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
24,900
chee-commerce/CheeModule
src/Chee/Module/CheeModule.php
CheeModule.removeModuleDirectory
protected function removeModuleDirectory($moduleName) { $this->files->deleteDirectory($this->getModuleDirectory($moduleName)); if($this->files->exists($this->getModuleDirectory($moduleName))) { $this->errors->add('delete_files', 'Unable to delete '.$this->getModuleDirectory($modu...
php
protected function removeModuleDirectory($moduleName) { $this->files->deleteDirectory($this->getModuleDirectory($moduleName)); if($this->files->exists($this->getModuleDirectory($moduleName))) { $this->errors->add('delete_files', 'Unable to delete '.$this->getModuleDirectory($modu...
[ "protected", "function", "removeModuleDirectory", "(", "$", "moduleName", ")", "{", "$", "this", "->", "files", "->", "deleteDirectory", "(", "$", "this", "->", "getModuleDirectory", "(", "$", "moduleName", ")", ")", ";", "if", "(", "$", "this", "->", "fil...
Remove module directory @param string $moduleName @return bool
[ "Remove", "module", "directory" ]
ccfff426f4ecf8f13687f5acd49246ba4997deee
https://github.com/chee-commerce/CheeModule/blob/ccfff426f4ecf8f13687f5acd49246ba4997deee/src/Chee/Module/CheeModule.php#L319-L328
24,901
chee-commerce/CheeModule
src/Chee/Module/CheeModule.php
CheeModule.sysVersionDependency
protected function sysVersionDependency($version) { $sysVersion = new Version($this->sysMajorVersion.'.'.$this->sysMinorVersion.'.'.$this->sysPathVersion); $needVersion = new Version($version); if (!$sysVersion->isPartOf($needVersion)) { $this->errors->add('module_depend...
php
protected function sysVersionDependency($version) { $sysVersion = new Version($this->sysMajorVersion.'.'.$this->sysMinorVersion.'.'.$this->sysPathVersion); $needVersion = new Version($version); if (!$sysVersion->isPartOf($needVersion)) { $this->errors->add('module_depend...
[ "protected", "function", "sysVersionDependency", "(", "$", "version", ")", "{", "$", "sysVersion", "=", "new", "Version", "(", "$", "this", "->", "sysMajorVersion", ".", "'.'", ".", "$", "this", "->", "sysMinorVersion", ".", "'.'", ".", "$", "this", "->", ...
Check system dependency @param string $version @return bool
[ "Check", "system", "dependency" ]
ccfff426f4ecf8f13687f5acd49246ba4997deee
https://github.com/chee-commerce/CheeModule/blob/ccfff426f4ecf8f13687f5acd49246ba4997deee/src/Chee/Module/CheeModule.php#L336-L347
24,902
chee-commerce/CheeModule
src/Chee/Module/CheeModule.php
CheeModule.checkDependency
protected function checkDependency($dependencies = null) { $errors = array(); if (is_null($dependencies)) $dependencies = array(); $i = 0; $clean = true; foreach ($dependencies as $module => $version) { if ($module == $this->systemName) { ...
php
protected function checkDependency($dependencies = null) { $errors = array(); if (is_null($dependencies)) $dependencies = array(); $i = 0; $clean = true; foreach ($dependencies as $module => $version) { if ($module == $this->systemName) { ...
[ "protected", "function", "checkDependency", "(", "$", "dependencies", "=", "null", ")", "{", "$", "errors", "=", "array", "(", ")", ";", "if", "(", "is_null", "(", "$", "dependencies", ")", ")", "$", "dependencies", "=", "array", "(", ")", ";", "$", ...
Check module dependencies @param array $dependencies @return bool
[ "Check", "module", "dependencies" ]
ccfff426f4ecf8f13687f5acd49246ba4997deee
https://github.com/chee-commerce/CheeModule/blob/ccfff426f4ecf8f13687f5acd49246ba4997deee/src/Chee/Module/CheeModule.php#L355-L400
24,903
chee-commerce/CheeModule
src/Chee/Module/CheeModule.php
CheeModule.uninstall
public function uninstall($moduleName) { $module = $this->findOrFalse('module_name', $moduleName); if ($module) { $version = $this->def($moduleName, 'version'); if ($this->checkModuleDepends($moduleName, new Version($version))) return false; ...
php
public function uninstall($moduleName) { $module = $this->findOrFalse('module_name', $moduleName); if ($module) { $version = $this->def($moduleName, 'version'); if ($this->checkModuleDepends($moduleName, new Version($version))) return false; ...
[ "public", "function", "uninstall", "(", "$", "moduleName", ")", "{", "$", "module", "=", "$", "this", "->", "findOrFalse", "(", "'module_name'", ",", "$", "moduleName", ")", ";", "if", "(", "$", "module", ")", "{", "$", "version", "=", "$", "this", "...
Uninstall module and remove assets @param string $moduleName @return bool
[ "Uninstall", "module", "and", "remove", "assets" ]
ccfff426f4ecf8f13687f5acd49246ba4997deee
https://github.com/chee-commerce/CheeModule/blob/ccfff426f4ecf8f13687f5acd49246ba4997deee/src/Chee/Module/CheeModule.php#L420-L442
24,904
chee-commerce/CheeModule
src/Chee/Module/CheeModule.php
CheeModule.install
public function install($tempPath, $moduleName) { //Check module dependecies $moduleDependency = $this->def($tempPath, 'require', true); if (!$moduleDependency = $this->checkDependency($moduleDependency)) return false; //Move extracted module to modules path if (...
php
public function install($tempPath, $moduleName) { //Check module dependecies $moduleDependency = $this->def($tempPath, 'require', true); if (!$moduleDependency = $this->checkDependency($moduleDependency)) return false; //Move extracted module to modules path if (...
[ "public", "function", "install", "(", "$", "tempPath", ",", "$", "moduleName", ")", "{", "//Check module dependecies", "$", "moduleDependency", "=", "$", "this", "->", "def", "(", "$", "tempPath", ",", "'require'", ",", "true", ")", ";", "if", "(", "!", ...
Install module and build assets @param string $moduleName @param string path of module @return bool
[ "Install", "module", "and", "build", "assets" ]
ccfff426f4ecf8f13687f5acd49246ba4997deee
https://github.com/chee-commerce/CheeModule/blob/ccfff426f4ecf8f13687f5acd49246ba4997deee/src/Chee/Module/CheeModule.php#L451-L472
24,905
chee-commerce/CheeModule
src/Chee/Module/CheeModule.php
CheeModule.updateRegisteredModule
protected function updateRegisteredModule($moduleName) { $module = $this->findOrFalse('module_name', $moduleName); $module->module_version = $this->def($moduleName, 'version'); $module->module_is_updated = 1; $module->save(); }
php
protected function updateRegisteredModule($moduleName) { $module = $this->findOrFalse('module_name', $moduleName); $module->module_version = $this->def($moduleName, 'version'); $module->module_is_updated = 1; $module->save(); }
[ "protected", "function", "updateRegisteredModule", "(", "$", "moduleName", ")", "{", "$", "module", "=", "$", "this", "->", "findOrFalse", "(", "'module_name'", ",", "$", "moduleName", ")", ";", "$", "module", "->", "module_version", "=", "$", "this", "->", ...
Update metadate of module updated @param string $moduleName @return void
[ "Update", "metadate", "of", "module", "updated" ]
ccfff426f4ecf8f13687f5acd49246ba4997deee
https://github.com/chee-commerce/CheeModule/blob/ccfff426f4ecf8f13687f5acd49246ba4997deee/src/Chee/Module/CheeModule.php#L499-L505
24,906
chee-commerce/CheeModule
src/Chee/Module/CheeModule.php
CheeModule.zipInit
public function zipInit($archive, $callback = null) { $tempPath = $this->getAssetDirectory().'/#tmp/'.uniqid(); $result = $this->traceZip($archive, $tempPath); $this->files->deleteDirectory($tempPath); if (!is_null($callback)) call_user_func($callback, $result[0], $res...
php
public function zipInit($archive, $callback = null) { $tempPath = $this->getAssetDirectory().'/#tmp/'.uniqid(); $result = $this->traceZip($archive, $tempPath); $this->files->deleteDirectory($tempPath); if (!is_null($callback)) call_user_func($callback, $result[0], $res...
[ "public", "function", "zipInit", "(", "$", "archive", ",", "$", "callback", "=", "null", ")", "{", "$", "tempPath", "=", "$", "this", "->", "getAssetDirectory", "(", ")", ".", "'/#tmp/'", ".", "uniqid", "(", ")", ";", "$", "result", "=", "$", "this",...
Initialize zip module @param string $archive path of module zip @param callback|null $callback parameters: bool $result, string $moduleName @return bool
[ "Initialize", "zip", "module" ]
ccfff426f4ecf8f13687f5acd49246ba4997deee
https://github.com/chee-commerce/CheeModule/blob/ccfff426f4ecf8f13687f5acd49246ba4997deee/src/Chee/Module/CheeModule.php#L515-L527
24,907
chee-commerce/CheeModule
src/Chee/Module/CheeModule.php
CheeModule.traceZip
protected function traceZip($archive, $tempPath) { if (!$archive = $this->extractZip($archive, $tempPath, true)) return array(false, null); //Check module has requires file if (!$this->checkRequires($tempPath)) return array(false, null); $moduleName = $this-...
php
protected function traceZip($archive, $tempPath) { if (!$archive = $this->extractZip($archive, $tempPath, true)) return array(false, null); //Check module has requires file if (!$this->checkRequires($tempPath)) return array(false, null); $moduleName = $this-...
[ "protected", "function", "traceZip", "(", "$", "archive", ",", "$", "tempPath", ")", "{", "if", "(", "!", "$", "archive", "=", "$", "this", "->", "extractZip", "(", "$", "archive", ",", "$", "tempPath", ",", "true", ")", ")", "return", "array", "(", ...
Step by Step to install or update a module zip @param string $archive path of zip @param string $tempPath path of extract zip @return array array(bool $result, string $moduleName)
[ "Step", "by", "Step", "to", "install", "or", "update", "a", "module", "zip" ]
ccfff426f4ecf8f13687f5acd49246ba4997deee
https://github.com/chee-commerce/CheeModule/blob/ccfff426f4ecf8f13687f5acd49246ba4997deee/src/Chee/Module/CheeModule.php#L536-L552
24,908
chee-commerce/CheeModule
src/Chee/Module/CheeModule.php
CheeModule.checkRequires
protected function checkRequires($modulePath) { $requires = $this->getConfig('requires', array()); foreach($requires as $key => $value) { if (is_array($value)) { if (!$this->files->exists($modulePath.'/'.$key)) { $t...
php
protected function checkRequires($modulePath) { $requires = $this->getConfig('requires', array()); foreach($requires as $key => $value) { if (is_array($value)) { if (!$this->files->exists($modulePath.'/'.$key)) { $t...
[ "protected", "function", "checkRequires", "(", "$", "modulePath", ")", "{", "$", "requires", "=", "$", "this", "->", "getConfig", "(", "'requires'", ",", "array", "(", ")", ")", ";", "foreach", "(", "$", "requires", "as", "$", "key", "=>", "$", "value"...
Check module has required file @param string $modulePath @return bool
[ "Check", "module", "has", "required", "file" ]
ccfff426f4ecf8f13687f5acd49246ba4997deee
https://github.com/chee-commerce/CheeModule/blob/ccfff426f4ecf8f13687f5acd49246ba4997deee/src/Chee/Module/CheeModule.php#L560-L601
24,909
chee-commerce/CheeModule
src/Chee/Module/CheeModule.php
CheeModule.checkModuleDepends
public function checkModuleDepends($moduleName, Version $curVersion, Version $newVersion = null) { $modules = $this->getListAllModules(); $clean = true; $i = 0; foreach ($modules as $module) { $depends = $this->def($module['name'], 'require', false, array()); ...
php
public function checkModuleDepends($moduleName, Version $curVersion, Version $newVersion = null) { $modules = $this->getListAllModules(); $clean = true; $i = 0; foreach ($modules as $module) { $depends = $this->def($module['name'], 'require', false, array()); ...
[ "public", "function", "checkModuleDepends", "(", "$", "moduleName", ",", "Version", "$", "curVersion", ",", "Version", "$", "newVersion", "=", "null", ")", "{", "$", "modules", "=", "$", "this", "->", "getListAllModules", "(", ")", ";", "$", "clean", "=", ...
Check others modules depends to this module or not, when update or delete module @param string $moduleName @param Chee\Version\Version $curVersion for update required @param Chee\Version\Version $newVersion for delete not required @return bool
[ "Check", "others", "modules", "depends", "to", "this", "module", "or", "not", "when", "update", "or", "delete", "module" ]
ccfff426f4ecf8f13687f5acd49246ba4997deee
https://github.com/chee-commerce/CheeModule/blob/ccfff426f4ecf8f13687f5acd49246ba4997deee/src/Chee/Module/CheeModule.php#L671-L709
24,910
chee-commerce/CheeModule
src/Chee/Module/CheeModule.php
CheeModule.extractZip
protected function extractZip($archive, $target, $deleteSource = false) { if (!$this->files->exists($target)) { $this->files->makeDirectory($target, 0777, true); } $archive = new Pclzip($archive); if ($archive->extract(PCLZIP_OPT_PATH, $target) == 0) { ...
php
protected function extractZip($archive, $target, $deleteSource = false) { if (!$this->files->exists($target)) { $this->files->makeDirectory($target, 0777, true); } $archive = new Pclzip($archive); if ($archive->extract(PCLZIP_OPT_PATH, $target) == 0) { ...
[ "protected", "function", "extractZip", "(", "$", "archive", ",", "$", "target", ",", "$", "deleteSource", "=", "false", ")", "{", "if", "(", "!", "$", "this", "->", "files", "->", "exists", "(", "$", "target", ")", ")", "{", "$", "this", "->", "fil...
Extract zip file @param string $archive path of archive @param string $target @param bool $deleteSource @return Chee\Pclzip\Pclzip|false
[ "Extract", "zip", "file" ]
ccfff426f4ecf8f13687f5acd49246ba4997deee
https://github.com/chee-commerce/CheeModule/blob/ccfff426f4ecf8f13687f5acd49246ba4997deee/src/Chee/Module/CheeModule.php#L719-L738
24,911
chee-commerce/CheeModule
src/Chee/Module/CheeModule.php
CheeModule.moduleExists
public function moduleExists($moduleName, $returnId = false) { $module = $this->findOrFalse('module_name', $moduleName); if ($module) { if ($returnId) return $module->module_id; else return true; } return false; }
php
public function moduleExists($moduleName, $returnId = false) { $module = $this->findOrFalse('module_name', $moduleName); if ($module) { if ($returnId) return $module->module_id; else return true; } return false; }
[ "public", "function", "moduleExists", "(", "$", "moduleName", ",", "$", "returnId", "=", "false", ")", "{", "$", "module", "=", "$", "this", "->", "findOrFalse", "(", "'module_name'", ",", "$", "moduleName", ")", ";", "if", "(", "$", "module", ")", "{"...
Check if module exists @param string $moduleName @param bool $returnId @return bool
[ "Check", "if", "module", "exists" ]
ccfff426f4ecf8f13687f5acd49246ba4997deee
https://github.com/chee-commerce/CheeModule/blob/ccfff426f4ecf8f13687f5acd49246ba4997deee/src/Chee/Module/CheeModule.php#L747-L759
24,912
chee-commerce/CheeModule
src/Chee/Module/CheeModule.php
CheeModule.findOrFalse
public function findOrFalse($field, $name) { $module = ModuleModel::where($field, $name)->first(); return !is_null($module) ? $module : false; }
php
public function findOrFalse($field, $name) { $module = ModuleModel::where($field, $name)->first(); return !is_null($module) ? $module : false; }
[ "public", "function", "findOrFalse", "(", "$", "field", ",", "$", "name", ")", "{", "$", "module", "=", "ModuleModel", "::", "where", "(", "$", "field", ",", "$", "name", ")", "->", "first", "(", ")", ";", "return", "!", "is_null", "(", "$", "modul...
Find one record from model @param string $field @param string $name @return object|false
[ "Find", "one", "record", "from", "model" ]
ccfff426f4ecf8f13687f5acd49246ba4997deee
https://github.com/chee-commerce/CheeModule/blob/ccfff426f4ecf8f13687f5acd49246ba4997deee/src/Chee/Module/CheeModule.php#L768-L771
24,913
chee-commerce/CheeModule
src/Chee/Module/CheeModule.php
CheeModule.getModuleDirectory
public function getModuleDirectory($moduleName) { if ($this->files->exists($this->path.'/'.$moduleName)) return $this->path.'/'.$moduleName; else return false; }
php
public function getModuleDirectory($moduleName) { if ($this->files->exists($this->path.'/'.$moduleName)) return $this->path.'/'.$moduleName; else return false; }
[ "public", "function", "getModuleDirectory", "(", "$", "moduleName", ")", "{", "if", "(", "$", "this", "->", "files", "->", "exists", "(", "$", "this", "->", "path", ".", "'/'", ".", "$", "moduleName", ")", ")", "return", "$", "this", "->", "path", "....
Get path of specific module @param string $moduleName name of module @return string|false
[ "Get", "path", "of", "specific", "module" ]
ccfff426f4ecf8f13687f5acd49246ba4997deee
https://github.com/chee-commerce/CheeModule/blob/ccfff426f4ecf8f13687f5acd49246ba4997deee/src/Chee/Module/CheeModule.php#L779-L786
24,914
chee-commerce/CheeModule
src/Chee/Module/CheeModule.php
CheeModule.getAssetDirectory
public function getAssetDirectory($moduleName = null) { if ($moduleName) return public_path().'/'.$this->getConfig('assets').'/'.$moduleName; return public_path().'/'.$this->getConfig('assets').'/'; }
php
public function getAssetDirectory($moduleName = null) { if ($moduleName) return public_path().'/'.$this->getConfig('assets').'/'.$moduleName; return public_path().'/'.$this->getConfig('assets').'/'; }
[ "public", "function", "getAssetDirectory", "(", "$", "moduleName", "=", "null", ")", "{", "if", "(", "$", "moduleName", ")", "return", "public_path", "(", ")", ".", "'/'", ".", "$", "this", "->", "getConfig", "(", "'assets'", ")", ".", "'/'", ".", "$",...
Get assets path of speciic module @param string|null $moduleName name of module @return string
[ "Get", "assets", "path", "of", "speciic", "module" ]
ccfff426f4ecf8f13687f5acd49246ba4997deee
https://github.com/chee-commerce/CheeModule/blob/ccfff426f4ecf8f13687f5acd49246ba4997deee/src/Chee/Module/CheeModule.php#L794-L800
24,915
zapheus/zapheus
src/Http/Message/RequestFactory.php
RequestFactory.make
public function make() { return new Request($this->method, $this->target, $this->server, $this->cookies, $this->data, $this->files, $this->queries, $this->attributes, $this->uri, $this->headers, $this->stream, $this->version); }
php
public function make() { return new Request($this->method, $this->target, $this->server, $this->cookies, $this->data, $this->files, $this->queries, $this->attributes, $this->uri, $this->headers, $this->stream, $this->version); }
[ "public", "function", "make", "(", ")", "{", "return", "new", "Request", "(", "$", "this", "->", "method", ",", "$", "this", "->", "target", ",", "$", "this", "->", "server", ",", "$", "this", "->", "cookies", ",", "$", "this", "->", "data", ",", ...
Creates the request instance. @return \Zapheus\Http\Message\RequestInterface
[ "Creates", "the", "request", "instance", "." ]
96618b5cee7d20b6700d0475e4334ae4b5163a6b
https://github.com/zapheus/zapheus/blob/96618b5cee7d20b6700d0475e4334ae4b5163a6b/src/Http/Message/RequestFactory.php#L176-L179
24,916
bheisig/cli
src/Log.php
Log.flush
protected function flush($message) { switch ($this->output) { case self::PRINT_AS_OUTPUT: IO::out($message); break; case self::PRINT_AS_MESSAGE: IO::err($message); break; } }
php
protected function flush($message) { switch ($this->output) { case self::PRINT_AS_OUTPUT: IO::out($message); break; case self::PRINT_AS_MESSAGE: IO::err($message); break; } }
[ "protected", "function", "flush", "(", "$", "message", ")", "{", "switch", "(", "$", "this", "->", "output", ")", "{", "case", "self", "::", "PRINT_AS_OUTPUT", ":", "IO", "::", "out", "(", "$", "message", ")", ";", "break", ";", "case", "self", "::",...
Print message to STDOUT or STDERR @param string $message Message
[ "Print", "message", "to", "STDOUT", "or", "STDERR" ]
ee77266e173335950357899cdfe86b43c00a6776
https://github.com/bheisig/cli/blob/ee77266e173335950357899cdfe86b43c00a6776/src/Log.php#L412-L421
24,917
wb-crowdfusion/crowdfusion
system/core/classes/libraries/database/DTO.php
DTO.setOrderBy
public function setOrderBy($field, $direction = null) { if (empty($field)) return $this; if (count($order = explode(' ', $field)) == 2) { $field = $order[0]; $direction = $order[1]; } $this->orderBy[$field] = empty($direction) ? 'ASC' : $direction...
php
public function setOrderBy($field, $direction = null) { if (empty($field)) return $this; if (count($order = explode(' ', $field)) == 2) { $field = $order[0]; $direction = $order[1]; } $this->orderBy[$field] = empty($direction) ? 'ASC' : $direction...
[ "public", "function", "setOrderBy", "(", "$", "field", ",", "$", "direction", "=", "null", ")", "{", "if", "(", "empty", "(", "$", "field", ")", ")", "return", "$", "this", ";", "if", "(", "count", "(", "$", "order", "=", "explode", "(", "' '", "...
Sets the specified orderBy @param string $field The name of the field @param string $direction The direction to sort. Can be ASC or DESC (default to ASC if not specified) @return DTO $this
[ "Sets", "the", "specified", "orderBy" ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/database/DTO.php#L157-L168
24,918
wb-crowdfusion/crowdfusion
system/core/classes/libraries/database/DTO.php
DTO.getOrderBy
public function getOrderBy($field) { return array_key_exists($field, $this->orderBy) ? $this->orderBy[$field] : null; }
php
public function getOrderBy($field) { return array_key_exists($field, $this->orderBy) ? $this->orderBy[$field] : null; }
[ "public", "function", "getOrderBy", "(", "$", "field", ")", "{", "return", "array_key_exists", "(", "$", "field", ",", "$", "this", "->", "orderBy", ")", "?", "$", "this", "->", "orderBy", "[", "$", "field", "]", ":", "null", ";", "}" ]
Returns the OrderBy direction for the field specified @param string $field the field name to lookup @return string Returns the direction (ASC or DESC) for the field specified, or null if it doesn't exist.
[ "Returns", "the", "OrderBy", "direction", "for", "the", "field", "specified" ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/database/DTO.php#L177-L182
24,919
wb-crowdfusion/crowdfusion
system/core/classes/libraries/database/DTO.php
DTO.setOffset
public function setOffset($offset) { if ($offset >= PHP_INT_MAX) { $offset = false; } $this->offset = $offset; return $this; }
php
public function setOffset($offset) { if ($offset >= PHP_INT_MAX) { $offset = false; } $this->offset = $offset; return $this; }
[ "public", "function", "setOffset", "(", "$", "offset", ")", "{", "if", "(", "$", "offset", ">=", "PHP_INT_MAX", ")", "{", "$", "offset", "=", "false", ";", "}", "$", "this", "->", "offset", "=", "$", "offset", ";", "return", "$", "this", ";", "}" ]
Sets the offset if the offset is greater than the PHP_INT_MAX then the offset will be set to false @param integer $offset The offset @return DTO $this
[ "Sets", "the", "offset" ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/database/DTO.php#L244-L252
24,920
wb-crowdfusion/crowdfusion
system/core/classes/libraries/database/DTO.php
DTO.getResultsAsObjects
public function getResultsAsObjects($classname) { $new = array(); foreach ((array) $this->results as $result) { if (is_array($result)) $new[] = new $classname($result); else $new[] = $result; } return $new; }
php
public function getResultsAsObjects($classname) { $new = array(); foreach ((array) $this->results as $result) { if (is_array($result)) $new[] = new $classname($result); else $new[] = $result; } return $new; }
[ "public", "function", "getResultsAsObjects", "(", "$", "classname", ")", "{", "$", "new", "=", "array", "(", ")", ";", "foreach", "(", "(", "array", ")", "$", "this", "->", "results", "as", "$", "result", ")", "{", "if", "(", "is_array", "(", "$", ...
Returns all the results as objects of the class specified @param string $classname The name of the class to return the objects as @return array An array of the results converted into the new class
[ "Returns", "all", "the", "results", "as", "objects", "of", "the", "class", "specified" ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/database/DTO.php#L369-L379
24,921
wb-crowdfusion/crowdfusion
system/core/classes/libraries/database/DTO.php
DTO.getResultsAsArray
public function getResultsAsArray() { $new = array(); foreach ((array) $this->results as $result) { if ($result instanceof Object) $new[] = $result->toArray(); else if (is_array($result)) return $this->results; else ...
php
public function getResultsAsArray() { $new = array(); foreach ((array) $this->results as $result) { if ($result instanceof Object) $new[] = $result->toArray(); else if (is_array($result)) return $this->results; else ...
[ "public", "function", "getResultsAsArray", "(", ")", "{", "$", "new", "=", "array", "(", ")", ";", "foreach", "(", "(", "array", ")", "$", "this", "->", "results", "as", "$", "result", ")", "{", "if", "(", "$", "result", "instanceof", "Object", ")", ...
Returns all results as an array @return array an Array of all results, each one being an array
[ "Returns", "all", "results", "as", "an", "array" ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/database/DTO.php#L386-L398
24,922
wb-crowdfusion/crowdfusion
system/core/classes/libraries/database/DTO.php
DTO.getColumnOfResults
public function getColumnOfResults($col) { $new = array(); foreach ((array)$this->results as $result) { if ($result instanceof Object) $new[] = $result->$col; else if (is_array($result)) $new[] = $result[$col]; } return $new; ...
php
public function getColumnOfResults($col) { $new = array(); foreach ((array)$this->results as $result) { if ($result instanceof Object) $new[] = $result->$col; else if (is_array($result)) $new[] = $result[$col]; } return $new; ...
[ "public", "function", "getColumnOfResults", "(", "$", "col", ")", "{", "$", "new", "=", "array", "(", ")", ";", "foreach", "(", "(", "array", ")", "$", "this", "->", "results", "as", "$", "result", ")", "{", "if", "(", "$", "result", "instanceof", ...
Returns an array containing the value stored in the column specifed for each result @param string $col The column name to fetch @return array
[ "Returns", "an", "array", "containing", "the", "value", "stored", "in", "the", "column", "specifed", "for", "each", "result" ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/database/DTO.php#L407-L417
24,923
wb-crowdfusion/crowdfusion
system/core/classes/libraries/database/DTO.php
DTO.isRetrieveAsObjects
public function isRetrieveAsObjects($val = null) { if (!is_null($val)) { $this->retrieveAsObjects = $val; return $this; } return $this->retrieveAsObjects == true; }
php
public function isRetrieveAsObjects($val = null) { if (!is_null($val)) { $this->retrieveAsObjects = $val; return $this; } return $this->retrieveAsObjects == true; }
[ "public", "function", "isRetrieveAsObjects", "(", "$", "val", "=", "null", ")", "{", "if", "(", "!", "is_null", "(", "$", "val", ")", ")", "{", "$", "this", "->", "retrieveAsObjects", "=", "$", "val", ";", "return", "$", "this", ";", "}", "return", ...
Determines if the DTO will retrieve the results as objects. Also acts as a setter for retrieve as objects @param boolean $val If set to true or false, then it will retrieve results as objects or arrays respectively. @return mixed Will return DTO $this if $val is specified, otherwise, returns boolean that answers the ...
[ "Determines", "if", "the", "DTO", "will", "retrieve", "the", "results", "as", "objects", ".", "Also", "acts", "as", "a", "setter", "for", "retrieve", "as", "objects" ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/database/DTO.php#L450-L458
24,924
wb-crowdfusion/crowdfusion
system/core/classes/libraries/database/DTO.php
DTO.isRetrieveTotalRecords
public function isRetrieveTotalRecords($val = null) { if (!is_null($val)) { $this->retrieveTotalRecords = $val; return $this; } return $this->retrieveTotalRecords; }
php
public function isRetrieveTotalRecords($val = null) { if (!is_null($val)) { $this->retrieveTotalRecords = $val; return $this; } return $this->retrieveTotalRecords; }
[ "public", "function", "isRetrieveTotalRecords", "(", "$", "val", "=", "null", ")", "{", "if", "(", "!", "is_null", "(", "$", "val", ")", ")", "{", "$", "this", "->", "retrieveTotalRecords", "=", "$", "val", ";", "return", "$", "this", ";", "}", "retu...
Determines if the DTO will retrieve a count of total records for the results Also acts as a setter for retrieve total records @param boolean $val If set to true, then it will retrieve a count of total records for the results. If unspecified, the function will return the current value for retrieveTotalRecords @return ...
[ "Determines", "if", "the", "DTO", "will", "retrieve", "a", "count", "of", "total", "records", "for", "the", "results", "Also", "acts", "as", "a", "setter", "for", "retrieve", "total", "records" ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/database/DTO.php#L470-L478
24,925
siriusSupreme/sirius-broadcast
src/Broadcasters/Broadcaster.php
Broadcaster.extractAuthParameters
protected function extractAuthParameters($pattern, $channel, $callback) { $callbackParameters = (new ReflectionFunction($callback))->getParameters(); return collect($this->extractChannelKeys($pattern, $channel))->reject(function ($value, $key) { return is_numeric($key); })->map(...
php
protected function extractAuthParameters($pattern, $channel, $callback) { $callbackParameters = (new ReflectionFunction($callback))->getParameters(); return collect($this->extractChannelKeys($pattern, $channel))->reject(function ($value, $key) { return is_numeric($key); })->map(...
[ "protected", "function", "extractAuthParameters", "(", "$", "pattern", ",", "$", "channel", ",", "$", "callback", ")", "{", "$", "callbackParameters", "=", "(", "new", "ReflectionFunction", "(", "$", "callback", ")", ")", "->", "getParameters", "(", ")", ";"...
Extract the parameters from the given pattern and channel. @param string $pattern @param string $channel @param callable $callback @return array
[ "Extract", "the", "parameters", "from", "the", "given", "pattern", "and", "channel", "." ]
d98f47973631dbb2da0296fd7066d1a70e9b30f7
https://github.com/siriusSupreme/sirius-broadcast/blob/d98f47973631dbb2da0296fd7066d1a70e9b30f7/src/Broadcasters/Broadcaster.php#L67-L76
24,926
railken/lem
src/Attributes/BaseAttribute.php
BaseAttribute.bootPermissions
public function bootPermissions() { foreach ($this->permissions as $token => $permission) { $this->permissions[$token] = sprintf($permission, Str::kebab($this->getManager()->getName()), Str::kebab($this->getName())); } }
php
public function bootPermissions() { foreach ($this->permissions as $token => $permission) { $this->permissions[$token] = sprintf($permission, Str::kebab($this->getManager()->getName()), Str::kebab($this->getName())); } }
[ "public", "function", "bootPermissions", "(", ")", "{", "foreach", "(", "$", "this", "->", "permissions", "as", "$", "token", "=>", "$", "permission", ")", "{", "$", "this", "->", "permissions", "[", "$", "token", "]", "=", "sprintf", "(", "$", "permis...
Boot permissions.
[ "Boot", "permissions", "." ]
cff1efcd090a9504b2faf5594121885786dea67a
https://github.com/railken/lem/blob/cff1efcd090a9504b2faf5594121885786dea67a/src/Attributes/BaseAttribute.php#L115-L120
24,927
railken/lem
src/Attributes/BaseAttribute.php
BaseAttribute.newException
public function newException(string $code, $value): Exception { $exception = $this->getException($code); return new $exception( strtoupper(Str::kebab($this->getManager()->getName())), strtoupper(Str::kebab($this->getName())), $value ); }
php
public function newException(string $code, $value): Exception { $exception = $this->getException($code); return new $exception( strtoupper(Str::kebab($this->getManager()->getName())), strtoupper(Str::kebab($this->getName())), $value ); }
[ "public", "function", "newException", "(", "string", "$", "code", ",", "$", "value", ")", ":", "Exception", "{", "$", "exception", "=", "$", "this", "->", "getException", "(", "$", "code", ")", ";", "return", "new", "$", "exception", "(", "strtoupper", ...
Create a new instance of exception. @param string $code @param mixed $value @return \Exception
[ "Create", "a", "new", "instance", "of", "exception", "." ]
cff1efcd090a9504b2faf5594121885786dea67a
https://github.com/railken/lem/blob/cff1efcd090a9504b2faf5594121885786dea67a/src/Attributes/BaseAttribute.php#L130-L139
24,928
ekyna/MediaBundle
Install/MediaInstaller.php
MediaInstaller.createRootFolders
private function createRootFolders(OutputInterface $output) { $em = $this->container->get('doctrine.orm.default_entity_manager'); $repository = $this->container->get('ekyna_media.folder.repository'); $name = FolderInterface::ROOT; $output->write(sprintf( '- <comment>%s</...
php
private function createRootFolders(OutputInterface $output) { $em = $this->container->get('doctrine.orm.default_entity_manager'); $repository = $this->container->get('ekyna_media.folder.repository'); $name = FolderInterface::ROOT; $output->write(sprintf( '- <comment>%s</...
[ "private", "function", "createRootFolders", "(", "OutputInterface", "$", "output", ")", "{", "$", "em", "=", "$", "this", "->", "container", "->", "get", "(", "'doctrine.orm.default_entity_manager'", ")", ";", "$", "repository", "=", "$", "this", "->", "contai...
Creates root folders. @param OutputInterface $output
[ "Creates", "root", "folders", "." ]
512cf86c801a130a9f17eba8b48d646d23acdbab
https://github.com/ekyna/MediaBundle/blob/512cf86c801a130a9f17eba8b48d646d23acdbab/Install/MediaInstaller.php#L51-L74
24,929
sil-project/VarietyBundle
src/Entity/PlantCategory.php
PlantCategory.addVariety
public function addVariety(\Librinfo\VarietiesBundle\Entity\Variety $variety) { $this->varieties[] = $variety; return $this; }
php
public function addVariety(\Librinfo\VarietiesBundle\Entity\Variety $variety) { $this->varieties[] = $variety; return $this; }
[ "public", "function", "addVariety", "(", "\\", "Librinfo", "\\", "VarietiesBundle", "\\", "Entity", "\\", "Variety", "$", "variety", ")", "{", "$", "this", "->", "varieties", "[", "]", "=", "$", "variety", ";", "return", "$", "this", ";", "}" ]
Add variety. @param \Librinfo\VarietiesBundle\Entity\Variety $variety @return PlantCategory
[ "Add", "variety", "." ]
e9508ce13a4bb277d10bdcd925fdb84bc01f453f
https://github.com/sil-project/VarietyBundle/blob/e9508ce13a4bb277d10bdcd925fdb84bc01f453f/src/Entity/PlantCategory.php#L90-L95
24,930
sil-project/VarietyBundle
src/Entity/PlantCategory.php
PlantCategory.removeVariety
public function removeVariety(\Librinfo\VarietiesBundle\Entity\Variety $variety) { return $this->varieties->removeElement($variety); }
php
public function removeVariety(\Librinfo\VarietiesBundle\Entity\Variety $variety) { return $this->varieties->removeElement($variety); }
[ "public", "function", "removeVariety", "(", "\\", "Librinfo", "\\", "VarietiesBundle", "\\", "Entity", "\\", "Variety", "$", "variety", ")", "{", "return", "$", "this", "->", "varieties", "->", "removeElement", "(", "$", "variety", ")", ";", "}" ]
Remove variety. @param \Librinfo\VarietiesBundle\Entity\Variety $variety @return bool tRUE if this collection contained the specified element, FALSE otherwise
[ "Remove", "variety", "." ]
e9508ce13a4bb277d10bdcd925fdb84bc01f453f
https://github.com/sil-project/VarietyBundle/blob/e9508ce13a4bb277d10bdcd925fdb84bc01f453f/src/Entity/PlantCategory.php#L104-L107
24,931
sil-project/VarietyBundle
src/Entity/PlantCategory.php
PlantCategory.addSpecies
public function addSpecies(\Librinfo\VarietiesBundle\Entity\Species $species) { $this->species[] = $species; return $this; }
php
public function addSpecies(\Librinfo\VarietiesBundle\Entity\Species $species) { $this->species[] = $species; return $this; }
[ "public", "function", "addSpecies", "(", "\\", "Librinfo", "\\", "VarietiesBundle", "\\", "Entity", "\\", "Species", "$", "species", ")", "{", "$", "this", "->", "species", "[", "]", "=", "$", "species", ";", "return", "$", "this", ";", "}" ]
Add species. @param \Librinfo\VarietiesBundle\Entity\Species $species @return PlantCategory
[ "Add", "species", "." ]
e9508ce13a4bb277d10bdcd925fdb84bc01f453f
https://github.com/sil-project/VarietyBundle/blob/e9508ce13a4bb277d10bdcd925fdb84bc01f453f/src/Entity/PlantCategory.php#L126-L131
24,932
DzikuVx/phpCache
src/File.php
File.synchronize
function synchronize() { $tCounter = 0; if ($this->changed) { $tFile = fopen ( $this->fileName, 'a' ); while ( ! flock ( $tFile, LOCK_EX ) ) { usleep ( 5 ); $tCounter ++; if ($tCounter == 100) { return false; } } $tContent = serialize ( $this->elements ); ftruncate ( $tFile,...
php
function synchronize() { $tCounter = 0; if ($this->changed) { $tFile = fopen ( $this->fileName, 'a' ); while ( ! flock ( $tFile, LOCK_EX ) ) { usleep ( 5 ); $tCounter ++; if ($tCounter == 100) { return false; } } $tContent = serialize ( $this->elements ); ftruncate ( $tFile,...
[ "function", "synchronize", "(", ")", "{", "$", "tCounter", "=", "0", ";", "if", "(", "$", "this", "->", "changed", ")", "{", "$", "tFile", "=", "fopen", "(", "$", "this", "->", "fileName", ",", "'a'", ")", ";", "while", "(", "!", "flock", "(", ...
Synchronize cache with file @return boolean
[ "Synchronize", "cache", "with", "file" ]
faf3003795ab21913e7ebb02fb04d6a480b7786c
https://github.com/DzikuVx/phpCache/blob/faf3003795ab21913e7ebb02fb04d6a480b7786c/src/File.php#L101-L132
24,933
DzikuVx/phpCache
src/File.php
File.check
function check(CacheKey $key) { if (isset ( $this->elements [$key->getModule()] [$key->getProperty()] )) { return true; } else { return false; } }
php
function check(CacheKey $key) { if (isset ( $this->elements [$key->getModule()] [$key->getProperty()] )) { return true; } else { return false; } }
[ "function", "check", "(", "CacheKey", "$", "key", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "elements", "[", "$", "key", "->", "getModule", "(", ")", "]", "[", "$", "key", "->", "getProperty", "(", ")", "]", ")", ")", "{", "return", ...
Check is cache entry is set @param CacheKey $key @return boolean
[ "Check", "is", "cache", "entry", "is", "set" ]
faf3003795ab21913e7ebb02fb04d6a480b7786c
https://github.com/DzikuVx/phpCache/blob/faf3003795ab21913e7ebb02fb04d6a480b7786c/src/File.php#L176-L183
24,934
DzikuVx/phpCache
src/File.php
File.get
public function get(CacheKey $key) { if (!empty($this->elements[$key->getModule()] [$key->getProperty()])) { /** @noinspection PhpUndefinedMethodInspection */ $tValue = $this->elements[$key->getModule()] [$key->getProperty()]->getValue (); return $tValue; } else { return false; } }
php
public function get(CacheKey $key) { if (!empty($this->elements[$key->getModule()] [$key->getProperty()])) { /** @noinspection PhpUndefinedMethodInspection */ $tValue = $this->elements[$key->getModule()] [$key->getProperty()]->getValue (); return $tValue; } else { return false; } }
[ "public", "function", "get", "(", "CacheKey", "$", "key", ")", "{", "if", "(", "!", "empty", "(", "$", "this", "->", "elements", "[", "$", "key", "->", "getModule", "(", ")", "]", "[", "$", "key", "->", "getProperty", "(", ")", "]", ")", ")", "...
Get value from cache or null when not set @param CacheKey $key @return mixed
[ "Get", "value", "from", "cache", "or", "null", "when", "not", "set" ]
faf3003795ab21913e7ebb02fb04d6a480b7786c
https://github.com/DzikuVx/phpCache/blob/faf3003795ab21913e7ebb02fb04d6a480b7786c/src/File.php#L190-L199
24,935
DzikuVx/phpCache
src/File.php
File.clear
public function clear(CacheKey $key) { if (isset ( $this->elements [$key->getModule()] [$key->getProperty()] )) { unset ( $this->elements [$key->getModule()] [$key->getProperty()] ); $this->changed = true; } }
php
public function clear(CacheKey $key) { if (isset ( $this->elements [$key->getModule()] [$key->getProperty()] )) { unset ( $this->elements [$key->getModule()] [$key->getProperty()] ); $this->changed = true; } }
[ "public", "function", "clear", "(", "CacheKey", "$", "key", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "elements", "[", "$", "key", "->", "getModule", "(", ")", "]", "[", "$", "key", "->", "getProperty", "(", ")", "]", ")", ")", "{", ...
Unset cache value @param CacheKey $key
[ "Unset", "cache", "value" ]
faf3003795ab21913e7ebb02fb04d6a480b7786c
https://github.com/DzikuVx/phpCache/blob/faf3003795ab21913e7ebb02fb04d6a480b7786c/src/File.php#L205-L210
24,936
DzikuVx/phpCache
src/File.php
File.clearModule
function clearModule(CacheKey $key) { if (isset ( $this->elements [$key->getModule()] )) { unset ( $this->elements [$key->getModule()] ); $this->changed = true; } }
php
function clearModule(CacheKey $key) { if (isset ( $this->elements [$key->getModule()] )) { unset ( $this->elements [$key->getModule()] ); $this->changed = true; } }
[ "function", "clearModule", "(", "CacheKey", "$", "key", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "elements", "[", "$", "key", "->", "getModule", "(", ")", "]", ")", ")", "{", "unset", "(", "$", "this", "->", "elements", "[", "$", "ke...
Clear whole module and all it's properties @param CacheKey $key @depreciated
[ "Clear", "whole", "module", "and", "all", "it", "s", "properties" ]
faf3003795ab21913e7ebb02fb04d6a480b7786c
https://github.com/DzikuVx/phpCache/blob/faf3003795ab21913e7ebb02fb04d6a480b7786c/src/File.php#L217-L224
24,937
lasallecms/lasallecms-l5-lasallecmsapi-pkg
src/FeaturedImageProcessing/FeaturedImageProcessing.php
FeaturedImageProcessing.process
public function process($data) { $featuredImageProcessing = []; // FEATURED_IMAGE_URL // is the featured image from an external URL? $useFeaturedImageUrl = $this->isFieldValueBlank($data['featured_image_url']); // if using the featured_image_url field, then validate it now ...
php
public function process($data) { $featuredImageProcessing = []; // FEATURED_IMAGE_URL // is the featured image from an external URL? $useFeaturedImageUrl = $this->isFieldValueBlank($data['featured_image_url']); // if using the featured_image_url field, then validate it now ...
[ "public", "function", "process", "(", "$", "data", ")", "{", "$", "featuredImageProcessing", "=", "[", "]", ";", "// FEATURED_IMAGE_URL", "// is the featured image from an external URL?", "$", "useFeaturedImageUrl", "=", "$", "this", "->", "isFieldValueBlank", "(", "$...
Main featured image processing @param array $data Form field data
[ "Main", "featured", "image", "processing" ]
05083be19645d52be86d8ba4f322773db348a11d
https://github.com/lasallecms/lasallecms-l5-lasallecmsapi-pkg/blob/05083be19645d52be86d8ba4f322773db348a11d/src/FeaturedImageProcessing/FeaturedImageProcessing.php#L69-L140
24,938
lasallecms/lasallecms-l5-lasallecmsapi-pkg
src/FeaturedImageProcessing/FeaturedImageProcessing.php
FeaturedImageProcessing.validateFeaturedImageUpload
public function validateFeaturedImageUpload($featuredImageUpload) { // not acceptable file extension if (!$this->isImageFileExtensionKosher($featuredImageUpload)) { return "Your uploaded image file, ".$featuredImageUpload.", is not an accepted image file type."; } // file ...
php
public function validateFeaturedImageUpload($featuredImageUpload) { // not acceptable file extension if (!$this->isImageFileExtensionKosher($featuredImageUpload)) { return "Your uploaded image file, ".$featuredImageUpload.", is not an accepted image file type."; } // file ...
[ "public", "function", "validateFeaturedImageUpload", "(", "$", "featuredImageUpload", ")", "{", "// not acceptable file extension", "if", "(", "!", "$", "this", "->", "isImageFileExtensionKosher", "(", "$", "featuredImageUpload", ")", ")", "{", "return", "\"Your uploade...
Validate the featured_image_upload field's data @param string $featuredImageUpload The featured_image_upload form field's value @return string "passed", or an error message
[ "Validate", "the", "featured_image_upload", "field", "s", "data" ]
05083be19645d52be86d8ba4f322773db348a11d
https://github.com/lasallecms/lasallecms-l5-lasallecmsapi-pkg/blob/05083be19645d52be86d8ba4f322773db348a11d/src/FeaturedImageProcessing/FeaturedImageProcessing.php#L175-L193
24,939
lasallecms/lasallecms-l5-lasallecmsapi-pkg
src/FeaturedImageProcessing/FeaturedImageProcessing.php
FeaturedImageProcessing.validateFeaturedImageServer
public function validateFeaturedImageServer($featuredImageServer) { // if there is no featured_image_server, then there is no featured image -- which is ok if ((!$featuredImageServer) || ($featuredImageServer == "") ) { return "passed"; } // not acceptable file extension ...
php
public function validateFeaturedImageServer($featuredImageServer) { // if there is no featured_image_server, then there is no featured image -- which is ok if ((!$featuredImageServer) || ($featuredImageServer == "") ) { return "passed"; } // not acceptable file extension ...
[ "public", "function", "validateFeaturedImageServer", "(", "$", "featuredImageServer", ")", "{", "// if there is no featured_image_server, then there is no featured image -- which is ok", "if", "(", "(", "!", "$", "featuredImageServer", ")", "||", "(", "$", "featuredImageServer"...
Validate the featured_image_server field's data @param string $featuredImageServer The featured_image_server form field's value @return string "passed", or an error message
[ "Validate", "the", "featured_image_server", "field", "s", "data" ]
05083be19645d52be86d8ba4f322773db348a11d
https://github.com/lasallecms/lasallecms-l5-lasallecmsapi-pkg/blob/05083be19645d52be86d8ba4f322773db348a11d/src/FeaturedImageProcessing/FeaturedImageProcessing.php#L201-L219
24,940
lasallecms/lasallecms-l5-lasallecmsapi-pkg
src/FeaturedImageProcessing/FeaturedImageProcessing.php
FeaturedImageProcessing.isImageFileExtensionKosher
public function isImageFileExtensionKosher($filename) { // must have acceptable file extension $imageFileExtension = $this->ImagesHelper->filenameWithExtensionOnly($filename); $haystack = Config::get('lasallecmsfrontend.acceptable_image_extensions_for_uploading'); if (in_array(strtolo...
php
public function isImageFileExtensionKosher($filename) { // must have acceptable file extension $imageFileExtension = $this->ImagesHelper->filenameWithExtensionOnly($filename); $haystack = Config::get('lasallecmsfrontend.acceptable_image_extensions_for_uploading'); if (in_array(strtolo...
[ "public", "function", "isImageFileExtensionKosher", "(", "$", "filename", ")", "{", "// must have acceptable file extension", "$", "imageFileExtension", "=", "$", "this", "->", "ImagesHelper", "->", "filenameWithExtensionOnly", "(", "$", "filename", ")", ";", "$", "ha...
Is the image's extension allowed? @param string $filename The image's filename @return bool
[ "Is", "the", "image", "s", "extension", "allowed?" ]
05083be19645d52be86d8ba4f322773db348a11d
https://github.com/lasallecms/lasallecms-l5-lasallecmsapi-pkg/blob/05083be19645d52be86d8ba4f322773db348a11d/src/FeaturedImageProcessing/FeaturedImageProcessing.php#L238-L250
24,941
lasallecms/lasallecms-l5-lasallecmsapi-pkg
src/FeaturedImageProcessing/FeaturedImageProcessing.php
FeaturedImageProcessing.doesImageFileExistOnServer
public function doesImageFileExistOnServer($filename) { if (\File::exists($this->ImagesHelper->pathOfImagesUploadParentFolder() . "/" . Config::get('lasallecmsfrontend.images_folder_uploaded'). '/'. $filename)) { return true; } return false; }
php
public function doesImageFileExistOnServer($filename) { if (\File::exists($this->ImagesHelper->pathOfImagesUploadParentFolder() . "/" . Config::get('lasallecmsfrontend.images_folder_uploaded'). '/'. $filename)) { return true; } return false; }
[ "public", "function", "doesImageFileExistOnServer", "(", "$", "filename", ")", "{", "if", "(", "\\", "File", "::", "exists", "(", "$", "this", "->", "ImagesHelper", "->", "pathOfImagesUploadParentFolder", "(", ")", ".", "\"/\"", ".", "Config", "::", "get", "...
Does the iamge file exist already on the server? @param string $filename The image's filename @return bool
[ "Does", "the", "iamge", "file", "exist", "already", "on", "the", "server?" ]
05083be19645d52be86d8ba4f322773db348a11d
https://github.com/lasallecms/lasallecms-l5-lasallecmsapi-pkg/blob/05083be19645d52be86d8ba4f322773db348a11d/src/FeaturedImageProcessing/FeaturedImageProcessing.php#L258-L264
24,942
lasallecms/lasallecms-l5-lasallecmsapi-pkg
src/FeaturedImageProcessing/FeaturedImageProcessing.php
FeaturedImageProcessing.moveFile
public function moveFile($filename) { $destinationPath = $this->ImagesHelper->pathOfImagesUploadParentFolder() . "/" . Config::get('lasallecmsfrontend.images_folder_uploaded'); \Input::file('featured_image_upload')->move($destinationPath, $filename); }
php
public function moveFile($filename) { $destinationPath = $this->ImagesHelper->pathOfImagesUploadParentFolder() . "/" . Config::get('lasallecmsfrontend.images_folder_uploaded'); \Input::file('featured_image_upload')->move($destinationPath, $filename); }
[ "public", "function", "moveFile", "(", "$", "filename", ")", "{", "$", "destinationPath", "=", "$", "this", "->", "ImagesHelper", "->", "pathOfImagesUploadParentFolder", "(", ")", ".", "\"/\"", ".", "Config", "::", "get", "(", "'lasallecmsfrontend.images_folder_up...
Move the uploaded file from the tmp folder to its proper destination folder @param string $filename The image's filename @return null
[ "Move", "the", "uploaded", "file", "from", "the", "tmp", "folder", "to", "its", "proper", "destination", "folder" ]
05083be19645d52be86d8ba4f322773db348a11d
https://github.com/lasallecms/lasallecms-l5-lasallecmsapi-pkg/blob/05083be19645d52be86d8ba4f322773db348a11d/src/FeaturedImageProcessing/FeaturedImageProcessing.php#L277-L282
24,943
andela-doladosu/liteorm
src/Origins/BaseModel.php
BaseModel.where
public function where($table, $column, $keyword) { $connection = Connection::connect(); $selectValue = $connection->prepare('select * from '.$table.' where '.$column.' = \''.$keyword.'\''); $selectValue->execute(); return $selectValue->fetch(PDO::FETCH_ASSOC); }
php
public function where($table, $column, $keyword) { $connection = Connection::connect(); $selectValue = $connection->prepare('select * from '.$table.' where '.$column.' = \''.$keyword.'\''); $selectValue->execute(); return $selectValue->fetch(PDO::FETCH_ASSOC); }
[ "public", "function", "where", "(", "$", "table", ",", "$", "column", ",", "$", "keyword", ")", "{", "$", "connection", "=", "Connection", "::", "connect", "(", ")", ";", "$", "selectValue", "=", "$", "connection", "->", "prepare", "(", "'select * from '...
Return details where a column is matched by the given keyword @param string $table @param string $column @param string $keyword @return array
[ "Return", "details", "where", "a", "column", "is", "matched", "by", "the", "given", "keyword" ]
e97f69e20be4ce0c078a0c25a9a777307d85e9e4
https://github.com/andela-doladosu/liteorm/blob/e97f69e20be4ce0c078a0c25a9a777307d85e9e4/src/Origins/BaseModel.php#L70-L78
24,944
andela-doladosu/liteorm
src/Origins/BaseModel.php
BaseModel.selectAll
protected static function selectAll($model, $tableName) { $connection = Connection::connect(); $getAll = $connection->prepare('select * from '.$tableName); $getAll->execute(); while ($allRows = $getAll->fetch(PDO::FETCH_ASSOC)) { array_push($model->resultRows, $allRo...
php
protected static function selectAll($model, $tableName) { $connection = Connection::connect(); $getAll = $connection->prepare('select * from '.$tableName); $getAll->execute(); while ($allRows = $getAll->fetch(PDO::FETCH_ASSOC)) { array_push($model->resultRows, $allRo...
[ "protected", "static", "function", "selectAll", "(", "$", "model", ",", "$", "tableName", ")", "{", "$", "connection", "=", "Connection", "::", "connect", "(", ")", ";", "$", "getAll", "=", "$", "connection", "->", "prepare", "(", "'select * from '", ".", ...
Search database for all rows @param $model @param $tableName @return mixed
[ "Search", "database", "for", "all", "rows" ]
e97f69e20be4ce0c078a0c25a9a777307d85e9e4
https://github.com/andela-doladosu/liteorm/blob/e97f69e20be4ce0c078a0c25a9a777307d85e9e4/src/Origins/BaseModel.php#L88-L100
24,945
andela-doladosu/liteorm
src/Origins/BaseModel.php
BaseModel.selectOne
protected static function selectOne($model, $tableName, $id) { $connection = Connection::connect(); $getAll = $connection->prepare('select * from '.$tableName.' where id='.$id); $getAll->execute(); $row = $getAll->fetch(PDO::FETCH_ASSOC); array_push($model->resultRows, $row...
php
protected static function selectOne($model, $tableName, $id) { $connection = Connection::connect(); $getAll = $connection->prepare('select * from '.$tableName.' where id='.$id); $getAll->execute(); $row = $getAll->fetch(PDO::FETCH_ASSOC); array_push($model->resultRows, $row...
[ "protected", "static", "function", "selectOne", "(", "$", "model", ",", "$", "tableName", ",", "$", "id", ")", "{", "$", "connection", "=", "Connection", "::", "connect", "(", ")", ";", "$", "getAll", "=", "$", "connection", "->", "prepare", "(", "'sel...
Search database for one row @param $model @param $tableName @param $id @return mixed
[ "Search", "database", "for", "one", "row" ]
e97f69e20be4ce0c078a0c25a9a777307d85e9e4
https://github.com/andela-doladosu/liteorm/blob/e97f69e20be4ce0c078a0c25a9a777307d85e9e4/src/Origins/BaseModel.php#L111-L122
24,946
andela-doladosu/liteorm
src/Origins/BaseModel.php
BaseModel.updateRow
protected function updateRow() { $tableName = $this->getTableName($this->className); $assignedValues = $this->getAssignedValues(); $updateDetails = []; for ($i = 0; $i < count($assignedValues['columns']); $i++) { array_push($updateDetails, $assignedValues['columns'][...
php
protected function updateRow() { $tableName = $this->getTableName($this->className); $assignedValues = $this->getAssignedValues(); $updateDetails = []; for ($i = 0; $i < count($assignedValues['columns']); $i++) { array_push($updateDetails, $assignedValues['columns'][...
[ "protected", "function", "updateRow", "(", ")", "{", "$", "tableName", "=", "$", "this", "->", "getTableName", "(", "$", "this", "->", "className", ")", ";", "$", "assignedValues", "=", "$", "this", "->", "getAssignedValues", "(", ")", ";", "$", "updateD...
Edit an existing row @return bool
[ "Edit", "an", "existing", "row" ]
e97f69e20be4ce0c078a0c25a9a777307d85e9e4
https://github.com/andela-doladosu/liteorm/blob/e97f69e20be4ce0c078a0c25a9a777307d85e9e4/src/Origins/BaseModel.php#L178-L198
24,947
andela-doladosu/liteorm
src/Origins/BaseModel.php
BaseModel.destroy
public static function destroy($id) { if (self::confirmIdExists($id)) { return self::doDelete($id); } else { throw new Exception('Now rows found with ID '.$id.' in the database, it may have been already deleted'); } }
php
public static function destroy($id) { if (self::confirmIdExists($id)) { return self::doDelete($id); } else { throw new Exception('Now rows found with ID '.$id.' in the database, it may have been already deleted'); } }
[ "public", "static", "function", "destroy", "(", "$", "id", ")", "{", "if", "(", "self", "::", "confirmIdExists", "(", "$", "id", ")", ")", "{", "return", "self", "::", "doDelete", "(", "$", "id", ")", ";", "}", "else", "{", "throw", "new", "Excepti...
Call doDelete function if the specified id exists @param $id @return string
[ "Call", "doDelete", "function", "if", "the", "specified", "id", "exists" ]
e97f69e20be4ce0c078a0c25a9a777307d85e9e4
https://github.com/andela-doladosu/liteorm/blob/e97f69e20be4ce0c078a0c25a9a777307d85e9e4/src/Origins/BaseModel.php#L207-L214
24,948
andela-doladosu/liteorm
src/Origins/BaseModel.php
BaseModel.doDelete
protected static function doDelete($id) { $model = self::createModelInstance(); $tableName = $model->getTableName($model->className); $connection = Connection::connect(); $delete = $connection->prepare('delete from '.$tableName.' where id ='.$id); return $delete->execute() ...
php
protected static function doDelete($id) { $model = self::createModelInstance(); $tableName = $model->getTableName($model->className); $connection = Connection::connect(); $delete = $connection->prepare('delete from '.$tableName.' where id ='.$id); return $delete->execute() ...
[ "protected", "static", "function", "doDelete", "(", "$", "id", ")", "{", "$", "model", "=", "self", "::", "createModelInstance", "(", ")", ";", "$", "tableName", "=", "$", "model", "->", "getTableName", "(", "$", "model", "->", "className", ")", ";", "...
Delete an existing row from the database @param $id @return string
[ "Delete", "an", "existing", "row", "from", "the", "database" ]
e97f69e20be4ce0c078a0c25a9a777307d85e9e4
https://github.com/andela-doladosu/liteorm/blob/e97f69e20be4ce0c078a0c25a9a777307d85e9e4/src/Origins/BaseModel.php#L222-L233
24,949
alphalemon/BootstrapBundle
Core/ActionManager/ActionManagerGenerator.php
ActionManagerGenerator.generate
public function generate($actionManager) { if ($actionManager instanceof ActionManagerInterface) { $this->actionManager = $actionManager; $this->actionManagerClass = get_class($this->actionManager); } if (is_string($actionManager) && class_exists($actionManager)) { ...
php
public function generate($actionManager) { if ($actionManager instanceof ActionManagerInterface) { $this->actionManager = $actionManager; $this->actionManagerClass = get_class($this->actionManager); } if (is_string($actionManager) && class_exists($actionManager)) { ...
[ "public", "function", "generate", "(", "$", "actionManager", ")", "{", "if", "(", "$", "actionManager", "instanceof", "ActionManagerInterface", ")", "{", "$", "this", "->", "actionManager", "=", "$", "actionManager", ";", "$", "this", "->", "actionManagerClass",...
Generates the ActionManager object @param mixed ActionManagerInterface|string $actionManager
[ "Generates", "the", "ActionManager", "object" ]
27ff5cbc58d58149ec72a974f2a9d765a6fd37a6
https://github.com/alphalemon/BootstrapBundle/blob/27ff5cbc58d58149ec72a974f2a9d765a6fd37a6/Core/ActionManager/ActionManagerGenerator.php#L48-L59
24,950
ColibriPlatform/base
Env.php
Env.load
public static function load($file) { if (file_exists($file)) { $env = \M1\Env\Parser::parse(file_get_contents($file)); foreach ($env as $key => $value) { putenv("{$key}={$value}"); } } }
php
public static function load($file) { if (file_exists($file)) { $env = \M1\Env\Parser::parse(file_get_contents($file)); foreach ($env as $key => $value) { putenv("{$key}={$value}"); } } }
[ "public", "static", "function", "load", "(", "$", "file", ")", "{", "if", "(", "file_exists", "(", "$", "file", ")", ")", "{", "$", "env", "=", "\\", "M1", "\\", "Env", "\\", "Parser", "::", "parse", "(", "file_get_contents", "(", "$", "file", ")",...
Load file containing environment variables and setup environment with these variables @param string $file @return void
[ "Load", "file", "containing", "environment", "variables", "and", "setup", "environment", "with", "these", "variables" ]
b45db9c88317e28acc5b024ac98f8428685179aa
https://github.com/ColibriPlatform/base/blob/b45db9c88317e28acc5b024ac98f8428685179aa/Env.php#L27-L35
24,951
net-tools/core
src/Helpers/PdoHelper.php
PdoHelper.addForeignKey
function addForeignKey($table, $pkname, $tables) { if ( is_string($tables) ) $tables = array($tables); $this->_foreignKeys[$table] = array( 'primaryKey' => $pkname, 'tables' => $tables ); }
php
function addForeignKey($table, $pkname, $tables) { if ( is_string($tables) ) $tables = array($tables); $this->_foreignKeys[$table] = array( 'primaryKey' => $pkname, 'tables' => $tables ); }
[ "function", "addForeignKey", "(", "$", "table", ",", "$", "pkname", ",", "$", "tables", ")", "{", "if", "(", "is_string", "(", "$", "tables", ")", ")", "$", "tables", "=", "array", "(", "$", "tables", ")", ";", "$", "this", "->", "_foreignKeys", "[...
Add some config data for a new foreign key @param string $table Name of the foreign key table @param string $pkname Name of its primary key @param string[] $tables Array of tables referencing $table parameter
[ "Add", "some", "config", "data", "for", "a", "new", "foreign", "key" ]
51446641cee22c0cf53d2b409c76cc8bd1a187e7
https://github.com/net-tools/core/blob/51446641cee22c0cf53d2b409c76cc8bd1a187e7/src/Helpers/PdoHelper.php#L59-L69
24,952
net-tools/core
src/Helpers/PdoHelper.php
PdoHelper.pdo_query_select
function pdo_query_select($query, $values = NULL) { if ( !is_null($values) && !is_array($values) ) $values = array($values); $st = $this->prepare($query); $st->execute($values); return $st; }
php
function pdo_query_select($query, $values = NULL) { if ( !is_null($values) && !is_array($values) ) $values = array($values); $st = $this->prepare($query); $st->execute($values); return $st; }
[ "function", "pdo_query_select", "(", "$", "query", ",", "$", "values", "=", "NULL", ")", "{", "if", "(", "!", "is_null", "(", "$", "values", ")", "&&", "!", "is_array", "(", "$", "values", ")", ")", "$", "values", "=", "array", "(", "$", "values", ...
Helper query method for a SQL SELECT request @param string $query The SQL query @param string[] $values An array of parameters for the query (? and :xxx placeholders concrete values) @return \PDOStatement A PDOStatement object with rows to fetch @throws \PDOException If an error occured, a exception is thrown
[ "Helper", "query", "method", "for", "a", "SQL", "SELECT", "request" ]
51446641cee22c0cf53d2b409c76cc8bd1a187e7
https://github.com/net-tools/core/blob/51446641cee22c0cf53d2b409c76cc8bd1a187e7/src/Helpers/PdoHelper.php#L120-L129
24,953
MindyPHP/Pagination
BasePagination.php
BasePagination.paginate
public function paginate() { $this->total = $this->dataSource->getTotal($this->source); if ( ($this->getPagesCount() > 0 && $this->getPage() > $this->getPagesCount()) || $this->getPage() <= 0 ) { $this->handler->wrongPageCallback(); } $th...
php
public function paginate() { $this->total = $this->dataSource->getTotal($this->source); if ( ($this->getPagesCount() > 0 && $this->getPage() > $this->getPagesCount()) || $this->getPage() <= 0 ) { $this->handler->wrongPageCallback(); } $th...
[ "public", "function", "paginate", "(", ")", "{", "$", "this", "->", "total", "=", "$", "this", "->", "dataSource", "->", "getTotal", "(", "$", "this", "->", "source", ")", ";", "if", "(", "(", "$", "this", "->", "getPagesCount", "(", ")", ">", "0",...
Apply limits to source. @throws \Exception @return array
[ "Apply", "limits", "to", "source", "." ]
9f38cc7ac219ea2639b88d9f45351c7b24ea8322
https://github.com/MindyPHP/Pagination/blob/9f38cc7ac219ea2639b88d9f45351c7b24ea8322/BasePagination.php#L204-L222
24,954
CatLabInteractive/Accounts
src/CatLab/Accounts/Module.php
Module.initialize
public function initialize ($routepath) { // Set path $this->routepath = $routepath; // Add templates Template::addPath (__DIR__ . '/templates/', 'CatLab/Accounts/'); // Add locales Text::getInstance ()->addPath ('catlab.accounts', __DIR__ . '/locales/'); /...
php
public function initialize ($routepath) { // Set path $this->routepath = $routepath; // Add templates Template::addPath (__DIR__ . '/templates/', 'CatLab/Accounts/'); // Add locales Text::getInstance ()->addPath ('catlab.accounts', __DIR__ . '/locales/'); /...
[ "public", "function", "initialize", "(", "$", "routepath", ")", "{", "// Set path", "$", "this", "->", "routepath", "=", "$", "routepath", ";", "// Add templates", "Template", "::", "addPath", "(", "__DIR__", ".", "'/templates/'", ",", "'CatLab/Accounts/'", ")",...
Set template paths, config vars, etc @param string $routepath The prefix that should be added to all route paths. @return void
[ "Set", "template", "paths", "config", "vars", "etc" ]
e5465ad815c3caba5b7c1fde7b465a5fa05f3298
https://github.com/CatLabInteractive/Accounts/blob/e5465ad815c3caba5b7c1fde7b465a5fa05f3298/src/CatLab/Accounts/Module.php#L56-L77
24,955
CatLabInteractive/Accounts
src/CatLab/Accounts/Module.php
Module.setRequestUser
public function setRequestUser (Request $request) { $request->addUserCallback ('accounts', function (Request $request) { $userid = $request->getSession ()->get ('catlab-user-id'); if ($userid) { $user = MapperFactory::getUserMapper ()->getFromId ($userid...
php
public function setRequestUser (Request $request) { $request->addUserCallback ('accounts', function (Request $request) { $userid = $request->getSession ()->get ('catlab-user-id'); if ($userid) { $user = MapperFactory::getUserMapper ()->getFromId ($userid...
[ "public", "function", "setRequestUser", "(", "Request", "$", "request", ")", "{", "$", "request", "->", "addUserCallback", "(", "'accounts'", ",", "function", "(", "Request", "$", "request", ")", "{", "$", "userid", "=", "$", "request", "->", "getSession", ...
Set user from session @param Request $request @throws \Neuron\Exceptions\InvalidParameter
[ "Set", "user", "from", "session" ]
e5465ad815c3caba5b7c1fde7b465a5fa05f3298
https://github.com/CatLabInteractive/Accounts/blob/e5465ad815c3caba5b7c1fde7b465a5fa05f3298/src/CatLab/Accounts/Module.php#L84-L99
24,956
CatLabInteractive/Accounts
src/CatLab/Accounts/Module.php
Module.login
public function login (Request $request, User $user, $registration = false) { // Check for email validation if ($this->requiresEmailValidation()) { if (!$user->isEmailVerified()) { $request->getSession()->set ('catlab-non-verified-user-id', $user->getId()); ...
php
public function login (Request $request, User $user, $registration = false) { // Check for email validation if ($this->requiresEmailValidation()) { if (!$user->isEmailVerified()) { $request->getSession()->set ('catlab-non-verified-user-id', $user->getId()); ...
[ "public", "function", "login", "(", "Request", "$", "request", ",", "User", "$", "user", ",", "$", "registration", "=", "false", ")", "{", "// Check for email validation", "if", "(", "$", "this", "->", "requiresEmailValidation", "(", ")", ")", "{", "if", "...
Login a specific user @param Request $request @param User $user @param bool $registration @return \Neuron\Net\Response @throws DataNotSet
[ "Login", "a", "specific", "user" ]
e5465ad815c3caba5b7c1fde7b465a5fa05f3298
https://github.com/CatLabInteractive/Accounts/blob/e5465ad815c3caba5b7c1fde7b465a5fa05f3298/src/CatLab/Accounts/Module.php#L141-L153
24,957
CatLabInteractive/Accounts
src/CatLab/Accounts/Module.php
Module.postLogin
public function postLogin (Request $request, \Neuron\Interfaces\Models\User $user, $registered = false) { $parameters = array(); if ($registered) { $parameters['registered'] = 1; } // Also set in session... why wouldn't this be in session? :D $request->getSession...
php
public function postLogin (Request $request, \Neuron\Interfaces\Models\User $user, $registered = false) { $parameters = array(); if ($registered) { $parameters['registered'] = 1; } // Also set in session... why wouldn't this be in session? :D $request->getSession...
[ "public", "function", "postLogin", "(", "Request", "$", "request", ",", "\\", "Neuron", "\\", "Interfaces", "\\", "Models", "\\", "User", "$", "user", ",", "$", "registered", "=", "false", ")", "{", "$", "parameters", "=", "array", "(", ")", ";", "if",...
Called right after a user is logged in. Should be a redirect. @param Request $request @param \Neuron\Interfaces\Models\User $user @param boolean $registered @return \Neuron\Net\Response @throws DataNotSet
[ "Called", "right", "after", "a", "user", "is", "logged", "in", ".", "Should", "be", "a", "redirect", "." ]
e5465ad815c3caba5b7c1fde7b465a5fa05f3298
https://github.com/CatLabInteractive/Accounts/blob/e5465ad815c3caba5b7c1fde7b465a5fa05f3298/src/CatLab/Accounts/Module.php#L177-L200
24,958
CatLabInteractive/Accounts
src/CatLab/Accounts/Module.php
Module.postLogout
public function postLogout (Request $request) { if ($redirect = $request->getSession ()->get ('post-login-redirect')) { $request->getSession ()->set ('post-login-redirect', null); $request->getSession ()->set ('cancel-login-redirect', null); return Response::redi...
php
public function postLogout (Request $request) { if ($redirect = $request->getSession ()->get ('post-login-redirect')) { $request->getSession ()->set ('post-login-redirect', null); $request->getSession ()->set ('cancel-login-redirect', null); return Response::redi...
[ "public", "function", "postLogout", "(", "Request", "$", "request", ")", "{", "if", "(", "$", "redirect", "=", "$", "request", "->", "getSession", "(", ")", "->", "get", "(", "'post-login-redirect'", ")", ")", "{", "$", "request", "->", "getSession", "("...
Called after a redirect @param Request $request @return Response @throws DataNotSet
[ "Called", "after", "a", "redirect" ]
e5465ad815c3caba5b7c1fde7b465a5fa05f3298
https://github.com/CatLabInteractive/Accounts/blob/e5465ad815c3caba5b7c1fde7b465a5fa05f3298/src/CatLab/Accounts/Module.php#L223-L234
24,959
CatLabInteractive/Accounts
src/CatLab/Accounts/Module.php
Module.setRoutes
public function setRoutes (Router $router) { // Filter $router->addFilter ('authenticated', array ($this, 'routerVerifier')); // Routes $router->match ('GET|POST', $this->routepath . '/login/{authenticator}', '\CatLab\Accounts\Controllers\LoginController@authenticator'); $ro...
php
public function setRoutes (Router $router) { // Filter $router->addFilter ('authenticated', array ($this, 'routerVerifier')); // Routes $router->match ('GET|POST', $this->routepath . '/login/{authenticator}', '\CatLab\Accounts\Controllers\LoginController@authenticator'); $ro...
[ "public", "function", "setRoutes", "(", "Router", "$", "router", ")", "{", "// Filter", "$", "router", "->", "addFilter", "(", "'authenticated'", ",", "array", "(", "$", "this", ",", "'routerVerifier'", ")", ")", ";", "// Routes", "$", "router", "->", "mat...
Register the routes required for this module. @param Router $router @return mixed
[ "Register", "the", "routes", "required", "for", "this", "module", "." ]
e5465ad815c3caba5b7c1fde7b465a5fa05f3298
https://github.com/CatLabInteractive/Accounts/blob/e5465ad815c3caba5b7c1fde7b465a5fa05f3298/src/CatLab/Accounts/Module.php#L249-L269
24,960
aloframework/common
src/Alo.php
Alo.asciiRand
public static function asciiRand($length, $subset = self::ASCII_ALL) { switch ($subset) { case self::ASCII_ALPHANUM: $subset = self::$asciiAlphanum; break; case self::ASCII_NONALPHANUM: $subset = self::$asciNonAlphan...
php
public static function asciiRand($length, $subset = self::ASCII_ALL) { switch ($subset) { case self::ASCII_ALPHANUM: $subset = self::$asciiAlphanum; break; case self::ASCII_NONALPHANUM: $subset = self::$asciNonAlphan...
[ "public", "static", "function", "asciiRand", "(", "$", "length", ",", "$", "subset", "=", "self", "::", "ASCII_ALL", ")", "{", "switch", "(", "$", "subset", ")", "{", "case", "self", "::", "ASCII_ALPHANUM", ":", "$", "subset", "=", "self", "::", "$", ...
Generates a string of random ASCII characters @author Art <a.molcanovas@gmail.com> @param int $length The length of the string @param int $subset Which subset to use - see class' ASCII_* constants @return string @since 1.3
[ "Generates", "a", "string", "of", "random", "ASCII", "characters" ]
484ef76ea5e1b99b2758e5c35c76229572dc27cb
https://github.com/aloframework/common/blob/484ef76ea5e1b99b2758e5c35c76229572dc27cb/src/Alo.php#L189-L210
24,961
aloframework/common
src/Alo.php
Alo.getUniqid
public static function getUniqid($hash = 'sha256', $prefix = '', $entropy = 10000, $rawOutput = false) { $str = mt_rand(~PHP_INT_MAX, PHP_INT_MAX) . json_encode([$_COOKIE, $_REQUEST, ...
php
public static function getUniqid($hash = 'sha256', $prefix = '', $entropy = 10000, $rawOutput = false) { $str = mt_rand(~PHP_INT_MAX, PHP_INT_MAX) . json_encode([$_COOKIE, $_REQUEST, ...
[ "public", "static", "function", "getUniqid", "(", "$", "hash", "=", "'sha256'", ",", "$", "prefix", "=", "''", ",", "$", "entropy", "=", "10000", ",", "$", "rawOutput", "=", "false", ")", "{", "$", "str", "=", "mt_rand", "(", "~", "PHP_INT_MAX", ",",...
Generates a unique identifier @author Art <a.molcanovas@gmail.com> @param string $hash Hash algorithm @param string $prefix Prefix for the identifier @param int $entropy Number of pseudo bytes used in entropy @param bool $rawOutput When set to true, outputs raw binary data. false outputs lowercase hexi...
[ "Generates", "a", "unique", "identifier" ]
484ef76ea5e1b99b2758e5c35c76229572dc27cb
https://github.com/aloframework/common/blob/484ef76ea5e1b99b2758e5c35c76229572dc27cb/src/Alo.php#L230-L256
24,962
aloframework/common
src/Alo.php
Alo.getFingerprint
public static function getFingerprint($hashAlgo = 'sha256') { return hash($hashAlgo, '#QramRAN7*s%6n%@x*53jVVPsnrz@5MY$49o^mhJ8HqY%3a09yJnSWg9lBl$O4CKUb&&S%EgYBjhUZEbhquw$keCjR6I%zMcA!Qr' . self::get($_SERVER['HTTP_USER_AGENT']) . 'OE2%...
php
public static function getFingerprint($hashAlgo = 'sha256') { return hash($hashAlgo, '#QramRAN7*s%6n%@x*53jVVPsnrz@5MY$49o^mhJ8HqY%3a09yJnSWg9lBl$O4CKUb&&S%EgYBjhUZEbhquw$keCjR6I%zMcA!Qr' . self::get($_SERVER['HTTP_USER_AGENT']) . 'OE2%...
[ "public", "static", "function", "getFingerprint", "(", "$", "hashAlgo", "=", "'sha256'", ")", "{", "return", "hash", "(", "$", "hashAlgo", ",", "'#QramRAN7*s%6n%@x*53jVVPsnrz@5MY$49o^mhJ8HqY%3a09yJnSWg9lBl$O4CKUb&&S%EgYBjhUZEbhquw$keCjR6I%zMcA!Qr'", ".", "self", "::", "get"...
Returns a hashed browser fingerprint @author Art <a.molcanovas@gmail.com> @param string $hashAlgo Hash algorithm to use @return string @since 1.2
[ "Returns", "a", "hashed", "browser", "fingerprint" ]
484ef76ea5e1b99b2758e5c35c76229572dc27cb
https://github.com/aloframework/common/blob/484ef76ea5e1b99b2758e5c35c76229572dc27cb/src/Alo.php#L388-L397
24,963
aloframework/common
src/Alo.php
Alo.unXss
public static function unXss($input) { if (self::isTraversable($input)) { foreach ($input as &$i) { $i = self::unXss($i); } } elseif (is_scalar($input)) { $input = htmlspecialchars($input, ENT_QUOTES | ENT_HTML5 | ENT_SUBSTITUTE...
php
public static function unXss($input) { if (self::isTraversable($input)) { foreach ($input as &$i) { $i = self::unXss($i); } } elseif (is_scalar($input)) { $input = htmlspecialchars($input, ENT_QUOTES | ENT_HTML5 | ENT_SUBSTITUTE...
[ "public", "static", "function", "unXss", "(", "$", "input", ")", "{", "if", "(", "self", "::", "isTraversable", "(", "$", "input", ")", ")", "{", "foreach", "(", "$", "input", "as", "&", "$", "i", ")", "{", "$", "i", "=", "self", "::", "unXss", ...
Protects the input from cross-site scripting attacks @author Art <a.molcanovas@gmail.com> @param string|array|Traversable $input The scalar input, or an array/Traversable @return string|array|Traversable The escaped string. If an array or traversable was passed on, the input withall its applicable values escaped. @s...
[ "Protects", "the", "input", "from", "cross", "-", "site", "scripting", "attacks" ]
484ef76ea5e1b99b2758e5c35c76229572dc27cb
https://github.com/aloframework/common/blob/484ef76ea5e1b99b2758e5c35c76229572dc27cb/src/Alo.php#L425-L435
24,964
mpf-soft/admin-widgets
jqueryfileupload/Uploader.php
Uploader.init
protected function init($config) { parent::init($config); if (!$this->dataUrl) { $this->dataUrl = WebApp::get()->request()->getCurrentURL(); // if dataUrl is not set then current URL will be used; } if ($this->handleRequest) { $this->_handle(); die(); ...
php
protected function init($config) { parent::init($config); if (!$this->dataUrl) { $this->dataUrl = WebApp::get()->request()->getCurrentURL(); // if dataUrl is not set then current URL will be used; } if ($this->handleRequest) { $this->_handle(); die(); ...
[ "protected", "function", "init", "(", "$", "config", ")", "{", "parent", "::", "init", "(", "$", "config", ")", ";", "if", "(", "!", "$", "this", "->", "dataUrl", ")", "{", "$", "this", "->", "dataUrl", "=", "WebApp", "::", "get", "(", ")", "->",...
It will take care of upload and delete requests; @param array $config @return bool @throws \Exception
[ "It", "will", "take", "care", "of", "upload", "and", "delete", "requests", ";" ]
92597f9a09d086664268d6b7e0111d5a5586d8c7
https://github.com/mpf-soft/admin-widgets/blob/92597f9a09d086664268d6b7e0111d5a5586d8c7/jqueryfileupload/Uploader.php#L127-L138
24,965
mpf-soft/admin-widgets
jqueryfileupload/Uploader.php
Uploader.display
public function display() { $source = str_replace(['{VENDOR}', '{APP_ROOT}'], [LIBS_FOLDER, APP_ROOT], $this->jsSource); $url = AssetsPublisher::get()->publishFolder($source); $events = $this->getJSEvents(); $r = Form::get()->input($this->name . '[]', 'file', null, [ 'id'...
php
public function display() { $source = str_replace(['{VENDOR}', '{APP_ROOT}'], [LIBS_FOLDER, APP_ROOT], $this->jsSource); $url = AssetsPublisher::get()->publishFolder($source); $events = $this->getJSEvents(); $r = Form::get()->input($this->name . '[]', 'file', null, [ 'id'...
[ "public", "function", "display", "(", ")", "{", "$", "source", "=", "str_replace", "(", "[", "'{VENDOR}'", ",", "'{APP_ROOT}'", "]", ",", "[", "LIBS_FOLDER", ",", "APP_ROOT", "]", ",", "$", "this", "->", "jsSource", ")", ";", "$", "url", "=", "AssetsPu...
Returns the HTML code for the element. @return string
[ "Returns", "the", "HTML", "code", "for", "the", "element", "." ]
92597f9a09d086664268d6b7e0111d5a5586d8c7
https://github.com/mpf-soft/admin-widgets/blob/92597f9a09d086664268d6b7e0111d5a5586d8c7/jqueryfileupload/Uploader.php#L183-L209
24,966
stellaqua/Waltz.Stagehand
src/Waltz/Stagehand/ClassUtility/ClassObject/PhpClassObject.php
PhpClassObject.getDocComment
public function getDocComment ( $withCommentMark = false ) { $docComment = $this->_reflectionClass->getDocComment(); if ( $withCommentMark === false ) { $docComment = PhpDocCommentObject::stripCommentMarks($docComment); } return $docComment; }
php
public function getDocComment ( $withCommentMark = false ) { $docComment = $this->_reflectionClass->getDocComment(); if ( $withCommentMark === false ) { $docComment = PhpDocCommentObject::stripCommentMarks($docComment); } return $docComment; }
[ "public", "function", "getDocComment", "(", "$", "withCommentMark", "=", "false", ")", "{", "$", "docComment", "=", "$", "this", "->", "_reflectionClass", "->", "getDocComment", "(", ")", ";", "if", "(", "$", "withCommentMark", "===", "false", ")", "{", "$...
Get DocComment of class @param bool $withCommentMark @return string DocComment
[ "Get", "DocComment", "of", "class" ]
01df286751f5b9a5c90c47138dca3709e5bc383b
https://github.com/stellaqua/Waltz.Stagehand/blob/01df286751f5b9a5c90c47138dca3709e5bc383b/src/Waltz/Stagehand/ClassUtility/ClassObject/PhpClassObject.php#L77-L83
24,967
fridge-project/dbal
src/Fridge/DBAL/Schema/Column.php
Column.setLength
public function setLength($length) { if (($length !== null) && (!is_int($length) || ($length <= 0))) { throw SchemaException::invalidColumnLength($this->getName()); } $this->length = $length; }
php
public function setLength($length) { if (($length !== null) && (!is_int($length) || ($length <= 0))) { throw SchemaException::invalidColumnLength($this->getName()); } $this->length = $length; }
[ "public", "function", "setLength", "(", "$", "length", ")", "{", "if", "(", "(", "$", "length", "!==", "null", ")", "&&", "(", "!", "is_int", "(", "$", "length", ")", "||", "(", "$", "length", "<=", "0", ")", ")", ")", "{", "throw", "SchemaExcept...
Sets the column length. @param integer|null $length The column length. @throws \Fridge\DBAL\Exception\SchemaException If the length is not a positive integer.
[ "Sets", "the", "column", "length", "." ]
d0b8c3551922d696836487aa0eb1bd74014edcd4
https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Column.php#L117-L124
24,968
fridge-project/dbal
src/Fridge/DBAL/Schema/Column.php
Column.setPrecision
public function setPrecision($precision) { if (($precision !== null) && (!is_int($precision) || ($precision <= 0))) { throw SchemaException::invalidColumnPrecision($this->getName()); } $this->precision = $precision; }
php
public function setPrecision($precision) { if (($precision !== null) && (!is_int($precision) || ($precision <= 0))) { throw SchemaException::invalidColumnPrecision($this->getName()); } $this->precision = $precision; }
[ "public", "function", "setPrecision", "(", "$", "precision", ")", "{", "if", "(", "(", "$", "precision", "!==", "null", ")", "&&", "(", "!", "is_int", "(", "$", "precision", ")", "||", "(", "$", "precision", "<=", "0", ")", ")", ")", "{", "throw", ...
Sets the column precision. @param integer|null $precision The column precision. @throws \Fridge\DBAL\Exception\SchemaException If the precision is not a positive integer.
[ "Sets", "the", "column", "precision", "." ]
d0b8c3551922d696836487aa0eb1bd74014edcd4
https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Column.php#L143-L150
24,969
fridge-project/dbal
src/Fridge/DBAL/Schema/Column.php
Column.setScale
public function setScale($scale) { if (($scale !== null) && (!is_int($scale) || ($scale < 0))) { throw SchemaException::invalidColumnScale($this->getName()); } $this->scale = $scale; }
php
public function setScale($scale) { if (($scale !== null) && (!is_int($scale) || ($scale < 0))) { throw SchemaException::invalidColumnScale($this->getName()); } $this->scale = $scale; }
[ "public", "function", "setScale", "(", "$", "scale", ")", "{", "if", "(", "(", "$", "scale", "!==", "null", ")", "&&", "(", "!", "is_int", "(", "$", "scale", ")", "||", "(", "$", "scale", "<", "0", ")", ")", ")", "{", "throw", "SchemaException", ...
Sets the column scale. @param integer|null $scale The column scale. @throws \Fridge\DBAL\Exception\SchemaException If the scale is not a positive integer.
[ "Sets", "the", "column", "scale", "." ]
d0b8c3551922d696836487aa0eb1bd74014edcd4
https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Column.php#L169-L176
24,970
fridge-project/dbal
src/Fridge/DBAL/Schema/Column.php
Column.setUnsigned
public function setUnsigned($unsigned) { if (($unsigned !== null) && !is_bool($unsigned)) { throw SchemaException::invalidColumnUnsignedFlag($this->getName()); } $this->unsigned = $unsigned; }
php
public function setUnsigned($unsigned) { if (($unsigned !== null) && !is_bool($unsigned)) { throw SchemaException::invalidColumnUnsignedFlag($this->getName()); } $this->unsigned = $unsigned; }
[ "public", "function", "setUnsigned", "(", "$", "unsigned", ")", "{", "if", "(", "(", "$", "unsigned", "!==", "null", ")", "&&", "!", "is_bool", "(", "$", "unsigned", ")", ")", "{", "throw", "SchemaException", "::", "invalidColumnUnsignedFlag", "(", "$", ...
Sets the column unsigned flag. @param boolean|null $unsigned The column unsigned flag. @throws \Fridge\DBAL\Exception\SchemaException If the unsigned flag is not a boolean.
[ "Sets", "the", "column", "unsigned", "flag", "." ]
d0b8c3551922d696836487aa0eb1bd74014edcd4
https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Column.php#L195-L202
24,971
fridge-project/dbal
src/Fridge/DBAL/Schema/Column.php
Column.setFixed
public function setFixed($fixed) { if (($fixed !== null) && !is_bool($fixed)) { throw SchemaException::invalidColumnFixedFlag($this->getName()); } $this->fixed = $fixed; }
php
public function setFixed($fixed) { if (($fixed !== null) && !is_bool($fixed)) { throw SchemaException::invalidColumnFixedFlag($this->getName()); } $this->fixed = $fixed; }
[ "public", "function", "setFixed", "(", "$", "fixed", ")", "{", "if", "(", "(", "$", "fixed", "!==", "null", ")", "&&", "!", "is_bool", "(", "$", "fixed", ")", ")", "{", "throw", "SchemaException", "::", "invalidColumnFixedFlag", "(", "$", "this", "->",...
Sets the column fixed flag. @param boolean $fixed The column fixed flag. @throws \Fridge\DBAL\Exception\SchemaException If the fixed flag is not a boolean.
[ "Sets", "the", "column", "fixed", "flag", "." ]
d0b8c3551922d696836487aa0eb1bd74014edcd4
https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Column.php#L221-L228
24,972
fridge-project/dbal
src/Fridge/DBAL/Schema/Column.php
Column.setNotNull
public function setNotNull($notNull) { if (($notNull !== null) && !is_bool($notNull)) { throw SchemaException::invalidColumnNotNullFlag($this->getName()); } $this->notNull = $notNull; }
php
public function setNotNull($notNull) { if (($notNull !== null) && !is_bool($notNull)) { throw SchemaException::invalidColumnNotNullFlag($this->getName()); } $this->notNull = $notNull; }
[ "public", "function", "setNotNull", "(", "$", "notNull", ")", "{", "if", "(", "(", "$", "notNull", "!==", "null", ")", "&&", "!", "is_bool", "(", "$", "notNull", ")", ")", "{", "throw", "SchemaException", "::", "invalidColumnNotNullFlag", "(", "$", "this...
Sets the column not null flag. @param boolean|null $notNull The column not null flag. @throws \Fridge\DBAL\Exception\SchemaException If the not null flag is not a boolean.
[ "Sets", "the", "column", "not", "null", "flag", "." ]
d0b8c3551922d696836487aa0eb1bd74014edcd4
https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Column.php#L247-L254
24,973
fridge-project/dbal
src/Fridge/DBAL/Schema/Column.php
Column.setAutoIncrement
public function setAutoIncrement($autoIncrement) { if (($autoIncrement !== null) && !is_bool($autoIncrement)) { throw SchemaException::invalidColumnAutoIncrementFlag($this->getName()); } $this->autoIncrement = $autoIncrement; }
php
public function setAutoIncrement($autoIncrement) { if (($autoIncrement !== null) && !is_bool($autoIncrement)) { throw SchemaException::invalidColumnAutoIncrementFlag($this->getName()); } $this->autoIncrement = $autoIncrement; }
[ "public", "function", "setAutoIncrement", "(", "$", "autoIncrement", ")", "{", "if", "(", "(", "$", "autoIncrement", "!==", "null", ")", "&&", "!", "is_bool", "(", "$", "autoIncrement", ")", ")", "{", "throw", "SchemaException", "::", "invalidColumnAutoIncreme...
Sets the column auto increment flag. @param boolean|null $autoIncrement The column auto increment flag. @throws \Fridge\DBAL\Exception\SchemaException If the auto increment flag is not a boolean.
[ "Sets", "the", "column", "auto", "increment", "flag", "." ]
d0b8c3551922d696836487aa0eb1bd74014edcd4
https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Column.php#L293-L300
24,974
fridge-project/dbal
src/Fridge/DBAL/Schema/Column.php
Column.setComment
public function setComment($comment) { if (($comment !== null) && !is_string($comment)) { throw SchemaException::invalidColumnComment($this->getName()); } $this->comment = $comment; }
php
public function setComment($comment) { if (($comment !== null) && !is_string($comment)) { throw SchemaException::invalidColumnComment($this->getName()); } $this->comment = $comment; }
[ "public", "function", "setComment", "(", "$", "comment", ")", "{", "if", "(", "(", "$", "comment", "!==", "null", ")", "&&", "!", "is_string", "(", "$", "comment", ")", ")", "{", "throw", "SchemaException", "::", "invalidColumnComment", "(", "$", "this",...
Sets the column comment. @param string|null $comment The column comment. @throws \Fridge\DBAL\Exception\SchemaException If the comment is not a string.
[ "Sets", "the", "column", "comment", "." ]
d0b8c3551922d696836487aa0eb1bd74014edcd4
https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Column.php#L319-L326
24,975
fridge-project/dbal
src/Fridge/DBAL/Schema/Column.php
Column.setProperties
public function setProperties(array $properties) { foreach ($properties as $property => $value) { $method = sprintf('set%s', str_replace('_', '', $property)); if (!method_exists($this, $method)) { throw SchemaException::invalidColumnProperty($this->getName(), $prope...
php
public function setProperties(array $properties) { foreach ($properties as $property => $value) { $method = sprintf('set%s', str_replace('_', '', $property)); if (!method_exists($this, $method)) { throw SchemaException::invalidColumnProperty($this->getName(), $prope...
[ "public", "function", "setProperties", "(", "array", "$", "properties", ")", "{", "foreach", "(", "$", "properties", "as", "$", "property", "=>", "$", "value", ")", "{", "$", "method", "=", "sprintf", "(", "'set%s'", ",", "str_replace", "(", "'_'", ",", ...
Sets the column options. @param array $properties Associative array that describes property => value pairs. @throws \Fridge\DBAL\Exception\SchemaException If the property does not exist.
[ "Sets", "the", "column", "options", "." ]
d0b8c3551922d696836487aa0eb1bd74014edcd4
https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Column.php#L335-L346
24,976
fridge-project/dbal
src/Fridge/DBAL/Schema/Column.php
Column.toArray
public function toArray() { return array( 'name' => $this->getName(), 'type' => $this->getType()->getName(), 'length' => $this->getLength(), 'precision' => $this->getPrecision(), 'scale' => $this->getScale(...
php
public function toArray() { return array( 'name' => $this->getName(), 'type' => $this->getType()->getName(), 'length' => $this->getLength(), 'precision' => $this->getPrecision(), 'scale' => $this->getScale(...
[ "public", "function", "toArray", "(", ")", "{", "return", "array", "(", "'name'", "=>", "$", "this", "->", "getName", "(", ")", ",", "'type'", "=>", "$", "this", "->", "getType", "(", ")", "->", "getName", "(", ")", ",", "'length'", "=>", "$", "thi...
Converts a column to an array. @return array The column converted to an array.
[ "Converts", "a", "column", "to", "an", "array", "." ]
d0b8c3551922d696836487aa0eb1bd74014edcd4
https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Column.php#L353-L368
24,977
eureka-framework/component-controller
src/Controller/DataCollection.php
DataCollection.add
public function add($key, $value) { $this->collection[$key] = $value; $this->indices[$this->length] = $key; $this->length++; return $this; }
php
public function add($key, $value) { $this->collection[$key] = $value; $this->indices[$this->length] = $key; $this->length++; return $this; }
[ "public", "function", "add", "(", "$", "key", ",", "$", "value", ")", "{", "$", "this", "->", "collection", "[", "$", "key", "]", "=", "$", "value", ";", "$", "this", "->", "indices", "[", "$", "this", "->", "length", "]", "=", "$", "key", ";",...
Add data to the collection. @param string $key @param mixed $value @return self
[ "Add", "data", "to", "the", "collection", "." ]
368efb6fb9eece4f7f69233e6190e1fdbb0ace2c
https://github.com/eureka-framework/component-controller/blob/368efb6fb9eece4f7f69233e6190e1fdbb0ace2c/src/Controller/DataCollection.php#L54-L61
24,978
SagittariusX/Beluga.Core
src/Beluga/Type.php
Type.getPhpCode
public final function getPhpCode() : string { $str = $this->stringValue; switch ( $this->typeName ) { case Type::PHP_BOOLEAN: case 'boolean': return ( $this->value ? 'true' : 'false' ); case Type::PHP_DOUBLE: case Type::PHP_FLOAT: case Ty...
php
public final function getPhpCode() : string { $str = $this->stringValue; switch ( $this->typeName ) { case Type::PHP_BOOLEAN: case 'boolean': return ( $this->value ? 'true' : 'false' ); case Type::PHP_DOUBLE: case Type::PHP_FLOAT: case Ty...
[ "public", "final", "function", "getPhpCode", "(", ")", ":", "string", "{", "$", "str", "=", "$", "this", "->", "stringValue", ";", "switch", "(", "$", "this", "->", "typeName", ")", "{", "case", "Type", "::", "PHP_BOOLEAN", ":", "case", "'boolean'", ":...
Returns the PHP code, defining the current base value. @return string
[ "Returns", "the", "PHP", "code", "defining", "the", "current", "base", "value", "." ]
51057b362707157a4b075df42bb49f397e2d310b
https://github.com/SagittariusX/Beluga.Core/blob/51057b362707157a4b075df42bb49f397e2d310b/src/Beluga/Type.php#L298-L359
24,979
Linkvalue-Interne/MajoraOrientDBBundle
src/Majora/Component/Graph/Engine/OrientDbEngine.php
OrientDbEngine.registerConnection
public function registerConnection($name, array $configuration) { $this->configurations->set($name, new OrientDbMetadata( $configuration['host'], $configuration['port'], $configuration['timeout'], $configuration['user'], $configuration['password'],...
php
public function registerConnection($name, array $configuration) { $this->configurations->set($name, new OrientDbMetadata( $configuration['host'], $configuration['port'], $configuration['timeout'], $configuration['user'], $configuration['password'],...
[ "public", "function", "registerConnection", "(", "$", "name", ",", "array", "$", "configuration", ")", "{", "$", "this", "->", "configurations", "->", "set", "(", "$", "name", ",", "new", "OrientDbMetadata", "(", "$", "configuration", "[", "'host'", "]", "...
Register a new OrientDB connection under given name @param string $name
[ "Register", "a", "new", "OrientDB", "connection", "under", "given", "name" ]
9fc9a409604472b558319c274442f75bbd055435
https://github.com/Linkvalue-Interne/MajoraOrientDBBundle/blob/9fc9a409604472b558319c274442f75bbd055435/src/Majora/Component/Graph/Engine/OrientDbEngine.php#L44-L56
24,980
Linkvalue-Interne/MajoraOrientDBBundle
src/Majora/Component/Graph/Engine/OrientDbEngine.php
OrientDbEngine.getConfiguration
public function getConfiguration($connectionName = 'default') { if (!$this->configurations->containsKey($connectionName)) { throw new \InvalidArgumentException(sprintf('Any registered configuration under given key.')); } return $this->configurations->get($connectionName); }
php
public function getConfiguration($connectionName = 'default') { if (!$this->configurations->containsKey($connectionName)) { throw new \InvalidArgumentException(sprintf('Any registered configuration under given key.')); } return $this->configurations->get($connectionName); }
[ "public", "function", "getConfiguration", "(", "$", "connectionName", "=", "'default'", ")", "{", "if", "(", "!", "$", "this", "->", "configurations", "->", "containsKey", "(", "$", "connectionName", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentExcepti...
Return registered configuration under given connectionName @param string $connectionName @return OrientDbMetadata
[ "Return", "registered", "configuration", "under", "given", "connectionName" ]
9fc9a409604472b558319c274442f75bbd055435
https://github.com/Linkvalue-Interne/MajoraOrientDBBundle/blob/9fc9a409604472b558319c274442f75bbd055435/src/Majora/Component/Graph/Engine/OrientDbEngine.php#L76-L83
24,981
Linkvalue-Interne/MajoraOrientDBBundle
src/Majora/Component/Graph/Engine/OrientDbEngine.php
OrientDbEngine.getConnection
public function getConnection($connectionName = 'default') { if ($this->connections->containsKey($connectionName)) { return $this->connections->get($connectionName); } $configuration = $this->getConfiguration($connectionName); $this->connections->set($connectionName, ...
php
public function getConnection($connectionName = 'default') { if ($this->connections->containsKey($connectionName)) { return $this->connections->get($connectionName); } $configuration = $this->getConfiguration($connectionName); $this->connections->set($connectionName, ...
[ "public", "function", "getConnection", "(", "$", "connectionName", "=", "'default'", ")", "{", "if", "(", "$", "this", "->", "connections", "->", "containsKey", "(", "$", "connectionName", ")", ")", "{", "return", "$", "this", "->", "connections", "->", "g...
Return registered connection under given connectionName @param string $connectionName @return \OrientDB
[ "Return", "registered", "connection", "under", "given", "connectionName" ]
9fc9a409604472b558319c274442f75bbd055435
https://github.com/Linkvalue-Interne/MajoraOrientDBBundle/blob/9fc9a409604472b558319c274442f75bbd055435/src/Majora/Component/Graph/Engine/OrientDbEngine.php#L92-L113
24,982
Linkvalue-Interne/MajoraOrientDBBundle
src/Majora/Component/Graph/Engine/OrientDbEngine.php
OrientDbEngine.createDatabase
public function createDatabase($connectionName) { $configuration = $this->getConfiguration($connectionName); $database = $this->getConnection($connectionName); $database->DBCreate( $configuration->getDatabase(), $configuration->getDataType(), $configurati...
php
public function createDatabase($connectionName) { $configuration = $this->getConfiguration($connectionName); $database = $this->getConnection($connectionName); $database->DBCreate( $configuration->getDatabase(), $configuration->getDataType(), $configurati...
[ "public", "function", "createDatabase", "(", "$", "connectionName", ")", "{", "$", "configuration", "=", "$", "this", "->", "getConfiguration", "(", "$", "connectionName", ")", ";", "$", "database", "=", "$", "this", "->", "getConnection", "(", "$", "connect...
Tries to create a database for given connection name @param string $name @return \OrientDB
[ "Tries", "to", "create", "a", "database", "for", "given", "connection", "name" ]
9fc9a409604472b558319c274442f75bbd055435
https://github.com/Linkvalue-Interne/MajoraOrientDBBundle/blob/9fc9a409604472b558319c274442f75bbd055435/src/Majora/Component/Graph/Engine/OrientDbEngine.php#L122-L134
24,983
Linkvalue-Interne/MajoraOrientDBBundle
src/Majora/Component/Graph/Engine/OrientDbEngine.php
OrientDbEngine.dropDatabase
public function dropDatabase($connectionName) { $configuration = $this->getConfiguration($connectionName); $database = $this->getConnection($connectionName); $database->DBDelete( $configuration->getDatabase() ); }
php
public function dropDatabase($connectionName) { $configuration = $this->getConfiguration($connectionName); $database = $this->getConnection($connectionName); $database->DBDelete( $configuration->getDatabase() ); }
[ "public", "function", "dropDatabase", "(", "$", "connectionName", ")", "{", "$", "configuration", "=", "$", "this", "->", "getConfiguration", "(", "$", "connectionName", ")", ";", "$", "database", "=", "$", "this", "->", "getConnection", "(", "$", "connectio...
Tries to drop a database for given connection name @param string $name @return \OrientDB
[ "Tries", "to", "drop", "a", "database", "for", "given", "connection", "name" ]
9fc9a409604472b558319c274442f75bbd055435
https://github.com/Linkvalue-Interne/MajoraOrientDBBundle/blob/9fc9a409604472b558319c274442f75bbd055435/src/Majora/Component/Graph/Engine/OrientDbEngine.php#L143-L151
24,984
Linkvalue-Interne/MajoraOrientDBBundle
src/Majora/Component/Graph/Engine/OrientDbEngine.php
OrientDbEngine.getDatabase
public function getDatabase($connectionName = 'default') { if ($this->databases->containsKey($connectionName)) { return $this->databases->get($connectionName); } $configuration = $this->getConfiguration($connectionName); $database = $this->getConnection($connectionName);...
php
public function getDatabase($connectionName = 'default') { if ($this->databases->containsKey($connectionName)) { return $this->databases->get($connectionName); } $configuration = $this->getConfiguration($connectionName); $database = $this->getConnection($connectionName);...
[ "public", "function", "getDatabase", "(", "$", "connectionName", "=", "'default'", ")", "{", "if", "(", "$", "this", "->", "databases", "->", "containsKey", "(", "$", "connectionName", ")", ")", "{", "return", "$", "this", "->", "databases", "->", "get", ...
Return registered database under given name @param string $connectionName @return \OrientDB
[ "Return", "registered", "database", "under", "given", "name" ]
9fc9a409604472b558319c274442f75bbd055435
https://github.com/Linkvalue-Interne/MajoraOrientDBBundle/blob/9fc9a409604472b558319c274442f75bbd055435/src/Majora/Component/Graph/Engine/OrientDbEngine.php#L160-L178
24,985
Linkvalue-Interne/MajoraOrientDBBundle
src/Majora/Component/Graph/Engine/OrientDbEngine.php
OrientDbEngine.synchronize
public function synchronize($connectionName) { $configuration = $this->getConfiguration($connectionName); $database = $this->getDatabase($connectionName); foreach ($configuration->getVertexes() as $vertex) { try { $database->query(sprintf('CREATE CLASS %s EXTENDS...
php
public function synchronize($connectionName) { $configuration = $this->getConfiguration($connectionName); $database = $this->getDatabase($connectionName); foreach ($configuration->getVertexes() as $vertex) { try { $database->query(sprintf('CREATE CLASS %s EXTENDS...
[ "public", "function", "synchronize", "(", "$", "connectionName", ")", "{", "$", "configuration", "=", "$", "this", "->", "getConfiguration", "(", "$", "connectionName", ")", ";", "$", "database", "=", "$", "this", "->", "getDatabase", "(", "$", "connectionNa...
Synchronize vertexes and edges with related OrientDb database @param string $connectionName
[ "Synchronize", "vertexes", "and", "edges", "with", "related", "OrientDb", "database" ]
9fc9a409604472b558319c274442f75bbd055435
https://github.com/Linkvalue-Interne/MajoraOrientDBBundle/blob/9fc9a409604472b558319c274442f75bbd055435/src/Majora/Component/Graph/Engine/OrientDbEngine.php#L185-L207
24,986
1HappyPlace/ansi-terminal
src/ANSI/EscapeSequenceGenerator.php
EscapeSequenceGenerator.generateSequence
public function generateSequence(TerminalState $state, $reset) { // this will return null if there are no active styles $sequence = ""; // build an array of the currently active style codes $styles = []; if ($state->isBold()) {$styles[] = self::BOLD;} if ($stat...
php
public function generateSequence(TerminalState $state, $reset) { // this will return null if there are no active styles $sequence = ""; // build an array of the currently active style codes $styles = []; if ($state->isBold()) {$styles[] = self::BOLD;} if ($stat...
[ "public", "function", "generateSequence", "(", "TerminalState", "$", "state", ",", "$", "reset", ")", "{", "// this will return null if there are no active styles", "$", "sequence", "=", "\"\"", ";", "// build an array of the currently active style codes", "$", "styles", "=...
Generate the escape sequencing for a particular state @param TerminalState $state - the state to achieve @param boolean $reset - whether the zero reset code needs to start this sequence @return string
[ "Generate", "the", "escape", "sequencing", "for", "a", "particular", "state" ]
3a550eadb21bb87a6909436c3b961919d2731923
https://github.com/1HappyPlace/ansi-terminal/blob/3a550eadb21bb87a6909436c3b961919d2731923/src/ANSI/EscapeSequenceGenerator.php#L197-L253
24,987
1HappyPlace/ansi-terminal
src/ANSI/EscapeSequenceGenerator.php
EscapeSequenceGenerator.generate
public function generate(TerminalStateInterface $currentState, TerminalState $desiredState) { // get a state object with anything that is changing $changes = $currentState->findChanges($desiredState); // if an object is returned, then just positive changes are occurring if ($changes) {...
php
public function generate(TerminalStateInterface $currentState, TerminalState $desiredState) { // get a state object with anything that is changing $changes = $currentState->findChanges($desiredState); // if an object is returned, then just positive changes are occurring if ($changes) {...
[ "public", "function", "generate", "(", "TerminalStateInterface", "$", "currentState", ",", "TerminalState", "$", "desiredState", ")", "{", "// get a state object with anything that is changing", "$", "changes", "=", "$", "currentState", "->", "findChanges", "(", "$", "d...
Generate an escape sequence based on the current state and the new desired state @param TerminalStateInterface $currentState @param TerminalState $desiredState @return string
[ "Generate", "an", "escape", "sequence", "based", "on", "the", "current", "state", "and", "the", "new", "desired", "state" ]
3a550eadb21bb87a6909436c3b961919d2731923
https://github.com/1HappyPlace/ansi-terminal/blob/3a550eadb21bb87a6909436c3b961919d2731923/src/ANSI/EscapeSequenceGenerator.php#L263-L295
24,988
Soneritics/Database
Soneritics/Database/DatabaseRecord/PDODatabaseRecord.php
PDODatabaseRecord.createMapping
private function createMapping() { $columns = $this->pdoStatement->columnCount(); if ($columns > 0) { $this->mapping = []; for ($i = 0; $i < $columns; $i++) { $meta = $this->pdoStatement->getColumnMeta($i); $this->mapping[$i] = [$meta['table'],...
php
private function createMapping() { $columns = $this->pdoStatement->columnCount(); if ($columns > 0) { $this->mapping = []; for ($i = 0; $i < $columns; $i++) { $meta = $this->pdoStatement->getColumnMeta($i); $this->mapping[$i] = [$meta['table'],...
[ "private", "function", "createMapping", "(", ")", "{", "$", "columns", "=", "$", "this", "->", "pdoStatement", "->", "columnCount", "(", ")", ";", "if", "(", "$", "columns", ">", "0", ")", "{", "$", "this", "->", "mapping", "=", "[", "]", ";", "for...
Create the mapping to use for mapping the column names to a result array.
[ "Create", "the", "mapping", "to", "use", "for", "mapping", "the", "column", "names", "to", "a", "result", "array", "." ]
20cb74f2a2ee8d9161d3144b5c061a6da11cd066
https://github.com/Soneritics/Database/blob/20cb74f2a2ee8d9161d3144b5c061a6da11cd066/Soneritics/Database/DatabaseRecord/PDODatabaseRecord.php#L51-L61
24,989
Soneritics/Database
Soneritics/Database/DatabaseRecord/PDODatabaseRecord.php
PDODatabaseRecord.all
public function all() { $this->reset(); $result = []; while ($row = $this->get()) { $result[] = $row; } return $result; }
php
public function all() { $this->reset(); $result = []; while ($row = $this->get()) { $result[] = $row; } return $result; }
[ "public", "function", "all", "(", ")", "{", "$", "this", "->", "reset", "(", ")", ";", "$", "result", "=", "[", "]", ";", "while", "(", "$", "row", "=", "$", "this", "->", "get", "(", ")", ")", "{", "$", "result", "[", "]", "=", "$", "row",...
Return an array with all the data from the query. @return array
[ "Return", "an", "array", "with", "all", "the", "data", "from", "the", "query", "." ]
20cb74f2a2ee8d9161d3144b5c061a6da11cd066
https://github.com/Soneritics/Database/blob/20cb74f2a2ee8d9161d3144b5c061a6da11cd066/Soneritics/Database/DatabaseRecord/PDODatabaseRecord.php#L80-L90
24,990
zapheus/zapheus
src/Routing/Dispatcher.php
Dispatcher.match
protected function match($method, $uri) { $result = null; foreach ((array) $this->router->routes() as $route) { $matched = preg_match($route->regex(), $uri, $matches); if ($matched && $route->method() === $method) { return array($matches,...
php
protected function match($method, $uri) { $result = null; foreach ((array) $this->router->routes() as $route) { $matched = preg_match($route->regex(), $uri, $matches); if ($matched && $route->method() === $method) { return array($matches,...
[ "protected", "function", "match", "(", "$", "method", ",", "$", "uri", ")", "{", "$", "result", "=", "null", ";", "foreach", "(", "(", "array", ")", "$", "this", "->", "router", "->", "routes", "(", ")", "as", "$", "route", ")", "{", "$", "matche...
Matches the route from the parsed URI. @param string $method @param string $uri @return array|null
[ "Matches", "the", "route", "from", "the", "parsed", "URI", "." ]
96618b5cee7d20b6700d0475e4334ae4b5163a6b
https://github.com/zapheus/zapheus/blob/96618b5cee7d20b6700d0475e4334ae4b5163a6b/src/Routing/Dispatcher.php#L68-L83
24,991
SlabPHP/controllers
src/POSTBack.php
POSTBack.requireSubmitValue
protected function requireSubmitValue() { if ($this->system->input()->post('submit')) { echo 'LOOK: ' . $this->system->input()->post('submit') . PHP_EOL; return; } $this->setNotReady("No submit value present."); }
php
protected function requireSubmitValue() { if ($this->system->input()->post('submit')) { echo 'LOOK: ' . $this->system->input()->post('submit') . PHP_EOL; return; } $this->setNotReady("No submit value present."); }
[ "protected", "function", "requireSubmitValue", "(", ")", "{", "if", "(", "$", "this", "->", "system", "->", "input", "(", ")", "->", "post", "(", "'submit'", ")", ")", "{", "echo", "'LOOK: '", ".", "$", "this", "->", "system", "->", "input", "(", ")"...
Require Submit Value
[ "Require", "Submit", "Value" ]
a1c4fded0265100a85904dd664b972a7f8687652
https://github.com/SlabPHP/controllers/blob/a1c4fded0265100a85904dd664b972a7f8687652/src/POSTBack.php#L56-L64
24,992
SlabPHP/controllers
src/POSTBack.php
POSTBack.resolveRedirectRoute
protected function resolveRedirectRoute() { if (empty($this->redirectRoute)) return; $route = $this->system->router()->getRouteByName($this->redirectRoute); if (empty($route)) { $this->setNotReady("Unable to find route " . $this->redirectRoute); return; ...
php
protected function resolveRedirectRoute() { if (empty($this->redirectRoute)) return; $route = $this->system->router()->getRouteByName($this->redirectRoute); if (empty($route)) { $this->setNotReady("Unable to find route " . $this->redirectRoute); return; ...
[ "protected", "function", "resolveRedirectRoute", "(", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "redirectRoute", ")", ")", "return", ";", "$", "route", "=", "$", "this", "->", "system", "->", "router", "(", ")", "->", "getRouteByName", "(", ...
Resolve redirect route
[ "Resolve", "redirect", "route" ]
a1c4fded0265100a85904dd664b972a7f8687652
https://github.com/SlabPHP/controllers/blob/a1c4fded0265100a85904dd664b972a7f8687652/src/POSTBack.php#L86-L99
24,993
Stinger-Soft/PhpCommons
src/StingerSoft/PhpCommons/Formatter/TimeFormatter.php
TimeFormatter.prettyPrintMicroTimeInterval
public static function prettyPrintMicroTimeInterval($startTime, $endTime) { $seconds = abs($endTime - $startTime); return sprintf('%02d:%02d:%02d', ($seconds / 3600), ($seconds / 60 % 60), $seconds % 60); }
php
public static function prettyPrintMicroTimeInterval($startTime, $endTime) { $seconds = abs($endTime - $startTime); return sprintf('%02d:%02d:%02d', ($seconds / 3600), ($seconds / 60 % 60), $seconds % 60); }
[ "public", "static", "function", "prettyPrintMicroTimeInterval", "(", "$", "startTime", ",", "$", "endTime", ")", "{", "$", "seconds", "=", "abs", "(", "$", "endTime", "-", "$", "startTime", ")", ";", "return", "sprintf", "(", "'%02d:%02d:%02d'", ",", "(", ...
Pretty prints an interval specfied by two timestamps @param float $startTime Starttime as returned by microtime(true) @param float $endTime Endtime as returned by microtime(true) @param string $locale Locale used to format the result
[ "Pretty", "prints", "an", "interval", "specfied", "by", "two", "timestamps" ]
e1d7e2bb7b384fb9182903d3b6138aa3bbd05d9b
https://github.com/Stinger-Soft/PhpCommons/blob/e1d7e2bb7b384fb9182903d3b6138aa3bbd05d9b/src/StingerSoft/PhpCommons/Formatter/TimeFormatter.php#L53-L56
24,994
makinacorpus/drupal-ulink
src/EntityFinderRegistry.php
EntityFinderRegistry.all
public function all() { $ret = []; foreach ($this->instances as $instances) { $ret = array_merge($ret, $instances); } return $ret; }
php
public function all() { $ret = []; foreach ($this->instances as $instances) { $ret = array_merge($ret, $instances); } return $ret; }
[ "public", "function", "all", "(", ")", "{", "$", "ret", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "instances", "as", "$", "instances", ")", "{", "$", "ret", "=", "array_merge", "(", "$", "ret", ",", "$", "instances", ")", ";", "}", ...
Get all instances @return EntityFinderInterface[]
[ "Get", "all", "instances" ]
4e1e54b979d72934a6fc0242aae3f12abebf41d0
https://github.com/makinacorpus/drupal-ulink/blob/4e1e54b979d72934a6fc0242aae3f12abebf41d0/src/EntityFinderRegistry.php#L55-L64
24,995
Vectrex/vxPHP
src/Http/AcceptHeaderItem.php
AcceptHeaderItem.getAttribute
public function getAttribute($name, $default = NULL) { return isset($this->attributes[$name]) ? $this->attributes[$name] : $default; }
php
public function getAttribute($name, $default = NULL) { return isset($this->attributes[$name]) ? $this->attributes[$name] : $default; }
[ "public", "function", "getAttribute", "(", "$", "name", ",", "$", "default", "=", "NULL", ")", "{", "return", "isset", "(", "$", "this", "->", "attributes", "[", "$", "name", "]", ")", "?", "$", "this", "->", "attributes", "[", "$", "name", "]", ":...
Returns an attribute by its name. @param string $name @param mixed $default @return mixed
[ "Returns", "an", "attribute", "by", "its", "name", "." ]
295c21b00e7ef6085efcdf5b64fabb28d499b5a6
https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Http/AcceptHeaderItem.php#L209-L213
24,996
pryley/castor-framework
src/Services/Validator.php
Validator.validate
public function validate( $data, array $rules = [] ) { $this->normalizeData( $data ); $this->setRules( $rules ); foreach( $this->rules as $attribute => $rules ) { foreach( $rules as $rule ) { $this->validateAttribute( $rule, $attribute ); if( $this->shouldStopValidating( $attribute ))break; } }...
php
public function validate( $data, array $rules = [] ) { $this->normalizeData( $data ); $this->setRules( $rules ); foreach( $this->rules as $attribute => $rules ) { foreach( $rules as $rule ) { $this->validateAttribute( $rule, $attribute ); if( $this->shouldStopValidating( $attribute ))break; } }...
[ "public", "function", "validate", "(", "$", "data", ",", "array", "$", "rules", "=", "[", "]", ")", "{", "$", "this", "->", "normalizeData", "(", "$", "data", ")", ";", "$", "this", "->", "setRules", "(", "$", "rules", ")", ";", "foreach", "(", "...
Run the validator's rules against its data. @param mixed $data @return array
[ "Run", "the", "validator", "s", "rules", "against", "its", "data", "." ]
cbc137d02625cd05f4cc96414d6f70e451cb821f
https://github.com/pryley/castor-framework/blob/cbc137d02625cd05f4cc96414d6f70e451cb821f/src/Services/Validator.php#L72-L86
24,997
pryley/castor-framework
src/Services/Validator.php
Validator.addError
protected function addError( $attribute, $rule, array $parameters ) { $message = $this->getMessage( $attribute, $rule, $parameters ); $this->errors[ $attribute ]['errors'][] = $message; if( !isset( $this->errors[ $attribute ]['value'] )) { $this->errors[ $attribute ]['value'] = $this->getValue( $attribute )...
php
protected function addError( $attribute, $rule, array $parameters ) { $message = $this->getMessage( $attribute, $rule, $parameters ); $this->errors[ $attribute ]['errors'][] = $message; if( !isset( $this->errors[ $attribute ]['value'] )) { $this->errors[ $attribute ]['value'] = $this->getValue( $attribute )...
[ "protected", "function", "addError", "(", "$", "attribute", ",", "$", "rule", ",", "array", "$", "parameters", ")", "{", "$", "message", "=", "$", "this", "->", "getMessage", "(", "$", "attribute", ",", "$", "rule", ",", "$", "parameters", ")", ";", ...
Add an error message to the validator's collection of errors. @param string $attribute @param string $rule @return void
[ "Add", "an", "error", "message", "to", "the", "validator", "s", "collection", "of", "errors", "." ]
cbc137d02625cd05f4cc96414d6f70e451cb821f
https://github.com/pryley/castor-framework/blob/cbc137d02625cd05f4cc96414d6f70e451cb821f/src/Services/Validator.php#L96-L105
24,998
pryley/castor-framework
src/Services/Validator.php
Validator.normalizeData
protected function normalizeData( $data ) { // If an object was provided, get its public properties if( is_object( $data )) { $this->data = get_object_vars( $data ); } else { $this->data = $data; } return $this; }
php
protected function normalizeData( $data ) { // If an object was provided, get its public properties if( is_object( $data )) { $this->data = get_object_vars( $data ); } else { $this->data = $data; } return $this; }
[ "protected", "function", "normalizeData", "(", "$", "data", ")", "{", "// If an object was provided, get its public properties", "if", "(", "is_object", "(", "$", "data", ")", ")", "{", "$", "this", "->", "data", "=", "get_object_vars", "(", "$", "data", ")", ...
Normalize the provided data to an array. @param mixed $data @return $this
[ "Normalize", "the", "provided", "data", "to", "an", "array", "." ]
cbc137d02625cd05f4cc96414d6f70e451cb821f
https://github.com/pryley/castor-framework/blob/cbc137d02625cd05f4cc96414d6f70e451cb821f/src/Services/Validator.php#L251-L262
24,999
pryley/castor-framework
src/Services/Validator.php
Validator.translator
protected function translator( $key, $rule, $attribute, array $parameters ) { $strings = [];//glsr_resolve( 'Strings' )->validation(); $message = isset( $strings[$key] ) ? $strings[$key] : false; if( !$message )return; $message = str_replace( ':attribute', $attribute, $message ); if( method_exists(...
php
protected function translator( $key, $rule, $attribute, array $parameters ) { $strings = [];//glsr_resolve( 'Strings' )->validation(); $message = isset( $strings[$key] ) ? $strings[$key] : false; if( !$message )return; $message = str_replace( ':attribute', $attribute, $message ); if( method_exists(...
[ "protected", "function", "translator", "(", "$", "key", ",", "$", "rule", ",", "$", "attribute", ",", "array", "$", "parameters", ")", "{", "$", "strings", "=", "[", "]", ";", "//glsr_resolve( 'Strings' )->validation();", "$", "message", "=", "isset", "(", ...
Returns a translated message for the attribute @param string $key @param string $rule @param string $attribute @return string|null
[ "Returns", "a", "translated", "message", "for", "the", "attribute" ]
cbc137d02625cd05f4cc96414d6f70e451cb821f
https://github.com/pryley/castor-framework/blob/cbc137d02625cd05f4cc96414d6f70e451cb821f/src/Services/Validator.php#L415-L432