id
int32
0
241k
repo
stringlengths
6
63
path
stringlengths
5
140
func_name
stringlengths
3
151
original_string
stringlengths
84
13k
language
stringclasses
1 value
code
stringlengths
84
13k
code_tokens
list
docstring
stringlengths
3
47.2k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
91
247
240,700
hash-bang/Joyst
Joyst_Model.php
Joyst_Model.Save
function Save($id, $data = null) { if (!$id) return; $this->LoadSchema(); if (is_array($id)) { $data = $id; if (!isset($data[$this->schema['_id']['field']])) // Incomming data has no ID to address by return; $id = $data[$this->schema['_id']['field']]; } else { $data[$this->schema['_id']['fi...
php
function Save($id, $data = null) { if (!$id) return; $this->LoadSchema(); if (is_array($id)) { $data = $id; if (!isset($data[$this->schema['_id']['field']])) // Incomming data has no ID to address by return; $id = $data[$this->schema['_id']['field']]; } else { $data[$this->schema['_id']['fi...
[ "function", "Save", "(", "$", "id", ",", "$", "data", "=", "null", ")", "{", "if", "(", "!", "$", "id", ")", "return", ";", "$", "this", "->", "LoadSchema", "(", ")", ";", "if", "(", "is_array", "(", "$", "id", ")", ")", "{", "$", "data", "...
Attempt to save a database record using the provided data Calls the 'save' trigger on the data before it is saved @param mixed|array $id The ID to use to identify the record to change or the full row to save (data will be ignored) @param array $data A hash of data to attempt to store (optional if ID is the full row) @r...
[ "Attempt", "to", "save", "a", "database", "record", "using", "the", "provided", "data", "Calls", "the", "save", "trigger", "on", "the", "data", "before", "it", "is", "saved" ]
f8bcf396120884c5c77e3e8f016b8472e2cc2fb0
https://github.com/hash-bang/Joyst/blob/f8bcf396120884c5c77e3e8f016b8472e2cc2fb0/Joyst_Model.php#L937-L995
240,701
hash-bang/Joyst
Joyst_Model.php
Joyst_Model.Delete
function Delete($id) { $this->LoadSchema(); $data = array($this->schema['_id']['field'] => $id); $this->ResetQuery(array( 'method' => 'delete', 'table' => $this->table, 'where' => array( $this->schema['_id']['field'] => $id, ), )); $this->Trigger('access', $data); if (!$this->continue) ...
php
function Delete($id) { $this->LoadSchema(); $data = array($this->schema['_id']['field'] => $id); $this->ResetQuery(array( 'method' => 'delete', 'table' => $this->table, 'where' => array( $this->schema['_id']['field'] => $id, ), )); $this->Trigger('access', $data); if (!$this->continue) ...
[ "function", "Delete", "(", "$", "id", ")", "{", "$", "this", "->", "LoadSchema", "(", ")", ";", "$", "data", "=", "array", "(", "$", "this", "->", "schema", "[", "'_id'", "]", "[", "'field'", "]", "=>", "$", "id", ")", ";", "$", "this", "->", ...
Delete a single item by its ID Calls the 'delete' trigger on the retrieved row @param mixed|null $id The ID (usually an Int) to retrieve the row by @return bool The success of the delete operation
[ "Delete", "a", "single", "item", "by", "its", "ID", "Calls", "the", "delete", "trigger", "on", "the", "retrieved", "row" ]
f8bcf396120884c5c77e3e8f016b8472e2cc2fb0
https://github.com/hash-bang/Joyst/blob/f8bcf396120884c5c77e3e8f016b8472e2cc2fb0/Joyst_Model.php#L1003-L1036
240,702
hash-bang/Joyst
Joyst_Model.php
Joyst_Model.ResetQuery
function ResetQuery($query = null) { $this->db->ar_select = array(); $this->db->ar_distinct = FALSE; $this->db->ar_from = array(); $this->db->ar_join = array(); $this->db->ar_where = array(); $this->db->ar_like = array(); $this->db->ar_groupby = array(); $this->db->ar_having = array(); $this->db->ar_k...
php
function ResetQuery($query = null) { $this->db->ar_select = array(); $this->db->ar_distinct = FALSE; $this->db->ar_from = array(); $this->db->ar_join = array(); $this->db->ar_where = array(); $this->db->ar_like = array(); $this->db->ar_groupby = array(); $this->db->ar_having = array(); $this->db->ar_k...
[ "function", "ResetQuery", "(", "$", "query", "=", "null", ")", "{", "$", "this", "->", "db", "->", "ar_select", "=", "array", "(", ")", ";", "$", "this", "->", "db", "->", "ar_distinct", "=", "FALSE", ";", "$", "this", "->", "db", "->", "ar_from", ...
Force CI ActiveRecord + Joyst to discard any half formed AR queries @param array $query Optional query to reset Joysts internal query tracker to
[ "Force", "CI", "ActiveRecord", "+", "Joyst", "to", "discard", "any", "half", "formed", "AR", "queries" ]
f8bcf396120884c5c77e3e8f016b8472e2cc2fb0
https://github.com/hash-bang/Joyst/blob/f8bcf396120884c5c77e3e8f016b8472e2cc2fb0/Joyst_Model.php#L1087-L1109
240,703
tenside/core-bundle
src/Controller/InstallProjectController.php
InstallProjectController.configureAction
public function configureAction(Request $request) { if ($this->get('tenside.status')->isTensideConfigured()) { throw new NotAcceptableHttpException('Already configured.'); } $inputData = new JsonArray($request->getContent()); $secret = bin2hex(random_bytes(40)); ...
php
public function configureAction(Request $request) { if ($this->get('tenside.status')->isTensideConfigured()) { throw new NotAcceptableHttpException('Already configured.'); } $inputData = new JsonArray($request->getContent()); $secret = bin2hex(random_bytes(40)); ...
[ "public", "function", "configureAction", "(", "Request", "$", "request", ")", "{", "if", "(", "$", "this", "->", "get", "(", "'tenside.status'", ")", "->", "isTensideConfigured", "(", ")", ")", "{", "throw", "new", "NotAcceptableHttpException", "(", "'Already ...
Configure tenside. NOTE: This method will become inaccessible after the first successful call. @param Request $request The request. @return JsonResponse @throws NotAcceptableHttpException When the configuration is already complete. @ApiDoc( section="install", statusCodes = { 201 = "When everything worked out ok", ...
[ "Configure", "tenside", "." ]
a7ffad3649cddac1e5594b4f8b65a5504363fccd
https://github.com/tenside/core-bundle/blob/a7ffad3649cddac1e5594b4f8b65a5504363fccd/src/Controller/InstallProjectController.php#L108-L136
240,704
tenside/core-bundle
src/Controller/InstallProjectController.php
InstallProjectController.getProjectVersionsAction
public function getProjectVersionsAction($vendor, $project) { $this->checkUninstalled(); $url = sprintf('https://packagist.org/packages/%s/%s.json', $vendor, $project); $rfs = new RemoteFilesystem($this->getInputOutput()); $results = $rfs->getContents($url, $url); $d...
php
public function getProjectVersionsAction($vendor, $project) { $this->checkUninstalled(); $url = sprintf('https://packagist.org/packages/%s/%s.json', $vendor, $project); $rfs = new RemoteFilesystem($this->getInputOutput()); $results = $rfs->getContents($url, $url); $d...
[ "public", "function", "getProjectVersionsAction", "(", "$", "vendor", ",", "$", "project", ")", "{", "$", "this", "->", "checkUninstalled", "(", ")", ";", "$", "url", "=", "sprintf", "(", "'https://packagist.org/packages/%s/%s.json'", ",", "$", "vendor", ",", ...
Retrieve the available versions of a package. NOTE: This method will become inaccessible as soon as the installation is complete. @param string $vendor The vendor name of the package. @param string $project The name of the package. @return JsonResponse @ApiDoc( section="install", statusCodes = { 201 = "When every...
[ "Retrieve", "the", "available", "versions", "of", "a", "package", "." ]
a7ffad3649cddac1e5594b4f8b65a5504363fccd
https://github.com/tenside/core-bundle/blob/a7ffad3649cddac1e5594b4f8b65a5504363fccd/src/Controller/InstallProjectController.php#L357-L397
240,705
tenside/core-bundle
src/Controller/InstallProjectController.php
InstallProjectController.getInstallationStateAction
public function getInstallationStateAction() { $status = $this->get('tenside.status'); return new JsonResponse( [ 'state' => [ 'tenside_configured' => $status->isTensideConfigured(), 'project_created' => $status->isProjectPrese...
php
public function getInstallationStateAction() { $status = $this->get('tenside.status'); return new JsonResponse( [ 'state' => [ 'tenside_configured' => $status->isTensideConfigured(), 'project_created' => $status->isProjectPrese...
[ "public", "function", "getInstallationStateAction", "(", ")", "{", "$", "status", "=", "$", "this", "->", "get", "(", "'tenside.status'", ")", ";", "return", "new", "JsonResponse", "(", "[", "'state'", "=>", "[", "'tenside_configured'", "=>", "$", "status", ...
Check if installation is new, partial or complete. @return JsonResponse @ApiDoc( section="install", description="This method provides information about the installation.", statusCodes = { 201 = "When everything worked out ok", 406 = "When the installation is already complete" }, ) @ApiDescription( response={ "state" ...
[ "Check", "if", "installation", "is", "new", "partial", "or", "complete", "." ]
a7ffad3649cddac1e5594b4f8b65a5504363fccd
https://github.com/tenside/core-bundle/blob/a7ffad3649cddac1e5594b4f8b65a5504363fccd/src/Controller/InstallProjectController.php#L441-L455
240,706
tenside/core-bundle
src/Controller/InstallProjectController.php
InstallProjectController.createUser
private function createUser($username, $password) { $user = new UserInformation( [ 'username' => $username, 'acl' => UserInformationInterface::ROLE_ALL ] ); $user->set('password', $this->get('security.password_encoder')->encodePas...
php
private function createUser($username, $password) { $user = new UserInformation( [ 'username' => $username, 'acl' => UserInformationInterface::ROLE_ALL ] ); $user->set('password', $this->get('security.password_encoder')->encodePas...
[ "private", "function", "createUser", "(", "$", "username", ",", "$", "password", ")", "{", "$", "user", "=", "new", "UserInformation", "(", "[", "'username'", "=>", "$", "username", ",", "'acl'", "=>", "UserInformationInterface", "::", "ROLE_ALL", "]", ")", ...
Add an user to the database. @param string $username The username. @param string $password The password. @return UserInformation
[ "Add", "an", "user", "to", "the", "database", "." ]
a7ffad3649cddac1e5594b4f8b65a5504363fccd
https://github.com/tenside/core-bundle/blob/a7ffad3649cddac1e5594b4f8b65a5504363fccd/src/Controller/InstallProjectController.php#L480-L494
240,707
tenside/core-bundle
src/Controller/InstallProjectController.php
InstallProjectController.handleConfiguration
private function handleConfiguration($configuration) { $tensideConfig = $this->get('tenside.config'); if (isset($configuration['php_cli'])) { $tensideConfig->setPhpCliBinary($configuration['php_cli']); } if (isset($configuration['php_cli_arguments'])) { $ten...
php
private function handleConfiguration($configuration) { $tensideConfig = $this->get('tenside.config'); if (isset($configuration['php_cli'])) { $tensideConfig->setPhpCliBinary($configuration['php_cli']); } if (isset($configuration['php_cli_arguments'])) { $ten...
[ "private", "function", "handleConfiguration", "(", "$", "configuration", ")", "{", "$", "tensideConfig", "=", "$", "this", "->", "get", "(", "'tenside.config'", ")", ";", "if", "(", "isset", "(", "$", "configuration", "[", "'php_cli'", "]", ")", ")", "{", ...
Absorb the passed configuration. @param array $configuration The configuration to absorb. @return void
[ "Absorb", "the", "passed", "configuration", "." ]
a7ffad3649cddac1e5594b4f8b65a5504363fccd
https://github.com/tenside/core-bundle/blob/a7ffad3649cddac1e5594b4f8b65a5504363fccd/src/Controller/InstallProjectController.php#L503-L535
240,708
99designs/ergo
classes/Ergo/Config/FileConfig.php
FileConfig.loadFile
function loadFile($file, $optional=false, $varname=false, $recursive=false) { if (!is_file($file)) { if ($optional) return $this; else throw new Exception("Failed to read config file '$file'"); } $newConfig = @include($file); if(!is_array($newConfig) && $varname) $newConfig = $$varname; ...
php
function loadFile($file, $optional=false, $varname=false, $recursive=false) { if (!is_file($file)) { if ($optional) return $this; else throw new Exception("Failed to read config file '$file'"); } $newConfig = @include($file); if(!is_array($newConfig) && $varname) $newConfig = $$varname; ...
[ "function", "loadFile", "(", "$", "file", ",", "$", "optional", "=", "false", ",", "$", "varname", "=", "false", ",", "$", "recursive", "=", "false", ")", "{", "if", "(", "!", "is_file", "(", "$", "file", ")", ")", "{", "if", "(", "$", "optional"...
Loads a config file and merges its contents with the previously loaded settings @param string the name of the file to load @param bool whether the file is optional @param mixed the name of the variable to save as the data @param bool whether the config should merge recursively @chainable
[ "Loads", "a", "config", "file", "and", "merges", "its", "contents", "with", "the", "previously", "loaded", "settings" ]
8fbcfe683a14572cbf26ff59c3537c2261a7a4eb
https://github.com/99designs/ergo/blob/8fbcfe683a14572cbf26ff59c3537c2261a7a4eb/classes/Ergo/Config/FileConfig.php#L65-L91
240,709
BlackBoxRepo/PandoContentBundle
Service/TemplateFinderService.php
TemplateFinderService.find
public function find(PageDocument $page) { $request = $this->requestStack->getCurrentRequest(); $template = $page->getDefault(AbstractPhpcrDocument::DEFAULT_TEMPLATE_KEY); if ($template === null) { $defaults = []; /** @var RouteEnhancerInterface $enhancer */ ...
php
public function find(PageDocument $page) { $request = $this->requestStack->getCurrentRequest(); $template = $page->getDefault(AbstractPhpcrDocument::DEFAULT_TEMPLATE_KEY); if ($template === null) { $defaults = []; /** @var RouteEnhancerInterface $enhancer */ ...
[ "public", "function", "find", "(", "PageDocument", "$", "page", ")", "{", "$", "request", "=", "$", "this", "->", "requestStack", "->", "getCurrentRequest", "(", ")", ";", "$", "template", "=", "$", "page", "->", "getDefault", "(", "AbstractPhpcrDocument", ...
Returns the default template for a given page @param PageDocument $page @return string|null
[ "Returns", "the", "default", "template", "for", "a", "given", "page" ]
fa54d0c7542c1d359a5dbb4f32dab3e195e41007
https://github.com/BlackBoxRepo/PandoContentBundle/blob/fa54d0c7542c1d359a5dbb4f32dab3e195e41007/Service/TemplateFinderService.php#L51-L70
240,710
Nobiles2/pcc-3-deklaracja
PCC3/Deklaracja.php
Deklaracja.setPodmiot1
public function setPodmiot1(\KCH\PCC3\Deklaracja\Podmiot1AnonymousType $podmiot1) { $this->podmiot1 = $podmiot1; return $this; }
php
public function setPodmiot1(\KCH\PCC3\Deklaracja\Podmiot1AnonymousType $podmiot1) { $this->podmiot1 = $podmiot1; return $this; }
[ "public", "function", "setPodmiot1", "(", "\\", "KCH", "\\", "PCC3", "\\", "Deklaracja", "\\", "Podmiot1AnonymousType", "$", "podmiot1", ")", "{", "$", "this", "->", "podmiot1", "=", "$", "podmiot1", ";", "return", "$", "this", ";", "}" ]
Sets a new podmiot1 Dane podatnika dokonującego zapłaty lub zwolnionego z podatku na podstawie art. 9 pkt 10 lit. b ustawy @param \KCH\PCC3\Deklaracja\Podmiot1AnonymousType $podmiot1 @return self
[ "Sets", "a", "new", "podmiot1" ]
8c36b2bc70f7ab0ebc8a0d68a0326f4c20e35106
https://github.com/Nobiles2/pcc-3-deklaracja/blob/8c36b2bc70f7ab0ebc8a0d68a0326f4c20e35106/PCC3/Deklaracja.php#L99-L103
240,711
Nobiles2/pcc-3-deklaracja
PCC3/Deklaracja.php
Deklaracja.setZalaczniki
public function setZalaczniki(\KCH\PCC3\Deklaracja\ZalacznikiAnonymousType $zalaczniki) { $this->zalaczniki = $zalaczniki; return $this; }
php
public function setZalaczniki(\KCH\PCC3\Deklaracja\ZalacznikiAnonymousType $zalaczniki) { $this->zalaczniki = $zalaczniki; return $this; }
[ "public", "function", "setZalaczniki", "(", "\\", "KCH", "\\", "PCC3", "\\", "Deklaracja", "\\", "ZalacznikiAnonymousType", "$", "zalaczniki", ")", "{", "$", "this", "->", "zalaczniki", "=", "$", "zalaczniki", ";", "return", "$", "this", ";", "}" ]
Sets a new zalaczniki @param \KCH\PCC3\Deklaracja\ZalacznikiAnonymousType $zalaczniki @return self
[ "Sets", "a", "new", "zalaczniki" ]
8c36b2bc70f7ab0ebc8a0d68a0326f4c20e35106
https://github.com/Nobiles2/pcc-3-deklaracja/blob/8c36b2bc70f7ab0ebc8a0d68a0326f4c20e35106/PCC3/Deklaracja.php#L197-L201
240,712
spiritdead/resque
components/workers/base/ResqueWorkerBase.php
ResqueWorkerBase.restore
public function restore($workerInstance) { list($hostname, $pid, $queues) = explode(':', $workerInstance, 3); if (!is_array($queues)) { $queues = explode(',', $queues); } $this->queues = $queues; $this->pid = $pid; $this->id = $workerInstance; //regenerat...
php
public function restore($workerInstance) { list($hostname, $pid, $queues) = explode(':', $workerInstance, 3); if (!is_array($queues)) { $queues = explode(',', $queues); } $this->queues = $queues; $this->pid = $pid; $this->id = $workerInstance; //regenerat...
[ "public", "function", "restore", "(", "$", "workerInstance", ")", "{", "list", "(", "$", "hostname", ",", "$", "pid", ",", "$", "queues", ")", "=", "explode", "(", "':'", ",", "$", "workerInstance", ",", "3", ")", ";", "if", "(", "!", "is_array", "...
Method for regenerate worker from the current ID saved in the redis and the instance in the server @param $workerInstance @return boolean // Success or Fail
[ "Method", "for", "regenerate", "worker", "from", "the", "current", "ID", "saved", "in", "the", "redis", "and", "the", "instance", "in", "the", "server" ]
6d1f58c5a15a7f50a90ca08f882e64bc07488cc4
https://github.com/spiritdead/resque/blob/6d1f58c5a15a7f50a90ca08f882e64bc07488cc4/components/workers/base/ResqueWorkerBase.php#L114-L135
240,713
silinternational/psr3-adapters
src/LoggerBase.php
LoggerBase.interpolateString
private function interpolateString($message, array $context = []) { // Build a replacement array with braces around the context keys. $replace = []; foreach ($context as $key => $value) { // Check that the value can be cast to string. if (!is_array($value) && (!is_obj...
php
private function interpolateString($message, array $context = []) { // Build a replacement array with braces around the context keys. $replace = []; foreach ($context as $key => $value) { // Check that the value can be cast to string. if (!is_array($value) && (!is_obj...
[ "private", "function", "interpolateString", "(", "$", "message", ",", "array", "$", "context", "=", "[", "]", ")", "{", "// Build a replacement array with braces around the context keys.", "$", "replace", "=", "[", "]", ";", "foreach", "(", "$", "context", "as", ...
Interpolate context values into the given string. This is based heavily on the example implementation here: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md#12-message @param string $message The message (potentially with placeholders). @param array $context (Optional:) The array...
[ "Interpolate", "context", "values", "into", "the", "given", "string", "." ]
dd091be5b23f1f86fbb404dba2c4cf700e2ba9f9
https://github.com/silinternational/psr3-adapters/blob/dd091be5b23f1f86fbb404dba2c4cf700e2ba9f9/src/LoggerBase.php#L51-L76
240,714
rozaverta/cmf
core/Prop.php
Prop.file
public static function file( $name, & $exists = false ) { if( !defined("APP_DIR") ) { return []; } $file = APP_DIR . "config" . DIRECTORY_SEPARATOR . $name . '.php'; if( file_exists( $file ) ) { $data = Helper::includeImport($file); $exists = true; } if( ! isset( $data ) || ! is_array( $data...
php
public static function file( $name, & $exists = false ) { if( !defined("APP_DIR") ) { return []; } $file = APP_DIR . "config" . DIRECTORY_SEPARATOR . $name . '.php'; if( file_exists( $file ) ) { $data = Helper::includeImport($file); $exists = true; } if( ! isset( $data ) || ! is_array( $data...
[ "public", "static", "function", "file", "(", "$", "name", ",", "&", "$", "exists", "=", "false", ")", "{", "if", "(", "!", "defined", "(", "\"APP_DIR\"", ")", ")", "{", "return", "[", "]", ";", "}", "$", "file", "=", "APP_DIR", ".", "\"config\"", ...
Get array data from file @param $name @param bool $exists @return array
[ "Get", "array", "data", "from", "file" ]
95ed38362e397d1c700ee255f7200234ef98d356
https://github.com/rozaverta/cmf/blob/95ed38362e397d1c700ee255f7200234ef98d356/core/Prop.php#L84-L104
240,715
rozaverta/cmf
core/Prop.php
Prop.cache
public static function cache( $name ) { static $cache = []; $name = (string) $name; if( ! isset($cache[$name]) ) { $cache[$name] = new self($name); } return $cache[$name]; }
php
public static function cache( $name ) { static $cache = []; $name = (string) $name; if( ! isset($cache[$name]) ) { $cache[$name] = new self($name); } return $cache[$name]; }
[ "public", "static", "function", "cache", "(", "$", "name", ")", "{", "static", "$", "cache", "=", "[", "]", ";", "$", "name", "=", "(", "string", ")", "$", "name", ";", "if", "(", "!", "isset", "(", "$", "cache", "[", "$", "name", "]", ")", "...
Get cache property from file @param $name @return Prop
[ "Get", "cache", "property", "from", "file" ]
95ed38362e397d1c700ee255f7200234ef98d356
https://github.com/rozaverta/cmf/blob/95ed38362e397d1c700ee255f7200234ef98d356/core/Prop.php#L112-L124
240,716
rozaverta/cmf
core/Prop.php
Prop.group
public function group( $name ) { $name = rtrim($name, '.'); $pref = $name . '.'; $len = strlen($pref); $data = []; foreach( array_keys($this->items) as $key ) { if( $key === $name ) { $data['.'] = $this->items[$key]; } else if( strlen($key) > $len && substr($key, 0, $len) === $pref ) { ...
php
public function group( $name ) { $name = rtrim($name, '.'); $pref = $name . '.'; $len = strlen($pref); $data = []; foreach( array_keys($this->items) as $key ) { if( $key === $name ) { $data['.'] = $this->items[$key]; } else if( strlen($key) > $len && substr($key, 0, $len) === $pref ) { ...
[ "public", "function", "group", "(", "$", "name", ")", "{", "$", "name", "=", "rtrim", "(", "$", "name", ",", "'.'", ")", ";", "$", "pref", "=", "$", "name", ".", "'.'", ";", "$", "len", "=", "strlen", "(", "$", "pref", ")", ";", "$", "data", ...
Get new property group @param $name @return Prop
[ "Get", "new", "property", "group" ]
95ed38362e397d1c700ee255f7200234ef98d356
https://github.com/rozaverta/cmf/blob/95ed38362e397d1c700ee255f7200234ef98d356/core/Prop.php#L210-L230
240,717
rozaverta/cmf
core/Prop.php
Prop.pathSet
public function pathSet( $path, $value ) { $path = $this->createPath($path); if( $path[0] == 1 ) { $this->offsetSet($path[1], $value); } else { $array = & $this->items; for( $i = 1, $len = $path[0]; $i <= $len; $i++ ) { $key = $path[$i]; if( $i == $len ) { $array[$key] = $value...
php
public function pathSet( $path, $value ) { $path = $this->createPath($path); if( $path[0] == 1 ) { $this->offsetSet($path[1], $value); } else { $array = & $this->items; for( $i = 1, $len = $path[0]; $i <= $len; $i++ ) { $key = $path[$i]; if( $i == $len ) { $array[$key] = $value...
[ "public", "function", "pathSet", "(", "$", "path", ",", "$", "value", ")", "{", "$", "path", "=", "$", "this", "->", "createPath", "(", "$", "path", ")", ";", "if", "(", "$", "path", "[", "0", "]", "==", "1", ")", "{", "$", "this", "->", "off...
Set value for path. @example $this->pathSet( 'a.b.c', $value ) => $this->items['a']['b']['c'] = $value; @param string $path @param mixed $value @return $this
[ "Set", "value", "for", "path", "." ]
95ed38362e397d1c700ee255f7200234ef98d356
https://github.com/rozaverta/cmf/blob/95ed38362e397d1c700ee255f7200234ef98d356/core/Prop.php#L252-L281
240,718
rozaverta/cmf
core/Prop.php
Prop.pathGetIs
public function pathGetIs( $path, $accessible = false ) { $path = $this->createPath($path); $array = & $this->items; $key = $path[1]; if( $path[0] > 1 ) { for( $i = 1, $len = $path[0]; $i <= $len; $i++ ) { $key = $path[$i]; if( ! array_key_exists($key, $array) ) { return false; } ...
php
public function pathGetIs( $path, $accessible = false ) { $path = $this->createPath($path); $array = & $this->items; $key = $path[1]; if( $path[0] > 1 ) { for( $i = 1, $len = $path[0]; $i <= $len; $i++ ) { $key = $path[$i]; if( ! array_key_exists($key, $array) ) { return false; } ...
[ "public", "function", "pathGetIs", "(", "$", "path", ",", "$", "accessible", "=", "false", ")", "{", "$", "path", "=", "$", "this", "->", "createPath", "(", "$", "path", ")", ";", "$", "array", "=", "&", "$", "this", "->", "items", ";", "$", "key...
Check value exists for path exist. @param string $path @param bool $accessible @return bool
[ "Check", "value", "exists", "for", "path", "exist", "." ]
95ed38362e397d1c700ee255f7200234ef98d356
https://github.com/rozaverta/cmf/blob/95ed38362e397d1c700ee255f7200234ef98d356/core/Prop.php#L290-L329
240,719
rozaverta/cmf
core/Prop.php
Prop.pathGetOr
public function pathGetOr( $path, $default ) { $path = $this->createPath($path); if( $path[0] == 1 ) { return $this->get($path[1]); } $array = & $this->items; for( $i = 1, $len = $path[0]; $i <= $len; $i++ ) { $key = $path[$i]; if( ! array_key_exists($key, $array) ) { break; } if(...
php
public function pathGetOr( $path, $default ) { $path = $this->createPath($path); if( $path[0] == 1 ) { return $this->get($path[1]); } $array = & $this->items; for( $i = 1, $len = $path[0]; $i <= $len; $i++ ) { $key = $path[$i]; if( ! array_key_exists($key, $array) ) { break; } if(...
[ "public", "function", "pathGetOr", "(", "$", "path", ",", "$", "default", ")", "{", "$", "path", "=", "$", "this", "->", "createPath", "(", "$", "path", ")", ";", "if", "(", "$", "path", "[", "0", "]", "==", "1", ")", "{", "return", "$", "this"...
Get value from path or get default value if not exists. @param string $path @param mixed $default @return mixed
[ "Get", "value", "from", "path", "or", "get", "default", "value", "if", "not", "exists", "." ]
95ed38362e397d1c700ee255f7200234ef98d356
https://github.com/rozaverta/cmf/blob/95ed38362e397d1c700ee255f7200234ef98d356/core/Prop.php#L349-L380
240,720
phn-io/compilation
spec/Phn/Compilation/LoopSpec.php
LoopSpec.it_provides_useful_information_about_iterations
function it_provides_useful_information_about_iterations() { $this->next('one'); $this->getIndex()->shouldBe(0); $this->getKey()->shouldBe('one'); $this->isFirst()->shouldBe(true); $this->isLast()->shouldBe(false); $this->next('two'); $this->getIndex()->shoul...
php
function it_provides_useful_information_about_iterations() { $this->next('one'); $this->getIndex()->shouldBe(0); $this->getKey()->shouldBe('one'); $this->isFirst()->shouldBe(true); $this->isLast()->shouldBe(false); $this->next('two'); $this->getIndex()->shoul...
[ "function", "it_provides_useful_information_about_iterations", "(", ")", "{", "$", "this", "->", "next", "(", "'one'", ")", ";", "$", "this", "->", "getIndex", "(", ")", "->", "shouldBe", "(", "0", ")", ";", "$", "this", "->", "getKey", "(", ")", "->", ...
It provides useful information about iterations.
[ "It", "provides", "useful", "information", "about", "iterations", "." ]
202e1816cc0039c08ad7ab3eb914e91e51d77320
https://github.com/phn-io/compilation/blob/202e1816cc0039c08ad7ab3eb914e91e51d77320/spec/Phn/Compilation/LoopSpec.php#L41-L60
240,721
indigophp-archive/codeception-fuel-module
fuel/fuel/core/classes/fuel.php
Fuel.init
public static function init($config) { if (static::$initialized) { throw new \FuelException("You can't initialize Fuel more than once."); } // BC FIX FOR APPLICATIONS <= 1.6.1, makes Redis_Db available as Redis, // like it was in versions before 1.7 class_exists('Redis', false) or class_alias('Redis_Db...
php
public static function init($config) { if (static::$initialized) { throw new \FuelException("You can't initialize Fuel more than once."); } // BC FIX FOR APPLICATIONS <= 1.6.1, makes Redis_Db available as Redis, // like it was in versions before 1.7 class_exists('Redis', false) or class_alias('Redis_Db...
[ "public", "static", "function", "init", "(", "$", "config", ")", "{", "if", "(", "static", "::", "$", "initialized", ")", "{", "throw", "new", "\\", "FuelException", "(", "\"You can't initialize Fuel more than once.\"", ")", ";", "}", "// BC FIX FOR APPLICATIONS <...
Initializes the framework. This can only be called once. @access public @return void
[ "Initializes", "the", "framework", ".", "This", "can", "only", "be", "called", "once", "." ]
0973b7cbd540a0e89cc5bb7af94627f77f09bf49
https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/fuel.php#L123-L211
240,722
indigophp-archive/codeception-fuel-module
fuel/fuel/core/classes/fuel.php
Fuel.finish
public static function finish() { if (\Config::get('caching', false)) { \Finder::instance()->write_cache('FuelFileFinder'); } if (static::$profiling and ! static::$is_cli and ! \Input::is_ajax()) { // Grab the output buffer and flush it, we will rebuffer later $output = ob_get_clean(); $headers...
php
public static function finish() { if (\Config::get('caching', false)) { \Finder::instance()->write_cache('FuelFileFinder'); } if (static::$profiling and ! static::$is_cli and ! \Input::is_ajax()) { // Grab the output buffer and flush it, we will rebuffer later $output = ob_get_clean(); $headers...
[ "public", "static", "function", "finish", "(", ")", "{", "if", "(", "\\", "Config", "::", "get", "(", "'caching'", ",", "false", ")", ")", "{", "\\", "Finder", "::", "instance", "(", ")", "->", "write_cache", "(", "'FuelFileFinder'", ")", ";", "}", "...
Cleans up Fuel execution, ends the output buffering, and outputs the buffer contents. @access public @return void
[ "Cleans", "up", "Fuel", "execution", "ends", "the", "output", "buffering", "and", "outputs", "the", "buffer", "contents", "." ]
0973b7cbd540a0e89cc5bb7af94627f77f09bf49
https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/fuel.php#L220-L261
240,723
indigophp-archive/codeception-fuel-module
fuel/fuel/core/classes/fuel.php
Fuel.generate_base_url
protected static function generate_base_url() { $base_url = ''; if(\Input::server('http_host')) { $base_url .= \Input::protocol().'://'.\Input::server('http_host'); } if (\Input::server('script_name')) { $common = get_common_path(array(\Input::server('request_uri'), \Input::server('script_name'))); ...
php
protected static function generate_base_url() { $base_url = ''; if(\Input::server('http_host')) { $base_url .= \Input::protocol().'://'.\Input::server('http_host'); } if (\Input::server('script_name')) { $common = get_common_path(array(\Input::server('request_uri'), \Input::server('script_name'))); ...
[ "protected", "static", "function", "generate_base_url", "(", ")", "{", "$", "base_url", "=", "''", ";", "if", "(", "\\", "Input", "::", "server", "(", "'http_host'", ")", ")", "{", "$", "base_url", ".=", "\\", "Input", "::", "protocol", "(", ")", ".", ...
Generates a base url. @return string the base url
[ "Generates", "a", "base", "url", "." ]
0973b7cbd540a0e89cc5bb7af94627f77f09bf49
https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/fuel.php#L268-L283
240,724
indigophp-archive/codeception-fuel-module
fuel/fuel/core/classes/fuel.php
Fuel.always_load
public static function always_load($array = null) { is_null($array) and $array = \Config::get('always_load', array()); isset($array['packages']) and \Package::load($array['packages']); isset($array['modules']) and \Module::load($array['modules']); if (isset($array['classes'])) { foreach ($array['classe...
php
public static function always_load($array = null) { is_null($array) and $array = \Config::get('always_load', array()); isset($array['packages']) and \Package::load($array['packages']); isset($array['modules']) and \Module::load($array['modules']); if (isset($array['classes'])) { foreach ($array['classe...
[ "public", "static", "function", "always_load", "(", "$", "array", "=", "null", ")", "{", "is_null", "(", "$", "array", ")", "and", "$", "array", "=", "\\", "Config", "::", "get", "(", "'always_load'", ",", "array", "(", ")", ")", ";", "isset", "(", ...
Always load packages, modules, classes, config & language files set in always_load.php config @param array what to autoload
[ "Always", "load", "packages", "modules", "classes", "config", "&", "language", "files", "set", "in", "always_load", ".", "php", "config" ]
0973b7cbd540a0e89cc5bb7af94627f77f09bf49
https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/fuel.php#L301-L340
240,725
indigophp-archive/codeception-fuel-module
fuel/fuel/core/classes/fuel.php
Fuel.clean_path
public static function clean_path($path) { static $search = array(APPPATH, COREPATH, PKGPATH, DOCROOT, '\\'); static $replace = array('APPPATH/', 'COREPATH/', 'PKGPATH/', 'DOCROOT/', '/'); return str_ireplace($search, $replace, $path); }
php
public static function clean_path($path) { static $search = array(APPPATH, COREPATH, PKGPATH, DOCROOT, '\\'); static $replace = array('APPPATH/', 'COREPATH/', 'PKGPATH/', 'DOCROOT/', '/'); return str_ireplace($search, $replace, $path); }
[ "public", "static", "function", "clean_path", "(", "$", "path", ")", "{", "static", "$", "search", "=", "array", "(", "APPPATH", ",", "COREPATH", ",", "PKGPATH", ",", "DOCROOT", ",", "'\\\\'", ")", ";", "static", "$", "replace", "=", "array", "(", "'AP...
Cleans a file path so that it does not contain absolute file paths. @param string the filepath @return string the clean path
[ "Cleans", "a", "file", "path", "so", "that", "it", "does", "not", "contain", "absolute", "file", "paths", "." ]
0973b7cbd540a0e89cc5bb7af94627f77f09bf49
https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/fuel.php#L361-L366
240,726
chenwenzhang/initially-rpc
src/Initially/Rpc/Transport/Transport.php
Transport.send
public function send(Request $request) { $interface = $request->getInterface(); $service = ConfigFactory::getClient()->getService($interface); $url = $service->getUrl(); $requestRaw = Formatter::serialize($request); $responseRaw = $this->protocol->sendData($url, $requestRaw)...
php
public function send(Request $request) { $interface = $request->getInterface(); $service = ConfigFactory::getClient()->getService($interface); $url = $service->getUrl(); $requestRaw = Formatter::serialize($request); $responseRaw = $this->protocol->sendData($url, $requestRaw)...
[ "public", "function", "send", "(", "Request", "$", "request", ")", "{", "$", "interface", "=", "$", "request", "->", "getInterface", "(", ")", ";", "$", "service", "=", "ConfigFactory", "::", "getClient", "(", ")", "->", "getService", "(", "$", "interfac...
Send Rpc Request @param Request $request @return mixed @throws InitiallyRpcException
[ "Send", "Rpc", "Request" ]
43d56eb3749bedd3f4ee83e57676f7bb6b89e682
https://github.com/chenwenzhang/initially-rpc/blob/43d56eb3749bedd3f4ee83e57676f7bb6b89e682/src/Initially/Rpc/Transport/Transport.php#L62-L88
240,727
moaction/jsonrpc-client
src/Moaction/Jsonrpc/Client/ClientBasic.php
ClientBasic.send
protected function send($content) { $streamOptions = array( 'http' => array( 'method' => 'POST', 'header' => 'Content-Type: application/json', 'content' => $content, ) ); $context = stream_context_create($streamOptions); $result = @file_get_contents($this->getServerUrl(), false, $context);...
php
protected function send($content) { $streamOptions = array( 'http' => array( 'method' => 'POST', 'header' => 'Content-Type: application/json', 'content' => $content, ) ); $context = stream_context_create($streamOptions); $result = @file_get_contents($this->getServerUrl(), false, $context);...
[ "protected", "function", "send", "(", "$", "content", ")", "{", "$", "streamOptions", "=", "array", "(", "'http'", "=>", "array", "(", "'method'", "=>", "'POST'", ",", "'header'", "=>", "'Content-Type: application/json'", ",", "'content'", "=>", "$", "content"...
Send low level data by http @param string $content @return string @throws Exception
[ "Send", "low", "level", "data", "by", "http" ]
cbfb6caeae7dce838cb0f429ae4a60e4ead5ee0c
https://github.com/moaction/jsonrpc-client/blob/cbfb6caeae7dce838cb0f429ae4a60e4ead5ee0c/src/Moaction/Jsonrpc/Client/ClientBasic.php#L43-L61
240,728
CakeCMS/Community
src/Notify/Email.php
Email.sendActivationMessage
public function sendActivationMessage() { $macros = new Macros($this->_data); $message = $this->_params->get('msg_account_activate_msg'); $message = $macros->text($message); $subject = $this->_params->get('msg_account_activate_subject'); return $this->send($subject, $messag...
php
public function sendActivationMessage() { $macros = new Macros($this->_data); $message = $this->_params->get('msg_account_activate_msg'); $message = $macros->text($message); $subject = $this->_params->get('msg_account_activate_subject'); return $this->send($subject, $messag...
[ "public", "function", "sendActivationMessage", "(", ")", "{", "$", "macros", "=", "new", "Macros", "(", "$", "this", "->", "_data", ")", ";", "$", "message", "=", "$", "this", "->", "_params", "->", "get", "(", "'msg_account_activate_msg'", ")", ";", "$"...
Send user message when have success activation profile. @return array
[ "Send", "user", "message", "when", "have", "success", "activation", "profile", "." ]
cc2bdb596dd9617d42fd81f59e981024caa062e8
https://github.com/CakeCMS/Community/blob/cc2bdb596dd9617d42fd81f59e981024caa062e8/src/Notify/Email.php#L45-L53
240,729
Thuata/IntercessionBundle
Intercession/IntercessionClass.php
IntercessionClass.addAuthor
public function addAuthor(string $name = null, string $email = null) { is_null($name) and $name = ''; is_null($email) and $email = ''; if (empty($name) and empty($email)) { throw new AuthorNoDataException(); } if (!empty($email)) { $author ...
php
public function addAuthor(string $name = null, string $email = null) { is_null($name) and $name = ''; is_null($email) and $email = ''; if (empty($name) and empty($email)) { throw new AuthorNoDataException(); } if (!empty($email)) { $author ...
[ "public", "function", "addAuthor", "(", "string", "$", "name", "=", "null", ",", "string", "$", "email", "=", "null", ")", "{", "is_null", "(", "$", "name", ")", "and", "$", "name", "=", "''", ";", "is_null", "(", "$", "email", ")", "and", "$", "...
Adds an author @param string $name @param string $email @return IntercessionClass @throws AuthorNoDataException
[ "Adds", "an", "author" ]
5dc223e162e8ba491825e105f1e43fad7578841d
https://github.com/Thuata/IntercessionBundle/blob/5dc223e162e8ba491825e105f1e43fad7578841d/Intercession/IntercessionClass.php#L216-L234
240,730
Thuata/IntercessionBundle
Intercession/IntercessionClass.php
IntercessionClass.addInterface
public function addInterface(string $interfaceName, string $alias = null) { $this->interfaces[] = $this->addUse($interfaceName, $alias); }
php
public function addInterface(string $interfaceName, string $alias = null) { $this->interfaces[] = $this->addUse($interfaceName, $alias); }
[ "public", "function", "addInterface", "(", "string", "$", "interfaceName", ",", "string", "$", "alias", "=", "null", ")", "{", "$", "this", "->", "interfaces", "[", "]", "=", "$", "this", "->", "addUse", "(", "$", "interfaceName", ",", "$", "alias", ")...
Adds an interface @param string $interfaceName @param string $alias @throws DuplicateUseWithAliasException
[ "Adds", "an", "interface" ]
5dc223e162e8ba491825e105f1e43fad7578841d
https://github.com/Thuata/IntercessionBundle/blob/5dc223e162e8ba491825e105f1e43fad7578841d/Intercession/IntercessionClass.php#L302-L305
240,731
Thuata/IntercessionBundle
Intercession/IntercessionClass.php
IntercessionClass.addTrait
public function addTrait(string $traitName, string $alias = null) { $this->traits[] = $this->addUse($traitName, $alias); return $this; }
php
public function addTrait(string $traitName, string $alias = null) { $this->traits[] = $this->addUse($traitName, $alias); return $this; }
[ "public", "function", "addTrait", "(", "string", "$", "traitName", ",", "string", "$", "alias", "=", "null", ")", "{", "$", "this", "->", "traits", "[", "]", "=", "$", "this", "->", "addUse", "(", "$", "traitName", ",", "$", "alias", ")", ";", "ret...
Adds a trait @param string $traitName @param string $alias @return IntercessionClass
[ "Adds", "a", "trait" ]
5dc223e162e8ba491825e105f1e43fad7578841d
https://github.com/Thuata/IntercessionBundle/blob/5dc223e162e8ba491825e105f1e43fad7578841d/Intercession/IntercessionClass.php#L325-L330
240,732
Thuata/IntercessionBundle
Intercession/IntercessionClass.php
IntercessionClass.extractClassNameFromUse
public function extractClassNameFromUse(string $use) { $matches = []; if (preg_match(self::USE_CLASS_EXTRACT_REGEXP, $use, $matches) === 0) { throw new InvalidNamespaceException($use); } $className = $matches['classname']; $namespace = array_key_exists(...
php
public function extractClassNameFromUse(string $use) { $matches = []; if (preg_match(self::USE_CLASS_EXTRACT_REGEXP, $use, $matches) === 0) { throw new InvalidNamespaceException($use); } $className = $matches['classname']; $namespace = array_key_exists(...
[ "public", "function", "extractClassNameFromUse", "(", "string", "$", "use", ")", "{", "$", "matches", "=", "[", "]", ";", "if", "(", "preg_match", "(", "self", "::", "USE_CLASS_EXTRACT_REGEXP", ",", "$", "use", ",", "$", "matches", ")", "===", "0", ")", ...
Extracts the class name from a used namespaced class @param string $use @return mixed @throws InvalidNamespaceException
[ "Extracts", "the", "class", "name", "from", "a", "used", "namespaced", "class" ]
5dc223e162e8ba491825e105f1e43fad7578841d
https://github.com/Thuata/IntercessionBundle/blob/5dc223e162e8ba491825e105f1e43fad7578841d/Intercession/IntercessionClass.php#L427-L446
240,733
Malwarebytes/AltamiraBundle
ScriptHandler.php
ScriptHandler.installJSDependencies
public static function installJSDependencies($event) { echo "Installing JS Library dependencies for the AltamiraBundle\n"; $dir = getcwd(); ScriptHandler::gitSubmodulesUpdate(); ScriptHandler::cleanPublicJSDir(); // discovered that assetic can minify all the code - all not nec...
php
public static function installJSDependencies($event) { echo "Installing JS Library dependencies for the AltamiraBundle\n"; $dir = getcwd(); ScriptHandler::gitSubmodulesUpdate(); ScriptHandler::cleanPublicJSDir(); // discovered that assetic can minify all the code - all not nec...
[ "public", "static", "function", "installJSDependencies", "(", "$", "event", ")", "{", "echo", "\"Installing JS Library dependencies for the AltamiraBundle\\n\"", ";", "$", "dir", "=", "getcwd", "(", ")", ";", "ScriptHandler", "::", "gitSubmodulesUpdate", "(", ")", ";"...
if this gets any bigger, break it up into separate methods
[ "if", "this", "gets", "any", "bigger", "break", "it", "up", "into", "separate", "methods" ]
f42a7c1b27b8d8f15ada10f20571f74b3f95f406
https://github.com/Malwarebytes/AltamiraBundle/blob/f42a7c1b27b8d8f15ada10f20571f74b3f95f406/ScriptHandler.php#L51-L114
240,734
tkhatibi/php-field
src/FieldFactory.php
FieldFactory.getInstance
public static function getInstance(array $config = []) { // If element has no name if (!isset($config['name'])){ throw new \Exception("You have to set the name of the field", 1); } if(!isset($config['class'])){ $config['class'] = Text::className(); ...
php
public static function getInstance(array $config = []) { // If element has no name if (!isset($config['name'])){ throw new \Exception("You have to set the name of the field", 1); } if(!isset($config['class'])){ $config['class'] = Text::className(); ...
[ "public", "static", "function", "getInstance", "(", "array", "$", "config", "=", "[", "]", ")", "{", "// If element has no name\r", "if", "(", "!", "isset", "(", "$", "config", "[", "'name'", "]", ")", ")", "{", "throw", "new", "\\", "Exception", "(", ...
Builds the field and returns it @param array $name field config @return Field instance @throws Exception if the name of the field not found in config array
[ "Builds", "the", "field", "and", "returns", "it" ]
629657a7f96353ab6caf11ca9319a17ede719b76
https://github.com/tkhatibi/php-field/blob/629657a7f96353ab6caf11ca9319a17ede719b76/src/FieldFactory.php#L28-L37
240,735
PHPComponent/AtomicFile
src/AtomicFileHandler.php
AtomicFileHandler.rewindFile
public function rewindFile() { $this->openFile(); if(!rewind($this->getFile())) { throw FileOperationException::createForFailedToRewindFile($this->getFilePath()); } return $this; }
php
public function rewindFile() { $this->openFile(); if(!rewind($this->getFile())) { throw FileOperationException::createForFailedToRewindFile($this->getFilePath()); } return $this; }
[ "public", "function", "rewindFile", "(", ")", "{", "$", "this", "->", "openFile", "(", ")", ";", "if", "(", "!", "rewind", "(", "$", "this", "->", "getFile", "(", ")", ")", ")", "{", "throw", "FileOperationException", "::", "createForFailedToRewindFile", ...
Rewind the file @return $this @throws AtomicFileException
[ "Rewind", "the", "file" ]
9ca88297bdbdeb3bcbecdcbe884e4f412bb2cfe8
https://github.com/PHPComponent/AtomicFile/blob/9ca88297bdbdeb3bcbecdcbe884e4f412bb2cfe8/src/AtomicFileHandler.php#L65-L73
240,736
PHPComponent/AtomicFile
src/AtomicFileHandler.php
AtomicFileHandler.isFileEmpty
public function isFileEmpty() { $this->openFile(); $saved_pointer = $this->getFilePointer(); $this->rewindFile()->seekFileToEnd(); $size_pointer = $this->getFilePointer(); $this->seekFile($saved_pointer); return $size_pointer === 0; }
php
public function isFileEmpty() { $this->openFile(); $saved_pointer = $this->getFilePointer(); $this->rewindFile()->seekFileToEnd(); $size_pointer = $this->getFilePointer(); $this->seekFile($saved_pointer); return $size_pointer === 0; }
[ "public", "function", "isFileEmpty", "(", ")", "{", "$", "this", "->", "openFile", "(", ")", ";", "$", "saved_pointer", "=", "$", "this", "->", "getFilePointer", "(", ")", ";", "$", "this", "->", "rewindFile", "(", ")", "->", "seekFileToEnd", "(", ")",...
Find whether file is empty @return bool @throws AtomicFileException
[ "Find", "whether", "file", "is", "empty" ]
9ca88297bdbdeb3bcbecdcbe884e4f412bb2cfe8
https://github.com/PHPComponent/AtomicFile/blob/9ca88297bdbdeb3bcbecdcbe884e4f412bb2cfe8/src/AtomicFileHandler.php#L142-L151
240,737
PHPComponent/AtomicFile
src/AtomicFileHandler.php
AtomicFileHandler.checkFile
protected function checkFile($writable = true) { if(!$this->fileExists()) throw NonExistentFileException::createForFileDoesNotExists($this->getFilePath()); if(!is_readable($this->file_path)) throw NotReadableFileException::createForNotReadable($this->getFilePath()); if($writable) { ...
php
protected function checkFile($writable = true) { if(!$this->fileExists()) throw NonExistentFileException::createForFileDoesNotExists($this->getFilePath()); if(!is_readable($this->file_path)) throw NotReadableFileException::createForNotReadable($this->getFilePath()); if($writable) { ...
[ "protected", "function", "checkFile", "(", "$", "writable", "=", "true", ")", "{", "if", "(", "!", "$", "this", "->", "fileExists", "(", ")", ")", "throw", "NonExistentFileException", "::", "createForFileDoesNotExists", "(", "$", "this", "->", "getFilePath", ...
Checks the file whether exists and is readable or writable @param bool $writable @throws AtomicFileException
[ "Checks", "the", "file", "whether", "exists", "and", "is", "readable", "or", "writable" ]
9ca88297bdbdeb3bcbecdcbe884e4f412bb2cfe8
https://github.com/PHPComponent/AtomicFile/blob/9ca88297bdbdeb3bcbecdcbe884e4f412bb2cfe8/src/AtomicFileHandler.php#L213-L221
240,738
PHPComponent/AtomicFile
src/AtomicFileHandler.php
AtomicFileHandler.fileExists
protected function fileExists() { $this->clearStatCache(true); return (file_exists($this->file_path) && is_file($this->file_path)); }
php
protected function fileExists() { $this->clearStatCache(true); return (file_exists($this->file_path) && is_file($this->file_path)); }
[ "protected", "function", "fileExists", "(", ")", "{", "$", "this", "->", "clearStatCache", "(", "true", ")", ";", "return", "(", "file_exists", "(", "$", "this", "->", "file_path", ")", "&&", "is_file", "(", "$", "this", "->", "file_path", ")", ")", ";...
Checks whether file exists @return bool
[ "Checks", "whether", "file", "exists" ]
9ca88297bdbdeb3bcbecdcbe884e4f412bb2cfe8
https://github.com/PHPComponent/AtomicFile/blob/9ca88297bdbdeb3bcbecdcbe884e4f412bb2cfe8/src/AtomicFileHandler.php#L227-L231
240,739
ojhaujjwal/UserRbac
src/Factory/IdentityRoleProviderFactory.php
IdentityRoleProviderFactory.createService
public function createService(ServiceLocatorInterface $serviceLocator) { $identityRoleProvider = new IdentityRoleProvider( $serviceLocator->get('UserRbac\UserRoleLinkerMapper'), $serviceLocator->get('UserRbac\ModuleOptions') ); if ($serviceLocator->get('zfcuser_auth_s...
php
public function createService(ServiceLocatorInterface $serviceLocator) { $identityRoleProvider = new IdentityRoleProvider( $serviceLocator->get('UserRbac\UserRoleLinkerMapper'), $serviceLocator->get('UserRbac\ModuleOptions') ); if ($serviceLocator->get('zfcuser_auth_s...
[ "public", "function", "createService", "(", "ServiceLocatorInterface", "$", "serviceLocator", ")", "{", "$", "identityRoleProvider", "=", "new", "IdentityRoleProvider", "(", "$", "serviceLocator", "->", "get", "(", "'UserRbac\\UserRoleLinkerMapper'", ")", ",", "$", "s...
Gets identity role provider @param ServiceLocatorInterface $serviceLocator @return IdentityRoleProvider
[ "Gets", "identity", "role", "provider" ]
ebe1cdbcbc9956af5a3a90d9c4c0fc7c8cd4c5fe
https://github.com/ojhaujjwal/UserRbac/blob/ebe1cdbcbc9956af5a3a90d9c4c0fc7c8cd4c5fe/src/Factory/IdentityRoleProviderFactory.php#L18-L31
240,740
monolyth-php/formulaic
src/Radio/Group.php
Group.setValue
public function setValue($value) { foreach ((array)$this as $element) { if ($value == $element->getElement()->getValue()) { $element->getElement()->check(); } else { $element->getElement()->check(false); } } }
php
public function setValue($value) { foreach ((array)$this as $element) { if ($value == $element->getElement()->getValue()) { $element->getElement()->check(); } else { $element->getElement()->check(false); } } }
[ "public", "function", "setValue", "(", "$", "value", ")", "{", "foreach", "(", "(", "array", ")", "$", "this", "as", "$", "element", ")", "{", "if", "(", "$", "value", "==", "$", "element", "->", "getElement", "(", ")", "->", "getValue", "(", ")", ...
Sets the element where the value matches to `checked`. @param mixed $value
[ "Sets", "the", "element", "where", "the", "value", "matches", "to", "checked", "." ]
4bf7853a0c29cc17957f1b26c79f633867742c14
https://github.com/monolyth-php/formulaic/blob/4bf7853a0c29cc17957f1b26c79f633867742c14/src/Radio/Group.php#L90-L99
240,741
monolyth-php/formulaic
src/Radio/Group.php
Group.getValue
public function getValue() : ArrayObject { foreach ((array)$this as $element) { if ($element->getElement() instanceof Radio && $element->getElement()->checked() ) { return new class([$element->getElement()->getValue()]) extends ArrayObject { ...
php
public function getValue() : ArrayObject { foreach ((array)$this as $element) { if ($element->getElement() instanceof Radio && $element->getElement()->checked() ) { return new class([$element->getElement()->getValue()]) extends ArrayObject { ...
[ "public", "function", "getValue", "(", ")", ":", "ArrayObject", "{", "foreach", "(", "(", "array", ")", "$", "this", "as", "$", "element", ")", "{", "if", "(", "$", "element", "->", "getElement", "(", ")", "instanceof", "Radio", "&&", "$", "element", ...
Gets the checked value in the group. @return array Array with a single entry (for compatibility with Element\Group, but obviously radio groups can only ever have one entry checked at a time).
[ "Gets", "the", "checked", "value", "in", "the", "group", "." ]
4bf7853a0c29cc17957f1b26c79f633867742c14
https://github.com/monolyth-php/formulaic/blob/4bf7853a0c29cc17957f1b26c79f633867742c14/src/Radio/Group.php#L108-L128
240,742
monolyth-php/formulaic
src/Radio/Group.php
Group.isRequired
public function isRequired() : Group { foreach ((array)$this as $el) { if (!is_object($el)) { continue; } $el->getElement()->attribute('required', 1); } return $this->addTest('required', function ($value) { foreach ($value as $o...
php
public function isRequired() : Group { foreach ((array)$this as $el) { if (!is_object($el)) { continue; } $el->getElement()->attribute('required', 1); } return $this->addTest('required', function ($value) { foreach ($value as $o...
[ "public", "function", "isRequired", "(", ")", ":", "Group", "{", "foreach", "(", "(", "array", ")", "$", "this", "as", "$", "el", ")", "{", "if", "(", "!", "is_object", "(", "$", "el", ")", ")", "{", "continue", ";", "}", "$", "el", "->", "getE...
Marks the group as required. @return self
[ "Marks", "the", "group", "as", "required", "." ]
4bf7853a0c29cc17957f1b26c79f633867742c14
https://github.com/monolyth-php/formulaic/blob/4bf7853a0c29cc17957f1b26c79f633867742c14/src/Radio/Group.php#L135-L153
240,743
extendsframework/extends-authorization
src/Permission/Permission.php
Permission.getSections
protected function getSections(): array { $sections = explode($this->getDivider(), $this->getNotation()); foreach ($sections as $index => $section) { $sections[$index] = explode($this->getSeparator(), $section); } return $sections; }
php
protected function getSections(): array { $sections = explode($this->getDivider(), $this->getNotation()); foreach ($sections as $index => $section) { $sections[$index] = explode($this->getSeparator(), $section); } return $sections; }
[ "protected", "function", "getSections", "(", ")", ":", "array", "{", "$", "sections", "=", "explode", "(", "$", "this", "->", "getDivider", "(", ")", ",", "$", "this", "->", "getNotation", "(", ")", ")", ";", "foreach", "(", "$", "sections", "as", "$...
Get exploded notation string. @return array
[ "Get", "exploded", "notation", "string", "." ]
f808ccdbfde07482fb77505a2eb7f7a8854ec828
https://github.com/extendsframework/extends-authorization/blob/f808ccdbfde07482fb77505a2eb7f7a8854ec828/src/Permission/Permission.php#L98-L106
240,744
tenside/core
src/Composer/Search/AbstractSearch.php
AbstractSearch.normalizeResultSet
protected function normalizeResultSet(array $resultSet) { $normalized = []; foreach ($resultSet as $result) { if (($normalizedResult = $this->normalizeResult($result)) === null) { continue; } $normalized[$normalizedResult] = $normalizedResult; ...
php
protected function normalizeResultSet(array $resultSet) { $normalized = []; foreach ($resultSet as $result) { if (($normalizedResult = $this->normalizeResult($result)) === null) { continue; } $normalized[$normalizedResult] = $normalizedResult; ...
[ "protected", "function", "normalizeResultSet", "(", "array", "$", "resultSet", ")", "{", "$", "normalized", "=", "[", "]", ";", "foreach", "(", "$", "resultSet", "as", "$", "result", ")", "{", "if", "(", "(", "$", "normalizedResult", "=", "$", "this", ...
Normalize a result set. @param array $resultSet The result set. @return string[]
[ "Normalize", "a", "result", "set", "." ]
56422fa8cdecf03cb431bb6654c2942ade39bf7b
https://github.com/tenside/core/blob/56422fa8cdecf03cb431bb6654c2942ade39bf7b/src/Composer/Search/AbstractSearch.php#L73-L86
240,745
cube-group/myaf-utils
src/PageUtil.php
PageUtil.create
public static function create($totalPage, $pageSize = 10, $page = 1, $gets = []) { $p = new PageUtil(); if ($pageSize < 1) { $pageSize = 1; } $total = ceil($totalPage / $pageSize); if ($page < 1) { $page = 1; } else if ($page > $total) { ...
php
public static function create($totalPage, $pageSize = 10, $page = 1, $gets = []) { $p = new PageUtil(); if ($pageSize < 1) { $pageSize = 1; } $total = ceil($totalPage / $pageSize); if ($page < 1) { $page = 1; } else if ($page > $total) { ...
[ "public", "static", "function", "create", "(", "$", "totalPage", ",", "$", "pageSize", "=", "10", ",", "$", "page", "=", "1", ",", "$", "gets", "=", "[", "]", ")", "{", "$", "p", "=", "new", "PageUtil", "(", ")", ";", "if", "(", "$", "pageSize"...
Page constructor. @param $totalPage int 总条数 @param int $pageSize 每页显示条数 @param int $page 当前页码 @param array $gets url携带get参数数组 @return self
[ "Page", "constructor", "." ]
febc3e1936ebdf763cf5478647e5ba22b3fd2812
https://github.com/cube-group/myaf-utils/blob/febc3e1936ebdf763cf5478647e5ba22b3fd2812/src/PageUtil.php#L42-L62
240,746
phpzm/kernel
src/Kernel/Container.php
Container.make
public function make(string $alias) { if (array_key_exists($alias, $this->bindings)) { $classOrObject = $this->bindings[$alias]; if (is_object($classOrObject)) { return $classOrObject; } return $this->makeInstance($classOrObject); } ...
php
public function make(string $alias) { if (array_key_exists($alias, $this->bindings)) { $classOrObject = $this->bindings[$alias]; if (is_object($classOrObject)) { return $classOrObject; } return $this->makeInstance($classOrObject); } ...
[ "public", "function", "make", "(", "string", "$", "alias", ")", "{", "if", "(", "array_key_exists", "(", "$", "alias", ",", "$", "this", "->", "bindings", ")", ")", "{", "$", "classOrObject", "=", "$", "this", "->", "bindings", "[", "$", "alias", "]"...
Resolves and created a new instance of a desired class. @param string $alias @return mixed @throws SimplesRunTimeError
[ "Resolves", "and", "created", "a", "new", "instance", "of", "a", "desired", "class", "." ]
e75da67a7815ddca56468dff75e50b614f823fad
https://github.com/phpzm/kernel/blob/e75da67a7815ddca56468dff75e50b614f823fad/src/Kernel/Container.php#L124-L140
240,747
phpzm/kernel
src/Kernel/Container.php
Container.makeInstance
public function makeInstance($className) { // class reflection $reflection = new ReflectionClass($className); // get the class constructor $constructor = $reflection->getConstructor(); // if there is no constructor, just create and // return a new instance if...
php
public function makeInstance($className) { // class reflection $reflection = new ReflectionClass($className); // get the class constructor $constructor = $reflection->getConstructor(); // if there is no constructor, just create and // return a new instance if...
[ "public", "function", "makeInstance", "(", "$", "className", ")", "{", "// class reflection", "$", "reflection", "=", "new", "ReflectionClass", "(", "$", "className", ")", ";", "// get the class constructor", "$", "constructor", "=", "$", "reflection", "->", "getC...
Created a instance of a desired class. @param $className @return mixed @throws SimplesRunTimeError
[ "Created", "a", "instance", "of", "a", "desired", "class", "." ]
e75da67a7815ddca56468dff75e50b614f823fad
https://github.com/phpzm/kernel/blob/e75da67a7815ddca56468dff75e50b614f823fad/src/Kernel/Container.php#L149-L165
240,748
phpzm/kernel
src/Kernel/Container.php
Container.exists
public function exists($instance, string $method) { $reflection = new ReflectionClass(get_class($instance)); return $reflection->hasMethod($method); }
php
public function exists($instance, string $method) { $reflection = new ReflectionClass(get_class($instance)); return $reflection->hasMethod($method); }
[ "public", "function", "exists", "(", "$", "instance", ",", "string", "$", "method", ")", "{", "$", "reflection", "=", "new", "ReflectionClass", "(", "get_class", "(", "$", "instance", ")", ")", ";", "return", "$", "reflection", "->", "hasMethod", "(", "$...
Checks whether a specific method is defined in a class @param mixed $instance @param string $method @return bool
[ "Checks", "whether", "a", "specific", "method", "is", "defined", "in", "a", "class" ]
e75da67a7815ddca56468dff75e50b614f823fad
https://github.com/phpzm/kernel/blob/e75da67a7815ddca56468dff75e50b614f823fad/src/Kernel/Container.php#L174-L179
240,749
phpzm/kernel
src/Kernel/Container.php
Container.invoke
public function invoke($instance, string $method, array $data) { // get the parameters $parameters = $this->resolveMethodParameters($instance, $method, $data, true); // get the reflection of method $reflection = new ReflectionMethod(get_class($instance), $method); // allow ...
php
public function invoke($instance, string $method, array $data) { // get the parameters $parameters = $this->resolveMethodParameters($instance, $method, $data, true); // get the reflection of method $reflection = new ReflectionMethod(get_class($instance), $method); // allow ...
[ "public", "function", "invoke", "(", "$", "instance", ",", "string", "$", "method", ",", "array", "$", "data", ")", "{", "// get the parameters", "$", "parameters", "=", "$", "this", "->", "resolveMethodParameters", "(", "$", "instance", ",", "$", "method", ...
Invoke a method of an instance of a class @param mixed $instance @param string $method @param array $data @return mixed @throws SimplesRunTimeError
[ "Invoke", "a", "method", "of", "an", "instance", "of", "a", "class" ]
e75da67a7815ddca56468dff75e50b614f823fad
https://github.com/phpzm/kernel/blob/e75da67a7815ddca56468dff75e50b614f823fad/src/Kernel/Container.php#L190-L203
240,750
phpzm/kernel
src/Kernel/Container.php
Container.resolveMethodParameters
public function resolveMethodParameters($instance, $method, $parameters, $labels = false) { // method reflection $reflectionMethod = new ReflectionMethod($instance, $method); // resolved array of parameters return $this->resolveParameters($reflectionMethod->getParameters(), $paramet...
php
public function resolveMethodParameters($instance, $method, $parameters, $labels = false) { // method reflection $reflectionMethod = new ReflectionMethod($instance, $method); // resolved array of parameters return $this->resolveParameters($reflectionMethod->getParameters(), $paramet...
[ "public", "function", "resolveMethodParameters", "(", "$", "instance", ",", "$", "method", ",", "$", "parameters", ",", "$", "labels", "=", "false", ")", "{", "// method reflection", "$", "reflectionMethod", "=", "new", "ReflectionMethod", "(", "$", "instance", ...
Generate a list of values to be used like parameters to one method @param $instance @param $method @param $parameters @param bool $labels @return array @throws SimplesRunTimeError
[ "Generate", "a", "list", "of", "values", "to", "be", "used", "like", "parameters", "to", "one", "method" ]
e75da67a7815ddca56468dff75e50b614f823fad
https://github.com/phpzm/kernel/blob/e75da67a7815ddca56468dff75e50b614f823fad/src/Kernel/Container.php#L215-L222
240,751
phpzm/kernel
src/Kernel/Container.php
Container.resolveFunctionParameters
public function resolveFunctionParameters($callable, $parameters, $labels = false) { // method reflection $reflectionFunction = new ReflectionFunction($callable); // resolved array of parameters return $this->resolveParameters($reflectionFunction->getParameters(), $parameters, $labe...
php
public function resolveFunctionParameters($callable, $parameters, $labels = false) { // method reflection $reflectionFunction = new ReflectionFunction($callable); // resolved array of parameters return $this->resolveParameters($reflectionFunction->getParameters(), $parameters, $labe...
[ "public", "function", "resolveFunctionParameters", "(", "$", "callable", ",", "$", "parameters", ",", "$", "labels", "=", "false", ")", "{", "// method reflection", "$", "reflectionFunction", "=", "new", "ReflectionFunction", "(", "$", "callable", ")", ";", "// ...
Generate a list of values to be used like parameters to one function @param $callable @param $parameters @param bool $labels @return array @throws SimplesRunTimeError
[ "Generate", "a", "list", "of", "values", "to", "be", "used", "like", "parameters", "to", "one", "function" ]
e75da67a7815ddca56468dff75e50b614f823fad
https://github.com/phpzm/kernel/blob/e75da67a7815ddca56468dff75e50b614f823fad/src/Kernel/Container.php#L233-L240
240,752
phpzm/kernel
src/Kernel/Container.php
Container.resolveParameters
private function resolveParameters($parameters, $data, $labels = false) { $resolved = []; /** @var ReflectionParameter $reflectionParameter */ foreach ($parameters as $reflectionParameter) { /** @noinspection PhpAssignmentInConditionInspection */ $parameter = $this->p...
php
private function resolveParameters($parameters, $data, $labels = false) { $resolved = []; /** @var ReflectionParameter $reflectionParameter */ foreach ($parameters as $reflectionParameter) { /** @noinspection PhpAssignmentInConditionInspection */ $parameter = $this->p...
[ "private", "function", "resolveParameters", "(", "$", "parameters", ",", "$", "data", ",", "$", "labels", "=", "false", ")", "{", "$", "resolved", "=", "[", "]", ";", "/** @var ReflectionParameter $reflectionParameter */", "foreach", "(", "$", "parameters", "as"...
Generate a list of values to be used like parameters to one method or function @param $parameters @param $data @param bool $labels @return array @throws SimplesRunTimeError
[ "Generate", "a", "list", "of", "values", "to", "be", "used", "like", "parameters", "to", "one", "method", "or", "function" ]
e75da67a7815ddca56468dff75e50b614f823fad
https://github.com/phpzm/kernel/blob/e75da67a7815ddca56468dff75e50b614f823fad/src/Kernel/Container.php#L251-L270
240,753
phpzm/kernel
src/Kernel/Container.php
Container.parseParameter
private function parseParameter(ReflectionParameter $reflectionParameter, &$data, $labels) { // get the principal properties $name = $reflectionParameter->getName(); $value = null; if ($reflectionParameter->isOptional()) { $value = $reflectionParameter->getDefaultValue();...
php
private function parseParameter(ReflectionParameter $reflectionParameter, &$data, $labels) { // get the principal properties $name = $reflectionParameter->getName(); $value = null; if ($reflectionParameter->isOptional()) { $value = $reflectionParameter->getDefaultValue();...
[ "private", "function", "parseParameter", "(", "ReflectionParameter", "$", "reflectionParameter", ",", "&", "$", "data", ",", "$", "labels", ")", "{", "// get the principal properties", "$", "name", "=", "$", "reflectionParameter", "->", "getName", "(", ")", ";", ...
Configure the beste resource to each parameter of one method or function @param ReflectionParameter $reflectionParameter @param array $data @param bool $labels @return mixed
[ "Configure", "the", "beste", "resource", "to", "each", "parameter", "of", "one", "method", "or", "function" ]
e75da67a7815ddca56468dff75e50b614f823fad
https://github.com/phpzm/kernel/blob/e75da67a7815ddca56468dff75e50b614f823fad/src/Kernel/Container.php#L280-L305
240,754
phpzm/kernel
src/Kernel/Container.php
Container.extractClassName
private function extractClassName(ReflectionParameter $reflectionParameter) { if (isset($reflectionParameter->getClass()->name)) { return $reflectionParameter->getClass()->name; } return ''; }
php
private function extractClassName(ReflectionParameter $reflectionParameter) { if (isset($reflectionParameter->getClass()->name)) { return $reflectionParameter->getClass()->name; } return ''; }
[ "private", "function", "extractClassName", "(", "ReflectionParameter", "$", "reflectionParameter", ")", "{", "if", "(", "isset", "(", "$", "reflectionParameter", "->", "getClass", "(", ")", "->", "name", ")", ")", "{", "return", "$", "reflectionParameter", "->",...
Get the name of class related to a list of parameters @param ReflectionParameter $reflectionParameter @return string
[ "Get", "the", "name", "of", "class", "related", "to", "a", "list", "of", "parameters" ]
e75da67a7815ddca56468dff75e50b614f823fad
https://github.com/phpzm/kernel/blob/e75da67a7815ddca56468dff75e50b614f823fad/src/Kernel/Container.php#L313-L319
240,755
budkit/budkit-framework
src/Budkit/Datastore/Drivers/MySQLi/Statement.php
Statement.execute
public function execute() { $DB = $this->getDBO(); //Run the Query; $resultId = $DB->exec(); //\Platform\Debugger::log($resultId); $this->setResultId($resultId)->setConnectionId($DB->getResourceId())->setAffectedRows($this->getAffectedRows()); $DB->resetRun(); ...
php
public function execute() { $DB = $this->getDBO(); //Run the Query; $resultId = $DB->exec(); //\Platform\Debugger::log($resultId); $this->setResultId($resultId)->setConnectionId($DB->getResourceId())->setAffectedRows($this->getAffectedRows()); $DB->resetRun(); ...
[ "public", "function", "execute", "(", ")", "{", "$", "DB", "=", "$", "this", "->", "getDBO", "(", ")", ";", "//Run the Query;", "$", "resultId", "=", "$", "DB", "->", "exec", "(", ")", ";", "//\\Platform\\Debugger::log($resultId);", "$", "this", "->", "s...
Executes the prepared Statement @return
[ "Executes", "the", "prepared", "Statement" ]
0635061815fe07a8c63f9514b845d199b3c0d485
https://github.com/budkit/budkit-framework/blob/0635061815fe07a8c63f9514b845d199b3c0d485/src/Budkit/Datastore/Drivers/MySQLi/Statement.php#L41-L54
240,756
budkit/budkit-framework
src/Budkit/Datastore/Drivers/MySQLi/Statement.php
Statement.listColumns
public function listColumns() { $fieldNames = array(); $field = NULL; while ($field = mysqli_fetch_field($this->getResultId())) { $fieldNames[] = $field->name; } return $fieldNames; }
php
public function listColumns() { $fieldNames = array(); $field = NULL; while ($field = mysqli_fetch_field($this->getResultId())) { $fieldNames[] = $field->name; } return $fieldNames; }
[ "public", "function", "listColumns", "(", ")", "{", "$", "fieldNames", "=", "array", "(", ")", ";", "$", "field", "=", "NULL", ";", "while", "(", "$", "field", "=", "mysqli_fetch_field", "(", "$", "this", "->", "getResultId", "(", ")", ")", ")", "{",...
Lists all columns in a result row @return array
[ "Lists", "all", "columns", "in", "a", "result", "row" ]
0635061815fe07a8c63f9514b845d199b3c0d485
https://github.com/budkit/budkit-framework/blob/0635061815fe07a8c63f9514b845d199b3c0d485/src/Budkit/Datastore/Drivers/MySQLi/Statement.php#L92-L101
240,757
budkit/budkit-framework
src/Budkit/Datastore/Drivers/MySQLi/Statement.php
Statement.getColumnMeta
public function getColumnMeta($name = '') { $retval = array(); $field = NULL; while ($field = mysqli_fetch_field($this->getResultId())) { $f = new stdClass(); $f->name = $field->name; $f->type = $field->type; $f->default = $field->def; ...
php
public function getColumnMeta($name = '') { $retval = array(); $field = NULL; while ($field = mysqli_fetch_field($this->getResultId())) { $f = new stdClass(); $f->name = $field->name; $f->type = $field->type; $f->default = $field->def; ...
[ "public", "function", "getColumnMeta", "(", "$", "name", "=", "''", ")", "{", "$", "retval", "=", "array", "(", ")", ";", "$", "field", "=", "NULL", ";", "while", "(", "$", "field", "=", "mysqli_fetch_field", "(", "$", "this", "->", "getResultId", "(...
Returns metadata for a column or all columns in a result set @return stdClass
[ "Returns", "metadata", "for", "a", "column", "or", "all", "columns", "in", "a", "result", "set" ]
0635061815fe07a8c63f9514b845d199b3c0d485
https://github.com/budkit/budkit-framework/blob/0635061815fe07a8c63f9514b845d199b3c0d485/src/Budkit/Datastore/Drivers/MySQLi/Statement.php#L108-L125
240,758
budkit/budkit-framework
src/Budkit/Datastore/Drivers/MySQLi/Statement.php
Statement.freeResults
public function freeResults() { if (is_a($this->getResultId(), "mysqli_result")) { mysqli_free_result($this->getResultId()); $this->setResultId(FALSE); } }
php
public function freeResults() { if (is_a($this->getResultId(), "mysqli_result")) { mysqli_free_result($this->getResultId()); $this->setResultId(FALSE); } }
[ "public", "function", "freeResults", "(", ")", "{", "if", "(", "is_a", "(", "$", "this", "->", "getResultId", "(", ")", ",", "\"mysqli_result\"", ")", ")", "{", "mysqli_free_result", "(", "$", "this", "->", "getResultId", "(", ")", ")", ";", "$", "this...
Frees the result @return void
[ "Frees", "the", "result" ]
0635061815fe07a8c63f9514b845d199b3c0d485
https://github.com/budkit/budkit-framework/blob/0635061815fe07a8c63f9514b845d199b3c0d485/src/Budkit/Datastore/Drivers/MySQLi/Statement.php#L132-L138
240,759
jeromeklam/freefw
src/FreeFW/Core/ApiController.php
ApiController.createOne
public function createOne(\Psr\Http\Message\ServerRequestInterface $p_request) { $this->logger->debug('FreeFW.ApiController.createOne.start'); $apiParams = $p_request->getAttribute('api_params', false); // if ($apiParams->hasData()) { /** * @var \FreeFW\Core\...
php
public function createOne(\Psr\Http\Message\ServerRequestInterface $p_request) { $this->logger->debug('FreeFW.ApiController.createOne.start'); $apiParams = $p_request->getAttribute('api_params', false); // if ($apiParams->hasData()) { /** * @var \FreeFW\Core\...
[ "public", "function", "createOne", "(", "\\", "Psr", "\\", "Http", "\\", "Message", "\\", "ServerRequestInterface", "$", "p_request", ")", "{", "$", "this", "->", "logger", "->", "debug", "(", "'FreeFW.ApiController.createOne.start'", ")", ";", "$", "apiParams",...
Add new single element @param \Psr\Http\Message\ServerRequestInterface $p_request
[ "Add", "new", "single", "element" ]
16ecf24192375c920a070296f396b9d3fd994a1e
https://github.com/jeromeklam/freefw/blob/16ecf24192375c920a070296f396b9d3fd994a1e/src/FreeFW/Core/ApiController.php#L17-L37
240,760
jeromeklam/freefw
src/FreeFW/Core/ApiController.php
ApiController.removeOne
public function removeOne(\Psr\Http\Message\ServerRequestInterface $p_request) { $this->logger->debug('FreeFW.ApiController.removeOne.start'); $apiParams = $p_request->getAttribute('api_params', false); // if ($apiParams->hasData()) { /** * @var \FreeFW\Core\...
php
public function removeOne(\Psr\Http\Message\ServerRequestInterface $p_request) { $this->logger->debug('FreeFW.ApiController.removeOne.start'); $apiParams = $p_request->getAttribute('api_params', false); // if ($apiParams->hasData()) { /** * @var \FreeFW\Core\...
[ "public", "function", "removeOne", "(", "\\", "Psr", "\\", "Http", "\\", "Message", "\\", "ServerRequestInterface", "$", "p_request", ")", "{", "$", "this", "->", "logger", "->", "debug", "(", "'FreeFW.ApiController.removeOne.start'", ")", ";", "$", "apiParams",...
Remove single element @param \Psr\Http\Message\ServerRequestInterface $p_request
[ "Remove", "single", "element" ]
16ecf24192375c920a070296f396b9d3fd994a1e
https://github.com/jeromeklam/freefw/blob/16ecf24192375c920a070296f396b9d3fd994a1e/src/FreeFW/Core/ApiController.php#L69-L85
240,761
frankfoerster/cakephp-filter
src/Controller/Component/FilterComponent.php
FilterComponent.filter
public function filter(Query $query) { if (!empty($this->filterOptions['conditions'])) { $query->where($this->filterOptions['conditions']); } if (!empty($this->filterOptions['order'])) { $query->order($this->filterOptions['order']); } return $query; ...
php
public function filter(Query $query) { if (!empty($this->filterOptions['conditions'])) { $query->where($this->filterOptions['conditions']); } if (!empty($this->filterOptions['order'])) { $query->order($this->filterOptions['order']); } return $query; ...
[ "public", "function", "filter", "(", "Query", "$", "query", ")", "{", "if", "(", "!", "empty", "(", "$", "this", "->", "filterOptions", "[", "'conditions'", "]", ")", ")", "{", "$", "query", "->", "where", "(", "$", "this", "->", "filterOptions", "["...
Apply filter conditions and order options to the given query. @param Query $query @return Query
[ "Apply", "filter", "conditions", "and", "order", "options", "to", "the", "given", "query", "." ]
539ec2d5c01c9b00766a6db98b60f32832fa5dee
https://github.com/frankfoerster/cakephp-filter/blob/539ec2d5c01c9b00766a6db98b60f32832fa5dee/src/Controller/Component/FilterComponent.php#L243-L253
240,762
frankfoerster/cakephp-filter
src/Controller/Component/FilterComponent.php
FilterComponent.getBacklink
public static function getBacklink($url, ServerRequest $request) { if (!isset($url['plugin'])) { $url['plugin'] = $request->getParam('plugin'); } if (!isset($url['controller'])) { $url['controller'] = $request->getParam('controller'); } $path = join('...
php
public static function getBacklink($url, ServerRequest $request) { if (!isset($url['plugin'])) { $url['plugin'] = $request->getParam('plugin'); } if (!isset($url['controller'])) { $url['controller'] = $request->getParam('controller'); } $path = join('...
[ "public", "static", "function", "getBacklink", "(", "$", "url", ",", "ServerRequest", "$", "request", ")", "{", "if", "(", "!", "isset", "(", "$", "url", "[", "'plugin'", "]", ")", ")", "{", "$", "url", "[", "'plugin'", "]", "=", "$", "request", "-...
Try to retrieve a filtered backlink from the session. @param array $url @param ServerRequest $request @return array
[ "Try", "to", "retrieve", "a", "filtered", "backlink", "from", "the", "session", "." ]
539ec2d5c01c9b00766a6db98b60f32832fa5dee
https://github.com/frankfoerster/cakephp-filter/blob/539ec2d5c01c9b00766a6db98b60f32832fa5dee/src/Controller/Component/FilterComponent.php#L411-L440
240,763
frankfoerster/cakephp-filter
src/Controller/Component/FilterComponent.php
FilterComponent._initFilterOptions
protected function _initFilterOptions() { if (!$this->_filterEnabled && !$this->_sortEnabled) { return; } $options = [ 'conditions' => [], 'order' => [] ]; // check filter params if (!empty($this->request->getData())) { ...
php
protected function _initFilterOptions() { if (!$this->_filterEnabled && !$this->_sortEnabled) { return; } $options = [ 'conditions' => [], 'order' => [] ]; // check filter params if (!empty($this->request->getData())) { ...
[ "protected", "function", "_initFilterOptions", "(", ")", "{", "if", "(", "!", "$", "this", "->", "_filterEnabled", "&&", "!", "$", "this", "->", "_sortEnabled", ")", "{", "return", ";", "}", "$", "options", "=", "[", "'conditions'", "=>", "[", "]", ","...
Create the filter options that can be used for model find calls in the controller. @return void
[ "Create", "the", "filter", "options", "that", "can", "be", "used", "for", "model", "find", "calls", "in", "the", "controller", "." ]
539ec2d5c01c9b00766a6db98b60f32832fa5dee
https://github.com/frankfoerster/cakephp-filter/blob/539ec2d5c01c9b00766a6db98b60f32832fa5dee/src/Controller/Component/FilterComponent.php#L449-L494
240,764
frankfoerster/cakephp-filter
src/Controller/Component/FilterComponent.php
FilterComponent._isSortEnabled
protected function _isSortEnabled() { if (!isset($this->controller->sortFields)) { return false; } foreach ($this->controller->sortFields as $field) { if (isset($field['actions']) && is_array($field['actions']) && in_array($this->actio...
php
protected function _isSortEnabled() { if (!isset($this->controller->sortFields)) { return false; } foreach ($this->controller->sortFields as $field) { if (isset($field['actions']) && is_array($field['actions']) && in_array($this->actio...
[ "protected", "function", "_isSortEnabled", "(", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "controller", "->", "sortFields", ")", ")", "{", "return", "false", ";", "}", "foreach", "(", "$", "this", "->", "controller", "->", "sortFields", ...
Check if sorting for the current controller action is enabled. @return boolean
[ "Check", "if", "sorting", "for", "the", "current", "controller", "action", "is", "enabled", "." ]
539ec2d5c01c9b00766a6db98b60f32832fa5dee
https://github.com/frankfoerster/cakephp-filter/blob/539ec2d5c01c9b00766a6db98b60f32832fa5dee/src/Controller/Component/FilterComponent.php#L501-L517
240,765
frankfoerster/cakephp-filter
src/Controller/Component/FilterComponent.php
FilterComponent._isFilterEnabled
protected function _isFilterEnabled() { if (!isset($this->controller->filterFields)) { return false; } foreach ($this->controller->filterFields as $field) { if (isset($field['actions']) && is_array($field['actions']) && in_array($this-...
php
protected function _isFilterEnabled() { if (!isset($this->controller->filterFields)) { return false; } foreach ($this->controller->filterFields as $field) { if (isset($field['actions']) && is_array($field['actions']) && in_array($this-...
[ "protected", "function", "_isFilterEnabled", "(", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "controller", "->", "filterFields", ")", ")", "{", "return", "false", ";", "}", "foreach", "(", "$", "this", "->", "controller", "->", "filterFie...
Check if filtering for the current controller action is enabled. @return boolean
[ "Check", "if", "filtering", "for", "the", "current", "controller", "action", "is", "enabled", "." ]
539ec2d5c01c9b00766a6db98b60f32832fa5dee
https://github.com/frankfoerster/cakephp-filter/blob/539ec2d5c01c9b00766a6db98b60f32832fa5dee/src/Controller/Component/FilterComponent.php#L524-L540
240,766
frankfoerster/cakephp-filter
src/Controller/Component/FilterComponent.php
FilterComponent._isPaginationEnabled
protected function _isPaginationEnabled() { if (!isset($this->controller->limits) || !isset($this->controller->limits[$this->action]) || !isset($this->controller->limits[$this->action]['default']) || !isset($this->controller->limits[$this->action]['limits']) ) { ...
php
protected function _isPaginationEnabled() { if (!isset($this->controller->limits) || !isset($this->controller->limits[$this->action]) || !isset($this->controller->limits[$this->action]['default']) || !isset($this->controller->limits[$this->action]['limits']) ) { ...
[ "protected", "function", "_isPaginationEnabled", "(", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "controller", "->", "limits", ")", "||", "!", "isset", "(", "$", "this", "->", "controller", "->", "limits", "[", "$", "this", "->", "actio...
Check if pagination is enabled for the current controller action. @return boolean
[ "Check", "if", "pagination", "is", "enabled", "for", "the", "current", "controller", "action", "." ]
539ec2d5c01c9b00766a6db98b60f32832fa5dee
https://github.com/frankfoerster/cakephp-filter/blob/539ec2d5c01c9b00766a6db98b60f32832fa5dee/src/Controller/Component/FilterComponent.php#L547-L558
240,767
frankfoerster/cakephp-filter
src/Controller/Component/FilterComponent.php
FilterComponent._getSortFields
protected function _getSortFields() { $sortFields = []; foreach ($this->controller->sortFields as $field => $options) { if (isset($options['actions']) && is_array($options['actions']) && in_array($this->action, $options['actions']) ) { ...
php
protected function _getSortFields() { $sortFields = []; foreach ($this->controller->sortFields as $field => $options) { if (isset($options['actions']) && is_array($options['actions']) && in_array($this->action, $options['actions']) ) { ...
[ "protected", "function", "_getSortFields", "(", ")", "{", "$", "sortFields", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "controller", "->", "sortFields", "as", "$", "field", "=>", "$", "options", ")", "{", "if", "(", "isset", "(", "$", "o...
Get all available sort fields for the current controller action. @return array
[ "Get", "all", "available", "sort", "fields", "for", "the", "current", "controller", "action", "." ]
539ec2d5c01c9b00766a6db98b60f32832fa5dee
https://github.com/frankfoerster/cakephp-filter/blob/539ec2d5c01c9b00766a6db98b60f32832fa5dee/src/Controller/Component/FilterComponent.php#L565-L579
240,768
frankfoerster/cakephp-filter
src/Controller/Component/FilterComponent.php
FilterComponent._getFilterFields
protected function _getFilterFields() { $filterFields = []; foreach ($this->controller->filterFields as $field => $options) { if (isset($options['actions']) && is_array($options['actions']) && in_array($this->action, $options['actions']) ) { ...
php
protected function _getFilterFields() { $filterFields = []; foreach ($this->controller->filterFields as $field => $options) { if (isset($options['actions']) && is_array($options['actions']) && in_array($this->action, $options['actions']) ) { ...
[ "protected", "function", "_getFilterFields", "(", ")", "{", "$", "filterFields", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "controller", "->", "filterFields", "as", "$", "field", "=>", "$", "options", ")", "{", "if", "(", "isset", "(", "$"...
Get all available filter fields for the current controller action. @return array
[ "Get", "all", "available", "filter", "fields", "for", "the", "current", "controller", "action", "." ]
539ec2d5c01c9b00766a6db98b60f32832fa5dee
https://github.com/frankfoerster/cakephp-filter/blob/539ec2d5c01c9b00766a6db98b60f32832fa5dee/src/Controller/Component/FilterComponent.php#L586-L600
240,769
frankfoerster/cakephp-filter
src/Controller/Component/FilterComponent.php
FilterComponent._createSortFieldOption
protected function _createSortFieldOption($field, $dir, $options) { $sortField = $this->sortFields[$field]; if (isset($sortField['custom'])) { if (!is_array($sortField['custom'])) { $sortField['custom'] = [$sortField['custom']]; } foreach ($sortFie...
php
protected function _createSortFieldOption($field, $dir, $options) { $sortField = $this->sortFields[$field]; if (isset($sortField['custom'])) { if (!is_array($sortField['custom'])) { $sortField['custom'] = [$sortField['custom']]; } foreach ($sortFie...
[ "protected", "function", "_createSortFieldOption", "(", "$", "field", ",", "$", "dir", ",", "$", "options", ")", "{", "$", "sortField", "=", "$", "this", "->", "sortFields", "[", "$", "field", "]", ";", "if", "(", "isset", "(", "$", "sortField", "[", ...
Create the 'order' find condition part for a sorted field. @param string $field The field name to sort @param string $dir The sort direction (asc, desc) @param array $options The current find options where the sorting should be added. @return mixed
[ "Create", "the", "order", "find", "condition", "part", "for", "a", "sorted", "field", "." ]
539ec2d5c01c9b00766a6db98b60f32832fa5dee
https://github.com/frankfoerster/cakephp-filter/blob/539ec2d5c01c9b00766a6db98b60f32832fa5dee/src/Controller/Component/FilterComponent.php#L610-L625
240,770
frankfoerster/cakephp-filter
src/Controller/Component/FilterComponent.php
FilterComponent._extractPassParams
protected function _extractPassParams() { if (!empty($this->controller->filterPassParams[$this->action])) { foreach ($this->controller->filterPassParams[$this->action] as $key) { if (!empty($this->request->getParam($key))) { $this->_passParams[$key] = $this->r...
php
protected function _extractPassParams() { if (!empty($this->controller->filterPassParams[$this->action])) { foreach ($this->controller->filterPassParams[$this->action] as $key) { if (!empty($this->request->getParam($key))) { $this->_passParams[$key] = $this->r...
[ "protected", "function", "_extractPassParams", "(", ")", "{", "if", "(", "!", "empty", "(", "$", "this", "->", "controller", "->", "filterPassParams", "[", "$", "this", "->", "action", "]", ")", ")", "{", "foreach", "(", "$", "this", "->", "controller", ...
Puts the values in the passParams array
[ "Puts", "the", "values", "in", "the", "passParams", "array" ]
539ec2d5c01c9b00766a6db98b60f32832fa5dee
https://github.com/frankfoerster/cakephp-filter/blob/539ec2d5c01c9b00766a6db98b60f32832fa5dee/src/Controller/Component/FilterComponent.php#L703-L712
240,771
frankfoerster/cakephp-filter
src/Controller/Component/FilterComponent.php
FilterComponent._getFilterData
protected function _getFilterData() { $rawFilterData = $this->request->getData(); $filterData = []; foreach ($this->filterFields as $filterField => $options) { if (isset($rawFilterData[$filterField]) && $rawFilterData[$filterField] !== '') { $filterData[$filterFie...
php
protected function _getFilterData() { $rawFilterData = $this->request->getData(); $filterData = []; foreach ($this->filterFields as $filterField => $options) { if (isset($rawFilterData[$filterField]) && $rawFilterData[$filterField] !== '') { $filterData[$filterFie...
[ "protected", "function", "_getFilterData", "(", ")", "{", "$", "rawFilterData", "=", "$", "this", "->", "request", "->", "getData", "(", ")", ";", "$", "filterData", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "filterFields", "as", "$", "fil...
Get the filter data. @return array
[ "Get", "the", "filter", "data", "." ]
539ec2d5c01c9b00766a6db98b60f32832fa5dee
https://github.com/frankfoerster/cakephp-filter/blob/539ec2d5c01c9b00766a6db98b60f32832fa5dee/src/Controller/Component/FilterComponent.php#L719-L730
240,772
frankfoerster/cakephp-filter
src/Controller/Component/FilterComponent.php
FilterComponent._setupSort
protected function _setupSort() { if (!($this->_sortEnabled = $this->_isSortEnabled())) { return; } $this->sortFields = $this->_getSortFields(); foreach ($this->sortFields as $field => $options) { if (!isset($options['default'])) { continue; ...
php
protected function _setupSort() { if (!($this->_sortEnabled = $this->_isSortEnabled())) { return; } $this->sortFields = $this->_getSortFields(); foreach ($this->sortFields as $field => $options) { if (!isset($options['default'])) { continue; ...
[ "protected", "function", "_setupSort", "(", ")", "{", "if", "(", "!", "(", "$", "this", "->", "_sortEnabled", "=", "$", "this", "->", "_isSortEnabled", "(", ")", ")", ")", "{", "return", ";", "}", "$", "this", "->", "sortFields", "=", "$", "this", ...
Setup default sort options. @return void
[ "Setup", "default", "sort", "options", "." ]
539ec2d5c01c9b00766a6db98b60f32832fa5dee
https://github.com/frankfoerster/cakephp-filter/blob/539ec2d5c01c9b00766a6db98b60f32832fa5dee/src/Controller/Component/FilterComponent.php#L737-L757
240,773
frankfoerster/cakephp-filter
src/Controller/Component/FilterComponent.php
FilterComponent._setupFilters
protected function _setupFilters() { if (!($this->_filterEnabled = $this->_isFilterEnabled())) { return; } $this->filterFields = $this->_getFilterFields(); $sluggedFilter = $this->request->getParam('sluggedFilter', ''); if ($sluggedFilter === '') { r...
php
protected function _setupFilters() { if (!($this->_filterEnabled = $this->_isFilterEnabled())) { return; } $this->filterFields = $this->_getFilterFields(); $sluggedFilter = $this->request->getParam('sluggedFilter', ''); if ($sluggedFilter === '') { r...
[ "protected", "function", "_setupFilters", "(", ")", "{", "if", "(", "!", "(", "$", "this", "->", "_filterEnabled", "=", "$", "this", "->", "_isFilterEnabled", "(", ")", ")", ")", "{", "return", ";", "}", "$", "this", "->", "filterFields", "=", "$", "...
Setup the filter field options. If the current request is provided with the sluggedFilter param, then the corresponding filter data will be fetched and set on the request data. @return void
[ "Setup", "the", "filter", "field", "options", "." ]
539ec2d5c01c9b00766a6db98b60f32832fa5dee
https://github.com/frankfoerster/cakephp-filter/blob/539ec2d5c01c9b00766a6db98b60f32832fa5dee/src/Controller/Component/FilterComponent.php#L767-L791
240,774
frankfoerster/cakephp-filter
src/Controller/Component/FilterComponent.php
FilterComponent._setupPagination
protected function _setupPagination() { if (!($this->_paginationEnabled = $this->_isPaginationEnabled())) { return; } $this->defaultLimit = $this->controller->limits[$this->action]['default']; $this->limits = $this->controller->limits[$this->action]['limits']; }
php
protected function _setupPagination() { if (!($this->_paginationEnabled = $this->_isPaginationEnabled())) { return; } $this->defaultLimit = $this->controller->limits[$this->action]['default']; $this->limits = $this->controller->limits[$this->action]['limits']; }
[ "protected", "function", "_setupPagination", "(", ")", "{", "if", "(", "!", "(", "$", "this", "->", "_paginationEnabled", "=", "$", "this", "->", "_isPaginationEnabled", "(", ")", ")", ")", "{", "return", ";", "}", "$", "this", "->", "defaultLimit", "=",...
Setup the default pagination params. @return void
[ "Setup", "the", "default", "pagination", "params", "." ]
539ec2d5c01c9b00766a6db98b60f32832fa5dee
https://github.com/frankfoerster/cakephp-filter/blob/539ec2d5c01c9b00766a6db98b60f32832fa5dee/src/Controller/Component/FilterComponent.php#L798-L806
240,775
frankfoerster/cakephp-filter
src/Controller/Component/FilterComponent.php
FilterComponent._isFilterRequest
protected function _isFilterRequest() { return ( $this->controller !== null && $this->request !== null && $this->action !== null && $this->_filterEnabled ); }
php
protected function _isFilterRequest() { return ( $this->controller !== null && $this->request !== null && $this->action !== null && $this->_filterEnabled ); }
[ "protected", "function", "_isFilterRequest", "(", ")", "{", "return", "(", "$", "this", "->", "controller", "!==", "null", "&&", "$", "this", "->", "request", "!==", "null", "&&", "$", "this", "->", "action", "!==", "null", "&&", "$", "this", "->", "_f...
Check if the current request is a filter request. @return bool
[ "Check", "if", "the", "current", "request", "is", "a", "filter", "request", "." ]
539ec2d5c01c9b00766a6db98b60f32832fa5dee
https://github.com/frankfoerster/cakephp-filter/blob/539ec2d5c01c9b00766a6db98b60f32832fa5dee/src/Controller/Component/FilterComponent.php#L813-L821
240,776
frankfoerster/cakephp-filter
src/Controller/Component/FilterComponent.php
FilterComponent._createFilterSlug
protected function _createFilterSlug(array $filterData) { /** @var Filter $existingFilter */ $existingFilter = $this->Filters->find('slugForFilterData', [ 'request' => $this->request, 'filterData' => $filterData ])->first(); if ($existingFilter) { ...
php
protected function _createFilterSlug(array $filterData) { /** @var Filter $existingFilter */ $existingFilter = $this->Filters->find('slugForFilterData', [ 'request' => $this->request, 'filterData' => $filterData ])->first(); if ($existingFilter) { ...
[ "protected", "function", "_createFilterSlug", "(", "array", "$", "filterData", ")", "{", "/** @var Filter $existingFilter */", "$", "existingFilter", "=", "$", "this", "->", "Filters", "->", "find", "(", "'slugForFilterData'", ",", "[", "'request'", "=>", "$", "th...
Create a filter slug for the given filter data. @param array $filterData @return string The slug.
[ "Create", "a", "filter", "slug", "for", "the", "given", "filter", "data", "." ]
539ec2d5c01c9b00766a6db98b60f32832fa5dee
https://github.com/frankfoerster/cakephp-filter/blob/539ec2d5c01c9b00766a6db98b60f32832fa5dee/src/Controller/Component/FilterComponent.php#L829-L842
240,777
frankfoerster/cakephp-filter
src/Controller/Component/FilterComponent.php
FilterComponent._applyFilterData
protected function _applyFilterData($url) { $filterData = $this->_getFilterData(); if (empty($filterData)) { return $url; } return $url + [ 'sluggedFilter' => $this->_createFilterSlug($filterData), '?' => $this->request->getQuery() ]; ...
php
protected function _applyFilterData($url) { $filterData = $this->_getFilterData(); if (empty($filterData)) { return $url; } return $url + [ 'sluggedFilter' => $this->_createFilterSlug($filterData), '?' => $this->request->getQuery() ]; ...
[ "protected", "function", "_applyFilterData", "(", "$", "url", ")", "{", "$", "filterData", "=", "$", "this", "->", "_getFilterData", "(", ")", ";", "if", "(", "empty", "(", "$", "filterData", ")", ")", "{", "return", "$", "url", ";", "}", "return", "...
Apply filter data to the given url. @param $url @return array modified url array
[ "Apply", "filter", "data", "to", "the", "given", "url", "." ]
539ec2d5c01c9b00766a6db98b60f32832fa5dee
https://github.com/frankfoerster/cakephp-filter/blob/539ec2d5c01c9b00766a6db98b60f32832fa5dee/src/Controller/Component/FilterComponent.php#L850-L861
240,778
frankfoerster/cakephp-filter
src/Controller/Component/FilterComponent.php
FilterComponent._applyPassedParams
protected function _applyPassedParams($url) { if (empty($this->_passParams)) { return $url; } return array_merge($url, $this->_passParams); }
php
protected function _applyPassedParams($url) { if (empty($this->_passParams)) { return $url; } return array_merge($url, $this->_passParams); }
[ "protected", "function", "_applyPassedParams", "(", "$", "url", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "_passParams", ")", ")", "{", "return", "$", "url", ";", "}", "return", "array_merge", "(", "$", "url", ",", "$", "this", "->", "_pa...
Apply configured pass params to the url array. @param array $url @return array modified url array
[ "Apply", "configured", "pass", "params", "to", "the", "url", "array", "." ]
539ec2d5c01c9b00766a6db98b60f32832fa5dee
https://github.com/frankfoerster/cakephp-filter/blob/539ec2d5c01c9b00766a6db98b60f32832fa5dee/src/Controller/Component/FilterComponent.php#L869-L876
240,779
frankfoerster/cakephp-filter
src/Controller/Component/FilterComponent.php
FilterComponent._applySort
protected function _applySort($url) { if (!$this->_sortEnabled) { return $url; } if (!empty($this->request->getQuery('s'))) { $url['?']['s'] = $this->request->getQuery('s'); } if (!empty($this->request->getQuery('d'))) { $url['?']['d'] = ...
php
protected function _applySort($url) { if (!$this->_sortEnabled) { return $url; } if (!empty($this->request->getQuery('s'))) { $url['?']['s'] = $this->request->getQuery('s'); } if (!empty($this->request->getQuery('d'))) { $url['?']['d'] = ...
[ "protected", "function", "_applySort", "(", "$", "url", ")", "{", "if", "(", "!", "$", "this", "->", "_sortEnabled", ")", "{", "return", "$", "url", ";", "}", "if", "(", "!", "empty", "(", "$", "this", "->", "request", "->", "getQuery", "(", "'s'",...
Pass sort options through to the filtered url. @param array $url @return array modified url array
[ "Pass", "sort", "options", "through", "to", "the", "filtered", "url", "." ]
539ec2d5c01c9b00766a6db98b60f32832fa5dee
https://github.com/frankfoerster/cakephp-filter/blob/539ec2d5c01c9b00766a6db98b60f32832fa5dee/src/Controller/Component/FilterComponent.php#L884-L899
240,780
canis-io/yii2-canis-lib
lib/web/Response.php
Response.getIsInstructable
public function getIsInstructable() { $isAjax = (isset(Yii::$app->request->isAjax) && Yii::$app->request->isAjax); if (isset($_GET['_instruct'])) { if (!empty($_GET['_instruct'])) { $this->forceInstructions = true; $this->disableInstructions = false; ...
php
public function getIsInstructable() { $isAjax = (isset(Yii::$app->request->isAjax) && Yii::$app->request->isAjax); if (isset($_GET['_instruct'])) { if (!empty($_GET['_instruct'])) { $this->forceInstructions = true; $this->disableInstructions = false; ...
[ "public", "function", "getIsInstructable", "(", ")", "{", "$", "isAjax", "=", "(", "isset", "(", "Yii", "::", "$", "app", "->", "request", "->", "isAjax", ")", "&&", "Yii", "::", "$", "app", "->", "request", "->", "isAjax", ")", ";", "if", "(", "is...
Get is instructable. @return [[@doctodo return_type:getIsInstructable]] [[@doctodo return_description:getIsInstructable]]
[ "Get", "is", "instructable", "." ]
97d533521f65b084dc805c5f312c364b469142d2
https://github.com/canis-io/yii2-canis-lib/blob/97d533521f65b084dc805c5f312c364b469142d2/lib/web/Response.php#L139-L153
240,781
mtils/collection
src/Collection/Support/FindsCallableByInheritance.php
FindsCallableByInheritance.classInheritance
public static function classInheritance($object){ $class = new ReflectionClass($object); $classNames = [$class->getName()]; while($class = $class->getParentClass()){ $classNames[] = $class->getName(); } return $classNames; }
php
public static function classInheritance($object){ $class = new ReflectionClass($object); $classNames = [$class->getName()]; while($class = $class->getParentClass()){ $classNames[] = $class->getName(); } return $classNames; }
[ "public", "static", "function", "classInheritance", "(", "$", "object", ")", "{", "$", "class", "=", "new", "ReflectionClass", "(", "$", "object", ")", ";", "$", "classNames", "=", "[", "$", "class", "->", "getName", "(", ")", "]", ";", "while", "(", ...
Returns an array of the classname and all parent class names of the passed class or object @param object|string $object @return array
[ "Returns", "an", "array", "of", "the", "classname", "and", "all", "parent", "class", "names", "of", "the", "passed", "class", "or", "object" ]
186f8a6cc68fef1babc486438aa6d6c643186cc8
https://github.com/mtils/collection/blob/186f8a6cc68fef1babc486438aa6d6c643186cc8/src/Collection/Support/FindsCallableByInheritance.php#L154-L165
240,782
arvici/framework
src/Arvici/Heart/App/AppManager.php
AppManager.initApps
public function initApps() { if (count($this->apps) > 0) { throw new AlreadyInitiatedException('The apps are already loaded!'); } foreach ($this->appList as $className) { $instance = new $className($this); $this->apps->append($instance); } ...
php
public function initApps() { if (count($this->apps) > 0) { throw new AlreadyInitiatedException('The apps are already loaded!'); } foreach ($this->appList as $className) { $instance = new $className($this); $this->apps->append($instance); } ...
[ "public", "function", "initApps", "(", ")", "{", "if", "(", "count", "(", "$", "this", "->", "apps", ")", ">", "0", ")", "{", "throw", "new", "AlreadyInitiatedException", "(", "'The apps are already loaded!'", ")", ";", "}", "foreach", "(", "$", "this", ...
Load and initiate all apps. @codeCoverageIgnore
[ "Load", "and", "initiate", "all", "apps", "." ]
4d0933912fef8f9edc756ef1ace009e96d9fc4b1
https://github.com/arvici/framework/blob/4d0933912fef8f9edc756ef1ace009e96d9fc4b1/src/Arvici/Heart/App/AppManager.php#L68-L88
240,783
indigophp-archive/supervisor-configuration
src/Configuration/Parser/Base.php
Base.findSection
public function findSection($section) { if (!isset($this->sectionMap[$section])) { throw new UnknownSection($section); } return $this->sectionMap[$section]; }
php
public function findSection($section) { if (!isset($this->sectionMap[$section])) { throw new UnknownSection($section); } return $this->sectionMap[$section]; }
[ "public", "function", "findSection", "(", "$", "section", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "sectionMap", "[", "$", "section", "]", ")", ")", "{", "throw", "new", "UnknownSection", "(", "$", "section", ")", ";", "}", "return"...
Finds a section class by name @param string $section @return string @throws UnknownException If section is not found in the section map
[ "Finds", "a", "section", "class", "by", "name" ]
7c5fca2e305be004ad91f8e2b4859ece1d484813
https://github.com/indigophp-archive/supervisor-configuration/blob/7c5fca2e305be004ad91f8e2b4859ece1d484813/src/Configuration/Parser/Base.php#L63-L70
240,784
indigophp-archive/supervisor-configuration
src/Configuration/Parser/Base.php
Base.parseArray
public function parseArray(array $ini) { $sections = []; foreach ($ini as $name => $section) { $section = $this->parseSection($name, $section); $sections[] = $section; } return $sections; }
php
public function parseArray(array $ini) { $sections = []; foreach ($ini as $name => $section) { $section = $this->parseSection($name, $section); $sections[] = $section; } return $sections; }
[ "public", "function", "parseArray", "(", "array", "$", "ini", ")", "{", "$", "sections", "=", "[", "]", ";", "foreach", "(", "$", "ini", "as", "$", "name", "=>", "$", "section", ")", "{", "$", "section", "=", "$", "this", "->", "parseSection", "(",...
Parses an INI array Sections must be included @param array $ini @return Section[]
[ "Parses", "an", "INI", "array" ]
7c5fca2e305be004ad91f8e2b4859ece1d484813
https://github.com/indigophp-archive/supervisor-configuration/blob/7c5fca2e305be004ad91f8e2b4859ece1d484813/src/Configuration/Parser/Base.php#L81-L91
240,785
indigophp-archive/supervisor-configuration
src/Configuration/Parser/Base.php
Base.parseSection
public function parseSection($name, array $section) { $name = explode(':', $name, 2); $class = $this->findSection($name[0]); if (isset($name[1])) { return new $class($name[1], $section); } return new $class($section); }
php
public function parseSection($name, array $section) { $name = explode(':', $name, 2); $class = $this->findSection($name[0]); if (isset($name[1])) { return new $class($name[1], $section); } return new $class($section); }
[ "public", "function", "parseSection", "(", "$", "name", ",", "array", "$", "section", ")", "{", "$", "name", "=", "explode", "(", "':'", ",", "$", "name", ",", "2", ")", ";", "$", "class", "=", "$", "this", "->", "findSection", "(", "$", "name", ...
Parses an individual section @param string $name @param array $section Array representation of section @return Section
[ "Parses", "an", "individual", "section" ]
7c5fca2e305be004ad91f8e2b4859ece1d484813
https://github.com/indigophp-archive/supervisor-configuration/blob/7c5fca2e305be004ad91f8e2b4859ece1d484813/src/Configuration/Parser/Base.php#L101-L112
240,786
indigophp-archive/codeception-fuel-module
fuel/fuel/core/classes/config.php
Config.save
public static function save($file, $config) { if ( ! is_array($config)) { if ( ! isset(static::$items[$config])) { return false; } $config = static::$items[$config]; } $info = pathinfo($file); $type = 'php'; if (isset($info['extension'])) { $type = $info['extension']; // Keep exte...
php
public static function save($file, $config) { if ( ! is_array($config)) { if ( ! isset(static::$items[$config])) { return false; } $config = static::$items[$config]; } $info = pathinfo($file); $type = 'php'; if (isset($info['extension'])) { $type = $info['extension']; // Keep exte...
[ "public", "static", "function", "save", "(", "$", "file", ",", "$", "config", ")", "{", "if", "(", "!", "is_array", "(", "$", "config", ")", ")", "{", "if", "(", "!", "isset", "(", "static", "::", "$", "items", "[", "$", "config", "]", ")", ")"...
Save a config array to disc. @param string $file desired file name @param string|array $config master config array key or config array @return bool false when config is empty or invalid else \File::update result
[ "Save", "a", "config", "array", "to", "disc", "." ]
0973b7cbd540a0e89cc5bb7af94627f77f09bf49
https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/config.php#L140-L174
240,787
lucifurious/kisma
src/Kisma/Core/Utility/ErrorHandler.php
ErrorHandler.renderError
public static function renderError() { try { $_errorTemplate = \Kisma::get( 'app.error_template', '_error.twig' ); Render::twigView( $_errorTemplate, array( 'base_path' => \Kisma::get( 'app.base_path' ), ...
php
public static function renderError() { try { $_errorTemplate = \Kisma::get( 'app.error_template', '_error.twig' ); Render::twigView( $_errorTemplate, array( 'base_path' => \Kisma::get( 'app.base_path' ), ...
[ "public", "static", "function", "renderError", "(", ")", "{", "try", "{", "$", "_errorTemplate", "=", "\\", "Kisma", "::", "get", "(", "'app.error_template'", ",", "'_error.twig'", ")", ";", "Render", "::", "twigView", "(", "$", "_errorTemplate", ",", "array...
Renders an error @return bool
[ "Renders", "an", "error" ]
4cc9954249da4e535b52f154e728935f07e648ae
https://github.com/lucifurious/kisma/blob/4cc9954249da4e535b52f154e728935f07e648ae/src/Kisma/Core/Utility/ErrorHandler.php#L168-L205
240,788
lucifurious/kisma
src/Kisma/Core/Utility/ErrorHandler.php
ErrorHandler._cleanTrace
protected static function _cleanTrace( array &$trace, $skipLines = null, $basePath = null ) { $_trace = array(); $_basePath = $basePath ?: \Kisma::get( 'app.base_path' ); // Skip some lines if ( !empty( $skipLines ) && count( $trace ) > $skipLines ) { $trace = ar...
php
protected static function _cleanTrace( array &$trace, $skipLines = null, $basePath = null ) { $_trace = array(); $_basePath = $basePath ?: \Kisma::get( 'app.base_path' ); // Skip some lines if ( !empty( $skipLines ) && count( $trace ) > $skipLines ) { $trace = ar...
[ "protected", "static", "function", "_cleanTrace", "(", "array", "&", "$", "trace", ",", "$", "skipLines", "=", "null", ",", "$", "basePath", "=", "null", ")", "{", "$", "_trace", "=", "array", "(", ")", ";", "$", "_basePath", "=", "$", "basePath", "?...
Cleans up a trace array @param array $trace @param int $skipLines @param null $basePath @return null|string
[ "Cleans", "up", "a", "trace", "array" ]
4cc9954249da4e535b52f154e728935f07e648ae
https://github.com/lucifurious/kisma/blob/4cc9954249da4e535b52f154e728935f07e648ae/src/Kisma/Core/Utility/ErrorHandler.php#L216-L314
240,789
phossa2/libs
src/Phossa2/Db/Driver/StatementAbstract.php
StatementAbstract.checkPreparation
protected function checkPreparation() { // must be prepared if (null === $this->prepared) { throw new RuntimeException( Message::get(Message::DB_STMT_NOTPREPARED), Message::DB_STMT_NOTPREPARED ); } // close any previous results...
php
protected function checkPreparation() { // must be prepared if (null === $this->prepared) { throw new RuntimeException( Message::get(Message::DB_STMT_NOTPREPARED), Message::DB_STMT_NOTPREPARED ); } // close any previous results...
[ "protected", "function", "checkPreparation", "(", ")", "{", "// must be prepared", "if", "(", "null", "===", "$", "this", "->", "prepared", ")", "{", "throw", "new", "RuntimeException", "(", "Message", "::", "get", "(", "Message", "::", "DB_STMT_NOTPREPARED", ...
Throw exception if not prepared @throws RuntimeException @access protected
[ "Throw", "exception", "if", "not", "prepared" ]
921e485c8cc29067f279da2cdd06f47a9bddd115
https://github.com/phossa2/libs/blob/921e485c8cc29067f279da2cdd06f47a9bddd115/src/Phossa2/Db/Driver/StatementAbstract.php#L158-L170
240,790
kairosProject/ApiLoader
KairosProject/ApiLoader/Loader/AbstractApiLoader.php
AbstractApiLoader.loadItemOrThrowException
private function loadItemOrThrowException( QueryBuildingEventInterface $event, string $eventName, EventDispatcherInterface $dispatcher ) { $queryResult = $this->executeItemQuery($event, $eventName, $dispatcher); if (empty($queryResult) && $this->noItemException) { ...
php
private function loadItemOrThrowException( QueryBuildingEventInterface $event, string $eventName, EventDispatcherInterface $dispatcher ) { $queryResult = $this->executeItemQuery($event, $eventName, $dispatcher); if (empty($queryResult) && $this->noItemException) { ...
[ "private", "function", "loadItemOrThrowException", "(", "QueryBuildingEventInterface", "$", "event", ",", "string", "$", "eventName", ",", "EventDispatcherInterface", "$", "dispatcher", ")", "{", "$", "queryResult", "=", "$", "this", "->", "executeItemQuery", "(", "...
Load item or throw exception Load an item by executing the executeQueryItem. In case of item cannot be resolved, this method will throw a RuntimeException. The exception throwing can be disabled by the $noItemException constructor argument. @param ProcessEventInterface $event The original event. @param string...
[ "Load", "item", "or", "throw", "exception" ]
d07c75ccc139d8b55b782e5e7719f802a61f044a
https://github.com/kairosProject/ApiLoader/blob/d07c75ccc139d8b55b782e5e7719f802a61f044a/KairosProject/ApiLoader/Loader/AbstractApiLoader.php#L307-L328
240,791
nirix/radium
src/Helpers/Pagination.php
Pagination.createUri
public function createUri($page) { $queryString = $this->query; $queryString[] = "page={$page}"; $queryString = implode('&', $queryString); return Request::pathInfo() . "?{$queryString}"; }
php
public function createUri($page) { $queryString = $this->query; $queryString[] = "page={$page}"; $queryString = implode('&', $queryString); return Request::pathInfo() . "?{$queryString}"; }
[ "public", "function", "createUri", "(", "$", "page", ")", "{", "$", "queryString", "=", "$", "this", "->", "query", ";", "$", "queryString", "[", "]", "=", "\"page={$page}\"", ";", "$", "queryString", "=", "implode", "(", "'&'", ",", "$", "queryString", ...
Creates the URI for the specified page. @param integer $page @return string
[ "Creates", "the", "URI", "for", "the", "specified", "page", "." ]
cc6907bfee296b64a7630b0b188e233d7cdb86fd
https://github.com/nirix/radium/blob/cc6907bfee296b64a7630b0b188e233d7cdb86fd/src/Helpers/Pagination.php#L174-L181
240,792
nirix/radium
src/Helpers/Pagination.php
Pagination.createPageLinks
protected function createPageLinks() { $pageLinks = array(); if ($this->totalPages > 10) { $startRange = $this->page - floor($this->range/2); $endRange = $this->page + floor($this->range/2); //Start range if ($startRange <= 0) { $st...
php
protected function createPageLinks() { $pageLinks = array(); if ($this->totalPages > 10) { $startRange = $this->page - floor($this->range/2); $endRange = $this->page + floor($this->range/2); //Start range if ($startRange <= 0) { $st...
[ "protected", "function", "createPageLinks", "(", ")", "{", "$", "pageLinks", "=", "array", "(", ")", ";", "if", "(", "$", "this", "->", "totalPages", ">", "10", ")", "{", "$", "startRange", "=", "$", "this", "->", "page", "-", "floor", "(", "$", "t...
Creates the page links.
[ "Creates", "the", "page", "links", "." ]
cc6907bfee296b64a7630b0b188e233d7cdb86fd
https://github.com/nirix/radium/blob/cc6907bfee296b64a7630b0b188e233d7cdb86fd/src/Helpers/Pagination.php#L186-L240
240,793
lucifurious/kisma
src/Kisma/Core/Utility/Xml.php
Xml.fromObject
public static function fromObject( $object, $rootName = null, $nodeName = null, $addHeader = true ) { if ( !is_object( $object ) ) { throw new \InvalidArgumentException( 'The value of "$object" is not an object.' ); } return static::fromArray( get_object_vars( $object ),...
php
public static function fromObject( $object, $rootName = null, $nodeName = null, $addHeader = true ) { if ( !is_object( $object ) ) { throw new \InvalidArgumentException( 'The value of "$object" is not an object.' ); } return static::fromArray( get_object_vars( $object ),...
[ "public", "static", "function", "fromObject", "(", "$", "object", ",", "$", "rootName", "=", "null", ",", "$", "nodeName", "=", "null", ",", "$", "addHeader", "=", "true", ")", "{", "if", "(", "!", "is_object", "(", "$", "object", ")", ")", "{", "t...
Converts an object to an XML string @param mixed $object @param string $rootName @param string $nodeName @param bool $addHeader If true, the <?xml?> header is prepended to the result @throws \InvalidArgumentException @return null|string
[ "Converts", "an", "object", "to", "an", "XML", "string" ]
4cc9954249da4e535b52f154e728935f07e648ae
https://github.com/lucifurious/kisma/blob/4cc9954249da4e535b52f154e728935f07e648ae/src/Kisma/Core/Utility/Xml.php#L42-L50
240,794
lucifurious/kisma
src/Kisma/Core/Utility/Xml.php
Xml.fromArray
public static function fromArray( $data, $rootName = null, $nodeName = null, $addHeader = true ) { $_xml = true === $addHeader ? '<?xml version="1.0" encoding="UTF-8" ?>' : null; if ( null !== $rootName ) { $_xml .= Markup::openTag( $rootName ); } $_string = nul...
php
public static function fromArray( $data, $rootName = null, $nodeName = null, $addHeader = true ) { $_xml = true === $addHeader ? '<?xml version="1.0" encoding="UTF-8" ?>' : null; if ( null !== $rootName ) { $_xml .= Markup::openTag( $rootName ); } $_string = nul...
[ "public", "static", "function", "fromArray", "(", "$", "data", ",", "$", "rootName", "=", "null", ",", "$", "nodeName", "=", "null", ",", "$", "addHeader", "=", "true", ")", "{", "$", "_xml", "=", "true", "===", "$", "addHeader", "?", "'<?xml version=\...
Converts an array to an XML string @param mixed $data @param string $rootName @param string $nodeName @param bool $addHeader @return null|string
[ "Converts", "an", "array", "to", "an", "XML", "string" ]
4cc9954249da4e535b52f154e728935f07e648ae
https://github.com/lucifurious/kisma/blob/4cc9954249da4e535b52f154e728935f07e648ae/src/Kisma/Core/Utility/Xml.php#L62-L99
240,795
PentagonalProject/SlimService
src/Session.php
Session.&
public static function &createWithName($name = null, AuraSession $session = null) : Session { $session = ! is_null($session) ? new static : new static($session); if (is_null($name)) { return $session; } $session->setSegmentName($name); return $session; }
php
public static function &createWithName($name = null, AuraSession $session = null) : Session { $session = ! is_null($session) ? new static : new static($session); if (is_null($name)) { return $session; } $session->setSegmentName($name); return $session; }
[ "public", "static", "function", "&", "createWithName", "(", "$", "name", "=", "null", ",", "AuraSession", "$", "session", "=", "null", ")", ":", "Session", "{", "$", "session", "=", "!", "is_null", "(", "$", "session", ")", "?", "new", "static", ":", ...
Create Instance Session @param string|null $name @param AuraSession|null $session @return Session
[ "Create", "Instance", "Session" ]
65df2ad530e28b6d72aad5394a0872760aad44cb
https://github.com/PentagonalProject/SlimService/blob/65df2ad530e28b6d72aad5394a0872760aad44cb/src/Session.php#L112-L121
240,796
PentagonalProject/SlimService
src/Session.php
Session.startOrResume
public function startOrResume() : bool { if (!$this->session->isStarted()) { return $this->session->start(); } return $this->session->resume(); }
php
public function startOrResume() : bool { if (!$this->session->isStarted()) { return $this->session->start(); } return $this->session->resume(); }
[ "public", "function", "startOrResume", "(", ")", ":", "bool", "{", "if", "(", "!", "$", "this", "->", "session", "->", "isStarted", "(", ")", ")", "{", "return", "$", "this", "->", "session", "->", "start", "(", ")", ";", "}", "return", "$", "this"...
Start Or Resume Session @return bool
[ "Start", "Or", "Resume", "Session" ]
65df2ad530e28b6d72aad5394a0872760aad44cb
https://github.com/PentagonalProject/SlimService/blob/65df2ad530e28b6d72aad5394a0872760aad44cb/src/Session.php#L138-L145
240,797
PentagonalProject/SlimService
src/Session.php
Session.validateToken
public function validateToken($value) : bool { if (!is_string($value)) { return false; } return $this->getCSRFToken()->isValid($value); }
php
public function validateToken($value) : bool { if (!is_string($value)) { return false; } return $this->getCSRFToken()->isValid($value); }
[ "public", "function", "validateToken", "(", "$", "value", ")", ":", "bool", "{", "if", "(", "!", "is_string", "(", "$", "value", ")", ")", "{", "return", "false", ";", "}", "return", "$", "this", "->", "getCSRFToken", "(", ")", "->", "isValid", "(", ...
validate token set @param string $value @return bool
[ "validate", "token", "set" ]
65df2ad530e28b6d72aad5394a0872760aad44cb
https://github.com/PentagonalProject/SlimService/blob/65df2ad530e28b6d72aad5394a0872760aad44cb/src/Session.php#L194-L201
240,798
PentagonalProject/SlimService
src/Session.php
Session.exist
public function exist($keyName) : bool { # double check return $this->get($keyName, true) !== true && $this->get($keyName, false) !== false; }
php
public function exist($keyName) : bool { # double check return $this->get($keyName, true) !== true && $this->get($keyName, false) !== false; }
[ "public", "function", "exist", "(", "$", "keyName", ")", ":", "bool", "{", "# double check", "return", "$", "this", "->", "get", "(", "$", "keyName", ",", "true", ")", "!==", "true", "&&", "$", "this", "->", "get", "(", "$", "keyName", ",", "false", ...
Check whether Session is exists or not on segment @param string $keyName @return bool
[ "Check", "whether", "Session", "is", "exists", "or", "not", "on", "segment" ]
65df2ad530e28b6d72aad5394a0872760aad44cb
https://github.com/PentagonalProject/SlimService/blob/65df2ad530e28b6d72aad5394a0872760aad44cb/src/Session.php#L227-L233
240,799
railsphp/framework
src/Rails/ActionDispatch/Http/Parameters.php
Parameters.required
public function required($keys, array $params = [], array $parents = []) { if (!$params) { $params = $this->all(); } if (is_array($keys)) { foreach ($keys as $key => $value) { if (is_int($key)) { $key = $value; ...
php
public function required($keys, array $params = [], array $parents = []) { if (!$params) { $params = $this->all(); } if (is_array($keys)) { foreach ($keys as $key => $value) { if (is_int($key)) { $key = $value; ...
[ "public", "function", "required", "(", "$", "keys", ",", "array", "$", "params", "=", "[", "]", ",", "array", "$", "parents", "=", "[", "]", ")", "{", "if", "(", "!", "$", "params", ")", "{", "$", "params", "=", "$", "this", "->", "all", "(", ...
Checks for required parameters. If one of them is null, ParameterMissingException is thrown. ``` // Check for a value. $parameters->required('user'); // Check for an array and some keys $parameters->required(['user' => ['name', 'address']]); ``` @throws ParameterMissingException
[ "Checks", "for", "required", "parameters", ".", "If", "one", "of", "them", "is", "null", "ParameterMissingException", "is", "thrown", "." ]
2ac9d3e493035dcc68f3c3812423327127327cd5
https://github.com/railsphp/framework/blob/2ac9d3e493035dcc68f3c3812423327127327cd5/src/Rails/ActionDispatch/Http/Parameters.php#L200-L242