repository_name
stringlengths
5
67
func_path_in_repository
stringlengths
4
234
func_name
stringlengths
0
314
whole_func_string
stringlengths
52
3.87M
language
stringclasses
6 values
func_code_string
stringlengths
52
3.87M
func_code_tokens
listlengths
15
672k
func_documentation_string
stringlengths
1
47.2k
func_documentation_tokens
listlengths
1
3.92k
split_name
stringclasses
1 value
func_code_url
stringlengths
85
339
romainbessugesmeusy/php-datagrid
library/RBM/Datagrid/Data/Processor/ResultRow.php
ResultRow.getCellDataForColumnName
public function getCellDataForColumnName($columnName) { return Extractor::extract( $this->_data, $this->_dataGrid->getColumn($columnName)->getCellAccessor() ); }
php
public function getCellDataForColumnName($columnName) { return Extractor::extract( $this->_data, $this->_dataGrid->getColumn($columnName)->getCellAccessor() ); }
[ "public", "function", "getCellDataForColumnName", "(", "$", "columnName", ")", "{", "return", "Extractor", "::", "extract", "(", "$", "this", "->", "_data", ",", "$", "this", "->", "_dataGrid", "->", "getColumn", "(", "$", "columnName", ")", "->", "getCellAc...
Get the cell accessor from the DataGridColumn and extract the data from the row @param $columnName @return mixed
[ "Get", "the", "cell", "accessor", "from", "the", "DataGridColumn", "and", "extract", "the", "data", "from", "the", "row" ]
train
https://github.com/romainbessugesmeusy/php-datagrid/blob/18f7ae15845fcf61520bbfc946771242bf1091c9/library/RBM/Datagrid/Data/Processor/ResultRow.php#L71-L77
highday/glitter
src/Services/Office/Circle/SearchService.php
SearchService.search
public function search(FinderItem $finder = null): LengthAwarePaginator { if ($finder) { $this->query = $finder($this->query); } return $this->query->paginate(); }
php
public function search(FinderItem $finder = null): LengthAwarePaginator { if ($finder) { $this->query = $finder($this->query); } return $this->query->paginate(); }
[ "public", "function", "search", "(", "FinderItem", "$", "finder", "=", "null", ")", ":", "LengthAwarePaginator", "{", "if", "(", "$", "finder", ")", "{", "$", "this", "->", "query", "=", "$", "finder", "(", "$", "this", "->", "query", ")", ";", "}", ...
@param FinderItem|null $finder @throws \Exception @return LengthAwarePaginator
[ "@param", "FinderItem|null", "$finder" ]
train
https://github.com/highday/glitter/blob/d1c7a227fd2343806bd3ec0314e621ced57dfe66/src/Services/Office/Circle/SearchService.php#L54-L61
dotkernel/dot-rbac
src/Role/RoleService.php
RoleService.matchIdentityRoles
public function matchIdentityRoles(array $roles): bool { $identityRoles = $this->getIdentityRoles(); // Too easy... if (empty($identityRoles)) { return false; } $roleNames = []; foreach ($roles as $role) { $roleNames[] = $role instanceof RoleIn...
php
public function matchIdentityRoles(array $roles): bool { $identityRoles = $this->getIdentityRoles(); // Too easy... if (empty($identityRoles)) { return false; } $roleNames = []; foreach ($roles as $role) { $roleNames[] = $role instanceof RoleIn...
[ "public", "function", "matchIdentityRoles", "(", "array", "$", "roles", ")", ":", "bool", "{", "$", "identityRoles", "=", "$", "this", "->", "getIdentityRoles", "(", ")", ";", "// Too easy...", "if", "(", "empty", "(", "$", "identityRoles", ")", ")", "{", ...
Check if the given roles match one of the identity roles This method is smart enough to automatically recursively extracts roles for hierarchical roles @param string[]|RoleInterface[] $roles @return bool
[ "Check", "if", "the", "given", "roles", "match", "one", "of", "the", "identity", "roles" ]
train
https://github.com/dotkernel/dot-rbac/blob/747ffadf3cf28750bb7cf81be60eb4c93b830446/src/Role/RoleService.php#L92-L110
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/variable/var_set.php
ezcMailVariableSet.getNextLine
public function getNextLine() { $line = current( $this->mail ); next( $this->mail ); if ( $line === false ) { return null; } return $line . "\n"; }
php
public function getNextLine() { $line = current( $this->mail ); next( $this->mail ); if ( $line === false ) { return null; } return $line . "\n"; }
[ "public", "function", "getNextLine", "(", ")", "{", "$", "line", "=", "current", "(", "$", "this", "->", "mail", ")", ";", "next", "(", "$", "this", "->", "mail", ")", ";", "if", "(", "$", "line", "===", "false", ")", "{", "return", "null", ";", ...
Returns one line of data from the current mail in the set. Null is returned if there is no current mail in the set or the end of the mail is reached. @return string
[ "Returns", "one", "line", "of", "data", "from", "the", "current", "mail", "in", "the", "set", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/variable/var_set.php#L59-L70
skeeks-cms/cms-log-db-target
src/console/controllers/FlushController.php
FlushController.actionLogs
public function actionLogs($countDay = 5) { if ($count = LogDbTargetModel::find()->where(['<=', 'log_time', time() - 3600*24*$countDay])->count()) { $this->stdout("Total logs found: {$count}\n", Console::BOLD); $totalDeleted = LogDbTargetModel::deleteAll(['<=', 'log_time', ti...
php
public function actionLogs($countDay = 5) { if ($count = LogDbTargetModel::find()->where(['<=', 'log_time', time() - 3600*24*$countDay])->count()) { $this->stdout("Total logs found: {$count}\n", Console::BOLD); $totalDeleted = LogDbTargetModel::deleteAll(['<=', 'log_time', ti...
[ "public", "function", "actionLogs", "(", "$", "countDay", "=", "5", ")", "{", "if", "(", "$", "count", "=", "LogDbTargetModel", "::", "find", "(", ")", "->", "where", "(", "[", "'<='", ",", "'log_time'", ",", "time", "(", ")", "-", "3600", "*", "24...
Чистка логов старше чем (указать количество дней) @param int $countDay количество дней
[ "Чистка", "логов", "старше", "чем", "(", "указать", "количество", "дней", ")" ]
train
https://github.com/skeeks-cms/cms-log-db-target/blob/cb660a50d0d4d734096230e525f66855a7373d14/src/console/controllers/FlushController.php#L24-L35
nabab/bbn
src/bbn/appui/project.php
project.get_root_path
public function get_root_path($repository){ if ( \is_string($repository) ){ $repository = $this->repository($repository); } if ( !empty($repository) && !empty($repository['bbn_path']) ){ $repository_path = !empty($repository['path']) ? '/' . $repository['path'] : ''; $path = self::decipher...
php
public function get_root_path($repository){ if ( \is_string($repository) ){ $repository = $this->repository($repository); } if ( !empty($repository) && !empty($repository['bbn_path']) ){ $repository_path = !empty($repository['path']) ? '/' . $repository['path'] : ''; $path = self::decipher...
[ "public", "function", "get_root_path", "(", "$", "repository", ")", "{", "if", "(", "\\", "is_string", "(", "$", "repository", ")", ")", "{", "$", "repository", "=", "$", "this", "->", "repository", "(", "$", "repository", ")", ";", "}", "if", "(", "...
Gets the real root path from a repository's id as recorded in the options. @param string|array $repository The repository's name (code) or the repository's configuration @return bool|string
[ "Gets", "the", "real", "root", "path", "from", "a", "repository", "s", "id", "as", "recorded", "in", "the", "options", "." ]
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/project.php#L226-L236
nabab/bbn
src/bbn/appui/project.php
project.repositories
public function repositories(string $code=''){ $all = $this->options->full_soptions($this->options->from_code('PATHS', 'ide', 'appui')); $cats = []; $r = []; foreach ( $all as $a ){ if ( \defined($a['bbn_path']) ){ $k = $a['bbn_path'] . '/' . ($a['code'] === '/' ? '' : $a['code']); ...
php
public function repositories(string $code=''){ $all = $this->options->full_soptions($this->options->from_code('PATHS', 'ide', 'appui')); $cats = []; $r = []; foreach ( $all as $a ){ if ( \defined($a['bbn_path']) ){ $k = $a['bbn_path'] . '/' . ($a['code'] === '/' ? '' : $a['code']); ...
[ "public", "function", "repositories", "(", "string", "$", "code", "=", "''", ")", "{", "$", "all", "=", "$", "this", "->", "options", "->", "full_soptions", "(", "$", "this", "->", "options", "->", "from_code", "(", "'PATHS'", ",", "'ide'", ",", "'appu...
Makes the repositories' configurations. @param string $code The repository's name (code) @return array|bool
[ "Makes", "the", "repositories", "configurations", "." ]
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/project.php#L254-L283
nabab/bbn
src/bbn/appui/project.php
project.repository_from_url
public function repository_from_url(string $url, bool $obj = false){ $repository = ''; $repositories = $this->repositories(); foreach ( $repositories as $i => $d ){ if ( (strpos($url, $i) === 0) && (\strlen($i) > \strlen($repository) ) ){ $repository = $i; } } if (...
php
public function repository_from_url(string $url, bool $obj = false){ $repository = ''; $repositories = $this->repositories(); foreach ( $repositories as $i => $d ){ if ( (strpos($url, $i) === 0) && (\strlen($i) > \strlen($repository) ) ){ $repository = $i; } } if (...
[ "public", "function", "repository_from_url", "(", "string", "$", "url", ",", "bool", "$", "obj", "=", "false", ")", "{", "$", "repository", "=", "''", ";", "$", "repositories", "=", "$", "this", "->", "repositories", "(", ")", ";", "foreach", "(", "$",...
Returns the repository's name or object from an URL. @param string $url @param bool $obj @return bool|int|string
[ "Returns", "the", "repository", "s", "name", "or", "object", "from", "an", "URL", "." ]
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/project.php#L292-L307
nabab/bbn
src/bbn/appui/project.php
project.real_to_url
public function real_to_url(string $file){ foreach ( $this->repositories() as $i => $d ){ if ( // Repository's root path ($root = $this->get_root_path($d)) && (strpos($file, $root) === 0) ){ $res = $i; $bits = explode('/', substr($file, \strlen($root))); // ...
php
public function real_to_url(string $file){ foreach ( $this->repositories() as $i => $d ){ if ( // Repository's root path ($root = $this->get_root_path($d)) && (strpos($file, $root) === 0) ){ $res = $i; $bits = explode('/', substr($file, \strlen($root))); // ...
[ "public", "function", "real_to_url", "(", "string", "$", "file", ")", "{", "foreach", "(", "$", "this", "->", "repositories", "(", ")", "as", "$", "i", "=>", "$", "d", ")", "{", "if", "(", "// Repository's root path", "(", "$", "root", "=", "$", "thi...
Returns the file's URL from the real file's path. @param string $file The real file's path @return bool|string
[ "Returns", "the", "file", "s", "URL", "from", "the", "real", "file", "s", "path", "." ]
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/project.php#L315-L352
qlake/framework
src/Qlake/Database/Query.php
Query.all
public function all() { $callback = $this->connection->executeSelect($this->toSql(), ['12']); $start = time() + microtime(true); $statement = $callback(); $delay = time() + microtime(true) - $start; $items = $statement->fetchAll(PDO::FETCH_OBJ); $collection = new Collection($items, (count($items) > ...
php
public function all() { $callback = $this->connection->executeSelect($this->toSql(), ['12']); $start = time() + microtime(true); $statement = $callback(); $delay = time() + microtime(true) - $start; $items = $statement->fetchAll(PDO::FETCH_OBJ); $collection = new Collection($items, (count($items) > ...
[ "public", "function", "all", "(", ")", "{", "$", "callback", "=", "$", "this", "->", "connection", "->", "executeSelect", "(", "$", "this", "->", "toSql", "(", ")", ",", "[", "'12'", "]", ")", ";", "$", "start", "=", "time", "(", ")", "+", "micro...
/*public static function table($table) { $query = new static; return $query->from($table); }
[ "/", "*", "public", "static", "function", "table", "(", "$table", ")", "{", "$query", "=", "new", "static", ";" ]
train
https://github.com/qlake/framework/blob/0b7bad459ae0721bc5cdd141344f9dfc1acee28a/src/Qlake/Database/Query.php#L289-L304
qlake/framework
src/Qlake/Database/Query.php
Query.connection
public function connection($connection) { $connections = Config::get('database.connections'); $default = Config::get('database.default'); $connection = $connections[$default]; $connectionString = "{$connection['driver']}:host={$connection['host']};dbname={$connection['database']}"; try { $pdo = new...
php
public function connection($connection) { $connections = Config::get('database.connections'); $default = Config::get('database.default'); $connection = $connections[$default]; $connectionString = "{$connection['driver']}:host={$connection['host']};dbname={$connection['database']}"; try { $pdo = new...
[ "public", "function", "connection", "(", "$", "connection", ")", "{", "$", "connections", "=", "Config", "::", "get", "(", "'database.connections'", ")", ";", "$", "default", "=", "Config", "::", "get", "(", "'database.default'", ")", ";", "$", "connection",...
/*public function on($connection) { }
[ "/", "*", "public", "function", "on", "(", "$connection", ")", "{" ]
train
https://github.com/qlake/framework/blob/0b7bad459ae0721bc5cdd141344f9dfc1acee28a/src/Qlake/Database/Query.php#L392-L415
bfitech/zapstore
src/RedisConn.php
RedisConn.connection__predis
private function connection__predis() { $args = []; foreach (array_keys($this->verified_params) as $key) { if ($key == 'redistype' || !$this->$key) continue; $args[substr($key, 5)] = $this->$key; } try { $this->connection = new \Predis\Client($args); $this->connection->ping(); return $this->c...
php
private function connection__predis() { $args = []; foreach (array_keys($this->verified_params) as $key) { if ($key == 'redistype' || !$this->$key) continue; $args[substr($key, 5)] = $this->$key; } try { $this->connection = new \Predis\Client($args); $this->connection->ping(); return $this->c...
[ "private", "function", "connection__predis", "(", ")", "{", "$", "args", "=", "[", "]", ";", "foreach", "(", "array_keys", "(", "$", "this", "->", "verified_params", ")", "as", "$", "key", ")", "{", "if", "(", "$", "key", "==", "'redistype'", "||", "...
Open connection with predis.
[ "Open", "connection", "with", "predis", "." ]
train
https://github.com/bfitech/zapstore/blob/0353a7a3f81cbc4e25fc1646fa2f98cb490b85d0/src/RedisConn.php#L111-L125
bfitech/zapstore
src/RedisConn.php
RedisConn.connection__redis
private function connection__redis() { $this->connection = new \Redis(); # @note: This emits warning on failure instead of throwing # exception, hence the @ sign. if (!@$this->connection->connect( $this->redishost, $this->redisport, $this->redistimeout )) // @codeCoverageIgnoreStart return $this->...
php
private function connection__redis() { $this->connection = new \Redis(); # @note: This emits warning on failure instead of throwing # exception, hence the @ sign. if (!@$this->connection->connect( $this->redishost, $this->redisport, $this->redistimeout )) // @codeCoverageIgnoreStart return $this->...
[ "private", "function", "connection__redis", "(", ")", "{", "$", "this", "->", "connection", "=", "new", "\\", "Redis", "(", ")", ";", "# @note: This emits warning on failure instead of throwing", "# exception, hence the @ sign.", "if", "(", "!", "@", "$", "this", "-...
Open connection with ext-redis.
[ "Open", "connection", "with", "ext", "-", "redis", "." ]
train
https://github.com/bfitech/zapstore/blob/0353a7a3f81cbc4e25fc1646fa2f98cb490b85d0/src/RedisConn.php#L130-L157
bfitech/zapstore
src/RedisConn.php
RedisConn.connection_open_fail
private function connection_open_fail($msg='') { $logline = sprintf('Redis: %s connection failed', $this->redistype); if ($msg) $logline .= ': ' . $msg; $logline .= ' <- ' . json_encode($this->verified_params); self::$logger->error($logline); throw new RedisError(RedisError::CONNECTION_ERROR, $loglin...
php
private function connection_open_fail($msg='') { $logline = sprintf('Redis: %s connection failed', $this->redistype); if ($msg) $logline .= ': ' . $msg; $logline .= ' <- ' . json_encode($this->verified_params); self::$logger->error($logline); throw new RedisError(RedisError::CONNECTION_ERROR, $loglin...
[ "private", "function", "connection_open_fail", "(", "$", "msg", "=", "''", ")", "{", "$", "logline", "=", "sprintf", "(", "'Redis: %s connection failed'", ",", "$", "this", "->", "redistype", ")", ";", "if", "(", "$", "msg", ")", "$", "logline", ".=", "'...
Throw exception on failing connection.
[ "Throw", "exception", "on", "failing", "connection", "." ]
train
https://github.com/bfitech/zapstore/blob/0353a7a3f81cbc4e25fc1646fa2f98cb490b85d0/src/RedisConn.php#L162-L171
bfitech/zapstore
src/RedisConn.php
RedisConn.set
final public function set($key, $value, $options=null) { $res = $this->redistype == 'redis' ? $this->connection->set($key, $value, $options) : $this->connection->set($key, $value); $res_log = $res ? 'ok': 'fail'; self::$logger->info(sprintf( "Redis: set %s: %s -> '%s'.", $res_log, $key, $value)); re...
php
final public function set($key, $value, $options=null) { $res = $this->redistype == 'redis' ? $this->connection->set($key, $value, $options) : $this->connection->set($key, $value); $res_log = $res ? 'ok': 'fail'; self::$logger->info(sprintf( "Redis: set %s: %s -> '%s'.", $res_log, $key, $value)); re...
[ "final", "public", "function", "set", "(", "$", "key", ",", "$", "value", ",", "$", "options", "=", "null", ")", "{", "$", "res", "=", "$", "this", "->", "redistype", "==", "'redis'", "?", "$", "this", "->", "connection", "->", "set", "(", "$", "...
set Set the string value in argument as value of the key. If you're using Redis >= 2.6.12, you can pass extended options as explained below. @param string $key Key. @param string $value Value. @param mixed $options Expiration or phpredis options array. If you pass an integer, phpredis will redirect to SETEX and set t...
[ "set" ]
train
https://github.com/bfitech/zapstore/blob/0353a7a3f81cbc4e25fc1646fa2f98cb490b85d0/src/RedisConn.php#L199-L208
bfitech/zapstore
src/RedisConn.php
RedisConn.hset
final public function hset($key, $hkey, $value) { $res = $this->connection->hset($key, $hkey, $value); $res_log = $res === false ? 'fail' : 'ok'; self::$logger->info(sprintf( "Redis: hset %s: %s.%s -> '%s'.", $res_log, $key, $hkey, $value)); return $res; }
php
final public function hset($key, $hkey, $value) { $res = $this->connection->hset($key, $hkey, $value); $res_log = $res === false ? 'fail' : 'ok'; self::$logger->info(sprintf( "Redis: hset %s: %s.%s -> '%s'.", $res_log, $key, $hkey, $value)); return $res; }
[ "final", "public", "function", "hset", "(", "$", "key", ",", "$", "hkey", ",", "$", "value", ")", "{", "$", "res", "=", "$", "this", "->", "connection", "->", "hset", "(", "$", "key", ",", "$", "hkey", ",", "$", "value", ")", ";", "$", "res_log...
hset Add a value to the hash stored at a key. @param string $key Key. @param string $hkey Hash key. @param string $value Value. @return long 1 if old value doesn't exist and new value is added successfully, 0 if the value is already present and replaced, false on error.
[ "hset" ]
train
https://github.com/bfitech/zapstore/blob/0353a7a3f81cbc4e25fc1646fa2f98cb490b85d0/src/RedisConn.php#L222-L230
bfitech/zapstore
src/RedisConn.php
RedisConn.del
final public function del($keys) { $res = $this->connection->del($keys); $res_log = $res ? 'ok' : 'fail'; $res_keys = $keys; if (!is_array($keys)) $keys = func_get_args(); $res_keys = json_encode($keys); self::$logger->info(sprintf( "Redis: delete %s: '%s'.", $res_log, $res_keys)); return $res; ...
php
final public function del($keys) { $res = $this->connection->del($keys); $res_log = $res ? 'ok' : 'fail'; $res_keys = $keys; if (!is_array($keys)) $keys = func_get_args(); $res_keys = json_encode($keys); self::$logger->info(sprintf( "Redis: delete %s: '%s'.", $res_log, $res_keys)); return $res; ...
[ "final", "public", "function", "del", "(", "$", "keys", ")", "{", "$", "res", "=", "$", "this", "->", "connection", "->", "del", "(", "$", "keys", ")", ";", "$", "res_log", "=", "$", "res", "?", "'ok'", ":", "'fail'", ";", "$", "res_keys", "=", ...
del Remove specified keys. @param array $keys An array of keys, or variadic parameters, each corresponding to a Redis key. @return long Number of keys deleted.
[ "del" ]
train
https://github.com/bfitech/zapstore/blob/0353a7a3f81cbc4e25fc1646fa2f98cb490b85d0/src/RedisConn.php#L241-L252
bfitech/zapstore
src/RedisConn.php
RedisConn.expire
final public function expire($key, $ttl) { $method = 'setTimeout'; if ($this->redistype == 'predis') $method = 'expire'; $res = $this->connection->$method($key, $ttl); self::$logger->info(sprintf( "Redis: expire %s: %s.", $key, $ttl)); return $res; }
php
final public function expire($key, $ttl) { $method = 'setTimeout'; if ($this->redistype == 'predis') $method = 'expire'; $res = $this->connection->$method($key, $ttl); self::$logger->info(sprintf( "Redis: expire %s: %s.", $key, $ttl)); return $res; }
[ "final", "public", "function", "expire", "(", "$", "key", ",", "$", "ttl", ")", "{", "$", "method", "=", "'setTimeout'", ";", "if", "(", "$", "this", "->", "redistype", "==", "'predis'", ")", "$", "method", "=", "'expire'", ";", "$", "res", "=", "$...
expire Sets an expiration date (a timeout) on an item. @param string $key The key that will disappear. @param integer $ttl The key's remaining ttl, in seconds. @return bool True on success, false otherwise.
[ "expire" ]
train
https://github.com/bfitech/zapstore/blob/0353a7a3f81cbc4e25fc1646fa2f98cb490b85d0/src/RedisConn.php#L263-L271
bfitech/zapstore
src/RedisConn.php
RedisConn.expireat
final public function expireat($key, $ttl) { $res = $this->connection->expireat($key, $ttl); self::$logger->info(sprintf( "Redis: expireat %s: %s.", $key, $ttl)); return $res; }
php
final public function expireat($key, $ttl) { $res = $this->connection->expireat($key, $ttl); self::$logger->info(sprintf( "Redis: expireat %s: %s.", $key, $ttl)); return $res; }
[ "final", "public", "function", "expireat", "(", "$", "key", ",", "$", "ttl", ")", "{", "$", "res", "=", "$", "this", "->", "connection", "->", "expireat", "(", "$", "key", ",", "$", "ttl", ")", ";", "self", "::", "$", "logger", "->", "info", "(",...
expireat Sets an expiration timestamp of an item. @param string $key The key that will disappear. @param integer $ttl Unix timestamp. The key's date of death, in seconds after Unix epoch. @return bool True on suceess, false otherwise.
[ "expireat" ]
train
https://github.com/bfitech/zapstore/blob/0353a7a3f81cbc4e25fc1646fa2f98cb490b85d0/src/RedisConn.php#L283-L288
bfitech/zapstore
src/RedisConn.php
RedisConn.get
final public function get($key) { $res = $this->connection->get($key); self::$logger->info(sprintf( "Redis: get %s: '%s'.", $key, $res)); if ($this->redistype == 'predis' && $res == null) $res = false; return $res; }
php
final public function get($key) { $res = $this->connection->get($key); self::$logger->info(sprintf( "Redis: get %s: '%s'.", $key, $res)); if ($this->redistype == 'predis' && $res == null) $res = false; return $res; }
[ "final", "public", "function", "get", "(", "$", "key", ")", "{", "$", "res", "=", "$", "this", "->", "connection", "->", "get", "(", "$", "key", ")", ";", "self", "::", "$", "logger", "->", "info", "(", "sprintf", "(", "\"Redis: get %s: '%s'.\"", ","...
get Get the value related to the specified key. @param string $key Key. @return string|bool If key doesn't exist, false is returned. Otherwise, the value related to this key is returned.
[ "get" ]
train
https://github.com/bfitech/zapstore/blob/0353a7a3f81cbc4e25fc1646fa2f98cb490b85d0/src/RedisConn.php#L299-L306
bfitech/zapstore
src/RedisConn.php
RedisConn.hget
final public function hget($key, $hkey=null) { $res = $this->connection->hget($key, $hkey); self::$logger->info(sprintf( "Redis: hget %s.%s: '%s'.", $key, $hkey, $res)); return $res; }
php
final public function hget($key, $hkey=null) { $res = $this->connection->hget($key, $hkey); self::$logger->info(sprintf( "Redis: hget %s.%s: '%s'.", $key, $hkey, $res)); return $res; }
[ "final", "public", "function", "hget", "(", "$", "key", ",", "$", "hkey", "=", "null", ")", "{", "$", "res", "=", "$", "this", "->", "connection", "->", "hget", "(", "$", "key", ",", "$", "hkey", ")", ";", "self", "::", "$", "logger", "->", "in...
hget Get a value from the hash stored at key. If the hash table or the key doesn't exist, false is returned. @param string $key Key. @param string $hkey Hash key. @return string The value, if the command executed successfully. False otherwise.
[ "hget" ]
train
https://github.com/bfitech/zapstore/blob/0353a7a3f81cbc4e25fc1646fa2f98cb490b85d0/src/RedisConn.php#L319-L324
bfitech/zapstore
src/RedisConn.php
RedisConn.time
final public function time($with_mcs=false) { $time = $this->connection->time(); if (!$with_mcs) return $time[0]; return $time[0] + ($time[1] / 1e6); }
php
final public function time($with_mcs=false) { $time = $this->connection->time(); if (!$with_mcs) return $time[0]; return $time[0] + ($time[1] / 1e6); }
[ "final", "public", "function", "time", "(", "$", "with_mcs", "=", "false", ")", "{", "$", "time", "=", "$", "this", "->", "connection", "->", "time", "(", ")", ";", "if", "(", "!", "$", "with_mcs", ")", "return", "$", "time", "[", "0", "]", ";", ...
time Get Redis server time. Always use server time as a reference to do RedisConn::expireat in case of PHP interpreter's or Redis server's clock not being properly synched. @param bool $with_mcs If true, returned time includes microsecond fraction. @return int|float Redis server time in Unix epoch.
[ "time" ]
train
https://github.com/bfitech/zapstore/blob/0353a7a3f81cbc4e25fc1646fa2f98cb490b85d0/src/RedisConn.php#L353-L358
bfitech/zapstore
src/RedisConn.php
RedisConn.close
public function close() { if ($this->redistype == 'redis') $this->connection->close(); $this->connection = null; $this->verified_params = null; }
php
public function close() { if ($this->redistype == 'redis') $this->connection->close(); $this->connection = null; $this->verified_params = null; }
[ "public", "function", "close", "(", ")", "{", "if", "(", "$", "this", "->", "redistype", "==", "'redis'", ")", "$", "this", "->", "connection", "->", "close", "(", ")", ";", "$", "this", "->", "connection", "=", "null", ";", "$", "this", "->", "ver...
Close connection.
[ "Close", "connection", "." ]
train
https://github.com/bfitech/zapstore/blob/0353a7a3f81cbc4e25fc1646fa2f98cb490b85d0/src/RedisConn.php#L363-L368
ronaldborla/chikka
src/Borla/Chikka/Models/Request.php
Request.toArray
public function toArray() { // Get array $array = parent::toArray(); // Insert config $array['shortcode'] = $this->config->shortcode; $array['client_id'] = $this->config->client_id; $array['secret_key'] = $this->config->secret_key; // Return return $array; }
php
public function toArray() { // Get array $array = parent::toArray(); // Insert config $array['shortcode'] = $this->config->shortcode; $array['client_id'] = $this->config->client_id; $array['secret_key'] = $this->config->secret_key; // Return return $array; }
[ "public", "function", "toArray", "(", ")", "{", "// Get array", "$", "array", "=", "parent", "::", "toArray", "(", ")", ";", "// Insert config", "$", "array", "[", "'shortcode'", "]", "=", "$", "this", "->", "config", "->", "shortcode", ";", "$", "array"...
To array
[ "To", "array" ]
train
https://github.com/ronaldborla/chikka/blob/446987706f81d5a0efbc8bd6b7d3b259d0527719/src/Borla/Chikka/Models/Request.php#L35-L44
heidelpay/PhpDoc
src/Cilex/Provider/JmsSerializerServiceProvider.php
JmsSerializerServiceProvider.register
public function register(Application $app) { $vendorPath = isset($app['composer.vendor_path']) ? $app['composer.vendor_path'] : __DIR__ . '/../../../vendor'; $serializerPath = $vendorPath . '/jms/serializer/src'; if (!file_exists($serializerPath)) { $seri...
php
public function register(Application $app) { $vendorPath = isset($app['composer.vendor_path']) ? $app['composer.vendor_path'] : __DIR__ . '/../../../vendor'; $serializerPath = $vendorPath . '/jms/serializer/src'; if (!file_exists($serializerPath)) { $seri...
[ "public", "function", "register", "(", "Application", "$", "app", ")", "{", "$", "vendorPath", "=", "isset", "(", "$", "app", "[", "'composer.vendor_path'", "]", ")", "?", "$", "app", "[", "'composer.vendor_path'", "]", ":", "__DIR__", ".", "'/../../../vendo...
Registers services on the given app. @param Application $app An Application instance
[ "Registers", "services", "on", "the", "given", "app", "." ]
train
https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/Cilex/Provider/JmsSerializerServiceProvider.php#L29-L76
ekuiter/feature-php
FeaturePhp/Helper/PhpParser.php
PhpParser.parseString
public function parseString($str) { $parser = (new \PhpParser\ParserFactory())->create(\PhpParser\ParserFactory::PREFER_PHP7); $this->ast = $parser->parse($str); return $this; }
php
public function parseString($str) { $parser = (new \PhpParser\ParserFactory())->create(\PhpParser\ParserFactory::PREFER_PHP7); $this->ast = $parser->parse($str); return $this; }
[ "public", "function", "parseString", "(", "$", "str", ")", "{", "$", "parser", "=", "(", "new", "\\", "PhpParser", "\\", "ParserFactory", "(", ")", ")", "->", "create", "(", "\\", "PhpParser", "\\", "ParserFactory", "::", "PREFER_PHP7", ")", ";", "$", ...
Parses a PHP string. @param string $str @return PhpParser
[ "Parses", "a", "PHP", "string", "." ]
train
https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Helper/PhpParser.php#L29-L33
ekuiter/feature-php
FeaturePhp/Helper/PhpParser.php
PhpParser.getExactlyOneClass
public function getExactlyOneClass($fileSource) { if (count($this->ast) !== 1 || $this->ast[0]->getType() !== "Stmt_Class") throw new PhpParserException("\"$fileSource\" does not define exactly one class"); return $this->ast[0]; }
php
public function getExactlyOneClass($fileSource) { if (count($this->ast) !== 1 || $this->ast[0]->getType() !== "Stmt_Class") throw new PhpParserException("\"$fileSource\" does not define exactly one class"); return $this->ast[0]; }
[ "public", "function", "getExactlyOneClass", "(", "$", "fileSource", ")", "{", "if", "(", "count", "(", "$", "this", "->", "ast", ")", "!==", "1", "||", "$", "this", "->", "ast", "[", "0", "]", "->", "getType", "(", ")", "!==", "\"Stmt_Class\"", ")", ...
Asserts that the code defines one class and returns it. @param string $fileSource @return \PhpParser\Node\Stmt\Class_
[ "Asserts", "that", "the", "code", "defines", "one", "class", "and", "returns", "it", "." ]
train
https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Helper/PhpParser.php#L60-L64
clickalicious/caching-middleware
src/Cache.php
Cache.getCachedResponseHtml
protected function getCachedResponseHtml(RequestInterface $request) { return $this ->getCacheItemPool() ->getItem($this->createKeyFromRequest($request)) ->get(); }
php
protected function getCachedResponseHtml(RequestInterface $request) { return $this ->getCacheItemPool() ->getItem($this->createKeyFromRequest($request)) ->get(); }
[ "protected", "function", "getCachedResponseHtml", "(", "RequestInterface", "$", "request", ")", "{", "return", "$", "this", "->", "getCacheItemPool", "(", ")", "->", "getItem", "(", "$", "this", "->", "createKeyFromRequest", "(", "$", "request", ")", ")", "->"...
Returns a cached Response by Request(Interface). @param RequestInterface $request the request to return cached response for @author Benjamin Carl <opensource@clickalicious.de> @return string|null The HTML for response as string if found, otherwise NULL @throws \Psr\Cache\InvalidArgumentException
[ "Returns", "a", "cached", "Response", "by", "Request", "(", "Interface", ")", "." ]
train
https://github.com/clickalicious/caching-middleware/blob/86ce045ec19bf3bcb48c656ca27f7cdfa03746ed/src/Cache.php#L225-L231
clickalicious/caching-middleware
src/Cache.php
Cache.handle
protected function handle(ServerRequestInterface $request, ResponseInterface $response, callable $next) { // @codeCoverageIgnoreStart if ($html = $this->getCachedResponseHtml($request)) { return $this->buildResponse($html, $response); } // @codeCoverageIgnoreEnd ...
php
protected function handle(ServerRequestInterface $request, ResponseInterface $response, callable $next) { // @codeCoverageIgnoreStart if ($html = $this->getCachedResponseHtml($request)) { return $this->buildResponse($html, $response); } // @codeCoverageIgnoreEnd ...
[ "protected", "function", "handle", "(", "ServerRequestInterface", "$", "request", ",", "ResponseInterface", "$", "response", ",", "callable", "$", "next", ")", "{", "// @codeCoverageIgnoreStart", "if", "(", "$", "html", "=", "$", "this", "->", "getCachedResponseHt...
@param \Psr\Http\Message\ServerRequestInterface $request @param \Psr\Http\Message\ResponseInterface $response @param callable $next @return \Psr\Http\Message\ResponseInterface @throws \InvalidArgumentException @throws \Psr\Cache\InvalidArgumentException @throws \RuntimeException
[ "@param", "\\", "Psr", "\\", "Http", "\\", "Message", "\\", "ServerRequestInterface", "$request", "@param", "\\", "Psr", "\\", "Http", "\\", "Message", "\\", "ResponseInterface", "$response", "@param", "callable", "$next" ]
train
https://github.com/clickalicious/caching-middleware/blob/86ce045ec19bf3bcb48c656ca27f7cdfa03746ed/src/Cache.php#L248-L264
clickalicious/caching-middleware
src/Cache.php
Cache.buildResponse
protected function buildResponse($html, ResponseInterface $response) { // @codeCoverageIgnoreStart $body = new Stream('php://memory', 'w'); $body->write($html); $response = $response->withBody($body); return $response; // @codeCoverageIgnoreEnd }
php
protected function buildResponse($html, ResponseInterface $response) { // @codeCoverageIgnoreStart $body = new Stream('php://memory', 'w'); $body->write($html); $response = $response->withBody($body); return $response; // @codeCoverageIgnoreEnd }
[ "protected", "function", "buildResponse", "(", "$", "html", ",", "ResponseInterface", "$", "response", ")", "{", "// @codeCoverageIgnoreStart", "$", "body", "=", "new", "Stream", "(", "'php://memory'", ",", "'w'", ")", ";", "$", "body", "->", "write", "(", "...
Builds response instance with HTML body from HTML passed in. @param string $html HTML used for response body @param \Psr\Http\Message\ResponseInterface $response Response used as base for response @author Benjamin Carl <opensource@clickalicious.de> @return \Psr\Http\Message\ResponseI...
[ "Builds", "response", "instance", "with", "HTML", "body", "from", "HTML", "passed", "in", "." ]
train
https://github.com/clickalicious/caching-middleware/blob/86ce045ec19bf3bcb48c656ca27f7cdfa03746ed/src/Cache.php#L279-L288
clickalicious/caching-middleware
src/Cache.php
Cache.cacheResponse
protected function cacheResponse(RequestInterface $request, ResponseInterface $response) { $cacheItem = $this->createCacheItem($this->createKeyFromRequest($request)); $value = $response->getBody()->__toString(); $cacheItem->set($value); $this ->getCacheItemPool() ...
php
protected function cacheResponse(RequestInterface $request, ResponseInterface $response) { $cacheItem = $this->createCacheItem($this->createKeyFromRequest($request)); $value = $response->getBody()->__toString(); $cacheItem->set($value); $this ->getCacheItemPool() ...
[ "protected", "function", "cacheResponse", "(", "RequestInterface", "$", "request", ",", "ResponseInterface", "$", "response", ")", "{", "$", "cacheItem", "=", "$", "this", "->", "createCacheItem", "(", "$", "this", "->", "createKeyFromRequest", "(", "$", "reques...
Caches a response by Request & Response. @param RequestInterface $request Request as identifier @param ResponseInterface $response Response to cache @author Benjamin Carl <opensource@clickalicious.de>
[ "Caches", "a", "response", "by", "Request", "&", "Response", "." ]
train
https://github.com/clickalicious/caching-middleware/blob/86ce045ec19bf3bcb48c656ca27f7cdfa03746ed/src/Cache.php#L330-L339
Eresus/EresusCMS
src/core/Feed/Writer/Item.php
Eresus_Feed_Writer_Item.addElement
public function addElement($elementName, $content, $attributes = null) { $this->elements[$elementName]['name'] = $elementName; $this->elements[$elementName]['content'] = $content; $this->elements[$elementName]['attributes'] = $attributes; }
php
public function addElement($elementName, $content, $attributes = null) { $this->elements[$elementName]['name'] = $elementName; $this->elements[$elementName]['content'] = $content; $this->elements[$elementName]['attributes'] = $attributes; }
[ "public", "function", "addElement", "(", "$", "elementName", ",", "$", "content", ",", "$", "attributes", "=", "null", ")", "{", "$", "this", "->", "elements", "[", "$", "elementName", "]", "[", "'name'", "]", "=", "$", "elementName", ";", "$", "this",...
Add an element to elements array @param string $elementName The tag name of an element @param string $content The content of tag @param array $attributes Attributes(if any) in 'attrName' => 'attrValue' format @return void
[ "Add", "an", "element", "to", "elements", "array" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/Feed/Writer/Item.php#L65-L70
Eresus/EresusCMS
src/core/Feed/Writer/Item.php
Eresus_Feed_Writer_Item.addElementArray
public function addElementArray($elementArray) { if (!is_array($elementArray)) { return; } foreach ($elementArray as $elementName => $content) { $this->addElement($elementName, $content); } }
php
public function addElementArray($elementArray) { if (!is_array($elementArray)) { return; } foreach ($elementArray as $elementName => $content) { $this->addElement($elementName, $content); } }
[ "public", "function", "addElementArray", "(", "$", "elementArray", ")", "{", "if", "(", "!", "is_array", "(", "$", "elementArray", ")", ")", "{", "return", ";", "}", "foreach", "(", "$", "elementArray", "as", "$", "elementName", "=>", "$", "content", ")"...
Set multiple feed elements from an array. Elements which have attributes cannot be added by this method @param array array of elements in 'tagName' => 'tagContent' format. @return void
[ "Set", "multiple", "feed", "elements", "from", "an", "array", ".", "Elements", "which", "have", "attributes", "cannot", "be", "added", "by", "this", "method" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/Feed/Writer/Item.php#L79-L89
Eresus/EresusCMS
src/core/Feed/Writer/Item.php
Eresus_Feed_Writer_Item.setDescription
public function setDescription($description) { $tag = ($this->version == Eresus_Feed_Writer::ATOM) ? 'summary' : 'description'; $this->addElement($tag, $description); }
php
public function setDescription($description) { $tag = ($this->version == Eresus_Feed_Writer::ATOM) ? 'summary' : 'description'; $this->addElement($tag, $description); }
[ "public", "function", "setDescription", "(", "$", "description", ")", "{", "$", "tag", "=", "(", "$", "this", "->", "version", "==", "Eresus_Feed_Writer", "::", "ATOM", ")", "?", "'summary'", ":", "'description'", ";", "$", "this", "->", "addElement", "(",...
Set the 'description' element of feed item @param string $description The content of 'description' element @return void
[ "Set", "the", "description", "element", "of", "feed", "item" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/Feed/Writer/Item.php#L107-L111
Eresus/EresusCMS
src/core/Feed/Writer/Item.php
Eresus_Feed_Writer_Item.setDate
public function setDate($date) { if (!is_numeric($date)) { $date = strtotime($date); } if ($this->version == Eresus_Feed_Writer::ATOM) { $tag = 'updated'; $value = date(DATE_ATOM, $date); } elseif ($this->version == Eresus_...
php
public function setDate($date) { if (!is_numeric($date)) { $date = strtotime($date); } if ($this->version == Eresus_Feed_Writer::ATOM) { $tag = 'updated'; $value = date(DATE_ATOM, $date); } elseif ($this->version == Eresus_...
[ "public", "function", "setDate", "(", "$", "date", ")", "{", "if", "(", "!", "is_numeric", "(", "$", "date", ")", ")", "{", "$", "date", "=", "strtotime", "(", "$", "date", ")", ";", "}", "if", "(", "$", "this", "->", "version", "==", "Eresus_Fee...
Set the 'date' element of feed item @param string $date The content of 'date' element @return void
[ "Set", "the", "date", "element", "of", "feed", "item" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/Feed/Writer/Item.php#L130-L154
Eresus/EresusCMS
src/core/Feed/Writer/Item.php
Eresus_Feed_Writer_Item.setLink
public function setLink($link) { if ($this->version == Eresus_Feed_Writer::RSS2 || $this->version == Eresus_Feed_Writer::RSS1) { $this->addElement('link', $link); } else { $this->addElement('link', '', array('href' => $link)); $this->addEle...
php
public function setLink($link) { if ($this->version == Eresus_Feed_Writer::RSS2 || $this->version == Eresus_Feed_Writer::RSS1) { $this->addElement('link', $link); } else { $this->addElement('link', '', array('href' => $link)); $this->addEle...
[ "public", "function", "setLink", "(", "$", "link", ")", "{", "if", "(", "$", "this", "->", "version", "==", "Eresus_Feed_Writer", "::", "RSS2", "||", "$", "this", "->", "version", "==", "Eresus_Feed_Writer", "::", "RSS1", ")", "{", "$", "this", "->", "...
Set the 'link' element of feed item @param string $link The content of 'link' element @return void
[ "Set", "the", "link", "element", "of", "feed", "item" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/Feed/Writer/Item.php#L162-L174
Eresus/EresusCMS
src/core/Feed/Writer/Item.php
Eresus_Feed_Writer_Item.setEncloser
public function setEncloser($url, $length, $type) { $attributes = array('url' => $url, 'length' => $length, 'type' => $type); $this->addElement('enclosure', '', $attributes); }
php
public function setEncloser($url, $length, $type) { $attributes = array('url' => $url, 'length' => $length, 'type' => $type); $this->addElement('enclosure', '', $attributes); }
[ "public", "function", "setEncloser", "(", "$", "url", ",", "$", "length", ",", "$", "type", ")", "{", "$", "attributes", "=", "array", "(", "'url'", "=>", "$", "url", ",", "'length'", "=>", "$", "length", ",", "'type'", "=>", "$", "type", ")", ";",...
Set the 'encloser' element of feed item For RSS 2.0 only @param string $url The url attribute of encloser tag @param string $length The length attribute of encloser tag @param string $type The type attribute of encloser tag @return void
[ "Set", "the", "encloser", "element", "of", "feed", "item", "For", "RSS", "2", ".", "0", "only" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/Feed/Writer/Item.php#L185-L189
ezsystems/ezcomments-ls-extension
classes/ezcomnotification.php
ezcomNotification.fetchNotificationList
static function fetchNotificationList( $status = 1, $length = null, $offset = 0, $sorts = null ) { $cond = array(); if ( is_null( $status ) ) { $cond = null; } else { $cond['status'] = $status; } $limit = array(); if ( is_nu...
php
static function fetchNotificationList( $status = 1, $length = null, $offset = 0, $sorts = null ) { $cond = array(); if ( is_null( $status ) ) { $cond = null; } else { $cond['status'] = $status; } $limit = array(); if ( is_nu...
[ "static", "function", "fetchNotificationList", "(", "$", "status", "=", "1", ",", "$", "length", "=", "null", ",", "$", "offset", "=", "0", ",", "$", "sorts", "=", "null", ")", "{", "$", "cond", "=", "array", "(", ")", ";", "if", "(", "is_null", ...
Fetch the list of notification @param $length: count of the notification to be fetched @param $status: the status of the notification @param $offset: offset @return notification list
[ "Fetch", "the", "list", "of", "notification" ]
train
https://github.com/ezsystems/ezcomments-ls-extension/blob/2b4cd8c34d4a77813e4d6a9c5a0d317a274c63c5/classes/ezcomnotification.php#L98-L120
neilime/zf2-tree-layout-stack
src/TreeLayoutStack/TemplatingService.php
TemplatingService.factory
public static function factory($aOptions){ if($aOptions instanceof \Traversable)$aOptions = \Zend\Stdlib\ArrayUtils::iteratorToArray($aOptions); elseif(!is_array($aOptions))throw new \InvalidArgumentException(__METHOD__.' expects an array or Traversable object; received "'.(is_object($aOptions)?get_class($aOptions)...
php
public static function factory($aOptions){ if($aOptions instanceof \Traversable)$aOptions = \Zend\Stdlib\ArrayUtils::iteratorToArray($aOptions); elseif(!is_array($aOptions))throw new \InvalidArgumentException(__METHOD__.' expects an array or Traversable object; received "'.(is_object($aOptions)?get_class($aOptions)...
[ "public", "static", "function", "factory", "(", "$", "aOptions", ")", "{", "if", "(", "$", "aOptions", "instanceof", "\\", "Traversable", ")", "$", "aOptions", "=", "\\", "Zend", "\\", "Stdlib", "\\", "ArrayUtils", "::", "iteratorToArray", "(", "$", "aOpti...
Instantiate a Templating service @param array|Traversable $aOptions @throws \InvalidArgumentException @return \TreeLayoutStack\TemplatingService
[ "Instantiate", "a", "Templating", "service" ]
train
https://github.com/neilime/zf2-tree-layout-stack/blob/0a1431816ca1f4d4053b6f7f9ba83d8e72ad564a/src/TreeLayoutStack/TemplatingService.php#L28-L32
neilime/zf2-tree-layout-stack
src/TreeLayoutStack/TemplatingService.php
TemplatingService.buildLayoutTemplate
public function buildLayoutTemplate(\Zend\Mvc\MvcEvent $oEvent){ $oRequest = $oEvent->getRequest(); if(!($oRequest instanceof \Zend\Http\Request) || $oRequest->isXmlHttpRequest() || ( ($oView = $oEvent->getResult()) instanceof \Zend\View\Model\ModelInterface && $oView->terminate() ))return $this; ...
php
public function buildLayoutTemplate(\Zend\Mvc\MvcEvent $oEvent){ $oRequest = $oEvent->getRequest(); if(!($oRequest instanceof \Zend\Http\Request) || $oRequest->isXmlHttpRequest() || ( ($oView = $oEvent->getResult()) instanceof \Zend\View\Model\ModelInterface && $oView->terminate() ))return $this; ...
[ "public", "function", "buildLayoutTemplate", "(", "\\", "Zend", "\\", "Mvc", "\\", "MvcEvent", "$", "oEvent", ")", "{", "$", "oRequest", "=", "$", "oEvent", "->", "getRequest", "(", ")", ";", "if", "(", "!", "(", "$", "oRequest", "instanceof", "\\", "Z...
Define layout template @param \Zend\Mvc\MvcEvent $oEvent @throws \RuntimeException @return \TreeLayoutStack\TemplatingService
[ "Define", "layout", "template" ]
train
https://github.com/neilime/zf2-tree-layout-stack/blob/0a1431816ca1f4d4053b6f7f9ba83d8e72ad564a/src/TreeLayoutStack/TemplatingService.php#L84-L118
expectation-php/expect
src/MatcherPackage.php
MatcherPackage.registerTo
public function registerTo(MatcherRegistry $registry) { $provideMatchers = $this->getProvideMatchers(); foreach ($provideMatchers as $provideMatcher) { $registry->register($provideMatcher); } }
php
public function registerTo(MatcherRegistry $registry) { $provideMatchers = $this->getProvideMatchers(); foreach ($provideMatchers as $provideMatcher) { $registry->register($provideMatcher); } }
[ "public", "function", "registerTo", "(", "MatcherRegistry", "$", "registry", ")", "{", "$", "provideMatchers", "=", "$", "this", "->", "getProvideMatchers", "(", ")", ";", "foreach", "(", "$", "provideMatchers", "as", "$", "provideMatcher", ")", "{", "$", "r...
{@inheritdoc}
[ "{" ]
train
https://github.com/expectation-php/expect/blob/1a32c5af37f3dc8dabe4e8eedeeb21aea16ce139/src/MatcherPackage.php#L54-L61
expectation-php/expect
src/MatcherPackage.php
MatcherPackage.fromPackageFile
public static function fromPackageFile($composerJson) { if (file_exists($composerJson) === false) { throw new ComposerJsonNotFoundException("File {$composerJson} not found."); } $config = Config::load($composerJson); $autoload = $config->get('autoload.psr-4'); $...
php
public static function fromPackageFile($composerJson) { if (file_exists($composerJson) === false) { throw new ComposerJsonNotFoundException("File {$composerJson} not found."); } $config = Config::load($composerJson); $autoload = $config->get('autoload.psr-4'); $...
[ "public", "static", "function", "fromPackageFile", "(", "$", "composerJson", ")", "{", "if", "(", "file_exists", "(", "$", "composerJson", ")", "===", "false", ")", "{", "throw", "new", "ComposerJsonNotFoundException", "(", "\"File {$composerJson} not found.\"", ")"...
Create a new matcher package from composer.json @param string $composerJson composer.json path @throws \expect\package\ComposerJsonNotFoundException
[ "Create", "a", "new", "matcher", "package", "from", "composer", ".", "json" ]
train
https://github.com/expectation-php/expect/blob/1a32c5af37f3dc8dabe4e8eedeeb21aea16ce139/src/MatcherPackage.php#L107-L126
gpupo/common-schema
src/ORM/Entity/Application/API/OAuth/Client/AccessToken.php
AccessToken.setClient
public function setClient(\Gpupo\CommonSchema\ORM\Entity\Application\API\OAuth\Client\Client $client = null) { $this->client = $client; return $this; }
php
public function setClient(\Gpupo\CommonSchema\ORM\Entity\Application\API\OAuth\Client\Client $client = null) { $this->client = $client; return $this; }
[ "public", "function", "setClient", "(", "\\", "Gpupo", "\\", "CommonSchema", "\\", "ORM", "\\", "Entity", "\\", "Application", "\\", "API", "\\", "OAuth", "\\", "Client", "\\", "Client", "$", "client", "=", "null", ")", "{", "$", "this", "->", "client", ...
Set client. @param null|\Gpupo\CommonSchema\ORM\Entity\Application\API\OAuth\Client\Client $client @return AccessToken
[ "Set", "client", "." ]
train
https://github.com/gpupo/common-schema/blob/a762d2eb3063b7317c72c69cbb463b1f95b86b0a/src/ORM/Entity/Application/API/OAuth/Client/AccessToken.php#L274-L279
ShaoZeMing/laravel-merchant
src/Grid/Tools/BatchActions.php
BatchActions.render
public function render() { if (!$this->enableDelete) { $this->actions->shift(); } if ($this->actions->isEmpty()) { return ''; } $this->setUpScripts(); return view('merchant::grid.batch-actions', ['actions' => $this->actions])->render(); ...
php
public function render() { if (!$this->enableDelete) { $this->actions->shift(); } if ($this->actions->isEmpty()) { return ''; } $this->setUpScripts(); return view('merchant::grid.batch-actions', ['actions' => $this->actions])->render(); ...
[ "public", "function", "render", "(", ")", "{", "if", "(", "!", "$", "this", "->", "enableDelete", ")", "{", "$", "this", "->", "actions", "->", "shift", "(", ")", ";", "}", "if", "(", "$", "this", "->", "actions", "->", "isEmpty", "(", ")", ")", ...
Render BatchActions button groups. @return string
[ "Render", "BatchActions", "button", "groups", "." ]
train
https://github.com/ShaoZeMing/laravel-merchant/blob/20801b1735e7832a6e58b37c2c391328f8d626fa/src/Grid/Tools/BatchActions.php#L124-L137
php-lug/lug
src/Component/Grid/Sort/Sorter.php
Sorter.sort
public function sort(DataSourceBuilderInterface $builder, GridInterface $grid, array $sorting) { foreach ($sorting as $name => $order) { if (!$grid->hasSort($name) || !in_array($order, [self::ASC, self::DESC], true)) { continue; } $sort = $grid->getSort($...
php
public function sort(DataSourceBuilderInterface $builder, GridInterface $grid, array $sorting) { foreach ($sorting as $name => $order) { if (!$grid->hasSort($name) || !in_array($order, [self::ASC, self::DESC], true)) { continue; } $sort = $grid->getSort($...
[ "public", "function", "sort", "(", "DataSourceBuilderInterface", "$", "builder", ",", "GridInterface", "$", "grid", ",", "array", "$", "sorting", ")", "{", "foreach", "(", "$", "sorting", "as", "$", "name", "=>", "$", "order", ")", "{", "if", "(", "!", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Grid/Sort/Sorter.php#L41-L61
php-lug/lug
src/Component/Grid/Sort/Sorter.php
Sorter.resolveTypes
private function resolveTypes($type) { $sortTypes = []; do { $sortTypes[] = $sortType = $this->sortRegistry[$type]; } while (($type = $sortType->getParent()) !== null); return $sortTypes; }
php
private function resolveTypes($type) { $sortTypes = []; do { $sortTypes[] = $sortType = $this->sortRegistry[$type]; } while (($type = $sortType->getParent()) !== null); return $sortTypes; }
[ "private", "function", "resolveTypes", "(", "$", "type", ")", "{", "$", "sortTypes", "=", "[", "]", ";", "do", "{", "$", "sortTypes", "[", "]", "=", "$", "sortType", "=", "$", "this", "->", "sortRegistry", "[", "$", "type", "]", ";", "}", "while", ...
@param string $type @return TypeInterface[]
[ "@param", "string", "$type" ]
train
https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Grid/Sort/Sorter.php#L68-L77
alevilar/ristorantino-vendor
Acl/Controller/Component/AclManagerComponent.php
AclManagerComponent.check_controller_hash_tmp_file
private function check_controller_hash_tmp_file() { if(is_writable(dirname($this->controllers_hash_file))) { App :: uses('File', 'Utility'); $file = new File($this->controllers_hash_file, true); return $file->exists(); } else { $this->Session->setFlash(sprin...
php
private function check_controller_hash_tmp_file() { if(is_writable(dirname($this->controllers_hash_file))) { App :: uses('File', 'Utility'); $file = new File($this->controllers_hash_file, true); return $file->exists(); } else { $this->Session->setFlash(sprin...
[ "private", "function", "check_controller_hash_tmp_file", "(", ")", "{", "if", "(", "is_writable", "(", "dirname", "(", "$", "this", "->", "controllers_hash_file", ")", ")", ")", "{", "App", "::", "uses", "(", "'File'", ",", "'Utility'", ")", ";", "$", "fil...
Check if the file containing the stored controllers hashes can be created, and create it if it does not exist @return boolean true if the file exists or could be created
[ "Check", "if", "the", "file", "containing", "the", "stored", "controllers", "hashes", "can", "be", "created", "and", "create", "it", "if", "it", "does", "not", "exist" ]
train
https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Acl/Controller/Component/AclManagerComponent.php#L31-L44
alevilar/ristorantino-vendor
Acl/Controller/Component/AclManagerComponent.php
AclManagerComponent.check_user_model_acts_as_acl_requester
public function check_user_model_acts_as_acl_requester($model_classname) { // if(!isset($this->controller->{$model_classname})) // { // /* // * Do not use $this->controller->loadModel, as calling it from a plugin may prevent correct loading of behaviors // */ // $user_model = ClassRegistry :: init($model_c...
php
public function check_user_model_acts_as_acl_requester($model_classname) { // if(!isset($this->controller->{$model_classname})) // { // /* // * Do not use $this->controller->loadModel, as calling it from a plugin may prevent correct loading of behaviors // */ // $user_model = ClassRegistry :: init($model_c...
[ "public", "function", "check_user_model_acts_as_acl_requester", "(", "$", "model_classname", ")", "{", "//\t\tif(!isset($this->controller->{$model_classname}))", "//\t\t{", "//\t\t\t/*", "//\t\t\t * Do not use $this->controller->loadModel, as calling it from a plugin may prevent correct loadin...
*************************************************************************************
[ "*************************************************************************************" ]
train
https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Acl/Controller/Component/AclManagerComponent.php#L48-L79
alevilar/ristorantino-vendor
Acl/Controller/Component/AclManagerComponent.php
AclManagerComponent.set_display_name
public function set_display_name($model_classname, $field_expression) { $model_instance = $this->get_model_instance($model_classname); $schema = $model_instance->schema(); if(array_key_exists($field_expression, $schema) || array_key_exists(str_replace($model_classname . '.',...
php
public function set_display_name($model_classname, $field_expression) { $model_instance = $this->get_model_instance($model_classname); $schema = $model_instance->schema(); if(array_key_exists($field_expression, $schema) || array_key_exists(str_replace($model_classname . '.',...
[ "public", "function", "set_display_name", "(", "$", "model_classname", ",", "$", "field_expression", ")", "{", "$", "model_instance", "=", "$", "this", "->", "get_model_instance", "(", "$", "model_classname", ")", ";", "$", "schema", "=", "$", "model_instance", ...
Check if a given field_expression is an existing fieldname for the given model If it doesn't exist, a virtual field called 'alaxos_acl_display_name' is created with the given expression @param string $model_classname @param string $field_expression @return string The name of the field to use as display name
[ "Check", "if", "a", "given", "field_expression", "is", "an", "existing", "fieldname", "for", "the", "given", "model" ]
train
https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Acl/Controller/Component/AclManagerComponent.php#L90-L128
alevilar/ristorantino-vendor
Acl/Controller/Component/AclManagerComponent.php
AclManagerComponent.get_model_instance
private function get_model_instance($model_classname) { if(!isset($this->controller->{$model_classname})) { /* * Do not use $this->controller->loadModel, as calling it from a plugin may prevent correct loading of behaviors */ $model_instance = ClassRegistry :: init($model_classname); } else ...
php
private function get_model_instance($model_classname) { if(!isset($this->controller->{$model_classname})) { /* * Do not use $this->controller->loadModel, as calling it from a plugin may prevent correct loading of behaviors */ $model_instance = ClassRegistry :: init($model_classname); } else ...
[ "private", "function", "get_model_instance", "(", "$", "model_classname", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "controller", "->", "{", "$", "model_classname", "}", ")", ")", "{", "/*\n\t\t\t * Do not use $this->controller->loadModel, as callin...
Return an instance of the given model name @param string $model_classname @return Model
[ "Return", "an", "instance", "of", "the", "given", "model", "name" ]
train
https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Acl/Controller/Component/AclManagerComponent.php#L136-L151
alevilar/ristorantino-vendor
Acl/Controller/Component/AclManagerComponent.php
AclManagerComponent.get_stored_controllers_hashes
public function get_stored_controllers_hashes() { $file = new File($this->controllers_hash_file); $file_content = $file->read(); if(!empty($file_content)) { $stored_controller_hashes = unserialize($file_content); } else { $stored_controller_hashes = array(); } return $stored_controller...
php
public function get_stored_controllers_hashes() { $file = new File($this->controllers_hash_file); $file_content = $file->read(); if(!empty($file_content)) { $stored_controller_hashes = unserialize($file_content); } else { $stored_controller_hashes = array(); } return $stored_controller...
[ "public", "function", "get_stored_controllers_hashes", "(", ")", "{", "$", "file", "=", "new", "File", "(", "$", "this", "->", "controllers_hash_file", ")", ";", "$", "file_content", "=", "$", "file", "->", "read", "(", ")", ";", "if", "(", "!", "empty",...
return the stored array of controllers hashes @return array
[ "return", "the", "stored", "array", "of", "controllers", "hashes" ]
train
https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Acl/Controller/Component/AclManagerComponent.php#L158-L173
alevilar/ristorantino-vendor
Acl/Controller/Component/AclManagerComponent.php
AclManagerComponent.get_current_controllers_hashes
public function get_current_controllers_hashes() { $controllers = $this->AclReflector->get_all_controllers(); $current_controller_hashes = array(); foreach($controllers as $controller) { $ctler_file = new File($controller['file']); $current_controller_hashes[$controlle...
php
public function get_current_controllers_hashes() { $controllers = $this->AclReflector->get_all_controllers(); $current_controller_hashes = array(); foreach($controllers as $controller) { $ctler_file = new File($controller['file']); $current_controller_hashes[$controlle...
[ "public", "function", "get_current_controllers_hashes", "(", ")", "{", "$", "controllers", "=", "$", "this", "->", "AclReflector", "->", "get_all_controllers", "(", ")", ";", "$", "current_controller_hashes", "=", "array", "(", ")", ";", "foreach", "(", "$", "...
return an array of all controllers hashes @return array
[ "return", "an", "array", "of", "all", "controllers", "hashes" ]
train
https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Acl/Controller/Component/AclManagerComponent.php#L180-L193
alevilar/ristorantino-vendor
Acl/Controller/Component/AclManagerComponent.php
AclManagerComponent.get_missing_acos
public function get_missing_acos($update_hash_file = true) { if($this->check_controller_hash_tmp_file()) { $missing_aco_nodes = array(); $stored_controller_hashes = $this->get_stored_controllers_hashes(); $current_controller_hashes = $this->get_current_controllers_hashes(); ...
php
public function get_missing_acos($update_hash_file = true) { if($this->check_controller_hash_tmp_file()) { $missing_aco_nodes = array(); $stored_controller_hashes = $this->get_stored_controllers_hashes(); $current_controller_hashes = $this->get_current_controllers_hashes(); ...
[ "public", "function", "get_missing_acos", "(", "$", "update_hash_file", "=", "true", ")", "{", "if", "(", "$", "this", "->", "check_controller_hash_tmp_file", "(", ")", ")", "{", "$", "missing_aco_nodes", "=", "array", "(", ")", ";", "$", "stored_controller_ha...
Get a list of plugins, controllers and actions that don't have any corresponding ACO. To run faster, the method only checks controllers that have not already been checked or that have been modified. Depending on the $update_hash_file, the method may return the missing ACOs only once (in order to show the alert message...
[ "Get", "a", "list", "of", "plugins", "controllers", "and", "actions", "that", "don", "t", "have", "any", "corresponding", "ACO", ".", "To", "run", "faster", "the", "method", "only", "checks", "controllers", "that", "have", "not", "already", "been", "checked"...
train
https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Acl/Controller/Component/AclManagerComponent.php#L205-L255
alevilar/ristorantino-vendor
Acl/Controller/Component/AclManagerComponent.php
AclManagerComponent.create_acos
public function create_acos() { $aco =& $this->Acl->Aco; $log = array(); $controllers = $this->AclReflector->get_all_controllers(); /****************************************** * Create 'controllers' node if it does not exist */ $root = $aco->node('controllers'); ...
php
public function create_acos() { $aco =& $this->Acl->Aco; $log = array(); $controllers = $this->AclReflector->get_all_controllers(); /****************************************** * Create 'controllers' node if it does not exist */ $root = $aco->node('controllers'); ...
[ "public", "function", "create_acos", "(", ")", "{", "$", "aco", "=", "&", "$", "this", "->", "Acl", "->", "Aco", ";", "$", "log", "=", "array", "(", ")", ";", "$", "controllers", "=", "$", "this", "->", "AclReflector", "->", "get_all_controllers", "(...
Store missing ACOs for all actions in the datasource If necessary, it creates actions parent nodes (plugin and controller) as well
[ "Store", "missing", "ACOs", "for", "all", "actions", "in", "the", "datasource", "If", "necessary", "it", "creates", "actions", "parent", "nodes", "(", "plugin", "and", "controller", ")", "as", "well" ]
train
https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Acl/Controller/Component/AclManagerComponent.php#L261-L394
brick/di
src/InjectionPolicy/AnnotationPolicy.php
AnnotationPolicy.isClassInjected
public function isClassInjected(\ReflectionClass $class) : bool { foreach ($this->reader->getClassAnnotations($class) as $annotation) { if ($annotation instanceof Inject) { return true; } } return false; }
php
public function isClassInjected(\ReflectionClass $class) : bool { foreach ($this->reader->getClassAnnotations($class) as $annotation) { if ($annotation instanceof Inject) { return true; } } return false; }
[ "public", "function", "isClassInjected", "(", "\\", "ReflectionClass", "$", "class", ")", ":", "bool", "{", "foreach", "(", "$", "this", "->", "reader", "->", "getClassAnnotations", "(", "$", "class", ")", "as", "$", "annotation", ")", "{", "if", "(", "$...
{@inheritdoc}
[ "{" ]
train
https://github.com/brick/di/blob/6ced82ab3623b8f1470317d38cbd2de855e7aa3d/src/InjectionPolicy/AnnotationPolicy.php#L40-L49
brick/di
src/InjectionPolicy/AnnotationPolicy.php
AnnotationPolicy.isMethodInjected
public function isMethodInjected(\ReflectionMethod $method) : bool { foreach ($this->reader->getMethodAnnotations($method) as $annotation) { if ($annotation instanceof Inject) { return true; } } return false; }
php
public function isMethodInjected(\ReflectionMethod $method) : bool { foreach ($this->reader->getMethodAnnotations($method) as $annotation) { if ($annotation instanceof Inject) { return true; } } return false; }
[ "public", "function", "isMethodInjected", "(", "\\", "ReflectionMethod", "$", "method", ")", ":", "bool", "{", "foreach", "(", "$", "this", "->", "reader", "->", "getMethodAnnotations", "(", "$", "method", ")", "as", "$", "annotation", ")", "{", "if", "(",...
{@inheritdoc}
[ "{" ]
train
https://github.com/brick/di/blob/6ced82ab3623b8f1470317d38cbd2de855e7aa3d/src/InjectionPolicy/AnnotationPolicy.php#L54-L63
brick/di
src/InjectionPolicy/AnnotationPolicy.php
AnnotationPolicy.isPropertyInjected
public function isPropertyInjected(\ReflectionProperty $property) : bool { foreach ($this->reader->getPropertyAnnotations($property) as $annotation) { if ($annotation instanceof Inject) { return true; } } return false; }
php
public function isPropertyInjected(\ReflectionProperty $property) : bool { foreach ($this->reader->getPropertyAnnotations($property) as $annotation) { if ($annotation instanceof Inject) { return true; } } return false; }
[ "public", "function", "isPropertyInjected", "(", "\\", "ReflectionProperty", "$", "property", ")", ":", "bool", "{", "foreach", "(", "$", "this", "->", "reader", "->", "getPropertyAnnotations", "(", "$", "property", ")", "as", "$", "annotation", ")", "{", "i...
{@inheritdoc}
[ "{" ]
train
https://github.com/brick/di/blob/6ced82ab3623b8f1470317d38cbd2de855e7aa3d/src/InjectionPolicy/AnnotationPolicy.php#L68-L77
brick/di
src/InjectionPolicy/AnnotationPolicy.php
AnnotationPolicy.getParameterKey
public function getParameterKey(\ReflectionParameter $parameter) : ?string { $function = $parameter->getDeclaringFunction(); if ($function instanceof \ReflectionMethod) { foreach ($this->reader->getMethodAnnotations($function) as $annotation) { if ($annotation instanceof...
php
public function getParameterKey(\ReflectionParameter $parameter) : ?string { $function = $parameter->getDeclaringFunction(); if ($function instanceof \ReflectionMethod) { foreach ($this->reader->getMethodAnnotations($function) as $annotation) { if ($annotation instanceof...
[ "public", "function", "getParameterKey", "(", "\\", "ReflectionParameter", "$", "parameter", ")", ":", "?", "string", "{", "$", "function", "=", "$", "parameter", "->", "getDeclaringFunction", "(", ")", ";", "if", "(", "$", "function", "instanceof", "\\", "R...
{@inheritdoc}
[ "{" ]
train
https://github.com/brick/di/blob/6ced82ab3623b8f1470317d38cbd2de855e7aa3d/src/InjectionPolicy/AnnotationPolicy.php#L82-L95
brick/di
src/InjectionPolicy/AnnotationPolicy.php
AnnotationPolicy.getPropertyKey
public function getPropertyKey(\ReflectionProperty $property) : ?string { foreach ($this->reader->getPropertyAnnotations($property) as $annotation) { if ($annotation instanceof Inject) { return $annotation->getSingleValue(); } } return null; }
php
public function getPropertyKey(\ReflectionProperty $property) : ?string { foreach ($this->reader->getPropertyAnnotations($property) as $annotation) { if ($annotation instanceof Inject) { return $annotation->getSingleValue(); } } return null; }
[ "public", "function", "getPropertyKey", "(", "\\", "ReflectionProperty", "$", "property", ")", ":", "?", "string", "{", "foreach", "(", "$", "this", "->", "reader", "->", "getPropertyAnnotations", "(", "$", "property", ")", "as", "$", "annotation", ")", "{",...
{@inheritdoc}
[ "{" ]
train
https://github.com/brick/di/blob/6ced82ab3623b8f1470317d38cbd2de855e7aa3d/src/InjectionPolicy/AnnotationPolicy.php#L100-L109
heidelpay/PhpDoc
src/phpDocumentor/Plugin/Twig/ServiceProvider.php
ServiceProvider.register
public function register(Application $app) { /** @var Translator $translator */ $translator = $app['translator']; /** @var Collection $writerCollection */ $writerCollection = $app['transformer.writer.collection']; $writerCollection['twig'] = new Writer\Twig(); $wri...
php
public function register(Application $app) { /** @var Translator $translator */ $translator = $app['translator']; /** @var Collection $writerCollection */ $writerCollection = $app['transformer.writer.collection']; $writerCollection['twig'] = new Writer\Twig(); $wri...
[ "public", "function", "register", "(", "Application", "$", "app", ")", "{", "/** @var Translator $translator */", "$", "translator", "=", "$", "app", "[", "'translator'", "]", ";", "/** @var Collection $writerCollection */", "$", "writerCollection", "=", "$", "app", ...
Registers services on the given app. @param Application $app An Application instance.
[ "Registers", "services", "on", "the", "given", "app", "." ]
train
https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Plugin/Twig/ServiceProvider.php#L34-L44
gedex/php-janrain-api
lib/Janrain/Api/Engage/LegacySharing.php
LegacySharing.setStatus
public function setStatus(array $params) { if (!isset($params['identifier'])) { throw new MissingArgumentException('identifier'); } if (!isset($params['status'])) { throw new MissingArgumentException('status'); } return $this->post('set_status', $params); }
php
public function setStatus(array $params) { if (!isset($params['identifier'])) { throw new MissingArgumentException('identifier'); } if (!isset($params['status'])) { throw new MissingArgumentException('status'); } return $this->post('set_status', $params); }
[ "public", "function", "setStatus", "(", "array", "$", "params", ")", "{", "if", "(", "!", "isset", "(", "$", "params", "[", "'identifier'", "]", ")", ")", "{", "throw", "new", "MissingArgumentException", "(", "'identifier'", ")", ";", "}", "if", "(", "...
Updates the user status using the current signed in identity provider. @param array $params @link http://developers.janrain.com/documentation/api-methods/engage/legacy/set_status/
[ "Updates", "the", "user", "status", "using", "the", "current", "signed", "in", "identity", "provider", "." ]
train
https://github.com/gedex/php-janrain-api/blob/6283f68454e0ad5211ac620f1d337df38cd49597/lib/Janrain/Api/Engage/LegacySharing.php#L51-L62
ajgarlag/AjglSessionConcurrency
src/Http/Session/Registry/Storage/PdoSessionRegistryStorage.php
PdoSessionRegistryStorage.createTable
public function createTable() { // connect if we are not yet $this->getConnection(); switch ($this->driver) { case 'mysql': // We use varbinary for the ID column because it prevents unwanted conversions: // - character set conversions between serv...
php
public function createTable() { // connect if we are not yet $this->getConnection(); switch ($this->driver) { case 'mysql': // We use varbinary for the ID column because it prevents unwanted conversions: // - character set conversions between serv...
[ "public", "function", "createTable", "(", ")", "{", "// connect if we are not yet", "$", "this", "->", "getConnection", "(", ")", ";", "switch", "(", "$", "this", "->", "driver", ")", "{", "case", "'mysql'", ":", "// We use varbinary for the ID column because it pre...
Creates the table to store sessions which can be called once for setup. Session ID is saved in a column of maximum length 128 because that is enough even for a 512 bit configured session.hash_function like Whirlpool. Session username is saved in a varchar of maximun length 256 because any valid email should fit into i...
[ "Creates", "the", "table", "to", "store", "sessions", "which", "can", "be", "called", "once", "for", "setup", "." ]
train
https://github.com/ajgarlag/AjglSessionConcurrency/blob/daa3b1ff3ad4951947f7192e12b2496555e135fb/src/Http/Session/Registry/Storage/PdoSessionRegistryStorage.php#L134-L169
ajgarlag/AjglSessionConcurrency
src/Http/Session/Registry/Storage/PdoSessionRegistryStorage.php
PdoSessionRegistryStorage.collectGarbage
public function collectGarbage($maxLifetime) { // delete the session records that have expired $sql = "DELETE FROM $this->table WHERE $this->lastUsedCol < :time"; try { $stmt = $this->getConnection()->prepare($sql); $stmt->bindValue(':time', time() - $maxLifetime, \P...
php
public function collectGarbage($maxLifetime) { // delete the session records that have expired $sql = "DELETE FROM $this->table WHERE $this->lastUsedCol < :time"; try { $stmt = $this->getConnection()->prepare($sql); $stmt->bindValue(':time', time() - $maxLifetime, \P...
[ "public", "function", "collectGarbage", "(", "$", "maxLifetime", ")", "{", "// delete the session records that have expired", "$", "sql", "=", "\"DELETE FROM $this->table WHERE $this->lastUsedCol < :time\"", ";", "try", "{", "$", "stmt", "=", "$", "this", "->", "getConnec...
{@inheritdoc}
[ "{" ]
train
https://github.com/ajgarlag/AjglSessionConcurrency/blob/daa3b1ff3ad4951947f7192e12b2496555e135fb/src/Http/Session/Registry/Storage/PdoSessionRegistryStorage.php#L174-L186
ajgarlag/AjglSessionConcurrency
src/Http/Session/Registry/Storage/PdoSessionRegistryStorage.php
PdoSessionRegistryStorage.getSessionInformation
public function getSessionInformation($sessionId) { $sql = "SELECT $this->usernameCol, $this->lastUsedCol, $this->expiredCol FROM $this->table WHERE $this->idCol = :id"; try { $stmt = $this->getConnection()->prepare($sql); $stmt->bindParam(':id', $sessionId, \PDO::PARAM_STR)...
php
public function getSessionInformation($sessionId) { $sql = "SELECT $this->usernameCol, $this->lastUsedCol, $this->expiredCol FROM $this->table WHERE $this->idCol = :id"; try { $stmt = $this->getConnection()->prepare($sql); $stmt->bindParam(':id', $sessionId, \PDO::PARAM_STR)...
[ "public", "function", "getSessionInformation", "(", "$", "sessionId", ")", "{", "$", "sql", "=", "\"SELECT $this->usernameCol, $this->lastUsedCol, $this->expiredCol FROM $this->table WHERE $this->idCol = :id\"", ";", "try", "{", "$", "stmt", "=", "$", "this", "->", "getConn...
{@inheritdoc}
[ "{" ]
train
https://github.com/ajgarlag/AjglSessionConcurrency/blob/daa3b1ff3ad4951947f7192e12b2496555e135fb/src/Http/Session/Registry/Storage/PdoSessionRegistryStorage.php#L191-L209
ajgarlag/AjglSessionConcurrency
src/Http/Session/Registry/Storage/PdoSessionRegistryStorage.php
PdoSessionRegistryStorage.getMergeSql
private function getMergeSql() { // connect if we are not yet $this->getConnection(); switch ($this->driver) { case 'mysql': return "INSERT INTO $this->table ($this->idCol, $this->usernameCol, $this->lastUsedCol, $this->expiredCol) VALUES (:id, :username, :last_u...
php
private function getMergeSql() { // connect if we are not yet $this->getConnection(); switch ($this->driver) { case 'mysql': return "INSERT INTO $this->table ($this->idCol, $this->usernameCol, $this->lastUsedCol, $this->expiredCol) VALUES (:id, :username, :last_u...
[ "private", "function", "getMergeSql", "(", ")", "{", "// connect if we are not yet", "$", "this", "->", "getConnection", "(", ")", ";", "switch", "(", "$", "this", "->", "driver", ")", "{", "case", "'mysql'", ":", "return", "\"INSERT INTO $this->table ($this->idCo...
Returns a merge/upsert (i.e. insert or update) SQL query when supported by the database. @return string|null The SQL string or null when not supported
[ "Returns", "a", "merge", "/", "upsert", "(", "i", ".", "e", ".", "insert", "or", "update", ")", "SQL", "query", "when", "supported", "by", "the", "database", "." ]
train
https://github.com/ajgarlag/AjglSessionConcurrency/blob/daa3b1ff3ad4951947f7192e12b2496555e135fb/src/Http/Session/Registry/Storage/PdoSessionRegistryStorage.php#L309-L332
expectation-php/expect
src/matcher/ToPrint.php
ToPrint.match
public function match($actual) { ob_start(); $actual(); $this->actual = ob_get_clean(); return $this->actual === $this->expected; }
php
public function match($actual) { ob_start(); $actual(); $this->actual = ob_get_clean(); return $this->actual === $this->expected; }
[ "public", "function", "match", "(", "$", "actual", ")", "{", "ob_start", "(", ")", ";", "$", "actual", "(", ")", ";", "$", "this", "->", "actual", "=", "ob_get_clean", "(", ")", ";", "return", "$", "this", "->", "actual", "===", "$", "this", "->", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/expectation-php/expect/blob/1a32c5af37f3dc8dabe4e8eedeeb21aea16ce139/src/matcher/ToPrint.php#L53-L60
expectation-php/expect
src/matcher/ToPrint.php
ToPrint.reportFailed
public function reportFailed(FailedMessage $message) { $message->appendText('Expected ') ->appendValue($this->expected) ->appendText(', got ') ->appendValue($this->actual); }
php
public function reportFailed(FailedMessage $message) { $message->appendText('Expected ') ->appendValue($this->expected) ->appendText(', got ') ->appendValue($this->actual); }
[ "public", "function", "reportFailed", "(", "FailedMessage", "$", "message", ")", "{", "$", "message", "->", "appendText", "(", "'Expected '", ")", "->", "appendValue", "(", "$", "this", "->", "expected", ")", "->", "appendText", "(", "', got '", ")", "->", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/expectation-php/expect/blob/1a32c5af37f3dc8dabe4e8eedeeb21aea16ce139/src/matcher/ToPrint.php#L65-L71
zeropingheroes/steam-browser-protocol
src/Zeropingheroes/SteamBrowserProtocol/SteamBrowserProtocol.php
SteamBrowserProtocol.connectToServer
public function connectToServer($address, $options = array()) { $parameters = NULL; if ( array_key_exists('port', $options) ) { $parameters = ':'.$options['port']; } if ( array_key_exists('password', $options) ) { $parameters .= '/'.$options['password']; } return $this->protocol.'connect/'.$ad...
php
public function connectToServer($address, $options = array()) { $parameters = NULL; if ( array_key_exists('port', $options) ) { $parameters = ':'.$options['port']; } if ( array_key_exists('password', $options) ) { $parameters .= '/'.$options['password']; } return $this->protocol.'connect/'.$ad...
[ "public", "function", "connectToServer", "(", "$", "address", ",", "$", "options", "=", "array", "(", ")", ")", "{", "$", "parameters", "=", "NULL", ";", "if", "(", "array_key_exists", "(", "'port'", ",", "$", "options", ")", ")", "{", "$", "parameters...
Generates a link to connecto the specified server @param string $address Server IP or hostname @param array $options Server port and password @return string
[ "Generates", "a", "link", "to", "connecto", "the", "specified", "server" ]
train
https://github.com/zeropingheroes/steam-browser-protocol/blob/1fce6740f2aed27480be5231351656aadcbf1d39/src/Zeropingheroes/SteamBrowserProtocol/SteamBrowserProtocol.php#L112-L125
zeropingheroes/steam-browser-protocol
src/Zeropingheroes/SteamBrowserProtocol/SteamBrowserProtocol.php
SteamBrowserProtocol.openSteamPage
public function openSteamPage($page, $parameter = NULL) { if( in_array($page, $this->steamPages) ) { return $this->protocol.'url/'.$page.'/'.$parameter; } }
php
public function openSteamPage($page, $parameter = NULL) { if( in_array($page, $this->steamPages) ) { return $this->protocol.'url/'.$page.'/'.$parameter; } }
[ "public", "function", "openSteamPage", "(", "$", "page", ",", "$", "parameter", "=", "NULL", ")", "{", "if", "(", "in_array", "(", "$", "page", ",", "$", "this", "->", "steamPages", ")", ")", "{", "return", "$", "this", "->", "protocol", ".", "'url/'...
Generates a link to open the specified named page @param string $page Page @param array $parameter Additional parameter @return string
[ "Generates", "a", "link", "to", "open", "the", "specified", "named", "page" ]
train
https://github.com/zeropingheroes/steam-browser-protocol/blob/1fce6740f2aed27480be5231351656aadcbf1d39/src/Zeropingheroes/SteamBrowserProtocol/SteamBrowserProtocol.php#L295-L301
garf/laravel-title
src/LaravelTitleServiceProvider.php
LaravelTitleServiceProvider.register
public function register() { $this->mergeConfigFrom( __DIR__ . '/../config/laravel-title.php', 'laravel-title' ); $this->registerLaravelTitle(); $this->app->alias('Title', \Garf\LaravelTitle\Title::class); }
php
public function register() { $this->mergeConfigFrom( __DIR__ . '/../config/laravel-title.php', 'laravel-title' ); $this->registerLaravelTitle(); $this->app->alias('Title', \Garf\LaravelTitle\Title::class); }
[ "public", "function", "register", "(", ")", "{", "$", "this", "->", "mergeConfigFrom", "(", "__DIR__", ".", "'/../config/laravel-title.php'", ",", "'laravel-title'", ")", ";", "$", "this", "->", "registerLaravelTitle", "(", ")", ";", "$", "this", "->", "app", ...
Register the application services. @return void
[ "Register", "the", "application", "services", "." ]
train
https://github.com/garf/laravel-title/blob/54b939b67fdd48d1579c9231d3a13a505279e1cd/src/LaravelTitleServiceProvider.php#L26-L34
songshenzong/log
src/DataCollector/QueryCollector.php
QueryCollector.setExplainSource
public function setExplainSource($enabled, $types) { $this->explainQuery = $enabled; if ($types) { $this->explainTypes = $types; } }
php
public function setExplainSource($enabled, $types) { $this->explainQuery = $enabled; if ($types) { $this->explainTypes = $types; } }
[ "public", "function", "setExplainSource", "(", "$", "enabled", ",", "$", "types", ")", "{", "$", "this", "->", "explainQuery", "=", "$", "enabled", ";", "if", "(", "$", "types", ")", "{", "$", "this", "->", "explainTypes", "=", "$", "types", ";", "}"...
Enable/disable the EXPLAIN queries @param bool $enabled @param array|null $types Array of types to explain queries (select/insert/update/delete)
[ "Enable", "/", "disable", "the", "EXPLAIN", "queries" ]
train
https://github.com/songshenzong/log/blob/b1e01f7994da47737866eabf82367490eab17c46/src/DataCollector/QueryCollector.php#L97-L103
songshenzong/log
src/DataCollector/QueryCollector.php
QueryCollector.findSource
protected function findSource() { $stack = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS | DEBUG_BACKTRACE_PROVIDE_OBJECT); $sources = []; foreach ($stack as $index => $trace) { $sources[] = $this->parseTrace($index, $trace); } return array_filter($sources); ...
php
protected function findSource() { $stack = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS | DEBUG_BACKTRACE_PROVIDE_OBJECT); $sources = []; foreach ($stack as $index => $trace) { $sources[] = $this->parseTrace($index, $trace); } return array_filter($sources); ...
[ "protected", "function", "findSource", "(", ")", "{", "$", "stack", "=", "debug_backtrace", "(", "DEBUG_BACKTRACE_IGNORE_ARGS", "|", "DEBUG_BACKTRACE_PROVIDE_OBJECT", ")", ";", "$", "sources", "=", "[", "]", ";", "foreach", "(", "$", "stack", "as", "$", "index...
Use a backtrace to search for the origins of the query. @return array
[ "Use", "a", "backtrace", "to", "search", "for", "the", "origins", "of", "the", "query", "." ]
train
https://github.com/songshenzong/log/blob/b1e01f7994da47737866eabf82367490eab17c46/src/DataCollector/QueryCollector.php#L215-L226
songshenzong/log
src/DataCollector/QueryCollector.php
QueryCollector.parseTrace
protected function parseTrace($index, array $trace) { $frame = (object) [ 'index' => $index, 'namespace' => null, 'name' => null, 'line' => isset($trace['line']) ? $trace['line'] : '?', ]; if (isset($trace['function']) && $trace[...
php
protected function parseTrace($index, array $trace) { $frame = (object) [ 'index' => $index, 'namespace' => null, 'name' => null, 'line' => isset($trace['line']) ? $trace['line'] : '?', ]; if (isset($trace['function']) && $trace[...
[ "protected", "function", "parseTrace", "(", "$", "index", ",", "array", "$", "trace", ")", "{", "$", "frame", "=", "(", "object", ")", "[", "'index'", "=>", "$", "index", ",", "'namespace'", "=>", "null", ",", "'name'", "=>", "null", ",", "'line'", "...
Parse a trace element from the backtrace stack. @param int $index @param array $trace @return object|bool
[ "Parse", "a", "trace", "element", "from", "the", "backtrace", "stack", "." ]
train
https://github.com/songshenzong/log/blob/b1e01f7994da47737866eabf82367490eab17c46/src/DataCollector/QueryCollector.php#L236-L292
php-comp/lite-database
src/Helper/DsnHelper.php
DsnHelper.getDsn
public static function getDsn(array $options = [], $driver = null): string { if (isset($options['dsn'])) { return $options['dsn']; } self::$options = $options; if (!$driver) { $driver = $options['driver'] ?? null; } if (!$driver) { ...
php
public static function getDsn(array $options = [], $driver = null): string { if (isset($options['dsn'])) { return $options['dsn']; } self::$options = $options; if (!$driver) { $driver = $options['driver'] ?? null; } if (!$driver) { ...
[ "public", "static", "function", "getDsn", "(", "array", "$", "options", "=", "[", "]", ",", "$", "driver", "=", "null", ")", ":", "string", "{", "if", "(", "isset", "(", "$", "options", "[", "'dsn'", "]", ")", ")", "{", "return", "$", "options", ...
getDsn @param string $driver @param array $options @throws \InvalidArgumentException @return string
[ "getDsn" ]
train
https://github.com/php-comp/lite-database/blob/af5f73cb89e0e6cd24dd464f7a48fb5088eaafca/src/Helper/DsnHelper.php#L45-L72
weew/http
src/Weew/Http/HttpHeaders.php
HttpHeaders.add
public function add($key, $value) { $key = $this->formatKey($key); $headers = $this->get($key); $headers[] = $value; array_set($this->headers, $key, $headers); }
php
public function add($key, $value) { $key = $this->formatKey($key); $headers = $this->get($key); $headers[] = $value; array_set($this->headers, $key, $headers); }
[ "public", "function", "add", "(", "$", "key", ",", "$", "value", ")", "{", "$", "key", "=", "$", "this", "->", "formatKey", "(", "$", "key", ")", ";", "$", "headers", "=", "$", "this", "->", "get", "(", "$", "key", ")", ";", "$", "headers", "...
Add header. @param $key @param $value
[ "Add", "header", "." ]
train
https://github.com/weew/http/blob/fd34d3d5643ca01c8e0946e888224a8e8dcc3c0d/src/Weew/Http/HttpHeaders.php#L24-L31
weew/http
src/Weew/Http/HttpHeaders.php
HttpHeaders.find
public function find($key, $default = null) { $key = $this->formatKey($key); $headers = array_get($this->headers, $key, $default); if (is_array($headers)) { $headers = array_pop($headers); } return $headers; }
php
public function find($key, $default = null) { $key = $this->formatKey($key); $headers = array_get($this->headers, $key, $default); if (is_array($headers)) { $headers = array_pop($headers); } return $headers; }
[ "public", "function", "find", "(", "$", "key", ",", "$", "default", "=", "null", ")", "{", "$", "key", "=", "$", "this", "->", "formatKey", "(", "$", "key", ")", ";", "$", "headers", "=", "array_get", "(", "$", "this", "->", "headers", ",", "$", ...
Find the last added header. @param $key @param null $default @return string
[ "Find", "the", "last", "added", "header", "." ]
train
https://github.com/weew/http/blob/fd34d3d5643ca01c8e0946e888224a8e8dcc3c0d/src/Weew/Http/HttpHeaders.php#L56-L65
weew/http
src/Weew/Http/HttpHeaders.php
HttpHeaders.set
public function set($key, $value) { $key = $this->formatKey($key); array_set($this->headers, $key, [$value]); }
php
public function set($key, $value) { $key = $this->formatKey($key); array_set($this->headers, $key, [$value]); }
[ "public", "function", "set", "(", "$", "key", ",", "$", "value", ")", "{", "$", "key", "=", "$", "this", "->", "formatKey", "(", "$", "key", ")", ";", "array_set", "(", "$", "this", "->", "headers", ",", "$", "key", ",", "[", "$", "value", "]",...
Replace all previous headers with this one. @param $key @param $value
[ "Replace", "all", "previous", "headers", "with", "this", "one", "." ]
train
https://github.com/weew/http/blob/fd34d3d5643ca01c8e0946e888224a8e8dcc3c0d/src/Weew/Http/HttpHeaders.php#L73-L76
weew/http
src/Weew/Http/HttpHeaders.php
HttpHeaders.get
public function get($key) { $key = $this->formatKey($key); return array_get($this->headers, $key, []); }
php
public function get($key) { $key = $this->formatKey($key); return array_get($this->headers, $key, []); }
[ "public", "function", "get", "(", "$", "key", ")", "{", "$", "key", "=", "$", "this", "->", "formatKey", "(", "$", "key", ")", ";", "return", "array_get", "(", "$", "this", "->", "headers", ",", "$", "key", ",", "[", "]", ")", ";", "}" ]
Get all headers by key. @param $key @return array
[ "Get", "all", "headers", "by", "key", "." ]
train
https://github.com/weew/http/blob/fd34d3d5643ca01c8e0946e888224a8e8dcc3c0d/src/Weew/Http/HttpHeaders.php#L85-L88
weew/http
src/Weew/Http/HttpHeaders.php
HttpHeaders.has
public function has($key) { $key = $this->formatKey($key); return array_has($this->headers, $key); }
php
public function has($key) { $key = $this->formatKey($key); return array_has($this->headers, $key); }
[ "public", "function", "has", "(", "$", "key", ")", "{", "$", "key", "=", "$", "this", "->", "formatKey", "(", "$", "key", ")", ";", "return", "array_has", "(", "$", "this", "->", "headers", ",", "$", "key", ")", ";", "}" ]
Check if there are any headers. @param $key @return bool
[ "Check", "if", "there", "are", "any", "headers", "." ]
train
https://github.com/weew/http/blob/fd34d3d5643ca01c8e0946e888224a8e8dcc3c0d/src/Weew/Http/HttpHeaders.php#L97-L100
weew/http
src/Weew/Http/HttpHeaders.php
HttpHeaders.remove
public function remove($key) { $key = $this->formatKey($key); array_remove($this->headers, $key); }
php
public function remove($key) { $key = $this->formatKey($key); array_remove($this->headers, $key); }
[ "public", "function", "remove", "(", "$", "key", ")", "{", "$", "key", "=", "$", "this", "->", "formatKey", "(", "$", "key", ")", ";", "array_remove", "(", "$", "this", "->", "headers", ",", "$", "key", ")", ";", "}" ]
Remove all registered headers. @param $key
[ "Remove", "all", "registered", "headers", "." ]
train
https://github.com/weew/http/blob/fd34d3d5643ca01c8e0946e888224a8e8dcc3c0d/src/Weew/Http/HttpHeaders.php#L107-L110
weew/http
src/Weew/Http/HttpHeaders.php
HttpHeaders.toFlatArray
public function toFlatArray() { $array = []; foreach ($this->headers as $key => $headers) { foreach ($headers as $header) { $array[] = $this->formatHeader($key, $header); } } return $array; }
php
public function toFlatArray() { $array = []; foreach ($this->headers as $key => $headers) { foreach ($headers as $header) { $array[] = $this->formatHeader($key, $header); } } return $array; }
[ "public", "function", "toFlatArray", "(", ")", "{", "$", "array", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "headers", "as", "$", "key", "=>", "$", "headers", ")", "{", "foreach", "(", "$", "headers", "as", "$", "header", ")", "{", "...
Get a list of formatted header strings. @return array
[ "Get", "a", "list", "of", "formatted", "header", "strings", "." ]
train
https://github.com/weew/http/blob/fd34d3d5643ca01c8e0946e888224a8e8dcc3c0d/src/Weew/Http/HttpHeaders.php#L160-L170
yawik/composer-plugin
src/AssetsInstaller.php
AssetsInstaller.install
public function install($modules, $expectedMethod = null) { $publicDir = $this->getModuleAssetDir(); $rows = []; $exitCode = 0; $copyUsed = false; $expectedMethod = is_null($expectedMethod) ? self::METHOD_RELATIVE_SYMLINK:$expectedMethod; f...
php
public function install($modules, $expectedMethod = null) { $publicDir = $this->getModuleAssetDir(); $rows = []; $exitCode = 0; $copyUsed = false; $expectedMethod = is_null($expectedMethod) ? self::METHOD_RELATIVE_SYMLINK:$expectedMethod; f...
[ "public", "function", "install", "(", "$", "modules", ",", "$", "expectedMethod", "=", "null", ")", "{", "$", "publicDir", "=", "$", "this", "->", "getModuleAssetDir", "(", ")", ";", "$", "rows", "=", "[", "]", ";", "$", "exitCode", "=", "0", ";", ...
Install modules assets with the given $modules. $modules should within this format: [module_name] => module_public_directory @param array $modules An array of modules @param string $expectedMethod Expected install method
[ "Install", "modules", "assets", "with", "the", "given", "$modules", ".", "$modules", "should", "within", "this", "format", ":" ]
train
https://github.com/yawik/composer-plugin/blob/d3a45d2ab342fc0eb21e1126e8637fb7752464e4/src/AssetsInstaller.php#L83-L125
yawik/composer-plugin
src/AssetsInstaller.php
AssetsInstaller.uninstall
public function uninstall($modules) { $assetDir = $this->getModuleAssetDir(); foreach ($modules as $name) { $publicPath = $assetDir.DIRECTORY_SEPARATOR.$name; if (is_dir($publicPath) || is_link($publicPath)) { $this->filesystem->remove($publicPath); ...
php
public function uninstall($modules) { $assetDir = $this->getModuleAssetDir(); foreach ($modules as $name) { $publicPath = $assetDir.DIRECTORY_SEPARATOR.$name; if (is_dir($publicPath) || is_link($publicPath)) { $this->filesystem->remove($publicPath); ...
[ "public", "function", "uninstall", "(", "$", "modules", ")", "{", "$", "assetDir", "=", "$", "this", "->", "getModuleAssetDir", "(", ")", ";", "foreach", "(", "$", "modules", "as", "$", "name", ")", "{", "$", "publicPath", "=", "$", "assetDir", ".", ...
Uninstall modules @param array $modules A list of modules to uninstall
[ "Uninstall", "modules" ]
train
https://github.com/yawik/composer-plugin/blob/d3a45d2ab342fc0eb21e1126e8637fb7752464e4/src/AssetsInstaller.php#L132-L142
yawik/composer-plugin
src/AssetsInstaller.php
AssetsInstaller.symlink
public function symlink($originDir, $targetDir, $relative = false) { if ($relative) { $this->filesystem->mkdir(dirname($targetDir)); $originDir = $this->filesystem->makePathRelative($originDir, realpath(dirname($targetDir))); } $this->filesystem->symlink($originDir, $...
php
public function symlink($originDir, $targetDir, $relative = false) { if ($relative) { $this->filesystem->mkdir(dirname($targetDir)); $originDir = $this->filesystem->makePathRelative($originDir, realpath(dirname($targetDir))); } $this->filesystem->symlink($originDir, $...
[ "public", "function", "symlink", "(", "$", "originDir", ",", "$", "targetDir", ",", "$", "relative", "=", "false", ")", "{", "if", "(", "$", "relative", ")", "{", "$", "this", "->", "filesystem", "->", "mkdir", "(", "dirname", "(", "$", "targetDir", ...
Creates symbolic link. @throws \Exception if link can not be created
[ "Creates", "symbolic", "link", "." ]
train
https://github.com/yawik/composer-plugin/blob/d3a45d2ab342fc0eb21e1126e8637fb7752464e4/src/AssetsInstaller.php#L222-L237
SporkCode/Spork
src/Mvc/Controller/AbstractRestfulTableController.php
AbstractRestfulTableController.toArray
protected function toArray($data) { if (is_array($data)) { return $data; } if (is_object($data)) { if (method_exists($data, 'toArray')) { return $data->toArray(); } if ($data instanceof \Traversable) { return iterator_to_array($data); ...
php
protected function toArray($data) { if (is_array($data)) { return $data; } if (is_object($data)) { if (method_exists($data, 'toArray')) { return $data->toArray(); } if ($data instanceof \Traversable) { return iterator_to_array($data); ...
[ "protected", "function", "toArray", "(", "$", "data", ")", "{", "if", "(", "is_array", "(", "$", "data", ")", ")", "{", "return", "$", "data", ";", "}", "if", "(", "is_object", "(", "$", "data", ")", ")", "{", "if", "(", "method_exists", "(", "$"...
Convert a result set to an array @param unknown $data
[ "Convert", "a", "result", "set", "to", "an", "array" ]
train
https://github.com/SporkCode/Spork/blob/7f569efdc0ceb4a9c1c7a8b648b6a7ed50d2088a/src/Mvc/Controller/AbstractRestfulTableController.php#L120-L136
mustardandrew/muan-laravel-acl
src/Commands/Role/RenameCommand.php
RenameCommand.handle
public function handle() { $roleName = $this->argument('role'); $newRoleName = $this->argument('newRole'); if (! $role = Role::whereName($roleName)->first()) { $this->warn("Role {$roleName} not exists."); return 1; } $role->name = $newRoleName; ...
php
public function handle() { $roleName = $this->argument('role'); $newRoleName = $this->argument('newRole'); if (! $role = Role::whereName($roleName)->first()) { $this->warn("Role {$roleName} not exists."); return 1; } $role->name = $newRoleName; ...
[ "public", "function", "handle", "(", ")", "{", "$", "roleName", "=", "$", "this", "->", "argument", "(", "'role'", ")", ";", "$", "newRoleName", "=", "$", "this", "->", "argument", "(", "'newRole'", ")", ";", "if", "(", "!", "$", "role", "=", "Role...
Execute the console command. @return mixed
[ "Execute", "the", "console", "command", "." ]
train
https://github.com/mustardandrew/muan-laravel-acl/blob/b5f23340b5536babb98d9fd0d727a7a3371c97d5/src/Commands/Role/RenameCommand.php#L34-L53
loevgaard/altapay-php-sdk
src/Payload/PaymentRequest.php
PaymentRequest.parseCookieParts
public static function parseCookieParts(array $cookieParts) { $cookie = ''; foreach ($cookieParts as $key => $val) { $cookie .= $key.'='.rawurlencode($val).';'; } $cookie = trim($cookie, ';'); return $cookie; }
php
public static function parseCookieParts(array $cookieParts) { $cookie = ''; foreach ($cookieParts as $key => $val) { $cookie .= $key.'='.rawurlencode($val).';'; } $cookie = trim($cookie, ';'); return $cookie; }
[ "public", "static", "function", "parseCookieParts", "(", "array", "$", "cookieParts", ")", "{", "$", "cookie", "=", "''", ";", "foreach", "(", "$", "cookieParts", "as", "$", "key", "=>", "$", "val", ")", "{", "$", "cookie", ".=", "$", "key", ".", "'=...
Takes an array of cookie parts and returns an urlencoded string ready to send @param array $cookieParts @return string
[ "Takes", "an", "array", "of", "cookie", "parts", "and", "returns", "an", "urlencoded", "string", "ready", "to", "send" ]
train
https://github.com/loevgaard/altapay-php-sdk/blob/476664e8725407249c04ca7ae76f92882e4f4583/src/Payload/PaymentRequest.php#L212-L221
heidelpay/PhpDoc
src/phpDocumentor/Translator/ServiceProvider.php
ServiceProvider.register
public function register(Application $app) { /** @var ApplicationConfiguration $config */ $config = $app['config']; $app['translator.locale'] = $config->getTranslator()->getLocale(); $app['translator'] = $app->share( function ($app) { $translator = new T...
php
public function register(Application $app) { /** @var ApplicationConfiguration $config */ $config = $app['config']; $app['translator.locale'] = $config->getTranslator()->getLocale(); $app['translator'] = $app->share( function ($app) { $translator = new T...
[ "public", "function", "register", "(", "Application", "$", "app", ")", "{", "/** @var ApplicationConfiguration $config */", "$", "config", "=", "$", "app", "[", "'config'", "]", ";", "$", "app", "[", "'translator.locale'", "]", "=", "$", "config", "->", "getTr...
Registers the translator using the currently active locale. @param Application $app
[ "Registers", "the", "translator", "using", "the", "currently", "active", "locale", "." ]
train
https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Translator/ServiceProvider.php#L36-L51
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Cache/src/interfaces/base_replacement_strategy.php
ezcCacheStackBaseReplacementStrategy.store
public static function store( ezcCacheStackStorageConfiguration $conf, ezcCacheStackMetaData $metaData, $itemId, $itemData, $itemAttributes = array() ) { if ( !$metaData->hasItem( $conf->id, $itemId ) && $metaData->reachedItemLimit( $conf->id, $conf->...
php
public static function store( ezcCacheStackStorageConfiguration $conf, ezcCacheStackMetaData $metaData, $itemId, $itemData, $itemAttributes = array() ) { if ( !$metaData->hasItem( $conf->id, $itemId ) && $metaData->reachedItemLimit( $conf->id, $conf->...
[ "public", "static", "function", "store", "(", "ezcCacheStackStorageConfiguration", "$", "conf", ",", "ezcCacheStackMetaData", "$", "metaData", ",", "$", "itemId", ",", "$", "itemData", ",", "$", "itemAttributes", "=", "array", "(", ")", ")", "{", "if", "(", ...
Stores the given $itemData in the storage given in $conf. This method stores the given $itemData assigned to $itemId and optionally $itemAttributes in the {@link ezcCacheStackableStorage} given in $conf. In case the storage has reached the $itemLimit defined in $conf, it must be freed according to $freeRate {@link ezc...
[ "Stores", "the", "given", "$itemData", "in", "the", "storage", "given", "in", "$conf", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Cache/src/interfaces/base_replacement_strategy.php#L64-L86
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Cache/src/interfaces/base_replacement_strategy.php
ezcCacheStackBaseReplacementStrategy.freeData
private static function freeData( ezcCacheStackStorageConfiguration $conf, ezcCacheStackMetaData $metaData, $freeNum ) { $purgedIds = $conf->storage->purge(); // Unset purged items in meta data foreach ( $purgedIds as $purgedId ) { $metaData->r...
php
private static function freeData( ezcCacheStackStorageConfiguration $conf, ezcCacheStackMetaData $metaData, $freeNum ) { $purgedIds = $conf->storage->purge(); // Unset purged items in meta data foreach ( $purgedIds as $purgedId ) { $metaData->r...
[ "private", "static", "function", "freeData", "(", "ezcCacheStackStorageConfiguration", "$", "conf", ",", "ezcCacheStackMetaData", "$", "metaData", ",", "$", "freeNum", ")", "{", "$", "purgedIds", "=", "$", "conf", "->", "storage", "->", "purge", "(", ")", ";",...
Frees $freeNum number of item slots in $storage. This method first purges outdated items from the storage inside $conf using {@link ezcCacheStackableStorage::purge()}. If this does not free $freeNum items, least recently used items (determined from {@link ezcCacheStackMetaData}) will be removed from the storage using ...
[ "Frees", "$freeNum", "number", "of", "item", "slots", "in", "$storage", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Cache/src/interfaces/base_replacement_strategy.php#L101-L137
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Cache/src/interfaces/base_replacement_strategy.php
ezcCacheStackBaseReplacementStrategy.restore
public static function restore( ezcCacheStackStorageConfiguration $conf, ezcCacheStackMetaData $metaData, $itemId, $itemAttributes = array(), $search = false ) { $item = $conf->storage->restore( $itemId, $itemAttributes, $search...
php
public static function restore( ezcCacheStackStorageConfiguration $conf, ezcCacheStackMetaData $metaData, $itemId, $itemAttributes = array(), $search = false ) { $item = $conf->storage->restore( $itemId, $itemAttributes, $search...
[ "public", "static", "function", "restore", "(", "ezcCacheStackStorageConfiguration", "$", "conf", ",", "ezcCacheStackMetaData", "$", "metaData", ",", "$", "itemId", ",", "$", "itemAttributes", "=", "array", "(", ")", ",", "$", "search", "=", "false", ")", "{",...
Restores the data with the given $dataId from the storage given in $conf. This method takes care of restoring the item with ID $itemId and optionally $itemAttributes from the {@link ezcCacheStackableStorage} given in $conf. The parameters $itemId, $itemAttributes and $search are forwarded to {@link ezcCacheStackableSt...
[ "Restores", "the", "data", "with", "the", "given", "$dataId", "from", "the", "storage", "given", "in", "$conf", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Cache/src/interfaces/base_replacement_strategy.php#L163-L189
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Cache/src/interfaces/base_replacement_strategy.php
ezcCacheStackBaseReplacementStrategy.delete
public static function delete( ezcCacheStackStorageConfiguration $conf, ezcCacheStackMetaData $metaData, $itemId, $itemAttributes = array(), $search = false ) { $deletedIds = $conf->storage->delete( $itemId, $itemAttributes, $se...
php
public static function delete( ezcCacheStackStorageConfiguration $conf, ezcCacheStackMetaData $metaData, $itemId, $itemAttributes = array(), $search = false ) { $deletedIds = $conf->storage->delete( $itemId, $itemAttributes, $se...
[ "public", "static", "function", "delete", "(", "ezcCacheStackStorageConfiguration", "$", "conf", ",", "ezcCacheStackMetaData", "$", "metaData", ",", "$", "itemId", ",", "$", "itemAttributes", "=", "array", "(", ")", ",", "$", "search", "=", "false", ")", "{", ...
Deletes the data with the given $itemId from the given $storage. This method takes care about deleting the item identified by $itemId and optionally $itemAttributes from the {@link ezcCacheStackableStorage} give in $conf. The parameters $itemId, $itemAttributes and $search are therefore forwarded to {@link ezcCacheSta...
[ "Deletes", "the", "data", "with", "the", "given", "$itemId", "from", "the", "given", "$storage", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Cache/src/interfaces/base_replacement_strategy.php#L212-L232
lukasz-adamski/teamspeak3-framework
src/TeamSpeak3/Node/Channel.php
Channel.subChannelGetById
public function subChannelGetById($cid) { if(!array_key_exists((int) $cid, $this->subChannelList())) { throw new Exception("invalid channelID", 0x300); } return $this->channelList[(int) $cid]; }
php
public function subChannelGetById($cid) { if(!array_key_exists((int) $cid, $this->subChannelList())) { throw new Exception("invalid channelID", 0x300); } return $this->channelList[(int) $cid]; }
[ "public", "function", "subChannelGetById", "(", "$", "cid", ")", "{", "if", "(", "!", "array_key_exists", "(", "(", "int", ")", "$", "cid", ",", "$", "this", "->", "subChannelList", "(", ")", ")", ")", "{", "throw", "new", "Exception", "(", "\"invalid ...
Returns the TeamSpeak3_Node_Channel object matching the given ID. @param integer $cid @throws Exception @return Channel
[ "Returns", "the", "TeamSpeak3_Node_Channel", "object", "matching", "the", "given", "ID", "." ]
train
https://github.com/lukasz-adamski/teamspeak3-framework/blob/39a56eca608da6b56b6aa386a7b5b31dc576c41a/src/TeamSpeak3/Node/Channel.php#L91-L99
lukasz-adamski/teamspeak3-framework
src/TeamSpeak3/Node/Channel.php
Channel.subChannelGetByName
public function subChannelGetByName($name) { foreach($this->subChannelList() as $channel) { if($channel["channel_name"] == $name) return $channel; } throw new Exception("invalid channelID", 0x300); }
php
public function subChannelGetByName($name) { foreach($this->subChannelList() as $channel) { if($channel["channel_name"] == $name) return $channel; } throw new Exception("invalid channelID", 0x300); }
[ "public", "function", "subChannelGetByName", "(", "$", "name", ")", "{", "foreach", "(", "$", "this", "->", "subChannelList", "(", ")", "as", "$", "channel", ")", "{", "if", "(", "$", "channel", "[", "\"channel_name\"", "]", "==", "$", "name", ")", "re...
Returns the TeamSpeak3_Node_Channel object matching the given name. @param integer $name @throws Exception @return Channel
[ "Returns", "the", "TeamSpeak3_Node_Channel", "object", "matching", "the", "given", "name", "." ]
train
https://github.com/lukasz-adamski/teamspeak3-framework/blob/39a56eca608da6b56b6aa386a7b5b31dc576c41a/src/TeamSpeak3/Node/Channel.php#L108-L116
lukasz-adamski/teamspeak3-framework
src/TeamSpeak3/Node/Channel.php
Channel.clientGetById
public function clientGetById($clid) { if(!array_key_exists($clid, $this->clientList())) { throw new Exception("invalid clientID", 0x200); } return $this->clientList[intval($clid)]; }
php
public function clientGetById($clid) { if(!array_key_exists($clid, $this->clientList())) { throw new Exception("invalid clientID", 0x200); } return $this->clientList[intval($clid)]; }
[ "public", "function", "clientGetById", "(", "$", "clid", ")", "{", "if", "(", "!", "array_key_exists", "(", "$", "clid", ",", "$", "this", "->", "clientList", "(", ")", ")", ")", "{", "throw", "new", "Exception", "(", "\"invalid clientID\"", ",", "0x200"...
Returns the Client object matching the given ID. @param integer $clid @throws Exception @return Client
[ "Returns", "the", "Client", "object", "matching", "the", "given", "ID", "." ]
train
https://github.com/lukasz-adamski/teamspeak3-framework/blob/39a56eca608da6b56b6aa386a7b5b31dc576c41a/src/TeamSpeak3/Node/Channel.php#L146-L154
xiewulong/yii2-fileupload
oss/libs/symfony/event-dispatcher/Symfony/Component/EventDispatcher/ContainerAwareEventDispatcher.php
ContainerAwareEventDispatcher.addListenerService
public function addListenerService($eventName, $callback, $priority = 0) { if (!is_array($callback) || 2 !== count($callback)) { throw new \InvalidArgumentException('Expected an array("service", "method") argument'); } $this->listenerIds[$eventName][] = array($callback[0], $call...
php
public function addListenerService($eventName, $callback, $priority = 0) { if (!is_array($callback) || 2 !== count($callback)) { throw new \InvalidArgumentException('Expected an array("service", "method") argument'); } $this->listenerIds[$eventName][] = array($callback[0], $call...
[ "public", "function", "addListenerService", "(", "$", "eventName", ",", "$", "callback", ",", "$", "priority", "=", "0", ")", "{", "if", "(", "!", "is_array", "(", "$", "callback", ")", "||", "2", "!==", "count", "(", "$", "callback", ")", ")", "{", ...
Adds a service as event listener @param string $eventName Event for which the listener is added @param array $callback The service ID of the listener service & the method name that has to be called @param integer $priority The higher this value, the earlier an event listener will be triggered in the chain. Defaults ...
[ "Adds", "a", "service", "as", "event", "listener" ]
train
https://github.com/xiewulong/yii2-fileupload/blob/3e75b17a4a18dd8466e3f57c63136de03470ca82/oss/libs/symfony/event-dispatcher/Symfony/Component/EventDispatcher/ContainerAwareEventDispatcher.php#L66-L73
xiewulong/yii2-fileupload
oss/libs/symfony/event-dispatcher/Symfony/Component/EventDispatcher/ContainerAwareEventDispatcher.php
ContainerAwareEventDispatcher.dispatch
public function dispatch($eventName, Event $event = null) { $this->lazyLoad($eventName); return parent::dispatch($eventName, $event); }
php
public function dispatch($eventName, Event $event = null) { $this->lazyLoad($eventName); return parent::dispatch($eventName, $event); }
[ "public", "function", "dispatch", "(", "$", "eventName", ",", "Event", "$", "event", "=", "null", ")", "{", "$", "this", "->", "lazyLoad", "(", "$", "eventName", ")", ";", "return", "parent", "::", "dispatch", "(", "$", "eventName", ",", "$", "event", ...
{@inheritDoc} Lazily loads listeners for this event from the dependency injection container. @throws \InvalidArgumentException if the service is not defined
[ "{", "@inheritDoc", "}" ]
train
https://github.com/xiewulong/yii2-fileupload/blob/3e75b17a4a18dd8466e3f57c63136de03470ca82/oss/libs/symfony/event-dispatcher/Symfony/Component/EventDispatcher/ContainerAwareEventDispatcher.php#L163-L168
xiewulong/yii2-fileupload
oss/libs/symfony/event-dispatcher/Symfony/Component/EventDispatcher/ContainerAwareEventDispatcher.php
ContainerAwareEventDispatcher.lazyLoad
protected function lazyLoad($eventName) { if (isset($this->listenerIds[$eventName])) { foreach ($this->listenerIds[$eventName] as $args) { list($serviceId, $method, $priority) = $args; $listener = $this->container->get($serviceId); $key = $service...
php
protected function lazyLoad($eventName) { if (isset($this->listenerIds[$eventName])) { foreach ($this->listenerIds[$eventName] as $args) { list($serviceId, $method, $priority) = $args; $listener = $this->container->get($serviceId); $key = $service...
[ "protected", "function", "lazyLoad", "(", "$", "eventName", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "listenerIds", "[", "$", "eventName", "]", ")", ")", "{", "foreach", "(", "$", "this", "->", "listenerIds", "[", "$", "eventName", "]", ...
Lazily loads listeners for this event from the dependency injection container. @param string $eventName The name of the event to dispatch. The name of the event is the name of the method that is invoked on listeners.
[ "Lazily", "loads", "listeners", "for", "this", "event", "from", "the", "dependency", "injection", "container", "." ]
train
https://github.com/xiewulong/yii2-fileupload/blob/3e75b17a4a18dd8466e3f57c63136de03470ca82/oss/libs/symfony/event-dispatcher/Symfony/Component/EventDispatcher/ContainerAwareEventDispatcher.php#L183-L201
gdbots/iam-php
src/GrantRolesToAppHandler.php
GrantRolesToAppHandler.createAppRolesGranted
protected function createAppRolesGranted(GrantRolesToApp $command, Pbjx $pbjx): AppRolesGranted { /** @var AppRolesGranted $event */ $event = AppRolesGrantedV1Mixin::findOne()->createMessage(); return $event; }
php
protected function createAppRolesGranted(GrantRolesToApp $command, Pbjx $pbjx): AppRolesGranted { /** @var AppRolesGranted $event */ $event = AppRolesGrantedV1Mixin::findOne()->createMessage(); return $event; }
[ "protected", "function", "createAppRolesGranted", "(", "GrantRolesToApp", "$", "command", ",", "Pbjx", "$", "pbjx", ")", ":", "AppRolesGranted", "{", "/** @var AppRolesGranted $event */", "$", "event", "=", "AppRolesGrantedV1Mixin", "::", "findOne", "(", ")", "->", ...
@param GrantRolesToApp $command @param Pbjx $pbjx @return AppRolesGranted
[ "@param", "GrantRolesToApp", "$command", "@param", "Pbjx", "$pbjx" ]
train
https://github.com/gdbots/iam-php/blob/3dbfa602de183a7ac5fb5140304e8cf4c4b15ab3/src/GrantRolesToAppHandler.php#L68-L73
expectation-php/expect
src/matcher/ToContain.php
ToContain.match
public function match($actual) { $this->actual = $actual; $strategy = $this->createStrategy(); $this->matchResult = $strategy->match($this->expectValues); return $this->matchResult->isMatched(); }
php
public function match($actual) { $this->actual = $actual; $strategy = $this->createStrategy(); $this->matchResult = $strategy->match($this->expectValues); return $this->matchResult->isMatched(); }
[ "public", "function", "match", "(", "$", "actual", ")", "{", "$", "this", "->", "actual", "=", "$", "actual", ";", "$", "strategy", "=", "$", "this", "->", "createStrategy", "(", ")", ";", "$", "this", "->", "matchResult", "=", "$", "strategy", "->",...
{@inheritdoc}
[ "{" ]
train
https://github.com/expectation-php/expect/blob/1a32c5af37f3dc8dabe4e8eedeeb21aea16ce139/src/matcher/ToContain.php#L68-L76