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
33,100
canihavesomecoffee/theTVDbAPI
src/Route/SeriesRoute.php
SeriesRoute.getEpisodesSummary
public function getEpisodesSummary(int $id): SeriesStatistics { $json = $this->parent->performAPICallWithJsonResponse('get', '/series/'.$id.'/episodes/summary'); return DataParser::parseData($json, SeriesStatistics::class); }
php
public function getEpisodesSummary(int $id): SeriesStatistics { $json = $this->parent->performAPICallWithJsonResponse('get', '/series/'.$id.'/episodes/summary'); return DataParser::parseData($json, SeriesStatistics::class); }
[ "public", "function", "getEpisodesSummary", "(", "int", "$", "id", ")", ":", "SeriesStatistics", "{", "$", "json", "=", "$", "this", "->", "parent", "->", "performAPICallWithJsonResponse", "(", "'get'", ",", "'/series/'", ".", "$", "id", ".", "'/episodes/summa...
Returns statistics about how many seasons & episodes were aired. @param int $id The series id. @return SeriesStatistics Statistics on the given series.
[ "Returns", "statistics", "about", "how", "many", "seasons", "&", "episodes", "were", "aired", "." ]
f23f544029269fe2a244818209b060d08654eca6
https://github.com/canihavesomecoffee/theTVDbAPI/blob/f23f544029269fe2a244818209b060d08654eca6/src/Route/SeriesRoute.php#L172-L177
33,101
canihavesomecoffee/theTVDbAPI
src/Route/SeriesRoute.php
SeriesRoute.getWithFilter
public function getWithFilter(int $id, array $keys): array { return $this->parent->performAPICallWithJsonResponse( 'get', '/series/'.$id.'/filter', [ 'query' => ['keys' => join(',', $keys)] ] ); }
php
public function getWithFilter(int $id, array $keys): array { return $this->parent->performAPICallWithJsonResponse( 'get', '/series/'.$id.'/filter', [ 'query' => ['keys' => join(',', $keys)] ] ); }
[ "public", "function", "getWithFilter", "(", "int", "$", "id", ",", "array", "$", "keys", ")", ":", "array", "{", "return", "$", "this", "->", "parent", "->", "performAPICallWithJsonResponse", "(", "'get'", ",", "'/series/'", ".", "$", "id", ".", "'/filter'...
Fetches the data for a series, but only with the attributes that are provided. @param int $id The series id. @param array $keys The keys that should be returned. @return array A key -> value list with the retrieved data.
[ "Fetches", "the", "data", "for", "a", "series", "but", "only", "with", "the", "attributes", "that", "are", "provided", "." ]
f23f544029269fe2a244818209b060d08654eca6
https://github.com/canihavesomecoffee/theTVDbAPI/blob/f23f544029269fe2a244818209b060d08654eca6/src/Route/SeriesRoute.php#L199-L208
33,102
canihavesomecoffee/theTVDbAPI
src/Route/SeriesRoute.php
SeriesRoute.getImages
public function getImages(int $id): ImageStatistics { $json = $this->parent->performAPICallWithJsonResponse('get', '/series/'.$id.'/images'); return DataParser::parseData($json, ImageStatistics::class); }
php
public function getImages(int $id): ImageStatistics { $json = $this->parent->performAPICallWithJsonResponse('get', '/series/'.$id.'/images'); return DataParser::parseData($json, ImageStatistics::class); }
[ "public", "function", "getImages", "(", "int", "$", "id", ")", ":", "ImageStatistics", "{", "$", "json", "=", "$", "this", "->", "parent", "->", "performAPICallWithJsonResponse", "(", "'get'", ",", "'/series/'", ".", "$", "id", ".", "'/images'", ")", ";", ...
Fetches statistics on the submitted images. @param int $id The id of the series. @return ImageStatistics An instance with series statistics.
[ "Fetches", "statistics", "on", "the", "submitted", "images", "." ]
f23f544029269fe2a244818209b060d08654eca6
https://github.com/canihavesomecoffee/theTVDbAPI/blob/f23f544029269fe2a244818209b060d08654eca6/src/Route/SeriesRoute.php#L217-L222
33,103
orchestral/support
src/Support/Concerns/QueryFilter.php
QueryFilter.buildWildcardQueryFilters
protected function buildWildcardQueryFilters($query, array $fields, array $keyword = []) { foreach ($fields as $field) { $this->buildWildcardForField($query, $field, $keyword); } return $query; }
php
protected function buildWildcardQueryFilters($query, array $fields, array $keyword = []) { foreach ($fields as $field) { $this->buildWildcardForField($query, $field, $keyword); } return $query; }
[ "protected", "function", "buildWildcardQueryFilters", "(", "$", "query", ",", "array", "$", "fields", ",", "array", "$", "keyword", "=", "[", "]", ")", "{", "foreach", "(", "$", "fields", "as", "$", "field", ")", "{", "$", "this", "->", "buildWildcardFor...
Build wildcard query filters. @param \Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Query\Builder $query @param array $fields @param array $keyword @param string $group @return \Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Query\Builder
[ "Build", "wildcard", "query", "filters", "." ]
b56f0469f967737e39fc9a33d40ae7439f4f6884
https://github.com/orchestral/support/blob/b56f0469f967737e39fc9a33d40ae7439f4f6884/src/Support/Concerns/QueryFilter.php#L119-L126
33,104
orchestral/support
src/Providers/Concerns/PackageProvider.php
PackageProvider.addLanguageComponent
public function addLanguageComponent(string $package, string $namespace, string $path): void { $this->app->make('translator')->addNamespace($namespace, $path); }
php
public function addLanguageComponent(string $package, string $namespace, string $path): void { $this->app->make('translator')->addNamespace($namespace, $path); }
[ "public", "function", "addLanguageComponent", "(", "string", "$", "package", ",", "string", "$", "namespace", ",", "string", "$", "path", ")", ":", "void", "{", "$", "this", "->", "app", "->", "make", "(", "'translator'", ")", "->", "addNamespace", "(", ...
Register the package's language component namespaces. @param string $package @param string $namespace @param string $path @return void
[ "Register", "the", "package", "s", "language", "component", "namespaces", "." ]
b56f0469f967737e39fc9a33d40ae7439f4f6884
https://github.com/orchestral/support/blob/b56f0469f967737e39fc9a33d40ae7439f4f6884/src/Providers/Concerns/PackageProvider.php#L35-L38
33,105
orchestral/support
src/Providers/Concerns/PackageProvider.php
PackageProvider.getAppViewPaths
protected function getAppViewPaths(string $package): array { return \array_map(function ($path) use ($package) { return "{$path}/packages/{$package}"; }, $this->app->make('config')->get('view.paths', [])); }
php
protected function getAppViewPaths(string $package): array { return \array_map(function ($path) use ($package) { return "{$path}/packages/{$package}"; }, $this->app->make('config')->get('view.paths', [])); }
[ "protected", "function", "getAppViewPaths", "(", "string", "$", "package", ")", ":", "array", "{", "return", "\\", "array_map", "(", "function", "(", "$", "path", ")", "use", "(", "$", "package", ")", "{", "return", "\"{$path}/packages/{$package}\"", ";", "}...
Get the application package view paths. @param string $package @return array
[ "Get", "the", "application", "package", "view", "paths", "." ]
b56f0469f967737e39fc9a33d40ae7439f4f6884
https://github.com/orchestral/support/blob/b56f0469f967737e39fc9a33d40ae7439f4f6884/src/Providers/Concerns/PackageProvider.php#L143-L148
33,106
nails/module-invoice
src/Api/Controller/Customer.php
Customer.getSearch
public function getSearch() { if (!userHasPermission('admin:invoice:customer:manage')) { throw new ApiException('You are not authorised to search customers.', 401); } $oInput = Factory::service('Input'); $sKeywords = $oInput->get('keywords'); $oCusto...
php
public function getSearch() { if (!userHasPermission('admin:invoice:customer:manage')) { throw new ApiException('You are not authorised to search customers.', 401); } $oInput = Factory::service('Input'); $sKeywords = $oInput->get('keywords'); $oCusto...
[ "public", "function", "getSearch", "(", ")", "{", "if", "(", "!", "userHasPermission", "(", "'admin:invoice:customer:manage'", ")", ")", "{", "throw", "new", "ApiException", "(", "'You are not authorised to search customers.'", ",", "401", ")", ";", "}", "$", "oIn...
Search for a customer
[ "Search", "for", "a", "customer" ]
3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716
https://github.com/nails/module-invoice/blob/3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716/src/Api/Controller/Customer.php#L24-L47
33,107
nails/module-invoice
src/Api/Controller/Customer.php
Customer.getId
public function getId($iId = null) { $oInput = Factory::service('Input'); $iId = (int) $iId ?: (int) $oInput->get('id'); if (empty($iId)) { throw new ApiException('Invalid Customer ID', 404); } $oCustomerModel = Factory::model('Customer', 'nails/module-invoic...
php
public function getId($iId = null) { $oInput = Factory::service('Input'); $iId = (int) $iId ?: (int) $oInput->get('id'); if (empty($iId)) { throw new ApiException('Invalid Customer ID', 404); } $oCustomerModel = Factory::model('Customer', 'nails/module-invoic...
[ "public", "function", "getId", "(", "$", "iId", "=", "null", ")", "{", "$", "oInput", "=", "Factory", "::", "service", "(", "'Input'", ")", ";", "$", "iId", "=", "(", "int", ")", "$", "iId", "?", ":", "(", "int", ")", "$", "oInput", "->", "get"...
Returns a customer by their ID @param string $iId The customer's ID @return array
[ "Returns", "a", "customer", "by", "their", "ID" ]
3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716
https://github.com/nails/module-invoice/blob/3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716/src/Api/Controller/Customer.php#L58-L76
33,108
emgiezet/errbitPHP
src/Errbit/Handlers/ErrorHandlers.php
ErrorHandlers.onShutdown
public function onShutdown() { if (($error = error_get_last()) && $error['type'] & error_reporting()) { $this->errbit->notify(new Fatal($error['message'], $error['file'], $error['line'])); } }
php
public function onShutdown() { if (($error = error_get_last()) && $error['type'] & error_reporting()) { $this->errbit->notify(new Fatal($error['message'], $error['file'], $error['line'])); } }
[ "public", "function", "onShutdown", "(", ")", "{", "if", "(", "(", "$", "error", "=", "error_get_last", "(", ")", ")", "&&", "$", "error", "[", "'type'", "]", "&", "error_reporting", "(", ")", ")", "{", "$", "this", "->", "errbit", "->", "notify", ...
On shut down
[ "On", "shut", "down" ]
cc634f8d6b0d2cd4a29648662119310afc73fa7b
https://github.com/emgiezet/errbitPHP/blob/cc634f8d6b0d2cd4a29648662119310afc73fa7b/src/Errbit/Handlers/ErrorHandlers.php#L96-L101
33,109
nails/module-invoice
src/Api/Controller/Invoice.php
Invoice.getSearch
public function getSearch() { if (!userHasPermission('admin:invoice:invoice:manage')) { throw new ApiException('You are not authorised to search invoices.', 401); } $oInput = Factory::service('Input'); $sKeywords = $oInput->get('keywords'); $oInvoiceMo...
php
public function getSearch() { if (!userHasPermission('admin:invoice:invoice:manage')) { throw new ApiException('You are not authorised to search invoices.', 401); } $oInput = Factory::service('Input'); $sKeywords = $oInput->get('keywords'); $oInvoiceMo...
[ "public", "function", "getSearch", "(", ")", "{", "if", "(", "!", "userHasPermission", "(", "'admin:invoice:invoice:manage'", ")", ")", "{", "throw", "new", "ApiException", "(", "'You are not authorised to search invoices.'", ",", "401", ")", ";", "}", "$", "oInpu...
Search for an invoice
[ "Search", "for", "an", "invoice" ]
3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716
https://github.com/nails/module-invoice/blob/3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716/src/Api/Controller/Invoice.php#L24-L47
33,110
nails/module-invoice
src/Api/Controller/Invoice.php
Invoice.getId
public function getId($iId = null) { $oInput = Factory::service('Input'); $iId = (int) $iId ?: (int) $oInput->get('id'); if (empty($iId)) { throw new ApiException('Invalid Invoice ID', 404); } $oInvoiceModel = Factory::model('Invoice', 'nails/module-invoice')...
php
public function getId($iId = null) { $oInput = Factory::service('Input'); $iId = (int) $iId ?: (int) $oInput->get('id'); if (empty($iId)) { throw new ApiException('Invalid Invoice ID', 404); } $oInvoiceModel = Factory::model('Invoice', 'nails/module-invoice')...
[ "public", "function", "getId", "(", "$", "iId", "=", "null", ")", "{", "$", "oInput", "=", "Factory", "::", "service", "(", "'Input'", ")", ";", "$", "iId", "=", "(", "int", ")", "$", "iId", "?", ":", "(", "int", ")", "$", "oInput", "->", "get"...
Returns an invoice by its ID @param string $iId The invoice's ID @return array
[ "Returns", "an", "invoice", "by", "its", "ID" ]
3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716
https://github.com/nails/module-invoice/blob/3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716/src/Api/Controller/Invoice.php#L58-L76
33,111
pxgamer/arionum-php
src/Transaction.php
Transaction.makeAliasSendInstance
public static function makeAliasSendInstance(string $alias, float $value, string $message = ''): self { $transaction = new self(); $transaction->setVersion(Version::ALIAS_SEND); $transaction->setDestinationAddress($alias); $transaction->setValue($value); $transaction->setMes...
php
public static function makeAliasSendInstance(string $alias, float $value, string $message = ''): self { $transaction = new self(); $transaction->setVersion(Version::ALIAS_SEND); $transaction->setDestinationAddress($alias); $transaction->setValue($value); $transaction->setMes...
[ "public", "static", "function", "makeAliasSendInstance", "(", "string", "$", "alias", ",", "float", "$", "value", ",", "string", "$", "message", "=", "''", ")", ":", "self", "{", "$", "transaction", "=", "new", "self", "(", ")", ";", "$", "transaction", ...
Retrieve a pre-populated Transaction instance for sending to an alias. @param string $alias @param float $value @param string $message @return self @api
[ "Retrieve", "a", "pre", "-", "populated", "Transaction", "instance", "for", "sending", "to", "an", "alias", "." ]
1d3e73f7b661878b864b3a910faad540e6af47bb
https://github.com/pxgamer/arionum-php/blob/1d3e73f7b661878b864b3a910faad540e6af47bb/src/Transaction.php#L132-L142
33,112
pxgamer/arionum-php
src/Transaction.php
Transaction.makeAliasSetInstance
public static function makeAliasSetInstance(string $address, string $alias): self { $transaction = new self(); $transaction->setVersion(Version::ALIAS_SET); $transaction->setDestinationAddress($address); $transaction->setValue(self::VALUE_ALIAS_SET); $transaction->setFee(sel...
php
public static function makeAliasSetInstance(string $address, string $alias): self { $transaction = new self(); $transaction->setVersion(Version::ALIAS_SET); $transaction->setDestinationAddress($address); $transaction->setValue(self::VALUE_ALIAS_SET); $transaction->setFee(sel...
[ "public", "static", "function", "makeAliasSetInstance", "(", "string", "$", "address", ",", "string", "$", "alias", ")", ":", "self", "{", "$", "transaction", "=", "new", "self", "(", ")", ";", "$", "transaction", "->", "setVersion", "(", "Version", "::", ...
Retrieve a pre-populated Transaction instance for setting an alias. @param string $address @param string $alias @return self @api
[ "Retrieve", "a", "pre", "-", "populated", "Transaction", "instance", "for", "setting", "an", "alias", "." ]
1d3e73f7b661878b864b3a910faad540e6af47bb
https://github.com/pxgamer/arionum-php/blob/1d3e73f7b661878b864b3a910faad540e6af47bb/src/Transaction.php#L152-L163
33,113
pxgamer/arionum-php
src/Transaction.php
Transaction.makeMasternodeCreateInstance
public static function makeMasternodeCreateInstance(string $ipAddress, string $address): self { $transaction = new self(); $transaction->setVersion(Version::MASTERNODE_CREATE); $transaction->setDestinationAddress($address); $transaction->setValue(self::VALUE_MASTERNODE_CREATE); ...
php
public static function makeMasternodeCreateInstance(string $ipAddress, string $address): self { $transaction = new self(); $transaction->setVersion(Version::MASTERNODE_CREATE); $transaction->setDestinationAddress($address); $transaction->setValue(self::VALUE_MASTERNODE_CREATE); ...
[ "public", "static", "function", "makeMasternodeCreateInstance", "(", "string", "$", "ipAddress", ",", "string", "$", "address", ")", ":", "self", "{", "$", "transaction", "=", "new", "self", "(", ")", ";", "$", "transaction", "->", "setVersion", "(", "Versio...
Retrieve a pre-populated Transaction instance for creating a masternode. @param string $ipAddress @param string $address @return self @api
[ "Retrieve", "a", "pre", "-", "populated", "Transaction", "instance", "for", "creating", "a", "masternode", "." ]
1d3e73f7b661878b864b3a910faad540e6af47bb
https://github.com/pxgamer/arionum-php/blob/1d3e73f7b661878b864b3a910faad540e6af47bb/src/Transaction.php#L173-L184
33,114
pxgamer/arionum-php
src/Transaction.php
Transaction.makeMasternodePauseInstance
public static function makeMasternodePauseInstance(string $address): self { $transaction = new self(); $transaction->setVersion(Version::MASTERNODE_PAUSE); return self::setMasternodeCommandDefaults($address, $transaction); }
php
public static function makeMasternodePauseInstance(string $address): self { $transaction = new self(); $transaction->setVersion(Version::MASTERNODE_PAUSE); return self::setMasternodeCommandDefaults($address, $transaction); }
[ "public", "static", "function", "makeMasternodePauseInstance", "(", "string", "$", "address", ")", ":", "self", "{", "$", "transaction", "=", "new", "self", "(", ")", ";", "$", "transaction", "->", "setVersion", "(", "Version", "::", "MASTERNODE_PAUSE", ")", ...
Retrieve a pre-populated Transaction instance for pausing a masternode. @param string $address @return self @api
[ "Retrieve", "a", "pre", "-", "populated", "Transaction", "instance", "for", "pausing", "a", "masternode", "." ]
1d3e73f7b661878b864b3a910faad540e6af47bb
https://github.com/pxgamer/arionum-php/blob/1d3e73f7b661878b864b3a910faad540e6af47bb/src/Transaction.php#L193-L199
33,115
pxgamer/arionum-php
src/Transaction.php
Transaction.makeMasternodeResumeInstance
public static function makeMasternodeResumeInstance(string $address): self { $transaction = new self(); $transaction->setVersion(Version::MASTERNODE_RESUME); return self::setMasternodeCommandDefaults($address, $transaction); }
php
public static function makeMasternodeResumeInstance(string $address): self { $transaction = new self(); $transaction->setVersion(Version::MASTERNODE_RESUME); return self::setMasternodeCommandDefaults($address, $transaction); }
[ "public", "static", "function", "makeMasternodeResumeInstance", "(", "string", "$", "address", ")", ":", "self", "{", "$", "transaction", "=", "new", "self", "(", ")", ";", "$", "transaction", "->", "setVersion", "(", "Version", "::", "MASTERNODE_RESUME", ")",...
Retrieve a pre-populated Transaction instance for resuming a masternode. @param string $address @return self @api
[ "Retrieve", "a", "pre", "-", "populated", "Transaction", "instance", "for", "resuming", "a", "masternode", "." ]
1d3e73f7b661878b864b3a910faad540e6af47bb
https://github.com/pxgamer/arionum-php/blob/1d3e73f7b661878b864b3a910faad540e6af47bb/src/Transaction.php#L208-L214
33,116
pxgamer/arionum-php
src/Transaction.php
Transaction.makeMasternodeReleaseInstance
public static function makeMasternodeReleaseInstance(string $address): self { $transaction = new self(); $transaction->setVersion(Version::MASTERNODE_RELEASE); return self::setMasternodeCommandDefaults($address, $transaction); }
php
public static function makeMasternodeReleaseInstance(string $address): self { $transaction = new self(); $transaction->setVersion(Version::MASTERNODE_RELEASE); return self::setMasternodeCommandDefaults($address, $transaction); }
[ "public", "static", "function", "makeMasternodeReleaseInstance", "(", "string", "$", "address", ")", ":", "self", "{", "$", "transaction", "=", "new", "self", "(", ")", ";", "$", "transaction", "->", "setVersion", "(", "Version", "::", "MASTERNODE_RELEASE", ")...
Retrieve a pre-populated Transaction instance for releasing a masternode. @param string $address @return self @api
[ "Retrieve", "a", "pre", "-", "populated", "Transaction", "instance", "for", "releasing", "a", "masternode", "." ]
1d3e73f7b661878b864b3a910faad540e6af47bb
https://github.com/pxgamer/arionum-php/blob/1d3e73f7b661878b864b3a910faad540e6af47bb/src/Transaction.php#L223-L229
33,117
pxgamer/arionum-php
src/Transaction.php
Transaction.setMasternodeCommandDefaults
private static function setMasternodeCommandDefaults(string $address, Transaction $transaction): self { $transaction->setDestinationAddress($address); $transaction->setValue(self::VALUE_MASTERNODE_COMMAND); $transaction->setFee(self::FEE_MASTERNODE_COMMAND); return $transaction; ...
php
private static function setMasternodeCommandDefaults(string $address, Transaction $transaction): self { $transaction->setDestinationAddress($address); $transaction->setValue(self::VALUE_MASTERNODE_COMMAND); $transaction->setFee(self::FEE_MASTERNODE_COMMAND); return $transaction; ...
[ "private", "static", "function", "setMasternodeCommandDefaults", "(", "string", "$", "address", ",", "Transaction", "$", "transaction", ")", ":", "self", "{", "$", "transaction", "->", "setDestinationAddress", "(", "$", "address", ")", ";", "$", "transaction", "...
Set the default fee and value for masternode commands. @param string $address @param self $transaction @return self @internal
[ "Set", "the", "default", "fee", "and", "value", "for", "masternode", "commands", "." ]
1d3e73f7b661878b864b3a910faad540e6af47bb
https://github.com/pxgamer/arionum-php/blob/1d3e73f7b661878b864b3a910faad540e6af47bb/src/Transaction.php#L338-L345
33,118
byjg/restserver
src/ServerRequestHandler.php
ServerRequestHandler.mimeContentType
public function mimeContentType($filename) { $mimeTypes = array( 'txt' => 'text/plain', 'htm' => 'text/html', 'html' => 'text/html', 'php' => 'text/html', 'css' => 'text/css', 'js' => 'application/javascript', 'json' => 'ap...
php
public function mimeContentType($filename) { $mimeTypes = array( 'txt' => 'text/plain', 'htm' => 'text/html', 'html' => 'text/html', 'php' => 'text/html', 'css' => 'text/css', 'js' => 'application/javascript', 'json' => 'ap...
[ "public", "function", "mimeContentType", "(", "$", "filename", ")", "{", "$", "mimeTypes", "=", "array", "(", "'txt'", "=>", "'text/plain'", ",", "'htm'", "=>", "'text/html'", ",", "'html'", "=>", "'text/html'", ",", "'php'", "=>", "'text/html'", ",", "'css'...
Get the Mime Type based on the filename @param string $filename @return string @throws Error404Exception
[ "Get", "the", "Mime", "Type", "based", "on", "the", "filename" ]
1fdbd58f414f5d9958de0873d67eea961dc52fda
https://github.com/byjg/restserver/blob/1fdbd58f414f5d9958de0873d67eea961dc52fda/src/ServerRequestHandler.php#L261-L328
33,119
QoboLtd/qobo-robo
src/Command/Mysql/DbCreate.php
DbCreate.mysqlDbCreate
public function mysqlDbCreate( $db, $user = 'root', $pass = null, $host = null, $port = null, $opts = ['format' => 'table', 'fields' => ''] ) { $result = $this->taskMysqlDbCreate() ->db($db) ->user($user) ->pass($pass) ...
php
public function mysqlDbCreate( $db, $user = 'root', $pass = null, $host = null, $port = null, $opts = ['format' => 'table', 'fields' => ''] ) { $result = $this->taskMysqlDbCreate() ->db($db) ->user($user) ->pass($pass) ...
[ "public", "function", "mysqlDbCreate", "(", "$", "db", ",", "$", "user", "=", "'root'", ",", "$", "pass", "=", "null", ",", "$", "host", "=", "null", ",", "$", "port", "=", "null", ",", "$", "opts", "=", "[", "'format'", "=>", "'table'", ",", "'f...
Create mysql database @param string $db Database name @param string $user MySQL user to bind with @param string $pass (Optional) MySQL user password @param string $host (Optional) MySQL server host @param string $port (Optional) MySQL server port @option string $format Output format (table, list, csv, json, xml) @opti...
[ "Create", "mysql", "database" ]
ea10f778bb046ad41324d22b27fce5a2fb8915ce
https://github.com/QoboLtd/qobo-robo/blob/ea10f778bb046ad41324d22b27fce5a2fb8915ce/src/Command/Mysql/DbCreate.php#L32-L54
33,120
orchestral/support
src/Support/Manager.php
Manager.checkNameIsNotBlacklisted
protected function checkNameIsNotBlacklisted(string $name): void { if (Str::contains($name, $this->blacklisted)) { throw new InvalidArgumentException("Invalid character in driver name [{$name}]."); } }
php
protected function checkNameIsNotBlacklisted(string $name): void { if (Str::contains($name, $this->blacklisted)) { throw new InvalidArgumentException("Invalid character in driver name [{$name}]."); } }
[ "protected", "function", "checkNameIsNotBlacklisted", "(", "string", "$", "name", ")", ":", "void", "{", "if", "(", "Str", "::", "contains", "(", "$", "name", ",", "$", "this", "->", "blacklisted", ")", ")", "{", "throw", "new", "InvalidArgumentException", ...
Check if name is not blacklisted. @param string $name @throws \InvalidArgumentException @return void
[ "Check", "if", "name", "is", "not", "blacklisted", "." ]
b56f0469f967737e39fc9a33d40ae7439f4f6884
https://github.com/orchestral/support/blob/b56f0469f967737e39fc9a33d40ae7439f4f6884/src/Support/Manager.php#L98-L103
33,121
doganoo/PHPUtil
src/Storage/PDOConnector.php
PDOConnector.startTransaction
public function startTransaction(): bool { if ($this->transactionExists) { return false; } $started = $this->pdo->beginTransaction(); $this->transactionExists = $started; return $started; }
php
public function startTransaction(): bool { if ($this->transactionExists) { return false; } $started = $this->pdo->beginTransaction(); $this->transactionExists = $started; return $started; }
[ "public", "function", "startTransaction", "(", ")", ":", "bool", "{", "if", "(", "$", "this", "->", "transactionExists", ")", "{", "return", "false", ";", "}", "$", "started", "=", "$", "this", "->", "pdo", "->", "beginTransaction", "(", ")", ";", "$",...
starts a database transaction @return bool
[ "starts", "a", "database", "transaction" ]
4415a014b4448b1ddf6d2e3f0f0d39cd1a83b8f5
https://github.com/doganoo/PHPUtil/blob/4415a014b4448b1ddf6d2e3f0f0d39cd1a83b8f5/src/Storage/PDOConnector.php#L68-L75
33,122
doganoo/PHPUtil
src/Storage/PDOConnector.php
PDOConnector.commit
public function commit(): bool { if ($this->transactionExists) { $commited = $this->pdo->commit(); $this->transactionExists = !$commited; return $commited; } return false; }
php
public function commit(): bool { if ($this->transactionExists) { $commited = $this->pdo->commit(); $this->transactionExists = !$commited; return $commited; } return false; }
[ "public", "function", "commit", "(", ")", ":", "bool", "{", "if", "(", "$", "this", "->", "transactionExists", ")", "{", "$", "commited", "=", "$", "this", "->", "pdo", "->", "commit", "(", ")", ";", "$", "this", "->", "transactionExists", "=", "!", ...
commits a started database transaction @return bool
[ "commits", "a", "started", "database", "transaction" ]
4415a014b4448b1ddf6d2e3f0f0d39cd1a83b8f5
https://github.com/doganoo/PHPUtil/blob/4415a014b4448b1ddf6d2e3f0f0d39cd1a83b8f5/src/Storage/PDOConnector.php#L81-L88
33,123
doganoo/PHPUtil
src/Storage/PDOConnector.php
PDOConnector.rollback
public function rollback(): bool { if ($this->transactionExists) { $rolledBack = $this->pdo->rollBack(); $this->transactionExists = !$rolledBack; return $rolledBack; } return false; }
php
public function rollback(): bool { if ($this->transactionExists) { $rolledBack = $this->pdo->rollBack(); $this->transactionExists = !$rolledBack; return $rolledBack; } return false; }
[ "public", "function", "rollback", "(", ")", ":", "bool", "{", "if", "(", "$", "this", "->", "transactionExists", ")", "{", "$", "rolledBack", "=", "$", "this", "->", "pdo", "->", "rollBack", "(", ")", ";", "$", "this", "->", "transactionExists", "=", ...
rolls a started transaction back @return bool
[ "rolls", "a", "started", "transaction", "back" ]
4415a014b4448b1ddf6d2e3f0f0d39cd1a83b8f5
https://github.com/doganoo/PHPUtil/blob/4415a014b4448b1ddf6d2e3f0f0d39cd1a83b8f5/src/Storage/PDOConnector.php#L94-L101
33,124
doganoo/PHPUtil
src/Storage/PDOConnector.php
PDOConnector.connect
public function connect(): bool { if (!$this->hasMinimumCredentials()) { throw new InvalidCredentialsException(); } $host = $this->credentials["servername"]; $db = $this->credentials["dbname"]; $dsn = "mysql:host=$host;dbname=$db;charset=utf8"; $this->pdo = ne...
php
public function connect(): bool { if (!$this->hasMinimumCredentials()) { throw new InvalidCredentialsException(); } $host = $this->credentials["servername"]; $db = $this->credentials["dbname"]; $dsn = "mysql:host=$host;dbname=$db;charset=utf8"; $this->pdo = ne...
[ "public", "function", "connect", "(", ")", ":", "bool", "{", "if", "(", "!", "$", "this", "->", "hasMinimumCredentials", "(", ")", ")", "{", "throw", "new", "InvalidCredentialsException", "(", ")", ";", "}", "$", "host", "=", "$", "this", "->", "creden...
connects to the database @return bool @throws InvalidCredentialsException
[ "connects", "to", "the", "database" ]
4415a014b4448b1ddf6d2e3f0f0d39cd1a83b8f5
https://github.com/doganoo/PHPUtil/blob/4415a014b4448b1ddf6d2e3f0f0d39cd1a83b8f5/src/Storage/PDOConnector.php#L109-L122
33,125
doganoo/PHPUtil
src/Storage/PDOConnector.php
PDOConnector.hasMinimumCredentials
private function hasMinimumCredentials(): bool { if (!isset($this->credentials["servername"])) { return false; } if (!isset($this->credentials["username"])) { return false; } if (!isset($this->credentials["password"])) { return false; }...
php
private function hasMinimumCredentials(): bool { if (!isset($this->credentials["servername"])) { return false; } if (!isset($this->credentials["username"])) { return false; } if (!isset($this->credentials["password"])) { return false; }...
[ "private", "function", "hasMinimumCredentials", "(", ")", ":", "bool", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "credentials", "[", "\"servername\"", "]", ")", ")", "{", "return", "false", ";", "}", "if", "(", "!", "isset", "(", "$", "th...
checks for the minimum required credentials @return bool
[ "checks", "for", "the", "minimum", "required", "credentials" ]
4415a014b4448b1ddf6d2e3f0f0d39cd1a83b8f5
https://github.com/doganoo/PHPUtil/blob/4415a014b4448b1ddf6d2e3f0f0d39cd1a83b8f5/src/Storage/PDOConnector.php#L129-L143
33,126
doganoo/PHPUtil
src/Storage/PDOConnector.php
PDOConnector.prepare
public function prepare(string $sql): ?\PDOStatement { $statement = $this->getConnection()->prepare($sql); if ($statement === false) { return null; } $this->statement = $statement; return $statement; }
php
public function prepare(string $sql): ?\PDOStatement { $statement = $this->getConnection()->prepare($sql); if ($statement === false) { return null; } $this->statement = $statement; return $statement; }
[ "public", "function", "prepare", "(", "string", "$", "sql", ")", ":", "?", "\\", "PDOStatement", "{", "$", "statement", "=", "$", "this", "->", "getConnection", "(", ")", "->", "prepare", "(", "$", "sql", ")", ";", "if", "(", "$", "statement", "===",...
prepares a SQL statement @param string $sql @return null|\PDOStatement
[ "prepares", "a", "SQL", "statement" ]
4415a014b4448b1ddf6d2e3f0f0d39cd1a83b8f5
https://github.com/doganoo/PHPUtil/blob/4415a014b4448b1ddf6d2e3f0f0d39cd1a83b8f5/src/Storage/PDOConnector.php#L151-L158
33,127
nails/module-invoice
src/Model/Customer.php
Customer.update
public function update($iCustomerId, array $aData = []): bool { try { $sKeyExistsLabel = array_key_exists('label', $aData); $sKeyExistsOrg = array_key_exists('organisation', $aData); $sKeyExistsFirst = array_key_exists('first_name', $aData); $sKeyExistsLast...
php
public function update($iCustomerId, array $aData = []): bool { try { $sKeyExistsLabel = array_key_exists('label', $aData); $sKeyExistsOrg = array_key_exists('organisation', $aData); $sKeyExistsFirst = array_key_exists('first_name', $aData); $sKeyExistsLast...
[ "public", "function", "update", "(", "$", "iCustomerId", ",", "array", "$", "aData", "=", "[", "]", ")", ":", "bool", "{", "try", "{", "$", "sKeyExistsLabel", "=", "array_key_exists", "(", "'label'", ",", "$", "aData", ")", ";", "$", "sKeyExistsOrg", "...
Update an existing customer @param integer $iCustomerId The ID of the customer to update @param array $aData The data to update the customer with @return mixed
[ "Update", "an", "existing", "customer" ]
3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716
https://github.com/nails/module-invoice/blob/3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716/src/Model/Customer.php#L123-L149
33,128
nails/module-invoice
src/Model/Customer.php
Customer.compileLabel
protected function compileLabel($aData) { if (!empty($aData['organisation'])) { return trim($aData['organisation']); } else { return implode( ' ', array_filter([ !empty($aData['first_name']) ? trim($aData['first_name']) : ''...
php
protected function compileLabel($aData) { if (!empty($aData['organisation'])) { return trim($aData['organisation']); } else { return implode( ' ', array_filter([ !empty($aData['first_name']) ? trim($aData['first_name']) : ''...
[ "protected", "function", "compileLabel", "(", "$", "aData", ")", "{", "if", "(", "!", "empty", "(", "$", "aData", "[", "'organisation'", "]", ")", ")", "{", "return", "trim", "(", "$", "aData", "[", "'organisation'", "]", ")", ";", "}", "else", "{", ...
Compile the customer label @param array $aData The data passed to create() or update() @return string
[ "Compile", "the", "customer", "label" ]
3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716
https://github.com/nails/module-invoice/blob/3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716/src/Model/Customer.php#L160-L173
33,129
doganoo/PHPUtil
src/Datatype/PasswordClass.php
PasswordClass.verify
public function verify($password): bool { if ($password instanceof StringClass || $password instanceof PasswordClass) { return password_verify($password->getValue(), $this->getValue()); } return password_verify($password, $this->getValue()); }
php
public function verify($password): bool { if ($password instanceof StringClass || $password instanceof PasswordClass) { return password_verify($password->getValue(), $this->getValue()); } return password_verify($password, $this->getValue()); }
[ "public", "function", "verify", "(", "$", "password", ")", ":", "bool", "{", "if", "(", "$", "password", "instanceof", "StringClass", "||", "$", "password", "instanceof", "PasswordClass", ")", "{", "return", "password_verify", "(", "$", "password", "->", "ge...
verifies the password @param $password @return bool
[ "verifies", "the", "password" ]
4415a014b4448b1ddf6d2e3f0f0d39cd1a83b8f5
https://github.com/doganoo/PHPUtil/blob/4415a014b4448b1ddf6d2e3f0f0d39cd1a83b8f5/src/Datatype/PasswordClass.php#L60-L65
33,130
QoboLtd/qobo-robo
src/Command/Project/DotenvDelete.php
DotenvDelete.projectDotenvDelete
public function projectDotenvDelete($envPath = '.env', $opts = ['force' => false]) { if (!$opts['force']) { $this->say(static::MSG_NO_DELETE); return false; } if (!file_exists($envPath)) { return true; } $result = $this->taskFilesystemStac...
php
public function projectDotenvDelete($envPath = '.env', $opts = ['force' => false]) { if (!$opts['force']) { $this->say(static::MSG_NO_DELETE); return false; } if (!file_exists($envPath)) { return true; } $result = $this->taskFilesystemStac...
[ "public", "function", "projectDotenvDelete", "(", "$", "envPath", "=", "'.env'", ",", "$", "opts", "=", "[", "'force'", "=>", "false", "]", ")", "{", "if", "(", "!", "$", "opts", "[", "'force'", "]", ")", "{", "$", "this", "->", "say", "(", "static...
Delete dotenv file @param string $envPath Path to dotenv file @option $force Force deletion @return bool true on success or false on failure
[ "Delete", "dotenv", "file" ]
ea10f778bb046ad41324d22b27fce5a2fb8915ce
https://github.com/QoboLtd/qobo-robo/blob/ea10f778bb046ad41324d22b27fce5a2fb8915ce/src/Command/Project/DotenvDelete.php#L26-L45
33,131
QoboLtd/qobo-robo
src/Utility/Dotenv.php
Dotenv.parse
public static function parse($dotenv, $data = [], $flags = self::FLAG_STRICT) { if (!is_array($dotenv)) { $dotenv = explode("\n", $dotenv); } $result = (!empty($data)) ? $data : []; // nothing to do with empty dotenv if (empty($dotenv)) { return $resu...
php
public static function parse($dotenv, $data = [], $flags = self::FLAG_STRICT) { if (!is_array($dotenv)) { $dotenv = explode("\n", $dotenv); } $result = (!empty($data)) ? $data : []; // nothing to do with empty dotenv if (empty($dotenv)) { return $resu...
[ "public", "static", "function", "parse", "(", "$", "dotenv", ",", "$", "data", "=", "[", "]", ",", "$", "flags", "=", "self", "::", "FLAG_STRICT", ")", "{", "if", "(", "!", "is_array", "(", "$", "dotenv", ")", ")", "{", "$", "dotenv", "=", "explo...
Parse dotenv content @param string|array string $dotenv Dotenv content @param array $data Any preset env variables @param int $flags Additianal flags for parsing @return array List of dotenv variables with their values
[ "Parse", "dotenv", "content" ]
ea10f778bb046ad41324d22b27fce5a2fb8915ce
https://github.com/QoboLtd/qobo-robo/blob/ea10f778bb046ad41324d22b27fce5a2fb8915ce/src/Utility/Dotenv.php#L50-L100
33,132
doganoo/PHPUtil
src/Util/AppContainer.php
AppContainer.getInstance
private static function getInstance(): HashMap { if (null === self::$map) { self::$map = new HashMap(); } return self::$map; }
php
private static function getInstance(): HashMap { if (null === self::$map) { self::$map = new HashMap(); } return self::$map; }
[ "private", "static", "function", "getInstance", "(", ")", ":", "HashMap", "{", "if", "(", "null", "===", "self", "::", "$", "map", ")", "{", "self", "::", "$", "map", "=", "new", "HashMap", "(", ")", ";", "}", "return", "self", "::", "$", "map", ...
returning the Map instance. @return HashMap
[ "returning", "the", "Map", "instance", "." ]
4415a014b4448b1ddf6d2e3f0f0d39cd1a83b8f5
https://github.com/doganoo/PHPUtil/blob/4415a014b4448b1ddf6d2e3f0f0d39cd1a83b8f5/src/Util/AppContainer.php#L74-L79
33,133
hackzilla/TicketBundle
Entity/Traits/TicketTrait.php
TicketTrait.setStatusString
public function setStatusString($status) { $status = \array_search(\strtolower($status), TicketMessageInterface::STATUSES); if ($status > 0) { $this->setStatus($status); } return $this; }
php
public function setStatusString($status) { $status = \array_search(\strtolower($status), TicketMessageInterface::STATUSES); if ($status > 0) { $this->setStatus($status); } return $this; }
[ "public", "function", "setStatusString", "(", "$", "status", ")", "{", "$", "status", "=", "\\", "array_search", "(", "\\", "strtolower", "(", "$", "status", ")", ",", "TicketMessageInterface", "::", "STATUSES", ")", ";", "if", "(", "$", "status", ">", "...
Set status string. @param string $status @return $this
[ "Set", "status", "string", "." ]
7bfd6c513979272a32bae582b7f96948605af459
https://github.com/hackzilla/TicketBundle/blob/7bfd6c513979272a32bae582b7f96948605af459/Entity/Traits/TicketTrait.php#L91-L100
33,134
hackzilla/TicketBundle
Entity/Traits/TicketTrait.php
TicketTrait.setPriorityString
public function setPriorityString($priority) { $priority = \array_search(\strtolower($priority), TicketMessageInterface::PRIORITIES); if ($priority > 0) { $this->setPriority($priority); } return $this; }
php
public function setPriorityString($priority) { $priority = \array_search(\strtolower($priority), TicketMessageInterface::PRIORITIES); if ($priority > 0) { $this->setPriority($priority); } return $this; }
[ "public", "function", "setPriorityString", "(", "$", "priority", ")", "{", "$", "priority", "=", "\\", "array_search", "(", "\\", "strtolower", "(", "$", "priority", ")", ",", "TicketMessageInterface", "::", "PRIORITIES", ")", ";", "if", "(", "$", "priority"...
Set priority string. @param string $priority @return $this
[ "Set", "priority", "string", "." ]
7bfd6c513979272a32bae582b7f96948605af459
https://github.com/hackzilla/TicketBundle/blob/7bfd6c513979272a32bae582b7f96948605af459/Entity/Traits/TicketTrait.php#L147-L156
33,135
hackzilla/TicketBundle
Entity/Traits/TicketTrait.php
TicketTrait.setUserCreated
public function setUserCreated($userCreated) { if (\is_object($userCreated)) { $this->userCreatedObject = $userCreated; $this->userCreated = $userCreated->getId(); } else { $this->userCreatedObject = null; $this->userCreated = $userCreated;...
php
public function setUserCreated($userCreated) { if (\is_object($userCreated)) { $this->userCreatedObject = $userCreated; $this->userCreated = $userCreated->getId(); } else { $this->userCreatedObject = null; $this->userCreated = $userCreated;...
[ "public", "function", "setUserCreated", "(", "$", "userCreated", ")", "{", "if", "(", "\\", "is_object", "(", "$", "userCreated", ")", ")", "{", "$", "this", "->", "userCreatedObject", "=", "$", "userCreated", ";", "$", "this", "->", "userCreated", "=", ...
Set userCreated. @param int|object $userCreated @return $this
[ "Set", "userCreated", "." ]
7bfd6c513979272a32bae582b7f96948605af459
https://github.com/hackzilla/TicketBundle/blob/7bfd6c513979272a32bae582b7f96948605af459/Entity/Traits/TicketTrait.php#L189-L200
33,136
hackzilla/TicketBundle
Entity/Traits/TicketTrait.php
TicketTrait.setLastUser
public function setLastUser($lastUser) { if (\is_object($lastUser)) { $this->lastUserObject = $lastUser; $this->lastUser = $lastUser->getId(); } else { $this->lastUserObject = null; $this->lastUser = $lastUser; } return $th...
php
public function setLastUser($lastUser) { if (\is_object($lastUser)) { $this->lastUserObject = $lastUser; $this->lastUser = $lastUser->getId(); } else { $this->lastUserObject = null; $this->lastUser = $lastUser; } return $th...
[ "public", "function", "setLastUser", "(", "$", "lastUser", ")", "{", "if", "(", "\\", "is_object", "(", "$", "lastUser", ")", ")", "{", "$", "this", "->", "lastUserObject", "=", "$", "lastUser", ";", "$", "this", "->", "lastUser", "=", "$", "lastUser",...
Set lastUser. @param int|object $lastUser @return $this
[ "Set", "lastUser", "." ]
7bfd6c513979272a32bae582b7f96948605af459
https://github.com/hackzilla/TicketBundle/blob/7bfd6c513979272a32bae582b7f96948605af459/Entity/Traits/TicketTrait.php#L229-L240
33,137
hackzilla/TicketBundle
Controller/TicketAttachmentController.php
TicketAttachmentController.downloadAction
public function downloadAction($ticketMessageId) { $ticketManager = $this->get('hackzilla_ticket.ticket_manager'); $ticketMessage = $ticketManager->getMessageById($ticketMessageId); if (!$ticketMessage || !$ticketMessage instanceof TicketMessageWithAttachment) { throw $this->cre...
php
public function downloadAction($ticketMessageId) { $ticketManager = $this->get('hackzilla_ticket.ticket_manager'); $ticketMessage = $ticketManager->getMessageById($ticketMessageId); if (!$ticketMessage || !$ticketMessage instanceof TicketMessageWithAttachment) { throw $this->cre...
[ "public", "function", "downloadAction", "(", "$", "ticketMessageId", ")", "{", "$", "ticketManager", "=", "$", "this", "->", "get", "(", "'hackzilla_ticket.ticket_manager'", ")", ";", "$", "ticketMessage", "=", "$", "ticketManager", "->", "getMessageById", "(", ...
Download attachment on message. @param int $ticketMessageId @return \Symfony\Component\HttpFoundation\Response
[ "Download", "attachment", "on", "message", "." ]
7bfd6c513979272a32bae582b7f96948605af459
https://github.com/hackzilla/TicketBundle/blob/7bfd6c513979272a32bae582b7f96948605af459/Controller/TicketAttachmentController.php#L22-L38
33,138
hackzilla/TicketBundle
Controller/TicketController.php
TicketController.indexAction
public function indexAction(Request $request) { $userManager = $this->getUserManager(); $ticketManager = $this->get('hackzilla_ticket.ticket_manager'); $ticketState = $request->get('state', $this->get('translator')->trans('STATUS_OPEN', [], 'HackzillaTicketBundle')); $ticketPri...
php
public function indexAction(Request $request) { $userManager = $this->getUserManager(); $ticketManager = $this->get('hackzilla_ticket.ticket_manager'); $ticketState = $request->get('state', $this->get('translator')->trans('STATUS_OPEN', [], 'HackzillaTicketBundle')); $ticketPri...
[ "public", "function", "indexAction", "(", "Request", "$", "request", ")", "{", "$", "userManager", "=", "$", "this", "->", "getUserManager", "(", ")", ";", "$", "ticketManager", "=", "$", "this", "->", "get", "(", "'hackzilla_ticket.ticket_manager'", ")", ";...
Lists all Ticket entities. @param Request $request @return \Symfony\Component\HttpFoundation\Response
[ "Lists", "all", "Ticket", "entities", "." ]
7bfd6c513979272a32bae582b7f96948605af459
https://github.com/hackzilla/TicketBundle/blob/7bfd6c513979272a32bae582b7f96948605af459/Controller/TicketController.php#L28-L56
33,139
hackzilla/TicketBundle
Controller/TicketController.php
TicketController.createAction
public function createAction(Request $request) { $ticketManager = $this->get('hackzilla_ticket.ticket_manager'); $ticket = $ticketManager->createTicket(); $form = $this->createForm(TicketType::class, $ticket); $form->handleRequest($request); if ($form->isValid()) { ...
php
public function createAction(Request $request) { $ticketManager = $this->get('hackzilla_ticket.ticket_manager'); $ticket = $ticketManager->createTicket(); $form = $this->createForm(TicketType::class, $ticket); $form->handleRequest($request); if ($form->isValid()) { ...
[ "public", "function", "createAction", "(", "Request", "$", "request", ")", "{", "$", "ticketManager", "=", "$", "this", "->", "get", "(", "'hackzilla_ticket.ticket_manager'", ")", ";", "$", "ticket", "=", "$", "ticketManager", "->", "createTicket", "(", ")", ...
Creates a new Ticket entity. @param Request $request @return \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response
[ "Creates", "a", "new", "Ticket", "entity", "." ]
7bfd6c513979272a32bae582b7f96948605af459
https://github.com/hackzilla/TicketBundle/blob/7bfd6c513979272a32bae582b7f96948605af459/Controller/TicketController.php#L65-L91
33,140
hackzilla/TicketBundle
Controller/TicketController.php
TicketController.newAction
public function newAction() { $ticketManager = $this->get('hackzilla_ticket.ticket_manager'); $entity = $ticketManager->createTicket(); $form = $this->createForm(TicketType::class, $entity); return $this->render( $this->container->getParameter('hackzilla_ticket.t...
php
public function newAction() { $ticketManager = $this->get('hackzilla_ticket.ticket_manager'); $entity = $ticketManager->createTicket(); $form = $this->createForm(TicketType::class, $entity); return $this->render( $this->container->getParameter('hackzilla_ticket.t...
[ "public", "function", "newAction", "(", ")", "{", "$", "ticketManager", "=", "$", "this", "->", "get", "(", "'hackzilla_ticket.ticket_manager'", ")", ";", "$", "entity", "=", "$", "ticketManager", "->", "createTicket", "(", ")", ";", "$", "form", "=", "$",...
Displays a form to create a new Ticket entity.
[ "Displays", "a", "form", "to", "create", "a", "new", "Ticket", "entity", "." ]
7bfd6c513979272a32bae582b7f96948605af459
https://github.com/hackzilla/TicketBundle/blob/7bfd6c513979272a32bae582b7f96948605af459/Controller/TicketController.php#L96-L110
33,141
hackzilla/TicketBundle
Controller/TicketController.php
TicketController.deleteAction
public function deleteAction(Request $request, $ticketId) { $userManager = $this->getUserManager(); $user = $userManager->getCurrentUser(); if (!\is_object($user) || !$userManager->hasRole($user, TicketRole::ADMIN)) { throw new \Symfony\Component\HttpKernel\Exception\Http...
php
public function deleteAction(Request $request, $ticketId) { $userManager = $this->getUserManager(); $user = $userManager->getCurrentUser(); if (!\is_object($user) || !$userManager->hasRole($user, TicketRole::ADMIN)) { throw new \Symfony\Component\HttpKernel\Exception\Http...
[ "public", "function", "deleteAction", "(", "Request", "$", "request", ",", "$", "ticketId", ")", "{", "$", "userManager", "=", "$", "this", "->", "getUserManager", "(", ")", ";", "$", "user", "=", "$", "userManager", "->", "getCurrentUser", "(", ")", ";"...
Deletes a Ticket entity. @param Request $request @param int $ticketId @return \Symfony\Component\HttpFoundation\RedirectResponse
[ "Deletes", "a", "Ticket", "entity", "." ]
7bfd6c513979272a32bae582b7f96948605af459
https://github.com/hackzilla/TicketBundle/blob/7bfd6c513979272a32bae582b7f96948605af459/Controller/TicketController.php#L196-L224
33,142
hackzilla/TicketBundle
Manager/TicketManager.php
TicketManager.createTicket
public function createTicket() { /* @var TicketInterface $ticket */ $ticket = new $this->ticketClass(); $ticket->setPriority(TicketMessageInterface::PRIORITY_MEDIUM); $ticket->setStatus(TicketMessageInterface::STATUS_OPEN); return $ticket; }
php
public function createTicket() { /* @var TicketInterface $ticket */ $ticket = new $this->ticketClass(); $ticket->setPriority(TicketMessageInterface::PRIORITY_MEDIUM); $ticket->setStatus(TicketMessageInterface::STATUS_OPEN); return $ticket; }
[ "public", "function", "createTicket", "(", ")", "{", "/* @var TicketInterface $ticket */", "$", "ticket", "=", "new", "$", "this", "->", "ticketClass", "(", ")", ";", "$", "ticket", "->", "setPriority", "(", "TicketMessageInterface", "::", "PRIORITY_MEDIUM", ")", ...
Create a new instance of Ticket entity. @return TicketInterface
[ "Create", "a", "new", "instance", "of", "Ticket", "entity", "." ]
7bfd6c513979272a32bae582b7f96948605af459
https://github.com/hackzilla/TicketBundle/blob/7bfd6c513979272a32bae582b7f96948605af459/Manager/TicketManager.php#L69-L77
33,143
hackzilla/TicketBundle
Entity/Traits/TicketMessageTrait.php
TicketMessageTrait.setTicket
public function setTicket(TicketInterface $ticket = null) { $this->ticket = $ticket; if (\is_null($this->getUserObject())) { $user = $this->getUser(); } else { $user = $this->getUserObject(); } // if null, then new ticket if (\is_null($ticket...
php
public function setTicket(TicketInterface $ticket = null) { $this->ticket = $ticket; if (\is_null($this->getUserObject())) { $user = $this->getUser(); } else { $user = $this->getUserObject(); } // if null, then new ticket if (\is_null($ticket...
[ "public", "function", "setTicket", "(", "TicketInterface", "$", "ticket", "=", "null", ")", "{", "$", "this", "->", "ticket", "=", "$", "ticket", ";", "if", "(", "\\", "is_null", "(", "$", "this", "->", "getUserObject", "(", ")", ")", ")", "{", "$", ...
Set ticket. @param TicketInterface $ticket @return $this
[ "Set", "ticket", "." ]
7bfd6c513979272a32bae582b7f96948605af459
https://github.com/hackzilla/TicketBundle/blob/7bfd6c513979272a32bae582b7f96948605af459/Entity/Traits/TicketMessageTrait.php#L258-L285
33,144
goaop/parser-reflection
src/ReflectionFile.php
ReflectionFile.getFileNamespaces
public function getFileNamespaces() { if (!isset($this->fileNamespaces)) { $this->fileNamespaces = $this->findFileNamespaces(); } return $this->fileNamespaces; }
php
public function getFileNamespaces() { if (!isset($this->fileNamespaces)) { $this->fileNamespaces = $this->findFileNamespaces(); } return $this->fileNamespaces; }
[ "public", "function", "getFileNamespaces", "(", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "fileNamespaces", ")", ")", "{", "$", "this", "->", "fileNamespaces", "=", "$", "this", "->", "findFileNamespaces", "(", ")", ";", "}", "return", ...
Gets the list of namespaces in the file @return array|ReflectionFileNamespace[]
[ "Gets", "the", "list", "of", "namespaces", "in", "the", "file" ]
a71d0454ef8bfa416a39bbb7dd3ed497e063e54c
https://github.com/goaop/parser-reflection/blob/a71d0454ef8bfa416a39bbb7dd3ed497e063e54c/src/ReflectionFile.php#L87-L94
33,145
goaop/parser-reflection
src/ReflectionFile.php
ReflectionFile.isStrictMode
public function isStrictMode() { // declare statement for the strict_types can be only top-level node $topLevelNode = reset($this->topLevelNodes); if (!$topLevelNode instanceof Node\Stmt\Declare_) { return false; } $declareStatement = reset($topLevelNode->declare...
php
public function isStrictMode() { // declare statement for the strict_types can be only top-level node $topLevelNode = reset($this->topLevelNodes); if (!$topLevelNode instanceof Node\Stmt\Declare_) { return false; } $declareStatement = reset($topLevelNode->declare...
[ "public", "function", "isStrictMode", "(", ")", "{", "// declare statement for the strict_types can be only top-level node", "$", "topLevelNode", "=", "reset", "(", "$", "this", "->", "topLevelNodes", ")", ";", "if", "(", "!", "$", "topLevelNode", "instanceof", "Node"...
Checks if the current file is in strict mode @return bool
[ "Checks", "if", "the", "current", "file", "is", "in", "strict", "mode" ]
a71d0454ef8bfa416a39bbb7dd3ed497e063e54c
https://github.com/goaop/parser-reflection/blob/a71d0454ef8bfa416a39bbb7dd3ed497e063e54c/src/ReflectionFile.php#L135-L149
33,146
goaop/parser-reflection
src/ReflectionFile.php
ReflectionFile.findFileNamespaces
private function findFileNamespaces() { $namespaces = array(); // namespaces can be only top-level nodes, so we can scan them directly foreach ($this->topLevelNodes as $topLevelNode) { if ($topLevelNode instanceof Namespace_) { $namespaceName = $topLevelNode->nam...
php
private function findFileNamespaces() { $namespaces = array(); // namespaces can be only top-level nodes, so we can scan them directly foreach ($this->topLevelNodes as $topLevelNode) { if ($topLevelNode instanceof Namespace_) { $namespaceName = $topLevelNode->nam...
[ "private", "function", "findFileNamespaces", "(", ")", "{", "$", "namespaces", "=", "array", "(", ")", ";", "// namespaces can be only top-level nodes, so we can scan them directly", "foreach", "(", "$", "this", "->", "topLevelNodes", "as", "$", "topLevelNode", ")", "...
Searches for file namespaces in the given AST @return array|ReflectionFileNamespace[]
[ "Searches", "for", "file", "namespaces", "in", "the", "given", "AST" ]
a71d0454ef8bfa416a39bbb7dd3ed497e063e54c
https://github.com/goaop/parser-reflection/blob/a71d0454ef8bfa416a39bbb7dd3ed497e063e54c/src/ReflectionFile.php#L156-L174
33,147
majkel89/dbase
benchmarks/TransactionalUpdateBenchmark.php
TransactionalUpdateBenchmark.setUp
public function setUp() { $this->sourceTable->next(); $this->currentIndex = $this->sourceTable->key(); $this->currentField = $this->sourceTable->current(); }
php
public function setUp() { $this->sourceTable->next(); $this->currentIndex = $this->sourceTable->key(); $this->currentField = $this->sourceTable->current(); }
[ "public", "function", "setUp", "(", ")", "{", "$", "this", "->", "sourceTable", "->", "next", "(", ")", ";", "$", "this", "->", "currentIndex", "=", "$", "this", "->", "sourceTable", "->", "key", "(", ")", ";", "$", "this", "->", "currentField", "=",...
Fetch new record
[ "Fetch", "new", "record" ]
483f27e83bae5323817c26aa297d923a4231dd6f
https://github.com/majkel89/dbase/blob/483f27e83bae5323817c26aa297d923a4231dd6f/benchmarks/TransactionalUpdateBenchmark.php#L56-L60
33,148
majkel89/dbase
src/FormatFactory.php
FormatFactory.getFormat
public function getFormat($name, $filePath, $mode) { $formats = $this->getFormats(); if (!isset($formats[$name])) { throw new Exception("Format `$name` is not registered"); } if (!is_callable($formats[$name])) { throw new Exception("Cannot generate format `$name`"...
php
public function getFormat($name, $filePath, $mode) { $formats = $this->getFormats(); if (!isset($formats[$name])) { throw new Exception("Format `$name` is not registered"); } if (!is_callable($formats[$name])) { throw new Exception("Cannot generate format `$name`"...
[ "public", "function", "getFormat", "(", "$", "name", ",", "$", "filePath", ",", "$", "mode", ")", "{", "$", "formats", "=", "$", "this", "->", "getFormats", "(", ")", ";", "if", "(", "!", "isset", "(", "$", "formats", "[", "$", "name", "]", ")", ...
Returns new format object @param string $name @param string $filePath @param integer $mode @return \org\majkel\dbase\Format @throws Exception
[ "Returns", "new", "format", "object" ]
483f27e83bae5323817c26aa297d923a4231dd6f
https://github.com/majkel89/dbase/blob/483f27e83bae5323817c26aa297d923a4231dd6f/src/FormatFactory.php#L35-L48
33,149
goaop/parser-reflection
src/ReflectionParameter.php
ReflectionParameter.haveSiblingsDefalutValues
protected function haveSiblingsDefalutValues() { $function = $this->getDeclaringFunction(); if (null === $function) { throw new ReflectionException('Could not get the declaring function reflection.'); } /** @var \ReflectionParameter[] $remainingParameters */ $rem...
php
protected function haveSiblingsDefalutValues() { $function = $this->getDeclaringFunction(); if (null === $function) { throw new ReflectionException('Could not get the declaring function reflection.'); } /** @var \ReflectionParameter[] $remainingParameters */ $rem...
[ "protected", "function", "haveSiblingsDefalutValues", "(", ")", "{", "$", "function", "=", "$", "this", "->", "getDeclaringFunction", "(", ")", ";", "if", "(", "null", "===", "$", "function", ")", "{", "throw", "new", "ReflectionException", "(", "'Could not ge...
Returns if all following parameters have a default value definition. @return bool @throws ReflectionException If could not fetch declaring function reflection
[ "Returns", "if", "all", "following", "parameters", "have", "a", "default", "value", "definition", "." ]
a71d0454ef8bfa416a39bbb7dd3ed497e063e54c
https://github.com/goaop/parser-reflection/blob/a71d0454ef8bfa416a39bbb7dd3ed497e063e54c/src/ReflectionParameter.php#L381-L397
33,150
goaop/parser-reflection
src/ReflectionProperty.php
ReflectionProperty.collectFromClassNode
public static function collectFromClassNode(ClassLike $classLikeNode, $fullClassName) { $properties = []; foreach ($classLikeNode->stmts as $classLevelNode) { if ($classLevelNode instanceof Property) { foreach ($classLevelNode->props as $classPropertyNode) { ...
php
public static function collectFromClassNode(ClassLike $classLikeNode, $fullClassName) { $properties = []; foreach ($classLikeNode->stmts as $classLevelNode) { if ($classLevelNode instanceof Property) { foreach ($classLevelNode->props as $classPropertyNode) { ...
[ "public", "static", "function", "collectFromClassNode", "(", "ClassLike", "$", "classLikeNode", ",", "$", "fullClassName", ")", "{", "$", "properties", "=", "[", "]", ";", "foreach", "(", "$", "classLikeNode", "->", "stmts", "as", "$", "classLevelNode", ")", ...
Parses properties from the concrete class node @param ClassLike $classLikeNode Class-like node @param string $fullClassName FQN of the class @return array|ReflectionProperty[]
[ "Parses", "properties", "from", "the", "concrete", "class", "node" ]
a71d0454ef8bfa416a39bbb7dd3ed497e063e54c
https://github.com/goaop/parser-reflection/blob/a71d0454ef8bfa416a39bbb7dd3ed497e063e54c/src/ReflectionProperty.php#L259-L278
33,151
majkel89/dbase
src/Record.php
Record.getMemoEntryId
public function getMemoEntryId($name) { return isset($this->memoEntries[$name]) ? $this->memoEntries[$name] : null; }
php
public function getMemoEntryId($name) { return isset($this->memoEntries[$name]) ? $this->memoEntries[$name] : null; }
[ "public", "function", "getMemoEntryId", "(", "$", "name", ")", "{", "return", "isset", "(", "$", "this", "->", "memoEntries", "[", "$", "name", "]", ")", "?", "$", "this", "->", "memoEntries", "[", "$", "name", "]", ":", "null", ";", "}" ]
Retrieves entity id for memo value @param string $name memo field name @return integer|null entity id @internal
[ "Retrieves", "entity", "id", "for", "memo", "value" ]
483f27e83bae5323817c26aa297d923a4231dd6f
https://github.com/majkel89/dbase/blob/483f27e83bae5323817c26aa297d923a4231dd6f/src/Record.php#L80-L82
33,152
majkel89/dbase
src/Table.php
Table.update
public function update($index, $data) { if (!$data instanceof Record) { $data = new Record(Utils::toArray($data)); } $this->getFormat()->update($index, $data); // update buffer to reflect current changes if (isset($this->buffer[$index])) { $this->buffer[$i...
php
public function update($index, $data) { if (!$data instanceof Record) { $data = new Record(Utils::toArray($data)); } $this->getFormat()->update($index, $data); // update buffer to reflect current changes if (isset($this->buffer[$index])) { $this->buffer[$i...
[ "public", "function", "update", "(", "$", "index", ",", "$", "data", ")", "{", "if", "(", "!", "$", "data", "instanceof", "Record", ")", "{", "$", "data", "=", "new", "Record", "(", "Utils", "::", "toArray", "(", "$", "data", ")", ")", ";", "}", ...
Stores record in database @param integer $index @param \org\majkel\dbase\Record|\Traversable|array $data @return void @throws Exception
[ "Stores", "record", "in", "database" ]
483f27e83bae5323817c26aa297d923a4231dd6f
https://github.com/majkel89/dbase/blob/483f27e83bae5323817c26aa297d923a4231dd6f/src/Table.php#L113-L122
33,153
majkel89/dbase
src/Table.php
Table.insert
public function insert($data) { if ($data instanceof Record) { $data = clone $data; } else { $data = new Record(Utils::toArray($data)); } return $this->getFormat()->insert($data); }
php
public function insert($data) { if ($data instanceof Record) { $data = clone $data; } else { $data = new Record(Utils::toArray($data)); } return $this->getFormat()->insert($data); }
[ "public", "function", "insert", "(", "$", "data", ")", "{", "if", "(", "$", "data", "instanceof", "Record", ")", "{", "$", "data", "=", "clone", "$", "data", ";", "}", "else", "{", "$", "data", "=", "new", "Record", "(", "Utils", "::", "toArray", ...
Adds new record to database @param \org\majkel\dbase\Record|\Traversable|array $data @return integer index of new record @throws Exception
[ "Adds", "new", "record", "to", "database" ]
483f27e83bae5323817c26aa297d923a4231dd6f
https://github.com/majkel89/dbase/blob/483f27e83bae5323817c26aa297d923a4231dd6f/src/Table.php#L130-L137
33,154
majkel89/dbase
src/Table.php
Table.getRecord
public function getRecord($index) { if (!$this->isValid()) { throw new Exception('File is not opened', Exception::FILE_NOT_OPENED); } if (!$this->offsetExists($index)) { throw new Exception('Offset '.strval($index).' does not exists', Exception::INVALID_OFFSET); }...
php
public function getRecord($index) { if (!$this->isValid()) { throw new Exception('File is not opened', Exception::FILE_NOT_OPENED); } if (!$this->offsetExists($index)) { throw new Exception('Offset '.strval($index).' does not exists', Exception::INVALID_OFFSET); }...
[ "public", "function", "getRecord", "(", "$", "index", ")", "{", "if", "(", "!", "$", "this", "->", "isValid", "(", ")", ")", "{", "throw", "new", "Exception", "(", "'File is not opened'", ",", "Exception", "::", "FILE_NOT_OPENED", ")", ";", "}", "if", ...
Reads record from table @param integer $index @return \org\majkel\dbase\Record @throws \org\majkel\dbase\Exception
[ "Reads", "record", "from", "table" ]
483f27e83bae5323817c26aa297d923a4231dd6f
https://github.com/majkel89/dbase/blob/483f27e83bae5323817c26aa297d923a4231dd6f/src/Table.php#L193-L205
33,155
goaop/parser-reflection
src/ReflectionType.php
ReflectionType.convertToDisplayType
public static function convertToDisplayType(\ReflectionType $type) { static $typeMap = [ 'int' => 'integer', 'bool' => 'boolean' ]; $displayType = (string)$type; if (isset($typeMap[$displayType])) { $displayType = $typeMap[$displayType]; }...
php
public static function convertToDisplayType(\ReflectionType $type) { static $typeMap = [ 'int' => 'integer', 'bool' => 'boolean' ]; $displayType = (string)$type; if (isset($typeMap[$displayType])) { $displayType = $typeMap[$displayType]; }...
[ "public", "static", "function", "convertToDisplayType", "(", "\\", "ReflectionType", "$", "type", ")", "{", "static", "$", "typeMap", "=", "[", "'int'", "=>", "'integer'", ",", "'bool'", "=>", "'boolean'", "]", ";", "$", "displayType", "=", "(", "string", ...
PHP reflection has it's own rules, so 'int' type will be displayed as 'integer', etc... @see https://3v4l.org/nZFiT @param ReflectionType $type Type to display @return string
[ "PHP", "reflection", "has", "it", "s", "own", "rules", "so", "int", "type", "will", "be", "displayed", "as", "integer", "etc", "..." ]
a71d0454ef8bfa416a39bbb7dd3ed497e063e54c
https://github.com/goaop/parser-reflection/blob/a71d0454ef8bfa416a39bbb7dd3ed497e063e54c/src/ReflectionType.php#L82-L100
33,156
goaop/parser-reflection
src/Traits/ReflectionClassLikeTrait.php
ReflectionClassLikeTrait.getMethods
public function getMethods($filter = null) { if (!isset($this->methods)) { $directMethods = ReflectionMethod::collectFromClassNode($this->classLikeNode, $this); $parentMethods = $this->recursiveCollect(function (array &$result, \ReflectionClass $instance, $isParent) { ...
php
public function getMethods($filter = null) { if (!isset($this->methods)) { $directMethods = ReflectionMethod::collectFromClassNode($this->classLikeNode, $this); $parentMethods = $this->recursiveCollect(function (array &$result, \ReflectionClass $instance, $isParent) { ...
[ "public", "function", "getMethods", "(", "$", "filter", "=", "null", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "methods", ")", ")", "{", "$", "directMethods", "=", "ReflectionMethod", "::", "collectFromClassNode", "(", "$", "this", "->",...
Returns list of reflection methods @param null|integer $filter Optional filter @return array|\ReflectionMethod[]
[ "Returns", "list", "of", "reflection", "methods" ]
a71d0454ef8bfa416a39bbb7dd3ed497e063e54c
https://github.com/goaop/parser-reflection/blob/a71d0454ef8bfa416a39bbb7dd3ed497e063e54c/src/Traits/ReflectionClassLikeTrait.php#L346-L376
33,157
goaop/parser-reflection
src/Traits/ReflectionClassLikeTrait.php
ReflectionClassLikeTrait.getModifiers
public function getModifiers() { $modifiers = 0; if ($this->isFinal()) { $modifiers += \ReflectionClass::IS_FINAL; } if (PHP_VERSION_ID < 70000 && $this->isTrait()) { $modifiers += \ReflectionClass::IS_EXPLICIT_ABSTRACT; } if ($this->classLi...
php
public function getModifiers() { $modifiers = 0; if ($this->isFinal()) { $modifiers += \ReflectionClass::IS_FINAL; } if (PHP_VERSION_ID < 70000 && $this->isTrait()) { $modifiers += \ReflectionClass::IS_EXPLICIT_ABSTRACT; } if ($this->classLi...
[ "public", "function", "getModifiers", "(", ")", "{", "$", "modifiers", "=", "0", ";", "if", "(", "$", "this", "->", "isFinal", "(", ")", ")", "{", "$", "modifiers", "+=", "\\", "ReflectionClass", "::", "IS_FINAL", ";", "}", "if", "(", "PHP_VERSION_ID",...
Returns a bitfield of the access modifiers for this class. @link http://php.net/manual/en/reflectionclass.getmodifiers.php NB: this method is not fully compatible with original value because of hidden internal constants @return int
[ "Returns", "a", "bitfield", "of", "the", "access", "modifiers", "for", "this", "class", "." ]
a71d0454ef8bfa416a39bbb7dd3ed497e063e54c
https://github.com/goaop/parser-reflection/blob/a71d0454ef8bfa416a39bbb7dd3ed497e063e54c/src/Traits/ReflectionClassLikeTrait.php#L387-L413
33,158
goaop/parser-reflection
src/Traits/ReflectionClassLikeTrait.php
ReflectionClassLikeTrait.getProperties
public function getProperties($filter = null) { if (!isset($this->properties)) { $directProperties = ReflectionProperty::collectFromClassNode($this->classLikeNode, $this->getName()); $parentProperties = $this->recursiveCollect(function (array &$result, \ReflectionClass $instance, $is...
php
public function getProperties($filter = null) { if (!isset($this->properties)) { $directProperties = ReflectionProperty::collectFromClassNode($this->classLikeNode, $this->getName()); $parentProperties = $this->recursiveCollect(function (array &$result, \ReflectionClass $instance, $is...
[ "public", "function", "getProperties", "(", "$", "filter", "=", "null", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "properties", ")", ")", "{", "$", "directProperties", "=", "ReflectionProperty", "::", "collectFromClassNode", "(", "$", "thi...
Retrieves reflected properties. @param int $filter The optional filter, for filtering desired property types. It's configured using the ReflectionProperty constants, and defaults to all property types. @return array|\Go\ParserReflection\ReflectionProperty[]
[ "Retrieves", "reflected", "properties", "." ]
a71d0454ef8bfa416a39bbb7dd3ed497e063e54c
https://github.com/goaop/parser-reflection/blob/a71d0454ef8bfa416a39bbb7dd3ed497e063e54c/src/Traits/ReflectionClassLikeTrait.php#L462-L494
33,159
goaop/parser-reflection
src/Traits/ReflectionClassLikeTrait.php
ReflectionClassLikeTrait.getTraitAliases
public function getTraitAliases() { $aliases = []; $traits = $this->getTraits(); foreach ($this->traitAdaptations as $adaptation) { if ($adaptation instanceof TraitUseAdaptation\Alias) { $methodName = $adaptation->method; $traitName = null; ...
php
public function getTraitAliases() { $aliases = []; $traits = $this->getTraits(); foreach ($this->traitAdaptations as $adaptation) { if ($adaptation instanceof TraitUseAdaptation\Alias) { $methodName = $adaptation->method; $traitName = null; ...
[ "public", "function", "getTraitAliases", "(", ")", "{", "$", "aliases", "=", "[", "]", ";", "$", "traits", "=", "$", "this", "->", "getTraits", "(", ")", ";", "foreach", "(", "$", "this", "->", "traitAdaptations", "as", "$", "adaptation", ")", "{", "...
Returns an array of trait aliases @link http://php.net/manual/en/reflectionclass.gettraitaliases.php @return array|null an array with new method names in keys and original names (in the format "TraitName::original") in values.
[ "Returns", "an", "array", "of", "trait", "aliases" ]
a71d0454ef8bfa416a39bbb7dd3ed497e063e54c
https://github.com/goaop/parser-reflection/blob/a71d0454ef8bfa416a39bbb7dd3ed497e063e54c/src/Traits/ReflectionClassLikeTrait.php#L532-L551
33,160
goaop/parser-reflection
src/Traits/ReflectionClassLikeTrait.php
ReflectionClassLikeTrait.getTraits
public function getTraits() { if (!isset($this->traits)) { $traitAdaptations = []; $this->traits = ReflectionClass::collectTraitsFromClassNode($this->classLikeNode, $traitAdaptations); $this->traitAdaptations = $traitAdaptations; } return $this->trait...
php
public function getTraits() { if (!isset($this->traits)) { $traitAdaptations = []; $this->traits = ReflectionClass::collectTraitsFromClassNode($this->classLikeNode, $traitAdaptations); $this->traitAdaptations = $traitAdaptations; } return $this->trait...
[ "public", "function", "getTraits", "(", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "traits", ")", ")", "{", "$", "traitAdaptations", "=", "[", "]", ";", "$", "this", "->", "traits", "=", "ReflectionClass", "::", "collectTraitsFromClassNod...
Returns an array of traits used by this class @link http://php.net/manual/en/reflectionclass.gettraits.php @return array|\ReflectionClass[]
[ "Returns", "an", "array", "of", "traits", "used", "by", "this", "class" ]
a71d0454ef8bfa416a39bbb7dd3ed497e063e54c
https://github.com/goaop/parser-reflection/blob/a71d0454ef8bfa416a39bbb7dd3ed497e063e54c/src/Traits/ReflectionClassLikeTrait.php#L572-L581
33,161
goaop/parser-reflection
src/Traits/ReflectionClassLikeTrait.php
ReflectionClassLikeTrait.getStaticProperties
public function getStaticProperties() { // In runtime static properties can be changed in any time if ($this->isInitialized()) { return parent::getStaticProperties(); } $properties = []; $reflectionProperties = $this->getProperties(ReflectionProperty::IS_STATIC)...
php
public function getStaticProperties() { // In runtime static properties can be changed in any time if ($this->isInitialized()) { return parent::getStaticProperties(); } $properties = []; $reflectionProperties = $this->getProperties(ReflectionProperty::IS_STATIC)...
[ "public", "function", "getStaticProperties", "(", ")", "{", "// In runtime static properties can be changed in any time", "if", "(", "$", "this", "->", "isInitialized", "(", ")", ")", "{", "return", "parent", "::", "getStaticProperties", "(", ")", ";", "}", "$", "...
Gets static properties @link http://php.net/manual/en/reflectionclass.getstaticproperties.php @return array
[ "Gets", "static", "properties" ]
a71d0454ef8bfa416a39bbb7dd3ed497e063e54c
https://github.com/goaop/parser-reflection/blob/a71d0454ef8bfa416a39bbb7dd3ed497e063e54c/src/Traits/ReflectionClassLikeTrait.php#L799-L819
33,162
goaop/parser-reflection
src/Traits/ReflectionClassLikeTrait.php
ReflectionClassLikeTrait.getStaticPropertyValue
public function getStaticPropertyValue($name, $default = null) { $properties = $this->getStaticProperties(); $propertyExists = array_key_exists($name, $properties); if (!$propertyExists && func_num_args() === 1) { throw new ReflectionException("Static property does not exist...
php
public function getStaticPropertyValue($name, $default = null) { $properties = $this->getStaticProperties(); $propertyExists = array_key_exists($name, $properties); if (!$propertyExists && func_num_args() === 1) { throw new ReflectionException("Static property does not exist...
[ "public", "function", "getStaticPropertyValue", "(", "$", "name", ",", "$", "default", "=", "null", ")", "{", "$", "properties", "=", "$", "this", "->", "getStaticProperties", "(", ")", ";", "$", "propertyExists", "=", "array_key_exists", "(", "$", "name", ...
Gets static property value @param string $name The name of the static property for which to return a value. @param mixed $default A default value to return in case the class does not declare a static property with the given name @return mixed @throws ReflectionException If there is no such property and no default...
[ "Gets", "static", "property", "value" ]
a71d0454ef8bfa416a39bbb7dd3ed497e063e54c
https://github.com/goaop/parser-reflection/blob/a71d0454ef8bfa416a39bbb7dd3ed497e063e54c/src/Traits/ReflectionClassLikeTrait.php#L831-L841
33,163
goaop/parser-reflection
src/Traits/ReflectionClassLikeTrait.php
ReflectionClassLikeTrait.newInstance
public function newInstance($arg = null, ...$args) { $args = array_slice(array_merge([$arg], $args), 0, \func_num_args()); $this->initializeInternalReflection(); return parent::newInstance(...$args); }
php
public function newInstance($arg = null, ...$args) { $args = array_slice(array_merge([$arg], $args), 0, \func_num_args()); $this->initializeInternalReflection(); return parent::newInstance(...$args); }
[ "public", "function", "newInstance", "(", "$", "arg", "=", "null", ",", "...", "$", "args", ")", "{", "$", "args", "=", "array_slice", "(", "array_merge", "(", "[", "$", "arg", "]", ",", "$", "args", ")", ",", "0", ",", "\\", "func_num_args", "(", ...
Creates a new class instance from given arguments. @link http://php.net/manual/en/reflectionclass.newinstance.php Signature was hacked to support both 5.6, 7.1.x and 7.2.0 versions @see https://3v4l.org/hW9O9 @see https://3v4l.org/sWT3j @see https://3v4l.org/eeVf8 @param mixed $arg First argument @param mixed $args ...
[ "Creates", "a", "new", "class", "instance", "from", "given", "arguments", "." ]
a71d0454ef8bfa416a39bbb7dd3ed497e063e54c
https://github.com/goaop/parser-reflection/blob/a71d0454ef8bfa416a39bbb7dd3ed497e063e54c/src/Traits/ReflectionClassLikeTrait.php#L859-L865
33,164
goaop/parser-reflection
src/Traits/ReflectionClassLikeTrait.php
ReflectionClassLikeTrait.collectSelfConstants
private function collectSelfConstants() { $expressionSolver = new NodeExpressionResolver($this); $localConstants = []; // constants can be only top-level nodes in the class, so we can scan them directly foreach ($this->classLikeNode->stmts as $classLevelNode) { if ($cl...
php
private function collectSelfConstants() { $expressionSolver = new NodeExpressionResolver($this); $localConstants = []; // constants can be only top-level nodes in the class, so we can scan them directly foreach ($this->classLikeNode->stmts as $classLevelNode) { if ($cl...
[ "private", "function", "collectSelfConstants", "(", ")", "{", "$", "expressionSolver", "=", "new", "NodeExpressionResolver", "(", "$", "this", ")", ";", "$", "localConstants", "=", "[", "]", ";", "// constants can be only top-level nodes in the class, so we can scan them ...
Collects list of constants from the class itself
[ "Collects", "list", "of", "constants", "from", "the", "class", "itself" ]
a71d0454ef8bfa416a39bbb7dd3ed497e063e54c
https://github.com/goaop/parser-reflection/blob/a71d0454ef8bfa416a39bbb7dd3ed497e063e54c/src/Traits/ReflectionClassLikeTrait.php#L940-L958
33,165
goaop/parser-reflection
src/ReflectionMethod.php
ReflectionMethod.collectFromClassNode
public static function collectFromClassNode(ClassLike $classLikeNode, ReflectionClass $reflectionClass) { $methods = []; foreach ($classLikeNode->stmts as $classLevelNode) { if ($classLevelNode instanceof ClassMethod) { $classLevelNode->setAttribute('fileName', $classLik...
php
public static function collectFromClassNode(ClassLike $classLikeNode, ReflectionClass $reflectionClass) { $methods = []; foreach ($classLikeNode->stmts as $classLevelNode) { if ($classLevelNode instanceof ClassMethod) { $classLevelNode->setAttribute('fileName', $classLik...
[ "public", "static", "function", "collectFromClassNode", "(", "ClassLike", "$", "classLikeNode", ",", "ReflectionClass", "$", "reflectionClass", ")", "{", "$", "methods", "=", "[", "]", ";", "foreach", "(", "$", "classLikeNode", "->", "stmts", "as", "$", "class...
Parses methods from the concrete class node @param ClassLike $classLikeNode Class-like node @param ReflectionClass $reflectionClass Reflection of the class @return array|ReflectionMethod[]
[ "Parses", "methods", "from", "the", "concrete", "class", "node" ]
a71d0454ef8bfa416a39bbb7dd3ed497e063e54c
https://github.com/goaop/parser-reflection/blob/a71d0454ef8bfa416a39bbb7dd3ed497e063e54c/src/ReflectionMethod.php#L304-L323
33,166
goaop/parser-reflection
src/ReflectionFileNamespace.php
ReflectionFileNamespace.getClasses
public function getClasses() { if (!isset($this->fileClasses)) { $this->fileClasses = $this->findClasses(); } return $this->fileClasses; }
php
public function getClasses() { if (!isset($this->fileClasses)) { $this->fileClasses = $this->findClasses(); } return $this->fileClasses; }
[ "public", "function", "getClasses", "(", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "fileClasses", ")", ")", "{", "$", "this", "->", "fileClasses", "=", "$", "this", "->", "findClasses", "(", ")", ";", "}", "return", "$", "this", "-...
Gets list of classes in the namespace @return ReflectionClass[]|array
[ "Gets", "list", "of", "classes", "in", "the", "namespace" ]
a71d0454ef8bfa416a39bbb7dd3ed497e063e54c
https://github.com/goaop/parser-reflection/blob/a71d0454ef8bfa416a39bbb7dd3ed497e063e54c/src/ReflectionFileNamespace.php#L125-L132
33,167
goaop/parser-reflection
src/ReflectionFileNamespace.php
ReflectionFileNamespace.getConstants
public function getConstants($withDefined = false) { if ($withDefined) { if (!isset($this->fileConstantsWithDefined)) { $this->fileConstantsWithDefined = $this->findConstants(true); } return $this->fileConstantsWithDefined; } if (!isset($...
php
public function getConstants($withDefined = false) { if ($withDefined) { if (!isset($this->fileConstantsWithDefined)) { $this->fileConstantsWithDefined = $this->findConstants(true); } return $this->fileConstantsWithDefined; } if (!isset($...
[ "public", "function", "getConstants", "(", "$", "withDefined", "=", "false", ")", "{", "if", "(", "$", "withDefined", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "fileConstantsWithDefined", ")", ")", "{", "$", "this", "->", "fileConstantsW...
Returns a list of defined constants in the namespace @param bool $withDefined Include constants defined via "define(...)" in results. @return array
[ "Returns", "a", "list", "of", "defined", "constants", "in", "the", "namespace" ]
a71d0454ef8bfa416a39bbb7dd3ed497e063e54c
https://github.com/goaop/parser-reflection/blob/a71d0454ef8bfa416a39bbb7dd3ed497e063e54c/src/ReflectionFileNamespace.php#L157-L172
33,168
goaop/parser-reflection
src/ReflectionFileNamespace.php
ReflectionFileNamespace.getDocComment
public function getDocComment() { $docComment = false; $comments = $this->namespaceNode->getAttribute('comments'); if ($comments) { $docComment = (string)$comments[0]; } return $docComment; }
php
public function getDocComment() { $docComment = false; $comments = $this->namespaceNode->getAttribute('comments'); if ($comments) { $docComment = (string)$comments[0]; } return $docComment; }
[ "public", "function", "getDocComment", "(", ")", "{", "$", "docComment", "=", "false", ";", "$", "comments", "=", "$", "this", "->", "namespaceNode", "->", "getAttribute", "(", "'comments'", ")", ";", "if", "(", "$", "comments", ")", "{", "$", "docCommen...
Gets doc comments from a class. @return string|false The doc comment if it exists, otherwise "false"
[ "Gets", "doc", "comments", "from", "a", "class", "." ]
a71d0454ef8bfa416a39bbb7dd3ed497e063e54c
https://github.com/goaop/parser-reflection/blob/a71d0454ef8bfa416a39bbb7dd3ed497e063e54c/src/ReflectionFileNamespace.php#L179-L189
33,169
goaop/parser-reflection
src/ReflectionFileNamespace.php
ReflectionFileNamespace.getFunctions
public function getFunctions() { if (!isset($this->fileFunctions)) { $this->fileFunctions = $this->findFunctions(); } return $this->fileFunctions; }
php
public function getFunctions() { if (!isset($this->fileFunctions)) { $this->fileFunctions = $this->findFunctions(); } return $this->fileFunctions; }
[ "public", "function", "getFunctions", "(", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "fileFunctions", ")", ")", "{", "$", "this", "->", "fileFunctions", "=", "$", "this", "->", "findFunctions", "(", ")", ";", "}", "return", "$", "thi...
Gets list of functions in the namespace @return ReflectionFunction[]|array
[ "Gets", "list", "of", "functions", "in", "the", "namespace" ]
a71d0454ef8bfa416a39bbb7dd3ed497e063e54c
https://github.com/goaop/parser-reflection/blob/a71d0454ef8bfa416a39bbb7dd3ed497e063e54c/src/ReflectionFileNamespace.php#L232-L239
33,170
goaop/parser-reflection
src/ReflectionFileNamespace.php
ReflectionFileNamespace.getNamespaceAliases
public function getNamespaceAliases() { if (!isset($this->fileNamespaceAliases)) { $this->fileNamespaceAliases = $this->findNamespaceAliases(); } return $this->fileNamespaceAliases; }
php
public function getNamespaceAliases() { if (!isset($this->fileNamespaceAliases)) { $this->fileNamespaceAliases = $this->findNamespaceAliases(); } return $this->fileNamespaceAliases; }
[ "public", "function", "getNamespaceAliases", "(", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "fileNamespaceAliases", ")", ")", "{", "$", "this", "->", "fileNamespaceAliases", "=", "$", "this", "->", "findNamespaceAliases", "(", ")", ";", "}...
Returns a list of namespace aliases @return array
[ "Returns", "a", "list", "of", "namespace", "aliases" ]
a71d0454ef8bfa416a39bbb7dd3ed497e063e54c
https://github.com/goaop/parser-reflection/blob/a71d0454ef8bfa416a39bbb7dd3ed497e063e54c/src/ReflectionFileNamespace.php#L258-L265
33,171
goaop/parser-reflection
src/ReflectionFileNamespace.php
ReflectionFileNamespace.getLastTokenPosition
public function getLastTokenPosition() { $endNamespaceTokenPosition = $this->namespaceNode->getAttribute('endTokenPos'); /** @var Node $lastNamespaceNode */ $lastNamespaceNode = end($this->namespaceNode->stmts); $endStatementTokenPosition = $lastNamespaceNode->getAttribute('...
php
public function getLastTokenPosition() { $endNamespaceTokenPosition = $this->namespaceNode->getAttribute('endTokenPos'); /** @var Node $lastNamespaceNode */ $lastNamespaceNode = end($this->namespaceNode->stmts); $endStatementTokenPosition = $lastNamespaceNode->getAttribute('...
[ "public", "function", "getLastTokenPosition", "(", ")", "{", "$", "endNamespaceTokenPosition", "=", "$", "this", "->", "namespaceNode", "->", "getAttribute", "(", "'endTokenPos'", ")", ";", "/** @var Node $lastNamespaceNode */", "$", "lastNamespaceNode", "=", "end", "...
Helper method to access last token position for namespace This method is useful because namespace can be declared with braces or without them
[ "Helper", "method", "to", "access", "last", "token", "position", "for", "namespace" ]
a71d0454ef8bfa416a39bbb7dd3ed497e063e54c
https://github.com/goaop/parser-reflection/blob/a71d0454ef8bfa416a39bbb7dd3ed497e063e54c/src/ReflectionFileNamespace.php#L282-L291
33,172
goaop/parser-reflection
src/ReflectionFileNamespace.php
ReflectionFileNamespace.findClasses
private function findClasses() { $classes = array(); $namespaceName = $this->getName(); // classes can be only top-level nodes in the namespace, so we can scan them directly foreach ($this->namespaceNode->stmts as $namespaceLevelNode) { if ($namespaceLevelNode insta...
php
private function findClasses() { $classes = array(); $namespaceName = $this->getName(); // classes can be only top-level nodes in the namespace, so we can scan them directly foreach ($this->namespaceNode->stmts as $namespaceLevelNode) { if ($namespaceLevelNode insta...
[ "private", "function", "findClasses", "(", ")", "{", "$", "classes", "=", "array", "(", ")", ";", "$", "namespaceName", "=", "$", "this", "->", "getName", "(", ")", ";", "// classes can be only top-level nodes in the namespace, so we can scan them directly", "foreach"...
Searches for classes in the given AST @return array|ReflectionClass[]
[ "Searches", "for", "classes", "in", "the", "given", "AST" ]
a71d0454ef8bfa416a39bbb7dd3ed497e063e54c
https://github.com/goaop/parser-reflection/blob/a71d0454ef8bfa416a39bbb7dd3ed497e063e54c/src/ReflectionFileNamespace.php#L350-L366
33,173
goaop/parser-reflection
src/ReflectionFileNamespace.php
ReflectionFileNamespace.findFunctions
private function findFunctions() { $functions = array(); $namespaceName = $this->getName(); // functions can be only top-level nodes in the namespace, so we can scan them directly foreach ($this->namespaceNode->stmts as $namespaceLevelNode) { if ($namespaceLevelNode ...
php
private function findFunctions() { $functions = array(); $namespaceName = $this->getName(); // functions can be only top-level nodes in the namespace, so we can scan them directly foreach ($this->namespaceNode->stmts as $namespaceLevelNode) { if ($namespaceLevelNode ...
[ "private", "function", "findFunctions", "(", ")", "{", "$", "functions", "=", "array", "(", ")", ";", "$", "namespaceName", "=", "$", "this", "->", "getName", "(", ")", ";", "// functions can be only top-level nodes in the namespace, so we can scan them directly", "fo...
Searches for functions in the given AST @return array
[ "Searches", "for", "functions", "in", "the", "given", "AST" ]
a71d0454ef8bfa416a39bbb7dd3ed497e063e54c
https://github.com/goaop/parser-reflection/blob/a71d0454ef8bfa416a39bbb7dd3ed497e063e54c/src/ReflectionFileNamespace.php#L373-L390
33,174
goaop/parser-reflection
src/ReflectionFileNamespace.php
ReflectionFileNamespace.findConstants
private function findConstants($withDefined = false) { $constants = array(); $expressionSolver = new NodeExpressionResolver($this); // constants can be only top-level nodes in the namespace, so we can scan them directly foreach ($this->namespaceNode->stmts as $namespaceLevelN...
php
private function findConstants($withDefined = false) { $constants = array(); $expressionSolver = new NodeExpressionResolver($this); // constants can be only top-level nodes in the namespace, so we can scan them directly foreach ($this->namespaceNode->stmts as $namespaceLevelN...
[ "private", "function", "findConstants", "(", "$", "withDefined", "=", "false", ")", "{", "$", "constants", "=", "array", "(", ")", ";", "$", "expressionSolver", "=", "new", "NodeExpressionResolver", "(", "$", "this", ")", ";", "// constants can be only top-level...
Searches for constants in the given AST @param bool $withDefined Include constants defined via "define(...)" in results. @return array
[ "Searches", "for", "constants", "in", "the", "given", "AST" ]
a71d0454ef8bfa416a39bbb7dd3ed497e063e54c
https://github.com/goaop/parser-reflection/blob/a71d0454ef8bfa416a39bbb7dd3ed497e063e54c/src/ReflectionFileNamespace.php#L399-L440
33,175
goaop/parser-reflection
src/ReflectionFileNamespace.php
ReflectionFileNamespace.findNamespaceAliases
private function findNamespaceAliases() { $namespaceAliases = []; // aliases can be only top-level nodes in the namespace, so we can scan them directly foreach ($this->namespaceNode->stmts as $namespaceLevelNode) { if ($namespaceLevelNode instanceof Use_) { $useA...
php
private function findNamespaceAliases() { $namespaceAliases = []; // aliases can be only top-level nodes in the namespace, so we can scan them directly foreach ($this->namespaceNode->stmts as $namespaceLevelNode) { if ($namespaceLevelNode instanceof Use_) { $useA...
[ "private", "function", "findNamespaceAliases", "(", ")", "{", "$", "namespaceAliases", "=", "[", "]", ";", "// aliases can be only top-level nodes in the namespace, so we can scan them directly", "foreach", "(", "$", "this", "->", "namespaceNode", "->", "stmts", "as", "$"...
Searchse for namespace aliases for the current block @return array
[ "Searchse", "for", "namespace", "aliases", "for", "the", "current", "block" ]
a71d0454ef8bfa416a39bbb7dd3ed497e063e54c
https://github.com/goaop/parser-reflection/blob/a71d0454ef8bfa416a39bbb7dd3ed497e063e54c/src/ReflectionFileNamespace.php#L447-L464
33,176
goaop/parser-reflection
src/Traits/ReflectionFunctionLikeTrait.php
ReflectionFunctionLikeTrait.getReturnType
public function getReturnType() { $isBuiltin = false; $returnType = $this->functionLikeNode->getReturnType(); $isNullable = $returnType instanceof NullableType; if ($isNullable) { $returnType = $returnType->type; } if ($returnType instanceof Identifier) ...
php
public function getReturnType() { $isBuiltin = false; $returnType = $this->functionLikeNode->getReturnType(); $isNullable = $returnType instanceof NullableType; if ($isNullable) { $returnType = $returnType->type; } if ($returnType instanceof Identifier) ...
[ "public", "function", "getReturnType", "(", ")", "{", "$", "isBuiltin", "=", "false", ";", "$", "returnType", "=", "$", "this", "->", "functionLikeNode", "->", "getReturnType", "(", ")", ";", "$", "isNullable", "=", "$", "returnType", "instanceof", "Nullable...
Gets the specified return type of a function @return \ReflectionType @link http://php.net/manual/en/reflectionfunctionabstract.getreturntype.php
[ "Gets", "the", "specified", "return", "type", "of", "a", "function" ]
a71d0454ef8bfa416a39bbb7dd3ed497e063e54c
https://github.com/goaop/parser-reflection/blob/a71d0454ef8bfa416a39bbb7dd3ed497e063e54c/src/Traits/ReflectionFunctionLikeTrait.php#L182-L203
33,177
goaop/parser-reflection
src/ValueResolver/NodeExpressionResolver.php
NodeExpressionResolver.resolve
protected function resolve(Node $node) { $value = null; try { ++$this->nodeLevel; $methodName = $this->getDispatchMethodFor($node); if (method_exists($this, $methodName)) { $value = $this->$methodName($node); } } finally { ...
php
protected function resolve(Node $node) { $value = null; try { ++$this->nodeLevel; $methodName = $this->getDispatchMethodFor($node); if (method_exists($this, $methodName)) { $value = $this->$methodName($node); } } finally { ...
[ "protected", "function", "resolve", "(", "Node", "$", "node", ")", "{", "$", "value", "=", "null", ";", "try", "{", "++", "$", "this", "->", "nodeLevel", ";", "$", "methodName", "=", "$", "this", "->", "getDispatchMethodFor", "(", "$", "node", ")", "...
Resolves node into valid value @param Node $node @return mixed
[ "Resolves", "node", "into", "valid", "value" ]
a71d0454ef8bfa416a39bbb7dd3ed497e063e54c
https://github.com/goaop/parser-reflection/blob/a71d0454ef8bfa416a39bbb7dd3ed497e063e54c/src/ValueResolver/NodeExpressionResolver.php#L115-L130
33,178
goaop/parser-reflection
src/ValueResolver/NodeExpressionResolver.php
NodeExpressionResolver.fetchReflectionClass
private function fetchReflectionClass(Node\Name $node) { $className = $node->toString(); $isFQNClass = $node instanceof Node\Name\FullyQualified; if ($isFQNClass) { // check to see if the class is already loaded and is safe to use // PHP's ReflectionClass to determin...
php
private function fetchReflectionClass(Node\Name $node) { $className = $node->toString(); $isFQNClass = $node instanceof Node\Name\FullyQualified; if ($isFQNClass) { // check to see if the class is already loaded and is safe to use // PHP's ReflectionClass to determin...
[ "private", "function", "fetchReflectionClass", "(", "Node", "\\", "Name", "$", "node", ")", "{", "$", "className", "=", "$", "node", "->", "toString", "(", ")", ";", "$", "isFQNClass", "=", "$", "node", "instanceof", "Node", "\\", "Name", "\\", "FullyQua...
Utility method to fetch reflection class instance by name Supports: 'self' keyword 'parent' keyword not-FQN class names @param Node\Name $node Class name node @return bool|\ReflectionClass @throws ReflectionException
[ "Utility", "method", "to", "fetch", "reflection", "class", "instance", "by", "name" ]
a71d0454ef8bfa416a39bbb7dd3ed497e063e54c
https://github.com/goaop/parser-reflection/blob/a71d0454ef8bfa416a39bbb7dd3ed497e063e54c/src/ValueResolver/NodeExpressionResolver.php#L471-L513
33,179
majkel89/dbase
src/Field.php
Field.removeFilter
public function removeFilter($indexOrFilter) { if (is_scalar($indexOrFilter)) { unset($this->filters[$indexOrFilter]); } else if ($indexOrFilter instanceof FilterInterface) { foreach ($this->filters as $i => $filter) { if ($filter === $indexOrFilter) { ...
php
public function removeFilter($indexOrFilter) { if (is_scalar($indexOrFilter)) { unset($this->filters[$indexOrFilter]); } else if ($indexOrFilter instanceof FilterInterface) { foreach ($this->filters as $i => $filter) { if ($filter === $indexOrFilter) { ...
[ "public", "function", "removeFilter", "(", "$", "indexOrFilter", ")", "{", "if", "(", "is_scalar", "(", "$", "indexOrFilter", ")", ")", "{", "unset", "(", "$", "this", "->", "filters", "[", "$", "indexOrFilter", "]", ")", ";", "}", "else", "if", "(", ...
Removes filter at index or by object @param integer $indexOrFilter @return \org\majkel\dbase\Field
[ "Removes", "filter", "at", "index", "or", "by", "object" ]
483f27e83bae5323817c26aa297d923a4231dd6f
https://github.com/majkel89/dbase/blob/483f27e83bae5323817c26aa297d923a4231dd6f/src/Field.php#L89-L100
33,180
majkel89/dbase
src/Field.php
Field.setName
public function setName($name) { if (strlen($name) > self::MAX_NAME_LENGTH) { throw new Exception("Field name cannot be longer than ".self::MAX_NAME_LENGTH." characters"); } $this->name = $name; return $this; }
php
public function setName($name) { if (strlen($name) > self::MAX_NAME_LENGTH) { throw new Exception("Field name cannot be longer than ".self::MAX_NAME_LENGTH." characters"); } $this->name = $name; return $this; }
[ "public", "function", "setName", "(", "$", "name", ")", "{", "if", "(", "strlen", "(", "$", "name", ")", ">", "self", "::", "MAX_NAME_LENGTH", ")", "{", "throw", "new", "Exception", "(", "\"Field name cannot be longer than \"", ".", "self", "::", "MAX_NAME_L...
Sets filed name @param string $name @return \org\majkel\dbase\Field @throws \org\majkel\dbase\Exception
[ "Sets", "filed", "name" ]
483f27e83bae5323817c26aa297d923a4231dd6f
https://github.com/majkel89/dbase/blob/483f27e83bae5323817c26aa297d923a4231dd6f/src/Field.php#L118-L124
33,181
majkel89/dbase
src/Field.php
Field.unserialize
public function unserialize($data) { $value = $this->fromData($data); foreach ($this->getFilters() as $filter) { $value = $filter->toValue($value); } return $value; }
php
public function unserialize($data) { $value = $this->fromData($data); foreach ($this->getFilters() as $filter) { $value = $filter->toValue($value); } return $value; }
[ "public", "function", "unserialize", "(", "$", "data", ")", "{", "$", "value", "=", "$", "this", "->", "fromData", "(", "$", "data", ")", ";", "foreach", "(", "$", "this", "->", "getFilters", "(", ")", "as", "$", "filter", ")", "{", "$", "value", ...
Constructs value from raw data and applies filters @param string $data @return mixed
[ "Constructs", "value", "from", "raw", "data", "and", "applies", "filters" ]
483f27e83bae5323817c26aa297d923a4231dd6f
https://github.com/majkel89/dbase/blob/483f27e83bae5323817c26aa297d923a4231dd6f/src/Field.php#L185-L191
33,182
majkel89/dbase
src/Field.php
Field.serialize
public function serialize($value) { $filters = $this->getFilters(); for ($i = count($filters) - 1; $i >= 0; --$i) { $value = $filters[$i]->fromValue($value); } return $this->toData($value); }
php
public function serialize($value) { $filters = $this->getFilters(); for ($i = count($filters) - 1; $i >= 0; --$i) { $value = $filters[$i]->fromValue($value); } return $this->toData($value); }
[ "public", "function", "serialize", "(", "$", "value", ")", "{", "$", "filters", "=", "$", "this", "->", "getFilters", "(", ")", ";", "for", "(", "$", "i", "=", "count", "(", "$", "filters", ")", "-", "1", ";", "$", "i", ">=", "0", ";", "--", ...
Applies filters and converts value to raw data @param mixed $value @return string
[ "Applies", "filters", "and", "converts", "value", "to", "raw", "data" ]
483f27e83bae5323817c26aa297d923a4231dd6f
https://github.com/majkel89/dbase/blob/483f27e83bae5323817c26aa297d923a4231dd6f/src/Field.php#L198-L204
33,183
majkel89/dbase
src/Field.php
Field.create
public static function create($type) { switch ($type) { case Field::TYPE_CHARACTER: return new field\CharacterField; case Field::TYPE_DATE: return new field\DateField; case Field::TYPE_LOGICAL: return new field\LogicalField; ...
php
public static function create($type) { switch ($type) { case Field::TYPE_CHARACTER: return new field\CharacterField; case Field::TYPE_DATE: return new field\DateField; case Field::TYPE_LOGICAL: return new field\LogicalField; ...
[ "public", "static", "function", "create", "(", "$", "type", ")", "{", "switch", "(", "$", "type", ")", "{", "case", "Field", "::", "TYPE_CHARACTER", ":", "return", "new", "field", "\\", "CharacterField", ";", "case", "Field", "::", "TYPE_DATE", ":", "ret...
Constructs Filed based on type @param string $type @return \org\majkel\dbase\Field @throws Exception
[ "Constructs", "Filed", "based", "on", "type" ]
483f27e83bae5323817c26aa297d923a4231dd6f
https://github.com/majkel89/dbase/blob/483f27e83bae5323817c26aa297d923a4231dd6f/src/Field.php#L240-L255
33,184
majkel89/dbase
src/Field.php
Field.getTypes
public static function getTypes() { return array( self::TYPE_CHARACTER, self::TYPE_LOGICAL, self::TYPE_DATE , self::TYPE_NUMERIC, self::TYPE_MEMO, ); }
php
public static function getTypes() { return array( self::TYPE_CHARACTER, self::TYPE_LOGICAL, self::TYPE_DATE , self::TYPE_NUMERIC, self::TYPE_MEMO, ); }
[ "public", "static", "function", "getTypes", "(", ")", "{", "return", "array", "(", "self", "::", "TYPE_CHARACTER", ",", "self", "::", "TYPE_LOGICAL", ",", "self", "::", "TYPE_DATE", ",", "self", "::", "TYPE_NUMERIC", ",", "self", "::", "TYPE_MEMO", ",", ")...
Returns all supported types @return integer[]
[ "Returns", "all", "supported", "types" ]
483f27e83bae5323817c26aa297d923a4231dd6f
https://github.com/majkel89/dbase/blob/483f27e83bae5323817c26aa297d923a4231dd6f/src/Field.php#L261-L269
33,185
goaop/parser-reflection
src/ReflectionClass.php
ReflectionClass.collectInterfacesFromClassNode
public static function collectInterfacesFromClassNode(ClassLike $classLikeNode) { $interfaces = []; $isInterface = $classLikeNode instanceof Interface_; $interfaceField = $isInterface ? 'extends' : 'implements'; $hasInterfaces = in_array($interfaceField, $classLikeNode->getSubNo...
php
public static function collectInterfacesFromClassNode(ClassLike $classLikeNode) { $interfaces = []; $isInterface = $classLikeNode instanceof Interface_; $interfaceField = $isInterface ? 'extends' : 'implements'; $hasInterfaces = in_array($interfaceField, $classLikeNode->getSubNo...
[ "public", "static", "function", "collectInterfacesFromClassNode", "(", "ClassLike", "$", "classLikeNode", ")", "{", "$", "interfaces", "=", "[", "]", ";", "$", "isInterface", "=", "$", "classLikeNode", "instanceof", "Interface_", ";", "$", "interfaceField", "=", ...
Parses interfaces from the concrete class node @param ClassLike $classLikeNode Class-like node @return array|\ReflectionClass[] List of reflections of interfaces
[ "Parses", "interfaces", "from", "the", "concrete", "class", "node" ]
a71d0454ef8bfa416a39bbb7dd3ed497e063e54c
https://github.com/goaop/parser-reflection/blob/a71d0454ef8bfa416a39bbb7dd3ed497e063e54c/src/ReflectionClass.php#L54-L75
33,186
goaop/parser-reflection
src/ReflectionClass.php
ReflectionClass.collectTraitsFromClassNode
public static function collectTraitsFromClassNode(ClassLike $classLikeNode, array &$traitAdaptations) { $traits = []; if (!empty($classLikeNode->stmts)) { foreach ($classLikeNode->stmts as $classLevelNode) { if ($classLevelNode instanceof TraitUse) { ...
php
public static function collectTraitsFromClassNode(ClassLike $classLikeNode, array &$traitAdaptations) { $traits = []; if (!empty($classLikeNode->stmts)) { foreach ($classLikeNode->stmts as $classLevelNode) { if ($classLevelNode instanceof TraitUse) { ...
[ "public", "static", "function", "collectTraitsFromClassNode", "(", "ClassLike", "$", "classLikeNode", ",", "array", "&", "$", "traitAdaptations", ")", "{", "$", "traits", "=", "[", "]", ";", "if", "(", "!", "empty", "(", "$", "classLikeNode", "->", "stmts", ...
Parses traits from the concrete class node @param ClassLike $classLikeNode Class-like node @param array $traitAdaptations List of method adaptations @return array|\ReflectionClass[] List of reflections of traits
[ "Parses", "traits", "from", "the", "concrete", "class", "node" ]
a71d0454ef8bfa416a39bbb7dd3ed497e063e54c
https://github.com/goaop/parser-reflection/blob/a71d0454ef8bfa416a39bbb7dd3ed497e063e54c/src/ReflectionClass.php#L85-L107
33,187
goaop/parser-reflection
src/ReflectionEngine.php
ReflectionEngine.setMaximumCachedFiles
public static function setMaximumCachedFiles($newLimit) { self::$maximumCachedFiles = $newLimit; if (count(self::$parsedFiles) > $newLimit) { self::$parsedFiles = array_slice(self::$parsedFiles, 0, $newLimit); } }
php
public static function setMaximumCachedFiles($newLimit) { self::$maximumCachedFiles = $newLimit; if (count(self::$parsedFiles) > $newLimit) { self::$parsedFiles = array_slice(self::$parsedFiles, 0, $newLimit); } }
[ "public", "static", "function", "setMaximumCachedFiles", "(", "$", "newLimit", ")", "{", "self", "::", "$", "maximumCachedFiles", "=", "$", "newLimit", ";", "if", "(", "count", "(", "self", "::", "$", "parsedFiles", ")", ">", "$", "newLimit", ")", "{", "...
Limits number of files, that can be cached at any given moment @param integer $newLimit New limit @return void
[ "Limits", "number", "of", "files", "that", "can", "be", "cached", "at", "any", "given", "moment" ]
a71d0454ef8bfa416a39bbb7dd3ed497e063e54c
https://github.com/goaop/parser-reflection/blob/a71d0454ef8bfa416a39bbb7dd3ed497e063e54c/src/ReflectionEngine.php#L91-L97
33,188
goaop/parser-reflection
src/ReflectionEngine.php
ReflectionEngine.locateClassFile
public static function locateClassFile($fullClassName) { if (class_exists($fullClassName, false) || interface_exists($fullClassName, false) || trait_exists($fullClassName, false) ) { $refClass = new \ReflectionClass($fullClassName); $classFileName...
php
public static function locateClassFile($fullClassName) { if (class_exists($fullClassName, false) || interface_exists($fullClassName, false) || trait_exists($fullClassName, false) ) { $refClass = new \ReflectionClass($fullClassName); $classFileName...
[ "public", "static", "function", "locateClassFile", "(", "$", "fullClassName", ")", "{", "if", "(", "class_exists", "(", "$", "fullClassName", ",", "false", ")", "||", "interface_exists", "(", "$", "fullClassName", ",", "false", ")", "||", "trait_exists", "(", ...
Locates a file name for class @param string $fullClassName Full name of the class @return string
[ "Locates", "a", "file", "name", "for", "class" ]
a71d0454ef8bfa416a39bbb7dd3ed497e063e54c
https://github.com/goaop/parser-reflection/blob/a71d0454ef8bfa416a39bbb7dd3ed497e063e54c/src/ReflectionEngine.php#L106-L123
33,189
goaop/parser-reflection
src/ReflectionEngine.php
ReflectionEngine.parseClass
public static function parseClass($fullClassName) { $classFileName = self::locateClassFile($fullClassName); $namespaceParts = explode('\\', $fullClassName); $className = array_pop($namespaceParts); $namespaceName = join('\\', $namespaceParts); // we have a namespace n...
php
public static function parseClass($fullClassName) { $classFileName = self::locateClassFile($fullClassName); $namespaceParts = explode('\\', $fullClassName); $className = array_pop($namespaceParts); $namespaceName = join('\\', $namespaceParts); // we have a namespace n...
[ "public", "static", "function", "parseClass", "(", "$", "fullClassName", ")", "{", "$", "classFileName", "=", "self", "::", "locateClassFile", "(", "$", "fullClassName", ")", ";", "$", "namespaceParts", "=", "explode", "(", "'\\\\'", ",", "$", "fullClassName",...
Tries to parse a class by name using LocatorInterface @param string $fullClassName Class name to load @return ClassLike
[ "Tries", "to", "parse", "a", "class", "by", "name", "using", "LocatorInterface" ]
a71d0454ef8bfa416a39bbb7dd3ed497e063e54c
https://github.com/goaop/parser-reflection/blob/a71d0454ef8bfa416a39bbb7dd3ed497e063e54c/src/ReflectionEngine.php#L132-L152
33,190
goaop/parser-reflection
src/ReflectionEngine.php
ReflectionEngine.parseClassMethod
public static function parseClassMethod($fullClassName, $methodName) { $class = self::parseClass($fullClassName); $classNodes = $class->stmts; foreach ($classNodes as $classLevelNode) { if ($classLevelNode instanceof ClassMethod && $classLevelNode->name->toString() == $meth...
php
public static function parseClassMethod($fullClassName, $methodName) { $class = self::parseClass($fullClassName); $classNodes = $class->stmts; foreach ($classNodes as $classLevelNode) { if ($classLevelNode instanceof ClassMethod && $classLevelNode->name->toString() == $meth...
[ "public", "static", "function", "parseClassMethod", "(", "$", "fullClassName", ",", "$", "methodName", ")", "{", "$", "class", "=", "self", "::", "parseClass", "(", "$", "fullClassName", ")", ";", "$", "classNodes", "=", "$", "class", "->", "stmts", ";", ...
Parses class method @param string $fullClassName Name of the class @param string $methodName Name of the method @return ClassMethod
[ "Parses", "class", "method" ]
a71d0454ef8bfa416a39bbb7dd3ed497e063e54c
https://github.com/goaop/parser-reflection/blob/a71d0454ef8bfa416a39bbb7dd3ed497e063e54c/src/ReflectionEngine.php#L162-L174
33,191
goaop/parser-reflection
src/ReflectionEngine.php
ReflectionEngine.parseClassProperty
public static function parseClassProperty($fullClassName, $propertyName) { $class = self::parseClass($fullClassName); $classNodes = $class->stmts; foreach ($classNodes as $classLevelNode) { if ($classLevelNode instanceof Property) { foreach ($classLevelNode-...
php
public static function parseClassProperty($fullClassName, $propertyName) { $class = self::parseClass($fullClassName); $classNodes = $class->stmts; foreach ($classNodes as $classLevelNode) { if ($classLevelNode instanceof Property) { foreach ($classLevelNode-...
[ "public", "static", "function", "parseClassProperty", "(", "$", "fullClassName", ",", "$", "propertyName", ")", "{", "$", "class", "=", "self", "::", "parseClass", "(", "$", "fullClassName", ")", ";", "$", "classNodes", "=", "$", "class", "->", "stmts", ";...
Parses class property @param string $fullClassName Name of the class @param string $propertyName Name of the property @return array Pair of [Property and PropertyProperty] nodes
[ "Parses", "class", "property" ]
a71d0454ef8bfa416a39bbb7dd3ed497e063e54c
https://github.com/goaop/parser-reflection/blob/a71d0454ef8bfa416a39bbb7dd3ed497e063e54c/src/ReflectionEngine.php#L184-L200
33,192
goaop/parser-reflection
src/ReflectionEngine.php
ReflectionEngine.parseFile
public static function parseFile($fileName, $fileContent = null) { $fileName = PathResolver::realpath($fileName); if (isset(self::$parsedFiles[$fileName]) && !isset($fileContent)) { return self::$parsedFiles[$fileName]; } if (isset(self::$maximumCachedFiles) && (count(se...
php
public static function parseFile($fileName, $fileContent = null) { $fileName = PathResolver::realpath($fileName); if (isset(self::$parsedFiles[$fileName]) && !isset($fileContent)) { return self::$parsedFiles[$fileName]; } if (isset(self::$maximumCachedFiles) && (count(se...
[ "public", "static", "function", "parseFile", "(", "$", "fileName", ",", "$", "fileContent", "=", "null", ")", "{", "$", "fileName", "=", "PathResolver", "::", "realpath", "(", "$", "fileName", ")", ";", "if", "(", "isset", "(", "self", "::", "$", "pars...
Parses a file and returns an AST for it @param string $fileName Name of the file @param string|null $fileContent Optional content of the file @return \PhpParser\Node[]
[ "Parses", "a", "file", "and", "returns", "an", "AST", "for", "it" ]
a71d0454ef8bfa416a39bbb7dd3ed497e063e54c
https://github.com/goaop/parser-reflection/blob/a71d0454ef8bfa416a39bbb7dd3ed497e063e54c/src/ReflectionEngine.php#L210-L230
33,193
goaop/parser-reflection
src/ReflectionEngine.php
ReflectionEngine.parseFileNamespace
public static function parseFileNamespace($fileName, $namespaceName) { $topLevelNodes = self::parseFile($fileName); // namespaces can be only top-level nodes, so we can scan them directly foreach ($topLevelNodes as $topLevelNode) { if (!$topLevelNode instanceof Namespace_) { ...
php
public static function parseFileNamespace($fileName, $namespaceName) { $topLevelNodes = self::parseFile($fileName); // namespaces can be only top-level nodes, so we can scan them directly foreach ($topLevelNodes as $topLevelNode) { if (!$topLevelNode instanceof Namespace_) { ...
[ "public", "static", "function", "parseFileNamespace", "(", "$", "fileName", ",", "$", "namespaceName", ")", "{", "$", "topLevelNodes", "=", "self", "::", "parseFile", "(", "$", "fileName", ")", ";", "// namespaces can be only top-level nodes, so we can scan them directl...
Parses a file namespace and returns an AST for it @param string $fileName Name of the file @param string $namespaceName Namespace name @return Namespace_ @throws ReflectionException
[ "Parses", "a", "file", "namespace", "and", "returns", "an", "AST", "for", "it" ]
a71d0454ef8bfa416a39bbb7dd3ed497e063e54c
https://github.com/goaop/parser-reflection/blob/a71d0454ef8bfa416a39bbb7dd3ed497e063e54c/src/ReflectionEngine.php#L241-L256
33,194
goaop/parser-reflection
src/Locator/ComposerLocator.php
ComposerLocator.locateClass
public function locateClass($className) { $filePath = $this->loader->findFile(ltrim($className, '\\')); if (!empty($filePath)) { $filePath = PathResolver::realpath($filePath); } return $filePath; }
php
public function locateClass($className) { $filePath = $this->loader->findFile(ltrim($className, '\\')); if (!empty($filePath)) { $filePath = PathResolver::realpath($filePath); } return $filePath; }
[ "public", "function", "locateClass", "(", "$", "className", ")", "{", "$", "filePath", "=", "$", "this", "->", "loader", "->", "findFile", "(", "ltrim", "(", "$", "className", ",", "'\\\\'", ")", ")", ";", "if", "(", "!", "empty", "(", "$", "filePath...
Returns a path to the file for given class name @param string $className Name of the class @return string|false Path to the file with given class or false if not found
[ "Returns", "a", "path", "to", "the", "file", "for", "given", "class", "name" ]
a71d0454ef8bfa416a39bbb7dd3ed497e063e54c
https://github.com/goaop/parser-reflection/blob/a71d0454ef8bfa416a39bbb7dd3ed497e063e54c/src/Locator/ComposerLocator.php#L52-L60
33,195
rossedman/teamwork
src/Rossedman/Teamwork/AbstractObject.php
AbstractObject.areArgumentsValid
protected function areArgumentsValid($args, array $accepted) { if ($args == null) { return; } foreach ($accepted as $accept) { if (array_key_exists($accept, $args)) { return true; } } throw new ...
php
protected function areArgumentsValid($args, array $accepted) { if ($args == null) { return; } foreach ($accepted as $accept) { if (array_key_exists($accept, $args)) { return true; } } throw new ...
[ "protected", "function", "areArgumentsValid", "(", "$", "args", ",", "array", "$", "accepted", ")", "{", "if", "(", "$", "args", "==", "null", ")", "{", "return", ";", "}", "foreach", "(", "$", "accepted", "as", "$", "accept", ")", "{", "if", "(", ...
Are Arguments Valid @param array $args @param string[] $accepted @return null|bool
[ "Are", "Arguments", "Valid" ]
c929b0f11114ec6a808df81762879be84a9d2e36
https://github.com/rossedman/teamwork/blob/c929b0f11114ec6a808df81762879be84a9d2e36/src/Rossedman/Teamwork/AbstractObject.php#L52-L68
33,196
rossedman/teamwork
src/Rossedman/Teamwork/Client.php
Client.buildQuery
public function buildQuery($query) { $q = $this->request->getQuery(); foreach ($query as $key => $value) { $q[$key] = $value; } }
php
public function buildQuery($query) { $q = $this->request->getQuery(); foreach ($query as $key => $value) { $q[$key] = $value; } }
[ "public", "function", "buildQuery", "(", "$", "query", ")", "{", "$", "q", "=", "$", "this", "->", "request", "->", "getQuery", "(", ")", ";", "foreach", "(", "$", "query", "as", "$", "key", "=>", "$", "value", ")", "{", "$", "q", "[", "$", "ke...
Build Query String if a query string is needed it will be built up and added to the request. This is only used in certain GET requests @param $query
[ "Build", "Query", "String" ]
c929b0f11114ec6a808df81762879be84a9d2e36
https://github.com/rossedman/teamwork/blob/c929b0f11114ec6a808df81762879be84a9d2e36/src/Rossedman/Teamwork/Client.php#L197-L205
33,197
alterphp/components
src/AlterPHP/Component/ToolBox/BitTools.php
BitTools.getBitArrayFromInt
public static function getBitArrayFromInt($int) { $binstr = (string) decbin($int); $binarr = array_reverse(str_split($binstr)); $bitarr = array_keys($binarr, '1', true); return $bitarr; }
php
public static function getBitArrayFromInt($int) { $binstr = (string) decbin($int); $binarr = array_reverse(str_split($binstr)); $bitarr = array_keys($binarr, '1', true); return $bitarr; }
[ "public", "static", "function", "getBitArrayFromInt", "(", "$", "int", ")", "{", "$", "binstr", "=", "(", "string", ")", "decbin", "(", "$", "int", ")", ";", "$", "binarr", "=", "array_reverse", "(", "str_split", "(", "$", "binstr", ")", ")", ";", "$...
Return an array of active bits in the binary representation of the given integer @param integer $int @return array
[ "Return", "an", "array", "of", "active", "bits", "in", "the", "binary", "representation", "of", "the", "given", "integer" ]
a2fa91bf02746f9493ffc742ab3ef1d2f18b56d5
https://github.com/alterphp/components/blob/a2fa91bf02746f9493ffc742ab3ef1d2f18b56d5/src/AlterPHP/Component/ToolBox/BitTools.php#L31-L38
33,198
alterphp/components
src/AlterPHP/Component/Behavior/StatusableEntity.php
StatusableEntity.getStatusList
public static function getStatusList($withLabelsAsIndexes = false, array $filterStatus = null) { // Build $statusValues if this is the first call if (null === static::$statusValues) { static::$statusValues = array(); $refClass = new \ReflectionClass(get_called_class()); ...
php
public static function getStatusList($withLabelsAsIndexes = false, array $filterStatus = null) { // Build $statusValues if this is the first call if (null === static::$statusValues) { static::$statusValues = array(); $refClass = new \ReflectionClass(get_called_class()); ...
[ "public", "static", "function", "getStatusList", "(", "$", "withLabelsAsIndexes", "=", "false", ",", "array", "$", "filterStatus", "=", "null", ")", "{", "// Build $statusValues if this is the first call", "if", "(", "null", "===", "static", "::", "$", "statusValues...
Returns status list, with or without labels. @param bool $withLabelsAsIndexes @param array $filterStatus @return array
[ "Returns", "status", "list", "with", "or", "without", "labels", "." ]
a2fa91bf02746f9493ffc742ab3ef1d2f18b56d5
https://github.com/alterphp/components/blob/a2fa91bf02746f9493ffc742ab3ef1d2f18b56d5/src/AlterPHP/Component/Behavior/StatusableEntity.php#L39-L70
33,199
alterphp/components
src/AlterPHP/Component/Behavior/StatusableEntity.php
StatusableEntity.isStatusBetween
public function isStatusBetween($from = null, $to = null, $strict = false, $strictTo = null) { return in_array($this->status, static::getStatusBetween($from, $to, $strict, $strictTo)); }
php
public function isStatusBetween($from = null, $to = null, $strict = false, $strictTo = null) { return in_array($this->status, static::getStatusBetween($from, $to, $strict, $strictTo)); }
[ "public", "function", "isStatusBetween", "(", "$", "from", "=", "null", ",", "$", "to", "=", "null", ",", "$", "strict", "=", "false", ",", "$", "strictTo", "=", "null", ")", "{", "return", "in_array", "(", "$", "this", "->", "status", ",", "static",...
Checks if status is between a "from" and a "to" status. @param string $from @param string $to @param bool $strict @param bool $strictTo @return bool
[ "Checks", "if", "status", "is", "between", "a", "from", "and", "a", "to", "status", "." ]
a2fa91bf02746f9493ffc742ab3ef1d2f18b56d5
https://github.com/alterphp/components/blob/a2fa91bf02746f9493ffc742ab3ef1d2f18b56d5/src/AlterPHP/Component/Behavior/StatusableEntity.php#L82-L85