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
202,000
ekyna/RequireJsBundle
Configuration/Provider.php
Provider.collectConfigs
public function collectConfigs() { if (!$this->collectedConfig) { $config = $this->config; foreach ($this->bundles as $bundle) { $reflection = new \ReflectionClass($bundle); if (is_file($file = dirname($reflection->getFileName()) . '/Resources/config/r...
php
public function collectConfigs() { if (!$this->collectedConfig) { $config = $this->config; foreach ($this->bundles as $bundle) { $reflection = new \ReflectionClass($bundle); if (is_file($file = dirname($reflection->getFileName()) . '/Resources/config/r...
[ "public", "function", "collectConfigs", "(", ")", "{", "if", "(", "!", "$", "this", "->", "collectedConfig", ")", "{", "$", "config", "=", "$", "this", "->", "config", ";", "foreach", "(", "$", "this", "->", "bundles", "as", "$", "bundle", ")", "{", ...
Goes across bundles and collects configurations @return array
[ "Goes", "across", "bundles", "and", "collects", "configurations" ]
2b746d25c17487838447d72a03d1050819bcf66a
https://github.com/ekyna/RequireJsBundle/blob/2b746d25c17487838447d72a03d1050819bcf66a/Configuration/Provider.php#L148-L162
202,001
miBadger/miBadger.Mvc
src/View.php
View.get
public static function get($path, $data = []) { ob_start(); extract($data); try { $basePath = static::getInstance()->basePath; if ($basePath !== null) { if (mb_substr($path, 0, 1) === static::DIRECTORY_SEPARATOR) { $path = mb_substr($path, 1); } if (mb_substr($basePath, -1) === static:...
php
public static function get($path, $data = []) { ob_start(); extract($data); try { $basePath = static::getInstance()->basePath; if ($basePath !== null) { if (mb_substr($path, 0, 1) === static::DIRECTORY_SEPARATOR) { $path = mb_substr($path, 1); } if (mb_substr($basePath, -1) === static:...
[ "public", "static", "function", "get", "(", "$", "path", ",", "$", "data", "=", "[", "]", ")", "{", "ob_start", "(", ")", ";", "extract", "(", "$", "data", ")", ";", "try", "{", "$", "basePath", "=", "static", "::", "getInstance", "(", ")", "->",...
Returns the view at the given path with the given data. @param string $path @param string[] $data = [] @return string a string representation of the view.
[ "Returns", "the", "view", "at", "the", "given", "path", "with", "the", "given", "data", "." ]
d6725938a7c7c198deacb907c0db03e5db110d77
https://github.com/miBadger/miBadger.Mvc/blob/d6725938a7c7c198deacb907c0db03e5db110d77/src/View.php#L64-L92
202,002
bytic/orm
src/Navigator/Pagination/AbstractPaginator.php
AbstractPaginator.doCount
protected function doCount() { $query = $this->getCountQuery(); $result = $query->execute()->fetchResult(); $this->count = intval($result['count']); $this->pages = intval($this->count / $this->itemsPerPage); if ($this->count % $this->itemsPerPage != 0) { $this->...
php
protected function doCount() { $query = $this->getCountQuery(); $result = $query->execute()->fetchResult(); $this->count = intval($result['count']); $this->pages = intval($this->count / $this->itemsPerPage); if ($this->count % $this->itemsPerPage != 0) { $this->...
[ "protected", "function", "doCount", "(", ")", "{", "$", "query", "=", "$", "this", "->", "getCountQuery", "(", ")", ";", "$", "result", "=", "$", "query", "->", "execute", "(", ")", "->", "fetchResult", "(", ")", ";", "$", "this", "->", "count", "=...
Does the count for all records
[ "Does", "the", "count", "for", "all", "records" ]
8d9a79b47761af0bfd9b8d1d28c83221dcac0de0
https://github.com/bytic/orm/blob/8d9a79b47761af0bfd9b8d1d28c83221dcac0de0/src/Navigator/Pagination/AbstractPaginator.php#L79-L94
202,003
brightnucleus/options-store
src/OptionRepository/IdentityMap.php
IdentityMap.getOption
public function getOption(string $key): Option { if (! $this->has($key)) { throw UnknownOptionKey::fromKey($key); } return $this->map[$key][self::SUBKEY_OPTION]; }
php
public function getOption(string $key): Option { if (! $this->has($key)) { throw UnknownOptionKey::fromKey($key); } return $this->map[$key][self::SUBKEY_OPTION]; }
[ "public", "function", "getOption", "(", "string", "$", "key", ")", ":", "Option", "{", "if", "(", "!", "$", "this", "->", "has", "(", "$", "key", ")", ")", "{", "throw", "UnknownOptionKey", "::", "fromKey", "(", "$", "key", ")", ";", "}", "return",...
Get the associated option for a specific key. @since 0.1.0 @param string $key Key to fetch the option for. @return Option The option that is associated with the requested key.
[ "Get", "the", "associated", "option", "for", "a", "specific", "key", "." ]
9a9ef2a160bbacd69fe3e9db0be8ed89e6905ef1
https://github.com/brightnucleus/options-store/blob/9a9ef2a160bbacd69fe3e9db0be8ed89e6905ef1/src/OptionRepository/IdentityMap.php#L90-L97
202,004
brightnucleus/options-store
src/OptionRepository/IdentityMap.php
IdentityMap.getRepository
public function getRepository(string $key): OptionRepository { if (! $this->has($key)) { throw UnknownOptionKey::fromKey($key); } return $this->map[$key][self::SUBKEY_REPOSITORY]; }
php
public function getRepository(string $key): OptionRepository { if (! $this->has($key)) { throw UnknownOptionKey::fromKey($key); } return $this->map[$key][self::SUBKEY_REPOSITORY]; }
[ "public", "function", "getRepository", "(", "string", "$", "key", ")", ":", "OptionRepository", "{", "if", "(", "!", "$", "this", "->", "has", "(", "$", "key", ")", ")", "{", "throw", "UnknownOptionKey", "::", "fromKey", "(", "$", "key", ")", ";", "}...
Get the associated repository for a specific key. @since 0.1.0 @param string $key Key to fetch the repository for. @return OptionRepository The repository that is associated with the requested key.
[ "Get", "the", "associated", "repository", "for", "a", "specific", "key", "." ]
9a9ef2a160bbacd69fe3e9db0be8ed89e6905ef1
https://github.com/brightnucleus/options-store/blob/9a9ef2a160bbacd69fe3e9db0be8ed89e6905ef1/src/OptionRepository/IdentityMap.php#L108-L115
202,005
brightnucleus/options-store
src/OptionRepository/IdentityMap.php
IdentityMap.put
public function put(Option $option, OptionRepository $repository): Option { $this->map[$option->getKey()] = [ self::SUBKEY_OPTION => $option, self::SUBKEY_REPOSITORY => $repository, ]; return $option; }
php
public function put(Option $option, OptionRepository $repository): Option { $this->map[$option->getKey()] = [ self::SUBKEY_OPTION => $option, self::SUBKEY_REPOSITORY => $repository, ]; return $option; }
[ "public", "function", "put", "(", "Option", "$", "option", ",", "OptionRepository", "$", "repository", ")", ":", "Option", "{", "$", "this", "->", "map", "[", "$", "option", "->", "getKey", "(", ")", "]", "=", "[", "self", "::", "SUBKEY_OPTION", "=>", ...
Put a new association into the identity map. @since 0.1.0 @param Option $option Option to store for the given key. @param OptionRepository $repository Repository to store for the given key. @return Option $option Option that was stored in the identity map. This might differ from the passed-in $option.
[ "Put", "a", "new", "association", "into", "the", "identity", "map", "." ]
9a9ef2a160bbacd69fe3e9db0be8ed89e6905ef1
https://github.com/brightnucleus/options-store/blob/9a9ef2a160bbacd69fe3e9db0be8ed89e6905ef1/src/OptionRepository/IdentityMap.php#L127-L135
202,006
dmitrya2e/filtration-bundle
Form/Creator/FormCreator.php
FormCreator.createForm
protected function createForm( CollectionInterface $filterCollection, $name = null, array $rootFormBuilderOptions = [], array $filterFormBuilderOptions = [] ) { // Create the root form builder, which is used as the container for all filter forms. $rootFormBui...
php
protected function createForm( CollectionInterface $filterCollection, $name = null, array $rootFormBuilderOptions = [], array $filterFormBuilderOptions = [] ) { // Create the root form builder, which is used as the container for all filter forms. $rootFormBui...
[ "protected", "function", "createForm", "(", "CollectionInterface", "$", "filterCollection", ",", "$", "name", "=", "null", ",", "array", "$", "rootFormBuilderOptions", "=", "[", "]", ",", "array", "$", "filterFormBuilderOptions", "=", "[", "]", ")", "{", "// C...
Creates the filtration form. @param CollectionInterface $filterCollection The collection of the filters @param null|string $name (Optional) The name of the root form @param array $rootFormBuilderOptions (Optional) The options for the root form @param array ...
[ "Creates", "the", "filtration", "form", "." ]
fed5764af4e43871835744fb84957b2a76e9a215
https://github.com/dmitrya2e/filtration-bundle/blob/fed5764af4e43871835744fb84957b2a76e9a215/Form/Creator/FormCreator.php#L95-L129
202,007
dmitrya2e/filtration-bundle
Form/Creator/FormCreator.php
FormCreator.appendFormField
protected function appendFormField(FilterHasFormInterface $filter, FormBuilderInterface $filterFormBuilder) { if (!($filter instanceof CustomAppendFormFieldsInterface)) { $filter->appendFormFieldsToForm($filterFormBuilder); return $filter; } $callableFunctio...
php
protected function appendFormField(FilterHasFormInterface $filter, FormBuilderInterface $filterFormBuilder) { if (!($filter instanceof CustomAppendFormFieldsInterface)) { $filter->appendFormFieldsToForm($filterFormBuilder); return $filter; } $callableFunctio...
[ "protected", "function", "appendFormField", "(", "FilterHasFormInterface", "$", "filter", ",", "FormBuilderInterface", "$", "filterFormBuilder", ")", "{", "if", "(", "!", "(", "$", "filter", "instanceof", "CustomAppendFormFieldsInterface", ")", ")", "{", "$", "filte...
The main "actor" here. Appends a filter to the representation form. If the filter has defined a custom function for form appending, than it will be used. @param FilterHasFormInterface $filter The filter @param FormBuilderInterface $filterFormBuilder A form builder for a specific filter @return FilterHasF...
[ "The", "main", "actor", "here", ".", "Appends", "a", "filter", "to", "the", "representation", "form", ".", "If", "the", "filter", "has", "defined", "a", "custom", "function", "for", "form", "appending", "than", "it", "will", "be", "used", "." ]
fed5764af4e43871835744fb84957b2a76e9a215
https://github.com/dmitrya2e/filtration-bundle/blob/fed5764af4e43871835744fb84957b2a76e9a215/Form/Creator/FormCreator.php#L141-L161
202,008
dmitrya2e/filtration-bundle
Form/Creator/FormCreator.php
FormCreator.createFormBuilder
protected function createFormBuilder($name = null, $type = 'form', $data = null, array $options = []) { if ($name !== null) { return $this->formFactory->createNamedBuilder($name, $type, $data, $options); } return $this->formFactory->createBuilder($type, $data, $options); ...
php
protected function createFormBuilder($name = null, $type = 'form', $data = null, array $options = []) { if ($name !== null) { return $this->formFactory->createNamedBuilder($name, $type, $data, $options); } return $this->formFactory->createBuilder($type, $data, $options); ...
[ "protected", "function", "createFormBuilder", "(", "$", "name", "=", "null", ",", "$", "type", "=", "'form'", ",", "$", "data", "=", "null", ",", "array", "$", "options", "=", "[", "]", ")", "{", "if", "(", "$", "name", "!==", "null", ")", "{", "...
Creates and returns a form builder. @param null|string $name For named form builder must not be null @param string|object $type Form type @param mixed|null $data Form data @param array $options Form builder options @return FormBuilderInterface
[ "Creates", "and", "returns", "a", "form", "builder", "." ]
fed5764af4e43871835744fb84957b2a76e9a215
https://github.com/dmitrya2e/filtration-bundle/blob/fed5764af4e43871835744fb84957b2a76e9a215/Form/Creator/FormCreator.php#L173-L180
202,009
dmitrya2e/filtration-bundle
Form/Creator/FormCreator.php
FormCreator.validateConfig
protected function validateConfig(array $config) { // For now it's only required to pass a filter form type class. // If you don't want to use a defined form type class, // you can override the FormCreator object, implement FormCreatorInterface and customize it. $requiredKeys = ...
php
protected function validateConfig(array $config) { // For now it's only required to pass a filter form type class. // If you don't want to use a defined form type class, // you can override the FormCreator object, implement FormCreatorInterface and customize it. $requiredKeys = ...
[ "protected", "function", "validateConfig", "(", "array", "$", "config", ")", "{", "// For now it's only required to pass a filter form type class.\r", "// If you don't want to use a defined form type class,\r", "// you can override the FormCreator object, implement FormCreatorInterface and cus...
Validates configuration. @param array $config @throws FormCreatorException
[ "Validates", "configuration", "." ]
fed5764af4e43871835744fb84957b2a76e9a215
https://github.com/dmitrya2e/filtration-bundle/blob/fed5764af4e43871835744fb84957b2a76e9a215/Form/Creator/FormCreator.php#L199-L217
202,010
gplcart/cli
controllers/commands/CategoryGroup.php
CategoryGroup.cmdGetCategoryGroup
public function cmdGetCategoryGroup() { $result = $this->getListCategoryGroup(); $this->outputFormat($result); $this->outputFormatTableCategoryGroup($result); $this->output(); }
php
public function cmdGetCategoryGroup() { $result = $this->getListCategoryGroup(); $this->outputFormat($result); $this->outputFormatTableCategoryGroup($result); $this->output(); }
[ "public", "function", "cmdGetCategoryGroup", "(", ")", "{", "$", "result", "=", "$", "this", "->", "getListCategoryGroup", "(", ")", ";", "$", "this", "->", "outputFormat", "(", "$", "result", ")", ";", "$", "this", "->", "outputFormatTableCategoryGroup", "(...
Callback for "category-group-get" command
[ "Callback", "for", "category", "-", "group", "-", "get", "command" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/CategoryGroup.php#L40-L46
202,011
gplcart/cli
controllers/commands/CategoryGroup.php
CategoryGroup.cmdUpdateCategoryGroup
public function cmdUpdateCategoryGroup() { $params = $this->getParam(); if (empty($params[0]) || count($params) < 2) { $this->errorAndExit($this->text('Invalid command')); } if (!is_numeric($params[0])) { $this->errorAndExit($this->text('Invalid argument'));...
php
public function cmdUpdateCategoryGroup() { $params = $this->getParam(); if (empty($params[0]) || count($params) < 2) { $this->errorAndExit($this->text('Invalid command')); } if (!is_numeric($params[0])) { $this->errorAndExit($this->text('Invalid argument'));...
[ "public", "function", "cmdUpdateCategoryGroup", "(", ")", "{", "$", "params", "=", "$", "this", "->", "getParam", "(", ")", ";", "if", "(", "empty", "(", "$", "params", "[", "0", "]", ")", "||", "count", "(", "$", "params", ")", "<", "2", ")", "{...
Callback for "category-group-update" command
[ "Callback", "for", "category", "-", "group", "-", "update", "command" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/CategoryGroup.php#L110-L128
202,012
gplcart/cli
controllers/commands/CategoryGroup.php
CategoryGroup.addCategoryGroup
protected function addCategoryGroup() { if (!$this->isError()) { $id = $this->category_group->add($this->getSubmitted()); if (empty($id)) { $this->errorAndExit($this->text('Unexpected result')); } $this->line($id); } }
php
protected function addCategoryGroup() { if (!$this->isError()) { $id = $this->category_group->add($this->getSubmitted()); if (empty($id)) { $this->errorAndExit($this->text('Unexpected result')); } $this->line($id); } }
[ "protected", "function", "addCategoryGroup", "(", ")", "{", "if", "(", "!", "$", "this", "->", "isError", "(", ")", ")", "{", "$", "id", "=", "$", "this", "->", "category_group", "->", "add", "(", "$", "this", "->", "getSubmitted", "(", ")", ")", "...
Add a new category group
[ "Add", "a", "new", "category", "group" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/CategoryGroup.php#L193-L202
202,013
gplcart/cli
controllers/commands/CategoryGroup.php
CategoryGroup.submitAddCategoryGroup
protected function submitAddCategoryGroup() { $this->setSubmitted(null, $this->getParam()); $this->validateComponent('category_group'); $this->addCategoryGroup(); }
php
protected function submitAddCategoryGroup() { $this->setSubmitted(null, $this->getParam()); $this->validateComponent('category_group'); $this->addCategoryGroup(); }
[ "protected", "function", "submitAddCategoryGroup", "(", ")", "{", "$", "this", "->", "setSubmitted", "(", "null", ",", "$", "this", "->", "getParam", "(", ")", ")", ";", "$", "this", "->", "validateComponent", "(", "'category_group'", ")", ";", "$", "this"...
Add a new category group at once
[ "Add", "a", "new", "category", "group", "at", "once" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/CategoryGroup.php#L218-L223
202,014
gplcart/cli
controllers/commands/CategoryGroup.php
CategoryGroup.wizardAddCategoryGroup
protected function wizardAddCategoryGroup() { $this->validatePrompt('title', $this->text('Name'), 'category_group'); $this->validatePrompt('store_id', $this->text('Store ID'), 'category_group'); $this->validateMenu('type', $this->text('Type'), 'category_group', $this->category_group->getType...
php
protected function wizardAddCategoryGroup() { $this->validatePrompt('title', $this->text('Name'), 'category_group'); $this->validatePrompt('store_id', $this->text('Store ID'), 'category_group'); $this->validateMenu('type', $this->text('Type'), 'category_group', $this->category_group->getType...
[ "protected", "function", "wizardAddCategoryGroup", "(", ")", "{", "$", "this", "->", "validatePrompt", "(", "'title'", ",", "$", "this", "->", "text", "(", "'Name'", ")", ",", "'category_group'", ")", ";", "$", "this", "->", "validatePrompt", "(", "'store_id...
Add a new category group step by step
[ "Add", "a", "new", "category", "group", "step", "by", "step" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/CategoryGroup.php#L228-L236
202,015
agentmedia/phine-core
src/Core/Snippets/BackendRights/Base/RightsCheckboxes.php
RightsCheckboxes.RenderCheckbox
protected function RenderCheckbox($name) { $checkbox = new Checkbox($this->namePrefix . $name); $class = new \ReflectionClass($this); $checkbox->SetLabel(Trans('Core.' . $class->getShortName() . '.' . $name)); if ($this->Value($name)) { $checkbox->SetChecked(); ...
php
protected function RenderCheckbox($name) { $checkbox = new Checkbox($this->namePrefix . $name); $class = new \ReflectionClass($this); $checkbox->SetLabel(Trans('Core.' . $class->getShortName() . '.' . $name)); if ($this->Value($name)) { $checkbox->SetChecked(); ...
[ "protected", "function", "RenderCheckbox", "(", "$", "name", ")", "{", "$", "checkbox", "=", "new", "Checkbox", "(", "$", "this", "->", "namePrefix", ".", "$", "name", ")", ";", "$", "class", "=", "new", "\\", "ReflectionClass", "(", "$", "this", ")", ...
Renders a specific checkbox @param string $name @return string
[ "Renders", "a", "specific", "checkbox" ]
38c1be8d03ebffae950d00a96da3c612aff67832
https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Snippets/BackendRights/Base/RightsCheckboxes.php#L51-L62
202,016
agentmedia/phine-core
src/Core/Snippets/BackendRights/Base/RightsCheckboxes.php
RightsCheckboxes.Value
protected function Value($name) { if (Request::IsPost()) { return (bool)trim(Request::PostData($this->namePrefix . $name)); } if ($this->Rights()) { return $this->Rights()->$name; } if ($this->ParentRights()) { retur...
php
protected function Value($name) { if (Request::IsPost()) { return (bool)trim(Request::PostData($this->namePrefix . $name)); } if ($this->Rights()) { return $this->Rights()->$name; } if ($this->ParentRights()) { retur...
[ "protected", "function", "Value", "(", "$", "name", ")", "{", "if", "(", "Request", "::", "IsPost", "(", ")", ")", "{", "return", "(", "bool", ")", "trim", "(", "Request", "::", "PostData", "(", "$", "this", "->", "namePrefix", ".", "$", "name", ")...
Gets the posted value of the name, optional name prefix automatically attached @param string $name The checkbox name without prefix
[ "Gets", "the", "posted", "value", "of", "the", "name", "optional", "name", "prefix", "automatically", "attached" ]
38c1be8d03ebffae950d00a96da3c612aff67832
https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Snippets/BackendRights/Base/RightsCheckboxes.php#L67-L82
202,017
leogitpro/php-network
src/Client.php
Client.reset
public function reset() { $this->_headers->clearHeaders(); $this->params = []; $this->postRawData = null; $this->httpClient->reset(); return $this; }
php
public function reset() { $this->_headers->clearHeaders(); $this->params = []; $this->postRawData = null; $this->httpClient->reset(); return $this; }
[ "public", "function", "reset", "(", ")", "{", "$", "this", "->", "_headers", "->", "clearHeaders", "(", ")", ";", "$", "this", "->", "params", "=", "[", "]", ";", "$", "this", "->", "postRawData", "=", "null", ";", "$", "this", "->", "httpClient", ...
Reset request information @return Client
[ "Reset", "request", "information" ]
6428e5081dce336ef36edcca28d8ea2b45bd2fce
https://github.com/leogitpro/php-network/blob/6428e5081dce336ef36edcca28d8ea2b45bd2fce/src/Client.php#L172-L179
202,018
leogitpro/php-network
src/Client.php
Client.send
public function send() { if (empty($this->uri)) { throw new InvalidArgumentException('Invalid url for request.'); } $customRequest = new Request(); $customRequest->setHeaders($this->_headers); $this->httpClient->setRequest($customRequest); $this->httpCli...
php
public function send() { if (empty($this->uri)) { throw new InvalidArgumentException('Invalid url for request.'); } $customRequest = new Request(); $customRequest->setHeaders($this->_headers); $this->httpClient->setRequest($customRequest); $this->httpCli...
[ "public", "function", "send", "(", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "uri", ")", ")", "{", "throw", "new", "InvalidArgumentException", "(", "'Invalid url for request.'", ")", ";", "}", "$", "customRequest", "=", "new", "Request", "(", ...
Send http request @throws InvalidArgumentException @throws RuntimeException @return Response
[ "Send", "http", "request" ]
6428e5081dce336ef36edcca28d8ea2b45bd2fce
https://github.com/leogitpro/php-network/blob/6428e5081dce336ef36edcca28d8ea2b45bd2fce/src/Client.php#L291-L334
202,019
leogitpro/php-network
src/Client.php
Client.genericDefaultHeaders
private function genericDefaultHeaders() { //Cache-Control: no-cache $this->addRawHeaderLine('Cache-Control', 'no-cache'); //Pragma: no-cache $this->addRawHeaderLine('Pragma', 'no-cache'); //Connection: keep-alive $this->addRawHeaderLine('Connection', 'keep-alive')...
php
private function genericDefaultHeaders() { //Cache-Control: no-cache $this->addRawHeaderLine('Cache-Control', 'no-cache'); //Pragma: no-cache $this->addRawHeaderLine('Pragma', 'no-cache'); //Connection: keep-alive $this->addRawHeaderLine('Connection', 'keep-alive')...
[ "private", "function", "genericDefaultHeaders", "(", ")", "{", "//Cache-Control: no-cache", "$", "this", "->", "addRawHeaderLine", "(", "'Cache-Control'", ",", "'no-cache'", ")", ";", "//Pragma: no-cache", "$", "this", "->", "addRawHeaderLine", "(", "'Pragma'", ",", ...
Default request headers
[ "Default", "request", "headers" ]
6428e5081dce336ef36edcca28d8ea2b45bd2fce
https://github.com/leogitpro/php-network/blob/6428e5081dce336ef36edcca28d8ea2b45bd2fce/src/Client.php#L339-L363
202,020
koolkode/k2
src/Log/LoggerManager.php
LoggerManager.getLogger
public function getLogger(ExposedContainerInterface $container, InjectionPointInterface $point = NULL) { $channel = ($point === NULL) ? 'app' : str_replace('\\', '.', $point->getTypeName()); if(isset($this->loggers[$channel])) { return $this->loggers[$channel]; } $logger = new Logger($channel); $l...
php
public function getLogger(ExposedContainerInterface $container, InjectionPointInterface $point = NULL) { $channel = ($point === NULL) ? 'app' : str_replace('\\', '.', $point->getTypeName()); if(isset($this->loggers[$channel])) { return $this->loggers[$channel]; } $logger = new Logger($channel); $l...
[ "public", "function", "getLogger", "(", "ExposedContainerInterface", "$", "container", ",", "InjectionPointInterface", "$", "point", "=", "NULL", ")", "{", "$", "channel", "=", "(", "$", "point", "===", "NULL", ")", "?", "'app'", ":", "str_replace", "(", "'\...
Obtain a logger instance, the log channel will consist of the type name provided by the injection point where all namespace separators will be replaced by periods. @param ExposedContainerInterface $container DI container being used for log handler creation. @param InjectionPointInterface $point The target of the injec...
[ "Obtain", "a", "logger", "instance", "the", "log", "channel", "will", "consist", "of", "the", "type", "name", "provided", "by", "the", "injection", "point", "where", "all", "namespace", "separators", "will", "be", "replaced", "by", "periods", "." ]
c425a1bc7d2f8c567b1b0cc724ca9e8be7087397
https://github.com/koolkode/k2/blob/c425a1bc7d2f8c567b1b0cc724ca9e8be7087397/src/Log/LoggerManager.php#L69-L103
202,021
koolkode/k2
src/Log/LoggerManager.php
LoggerManager.replaceSpecialChars
protected function replaceSpecialChars($input) { if(is_array($input)) { $result = []; foreach($input as $k => $v) { $result[$k] = $this->replaceSpecialChars($v); } return $result; } return strtr($input, [ '\n' => "\n", '\t' => "\t" ]); }
php
protected function replaceSpecialChars($input) { if(is_array($input)) { $result = []; foreach($input as $k => $v) { $result[$k] = $this->replaceSpecialChars($v); } return $result; } return strtr($input, [ '\n' => "\n", '\t' => "\t" ]); }
[ "protected", "function", "replaceSpecialChars", "(", "$", "input", ")", "{", "if", "(", "is_array", "(", "$", "input", ")", ")", "{", "$", "result", "=", "[", "]", ";", "foreach", "(", "$", "input", "as", "$", "k", "=>", "$", "v", ")", "{", "$", ...
Recursively replaces special escape characters for line breaks and tabs with according characters. @param mixed $input @return mixed
[ "Recursively", "replaces", "special", "escape", "characters", "for", "line", "breaks", "and", "tabs", "with", "according", "characters", "." ]
c425a1bc7d2f8c567b1b0cc724ca9e8be7087397
https://github.com/koolkode/k2/blob/c425a1bc7d2f8c567b1b0cc724ca9e8be7087397/src/Log/LoggerManager.php#L158-L176
202,022
ekyna/Table
Bridge/Doctrine/ORM/Source/EntityAdapter.php
EntityAdapter.getQueryBuilderPath
public function getQueryBuilderPath($propertyPath) { if (false === strpos($propertyPath, '.')) { return $this->alias . '.' . $propertyPath; } if (isset($this->paths[$propertyPath])) { return $this->paths[$propertyPath]; } $paths = explode('.', $prope...
php
public function getQueryBuilderPath($propertyPath) { if (false === strpos($propertyPath, '.')) { return $this->alias . '.' . $propertyPath; } if (isset($this->paths[$propertyPath])) { return $this->paths[$propertyPath]; } $paths = explode('.', $prope...
[ "public", "function", "getQueryBuilderPath", "(", "$", "propertyPath", ")", "{", "if", "(", "false", "===", "strpos", "(", "$", "propertyPath", ",", "'.'", ")", ")", "{", "return", "$", "this", "->", "alias", ".", "'.'", ".", "$", "propertyPath", ";", ...
Converts the property path to a query builder path and configures the necessary joins. @param string $propertyPath @return string
[ "Converts", "the", "property", "path", "to", "a", "query", "builder", "path", "and", "configures", "the", "necessary", "joins", "." ]
6f06e8fd8a3248d52f3a91f10508471344db311a
https://github.com/ekyna/Table/blob/6f06e8fd8a3248d52f3a91f10508471344db311a/Bridge/Doctrine/ORM/Source/EntityAdapter.php#L94-L139
202,023
ekyna/Table
Bridge/Doctrine/ORM/Source/EntityAdapter.php
EntityAdapter.getClassMetadata
private function getClassMetadata() { if (null !== $this->metadata) { return $this->metadata; } return $this->metadata = $this->manager->getClassMetadata($this->getSource()->getClass()); }
php
private function getClassMetadata() { if (null !== $this->metadata) { return $this->metadata; } return $this->metadata = $this->manager->getClassMetadata($this->getSource()->getClass()); }
[ "private", "function", "getClassMetadata", "(", ")", "{", "if", "(", "null", "!==", "$", "this", "->", "metadata", ")", "{", "return", "$", "this", "->", "metadata", ";", "}", "return", "$", "this", "->", "metadata", "=", "$", "this", "->", "manager", ...
Returns the class metadata. @return ClassMetadata
[ "Returns", "the", "class", "metadata", "." ]
6f06e8fd8a3248d52f3a91f10508471344db311a
https://github.com/ekyna/Table/blob/6f06e8fd8a3248d52f3a91f10508471344db311a/Bridge/Doctrine/ORM/Source/EntityAdapter.php#L242-L249
202,024
OpenConext-Attic/OpenConext-engineblock-metadata
src/AttributeReleasePolicy.php
AttributeReleasePolicy.getRulesWithSourceSpecification
public function getRulesWithSourceSpecification() { $rulesWithSource = []; foreach ($this->attributeRules as $name => $rules) { $rulesWithSource[$name] = array_filter( $rules, function ($rule) { return isset($rule['source']); ...
php
public function getRulesWithSourceSpecification() { $rulesWithSource = []; foreach ($this->attributeRules as $name => $rules) { $rulesWithSource[$name] = array_filter( $rules, function ($rule) { return isset($rule['source']); ...
[ "public", "function", "getRulesWithSourceSpecification", "(", ")", "{", "$", "rulesWithSource", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "attributeRules", "as", "$", "name", "=>", "$", "rules", ")", "{", "$", "rulesWithSource", "[", "$", "nam...
Return all attribute rules eligible for attribute aggregation. A rule is eligible for attribute aggregation if it contains a source. @return array
[ "Return", "all", "attribute", "rules", "eligible", "for", "attribute", "aggregation", "." ]
236e2f52ef9cf28e71404544a1c4388f63ee535d
https://github.com/OpenConext-Attic/OpenConext-engineblock-metadata/blob/236e2f52ef9cf28e71404544a1c4388f63ee535d/src/AttributeReleasePolicy.php#L87-L101
202,025
OpenConext-Attic/OpenConext-engineblock-metadata
src/AttributeReleasePolicy.php
AttributeReleasePolicy.getSource
public function getSource($attributeName) { if ($this->hasAttribute($attributeName) && isset($this->attributeRules[$attributeName][0]['source'])) { return $this->attributeRules[$attributeName][0]['source']; } return 'idp'; }
php
public function getSource($attributeName) { if ($this->hasAttribute($attributeName) && isset($this->attributeRules[$attributeName][0]['source'])) { return $this->attributeRules[$attributeName][0]['source']; } return 'idp'; }
[ "public", "function", "getSource", "(", "$", "attributeName", ")", "{", "if", "(", "$", "this", "->", "hasAttribute", "(", "$", "attributeName", ")", "&&", "isset", "(", "$", "this", "->", "attributeRules", "[", "$", "attributeName", "]", "[", "0", "]", ...
Loads the first source it finds in the list of attribute rules for the given attributeName. @param $attributeName @return string
[ "Loads", "the", "first", "source", "it", "finds", "in", "the", "list", "of", "attribute", "rules", "for", "the", "given", "attributeName", "." ]
236e2f52ef9cf28e71404544a1c4388f63ee535d
https://github.com/OpenConext-Attic/OpenConext-engineblock-metadata/blob/236e2f52ef9cf28e71404544a1c4388f63ee535d/src/AttributeReleasePolicy.php#L182-L188
202,026
phpffcms/ffcms-core
src/Managers/EventManager.php
EventManager.on
public function on($event, \Closure $callback): void { // check if event is a single string and parse it to array single item if (!Any::isArray($event)) { $event = [$event]; } foreach ($event as $item) { $this->events[$item][] = $callback; } ...
php
public function on($event, \Closure $callback): void { // check if event is a single string and parse it to array single item if (!Any::isArray($event)) { $event = [$event]; } foreach ($event as $item) { $this->events[$item][] = $callback; } ...
[ "public", "function", "on", "(", "$", "event", ",", "\\", "Closure", "$", "callback", ")", ":", "void", "{", "// check if event is a single string and parse it to array single item", "if", "(", "!", "Any", "::", "isArray", "(", "$", "event", ")", ")", "{", "$"...
Catch the event if it occurred after this initiation of interception @param string|array $event @param \Closure $callback
[ "Catch", "the", "event", "if", "it", "occurred", "after", "this", "initiation", "of", "interception" ]
44a309553ef9f115ccfcfd71f2ac6e381c612082
https://github.com/phpffcms/ffcms-core/blob/44a309553ef9f115ccfcfd71f2ac6e381c612082/src/Managers/EventManager.php#L34-L44
202,027
phpffcms/ffcms-core
src/Managers/EventManager.php
EventManager.listen
public function listen($event, \Closure $callback): void { // check if $event is a single string and set it as array with one item if (!Any::isArray($event)) { $event = [$event]; } // each every one event in array foreach ($event as $item) { i...
php
public function listen($event, \Closure $callback): void { // check if $event is a single string and set it as array with one item if (!Any::isArray($event)) { $event = [$event]; } // each every one event in array foreach ($event as $item) { i...
[ "public", "function", "listen", "(", "$", "event", ",", "\\", "Closure", "$", "callback", ")", ":", "void", "{", "// check if $event is a single string and set it as array with one item", "if", "(", "!", "Any", "::", "isArray", "(", "$", "event", ")", ")", "{", ...
Catch the event if it occurred before the initiation of interception @param string|array $event @param \Closure $callback @return void
[ "Catch", "the", "event", "if", "it", "occurred", "before", "the", "initiation", "of", "interception" ]
44a309553ef9f115ccfcfd71f2ac6e381c612082
https://github.com/phpffcms/ffcms-core/blob/44a309553ef9f115ccfcfd71f2ac6e381c612082/src/Managers/EventManager.php#L52-L65
202,028
phpffcms/ffcms-core
src/Managers/EventManager.php
EventManager.run
public function run(): void { // dynamicly parse input params $args = func_get_args(); if (count($args) < 1) { return; } // get event name $eventName = array_shift($args); // get event args as array if passed $eventArgs = ...
php
public function run(): void { // dynamicly parse input params $args = func_get_args(); if (count($args) < 1) { return; } // get event name $eventName = array_shift($args); // get event args as array if passed $eventArgs = ...
[ "public", "function", "run", "(", ")", ":", "void", "{", "// dynamicly parse input params", "$", "args", "=", "func_get_args", "(", ")", ";", "if", "(", "count", "(", "$", "args", ")", "<", "1", ")", "{", "return", ";", "}", "// get event name", "$", "...
Process event on happens @return void
[ "Process", "event", "on", "happens" ]
44a309553ef9f115ccfcfd71f2ac6e381c612082
https://github.com/phpffcms/ffcms-core/blob/44a309553ef9f115ccfcfd71f2ac6e381c612082/src/Managers/EventManager.php#L71-L95
202,029
miguelibero/meinhof
src/Meinhof/DependencyInjection/Compiler/EventListenerPass.php
EventListenerPass.getMethodFromAttributes
protected function getMethodFromAttributes($attrs) { if (!is_array($attrs) || !isset($attrs['method'])) { return $this->getEventFromAttributes($attrs); } return $attrs['method']; }
php
protected function getMethodFromAttributes($attrs) { if (!is_array($attrs) || !isset($attrs['method'])) { return $this->getEventFromAttributes($attrs); } return $attrs['method']; }
[ "protected", "function", "getMethodFromAttributes", "(", "$", "attrs", ")", "{", "if", "(", "!", "is_array", "(", "$", "attrs", ")", "||", "!", "isset", "(", "$", "attrs", "[", "'method'", "]", ")", ")", "{", "return", "$", "this", "->", "getEventFromA...
Returns the event method from the tag attributes. @param mixed $attrs tag attributes @return string event method
[ "Returns", "the", "event", "method", "from", "the", "tag", "attributes", "." ]
3a090f08485dc0da3e27463cf349dba374201072
https://github.com/miguelibero/meinhof/blob/3a090f08485dc0da3e27463cf349dba374201072/src/Meinhof/DependencyInjection/Compiler/EventListenerPass.php#L56-L63
202,030
miguelibero/meinhof
src/Meinhof/DependencyInjection/Compiler/EventListenerPass.php
EventListenerPass.getPriorityFromAttributes
protected function getPriorityFromAttributes($attrs) { if (!is_array($attrs) || !isset($attrs['priority'])) { return 0; } $p = intval($attrs['priority']); return $p < 0 ? 0 : $p; }
php
protected function getPriorityFromAttributes($attrs) { if (!is_array($attrs) || !isset($attrs['priority'])) { return 0; } $p = intval($attrs['priority']); return $p < 0 ? 0 : $p; }
[ "protected", "function", "getPriorityFromAttributes", "(", "$", "attrs", ")", "{", "if", "(", "!", "is_array", "(", "$", "attrs", ")", "||", "!", "isset", "(", "$", "attrs", "[", "'priority'", "]", ")", ")", "{", "return", "0", ";", "}", "$", "p", ...
Returns the event priority from the tag attributes. If no priority specified returns priority 0. @param mixed $attrs tag attributes @return string event priotity
[ "Returns", "the", "event", "priority", "from", "the", "tag", "attributes", ".", "If", "no", "priority", "specified", "returns", "priority", "0", "." ]
3a090f08485dc0da3e27463cf349dba374201072
https://github.com/miguelibero/meinhof/blob/3a090f08485dc0da3e27463cf349dba374201072/src/Meinhof/DependencyInjection/Compiler/EventListenerPass.php#L73-L81
202,031
alexlcdee/colorcli
src/Logger.php
Logger.checkLevel
public function checkLevel($level) { if (static::$levels === null) { // Psr\Log does not provide Enum, so we need to load levels from LogLevel constants $reflection = new \ReflectionClass(LogLevel::class); static::$levels = $reflection->getConstants(); } ...
php
public function checkLevel($level) { if (static::$levels === null) { // Psr\Log does not provide Enum, so we need to load levels from LogLevel constants $reflection = new \ReflectionClass(LogLevel::class); static::$levels = $reflection->getConstants(); } ...
[ "public", "function", "checkLevel", "(", "$", "level", ")", "{", "if", "(", "static", "::", "$", "levels", "===", "null", ")", "{", "// Psr\\Log does not provide Enum, so we need to load levels from LogLevel constants", "$", "reflection", "=", "new", "\\", "Reflection...
Check if level exists in list of possible levels Psr\Log suggests to throw Psr\Log\InvalidArgumentException if incompatible log level passed @param mixed $level @throws InvalidArgumentException
[ "Check", "if", "level", "exists", "in", "list", "of", "possible", "levels", "Psr", "\\", "Log", "suggests", "to", "throw", "Psr", "\\", "Log", "\\", "InvalidArgumentException", "if", "incompatible", "log", "level", "passed" ]
2107917987f6c300ac5ce4a26102c9bf8e6b3d95
https://github.com/alexlcdee/colorcli/blob/2107917987f6c300ac5ce4a26102c9bf8e6b3d95/src/Logger.php#L61-L73
202,032
alexlcdee/colorcli
src/Logger.php
Logger.resetFGColors
public function resetFGColors() { static::$foregroundColorMap = [ LogLevel::EMERGENCY => ForegroundColors::YELLOW(), LogLevel::ALERT => ForegroundColors::WHITE(), LogLevel::CRITICAL => ForegroundColors::RED(), LogLevel::ERROR => ForegroundColors::LIGHT_RED(), ...
php
public function resetFGColors() { static::$foregroundColorMap = [ LogLevel::EMERGENCY => ForegroundColors::YELLOW(), LogLevel::ALERT => ForegroundColors::WHITE(), LogLevel::CRITICAL => ForegroundColors::RED(), LogLevel::ERROR => ForegroundColors::LIGHT_RED(), ...
[ "public", "function", "resetFGColors", "(", ")", "{", "static", "::", "$", "foregroundColorMap", "=", "[", "LogLevel", "::", "EMERGENCY", "=>", "ForegroundColors", "::", "YELLOW", "(", ")", ",", "LogLevel", "::", "ALERT", "=>", "ForegroundColors", "::", "WHITE...
Set foreground colors map to default ones
[ "Set", "foreground", "colors", "map", "to", "default", "ones" ]
2107917987f6c300ac5ce4a26102c9bf8e6b3d95
https://github.com/alexlcdee/colorcli/blob/2107917987f6c300ac5ce4a26102c9bf8e6b3d95/src/Logger.php#L91-L103
202,033
alexlcdee/colorcli
src/Logger.php
Logger.resetBGColor
public function resetBGColor() { static::$backgroundColorMap = [ LogLevel::EMERGENCY => BackgroundColors::RED(), LogLevel::ALERT => BackgroundColors::RED(), LogLevel::CRITICAL => BackgroundColors::YELLOW(), LogLevel::ERROR => null, LogLevel::WARNIN...
php
public function resetBGColor() { static::$backgroundColorMap = [ LogLevel::EMERGENCY => BackgroundColors::RED(), LogLevel::ALERT => BackgroundColors::RED(), LogLevel::CRITICAL => BackgroundColors::YELLOW(), LogLevel::ERROR => null, LogLevel::WARNIN...
[ "public", "function", "resetBGColor", "(", ")", "{", "static", "::", "$", "backgroundColorMap", "=", "[", "LogLevel", "::", "EMERGENCY", "=>", "BackgroundColors", "::", "RED", "(", ")", ",", "LogLevel", "::", "ALERT", "=>", "BackgroundColors", "::", "RED", "...
Set background colors map to default ones
[ "Set", "background", "colors", "map", "to", "default", "ones" ]
2107917987f6c300ac5ce4a26102c9bf8e6b3d95
https://github.com/alexlcdee/colorcli/blob/2107917987f6c300ac5ce4a26102c9bf8e6b3d95/src/Logger.php#L121-L133
202,034
alexlcdee/colorcli
src/Logger.php
Logger.resetOutputStreams
public function resetOutputStreams() { defined('STDOUT') || define('STDOUT', fopen('php://stdout', 'w')); defined('STDERR') || define('STDERR', fopen('php://stderr', 'w')); static::$streamsMap = [ LogLevel::EMERGENCY => STDERR, LogLevel::ALERT => STDERR, L...
php
public function resetOutputStreams() { defined('STDOUT') || define('STDOUT', fopen('php://stdout', 'w')); defined('STDERR') || define('STDERR', fopen('php://stderr', 'w')); static::$streamsMap = [ LogLevel::EMERGENCY => STDERR, LogLevel::ALERT => STDERR, L...
[ "public", "function", "resetOutputStreams", "(", ")", "{", "defined", "(", "'STDOUT'", ")", "||", "define", "(", "'STDOUT'", ",", "fopen", "(", "'php://stdout'", ",", "'w'", ")", ")", ";", "defined", "(", "'STDERR'", ")", "||", "define", "(", "'STDERR'", ...
Set output streams map to default map
[ "Set", "output", "streams", "map", "to", "default", "map" ]
2107917987f6c300ac5ce4a26102c9bf8e6b3d95
https://github.com/alexlcdee/colorcli/blob/2107917987f6c300ac5ce4a26102c9bf8e6b3d95/src/Logger.php#L209-L223
202,035
alexlcdee/colorcli
src/Logger.php
Logger.setFGColor
public function setFGColor($level, ForegroundColors $color) { if (static::$foregroundColorMap === null) { $this->resetFGColors(); } $this->checkLevel($level); static::$foregroundColorMap[$level] = $color; return $this; }
php
public function setFGColor($level, ForegroundColors $color) { if (static::$foregroundColorMap === null) { $this->resetFGColors(); } $this->checkLevel($level); static::$foregroundColorMap[$level] = $color; return $this; }
[ "public", "function", "setFGColor", "(", "$", "level", ",", "ForegroundColors", "$", "color", ")", "{", "if", "(", "static", "::", "$", "foregroundColorMap", "===", "null", ")", "{", "$", "this", "->", "resetFGColors", "(", ")", ";", "}", "$", "this", ...
Set foreground color for specified level @param mixed $level @param ForegroundColors $color @return $this
[ "Set", "foreground", "color", "for", "specified", "level" ]
2107917987f6c300ac5ce4a26102c9bf8e6b3d95
https://github.com/alexlcdee/colorcli/blob/2107917987f6c300ac5ce4a26102c9bf8e6b3d95/src/Logger.php#L231-L239
202,036
alexlcdee/colorcli
src/Logger.php
Logger.setBGColor
public function setBGColor($level, ForegroundColors $color) { if (static::$foregroundColorMap === null) { $this->resetBGColor(); } $this->checkLevel($level); static::$foregroundColorMap[$level] = $color; return $this; }
php
public function setBGColor($level, ForegroundColors $color) { if (static::$foregroundColorMap === null) { $this->resetBGColor(); } $this->checkLevel($level); static::$foregroundColorMap[$level] = $color; return $this; }
[ "public", "function", "setBGColor", "(", "$", "level", ",", "ForegroundColors", "$", "color", ")", "{", "if", "(", "static", "::", "$", "foregroundColorMap", "===", "null", ")", "{", "$", "this", "->", "resetBGColor", "(", ")", ";", "}", "$", "this", "...
Set background color for specified level @param mixed $level @param ForegroundColors $color @return $this
[ "Set", "background", "color", "for", "specified", "level" ]
2107917987f6c300ac5ce4a26102c9bf8e6b3d95
https://github.com/alexlcdee/colorcli/blob/2107917987f6c300ac5ce4a26102c9bf8e6b3d95/src/Logger.php#L247-L255
202,037
alexlcdee/colorcli
src/Logger.php
Logger.setOutputStream
public function setOutputStream($level, $stream) { if (static::$streamsMap === null) { $this->resetOutputStreams(); } $this->checkLevel($level); if (!is_resource($stream)) { throw new \UnexpectedValueException("Argument '\$stream' must be a writable stream res...
php
public function setOutputStream($level, $stream) { if (static::$streamsMap === null) { $this->resetOutputStreams(); } $this->checkLevel($level); if (!is_resource($stream)) { throw new \UnexpectedValueException("Argument '\$stream' must be a writable stream res...
[ "public", "function", "setOutputStream", "(", "$", "level", ",", "$", "stream", ")", "{", "if", "(", "static", "::", "$", "streamsMap", "===", "null", ")", "{", "$", "this", "->", "resetOutputStreams", "(", ")", ";", "}", "$", "this", "->", "checkLevel...
Set output stream for specified level @param mixed $level @param resource $stream @return $this
[ "Set", "output", "stream", "for", "specified", "level" ]
2107917987f6c300ac5ce4a26102c9bf8e6b3d95
https://github.com/alexlcdee/colorcli/blob/2107917987f6c300ac5ce4a26102c9bf8e6b3d95/src/Logger.php#L263-L274
202,038
ekyna/SettingBundle
Controller/Admin/ParameterController.php
ParameterController.showAction
public function showAction() { $this->isGranted('VIEW'); $this->container->get('ekyna_admin.menu.builder') ->breadcrumbAppend('settings', 'ekyna_setting.parameter.label.plural'); $manager = $this->getSettingsManager(); $schemas = $this->getSettingsRegistry()->ge...
php
public function showAction() { $this->isGranted('VIEW'); $this->container->get('ekyna_admin.menu.builder') ->breadcrumbAppend('settings', 'ekyna_setting.parameter.label.plural'); $manager = $this->getSettingsManager(); $schemas = $this->getSettingsRegistry()->ge...
[ "public", "function", "showAction", "(", ")", "{", "$", "this", "->", "isGranted", "(", "'VIEW'", ")", ";", "$", "this", "->", "container", "->", "get", "(", "'ekyna_admin.menu.builder'", ")", "->", "breadcrumbAppend", "(", "'settings'", ",", "'ekyna_setting.p...
Show the parameters. @return \Symfony\Component\HttpFoundation\Response
[ "Show", "the", "parameters", "." ]
df58f83eb3a01ef56cd76ea73639322c581e75c1
https://github.com/ekyna/SettingBundle/blob/df58f83eb3a01ef56cd76ea73639322c581e75c1/Controller/Admin/ParameterController.php#L22-L42
202,039
ekyna/SettingBundle
Controller/Admin/ParameterController.php
ParameterController.editAction
public function editAction(Request $request) { $this->isGranted('EDIT'); $this->container->get('ekyna_admin.menu.builder') ->breadcrumbAppend('settings', 'ekyna_setting.parameter.label.plural'); $manager = $this->getSettingsManager(); $schemas = $this->getSettingsRegist...
php
public function editAction(Request $request) { $this->isGranted('EDIT'); $this->container->get('ekyna_admin.menu.builder') ->breadcrumbAppend('settings', 'ekyna_setting.parameter.label.plural'); $manager = $this->getSettingsManager(); $schemas = $this->getSettingsRegist...
[ "public", "function", "editAction", "(", "Request", "$", "request", ")", "{", "$", "this", "->", "isGranted", "(", "'EDIT'", ")", ";", "$", "this", "->", "container", "->", "get", "(", "'ekyna_admin.menu.builder'", ")", "->", "breadcrumbAppend", "(", "'setti...
Edit the parameters. @param Request $request @return \Symfony\Component\HttpFoundation\Response
[ "Edit", "the", "parameters", "." ]
df58f83eb3a01ef56cd76ea73639322c581e75c1
https://github.com/ekyna/SettingBundle/blob/df58f83eb3a01ef56cd76ea73639322c581e75c1/Controller/Admin/ParameterController.php#L50-L124
202,040
ziopod/Tanuki-core
classes/View/Tanuki.php
View_Tanuki.title
public function title() { // Try to load title from model $model_name = $this->model_name; if (isset($this->$model_name->title)) { return $this->$model_name->title; } // Instead use global config return Arr::path($this->tanuki(), 'title'); }
php
public function title() { // Try to load title from model $model_name = $this->model_name; if (isset($this->$model_name->title)) { return $this->$model_name->title; } // Instead use global config return Arr::path($this->tanuki(), 'title'); }
[ "public", "function", "title", "(", ")", "{", "// Try to load title from model", "$", "model_name", "=", "$", "this", "->", "model_name", ";", "if", "(", "isset", "(", "$", "this", "->", "$", "model_name", "->", "title", ")", ")", "{", "return", "$", "th...
Set HTML title tag @return string
[ "Set", "HTML", "title", "tag" ]
8dbe2dd45c6cafd0029aa747cd1ffebea4a936ab
https://github.com/ziopod/Tanuki-core/blob/8dbe2dd45c6cafd0029aa747cd1ffebea4a936ab/classes/View/Tanuki.php#L133-L145
202,041
mtils/cmsable
src/Cmsable/Mail/MessageBuilder.php
MessageBuilder.setupMessage
public function setupMessage(Message $message){ $this->addRecipients($message); $this->setSubject($message); $this->callCustomBuilder($message); }
php
public function setupMessage(Message $message){ $this->addRecipients($message); $this->setSubject($message); $this->callCustomBuilder($message); }
[ "public", "function", "setupMessage", "(", "Message", "$", "message", ")", "{", "$", "this", "->", "addRecipients", "(", "$", "message", ")", ";", "$", "this", "->", "setSubject", "(", "$", "message", ")", ";", "$", "this", "->", "callCustomBuilder", "("...
This method will be called by the returned closure @param \Illuminate\Mail\Message $message @return void
[ "This", "method", "will", "be", "called", "by", "the", "returned", "closure" ]
03ae84ee3c7d46146f2a1cf687e5c29d6de4286d
https://github.com/mtils/cmsable/blob/03ae84ee3c7d46146f2a1cf687e5c29d6de4286d/src/Cmsable/Mail/MessageBuilder.php#L57-L65
202,042
mtils/cmsable
src/Cmsable/Mail/MessageBuilder.php
MessageBuilder.addRecipients
protected function addRecipients(Message $message){ if($overwriteTo = $this->getOverwriteTo()){ $message->to($overwriteTo); return; } $first = true; foreach($this->recipients as $recipient){ if($first){ $message->to($recipient); ...
php
protected function addRecipients(Message $message){ if($overwriteTo = $this->getOverwriteTo()){ $message->to($overwriteTo); return; } $first = true; foreach($this->recipients as $recipient){ if($first){ $message->to($recipient); ...
[ "protected", "function", "addRecipients", "(", "Message", "$", "message", ")", "{", "if", "(", "$", "overwriteTo", "=", "$", "this", "->", "getOverwriteTo", "(", ")", ")", "{", "$", "message", "->", "to", "(", "$", "overwriteTo", ")", ";", "return", ";...
Adds the recipients to the message @param \Illuminate\Mail\Message $message @return void
[ "Adds", "the", "recipients", "to", "the", "message" ]
03ae84ee3c7d46146f2a1cf687e5c29d6de4286d
https://github.com/mtils/cmsable/blob/03ae84ee3c7d46146f2a1cf687e5c29d6de4286d/src/Cmsable/Mail/MessageBuilder.php#L105-L127
202,043
mtils/cmsable
src/Cmsable/Mail/MessageBuilder.php
MessageBuilder.setSubject
protected function setSubject(Message $message){ if(!isset($this->data['subject'])){ throw new OutOfBoundsException("You have to pass a subject key and value in your view data"); } $message->subject($this->data['subject']); }
php
protected function setSubject(Message $message){ if(!isset($this->data['subject'])){ throw new OutOfBoundsException("You have to pass a subject key and value in your view data"); } $message->subject($this->data['subject']); }
[ "protected", "function", "setSubject", "(", "Message", "$", "message", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "data", "[", "'subject'", "]", ")", ")", "{", "throw", "new", "OutOfBoundsException", "(", "\"You have to pass a subject key and v...
Sets tzhe subject of the message @param \Illuminate\Mail\Message $message @return void
[ "Sets", "tzhe", "subject", "of", "the", "message" ]
03ae84ee3c7d46146f2a1cf687e5c29d6de4286d
https://github.com/mtils/cmsable/blob/03ae84ee3c7d46146f2a1cf687e5c29d6de4286d/src/Cmsable/Mail/MessageBuilder.php#L135-L143
202,044
bytic/orm
src/Relations/Traits/HasPivotTable.php
HasPivotTable.generatePivotTable
public function generatePivotTable() { $tables = [ $this->getManager()->getTable(), $this->getWith()->getTable() ]; sort($tables); return implode("_", $tables); }
php
public function generatePivotTable() { $tables = [ $this->getManager()->getTable(), $this->getWith()->getTable() ]; sort($tables); return implode("_", $tables); }
[ "public", "function", "generatePivotTable", "(", ")", "{", "$", "tables", "=", "[", "$", "this", "->", "getManager", "(", ")", "->", "getTable", "(", ")", ",", "$", "this", "->", "getWith", "(", ")", "->", "getTable", "(", ")", "]", ";", "sort", "(...
Builds the name of a has-and-belongs-to-many association table @return string
[ "Builds", "the", "name", "of", "a", "has", "-", "and", "-", "belongs", "-", "to", "-", "many", "association", "table" ]
8d9a79b47761af0bfd9b8d1d28c83221dcac0de0
https://github.com/bytic/orm/blob/8d9a79b47761af0bfd9b8d1d28c83221dcac0de0/src/Relations/Traits/HasPivotTable.php#L46-L55
202,045
kherge-abandoned/php-service-process
src/lib/Herrera/Service/Process/Process.php
Process.glob
public function glob($pattern) { foreach (glob($pattern) as $result) { $this->builder->add($result); } }
php
public function glob($pattern) { foreach (glob($pattern) as $result) { $this->builder->add($result); } }
[ "public", "function", "glob", "(", "$", "pattern", ")", "{", "foreach", "(", "glob", "(", "$", "pattern", ")", "as", "$", "result", ")", "{", "$", "this", "->", "builder", "->", "add", "(", "$", "result", ")", ";", "}", "}" ]
Expands the glob pattern and add the results as arguments. @param string $pattern The glob pattern. @return Process For method chaining.
[ "Expands", "the", "glob", "pattern", "and", "add", "the", "results", "as", "arguments", "." ]
33b6e17c027d99dcb38bfe66f250b56800a525fa
https://github.com/kherge-abandoned/php-service-process/blob/33b6e17c027d99dcb38bfe66f250b56800a525fa/src/lib/Herrera/Service/Process/Process.php#L90-L95
202,046
SevenEcks/string-utils
src/StringUtils.php
StringUtils.tostr
public function tostr(...$strings) { $new_string = ''; foreach ($strings as $temp) { switch (gettype($temp)) { case "array": $it = new \RecursiveIteratorIterator(new \RecursiveArrayIterator($temp)); foreach($it as $v) { ...
php
public function tostr(...$strings) { $new_string = ''; foreach ($strings as $temp) { switch (gettype($temp)) { case "array": $it = new \RecursiveIteratorIterator(new \RecursiveArrayIterator($temp)); foreach($it as $v) { ...
[ "public", "function", "tostr", "(", "...", "$", "strings", ")", "{", "$", "new_string", "=", "''", ";", "foreach", "(", "$", "strings", "as", "$", "temp", ")", "{", "switch", "(", "gettype", "(", "$", "temp", ")", ")", "{", "case", "\"array\"", ":"...
Take n arguments and combine them into a single string and return that string @param string $strings @param ... $strings @return string
[ "Take", "n", "arguments", "and", "combine", "them", "into", "a", "single", "string", "and", "return", "that", "string" ]
3d1fc3cbac2a77d1fbd52c4eca1868f6136ae3a0
https://github.com/SevenEcks/string-utils/blob/3d1fc3cbac2a77d1fbd52c4eca1868f6136ae3a0/src/StringUtils.php#L136-L154
202,047
SevenEcks/string-utils
src/StringUtils.php
StringUtils.wordWrap
public function wordWrap($string) { return wordwrap($string, $this->line_length, $this->break_string, $this->split_mid_word); }
php
public function wordWrap($string) { return wordwrap($string, $this->line_length, $this->break_string, $this->split_mid_word); }
[ "public", "function", "wordWrap", "(", "$", "string", ")", "{", "return", "wordwrap", "(", "$", "string", ",", "$", "this", "->", "line_length", ",", "$", "this", "->", "break_string", ",", "$", "this", "->", "split_mid_word", ")", ";", "}" ]
Return a string wrapped either at a word, or close to the words completion using the break_string defined on the object @param string $string @return none
[ "Return", "a", "string", "wrapped", "either", "at", "a", "word", "or", "close", "to", "the", "words", "completion", "using", "the", "break_string", "defined", "on", "the", "object" ]
3d1fc3cbac2a77d1fbd52c4eca1868f6136ae3a0
https://github.com/SevenEcks/string-utils/blob/3d1fc3cbac2a77d1fbd52c4eca1868f6136ae3a0/src/StringUtils.php#L176-L179
202,048
SevenEcks/string-utils
src/StringUtils.php
StringUtils.massColor
public function massColor(array $strings, string $color) { $len_array = count($strings); for ($i = 0; $i < $len_array; $i++) { $strings[$i] = $this->colorize->{$color}($strings[$i]); } return $strings; }
php
public function massColor(array $strings, string $color) { $len_array = count($strings); for ($i = 0; $i < $len_array; $i++) { $strings[$i] = $this->colorize->{$color}($strings[$i]); } return $strings; }
[ "public", "function", "massColor", "(", "array", "$", "strings", ",", "string", "$", "color", ")", "{", "$", "len_array", "=", "count", "(", "$", "strings", ")", ";", "for", "(", "$", "i", "=", "0", ";", "$", "i", "<", "$", "len_array", ";", "$",...
Mass colorize an array of strings @param array $strings @param string $color @return array
[ "Mass", "colorize", "an", "array", "of", "strings" ]
3d1fc3cbac2a77d1fbd52c4eca1868f6136ae3a0
https://github.com/SevenEcks/string-utils/blob/3d1fc3cbac2a77d1fbd52c4eca1868f6136ae3a0/src/StringUtils.php#L308-L315
202,049
SagittariusX/Beluga.Drawing
src/Beluga/Drawing/Color.php
Color.setRGB
public function setRGB( $rgbValue ) : Color { if ( \is_string( $rgbValue ) ) { $this->setRGBString( $rgbValue ); } else if ( \is_array( $rgbValue ) && \count( $rgbValue ) > 2 ) { $this->setRGBArray( $rgbValue ); } else { throw new ArgumentEr...
php
public function setRGB( $rgbValue ) : Color { if ( \is_string( $rgbValue ) ) { $this->setRGBString( $rgbValue ); } else if ( \is_array( $rgbValue ) && \count( $rgbValue ) > 2 ) { $this->setRGBArray( $rgbValue ); } else { throw new ArgumentEr...
[ "public", "function", "setRGB", "(", "$", "rgbValue", ")", ":", "Color", "{", "if", "(", "\\", "is_string", "(", "$", "rgbValue", ")", ")", "{", "$", "this", "->", "setRGBString", "(", "$", "rgbValue", ")", ";", "}", "else", "if", "(", "\\", "is_ar...
Sets a new color, defined by a valid RGB value. If a string is used the following formats are valid: 'rgb(r,g,b)' or 'r,g,b' Or a array (0=r,1=g,2=b) or associative with keys 'r'|'red', 'g'|'green', 'b'|'blue' @param string|array $rgbValue @return \Beluga\Drawing\Color @throws \Beluga\ArgumentError
[ "Sets", "a", "new", "color", "defined", "by", "a", "valid", "RGB", "value", "." ]
9c82874cf4ec68cb0af78757b65f19783540004a
https://github.com/SagittariusX/Beluga.Drawing/blob/9c82874cf4ec68cb0af78757b65f19783540004a/src/Beluga/Drawing/Color.php#L287-L310
202,050
SagittariusX/Beluga.Drawing
src/Beluga/Drawing/Color.php
Color.FromString
public static function FromString( $objectString ) { if ( false !== ( $rgb = ColorTool::Color2Rgb( $objectString ) ) ) { return new Color( ColorTool::Rgb2Hex( $rgb[ 0 ], $rgb[ 1 ], $rgb[ 2 ] ) ); } if ( f...
php
public static function FromString( $objectString ) { if ( false !== ( $rgb = ColorTool::Color2Rgb( $objectString ) ) ) { return new Color( ColorTool::Rgb2Hex( $rgb[ 0 ], $rgb[ 1 ], $rgb[ 2 ] ) ); } if ( f...
[ "public", "static", "function", "FromString", "(", "$", "objectString", ")", "{", "if", "(", "false", "!==", "(", "$", "rgb", "=", "ColorTool", "::", "Color2Rgb", "(", "$", "objectString", ")", ")", ")", "{", "return", "new", "Color", "(", "ColorTool", ...
Init a new instance from defined string. @param string $objectString @return \Beluga\Drawing\Color
[ "Init", "a", "new", "instance", "from", "defined", "string", "." ]
9c82874cf4ec68cb0af78757b65f19783540004a
https://github.com/SagittariusX/Beluga.Drawing/blob/9c82874cf4ec68cb0af78757b65f19783540004a/src/Beluga/Drawing/Color.php#L701-L722
202,051
SagittariusX/Beluga.Drawing
src/Beluga/Drawing/Color.php
Color.FromArray
public static function FromArray( array $objectData ) { if ( \count( $objectData ) == 3 ) { if ( false !== ( $hex = ColorTool::Color2Hex( $objectData ) ) ) { return new Color( $hex ); } } $rgb = array(); if ( isset( $objectData[ 'r' ] ) ) ...
php
public static function FromArray( array $objectData ) { if ( \count( $objectData ) == 3 ) { if ( false !== ( $hex = ColorTool::Color2Hex( $objectData ) ) ) { return new Color( $hex ); } } $rgb = array(); if ( isset( $objectData[ 'r' ] ) ) ...
[ "public", "static", "function", "FromArray", "(", "array", "$", "objectData", ")", "{", "if", "(", "\\", "count", "(", "$", "objectData", ")", "==", "3", ")", "{", "if", "(", "false", "!==", "(", "$", "hex", "=", "ColorTool", "::", "Color2Hex", "(", ...
Init a new instance from defined array. @param array $objectData @return \Beluga\Drawing\Color Or boolean FALSE
[ "Init", "a", "new", "instance", "from", "defined", "array", "." ]
9c82874cf4ec68cb0af78757b65f19783540004a
https://github.com/SagittariusX/Beluga.Drawing/blob/9c82874cf4ec68cb0af78757b65f19783540004a/src/Beluga/Drawing/Color.php#L730-L801
202,052
SagittariusX/Beluga.Drawing
src/Beluga/Drawing/Color.php
Color.FromGdValueWithAlpha
public static function FromGdValueWithAlpha( $gdValueWithAlpha ) { $a = ( $gdValueWithAlpha >> 24 ) & 0xFF; $r = ( $gdValueWithAlpha >> 16 ) & 0xFF; $g = ( $gdValueWithAlpha >> 8 ) & 0xFF; $b = $gdValueWithAlpha & 0xFF; if ( $a == 0 ) { $o = 0; } else if ( ...
php
public static function FromGdValueWithAlpha( $gdValueWithAlpha ) { $a = ( $gdValueWithAlpha >> 24 ) & 0xFF; $r = ( $gdValueWithAlpha >> 16 ) & 0xFF; $g = ( $gdValueWithAlpha >> 8 ) & 0xFF; $b = $gdValueWithAlpha & 0xFF; if ( $a == 0 ) { $o = 0; } else if ( ...
[ "public", "static", "function", "FromGdValueWithAlpha", "(", "$", "gdValueWithAlpha", ")", "{", "$", "a", "=", "(", "$", "gdValueWithAlpha", ">>", "24", ")", "&", "0xFF", ";", "$", "r", "=", "(", "$", "gdValueWithAlpha", ">>", "16", ")", "&", "0xFF", "...
Converts a GD integer value as color with alpha channel to an \Beluga\Drawing\Color instance. @param int $gdValueWithAlpha @return \Beluga\Drawing\Color
[ "Converts", "a", "GD", "integer", "value", "as", "color", "with", "alpha", "channel", "to", "an", "\\", "Beluga", "\\", "Drawing", "\\", "Color", "instance", "." ]
9c82874cf4ec68cb0af78757b65f19783540004a
https://github.com/SagittariusX/Beluga.Drawing/blob/9c82874cf4ec68cb0af78757b65f19783540004a/src/Beluga/Drawing/Color.php#L809-L832
202,053
Dhii/config
src/GetDataCapableByPathTrait.php
GetDataCapableByPathTrait._getData
protected function _getData($key) { $separator = $this->_getPathSegmentSeparator(); $path = $this->_normalizePath($key, $separator); $store = $this->_getDataStore(); return $this->_containerGetPath($store, $path); }
php
protected function _getData($key) { $separator = $this->_getPathSegmentSeparator(); $path = $this->_normalizePath($key, $separator); $store = $this->_getDataStore(); return $this->_containerGetPath($store, $path); }
[ "protected", "function", "_getData", "(", "$", "key", ")", "{", "$", "separator", "=", "$", "this", "->", "_getPathSegmentSeparator", "(", ")", ";", "$", "path", "=", "$", "this", "->", "_normalizePath", "(", "$", "key", ",", "$", "separator", ")", ";"...
Retrieves the data associated with the specified key or path. Will traverse the hierarchy of containers identified by the path segments. @since [*next-version*] @param string|Stringable $key The key or list of keys in the path to get the data for. @return mixed The data corresponding to the path.
[ "Retrieves", "the", "data", "associated", "with", "the", "specified", "key", "or", "path", "." ]
1ab9a7ccf9c0ebd7c6fcbce600b4c00b52b2fdcf
https://github.com/Dhii/config/blob/1ab9a7ccf9c0ebd7c6fcbce600b4c00b52b2fdcf/src/GetDataCapableByPathTrait.php#L32-L39
202,054
SlabPHP/bundle-stack
src/Stack.php
Stack.findClassName
public function findClassName($className) { if (!empty($this->lookupCache->classes[$className])) { return $this->lookupCache->classes[$className]; } if (class_exists($className)) return $className; $startsWithSlash = ($className[0] == '\\'); foreach ($this->sear...
php
public function findClassName($className) { if (!empty($this->lookupCache->classes[$className])) { return $this->lookupCache->classes[$className]; } if (class_exists($className)) return $className; $startsWithSlash = ($className[0] == '\\'); foreach ($this->sear...
[ "public", "function", "findClassName", "(", "$", "className", ")", "{", "if", "(", "!", "empty", "(", "$", "this", "->", "lookupCache", "->", "classes", "[", "$", "className", "]", ")", ")", "{", "return", "$", "this", "->", "lookupCache", "->", "class...
Find class name @param $className @return null|string
[ "Find", "class", "name" ]
d96c4de469e58040968044d2d6525cb60d9dd8c6
https://github.com/SlabPHP/bundle-stack/blob/d96c4de469e58040968044d2d6525cb60d9dd8c6/src/Stack.php#L79-L104
202,055
jenskooij/cloudcontrol
src/util/StringUtil.php
StringUtil.slugify
public static function slugify($str, $replace = array(), $delimiter = '-') { if (!empty($replace)) { $str = str_replace((array)$replace, ' ', $str); } $clean = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $str); $clean = preg_replace("/[^a-zA-Z0-9\/_|+ -]/", '', $clean); ...
php
public static function slugify($str, $replace = array(), $delimiter = '-') { if (!empty($replace)) { $str = str_replace((array)$replace, ' ', $str); } $clean = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $str); $clean = preg_replace("/[^a-zA-Z0-9\/_|+ -]/", '', $clean); ...
[ "public", "static", "function", "slugify", "(", "$", "str", ",", "$", "replace", "=", "array", "(", ")", ",", "$", "delimiter", "=", "'-'", ")", "{", "if", "(", "!", "empty", "(", "$", "replace", ")", ")", "{", "$", "str", "=", "str_replace", "("...
Convert a string to url friendly slug @param string $str @param array $replace @param string $delimiter @return mixed|string
[ "Convert", "a", "string", "to", "url", "friendly", "slug" ]
76e5d9ac8f9c50d06d39a995d13cc03742536548
https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/util/StringUtil.php#L38-L50
202,056
jenskooij/cloudcontrol
src/util/StringUtil.php
StringUtil.iconByFileType
public static function iconByFileType($fileType) { foreach (self::$fileTypeIcons as $needle => $icon) { if (strpos($fileType, $needle) !== false) { return $icon; } } return 'file-o'; }
php
public static function iconByFileType($fileType) { foreach (self::$fileTypeIcons as $needle => $icon) { if (strpos($fileType, $needle) !== false) { return $icon; } } return 'file-o'; }
[ "public", "static", "function", "iconByFileType", "(", "$", "fileType", ")", "{", "foreach", "(", "self", "::", "$", "fileTypeIcons", "as", "$", "needle", "=>", "$", "icon", ")", "{", "if", "(", "strpos", "(", "$", "fileType", ",", "$", "needle", ")", ...
Selects the right font-awesome icon for each filetype @param $fileType @return string
[ "Selects", "the", "right", "font", "-", "awesome", "icon", "for", "each", "filetype" ]
76e5d9ac8f9c50d06d39a995d13cc03742536548
https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/util/StringUtil.php#L59-L70
202,057
jenskooij/cloudcontrol
src/util/StringUtil.php
StringUtil.humanFileSize
public static function humanFileSize($size, $unit = '') { if (self::isHumanFilesizeUnitGb($size, $unit)) { return number_format($size / (1 << 30), 2) . 'GB'; } if (self::isHumanFilesizeUnitMb($size, $unit)) { return number_format($size / (1 << 20), 2) . 'MB'; ...
php
public static function humanFileSize($size, $unit = '') { if (self::isHumanFilesizeUnitGb($size, $unit)) { return number_format($size / (1 << 30), 2) . 'GB'; } if (self::isHumanFilesizeUnitMb($size, $unit)) { return number_format($size / (1 << 20), 2) . 'MB'; ...
[ "public", "static", "function", "humanFileSize", "(", "$", "size", ",", "$", "unit", "=", "''", ")", "{", "if", "(", "self", "::", "isHumanFilesizeUnitGb", "(", "$", "size", ",", "$", "unit", ")", ")", "{", "return", "number_format", "(", "$", "size", ...
Converts an amount of bytes to a human readable format @param $size @param string $unit @return string
[ "Converts", "an", "amount", "of", "bytes", "to", "a", "human", "readable", "format" ]
76e5d9ac8f9c50d06d39a995d13cc03742536548
https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/util/StringUtil.php#L81-L94
202,058
native5/native5-sdk-client-php
src/Native5/UI/TemplatingEngine.php
TemplatingEngine.render
protected function render($tmpl, $in_data=array()) { try { $data = array(); $app = array(); $app['content'] = $in_data; $app['settings'] = $this->_viewData['settings']; $data['app'] = $app; $data['global'] = a...
php
protected function render($tmpl, $in_data=array()) { try { $data = array(); $app = array(); $app['content'] = $in_data; $app['settings'] = $this->_viewData['settings']; $data['app'] = $app; $data['global'] = a...
[ "protected", "function", "render", "(", "$", "tmpl", ",", "$", "in_data", "=", "array", "(", ")", ")", "{", "try", "{", "$", "data", "=", "array", "(", ")", ";", "$", "app", "=", "array", "(", ")", ";", "$", "app", "[", "'content'", "]", "=", ...
Renders a given template along with input data. @param mixed $tmpl The template to render. @param mixed $in_data The data to render with. @access protected @return void
[ "Renders", "a", "given", "template", "along", "with", "input", "data", "." ]
e1f598cf27654d81bb5facace1990b737242a2f9
https://github.com/native5/native5-sdk-client-php/blob/e1f598cf27654d81bb5facace1990b737242a2f9/src/Native5/UI/TemplatingEngine.php#L148-L164
202,059
ARCANESOFT/Media
src/MediaServiceProvider.php
MediaServiceProvider.syncFilesystemConfig
private function syncFilesystemConfig() { foreach ($this->config()->get('arcanesoft.media.filesystem.disks', []) as $disk => $config) { $this->config()->set("filesystems.disks.$disk", $config); } }
php
private function syncFilesystemConfig() { foreach ($this->config()->get('arcanesoft.media.filesystem.disks', []) as $disk => $config) { $this->config()->set("filesystems.disks.$disk", $config); } }
[ "private", "function", "syncFilesystemConfig", "(", ")", "{", "foreach", "(", "$", "this", "->", "config", "(", ")", "->", "get", "(", "'arcanesoft.media.filesystem.disks'", ",", "[", "]", ")", "as", "$", "disk", "=>", "$", "config", ")", "{", "$", "this...
Sync the filesystem config.
[ "Sync", "the", "filesystem", "config", "." ]
e98aad52f94e6587fcbf79c56f7bf7072929bfc9
https://github.com/ARCANESOFT/Media/blob/e98aad52f94e6587fcbf79c56f7bf7072929bfc9/src/MediaServiceProvider.php#L84-L89
202,060
theopera/framework
src/Component/Template/PhpEngine.php
PhpEngine.loadFile
public function loadFile(string $file) { $path = $this->basePath . '/' . $file . '.phtml'; if (!is_readable($path)) { throw new TemplateException(sprintf('Template engine could not read the file "%s"', $path)); }; if (($this->contents = file_get_contents($path)) === fals...
php
public function loadFile(string $file) { $path = $this->basePath . '/' . $file . '.phtml'; if (!is_readable($path)) { throw new TemplateException(sprintf('Template engine could not read the file "%s"', $path)); }; if (($this->contents = file_get_contents($path)) === fals...
[ "public", "function", "loadFile", "(", "string", "$", "file", ")", "{", "$", "path", "=", "$", "this", "->", "basePath", ".", "'/'", ".", "$", "file", ".", "'.phtml'", ";", "if", "(", "!", "is_readable", "(", "$", "path", ")", ")", "{", "throw", ...
Loads a template file into memory @param string $file @return mixed
[ "Loads", "a", "template", "file", "into", "memory" ]
fa6165d3891a310faa580c81dee49a63c150c711
https://github.com/theopera/framework/blob/fa6165d3891a310faa580c81dee49a63c150c711/src/Component/Template/PhpEngine.php#L55-L66
202,061
chalasr/RCHCapistranoBundle
Generator/CapfileGenerator.php
CapfileGenerator.write
public function write() { $capfile = ''; foreach ($this->parameters as $namespace) { $line = str_replace('<requirement>', $namespace, self::$template); $capfile = sprintf('%s%s%s', $capfile, PHP_EOL, $line); } $capfile .= self::$importTemplate; fwri...
php
public function write() { $capfile = ''; foreach ($this->parameters as $namespace) { $line = str_replace('<requirement>', $namespace, self::$template); $capfile = sprintf('%s%s%s', $capfile, PHP_EOL, $line); } $capfile .= self::$importTemplate; fwri...
[ "public", "function", "write", "(", ")", "{", "$", "capfile", "=", "''", ";", "foreach", "(", "$", "this", "->", "parameters", "as", "$", "namespace", ")", "{", "$", "line", "=", "str_replace", "(", "'<requirement>'", ",", "$", "namespace", ",", "self"...
Writes Capfile.
[ "Writes", "Capfile", "." ]
c4a4cbaa2bc05f33bf431fd3afe6cac39947640e
https://github.com/chalasr/RCHCapistranoBundle/blob/c4a4cbaa2bc05f33bf431fd3afe6cac39947640e/Generator/CapfileGenerator.php#L49-L61
202,062
horntell/php-sdk
lib/guzzle/GuzzleHttp/Cookie/SetCookie.php
SetCookie.fromString
public static function fromString($cookie) { // Create the default return array $data = self::$defaults; // Explode the cookie string using a series of semicolons $pieces = array_filter(array_map('trim', explode(';', $cookie))); // The name of the cookie (first kvp) must incl...
php
public static function fromString($cookie) { // Create the default return array $data = self::$defaults; // Explode the cookie string using a series of semicolons $pieces = array_filter(array_map('trim', explode(';', $cookie))); // The name of the cookie (first kvp) must incl...
[ "public", "static", "function", "fromString", "(", "$", "cookie", ")", "{", "// Create the default return array", "$", "data", "=", "self", "::", "$", "defaults", ";", "// Explode the cookie string using a series of semicolons", "$", "pieces", "=", "array_filter", "(", ...
Create a new SetCookie object from a string @param string $cookie Set-Cookie header string @return self
[ "Create", "a", "new", "SetCookie", "object", "from", "a", "string" ]
e5205e9396a21b754d5651a8aa5898da5922a1b7
https://github.com/horntell/php-sdk/blob/e5205e9396a21b754d5651a8aa5898da5922a1b7/lib/guzzle/GuzzleHttp/Cookie/SetCookie.php#L35-L71
202,063
horntell/php-sdk
lib/guzzle/GuzzleHttp/Cookie/SetCookie.php
SetCookie.setExpires
public function setExpires($timestamp) { $this->data['Expires'] = is_numeric($timestamp) ? (int) $timestamp : strtotime($timestamp); return $this; }
php
public function setExpires($timestamp) { $this->data['Expires'] = is_numeric($timestamp) ? (int) $timestamp : strtotime($timestamp); return $this; }
[ "public", "function", "setExpires", "(", "$", "timestamp", ")", "{", "$", "this", "->", "data", "[", "'Expires'", "]", "=", "is_numeric", "(", "$", "timestamp", ")", "?", "(", "int", ")", "$", "timestamp", ":", "strtotime", "(", "$", "timestamp", ")", ...
Set the unix timestamp for which the cookie will expire @param int $timestamp Unix timestamp @return self
[ "Set", "the", "unix", "timestamp", "for", "which", "the", "cookie", "will", "expire" ]
e5205e9396a21b754d5651a8aa5898da5922a1b7
https://github.com/horntell/php-sdk/blob/e5205e9396a21b754d5651a8aa5898da5922a1b7/lib/guzzle/GuzzleHttp/Cookie/SetCookie.php#L246-L253
202,064
Kris-Kuiper/sFire-Framework
src/Image/Image.php
Image.setImage
public function setImage($file) { if(false === is_string($file)) { return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($file)), E_USER_ERROR); } if(false === is_file($file)) { return trigger_error(sprintf('File "%s" passed to %s() doe...
php
public function setImage($file) { if(false === is_string($file)) { return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($file)), E_USER_ERROR); } if(false === is_file($file)) { return trigger_error(sprintf('File "%s" passed to %s() doe...
[ "public", "function", "setImage", "(", "$", "file", ")", "{", "if", "(", "false", "===", "is_string", "(", "$", "file", ")", ")", "{", "return", "trigger_error", "(", "sprintf", "(", "'Argument 1 passed to %s() must be of the type string, \"%s\" given'", ",", "__M...
Set a new image @param string $image @return sFire\Image\Image
[ "Set", "a", "new", "image" ]
deefe1d9d2b40e7326381e8dcd4f01f9aa61885c
https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Image/Image.php#L94-L118
202,065
Kris-Kuiper/sFire-Framework
src/Image/Image.php
Image.flip
public function flip($mode = self :: FLIP_HORIZONTAL) { if(false === in_array($mode, [self :: FLIP_HORIZONTAL, self :: FLIP_VERTICAL, self :: FLIP_BOTH])) { return trigger_error(sprintf('Unknown mode passed %s(), "%s" given', __METHOD__, gettype($mode)), E_USER_ERROR); } $this -> add(__FUNCTION__, fu...
php
public function flip($mode = self :: FLIP_HORIZONTAL) { if(false === in_array($mode, [self :: FLIP_HORIZONTAL, self :: FLIP_VERTICAL, self :: FLIP_BOTH])) { return trigger_error(sprintf('Unknown mode passed %s(), "%s" given', __METHOD__, gettype($mode)), E_USER_ERROR); } $this -> add(__FUNCTION__, fu...
[ "public", "function", "flip", "(", "$", "mode", "=", "self", "::", "FLIP_HORIZONTAL", ")", "{", "if", "(", "false", "===", "in_array", "(", "$", "mode", ",", "[", "self", "::", "FLIP_HORIZONTAL", ",", "self", "::", "FLIP_VERTICAL", ",", "self", "::", "...
Flip the current image horizontal, vertical or both @param int $mode @return sFire\Image\Image
[ "Flip", "the", "current", "image", "horizontal", "vertical", "or", "both" ]
deefe1d9d2b40e7326381e8dcd4f01f9aa61885c
https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Image/Image.php#L340-L348
202,066
Kris-Kuiper/sFire-Framework
src/Image/Image.php
Image.call
private function call() { if(null === $this -> driver) { return trigger_error('Driver is not set. Set the driver with the setDriver() method', E_USER_ERROR); } if(null === $this -> image) { return trigger_error('Image has not been set. Set the image with the setImag...
php
private function call() { if(null === $this -> driver) { return trigger_error('Driver is not set. Set the driver with the setDriver() method', E_USER_ERROR); } if(null === $this -> image) { return trigger_error('Image has not been set. Set the image with the setImag...
[ "private", "function", "call", "(", ")", "{", "if", "(", "null", "===", "$", "this", "->", "driver", ")", "{", "return", "trigger_error", "(", "'Driver is not set. Set the driver with the setDriver() method'", ",", "E_USER_ERROR", ")", ";", "}", "if", "(", "null...
Check if image and driver is set and returns the driver @return mixed
[ "Check", "if", "image", "and", "driver", "is", "set", "and", "returns", "the", "driver" ]
deefe1d9d2b40e7326381e8dcd4f01f9aa61885c
https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Image/Image.php#L458-L473
202,067
Kris-Kuiper/sFire-Framework
src/Image/Image.php
Image.getQuality
private function getQuality($quality, $extension) { if(false === ('-' . intval($quality) == '-' . $quality)) { return trigger_error(sprintf('Argument 1 passed to %s() must be of the type integer, "%s" given', __METHOD__, gettype($quality)), E_USER_ERROR); } if(false === is_string($extension)) { ret...
php
private function getQuality($quality, $extension) { if(false === ('-' . intval($quality) == '-' . $quality)) { return trigger_error(sprintf('Argument 1 passed to %s() must be of the type integer, "%s" given', __METHOD__, gettype($quality)), E_USER_ERROR); } if(false === is_string($extension)) { ret...
[ "private", "function", "getQuality", "(", "$", "quality", ",", "$", "extension", ")", "{", "if", "(", "false", "===", "(", "'-'", ".", "intval", "(", "$", "quality", ")", "==", "'-'", ".", "$", "quality", ")", ")", "{", "return", "trigger_error", "("...
Validates and returns quality based on image extension @param int $quality @param string $extension @return int
[ "Validates", "and", "returns", "quality", "based", "on", "image", "extension" ]
deefe1d9d2b40e7326381e8dcd4f01f9aa61885c
https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Image/Image.php#L482-L497
202,068
ndavison/groundwork-framework
src/Groundwork/Classes/Resource.php
Resource.output
public function output() { // Check that the method for this HTTP request method exists. $methodName = 'http_' . $this->request->httpMethod(); if (method_exists($this, $methodName)) { // Execute the requested Resource instance's method that // corresponds with the re...
php
public function output() { // Check that the method for this HTTP request method exists. $methodName = 'http_' . $this->request->httpMethod(); if (method_exists($this, $methodName)) { // Execute the requested Resource instance's method that // corresponds with the re...
[ "public", "function", "output", "(", ")", "{", "// Check that the method for this HTTP request method exists.", "$", "methodName", "=", "'http_'", ".", "$", "this", "->", "request", "->", "httpMethod", "(", ")", ";", "if", "(", "method_exists", "(", "$", "this", ...
Generate the output of the requested Resource instance. @return mixed
[ "Generate", "the", "output", "of", "the", "requested", "Resource", "instance", "." ]
c3d22a1410c8d8a07b4ca1f99a35a1181516cd6c
https://github.com/ndavison/groundwork-framework/blob/c3d22a1410c8d8a07b4ca1f99a35a1181516cd6c/src/Groundwork/Classes/Resource.php#L53-L70
202,069
brightnucleus/options-store
src/Exception/InvalidOption.php
InvalidOption.fromOption
public static function fromOption($option) { $message = sprintf( 'Could not add invalid Option of type "%1$s" to option repository.', is_object($option) ? get_class($option) : gettype($option) ); return new static($message); }
php
public static function fromOption($option) { $message = sprintf( 'Could not add invalid Option of type "%1$s" to option repository.', is_object($option) ? get_class($option) : gettype($option) ); return new static($message); }
[ "public", "static", "function", "fromOption", "(", "$", "option", ")", "{", "$", "message", "=", "sprintf", "(", "'Could not add invalid Option of type \"%1$s\" to option repository.'", ",", "is_object", "(", "$", "option", ")", "?", "get_class", "(", "$", "option",...
Get a new exception based on the type of an invalid option. @since 0.1.0 @param mixed $option Option that was tried to be added. @return static
[ "Get", "a", "new", "exception", "based", "on", "the", "type", "of", "an", "invalid", "option", "." ]
9a9ef2a160bbacd69fe3e9db0be8ed89e6905ef1
https://github.com/brightnucleus/options-store/blob/9a9ef2a160bbacd69fe3e9db0be8ed89e6905ef1/src/Exception/InvalidOption.php#L40-L50
202,070
EdwinDayot/shorty-framework
src/Framework/Routing/Controller.php
Controller.middleware
public function middleware($name) { if (is_string($name)) { app()->addRouteMiddleware($name); } else if (is_array($name)) { foreach ($name as $middlewareName) { app()->addRouteMiddleware($middlewareName); } } }
php
public function middleware($name) { if (is_string($name)) { app()->addRouteMiddleware($name); } else if (is_array($name)) { foreach ($name as $middlewareName) { app()->addRouteMiddleware($middlewareName); } } }
[ "public", "function", "middleware", "(", "$", "name", ")", "{", "if", "(", "is_string", "(", "$", "name", ")", ")", "{", "app", "(", ")", "->", "addRouteMiddleware", "(", "$", "name", ")", ";", "}", "else", "if", "(", "is_array", "(", "$", "name", ...
Middlewares to add. @param string|string[] $name
[ "Middlewares", "to", "add", "." ]
e03c991ea86aedbd87674d1ee2f9041b55b5e578
https://github.com/EdwinDayot/shorty-framework/blob/e03c991ea86aedbd87674d1ee2f9041b55b5e578/src/Framework/Routing/Controller.php#L20-L29
202,071
Linkvalue-Interne/MajoraFrameworkExtraBundle
src/Majora/Framework/Normalizer/MajoraNormalizer.php
MajoraNormalizer.createNormalizer
public static function createNormalizer($key = 'default') { return isset(self::$instancePool[$key]) ? self::$instancePool[$key] : self::$instancePool[$key] = new static( PropertyAccess::createPropertyAccessor() ); }
php
public static function createNormalizer($key = 'default') { return isset(self::$instancePool[$key]) ? self::$instancePool[$key] : self::$instancePool[$key] = new static( PropertyAccess::createPropertyAccessor() ); }
[ "public", "static", "function", "createNormalizer", "(", "$", "key", "=", "'default'", ")", "{", "return", "isset", "(", "self", "::", "$", "instancePool", "[", "$", "key", "]", ")", "?", "self", "::", "$", "instancePool", "[", "$", "key", "]", ":", ...
Create and return an instantiated normalizer, returns always the same throught this call. @param string $key optionnal normalizer key @return MajoraNormalizer
[ "Create", "and", "return", "an", "instantiated", "normalizer", "returns", "always", "the", "same", "throught", "this", "call", "." ]
6f368380cfc39d27fafb0844e9a53b4d86d7c034
https://github.com/Linkvalue-Interne/MajoraFrameworkExtraBundle/blob/6f368380cfc39d27fafb0844e9a53b4d86d7c034/src/Majora/Framework/Normalizer/MajoraNormalizer.php#L69-L76
202,072
Linkvalue-Interne/MajoraFrameworkExtraBundle
src/Majora/Framework/Normalizer/MajoraNormalizer.php
MajoraNormalizer.createReadingDelegate
private function createReadingDelegate() { return $this->readDelegate ?: $this->readDelegate = function ($property, PropertyAccessor $propertyAccessor) { switch (true) { // Public property / accessor case case $propertyAccessor->isReadable($this, $property) : ...
php
private function createReadingDelegate() { return $this->readDelegate ?: $this->readDelegate = function ($property, PropertyAccessor $propertyAccessor) { switch (true) { // Public property / accessor case case $propertyAccessor->isReadable($this, $property) : ...
[ "private", "function", "createReadingDelegate", "(", ")", "{", "return", "$", "this", "->", "readDelegate", "?", ":", "$", "this", "->", "readDelegate", "=", "function", "(", "$", "property", ",", "PropertyAccessor", "$", "propertyAccessor", ")", "{", "switch"...
Create and return a Closure available to read an object property through a property path or a private property. @return \Closure
[ "Create", "and", "return", "a", "Closure", "available", "to", "read", "an", "object", "property", "through", "a", "property", "path", "or", "a", "private", "property", "." ]
6f368380cfc39d27fafb0844e9a53b4d86d7c034
https://github.com/Linkvalue-Interne/MajoraFrameworkExtraBundle/blob/6f368380cfc39d27fafb0844e9a53b4d86d7c034/src/Majora/Framework/Normalizer/MajoraNormalizer.php#L107-L127
202,073
Linkvalue-Interne/MajoraFrameworkExtraBundle
src/Majora/Framework/Normalizer/MajoraNormalizer.php
MajoraNormalizer.normalize
public function normalize($object, $scope = 'default') { switch (true) { // Cannot normalized anything which already are case !is_object($object) : return $object; // StdClass can be cast as array case $object instanceof StdClass : ...
php
public function normalize($object, $scope = 'default') { switch (true) { // Cannot normalized anything which already are case !is_object($object) : return $object; // StdClass can be cast as array case $object instanceof StdClass : ...
[ "public", "function", "normalize", "(", "$", "object", ",", "$", "scope", "=", "'default'", ")", "{", "switch", "(", "true", ")", "{", "// Cannot normalized anything which already are", "case", "!", "is_object", "(", "$", "object", ")", ":", "return", "$", "...
Normalize given object using given scope. @param mixed $object @param string $scope @return array|string @throws ScopeNotFoundException If given scope not defined into given normalizable @throws InvalidScopeException If given scope requires an unaccessible field
[ "Normalize", "given", "object", "using", "given", "scope", "." ]
6f368380cfc39d27fafb0844e9a53b4d86d7c034
https://github.com/Linkvalue-Interne/MajoraFrameworkExtraBundle/blob/6f368380cfc39d27fafb0844e9a53b4d86d7c034/src/Majora/Framework/Normalizer/MajoraNormalizer.php#L140-L166
202,074
Linkvalue-Interne/MajoraFrameworkExtraBundle
src/Majora/Framework/Normalizer/MajoraNormalizer.php
MajoraNormalizer.scopify
public function scopify(NormalizableInterface $object, $scope) { $scopes = $object->getScopes(); if (!isset($scopes[$scope])) { throw new ScopeNotFoundException(sprintf( 'Invalid scope for %s object, only ["%s"] supported, "%s" given.', get_class($object),...
php
public function scopify(NormalizableInterface $object, $scope) { $scopes = $object->getScopes(); if (!isset($scopes[$scope])) { throw new ScopeNotFoundException(sprintf( 'Invalid scope for %s object, only ["%s"] supported, "%s" given.', get_class($object),...
[ "public", "function", "scopify", "(", "NormalizableInterface", "$", "object", ",", "$", "scope", ")", "{", "$", "scopes", "=", "$", "object", "->", "getScopes", "(", ")", ";", "if", "(", "!", "isset", "(", "$", "scopes", "[", "$", "scope", "]", ")", ...
Normalize given normalizable following given scope. @param NormalizableInterface $object @param string $scope @return array
[ "Normalize", "given", "normalizable", "following", "given", "scope", "." ]
6f368380cfc39d27fafb0844e9a53b4d86d7c034
https://github.com/Linkvalue-Interne/MajoraFrameworkExtraBundle/blob/6f368380cfc39d27fafb0844e9a53b4d86d7c034/src/Majora/Framework/Normalizer/MajoraNormalizer.php#L176-L261
202,075
Linkvalue-Interne/MajoraFrameworkExtraBundle
src/Majora/Framework/Normalizer/MajoraNormalizer.php
MajoraNormalizer.createWrittingDelegate
private function createWrittingDelegate() { return $this->writeDelegate ?: $this->writeDelegate = function (PropertyPathInterface $property, $value, PropertyAccessor $propertyAccessor) { switch (true) { // Public property / accessor case case $propertyAccessor->i...
php
private function createWrittingDelegate() { return $this->writeDelegate ?: $this->writeDelegate = function (PropertyPathInterface $property, $value, PropertyAccessor $propertyAccessor) { switch (true) { // Public property / accessor case case $propertyAccessor->i...
[ "private", "function", "createWrittingDelegate", "(", ")", "{", "return", "$", "this", "->", "writeDelegate", "?", ":", "$", "this", "->", "writeDelegate", "=", "function", "(", "PropertyPathInterface", "$", "property", ",", "$", "value", ",", "PropertyAccessor"...
Create and return a Closure available to write an object property through a property path or a private property. @return \Closure
[ "Create", "and", "return", "a", "Closure", "available", "to", "write", "an", "object", "property", "through", "a", "property", "path", "or", "a", "private", "property", "." ]
6f368380cfc39d27fafb0844e9a53b4d86d7c034
https://github.com/Linkvalue-Interne/MajoraFrameworkExtraBundle/blob/6f368380cfc39d27fafb0844e9a53b4d86d7c034/src/Majora/Framework/Normalizer/MajoraNormalizer.php#L268-L288
202,076
kambalabs/KmbPmProxy
src/KmbPmProxy/Service/PuppetModule.php
PuppetModule.getModuleHydrator
public function getModuleHydrator() { if ($this->moduleHydrator == null) { $moduleHydratorClass = $this->getOptions()->getPuppetModuleHydratorClass(); $this->moduleHydrator = new $moduleHydratorClass; } return $this->moduleHydrator; }
php
public function getModuleHydrator() { if ($this->moduleHydrator == null) { $moduleHydratorClass = $this->getOptions()->getPuppetModuleHydratorClass(); $this->moduleHydrator = new $moduleHydratorClass; } return $this->moduleHydrator; }
[ "public", "function", "getModuleHydrator", "(", ")", "{", "if", "(", "$", "this", "->", "moduleHydrator", "==", "null", ")", "{", "$", "moduleHydratorClass", "=", "$", "this", "->", "getOptions", "(", ")", "->", "getPuppetModuleHydratorClass", "(", ")", ";",...
Get ModuleHydrator. @return \Zend\Stdlib\Hydrator\HydratorInterface
[ "Get", "ModuleHydrator", "." ]
b4c664ae8b6f29e4e8768461ed99e1b0b80bde18
https://github.com/kambalabs/KmbPmProxy/blob/b4c664ae8b6f29e4e8768461ed99e1b0b80bde18/src/KmbPmProxy/Service/PuppetModule.php#L224-L231
202,077
kambalabs/KmbPmProxy
src/KmbPmProxy/Service/PuppetModule.php
PuppetModule.getClassHydrator
public function getClassHydrator() { if ($this->classHydrator == null) { $classHydratorClass = $this->getOptions()->getPuppetClassHydratorClass(); $this->classHydrator = new $classHydratorClass; } return $this->classHydrator; }
php
public function getClassHydrator() { if ($this->classHydrator == null) { $classHydratorClass = $this->getOptions()->getPuppetClassHydratorClass(); $this->classHydrator = new $classHydratorClass; } return $this->classHydrator; }
[ "public", "function", "getClassHydrator", "(", ")", "{", "if", "(", "$", "this", "->", "classHydrator", "==", "null", ")", "{", "$", "classHydratorClass", "=", "$", "this", "->", "getOptions", "(", ")", "->", "getPuppetClassHydratorClass", "(", ")", ";", "...
Get ClassHydrator. @return \Zend\Stdlib\Hydrator\HydratorInterface
[ "Get", "ClassHydrator", "." ]
b4c664ae8b6f29e4e8768461ed99e1b0b80bde18
https://github.com/kambalabs/KmbPmProxy/blob/b4c664ae8b6f29e4e8768461ed99e1b0b80bde18/src/KmbPmProxy/Service/PuppetModule.php#L250-L257
202,078
zarathustra323/modlr-data
src/Zarathustra/ModlrData/Metadata/RelationshipMetadata.php
RelationshipMetadata.validateType
protected function validateType($relType) { $valid = ['one', 'many']; if (!in_array($relType, $valid)) { throw MetadataException::invalidRelType($relType, $valid); } return true; }
php
protected function validateType($relType) { $valid = ['one', 'many']; if (!in_array($relType, $valid)) { throw MetadataException::invalidRelType($relType, $valid); } return true; }
[ "protected", "function", "validateType", "(", "$", "relType", ")", "{", "$", "valid", "=", "[", "'one'", ",", "'many'", "]", ";", "if", "(", "!", "in_array", "(", "$", "relType", ",", "$", "valid", ")", ")", "{", "throw", "MetadataException", "::", "...
Validates the relationship type. @param string $type @return bool @throws MetadataException
[ "Validates", "the", "relationship", "type", "." ]
7c2c767216055f75abf8cf22e2200f11998ed24e
https://github.com/zarathustra323/modlr-data/blob/7c2c767216055f75abf8cf22e2200f11998ed24e/src/Zarathustra/ModlrData/Metadata/RelationshipMetadata.php#L108-L115
202,079
SlabPHP/configuration-manager
src/Parameter.php
Parameter.getConfigurationParameterName
public function getConfigurationParameterName($value = null) { $output = ''; if (!empty($this->_parent) && $this->_parent instanceof Parameter) { $output .= $this->_parent->getConfigurationParameterName(); } if (!empty($this->_name)) { if (!empty($output)) $...
php
public function getConfigurationParameterName($value = null) { $output = ''; if (!empty($this->_parent) && $this->_parent instanceof Parameter) { $output .= $this->_parent->getConfigurationParameterName(); } if (!empty($this->_name)) { if (!empty($output)) $...
[ "public", "function", "getConfigurationParameterName", "(", "$", "value", "=", "null", ")", "{", "$", "output", "=", "''", ";", "if", "(", "!", "empty", "(", "$", "this", "->", "_parent", ")", "&&", "$", "this", "->", "_parent", "instanceof", "Parameter"...
Get name of configuration value @param string $value return $string;
[ "Get", "name", "of", "configuration", "value" ]
3f36b528b8d7b0ffbb43ec933e82efd7312a3397
https://github.com/SlabPHP/configuration-manager/blob/3f36b528b8d7b0ffbb43ec933e82efd7312a3397/src/Parameter.php#L50-L75
202,080
SlabPHP/configuration-manager
src/Parameter.php
Parameter.flattenResult
public function flattenResult() { $output = []; $vars = (array)$this; foreach ($vars as $field => $value) { //Trim off the protected items that come in as \0*\0_name if (ord($field[0]) == 0) continue; if ($value instanceof Parameter) { $...
php
public function flattenResult() { $output = []; $vars = (array)$this; foreach ($vars as $field => $value) { //Trim off the protected items that come in as \0*\0_name if (ord($field[0]) == 0) continue; if ($value instanceof Parameter) { $...
[ "public", "function", "flattenResult", "(", ")", "{", "$", "output", "=", "[", "]", ";", "$", "vars", "=", "(", "array", ")", "$", "this", ";", "foreach", "(", "$", "vars", "as", "$", "field", "=>", "$", "value", ")", "{", "//Trim off the protected i...
Get flattened scalars from a configuration parameter, recursively @return array
[ "Get", "flattened", "scalars", "from", "a", "configuration", "parameter", "recursively" ]
3f36b528b8d7b0ffbb43ec933e82efd7312a3397
https://github.com/SlabPHP/configuration-manager/blob/3f36b528b8d7b0ffbb43ec933e82efd7312a3397/src/Parameter.php#L119-L137
202,081
moaction/jsonrpc-common
src/Moaction/Jsonrpc/Common/Request.php
Request.toArray
public function toArray() { if (!$this->getMethod()) { throw new \InvalidArgumentException('Method must be provided for request'); } $data = array( 'jsonrpc' => self::VERSION, 'method' => $this->getMethod(), ); if ($this->getParams()) { $data['params'] = $this->getParams(); } if ($this->g...
php
public function toArray() { if (!$this->getMethod()) { throw new \InvalidArgumentException('Method must be provided for request'); } $data = array( 'jsonrpc' => self::VERSION, 'method' => $this->getMethod(), ); if ($this->getParams()) { $data['params'] = $this->getParams(); } if ($this->g...
[ "public", "function", "toArray", "(", ")", "{", "if", "(", "!", "$", "this", "->", "getMethod", "(", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "'Method must be provided for request'", ")", ";", "}", "$", "data", "=", "array", "(...
Serialize into array @throws \InvalidArgumentException @return array
[ "Serialize", "into", "array" ]
05692a2c58d647f20f11b6f7b9568c8fff2d5f8c
https://github.com/moaction/jsonrpc-common/blob/05692a2c58d647f20f11b6f7b9568c8fff2d5f8c/src/Moaction/Jsonrpc/Common/Request.php#L87-L107
202,082
Rundiz/serializer
Rundiz/Serializer/Serializer.php
Serializer.isSerialized
public function isSerialized($string) { if (!is_string($string)) { return false; } $string = trim($string); if ($string === 'N;') { // if serialized string is NULL. return true; } $string_encoding = mb_detect_encoding($string); ...
php
public function isSerialized($string) { if (!is_string($string)) { return false; } $string = trim($string); if ($string === 'N;') { // if serialized string is NULL. return true; } $string_encoding = mb_detect_encoding($string); ...
[ "public", "function", "isSerialized", "(", "$", "string", ")", "{", "if", "(", "!", "is_string", "(", "$", "string", ")", ")", "{", "return", "false", ";", "}", "$", "string", "=", "trim", "(", "$", "string", ")", ";", "if", "(", "$", "string", "...
Is serialized string. @link https://core.trac.wordpress.org/browser/tags/4.7.3/src/wp-includes/functions.php#L341 Reference from WordPress. @link https://gist.github.com/cs278/217091 Reference from Github cs278/is_serialized.php @param string $string The string to check. @return boolean Return true if serialized, fals...
[ "Is", "serialized", "string", "." ]
e50185a835949a7f0c7a5d73ae48daa7f3f4a2d9
https://github.com/Rundiz/serializer/blob/e50185a835949a7f0c7a5d73ae48daa7f3f4a2d9/Rundiz/Serializer/Serializer.php#L33-L111
202,083
AnnotateFramework/backend
src/Content/Providers/MainPanelContentProvider.php
MainPanelContentProvider.addLink
public function addLink($url, $title, $icon = NULL, $priority = 0) { $link = [ "moduleUrl" => str_replace("#", NULL, substr($url, 0, strpos($url, ":"))), "url" => $url, "title" => $title, "icon" => $icon, "priority" => $priority ]; $this->links[] = $link; }
php
public function addLink($url, $title, $icon = NULL, $priority = 0) { $link = [ "moduleUrl" => str_replace("#", NULL, substr($url, 0, strpos($url, ":"))), "url" => $url, "title" => $title, "icon" => $icon, "priority" => $priority ]; $this->links[] = $link; }
[ "public", "function", "addLink", "(", "$", "url", ",", "$", "title", ",", "$", "icon", "=", "NULL", ",", "$", "priority", "=", "0", ")", "{", "$", "link", "=", "[", "\"moduleUrl\"", "=>", "str_replace", "(", "\"#\"", ",", "NULL", ",", "substr", "("...
Adds link to mainPanel @param string @param string @param string|NULL @param int|NULL goes from min to max
[ "Adds", "link", "to", "mainPanel" ]
dbc524ceb9d2af5f5f76a72ea0f6100399bc2f17
https://github.com/AnnotateFramework/backend/blob/dbc524ceb9d2af5f5f76a72ea0f6100399bc2f17/src/Content/Providers/MainPanelContentProvider.php#L45-L55
202,084
ScaraMVC/Framework
src/Scara/Debug/ExceptionRenderer.php
ExceptionRenderer.render
public function render(Exception $e, $debug) { $e = FlattenException::create($e); $handler = new SymfonyExceptionHandler($debug); $status = $e->getStatusCode(); $response = SymfonyResponse::create($handler->getHtml($e), $status, $e->getHeaders()); $rex = explode("\n", $resp...
php
public function render(Exception $e, $debug) { $e = FlattenException::create($e); $handler = new SymfonyExceptionHandler($debug); $status = $e->getStatusCode(); $response = SymfonyResponse::create($handler->getHtml($e), $status, $e->getHeaders()); $rex = explode("\n", $resp...
[ "public", "function", "render", "(", "Exception", "$", "e", ",", "$", "debug", ")", "{", "$", "e", "=", "FlattenException", "::", "create", "(", "$", "e", ")", ";", "$", "handler", "=", "new", "SymfonyExceptionHandler", "(", "$", "debug", ")", ";", "...
Renders the error. @param \Exception $e @param bool $debug @return void
[ "Renders", "the", "error", "." ]
199b08b45fadf5dae14ac4732af03b36e15bbef2
https://github.com/ScaraMVC/Framework/blob/199b08b45fadf5dae14ac4732af03b36e15bbef2/src/Scara/Debug/ExceptionRenderer.php#L30-L51
202,085
wb-crowdfusion/crowdfusion
system/core/classes/libraries/caching/interfaces/AbstractCache.php
AbstractCache.multiGet
public function multiGet(array $keys, $localOnly = false) { $keys = array_unique($keys); $results = array(); $others = array(); foreach ($keys as $key) { $cacheKey = $this->cacheKey($key); if ($this->keepLocalCache && array_key_exists($cacheKey, $this->localCa...
php
public function multiGet(array $keys, $localOnly = false) { $keys = array_unique($keys); $results = array(); $others = array(); foreach ($keys as $key) { $cacheKey = $this->cacheKey($key); if ($this->keepLocalCache && array_key_exists($cacheKey, $this->localCa...
[ "public", "function", "multiGet", "(", "array", "$", "keys", ",", "$", "localOnly", "=", "false", ")", "{", "$", "keys", "=", "array_unique", "(", "$", "keys", ")", ";", "$", "results", "=", "array", "(", ")", ";", "$", "others", "=", "array", "(",...
Returns an array of nodes from cache specified by key @param array $keys An array of keys to fetch @param bool $localOnly @return array
[ "Returns", "an", "array", "of", "nodes", "from", "cache", "specified", "by", "key" ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/caching/interfaces/AbstractCache.php#L54-L80
202,086
wb-crowdfusion/crowdfusion
system/core/classes/libraries/caching/interfaces/AbstractCache.php
AbstractCache.put
public function put($key, $value, $duration, $localOnly = false) { $cacheKey = $this->cacheKey($key); if($this->keepLocalCache) $this->localCache[$cacheKey] = $value; if(!$localOnly) $this->cacheStore->put($cacheKey, $value, $duration); }
php
public function put($key, $value, $duration, $localOnly = false) { $cacheKey = $this->cacheKey($key); if($this->keepLocalCache) $this->localCache[$cacheKey] = $value; if(!$localOnly) $this->cacheStore->put($cacheKey, $value, $duration); }
[ "public", "function", "put", "(", "$", "key", ",", "$", "value", ",", "$", "duration", ",", "$", "localOnly", "=", "false", ")", "{", "$", "cacheKey", "=", "$", "this", "->", "cacheKey", "(", "$", "key", ")", ";", "if", "(", "$", "this", "->", ...
Stores the value specified with the cacheKey given. @param string $cacheKey The cache key @param mixed $value The value to store @access public @return void
[ "Stores", "the", "value", "specified", "with", "the", "cacheKey", "given", "." ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/caching/interfaces/AbstractCache.php#L91-L98
202,087
ZFrapid/zfrapid-core
src/Console/Application.php
Application.translateRoutes
protected function translateRoutes(array $routes = []) { foreach ($routes as $routeKey => $routeParams) { if (isset($routeParams['description'])) { $routes[$routeKey]['description'] = $this->translator->translate( $routeParams['description'...
php
protected function translateRoutes(array $routes = []) { foreach ($routes as $routeKey => $routeParams) { if (isset($routeParams['description'])) { $routes[$routeKey]['description'] = $this->translator->translate( $routeParams['description'...
[ "protected", "function", "translateRoutes", "(", "array", "$", "routes", "=", "[", "]", ")", "{", "foreach", "(", "$", "routes", "as", "$", "routeKey", "=>", "$", "routeParams", ")", "{", "if", "(", "isset", "(", "$", "routeParams", "[", "'description'",...
Translate the route texts @param array $routes @return array
[ "Translate", "the", "route", "texts" ]
8be56b82f9f5a687619a2b2175fcaa66ad3d2233
https://github.com/ZFrapid/zfrapid-core/blob/8be56b82f9f5a687619a2b2175fcaa66ad3d2233/src/Console/Application.php#L132-L161
202,088
ZFrapid/zfrapid-core
src/Console/Application.php
Application.writeApplicationBanner
public function writeApplicationBanner(AdapterInterface $console) { $console->writeLine(); $console->writeLine( str_pad('', $console->getWidth() - 1, '=', STR_PAD_RIGHT), Color::GREEN ); $console->write('=', Color::GREEN); $console->write( ...
php
public function writeApplicationBanner(AdapterInterface $console) { $console->writeLine(); $console->writeLine( str_pad('', $console->getWidth() - 1, '=', STR_PAD_RIGHT), Color::GREEN ); $console->write('=', Color::GREEN); $console->write( ...
[ "public", "function", "writeApplicationBanner", "(", "AdapterInterface", "$", "console", ")", "{", "$", "console", "->", "writeLine", "(", ")", ";", "$", "console", "->", "writeLine", "(", "str_pad", "(", "''", ",", "$", "console", "->", "getWidth", "(", "...
Write application banner @param AdapterInterface $console
[ "Write", "application", "banner" ]
8be56b82f9f5a687619a2b2175fcaa66ad3d2233
https://github.com/ZFrapid/zfrapid-core/blob/8be56b82f9f5a687619a2b2175fcaa66ad3d2233/src/Console/Application.php#L168-L195
202,089
ZFrapid/zfrapid-core
src/Console/Application.php
Application.writeApplicationFooter
public function writeApplicationFooter(AdapterInterface $console) { $console->writeLine( str_pad('', $console->getWidth() - 1, '=', STR_PAD_RIGHT), Color::GREEN ); $console->writeLine(); }
php
public function writeApplicationFooter(AdapterInterface $console) { $console->writeLine( str_pad('', $console->getWidth() - 1, '=', STR_PAD_RIGHT), Color::GREEN ); $console->writeLine(); }
[ "public", "function", "writeApplicationFooter", "(", "AdapterInterface", "$", "console", ")", "{", "$", "console", "->", "writeLine", "(", "str_pad", "(", "''", ",", "$", "console", "->", "getWidth", "(", ")", "-", "1", ",", "'='", ",", "STR_PAD_RIGHT", ")...
Write application footer @param AdapterInterface $console
[ "Write", "application", "footer" ]
8be56b82f9f5a687619a2b2175fcaa66ad3d2233
https://github.com/ZFrapid/zfrapid-core/blob/8be56b82f9f5a687619a2b2175fcaa66ad3d2233/src/Console/Application.php#L202-L210
202,090
wb-crowdfusion/crowdfusion
system/core/classes/libraries/inputclean/InputClean.php
InputClean.clean
public function clean($string, $allowedTags = null) { if (is_array($string)) { $new_array = array(); foreach ($string as $key => $val) { $new_array[$key] = $this->clean($val, $allowedTags); } return $new_array; } $string = $thi...
php
public function clean($string, $allowedTags = null) { if (is_array($string)) { $new_array = array(); foreach ($string as $key => $val) { $new_array[$key] = $this->clean($val, $allowedTags); } return $new_array; } $string = $thi...
[ "public", "function", "clean", "(", "$", "string", ",", "$", "allowedTags", "=", "null", ")", "{", "if", "(", "is_array", "(", "$", "string", ")", ")", "{", "$", "new_array", "=", "array", "(", ")", ";", "foreach", "(", "$", "string", "as", "$", ...
Cleans XSS by removing all tags @param string $string to clean @return string cleaned
[ "Cleans", "XSS", "by", "removing", "all", "tags" ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/inputclean/InputClean.php#L94-L107
202,091
wb-crowdfusion/crowdfusion
system/core/classes/libraries/inputclean/InputClean.php
InputClean.cleanHTMLPurify
protected function cleanHTMLPurify($string, $allowedTags = null) { if(strlen($string)==0) return ''; if($allowedTags === null) $allowedTags = $this->defaultAllowedTags; if($allowedTags == '*') return $string; if(is_null($this->purifier)) ...
php
protected function cleanHTMLPurify($string, $allowedTags = null) { if(strlen($string)==0) return ''; if($allowedTags === null) $allowedTags = $this->defaultAllowedTags; if($allowedTags == '*') return $string; if(is_null($this->purifier)) ...
[ "protected", "function", "cleanHTMLPurify", "(", "$", "string", ",", "$", "allowedTags", "=", "null", ")", "{", "if", "(", "strlen", "(", "$", "string", ")", "==", "0", ")", "return", "''", ";", "if", "(", "$", "allowedTags", "===", "null", ")", "$",...
Produces a nicely-formatted HTML string with all non-matching tags stripped. @param string $string The HTML string to format @param string $allowedTags A comma separated list of tags to allow in the result @return string A nicely-formatted version of the input text, containing only the tags specified.
[ "Produces", "a", "nicely", "-", "formatted", "HTML", "string", "with", "all", "non", "-", "matching", "tags", "stripped", "." ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/inputclean/InputClean.php#L157-L190
202,092
wb-crowdfusion/crowdfusion
system/core/classes/libraries/inputclean/InputClean.php
InputClean.autoParagraph
public function autoParagraph($string, $allowedTags = null, $linkUrls = true) { if(is_null($allowedTags)) $allowedTags = $this->defaultAllowedTags; if(is_null($this->purifier)) { require_once PATH_SYSTEM . '/vendors/HTMLPurifier.php'; $this->purifier = H...
php
public function autoParagraph($string, $allowedTags = null, $linkUrls = true) { if(is_null($allowedTags)) $allowedTags = $this->defaultAllowedTags; if(is_null($this->purifier)) { require_once PATH_SYSTEM . '/vendors/HTMLPurifier.php'; $this->purifier = H...
[ "public", "function", "autoParagraph", "(", "$", "string", ",", "$", "allowedTags", "=", "null", ",", "$", "linkUrls", "=", "true", ")", "{", "if", "(", "is_null", "(", "$", "allowedTags", ")", ")", "$", "allowedTags", "=", "$", "this", "->", "defaultA...
Marks up a string with paragraphs and automatically links any urls. This function marks up the output with paragraph tags and auto-links any URLs that are found. The resulting output is suitable for display in any web-browser, but must have paragraph and extra html tags removed before it's ready for editing. Content ...
[ "Marks", "up", "a", "string", "with", "paragraphs", "and", "automatically", "links", "any", "urls", "." ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/inputclean/InputClean.php#L209-L258
202,093
wb-crowdfusion/crowdfusion
system/core/classes/libraries/inputclean/InputClean.php
InputClean.unAutoParagraph
public function unAutoParagraph($string) { $string = str_replace(array("<p>","</p>","<br/>", "<br />"), array("", "\n\n", "\n", "\n"), $string); $string = preg_replace("/\<a href\=\"(".URLUtils::URL_MATCH.")\"\>\\1\<\/a\>/i", '$1', $string); $string = preg_replace_callback("/\<a href\=\"("....
php
public function unAutoParagraph($string) { $string = str_replace(array("<p>","</p>","<br/>", "<br />"), array("", "\n\n", "\n", "\n"), $string); $string = preg_replace("/\<a href\=\"(".URLUtils::URL_MATCH.")\"\>\\1\<\/a\>/i", '$1', $string); $string = preg_replace_callback("/\<a href\=\"("....
[ "public", "function", "unAutoParagraph", "(", "$", "string", ")", "{", "$", "string", "=", "str_replace", "(", "array", "(", "\"<p>\"", ",", "\"</p>\"", ",", "\"<br/>\"", ",", "\"<br />\"", ")", ",", "array", "(", "\"\"", ",", "\"\\n\\n\"", ",", "\"\\n\"",...
Removes the markup added by autoParagraph. This will restore the string to a version that's safe to display in a simple <textarea> editor. All autolinked urls are unlinked and paragraph tags are removed. @param string $string The string that will be deconverted @return string A version of $string suitable for editin...
[ "Removes", "the", "markup", "added", "by", "autoParagraph", "." ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/inputclean/InputClean.php#L291-L300
202,094
codeblanche/Entity
src/Entity/Utils.php
Utils.makeSetterGetterDoc
public static function makeSetterGetterDoc(Entity $entity) { $properties = $entity->toArray(false); $entityName = $entity->calledClassName(); echo "<pre>\n"; foreach ($properties as $name => $value) { $methodName = ucfirst($name); $type = $entity->type...
php
public static function makeSetterGetterDoc(Entity $entity) { $properties = $entity->toArray(false); $entityName = $entity->calledClassName(); echo "<pre>\n"; foreach ($properties as $name => $value) { $methodName = ucfirst($name); $type = $entity->type...
[ "public", "static", "function", "makeSetterGetterDoc", "(", "Entity", "$", "entity", ")", "{", "$", "properties", "=", "$", "entity", "->", "toArray", "(", "false", ")", ";", "$", "entityName", "=", "$", "entity", "->", "calledClassName", "(", ")", ";", ...
Generate the setter and getter method PHPDoc declaration to paste into your entity class. @param Entity $entity
[ "Generate", "the", "setter", "and", "getter", "method", "PHPDoc", "declaration", "to", "paste", "into", "your", "entity", "class", "." ]
1d3839c09d7639ae8bbfc9d2721223202f3a5cdd
https://github.com/codeblanche/Entity/blob/1d3839c09d7639ae8bbfc9d2721223202f3a5cdd/src/Entity/Utils.php#L20-L35
202,095
codeblanche/Entity
src/Entity/Utils.php
Utils.makePublicProperties
public static function makePublicProperties(array $properties) { echo '<pre>'."\n"; foreach ($properties as $key => $value) { $type = gettype($value); if ($type === 'object') { $type = get_class($value); } echo <<<EODOC /...
php
public static function makePublicProperties(array $properties) { echo '<pre>'."\n"; foreach ($properties as $key => $value) { $type = gettype($value); if ($type === 'object') { $type = get_class($value); } echo <<<EODOC /...
[ "public", "static", "function", "makePublicProperties", "(", "array", "$", "properties", ")", "{", "echo", "'<pre>'", ".", "\"\\n\"", ";", "foreach", "(", "$", "properties", "as", "$", "key", "=>", "$", "value", ")", "{", "$", "type", "=", "gettype", "("...
Generate the public properties PHPDoc declarations to paste into your entity class. @param array $properties
[ "Generate", "the", "public", "properties", "PHPDoc", "declarations", "to", "paste", "into", "your", "entity", "class", "." ]
1d3839c09d7639ae8bbfc9d2721223202f3a5cdd
https://github.com/codeblanche/Entity/blob/1d3839c09d7639ae8bbfc9d2721223202f3a5cdd/src/Entity/Utils.php#L41-L63
202,096
covex-nn/JooS
src/JooS/Event/Event.php
Event.getInstance
final public static function getInstance() { $className = get_called_class(); if (!isset(self::$_instances[$className])) { self::$_instances[$className] = new static(); } self::$_instances[$className]->initialize(); return self::$_instances[$className]; }
php
final public static function getInstance() { $className = get_called_class(); if (!isset(self::$_instances[$className])) { self::$_instances[$className] = new static(); } self::$_instances[$className]->initialize(); return self::$_instances[$className]; }
[ "final", "public", "static", "function", "getInstance", "(", ")", "{", "$", "className", "=", "get_called_class", "(", ")", ";", "if", "(", "!", "isset", "(", "self", "::", "$", "_instances", "[", "$", "className", "]", ")", ")", "{", "self", "::", "...
Return event instance @return Event
[ "Return", "event", "instance" ]
8dfb94edccecaf307787d4091ba7f20a674b7792
https://github.com/covex-nn/JooS/blob/8dfb94edccecaf307787d4091ba7f20a674b7792/src/JooS/Event/Event.php#L63-L73
202,097
covex-nn/JooS
src/JooS/Event/Event.php
Event.clearInstance
final public static function clearInstance($className) { if (isset(self::$_instances[$className])) { $name = self::_configName($className); Config::clearInstance($name); self::$_instances[$className]->_loadObservers(); } }
php
final public static function clearInstance($className) { if (isset(self::$_instances[$className])) { $name = self::_configName($className); Config::clearInstance($name); self::$_instances[$className]->_loadObservers(); } }
[ "final", "public", "static", "function", "clearInstance", "(", "$", "className", ")", "{", "if", "(", "isset", "(", "self", "::", "$", "_instances", "[", "$", "className", "]", ")", ")", "{", "$", "name", "=", "self", "::", "_configName", "(", "$", "...
Unloads event instance. @param string $className Event name @return null
[ "Unloads", "event", "instance", "." ]
8dfb94edccecaf307787d4091ba7f20a674b7792
https://github.com/covex-nn/JooS/blob/8dfb94edccecaf307787d4091ba7f20a674b7792/src/JooS/Event/Event.php#L82-L90
202,098
covex-nn/JooS
src/JooS/Event/Event.php
Event.notify
final public function notify() { $observers = array_values($this->_observers); foreach ($observers as $observer) { switch (false) { case is_array($observer): case isset($observer[0]): case isset($observer[1]): case is_string($observer[0]): break; default...
php
final public function notify() { $observers = array_values($this->_observers); foreach ($observers as $observer) { switch (false) { case is_array($observer): case isset($observer[0]): case isset($observer[1]): case is_string($observer[0]): break; default...
[ "final", "public", "function", "notify", "(", ")", "{", "$", "observers", "=", "array_values", "(", "$", "this", "->", "_observers", ")", ";", "foreach", "(", "$", "observers", "as", "$", "observer", ")", "{", "switch", "(", "false", ")", "{", "case", ...
Notify observers. @return Event
[ "Notify", "observers", "." ]
8dfb94edccecaf307787d4091ba7f20a674b7792
https://github.com/covex-nn/JooS/blob/8dfb94edccecaf307787d4091ba7f20a674b7792/src/JooS/Event/Event.php#L111-L134
202,099
covex-nn/JooS
src/JooS/Event/Event.php
Event.attach
final public function attach($observer) { if (!in_array($observer, $this->_observers)) { array_push($this->_observers, $observer); } return $this; }
php
final public function attach($observer) { if (!in_array($observer, $this->_observers)) { array_push($this->_observers, $observer); } return $this; }
[ "final", "public", "function", "attach", "(", "$", "observer", ")", "{", "if", "(", "!", "in_array", "(", "$", "observer", ",", "$", "this", "->", "_observers", ")", ")", "{", "array_push", "(", "$", "this", "->", "_observers", ",", "$", "observer", ...
Attach new observer. @param callback $observer Observer @return Event
[ "Attach", "new", "observer", "." ]
8dfb94edccecaf307787d4091ba7f20a674b7792
https://github.com/covex-nn/JooS/blob/8dfb94edccecaf307787d4091ba7f20a674b7792/src/JooS/Event/Event.php#L143-L149