id
int32
0
241k
repo
stringlengths
6
63
path
stringlengths
5
140
func_name
stringlengths
3
151
original_string
stringlengths
84
13k
language
stringclasses
1 value
code
stringlengths
84
13k
code_tokens
list
docstring
stringlengths
3
47.2k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
91
247
193,600
native5/native5-sdk-client-php
src/Native5/ConfigurationFactory.php
ConfigurationFactory.makeConfig
protected function makeConfig() { $this->_checkConfig(); // Construct the Configuration object if (empty($this->_configuration) || !($this->_configuration instanceof Configuration)) { $this->_configuration = new Configuration(trim($this->_config['app']['name'])); // Loca...
php
protected function makeConfig() { $this->_checkConfig(); // Construct the Configuration object if (empty($this->_configuration) || !($this->_configuration instanceof Configuration)) { $this->_configuration = new Configuration(trim($this->_config['app']['name'])); // Loca...
[ "protected", "function", "makeConfig", "(", ")", "{", "$", "this", "->", "_checkConfig", "(", ")", ";", "// Construct the Configuration object", "if", "(", "empty", "(", "$", "this", "->", "_configuration", ")", "||", "!", "(", "$", "this", "->", "_configura...
makeConfig Wrap the associative configuration array inside a Configuration class @access public @return void @note the ftp configuration should be of the following format: mixed[] $configuration { @type string "host" domain name or IP address of ftp host @type string "port" port where ftp service is running on the hos...
[ "makeConfig", "Wrap", "the", "associative", "configuration", "array", "inside", "a", "Configuration", "class" ]
e1f598cf27654d81bb5facace1990b737242a2f9
https://github.com/native5/native5-sdk-client-php/blob/e1f598cf27654d81bb5facace1990b737242a2f9/src/Native5/ConfigurationFactory.php#L58-L107
193,601
jabernardo/lollipop-php
Library/HTTP/Upload.php
Upload.store
public function store($dest_folder, Callable $modifyName = null) { if (!isset($_FILES[$this->_file])) { return false; } if (is_array($_FILES[$this->_file]['name'])) { // Multiple file uploads $count = count($_FILES[$this->_file]['name']); ...
php
public function store($dest_folder, Callable $modifyName = null) { if (!isset($_FILES[$this->_file])) { return false; } if (is_array($_FILES[$this->_file]['name'])) { // Multiple file uploads $count = count($_FILES[$this->_file]['name']); ...
[ "public", "function", "store", "(", "$", "dest_folder", ",", "Callable", "$", "modifyName", "=", "null", ")", "{", "if", "(", "!", "isset", "(", "$", "_FILES", "[", "$", "this", "->", "_file", "]", ")", ")", "{", "return", "false", ";", "}", "if", ...
Store temporary files to destination path of uploads @access public @param string $dest_folder Destination path @param Callable $modifyName Name modification callback @return mixed Returns `false` if upload fails. Returns `array` of stored and failed files for multiple file upload.
[ "Store", "temporary", "files", "to", "destination", "path", "of", "uploads" ]
004d80b21f7246bb3e08c7b9f74a165b0d3ca0f5
https://github.com/jabernardo/lollipop-php/blob/004d80b21f7246bb3e08c7b9f74a165b0d3ca0f5/Library/HTTP/Upload.php#L98-L133
193,602
g4code/buffer
src/Adapter/Base.php
Base.setSize
public function setSize($size = null) { $this->_size = is_int($size)? $size : self::DEFAULT_SIZE; }
php
public function setSize($size = null) { $this->_size = is_int($size)? $size : self::DEFAULT_SIZE; }
[ "public", "function", "setSize", "(", "$", "size", "=", "null", ")", "{", "$", "this", "->", "_size", "=", "is_int", "(", "$", "size", ")", "?", "$", "size", ":", "self", "::", "DEFAULT_SIZE", ";", "}" ]
Set buffer size @param int $size
[ "Set", "buffer", "size" ]
2f98fe8681f337095aac60542e31ca9034a795be
https://github.com/g4code/buffer/blob/2f98fe8681f337095aac60542e31ca9034a795be/src/Adapter/Base.php#L83-L85
193,603
nails/module-blog
blog/models/blog_tag_model.php
NAILS_Blog_tag_model.create
public function create($aData, $bReturnObject = false) { $aTagData = array(); // -------------------------------------------------------------------------- // Some basic sanity testing if (empty($aData['label'])) { $this->setError('"label" is a required field.'); ...
php
public function create($aData, $bReturnObject = false) { $aTagData = array(); // -------------------------------------------------------------------------- // Some basic sanity testing if (empty($aData['label'])) { $this->setError('"label" is a required field.'); ...
[ "public", "function", "create", "(", "$", "aData", ",", "$", "bReturnObject", "=", "false", ")", "{", "$", "aTagData", "=", "array", "(", ")", ";", "// --------------------------------------------------------------------------", "// Some basic sanity testing", "if", "(...
Creates a new tag @param array $aData The data to create the tag with @param boolean $bReturnObject Whether to return the full tag object (or just the ID) @return mixed
[ "Creates", "a", "new", "tag" ]
7b369c5209f4343fff7c7e2a22c237d5a95c8c24
https://github.com/nails/module-blog/blob/7b369c5209f4343fff7c7e2a22c237d5a95c8c24/blog/models/blog_tag_model.php#L74-L126
193,604
nails/module-blog
blog/models/blog_tag_model.php
NAILS_Blog_tag_model.update
public function update($iId, $aData) { $aTagData = array(); // -------------------------------------------------------------------------- // Some basic sanity testing if (empty($aData['label'])) { $this->setError('"label" is a required field.'); return fal...
php
public function update($iId, $aData) { $aTagData = array(); // -------------------------------------------------------------------------- // Some basic sanity testing if (empty($aData['label'])) { $this->setError('"label" is a required field.'); return fal...
[ "public", "function", "update", "(", "$", "iId", ",", "$", "aData", ")", "{", "$", "aTagData", "=", "array", "(", ")", ";", "// --------------------------------------------------------------------------", "// Some basic sanity testing", "if", "(", "empty", "(", "$", ...
Updates an existing tag @param integer $iId The tag's ID @param stdClass $aData The data to update the tag with @return boolean
[ "Updates", "an", "existing", "tag" ]
7b369c5209f4343fff7c7e2a22c237d5a95c8c24
https://github.com/nails/module-blog/blob/7b369c5209f4343fff7c7e2a22c237d5a95c8c24/blog/models/blog_tag_model.php#L136-L178
193,605
Kris-Kuiper/sFire-Framework
src/Entity/Traits/TimestampAwareTrait.php
TimestampAwareTrait.setCreatedAt
public function setCreatedAt($created_at) { $this -> created_at = $created_at !== null ? new \DateTime($created_at) : null; return $this; }
php
public function setCreatedAt($created_at) { $this -> created_at = $created_at !== null ? new \DateTime($created_at) : null; return $this; }
[ "public", "function", "setCreatedAt", "(", "$", "created_at", ")", "{", "$", "this", "->", "created_at", "=", "$", "created_at", "!==", "null", "?", "new", "\\", "DateTime", "(", "$", "created_at", ")", ":", "null", ";", "return", "$", "this", ";", "}"...
Sets the created at @param string $created_at @return TimestampAwareTrait
[ "Sets", "the", "created", "at" ]
deefe1d9d2b40e7326381e8dcd4f01f9aa61885c
https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Entity/Traits/TimestampAwareTrait.php#L92-L96
193,606
Kris-Kuiper/sFire-Framework
src/Entity/Traits/TimestampAwareTrait.php
TimestampAwareTrait.setCreatedOn
public function setCreatedOn($created_on) { $this -> created_on = $created_on !== null ? new \DateTime($created_on) : null; return $this; }
php
public function setCreatedOn($created_on) { $this -> created_on = $created_on !== null ? new \DateTime($created_on) : null; return $this; }
[ "public", "function", "setCreatedOn", "(", "$", "created_on", ")", "{", "$", "this", "->", "created_on", "=", "$", "created_on", "!==", "null", "?", "new", "\\", "DateTime", "(", "$", "created_on", ")", ":", "null", ";", "return", "$", "this", ";", "}"...
Sets the created on @param string $created_on @return TimestampAwareTrait
[ "Sets", "the", "created", "on" ]
deefe1d9d2b40e7326381e8dcd4f01f9aa61885c
https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Entity/Traits/TimestampAwareTrait.php#L113-L117
193,607
Kris-Kuiper/sFire-Framework
src/Entity/Traits/TimestampAwareTrait.php
TimestampAwareTrait.setUpdatedAt
public function setUpdatedAt($updated_at) { $this -> updated_at = $updated_at !== null ? new \DateTime($updated_at) : null; return $this; }
php
public function setUpdatedAt($updated_at) { $this -> updated_at = $updated_at !== null ? new \DateTime($updated_at) : null; return $this; }
[ "public", "function", "setUpdatedAt", "(", "$", "updated_at", ")", "{", "$", "this", "->", "updated_at", "=", "$", "updated_at", "!==", "null", "?", "new", "\\", "DateTime", "(", "$", "updated_at", ")", ":", "null", ";", "return", "$", "this", ";", "}"...
Sets the updated at @param string $updated_at @return TimestampAwareTrait
[ "Sets", "the", "updated", "at" ]
deefe1d9d2b40e7326381e8dcd4f01f9aa61885c
https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Entity/Traits/TimestampAwareTrait.php#L133-L137
193,608
Kris-Kuiper/sFire-Framework
src/Entity/Traits/TimestampAwareTrait.php
TimestampAwareTrait.setUpdatedOn
public function setUpdatedOn($updated_on) { $this -> updated_on = $updated_on !== null ? new \DateTime($updated_on) : null; return $this; }
php
public function setUpdatedOn($updated_on) { $this -> updated_on = $updated_on !== null ? new \DateTime($updated_on) : null; return $this; }
[ "public", "function", "setUpdatedOn", "(", "$", "updated_on", ")", "{", "$", "this", "->", "updated_on", "=", "$", "updated_on", "!==", "null", "?", "new", "\\", "DateTime", "(", "$", "updated_on", ")", ":", "null", ";", "return", "$", "this", ";", "}"...
Sets the updated on @param string $updated_on @return TimestampAwareTrait
[ "Sets", "the", "updated", "on" ]
deefe1d9d2b40e7326381e8dcd4f01f9aa61885c
https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Entity/Traits/TimestampAwareTrait.php#L153-L157
193,609
Kris-Kuiper/sFire-Framework
src/Entity/Traits/TimestampAwareTrait.php
TimestampAwareTrait.setEditedAt
public function setEditedAt($edited_at) { $this -> edited_at = $edited_at !== null ? new \DateTime($edited_at) : null; return $this; }
php
public function setEditedAt($edited_at) { $this -> edited_at = $edited_at !== null ? new \DateTime($edited_at) : null; return $this; }
[ "public", "function", "setEditedAt", "(", "$", "edited_at", ")", "{", "$", "this", "->", "edited_at", "=", "$", "edited_at", "!==", "null", "?", "new", "\\", "DateTime", "(", "$", "edited_at", ")", ":", "null", ";", "return", "$", "this", ";", "}" ]
Sets the edited at @param string $edited_at @return TimestampAwareTrait
[ "Sets", "the", "edited", "at" ]
deefe1d9d2b40e7326381e8dcd4f01f9aa61885c
https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Entity/Traits/TimestampAwareTrait.php#L173-L177
193,610
Kris-Kuiper/sFire-Framework
src/Entity/Traits/TimestampAwareTrait.php
TimestampAwareTrait.setEditedOn
public function setEditedOn($edited_on) { $this -> edited_on = $edited_on !== null ? new \DateTime($edited_on) : null; return $this; }
php
public function setEditedOn($edited_on) { $this -> edited_on = $edited_on !== null ? new \DateTime($edited_on) : null; return $this; }
[ "public", "function", "setEditedOn", "(", "$", "edited_on", ")", "{", "$", "this", "->", "edited_on", "=", "$", "edited_on", "!==", "null", "?", "new", "\\", "DateTime", "(", "$", "edited_on", ")", ":", "null", ";", "return", "$", "this", ";", "}" ]
Sets the edited on @param string $edited_on @return TimestampAwareTrait
[ "Sets", "the", "edited", "on" ]
deefe1d9d2b40e7326381e8dcd4f01f9aa61885c
https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Entity/Traits/TimestampAwareTrait.php#L193-L197
193,611
Kris-Kuiper/sFire-Framework
src/Entity/Traits/TimestampAwareTrait.php
TimestampAwareTrait.setDeletedAt
public function setDeletedAt($deleted_at) { $this -> deleted_at = $deleted_at !== null ? new \DateTime($deleted_at) : null; return $this; }
php
public function setDeletedAt($deleted_at) { $this -> deleted_at = $deleted_at !== null ? new \DateTime($deleted_at) : null; return $this; }
[ "public", "function", "setDeletedAt", "(", "$", "deleted_at", ")", "{", "$", "this", "->", "deleted_at", "=", "$", "deleted_at", "!==", "null", "?", "new", "\\", "DateTime", "(", "$", "deleted_at", ")", ":", "null", ";", "return", "$", "this", ";", "}"...
Sets the deleted at @param string $deleted_at @return TimestampAwareTrait
[ "Sets", "the", "deleted", "at" ]
deefe1d9d2b40e7326381e8dcd4f01f9aa61885c
https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Entity/Traits/TimestampAwareTrait.php#L213-L217
193,612
Kris-Kuiper/sFire-Framework
src/Entity/Traits/TimestampAwareTrait.php
TimestampAwareTrait.setDeletedOn
public function setDeletedOn($deleted_on) { $this -> deleted_on = $deleted_on !== null ? new \DateTime($deleted_on) : null; return $this; }
php
public function setDeletedOn($deleted_on) { $this -> deleted_on = $deleted_on !== null ? new \DateTime($deleted_on) : null; return $this; }
[ "public", "function", "setDeletedOn", "(", "$", "deleted_on", ")", "{", "$", "this", "->", "deleted_on", "=", "$", "deleted_on", "!==", "null", "?", "new", "\\", "DateTime", "(", "$", "deleted_on", ")", ":", "null", ";", "return", "$", "this", ";", "}"...
Sets the deleted on @param string $deleted_on @return TimestampAwareTrait
[ "Sets", "the", "deleted", "on" ]
deefe1d9d2b40e7326381e8dcd4f01f9aa61885c
https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Entity/Traits/TimestampAwareTrait.php#L233-L237
193,613
Kris-Kuiper/sFire-Framework
src/Entity/Traits/TimestampAwareTrait.php
TimestampAwareTrait.setActivatedAt
public function setActivatedAt($activated_at) { $this -> activated_at = $activated_at !== null ? new \DateTime($activated_at) : null; return $this; }
php
public function setActivatedAt($activated_at) { $this -> activated_at = $activated_at !== null ? new \DateTime($activated_at) : null; return $this; }
[ "public", "function", "setActivatedAt", "(", "$", "activated_at", ")", "{", "$", "this", "->", "activated_at", "=", "$", "activated_at", "!==", "null", "?", "new", "\\", "DateTime", "(", "$", "activated_at", ")", ":", "null", ";", "return", "$", "this", ...
Sets the activated_at @param string $activated at @return TimestampAwareTrait
[ "Sets", "the", "activated_at" ]
deefe1d9d2b40e7326381e8dcd4f01f9aa61885c
https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Entity/Traits/TimestampAwareTrait.php#L253-L257
193,614
Kris-Kuiper/sFire-Framework
src/Entity/Traits/TimestampAwareTrait.php
TimestampAwareTrait.setActivatedOn
public function setActivatedOn($activated_on) { $this -> activated_on = $activated_on !== null ? new \DateTime($activated_on) : null; return $this; }
php
public function setActivatedOn($activated_on) { $this -> activated_on = $activated_on !== null ? new \DateTime($activated_on) : null; return $this; }
[ "public", "function", "setActivatedOn", "(", "$", "activated_on", ")", "{", "$", "this", "->", "activated_on", "=", "$", "activated_on", "!==", "null", "?", "new", "\\", "DateTime", "(", "$", "activated_on", ")", ":", "null", ";", "return", "$", "this", ...
Sets the activated on @param string $activated_on @return TimestampAwareTrait
[ "Sets", "the", "activated", "on" ]
deefe1d9d2b40e7326381e8dcd4f01f9aa61885c
https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Entity/Traits/TimestampAwareTrait.php#L273-L277
193,615
Kris-Kuiper/sFire-Framework
src/Entity/Traits/TimestampAwareTrait.php
TimestampAwareTrait.setCompletedAt
public function setCompletedAt($completed_at) { $this -> completed_at = $completed_at !== null ? new \DateTime($completed_at) : null; return $this; }
php
public function setCompletedAt($completed_at) { $this -> completed_at = $completed_at !== null ? new \DateTime($completed_at) : null; return $this; }
[ "public", "function", "setCompletedAt", "(", "$", "completed_at", ")", "{", "$", "this", "->", "completed_at", "=", "$", "completed_at", "!==", "null", "?", "new", "\\", "DateTime", "(", "$", "completed_at", ")", ":", "null", ";", "return", "$", "this", ...
Sets the completed at @param string $completed_at @return TimestampAwareTrait
[ "Sets", "the", "completed", "at" ]
deefe1d9d2b40e7326381e8dcd4f01f9aa61885c
https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Entity/Traits/TimestampAwareTrait.php#L293-L297
193,616
Kris-Kuiper/sFire-Framework
src/Entity/Traits/TimestampAwareTrait.php
TimestampAwareTrait.setCompletedOn
public function setCompletedOn($completed_on) { $this -> completed_on = $completed_on !== null ? new \DateTime($completed_on) : null; return $this; }
php
public function setCompletedOn($completed_on) { $this -> completed_on = $completed_on !== null ? new \DateTime($completed_on) : null; return $this; }
[ "public", "function", "setCompletedOn", "(", "$", "completed_on", ")", "{", "$", "this", "->", "completed_on", "=", "$", "completed_on", "!==", "null", "?", "new", "\\", "DateTime", "(", "$", "completed_on", ")", ":", "null", ";", "return", "$", "this", ...
Sets the completed on @param string $completed_on @return TimestampAwareTrait
[ "Sets", "the", "completed", "on" ]
deefe1d9d2b40e7326381e8dcd4f01f9aa61885c
https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Entity/Traits/TimestampAwareTrait.php#L313-L317
193,617
perryflynn/PerrysLambda
src/PerrysLambda/ArrayBase.php
ArrayBase.newInstance
public function newInstance($data=null) { $class = $this->getClassName(); $conv = $this->newConverterInstance(); if(is_null($data)) { $data = array(); } if($conv instanceof IListConverter) { $data = $conv; } $o = new ...
php
public function newInstance($data=null) { $class = $this->getClassName(); $conv = $this->newConverterInstance(); if(is_null($data)) { $data = array(); } if($conv instanceof IListConverter) { $data = $conv; } $o = new ...
[ "public", "function", "newInstance", "(", "$", "data", "=", "null", ")", "{", "$", "class", "=", "$", "this", "->", "getClassName", "(", ")", ";", "$", "conv", "=", "$", "this", "->", "newConverterInstance", "(", ")", ";", "if", "(", "is_null", "(", ...
Creates new instance of current class type Expect a subclass of \PerrysLambda\ArrayBase @return \PerrysLambda\ArrayBase
[ "Creates", "new", "instance", "of", "current", "class", "type", "Expect", "a", "subclass", "of", "\\", "PerrysLambda", "\\", "ArrayBase" ]
9f1734ae4689d73278b887f9354dfd31428e96de
https://github.com/perryflynn/PerrysLambda/blob/9f1734ae4689d73278b887f9354dfd31428e96de/src/PerrysLambda/ArrayBase.php#L96-L118
193,618
perryflynn/PerrysLambda
src/PerrysLambda/ArrayBase.php
ArrayBase.applyDefaults
public function applyDefaults(array $defaults) { foreach($defaults as $dkey => $dvalue) { if(!$this->exists($dkey)) { $this[$dkey] = $dvalue; } } }
php
public function applyDefaults(array $defaults) { foreach($defaults as $dkey => $dvalue) { if(!$this->exists($dkey)) { $this[$dkey] = $dvalue; } } }
[ "public", "function", "applyDefaults", "(", "array", "$", "defaults", ")", "{", "foreach", "(", "$", "defaults", "as", "$", "dkey", "=>", "$", "dvalue", ")", "{", "if", "(", "!", "$", "this", "->", "exists", "(", "$", "dkey", ")", ")", "{", "$", ...
Applies given fields to this object if field does not exist @param array $defaults
[ "Applies", "given", "fields", "to", "this", "object", "if", "field", "does", "not", "exist" ]
9f1734ae4689d73278b887f9354dfd31428e96de
https://github.com/perryflynn/PerrysLambda/blob/9f1734ae4689d73278b887f9354dfd31428e96de/src/PerrysLambda/ArrayBase.php#L172-L181
193,619
perryflynn/PerrysLambda
src/PerrysLambda/ArrayBase.php
ArrayBase.regenerateKeyCache
protected function regenerateKeyCache() { if(is_array($this->__data)) { $i=0; $this->__keycache = array(); $this->__keycacheindex = array(); foreach($this->__data as $key => $value) { $this->__keycache[$key] = $i; ...
php
protected function regenerateKeyCache() { if(is_array($this->__data)) { $i=0; $this->__keycache = array(); $this->__keycacheindex = array(); foreach($this->__data as $key => $value) { $this->__keycache[$key] = $i; ...
[ "protected", "function", "regenerateKeyCache", "(", ")", "{", "if", "(", "is_array", "(", "$", "this", "->", "__data", ")", ")", "{", "$", "i", "=", "0", ";", "$", "this", "->", "__keycache", "=", "array", "(", ")", ";", "$", "this", "->", "__keyca...
Regenerate array key cache
[ "Regenerate", "array", "key", "cache" ]
9f1734ae4689d73278b887f9354dfd31428e96de
https://github.com/perryflynn/PerrysLambda/blob/9f1734ae4689d73278b887f9354dfd31428e96de/src/PerrysLambda/ArrayBase.php#L215-L236
193,620
perryflynn/PerrysLambda
src/PerrysLambda/ArrayBase.php
ArrayBase.getNames
public function getNames() { if($this->isKeycacheInvalid()) { $this->regenerateKeyCache(); } if(is_array($this->__keycacheindex)) { return $this->__keycacheindex; } return array(); }
php
public function getNames() { if($this->isKeycacheInvalid()) { $this->regenerateKeyCache(); } if(is_array($this->__keycacheindex)) { return $this->__keycacheindex; } return array(); }
[ "public", "function", "getNames", "(", ")", "{", "if", "(", "$", "this", "->", "isKeycacheInvalid", "(", ")", ")", "{", "$", "this", "->", "regenerateKeyCache", "(", ")", ";", "}", "if", "(", "is_array", "(", "$", "this", "->", "__keycacheindex", ")", ...
Get all field names @return array
[ "Get", "all", "field", "names" ]
9f1734ae4689d73278b887f9354dfd31428e96de
https://github.com/perryflynn/PerrysLambda/blob/9f1734ae4689d73278b887f9354dfd31428e96de/src/PerrysLambda/ArrayBase.php#L242-L253
193,621
perryflynn/PerrysLambda
src/PerrysLambda/ArrayBase.php
ArrayBase.getNameByValue
public function getNameByValue($value) { $i = array_search($value, $this->__data, true); if($i===false) { return null; } return $i; }
php
public function getNameByValue($value) { $i = array_search($value, $this->__data, true); if($i===false) { return null; } return $i; }
[ "public", "function", "getNameByValue", "(", "$", "value", ")", "{", "$", "i", "=", "array_search", "(", "$", "value", ",", "$", "this", "->", "__data", ",", "true", ")", ";", "if", "(", "$", "i", "===", "false", ")", "{", "return", "null", ";", ...
Get field name by its value NULL if not exist @param mixed $value @return mixed
[ "Get", "field", "name", "by", "its", "value", "NULL", "if", "not", "exist" ]
9f1734ae4689d73278b887f9354dfd31428e96de
https://github.com/perryflynn/PerrysLambda/blob/9f1734ae4689d73278b887f9354dfd31428e96de/src/PerrysLambda/ArrayBase.php#L285-L293
193,622
perryflynn/PerrysLambda
src/PerrysLambda/ArrayBase.php
ArrayBase.indexOfKey
public function indexOfKey($key) { if($this->isKeycacheInvalid()) { $this->regenerateKeyCache(); } if(isset($this->__keycache[$key])) { return $this->__keycache[$key]; } return -1; }
php
public function indexOfKey($key) { if($this->isKeycacheInvalid()) { $this->regenerateKeyCache(); } if(isset($this->__keycache[$key])) { return $this->__keycache[$key]; } return -1; }
[ "public", "function", "indexOfKey", "(", "$", "key", ")", "{", "if", "(", "$", "this", "->", "isKeycacheInvalid", "(", ")", ")", "{", "$", "this", "->", "regenerateKeyCache", "(", ")", ";", "}", "if", "(", "isset", "(", "$", "this", "->", "__keycache...
Index of key @param mixed $key @return int
[ "Index", "of", "key" ]
9f1734ae4689d73278b887f9354dfd31428e96de
https://github.com/perryflynn/PerrysLambda/blob/9f1734ae4689d73278b887f9354dfd31428e96de/src/PerrysLambda/ArrayBase.php#L300-L313
193,623
perryflynn/PerrysLambda
src/PerrysLambda/ArrayBase.php
ArrayBase.indexOfValue
public function indexOfValue($value) { $name = $this->getNameByValue($value); if(!is_null($name)) { return $this->indexOfKey($name); } return -1; }
php
public function indexOfValue($value) { $name = $this->getNameByValue($value); if(!is_null($name)) { return $this->indexOfKey($name); } return -1; }
[ "public", "function", "indexOfValue", "(", "$", "value", ")", "{", "$", "name", "=", "$", "this", "->", "getNameByValue", "(", "$", "value", ")", ";", "if", "(", "!", "is_null", "(", "$", "name", ")", ")", "{", "return", "$", "this", "->", "indexOf...
Index of element -1 = element not found @param mixed $value @return int
[ "Index", "of", "element", "-", "1", "=", "element", "not", "found" ]
9f1734ae4689d73278b887f9354dfd31428e96de
https://github.com/perryflynn/PerrysLambda/blob/9f1734ae4689d73278b887f9354dfd31428e96de/src/PerrysLambda/ArrayBase.php#L321-L329
193,624
perryflynn/PerrysLambda
src/PerrysLambda/ArrayBase.php
ArrayBase.&
public function &get($field, $default=null, $autoset=false) { if($this->exists($field)) { return $this->__data[$field]; } if($autoset===true) { $this->set($field, $default); return $this->get($field); } return $default; ...
php
public function &get($field, $default=null, $autoset=false) { if($this->exists($field)) { return $this->__data[$field]; } if($autoset===true) { $this->set($field, $default); return $this->get($field); } return $default; ...
[ "public", "function", "&", "get", "(", "$", "field", ",", "$", "default", "=", "null", ",", "$", "autoset", "=", "false", ")", "{", "if", "(", "$", "this", "->", "exists", "(", "$", "field", ")", ")", "{", "return", "$", "this", "->", "__data", ...
Get field by its name @param mixed $field @param mixed $default @param bool $autoset @return mixed
[ "Get", "field", "by", "its", "name" ]
9f1734ae4689d73278b887f9354dfd31428e96de
https://github.com/perryflynn/PerrysLambda/blob/9f1734ae4689d73278b887f9354dfd31428e96de/src/PerrysLambda/ArrayBase.php#L396-L408
193,625
perryflynn/PerrysLambda
src/PerrysLambda/ArrayBase.php
ArrayBase.getScalarAt
public function getScalarAt($i, $default=null) { $name = $this->getNameAt($i); if(!is_null($name)) { return $this->getScalar($name, $default); } return new ScalarProperty($default); }
php
public function getScalarAt($i, $default=null) { $name = $this->getNameAt($i); if(!is_null($name)) { return $this->getScalar($name, $default); } return new ScalarProperty($default); }
[ "public", "function", "getScalarAt", "(", "$", "i", ",", "$", "default", "=", "null", ")", "{", "$", "name", "=", "$", "this", "->", "getNameAt", "(", "$", "i", ")", ";", "if", "(", "!", "is_null", "(", "$", "name", ")", ")", "{", "return", "$"...
Get field value as scalar by index @param int $i @param mixed $default @return \PerrysLambda\ScalarProperty
[ "Get", "field", "value", "as", "scalar", "by", "index" ]
9f1734ae4689d73278b887f9354dfd31428e96de
https://github.com/perryflynn/PerrysLambda/blob/9f1734ae4689d73278b887f9354dfd31428e96de/src/PerrysLambda/ArrayBase.php#L416-L424
193,626
perryflynn/PerrysLambda
src/PerrysLambda/ArrayBase.php
ArrayBase.getScalar
public function getScalar($field, $default=null, $autoset=false) { $value = $this->get($field, $default, $autoset); return new ScalarProperty($value); }
php
public function getScalar($field, $default=null, $autoset=false) { $value = $this->get($field, $default, $autoset); return new ScalarProperty($value); }
[ "public", "function", "getScalar", "(", "$", "field", ",", "$", "default", "=", "null", ",", "$", "autoset", "=", "false", ")", "{", "$", "value", "=", "$", "this", "->", "get", "(", "$", "field", ",", "$", "default", ",", "$", "autoset", ")", ";...
Get field value as scalar by field name @param mixed $field @param mixed $default @param bool $autoset @return \PerrysLambda\ScalarProperty
[ "Get", "field", "value", "as", "scalar", "by", "field", "name" ]
9f1734ae4689d73278b887f9354dfd31428e96de
https://github.com/perryflynn/PerrysLambda/blob/9f1734ae4689d73278b887f9354dfd31428e96de/src/PerrysLambda/ArrayBase.php#L433-L437
193,627
perryflynn/PerrysLambda
src/PerrysLambda/ArrayBase.php
ArrayBase.removeAt
public function removeAt($i) { $field = $this->getNameAt($i); $this->removeKey($field); return $this; }
php
public function removeAt($i) { $field = $this->getNameAt($i); $this->removeKey($field); return $this; }
[ "public", "function", "removeAt", "(", "$", "i", ")", "{", "$", "field", "=", "$", "this", "->", "getNameAt", "(", "$", "i", ")", ";", "$", "this", "->", "removeKey", "(", "$", "field", ")", ";", "return", "$", "this", ";", "}" ]
Remove field by index @param int $i @return \PerrysLambda\ArrayList
[ "Remove", "field", "by", "index" ]
9f1734ae4689d73278b887f9354dfd31428e96de
https://github.com/perryflynn/PerrysLambda/blob/9f1734ae4689d73278b887f9354dfd31428e96de/src/PerrysLambda/ArrayBase.php#L523-L528
193,628
perryflynn/PerrysLambda
src/PerrysLambda/ArrayBase.php
ArrayBase.removeValue
public function removeValue($value) { $i = $this->getNameByValue($value); if($i>=0) { $this->removeKey($i); } return $this; }
php
public function removeValue($value) { $i = $this->getNameByValue($value); if($i>=0) { $this->removeKey($i); } return $this; }
[ "public", "function", "removeValue", "(", "$", "value", ")", "{", "$", "i", "=", "$", "this", "->", "getNameByValue", "(", "$", "value", ")", ";", "if", "(", "$", "i", ">=", "0", ")", "{", "$", "this", "->", "removeKey", "(", "$", "i", ")", ";"...
Remove field by its value @param mixed $value @return \PerrysLambda\ArrayList
[ "Remove", "field", "by", "its", "value" ]
9f1734ae4689d73278b887f9354dfd31428e96de
https://github.com/perryflynn/PerrysLambda/blob/9f1734ae4689d73278b887f9354dfd31428e96de/src/PerrysLambda/ArrayBase.php#L535-L543
193,629
perryflynn/PerrysLambda
src/PerrysLambda/ArrayBase.php
ArrayBase.removeKey
public function removeKey($field) { if($this->exists($field)) { unset($this->__data[$field]); $this->invalidateKeycache(); } return $this; }
php
public function removeKey($field) { if($this->exists($field)) { unset($this->__data[$field]); $this->invalidateKeycache(); } return $this; }
[ "public", "function", "removeKey", "(", "$", "field", ")", "{", "if", "(", "$", "this", "->", "exists", "(", "$", "field", ")", ")", "{", "unset", "(", "$", "this", "->", "__data", "[", "$", "field", "]", ")", ";", "$", "this", "->", "invalidateK...
Remove field by name @param mixed $field @return \PerrysLambda\ArrayList
[ "Remove", "field", "by", "name" ]
9f1734ae4689d73278b887f9354dfd31428e96de
https://github.com/perryflynn/PerrysLambda/blob/9f1734ae4689d73278b887f9354dfd31428e96de/src/PerrysLambda/ArrayBase.php#L550-L558
193,630
perryflynn/PerrysLambda
src/PerrysLambda/ArrayBase.php
ArrayBase.getIsAllKeysValid
public function getIsAllKeysValid(array $data) { $keys = array_keys($data); foreach($keys as $key) { if(!$this->getIsValidKey($key)) { return false; } } return true; }
php
public function getIsAllKeysValid(array $data) { $keys = array_keys($data); foreach($keys as $key) { if(!$this->getIsValidKey($key)) { return false; } } return true; }
[ "public", "function", "getIsAllKeysValid", "(", "array", "$", "data", ")", "{", "$", "keys", "=", "array_keys", "(", "$", "data", ")", ";", "foreach", "(", "$", "keys", "as", "$", "key", ")", "{", "if", "(", "!", "$", "this", "->", "getIsValidKey", ...
Validate all field keys @param array $data @return boolean
[ "Validate", "all", "field", "keys" ]
9f1734ae4689d73278b887f9354dfd31428e96de
https://github.com/perryflynn/PerrysLambda/blob/9f1734ae4689d73278b887f9354dfd31428e96de/src/PerrysLambda/ArrayBase.php#L565-L576
193,631
perryflynn/PerrysLambda
src/PerrysLambda/ArrayBase.php
ArrayBase.getIsAllValuesValid
public function getIsAllValuesValid(array $data) { foreach($data as $value) { if(!$this->getIsValidValue($value)) { return false; } } return true; }
php
public function getIsAllValuesValid(array $data) { foreach($data as $value) { if(!$this->getIsValidValue($value)) { return false; } } return true; }
[ "public", "function", "getIsAllValuesValid", "(", "array", "$", "data", ")", "{", "foreach", "(", "$", "data", "as", "$", "value", ")", "{", "if", "(", "!", "$", "this", "->", "getIsValidValue", "(", "$", "value", ")", ")", "{", "return", "false", ";...
Validate all field values @param array $data @return boolean
[ "Validate", "all", "field", "values" ]
9f1734ae4689d73278b887f9354dfd31428e96de
https://github.com/perryflynn/PerrysLambda/blob/9f1734ae4689d73278b887f9354dfd31428e96de/src/PerrysLambda/ArrayBase.php#L583-L593
193,632
perryflynn/PerrysLambda
src/PerrysLambda/ArrayBase.php
ArrayBase.where
public function where($where) { $where = LambdaUtils::toConditionCallable($where); $collection = $this->newInstance(); foreach($this as $record) { if(call_user_func($where, $record)) { $collection->add($record); } } ...
php
public function where($where) { $where = LambdaUtils::toConditionCallable($where); $collection = $this->newInstance(); foreach($this as $record) { if(call_user_func($where, $record)) { $collection->add($record); } } ...
[ "public", "function", "where", "(", "$", "where", ")", "{", "$", "where", "=", "LambdaUtils", "::", "toConditionCallable", "(", "$", "where", ")", ";", "$", "collection", "=", "$", "this", "->", "newInstance", "(", ")", ";", "foreach", "(", "$", "this"...
filter by condition @param callable|array $where @return \PerrysLambda\ArrayList
[ "filter", "by", "condition" ]
9f1734ae4689d73278b887f9354dfd31428e96de
https://github.com/perryflynn/PerrysLambda/blob/9f1734ae4689d73278b887f9354dfd31428e96de/src/PerrysLambda/ArrayBase.php#L618-L630
193,633
perryflynn/PerrysLambda
src/PerrysLambda/ArrayBase.php
ArrayBase.whereFirst
public function whereFirst($where) { $where = LambdaUtils::toConditionCallable($where); foreach($this as $record) { if(call_user_func($where, $record)) { return $record; } } throw new \OutOfBoundsException(); }
php
public function whereFirst($where) { $where = LambdaUtils::toConditionCallable($where); foreach($this as $record) { if(call_user_func($where, $record)) { return $record; } } throw new \OutOfBoundsException(); }
[ "public", "function", "whereFirst", "(", "$", "where", ")", "{", "$", "where", "=", "LambdaUtils", "::", "toConditionCallable", "(", "$", "where", ")", ";", "foreach", "(", "$", "this", "as", "$", "record", ")", "{", "if", "(", "call_user_func", "(", "...
Get first item matching to callable @param callable|array $where @return mixed @throws \OutOfBoundsException
[ "Get", "first", "item", "matching", "to", "callable" ]
9f1734ae4689d73278b887f9354dfd31428e96de
https://github.com/perryflynn/PerrysLambda/blob/9f1734ae4689d73278b887f9354dfd31428e96de/src/PerrysLambda/ArrayBase.php#L638-L649
193,634
perryflynn/PerrysLambda
src/PerrysLambda/ArrayBase.php
ArrayBase.whereFirstOrDefault
public function whereFirstOrDefault($where, $default=null) { $where = LambdaUtils::toConditionCallable($where); foreach($this as $record) { if(call_user_func($where, $record)) { return $record; } } return $default; }
php
public function whereFirstOrDefault($where, $default=null) { $where = LambdaUtils::toConditionCallable($where); foreach($this as $record) { if(call_user_func($where, $record)) { return $record; } } return $default; }
[ "public", "function", "whereFirstOrDefault", "(", "$", "where", ",", "$", "default", "=", "null", ")", "{", "$", "where", "=", "LambdaUtils", "::", "toConditionCallable", "(", "$", "where", ")", ";", "foreach", "(", "$", "this", "as", "$", "record", ")",...
Get first item matching to callable or default @param callable|array $where @param mixed $default @return mixed
[ "Get", "first", "item", "matching", "to", "callable", "or", "default" ]
9f1734ae4689d73278b887f9354dfd31428e96de
https://github.com/perryflynn/PerrysLambda/blob/9f1734ae4689d73278b887f9354dfd31428e96de/src/PerrysLambda/ArrayBase.php#L657-L668
193,635
perryflynn/PerrysLambda
src/PerrysLambda/ArrayBase.php
ArrayBase.groupBy
public function groupBy($group=null) { $group = LambdaUtils::toSelectCallable($group); $result = new ObjectArray(array()); if($this instanceof ObjectArray) { $result = $this->newInstance(); } foreach($this as $record) { $key = call_us...
php
public function groupBy($group=null) { $group = LambdaUtils::toSelectCallable($group); $result = new ObjectArray(array()); if($this instanceof ObjectArray) { $result = $this->newInstance(); } foreach($this as $record) { $key = call_us...
[ "public", "function", "groupBy", "(", "$", "group", "=", "null", ")", "{", "$", "group", "=", "LambdaUtils", "::", "toSelectCallable", "(", "$", "group", ")", ";", "$", "result", "=", "new", "ObjectArray", "(", "array", "(", ")", ")", ";", "if", "(",...
Group fields by condition @param callable|string|null $group @return \PerrysLambda\ArrayBase
[ "Group", "fields", "by", "condition" ]
9f1734ae4689d73278b887f9354dfd31428e96de
https://github.com/perryflynn/PerrysLambda/blob/9f1734ae4689d73278b887f9354dfd31428e96de/src/PerrysLambda/ArrayBase.php#L675-L700
193,636
perryflynn/PerrysLambda
src/PerrysLambda/ArrayBase.php
ArrayBase.distinct
public function distinct($distinct=null) { $distinct = LambdaUtils::toSelectCallable($distinct); $keys = array(); $collection = $this->newInstance(); foreach($this as $record) { $value = call_user_func($distinct, $record); $hash = md5(json_encode($val...
php
public function distinct($distinct=null) { $distinct = LambdaUtils::toSelectCallable($distinct); $keys = array(); $collection = $this->newInstance(); foreach($this as $record) { $value = call_user_func($distinct, $record); $hash = md5(json_encode($val...
[ "public", "function", "distinct", "(", "$", "distinct", "=", "null", ")", "{", "$", "distinct", "=", "LambdaUtils", "::", "toSelectCallable", "(", "$", "distinct", ")", ";", "$", "keys", "=", "array", "(", ")", ";", "$", "collection", "=", "$", "this",...
filter duplicate field by condition @param callable|string|null $distinct @return \PerrysLambda\ArrayBase
[ "filter", "duplicate", "field", "by", "condition" ]
9f1734ae4689d73278b887f9354dfd31428e96de
https://github.com/perryflynn/PerrysLambda/blob/9f1734ae4689d73278b887f9354dfd31428e96de/src/PerrysLambda/ArrayBase.php#L707-L724
193,637
perryflynn/PerrysLambda
src/PerrysLambda/ArrayBase.php
ArrayBase.intersect
public function intersect(ArrayBase $comparedata) { $cmpvalue = function($v1, $v2) { return $v1==$v2 ? 0 : ($v1>$v2 ? 1 : -1); }; $collection = $this->newInstance(); $temp = array_uintersect($this->getData(), $comparedata->getData(), $cmpvalue); $collection->setData($temp); ...
php
public function intersect(ArrayBase $comparedata) { $cmpvalue = function($v1, $v2) { return $v1==$v2 ? 0 : ($v1>$v2 ? 1 : -1); }; $collection = $this->newInstance(); $temp = array_uintersect($this->getData(), $comparedata->getData(), $cmpvalue); $collection->setData($temp); ...
[ "public", "function", "intersect", "(", "ArrayBase", "$", "comparedata", ")", "{", "$", "cmpvalue", "=", "function", "(", "$", "v1", ",", "$", "v2", ")", "{", "return", "$", "v1", "==", "$", "v2", "?", "0", ":", "(", "$", "v1", ">", "$", "v2", ...
Intersection to another object @param \PerrysLambda\ArrayBase $comparedata @return \PerrysLambda\ArrayBase
[ "Intersection", "to", "another", "object" ]
9f1734ae4689d73278b887f9354dfd31428e96de
https://github.com/perryflynn/PerrysLambda/blob/9f1734ae4689d73278b887f9354dfd31428e96de/src/PerrysLambda/ArrayBase.php#L731-L741
193,638
perryflynn/PerrysLambda
src/PerrysLambda/ArrayBase.php
ArrayBase.except
public function except(ArrayBase $comparedata) { $cmpvalue = function($v1, $v2) { return $v1==$v2 ? 0 : ($v1>$v2 ? 1 : -1); }; $collection = $this->newInstance(); $temp1 = array_udiff($this->getData(), $comparedata->getData(), $cmpvalue); $temp2 = array_udiff($comparedata->getData()...
php
public function except(ArrayBase $comparedata) { $cmpvalue = function($v1, $v2) { return $v1==$v2 ? 0 : ($v1>$v2 ? 1 : -1); }; $collection = $this->newInstance(); $temp1 = array_udiff($this->getData(), $comparedata->getData(), $cmpvalue); $temp2 = array_udiff($comparedata->getData()...
[ "public", "function", "except", "(", "ArrayBase", "$", "comparedata", ")", "{", "$", "cmpvalue", "=", "function", "(", "$", "v1", ",", "$", "v2", ")", "{", "return", "$", "v1", "==", "$", "v2", "?", "0", ":", "(", "$", "v1", ">", "$", "v2", "?"...
Difference to another object @param \PerrysLambda\ArrayBase $comparedata @return \PerrysLambda\ArrayBase
[ "Difference", "to", "another", "object" ]
9f1734ae4689d73278b887f9354dfd31428e96de
https://github.com/perryflynn/PerrysLambda/blob/9f1734ae4689d73278b887f9354dfd31428e96de/src/PerrysLambda/ArrayBase.php#L748-L761
193,639
perryflynn/PerrysLambda
src/PerrysLambda/ArrayBase.php
ArrayBase.all
public function all($where) { $where = LambdaUtils::toConditionCallable($where); foreach($this as $record) { if(!call_user_func($where, $record)) { return false; } } return true; }
php
public function all($where) { $where = LambdaUtils::toConditionCallable($where); foreach($this as $record) { if(!call_user_func($where, $record)) { return false; } } return true; }
[ "public", "function", "all", "(", "$", "where", ")", "{", "$", "where", "=", "LambdaUtils", "::", "toConditionCallable", "(", "$", "where", ")", ";", "foreach", "(", "$", "this", "as", "$", "record", ")", "{", "if", "(", "!", "call_user_func", "(", "...
Check for all fields by condition @param callable|array $where @return bool
[ "Check", "for", "all", "fields", "by", "condition" ]
9f1734ae4689d73278b887f9354dfd31428e96de
https://github.com/perryflynn/PerrysLambda/blob/9f1734ae4689d73278b887f9354dfd31428e96de/src/PerrysLambda/ArrayBase.php#L786-L797
193,640
perryflynn/PerrysLambda
src/PerrysLambda/ArrayBase.php
ArrayBase.selectMany
public function selectMany($select=null) { $select = LambdaUtils::toSelectCallable($select); $result = array(); foreach($this as $key => $record) { $temp = call_user_func($select, $record, $key); if(is_array($temp) || $temp instanceof \Iterator) {...
php
public function selectMany($select=null) { $select = LambdaUtils::toSelectCallable($select); $result = array(); foreach($this as $key => $record) { $temp = call_user_func($select, $record, $key); if(is_array($temp) || $temp instanceof \Iterator) {...
[ "public", "function", "selectMany", "(", "$", "select", "=", "null", ")", "{", "$", "select", "=", "LambdaUtils", "::", "toSelectCallable", "(", "$", "select", ")", ";", "$", "result", "=", "array", "(", ")", ";", "foreach", "(", "$", "this", "as", "...
Select a field and merge all arrays into one @param callable|string|null $select @return \PerrysLambda\ArrayList
[ "Select", "a", "field", "and", "merge", "all", "arrays", "into", "one" ]
9f1734ae4689d73278b887f9354dfd31428e96de
https://github.com/perryflynn/PerrysLambda/blob/9f1734ae4689d73278b887f9354dfd31428e96de/src/PerrysLambda/ArrayBase.php#L821-L842
193,641
perryflynn/PerrysLambda
src/PerrysLambda/ArrayBase.php
ArrayBase.each
public function each(callable $each) { foreach($this->__data as $key => &$record) { call_user_func_array($each, array(&$record, $key)); } unset($record); return $this; }
php
public function each(callable $each) { foreach($this->__data as $key => &$record) { call_user_func_array($each, array(&$record, $key)); } unset($record); return $this; }
[ "public", "function", "each", "(", "callable", "$", "each", ")", "{", "foreach", "(", "$", "this", "->", "__data", "as", "$", "key", "=>", "&", "$", "record", ")", "{", "call_user_func_array", "(", "$", "each", ",", "array", "(", "&", "$", "record", ...
Iterate all fields @param callable $each @return \PerrysLambda\ArrayList
[ "Iterate", "all", "fields" ]
9f1734ae4689d73278b887f9354dfd31428e96de
https://github.com/perryflynn/PerrysLambda/blob/9f1734ae4689d73278b887f9354dfd31428e96de/src/PerrysLambda/ArrayBase.php#L849-L857
193,642
perryflynn/PerrysLambda
src/PerrysLambda/ArrayBase.php
ArrayBase.sum
public function sum($sum=null) { $sum = LambdaUtils::toSelectCallable($sum); $temp = $this->select($sum)->toArray(); return array_sum($temp); }
php
public function sum($sum=null) { $sum = LambdaUtils::toSelectCallable($sum); $temp = $this->select($sum)->toArray(); return array_sum($temp); }
[ "public", "function", "sum", "(", "$", "sum", "=", "null", ")", "{", "$", "sum", "=", "LambdaUtils", "::", "toSelectCallable", "(", "$", "sum", ")", ";", "$", "temp", "=", "$", "this", "->", "select", "(", "$", "sum", ")", "->", "toArray", "(", "...
Calculates the sum of values from given expression @param callable|string|null $sum @return numeric
[ "Calculates", "the", "sum", "of", "values", "from", "given", "expression" ]
9f1734ae4689d73278b887f9354dfd31428e96de
https://github.com/perryflynn/PerrysLambda/blob/9f1734ae4689d73278b887f9354dfd31428e96de/src/PerrysLambda/ArrayBase.php#L864-L869
193,643
perryflynn/PerrysLambda
src/PerrysLambda/ArrayBase.php
ArrayBase.min
public function min($min=null) { $min = LambdaUtils::toSelectCallable($min); $temp = $this->select($min)->toArray(); return min($temp); }
php
public function min($min=null) { $min = LambdaUtils::toSelectCallable($min); $temp = $this->select($min)->toArray(); return min($temp); }
[ "public", "function", "min", "(", "$", "min", "=", "null", ")", "{", "$", "min", "=", "LambdaUtils", "::", "toSelectCallable", "(", "$", "min", ")", ";", "$", "temp", "=", "$", "this", "->", "select", "(", "$", "min", ")", "->", "toArray", "(", "...
Find the lowest value from given expression @param callable|string|null $min @return numeric
[ "Find", "the", "lowest", "value", "from", "given", "expression" ]
9f1734ae4689d73278b887f9354dfd31428e96de
https://github.com/perryflynn/PerrysLambda/blob/9f1734ae4689d73278b887f9354dfd31428e96de/src/PerrysLambda/ArrayBase.php#L876-L881
193,644
perryflynn/PerrysLambda
src/PerrysLambda/ArrayBase.php
ArrayBase.max
public function max($max=null) { $max = LambdaUtils::toSelectCallable($max); $temp = $this->select($max)->toArray(); return max($temp); }
php
public function max($max=null) { $max = LambdaUtils::toSelectCallable($max); $temp = $this->select($max)->toArray(); return max($temp); }
[ "public", "function", "max", "(", "$", "max", "=", "null", ")", "{", "$", "max", "=", "LambdaUtils", "::", "toSelectCallable", "(", "$", "max", ")", ";", "$", "temp", "=", "$", "this", "->", "select", "(", "$", "max", ")", "->", "toArray", "(", "...
Find the biggest value from given expression @param callable|string|null $max @return numeric
[ "Find", "the", "biggest", "value", "from", "given", "expression" ]
9f1734ae4689d73278b887f9354dfd31428e96de
https://github.com/perryflynn/PerrysLambda/blob/9f1734ae4689d73278b887f9354dfd31428e96de/src/PerrysLambda/ArrayBase.php#L888-L893
193,645
perryflynn/PerrysLambda
src/PerrysLambda/ArrayBase.php
ArrayBase.avg
public function avg($avg=null) { $avg = LambdaUtils::toSelectCallable($avg); return ($this->sum($avg)/$this->length()); }
php
public function avg($avg=null) { $avg = LambdaUtils::toSelectCallable($avg); return ($this->sum($avg)/$this->length()); }
[ "public", "function", "avg", "(", "$", "avg", "=", "null", ")", "{", "$", "avg", "=", "LambdaUtils", "::", "toSelectCallable", "(", "$", "avg", ")", ";", "return", "(", "$", "this", "->", "sum", "(", "$", "avg", ")", "/", "$", "this", "->", "leng...
Find the average of the values from given expression @param callable|string|null $avg @return numeric
[ "Find", "the", "average", "of", "the", "values", "from", "given", "expression" ]
9f1734ae4689d73278b887f9354dfd31428e96de
https://github.com/perryflynn/PerrysLambda/blob/9f1734ae4689d73278b887f9354dfd31428e96de/src/PerrysLambda/ArrayBase.php#L900-L904
193,646
perryflynn/PerrysLambda
src/PerrysLambda/ArrayBase.php
ArrayBase.joinString
public function joinString($join=null, $glue=", ") { $join = LambdaUtils::toSelectCallable($join); $temp = $this->select($join)->toArray(); return implode($glue, $temp); }
php
public function joinString($join=null, $glue=", ") { $join = LambdaUtils::toSelectCallable($join); $temp = $this->select($join)->toArray(); return implode($glue, $temp); }
[ "public", "function", "joinString", "(", "$", "join", "=", "null", ",", "$", "glue", "=", "\", \"", ")", "{", "$", "join", "=", "LambdaUtils", "::", "toSelectCallable", "(", "$", "join", ")", ";", "$", "temp", "=", "$", "this", "->", "select", "(", ...
Join values from expression to one string @param callable|string|null $join @param string $glue @return string
[ "Join", "values", "from", "expression", "to", "one", "string" ]
9f1734ae4689d73278b887f9354dfd31428e96de
https://github.com/perryflynn/PerrysLambda/blob/9f1734ae4689d73278b887f9354dfd31428e96de/src/PerrysLambda/ArrayBase.php#L912-L917
193,647
perryflynn/PerrysLambda
src/PerrysLambda/ArrayBase.php
ArrayBase.take
public function take($length) { if(!is_int($length)) { throw new \InvalidArgumentException(); } if($length>=0 && $length>$this->length()) { $length = $this->length(); } elseif($length<0 && $length<(0-$this->length())) { ...
php
public function take($length) { if(!is_int($length)) { throw new \InvalidArgumentException(); } if($length>=0 && $length>$this->length()) { $length = $this->length(); } elseif($length<0 && $length<(0-$this->length())) { ...
[ "public", "function", "take", "(", "$", "length", ")", "{", "if", "(", "!", "is_int", "(", "$", "length", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", ")", ";", "}", "if", "(", "$", "length", ">=", "0", "&&", "$", "length",...
Take first x fields @param int $length @return \PerrysLambda\ArrayList
[ "Take", "first", "x", "fields" ]
9f1734ae4689d73278b887f9354dfd31428e96de
https://github.com/perryflynn/PerrysLambda/blob/9f1734ae4689d73278b887f9354dfd31428e96de/src/PerrysLambda/ArrayBase.php#L1010-L1038
193,648
perryflynn/PerrysLambda
src/PerrysLambda/ArrayBase.php
ArrayBase.skip
public function skip($offset) { if(!is_int($offset)) { throw new \InvalidArgumentException(); } if($offset<0 || $offset>=$this->length()) { throw new \OutOfBoundsException(); } $temp = $this->newInstance(); $temp->setData(arra...
php
public function skip($offset) { if(!is_int($offset)) { throw new \InvalidArgumentException(); } if($offset<0 || $offset>=$this->length()) { throw new \OutOfBoundsException(); } $temp = $this->newInstance(); $temp->setData(arra...
[ "public", "function", "skip", "(", "$", "offset", ")", "{", "if", "(", "!", "is_int", "(", "$", "offset", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", ")", ";", "}", "if", "(", "$", "offset", "<", "0", "||", "$", "offset", ...
Skip x fields @param type $offset @return \PerrysLambda\ArrayList
[ "Skip", "x", "fields" ]
9f1734ae4689d73278b887f9354dfd31428e96de
https://github.com/perryflynn/PerrysLambda/blob/9f1734ae4689d73278b887f9354dfd31428e96de/src/PerrysLambda/ArrayBase.php#L1045-L1060
193,649
CrunchPHP/fastcgi
src/Client/Client.php
Client.newRequest
public function newRequest(RequestParametersInterface $parameters = null, ReaderInterface $stdin = null) { return new Request(Role::responder(), $this->nextRequestId++, true, $parameters, $stdin); }
php
public function newRequest(RequestParametersInterface $parameters = null, ReaderInterface $stdin = null) { return new Request(Role::responder(), $this->nextRequestId++, true, $parameters, $stdin); }
[ "public", "function", "newRequest", "(", "RequestParametersInterface", "$", "parameters", "=", "null", ",", "ReaderInterface", "$", "stdin", "=", "null", ")", "{", "return", "new", "Request", "(", "Role", "::", "responder", "(", ")", ",", "$", "this", "->", ...
Creates a new responder request. Although you can create a Request instance manually it is highly recommended to use this factory method, because only this one ensures, that the request uses a previously unused request id. @param RequestParametersInterface|null $parameters @param ReaderInterface|null $stdi...
[ "Creates", "a", "new", "responder", "request", "." ]
102437193e67e5a841ec5a897549ec345788d1bd
https://github.com/CrunchPHP/fastcgi/blob/102437193e67e5a841ec5a897549ec345788d1bd/src/Client/Client.php#L60-L63
193,650
dmt-software/auth-middleware
src/Authorization/ApiToken.php
ApiToken.handle
public function handle(RequestInterface $request): RequestInterface { if ($this->token === '' || $this->key === '') { throw new AuthorizationException('Could not create api token, missing or empty arguments'); } return $request->withHeader($this->key, $this->token); }
php
public function handle(RequestInterface $request): RequestInterface { if ($this->token === '' || $this->key === '') { throw new AuthorizationException('Could not create api token, missing or empty arguments'); } return $request->withHeader($this->key, $this->token); }
[ "public", "function", "handle", "(", "RequestInterface", "$", "request", ")", ":", "RequestInterface", "{", "if", "(", "$", "this", "->", "token", "===", "''", "||", "$", "this", "->", "key", "===", "''", ")", "{", "throw", "new", "AuthorizationException",...
Get a request with the headers associated with the authorization. @param RequestInterface $request @return RequestInterface
[ "Get", "a", "request", "with", "the", "headers", "associated", "with", "the", "authorization", "." ]
7a4633224944567c1e2ce63189f40a69acf221a6
https://github.com/dmt-software/auth-middleware/blob/7a4633224944567c1e2ce63189f40a69acf221a6/src/Authorization/ApiToken.php#L49-L55
193,651
net-tools/core
src/Helpers/SecureRequestHelper.php
SecureRequestHelper.getCSRFCookie
public function getCSRFCookie() { $cookie = $this->_browserInterface->getCookie($this->_csrf_cookiename); if ( !$cookie ) throw new SecureRequestHelper\CSRFException('CSRF cookie has not been initialized'); return $cookie; }
php
public function getCSRFCookie() { $cookie = $this->_browserInterface->getCookie($this->_csrf_cookiename); if ( !$cookie ) throw new SecureRequestHelper\CSRFException('CSRF cookie has not been initialized'); return $cookie; }
[ "public", "function", "getCSRFCookie", "(", ")", "{", "$", "cookie", "=", "$", "this", "->", "_browserInterface", "->", "getCookie", "(", "$", "this", "->", "_csrf_cookiename", ")", ";", "if", "(", "!", "$", "cookie", ")", "throw", "new", "SecureRequestHel...
Get CSRF cookie value @return string @throws SecureRequestHelper\CSRFException Thrown if the CSRF layer has not been initialized
[ "Get", "CSRF", "cookie", "value" ]
51446641cee22c0cf53d2b409c76cc8bd1a187e7
https://github.com/net-tools/core/blob/51446641cee22c0cf53d2b409c76cc8bd1a187e7/src/Helpers/SecureRequestHelper.php#L77-L84
193,652
fridge-project/dbal
src/Fridge/DBAL/Driver/Statement/MysqliStatement.php
MysqliStatement.getMappedType
private static function getMappedType($type) { if (!isset(self::$mappedTypes[$type])) { throw MysqliException::mappedTypeDoesNotExist($type); } return self::$mappedTypes[$type]; }
php
private static function getMappedType($type) { if (!isset(self::$mappedTypes[$type])) { throw MysqliException::mappedTypeDoesNotExist($type); } return self::$mappedTypes[$type]; }
[ "private", "static", "function", "getMappedType", "(", "$", "type", ")", "{", "if", "(", "!", "isset", "(", "self", "::", "$", "mappedTypes", "[", "$", "type", "]", ")", ")", "{", "throw", "MysqliException", "::", "mappedTypeDoesNotExist", "(", "$", "typ...
Gets the mapped type. @param integer $type The type (\PDO::PARAM_*). @throws \Fridge\DBAL\Exception\MysqliException If the mapped type does not exist. @return string The mapped type.
[ "Gets", "the", "mapped", "type", "." ]
d0b8c3551922d696836487aa0eb1bd74014edcd4
https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Driver/Statement/MysqliStatement.php#L302-L309
193,653
fridge-project/dbal
src/Fridge/DBAL/Driver/Statement/MysqliStatement.php
MysqliStatement.bindValues
private function bindValues(array $values) { $this->bindedParameters = array(); $this->bindedTypes = array(); $this->bindedValues = array(); foreach ($values as $parameter => $value) { if (is_int($parameter)) { $parameter++; } $th...
php
private function bindValues(array $values) { $this->bindedParameters = array(); $this->bindedTypes = array(); $this->bindedValues = array(); foreach ($values as $parameter => $value) { if (is_int($parameter)) { $parameter++; } $th...
[ "private", "function", "bindValues", "(", "array", "$", "values", ")", "{", "$", "this", "->", "bindedParameters", "=", "array", "(", ")", ";", "$", "this", "->", "bindedTypes", "=", "array", "(", ")", ";", "$", "this", "->", "bindedValues", "=", "arra...
Binds values on the statement. @param array $values Associative array describing parameter => value pairs.
[ "Binds", "values", "on", "the", "statement", "." ]
d0b8c3551922d696836487aa0eb1bd74014edcd4
https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Driver/Statement/MysqliStatement.php#L316-L329
193,654
fridge-project/dbal
src/Fridge/DBAL/Driver/Statement/MysqliStatement.php
MysqliStatement.bindParameters
private function bindParameters() { $bindedParameterReferences = array(implode('', $this->bindedTypes)); $lobParameters = array(); $null = null; foreach ($this->bindedParameters as $key => &$parameter) { if (isset($this->bindedTypes[$key - 1]) && ($this->...
php
private function bindParameters() { $bindedParameterReferences = array(implode('', $this->bindedTypes)); $lobParameters = array(); $null = null; foreach ($this->bindedParameters as $key => &$parameter) { if (isset($this->bindedTypes[$key - 1]) && ($this->...
[ "private", "function", "bindParameters", "(", ")", "{", "$", "bindedParameterReferences", "=", "array", "(", "implode", "(", "''", ",", "$", "this", "->", "bindedTypes", ")", ")", ";", "$", "lobParameters", "=", "array", "(", ")", ";", "$", "null", "=", ...
Binds the parameters on the driver statement.
[ "Binds", "the", "parameters", "on", "the", "driver", "statement", "." ]
d0b8c3551922d696836487aa0eb1bd74014edcd4
https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Driver/Statement/MysqliStatement.php#L334-L362
193,655
fridge-project/dbal
src/Fridge/DBAL/Driver/Statement/MysqliStatement.php
MysqliStatement.bindResultFields
private function bindResultFields() { $resultMetadata = $this->mysqliStatement->result_metadata(); if ($resultMetadata !== false) { $this->resultFields = array(); foreach ($resultMetadata->fetch_fields() as $field) { $this->resultFields[] = $field->name; ...
php
private function bindResultFields() { $resultMetadata = $this->mysqliStatement->result_metadata(); if ($resultMetadata !== false) { $this->resultFields = array(); foreach ($resultMetadata->fetch_fields() as $field) { $this->resultFields[] = $field->name; ...
[ "private", "function", "bindResultFields", "(", ")", "{", "$", "resultMetadata", "=", "$", "this", "->", "mysqliStatement", "->", "result_metadata", "(", ")", ";", "if", "(", "$", "resultMetadata", "!==", "false", ")", "{", "$", "this", "->", "resultFields",...
Binds the driver result fields.
[ "Binds", "the", "driver", "result", "fields", "." ]
d0b8c3551922d696836487aa0eb1bd74014edcd4
https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Driver/Statement/MysqliStatement.php#L367-L380
193,656
fridge-project/dbal
src/Fridge/DBAL/Driver/Statement/MysqliStatement.php
MysqliStatement.bindResult
private function bindResult() { $this->result = array_fill(0, count($this->resultFields), null); $resultReferences = array(); foreach ($this->result as $key => &$result) { $resultReferences[$key] = &$result; } call_user_func_array(array($this->mysqliStatement, '...
php
private function bindResult() { $this->result = array_fill(0, count($this->resultFields), null); $resultReferences = array(); foreach ($this->result as $key => &$result) { $resultReferences[$key] = &$result; } call_user_func_array(array($this->mysqliStatement, '...
[ "private", "function", "bindResult", "(", ")", "{", "$", "this", "->", "result", "=", "array_fill", "(", "0", ",", "count", "(", "$", "this", "->", "resultFields", ")", ",", "null", ")", ";", "$", "resultReferences", "=", "array", "(", ")", ";", "for...
Binds the driver statement result.
[ "Binds", "the", "driver", "statement", "result", "." ]
d0b8c3551922d696836487aa0eb1bd74014edcd4
https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Driver/Statement/MysqliStatement.php#L385-L397
193,657
kambalabs/KmbDomain
src/KmbDomain/Service/GroupFactory.php
GroupFactory.createFromImportedData
public function createFromImportedData($data) { $group = new Group($data['name'], $data['include_pattern'], $data['exclude_pattern']); if (isset($data['type'])) { $group->setType($data['type']); } $group->setOrdering($data['ordering']); foreach ($data['classes'] a...
php
public function createFromImportedData($data) { $group = new Group($data['name'], $data['include_pattern'], $data['exclude_pattern']); if (isset($data['type'])) { $group->setType($data['type']); } $group->setOrdering($data['ordering']); foreach ($data['classes'] a...
[ "public", "function", "createFromImportedData", "(", "$", "data", ")", "{", "$", "group", "=", "new", "Group", "(", "$", "data", "[", "'name'", "]", ",", "$", "data", "[", "'include_pattern'", "]", ",", "$", "data", "[", "'exclude_pattern'", "]", ")", ...
Create Group instance from imported data. @param array $data @return Group
[ "Create", "Group", "instance", "from", "imported", "data", "." ]
b1631bd936c6c6798076b51dfaebd706e1bdc8c2
https://github.com/kambalabs/KmbDomain/blob/b1631bd936c6c6798076b51dfaebd706e1bdc8c2/src/KmbDomain/Service/GroupFactory.php#L36-L47
193,658
Saritasa/php-eloquent-custom
src/Models/User.php
User.getRules
public function getRules() { $rules = [ static::FIRST_NAME => "required|max:100", static::LAST_NAME => "required|max:100", static::EMAIL => "required|max:100|email|unique:users,email,{$this->id},id", ]; if (!$this->id) { $rules[static::PWD_FIEL...
php
public function getRules() { $rules = [ static::FIRST_NAME => "required|max:100", static::LAST_NAME => "required|max:100", static::EMAIL => "required|max:100|email|unique:users,email,{$this->id},id", ]; if (!$this->id) { $rules[static::PWD_FIEL...
[ "public", "function", "getRules", "(", ")", "{", "$", "rules", "=", "[", "static", "::", "FIRST_NAME", "=>", "\"required|max:100\"", ",", "static", "::", "LAST_NAME", "=>", "\"required|max:100\"", ",", "static", "::", "EMAIL", "=>", "\"required|max:100|email|uniqu...
Return array of rules for model validation @deprecated Declare rules in Form Request: https://laravel.com/docs/5.5/validation#form-request-validation @return array
[ "Return", "array", "of", "rules", "for", "model", "validation" ]
54a2479f1d6e9cddac14dd8e473ab6a99dc6a82a
https://github.com/Saritasa/php-eloquent-custom/blob/54a2479f1d6e9cddac14dd8e473ab6a99dc6a82a/src/Models/User.php#L161-L173
193,659
anime-db/catalog-bundle
src/Event/Listener/Entity/Downloader.php
Downloader.renameFile
protected function renameFile(EntityInterface $entity, $target) { if ($entity->getFilename() && strpos($entity->getFilename(), 'tmp') !== false) { $filename = $entity->getFilename(); $entity->setFilename($target.pathinfo($filename, PATHINFO_BASENAME)); $root = $this->root...
php
protected function renameFile(EntityInterface $entity, $target) { if ($entity->getFilename() && strpos($entity->getFilename(), 'tmp') !== false) { $filename = $entity->getFilename(); $entity->setFilename($target.pathinfo($filename, PATHINFO_BASENAME)); $root = $this->root...
[ "protected", "function", "renameFile", "(", "EntityInterface", "$", "entity", ",", "$", "target", ")", "{", "if", "(", "$", "entity", "->", "getFilename", "(", ")", "&&", "strpos", "(", "$", "entity", "->", "getFilename", "(", ")", ",", "'tmp'", ")", "...
Rename file, if it in the temp folder. @param EntityInterface $entity @param string $target
[ "Rename", "file", "if", "it", "in", "the", "temp", "folder", "." ]
631b6f92a654e91bee84f46218c52cf42bdb8606
https://github.com/anime-db/catalog-bundle/blob/631b6f92a654e91bee84f46218c52cf42bdb8606/src/Event/Listener/Entity/Downloader.php#L64-L72
193,660
stevenliebregt/crispysystem
src/CrispySystem.php
CrispySystem.handle
private function handle(Request $request) : Response { $router = $this->getInstance(Router::class); if ($router->match($request->getPathInfo(), $request->getMethod())) { // A match has been found /** @var Route $match */ $match = $router->getMatch(); // Check if...
php
private function handle(Request $request) : Response { $router = $this->getInstance(Router::class); if ($router->match($request->getPathInfo(), $request->getMethod())) { // A match has been found /** @var Route $match */ $match = $router->getMatch(); // Check if...
[ "private", "function", "handle", "(", "Request", "$", "request", ")", ":", "Response", "{", "$", "router", "=", "$", "this", "->", "getInstance", "(", "Router", "::", "class", ")", ";", "if", "(", "$", "router", "->", "match", "(", "$", "request", "-...
Turn a request into a response @param Request $request @return Response @since 1.0.0
[ "Turn", "a", "request", "into", "a", "response" ]
06547dae100dae1023a93ec903f2d2abacce9aec
https://github.com/stevenliebregt/crispysystem/blob/06547dae100dae1023a93ec903f2d2abacce9aec/src/CrispySystem.php#L75-L124
193,661
agentmedia/phine-core
src/Core/Logic/Tree/ContentTreeUtil.php
ContentTreeUtil.FirstChildOf
static function FirstChildOf (Content $content) { $provider = self::GetTreeProvider($content); if (!$provider) { return null; } $item = $provider->ItemByContent($content); return $provider->ContentByItem($provider->FirstChildOf($item)); }
php
static function FirstChildOf (Content $content) { $provider = self::GetTreeProvider($content); if (!$provider) { return null; } $item = $provider->ItemByContent($content); return $provider->ContentByItem($provider->FirstChildOf($item)); }
[ "static", "function", "FirstChildOf", "(", "Content", "$", "content", ")", "{", "$", "provider", "=", "self", "::", "GetTreeProvider", "(", "$", "content", ")", ";", "if", "(", "!", "$", "provider", ")", "{", "return", "null", ";", "}", "$", "item", ...
Returns the first child of the content @param Content $content The parent content @return Content Returns the first child in the tree
[ "Returns", "the", "first", "child", "of", "the", "content" ]
38c1be8d03ebffae950d00a96da3c612aff67832
https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Tree/ContentTreeUtil.php#L54-L63
193,662
PhoxPHP/Console
src/Command.php
Command.hasCommand
public static function hasCommand(String $label) : Bool { return (isset(Command::$commands[$label])) ? true : false; }
php
public static function hasCommand(String $label) : Bool { return (isset(Command::$commands[$label])) ? true : false; }
[ "public", "static", "function", "hasCommand", "(", "String", "$", "label", ")", ":", "Bool", "{", "return", "(", "isset", "(", "Command", "::", "$", "commands", "[", "$", "label", "]", ")", ")", "?", "true", ":", "false", ";", "}" ]
Checks if a command is registered. @param $command <String> @access public @static @return <Boolean>
[ "Checks", "if", "a", "command", "is", "registered", "." ]
fee1238cfdb3592964bb5d5a2336e70b8ffd20e9
https://github.com/PhoxPHP/Console/blob/fee1238cfdb3592964bb5d5a2336e70b8ffd20e9/src/Command.php#L66-L69
193,663
PhoxPHP/Console
src/Command.php
Command.watchOutput
public function watchOutput() { $arguments = $_SERVER['argv']; unset($arguments[0]); $argumentsCount = $_SERVER['argc'] - 1; $arguments = array_values($arguments); if ($argumentsCount > 0) { $commandId = $arguments[0]; if (!Command::hasCommand($commandId)) { return $this->env->sendOutput(sprintf(...
php
public function watchOutput() { $arguments = $_SERVER['argv']; unset($arguments[0]); $argumentsCount = $_SERVER['argc'] - 1; $arguments = array_values($arguments); if ($argumentsCount > 0) { $commandId = $arguments[0]; if (!Command::hasCommand($commandId)) { return $this->env->sendOutput(sprintf(...
[ "public", "function", "watchOutput", "(", ")", "{", "$", "arguments", "=", "$", "_SERVER", "[", "'argv'", "]", ";", "unset", "(", "$", "arguments", "[", "0", "]", ")", ";", "$", "argumentsCount", "=", "$", "_SERVER", "[", "'argc'", "]", "-", "1", "...
Processes called command and returns it's output. @access public @return <void>
[ "Processes", "called", "command", "and", "returns", "it", "s", "output", "." ]
fee1238cfdb3592964bb5d5a2336e70b8ffd20e9
https://github.com/PhoxPHP/Console/blob/fee1238cfdb3592964bb5d5a2336e70b8ffd20e9/src/Command.php#L139-L187
193,664
PhoxPHP/Console
src/Command.php
Command.question
public function question(String $question) { $this->env->sendOutput($question); return $this->env->getOutputOption(); }
php
public function question(String $question) { $this->env->sendOutput($question); return $this->env->getOutputOption(); }
[ "public", "function", "question", "(", "String", "$", "question", ")", "{", "$", "this", "->", "env", "->", "sendOutput", "(", "$", "question", ")", ";", "return", "$", "this", "->", "env", "->", "getOutputOption", "(", ")", ";", "}" ]
Sends output to user as a question and returns response. @param $question <String> @access public @return <String>
[ "Sends", "output", "to", "user", "as", "a", "question", "and", "returns", "response", "." ]
fee1238cfdb3592964bb5d5a2336e70b8ffd20e9
https://github.com/PhoxPHP/Console/blob/fee1238cfdb3592964bb5d5a2336e70b8ffd20e9/src/Command.php#L196-L200
193,665
dmj/PicaRecord
src/HAB/Pica/Record/NestedRecord.php
NestedRecord.sort
public function sort () { parent::sort(); Helper::mapMethod($this->_records, 'sort'); usort($this->_records, array($this, 'compareRecords')); }
php
public function sort () { parent::sort(); Helper::mapMethod($this->_records, 'sort'); usort($this->_records, array($this, 'compareRecords')); }
[ "public", "function", "sort", "(", ")", "{", "parent", "::", "sort", "(", ")", ";", "Helper", "::", "mapMethod", "(", "$", "this", "->", "_records", ",", "'sort'", ")", ";", "usort", "(", "$", "this", "->", "_records", ",", "array", "(", "$", "this...
Sort fields and contained records. The sort() is propagated down to all contained records. In addition the nested records are sorted themselves using the implementing class' compareNestedRecords() function. @see Record::sort() @see NestedRecord::compareNestedRecords() @return void
[ "Sort", "fields", "and", "contained", "records", "." ]
bd5577b9a4333aa6156398b94cc870a9377061b8
https://github.com/dmj/PicaRecord/blob/bd5577b9a4333aa6156398b94cc870a9377061b8/src/HAB/Pica/Record/NestedRecord.php#L74-L79
193,666
dmj/PicaRecord
src/HAB/Pica/Record/NestedRecord.php
NestedRecord.isEmpty
public function isEmpty () { return parent::isEmpty() && Helper::every($this->_records, function (Record $record) { return $record->isEmpty(); }); }
php
public function isEmpty () { return parent::isEmpty() && Helper::every($this->_records, function (Record $record) { return $record->isEmpty(); }); }
[ "public", "function", "isEmpty", "(", ")", "{", "return", "parent", "::", "isEmpty", "(", ")", "&&", "Helper", "::", "every", "(", "$", "this", "->", "_records", ",", "function", "(", "Record", "$", "record", ")", "{", "return", "$", "record", "->", ...
Return true if the record is empty. A nested record is empty iff it contains no fields and no non-empty contained record. @return boolean
[ "Return", "true", "if", "the", "record", "is", "empty", "." ]
bd5577b9a4333aa6156398b94cc870a9377061b8
https://github.com/dmj/PicaRecord/blob/bd5577b9a4333aa6156398b94cc870a9377061b8/src/HAB/Pica/Record/NestedRecord.php#L89-L92
193,667
dmj/PicaRecord
src/HAB/Pica/Record/NestedRecord.php
NestedRecord.addRecord
protected function addRecord (Record $record) { if ($this->containsRecord($record)) { throw new InvalidArgumentException("{$this} already contains {$record}"); } $this->_records []= $record; }
php
protected function addRecord (Record $record) { if ($this->containsRecord($record)) { throw new InvalidArgumentException("{$this} already contains {$record}"); } $this->_records []= $record; }
[ "protected", "function", "addRecord", "(", "Record", "$", "record", ")", "{", "if", "(", "$", "this", "->", "containsRecord", "(", "$", "record", ")", ")", "{", "throw", "new", "InvalidArgumentException", "(", "\"{$this} already contains {$record}\"", ")", ";", ...
Add a record as a contained record. @throws InvalidArgumentException Record already contains the record @param Record $record Record to add @return void
[ "Add", "a", "record", "as", "a", "contained", "record", "." ]
bd5577b9a4333aa6156398b94cc870a9377061b8
https://github.com/dmj/PicaRecord/blob/bd5577b9a4333aa6156398b94cc870a9377061b8/src/HAB/Pica/Record/NestedRecord.php#L145-L151
193,668
dmj/PicaRecord
src/HAB/Pica/Record/NestedRecord.php
NestedRecord.removeRecord
protected function removeRecord (Record $record) { $index = array_search($record, $this->_records, true); if ($index === false) { throw new InvalidArgumentException("{$this} does not contain {$record}"); } unset($this->_records[$index]); }
php
protected function removeRecord (Record $record) { $index = array_search($record, $this->_records, true); if ($index === false) { throw new InvalidArgumentException("{$this} does not contain {$record}"); } unset($this->_records[$index]); }
[ "protected", "function", "removeRecord", "(", "Record", "$", "record", ")", "{", "$", "index", "=", "array_search", "(", "$", "record", ",", "$", "this", "->", "_records", ",", "true", ")", ";", "if", "(", "$", "index", "===", "false", ")", "{", "thr...
Remove a contained record. @throws InvalidArgumentException Record does not contain the record @param Record $record Record to remove @return void
[ "Remove", "a", "contained", "record", "." ]
bd5577b9a4333aa6156398b94cc870a9377061b8
https://github.com/dmj/PicaRecord/blob/bd5577b9a4333aa6156398b94cc870a9377061b8/src/HAB/Pica/Record/NestedRecord.php#L161-L168
193,669
helsingborg-stad/better-post-UI
source/php/Components/Author.php
Author.alwaysShowAuthorMetabox
public function alwaysShowAuthorMetabox($hidden, $screen) { if ($screen->post_type != 'page') { return $hidden; } $hidden = array_filter($hidden, function ($item) { return $item != 'authordiv'; }); return $hidden; }
php
public function alwaysShowAuthorMetabox($hidden, $screen) { if ($screen->post_type != 'page') { return $hidden; } $hidden = array_filter($hidden, function ($item) { return $item != 'authordiv'; }); return $hidden; }
[ "public", "function", "alwaysShowAuthorMetabox", "(", "$", "hidden", ",", "$", "screen", ")", "{", "if", "(", "$", "screen", "->", "post_type", "!=", "'page'", ")", "{", "return", "$", "hidden", ";", "}", "$", "hidden", "=", "array_filter", "(", "$", "...
Display the author metabox by default @param array $hidden Hidden metaboxes before @param array $screen Screen args @return array Hidden metaboxes after
[ "Display", "the", "author", "metabox", "by", "default" ]
0454e8d6f42787244d02f0e976825ed8dca579f0
https://github.com/helsingborg-stad/better-post-UI/blob/0454e8d6f42787244d02f0e976825ed8dca579f0/source/php/Components/Author.php#L133-L144
193,670
kapitchi/KapitchiEntity
src/KapitchiEntity/Controller/EntityController.php
EntityController.getIndexUrl
public function getIndexUrl(array $params = array(), array $options = array()) { return $this->url()->fromRoute($this->getEvent()->getRouteMatch()->getMatchedRouteName(), array_merge(array('action' => 'index'), $params), $options ); }
php
public function getIndexUrl(array $params = array(), array $options = array()) { return $this->url()->fromRoute($this->getEvent()->getRouteMatch()->getMatchedRouteName(), array_merge(array('action' => 'index'), $params), $options ); }
[ "public", "function", "getIndexUrl", "(", "array", "$", "params", "=", "array", "(", ")", ",", "array", "$", "options", "=", "array", "(", ")", ")", "{", "return", "$", "this", "->", "url", "(", ")", "->", "fromRoute", "(", "$", "this", "->", "getE...
Default implementation of this method returns entity index URL using matched route name and setting action = 'index' If you have different routes set overwrite this method in your concrete controller
[ "Default", "implementation", "of", "this", "method", "returns", "entity", "index", "URL", "using", "matched", "route", "name", "and", "setting", "action", "=", "index", "If", "you", "have", "different", "routes", "set", "overwrite", "this", "method", "in", "yo...
69deaeb41d9133422a20ad6f64f0743d66cea8fd
https://github.com/kapitchi/KapitchiEntity/blob/69deaeb41d9133422a20ad6f64f0743d66cea8fd/src/KapitchiEntity/Controller/EntityController.php#L75-L81
193,671
kapitchi/KapitchiEntity
src/KapitchiEntity/Controller/EntityController.php
EntityController.setEventManager
public function setEventManager(EventManagerInterface $events) { $events->setIdentifiers(array( 'Zend\Stdlib\DispatchableInterface', 'Zend\Mvc\Controller\AbstractController', 'Zend\Mvc\Controller\AbstractActionController', __CLASS__, get_c...
php
public function setEventManager(EventManagerInterface $events) { $events->setIdentifiers(array( 'Zend\Stdlib\DispatchableInterface', 'Zend\Mvc\Controller\AbstractController', 'Zend\Mvc\Controller\AbstractActionController', __CLASS__, get_c...
[ "public", "function", "setEventManager", "(", "EventManagerInterface", "$", "events", ")", "{", "$", "events", "->", "setIdentifiers", "(", "array", "(", "'Zend\\Stdlib\\DispatchableInterface'", ",", "'Zend\\Mvc\\Controller\\AbstractController'", ",", "'Zend\\Mvc\\Controller\...
Adds all subclass identifiers @author Matus Zeman <mz@kapitchi.com> @param EventManagerInterface $events @return AbstractController
[ "Adds", "all", "subclass", "identifiers" ]
69deaeb41d9133422a20ad6f64f0743d66cea8fd
https://github.com/kapitchi/KapitchiEntity/blob/69deaeb41d9133422a20ad6f64f0743d66cea8fd/src/KapitchiEntity/Controller/EntityController.php#L392-L408
193,672
siriusSupreme/sirius-broadcast
src/BroadcastManager.php
BroadcastManager.queue
public function queue($event) { $connection = $event instanceof ShouldBroadcastNow ? 'sync' : null; if (is_null($connection) && isset($event->connection)) { $connection = $event->connection; } $queue = null; if (method_exists($event, 'broadcastQueue')) { ...
php
public function queue($event) { $connection = $event instanceof ShouldBroadcastNow ? 'sync' : null; if (is_null($connection) && isset($event->connection)) { $connection = $event->connection; } $queue = null; if (method_exists($event, 'broadcastQueue')) { ...
[ "public", "function", "queue", "(", "$", "event", ")", "{", "$", "connection", "=", "$", "event", "instanceof", "ShouldBroadcastNow", "?", "'sync'", ":", "null", ";", "if", "(", "is_null", "(", "$", "connection", ")", "&&", "isset", "(", "$", "event", ...
Queue the given event for broadcast. @param mixed $event @return void
[ "Queue", "the", "given", "event", "for", "broadcast", "." ]
d98f47973631dbb2da0296fd7066d1a70e9b30f7
https://github.com/siriusSupreme/sirius-broadcast/blob/d98f47973631dbb2da0296fd7066d1a70e9b30f7/src/BroadcastManager.php#L138-L159
193,673
zenodorus-tools/strings
src/Strings.php
Strings.safe
public static function safe(string $string, string $regex = self::SAFE) { if (preg_match($regex, $string)) : return $string; else : return false; endif; }
php
public static function safe(string $string, string $regex = self::SAFE) { if (preg_match($regex, $string)) : return $string; else : return false; endif; }
[ "public", "static", "function", "safe", "(", "string", "$", "string", ",", "string", "$", "regex", "=", "self", "::", "SAFE", ")", "{", "if", "(", "preg_match", "(", "$", "regex", ",", "$", "string", ")", ")", ":", "return", "$", "string", ";", "el...
Determine if a string contains any "bad" characters. It works by checking for the presence of ONLY "good" characters; not the presense of "bad" characters, which should make it more difficult to trick. @param string $string The string to check. @param string $regex (optional) Regex defining "safe" characters. ...
[ "Determine", "if", "a", "string", "contains", "any", "bad", "characters", "." ]
5c98702ed2e3078169a3f2d4f12500cf630e5e6b
https://github.com/zenodorus-tools/strings/blob/5c98702ed2e3078169a3f2d4f12500cf630e5e6b/src/Strings.php#L19-L26
193,674
zenodorus-tools/strings
src/Strings.php
Strings.clean
public static function clean(string $string, string $replace = "", string $regex = self::CLEAN) { if ($replace === null) : $replace = ""; endif; if ($regex === null) : $regex = self::CLEAN; endif; return preg_replace($regex, $replace, $string); ...
php
public static function clean(string $string, string $replace = "", string $regex = self::CLEAN) { if ($replace === null) : $replace = ""; endif; if ($regex === null) : $regex = self::CLEAN; endif; return preg_replace($regex, $replace, $string); ...
[ "public", "static", "function", "clean", "(", "string", "$", "string", ",", "string", "$", "replace", "=", "\"\"", ",", "string", "$", "regex", "=", "self", "::", "CLEAN", ")", "{", "if", "(", "$", "replace", "===", "null", ")", ":", "$", "replace", ...
Clean a string by removing any characters we don't want. @param string $string The string we're cleaning. @param string $replace What to replace "bad" characters with. @param string $regex (optional) The regex determing "good" characters. @return string
[ "Clean", "a", "string", "by", "removing", "any", "characters", "we", "don", "t", "want", "." ]
5c98702ed2e3078169a3f2d4f12500cf630e5e6b
https://github.com/zenodorus-tools/strings/blob/5c98702ed2e3078169a3f2d4f12500cf630e5e6b/src/Strings.php#L36-L46
193,675
zenodorus-tools/strings
src/Strings.php
Strings.replaceFirst
public static function replaceFirst(string $search, string $replace, string $subject) { $pos = strpos($subject, $search); if ($pos !== false) { return substr_replace($subject, $replace, $pos, strlen($search)); } return $subject; }
php
public static function replaceFirst(string $search, string $replace, string $subject) { $pos = strpos($subject, $search); if ($pos !== false) { return substr_replace($subject, $replace, $pos, strlen($search)); } return $subject; }
[ "public", "static", "function", "replaceFirst", "(", "string", "$", "search", ",", "string", "$", "replace", ",", "string", "$", "subject", ")", "{", "$", "pos", "=", "strpos", "(", "$", "subject", ",", "$", "search", ")", ";", "if", "(", "$", "pos",...
Replace the first instance of a string in another string, if it exists. @param string $search The string being to be replaced. @param string $replace The string to replace $search with. @param string $subject The string that is being searched for $search. @return string If $search does...
[ "Replace", "the", "first", "instance", "of", "a", "string", "in", "another", "string", "if", "it", "exists", "." ]
5c98702ed2e3078169a3f2d4f12500cf630e5e6b
https://github.com/zenodorus-tools/strings/blob/5c98702ed2e3078169a3f2d4f12500cf630e5e6b/src/Strings.php#L57-L64
193,676
zenodorus-tools/strings
src/Strings.php
Strings.addNew
public static function addNew(string $add, string $existing, string $concatenateWith = ' ') { if (!strpos($existing, $add)) : return sprintf("%s%s%s", $existing, $concatenateWith, $add); endif; return $existing; }
php
public static function addNew(string $add, string $existing, string $concatenateWith = ' ') { if (!strpos($existing, $add)) : return sprintf("%s%s%s", $existing, $concatenateWith, $add); endif; return $existing; }
[ "public", "static", "function", "addNew", "(", "string", "$", "add", ",", "string", "$", "existing", ",", "string", "$", "concatenateWith", "=", "' '", ")", "{", "if", "(", "!", "strpos", "(", "$", "existing", ",", "$", "add", ")", ")", ":", "return"...
Concatenates a string to another string, if it isn't already a substring of it. @param string $add The string to be added. @param string $existing The existing string. @param string $concatenateWith (option) String to concatenate with. Defaults to ' '. @return string Returns ...
[ "Concatenates", "a", "string", "to", "another", "string", "if", "it", "isn", "t", "already", "a", "substring", "of", "it", "." ]
5c98702ed2e3078169a3f2d4f12500cf630e5e6b
https://github.com/zenodorus-tools/strings/blob/5c98702ed2e3078169a3f2d4f12500cf630e5e6b/src/Strings.php#L76-L83
193,677
Wedeto/DB
src/Query/LimitClause.php
LimitClause.toSQL
public function toSQL(Parameters $params, bool $inner_clause) { return "LIMIT " . $params->getDriver()->toSQL($params, $this->getLimit()); }
php
public function toSQL(Parameters $params, bool $inner_clause) { return "LIMIT " . $params->getDriver()->toSQL($params, $this->getLimit()); }
[ "public", "function", "toSQL", "(", "Parameters", "$", "params", ",", "bool", "$", "inner_clause", ")", "{", "return", "\"LIMIT \"", ".", "$", "params", "->", "getDriver", "(", ")", "->", "toSQL", "(", "$", "params", ",", "$", "this", "->", "getLimit", ...
Write a LIMIT clause to SQL query syntax @param Parameters $params The query parameters: tables and placeholder values @param bool $inner_caluse Unused @return string The generated SQL
[ "Write", "a", "LIMIT", "clause", "to", "SQL", "query", "syntax" ]
715f8f2e3ae6b53c511c40b620921cb9c87e6f62
https://github.com/Wedeto/DB/blob/715f8f2e3ae6b53c511c40b620921cb9c87e6f62/src/Query/LimitClause.php#L60-L63
193,678
eureka-framework/component-template
src/Template/Pattern/PatternCollection.php
PatternCollection.add
public function add(PatternInterface $pattern) { $this->collection[$this->length] = $pattern; $this->length++; return $this; }
php
public function add(PatternInterface $pattern) { $this->collection[$this->length] = $pattern; $this->length++; return $this; }
[ "public", "function", "add", "(", "PatternInterface", "$", "pattern", ")", "{", "$", "this", "->", "collection", "[", "$", "this", "->", "length", "]", "=", "$", "pattern", ";", "$", "this", "->", "length", "++", ";", "return", "$", "this", ";", "}" ...
Add pattern object to the collection. @param PatternInterface $pattern @return self
[ "Add", "pattern", "object", "to", "the", "collection", "." ]
42e9b3954b79892ba340ba7ca909f03ee99c36fe
https://github.com/eureka-framework/component-template/blob/42e9b3954b79892ba340ba7ca909f03ee99c36fe/src/Template/Pattern/PatternCollection.php#L48-L54
193,679
cloudtek/dynamodm
lib/Cloudtek/DynamoDM/Exception/ODMException.php
ODMException.conversionFailedInvalidType
static public function conversionFailedInvalidType($value, $toType, array $possibleTypes) { $actualType = is_object($value) ? get_class($value) : gettype($value); if (is_scalar($value)) { return new self(sprintf( "Could not convert PHP value '%s' of type '%s' to type '%s...
php
static public function conversionFailedInvalidType($value, $toType, array $possibleTypes) { $actualType = is_object($value) ? get_class($value) : gettype($value); if (is_scalar($value)) { return new self(sprintf( "Could not convert PHP value '%s' of type '%s' to type '%s...
[ "static", "public", "function", "conversionFailedInvalidType", "(", "$", "value", ",", "$", "toType", ",", "array", "$", "possibleTypes", ")", "{", "$", "actualType", "=", "is_object", "(", "$", "value", ")", "?", "get_class", "(", "$", "value", ")", ":", ...
Thrown when the PHP value passed to the type converter was not of the expected type. @param mixed $value @param string $toType @param string[] $possibleTypes @return ODMException
[ "Thrown", "when", "the", "PHP", "value", "passed", "to", "the", "type", "converter", "was", "not", "of", "the", "expected", "type", "." ]
119d355e2c5cbaef1f867970349b4432f5704fcd
https://github.com/cloudtek/dynamodm/blob/119d355e2c5cbaef1f867970349b4432f5704fcd/lib/Cloudtek/DynamoDM/Exception/ODMException.php#L95-L115
193,680
phata/widgetfy
src/Utils/Dimension.php
Dimension.toAttr
public function toAttr($prefix='', $suffix='') { $attrs = array(); if ($this->width !== FALSE) { $attrs[] = 'width="'.addslashes($this->width).'"'; } if ($this->height !== FALSE) { $attrs[] = 'height="'.addslashes($this->height).'"'; } return $pref...
php
public function toAttr($prefix='', $suffix='') { $attrs = array(); if ($this->width !== FALSE) { $attrs[] = 'width="'.addslashes($this->width).'"'; } if ($this->height !== FALSE) { $attrs[] = 'height="'.addslashes($this->height).'"'; } return $pref...
[ "public", "function", "toAttr", "(", "$", "prefix", "=", "''", ",", "$", "suffix", "=", "''", ")", "{", "$", "attrs", "=", "array", "(", ")", ";", "if", "(", "$", "this", "->", "width", "!==", "FALSE", ")", "{", "$", "attrs", "[", "]", "=", "...
translate the current dimension data to attribute width="xxx" height="yyy" @return string HTML/XML attribute width and height
[ "translate", "the", "current", "dimension", "data", "to", "attribute", "width", "=", "xxx", "height", "=", "yyy" ]
00102c35ec5267b42c627f1e34b8e64a7dd3590c
https://github.com/phata/widgetfy/blob/00102c35ec5267b42c627f1e34b8e64a7dd3590c/src/Utils/Dimension.php#L309-L318
193,681
ddrv-test/firmapi-core
src/Core.php
Core.init
public function init($configArrayOrPathToConfig) { $config = include(dirname(__DIR__).DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'default.php'); if (is_array($configArrayOrPathToConfig)) { $config = array_replace_recursive($config,$configArrayOrPathToConfig); } ...
php
public function init($configArrayOrPathToConfig) { $config = include(dirname(__DIR__).DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'default.php'); if (is_array($configArrayOrPathToConfig)) { $config = array_replace_recursive($config,$configArrayOrPathToConfig); } ...
[ "public", "function", "init", "(", "$", "configArrayOrPathToConfig", ")", "{", "$", "config", "=", "include", "(", "dirname", "(", "__DIR__", ")", ".", "DIRECTORY_SEPARATOR", ".", "'config'", ".", "DIRECTORY_SEPARATOR", ".", "'default.php'", ")", ";", "if", "(...
Init application with config @param array|string $configArrayOrPathToConfig @return $this
[ "Init", "application", "with", "config" ]
8f8843f0fb134568e7764cabd5039e15c579976d
https://github.com/ddrv-test/firmapi-core/blob/8f8843f0fb134568e7764cabd5039e15c579976d/src/Core.php#L111-L131
193,682
ddrv-test/firmapi-core
src/Core.php
Core.getAllowedMethods
public function getAllowedMethods($token) { $token = (string)$token; $array = (isset($this->config['tokens'][$token]))?$this->config['tokens'][$token]:array(); $allowed = array_merge_recursive( $this->config['tokens']['*'], $array ); $allowed = arra...
php
public function getAllowedMethods($token) { $token = (string)$token; $array = (isset($this->config['tokens'][$token]))?$this->config['tokens'][$token]:array(); $allowed = array_merge_recursive( $this->config['tokens']['*'], $array ); $allowed = arra...
[ "public", "function", "getAllowedMethods", "(", "$", "token", ")", "{", "$", "token", "=", "(", "string", ")", "$", "token", ";", "$", "array", "=", "(", "isset", "(", "$", "this", "->", "config", "[", "'tokens'", "]", "[", "$", "token", "]", ")", ...
Return Allowed methods for token @param string $token @return array
[ "Return", "Allowed", "methods", "for", "token" ]
8f8843f0fb134568e7764cabd5039e15c579976d
https://github.com/ddrv-test/firmapi-core/blob/8f8843f0fb134568e7764cabd5039e15c579976d/src/Core.php#L139-L149
193,683
ddrv-test/firmapi-core
src/Core.php
Core.isAllow
public function isAllow($object,$method,$token) { $allowed = $this->getAllowedMethods($token); $object = mb_strtolower($object); $method = mb_strtolower($method); $allow = false; if ( (isset($allowed[$object]) && in_array($method,$allowed[$object])) ...
php
public function isAllow($object,$method,$token) { $allowed = $this->getAllowedMethods($token); $object = mb_strtolower($object); $method = mb_strtolower($method); $allow = false; if ( (isset($allowed[$object]) && in_array($method,$allowed[$object])) ...
[ "public", "function", "isAllow", "(", "$", "object", ",", "$", "method", ",", "$", "token", ")", "{", "$", "allowed", "=", "$", "this", "->", "getAllowedMethods", "(", "$", "token", ")", ";", "$", "object", "=", "mb_strtolower", "(", "$", "object", "...
Check for method allow @param string $object @param string $method @param string $token @return true
[ "Check", "for", "method", "allow" ]
8f8843f0fb134568e7764cabd5039e15c579976d
https://github.com/ddrv-test/firmapi-core/blob/8f8843f0fb134568e7764cabd5039e15c579976d/src/Core.php#L159-L175
193,684
ddrv-test/firmapi-core
src/Core.php
Core.getRepository
public function getRepository($repositoryName) { $repositoryName = (string)$repositoryName; if(!isset($this->config['repositories'][$repositoryName]['class'])) return false; $className = $this->config['repositories'][$repositoryName]['class']; if (!class_exists($className)) { ...
php
public function getRepository($repositoryName) { $repositoryName = (string)$repositoryName; if(!isset($this->config['repositories'][$repositoryName]['class'])) return false; $className = $this->config['repositories'][$repositoryName]['class']; if (!class_exists($className)) { ...
[ "public", "function", "getRepository", "(", "$", "repositoryName", ")", "{", "$", "repositoryName", "=", "(", "string", ")", "$", "repositoryName", ";", "if", "(", "!", "isset", "(", "$", "this", "->", "config", "[", "'repositories'", "]", "[", "$", "rep...
Return repository object @param string $repositoryName @return mixed
[ "Return", "repository", "object" ]
8f8843f0fb134568e7764cabd5039e15c579976d
https://github.com/ddrv-test/firmapi-core/blob/8f8843f0fb134568e7764cabd5039e15c579976d/src/Core.php#L209-L219
193,685
Stinger-Soft/PhpCommons
src/StingerSoft/PhpCommons/String/Utils.php
Utils.startsWith
public static function startsWith($haystack, $needle) { if($needle === null && $haystack === null) return false; if($needle === null && $haystack !== null) return true; return $needle === "" || strrpos($haystack, $needle, -strlen($haystack)) !== false; }
php
public static function startsWith($haystack, $needle) { if($needle === null && $haystack === null) return false; if($needle === null && $haystack !== null) return true; return $needle === "" || strrpos($haystack, $needle, -strlen($haystack)) !== false; }
[ "public", "static", "function", "startsWith", "(", "$", "haystack", ",", "$", "needle", ")", "{", "if", "(", "$", "needle", "===", "null", "&&", "$", "haystack", "===", "null", ")", "return", "false", ";", "if", "(", "$", "needle", "===", "null", "&&...
Checks if the haystack starts with needle @param string $haystack @param string $needle @return boolean
[ "Checks", "if", "the", "haystack", "starts", "with", "needle" ]
e1d7e2bb7b384fb9182903d3b6138aa3bbd05d9b
https://github.com/Stinger-Soft/PhpCommons/blob/e1d7e2bb7b384fb9182903d3b6138aa3bbd05d9b/src/StingerSoft/PhpCommons/String/Utils.php#L26-L32
193,686
Stinger-Soft/PhpCommons
src/StingerSoft/PhpCommons/String/Utils.php
Utils.endsWith
public static function endsWith($haystack, $needle) { if($needle === null && $haystack === null) return true; if($needle === null && $haystack !== null) return true; return $needle === "" || (($temp = strlen($haystack) - strlen($needle)) >= 0 && strpos($haystack, $needle, $temp) !== false); }
php
public static function endsWith($haystack, $needle) { if($needle === null && $haystack === null) return true; if($needle === null && $haystack !== null) return true; return $needle === "" || (($temp = strlen($haystack) - strlen($needle)) >= 0 && strpos($haystack, $needle, $temp) !== false); }
[ "public", "static", "function", "endsWith", "(", "$", "haystack", ",", "$", "needle", ")", "{", "if", "(", "$", "needle", "===", "null", "&&", "$", "haystack", "===", "null", ")", "return", "true", ";", "if", "(", "$", "needle", "===", "null", "&&", ...
Checks if the haystack ends with needle @param string $haystack @param string $needle @return boolean
[ "Checks", "if", "the", "haystack", "ends", "with", "needle" ]
e1d7e2bb7b384fb9182903d3b6138aa3bbd05d9b
https://github.com/Stinger-Soft/PhpCommons/blob/e1d7e2bb7b384fb9182903d3b6138aa3bbd05d9b/src/StingerSoft/PhpCommons/String/Utils.php#L41-L47
193,687
Stinger-Soft/PhpCommons
src/StingerSoft/PhpCommons/String/Utils.php
Utils.excerpt
public static function excerpt($text, $phrase, $radius = 100, $ending = "...") { $phrases = is_array($phrase) ? $phrase : array( $phrase ); $phraseLen = strlen(implode(' ', $phrases)); if($radius < $phraseLen) { $radius = $phraseLen; } foreach($phrases as $phrase) { $pos = strpos(strtolower(...
php
public static function excerpt($text, $phrase, $radius = 100, $ending = "...") { $phrases = is_array($phrase) ? $phrase : array( $phrase ); $phraseLen = strlen(implode(' ', $phrases)); if($radius < $phraseLen) { $radius = $phraseLen; } foreach($phrases as $phrase) { $pos = strpos(strtolower(...
[ "public", "static", "function", "excerpt", "(", "$", "text", ",", "$", "phrase", ",", "$", "radius", "=", "100", ",", "$", "ending", "=", "\"...\"", ")", "{", "$", "phrases", "=", "is_array", "(", "$", "phrase", ")", "?", "$", "phrase", ":", "array...
Creates an excerpt from the given text based on the passed phrase @see http://stackoverflow.com/a/1404151 @param string $text The text to extract the excerpt from @param string|array $phrase The phrases to search for. @param number $radius The radius in characters to be included in the excerpt @param string $ending T...
[ "Creates", "an", "excerpt", "from", "the", "given", "text", "based", "on", "the", "passed", "phrase" ]
e1d7e2bb7b384fb9182903d3b6138aa3bbd05d9b
https://github.com/Stinger-Soft/PhpCommons/blob/e1d7e2bb7b384fb9182903d3b6138aa3bbd05d9b/src/StingerSoft/PhpCommons/String/Utils.php#L117-L155
193,688
Stinger-Soft/PhpCommons
src/StingerSoft/PhpCommons/String/Utils.php
Utils.hashCode
public static function hashCode($string) { // Code from https://stackoverflow.com/a/40688976/3918483 $hash = 0; if(!is_string($string)) { return $hash; } $len = mb_strlen($string, 'UTF-8'); if($len === 0) { return $hash; } for($i = 0; $i < $len; $i++) { $c = mb_substr($string, $i, 1, 'UTF-8');...
php
public static function hashCode($string) { // Code from https://stackoverflow.com/a/40688976/3918483 $hash = 0; if(!is_string($string)) { return $hash; } $len = mb_strlen($string, 'UTF-8'); if($len === 0) { return $hash; } for($i = 0; $i < $len; $i++) { $c = mb_substr($string, $i, 1, 'UTF-8');...
[ "public", "static", "function", "hashCode", "(", "$", "string", ")", "{", "// Code from https://stackoverflow.com/a/40688976/3918483", "$", "hash", "=", "0", ";", "if", "(", "!", "is_string", "(", "$", "string", ")", ")", "{", "return", "$", "hash", ";", "}"...
Get an integer based hash code of the given string. @param string $string the string to be hashed @return int the hash code of the given string
[ "Get", "an", "integer", "based", "hash", "code", "of", "the", "given", "string", "." ]
e1d7e2bb7b384fb9182903d3b6138aa3bbd05d9b
https://github.com/Stinger-Soft/PhpCommons/blob/e1d7e2bb7b384fb9182903d3b6138aa3bbd05d9b/src/StingerSoft/PhpCommons/String/Utils.php#L199-L217
193,689
nemundo/core
src/Text/TextConvert.php
TextConvert.removeHtmlTag
static function removeHtmlTag($text) { $text = htmlspecialchars_decode($text); $text = html_entity_decode($text); $text = strip_tags($text); return $text; }
php
static function removeHtmlTag($text) { $text = htmlspecialchars_decode($text); $text = html_entity_decode($text); $text = strip_tags($text); return $text; }
[ "static", "function", "removeHtmlTag", "(", "$", "text", ")", "{", "$", "text", "=", "htmlspecialchars_decode", "(", "$", "text", ")", ";", "$", "text", "=", "html_entity_decode", "(", "$", "text", ")", ";", "$", "text", "=", "strip_tags", "(", "$", "t...
Entfernt Html Tags und Umlaute @param $text @return string
[ "Entfernt", "Html", "Tags", "und", "Umlaute" ]
5ca14889fdfb9155b52fedb364b34502d14e21ed
https://github.com/nemundo/core/blob/5ca14889fdfb9155b52fedb364b34502d14e21ed/src/Text/TextConvert.php#L132-L140
193,690
dittertp/Puzzle
src/Puzzle/Serializer/DefaultSerializer.php
DefaultSerializer.serialize
public function serialize($data) { if (is_string($data) === true) { return $data; } else { $data = json_encode($data); if ($data === '[]') { return '{}'; } else { return $data; } } }
php
public function serialize($data) { if (is_string($data) === true) { return $data; } else { $data = json_encode($data); if ($data === '[]') { return '{}'; } else { return $data; } } }
[ "public", "function", "serialize", "(", "$", "data", ")", "{", "if", "(", "is_string", "(", "$", "data", ")", "===", "true", ")", "{", "return", "$", "data", ";", "}", "else", "{", "$", "data", "=", "json_encode", "(", "$", "data", ")", ";", "if"...
Serialize assoc array into JSON string @param string|array $data Assoc array to encode into JSON @return string
[ "Serialize", "assoc", "array", "into", "JSON", "string" ]
cb3dfd64b0df8610c054dbb43b242fbf2cf668a0
https://github.com/dittertp/Puzzle/blob/cb3dfd64b0df8610c054dbb43b242fbf2cf668a0/src/Puzzle/Serializer/DefaultSerializer.php#L46-L60
193,691
dittertp/Puzzle
src/Puzzle/Serializer/DefaultSerializer.php
DefaultSerializer.deserialize
public function deserialize($data) { $result = json_decode($data, true); if ($result === null) { return $data; } return $result; }
php
public function deserialize($data) { $result = json_decode($data, true); if ($result === null) { return $data; } return $result; }
[ "public", "function", "deserialize", "(", "$", "data", ")", "{", "$", "result", "=", "json_decode", "(", "$", "data", ",", "true", ")", ";", "if", "(", "$", "result", "===", "null", ")", "{", "return", "$", "data", ";", "}", "return", "$", "result"...
Deserialize JSON into an assoc array @param string $data JSON encoded string @return mixed
[ "Deserialize", "JSON", "into", "an", "assoc", "array" ]
cb3dfd64b0df8610c054dbb43b242fbf2cf668a0
https://github.com/dittertp/Puzzle/blob/cb3dfd64b0df8610c054dbb43b242fbf2cf668a0/src/Puzzle/Serializer/DefaultSerializer.php#L69-L76
193,692
Thruio/ActiveRecord
src/DatabaseLayer/Sql/GenericSql.php
GenericSql.process
public function process(DatabaseLayer\VirtualQuery $thing) { switch ($thing->getOperation()) { case 'Insert': //Create return $this->processInsert($thing); case 'Select': //Read return $this->processSelect($thing); ...
php
public function process(DatabaseLayer\VirtualQuery $thing) { switch ($thing->getOperation()) { case 'Insert': //Create return $this->processInsert($thing); case 'Select': //Read return $this->processSelect($thing); ...
[ "public", "function", "process", "(", "DatabaseLayer", "\\", "VirtualQuery", "$", "thing", ")", "{", "switch", "(", "$", "thing", "->", "getOperation", "(", ")", ")", "{", "case", "'Insert'", ":", "//Create", "return", "$", "this", "->", "processInsert", "...
Turn a VirtualQuery into a SQL statement @param \Thru\ActiveRecord\DatabaseLayer\VirtualQuery $thing @return array|boolean @throws Exception
[ "Turn", "a", "VirtualQuery", "into", "a", "SQL", "statement" ]
90b0f838cd0e0fb7f3b56a0c38632ff08b3c3461
https://github.com/Thruio/ActiveRecord/blob/90b0f838cd0e0fb7f3b56a0c38632ff08b3c3461/src/DatabaseLayer/Sql/GenericSql.php#L18-L39
193,693
devlabmtl/haven-web
Repository/PostRepository.php
PostRepository.findLastCreatedOnline
public function findLastCreatedOnline($qt) { $query_builder = $this->getBaseBuilder(); $this->FilterByTranslationStatus($query_builder, PostTranslation::STATUS_PUBLISHED); $query_builder // ->orderBy("p.created_at", "ASC") ->setMaxResults($qt); return $qu...
php
public function findLastCreatedOnline($qt) { $query_builder = $this->getBaseBuilder(); $this->FilterByTranslationStatus($query_builder, PostTranslation::STATUS_PUBLISHED); $query_builder // ->orderBy("p.created_at", "ASC") ->setMaxResults($qt); return $qu...
[ "public", "function", "findLastCreatedOnline", "(", "$", "qt", ")", "{", "$", "query_builder", "=", "$", "this", "->", "getBaseBuilder", "(", ")", ";", "$", "this", "->", "FilterByTranslationStatus", "(", "$", "query_builder", ",", "PostTranslation", "::", "ST...
Return a query for last crated post. @param boolean $return_qb @param \Doctrine\ORM\QueryBuilder $query_builder @return type
[ "Return", "a", "query", "for", "last", "crated", "post", "." ]
0d091bc5a8bda4c78c07a11be3525b88781b993a
https://github.com/devlabmtl/haven-web/blob/0d091bc5a8bda4c78c07a11be3525b88781b993a/Repository/PostRepository.php#L37-L46
193,694
ContaoDMS/dms-FileTypeSets
system/modules/DocumentManagementSystemFileTypeSets/classes/DmsFileTypeSetsModificator.php
DmsFileTypeSetsModificator.addFileTypeSetsToCategory
public function addFileTypeSetsToCategory(\Category $category, $dbResultCategory) { $arrFileTypesOfSets = array(); $arrFileTypeSetIds = deserialize($dbResultCategory->file_type_sets); if (!empty($arrFileTypeSetIds)) { foreach($arrFileTypeSetIds as $arrFileTypeSetId) { $arrFileTypes...
php
public function addFileTypeSetsToCategory(\Category $category, $dbResultCategory) { $arrFileTypesOfSets = array(); $arrFileTypeSetIds = deserialize($dbResultCategory->file_type_sets); if (!empty($arrFileTypeSetIds)) { foreach($arrFileTypeSetIds as $arrFileTypeSetId) { $arrFileTypes...
[ "public", "function", "addFileTypeSetsToCategory", "(", "\\", "Category", "$", "category", ",", "$", "dbResultCategory", ")", "{", "$", "arrFileTypesOfSets", "=", "array", "(", ")", ";", "$", "arrFileTypeSetIds", "=", "deserialize", "(", "$", "dbResultCategory", ...
Modify loaded categories.
[ "Modify", "loaded", "categories", "." ]
7a88a5d5d3e9e0cbfab442944d4199ec135f67b6
https://github.com/ContaoDMS/dms-FileTypeSets/blob/7a88a5d5d3e9e0cbfab442944d4199ec135f67b6/system/modules/DocumentManagementSystemFileTypeSets/classes/DmsFileTypeSetsModificator.php#L88-L105
193,695
geoffadams/bedrest-core
library/BedRest/Rest/Request/Request.php
Request.setMethod
public function setMethod($method = null) { if ($method === null) { $method = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : null; } $this->method = $method; }
php
public function setMethod($method = null) { if ($method === null) { $method = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : null; } $this->method = $method; }
[ "public", "function", "setMethod", "(", "$", "method", "=", "null", ")", "{", "if", "(", "$", "method", "===", "null", ")", "{", "$", "method", "=", "isset", "(", "$", "_SERVER", "[", "'REQUEST_METHOD'", "]", ")", "?", "$", "_SERVER", "[", "'REQUEST_...
Sets the HTTP method of the request. If the provided value is null, it is automatically detected from the environment. @param string $method
[ "Sets", "the", "HTTP", "method", "of", "the", "request", ".", "If", "the", "provided", "value", "is", "null", "it", "is", "automatically", "detected", "from", "the", "environment", "." ]
a77bf8b7492dfbfb720b201f7ec91a4f03417b5c
https://github.com/geoffadams/bedrest-core/blob/a77bf8b7492dfbfb720b201f7ec91a4f03417b5c/library/BedRest/Rest/Request/Request.php#L111-L118
193,696
geoffadams/bedrest-core
library/BedRest/Rest/Request/Request.php
Request.getParameter
public function getParameter($parameter, $default = null) { if (!isset($this->parameters[$parameter])) { return $default; } return $this->parameters[$parameter]; }
php
public function getParameter($parameter, $default = null) { if (!isset($this->parameters[$parameter])) { return $default; } return $this->parameters[$parameter]; }
[ "public", "function", "getParameter", "(", "$", "parameter", ",", "$", "default", "=", "null", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "parameters", "[", "$", "parameter", "]", ")", ")", "{", "return", "$", "default", ";", "}", "...
Returns the value of a single query string parameter. @param string $parameter @param mixed $default @return mixed
[ "Returns", "the", "value", "of", "a", "single", "query", "string", "parameter", "." ]
a77bf8b7492dfbfb720b201f7ec91a4f03417b5c
https://github.com/geoffadams/bedrest-core/blob/a77bf8b7492dfbfb720b201f7ec91a4f03417b5c/library/BedRest/Rest/Request/Request.php#L153-L160
193,697
geoffadams/bedrest-core
library/BedRest/Rest/Request/Request.php
Request.setContentType
public function setContentType($contentType = null) { if ($contentType === null) { $contentType = isset($_SERVER['CONTENT_TYPE']) ? $_SERVER['CONTENT_TYPE'] : null; } $this->contentType = $contentType; }
php
public function setContentType($contentType = null) { if ($contentType === null) { $contentType = isset($_SERVER['CONTENT_TYPE']) ? $_SERVER['CONTENT_TYPE'] : null; } $this->contentType = $contentType; }
[ "public", "function", "setContentType", "(", "$", "contentType", "=", "null", ")", "{", "if", "(", "$", "contentType", "===", "null", ")", "{", "$", "contentType", "=", "isset", "(", "$", "_SERVER", "[", "'CONTENT_TYPE'", "]", ")", "?", "$", "_SERVER", ...
Sets the content type of the request content. If the provided value is null, it is automatically detected from the environment. @param string $contentType
[ "Sets", "the", "content", "type", "of", "the", "request", "content", ".", "If", "the", "provided", "value", "is", "null", "it", "is", "automatically", "detected", "from", "the", "environment", "." ]
a77bf8b7492dfbfb720b201f7ec91a4f03417b5c
https://github.com/geoffadams/bedrest-core/blob/a77bf8b7492dfbfb720b201f7ec91a4f03417b5c/library/BedRest/Rest/Request/Request.php#L195-L202
193,698
squareproton/Bond
src/Bond/Exception/BadTypeException.php
BadTypeException.getVarForDisplay
public function getVarForDisplay() { if( is_object( $this->var ) ) { $output = "object ". get_class( $this->var ); } elseif( is_string( $this->var ) or is_array( $this->var ) ) { $type = is_string( $this->var ) ? 'string' : 'array'; $working = json_encode($this->...
php
public function getVarForDisplay() { if( is_object( $this->var ) ) { $output = "object ". get_class( $this->var ); } elseif( is_string( $this->var ) or is_array( $this->var ) ) { $type = is_string( $this->var ) ? 'string' : 'array'; $working = json_encode($this->...
[ "public", "function", "getVarForDisplay", "(", ")", "{", "if", "(", "is_object", "(", "$", "this", "->", "var", ")", ")", "{", "$", "output", "=", "\"object \"", ".", "get_class", "(", "$", "this", "->", "var", ")", ";", "}", "elseif", "(", "is_strin...
Get a human readable representation of the passed varibale @return string
[ "Get", "a", "human", "readable", "representation", "of", "the", "passed", "varibale" ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Exception/BadTypeException.php#L45-L80
193,699
ezra-obiwale/dSCore
src/Form/AValidator.php
AValidator.addFilters
final public function addFilters($elementName, array $filters) { $this->elements[$elementName]->filters->add($filters); return $this; }
php
final public function addFilters($elementName, array $filters) { $this->elements[$elementName]->filters->add($filters); return $this; }
[ "final", "public", "function", "addFilters", "(", "$", "elementName", ",", "array", "$", "filters", ")", "{", "$", "this", "->", "elements", "[", "$", "elementName", "]", "->", "filters", "->", "add", "(", "$", "filters", ")", ";", "return", "$", "this...
Add filters to specified element @param string $elementName @param array $filters @return \DScribe\Form\AValidator
[ "Add", "filters", "to", "specified", "element" ]
dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d
https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/Form/AValidator.php#L50-L53