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
200,700
ARCANESOFT/Auth
src/Providers/PackagesServiceProvider.php
PackagesServiceProvider.configLaravelAuthPackage
private function configLaravelAuthPackage() { $config = $this->config(); $config->set( 'laravel-auth', Arr::only($config->get('arcanesoft.auth'), [ 'database', 'users', 'roles', 'role-user', 'permissions-groups', 'permissions', 'permission-role', ...
php
private function configLaravelAuthPackage() { $config = $this->config(); $config->set( 'laravel-auth', Arr::only($config->get('arcanesoft.auth'), [ 'database', 'users', 'roles', 'role-user', 'permissions-groups', 'permissions', 'permission-role', ...
[ "private", "function", "configLaravelAuthPackage", "(", ")", "{", "$", "config", "=", "$", "this", "->", "config", "(", ")", ";", "$", "config", "->", "set", "(", "'laravel-auth'", ",", "Arr", "::", "only", "(", "$", "config", "->", "get", "(", "'arcan...
Config the Laravel Auth package.
[ "Config", "the", "Laravel", "Auth", "package", "." ]
b33ca82597a76b1e395071f71ae3e51f1ec67e62
https://github.com/ARCANESOFT/Auth/blob/b33ca82597a76b1e395071f71ae3e51f1ec67e62/src/Providers/PackagesServiceProvider.php#L86-L100
200,701
ARCANESOFT/Auth
src/Providers/PackagesServiceProvider.php
PackagesServiceProvider.rebindModels
private function rebindModels() { $config = $this->config(); $bindings = [ [ 'abstract' => \Arcanesoft\Contracts\Auth\Models\User::class, 'concrete' => $config->get('arcanesoft.auth.users.model'), ],[ 'abstract' => \Arcanesoft...
php
private function rebindModels() { $config = $this->config(); $bindings = [ [ 'abstract' => \Arcanesoft\Contracts\Auth\Models\User::class, 'concrete' => $config->get('arcanesoft.auth.users.model'), ],[ 'abstract' => \Arcanesoft...
[ "private", "function", "rebindModels", "(", ")", "{", "$", "config", "=", "$", "this", "->", "config", "(", ")", ";", "$", "bindings", "=", "[", "[", "'abstract'", "=>", "\\", "Arcanesoft", "\\", "Contracts", "\\", "Auth", "\\", "Models", "\\", "User",...
Rebind the auth models.
[ "Rebind", "the", "auth", "models", "." ]
b33ca82597a76b1e395071f71ae3e51f1ec67e62
https://github.com/ARCANESOFT/Auth/blob/b33ca82597a76b1e395071f71ae3e51f1ec67e62/src/Providers/PackagesServiceProvider.php#L115-L137
200,702
hiqdev/hidev-phpunit
src/console/PhpunitController.php
PhpunitController.actionGenfake
public function actionGenfake($file) { $path = $this->buildFakePath($file); if (!$this->force && file_exists($path)) { Yii::warning("already exists: $path"); return 1; } return $this->genFake($file, $path); }
php
public function actionGenfake($file) { $path = $this->buildFakePath($file); if (!$this->force && file_exists($path)) { Yii::warning("already exists: $path"); return 1; } return $this->genFake($file, $path); }
[ "public", "function", "actionGenfake", "(", "$", "file", ")", "{", "$", "path", "=", "$", "this", "->", "buildFakePath", "(", "$", "file", ")", ";", "if", "(", "!", "$", "this", "->", "force", "&&", "file_exists", "(", "$", "path", ")", ")", "{", ...
Generates skeleton class for fake.
[ "Generates", "skeleton", "class", "for", "fake", "." ]
53f3567490b20c720b911e4486a010585db13d28
https://github.com/hiqdev/hidev-phpunit/blob/53f3567490b20c720b911e4486a010585db13d28/src/console/PhpunitController.php#L50-L60
200,703
Wedeto/DB
src/Query/GetClause.php
GetClause.toSQL
public function toSQL(Parameters $params, bool $inner_clause) { $alias = $this->alias; $drv = $params->getDriver(); $sql = $drv->toSQL($params, $this->expression, true); if (empty($this->alias)) $this->alias = $params->generateAlias($this->expression); if (!emp...
php
public function toSQL(Parameters $params, bool $inner_clause) { $alias = $this->alias; $drv = $params->getDriver(); $sql = $drv->toSQL($params, $this->expression, true); if (empty($this->alias)) $this->alias = $params->generateAlias($this->expression); if (!emp...
[ "public", "function", "toSQL", "(", "Parameters", "$", "params", ",", "bool", "$", "inner_clause", ")", "{", "$", "alias", "=", "$", "this", "->", "alias", ";", "$", "drv", "=", "$", "params", "->", "getDriver", "(", ")", ";", "$", "sql", "=", "$",...
Write a select return clause as SQL query syntax @param Parameters $params The query parameters: tables and placeholder values @return string The generated SQL
[ "Write", "a", "select", "return", "clause", "as", "SQL", "query", "syntax" ]
715f8f2e3ae6b53c511c40b620921cb9c87e6f62
https://github.com/Wedeto/DB/blob/715f8f2e3ae6b53c511c40b620921cb9c87e6f62/src/Query/GetClause.php#L56-L70
200,704
wb-crowdfusion/crowdfusion
system/core/classes/libraries/xml/SimpleXMLParser.php
SimpleXMLParser.parseXMLString
public function parseXMLString($xmlString, $simpleXMLClass = 'SimpleXMLExtended') { libxml_use_internal_errors(true); $doc = simplexml_load_string($xmlString, $simpleXMLClass); if (false === $doc) { $xml = explode("\n", $xmlString); $errors = libxml_get_errors(); ...
php
public function parseXMLString($xmlString, $simpleXMLClass = 'SimpleXMLExtended') { libxml_use_internal_errors(true); $doc = simplexml_load_string($xmlString, $simpleXMLClass); if (false === $doc) { $xml = explode("\n", $xmlString); $errors = libxml_get_errors(); ...
[ "public", "function", "parseXMLString", "(", "$", "xmlString", ",", "$", "simpleXMLClass", "=", "'SimpleXMLExtended'", ")", "{", "libxml_use_internal_errors", "(", "true", ")", ";", "$", "doc", "=", "simplexml_load_string", "(", "$", "xmlString", ",", "$", "simp...
Converts an XML string into a SimpleXMLElement object @param string $xmlString String of well-formed XML @param string $simpleXMLClass Optional parameter to specify classname of the return object. That class should extend the SimpleXMLElement class. @return SimpleXMLElement Object of specified class @throws Simp...
[ "Converts", "an", "XML", "string", "into", "a", "SimpleXMLElement", "object" ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/xml/SimpleXMLParser.php#L46-L68
200,705
wb-crowdfusion/crowdfusion
system/core/classes/libraries/xml/SimpleXMLParser.php
SimpleXMLParser.loadIncludes
protected function loadIncludes($xmlPath, $xmlString) { $m = null; if (preg_match_all("/\<include\s*href\=\"([^\"]+)\".*?\/\>/si", $xmlString, $m, PREG_SET_ORDER) !== false) { foreach ($m as $match) { $includeFile = rtrim($xmlPath, '/').'/'.$match[1]; if (...
php
protected function loadIncludes($xmlPath, $xmlString) { $m = null; if (preg_match_all("/\<include\s*href\=\"([^\"]+)\".*?\/\>/si", $xmlString, $m, PREG_SET_ORDER) !== false) { foreach ($m as $match) { $includeFile = rtrim($xmlPath, '/').'/'.$match[1]; if (...
[ "protected", "function", "loadIncludes", "(", "$", "xmlPath", ",", "$", "xmlString", ")", "{", "$", "m", "=", "null", ";", "if", "(", "preg_match_all", "(", "\"/\\<include\\s*href\\=\\\"([^\\\"]+)\\\".*?\\/\\>/si\"", ",", "$", "xmlString", ",", "$", "m", ",", ...
Loads all the includes into the xml string. @param string $xmlPath The absolute path to the directory where the include files are located @param string $xmlString The full XML string (usually file contents from an xml doc) @return string the full xml string with any includes replaced by the included content
[ "Loads", "all", "the", "includes", "into", "the", "xml", "string", "." ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/xml/SimpleXMLParser.php#L177-L194
200,706
liip/DataAggregator
src/Liip/DataAggregator/Subjects/SubjectDispatcher.php
SubjectDispatcher.attachSubject
public function attachSubject($event, \SplSubject $subject) { $key = $this->getUniqueKey($event); if (!array_key_exists($event, $this->subjects)) { $this->subjects[$event] = array(); } $this->subjects[$event][$key] = $subject; return $key; }
php
public function attachSubject($event, \SplSubject $subject) { $key = $this->getUniqueKey($event); if (!array_key_exists($event, $this->subjects)) { $this->subjects[$event] = array(); } $this->subjects[$event][$key] = $subject; return $key; }
[ "public", "function", "attachSubject", "(", "$", "event", ",", "\\", "SplSubject", "$", "subject", ")", "{", "$", "key", "=", "$", "this", "->", "getUniqueKey", "(", "$", "event", ")", ";", "if", "(", "!", "array_key_exists", "(", "$", "event", ",", ...
Registers a subject to be called an a specific event. @param string $event @param \SplSubject $subject @return string
[ "Registers", "a", "subject", "to", "be", "called", "an", "a", "specific", "event", "." ]
53da08ed3f5f24597be9f40ecf8ec44da7765e47
https://github.com/liip/DataAggregator/blob/53da08ed3f5f24597be9f40ecf8ec44da7765e47/src/Liip/DataAggregator/Subjects/SubjectDispatcher.php#L23-L34
200,707
liip/DataAggregator
src/Liip/DataAggregator/Subjects/SubjectDispatcher.php
SubjectDispatcher.detachSubject
public function detachSubject($event, $key) { Assertion::notEmptyKey($this->subjects, $event, 'Provided event does not exist.'); Assertion::notEmptyKey($this->subjects[$event], $key, 'Subject to be detached does not exist.'); unset($this->subjects[$event][$key]); }
php
public function detachSubject($event, $key) { Assertion::notEmptyKey($this->subjects, $event, 'Provided event does not exist.'); Assertion::notEmptyKey($this->subjects[$event], $key, 'Subject to be detached does not exist.'); unset($this->subjects[$event][$key]); }
[ "public", "function", "detachSubject", "(", "$", "event", ",", "$", "key", ")", "{", "Assertion", "::", "notEmptyKey", "(", "$", "this", "->", "subjects", ",", "$", "event", ",", "'Provided event does not exist.'", ")", ";", "Assertion", "::", "notEmptyKey", ...
Unregisters a subject from a specific event. @param string $event @param string $key
[ "Unregisters", "a", "subject", "from", "a", "specific", "event", "." ]
53da08ed3f5f24597be9f40ecf8ec44da7765e47
https://github.com/liip/DataAggregator/blob/53da08ed3f5f24597be9f40ecf8ec44da7765e47/src/Liip/DataAggregator/Subjects/SubjectDispatcher.php#L42-L48
200,708
liip/DataAggregator
src/Liip/DataAggregator/Subjects/SubjectDispatcher.php
SubjectDispatcher.emit
public function emit($event) { if (!empty($this->subjects[$event])) { /** @var \SplSubject $subject */ foreach($this->subjects[$event] as $subject) { $subject->notify(); } } }
php
public function emit($event) { if (!empty($this->subjects[$event])) { /** @var \SplSubject $subject */ foreach($this->subjects[$event] as $subject) { $subject->notify(); } } }
[ "public", "function", "emit", "(", "$", "event", ")", "{", "if", "(", "!", "empty", "(", "$", "this", "->", "subjects", "[", "$", "event", "]", ")", ")", "{", "/** @var \\SplSubject $subject */", "foreach", "(", "$", "this", "->", "subjects", "[", "$",...
Triggers every subject attached to an event. @param string $event
[ "Triggers", "every", "subject", "attached", "to", "an", "event", "." ]
53da08ed3f5f24597be9f40ecf8ec44da7765e47
https://github.com/liip/DataAggregator/blob/53da08ed3f5f24597be9f40ecf8ec44da7765e47/src/Liip/DataAggregator/Subjects/SubjectDispatcher.php#L56-L65
200,709
koolkode/stream
src/ErrorHandlerTrait.php
ErrorHandlerTrait.handleError
protected static function handleError() { if(self::$errorHandler === NULL) { self::$errorHandler = function ($type, $message, $file, $line) { throw new \RuntimeException($message); }; } return self::$errorHandler; }
php
protected static function handleError() { if(self::$errorHandler === NULL) { self::$errorHandler = function ($type, $message, $file, $line) { throw new \RuntimeException($message); }; } return self::$errorHandler; }
[ "protected", "static", "function", "handleError", "(", ")", "{", "if", "(", "self", "::", "$", "errorHandler", "===", "NULL", ")", "{", "self", "::", "$", "errorHandler", "=", "function", "(", "$", "type", ",", "$", "message", ",", "$", "file", ",", ...
Initialize and return the error handler callback. @return callable
[ "Initialize", "and", "return", "the", "error", "handler", "callback", "." ]
05e83efd76e1cb9e40a972711986b4a7e38bc141
https://github.com/koolkode/stream/blob/05e83efd76e1cb9e40a972711986b4a7e38bc141/src/ErrorHandlerTrait.php#L33-L43
200,710
Facebook-Anonymous-Publisher/firewall
src/Firewall.php
Firewall.isAllowCountry
public function isAllowCountry(array $codes = ['*']) { try { return in_array('*', $codes, true) || in_array(Utility::isoCode($this->ip()), $codes, true); } catch (\Exception $e) { return true; } }
php
public function isAllowCountry(array $codes = ['*']) { try { return in_array('*', $codes, true) || in_array(Utility::isoCode($this->ip()), $codes, true); } catch (\Exception $e) { return true; } }
[ "public", "function", "isAllowCountry", "(", "array", "$", "codes", "=", "[", "'*'", "]", ")", "{", "try", "{", "return", "in_array", "(", "'*'", ",", "$", "codes", ",", "true", ")", "||", "in_array", "(", "Utility", "::", "isoCode", "(", "$", "this"...
Determine the request ip address is in allow countries. @param array $codes @return bool
[ "Determine", "the", "request", "ip", "address", "is", "in", "allow", "countries", "." ]
3d78855cc828a1ebda37ac73c41fd64dc8dd0583
https://github.com/Facebook-Anonymous-Publisher/firewall/blob/3d78855cc828a1ebda37ac73c41fd64dc8dd0583/src/Firewall.php#L79-L87
200,711
Facebook-Anonymous-Publisher/firewall
src/Firewall.php
Firewall.ban
public function ban($ip = null, $type = 'regular') { $this->validateType($type); if (! is_null($ip)) { if ('segment' === $type) { $ip = Utility::cidr($ip); } } else { $ip = $this->ip(); session(['isBan' => $type]); } ...
php
public function ban($ip = null, $type = 'regular') { $this->validateType($type); if (! is_null($ip)) { if ('segment' === $type) { $ip = Utility::cidr($ip); } } else { $ip = $this->ip(); session(['isBan' => $type]); } ...
[ "public", "function", "ban", "(", "$", "ip", "=", "null", ",", "$", "type", "=", "'regular'", ")", "{", "$", "this", "->", "validateType", "(", "$", "type", ")", ";", "if", "(", "!", "is_null", "(", "$", "ip", ")", ")", "{", "if", "(", "'segmen...
Ban ip address. @param string|null $ip @param string $type @return Models\Firewall
[ "Ban", "ip", "address", "." ]
3d78855cc828a1ebda37ac73c41fd64dc8dd0583
https://github.com/Facebook-Anonymous-Publisher/firewall/blob/3d78855cc828a1ebda37ac73c41fd64dc8dd0583/src/Firewall.php#L97-L112
200,712
Facebook-Anonymous-Publisher/firewall
src/Firewall.php
Firewall.unban
public function unban($ip = null) { if (is_null($ip)) { $ip = $this->ip(); session()->forget('isBan'); } return $this->model->destroy($ip); }
php
public function unban($ip = null) { if (is_null($ip)) { $ip = $this->ip(); session()->forget('isBan'); } return $this->model->destroy($ip); }
[ "public", "function", "unban", "(", "$", "ip", "=", "null", ")", "{", "if", "(", "is_null", "(", "$", "ip", ")", ")", "{", "$", "ip", "=", "$", "this", "->", "ip", "(", ")", ";", "session", "(", ")", "->", "forget", "(", "'isBan'", ")", ";", ...
Unban ip address. @param string|null $ip @return int
[ "Unban", "ip", "address", "." ]
3d78855cc828a1ebda37ac73c41fd64dc8dd0583
https://github.com/Facebook-Anonymous-Publisher/firewall/blob/3d78855cc828a1ebda37ac73c41fd64dc8dd0583/src/Firewall.php#L133-L142
200,713
wb-crowdfusion/crowdfusion
system/core/classes/libraries/storagefacility/LocalStorageFacility.php
LocalStorageFacility.fileExists
public function fileExists(StorageFacilityParams $params, $fileid) { $this->validateFileID($fileid); return file_exists($this->generateStoragePath($params, $fileid)); }
php
public function fileExists(StorageFacilityParams $params, $fileid) { $this->validateFileID($fileid); return file_exists($this->generateStoragePath($params, $fileid)); }
[ "public", "function", "fileExists", "(", "StorageFacilityParams", "$", "params", ",", "$", "fileid", ")", "{", "$", "this", "->", "validateFileID", "(", "$", "fileid", ")", ";", "return", "file_exists", "(", "$", "this", "->", "generateStoragePath", "(", "$"...
Returns true if the file exists in the storage facility or false if it doesn't exist. Throws an exception is the operation failed. @param Site $site Site used to determine storage location @param string $fileid File identifier of stored file, ex. /path/to/file.jpg @return boolean @throws StorageFacilityException ...
[ "Returns", "true", "if", "the", "file", "exists", "in", "the", "storage", "facility", "or", "false", "if", "it", "doesn", "t", "exist", ".", "Throws", "an", "exception", "is", "the", "operation", "failed", "." ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/storagefacility/LocalStorageFacility.php#L124-L128
200,714
wb-crowdfusion/crowdfusion
system/core/classes/libraries/storagefacility/LocalStorageFacility.php
LocalStorageFacility.deleteFile
public function deleteFile(StorageFacilityParams $params, $fileid) { $this->validateFileID($fileid); $storagePath = $this->generateStoragePath($params, $fileid); if (is_file($storagePath)) { if (!@unlink($storagePath)) { throw new StorageFacilityException("Canno...
php
public function deleteFile(StorageFacilityParams $params, $fileid) { $this->validateFileID($fileid); $storagePath = $this->generateStoragePath($params, $fileid); if (is_file($storagePath)) { if (!@unlink($storagePath)) { throw new StorageFacilityException("Canno...
[ "public", "function", "deleteFile", "(", "StorageFacilityParams", "$", "params", ",", "$", "fileid", ")", "{", "$", "this", "->", "validateFileID", "(", "$", "fileid", ")", ";", "$", "storagePath", "=", "$", "this", "->", "generateStoragePath", "(", "$", "...
Deletes a file in the storage facility. @param Site $site Site used to determine storage location @param string $fileid File identifier of stored file, ex. /path/to/file.jpg @return boolean True upon success @throws StorageFacilityException if operation fails
[ "Deletes", "a", "file", "in", "the", "storage", "facility", "." ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/storagefacility/LocalStorageFacility.php#L139-L152
200,715
wb-crowdfusion/crowdfusion
system/core/classes/libraries/storagefacility/LocalStorageFacility.php
LocalStorageFacility.renameFile
public function renameFile(StorageFacilityParams $params, StorageFacilityFile &$file, $newfileid) { $this->validateFileID($newfileid); if ($file->getId() == null) throw new StorageFacilityException("Invalid fileid '".$file->getId()."'"); if ($this->fileExists($params, $newfilei...
php
public function renameFile(StorageFacilityParams $params, StorageFacilityFile &$file, $newfileid) { $this->validateFileID($newfileid); if ($file->getId() == null) throw new StorageFacilityException("Invalid fileid '".$file->getId()."'"); if ($this->fileExists($params, $newfilei...
[ "public", "function", "renameFile", "(", "StorageFacilityParams", "$", "params", ",", "StorageFacilityFile", "&", "$", "file", ",", "$", "newfileid", ")", "{", "$", "this", "->", "validateFileID", "(", "$", "newfileid", ")", ";", "if", "(", "$", "file", "-...
Renames a StorageFacilityFile in the storage facility. @param Site $site Site used to determine storage location @param string &$file File identifier of stored file, ex. /path/to/file.ext @param string $newfileid File identifier to rename to @return StorageFacilityFile Fully-resolved and stored file, has U...
[ "Renames", "a", "StorageFacilityFile", "in", "the", "storage", "facility", "." ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/storagefacility/LocalStorageFacility.php#L165-L184
200,716
gplcart/cli
controllers/commands/Country.php
Country.cmdGetCountry
public function cmdGetCountry() { $result = $this->getListCountry(); $this->outputFormat($result); $this->outputFormatTableCountry($result); $this->output(); }
php
public function cmdGetCountry() { $result = $this->getListCountry(); $this->outputFormat($result); $this->outputFormatTableCountry($result); $this->output(); }
[ "public", "function", "cmdGetCountry", "(", ")", "{", "$", "result", "=", "$", "this", "->", "getListCountry", "(", ")", ";", "$", "this", "->", "outputFormat", "(", "$", "result", ")", ";", "$", "this", "->", "outputFormatTableCountry", "(", "$", "resul...
Callback for "country-get" command
[ "Callback", "for", "country", "-", "get", "command" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Country.php#L40-L46
200,717
gplcart/cli
controllers/commands/Country.php
Country.cmdUpdateCountry
public function cmdUpdateCountry() { $params = $this->getParam(); if (empty($params[0]) || count($params) < 2) { $this->errorAndExit($this->text('Invalid command')); } $this->setSubmitted(null, $params); $this->setSubmitted('update', $params[0]); $this->...
php
public function cmdUpdateCountry() { $params = $this->getParam(); if (empty($params[0]) || count($params) < 2) { $this->errorAndExit($this->text('Invalid command')); } $this->setSubmitted(null, $params); $this->setSubmitted('update', $params[0]); $this->...
[ "public", "function", "cmdUpdateCountry", "(", ")", "{", "$", "params", "=", "$", "this", "->", "getParam", "(", ")", ";", "if", "(", "empty", "(", "$", "params", "[", "0", "]", ")", "||", "count", "(", "$", "params", ")", "<", "2", ")", "{", "...
Callback for "country-update" command
[ "Callback", "for", "country", "-", "update", "command" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Country.php#L65-L80
200,718
gplcart/cli
controllers/commands/Country.php
Country.cmdDeleteCountry
public function cmdDeleteCountry() { $code = $this->getParam(0); $all = $this->getParam('all'); if (empty($code) && empty($all)) { $this->errorAndExit($this->text('Invalid command')); } $result = null; if (!empty($code)) { $result = $this->c...
php
public function cmdDeleteCountry() { $code = $this->getParam(0); $all = $this->getParam('all'); if (empty($code) && empty($all)) { $this->errorAndExit($this->text('Invalid command')); } $result = null; if (!empty($code)) { $result = $this->c...
[ "public", "function", "cmdDeleteCountry", "(", ")", "{", "$", "code", "=", "$", "this", "->", "getParam", "(", "0", ")", ";", "$", "all", "=", "$", "this", "->", "getParam", "(", "'all'", ")", ";", "if", "(", "empty", "(", "$", "code", ")", "&&",...
Callback for "country-delete" command
[ "Callback", "for", "country", "-", "delete", "command" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Country.php#L85-L114
200,719
gplcart/cli
controllers/commands/Country.php
Country.addCountry
protected function addCountry() { if (!$this->isError() && !$this->country->add($this->getSubmitted())) { $this->errorAndExit($this->text('Unexpected result')); } }
php
protected function addCountry() { if (!$this->isError() && !$this->country->add($this->getSubmitted())) { $this->errorAndExit($this->text('Unexpected result')); } }
[ "protected", "function", "addCountry", "(", ")", "{", "if", "(", "!", "$", "this", "->", "isError", "(", ")", "&&", "!", "$", "this", "->", "country", "->", "add", "(", "$", "this", "->", "getSubmitted", "(", ")", ")", ")", "{", "$", "this", "->"...
Add a new country
[ "Add", "a", "new", "country" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Country.php#L169-L174
200,720
gplcart/cli
controllers/commands/Country.php
Country.updateCountry
protected function updateCountry($code) { if (!$this->isError() && !$this->country->update($code, $this->getSubmitted())) { $this->errorAndExit($this->text('Unexpected result')); } }
php
protected function updateCountry($code) { if (!$this->isError() && !$this->country->update($code, $this->getSubmitted())) { $this->errorAndExit($this->text('Unexpected result')); } }
[ "protected", "function", "updateCountry", "(", "$", "code", ")", "{", "if", "(", "!", "$", "this", "->", "isError", "(", ")", "&&", "!", "$", "this", "->", "country", "->", "update", "(", "$", "code", ",", "$", "this", "->", "getSubmitted", "(", ")...
Updates an country @param string $code
[ "Updates", "an", "country" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Country.php#L180-L185
200,721
gplcart/cli
controllers/commands/Country.php
Country.submitAddCountry
protected function submitAddCountry() { $this->setSubmitted(null, $this->getParam()); $this->setSubmittedJson('format'); $this->validateComponent('country'); $this->addCountry(); }
php
protected function submitAddCountry() { $this->setSubmitted(null, $this->getParam()); $this->setSubmittedJson('format'); $this->validateComponent('country'); $this->addCountry(); }
[ "protected", "function", "submitAddCountry", "(", ")", "{", "$", "this", "->", "setSubmitted", "(", "null", ",", "$", "this", "->", "getParam", "(", ")", ")", ";", "$", "this", "->", "setSubmittedJson", "(", "'format'", ")", ";", "$", "this", "->", "va...
Add a new country at once
[ "Add", "a", "new", "country", "at", "once" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Country.php#L190-L196
200,722
gplcart/cli
controllers/commands/Country.php
Country.wizardAddCountry
protected function wizardAddCountry() { $this->validatePrompt('code', $this->text('Code'), 'country'); $this->validatePrompt('name', $this->text('Name'), 'country', ''); $this->validatePrompt('native_name', $this->text('Native name'), 'country', ''); $this->validatePrompt('zone_id', ...
php
protected function wizardAddCountry() { $this->validatePrompt('code', $this->text('Code'), 'country'); $this->validatePrompt('name', $this->text('Name'), 'country', ''); $this->validatePrompt('native_name', $this->text('Native name'), 'country', ''); $this->validatePrompt('zone_id', ...
[ "protected", "function", "wizardAddCountry", "(", ")", "{", "$", "this", "->", "validatePrompt", "(", "'code'", ",", "$", "this", "->", "text", "(", "'Code'", ")", ",", "'country'", ")", ";", "$", "this", "->", "validatePrompt", "(", "'name'", ",", "$", ...
Add a new country step by step
[ "Add", "a", "new", "country", "step", "by", "step" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Country.php#L201-L212
200,723
DaGhostman/codewave
src/Application/Router.php
Router.get
public function get($pattern, $callback, array $middleware = null, $name = null) { $this->addRoute('get', $pattern, $callback, $middleware, $name); return $this; }
php
public function get($pattern, $callback, array $middleware = null, $name = null) { $this->addRoute('get', $pattern, $callback, $middleware, $name); return $this; }
[ "public", "function", "get", "(", "$", "pattern", ",", "$", "callback", ",", "array", "$", "middleware", "=", "null", ",", "$", "name", "=", "null", ")", "{", "$", "this", "->", "addRoute", "(", "'get'", ",", "$", "pattern", ",", "$", "callback", "...
Defines a route which will respond to GET and HEAD requests @param string $pattern The route pattern for the URL @param callable $callback The callback which should be handle the response @param callable[] $middleware List of the middleware for the route @param string $name (Optional) Route name. Used for reverse rout...
[ "Defines", "a", "route", "which", "will", "respond", "to", "GET", "and", "HEAD", "requests" ]
f0f58e721699cdaaf87cbfaf8ce589a6b3c473b8
https://github.com/DaGhostman/codewave/blob/f0f58e721699cdaaf87cbfaf8ce589a6b3c473b8/src/Application/Router.php#L147-L152
200,724
DaGhostman/codewave
src/Application/Router.php
Router.addRoute
protected function addRoute($method, $pattern, $callback, array $middleware = null, $name = null) { $concatenatedPattern = (!is_null($this->prefix) ? '/' . $this->prefix : '') . $pattern; $this->collector->addRoute(strtoupper($method), $concatenatedPattern, new Route($callback, $middlew...
php
protected function addRoute($method, $pattern, $callback, array $middleware = null, $name = null) { $concatenatedPattern = (!is_null($this->prefix) ? '/' . $this->prefix : '') . $pattern; $this->collector->addRoute(strtoupper($method), $concatenatedPattern, new Route($callback, $middlew...
[ "protected", "function", "addRoute", "(", "$", "method", ",", "$", "pattern", ",", "$", "callback", ",", "array", "$", "middleware", "=", "null", ",", "$", "name", "=", "null", ")", "{", "$", "concatenatedPattern", "=", "(", "!", "is_null", "(", "$", ...
Proxies the route definition with the backend routing library @param string $method @param string $pattern @param callable $callback @param array $middleware @param null $name
[ "Proxies", "the", "route", "definition", "with", "the", "backend", "routing", "library" ]
f0f58e721699cdaaf87cbfaf8ce589a6b3c473b8
https://github.com/DaGhostman/codewave/blob/f0f58e721699cdaaf87cbfaf8ce589a6b3c473b8/src/Application/Router.php#L163-L173
200,725
DaGhostman/codewave
src/Application/Router.php
Router.post
public function post($pattern, $callback, array $middleware = null, $name = null) { $this->addRoute('post', $pattern, $callback, $middleware, $name); return $this; }
php
public function post($pattern, $callback, array $middleware = null, $name = null) { $this->addRoute('post', $pattern, $callback, $middleware, $name); return $this; }
[ "public", "function", "post", "(", "$", "pattern", ",", "$", "callback", ",", "array", "$", "middleware", "=", "null", ",", "$", "name", "=", "null", ")", "{", "$", "this", "->", "addRoute", "(", "'post'", ",", "$", "pattern", ",", "$", "callback", ...
Defines a route which will respond to POST requests @param string $pattern The route pattern for the URL @param callable $callback The callback which should be handle the response @param callable[] $middleware List of the middleware for the route @param string $name (Optional) Route name. Used for reverse routing. @r...
[ "Defines", "a", "route", "which", "will", "respond", "to", "POST", "requests" ]
f0f58e721699cdaaf87cbfaf8ce589a6b3c473b8
https://github.com/DaGhostman/codewave/blob/f0f58e721699cdaaf87cbfaf8ce589a6b3c473b8/src/Application/Router.php#L185-L190
200,726
DaGhostman/codewave
src/Application/Router.php
Router.put
public function put($pattern, $callback, array $middleware = null, $name = null) { $this->addRoute('put', $pattern, $callback, $middleware, $name); return $this; }
php
public function put($pattern, $callback, array $middleware = null, $name = null) { $this->addRoute('put', $pattern, $callback, $middleware, $name); return $this; }
[ "public", "function", "put", "(", "$", "pattern", ",", "$", "callback", ",", "array", "$", "middleware", "=", "null", ",", "$", "name", "=", "null", ")", "{", "$", "this", "->", "addRoute", "(", "'put'", ",", "$", "pattern", ",", "$", "callback", "...
Defines a route which will respond to PUT requests @param string $pattern The route pattern for the URL @param callable $callback The callback which should be handle the response @param callable[] $middleware List of the middleware for the route @param string $name (Optional) Route name. Used for reverse routing. @re...
[ "Defines", "a", "route", "which", "will", "respond", "to", "PUT", "requests" ]
f0f58e721699cdaaf87cbfaf8ce589a6b3c473b8
https://github.com/DaGhostman/codewave/blob/f0f58e721699cdaaf87cbfaf8ce589a6b3c473b8/src/Application/Router.php#L202-L207
200,727
DaGhostman/codewave
src/Application/Router.php
Router.patch
public function patch($pattern, $callback, array $middleware = null, $name = null) { $this->addRoute('patch', $pattern, $callback, $middleware, $name); return $this; }
php
public function patch($pattern, $callback, array $middleware = null, $name = null) { $this->addRoute('patch', $pattern, $callback, $middleware, $name); return $this; }
[ "public", "function", "patch", "(", "$", "pattern", ",", "$", "callback", ",", "array", "$", "middleware", "=", "null", ",", "$", "name", "=", "null", ")", "{", "$", "this", "->", "addRoute", "(", "'patch'", ",", "$", "pattern", ",", "$", "callback",...
Defines a route which will respond to PATCH requests @param string $pattern The route pattern for the URL @param callable $callback The callback which should be handle the response @param callable[] $middleware List of the middleware for the route @param string $name (Optional) Route name. Used for reverse routing. @...
[ "Defines", "a", "route", "which", "will", "respond", "to", "PATCH", "requests" ]
f0f58e721699cdaaf87cbfaf8ce589a6b3c473b8
https://github.com/DaGhostman/codewave/blob/f0f58e721699cdaaf87cbfaf8ce589a6b3c473b8/src/Application/Router.php#L219-L224
200,728
DaGhostman/codewave
src/Application/Router.php
Router.delete
public function delete($pattern, $callback, array $middleware = null, $name = null) { $this->addRoute('delete', $pattern, $callback, $middleware, $name); return $this; }
php
public function delete($pattern, $callback, array $middleware = null, $name = null) { $this->addRoute('delete', $pattern, $callback, $middleware, $name); return $this; }
[ "public", "function", "delete", "(", "$", "pattern", ",", "$", "callback", ",", "array", "$", "middleware", "=", "null", ",", "$", "name", "=", "null", ")", "{", "$", "this", "->", "addRoute", "(", "'delete'", ",", "$", "pattern", ",", "$", "callback...
Defines a route which will respond to DELETE requests @param string $pattern The route pattern for the URL @param callable $callback The callback which should be handle the response @param callable[] $middleware List of the middleware for the route @param string $name (Optional) Route name. Used for reverse routing. ...
[ "Defines", "a", "route", "which", "will", "respond", "to", "DELETE", "requests" ]
f0f58e721699cdaaf87cbfaf8ce589a6b3c473b8
https://github.com/DaGhostman/codewave/blob/f0f58e721699cdaaf87cbfaf8ce589a6b3c473b8/src/Application/Router.php#L236-L241
200,729
DaGhostman/codewave
src/Application/Router.php
Router.options
public function options($pattern, $callback, array $middleware = null, $name = null) { $this->addRoute('options', $pattern, $callback, $middleware, $name); return $this; }
php
public function options($pattern, $callback, array $middleware = null, $name = null) { $this->addRoute('options', $pattern, $callback, $middleware, $name); return $this; }
[ "public", "function", "options", "(", "$", "pattern", ",", "$", "callback", ",", "array", "$", "middleware", "=", "null", ",", "$", "name", "=", "null", ")", "{", "$", "this", "->", "addRoute", "(", "'options'", ",", "$", "pattern", ",", "$", "callba...
Defines a route which will respond to OPTIONS requests @param string $pattern The route pattern for the URL @param callable $callback The callback which should be handle the response @param callable[] $middleware List of the middleware for the route @param string $name (Optional) Route name. Used for reverse routing. ...
[ "Defines", "a", "route", "which", "will", "respond", "to", "OPTIONS", "requests" ]
f0f58e721699cdaaf87cbfaf8ce589a6b3c473b8
https://github.com/DaGhostman/codewave/blob/f0f58e721699cdaaf87cbfaf8ce589a6b3c473b8/src/Application/Router.php#L253-L258
200,730
DaGhostman/codewave
src/Application/Router.php
Router.dispatch
public function dispatch(ServerRequestInterface $request, ResponseInterface $response) { $method = $request->getMethod(); $uri = $request->getUri()->getPath(); $d = new \FastRoute\Dispatcher\GroupCountBased($this->collector->getData()); $r = $d->dispatch( ($method === '...
php
public function dispatch(ServerRequestInterface $request, ResponseInterface $response) { $method = $request->getMethod(); $uri = $request->getUri()->getPath(); $d = new \FastRoute\Dispatcher\GroupCountBased($this->collector->getData()); $r = $d->dispatch( ($method === '...
[ "public", "function", "dispatch", "(", "ServerRequestInterface", "$", "request", ",", "ResponseInterface", "$", "response", ")", "{", "$", "method", "=", "$", "request", "->", "getMethod", "(", ")", ";", "$", "uri", "=", "$", "request", "->", "getUri", "("...
Performs the route matching and invokes the handler for the route, if there is an error it throws exception. @param ServerRequestInterface $request @param ResponseInterface $response @throws MethodNotAllowedException @throws NotFoundException @return ResponseInterface
[ "Performs", "the", "route", "matching", "and", "invokes", "the", "handler", "for", "the", "route", "if", "there", "is", "an", "error", "it", "throws", "exception", "." ]
f0f58e721699cdaaf87cbfaf8ce589a6b3c473b8
https://github.com/DaGhostman/codewave/blob/f0f58e721699cdaaf87cbfaf8ce589a6b3c473b8/src/Application/Router.php#L387-L412
200,731
OxfordInfoLabs/kinikit-core
src/Util/XMLUtils.php
XMLUtils.prettyPrint
public static function prettyPrint($xmlString, $htmlDisplay = false) { // Create a nicely formatted version $doc = new \DOMDocument(); $doc->loadXML($xmlString); $doc->preserveWhiteSpace = false; $doc->formatOutput = true; $prettyXML = $doc->saveXML(); if ($htm...
php
public static function prettyPrint($xmlString, $htmlDisplay = false) { // Create a nicely formatted version $doc = new \DOMDocument(); $doc->loadXML($xmlString); $doc->preserveWhiteSpace = false; $doc->formatOutput = true; $prettyXML = $doc->saveXML(); if ($htm...
[ "public", "static", "function", "prettyPrint", "(", "$", "xmlString", ",", "$", "htmlDisplay", "=", "false", ")", "{", "// Create a nicely formatted version", "$", "doc", "=", "new", "\\", "DOMDocument", "(", ")", ";", "$", "doc", "->", "loadXML", "(", "$", ...
Pretty print an XML string - if the HTML Display flag is passed it will be formatted for display on a web page with special characters escaped. @param string $xmlString @param boolean $htmlDisplay @return string
[ "Pretty", "print", "an", "XML", "string", "-", "if", "the", "HTML", "Display", "flag", "is", "passed", "it", "will", "be", "formatted", "for", "display", "on", "a", "web", "page", "with", "special", "characters", "escaped", "." ]
edc1b2e6ffabd595c4c7d322279b3dd1e59ef359
https://github.com/OxfordInfoLabs/kinikit-core/blob/edc1b2e6ffabd595c4c7d322279b3dd1e59ef359/src/Util/XMLUtils.php#L19-L32
200,732
gplcart/cli
controllers/commands/Language.php
Language.cmdUpdateLanguage
public function cmdUpdateLanguage() { $params = $this->getParam(); if (empty($params[0]) || count($params) < 2) { $this->errorAndExit($this->text('Invalid command')); } $this->setSubmitted(null, $params); $this->setSubmitted('update', $params[0]); $this-...
php
public function cmdUpdateLanguage() { $params = $this->getParam(); if (empty($params[0]) || count($params) < 2) { $this->errorAndExit($this->text('Invalid command')); } $this->setSubmitted(null, $params); $this->setSubmitted('update', $params[0]); $this-...
[ "public", "function", "cmdUpdateLanguage", "(", ")", "{", "$", "params", "=", "$", "this", "->", "getParam", "(", ")", ";", "if", "(", "empty", "(", "$", "params", "[", "0", "]", ")", "||", "count", "(", "$", "params", ")", "<", "2", ")", "{", ...
Callback for "language-update"
[ "Callback", "for", "language", "-", "update" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Language.php#L31-L45
200,733
gplcart/cli
controllers/commands/Language.php
Language.cmdGetLanguage
public function cmdGetLanguage() { $list = $this->getListLanguage(); $this->outputFormat($list); $this->outputFormatTableLanguage($list); $this->output(); }
php
public function cmdGetLanguage() { $list = $this->getListLanguage(); $this->outputFormat($list); $this->outputFormatTableLanguage($list); $this->output(); }
[ "public", "function", "cmdGetLanguage", "(", ")", "{", "$", "list", "=", "$", "this", "->", "getListLanguage", "(", ")", ";", "$", "this", "->", "outputFormat", "(", "$", "list", ")", ";", "$", "this", "->", "outputFormatTableLanguage", "(", "$", "list",...
Callback for "language-get" command
[ "Callback", "for", "language", "-", "get", "command" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Language.php#L64-L70
200,734
gplcart/cli
controllers/commands/Language.php
Language.cmdDeleteLanguage
public function cmdDeleteLanguage() { $id = $this->getParam(0); $all = $this->getParam('all'); if (!isset($id) && empty($all)) { $this->errorAndExit($this->text('Invalid command')); } $result = false; if (isset($id)) { $result = $this->langu...
php
public function cmdDeleteLanguage() { $id = $this->getParam(0); $all = $this->getParam('all'); if (!isset($id) && empty($all)) { $this->errorAndExit($this->text('Invalid command')); } $result = false; if (isset($id)) { $result = $this->langu...
[ "public", "function", "cmdDeleteLanguage", "(", ")", "{", "$", "id", "=", "$", "this", "->", "getParam", "(", "0", ")", ";", "$", "all", "=", "$", "this", "->", "getParam", "(", "'all'", ")", ";", "if", "(", "!", "isset", "(", "$", "id", ")", "...
Callback for "language-delete" command
[ "Callback", "for", "language", "-", "delete", "command" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Language.php#L75-L105
200,735
gplcart/cli
controllers/commands/Language.php
Language.submitAddLanguage
protected function submitAddLanguage() { $this->setSubmitted(null, $this->getParam()); $this->validateComponent('language'); $this->addLanguage(); }
php
protected function submitAddLanguage() { $this->setSubmitted(null, $this->getParam()); $this->validateComponent('language'); $this->addLanguage(); }
[ "protected", "function", "submitAddLanguage", "(", ")", "{", "$", "this", "->", "setSubmitted", "(", "null", ",", "$", "this", "->", "getParam", "(", ")", ")", ";", "$", "this", "->", "validateComponent", "(", "'language'", ")", ";", "$", "this", "->", ...
Add a language at once
[ "Add", "a", "language", "at", "once" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Language.php#L187-L192
200,736
gplcart/cli
controllers/commands/Language.php
Language.wizardAddLanguage
protected function wizardAddLanguage() { $this->validatePrompt('code', $this->text('Code'), 'language'); $this->validatePrompt('name', $this->text('Name'), 'language', ''); $this->validatePrompt('native_name', $this->text('Native name'), 'language', ''); $this->validatePrompt('status...
php
protected function wizardAddLanguage() { $this->validatePrompt('code', $this->text('Code'), 'language'); $this->validatePrompt('name', $this->text('Name'), 'language', ''); $this->validatePrompt('native_name', $this->text('Native name'), 'language', ''); $this->validatePrompt('status...
[ "protected", "function", "wizardAddLanguage", "(", ")", "{", "$", "this", "->", "validatePrompt", "(", "'code'", ",", "$", "this", "->", "text", "(", "'Code'", ")", ",", "'language'", ")", ";", "$", "this", "->", "validatePrompt", "(", "'name'", ",", "$"...
Adds a language step by step
[ "Adds", "a", "language", "step", "by", "step" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Language.php#L197-L209
200,737
pvsaintpe/yii2-boost
db/ActiveRecord.php
ActiveRecord.oneOf
protected function oneOf($name, $conditions) { $method = 'get' . ucfirst($name); if (method_exists($this, $method)) { /** @var \yii\db\ActiveQuery $q */ $q = call_user_func([$this, $method]); $q->andOnCondition($conditions); return $q->one(); }...
php
protected function oneOf($name, $conditions) { $method = 'get' . ucfirst($name); if (method_exists($this, $method)) { /** @var \yii\db\ActiveQuery $q */ $q = call_user_func([$this, $method]); $q->andOnCondition($conditions); return $q->one(); }...
[ "protected", "function", "oneOf", "(", "$", "name", ",", "$", "conditions", ")", "{", "$", "method", "=", "'get'", ".", "ucfirst", "(", "$", "name", ")", ";", "if", "(", "method_exists", "(", "$", "this", ",", "$", "method", ")", ")", "{", "/** @va...
"One of" functionality @param string $name @param array $conditions @return array|null|ActiveRecord @throws InvalidArgumentException
[ "One", "of", "functionality" ]
68765919b61d0294a80f33cf4399e5ad7510ce0d
https://github.com/pvsaintpe/yii2-boost/blob/68765919b61d0294a80f33cf4399e5ad7510ce0d/db/ActiveRecord.php#L295-L305
200,738
Hnto/nuki
src/Handlers/Http/Headers.php
Headers.set
public function set($key, $value) { header('' . $key . ': ' . $value . '', true); $this->vars[$key] = $value; }
php
public function set($key, $value) { header('' . $key . ': ' . $value . '', true); $this->vars[$key] = $value; }
[ "public", "function", "set", "(", "$", "key", ",", "$", "value", ")", "{", "header", "(", "''", ".", "$", "key", ".", "': '", ".", "$", "value", ".", "''", ",", "true", ")", ";", "$", "this", "->", "vars", "[", "$", "key", "]", "=", "$", "v...
Alias of add But if key exists, it will be replaced @param mixed $key @param mixed $value
[ "Alias", "of", "add", "But", "if", "key", "exists", "it", "will", "be", "replaced" ]
c3fb16244e8d611c335a88e3b9c9ee7d81fafc0c
https://github.com/Hnto/nuki/blob/c3fb16244e8d611c335a88e3b9c9ee7d81fafc0c/src/Handlers/Http/Headers.php#L71-L74
200,739
eureka-framework/component-http
src/Http/Bag/Session.php
Session.getEphemeral
public function getEphemeral($name) { $ephemeral = $this->get(self::EPHEMERAL); if (isset($ephemeral[$name][self::VARIABLE])) { return $ephemeral[$name][self::VARIABLE]; } else { return null; } }
php
public function getEphemeral($name) { $ephemeral = $this->get(self::EPHEMERAL); if (isset($ephemeral[$name][self::VARIABLE])) { return $ephemeral[$name][self::VARIABLE]; } else { return null; } }
[ "public", "function", "getEphemeral", "(", "$", "name", ")", "{", "$", "ephemeral", "=", "$", "this", "->", "get", "(", "self", "::", "EPHEMERAL", ")", ";", "if", "(", "isset", "(", "$", "ephemeral", "[", "$", "name", "]", "[", "self", "::", "VARIA...
Get Session ephemeral variable specified. @param string $name @return mixed Variable value.
[ "Get", "Session", "ephemeral", "variable", "specified", "." ]
698c3b73581a9703a9c932890c57e50f8774607a
https://github.com/eureka-framework/component-http/blob/698c3b73581a9703a9c932890c57e50f8774607a/src/Http/Bag/Session.php#L76-L84
200,740
eureka-framework/component-http
src/Http/Bag/Session.php
Session.hasEphemeral
public function hasEphemeral($name) { $ephemeral = $this->get(self::EPHEMERAL); return isset($ephemeral[$name]); }
php
public function hasEphemeral($name) { $ephemeral = $this->get(self::EPHEMERAL); return isset($ephemeral[$name]); }
[ "public", "function", "hasEphemeral", "(", "$", "name", ")", "{", "$", "ephemeral", "=", "$", "this", "->", "get", "(", "self", "::", "EPHEMERAL", ")", ";", "return", "isset", "(", "$", "ephemeral", "[", "$", "name", "]", ")", ";", "}" ]
Check if have specified ephemeral var in Session. @param string $name Index Session name. @return bool
[ "Check", "if", "have", "specified", "ephemeral", "var", "in", "Session", "." ]
698c3b73581a9703a9c932890c57e50f8774607a
https://github.com/eureka-framework/component-http/blob/698c3b73581a9703a9c932890c57e50f8774607a/src/Http/Bag/Session.php#L92-L97
200,741
eureka-framework/component-http
src/Http/Bag/Session.php
Session.clearEphemeral
public function clearEphemeral() { //~ Check ephemeral vars if ($this->has(self::EPHEMERAL)) { $ephemeral = $this->get(self::EPHEMERAL); foreach ($ephemeral as $name => &$var) { if (true === $var[self::ACTIVE]) { $var[self::ACTIVE] = false;...
php
public function clearEphemeral() { //~ Check ephemeral vars if ($this->has(self::EPHEMERAL)) { $ephemeral = $this->get(self::EPHEMERAL); foreach ($ephemeral as $name => &$var) { if (true === $var[self::ACTIVE]) { $var[self::ACTIVE] = false;...
[ "public", "function", "clearEphemeral", "(", ")", "{", "//~ Check ephemeral vars", "if", "(", "$", "this", "->", "has", "(", "self", "::", "EPHEMERAL", ")", ")", "{", "$", "ephemeral", "=", "$", "this", "->", "get", "(", "self", "::", "EPHEMERAL", ")", ...
Initialize Session. Remove old ephemeral var in Session. @return self
[ "Initialize", "Session", ".", "Remove", "old", "ephemeral", "var", "in", "Session", "." ]
698c3b73581a9703a9c932890c57e50f8774607a
https://github.com/eureka-framework/component-http/blob/698c3b73581a9703a9c932890c57e50f8774607a/src/Http/Bag/Session.php#L104-L124
200,742
eureka-framework/component-http
src/Http/Bag/Session.php
Session.setEphemeral
public function setEphemeral($name, $value) { $ephemeral = $this->get(self::EPHEMERAL); $ephemeral[$name][self::ACTIVE] = true; $ephemeral[$name][self::VARIABLE] = $value; $this->set(self::EPHEMERAL, $ephemeral); return $this; }
php
public function setEphemeral($name, $value) { $ephemeral = $this->get(self::EPHEMERAL); $ephemeral[$name][self::ACTIVE] = true; $ephemeral[$name][self::VARIABLE] = $value; $this->set(self::EPHEMERAL, $ephemeral); return $this; }
[ "public", "function", "setEphemeral", "(", "$", "name", ",", "$", "value", ")", "{", "$", "ephemeral", "=", "$", "this", "->", "get", "(", "self", "::", "EPHEMERAL", ")", ";", "$", "ephemeral", "[", "$", "name", "]", "[", "self", "::", "ACTIVE", "]...
Set ephemeral variable in Session. @param string $name @param mixed $value @return self
[ "Set", "ephemeral", "variable", "in", "Session", "." ]
698c3b73581a9703a9c932890c57e50f8774607a
https://github.com/eureka-framework/component-http/blob/698c3b73581a9703a9c932890c57e50f8774607a/src/Http/Bag/Session.php#L133-L141
200,743
agentmedia/phine-core
src/Core/Snippets/TreeBranches/PageBranch.php
PageBranch.CanCreateAfter
protected function CanCreateAfter() { $parent = $this->tree->ParentOf($this->page); if ($parent) { return BackendModule::Guard()->Allow(BackendAction::Create(), $parent); } return BackendModule::Guard()->GrantAddPageToSite($this->page->GetSite()) -...
php
protected function CanCreateAfter() { $parent = $this->tree->ParentOf($this->page); if ($parent) { return BackendModule::Guard()->Allow(BackendAction::Create(), $parent); } return BackendModule::Guard()->GrantAddPageToSite($this->page->GetSite()) -...
[ "protected", "function", "CanCreateAfter", "(", ")", "{", "$", "parent", "=", "$", "this", "->", "tree", "->", "ParentOf", "(", "$", "this", "->", "page", ")", ";", "if", "(", "$", "parent", ")", "{", "return", "BackendModule", "::", "Guard", "(", ")...
True if page can be appended @param Page $page The page before @return bool
[ "True", "if", "page", "can", "be", "appended" ]
38c1be8d03ebffae950d00a96da3c612aff67832
https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Snippets/TreeBranches/PageBranch.php#L114-L123
200,744
agentmedia/phine-core
src/Core/Snippets/TreeBranches/PageBranch.php
PageBranch.AreaUrl
protected function AreaUrl(Area $area) { $params = array(); $params['page'] = $this->page->GetID(); $params['area'] = $area->GetID(); return BackendRouter::ModuleUrl(new PageContentTree(), $params); }
php
protected function AreaUrl(Area $area) { $params = array(); $params['page'] = $this->page->GetID(); $params['area'] = $area->GetID(); return BackendRouter::ModuleUrl(new PageContentTree(), $params); }
[ "protected", "function", "AreaUrl", "(", "Area", "$", "area", ")", "{", "$", "params", "=", "array", "(", ")", ";", "$", "params", "[", "'page'", "]", "=", "$", "this", "->", "page", "->", "GetID", "(", ")", ";", "$", "params", "[", "'area'", "]"...
Gets the content tree url @param Area $area @return string Returns the page content tree url
[ "Gets", "the", "content", "tree", "url" ]
38c1be8d03ebffae950d00a96da3c612aff67832
https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Snippets/TreeBranches/PageBranch.php#L160-L166
200,745
ezra-obiwale/dSCore
src/Stdlib/TwBootstrap.php
TwBootstrap.parseAttributes
final public static function parseAttributes($attributes, $ignore = array()) { if (!is_array($attributes)) { return $attributes; } $return = ""; foreach ($attributes as $attr => $value) { if (in_array($attr, $ignore)) continue; $return ...
php
final public static function parseAttributes($attributes, $ignore = array()) { if (!is_array($attributes)) { return $attributes; } $return = ""; foreach ($attributes as $attr => $value) { if (in_array($attr, $ignore)) continue; $return ...
[ "final", "public", "static", "function", "parseAttributes", "(", "$", "attributes", ",", "$", "ignore", "=", "array", "(", ")", ")", "{", "if", "(", "!", "is_array", "(", "$", "attributes", ")", ")", "{", "return", "$", "attributes", ";", "}", "$", "...
Parses the attributes for use @param array $attributes @param array $ignore Array of attributes to ignore @return string
[ "Parses", "the", "attributes", "for", "use" ]
dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d
https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/Stdlib/TwBootstrap.php#L421-L433
200,746
ezra-obiwale/dSCore
src/Stdlib/TwBootstrap.php
TwBootstrap.carousel
public static function carousel(array $items, array $attributes = array()) { self::$carousels++; $id = (isset($attributes['id'])) ? $attributes['id'] : 'myCarousel' . self::$carousels; $class = (isset($attributes['class'])) ? $attributes['class'] . ' carousel slide' : 'carousel slide'; $...
php
public static function carousel(array $items, array $attributes = array()) { self::$carousels++; $id = (isset($attributes['id'])) ? $attributes['id'] : 'myCarousel' . self::$carousels; $class = (isset($attributes['class'])) ? $attributes['class'] . ' carousel slide' : 'carousel slide'; $...
[ "public", "static", "function", "carousel", "(", "array", "$", "items", ",", "array", "$", "attributes", "=", "array", "(", ")", ")", "{", "self", "::", "$", "carousels", "++", ";", "$", "id", "=", "(", "isset", "(", "$", "attributes", "[", "'id'", ...
Creates a carousel @param array $items Array of items to add to the carousel<br /><br /> Example:<br /> Array (<br /> array(<br /> 'img' => '<img src="path/to/src" />',<br /> 'caption' => '',<br /> 'active' => true|false,<br /> )<br /> )<br /> @param array $attributes Array of attributes for the carousel<br /><br /> Ex...
[ "Creates", "a", "carousel" ]
dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d
https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/Stdlib/TwBootstrap.php#L458-L534
200,747
ezra-obiwale/dSCore
src/Stdlib/TwBootstrap.php
TwBootstrap.accordion
public static function accordion(array $groups, array $attributes = array()) { self::$accordions++; $collapse = 1; ob_start(); ?> <div data-close="<?= @$attributes['close'] ?>" class="accordion <?= @$attributes['class'] ?>" id="accordion<?= self::$accordions ?>" <?= self::parseAt...
php
public static function accordion(array $groups, array $attributes = array()) { self::$accordions++; $collapse = 1; ob_start(); ?> <div data-close="<?= @$attributes['close'] ?>" class="accordion <?= @$attributes['class'] ?>" id="accordion<?= self::$accordions ?>" <?= self::parseAt...
[ "public", "static", "function", "accordion", "(", "array", "$", "groups", ",", "array", "$", "attributes", "=", "array", "(", ")", ")", "{", "self", "::", "$", "accordions", "++", ";", "$", "collapse", "=", "1", ";", "ob_start", "(", ")", ";", "?>\n ...
Creates an accordion @todo Allow closing on attribute close. Currently, TWB closes it but no longer allows opening. So, this is to be implemented in the future @param array $groups Array of groups to add to the carousel Example: Array ( array( 'heading' => 'Group Heading', 'body' => 'Group content to be shown|hidden', ...
[ "Creates", "an", "accordion" ]
dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d
https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/Stdlib/TwBootstrap.php#L553-L591
200,748
ezra-obiwale/dSCore
src/Stdlib/TwBootstrap.php
TwBootstrap.groupIntoRows
public static function groupIntoRows(array $items, $itemsPerRow, array $options = array()) { ob_start(); ?> <div class="row-fluid <?= @$options['rows']['class'] ?>" <?= self::parseAttributes(@$options['rows'], array('class')) ?>> <?php foreach ($ite...
php
public static function groupIntoRows(array $items, $itemsPerRow, array $options = array()) { ob_start(); ?> <div class="row-fluid <?= @$options['rows']['class'] ?>" <?= self::parseAttributes(@$options['rows'], array('class')) ?>> <?php foreach ($ite...
[ "public", "static", "function", "groupIntoRows", "(", "array", "$", "items", ",", "$", "itemsPerRow", ",", "array", "$", "options", "=", "array", "(", ")", ")", "{", "ob_start", "(", ")", ";", "?>\n <div class=\"row-fluid <?=", "@", "$", "options", "[...
Groups given items into rows with class "row-fluid" @param array $items Array of items to group @param integer $itemsPerRow Number of items per row. This should be any of 1,2,3,4,6,12 @param array $options Array of additional options with the following possible keys:<br /> <b>wrap (boolean)</b>: True to wrap each item ...
[ "Groups", "given", "items", "into", "rows", "with", "class", "row", "-", "fluid" ]
dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d
https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/Stdlib/TwBootstrap.php#L605-L636
200,749
ezra-obiwale/dSCore
src/Stdlib/TwBootstrap.php
TwBootstrap.progress
public static function progress($message = 'Loading. Please wait ...', $percentage = 100, $style = 'info', $striped = true, $active = true) { ob_start(); ?> <div class="progress <?= ($striped) ? 'progress-striped' : '' ?> progress-<?= $style ?> <?= ($striped) ? 'active' : '' ?>"> <di...
php
public static function progress($message = 'Loading. Please wait ...', $percentage = 100, $style = 'info', $striped = true, $active = true) { ob_start(); ?> <div class="progress <?= ($striped) ? 'progress-striped' : '' ?> progress-<?= $style ?> <?= ($striped) ? 'active' : '' ?>"> <di...
[ "public", "static", "function", "progress", "(", "$", "message", "=", "'Loading. Please wait ...'", ",", "$", "percentage", "=", "100", ",", "$", "style", "=", "'info'", ",", "$", "striped", "=", "true", ",", "$", "active", "=", "true", ")", "{", "ob_sta...
Creates a progress bar @param string $message Message to show in the bar @param int $percentage Percentage of the progress @param string $style Style of the progress (danger|info|success|warning|) @param boolean $striped Indicates whether bar should be striped @param boolean $active Indicates whether bar should be acti...
[ "Creates", "a", "progress", "bar" ]
dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d
https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/Stdlib/TwBootstrap.php#L647-L655
200,750
ezra-obiwale/dSCore
src/Stdlib/TwBootstrap.php
TwBootstrap.popover
public static function popover($content, $label, $placement = 'top', $title = null, $class = null) { ob_start(); ?> <a href="#" class="<?= $class ?>" rel="popover" data-placement="<?= $placement ?>" data-content='<?= $content ?>' <?= $title ? ' data-original-title="' . ...
php
public static function popover($content, $label, $placement = 'top', $title = null, $class = null) { ob_start(); ?> <a href="#" class="<?= $class ?>" rel="popover" data-placement="<?= $placement ?>" data-content='<?= $content ?>' <?= $title ? ' data-original-title="' . ...
[ "public", "static", "function", "popover", "(", "$", "content", ",", "$", "label", ",", "$", "placement", "=", "'top'", ",", "$", "title", "=", "null", ",", "$", "class", "=", "null", ")", "{", "ob_start", "(", ")", ";", "?>\n <a href=\"#\" class=...
Create a popover and it's link @param string $content Content of the popover @param string $label The label for the link that'll call the popover @param string $placement top|bottom|left|right @param string $title @param string $class @return string
[ "Create", "a", "popover", "and", "it", "s", "link" ]
dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d
https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/Stdlib/TwBootstrap.php#L669-L688
200,751
PenoaksDev/Milky-Framework
src/Milky/Http/Routing/Route.php
Route.controllerMiddleware
protected function controllerMiddleware() { list( $class, $method ) = explode( '@', $this->action['uses'] ); $controller = UniversalBuilder::resolve( $class ); return ( new ControllerDispatcher( $this->router ) )->getMiddleware( $controller, $method ); }
php
protected function controllerMiddleware() { list( $class, $method ) = explode( '@', $this->action['uses'] ); $controller = UniversalBuilder::resolve( $class ); return ( new ControllerDispatcher( $this->router ) )->getMiddleware( $controller, $method ); }
[ "protected", "function", "controllerMiddleware", "(", ")", "{", "list", "(", "$", "class", ",", "$", "method", ")", "=", "explode", "(", "'@'", ",", "$", "this", "->", "action", "[", "'uses'", "]", ")", ";", "$", "controller", "=", "UniversalBuilder", ...
Get the controller middleware for the route. @return array
[ "Get", "the", "controller", "middleware", "for", "the", "route", "." ]
8afd7156610a70371aa5b1df50b8a212bf7b142c
https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Http/Routing/Route.php#L248-L255
200,752
jabernardo/lollipop-php
Library/Text.php
Text.lock
static function lock($string, $key = null) { return openssl_encrypt($string, self::_getSecMethod(), Utils::spare($key, self::_geteSecKey()), false, self::_getSecIv()); }
php
static function lock($string, $key = null) { return openssl_encrypt($string, self::_getSecMethod(), Utils::spare($key, self::_geteSecKey()), false, self::_getSecIv()); }
[ "static", "function", "lock", "(", "$", "string", ",", "$", "key", "=", "null", ")", "{", "return", "openssl_encrypt", "(", "$", "string", ",", "self", "::", "_getSecMethod", "(", ")", ",", "Utils", "::", "spare", "(", "$", "key", ",", "self", "::", ...
Encrypts values passed @param string $string String to be encoded. @param string $key Passphrase @return string
[ "Encrypts", "values", "passed" ]
004d80b21f7246bb3e08c7b9f74a165b0d3ca0f5
https://github.com/jabernardo/lollipop-php/blob/004d80b21f7246bb3e08c7b9f74a165b0d3ca0f5/Library/Text.php#L74-L76
200,753
jabernardo/lollipop-php
Library/Text.php
Text.unlock
static function unlock($cipher, $key = null) { return openssl_decrypt($cipher, self::_getSecMethod(), Utils::spare($key, self::_geteSecKey()), false, self::_getSecIv()); }
php
static function unlock($cipher, $key = null) { return openssl_decrypt($cipher, self::_getSecMethod(), Utils::spare($key, self::_geteSecKey()), false, self::_getSecIv()); }
[ "static", "function", "unlock", "(", "$", "cipher", ",", "$", "key", "=", "null", ")", "{", "return", "openssl_decrypt", "(", "$", "cipher", ",", "self", "::", "_getSecMethod", "(", ")", ",", "Utils", "::", "spare", "(", "$", "key", ",", "self", "::"...
Decrypts values passed @param string $cipher Code to be decrypt. @param string $key Passphrase @return string
[ "Decrypts", "values", "passed" ]
004d80b21f7246bb3e08c7b9f74a165b0d3ca0f5
https://github.com/jabernardo/lollipop-php/blob/004d80b21f7246bb3e08c7b9f74a165b0d3ca0f5/Library/Text.php#L86-L88
200,754
jenskooij/cloudcontrol
src/cc/application/ApplicationRunner.php
ApplicationRunner.runApplicationComponents
public function runApplicationComponents($applicationComponents) { foreach ($applicationComponents as $key => $applicationComponent) { $class = $applicationComponent->component; $parameters = $applicationComponent->parameters; $applicationComponents[$key]->{'object'} = $t...
php
public function runApplicationComponents($applicationComponents) { foreach ($applicationComponents as $key => $applicationComponent) { $class = $applicationComponent->component; $parameters = $applicationComponent->parameters; $applicationComponents[$key]->{'object'} = $t...
[ "public", "function", "runApplicationComponents", "(", "$", "applicationComponents", ")", "{", "foreach", "(", "$", "applicationComponents", "as", "$", "key", "=>", "$", "applicationComponent", ")", "{", "$", "class", "=", "$", "applicationComponent", "->", "compo...
Loop through all application components and run them @param $applicationComponents
[ "Loop", "through", "all", "application", "components", "and", "run", "them" ]
76e5d9ac8f9c50d06d39a995d13cc03742536548
https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/cc/application/ApplicationRunner.php#L31-L39
200,755
rollerworks/search-core
Field/GenericResolvedFieldType.php
GenericResolvedFieldType.newField
protected function newField($name, array $options): FieldConfig { if (OrderField::isOrder($name)) { return new OrderField($name, $this, $options); } return new SearchField($name, $this, $options); }
php
protected function newField($name, array $options): FieldConfig { if (OrderField::isOrder($name)) { return new OrderField($name, $this, $options); } return new SearchField($name, $this, $options); }
[ "protected", "function", "newField", "(", "$", "name", ",", "array", "$", "options", ")", ":", "FieldConfig", "{", "if", "(", "OrderField", "::", "isOrder", "(", "$", "name", ")", ")", "{", "return", "new", "OrderField", "(", "$", "name", ",", "$", "...
Creates a new SearchField instance. Override this method if you want to customize the field class.
[ "Creates", "a", "new", "SearchField", "instance", "." ]
6b5671b8c4d6298906ded768261b0a59845140fb
https://github.com/rollerworks/search-core/blob/6b5671b8c4d6298906ded768261b0a59845140fb/Field/GenericResolvedFieldType.php#L146-L153
200,756
Finesse/QueryScribe
src/Grammars/CommonGrammar.php
CommonGrammar.compileSelectPart
protected function compileSelectPart(Query $query, array &$bindings): string { $columns = []; foreach (($query->select ?: ['*']) as $alias => $column) { if ($column instanceof Aggregate) { $column = $this->compileAggregate($column, $bindings); } else { ...
php
protected function compileSelectPart(Query $query, array &$bindings): string { $columns = []; foreach (($query->select ?: ['*']) as $alias => $column) { if ($column instanceof Aggregate) { $column = $this->compileAggregate($column, $bindings); } else { ...
[ "protected", "function", "compileSelectPart", "(", "Query", "$", "query", ",", "array", "&", "$", "bindings", ")", ":", "string", "{", "$", "columns", "=", "[", "]", ";", "foreach", "(", "(", "$", "query", "->", "select", "?", ":", "[", "'*'", "]", ...
Compiles a SELECT part of an SQL query. @param Query $query Query data @param array $bindings Bound values (array is filled by link) @return string SQL text
[ "Compiles", "a", "SELECT", "part", "of", "an", "SQL", "query", "." ]
4edba721e37693780d142229b3ecb0cd4004c7a5
https://github.com/Finesse/QueryScribe/blob/4edba721e37693780d142229b3ecb0cd4004c7a5/src/Grammars/CommonGrammar.php#L201-L216
200,757
Finesse/QueryScribe
src/Grammars/CommonGrammar.php
CommonGrammar.compileFromPart
protected function compileFromPart(Query $query, array &$bindings): string { if ($query->table === null) { throw new InvalidQueryException('The FROM table is not set'); } return 'FROM '.$this->compileIdentifierWithAlias($query->table, $query->tableAlias, $bindings); }
php
protected function compileFromPart(Query $query, array &$bindings): string { if ($query->table === null) { throw new InvalidQueryException('The FROM table is not set'); } return 'FROM '.$this->compileIdentifierWithAlias($query->table, $query->tableAlias, $bindings); }
[ "protected", "function", "compileFromPart", "(", "Query", "$", "query", ",", "array", "&", "$", "bindings", ")", ":", "string", "{", "if", "(", "$", "query", "->", "table", "===", "null", ")", "{", "throw", "new", "InvalidQueryException", "(", "'The FROM t...
Compiles a FROM part of an SQL query. @param Query $query Query data @param array $bindings Bound values (array is filled by link) @return string SQL text @throws InvalidQueryException
[ "Compiles", "a", "FROM", "part", "of", "an", "SQL", "query", "." ]
4edba721e37693780d142229b3ecb0cd4004c7a5
https://github.com/Finesse/QueryScribe/blob/4edba721e37693780d142229b3ecb0cd4004c7a5/src/Grammars/CommonGrammar.php#L226-L233
200,758
Finesse/QueryScribe
src/Grammars/CommonGrammar.php
CommonGrammar.compileJoinPart
protected function compileJoinPart(Query $query, array &$bindings): string { $joinsSQL = []; foreach ($query->join as $join) { $joinsSQL[] = $this->compileOneJoin($join, $bindings); } return $this->implodeSQL($joinsSQL); }
php
protected function compileJoinPart(Query $query, array &$bindings): string { $joinsSQL = []; foreach ($query->join as $join) { $joinsSQL[] = $this->compileOneJoin($join, $bindings); } return $this->implodeSQL($joinsSQL); }
[ "protected", "function", "compileJoinPart", "(", "Query", "$", "query", ",", "array", "&", "$", "bindings", ")", ":", "string", "{", "$", "joinsSQL", "=", "[", "]", ";", "foreach", "(", "$", "query", "->", "join", "as", "$", "join", ")", "{", "$", ...
Compiles a JOIN parts of an SQL query. @param Query $query Query data @param array $bindings Bound values (array is filled by link) @return string SQL text @throws InvalidQueryException
[ "Compiles", "a", "JOIN", "parts", "of", "an", "SQL", "query", "." ]
4edba721e37693780d142229b3ecb0cd4004c7a5
https://github.com/Finesse/QueryScribe/blob/4edba721e37693780d142229b3ecb0cd4004c7a5/src/Grammars/CommonGrammar.php#L243-L252
200,759
Finesse/QueryScribe
src/Grammars/CommonGrammar.php
CommonGrammar.compileWherePart
protected function compileWherePart(Query $query, array &$bindings): string { $sql = $this->compileCriteria($query->where, $bindings); if ($sql !== '') { $sql = 'WHERE '.$sql; } return $sql; }
php
protected function compileWherePart(Query $query, array &$bindings): string { $sql = $this->compileCriteria($query->where, $bindings); if ($sql !== '') { $sql = 'WHERE '.$sql; } return $sql; }
[ "protected", "function", "compileWherePart", "(", "Query", "$", "query", ",", "array", "&", "$", "bindings", ")", ":", "string", "{", "$", "sql", "=", "$", "this", "->", "compileCriteria", "(", "$", "query", "->", "where", ",", "$", "bindings", ")", ";...
Compiles a WHERE part of an SQL query. @param Query $query Query data @param array $bindings Bound values (array is filled by link) @return string SQL text @throws InvalidQueryException
[ "Compiles", "a", "WHERE", "part", "of", "an", "SQL", "query", "." ]
4edba721e37693780d142229b3ecb0cd4004c7a5
https://github.com/Finesse/QueryScribe/blob/4edba721e37693780d142229b3ecb0cd4004c7a5/src/Grammars/CommonGrammar.php#L289-L297
200,760
Finesse/QueryScribe
src/Grammars/CommonGrammar.php
CommonGrammar.compileOrderPart
protected function compileOrderPart(Query $query, array &$bindings): string { $ordersSQL = []; foreach ($query->order as $order) { $orderSQL = $this->compileOneOrder($order, $bindings); if ($orderSQL !== '') { $ordersSQL[] = $orderSQL; } ...
php
protected function compileOrderPart(Query $query, array &$bindings): string { $ordersSQL = []; foreach ($query->order as $order) { $orderSQL = $this->compileOneOrder($order, $bindings); if ($orderSQL !== '') { $ordersSQL[] = $orderSQL; } ...
[ "protected", "function", "compileOrderPart", "(", "Query", "$", "query", ",", "array", "&", "$", "bindings", ")", ":", "string", "{", "$", "ordersSQL", "=", "[", "]", ";", "foreach", "(", "$", "query", "->", "order", "as", "$", "order", ")", "{", "$"...
Compiles a ORDER part of an SQL query. @param Query $query Query data @param array $bindings Bound values (array is filled by link) @return string SQL text @throws InvalidQueryException
[ "Compiles", "a", "ORDER", "part", "of", "an", "SQL", "query", "." ]
4edba721e37693780d142229b3ecb0cd4004c7a5
https://github.com/Finesse/QueryScribe/blob/4edba721e37693780d142229b3ecb0cd4004c7a5/src/Grammars/CommonGrammar.php#L307-L320
200,761
Finesse/QueryScribe
src/Grammars/CommonGrammar.php
CommonGrammar.compileUpdateValues
protected function compileUpdateValues(array $values, array &$bindings): string { $parts = []; foreach ($values as $column => $value) { $parts[] = $this->quoteCompositeIdentifier($column).' = '.$this->compileValue($value, $bindings); } return implode(', ', $parts); ...
php
protected function compileUpdateValues(array $values, array &$bindings): string { $parts = []; foreach ($values as $column => $value) { $parts[] = $this->quoteCompositeIdentifier($column).' = '.$this->compileValue($value, $bindings); } return implode(', ', $parts); ...
[ "protected", "function", "compileUpdateValues", "(", "array", "$", "values", ",", "array", "&", "$", "bindings", ")", ":", "string", "{", "$", "parts", "=", "[", "]", ";", "foreach", "(", "$", "values", "as", "$", "column", "=>", "$", "value", ")", "...
Compiles a values list for the SET part of a update SQL query. @param Query mixed[]|Query[]|StatementInterface[] Values. The indexes are the columns names, the values are the values. @param array $bindings Bound values (array is filled by link) @return string SQL text @throws InvalidQueryException
[ "Compiles", "a", "values", "list", "for", "the", "SET", "part", "of", "a", "update", "SQL", "query", "." ]
4edba721e37693780d142229b3ecb0cd4004c7a5
https://github.com/Finesse/QueryScribe/blob/4edba721e37693780d142229b3ecb0cd4004c7a5/src/Grammars/CommonGrammar.php#L331-L340
200,762
Finesse/QueryScribe
src/Grammars/CommonGrammar.php
CommonGrammar.compileValue
protected function compileValue($value, array &$bindings): string { if ($value instanceof Query || $value instanceof StatementInterface) { return $this->compileSubQuery($value, $bindings); } $this->mergeBindings($bindings, [$value]); return '?'; }
php
protected function compileValue($value, array &$bindings): string { if ($value instanceof Query || $value instanceof StatementInterface) { return $this->compileSubQuery($value, $bindings); } $this->mergeBindings($bindings, [$value]); return '?'; }
[ "protected", "function", "compileValue", "(", "$", "value", ",", "array", "&", "$", "bindings", ")", ":", "string", "{", "if", "(", "$", "value", "instanceof", "Query", "||", "$", "value", "instanceof", "StatementInterface", ")", "{", "return", "$", "this"...
Converts a value to a part of an SQL query text. Actually it sends all the values to the bindings. @param mixed|Query|StatementInterface $value Value (a scalar value or a subquery) @param array $bindings Bound values (array is filled by link) @return string SQL text
[ "Converts", "a", "value", "to", "a", "part", "of", "an", "SQL", "query", "text", ".", "Actually", "it", "sends", "all", "the", "values", "to", "the", "bindings", "." ]
4edba721e37693780d142229b3ecb0cd4004c7a5
https://github.com/Finesse/QueryScribe/blob/4edba721e37693780d142229b3ecb0cd4004c7a5/src/Grammars/CommonGrammar.php#L365-L373
200,763
Finesse/QueryScribe
src/Grammars/CommonGrammar.php
CommonGrammar.compileSubQuery
protected function compileSubQuery($subQuery, array &$bindings, bool $parenthesise = true): string { if ($subQuery instanceof Query) { try { $subQuery = $this->compile($subQuery); } catch (InvalidQueryException $exception) { throw new InvalidQueryExcep...
php
protected function compileSubQuery($subQuery, array &$bindings, bool $parenthesise = true): string { if ($subQuery instanceof Query) { try { $subQuery = $this->compile($subQuery); } catch (InvalidQueryException $exception) { throw new InvalidQueryExcep...
[ "protected", "function", "compileSubQuery", "(", "$", "subQuery", ",", "array", "&", "$", "bindings", ",", "bool", "$", "parenthesise", "=", "true", ")", ":", "string", "{", "if", "(", "$", "subQuery", "instanceof", "Query", ")", "{", "try", "{", "$", ...
Converts a subquery to an SQL query text. @param Query|StatementInterface $subQuery Subquery @param array $bindings Bound values (array is filled by link) @param bool $parenthesise Wrap the subquery in parentheses? @return string SQL text wrapped in parentheses
[ "Converts", "a", "subquery", "to", "an", "SQL", "query", "text", "." ]
4edba721e37693780d142229b3ecb0cd4004c7a5
https://github.com/Finesse/QueryScribe/blob/4edba721e37693780d142229b3ecb0cd4004c7a5/src/Grammars/CommonGrammar.php#L383-L401
200,764
Finesse/QueryScribe
src/Grammars/CommonGrammar.php
CommonGrammar.compileAggregate
protected function compileAggregate(Aggregate $aggregate, array &$bindings): string { return $aggregate->function.'('.$this->compileIdentifier($aggregate->column, $bindings).')'; }
php
protected function compileAggregate(Aggregate $aggregate, array &$bindings): string { return $aggregate->function.'('.$this->compileIdentifier($aggregate->column, $bindings).')'; }
[ "protected", "function", "compileAggregate", "(", "Aggregate", "$", "aggregate", ",", "array", "&", "$", "bindings", ")", ":", "string", "{", "return", "$", "aggregate", "->", "function", ".", "'('", ".", "$", "this", "->", "compileIdentifier", "(", "$", "...
Converts an Aggregate object to an SQL query text. @param Aggregate $aggregate Aggregate @param array $bindings Bound values (array is filled by link) @return string SQL text
[ "Converts", "an", "Aggregate", "object", "to", "an", "SQL", "query", "text", "." ]
4edba721e37693780d142229b3ecb0cd4004c7a5
https://github.com/Finesse/QueryScribe/blob/4edba721e37693780d142229b3ecb0cd4004c7a5/src/Grammars/CommonGrammar.php#L410-L413
200,765
Finesse/QueryScribe
src/Grammars/CommonGrammar.php
CommonGrammar.compileOneJoin
protected function compileOneJoin(Join $join, array &$bindings): string { $sql = $join->type.' JOIN '.$this->compileIdentifierWithAlias($join->table, $join->tableAlias, $bindings); if ($join->criteria) { $sql .= ' ON '.$this->compileCriteria($join->criteria, $bindings); } ...
php
protected function compileOneJoin(Join $join, array &$bindings): string { $sql = $join->type.' JOIN '.$this->compileIdentifierWithAlias($join->table, $join->tableAlias, $bindings); if ($join->criteria) { $sql .= ' ON '.$this->compileCriteria($join->criteria, $bindings); } ...
[ "protected", "function", "compileOneJoin", "(", "Join", "$", "join", ",", "array", "&", "$", "bindings", ")", ":", "string", "{", "$", "sql", "=", "$", "join", "->", "type", ".", "' JOIN '", ".", "$", "this", "->", "compileIdentifierWithAlias", "(", "$",...
Converts a Join object ot an SQL query text. @param Join $join Join @param array $bindings Bound values (array is filled by link) @return string SQL text
[ "Converts", "a", "Join", "object", "ot", "an", "SQL", "query", "text", "." ]
4edba721e37693780d142229b3ecb0cd4004c7a5
https://github.com/Finesse/QueryScribe/blob/4edba721e37693780d142229b3ecb0cd4004c7a5/src/Grammars/CommonGrammar.php#L422-L431
200,766
Finesse/QueryScribe
src/Grammars/CommonGrammar.php
CommonGrammar.compileOneOrder
protected function compileOneOrder($order, array &$bindings): string { if ($order instanceof Order) { return $this->compileIdentifier($order->column, $bindings).' '.($order->isDescending ? 'DESC' : 'ASC'); } if ($order instanceof OrderByIsNull) { return $this->compil...
php
protected function compileOneOrder($order, array &$bindings): string { if ($order instanceof Order) { return $this->compileIdentifier($order->column, $bindings).' '.($order->isDescending ? 'DESC' : 'ASC'); } if ($order instanceof OrderByIsNull) { return $this->compil...
[ "protected", "function", "compileOneOrder", "(", "$", "order", ",", "array", "&", "$", "bindings", ")", ":", "string", "{", "if", "(", "$", "order", "instanceof", "Order", ")", "{", "return", "$", "this", "->", "compileIdentifier", "(", "$", "order", "->...
Converts a single order to an SQL query text. @param Order|OrderByIsNull|ExplicitOrder|string $order Order. String `random` means that the order should be random. @param array $bindings Bound values (array is filled by link) @return string SQL text or an empty string @throws InvalidQueryException
[ "Converts", "a", "single", "order", "to", "an", "SQL", "query", "text", "." ]
4edba721e37693780d142229b3ecb0cd4004c7a5
https://github.com/Finesse/QueryScribe/blob/4edba721e37693780d142229b3ecb0cd4004c7a5/src/Grammars/CommonGrammar.php#L600-L633
200,767
Finesse/QueryScribe
src/Grammars/CommonGrammar.php
CommonGrammar.compileInsertFromValues
protected function compileInsertFromValues($table, string $tableAlias = null, array $values): array { if (empty($values)) { return []; } $bindings = []; // Step 1. Fetch unique columns list. $columns = []; foreach ($values as $row) { foreach ...
php
protected function compileInsertFromValues($table, string $tableAlias = null, array $values): array { if (empty($values)) { return []; } $bindings = []; // Step 1. Fetch unique columns list. $columns = []; foreach ($values as $row) { foreach ...
[ "protected", "function", "compileInsertFromValues", "(", "$", "table", ",", "string", "$", "tableAlias", "=", "null", ",", "array", "$", "values", ")", ":", "array", "{", "if", "(", "empty", "(", "$", "values", ")", ")", "{", "return", "[", "]", ";", ...
Compiles set of full INSERT queries from an array of values. @param string|Query|StatementInterface $table Target table name @param string|null $tableAlias Table alias @param mixed[][]|Query[][]|StatementInterface[][] $values Array of rows of values @return StatementInterface[] @throws InvalidQueryException
[ "Compiles", "set", "of", "full", "INSERT", "queries", "from", "an", "array", "of", "values", "." ]
4edba721e37693780d142229b3ecb0cd4004c7a5
https://github.com/Finesse/QueryScribe/blob/4edba721e37693780d142229b3ecb0cd4004c7a5/src/Grammars/CommonGrammar.php#L670-L708
200,768
Finesse/QueryScribe
src/Grammars/CommonGrammar.php
CommonGrammar.compileInsertFromSelect
protected function compileInsertFromSelect( $table, string $tableAlias = null, array $columns = null, $selectQuery ): StatementInterface { $bindings = []; $sqlLine1 = 'INSERT INTO '.$this->compileIdentifierWithAlias($table, $tableAlias, $bindings); if ($colum...
php
protected function compileInsertFromSelect( $table, string $tableAlias = null, array $columns = null, $selectQuery ): StatementInterface { $bindings = []; $sqlLine1 = 'INSERT INTO '.$this->compileIdentifierWithAlias($table, $tableAlias, $bindings); if ($colum...
[ "protected", "function", "compileInsertFromSelect", "(", "$", "table", ",", "string", "$", "tableAlias", "=", "null", ",", "array", "$", "columns", "=", "null", ",", "$", "selectQuery", ")", ":", "StatementInterface", "{", "$", "bindings", "=", "[", "]", "...
Compiles a full INSERT query from a select query. @param string|Query|StatementInterface $table Target table name @param string|null $tableAlias Table alias @param string[]|null $columns Columns of a target table. If null, the list of columns is omitted. @param Query|StatementInterface $selectQuery The select query @r...
[ "Compiles", "a", "full", "INSERT", "query", "from", "a", "select", "query", "." ]
4edba721e37693780d142229b3ecb0cd4004c7a5
https://github.com/Finesse/QueryScribe/blob/4edba721e37693780d142229b3ecb0cd4004c7a5/src/Grammars/CommonGrammar.php#L720-L736
200,769
Finesse/QueryScribe
src/Grammars/CommonGrammar.php
CommonGrammar.mergeBindings
protected function mergeBindings(array &$target, array $source) { $targetBindingsAmount = count($target); $sourceBindingsIndex = 0; foreach ($source as $name => $value) { $key = is_int($name) ? $targetBindingsAmount + $sourceBindingsIndex : $name; $target[$key] = $va...
php
protected function mergeBindings(array &$target, array $source) { $targetBindingsAmount = count($target); $sourceBindingsIndex = 0; foreach ($source as $name => $value) { $key = is_int($name) ? $targetBindingsAmount + $sourceBindingsIndex : $name; $target[$key] = $va...
[ "protected", "function", "mergeBindings", "(", "array", "&", "$", "target", ",", "array", "$", "source", ")", "{", "$", "targetBindingsAmount", "=", "count", "(", "$", "target", ")", ";", "$", "sourceBindingsIndex", "=", "0", ";", "foreach", "(", "$", "s...
Merges two arrays of bound values. @param array $target Where to add values. The values are added by link. @param array $source Values to add
[ "Merges", "two", "arrays", "of", "bound", "values", "." ]
4edba721e37693780d142229b3ecb0cd4004c7a5
https://github.com/Finesse/QueryScribe/blob/4edba721e37693780d142229b3ecb0cd4004c7a5/src/Grammars/CommonGrammar.php#L744-L754
200,770
Finesse/QueryScribe
src/Grammars/CommonGrammar.php
CommonGrammar.implodeSQL
protected function implodeSQL(array $parts): string { $result = ''; foreach ($parts as $part) { if ($part === '') { continue; } $result .= ($result === '' ? '' : "\n").$part; } return $result; }
php
protected function implodeSQL(array $parts): string { $result = ''; foreach ($parts as $part) { if ($part === '') { continue; } $result .= ($result === '' ? '' : "\n").$part; } return $result; }
[ "protected", "function", "implodeSQL", "(", "array", "$", "parts", ")", ":", "string", "{", "$", "result", "=", "''", ";", "foreach", "(", "$", "parts", "as", "$", "part", ")", "{", "if", "(", "$", "part", "===", "''", ")", "{", "continue", ";", ...
Implodes parts of SQL query to a single string. @param string[] $parts @return string
[ "Implodes", "parts", "of", "SQL", "query", "to", "a", "single", "string", "." ]
4edba721e37693780d142229b3ecb0cd4004c7a5
https://github.com/Finesse/QueryScribe/blob/4edba721e37693780d142229b3ecb0cd4004c7a5/src/Grammars/CommonGrammar.php#L762-L774
200,771
ScaraMVC/Framework
src/Scara/Routing/Router.php
Router.registerRoutes
public function registerRoutes() { $this->_route = new Route(); $this->_config = Config::from('app'); $router = $this; // MUST KEEP!!!!!!!!! require_once $this->_config->from('app')->get('routes'); }
php
public function registerRoutes() { $this->_route = new Route(); $this->_config = Config::from('app'); $router = $this; // MUST KEEP!!!!!!!!! require_once $this->_config->from('app')->get('routes'); }
[ "public", "function", "registerRoutes", "(", ")", "{", "$", "this", "->", "_route", "=", "new", "Route", "(", ")", ";", "$", "this", "->", "_config", "=", "Config", "::", "from", "(", "'app'", ")", ";", "$", "router", "=", "$", "this", ";", "// MUS...
Handles registering defined routes. @return void
[ "Handles", "registering", "defined", "routes", "." ]
199b08b45fadf5dae14ac4732af03b36e15bbef2
https://github.com/ScaraMVC/Framework/blob/199b08b45fadf5dae14ac4732af03b36e15bbef2/src/Scara/Routing/Router.php#L33-L41
200,772
ScaraMVC/Framework
src/Scara/Routing/Router.php
Router.getRoute
public function getRoute($url) { $routes = $this->_route->getRoutes(); $return = ''; foreach ($routes as $route) { $routeURI = $this->_config->from('app')->get('basepath').$route['uri']; // POST requests if (isset($_POST)) { foreach ($_POS...
php
public function getRoute($url) { $routes = $this->_route->getRoutes(); $return = ''; foreach ($routes as $route) { $routeURI = $this->_config->from('app')->get('basepath').$route['uri']; // POST requests if (isset($_POST)) { foreach ($_POS...
[ "public", "function", "getRoute", "(", "$", "url", ")", "{", "$", "routes", "=", "$", "this", "->", "_route", "->", "getRoutes", "(", ")", ";", "$", "return", "=", "''", ";", "foreach", "(", "$", "routes", "as", "$", "route", ")", "{", "$", "rout...
Gets the route from supplied URL. @param string $url - The route's URL @return array
[ "Gets", "the", "route", "from", "supplied", "URL", "." ]
199b08b45fadf5dae14ac4732af03b36e15bbef2
https://github.com/ScaraMVC/Framework/blob/199b08b45fadf5dae14ac4732af03b36e15bbef2/src/Scara/Routing/Router.php#L76-L129
200,773
Kris-Kuiper/sFire-Framework
src/Utils/Number.php
Number.round
public function round($decimals = 2) { if(false === ('-' . intval($decimals) == '-' . $decimals)) { return trigger_error(sprintf('Argument 1 passed to %s() must be of the type integer, "%s" given', __METHOD__, gettype($decimals)), E_USER_ERROR); } return $this -> convert(function($number, $decimals) { ...
php
public function round($decimals = 2) { if(false === ('-' . intval($decimals) == '-' . $decimals)) { return trigger_error(sprintf('Argument 1 passed to %s() must be of the type integer, "%s" given', __METHOD__, gettype($decimals)), E_USER_ERROR); } return $this -> convert(function($number, $decimals) { ...
[ "public", "function", "round", "(", "$", "decimals", "=", "2", ")", "{", "if", "(", "false", "===", "(", "'-'", ".", "intval", "(", "$", "decimals", ")", "==", "'-'", ".", "$", "decimals", ")", ")", "{", "return", "trigger_error", "(", "sprintf", "...
Round all the numbers with a precision @param int $decimals @return sFire\Number\Number
[ "Round", "all", "the", "numbers", "with", "a", "precision" ]
deefe1d9d2b40e7326381e8dcd4f01f9aa61885c
https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Utils/Number.php#L94-L103
200,774
Kris-Kuiper/sFire-Framework
src/Utils/Number.php
Number.toFixed
public function toFixed($decimals = 2) { if(false === ('-' . intval($decimals) == '-' . $decimals)) { return trigger_error(sprintf('Argument 1 passed to %s() must be of the type integer, "%s" given', __METHOD__, gettype($decimals)), E_USER_ERROR); } return $this -> convert(function($number, $decimals) ...
php
public function toFixed($decimals = 2) { if(false === ('-' . intval($decimals) == '-' . $decimals)) { return trigger_error(sprintf('Argument 1 passed to %s() must be of the type integer, "%s" given', __METHOD__, gettype($decimals)), E_USER_ERROR); } return $this -> convert(function($number, $decimals) ...
[ "public", "function", "toFixed", "(", "$", "decimals", "=", "2", ")", "{", "if", "(", "false", "===", "(", "'-'", ".", "intval", "(", "$", "decimals", ")", "==", "'-'", ".", "$", "decimals", ")", ")", "{", "return", "trigger_error", "(", "sprintf", ...
Converts number into a string, keeping a specified number of decimal @param int $decimals @return sFire\Number\Number
[ "Converts", "number", "into", "a", "string", "keeping", "a", "specified", "number", "of", "decimal" ]
deefe1d9d2b40e7326381e8dcd4f01f9aa61885c
https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Utils/Number.php#L111-L132
200,775
Kris-Kuiper/sFire-Framework
src/Utils/Number.php
Number.val
public function val($index = 0) { if(false === ('-' . intval($index) == '-' . $index)) { return trigger_error(sprintf('Argument 1 passed to %s() must be of the type integer, "%s" given', __METHOD__, gettype($index)), E_USER_ERROR); } $val = $this -> strip(); if(true === isset($val[$index])) { ...
php
public function val($index = 0) { if(false === ('-' . intval($index) == '-' . $index)) { return trigger_error(sprintf('Argument 1 passed to %s() must be of the type integer, "%s" given', __METHOD__, gettype($index)), E_USER_ERROR); } $val = $this -> strip(); if(true === isset($val[$index])) { ...
[ "public", "function", "val", "(", "$", "index", "=", "0", ")", "{", "if", "(", "false", "===", "(", "'-'", ".", "intval", "(", "$", "index", ")", "==", "'-'", ".", "$", "index", ")", ")", "{", "return", "trigger_error", "(", "sprintf", "(", "'Arg...
Strips all the numbers from a string and returns the value with an optional index to retrieve @return mixed
[ "Strips", "all", "the", "numbers", "from", "a", "string", "and", "returns", "the", "value", "with", "an", "optional", "index", "to", "retrieve" ]
deefe1d9d2b40e7326381e8dcd4f01f9aa61885c
https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Utils/Number.php#L153-L166
200,776
Kris-Kuiper/sFire-Framework
src/Utils/Number.php
Number.format
public function format($decimals = 2, $point = '.', $thousands_sep = ',', $currency = null) { if(false === ('-' . intval($decimals) == '-' . $decimals)) { return trigger_error(sprintf('Argument 1 passed to %s() must be of the type integer, "%s" given', __METHOD__, gettype($decimals)), E_USER_ERROR); } ...
php
public function format($decimals = 2, $point = '.', $thousands_sep = ',', $currency = null) { if(false === ('-' . intval($decimals) == '-' . $decimals)) { return trigger_error(sprintf('Argument 1 passed to %s() must be of the type integer, "%s" given', __METHOD__, gettype($decimals)), E_USER_ERROR); } ...
[ "public", "function", "format", "(", "$", "decimals", "=", "2", ",", "$", "point", "=", "'.'", ",", "$", "thousands_sep", "=", "','", ",", "$", "currency", "=", "null", ")", "{", "if", "(", "false", "===", "(", "'-'", ".", "intval", "(", "$", "de...
Converts all the numbers in a string to a specific format @param int $decimals @param string $point @param string $thousands_sep @param string $currency @return sFire\Number\Number
[ "Converts", "all", "the", "numbers", "in", "a", "string", "to", "a", "specific", "format" ]
deefe1d9d2b40e7326381e8dcd4f01f9aa61885c
https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Utils/Number.php#L177-L198
200,777
Kris-Kuiper/sFire-Framework
src/Utils/Number.php
Number.convert
private function convert($callback, $variables = []) { $this -> number = preg_replace_callback('~[0-9\.,]+~', function($number) use ($callback, $variables) { return call_user_func_array($callback, array_merge([(float) str_replace(',', '', $number[0])], $variables)); }, $this -> number); return $this; ...
php
private function convert($callback, $variables = []) { $this -> number = preg_replace_callback('~[0-9\.,]+~', function($number) use ($callback, $variables) { return call_user_func_array($callback, array_merge([(float) str_replace(',', '', $number[0])], $variables)); }, $this -> number); return $this; ...
[ "private", "function", "convert", "(", "$", "callback", ",", "$", "variables", "=", "[", "]", ")", "{", "$", "this", "->", "number", "=", "preg_replace_callback", "(", "'~[0-9\\.,]+~'", ",", "function", "(", "$", "number", ")", "use", "(", "$", "callback...
Executes a callable function and returns this instance @param object $callback @param array $variables @return sFire\Number\Number
[ "Executes", "a", "callable", "function", "and", "returns", "this", "instance" ]
deefe1d9d2b40e7326381e8dcd4f01f9aa61885c
https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Utils/Number.php#L207-L214
200,778
SlaxWeb/Output
src/Handler/View.php
View.addData
public function addData(array $data, string $type = "all"): self { $this->viewData[$type] = array_merge($this->viewData[$type] ?? [], $data); return $this; }
php
public function addData(array $data, string $type = "all"): self { $this->viewData[$type] = array_merge($this->viewData[$type] ?? [], $data); return $this; }
[ "public", "function", "addData", "(", "array", "$", "data", ",", "string", "$", "type", "=", "\"all\"", ")", ":", "self", "{", "$", "this", "->", "viewData", "[", "$", "type", "]", "=", "array_merge", "(", "$", "this", "->", "viewData", "[", "$", "...
Add view data Adds an array of data to the internal view data container. The second parameter, $type, defines if the data received will be used for a specific View, or all views. The $type needs to be set to the full class name of a view in order to be recognized as view data for that specific view. If the second para...
[ "Add", "view", "data" ]
5bee3258f2fe63e161d3e8abe85118bfbf02ab48
https://github.com/SlaxWeb/Output/blob/5bee3258f2fe63e161d3e8abe85118bfbf02ab48/src/Handler/View.php#L75-L79
200,779
Kris-Kuiper/sFire-Framework
src/MVC/MVC.php
MVC.loadController
public function loadController($module, $controller) { if(false === is_string($module)) { return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($module)), E_USER_ERROR); } if(false === is_string($controller)) { return trigger_error(spri...
php
public function loadController($module, $controller) { if(false === is_string($module)) { return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($module)), E_USER_ERROR); } if(false === is_string($controller)) { return trigger_error(spri...
[ "public", "function", "loadController", "(", "$", "module", ",", "$", "controller", ")", "{", "if", "(", "false", "===", "is_string", "(", "$", "module", ")", ")", "{", "return", "trigger_error", "(", "sprintf", "(", "'Argument 1 passed to %s() must be of the ty...
Loads controller by module name and controller name @param string $module @param string $controller @return string
[ "Loads", "controller", "by", "module", "name", "and", "controller", "name" ]
deefe1d9d2b40e7326381e8dcd4f01f9aa61885c
https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/MVC/MVC.php#L72-L102
200,780
Kris-Kuiper/sFire-Framework
src/MVC/MVC.php
MVC.executeController
private function executeController($controller, Route $method, $matches) { if(false === is_object($controller)) { return trigger_error(sprintf('Argument 1 passed to %s() must be of the type object, "%s" given', __METHOD__, gettype($controller)), E_USER_ERROR); } if(false === is_array($matches)) { r...
php
private function executeController($controller, Route $method, $matches) { if(false === is_object($controller)) { return trigger_error(sprintf('Argument 1 passed to %s() must be of the type object, "%s" given', __METHOD__, gettype($controller)), E_USER_ERROR); } if(false === is_array($matches)) { r...
[ "private", "function", "executeController", "(", "$", "controller", ",", "Route", "$", "method", ",", "$", "matches", ")", "{", "if", "(", "false", "===", "is_object", "(", "$", "controller", ")", ")", "{", "return", "trigger_error", "(", "sprintf", "(", ...
Executes default controller functions @param object $controller @param sFire\Routing\Extend\Route $method @param array $matches
[ "Executes", "default", "controller", "functions" ]
deefe1d9d2b40e7326381e8dcd4f01f9aa61885c
https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/MVC/MVC.php#L111-L143
200,781
Kris-Kuiper/sFire-Framework
src/MVC/MVC.php
MVC.loadBoot
private function loadBoot($module) { if(false === is_string($module)) { return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($module)), E_USER_ERROR); } $boot = Path :: get('modules') . $module . DIRECTORY_SEPARATOR . Files :: get('boot'...
php
private function loadBoot($module) { if(false === is_string($module)) { return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($module)), E_USER_ERROR); } $boot = Path :: get('modules') . $module . DIRECTORY_SEPARATOR . Files :: get('boot'...
[ "private", "function", "loadBoot", "(", "$", "module", ")", "{", "if", "(", "false", "===", "is_string", "(", "$", "module", ")", ")", "{", "return", "trigger_error", "(", "sprintf", "(", "'Argument 1 passed to %s() must be of the type string, \"%s\" given'", ",", ...
Load the module boot file if exists and readable @param string $module
[ "Load", "the", "module", "boot", "file", "if", "exists", "and", "readable" ]
deefe1d9d2b40e7326381e8dcd4f01f9aa61885c
https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/MVC/MVC.php#L151-L162
200,782
cubicmushroom/valueobjects
src/Web/Domain.php
Domain.specifyType
public static function specifyType($domain) { if (false !== filter_var($domain, FILTER_VALIDATE_IP)) { return new IPAddress($domain); } return new Hostname($domain); }
php
public static function specifyType($domain) { if (false !== filter_var($domain, FILTER_VALIDATE_IP)) { return new IPAddress($domain); } return new Hostname($domain); }
[ "public", "static", "function", "specifyType", "(", "$", "domain", ")", "{", "if", "(", "false", "!==", "filter_var", "(", "$", "domain", ",", "FILTER_VALIDATE_IP", ")", ")", "{", "return", "new", "IPAddress", "(", "$", "domain", ")", ";", "}", "return",...
Returns a Hostname or a IPAddress object depending on passed value @param $domain @return Hostname|IPAddress
[ "Returns", "a", "Hostname", "or", "a", "IPAddress", "object", "depending", "on", "passed", "value" ]
4554239ab75d65eeb9773219aa5b07e9fbfabb92
https://github.com/cubicmushroom/valueobjects/blob/4554239ab75d65eeb9773219aa5b07e9fbfabb92/src/Web/Domain.php#L15-L22
200,783
KDF5000/EasyThink
src/ThinkPHP/Library/Vendor/SmartTemplate/class.smarttemplate.php
SmartTemplate.result
function result ( $_top = '' ) { ob_start(); $this->output( $_top ); $result = ob_get_contents(); ob_end_clean(); return $result; }
php
function result ( $_top = '' ) { ob_start(); $this->output( $_top ); $result = ob_get_contents(); ob_end_clean(); return $result; }
[ "function", "result", "(", "$", "_top", "=", "''", ")", "{", "ob_start", "(", ")", ";", "$", "this", "->", "output", "(", "$", "_top", ")", ";", "$", "result", "=", "ob_get_contents", "(", ")", ";", "ob_end_clean", "(", ")", ";", "return", "$", "...
Parser Wrapper Returns Template Output as a String @access public @param array $_top Content Array @return string Parsed Template @desc Output Buffer Parser Wrapper
[ "Parser", "Wrapper", "Returns", "Template", "Output", "as", "a", "String" ]
86efc9c8a0d504e01e2fea55868227fdc8928841
https://github.com/KDF5000/EasyThink/blob/86efc9c8a0d504e01e2fea55868227fdc8928841/src/ThinkPHP/Library/Vendor/SmartTemplate/class.smarttemplate.php#L215-L222
200,784
KDF5000/EasyThink
src/ThinkPHP/Library/Vendor/SmartTemplate/class.smarttemplate.php
SmartTemplate.output
function output ( $_top = '' ) { global $_top; // Make sure that folder names have a trailing '/' if (strlen($this->template_dir) && substr($this->template_dir, -1) != '/') { $this->template_dir .= '/'; } if (strlen($this->temp_dir) && substr($this->temp_dir, -1) != '/') { $this->t...
php
function output ( $_top = '' ) { global $_top; // Make sure that folder names have a trailing '/' if (strlen($this->template_dir) && substr($this->template_dir, -1) != '/') { $this->template_dir .= '/'; } if (strlen($this->temp_dir) && substr($this->temp_dir, -1) != '/') { $this->t...
[ "function", "output", "(", "$", "_top", "=", "''", ")", "{", "global", "$", "_top", ";", "//\tMake sure that folder names have a trailing '/'", "if", "(", "strlen", "(", "$", "this", "->", "template_dir", ")", "&&", "substr", "(", "$", "this", "->", "templat...
Execute parsed Template Prints Parsing Results to Standard Output @access public @param array $_top Content Array @desc Execute parsed Template
[ "Execute", "parsed", "Template", "Prints", "Parsing", "Results", "to", "Standard", "Output" ]
86efc9c8a0d504e01e2fea55868227fdc8928841
https://github.com/KDF5000/EasyThink/blob/86efc9c8a0d504e01e2fea55868227fdc8928841/src/ThinkPHP/Library/Vendor/SmartTemplate/class.smarttemplate.php#L233-L299
200,785
KDF5000/EasyThink
src/ThinkPHP/Library/Vendor/SmartTemplate/class.smarttemplate.php
SmartTemplate.use_cache
function use_cache ( $key = '' ) { if (empty($_POST)) { $this->cache_filename = $this->cache_dir . 'cache_' . md5($_SERVER['REQUEST_URI'] . serialize($key)) . '.ser'; if (($_SERVER['HTTP_CACHE_CONTROL'] != 'no-cache') && ($_SERVER['HTTP_PRAGMA'] != 'no-cache') && @is_file($this->cache_filename)) ...
php
function use_cache ( $key = '' ) { if (empty($_POST)) { $this->cache_filename = $this->cache_dir . 'cache_' . md5($_SERVER['REQUEST_URI'] . serialize($key)) . '.ser'; if (($_SERVER['HTTP_CACHE_CONTROL'] != 'no-cache') && ($_SERVER['HTTP_PRAGMA'] != 'no-cache') && @is_file($this->cache_filename)) ...
[ "function", "use_cache", "(", "$", "key", "=", "''", ")", "{", "if", "(", "empty", "(", "$", "_POST", ")", ")", "{", "$", "this", "->", "cache_filename", "=", "$", "this", "->", "cache_dir", ".", "'cache_'", ".", "md5", "(", "$", "_SERVER", "[", ...
Start Ouput Content Buffering Usage Example: $page = new SmartTemplate('template.html'); $page->use_cache(); ... @access public @desc Output Cache
[ "Start", "Ouput", "Content", "Buffering" ]
86efc9c8a0d504e01e2fea55868227fdc8928841
https://github.com/KDF5000/EasyThink/blob/86efc9c8a0d504e01e2fea55868227fdc8928841/src/ThinkPHP/Library/Vendor/SmartTemplate/class.smarttemplate.php#L339-L354
200,786
KDF5000/EasyThink
src/ThinkPHP/Library/Vendor/SmartTemplate/class.smarttemplate.php
SmartTemplate.cache_callback
function cache_callback ( $output ) { if ($hd = @fopen($this->cache_filename, 'w')) { fputs($hd, $output); fclose($hd); } return $output; }
php
function cache_callback ( $output ) { if ($hd = @fopen($this->cache_filename, 'w')) { fputs($hd, $output); fclose($hd); } return $output; }
[ "function", "cache_callback", "(", "$", "output", ")", "{", "if", "(", "$", "hd", "=", "@", "fopen", "(", "$", "this", "->", "cache_filename", ",", "'w'", ")", ")", "{", "fputs", "(", "$", "hd", ",", "$", "output", ")", ";", "fclose", "(", "$", ...
Output Buffer Callback Function @access private @param string $output @return string $output
[ "Output", "Buffer", "Callback", "Function" ]
86efc9c8a0d504e01e2fea55868227fdc8928841
https://github.com/KDF5000/EasyThink/blob/86efc9c8a0d504e01e2fea55868227fdc8928841/src/ThinkPHP/Library/Vendor/SmartTemplate/class.smarttemplate.php#L364-L372
200,787
phospr/DoubleEntryBundle
Model/Posting.php
Posting.getOffsetPosting
public function getOffsetPosting() { $this->getJournal()->assertIsSimpleJournal(); foreach ($this->getJournal()->getPostings() as $posting) { if ($posting != $this) { return $posting; } } }
php
public function getOffsetPosting() { $this->getJournal()->assertIsSimpleJournal(); foreach ($this->getJournal()->getPostings() as $posting) { if ($posting != $this) { return $posting; } } }
[ "public", "function", "getOffsetPosting", "(", ")", "{", "$", "this", "->", "getJournal", "(", ")", "->", "assertIsSimpleJournal", "(", ")", ";", "foreach", "(", "$", "this", "->", "getJournal", "(", ")", "->", "getPostings", "(", ")", "as", "$", "postin...
Get offset posting If this Posting's Journal has only two Postings, then return the offset Posting @author Tom Haskins-Vaughan <tom@tomhv.uk> @since 0.8.0 @todo Use better Exception class @return Posting
[ "Get", "offset", "posting" ]
d9c421f30922b461483731983c59beb26047fb7f
https://github.com/phospr/DoubleEntryBundle/blob/d9c421f30922b461483731983c59beb26047fb7f/Model/Posting.php#L365-L374
200,788
netbull/CoreBundle
Form/DataTransformer/PointToStringTransformer.php
PointToStringTransformer.reverseTransform
public function reverseTransform($stringPoint) { if (!$stringPoint) { return null; } if (null === $stringPoint) { throw new TransformationFailedException(sprintf( 'An area with number "%s" does not exist!', $stringPoint ));...
php
public function reverseTransform($stringPoint) { if (!$stringPoint) { return null; } if (null === $stringPoint) { throw new TransformationFailedException(sprintf( 'An area with number "%s" does not exist!', $stringPoint ));...
[ "public", "function", "reverseTransform", "(", "$", "stringPoint", ")", "{", "if", "(", "!", "$", "stringPoint", ")", "{", "return", "null", ";", "}", "if", "(", "null", "===", "$", "stringPoint", ")", "{", "throw", "new", "TransformationFailedException", ...
Transforms a string to an object. @param mixed $stringPoint @return null|string
[ "Transforms", "a", "string", "to", "an", "object", "." ]
0bacc1d9e4733b6da613027400c48421e5a14645
https://github.com/netbull/CoreBundle/blob/0bacc1d9e4733b6da613027400c48421e5a14645/Form/DataTransformer/PointToStringTransformer.php#L34-L61
200,789
phospr/DoubleEntryBundle
Model/Organization.php
Organization.findVendorForSlug
public function findVendorForSlug($slug) { $criteria = Criteria::create() ->where(Criteria::expr()->eq('slug', $slug)) ; return $this->getVendors()->matching($criteria)->first(); }
php
public function findVendorForSlug($slug) { $criteria = Criteria::create() ->where(Criteria::expr()->eq('slug', $slug)) ; return $this->getVendors()->matching($criteria)->first(); }
[ "public", "function", "findVendorForSlug", "(", "$", "slug", ")", "{", "$", "criteria", "=", "Criteria", "::", "create", "(", ")", "->", "where", "(", "Criteria", "::", "expr", "(", ")", "->", "eq", "(", "'slug'", ",", "$", "slug", ")", ")", ";", "...
Find Vendor given slug @author Tom Haskins-Vaughan <tom@tomhv.uk> @since 0.8.0 @return Vendor
[ "Find", "Vendor", "given", "slug" ]
d9c421f30922b461483731983c59beb26047fb7f
https://github.com/phospr/DoubleEntryBundle/blob/d9c421f30922b461483731983c59beb26047fb7f/Model/Organization.php#L411-L418
200,790
aegis-security/JSON
src/Decoder.php
Decoder.decodeUnicodeString
public static function decodeUnicodeString($chrs) { $chrs = (string) $chrs; $utf8 = ''; $strlenChrs = strlen($chrs); for ($i = 0; $i < $strlenChrs; $i++) { $ordChrsC = ord($chrs[$i]); switch (true) { case preg_match('/\\\u[0-9A-F]...
php
public static function decodeUnicodeString($chrs) { $chrs = (string) $chrs; $utf8 = ''; $strlenChrs = strlen($chrs); for ($i = 0; $i < $strlenChrs; $i++) { $ordChrsC = ord($chrs[$i]); switch (true) { case preg_match('/\\\u[0-9A-F]...
[ "public", "static", "function", "decodeUnicodeString", "(", "$", "chrs", ")", "{", "$", "chrs", "=", "(", "string", ")", "$", "chrs", ";", "$", "utf8", "=", "''", ";", "$", "strlenChrs", "=", "strlen", "(", "$", "chrs", ")", ";", "for", "(", "$", ...
Decode Unicode Characters from \u0000 ASCII syntax. This algorithm was originally developed for the Solar Framework by Paul M. Jones @link http://solarphp.com/ @link https://github.com/solarphp/core/blob/master/Solar/Json.php @param string $chrs @return string
[ "Decode", "Unicode", "Characters", "from", "\\", "u0000", "ASCII", "syntax", "." ]
7bc8e442e9e570ecbc480053d9aaa42a52910fbc
https://github.com/aegis-security/JSON/blob/7bc8e442e9e570ecbc480053d9aaa42a52910fbc/src/Decoder.php#L83-L143
200,791
aegis-security/JSON
src/Decoder.php
Decoder._decodeValue
protected function _decodeValue() { switch ($this->token) { case self::DATUM: $result = $this->tokenValue; $this->_getNextToken(); return($result); case self::LBRACE: return($this->_decodeObject()); case...
php
protected function _decodeValue() { switch ($this->token) { case self::DATUM: $result = $this->tokenValue; $this->_getNextToken(); return($result); case self::LBRACE: return($this->_decodeObject()); case...
[ "protected", "function", "_decodeValue", "(", ")", "{", "switch", "(", "$", "this", "->", "token", ")", "{", "case", "self", "::", "DATUM", ":", "$", "result", "=", "$", "this", "->", "tokenValue", ";", "$", "this", "->", "_getNextToken", "(", ")", "...
Recursive driving routine for supported toplevel tops @return mixed
[ "Recursive", "driving", "routine", "for", "supported", "toplevel", "tops" ]
7bc8e442e9e570ecbc480053d9aaa42a52910fbc
https://github.com/aegis-security/JSON/blob/7bc8e442e9e570ecbc480053d9aaa42a52910fbc/src/Decoder.php#L211-L228
200,792
aegis-security/JSON
src/Decoder.php
Decoder._eatWhitespace
protected function _eatWhitespace() { if (preg_match('/([\t\b\f\n\r ])*/s', $this->source, $matches, PREG_OFFSET_CAPTURE, $this->offset) && $matches[0][1] == $this->offset) { $this->offset += strlen($matches[0][0]); } }
php
protected function _eatWhitespace() { if (preg_match('/([\t\b\f\n\r ])*/s', $this->source, $matches, PREG_OFFSET_CAPTURE, $this->offset) && $matches[0][1] == $this->offset) { $this->offset += strlen($matches[0][0]); } }
[ "protected", "function", "_eatWhitespace", "(", ")", "{", "if", "(", "preg_match", "(", "'/([\\t\\b\\f\\n\\r ])*/s'", ",", "$", "this", "->", "source", ",", "$", "matches", ",", "PREG_OFFSET_CAPTURE", ",", "$", "this", "->", "offset", ")", "&&", "$", "matche...
Removes whitespace characters from the source input
[ "Removes", "whitespace", "characters", "from", "the", "source", "input" ]
7bc8e442e9e570ecbc480053d9aaa42a52910fbc
https://github.com/aegis-security/JSON/blob/7bc8e442e9e570ecbc480053d9aaa42a52910fbc/src/Decoder.php#L334-L340
200,793
aegis-security/JSON
src/Decoder.php
Decoder._utf162utf8
protected static function _utf162utf8($utf16) { // Check for mb extension otherwise do by hand. if (function_exists('mb_convert_encoding')) { return mb_convert_encoding($utf16, 'UTF-8', 'UTF-16'); } $bytes = (ord($utf16{0}) << 8) | ord($utf16{1}); switch (true) ...
php
protected static function _utf162utf8($utf16) { // Check for mb extension otherwise do by hand. if (function_exists('mb_convert_encoding')) { return mb_convert_encoding($utf16, 'UTF-8', 'UTF-16'); } $bytes = (ord($utf16{0}) << 8) | ord($utf16{1}); switch (true) ...
[ "protected", "static", "function", "_utf162utf8", "(", "$", "utf16", ")", "{", "// Check for mb extension otherwise do by hand.", "if", "(", "function_exists", "(", "'mb_convert_encoding'", ")", ")", "{", "return", "mb_convert_encoding", "(", "$", "utf16", ",", "'UTF-...
Convert a string from one UTF-16 char to one UTF-8 char. Normally should be handled by mb_convert_encoding, but provides a slower PHP-only method for installations that lack the multibyte string extension. This method is from the Solar Framework by Paul M. Jones @link http://solarphp.com @param string $utf16 UTF-...
[ "Convert", "a", "string", "from", "one", "UTF", "-", "16", "char", "to", "one", "UTF", "-", "8", "char", "." ]
7bc8e442e9e570ecbc480053d9aaa42a52910fbc
https://github.com/aegis-security/JSON/blob/7bc8e442e9e570ecbc480053d9aaa42a52910fbc/src/Decoder.php#L508-L539
200,794
shgysk8zer0/core_api
traits/consolehandlers.php
ConsoleHandlers.reportError
final public function reportError( $errno, $errstr, $errfile, $errline, array $errcontext = array() ) { $this->_addRow( array($errstr), $this->_formatLocation($errfile, $errline), self::ERROR ); }
php
final public function reportError( $errno, $errstr, $errfile, $errline, array $errcontext = array() ) { $this->_addRow( array($errstr), $this->_formatLocation($errfile, $errline), self::ERROR ); }
[ "final", "public", "function", "reportError", "(", "$", "errno", ",", "$", "errstr", ",", "$", "errfile", ",", "$", "errline", ",", "array", "$", "errcontext", "=", "array", "(", ")", ")", "{", "$", "this", "->", "_addRow", "(", "array", "(", "$", ...
logs a PHP error to the console as an error @param int $errno the level of the error raised @param string $errstr the error message @param string $errfile the filename that the error was raised in @param int $errline the line number the error was raised at @param array $errcontext an array t...
[ "logs", "a", "PHP", "error", "to", "the", "console", "as", "an", "error" ]
9e9b8baf761af874b95256ad2462e55fbb2b2e58
https://github.com/shgysk8zer0/core_api/blob/9e9b8baf761af874b95256ad2462e55fbb2b2e58/traits/consolehandlers.php#L42-L55
200,795
shgysk8zer0/core_api
traits/consolehandlers.php
ConsoleHandlers.reportException
final public function reportException(\Exception $e) { $this->_addRow( array($e->getMessage()), $this->_formatLocation($e->getFile(), $e->getLine()), self::WARN ); }
php
final public function reportException(\Exception $e) { $this->_addRow( array($e->getMessage()), $this->_formatLocation($e->getFile(), $e->getLine()), self::WARN ); }
[ "final", "public", "function", "reportException", "(", "\\", "Exception", "$", "e", ")", "{", "$", "this", "->", "_addRow", "(", "array", "(", "$", "e", "->", "getMessage", "(", ")", ")", ",", "$", "this", "->", "_formatLocation", "(", "$", "e", "->"...
logs a PHP exception to the console as a warn @param Exception $e the exception @return void
[ "logs", "a", "PHP", "exception", "to", "the", "console", "as", "a", "warn" ]
9e9b8baf761af874b95256ad2462e55fbb2b2e58
https://github.com/shgysk8zer0/core_api/blob/9e9b8baf761af874b95256ad2462e55fbb2b2e58/traits/consolehandlers.php#L64-L71
200,796
vpg/titon.utility
src/Titon/Utility/Format.php
Format.phone
public static function phone($value, $format) { $value = preg_replace('/[^0-9]+/', '', $value); if (is_array($format)) { $length = mb_strlen($value); if ($length >= 11) { $format = $format[11]; } else if ($length >= 10) { $format = $f...
php
public static function phone($value, $format) { $value = preg_replace('/[^0-9]+/', '', $value); if (is_array($format)) { $length = mb_strlen($value); if ($length >= 11) { $format = $format[11]; } else if ($length >= 10) { $format = $f...
[ "public", "static", "function", "phone", "(", "$", "value", ",", "$", "format", ")", "{", "$", "value", "=", "preg_replace", "(", "'/[^0-9]+/'", ",", "''", ",", "$", "value", ")", ";", "if", "(", "is_array", "(", "$", "format", ")", ")", "{", "$", ...
Format a phone number. A phone number can support multiple variations, depending on how many numbers are present. @param int $value @param string $format @return string
[ "Format", "a", "phone", "number", ".", "A", "phone", "number", "can", "support", "multiple", "variations", "depending", "on", "how", "many", "numbers", "are", "present", "." ]
8a77eb9e7b8baacf41cc25487289779d8319cd3a
https://github.com/vpg/titon.utility/blob/8a77eb9e7b8baacf41cc25487289779d8319cd3a/src/Titon/Utility/Format.php#L109-L125
200,797
mpf-soft/admin-widgets
form/fields/ForumTextarea.php
ForumTextarea._replaceRuleText
protected static function _replaceRuleText($text, $rule){ for ($parts = 1; $parts < 20; $parts++){ if (false === strpos($rule, "{T$parts}")) break; } if (1=== $parts){ return str_replace(["T", "T1"], $text, $rule); } $text = str_replace("\\...
php
protected static function _replaceRuleText($text, $rule){ for ($parts = 1; $parts < 20; $parts++){ if (false === strpos($rule, "{T$parts}")) break; } if (1=== $parts){ return str_replace(["T", "T1"], $text, $rule); } $text = str_replace("\\...
[ "protected", "static", "function", "_replaceRuleText", "(", "$", "text", ",", "$", "rule", ")", "{", "for", "(", "$", "parts", "=", "1", ";", "$", "parts", "<", "20", ";", "$", "parts", "++", ")", "{", "if", "(", "false", "===", "strpos", "(", "$...
Replaced found text for a rule. @param string $text @param string $rule @return string
[ "Replaced", "found", "text", "for", "a", "rule", "." ]
92597f9a09d086664268d6b7e0111d5a5586d8c7
https://github.com/mpf-soft/admin-widgets/blob/92597f9a09d086664268d6b7e0111d5a5586d8c7/form/fields/ForumTextarea.php#L153-L168
200,798
zarathustra323/modlr-data
src/Zarathustra/ModlrData/Resource/Entity.php
Entity.getRelationship
public function getRelationship($key) { if (isset($this->relationships[$key])) { return $this->relationships[$key]; } return null; }
php
public function getRelationship($key) { if (isset($this->relationships[$key])) { return $this->relationships[$key]; } return null; }
[ "public", "function", "getRelationship", "(", "$", "key", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "relationships", "[", "$", "key", "]", ")", ")", "{", "return", "$", "this", "->", "relationships", "[", "$", "key", "]", ";", "}", "ret...
Gets a relationship from this entity. Returns null if the relationship doesn't exist. @param string $key @return Relationship|null
[ "Gets", "a", "relationship", "from", "this", "entity", ".", "Returns", "null", "if", "the", "relationship", "doesn", "t", "exist", "." ]
7c2c767216055f75abf8cf22e2200f11998ed24e
https://github.com/zarathustra323/modlr-data/blob/7c2c767216055f75abf8cf22e2200f11998ed24e/src/Zarathustra/ModlrData/Resource/Entity.php#L100-L106
200,799
zarathustra323/modlr-data
src/Zarathustra/ModlrData/Resource/Resource.php
Resource.pushData
public function pushData(Entity $entity) { if ($this->isMany()) { $this->primaryData[] = $entity; return $this; } $this->primaryData = $entity; return $this; }
php
public function pushData(Entity $entity) { if ($this->isMany()) { $this->primaryData[] = $entity; return $this; } $this->primaryData = $entity; return $this; }
[ "public", "function", "pushData", "(", "Entity", "$", "entity", ")", "{", "if", "(", "$", "this", "->", "isMany", "(", ")", ")", "{", "$", "this", "->", "primaryData", "[", "]", "=", "$", "entity", ";", "return", "$", "this", ";", "}", "$", "this...
Pushes entities to this resource. @param Entity $entity @return self
[ "Pushes", "entities", "to", "this", "resource", "." ]
7c2c767216055f75abf8cf22e2200f11998ed24e
https://github.com/zarathustra323/modlr-data/blob/7c2c767216055f75abf8cf22e2200f11998ed24e/src/Zarathustra/ModlrData/Resource/Resource.php#L81-L89