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
222,800
EcomDev/EcomDev_Varnish
src/shell/ecomdev-varnish.php
EcomDev_Varnish_Shell.run
public function run() { if ($this->_action === null) { die($this->usageHelp()); } $reflection = new ReflectionClass(__CLASS__); $methodName = 'run' . uc_words($this->_action, '', ':'); if ($reflection->hasMethod($methodName)) { try { M...
php
public function run() { if ($this->_action === null) { die($this->usageHelp()); } $reflection = new ReflectionClass(__CLASS__); $methodName = 'run' . uc_words($this->_action, '', ':'); if ($reflection->hasMethod($methodName)) { try { M...
[ "public", "function", "run", "(", ")", "{", "if", "(", "$", "this", "->", "_action", "===", "null", ")", "{", "die", "(", "$", "this", "->", "usageHelp", "(", ")", ")", ";", "}", "$", "reflection", "=", "new", "ReflectionClass", "(", "__CLASS__", "...
Runs scripts itself
[ "Runs", "scripts", "itself" ]
228b7b1bdaae15c1895f2533667fffa515447915
https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/shell/ecomdev-varnish.php#L125-L144
222,801
EcomDev/EcomDev_Varnish
src/shell/ecomdev-varnish.php
EcomDev_Varnish_Shell.getConfigBlock
protected function getConfigBlock() { $designPackage = Mage::getSingleton('core/design_package'); $designPackage->setArea('shell'); $block = Mage::app()->getLayout()->createBlock('ecomdev_varnish/vcl_config'); return $block; }
php
protected function getConfigBlock() { $designPackage = Mage::getSingleton('core/design_package'); $designPackage->setArea('shell'); $block = Mage::app()->getLayout()->createBlock('ecomdev_varnish/vcl_config'); return $block; }
[ "protected", "function", "getConfigBlock", "(", ")", "{", "$", "designPackage", "=", "Mage", "::", "getSingleton", "(", "'core/design_package'", ")", ";", "$", "designPackage", "->", "setArea", "(", "'shell'", ")", ";", "$", "block", "=", "Mage", "::", "app"...
Returns block instance @return EcomDev_Varnish_Block_Vcl_Config
[ "Returns", "block", "instance" ]
228b7b1bdaae15c1895f2533667fffa515447915
https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/shell/ecomdev-varnish.php#L151-L157
222,802
EcomDev/EcomDev_Varnish
src/shell/ecomdev-varnish.php
EcomDev_Varnish_Shell.runVclGenerate
protected function runVclGenerate() { $config = Mage::getModel( 'ecomdev_varnish/vcl_config_json', array('file' => $this->getArg('config')) ); $block = $this->getConfigBlock(); if ($version = $this->getArg('version')) { $block->setVersion...
php
protected function runVclGenerate() { $config = Mage::getModel( 'ecomdev_varnish/vcl_config_json', array('file' => $this->getArg('config')) ); $block = $this->getConfigBlock(); if ($version = $this->getArg('version')) { $block->setVersion...
[ "protected", "function", "runVclGenerate", "(", ")", "{", "$", "config", "=", "Mage", "::", "getModel", "(", "'ecomdev_varnish/vcl_config_json'", ",", "array", "(", "'file'", "=>", "$", "this", "->", "getArg", "(", "'config'", ")", ")", ")", ";", "$", "blo...
Generates VCL configuration
[ "Generates", "VCL", "configuration" ]
228b7b1bdaae15c1895f2533667fffa515447915
https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/shell/ecomdev-varnish.php#L163-L191
222,803
EcomDev/EcomDev_Varnish
src/shell/ecomdev-varnish.php
EcomDev_Varnish_Shell.runCacheBan
protected function runCacheBan() { $connector = Mage::getSingleton('ecomdev_varnish/connector'); $header = $this->getArg('header'); if (empty($header)) { $header = 'req.url'; } $value = $this->getArg('value'); $expression = $header . ' ~ ' . $value; ...
php
protected function runCacheBan() { $connector = Mage::getSingleton('ecomdev_varnish/connector'); $header = $this->getArg('header'); if (empty($header)) { $header = 'req.url'; } $value = $this->getArg('value'); $expression = $header . ' ~ ' . $value; ...
[ "protected", "function", "runCacheBan", "(", ")", "{", "$", "connector", "=", "Mage", "::", "getSingleton", "(", "'ecomdev_varnish/connector'", ")", ";", "$", "header", "=", "$", "this", "->", "getArg", "(", "'header'", ")", ";", "if", "(", "empty", "(", ...
Ban cache item
[ "Ban", "cache", "item" ]
228b7b1bdaae15c1895f2533667fffa515447915
https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/shell/ecomdev-varnish.php#L197-L211
222,804
EcomDev/EcomDev_Varnish
src/shell/ecomdev-varnish.php
EcomDev_Varnish_Shell.runCacheBanList
protected function runCacheBanList() { $connector = Mage::getSingleton('ecomdev_varnish/connector'); foreach ($connector->getVarnishPool()->getServers() as $server) { fwrite(STDOUT, sprintf('Ban list for server %s %s', (string)$server, PHP_EOL)); fwrite(STDOUT, $server->execu...
php
protected function runCacheBanList() { $connector = Mage::getSingleton('ecomdev_varnish/connector'); foreach ($connector->getVarnishPool()->getServers() as $server) { fwrite(STDOUT, sprintf('Ban list for server %s %s', (string)$server, PHP_EOL)); fwrite(STDOUT, $server->execu...
[ "protected", "function", "runCacheBanList", "(", ")", "{", "$", "connector", "=", "Mage", "::", "getSingleton", "(", "'ecomdev_varnish/connector'", ")", ";", "foreach", "(", "$", "connector", "->", "getVarnishPool", "(", ")", "->", "getServers", "(", ")", "as"...
Bans cache list
[ "Bans", "cache", "list" ]
228b7b1bdaae15c1895f2533667fffa515447915
https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/shell/ecomdev-varnish.php#L227-L234
222,805
EcomDev/EcomDev_Varnish
src/app/code/community/EcomDev/Varnish/controllers/AjaxController.php
EcomDev_Varnish_AjaxController.preDispatch
public function preDispatch() { $this->_getHelper()->disableSessionForControllerAction('token', $this); parent::preDispatch(); $this->_getHelper()->setIsEsiAllowed(false); $this->_getHelper()->setIsInternal(true); Mage::app()->setUseSessionVar(false); Mage::app()->s...
php
public function preDispatch() { $this->_getHelper()->disableSessionForControllerAction('token', $this); parent::preDispatch(); $this->_getHelper()->setIsEsiAllowed(false); $this->_getHelper()->setIsInternal(true); Mage::app()->setUseSessionVar(false); Mage::app()->s...
[ "public", "function", "preDispatch", "(", ")", "{", "$", "this", "->", "_getHelper", "(", ")", "->", "disableSessionForControllerAction", "(", "'token'", ",", "$", "this", ")", ";", "parent", "::", "preDispatch", "(", ")", ";", "$", "this", "->", "_getHelp...
Disables ESI processing and marks request as internal @return $this
[ "Disables", "ESI", "processing", "and", "marks", "request", "as", "internal" ]
228b7b1bdaae15c1895f2533667fffa515447915
https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/controllers/AjaxController.php#L39-L58
222,806
EcomDev/EcomDev_Varnish
src/app/code/community/EcomDev/Varnish/Block/Messages.php
EcomDev_Varnish_Block_Messages.getGroupedHtml
public function getGroupedHtml() { $name = $this->getNameInLayout(); $htmlId = uniqid($name); $types = []; foreach ($this->_usedStorageTypes as $type) { $type = $this->getVarnishMessageModel()->getMessageTypeByStorage($type); if (!$type) { con...
php
public function getGroupedHtml() { $name = $this->getNameInLayout(); $htmlId = uniqid($name); $types = []; foreach ($this->_usedStorageTypes as $type) { $type = $this->getVarnishMessageModel()->getMessageTypeByStorage($type); if (!$type) { con...
[ "public", "function", "getGroupedHtml", "(", ")", "{", "$", "name", "=", "$", "this", "->", "getNameInLayout", "(", ")", ";", "$", "htmlId", "=", "uniqid", "(", "$", "name", ")", ";", "$", "types", "=", "[", "]", ";", "foreach", "(", "$", "this", ...
Returns JS that is required to load messages @return string
[ "Returns", "JS", "that", "is", "required", "to", "load", "messages" ]
228b7b1bdaae15c1895f2533667fffa515447915
https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Block/Messages.php#L41-L68
222,807
EcomDev/EcomDev_Varnish
src/app/code/community/EcomDev/Varnish/Block/Messages.php
EcomDev_Varnish_Block_Messages.addStorageType
public function addStorageType($type) { parent::addStorageType($type); if (!is_string($type)) { return $this; } foreach ($this->getMessageCollection()->getItems() as $item) { $this->storageMessages[$type][] = $item; } $this->getMessageCollec...
php
public function addStorageType($type) { parent::addStorageType($type); if (!is_string($type)) { return $this; } foreach ($this->getMessageCollection()->getItems() as $item) { $this->storageMessages[$type][] = $item; } $this->getMessageCollec...
[ "public", "function", "addStorageType", "(", "$", "type", ")", "{", "parent", "::", "addStorageType", "(", "$", "type", ")", ";", "if", "(", "!", "is_string", "(", "$", "type", ")", ")", "{", "return", "$", "this", ";", "}", "foreach", "(", "$", "t...
Add used storage type @param string $type @return $this
[ "Add", "used", "storage", "type" ]
228b7b1bdaae15c1895f2533667fffa515447915
https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Block/Messages.php#L102-L116
222,808
stanislav-web/phalcon-uploader
src/Uploader/Uploader.php
Uploader.setRules
public function setRules(array $rules) { foreach ($rules as $key => $values) { if ((is_array($values) === true && empty($values) === false) || is_callable($values)) { $this->rules[$key] = $values; } else { $this->rules[$key] = trim($values); ...
php
public function setRules(array $rules) { foreach ($rules as $key => $values) { if ((is_array($values) === true && empty($values) === false) || is_callable($values)) { $this->rules[$key] = $values; } else { $this->rules[$key] = trim($values); ...
[ "public", "function", "setRules", "(", "array", "$", "rules", ")", "{", "foreach", "(", "$", "rules", "as", "$", "key", "=>", "$", "values", ")", "{", "if", "(", "(", "is_array", "(", "$", "values", ")", "===", "true", "&&", "empty", "(", "$", "v...
Setting up rules for uploaded files @param array $rules @return Uploader
[ "Setting", "up", "rules", "for", "uploaded", "files" ]
3e46aba5d6f51b52b7830eae21c0d3fe1e524c90
https://github.com/stanislav-web/phalcon-uploader/blob/3e46aba5d6f51b52b7830eae21c0d3fe1e524c90/src/Uploader/Uploader.php#L76-L88
222,809
stanislav-web/phalcon-uploader
src/Uploader/Uploader.php
Uploader.truncate
public function truncate() { if (empty($this->info) === false) { foreach ($this->info as $n => $file) { if (file_exists($file['path'])) { unlink($file['path']); } } } }
php
public function truncate() { if (empty($this->info) === false) { foreach ($this->info as $n => $file) { if (file_exists($file['path'])) { unlink($file['path']); } } } }
[ "public", "function", "truncate", "(", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "info", ")", "===", "false", ")", "{", "foreach", "(", "$", "this", "->", "info", "as", "$", "n", "=>", "$", "file", ")", "{", "if", "(", "file_exists", ...
Truncate uploaded files
[ "Truncate", "uploaded", "files" ]
3e46aba5d6f51b52b7830eae21c0d3fe1e524c90
https://github.com/stanislav-web/phalcon-uploader/blob/3e46aba5d6f51b52b7830eae21c0d3fe1e524c90/src/Uploader/Uploader.php#L200-L209
222,810
univicosa/laravel-openid-client
Providers/OpenIdServiceProvider.php
OpenIdServiceProvider.registerGuard
protected function registerGuard() { \Auth::extend('openid', function ($app, $name, array $config) { return new CustomSessionGuard($app['session.store']); }); \Auth::extend('basic-api', function ($app, $name, array $config) { return new CustomTokenGuard(); })...
php
protected function registerGuard() { \Auth::extend('openid', function ($app, $name, array $config) { return new CustomSessionGuard($app['session.store']); }); \Auth::extend('basic-api', function ($app, $name, array $config) { return new CustomTokenGuard(); })...
[ "protected", "function", "registerGuard", "(", ")", "{", "\\", "Auth", "::", "extend", "(", "'openid'", ",", "function", "(", "$", "app", ",", "$", "name", ",", "array", "$", "config", ")", "{", "return", "new", "CustomSessionGuard", "(", "$", "app", "...
Register Guard Session @return void
[ "Register", "Guard", "Session" ]
42ac511de250b597ba12ef0216f1d493fd7a2def
https://github.com/univicosa/laravel-openid-client/blob/42ac511de250b597ba12ef0216f1d493fd7a2def/Providers/OpenIdServiceProvider.php#L76-L85
222,811
digiaonline/lumen-dynamodb
src/Console/CreateTablesCommand.php
CreateTablesCommand.createTables
protected function createTables() { if (empty( self::$tables )) { throw new \Exception('Cannot create tables, as no configuration file given, or the ::$tables is not overridden.'); } $client = $this->dynamoDb->getClient(); foreach (self::$tables as $tableData) { ...
php
protected function createTables() { if (empty( self::$tables )) { throw new \Exception('Cannot create tables, as no configuration file given, or the ::$tables is not overridden.'); } $client = $this->dynamoDb->getClient(); foreach (self::$tables as $tableData) { ...
[ "protected", "function", "createTables", "(", ")", "{", "if", "(", "empty", "(", "self", "::", "$", "tables", ")", ")", "{", "throw", "new", "\\", "Exception", "(", "'Cannot create tables, as no configuration file given, or the ::$tables is not overridden.'", ")", ";"...
Creates the tables defined in configuration file, or overridden. @throws \Exception
[ "Creates", "the", "tables", "defined", "in", "configuration", "file", "or", "overridden", "." ]
d29edefbe461af0bc902037e397cc8586a2ec87c
https://github.com/digiaonline/lumen-dynamodb/blob/d29edefbe461af0bc902037e397cc8586a2ec87c/src/Console/CreateTablesCommand.php#L60-L84
222,812
fage1151/swoole-worker
Worker.php
Worker.parseCommand
protected static function parseCommand() { global $argv; // Check argv; $start_file = $argv[0]; if (!isset($argv[1])) { exit("Usage: php yourfile.php {start|stop|restart|reload|status}\n"); } // Get command. $command = trim($argv[1]); $co...
php
protected static function parseCommand() { global $argv; // Check argv; $start_file = $argv[0]; if (!isset($argv[1])) { exit("Usage: php yourfile.php {start|stop|restart|reload|status}\n"); } // Get command. $command = trim($argv[1]); $co...
[ "protected", "static", "function", "parseCommand", "(", ")", "{", "global", "$", "argv", ";", "// Check argv;", "$", "start_file", "=", "$", "argv", "[", "0", "]", ";", "if", "(", "!", "isset", "(", "$", "argv", "[", "1", "]", ")", ")", "{", "exit"...
Parse command. php yourfile.php start | stop | restart | reload | status @return void
[ "Parse", "command", ".", "php", "yourfile", ".", "php", "start", "|", "stop", "|", "restart", "|", "reload", "|", "status" ]
ade6e29ffb400129380d56e9a2e6656f19dceb17
https://github.com/fage1151/swoole-worker/blob/ade6e29ffb400129380d56e9a2e6656f19dceb17/Worker.php#L625-L720
222,813
fage1151/swoole-worker
Worker.php
Worker.exitAndClearAll
protected static function exitAndClearAll() { foreach (self::$_workers as $worker) { $socket_name = $worker->getSocketName(); if ($worker->transport === 'unix' && $socket_name) { list(, $address) = explode(':', $socket_name, 2); @unlink($address); ...
php
protected static function exitAndClearAll() { foreach (self::$_workers as $worker) { $socket_name = $worker->getSocketName(); if ($worker->transport === 'unix' && $socket_name) { list(, $address) = explode(':', $socket_name, 2); @unlink($address); ...
[ "protected", "static", "function", "exitAndClearAll", "(", ")", "{", "foreach", "(", "self", "::", "$", "_workers", "as", "$", "worker", ")", "{", "$", "socket_name", "=", "$", "worker", "->", "getSocketName", "(", ")", ";", "if", "(", "$", "worker", "...
Exit current process. @return void
[ "Exit", "current", "process", "." ]
ade6e29ffb400129380d56e9a2e6656f19dceb17
https://github.com/fage1151/swoole-worker/blob/ade6e29ffb400129380d56e9a2e6656f19dceb17/Worker.php#L1036-L1051
222,814
fage1151/swoole-worker
Worker.php
Worker.listen
public function listen() { if (!$this->_socketName || $this->_mainSocket) { return; } // Autoload. Autoloader::setRootPath($this->_autoloadRootPath); // Get the application layer communication protocol and listening address. list($scheme, $address) = ex...
php
public function listen() { if (!$this->_socketName || $this->_mainSocket) { return; } // Autoload. Autoloader::setRootPath($this->_autoloadRootPath); // Get the application layer communication protocol and listening address. list($scheme, $address) = ex...
[ "public", "function", "listen", "(", ")", "{", "if", "(", "!", "$", "this", "->", "_socketName", "||", "$", "this", "->", "_mainSocket", ")", "{", "return", ";", "}", "// Autoload.", "Autoloader", "::", "setRootPath", "(", "$", "this", "->", "_autoloadRo...
Listen port. @throws Exception
[ "Listen", "port", "." ]
ade6e29ffb400129380d56e9a2e6656f19dceb17
https://github.com/fage1151/swoole-worker/blob/ade6e29ffb400129380d56e9a2e6656f19dceb17/Worker.php#L1366-L1439
222,815
sgpatil/oriquent
src/Sgpatil/Orientdb/Schema/Blueprint.php
Blueprint.integer
public function integer($column, $autoIncrement = false, $unsigned = false) { return $this->addColumn('INTEGER', $column, compact('autoIncrement', 'unsigned')); }
php
public function integer($column, $autoIncrement = false, $unsigned = false) { return $this->addColumn('INTEGER', $column, compact('autoIncrement', 'unsigned')); }
[ "public", "function", "integer", "(", "$", "column", ",", "$", "autoIncrement", "=", "false", ",", "$", "unsigned", "=", "false", ")", "{", "return", "$", "this", "->", "addColumn", "(", "'INTEGER'", ",", "$", "column", ",", "compact", "(", "'autoIncreme...
Create a new integer column on the table. @param string $column @param bool $autoIncrement @param bool $unsigned @return \Illuminate\Support\Fluent
[ "Create", "a", "new", "integer", "column", "on", "the", "table", "." ]
cf0f2ba688496260946f569a20c351e91f287c32
https://github.com/sgpatil/oriquent/blob/cf0f2ba688496260946f569a20c351e91f287c32/src/Sgpatil/Orientdb/Schema/Blueprint.php#L402-L404
222,816
sgpatil/oriquent
src/Sgpatil/Orientdb/Eloquent/Edges/Finder.php
Finder.first
public function first(Model $parentModel, Model $relatedModel, $type, $direction = 'any') { // First we get the first relationship instance between the two models // absed on the given direction. $relation = $this->firstRelation($parentModel, $relatedModel, $type, $direction); // Le...
php
public function first(Model $parentModel, Model $relatedModel, $type, $direction = 'any') { // First we get the first relationship instance between the two models // absed on the given direction. $relation = $this->firstRelation($parentModel, $relatedModel, $type, $direction); // Le...
[ "public", "function", "first", "(", "Model", "$", "parentModel", ",", "Model", "$", "relatedModel", ",", "$", "type", ",", "$", "direction", "=", "'any'", ")", "{", "// First we get the first relationship instance between the two models", "// absed on the given direction....
Get the first edge relationship between two models. @param \Sgpatil\Orientdb\Eloquent\Model $parentModel @param \Sgpatil\Orientdb\Eloquent\Model $relatedModel @param string $direction @return \Sgpatil\Orientdb\Eloquent\Edges\Edge[In|Out]|null
[ "Get", "the", "first", "edge", "relationship", "between", "two", "models", "." ]
cf0f2ba688496260946f569a20c351e91f287c32
https://github.com/sgpatil/oriquent/blob/cf0f2ba688496260946f569a20c351e91f287c32/src/Sgpatil/Orientdb/Eloquent/Edges/Finder.php#L70-L81
222,817
teresko/palladium
src/Palladium/Service/Search.php
Search.findIdentityById
public function findIdentityById(int $identityId): Entity\Identity { $identity = new Entity\Identity; $identity->setId($identityId); $this->repository->load($identity, Entity\Identity::class); if ($identity->getAccountId() === null) { $this->logger->notice('identity not...
php
public function findIdentityById(int $identityId): Entity\Identity { $identity = new Entity\Identity; $identity->setId($identityId); $this->repository->load($identity, Entity\Identity::class); if ($identity->getAccountId() === null) { $this->logger->notice('identity not...
[ "public", "function", "findIdentityById", "(", "int", "$", "identityId", ")", ":", "Entity", "\\", "Identity", "{", "$", "identity", "=", "new", "Entity", "\\", "Identity", ";", "$", "identity", "->", "setId", "(", "$", "identityId", ")", ";", "$", "this...
Locates identity based on ID @throws IdentityNotFound if identity was not found
[ "Locates", "identity", "based", "on", "ID" ]
0ebb6dc3c52946c7f6d9967701ea6196eb7f45a8
https://github.com/teresko/palladium/blob/0ebb6dc3c52946c7f6d9967701ea6196eb7f45a8/src/Palladium/Service/Search.php#L38-L56
222,818
teresko/palladium
src/Palladium/Service/Search.php
Search.findStandardIdentityByIdentifier
public function findStandardIdentityByIdentifier(string $identifier): Entity\StandardIdentity { $identity = new Entity\StandardIdentity; $identity->setIdentifier($identifier); $this->repository->load($identity); if ($identity->getId() === null) { $this->logger->notice('...
php
public function findStandardIdentityByIdentifier(string $identifier): Entity\StandardIdentity { $identity = new Entity\StandardIdentity; $identity->setIdentifier($identifier); $this->repository->load($identity); if ($identity->getId() === null) { $this->logger->notice('...
[ "public", "function", "findStandardIdentityByIdentifier", "(", "string", "$", "identifier", ")", ":", "Entity", "\\", "StandardIdentity", "{", "$", "identity", "=", "new", "Entity", "\\", "StandardIdentity", ";", "$", "identity", "->", "setIdentifier", "(", "$", ...
Locates identity based on email address @throws IdentityNotFound if identity was not found
[ "Locates", "identity", "based", "on", "email", "address" ]
0ebb6dc3c52946c7f6d9967701ea6196eb7f45a8
https://github.com/teresko/palladium/blob/0ebb6dc3c52946c7f6d9967701ea6196eb7f45a8/src/Palladium/Service/Search.php#L64-L82
222,819
chillerlan/php-database
src/Drivers/MySQLiDrv.php
MySQLiDrv.getReferences
protected function getReferences(array $row){ $references = []; $types = []; foreach($row as &$field){ $type = gettype($field); if($type === 'integer'){ $types[] = 'i'; } elseif($type === 'double'){ $types[] = 'd'; } else{ $types[] = 's'; } $references[] = &$field; } ...
php
protected function getReferences(array $row){ $references = []; $types = []; foreach($row as &$field){ $type = gettype($field); if($type === 'integer'){ $types[] = 'i'; } elseif($type === 'double'){ $types[] = 'd'; } else{ $types[] = 's'; } $references[] = &$field; } ...
[ "protected", "function", "getReferences", "(", "array", "$", "row", ")", "{", "$", "references", "=", "[", "]", ";", "$", "types", "=", "[", "]", ";", "foreach", "(", "$", "row", "as", "&", "$", "field", ")", "{", "$", "type", "=", "gettype", "("...
Copies an array to an array of referenced values @param array $row @return array @see http://php.net/manual/mysqli-stmt.bind-param.php
[ "Copies", "an", "array", "to", "an", "array", "of", "referenced", "values" ]
e0fd75d8e99875d748e62bfd89be87ea7cea1f5c
https://github.com/chillerlan/php-database/blob/e0fd75d8e99875d748e62bfd89be87ea7cea1f5c/src/Drivers/MySQLiDrv.php#L237-L260
222,820
corneltek/FormKit
src/Widget/BaseWidget.php
BaseWidget.getSerialId
public function getSerialId() { if($this->id) return $this->id; $id = $this->generateSerialId(); $this->setId( $id ); return $id; }
php
public function getSerialId() { if($this->id) return $this->id; $id = $this->generateSerialId(); $this->setId( $id ); return $id; }
[ "public", "function", "getSerialId", "(", ")", "{", "if", "(", "$", "this", "->", "id", ")", "return", "$", "this", "->", "id", ";", "$", "id", "=", "$", "this", "->", "generateSerialId", "(", ")", ";", "$", "this", "->", "setId", "(", "$", "id",...
Get a new serial id
[ "Get", "a", "new", "serial", "id" ]
c8963d494b8bd7d7f63928002057db86e5873c26
https://github.com/corneltek/FormKit/blob/c8963d494b8bd7d7f63928002057db86e5873c26/src/Widget/BaseWidget.php#L220-L227
222,821
digiaonline/lumen-dynamodb
src/Domain/Model/DynamoDbModel.php
DynamoDbModel.find
public static function find($id, array $columns = []) { $model = static::getInstance(); $key = static::getModelKey($id, $model); $query = [ 'ConsistentRead' => true, 'TableName' => $model->getTable(), 'Key' => $key, ]; if ...
php
public static function find($id, array $columns = []) { $model = static::getInstance(); $key = static::getModelKey($id, $model); $query = [ 'ConsistentRead' => true, 'TableName' => $model->getTable(), 'Key' => $key, ]; if ...
[ "public", "static", "function", "find", "(", "$", "id", ",", "array", "$", "columns", "=", "[", "]", ")", "{", "$", "model", "=", "static", "::", "getInstance", "(", ")", ";", "$", "key", "=", "static", "::", "getModelKey", "(", "$", "id", ",", "...
Find a record. @param mixed $id The id to find. @param array $columns List of columns to get. @return DynamoDbModel|null The model, or null if nothing found.
[ "Find", "a", "record", "." ]
d29edefbe461af0bc902037e397cc8586a2ec87c
https://github.com/digiaonline/lumen-dynamodb/blob/d29edefbe461af0bc902037e397cc8586a2ec87c/src/Domain/Model/DynamoDbModel.php#L247-L272
222,822
digiaonline/lumen-dynamodb
src/Domain/Model/DynamoDbModel.php
DynamoDbModel.first
public static function first($columns = []) { $model = static::getInstance(); $item = $model->getAll($columns, 1); return $item->first(); }
php
public static function first($columns = []) { $model = static::getInstance(); $item = $model->getAll($columns, 1); return $item->first(); }
[ "public", "static", "function", "first", "(", "$", "columns", "=", "[", "]", ")", "{", "$", "model", "=", "static", "::", "getInstance", "(", ")", ";", "$", "item", "=", "$", "model", "->", "getAll", "(", "$", "columns", ",", "1", ")", ";", "retu...
Return the first result. @param array $columns Columns to get. @return mixed
[ "Return", "the", "first", "result", "." ]
d29edefbe461af0bc902037e397cc8586a2ec87c
https://github.com/digiaonline/lumen-dynamodb/blob/d29edefbe461af0bc902037e397cc8586a2ec87c/src/Domain/Model/DynamoDbModel.php#L296-L302
222,823
digiaonline/lumen-dynamodb
src/Domain/Model/DynamoDbModel.php
DynamoDbModel.where
public static function where($column, $operator = null, $value = null, $boolean = 'and') { if ($boolean !== 'and') { throw new NotSupportedException('Only support "and" in where clause'); } $model = static::getInstance(); // If the column is an array, we will assume it is...
php
public static function where($column, $operator = null, $value = null, $boolean = 'and') { if ($boolean !== 'and') { throw new NotSupportedException('Only support "and" in where clause'); } $model = static::getInstance(); // If the column is an array, we will assume it is...
[ "public", "static", "function", "where", "(", "$", "column", ",", "$", "operator", "=", "null", ",", "$", "value", "=", "null", ",", "$", "boolean", "=", "'and'", ")", "{", "if", "(", "$", "boolean", "!==", "'and'", ")", "{", "throw", "new", "NotSu...
Static where function, adds where conditions to the model. @param string|array $column @param string|null $operator @param string|null $value @param string $boolean @return DynamoDbModel @throws NotSupportedException
[ "Static", "where", "function", "adds", "where", "conditions", "to", "the", "model", "." ]
d29edefbe461af0bc902037e397cc8586a2ec87c
https://github.com/digiaonline/lumen-dynamodb/blob/d29edefbe461af0bc902037e397cc8586a2ec87c/src/Domain/Model/DynamoDbModel.php#L315-L335
222,824
digiaonline/lumen-dynamodb
src/Domain/Model/DynamoDbModel.php
DynamoDbModel.sort
public function sort($direction) { if (strtolower($direction) === self::DIRECTION_DESC) { $this->scanIndexForward = false; } else { $this->scanIndexForward = true; } }
php
public function sort($direction) { if (strtolower($direction) === self::DIRECTION_DESC) { $this->scanIndexForward = false; } else { $this->scanIndexForward = true; } }
[ "public", "function", "sort", "(", "$", "direction", ")", "{", "if", "(", "strtolower", "(", "$", "direction", ")", "===", "self", "::", "DIRECTION_DESC", ")", "{", "$", "this", "->", "scanIndexForward", "=", "false", ";", "}", "else", "{", "$", "this"...
Set the sort order for the current search query. @param string $direction The direction to sort.
[ "Set", "the", "sort", "order", "for", "the", "current", "search", "query", "." ]
d29edefbe461af0bc902037e397cc8586a2ec87c
https://github.com/digiaonline/lumen-dynamodb/blob/d29edefbe461af0bc902037e397cc8586a2ec87c/src/Domain/Model/DynamoDbModel.php#L395-L402
222,825
digiaonline/lumen-dynamodb
src/Domain/Model/DynamoDbModel.php
DynamoDbModel.getAll
protected function getAll(array $columns = [], $limit = - 1) { $query = [ 'TableName' => $this->getTable(), ]; $op = 'Scan'; if ($limit > - 1) { $query['limit'] = $limit; } if ( ! empty( $columns )) { $query['AttributesToGet'] = ...
php
protected function getAll(array $columns = [], $limit = - 1) { $query = [ 'TableName' => $this->getTable(), ]; $op = 'Scan'; if ($limit > - 1) { $query['limit'] = $limit; } if ( ! empty( $columns )) { $query['AttributesToGet'] = ...
[ "protected", "function", "getAll", "(", "array", "$", "columns", "=", "[", "]", ",", "$", "limit", "=", "-", "1", ")", "{", "$", "query", "=", "[", "'TableName'", "=>", "$", "this", "->", "getTable", "(", ")", ",", "]", ";", "$", "op", "=", "'S...
Gets all values for given columns. @param array $columns List of columns to get. @param int $limit Limit the result. @return Collection
[ "Gets", "all", "values", "for", "given", "columns", "." ]
d29edefbe461af0bc902037e397cc8586a2ec87c
https://github.com/digiaonline/lumen-dynamodb/blob/d29edefbe461af0bc902037e397cc8586a2ec87c/src/Domain/Model/DynamoDbModel.php#L424-L467
222,826
digiaonline/lumen-dynamodb
src/Domain/Model/DynamoDbModel.php
DynamoDbModel.conditionsContainIndexKey
protected function conditionsContainIndexKey() { if (empty( $this->where )) { return false; } foreach ($this->dynamoDbIndexKeys as $key => $name) { if (isset( $this->where[$key] )) { return $key; } } return false; }
php
protected function conditionsContainIndexKey() { if (empty( $this->where )) { return false; } foreach ($this->dynamoDbIndexKeys as $key => $name) { if (isset( $this->where[$key] )) { return $key; } } return false; }
[ "protected", "function", "conditionsContainIndexKey", "(", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "where", ")", ")", "{", "return", "false", ";", "}", "foreach", "(", "$", "this", "->", "dynamoDbIndexKeys", "as", "$", "key", "=>", "$", "...
Checks if the conditions contains an index key. @return bool|mixed The key if found, false otherwise.
[ "Checks", "if", "the", "conditions", "contains", "an", "index", "key", "." ]
d29edefbe461af0bc902037e397cc8586a2ec87c
https://github.com/digiaonline/lumen-dynamodb/blob/d29edefbe461af0bc902037e397cc8586a2ec87c/src/Domain/Model/DynamoDbModel.php#L474-L486
222,827
digiaonline/lumen-dynamodb
src/Domain/Model/DynamoDbModel.php
DynamoDbModel.getSpecificDynamoDbKey
protected static function getSpecificDynamoDbKey(DynamoDbModel $model, $keyName, $value) { $idKey = $model->marshalItem([ $keyName => $value, ]); return [$keyName => $idKey[$keyName]]; }
php
protected static function getSpecificDynamoDbKey(DynamoDbModel $model, $keyName, $value) { $idKey = $model->marshalItem([ $keyName => $value, ]); return [$keyName => $idKey[$keyName]]; }
[ "protected", "static", "function", "getSpecificDynamoDbKey", "(", "DynamoDbModel", "$", "model", ",", "$", "keyName", ",", "$", "value", ")", "{", "$", "idKey", "=", "$", "model", "->", "marshalItem", "(", "[", "$", "keyName", "=>", "$", "value", ",", "]...
Get a specific DynamoDb key. @param DynamoDbModel $model The DynamoDb model. @param string $keyName The key name. @param string $value The key value. @return array The DynamoDb key, keyName => value.
[ "Get", "a", "specific", "DynamoDb", "key", "." ]
d29edefbe461af0bc902037e397cc8586a2ec87c
https://github.com/digiaonline/lumen-dynamodb/blob/d29edefbe461af0bc902037e397cc8586a2ec87c/src/Domain/Model/DynamoDbModel.php#L510-L517
222,828
digiaonline/lumen-dynamodb
src/Domain/Model/DynamoDbModel.php
DynamoDbModel.getModelKey
protected static function getModelKey($id, DynamoDbModel $model) { if (is_array($id)) { $key = []; foreach ($id as $name => $value) { $specific_key = static::getSpecificDynamoDbKey($model, $name, $value); foreach ($specific_key as $keyName => $keyValue...
php
protected static function getModelKey($id, DynamoDbModel $model) { if (is_array($id)) { $key = []; foreach ($id as $name => $value) { $specific_key = static::getSpecificDynamoDbKey($model, $name, $value); foreach ($specific_key as $keyName => $keyValue...
[ "protected", "static", "function", "getModelKey", "(", "$", "id", ",", "DynamoDbModel", "$", "model", ")", "{", "if", "(", "is_array", "(", "$", "id", ")", ")", "{", "$", "key", "=", "[", "]", ";", "foreach", "(", "$", "id", "as", "$", "name", "=...
Get the key for this model whether composite or simple. @param mixed $id The ID. @param DynamoDbModel $model The DynamoDb model. @return array The DynamoDb key, keyName => value.
[ "Get", "the", "key", "for", "this", "model", "whether", "composite", "or", "simple", "." ]
d29edefbe461af0bc902037e397cc8586a2ec87c
https://github.com/digiaonline/lumen-dynamodb/blob/d29edefbe461af0bc902037e397cc8586a2ec87c/src/Domain/Model/DynamoDbModel.php#L527-L542
222,829
digiaonline/lumen-dynamodb
src/Domain/Model/DynamoDbModel.php
DynamoDbModel.getKeyAsArray
protected function getKeyAsArray() { $result = []; if ( ! empty( $this->compositeKey )) { foreach ($this->compositeKey as $key) { $result[$key] = $this->{$key}; } } else { $result[$this->getKeyName()] = $this->getKey(); } r...
php
protected function getKeyAsArray() { $result = []; if ( ! empty( $this->compositeKey )) { foreach ($this->compositeKey as $key) { $result[$key] = $this->{$key}; } } else { $result[$this->getKeyName()] = $this->getKey(); } r...
[ "protected", "function", "getKeyAsArray", "(", ")", "{", "$", "result", "=", "[", "]", ";", "if", "(", "!", "empty", "(", "$", "this", "->", "compositeKey", ")", ")", "{", "foreach", "(", "$", "this", "->", "compositeKey", "as", "$", "key", ")", "{...
Get a key as array. @return array The key, keyName => value.
[ "Get", "a", "key", "as", "array", "." ]
d29edefbe461af0bc902037e397cc8586a2ec87c
https://github.com/digiaonline/lumen-dynamodb/blob/d29edefbe461af0bc902037e397cc8586a2ec87c/src/Domain/Model/DynamoDbModel.php#L549-L561
222,830
digiaonline/lumen-dynamodb
src/Domain/Model/DynamoDbModel.php
DynamoDbModel.setUnfillableAttributes
protected function setUnfillableAttributes(array $attributes = []) { if ( ! empty( $attributes )) { $keysToFill = array_diff(array_keys($attributes), $this->fillable); foreach ($keysToFill as $key) { $this->setAttribute($key, $attributes[$key]); } ...
php
protected function setUnfillableAttributes(array $attributes = []) { if ( ! empty( $attributes )) { $keysToFill = array_diff(array_keys($attributes), $this->fillable); foreach ($keysToFill as $key) { $this->setAttribute($key, $attributes[$key]); } ...
[ "protected", "function", "setUnfillableAttributes", "(", "array", "$", "attributes", "=", "[", "]", ")", "{", "if", "(", "!", "empty", "(", "$", "attributes", ")", ")", "{", "$", "keysToFill", "=", "array_diff", "(", "array_keys", "(", "$", "attributes", ...
Sets the unfillable attributes. @param array $attributes List of attributes.
[ "Sets", "the", "unfillable", "attributes", "." ]
d29edefbe461af0bc902037e397cc8586a2ec87c
https://github.com/digiaonline/lumen-dynamodb/blob/d29edefbe461af0bc902037e397cc8586a2ec87c/src/Domain/Model/DynamoDbModel.php#L568-L576
222,831
corneltek/FormKit
src/Element.php
Element.setAttributeValue
public function setAttributeValue($name,$arg) { if ( property_exists($this, $name) ) { $this->$name = $arg; } else { $this->_attributes[ $name ] = $arg; } }
php
public function setAttributeValue($name,$arg) { if ( property_exists($this, $name) ) { $this->$name = $arg; } else { $this->_attributes[ $name ] = $arg; } }
[ "public", "function", "setAttributeValue", "(", "$", "name", ",", "$", "arg", ")", "{", "if", "(", "property_exists", "(", "$", "this", ",", "$", "name", ")", ")", "{", "$", "this", "->", "$", "name", "=", "$", "arg", ";", "}", "else", "{", "$", ...
Check property and set attribute value without type checking. If there is a property with the same name Then the value will be set to the property. Or the value will be stored in $this->_attributes array. This is for internal use. @param string $name @param mixed $arg
[ "Check", "property", "and", "set", "attribute", "value", "without", "type", "checking", "." ]
c8963d494b8bd7d7f63928002057db86e5873c26
https://github.com/corneltek/FormKit/blob/c8963d494b8bd7d7f63928002057db86e5873c26/src/Element.php#L115-L122
222,832
corneltek/FormKit
src/Element.php
Element.setAttribute
public function setAttribute($name,$args) { if ($this->isIgnoredAttribute($name)) { return; } // check if it's registered. if (isset($this->_supportedAttributes[ $name ])) { $c = count($args); $t = $this->_supportedAttributes[ $name ]; ...
php
public function setAttribute($name,$args) { if ($this->isIgnoredAttribute($name)) { return; } // check if it's registered. if (isset($this->_supportedAttributes[ $name ])) { $c = count($args); $t = $this->_supportedAttributes[ $name ]; ...
[ "public", "function", "setAttribute", "(", "$", "name", ",", "$", "args", ")", "{", "if", "(", "$", "this", "->", "isIgnoredAttribute", "(", "$", "name", ")", ")", "{", "return", ";", "}", "// check if it's registered.", "if", "(", "isset", "(", "$", "...
Check if the attribute is registered if it's registered, the type registered will change the behavior of setting values. @param string $name @param array $args
[ "Check", "if", "the", "attribute", "is", "registered", "if", "it", "s", "registered", "the", "type", "registered", "will", "change", "the", "behavior", "of", "setting", "values", "." ]
c8963d494b8bd7d7f63928002057db86e5873c26
https://github.com/corneltek/FormKit/blob/c8963d494b8bd7d7f63928002057db86e5873c26/src/Element.php#L144-L227
222,833
corneltek/FormKit
src/Element.php
Element.registerCustomAttributes
public function registerCustomAttributes($attributes) { if( is_string($attributes) ) { $attributes = explode(' ',$attributes); } $this->customAttributes = array_merge( $this->customAttributes , (array) $attributes ); return $this; }
php
public function registerCustomAttributes($attributes) { if( is_string($attributes) ) { $attributes = explode(' ',$attributes); } $this->customAttributes = array_merge( $this->customAttributes , (array) $attributes ); return $this; }
[ "public", "function", "registerCustomAttributes", "(", "$", "attributes", ")", "{", "if", "(", "is_string", "(", "$", "attributes", ")", ")", "{", "$", "attributes", "=", "explode", "(", "' '", ",", "$", "attributes", ")", ";", "}", "$", "this", "->", ...
Add attribute to customAttribute list @param string|array $attributes $this->addAttributes('id class for');
[ "Add", "attribute", "to", "customAttribute", "list" ]
c8963d494b8bd7d7f63928002057db86e5873c26
https://github.com/corneltek/FormKit/blob/c8963d494b8bd7d7f63928002057db86e5873c26/src/Element.php#L370-L377
222,834
corneltek/FormKit
src/Element.php
Element.setAttributes
public function setAttributes($attributes) { foreach ($attributes as $k => $val) { if ($this->isIgnoredAttribute($k)) { continue; } // this is for adding new class name with // +=newClass if( is_string($val) && strpos($val ,'+=')...
php
public function setAttributes($attributes) { foreach ($attributes as $k => $val) { if ($this->isIgnoredAttribute($k)) { continue; } // this is for adding new class name with // +=newClass if( is_string($val) && strpos($val ,'+=')...
[ "public", "function", "setAttributes", "(", "$", "attributes", ")", "{", "foreach", "(", "$", "attributes", "as", "$", "k", "=>", "$", "val", ")", "{", "if", "(", "$", "this", "->", "isIgnoredAttribute", "(", "$", "k", ")", ")", "{", "continue", ";",...
Set attributes from array @param array $attributes
[ "Set", "attributes", "from", "array" ]
c8963d494b8bd7d7f63928002057db86e5873c26
https://github.com/corneltek/FormKit/blob/c8963d494b8bd7d7f63928002057db86e5873c26/src/Element.php#L586-L613
222,835
corneltek/FormKit
src/Element.php
Element.renderAttributes
public function renderAttributes() { return $this->_renderAttributes($this->standardAttributes) . $this->_renderAttributes($this->customAttributes) . $this->_renderAttributes(array_keys($this->_attributes)); }
php
public function renderAttributes() { return $this->_renderAttributes($this->standardAttributes) . $this->_renderAttributes($this->customAttributes) . $this->_renderAttributes(array_keys($this->_attributes)); }
[ "public", "function", "renderAttributes", "(", ")", "{", "return", "$", "this", "->", "_renderAttributes", "(", "$", "this", "->", "standardAttributes", ")", ".", "$", "this", "->", "_renderAttributes", "(", "$", "this", "->", "customAttributes", ")", ".", "...
Render attributes string @return string Standard Attribute string
[ "Render", "attributes", "string" ]
c8963d494b8bd7d7f63928002057db86e5873c26
https://github.com/corneltek/FormKit/blob/c8963d494b8bd7d7f63928002057db86e5873c26/src/Element.php#L620-L625
222,836
corneltek/FormKit
src/Element.php
Element.open
public function open( $attributes = array() ) { $this->setAttributes( $attributes ); $html = '<' . $this->tagName . $this->renderAttributes() ; // should we close it ? if( $this->closeEmpty || $this->hasChildren() ) { $html .= '>'; ...
php
public function open( $attributes = array() ) { $this->setAttributes( $attributes ); $html = '<' . $this->tagName . $this->renderAttributes() ; // should we close it ? if( $this->closeEmpty || $this->hasChildren() ) { $html .= '>'; ...
[ "public", "function", "open", "(", "$", "attributes", "=", "array", "(", ")", ")", "{", "$", "this", "->", "setAttributes", "(", "$", "attributes", ")", ";", "$", "html", "=", "'<'", ".", "$", "this", "->", "tagName", ".", "$", "this", "->", "rende...
Render open tag $form->open(); $form->renderChildren(); $form->close();
[ "Render", "open", "tag" ]
c8963d494b8bd7d7f63928002057db86e5873c26
https://github.com/corneltek/FormKit/blob/c8963d494b8bd7d7f63928002057db86e5873c26/src/Element.php#L699-L711
222,837
corneltek/FormKit
src/Element.php
Element.close
public function close() { $html = ''; if( $this->closeEmpty || $this->hasChildren() ) { $html .= '</' . $this->tagName . '>'; } return $html; }
php
public function close() { $html = ''; if( $this->closeEmpty || $this->hasChildren() ) { $html .= '</' . $this->tagName . '>'; } return $html; }
[ "public", "function", "close", "(", ")", "{", "$", "html", "=", "''", ";", "if", "(", "$", "this", "->", "closeEmpty", "||", "$", "this", "->", "hasChildren", "(", ")", ")", "{", "$", "html", ".=", "'</'", ".", "$", "this", "->", "tagName", ".", ...
Render close tag
[ "Render", "close", "tag" ]
c8963d494b8bd7d7f63928002057db86e5873c26
https://github.com/corneltek/FormKit/blob/c8963d494b8bd7d7f63928002057db86e5873c26/src/Element.php#L717-L723
222,838
corneltek/FormKit
src/Element.php
Element.render
public function render( $attributes = array() ) { if( ! $this->tagName ) { throw new Exception('tagName is not defined.'); } $html = $this->open( $attributes ); // render close tag if( $this->hasChildren() ) { $html .= $this->renderChildren(); ...
php
public function render( $attributes = array() ) { if( ! $this->tagName ) { throw new Exception('tagName is not defined.'); } $html = $this->open( $attributes ); // render close tag if( $this->hasChildren() ) { $html .= $this->renderChildren(); ...
[ "public", "function", "render", "(", "$", "attributes", "=", "array", "(", ")", ")", "{", "if", "(", "!", "$", "this", "->", "tagName", ")", "{", "throw", "new", "Exception", "(", "'tagName is not defined.'", ")", ";", "}", "$", "html", "=", "$", "th...
Render the whole element. @param array $attributes attributes to override. @param string HTML
[ "Render", "the", "whole", "element", "." ]
c8963d494b8bd7d7f63928002057db86e5873c26
https://github.com/corneltek/FormKit/blob/c8963d494b8bd7d7f63928002057db86e5873c26/src/Element.php#L732-L747
222,839
rikbruil/Doctrine-Specification
spec/SpecificationRepositorySpec.php
SpecificationRepositorySpec.prepare
private function prepare( SpecificationInterface $specification, EntityManager $entityManager, QueryBuilder $queryBuilder, AbstractQuery $query ) { $entityManager->createQueryBuilder()->willReturn($queryBuilder); $specification->modify($queryBuilder, $this->dqlAlias)...
php
private function prepare( SpecificationInterface $specification, EntityManager $entityManager, QueryBuilder $queryBuilder, AbstractQuery $query ) { $entityManager->createQueryBuilder()->willReturn($queryBuilder); $specification->modify($queryBuilder, $this->dqlAlias)...
[ "private", "function", "prepare", "(", "SpecificationInterface", "$", "specification", ",", "EntityManager", "$", "entityManager", ",", "QueryBuilder", "$", "queryBuilder", ",", "AbstractQuery", "$", "query", ")", "{", "$", "entityManager", "->", "createQueryBuilder",...
Prepare mocks. @param SpecificationInterface $specification @param EntityManager $entityManager @param QueryBuilder $queryBuilder @param AbstractQuery $query
[ "Prepare", "mocks", "." ]
e61fb801c46107b0a9ce22086448557def7fa532
https://github.com/rikbruil/Doctrine-Specification/blob/e61fb801c46107b0a9ce22086448557def7fa532/spec/SpecificationRepositorySpec.php#L113-L130
222,840
teresko/palladium
src/Palladium/Service/Identification.php
Identification.checkCookieKey
private function checkCookieKey(Entity\CookieIdentity $identity, string $key) { if ($identity->matchKey($key) === true) { return; } $this->changeIdentityStatus($identity, Entity\Identity::STATUS_BLOCKED); $this->logger->warning('compromised cookie', $this->assembleCookie...
php
private function checkCookieKey(Entity\CookieIdentity $identity, string $key) { if ($identity->matchKey($key) === true) { return; } $this->changeIdentityStatus($identity, Entity\Identity::STATUS_BLOCKED); $this->logger->warning('compromised cookie', $this->assembleCookie...
[ "private", "function", "checkCookieKey", "(", "Entity", "\\", "CookieIdentity", "$", "identity", ",", "string", "$", "key", ")", "{", "if", "(", "$", "identity", "->", "matchKey", "(", "$", "key", ")", "===", "true", ")", "{", "return", ";", "}", "$", ...
Verify that the cookie based identity matches the key and, if verification is failed, disable this given identity @throws \Palladium\Exception\CompromisedCookie if key does not match
[ "Verify", "that", "the", "cookie", "based", "identity", "matches", "the", "key", "and", "if", "verification", "is", "failed", "disable", "this", "given", "identity" ]
0ebb6dc3c52946c7f6d9967701ea6196eb7f45a8
https://github.com/teresko/palladium/blob/0ebb6dc3c52946c7f6d9967701ea6196eb7f45a8/src/Palladium/Service/Identification.php#L182-L192
222,841
teresko/palladium
src/Palladium/Component/Collection.php
Collection.addBlueprint
public function addBlueprint(array $parameters) { $instance = $this->buildEntity(); $this->populateEntity($instance, $parameters); $this->addEntity($instance); return $instance; }
php
public function addBlueprint(array $parameters) { $instance = $this->buildEntity(); $this->populateEntity($instance, $parameters); $this->addEntity($instance); return $instance; }
[ "public", "function", "addBlueprint", "(", "array", "$", "parameters", ")", "{", "$", "instance", "=", "$", "this", "->", "buildEntity", "(", ")", ";", "$", "this", "->", "populateEntity", "(", "$", "instance", ",", "$", "parameters", ")", ";", "$", "t...
Add new domain entity, that is constructed using array as values. Each array key will be attempted top match with entity's setter method and provided with the respective array value. It returns the newly created entity. @param array $parameters @return HasId
[ "Add", "new", "domain", "entity", "that", "is", "constructed", "using", "array", "as", "values", ".", "Each", "array", "key", "will", "be", "attempted", "top", "match", "with", "entity", "s", "setter", "method", "and", "provided", "with", "the", "respective"...
0ebb6dc3c52946c7f6d9967701ea6196eb7f45a8
https://github.com/teresko/palladium/blob/0ebb6dc3c52946c7f6d9967701ea6196eb7f45a8/src/Palladium/Component/Collection.php#L41-L49
222,842
teresko/palladium
src/Palladium/Component/Collection.php
Collection.populateEntity
private function populateEntity($instance, array $parameters) { foreach ($parameters as $key => $value) { $method = 'set' . str_replace('_', '', $key); if (method_exists($instance, $method)) { $instance->{$method}($value); } } }
php
private function populateEntity($instance, array $parameters) { foreach ($parameters as $key => $value) { $method = 'set' . str_replace('_', '', $key); if (method_exists($instance, $method)) { $instance->{$method}($value); } } }
[ "private", "function", "populateEntity", "(", "$", "instance", ",", "array", "$", "parameters", ")", "{", "foreach", "(", "$", "parameters", "as", "$", "key", "=>", "$", "value", ")", "{", "$", "method", "=", "'set'", ".", "str_replace", "(", "'_'", ",...
code that does the actual population of data from the given array in blueprint
[ "code", "that", "does", "the", "actual", "population", "of", "data", "from", "the", "given", "array", "in", "blueprint" ]
0ebb6dc3c52946c7f6d9967701ea6196eb7f45a8
https://github.com/teresko/palladium/blob/0ebb6dc3c52946c7f6d9967701ea6196eb7f45a8/src/Palladium/Component/Collection.php#L53-L61
222,843
teresko/palladium
src/Palladium/Component/Collection.php
Collection.addEntity
public function addEntity(HasId $entity, $key = null) { if (is_null($key) === false) { $this->replaceEntity($entity, $key); return; } $entityId = $entity->getId(); $this->pool[] = $entity; $this->indexed[$entityId] = $entity; $this->map[$en...
php
public function addEntity(HasId $entity, $key = null) { if (is_null($key) === false) { $this->replaceEntity($entity, $key); return; } $entityId = $entity->getId(); $this->pool[] = $entity; $this->indexed[$entityId] = $entity; $this->map[$en...
[ "public", "function", "addEntity", "(", "HasId", "$", "entity", ",", "$", "key", "=", "null", ")", "{", "if", "(", "is_null", "(", "$", "key", ")", "===", "false", ")", "{", "$", "this", "->", "replaceEntity", "(", "$", "entity", ",", "$", "key", ...
Method for adding already existing domain entity to the collection. @param HasId $entity
[ "Method", "for", "adding", "already", "existing", "domain", "entity", "to", "the", "collection", "." ]
0ebb6dc3c52946c7f6d9967701ea6196eb7f45a8
https://github.com/teresko/palladium/blob/0ebb6dc3c52946c7f6d9967701ea6196eb7f45a8/src/Palladium/Component/Collection.php#L69-L83
222,844
teresko/palladium
src/Palladium/Component/Collection.php
Collection.replaceWith
public function replaceWith(Collection $replacement) { $this->pool = []; $this->map = []; $this->indexed = []; foreach ($replacement as $entity) { $this->addEntity($entity); } }
php
public function replaceWith(Collection $replacement) { $this->pool = []; $this->map = []; $this->indexed = []; foreach ($replacement as $entity) { $this->addEntity($entity); } }
[ "public", "function", "replaceWith", "(", "Collection", "$", "replacement", ")", "{", "$", "this", "->", "pool", "=", "[", "]", ";", "$", "this", "->", "map", "=", "[", "]", ";", "$", "this", "->", "indexed", "=", "[", "]", ";", "foreach", "(", "...
Replaces all of the domain entities with a content of some other collection @param Collection $replacement
[ "Replaces", "all", "of", "the", "domain", "entities", "with", "a", "content", "of", "some", "other", "collection" ]
0ebb6dc3c52946c7f6d9967701ea6196eb7f45a8
https://github.com/teresko/palladium/blob/0ebb6dc3c52946c7f6d9967701ea6196eb7f45a8/src/Palladium/Component/Collection.php#L140-L149
222,845
teresko/palladium
src/Palladium/Component/Collection.php
Collection.removeEntity
public function removeEntity(HasId $entity) { $key = $entity->getId(); if ($key !== null) { unset($this->pool[$this->map[$key]]); $this->removeIndexEntry($key); } }
php
public function removeEntity(HasId $entity) { $key = $entity->getId(); if ($key !== null) { unset($this->pool[$this->map[$key]]); $this->removeIndexEntry($key); } }
[ "public", "function", "removeEntity", "(", "HasId", "$", "entity", ")", "{", "$", "key", "=", "$", "entity", "->", "getId", "(", ")", ";", "if", "(", "$", "key", "!==", "null", ")", "{", "unset", "(", "$", "this", "->", "pool", "[", "$", "this", ...
Removes an entity from collection. @param HasId $entity
[ "Removes", "an", "entity", "from", "collection", "." ]
0ebb6dc3c52946c7f6d9967701ea6196eb7f45a8
https://github.com/teresko/palladium/blob/0ebb6dc3c52946c7f6d9967701ea6196eb7f45a8/src/Palladium/Component/Collection.php#L157-L165
222,846
sgpatil/oriquent
src/Sgpatil/Orientdb/Eloquent/Relations/HasOneOrMany.php
HasOneOrMany.saveMany
public function saveMany($models) { // We will collect the edges returned by save() in an Eloquent Database Collection // and return them when done. $edges = new Collection; foreach ($models as $model) { $edges->push($this->save($model, $properties)); } retu...
php
public function saveMany($models) { // We will collect the edges returned by save() in an Eloquent Database Collection // and return them when done. $edges = new Collection; foreach ($models as $model) { $edges->push($this->save($model, $properties)); } retu...
[ "public", "function", "saveMany", "(", "$", "models", ")", "{", "// We will collect the edges returned by save() in an Eloquent Database Collection", "// and return them when done.", "$", "edges", "=", "new", "Collection", ";", "foreach", "(", "$", "models", "as", "$", "m...
Attach an array of models to the parent instance. @param array $models @param arra $properties The relationship properties @return array
[ "Attach", "an", "array", "of", "models", "to", "the", "parent", "instance", "." ]
cf0f2ba688496260946f569a20c351e91f287c32
https://github.com/sgpatil/oriquent/blob/cf0f2ba688496260946f569a20c351e91f287c32/src/Sgpatil/Orientdb/Eloquent/Relations/HasOneOrMany.php#L199-L209
222,847
silverstripe/silverstripe-registry
src/RegistryPageController.php
RegistryPageController.QueryLink
public function QueryLink() { $vars = $this->queryVars(); unset($vars['Sort']); unset($vars['Dir']); return Convert::raw2xml($this->Link('RegistryFilterForm') . '?' . http_build_query($vars)); }
php
public function QueryLink() { $vars = $this->queryVars(); unset($vars['Sort']); unset($vars['Dir']); return Convert::raw2xml($this->Link('RegistryFilterForm') . '?' . http_build_query($vars)); }
[ "public", "function", "QueryLink", "(", ")", "{", "$", "vars", "=", "$", "this", "->", "queryVars", "(", ")", ";", "unset", "(", "$", "vars", "[", "'Sort'", "]", ")", ";", "unset", "(", "$", "vars", "[", "'Dir'", "]", ")", ";", "return", "Convert...
Get all search query vars except Sort and Dir, compiled into a query link. This will escape all the variables to avoid XSS. @return string
[ "Get", "all", "search", "query", "vars", "except", "Sort", "and", "Dir", "compiled", "into", "a", "query", "link", ".", "This", "will", "escape", "all", "the", "variables", "to", "avoid", "XSS", "." ]
36f97a5eda09132c82a4ef6b858f6fed14bfd368
https://github.com/silverstripe/silverstripe-registry/blob/36f97a5eda09132c82a4ef6b858f6fed14bfd368/src/RegistryPageController.php#L55-L62
222,848
silverstripe/silverstripe-registry
src/RegistryPageController.php
RegistryPageController.OppositeDirection
public function OppositeDirection() { // If direction is set, then just reverse it. $direction = $this->request->getVar('Dir'); if ($direction) { if ($direction == 'ASC') { return 'DESC'; } return 'ASC'; } // If the sort co...
php
public function OppositeDirection() { // If direction is set, then just reverse it. $direction = $this->request->getVar('Dir'); if ($direction) { if ($direction == 'ASC') { return 'DESC'; } return 'ASC'; } // If the sort co...
[ "public", "function", "OppositeDirection", "(", ")", "{", "// If direction is set, then just reverse it.", "$", "direction", "=", "$", "this", "->", "request", "->", "getVar", "(", "'Dir'", ")", ";", "if", "(", "$", "direction", ")", "{", "if", "(", "$", "di...
Return the opposite direction from the currently sorted column's direction. @return string
[ "Return", "the", "opposite", "direction", "from", "the", "currently", "sorted", "column", "s", "direction", "." ]
36f97a5eda09132c82a4ef6b858f6fed14bfd368
https://github.com/silverstripe/silverstripe-registry/blob/36f97a5eda09132c82a4ef6b858f6fed14bfd368/src/RegistryPageController.php#L73-L91
222,849
silverstripe/silverstripe-registry
src/RegistryPageController.php
RegistryPageController.canSortBy
public function canSortBy($property) { $canSort = false; $singleton = $this->dataRecord->getDataSingleton(); if ($singleton) { $properties = explode('.', $property); $relationClass = $singleton->getRelationClass($properties[0]); if ($relationClass) { ...
php
public function canSortBy($property) { $canSort = false; $singleton = $this->dataRecord->getDataSingleton(); if ($singleton) { $properties = explode('.', $property); $relationClass = $singleton->getRelationClass($properties[0]); if ($relationClass) { ...
[ "public", "function", "canSortBy", "(", "$", "property", ")", "{", "$", "canSort", "=", "false", ";", "$", "singleton", "=", "$", "this", "->", "dataRecord", "->", "getDataSingleton", "(", ")", ";", "if", "(", "$", "singleton", ")", "{", "$", "properti...
Loosely check if the record can be sorted by a property @param string $property @return boolean
[ "Loosely", "check", "if", "the", "record", "can", "be", "sorted", "by", "a", "property" ]
36f97a5eda09132c82a4ef6b858f6fed14bfd368
https://github.com/silverstripe/silverstripe-registry/blob/36f97a5eda09132c82a4ef6b858f6fed14bfd368/src/RegistryPageController.php#L179-L200
222,850
silverstripe/silverstripe-registry
src/RegistryPageController.php
RegistryPageController.Columns
public function Columns($id = null) { $singleton = $this->dataRecord->getDataSingleton(); $columns = $singleton->summaryFields(); $list = ArrayList::create(); $result = null; if ($id) { $result = $this->queryList()->byId($id); } foreach...
php
public function Columns($id = null) { $singleton = $this->dataRecord->getDataSingleton(); $columns = $singleton->summaryFields(); $list = ArrayList::create(); $result = null; if ($id) { $result = $this->queryList()->byId($id); } foreach...
[ "public", "function", "Columns", "(", "$", "id", "=", "null", ")", "{", "$", "singleton", "=", "$", "this", "->", "dataRecord", "->", "getDataSingleton", "(", ")", ";", "$", "columns", "=", "$", "singleton", "->", "summaryFields", "(", ")", ";", "$", ...
Format a set of columns, used for headings and row data @param int $id The result ID to reference @return ArrayList
[ "Format", "a", "set", "of", "columns", "used", "for", "headings", "and", "row", "data" ]
36f97a5eda09132c82a4ef6b858f6fed14bfd368
https://github.com/silverstripe/silverstripe-registry/blob/36f97a5eda09132c82a4ef6b858f6fed14bfd368/src/RegistryPageController.php#L207-L257
222,851
silverstripe/silverstripe-registry
src/RegistryPageController.php
RegistryPageController.export
public function export($request) { $dataClass = $this->dataRecord->getDataClass(); $resultColumns = $this->dataRecord->getDataSingleton()->fieldLabels(); // Used for the browser, not stored on the server $filepath = sprintf('export-%s.csv', date('Y-m-dHis')); // Allocates u...
php
public function export($request) { $dataClass = $this->dataRecord->getDataClass(); $resultColumns = $this->dataRecord->getDataSingleton()->fieldLabels(); // Used for the browser, not stored on the server $filepath = sprintf('export-%s.csv', date('Y-m-dHis')); // Allocates u...
[ "public", "function", "export", "(", "$", "request", ")", "{", "$", "dataClass", "=", "$", "this", "->", "dataRecord", "->", "getDataClass", "(", ")", ";", "$", "resultColumns", "=", "$", "this", "->", "dataRecord", "->", "getDataSingleton", "(", ")", "-...
Exports out all the data for the current search results. Sends the data to the browser as a CSV file.
[ "Exports", "out", "all", "the", "data", "for", "the", "current", "search", "results", ".", "Sends", "the", "data", "to", "the", "browser", "as", "a", "CSV", "file", "." ]
36f97a5eda09132c82a4ef6b858f6fed14bfd368
https://github.com/silverstripe/silverstripe-registry/blob/36f97a5eda09132c82a4ef6b858f6fed14bfd368/src/RegistryPageController.php#L263-L313
222,852
silverstripe/silverstripe-registry
src/RegistryPageController.php
RegistryPageController.queryList
protected function queryList() { // Sanity check $dataClass = $this->dataRecord->getDataClass(); if (!$dataClass) { return ArrayList::create(); } // Setup $singleton = $this->dataRecord->getDataSingleton(); // Create list $list = $singlet...
php
protected function queryList() { // Sanity check $dataClass = $this->dataRecord->getDataClass(); if (!$dataClass) { return ArrayList::create(); } // Setup $singleton = $this->dataRecord->getDataSingleton(); // Create list $list = $singlet...
[ "protected", "function", "queryList", "(", ")", "{", "// Sanity check", "$", "dataClass", "=", "$", "this", "->", "dataRecord", "->", "getDataClass", "(", ")", ";", "if", "(", "!", "$", "dataClass", ")", "{", "return", "ArrayList", "::", "create", "(", "...
Perform a search against the data table. @return SS_List
[ "Perform", "a", "search", "against", "the", "data", "table", "." ]
36f97a5eda09132c82a4ef6b858f6fed14bfd368
https://github.com/silverstripe/silverstripe-registry/blob/36f97a5eda09132c82a4ef6b858f6fed14bfd368/src/RegistryPageController.php#L337-L376
222,853
silverstripe/silverstripe-registry
src/RegistryPageController.php
RegistryPageController.queryVars
protected function queryVars() { $resultColumns = $this->dataRecord->getDataSingleton()->getSearchFields(); $columns = []; foreach ($resultColumns as $field) { $columns[$field->getName()] = ''; } $arr = array_merge( $columns, [ ...
php
protected function queryVars() { $resultColumns = $this->dataRecord->getDataSingleton()->getSearchFields(); $columns = []; foreach ($resultColumns as $field) { $columns[$field->getName()] = ''; } $arr = array_merge( $columns, [ ...
[ "protected", "function", "queryVars", "(", ")", "{", "$", "resultColumns", "=", "$", "this", "->", "dataRecord", "->", "getDataSingleton", "(", ")", "->", "getSearchFields", "(", ")", ";", "$", "columns", "=", "[", "]", ";", "foreach", "(", "$", "resultC...
Compiles all available GET variables for the result columns into an array. Used internally, not to be used directly with the templates or outside classes. This will NOT escape values to avoid XSS. @return array
[ "Compiles", "all", "available", "GET", "variables", "for", "the", "result", "columns", "into", "an", "array", ".", "Used", "internally", "not", "to", "be", "used", "directly", "with", "the", "templates", "or", "outside", "classes", "." ]
36f97a5eda09132c82a4ef6b858f6fed14bfd368
https://github.com/silverstripe/silverstripe-registry/blob/36f97a5eda09132c82a4ef6b858f6fed14bfd368/src/RegistryPageController.php#L423-L447
222,854
sgpatil/oriquent
src/Sgpatil/Orientdb/Eloquent/Model.php
Model.getDefaultNodeLabel
public function getDefaultNodeLabel() { // by default we take the $label, otherwise we consider $table // for Eloquent's backward compatibility $label = (empty($this->label)) ? $this->table : $this->label; // The label is accepted as an array for a convenience so we need to ...
php
public function getDefaultNodeLabel() { // by default we take the $label, otherwise we consider $table // for Eloquent's backward compatibility $label = (empty($this->label)) ? $this->table : $this->label; // The label is accepted as an array for a convenience so we need to ...
[ "public", "function", "getDefaultNodeLabel", "(", ")", "{", "// by default we take the $label, otherwise we consider $table", "// for Eloquent's backward compatibility", "$", "label", "=", "(", "empty", "(", "$", "this", "->", "label", ")", ")", "?", "$", "this", "->", ...
Get the node labels @return array
[ "Get", "the", "node", "labels" ]
cf0f2ba688496260946f569a20c351e91f287c32
https://github.com/sgpatil/oriquent/blob/cf0f2ba688496260946f569a20c351e91f287c32/src/Sgpatil/Orientdb/Eloquent/Model.php#L92-L119
222,855
silverstripe/silverstripe-registry
src/RegistryAdmin.php
RegistryAdmin.canView
public function canView($member = null) { $managedModels = $this->getManagedModels(); if (count($managedModels) == 0) { return false; } return parent::canView($member); }
php
public function canView($member = null) { $managedModels = $this->getManagedModels(); if (count($managedModels) == 0) { return false; } return parent::canView($member); }
[ "public", "function", "canView", "(", "$", "member", "=", "null", ")", "{", "$", "managedModels", "=", "$", "this", "->", "getManagedModels", "(", ")", ";", "if", "(", "count", "(", "$", "managedModels", ")", "==", "0", ")", "{", "return", "false", "...
Hide the registry section completely if we have no registries to manage. {@inheritDoc}
[ "Hide", "the", "registry", "section", "completely", "if", "we", "have", "no", "registries", "to", "manage", "." ]
36f97a5eda09132c82a4ef6b858f6fed14bfd368
https://github.com/silverstripe/silverstripe-registry/blob/36f97a5eda09132c82a4ef6b858f6fed14bfd368/src/RegistryAdmin.php#L20-L28
222,856
silverstripe/silverstripe-registry
src/RegistryAdmin.php
RegistryAdmin.getCsvImportFilename
public function getCsvImportFilename() { $feed = RegistryImportFeed::singleton(); return sprintf('%s/%s', $feed->getStoragePath($this->modelClass), $feed->getImportFilename()); }
php
public function getCsvImportFilename() { $feed = RegistryImportFeed::singleton(); return sprintf('%s/%s', $feed->getStoragePath($this->modelClass), $feed->getImportFilename()); }
[ "public", "function", "getCsvImportFilename", "(", ")", "{", "$", "feed", "=", "RegistryImportFeed", "::", "singleton", "(", ")", ";", "return", "sprintf", "(", "'%s/%s'", ",", "$", "feed", "->", "getStoragePath", "(", "$", "this", "->", "modelClass", ")", ...
Gets a unique filename to use for importing the uploaded CSV data @return string
[ "Gets", "a", "unique", "filename", "to", "use", "for", "importing", "the", "uploaded", "CSV", "data" ]
36f97a5eda09132c82a4ef6b858f6fed14bfd368
https://github.com/silverstripe/silverstripe-registry/blob/36f97a5eda09132c82a4ef6b858f6fed14bfd368/src/RegistryAdmin.php#L58-L63
222,857
php-kit/ext-pdo
src/ExtPDO.php
ExtPDO.create
static public function create ($driver, array $settings, array $optionsOverride = null) { switch ($driver) { case 'mysql': return new MysqlExtPDO ($settings, $optionsOverride); case 'pgsql': return new PostgreSqlExtPDO ($settings, $optionsOverride); case 'sqlite': return ...
php
static public function create ($driver, array $settings, array $optionsOverride = null) { switch ($driver) { case 'mysql': return new MysqlExtPDO ($settings, $optionsOverride); case 'pgsql': return new PostgreSqlExtPDO ($settings, $optionsOverride); case 'sqlite': return ...
[ "static", "public", "function", "create", "(", "$", "driver", ",", "array", "$", "settings", ",", "array", "$", "optionsOverride", "=", "null", ")", "{", "switch", "(", "$", "driver", ")", "{", "case", "'mysql'", ":", "return", "new", "MysqlExtPDO", "(",...
Creates an instance of an ExtPDO subclass that matches the given driver name. @param string $driver One of: mysql | pgsql | sqlite | sqlsrv @param array $settings A configuration array that may have the following keys (depending on the driver):<p> <table cellspacing=0 cellpadding=0> <tr><kbd>d...
[ "Creates", "an", "instance", "of", "an", "ExtPDO", "subclass", "that", "matches", "the", "given", "driver", "name", "." ]
b94bf1805b75ba114e4a216dbca441ca7dc893be
https://github.com/php-kit/ext-pdo/blob/b94bf1805b75ba114e4a216dbca441ca7dc893be/src/ExtPDO.php#L35-L48
222,858
teresko/palladium
src/Palladium/Component/MapperFactory.php
MapperFactory.create
public function create(string $className) { if (array_key_exists($className, $this->cache)) { return $this->cache[$className]; } if (!class_exists($className)) { throw new RuntimeException("Mapper not found. Attempted to load '{$className}'."); } $in...
php
public function create(string $className) { if (array_key_exists($className, $this->cache)) { return $this->cache[$className]; } if (!class_exists($className)) { throw new RuntimeException("Mapper not found. Attempted to load '{$className}'."); } $in...
[ "public", "function", "create", "(", "string", "$", "className", ")", "{", "if", "(", "array_key_exists", "(", "$", "className", ",", "$", "this", "->", "cache", ")", ")", "{", "return", "$", "this", "->", "cache", "[", "$", "className", "]", ";", "}...
Method for retrieving an SQL data mapper instance @param string $className Fully qualified class name of the mapper @throws RuntimeException if mapper's class can't be found @return DataMapper
[ "Method", "for", "retrieving", "an", "SQL", "data", "mapper", "instance" ]
0ebb6dc3c52946c7f6d9967701ea6196eb7f45a8
https://github.com/teresko/palladium/blob/0ebb6dc3c52946c7f6d9967701ea6196eb7f45a8/src/Palladium/Component/MapperFactory.php#L39-L53
222,859
jstewmc/php-helpers
src/Str.php
Str.rand
public static function rand($length, $charsets = array('alpha', 'number', 'symbol')) { $rand = ''; // if $length and $charsets are given if ($length !== null && $charsets !== null) { // if $length is an integer if (is_numeric($length) && is_int(+$length)) { // if $charsets is a string or arr...
php
public static function rand($length, $charsets = array('alpha', 'number', 'symbol')) { $rand = ''; // if $length and $charsets are given if ($length !== null && $charsets !== null) { // if $length is an integer if (is_numeric($length) && is_int(+$length)) { // if $charsets is a string or arr...
[ "public", "static", "function", "rand", "(", "$", "length", ",", "$", "charsets", "=", "array", "(", "'alpha'", ",", "'number'", ",", "'symbol'", ")", ")", "{", "$", "rand", "=", "''", ";", "// if $length and $charsets are given\r", "if", "(", "$", "length...
Returns a random string For example: echo Str::rand(8, 'alpha'); // example 'hbdrckso' echo Str::rand(8, ['lower', 'number']); // example 'k987hb54' echo Str::rand(8, ['upper', 'symbol']); // example 'HG!V*X]@' @since 0.1.0 @param int $length the length of the string to return @param mixed ...
[ "Returns", "a", "random", "string" ]
b019194778683035ecd5ad177f5d6d4ee3705aed
https://github.com/jstewmc/php-helpers/blob/b019194778683035ecd5ad177f5d6d4ee3705aed/src/Str.php#L340-L403
222,860
jstewmc/php-helpers
src/Str.php
Str.splitOnFirstAlpha
public static function splitOnFirstAlpha($string) { $pieces = array(); // if $string is not null if ($string !== null) { // if $string is actually a string if (is_string($string)) { // if the trimmed string isn't empty $string = trim($string); if ($string !== '') { $pieces = ...
php
public static function splitOnFirstAlpha($string) { $pieces = array(); // if $string is not null if ($string !== null) { // if $string is actually a string if (is_string($string)) { // if the trimmed string isn't empty $string = trim($string); if ($string !== '') { $pieces = ...
[ "public", "static", "function", "splitOnFirstAlpha", "(", "$", "string", ")", "{", "$", "pieces", "=", "array", "(", ")", ";", "// if $string is not null\r", "if", "(", "$", "string", "!==", "null", ")", "{", "// if $string is actually a string\r", "if", "(", ...
Splits a string on the first alpha character I'll return an array with two parts. The first element is the string part before the first alpha character, and the second part is everything after and including the first alpha character. For example: Str::splitOnFirstAlpha("123"); // returns ["123"] Str::splitOnF...
[ "Splits", "a", "string", "on", "the", "first", "alpha", "character" ]
b019194778683035ecd5ad177f5d6d4ee3705aed
https://github.com/jstewmc/php-helpers/blob/b019194778683035ecd5ad177f5d6d4ee3705aed/src/Str.php#L432-L459
222,861
jstewmc/php-helpers
src/Str.php
Str.strtobytes
public static function strtobytes($string) { $val = false; // if $string is given if ($string !== null) { // if $string is actually a string if (is_string($string)) { // get the string's last character $val = trim($string); $last = strtolower($val[strlen($val) - 1]); swit...
php
public static function strtobytes($string) { $val = false; // if $string is given if ($string !== null) { // if $string is actually a string if (is_string($string)) { // get the string's last character $val = trim($string); $last = strtolower($val[strlen($val) - 1]); swit...
[ "public", "static", "function", "strtobytes", "(", "$", "string", ")", "{", "$", "val", "=", "false", ";", "// if $string is given\r", "if", "(", "$", "string", "!==", "null", ")", "{", "// if $string is actually a string\r", "if", "(", "is_string", "(", "$", ...
Converts a php.ini-like byte notation shorthand to a number of bytes In the php.ini configuration file, byte values are sote in shorthand notation (e.g., "8M"). PHP's native ini_get() function will return the exact string stored in php.ini and not its integer equivalent. I will return the integer equivalent. For exam...
[ "Converts", "a", "php", ".", "ini", "-", "like", "byte", "notation", "shorthand", "to", "a", "number", "of", "bytes" ]
b019194778683035ecd5ad177f5d6d4ee3705aed
https://github.com/jstewmc/php-helpers/blob/b019194778683035ecd5ad177f5d6d4ee3705aed/src/Str.php#L553-L596
222,862
jstewmc/php-helpers
src/Str.php
Str.strtocamelcase
public static function strtocamelcase($string) { // if $string is given if ($string !== null) { // if $string is actually a string if (is_string($string)) { // if $string is not empty if (strlen($string)) { // trim the string $string = trim($string); // replace undersc...
php
public static function strtocamelcase($string) { // if $string is given if ($string !== null) { // if $string is actually a string if (is_string($string)) { // if $string is not empty if (strlen($string)) { // trim the string $string = trim($string); // replace undersc...
[ "public", "static", "function", "strtocamelcase", "(", "$", "string", ")", "{", "// if $string is given\r", "if", "(", "$", "string", "!==", "null", ")", "{", "// if $string is actually a string\r", "if", "(", "is_string", "(", "$", "string", ")", ")", "{", "/...
Returns a string in camel case For example: Str::strtocamelcase('Hello world'); // returns "helloWorld" Str::strtocamelcase('H3LLO WORLD!'); // returns "helloWorld" Str::strtocamelcase('hello_world'); // returns "helloWorld" @since 0.1.0 @param string $string the string to camel-case @return string the ...
[ "Returns", "a", "string", "in", "camel", "case" ]
b019194778683035ecd5ad177f5d6d4ee3705aed
https://github.com/jstewmc/php-helpers/blob/b019194778683035ecd5ad177f5d6d4ee3705aed/src/Str.php#L616-L657
222,863
sastrawi/sentence-detector
src/Sastrawi/SentenceDetector/Util/StringUtil.php
StringUtil.getNextWhitespace
public static function getNextWhitespace($string, $start = -1) { while ($start < (strlen($string) - 1) && !self::isWhitespace($string[$start + 1])) { $start++; } if ($start === (strlen($string) - 1)) { return false; } $start++; return $start...
php
public static function getNextWhitespace($string, $start = -1) { while ($start < (strlen($string) - 1) && !self::isWhitespace($string[$start + 1])) { $start++; } if ($start === (strlen($string) - 1)) { return false; } $start++; return $start...
[ "public", "static", "function", "getNextWhitespace", "(", "$", "string", ",", "$", "start", "=", "-", "1", ")", "{", "while", "(", "$", "start", "<", "(", "strlen", "(", "$", "string", ")", "-", "1", ")", "&&", "!", "self", "::", "isWhitespace", "(...
Get next first whitespace character. @param string $string Text to search whitespace character @param int $start Position index to start from @return false|int Return the position of next first whitespace character. False if not found.
[ "Get", "next", "first", "whitespace", "character", "." ]
a7741aea1b78afa0c77e4af1cf36c0eee05dab6f
https://github.com/sastrawi/sentence-detector/blob/a7741aea1b78afa0c77e4af1cf36c0eee05dab6f/src/Sastrawi/SentenceDetector/Util/StringUtil.php#L40-L53
222,864
sastrawi/sentence-detector
src/Sastrawi/SentenceDetector/Util/StringUtil.php
StringUtil.getPrevWhitespace
public static function getPrevWhitespace($string, $start = null) { $start = ($start !== null) ? $start : strlen($string); while ($start > 0 && !self::isWhitespace($string[$start - 1])) { $start--; } if ($start === 0) { return false; } $start...
php
public static function getPrevWhitespace($string, $start = null) { $start = ($start !== null) ? $start : strlen($string); while ($start > 0 && !self::isWhitespace($string[$start - 1])) { $start--; } if ($start === 0) { return false; } $start...
[ "public", "static", "function", "getPrevWhitespace", "(", "$", "string", ",", "$", "start", "=", "null", ")", "{", "$", "start", "=", "(", "$", "start", "!==", "null", ")", "?", "$", "start", ":", "strlen", "(", "$", "string", ")", ";", "while", "(...
Get previous first whitespace character. @param string $string Text to search whitespace character @param int $start Position index to start from @return false|int Return the position of previous first whitespace character. False if not found.
[ "Get", "previous", "first", "whitespace", "character", "." ]
a7741aea1b78afa0c77e4af1cf36c0eee05dab6f
https://github.com/sastrawi/sentence-detector/blob/a7741aea1b78afa0c77e4af1cf36c0eee05dab6f/src/Sastrawi/SentenceDetector/Util/StringUtil.php#L62-L77
222,865
sastrawi/sentence-detector
src/Sastrawi/SentenceDetector/Util/StringUtil.php
StringUtil.getNextNonWhitespace
public static function getNextNonWhitespace($string, $start = -1) { while ($start < (strlen($string) - 1) && self::isWhitespace($string[$start + 1])) { $start++; } if ($start === (strlen($string) - 1)) { return false; } $start++; return $sta...
php
public static function getNextNonWhitespace($string, $start = -1) { while ($start < (strlen($string) - 1) && self::isWhitespace($string[$start + 1])) { $start++; } if ($start === (strlen($string) - 1)) { return false; } $start++; return $sta...
[ "public", "static", "function", "getNextNonWhitespace", "(", "$", "string", ",", "$", "start", "=", "-", "1", ")", "{", "while", "(", "$", "start", "<", "(", "strlen", "(", "$", "string", ")", "-", "1", ")", "&&", "self", "::", "isWhitespace", "(", ...
Get next first non whitespace character. @param string $string Text to search non whitespace character @param int $start Position index to start from @return false|int Return the position of next first non whitespace character. False if not found.
[ "Get", "next", "first", "non", "whitespace", "character", "." ]
a7741aea1b78afa0c77e4af1cf36c0eee05dab6f
https://github.com/sastrawi/sentence-detector/blob/a7741aea1b78afa0c77e4af1cf36c0eee05dab6f/src/Sastrawi/SentenceDetector/Util/StringUtil.php#L86-L99
222,866
sastrawi/sentence-detector
src/Sastrawi/SentenceDetector/Util/StringUtil.php
StringUtil.getPrevNonWhitespace
public static function getPrevNonWhitespace($string, $start = null) { $start = ($start !== null) ? $start : strlen($string); while ($start > 0 && self::isWhitespace($string[$start - 1])) { $start--; } if ($start === 0) { return false; } $sta...
php
public static function getPrevNonWhitespace($string, $start = null) { $start = ($start !== null) ? $start : strlen($string); while ($start > 0 && self::isWhitespace($string[$start - 1])) { $start--; } if ($start === 0) { return false; } $sta...
[ "public", "static", "function", "getPrevNonWhitespace", "(", "$", "string", ",", "$", "start", "=", "null", ")", "{", "$", "start", "=", "(", "$", "start", "!==", "null", ")", "?", "$", "start", ":", "strlen", "(", "$", "string", ")", ";", "while", ...
Get previous first non whitespace character. @param string $string Text to search non whitespace character @param int $start Position index to start from @return false|int Return the position of previous first non whitespace character. False if not found.
[ "Get", "previous", "first", "non", "whitespace", "character", "." ]
a7741aea1b78afa0c77e4af1cf36c0eee05dab6f
https://github.com/sastrawi/sentence-detector/blob/a7741aea1b78afa0c77e4af1cf36c0eee05dab6f/src/Sastrawi/SentenceDetector/Util/StringUtil.php#L108-L123
222,867
fage1151/swoole-worker
Lib/Timer.php
Timer.delAll
public static function delAll() { if (count(self::$_tasks) > 0) { foreach (self::$_tasks as $k => $v) { swoole_timer_clear($k); } self::$_tasks = array(); } }
php
public static function delAll() { if (count(self::$_tasks) > 0) { foreach (self::$_tasks as $k => $v) { swoole_timer_clear($k); } self::$_tasks = array(); } }
[ "public", "static", "function", "delAll", "(", ")", "{", "if", "(", "count", "(", "self", "::", "$", "_tasks", ")", ">", "0", ")", "{", "foreach", "(", "self", "::", "$", "_tasks", "as", "$", "k", "=>", "$", "v", ")", "{", "swoole_timer_clear", "...
Remove all timers. @return void
[ "Remove", "all", "timers", "." ]
ade6e29ffb400129380d56e9a2e6656f19dceb17
https://github.com/fage1151/swoole-worker/blob/ade6e29ffb400129380d56e9a2e6656f19dceb17/Lib/Timer.php#L114-L122
222,868
sgpatil/oriquent
src/Sgpatil/Orientdb/Query/Builder.php
Builder.createWith
public function createWith(array $model, array $related) { $cypher = $this->grammar->compileCreateWith($this, compact('model', 'related')); // Indicate that we need the result returned as is. $result = true; return $this->connection->statement($cypher, [], $result); }
php
public function createWith(array $model, array $related) { $cypher = $this->grammar->compileCreateWith($this, compact('model', 'related')); // Indicate that we need the result returned as is. $result = true; return $this->connection->statement($cypher, [], $result); }
[ "public", "function", "createWith", "(", "array", "$", "model", ",", "array", "$", "related", ")", "{", "$", "cypher", "=", "$", "this", "->", "grammar", "->", "compileCreateWith", "(", "$", "this", ",", "compact", "(", "'model'", ",", "'related'", ")", ...
Create a new node with related nodes with one database hit. @param array $model @param array $related @return \Sgpatil\Orientdb\Eloquent\Model
[ "Create", "a", "new", "node", "with", "related", "nodes", "with", "one", "database", "hit", "." ]
cf0f2ba688496260946f569a20c351e91f287c32
https://github.com/sgpatil/oriquent/blob/cf0f2ba688496260946f569a20c351e91f287c32/src/Sgpatil/Orientdb/Query/Builder.php#L365-L371
222,869
digiaonline/lumen-dynamodb
src/Console/DynamoDbCommand.php
DynamoDbCommand.tableExists
protected function tableExists($tableName) { $found = false; $iterator = $this->dynamoDb->getClient()->getIterator('ListTables'); foreach ($iterator as $table) { if ($table === $tableName) { $found = true; } } return $foun...
php
protected function tableExists($tableName) { $found = false; $iterator = $this->dynamoDb->getClient()->getIterator('ListTables'); foreach ($iterator as $table) { if ($table === $tableName) { $found = true; } } return $foun...
[ "protected", "function", "tableExists", "(", "$", "tableName", ")", "{", "$", "found", "=", "false", ";", "$", "iterator", "=", "$", "this", "->", "dynamoDb", "->", "getClient", "(", ")", "->", "getIterator", "(", "'ListTables'", ")", ";", "foreach", "("...
Checks if the given table exists. @param string $tableName The table name to check. @return bool True if the table exists, false otherwise.
[ "Checks", "if", "the", "given", "table", "exists", "." ]
d29edefbe461af0bc902037e397cc8586a2ec87c
https://github.com/digiaonline/lumen-dynamodb/blob/d29edefbe461af0bc902037e397cc8586a2ec87c/src/Console/DynamoDbCommand.php#L50-L61
222,870
rikbruil/Doctrine-Specification
src/SpecificationRepositoryTrait.php
SpecificationRepositoryTrait.modifyQueryBuilder
private function modifyQueryBuilder(QueryBuilder $queryBuilder, SpecificationInterface $specification) { $condition = $specification->modify($queryBuilder, $this->dqlAlias); if (empty($condition)) { return; } $queryBuilder->where($condition); }
php
private function modifyQueryBuilder(QueryBuilder $queryBuilder, SpecificationInterface $specification) { $condition = $specification->modify($queryBuilder, $this->dqlAlias); if (empty($condition)) { return; } $queryBuilder->where($condition); }
[ "private", "function", "modifyQueryBuilder", "(", "QueryBuilder", "$", "queryBuilder", ",", "SpecificationInterface", "$", "specification", ")", "{", "$", "condition", "=", "$", "specification", "->", "modify", "(", "$", "queryBuilder", ",", "$", "this", "->", "...
Modifies the QueryBuilder according to the passed Specification. Will also set the condition for this query if needed. @param QueryBuilder $queryBuilder @param SpecificationInterface $specification @internal param string $dqlAlias
[ "Modifies", "the", "QueryBuilder", "according", "to", "the", "passed", "Specification", ".", "Will", "also", "set", "the", "condition", "for", "this", "query", "if", "needed", "." ]
e61fb801c46107b0a9ce22086448557def7fa532
https://github.com/rikbruil/Doctrine-Specification/blob/e61fb801c46107b0a9ce22086448557def7fa532/src/SpecificationRepositoryTrait.php#L54-L63
222,871
corneltek/FormKit
src/Element/Table.php
Table.addRow
public function addRow($rows = null) { if( ! is_array($rows) ) { $rows = func_get_args(); } $row = new TableRow; foreach( $rows as $arg ) { $cell = new TableCell; $cell->addChild( $arg ); $row->addChild( $cell ); } $this->ad...
php
public function addRow($rows = null) { if( ! is_array($rows) ) { $rows = func_get_args(); } $row = new TableRow; foreach( $rows as $arg ) { $cell = new TableCell; $cell->addChild( $arg ); $row->addChild( $cell ); } $this->ad...
[ "public", "function", "addRow", "(", "$", "rows", "=", "null", ")", "{", "if", "(", "!", "is_array", "(", "$", "rows", ")", ")", "{", "$", "rows", "=", "func_get_args", "(", ")", ";", "}", "$", "row", "=", "new", "TableRow", ";", "foreach", "(", ...
Add elements to a new row $table->addRow( $element1, $element2 , $element3 ); $table->addRow( array( $element1, $element2 , $element3 ) ); @return TableRow
[ "Add", "elements", "to", "a", "new", "row" ]
c8963d494b8bd7d7f63928002057db86e5873c26
https://github.com/corneltek/FormKit/blob/c8963d494b8bd7d7f63928002057db86e5873c26/src/Element/Table.php#L22-L34
222,872
silverstripe/silverstripe-registry
src/RegistryImportFeed.php
RegistryImportFeed.setAssetHandler
public function setAssetHandler(GeneratedAssetHandler $handler) { $handler->getFilesystem()->addPlugin(new ListFiles); $this->assetHandler = $handler; return $this; }
php
public function setAssetHandler(GeneratedAssetHandler $handler) { $handler->getFilesystem()->addPlugin(new ListFiles); $this->assetHandler = $handler; return $this; }
[ "public", "function", "setAssetHandler", "(", "GeneratedAssetHandler", "$", "handler", ")", "{", "$", "handler", "->", "getFilesystem", "(", ")", "->", "addPlugin", "(", "new", "ListFiles", ")", ";", "$", "this", "->", "assetHandler", "=", "$", "handler", ";...
Set the handler used to manipulate the filesystem, and add the ListFiles plugin from Flysystem to inspect the contents of a directory @param GeneratedAssetHandler $handler @return $this
[ "Set", "the", "handler", "used", "to", "manipulate", "the", "filesystem", "and", "add", "the", "ListFiles", "plugin", "from", "Flysystem", "to", "inspect", "the", "contents", "of", "a", "directory" ]
36f97a5eda09132c82a4ef6b858f6fed14bfd368
https://github.com/silverstripe/silverstripe-registry/blob/36f97a5eda09132c82a4ef6b858f6fed14bfd368/src/RegistryImportFeed.php#L81-L88
222,873
silverstripe/silverstripe-registry
src/RegistryImportFeed.php
RegistryImportFeed.getStoragePath
public function getStoragePath($modelClass = null) { $sanitisedClassName = $this->sanitiseClassName($modelClass ?: $this->modelClass); return str_replace('{model}', $sanitisedClassName, $this->config()->get('storage_path')); }
php
public function getStoragePath($modelClass = null) { $sanitisedClassName = $this->sanitiseClassName($modelClass ?: $this->modelClass); return str_replace('{model}', $sanitisedClassName, $this->config()->get('storage_path')); }
[ "public", "function", "getStoragePath", "(", "$", "modelClass", "=", "null", ")", "{", "$", "sanitisedClassName", "=", "$", "this", "->", "sanitiseClassName", "(", "$", "modelClass", "?", ":", "$", "this", "->", "modelClass", ")", ";", "return", "str_replace...
Get the path that import files will be stored for this model @param string $modelClass If null, the current model class will be used @return string
[ "Get", "the", "path", "that", "import", "files", "will", "be", "stored", "for", "this", "model" ]
36f97a5eda09132c82a4ef6b858f6fed14bfd368
https://github.com/silverstripe/silverstripe-registry/blob/36f97a5eda09132c82a4ef6b858f6fed14bfd368/src/RegistryImportFeed.php#L106-L110
222,874
silverstripe/silverstripe-registry
src/RegistryImportFeed.php
RegistryImportFeed.getImportFilename
public function getImportFilename() { // Note: CLDR date format see DBDatetime $datetime = DBDatetime::now()->Format('y-MM-dd-HHmmss'); return str_replace('{date}', $datetime, $this->config()->get('storage_filename')); }
php
public function getImportFilename() { // Note: CLDR date format see DBDatetime $datetime = DBDatetime::now()->Format('y-MM-dd-HHmmss'); return str_replace('{date}', $datetime, $this->config()->get('storage_filename')); }
[ "public", "function", "getImportFilename", "(", ")", "{", "// Note: CLDR date format see DBDatetime", "$", "datetime", "=", "DBDatetime", "::", "now", "(", ")", "->", "Format", "(", "'y-MM-dd-HHmmss'", ")", ";", "return", "str_replace", "(", "'{date}'", ",", "$", ...
Returns a relatively unique filename to storage imported data feeds as @return string
[ "Returns", "a", "relatively", "unique", "filename", "to", "storage", "imported", "data", "feeds", "as" ]
36f97a5eda09132c82a4ef6b858f6fed14bfd368
https://github.com/silverstripe/silverstripe-registry/blob/36f97a5eda09132c82a4ef6b858f6fed14bfd368/src/RegistryImportFeed.php#L141-L146
222,875
sgpatil/oriquent
src/Sgpatil/Orientdb/Eloquent/Builder.php
Builder.createWith
public function createWith(array $attributes, array $relations) { // Collect the model attributes and label in the form of ['label' => $label, 'attributes' => $attributes] // as expected by the Query Builder. $attributes = $this->prepareForCreation($this->model, $attributes); $model = ['...
php
public function createWith(array $attributes, array $relations) { // Collect the model attributes and label in the form of ['label' => $label, 'attributes' => $attributes] // as expected by the Query Builder. $attributes = $this->prepareForCreation($this->model, $attributes); $model = ['...
[ "public", "function", "createWith", "(", "array", "$", "attributes", ",", "array", "$", "relations", ")", "{", "// Collect the model attributes and label in the form of ['label' => $label, 'attributes' => $attributes]", "// as expected by the Query Builder.", "$", "attributes", "="...
Create a new record from the parent Model and new related records with it. @param array $attributes @param array $relations @return \Sgpatil\Orientdb\Eloquent\Model
[ "Create", "a", "new", "record", "from", "the", "parent", "Model", "and", "new", "related", "records", "with", "it", "." ]
cf0f2ba688496260946f569a20c351e91f287c32
https://github.com/sgpatil/oriquent/blob/cf0f2ba688496260946f569a20c351e91f287c32/src/Sgpatil/Orientdb/Eloquent/Builder.php#L575-L657
222,876
silverstripe/silverstripe-registry
src/RegistryPage.php
RegistryPage.Breadcrumbs
public function Breadcrumbs( $maxDepth = 20, $unlinked = false, $stopAtPageType = false, $showHidden = false, $delimiter = '&raquo;' ) { $page = $this; $pages = []; while ($page && (!$maxDepth || count($pages) < $maxDepth) && (...
php
public function Breadcrumbs( $maxDepth = 20, $unlinked = false, $stopAtPageType = false, $showHidden = false, $delimiter = '&raquo;' ) { $page = $this; $pages = []; while ($page && (!$maxDepth || count($pages) < $maxDepth) && (...
[ "public", "function", "Breadcrumbs", "(", "$", "maxDepth", "=", "20", ",", "$", "unlinked", "=", "false", ",", "$", "stopAtPageType", "=", "false", ",", "$", "showHidden", "=", "false", ",", "$", "delimiter", "=", "'&raquo;'", ")", "{", "$", "page", "=...
Modified version of Breadcrumbs, to cater for viewing items.
[ "Modified", "version", "of", "Breadcrumbs", "to", "cater", "for", "viewing", "items", "." ]
36f97a5eda09132c82a4ef6b858f6fed14bfd368
https://github.com/silverstripe/silverstripe-registry/blob/36f97a5eda09132c82a4ef6b858f6fed14bfd368/src/RegistryPage.php#L99-L138
222,877
jstewmc/php-helpers
src/Dir.php
Dir.copy
public static function copy($source, $destination, $mode = 0777) { $isSuccess = false; // if $source and $destination are given if ($source !== null && $destination !== null && $mode !== null) { // if $source is a string if (is_string($source)) { // if $destination is a string if (is_stri...
php
public static function copy($source, $destination, $mode = 0777) { $isSuccess = false; // if $source and $destination are given if ($source !== null && $destination !== null && $mode !== null) { // if $source is a string if (is_string($source)) { // if $destination is a string if (is_stri...
[ "public", "static", "function", "copy", "(", "$", "source", ",", "$", "destination", ",", "$", "mode", "=", "0777", ")", "{", "$", "isSuccess", "=", "false", ";", "// if $source and $destination are given\r", "if", "(", "$", "source", "!==", "null", "&&", ...
Copies files or directory to the filesystem PHP's native copy() function only copies files, not directories. I will recursively copy a directory and all of its files and sub-directories. If the $destination exists, I will overwrite any existing files with the corresponding file in the $source directory. If $destinat...
[ "Copies", "files", "or", "directory", "to", "the", "filesystem" ]
b019194778683035ecd5ad177f5d6d4ee3705aed
https://github.com/jstewmc/php-helpers/blob/b019194778683035ecd5ad177f5d6d4ee3705aed/src/Dir.php#L115-L220
222,878
jstewmc/php-helpers
src/Dir.php
Dir.remove
public static function remove($directory, $container) { $isSuccess = false; // if $directory and $container are given if ($directory !== null && $container !== null) { // if $directory is a string if (is_string($directory)) { // if $container is a string if (is_string($container)) { ...
php
public static function remove($directory, $container) { $isSuccess = false; // if $directory and $container are given if ($directory !== null && $container !== null) { // if $directory is a string if (is_string($directory)) { // if $container is a string if (is_string($container)) { ...
[ "public", "static", "function", "remove", "(", "$", "directory", ",", "$", "container", ")", "{", "$", "isSuccess", "=", "false", ";", "// if $directory and $container are given\r", "if", "(", "$", "directory", "!==", "null", "&&", "$", "container", "!==", "nu...
Deletes a non-empty directory and its sub-directories PHP's native rmdir() function requires the directory to be empty. I'll recursively delete a directory's files and sub-directories. BE CAREFUL! Use the $container argument to be safe. @since 0.1.0 @param string $directory the path of the directory to remove @p...
[ "Deletes", "a", "non", "-", "empty", "directory", "and", "its", "sub", "-", "directories" ]
b019194778683035ecd5ad177f5d6d4ee3705aed
https://github.com/jstewmc/php-helpers/blob/b019194778683035ecd5ad177f5d6d4ee3705aed/src/Dir.php#L260-L344
222,879
TheFrozenFire/PHP-Swagger-Parser
src/Swagger/SchemaResolver.php
SchemaResolver.parseType
public function parseType(Object\TypeObjectInterface $type, $data) { if($type instanceof Object\ReferentialInterface && $type->hasRef()) { $objectType = $type->getRef(); $type = $this->resolveReference($type); } else { try { $objectType = $type->ge...
php
public function parseType(Object\TypeObjectInterface $type, $data) { if($type instanceof Object\ReferentialInterface && $type->hasRef()) { $objectType = $type->getRef(); $type = $this->resolveReference($type); } else { try { $objectType = $type->ge...
[ "public", "function", "parseType", "(", "Object", "\\", "TypeObjectInterface", "$", "type", ",", "$", "data", ")", "{", "if", "(", "$", "type", "instanceof", "Object", "\\", "ReferentialInterface", "&&", "$", "type", "->", "hasRef", "(", ")", ")", "{", "...
Parse a type-object with data into its respective structure @param Object\TypeObjectInterface $type - The schema for the type @param \stdClass $data - The input data @return SchemaObject|array
[ "Parse", "a", "type", "-", "object", "with", "data", "into", "its", "respective", "structure" ]
7070e63c7687ee764b392b3a3150931de97966bc
https://github.com/TheFrozenFire/PHP-Swagger-Parser/blob/7070e63c7687ee764b392b3a3150931de97966bc/src/Swagger/SchemaResolver.php#L34-L79
222,880
jstewmc/php-helpers
src/Arr.php
Arr.filterBykey
public static function filterBykey($array, $callback) { $filtered = array(); // if $array and $callback are given if ($array !== null && $callback !== null) { // if the input arr is actually an arr if (is_array($array)) { // if $callback is callable if (is_callable($callback)) { /...
php
public static function filterBykey($array, $callback) { $filtered = array(); // if $array and $callback are given if ($array !== null && $callback !== null) { // if the input arr is actually an arr if (is_array($array)) { // if $callback is callable if (is_callable($callback)) { /...
[ "public", "static", "function", "filterBykey", "(", "$", "array", ",", "$", "callback", ")", "{", "$", "filtered", "=", "array", "(", ")", ";", "// if $array and $callback are given\r", "if", "(", "$", "array", "!==", "null", "&&", "$", "callback", "!==", ...
Filters an array by key I'll iterate over each key in $array passing it to the $callback function. If the callback function returns true, the current value from $array is added to the result array. Array keys are preserved. For example: $a = ['foo', 'bar', 'baz']; Arr::filterByKey($a, function ($k) { return $k > 1; ...
[ "Filters", "an", "array", "by", "key" ]
b019194778683035ecd5ad177f5d6d4ee3705aed
https://github.com/jstewmc/php-helpers/blob/b019194778683035ecd5ad177f5d6d4ee3705aed/src/Arr.php#L120-L155
222,881
jstewmc/php-helpers
src/Arr.php
Arr.filterByKeyPrefix
public static function filterByKeyPrefix($array, $prefix) { $filtered = array(); // if $array and $prefix are given if ($array !== null && $prefix !== null) { // if $array is actually an array if (is_array($array)) { // if $prefix is a string if (is_string($prefix)) { // if $array...
php
public static function filterByKeyPrefix($array, $prefix) { $filtered = array(); // if $array and $prefix are given if ($array !== null && $prefix !== null) { // if $array is actually an array if (is_array($array)) { // if $prefix is a string if (is_string($prefix)) { // if $array...
[ "public", "static", "function", "filterByKeyPrefix", "(", "$", "array", ",", "$", "prefix", ")", "{", "$", "filtered", "=", "array", "(", ")", ";", "// if $array and $prefix are given\r", "if", "(", "$", "array", "!==", "null", "&&", "$", "prefix", "!==", ...
Filters an array by a key prefix I'll iterate over each key in $array. If the key starts with $prefix, I'll add it to the result array. Array keys are preserved. For example: $a = ['foo' => 'bar', 'baz' => 'qux']; Arr::filterByKeyPrefix($a, 'b'); // returns ['baz'] @since 0.1.0 @param array $array the array ...
[ "Filters", "an", "array", "by", "a", "key", "prefix" ]
b019194778683035ecd5ad177f5d6d4ee3705aed
https://github.com/jstewmc/php-helpers/blob/b019194778683035ecd5ad177f5d6d4ee3705aed/src/Arr.php#L178-L212
222,882
jstewmc/php-helpers
src/Arr.php
Arr.inArray
public static function inArray($needle, $haystack, $wildcard = '*') { $inArray = false; // if $needle, $haystack, and $wildcard are given if ($needle !== null && $haystack !== null && $wildcard !== null) { // if $needle is a string if (is_string($needle)) { // if $haystack is an array if...
php
public static function inArray($needle, $haystack, $wildcard = '*') { $inArray = false; // if $needle, $haystack, and $wildcard are given if ($needle !== null && $haystack !== null && $wildcard !== null) { // if $needle is a string if (is_string($needle)) { // if $haystack is an array if...
[ "public", "static", "function", "inArray", "(", "$", "needle", ",", "$", "haystack", ",", "$", "wildcard", "=", "'*'", ")", "{", "$", "inArray", "=", "false", ";", "// if $needle, $haystack, and $wildcard are given\r", "if", "(", "$", "needle", "!==", "null", ...
Wildcard search for a value in an array I'll search $haystack for $needle. Unlike PHP's native in_array() method, I'll accept begins-with (e.g., "foo*"), ends-with (e.g., "*foo"), and contains (e.g., "*foo*") wildcard notation. For example: Arr::inArray('foo', ['foo', 'bar']); // returns true Arr::inArray('qux', ['...
[ "Wildcard", "search", "for", "a", "value", "in", "an", "array" ]
b019194778683035ecd5ad177f5d6d4ee3705aed
https://github.com/jstewmc/php-helpers/blob/b019194778683035ecd5ad177f5d6d4ee3705aed/src/Arr.php#L243-L301
222,883
jstewmc/php-helpers
src/Arr.php
Arr.permute
public static function permute(Array $set) { $perms = []; $j = 0; $size = count($set) - 1; $perm = range(0, $size); do { foreach ($perm as $i) { $perms[$j][] = $set[$i]; } } while ($perm = self::getNextPermutation($perm, $size) and ++$j); return $perms; }
php
public static function permute(Array $set) { $perms = []; $j = 0; $size = count($set) - 1; $perm = range(0, $size); do { foreach ($perm as $i) { $perms[$j][] = $set[$i]; } } while ($perm = self::getNextPermutation($perm, $size) and ++$j); return $perms; }
[ "public", "static", "function", "permute", "(", "Array", "$", "set", ")", "{", "$", "perms", "=", "[", "]", ";", "$", "j", "=", "0", ";", "$", "size", "=", "count", "(", "$", "set", ")", "-", "1", ";", "$", "perm", "=", "range", "(", "0", "...
Returns an array of this array's permutations @param string[] $array an array of strings @return string[] an array of $array's permutations @see http://docstore.mik.ua/orelly/webprog/pcook/ch04_26.htm an example from O'Reilly's PHPCookbook @since 0.1.2
[ "Returns", "an", "array", "of", "this", "array", "s", "permutations" ]
b019194778683035ecd5ad177f5d6d4ee3705aed
https://github.com/jstewmc/php-helpers/blob/b019194778683035ecd5ad177f5d6d4ee3705aed/src/Arr.php#L514-L529
222,884
jstewmc/php-helpers
src/Arr.php
Arr.sortByField
public static function sortByField($array, $field, $sort = 'asc') { // if $array, $field, and $sort are given if ($array !== null && $field !== null && $sort !== null) { // if $array is actually an array if (is_array($array)) { // if $field is a string if (is_string($field)) { // if $so...
php
public static function sortByField($array, $field, $sort = 'asc') { // if $array, $field, and $sort are given if ($array !== null && $field !== null && $sort !== null) { // if $array is actually an array if (is_array($array)) { // if $field is a string if (is_string($field)) { // if $so...
[ "public", "static", "function", "sortByField", "(", "$", "array", ",", "$", "field", ",", "$", "sort", "=", "'asc'", ")", "{", "// if $array, $field, and $sort are given\r", "if", "(", "$", "array", "!==", "null", "&&", "$", "field", "!==", "null", "&&", "...
Sorts an array of associative arrays by a field's value Oftentimes, you have a 0-indexed array of associative arrays. For example, a SELECT sql query result or a display-friendly data array. I'll sort a 0-based array of associative arrays by a field's value. For example: $a = [['a' => 3], ['a' => 1], ['a' => 2]]; Ar...
[ "Sorts", "an", "array", "of", "associative", "arrays", "by", "a", "field", "s", "value" ]
b019194778683035ecd5ad177f5d6d4ee3705aed
https://github.com/jstewmc/php-helpers/blob/b019194778683035ecd5ad177f5d6d4ee3705aed/src/Arr.php#L561-L627
222,885
jstewmc/php-helpers
src/Arr.php
Arr.sortByProperty
public static function sortByProperty($array, $property, $sort = 'asc') { // if $array, $property, and $sort are given if ($array !== null && $property !== null && $sort !== null) { // if $array is actually an array if (is_array($array)) { // if $property is a string if (is_string($property))...
php
public static function sortByProperty($array, $property, $sort = 'asc') { // if $array, $property, and $sort are given if ($array !== null && $property !== null && $sort !== null) { // if $array is actually an array if (is_array($array)) { // if $property is a string if (is_string($property))...
[ "public", "static", "function", "sortByProperty", "(", "$", "array", ",", "$", "property", ",", "$", "sort", "=", "'asc'", ")", "{", "// if $array, $property, and $sort are given\r", "if", "(", "$", "array", "!==", "null", "&&", "$", "property", "!==", "null",...
Sorts an array of objects using a public property's value @since 0.1.0 @param object[] $array the array of objects to sort @param string $property the object's public property name (may be a magic public property via the object's __get() method) @param string $sort the sort order (possible values...
[ "Sorts", "an", "array", "of", "objects", "using", "a", "public", "property", "s", "value" ]
b019194778683035ecd5ad177f5d6d4ee3705aed
https://github.com/jstewmc/php-helpers/blob/b019194778683035ecd5ad177f5d6d4ee3705aed/src/Arr.php#L651-L721
222,886
jstewmc/php-helpers
src/Arr.php
Arr.sortByMethod
public static function sortByMethod($array, $method, $sort = 'asc') { // if $array, $method, and $sort are given if ($array !== null && $method !== null && $sort !== null) { // if $array is actually an array if (is_array($array)) { // if $method is a string if (is_string($method)) { // ...
php
public static function sortByMethod($array, $method, $sort = 'asc') { // if $array, $method, and $sort are given if ($array !== null && $method !== null && $sort !== null) { // if $array is actually an array if (is_array($array)) { // if $method is a string if (is_string($method)) { // ...
[ "public", "static", "function", "sortByMethod", "(", "$", "array", ",", "$", "method", ",", "$", "sort", "=", "'asc'", ")", "{", "// if $array, $method, and $sort are given\r", "if", "(", "$", "array", "!==", "null", "&&", "$", "method", "!==", "null", "&&",...
Sorts an array of objects using a method's return value @since 0.1.0 @param object[] $array the array of objects to sort @param string $method the name of the public method to use (may be a "magic" method via the object's __call() magic method) @param string $sort the sort order (possible values ...
[ "Sorts", "an", "array", "of", "objects", "using", "a", "method", "s", "return", "value" ]
b019194778683035ecd5ad177f5d6d4ee3705aed
https://github.com/jstewmc/php-helpers/blob/b019194778683035ecd5ad177f5d6d4ee3705aed/src/Arr.php#L745-L813
222,887
jstewmc/php-helpers
src/Arr.php
Arr.getNextPermutation
protected static function getNextPermutation($p, $size) { // slide down the array looking for where we're smaller than the next guy for ($i = $size - 1; $i >= 0 && $p[$i] >= $p[$i+1]; --$i) { } // if this doesn't occur, we've finished our permutations // the array is reversed: (1, 2, ...
php
protected static function getNextPermutation($p, $size) { // slide down the array looking for where we're smaller than the next guy for ($i = $size - 1; $i >= 0 && $p[$i] >= $p[$i+1]; --$i) { } // if this doesn't occur, we've finished our permutations // the array is reversed: (1, 2, ...
[ "protected", "static", "function", "getNextPermutation", "(", "$", "p", ",", "$", "size", ")", "{", "// slide down the array looking for where we're smaller than the next guy\r", "for", "(", "$", "i", "=", "$", "size", "-", "1", ";", "$", "i", ">=", "0", "&&", ...
Returns the next permutation @see self:permute()
[ "Returns", "the", "next", "permutation" ]
b019194778683035ecd5ad177f5d6d4ee3705aed
https://github.com/jstewmc/php-helpers/blob/b019194778683035ecd5ad177f5d6d4ee3705aed/src/Arr.php#L823-L844
222,888
nadar/php-composer-reader
src/ComposerReader.php
ComposerReader.getContent
public function getContent() { if ($this->_content === null) { if (!$this->canRead()) { throw new Exception("Unable to read config file {$this->file}."); } $buffer = $this->getFileContent($this->file); $this->_content = $this->json...
php
public function getContent() { if ($this->_content === null) { if (!$this->canRead()) { throw new Exception("Unable to read config file {$this->file}."); } $buffer = $this->getFileContent($this->file); $this->_content = $this->json...
[ "public", "function", "getContent", "(", ")", "{", "if", "(", "$", "this", "->", "_content", "===", "null", ")", "{", "if", "(", "!", "$", "this", "->", "canRead", "(", ")", ")", "{", "throw", "new", "Exception", "(", "\"Unable to read config file {$this...
The content of the json file as array. @throws Exception @return array The composer.json file as array.
[ "The", "content", "of", "the", "json", "file", "as", "array", "." ]
1498c172313c5402357f43066c3e07f310f69076
https://github.com/nadar/php-composer-reader/blob/1498c172313c5402357f43066c3e07f310f69076/src/ComposerReader.php#L76-L88
222,889
nadar/php-composer-reader
src/ComposerReader.php
ComposerReader.writeContent
public function writeContent(array $content) { if (!$this->canWrite()) { throw new Exception("Unable to write file {this->file}."); } $json = $this->jsonEncode($content); return $this->writeFileContent($this->file, $json); }
php
public function writeContent(array $content) { if (!$this->canWrite()) { throw new Exception("Unable to write file {this->file}."); } $json = $this->jsonEncode($content); return $this->writeFileContent($this->file, $json); }
[ "public", "function", "writeContent", "(", "array", "$", "content", ")", "{", "if", "(", "!", "$", "this", "->", "canWrite", "(", ")", ")", "{", "throw", "new", "Exception", "(", "\"Unable to write file {this->file}.\"", ")", ";", "}", "$", "json", "=", ...
Write the content into the composer.json. @param array $content The content to write. @throws Exception @return boolean Whether writting was successfull or not.
[ "Write", "the", "content", "into", "the", "composer", ".", "json", "." ]
1498c172313c5402357f43066c3e07f310f69076
https://github.com/nadar/php-composer-reader/blob/1498c172313c5402357f43066c3e07f310f69076/src/ComposerReader.php#L97-L106
222,890
nadar/php-composer-reader
src/ComposerReader.php
ComposerReader.runCommand
public function runCommand($command) { $folder = dirname($this->file); $olddir = getcwd(); chdir($folder); ob_start(); $output = null; $cmd = system('composer ' . $command, $output); $output = ob_end_clean(); chdir($olddir); r...
php
public function runCommand($command) { $folder = dirname($this->file); $olddir = getcwd(); chdir($folder); ob_start(); $output = null; $cmd = system('composer ' . $command, $output); $output = ob_end_clean(); chdir($olddir); r...
[ "public", "function", "runCommand", "(", "$", "command", ")", "{", "$", "folder", "=", "dirname", "(", "$", "this", "->", "file", ")", ";", "$", "olddir", "=", "getcwd", "(", ")", ";", "chdir", "(", "$", "folder", ")", ";", "ob_start", "(", ")", ...
Run a composer command in the given composer.json. Example usage ```php $reader = new ComposerReader('path/to/composer.json'); $reader->runCommand('dump-autoload'); // equals to `composer dump-autoload` ``` @param string $command @return boolean
[ "Run", "a", "composer", "command", "in", "the", "given", "composer", ".", "json", "." ]
1498c172313c5402357f43066c3e07f310f69076
https://github.com/nadar/php-composer-reader/blob/1498c172313c5402357f43066c3e07f310f69076/src/ComposerReader.php#L165-L178
222,891
nadar/php-composer-reader
src/ComposerReader.php
ComposerReader.writeFileContent
protected function writeFileContent($file, $data) { $handler = file_put_contents($file, $data); return $handler === false ? false : true; }
php
protected function writeFileContent($file, $data) { $handler = file_put_contents($file, $data); return $handler === false ? false : true; }
[ "protected", "function", "writeFileContent", "(", "$", "file", ",", "$", "data", ")", "{", "$", "handler", "=", "file_put_contents", "(", "$", "file", ",", "$", "data", ")", ";", "return", "$", "handler", "===", "false", "?", "false", ":", "true", ";",...
Write the file content. @param string $file @param string $data @return boolean
[ "Write", "the", "file", "content", "." ]
1498c172313c5402357f43066c3e07f310f69076
https://github.com/nadar/php-composer-reader/blob/1498c172313c5402357f43066c3e07f310f69076/src/ComposerReader.php#L198-L203
222,892
nadar/php-composer-reader
src/ComposerReader.php
ComposerReader.jsonDecode
protected function jsonDecode($json) { $content = json_decode((string) $json, true); $this->handleJsonError(json_last_error()); return $content; }
php
protected function jsonDecode($json) { $content = json_decode((string) $json, true); $this->handleJsonError(json_last_error()); return $content; }
[ "protected", "function", "jsonDecode", "(", "$", "json", ")", "{", "$", "content", "=", "json_decode", "(", "(", "string", ")", "$", "json", ",", "true", ")", ";", "$", "this", "->", "handleJsonError", "(", "json_last_error", "(", ")", ")", ";", "retur...
Decodes a json string into php structure. @param string $json @return array
[ "Decodes", "a", "json", "string", "into", "php", "structure", "." ]
1498c172313c5402357f43066c3e07f310f69076
https://github.com/nadar/php-composer-reader/blob/1498c172313c5402357f43066c3e07f310f69076/src/ComposerReader.php#L211-L217
222,893
nadar/php-composer-reader
src/ComposerReader.php
ComposerReader.jsonEncode
protected function jsonEncode(array $data) { set_error_handler(function () { $this->handleJsonError(JSON_ERROR_SYNTAX); }, E_WARNING); $json = json_encode($data, JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT); restore_error_handler(); $this->handleJsonError(js...
php
protected function jsonEncode(array $data) { set_error_handler(function () { $this->handleJsonError(JSON_ERROR_SYNTAX); }, E_WARNING); $json = json_encode($data, JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT); restore_error_handler(); $this->handleJsonError(js...
[ "protected", "function", "jsonEncode", "(", "array", "$", "data", ")", "{", "set_error_handler", "(", "function", "(", ")", "{", "$", "this", "->", "handleJsonError", "(", "JSON_ERROR_SYNTAX", ")", ";", "}", ",", "E_WARNING", ")", ";", "$", "json", "=", ...
Encodes a php array structure into a json string. @param array $data @return string
[ "Encodes", "a", "php", "array", "structure", "into", "a", "json", "string", "." ]
1498c172313c5402357f43066c3e07f310f69076
https://github.com/nadar/php-composer-reader/blob/1498c172313c5402357f43066c3e07f310f69076/src/ComposerReader.php#L225-L236
222,894
nadar/php-composer-reader
src/ComposerReader.php
ComposerReader.handleJsonError
protected function handleJsonError($error) { switch ($error) { case JSON_ERROR_NONE: break; // handle nothing case JSON_ERROR_DEPTH: throw new Exception("Maximum stack depth exceeded"); case JSON_ERROR_STATE_MISMATCH: throw new Exception("Underflow or the modes mismatch")...
php
protected function handleJsonError($error) { switch ($error) { case JSON_ERROR_NONE: break; // handle nothing case JSON_ERROR_DEPTH: throw new Exception("Maximum stack depth exceeded"); case JSON_ERROR_STATE_MISMATCH: throw new Exception("Underflow or the modes mismatch")...
[ "protected", "function", "handleJsonError", "(", "$", "error", ")", "{", "switch", "(", "$", "error", ")", "{", "case", "JSON_ERROR_NONE", ":", "break", ";", "// handle nothing", "case", "JSON_ERROR_DEPTH", ":", "throw", "new", "Exception", "(", "\"Maximum stack...
Handle json parsing errors. @param integer $error @throws Exception
[ "Handle", "json", "parsing", "errors", "." ]
1498c172313c5402357f43066c3e07f310f69076
https://github.com/nadar/php-composer-reader/blob/1498c172313c5402357f43066c3e07f310f69076/src/ComposerReader.php#L244-L255
222,895
fage1151/swoole-worker
Connection/AsyncTcpConnection.php
AsyncTcpConnection.connect
public function connect() { if ($this->_status !== self::STATUS_INITIAL && $this->_status !== self::STATUS_CLOSING && $this->_status !== self::STATUS_CLOSED) { return; } $this->_status = self::STATUS_CONNECTING; $this->_connectStartTime = microtime(...
php
public function connect() { if ($this->_status !== self::STATUS_INITIAL && $this->_status !== self::STATUS_CLOSING && $this->_status !== self::STATUS_CLOSED) { return; } $this->_status = self::STATUS_CONNECTING; $this->_connectStartTime = microtime(...
[ "public", "function", "connect", "(", ")", "{", "if", "(", "$", "this", "->", "_status", "!==", "self", "::", "STATUS_INITIAL", "&&", "$", "this", "->", "_status", "!==", "self", "::", "STATUS_CLOSING", "&&", "$", "this", "->", "_status", "!==", "self", ...
Do connect. @return void
[ "Do", "connect", "." ]
ade6e29ffb400129380d56e9a2e6656f19dceb17
https://github.com/fage1151/swoole-worker/blob/ade6e29ffb400129380d56e9a2e6656f19dceb17/Connection/AsyncTcpConnection.php#L157-L191
222,896
meysampg/intldate
IntlDateTrait.php
IntlDateTrait.asDateTime
public function asDateTime($pattern = 'yyyy/MM/dd, HH:mm:ss') { $this->setFinalPattern($this->parsePattern($pattern)); return $this->getIntlDateFormatter()->format($this->getIntlCalendar()); }
php
public function asDateTime($pattern = 'yyyy/MM/dd, HH:mm:ss') { $this->setFinalPattern($this->parsePattern($pattern)); return $this->getIntlDateFormatter()->format($this->getIntlCalendar()); }
[ "public", "function", "asDateTime", "(", "$", "pattern", "=", "'yyyy/MM/dd, HH:mm:ss'", ")", "{", "$", "this", "->", "setFinalPattern", "(", "$", "this", "->", "parsePattern", "(", "$", "pattern", ")", ")", ";", "return", "$", "this", "->", "getIntlDateForma...
Return final date and time on supplied format. @param string $pattern pattern of datetime based on ICU standards @return string @since 1.0.0
[ "Return", "final", "date", "and", "time", "on", "supplied", "format", "." ]
cb5abc65562f6151520f640480d14cc9a31c18e0
https://github.com/meysampg/intldate/blob/cb5abc65562f6151520f640480d14cc9a31c18e0/IntlDateTrait.php#L52-L57
222,897
meysampg/intldate
IntlDateTrait.php
IntlDateTrait.fromTimestamp
public function fromTimestamp($timestamp, $timezone = 'UTC') { // [TODO] use DateTime object for parse timestamp $oldTz = date_default_timezone_get(); date_default_timezone_set($timezone); $timestamp = mktime(date('H', $timestamp), date('i', $timestamp), date('s', $timestamp), date('...
php
public function fromTimestamp($timestamp, $timezone = 'UTC') { // [TODO] use DateTime object for parse timestamp $oldTz = date_default_timezone_get(); date_default_timezone_set($timezone); $timestamp = mktime(date('H', $timestamp), date('i', $timestamp), date('s', $timestamp), date('...
[ "public", "function", "fromTimestamp", "(", "$", "timestamp", ",", "$", "timezone", "=", "'UTC'", ")", "{", "// [TODO] use DateTime object for parse timestamp", "$", "oldTz", "=", "date_default_timezone_get", "(", ")", ";", "date_default_timezone_set", "(", "$", "time...
Get datetime as a timestamp. @param int $timestamp timestamp on origin @return static @since 1.0.3
[ "Get", "datetime", "as", "a", "timestamp", "." ]
cb5abc65562f6151520f640480d14cc9a31c18e0
https://github.com/meysampg/intldate/blob/cb5abc65562f6151520f640480d14cc9a31c18e0/IntlDateTrait.php#L80-L95
222,898
meysampg/intldate
IntlDateTrait.php
IntlDateTrait.from
public function from( $datetime = [], $locale = 'en_US', $calendar = null, $timezone = 'UTC' ) { $datetime = $this->parseDateTime($datetime); $calendar = $calendar ?: self::$CAL_GREGORIAN; $this->setIntlCalendar() ->setFromCalendar($calendar)->set...
php
public function from( $datetime = [], $locale = 'en_US', $calendar = null, $timezone = 'UTC' ) { $datetime = $this->parseDateTime($datetime); $calendar = $calendar ?: self::$CAL_GREGORIAN; $this->setIntlCalendar() ->setFromCalendar($calendar)->set...
[ "public", "function", "from", "(", "$", "datetime", "=", "[", "]", ",", "$", "locale", "=", "'en_US'", ",", "$", "calendar", "=", "null", ",", "$", "timezone", "=", "'UTC'", ")", "{", "$", "datetime", "=", "$", "this", "->", "parseDateTime", "(", "...
Get information of datetime on origin. @param array $datetime Array contains datetime information. Its elements are [year, month, day, hour, minute, second]. @param string $locale locale for showing datetime on it (e.g. `en_US` or `fa_IR`, 'es_US', ...) @param string $calendar Calendar on origin @param string $time...
[ "Get", "information", "of", "datetime", "on", "origin", "." ]
cb5abc65562f6151520f640480d14cc9a31c18e0
https://github.com/meysampg/intldate/blob/cb5abc65562f6151520f640480d14cc9a31c18e0/IntlDateTrait.php#L111-L127
222,899
meysampg/intldate
IntlDateTrait.php
IntlDateTrait.to
public function to( $locale = 'en_US', $calendar = null, $timezone = 'UTC' ) { $calendar = $calendar !== null ? $calendar : self::$CAL_PERSIAN; $this->setIntlDateFormatter() ->setToCalendar($calendar)->setToLocale($locale) ->setFinalTimeZone($timezone...
php
public function to( $locale = 'en_US', $calendar = null, $timezone = 'UTC' ) { $calendar = $calendar !== null ? $calendar : self::$CAL_PERSIAN; $this->setIntlDateFormatter() ->setToCalendar($calendar)->setToLocale($locale) ->setFinalTimeZone($timezone...
[ "public", "function", "to", "(", "$", "locale", "=", "'en_US'", ",", "$", "calendar", "=", "null", ",", "$", "timezone", "=", "'UTC'", ")", "{", "$", "calendar", "=", "$", "calendar", "!==", "null", "?", "$", "calendar", ":", "self", "::", "$", "CA...
Convert datetime to a desired calendar. @param string $locale locale for showing new datetime @param mixed $calendar calendar system for showing new datetime @param string $timezone timezone of destination @return static
[ "Convert", "datetime", "to", "a", "desired", "calendar", "." ]
cb5abc65562f6151520f640480d14cc9a31c18e0
https://github.com/meysampg/intldate/blob/cb5abc65562f6151520f640480d14cc9a31c18e0/IntlDateTrait.php#L138-L157