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
237,100
elcodi/Configuration
Services/ConfigurationManager.php
ConfigurationManager.delete
public function delete($configurationIdentifier) { /** * Checks if the value is defined in the configuration elements. */ if (!array_key_exists($configurationIdentifier, $this->configurationElements)) { throw new ConfigurationParameterNotFoundException(); } ...
php
public function delete($configurationIdentifier) { /** * Checks if the value is defined in the configuration elements. */ if (!array_key_exists($configurationIdentifier, $this->configurationElements)) { throw new ConfigurationParameterNotFoundException(); } ...
[ "public", "function", "delete", "(", "$", "configurationIdentifier", ")", "{", "/**\n * Checks if the value is defined in the configuration elements.\n */", "if", "(", "!", "array_key_exists", "(", "$", "configurationIdentifier", ",", "$", "this", "->", "confi...
Deletes a parameter given the format "namespace.key". @param string $configurationIdentifier @return bool @throws ConfigurationNotEditableException Configuration parameter is read-only @throws ConfigurationParameterNotFoundException Configuration parameter not found
[ "Deletes", "a", "parameter", "given", "the", "format", "namespace", ".", "key", "." ]
1e416269c2e1bd957f98c6b1845dffb218794c55
https://github.com/elcodi/Configuration/blob/1e416269c2e1bd957f98c6b1845dffb218794c55/Services/ConfigurationManager.php#L246-L298
237,101
elcodi/Configuration
Services/ConfigurationManager.php
ConfigurationManager.loadConfiguration
private function loadConfiguration( $configurationNamespace, $configurationKey ) { $configurationEntity = $this ->configurationRepository ->find([ 'namespace' => $configurationNamespace, 'key' => $configurationKey, ]); ...
php
private function loadConfiguration( $configurationNamespace, $configurationKey ) { $configurationEntity = $this ->configurationRepository ->find([ 'namespace' => $configurationNamespace, 'key' => $configurationKey, ]); ...
[ "private", "function", "loadConfiguration", "(", "$", "configurationNamespace", ",", "$", "configurationKey", ")", "{", "$", "configurationEntity", "=", "$", "this", "->", "configurationRepository", "->", "find", "(", "[", "'namespace'", "=>", "$", "configurationNam...
Loads a configuration. @param string $configurationNamespace Configuration namespace @param string $configurationKey Configuration key @return ConfigurationInterface|null Object saved
[ "Loads", "a", "configuration", "." ]
1e416269c2e1bd957f98c6b1845dffb218794c55
https://github.com/elcodi/Configuration/blob/1e416269c2e1bd957f98c6b1845dffb218794c55/Services/ConfigurationManager.php#L308-L320
237,102
elcodi/Configuration
Services/ConfigurationManager.php
ConfigurationManager.flushConfiguration
private function flushConfiguration(ConfigurationInterface $configuration) { $this ->configurationObjectManager ->persist($configuration); $this ->configurationObjectManager ->flush($configuration); return $this; }
php
private function flushConfiguration(ConfigurationInterface $configuration) { $this ->configurationObjectManager ->persist($configuration); $this ->configurationObjectManager ->flush($configuration); return $this; }
[ "private", "function", "flushConfiguration", "(", "ConfigurationInterface", "$", "configuration", ")", "{", "$", "this", "->", "configurationObjectManager", "->", "persist", "(", "$", "configuration", ")", ";", "$", "this", "->", "configurationObjectManager", "->", ...
Flushes a configuration instance. @param ConfigurationInterface $configuration Configuration instance @return ConfigurationManager Self object
[ "Flushes", "a", "configuration", "instance", "." ]
1e416269c2e1bd957f98c6b1845dffb218794c55
https://github.com/elcodi/Configuration/blob/1e416269c2e1bd957f98c6b1845dffb218794c55/Services/ConfigurationManager.php#L329-L340
237,103
elcodi/Configuration
Services/ConfigurationManager.php
ConfigurationManager.deleteConfiguration
private function deleteConfiguration(ConfigurationInterface $configuration) { $this ->configurationObjectManager ->remove($configuration); $this ->configurationObjectManager ->flush($configuration); return $this; }
php
private function deleteConfiguration(ConfigurationInterface $configuration) { $this ->configurationObjectManager ->remove($configuration); $this ->configurationObjectManager ->flush($configuration); return $this; }
[ "private", "function", "deleteConfiguration", "(", "ConfigurationInterface", "$", "configuration", ")", "{", "$", "this", "->", "configurationObjectManager", "->", "remove", "(", "$", "configuration", ")", ";", "$", "this", "->", "configurationObjectManager", "->", ...
Deletes a configuration instance. @param ConfigurationInterface $configuration Configuration instance @return $this Self object
[ "Deletes", "a", "configuration", "instance", "." ]
1e416269c2e1bd957f98c6b1845dffb218794c55
https://github.com/elcodi/Configuration/blob/1e416269c2e1bd957f98c6b1845dffb218794c55/Services/ConfigurationManager.php#L349-L360
237,104
elcodi/Configuration
Services/ConfigurationManager.php
ConfigurationManager.createConfigurationInstance
private function createConfigurationInstance( $configurationIdentifier, $configurationNamespace, $configurationKey, $configurationValue ) { /** * Value is not found on database. We can just check if the value is * defined in the configuration elements, and w...
php
private function createConfigurationInstance( $configurationIdentifier, $configurationNamespace, $configurationKey, $configurationValue ) { /** * Value is not found on database. We can just check if the value is * defined in the configuration elements, and w...
[ "private", "function", "createConfigurationInstance", "(", "$", "configurationIdentifier", ",", "$", "configurationNamespace", ",", "$", "configurationKey", ",", "$", "configurationValue", ")", "{", "/**\n * Value is not found on database. We can just check if the value is\...
Creates a new configuration instance and serializes. @param string $configurationIdentifier Configuration identifier @param string $configurationNamespace Configuration namespace @param string $configurationKey Configuration key @param mixed $configurationValue Configuration value @return ConfigurationI...
[ "Creates", "a", "new", "configuration", "instance", "and", "serializes", "." ]
1e416269c2e1bd957f98c6b1845dffb218794c55
https://github.com/elcodi/Configuration/blob/1e416269c2e1bd957f98c6b1845dffb218794c55/Services/ConfigurationManager.php#L374-L407
237,105
elcodi/Configuration
Services/ConfigurationManager.php
ConfigurationManager.flushConfigurationToCache
private function flushConfigurationToCache( ConfigurationInterface $configuration, $configurationIdentifier ) { $configurationValue = $this->unserializeValue( $configuration->getValue(), $configuration->getType() ); $this ->cache ...
php
private function flushConfigurationToCache( ConfigurationInterface $configuration, $configurationIdentifier ) { $configurationValue = $this->unserializeValue( $configuration->getValue(), $configuration->getType() ); $this ->cache ...
[ "private", "function", "flushConfigurationToCache", "(", "ConfigurationInterface", "$", "configuration", ",", "$", "configurationIdentifier", ")", "{", "$", "configurationValue", "=", "$", "this", "->", "unserializeValue", "(", "$", "configuration", "->", "getValue", ...
Saves configuration into cache. @param ConfigurationInterface $configuration Configuration @param string $configurationIdentifier Configuration identifier @return mixed flushed value
[ "Saves", "configuration", "into", "cache", "." ]
1e416269c2e1bd957f98c6b1845dffb218794c55
https://github.com/elcodi/Configuration/blob/1e416269c2e1bd957f98c6b1845dffb218794c55/Services/ConfigurationManager.php#L417-L434
237,106
elcodi/Configuration
Services/ConfigurationManager.php
ConfigurationManager.splitConfigurationKey
private function splitConfigurationKey($configurationIdentifier) { $configurationIdentifier = explode('.', $configurationIdentifier, 2); if (count($configurationIdentifier) === 1) { array_unshift($configurationIdentifier, ''); } return $configurationIdentifier; }
php
private function splitConfigurationKey($configurationIdentifier) { $configurationIdentifier = explode('.', $configurationIdentifier, 2); if (count($configurationIdentifier) === 1) { array_unshift($configurationIdentifier, ''); } return $configurationIdentifier; }
[ "private", "function", "splitConfigurationKey", "(", "$", "configurationIdentifier", ")", "{", "$", "configurationIdentifier", "=", "explode", "(", "'.'", ",", "$", "configurationIdentifier", ",", "2", ")", ";", "if", "(", "count", "(", "$", "configurationIdentifi...
Split the configuration identifier and return each part. @param string $configurationIdentifier Configuration identifier @return string[] Identifier splitted
[ "Split", "the", "configuration", "identifier", "and", "return", "each", "part", "." ]
1e416269c2e1bd957f98c6b1845dffb218794c55
https://github.com/elcodi/Configuration/blob/1e416269c2e1bd957f98c6b1845dffb218794c55/Services/ConfigurationManager.php#L443-L452
237,107
elcodi/Configuration
Services/ConfigurationManager.php
ConfigurationManager.unserializeValue
private function unserializeValue($configurationValue, $configurationType) { switch ($configurationType) { case ElcodiConfigurationTypes::TYPE_BOOLEAN: $configurationValue = (boolean) $configurationValue; break; case ElcodiConfigurationTypes::TYPE_AR...
php
private function unserializeValue($configurationValue, $configurationType) { switch ($configurationType) { case ElcodiConfigurationTypes::TYPE_BOOLEAN: $configurationValue = (boolean) $configurationValue; break; case ElcodiConfigurationTypes::TYPE_AR...
[ "private", "function", "unserializeValue", "(", "$", "configurationValue", ",", "$", "configurationType", ")", "{", "switch", "(", "$", "configurationType", ")", "{", "case", "ElcodiConfigurationTypes", "::", "TYPE_BOOLEAN", ":", "$", "configurationValue", "=", "(",...
Unserialize configuration value. @param string $configurationValue Configuration value @param string $configurationType Configuration type @return mixed Configuration value unserialized
[ "Unserialize", "configuration", "value", "." ]
1e416269c2e1bd957f98c6b1845dffb218794c55
https://github.com/elcodi/Configuration/blob/1e416269c2e1bd957f98c6b1845dffb218794c55/Services/ConfigurationManager.php#L462-L476
237,108
elcodi/Configuration
Services/ConfigurationManager.php
ConfigurationManager.serializeValue
private function serializeValue($configurationValue, $configurationType) { switch ($configurationType) { case ElcodiConfigurationTypes::TYPE_ARRAY: $configurationValue = json_encode($configurationValue); break; } return $configurationValue; }
php
private function serializeValue($configurationValue, $configurationType) { switch ($configurationType) { case ElcodiConfigurationTypes::TYPE_ARRAY: $configurationValue = json_encode($configurationValue); break; } return $configurationValue; }
[ "private", "function", "serializeValue", "(", "$", "configurationValue", ",", "$", "configurationType", ")", "{", "switch", "(", "$", "configurationType", ")", "{", "case", "ElcodiConfigurationTypes", "::", "TYPE_ARRAY", ":", "$", "configurationValue", "=", "json_en...
Serialize configuration value. @param string $configurationValue Configuration value @param string $configurationType Configuration type @return string Configuration value serialized
[ "Serialize", "configuration", "value", "." ]
1e416269c2e1bd957f98c6b1845dffb218794c55
https://github.com/elcodi/Configuration/blob/1e416269c2e1bd957f98c6b1845dffb218794c55/Services/ConfigurationManager.php#L486-L496
237,109
chilimatic/transformer-component
src/Time/DateDiffToDecimalTime.php
DateDiffToDecimalTime.transform
public function transform($content, $options = []) { if (!$content instanceof \DateInterval) { return 0; } $decTime = 0; $decTime += ($content->d ? $content->d * 60 * 24 : 0); $decTime += ($content->h ? $content->h * 60 : 0); $decTime += $content->i; ...
php
public function transform($content, $options = []) { if (!$content instanceof \DateInterval) { return 0; } $decTime = 0; $decTime += ($content->d ? $content->d * 60 * 24 : 0); $decTime += ($content->h ? $content->h * 60 : 0); $decTime += $content->i; ...
[ "public", "function", "transform", "(", "$", "content", ",", "$", "options", "=", "[", "]", ")", "{", "if", "(", "!", "$", "content", "instanceof", "\\", "DateInterval", ")", "{", "return", "0", ";", "}", "$", "decTime", "=", "0", ";", "$", "decTim...
calculates the time down to the minutes @param \DateInterval $content @param array $options @return string
[ "calculates", "the", "time", "down", "to", "the", "minutes" ]
1d20cda19531bb3d3476666793906680ee523363
https://github.com/chilimatic/transformer-component/blob/1d20cda19531bb3d3476666793906680ee523363/src/Time/DateDiffToDecimalTime.php#L22-L35
237,110
tenside/core
src/Task/Composer/DumpAutoloadTask.php
DumpAutoloadTask.prepareInput
protected function prepareInput() { $arguments = [ '--optimize' => (bool) $this->file->get(self::SETTING_OPTIMIZE), '--no-dev' => true, ]; $input = new ArrayInput($arguments); $input->setInteractive(false); return $input; }
php
protected function prepareInput() { $arguments = [ '--optimize' => (bool) $this->file->get(self::SETTING_OPTIMIZE), '--no-dev' => true, ]; $input = new ArrayInput($arguments); $input->setInteractive(false); return $input; }
[ "protected", "function", "prepareInput", "(", ")", "{", "$", "arguments", "=", "[", "'--optimize'", "=>", "(", "bool", ")", "$", "this", "->", "file", "->", "get", "(", "self", "::", "SETTING_OPTIMIZE", ")", ",", "'--no-dev'", "=>", "true", ",", "]", "...
Prepare the input interface for the command. @return InputInterface
[ "Prepare", "the", "input", "interface", "for", "the", "command", "." ]
56422fa8cdecf03cb431bb6654c2942ade39bf7b
https://github.com/tenside/core/blob/56422fa8cdecf03cb431bb6654c2942ade39bf7b/src/Task/Composer/DumpAutoloadTask.php#L67-L78
237,111
mxc-commons/mxc-servicemanager
src/AbstractFactory/ReflectionBasedAbstractFactory.php
ReflectionBasedAbstractFactory.resolveParameterWithoutConfigService
private function resolveParameterWithoutConfigService(ContainerInterface $container, $requestedName) { /** * @param ReflectionParameter $parameter * @return mixed * @throws ServiceNotFoundException If type-hinted parameter cannot be * resolved to a service in the contai...
php
private function resolveParameterWithoutConfigService(ContainerInterface $container, $requestedName) { /** * @param ReflectionParameter $parameter * @return mixed * @throws ServiceNotFoundException If type-hinted parameter cannot be * resolved to a service in the contai...
[ "private", "function", "resolveParameterWithoutConfigService", "(", "ContainerInterface", "$", "container", ",", "$", "requestedName", ")", "{", "/**\n * @param ReflectionParameter $parameter\n * @return mixed\n * @throws ServiceNotFoundException If type-hinted parame...
Resolve a parameter to a value. Returns a callback for resolving a parameter to a value, but without allowing mapping array `$config` arguments to the `config` service. @param ContainerInterface $container @param string $requestedName @return callable
[ "Resolve", "a", "parameter", "to", "a", "value", "." ]
547a9ed579b96d32cb54db5723510d75fcad71be
https://github.com/mxc-commons/mxc-servicemanager/blob/547a9ed579b96d32cb54db5723510d75fcad71be/src/AbstractFactory/ReflectionBasedAbstractFactory.php#L151-L162
237,112
mxc-commons/mxc-servicemanager
src/AbstractFactory/ReflectionBasedAbstractFactory.php
ReflectionBasedAbstractFactory.resolveParameterWithConfigService
private function resolveParameterWithConfigService(ContainerInterface $container, $requestedName) { /** * @param ReflectionParameter $parameter * @return mixed * @throws ServiceNotFoundException If type-hinted parameter cannot be * resolved to a service in the container...
php
private function resolveParameterWithConfigService(ContainerInterface $container, $requestedName) { /** * @param ReflectionParameter $parameter * @return mixed * @throws ServiceNotFoundException If type-hinted parameter cannot be * resolved to a service in the container...
[ "private", "function", "resolveParameterWithConfigService", "(", "ContainerInterface", "$", "container", ",", "$", "requestedName", ")", "{", "/**\n * @param ReflectionParameter $parameter\n * @return mixed\n * @throws ServiceNotFoundException If type-hinted parameter...
Returns a callback for resolving a parameter to a value, including mapping 'config' arguments. Unlike resolveParameter(), this version will detect `$config` array arguments and have them return the 'config' service. @param ContainerInterface $container @param string $requestedName @return callable
[ "Returns", "a", "callback", "for", "resolving", "a", "parameter", "to", "a", "value", "including", "mapping", "config", "arguments", "." ]
547a9ed579b96d32cb54db5723510d75fcad71be
https://github.com/mxc-commons/mxc-servicemanager/blob/547a9ed579b96d32cb54db5723510d75fcad71be/src/AbstractFactory/ReflectionBasedAbstractFactory.php#L174-L188
237,113
mxc-commons/mxc-servicemanager
src/AbstractFactory/ReflectionBasedAbstractFactory.php
ReflectionBasedAbstractFactory.resolveParameter
private function resolveParameter(ReflectionParameter $parameter, ContainerInterface $container, $requestedName) { if ($parameter->isArray()) { return []; } if (! $parameter->getClass()) { if (! $parameter->isDefaultValueAvailable()) { throw new Servi...
php
private function resolveParameter(ReflectionParameter $parameter, ContainerInterface $container, $requestedName) { if ($parameter->isArray()) { return []; } if (! $parameter->getClass()) { if (! $parameter->isDefaultValueAvailable()) { throw new Servi...
[ "private", "function", "resolveParameter", "(", "ReflectionParameter", "$", "parameter", ",", "ContainerInterface", "$", "container", ",", "$", "requestedName", ")", "{", "if", "(", "$", "parameter", "->", "isArray", "(", ")", ")", "{", "return", "[", "]", "...
Logic common to all parameter resolution. @param ReflectionParameter $parameter @param ContainerInterface $container @param string $requestedName @return mixed @throws ServiceNotFoundException If type-hinted parameter cannot be resolved to a service in the container.
[ "Logic", "common", "to", "all", "parameter", "resolution", "." ]
547a9ed579b96d32cb54db5723510d75fcad71be
https://github.com/mxc-commons/mxc-servicemanager/blob/547a9ed579b96d32cb54db5723510d75fcad71be/src/AbstractFactory/ReflectionBasedAbstractFactory.php#L200-L238
237,114
mandango/MandangoBundle
DependencyInjection/MandangoExtension.php
MandangoExtension.load
public function load(array $configs, ContainerBuilder $container) { $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); $loader->load('mandango.xml'); $processor = new Processor(); $configuration = new Configuration($container->getParameter('ker...
php
public function load(array $configs, ContainerBuilder $container) { $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); $loader->load('mandango.xml'); $processor = new Processor(); $configuration = new Configuration($container->getParameter('ker...
[ "public", "function", "load", "(", "array", "$", "configs", ",", "ContainerBuilder", "$", "container", ")", "{", "$", "loader", "=", "new", "XmlFileLoader", "(", "$", "container", ",", "new", "FileLocator", "(", "__DIR__", ".", "'/../Resources/config'", ")", ...
Responds to the "mandango" configuration parameter. @param array $configs @param ContainerBuilder $container
[ "Responds", "to", "the", "mandango", "configuration", "parameter", "." ]
36e2ff4cc43989abbb3bd2f84cd7909c0f39d5b9
https://github.com/mandango/MandangoBundle/blob/36e2ff4cc43989abbb3bd2f84cd7909c0f39d5b9/DependencyInjection/MandangoExtension.php#L35-L79
237,115
tekkla/core-html
Core/Html/FormDesigner/FormElement.php
FormElement.&
public function &setContent($content) { // Set element type by analyzing the element switch (true) { case ($content instanceof FormGroup): $this->type = 'group'; break; case ($content instanceof ControlsCollectionInterface): $...
php
public function &setContent($content) { // Set element type by analyzing the element switch (true) { case ($content instanceof FormGroup): $this->type = 'group'; break; case ($content instanceof ControlsCollectionInterface): $...
[ "public", "function", "&", "setContent", "(", "$", "content", ")", "{", "// Set element type by analyzing the element", "switch", "(", "true", ")", "{", "case", "(", "$", "content", "instanceof", "FormGroup", ")", ":", "$", "this", "->", "type", "=", "'group'"...
Sets the element. @param sting|AbstractForm|AbstractHtml $element @return Ambigous <\Core\Html\AbstractForm, \Core\Html\AbstractHtml, \Core\Html\FormDesigner\FormGroup>
[ "Sets", "the", "element", "." ]
00bf3fa8e060e8aadf1c341f6e3c548c7a76cfd3
https://github.com/tekkla/core-html/blob/00bf3fa8e060e8aadf1c341f6e3c548c7a76cfd3/Core/Html/FormDesigner/FormElement.php#L75-L103
237,116
atelierspierrot/library
src/Library/HttpFundamental/Response.php
Response.download
public function download($file = null, $type = null, $file_name = null) { if (!empty($file) && @file_exists($file)) { if (is_null($file_name)) { $file_name_parts = explode('/', $file); $file_name = end( $file_name_parts ); } $this->addHeade...
php
public function download($file = null, $type = null, $file_name = null) { if (!empty($file) && @file_exists($file)) { if (is_null($file_name)) { $file_name_parts = explode('/', $file); $file_name = end( $file_name_parts ); } $this->addHeade...
[ "public", "function", "download", "(", "$", "file", "=", "null", ",", "$", "type", "=", "null", ",", "$", "file_name", "=", "null", ")", "{", "if", "(", "!", "empty", "(", "$", "file", ")", "&&", "@", "file_exists", "(", "$", "file", ")", ")", ...
Force client to download a file @param null $file @param null $type @param null $file_name
[ "Force", "client", "to", "download", "a", "file" ]
a2988a11370d13c7e0dc47f9d2d81c664c30b8dd
https://github.com/atelierspierrot/library/blob/a2988a11370d13c7e0dc47f9d2d81c664c30b8dd/src/Library/HttpFundamental/Response.php#L360-L379
237,117
bishopb/vanilla
applications/vanilla/settings/class.hooks.php
VanillaHooks.UserModel_BeforeDeleteUser_Handler
public function UserModel_BeforeDeleteUser_Handler($Sender) { $UserID = GetValue('UserID', $Sender->EventArguments); $Options = GetValue('Options', $Sender->EventArguments, array()); $Options = is_array($Options) ? $Options : array(); $Content =& $Sender->EventArguments['Content']; ...
php
public function UserModel_BeforeDeleteUser_Handler($Sender) { $UserID = GetValue('UserID', $Sender->EventArguments); $Options = GetValue('Options', $Sender->EventArguments, array()); $Options = is_array($Options) ? $Options : array(); $Content =& $Sender->EventArguments['Content']; ...
[ "public", "function", "UserModel_BeforeDeleteUser_Handler", "(", "$", "Sender", ")", "{", "$", "UserID", "=", "GetValue", "(", "'UserID'", ",", "$", "Sender", "->", "EventArguments", ")", ";", "$", "Options", "=", "GetValue", "(", "'Options'", ",", "$", "Sen...
Remove Vanilla data when deleting a user. @since 2.0.0 @package Vanilla @param UserModel $Sender UserModel.
[ "Remove", "Vanilla", "data", "when", "deleting", "a", "user", "." ]
8494eb4a4ad61603479015a8054d23ff488364e8
https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/applications/vanilla/settings/class.hooks.php#L158-L165
237,118
bishopb/vanilla
applications/vanilla/settings/class.hooks.php
VanillaHooks.UserModel_GetCategoryViewPermission_Create
public function UserModel_GetCategoryViewPermission_Create($Sender) { static $PermissionModel = NULL; $UserID = ArrayValue(0, $Sender->EventArguments, ''); $CategoryID = ArrayValue(1, $Sender->EventArguments, ''); $Permission = GetValue(2, $Sender->EventArguments, 'Vanilla.Discussions.View'); if...
php
public function UserModel_GetCategoryViewPermission_Create($Sender) { static $PermissionModel = NULL; $UserID = ArrayValue(0, $Sender->EventArguments, ''); $CategoryID = ArrayValue(1, $Sender->EventArguments, ''); $Permission = GetValue(2, $Sender->EventArguments, 'Vanilla.Discussions.View'); if...
[ "public", "function", "UserModel_GetCategoryViewPermission_Create", "(", "$", "Sender", ")", "{", "static", "$", "PermissionModel", "=", "NULL", ";", "$", "UserID", "=", "ArrayValue", "(", "0", ",", "$", "Sender", "->", "EventArguments", ",", "''", ")", ";", ...
Check whether a user has access to view discussions in a particular category. @since 2.0.18 @example $UserModel->GetCategoryViewPermission($UserID, $CategoryID). @param $Sender UserModel. @return bool Whether user has permission.
[ "Check", "whether", "a", "user", "has", "access", "to", "view", "discussions", "in", "a", "particular", "category", "." ]
8494eb4a4ad61603479015a8054d23ff488364e8
https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/applications/vanilla/settings/class.hooks.php#L176-L197
237,119
bishopb/vanilla
applications/vanilla/settings/class.hooks.php
VanillaHooks.Base_Render_Before
public function Base_Render_Before($Sender) { $Session = Gdn::Session(); if ($Sender->Menu) $Sender->Menu->AddLink('Discussions', T('Discussions'), '/discussions', FALSE, array('Standard' => TRUE)); }
php
public function Base_Render_Before($Sender) { $Session = Gdn::Session(); if ($Sender->Menu) $Sender->Menu->AddLink('Discussions', T('Discussions'), '/discussions', FALSE, array('Standard' => TRUE)); }
[ "public", "function", "Base_Render_Before", "(", "$", "Sender", ")", "{", "$", "Session", "=", "Gdn", "::", "Session", "(", ")", ";", "if", "(", "$", "Sender", "->", "Menu", ")", "$", "Sender", "->", "Menu", "->", "AddLink", "(", "'Discussions'", ",", ...
Adds 'Discussion' item to menu. 'Base_Render_Before' will trigger before every pageload across apps. If you abuse this hook, Tim with throw a Coke can at your head. @since 2.0.0 @package Vanilla @param object $Sender DashboardController.
[ "Adds", "Discussion", "item", "to", "menu", "." ]
8494eb4a4ad61603479015a8054d23ff488364e8
https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/applications/vanilla/settings/class.hooks.php#L210-L214
237,120
bishopb/vanilla
applications/vanilla/settings/class.hooks.php
VanillaHooks.ProfileController_AddProfileTabs_Handler
public function ProfileController_AddProfileTabs_Handler($Sender) { if (is_object($Sender->User) && $Sender->User->UserID > 0) { $UserID = $Sender->User->UserID; // Add the discussion tab $DiscussionsLabel = Sprite('SpDiscussions').' '.T('Discussions'); $CommentsLabel = Sprite(...
php
public function ProfileController_AddProfileTabs_Handler($Sender) { if (is_object($Sender->User) && $Sender->User->UserID > 0) { $UserID = $Sender->User->UserID; // Add the discussion tab $DiscussionsLabel = Sprite('SpDiscussions').' '.T('Discussions'); $CommentsLabel = Sprite(...
[ "public", "function", "ProfileController_AddProfileTabs_Handler", "(", "$", "Sender", ")", "{", "if", "(", "is_object", "(", "$", "Sender", "->", "User", ")", "&&", "$", "Sender", "->", "User", "->", "UserID", ">", "0", ")", "{", "$", "UserID", "=", "$",...
Adds 'Discussions' tab to profiles and adds CSS & JS files to their head. @since 2.0.0 @package Vanilla @param object $Sender ProfileController.
[ "Adds", "Discussions", "tab", "to", "profiles", "and", "adds", "CSS", "&", "JS", "files", "to", "their", "head", "." ]
8494eb4a4ad61603479015a8054d23ff488364e8
https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/applications/vanilla/settings/class.hooks.php#L224-L240
237,121
bishopb/vanilla
applications/vanilla/settings/class.hooks.php
VanillaHooks.ProfileController_AfterPreferencesDefined_Handler
public function ProfileController_AfterPreferencesDefined_Handler($Sender) { $Sender->Preferences['Notifications']['Email.DiscussionComment'] = T('Notify me when people comment on my discussions.'); $Sender->Preferences['Notifications']['Email.BookmarkComment'] = T('Notify me when people comment on my bookm...
php
public function ProfileController_AfterPreferencesDefined_Handler($Sender) { $Sender->Preferences['Notifications']['Email.DiscussionComment'] = T('Notify me when people comment on my discussions.'); $Sender->Preferences['Notifications']['Email.BookmarkComment'] = T('Notify me when people comment on my bookm...
[ "public", "function", "ProfileController_AfterPreferencesDefined_Handler", "(", "$", "Sender", ")", "{", "$", "Sender", "->", "Preferences", "[", "'Notifications'", "]", "[", "'Email.DiscussionComment'", "]", "=", "T", "(", "'Notify me when people comment on my discussions....
Adds email notification options to profiles. @since 2.0.0 @package Vanilla @param ProfileController $Sender
[ "Adds", "email", "notification", "options", "to", "profiles", "." ]
8494eb4a4ad61603479015a8054d23ff488364e8
https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/applications/vanilla/settings/class.hooks.php#L250-L297
237,122
bishopb/vanilla
applications/vanilla/settings/class.hooks.php
VanillaHooks.ProfileController_Comments_Create
public function ProfileController_Comments_Create($Sender, $UserReference = '', $Username = '', $Page = '', $UserID = '') { $Sender->EditMode(FALSE); $View = $Sender->View; // Tell the ProfileController what tab to load $Sender->GetUserInfo($UserReference, $Username, $UserID); $Sender->_SetBreadcrumbs...
php
public function ProfileController_Comments_Create($Sender, $UserReference = '', $Username = '', $Page = '', $UserID = '') { $Sender->EditMode(FALSE); $View = $Sender->View; // Tell the ProfileController what tab to load $Sender->GetUserInfo($UserReference, $Username, $UserID); $Sender->_SetBreadcrumbs...
[ "public", "function", "ProfileController_Comments_Create", "(", "$", "Sender", ",", "$", "UserReference", "=", "''", ",", "$", "Username", "=", "''", ",", "$", "Page", "=", "''", ",", "$", "UserID", "=", "''", ")", "{", "$", "Sender", "->", "EditMode", ...
Creates virtual 'Comments' method in ProfileController. @since 2.0.0 @package Vanilla @param ProfileController $Sender ProfileController.
[ "Creates", "virtual", "Comments", "method", "in", "ProfileController", "." ]
8494eb4a4ad61603479015a8054d23ff488364e8
https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/applications/vanilla/settings/class.hooks.php#L362-L410
237,123
bishopb/vanilla
applications/vanilla/settings/class.hooks.php
VanillaHooks.ProfileController_Discussions_Create
public function ProfileController_Discussions_Create($Sender, $UserReference = '', $Username = '', $Page = '', $UserID = '') { $Sender->EditMode(FALSE); // Tell the ProfileController what tab to load $Sender->GetUserInfo($UserReference, $Username, $UserID); $Sender->_SetBreadcrumbs(T('Discussions'), ...
php
public function ProfileController_Discussions_Create($Sender, $UserReference = '', $Username = '', $Page = '', $UserID = '') { $Sender->EditMode(FALSE); // Tell the ProfileController what tab to load $Sender->GetUserInfo($UserReference, $Username, $UserID); $Sender->_SetBreadcrumbs(T('Discussions'), ...
[ "public", "function", "ProfileController_Discussions_Create", "(", "$", "Sender", ",", "$", "UserReference", "=", "''", ",", "$", "Username", "=", "''", ",", "$", "Page", "=", "''", ",", "$", "UserID", "=", "''", ")", "{", "$", "Sender", "->", "EditMode"...
Creates virtual 'Discussions' method in ProfileController. @since 2.0.0 @package Vanilla @param ProfileController $Sender ProfileController.
[ "Creates", "virtual", "Discussions", "method", "in", "ProfileController", "." ]
8494eb4a4ad61603479015a8054d23ff488364e8
https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/applications/vanilla/settings/class.hooks.php#L420-L469
237,124
bishopb/vanilla
applications/vanilla/settings/class.hooks.php
VanillaHooks.Base_GetAppSettingsMenuItems_Handler
public function Base_GetAppSettingsMenuItems_Handler($Sender) { $Menu = &$Sender->EventArguments['SideMenu']; $Menu->AddLink('Moderation', T('Flood Control'), 'vanilla/settings/floodcontrol', 'Garden.Settings.Manage'); $Menu->AddLink('Forum', T('Categories'), 'vanilla/settings/managecategories', 'Gard...
php
public function Base_GetAppSettingsMenuItems_Handler($Sender) { $Menu = &$Sender->EventArguments['SideMenu']; $Menu->AddLink('Moderation', T('Flood Control'), 'vanilla/settings/floodcontrol', 'Garden.Settings.Manage'); $Menu->AddLink('Forum', T('Categories'), 'vanilla/settings/managecategories', 'Gard...
[ "public", "function", "Base_GetAppSettingsMenuItems_Handler", "(", "$", "Sender", ")", "{", "$", "Menu", "=", "&", "$", "Sender", "->", "EventArguments", "[", "'SideMenu'", "]", ";", "$", "Menu", "->", "AddLink", "(", "'Moderation'", ",", "T", "(", "'Flood C...
Adds items to dashboard menu. @since 2.0.0 @package Vanilla @param object $Sender DashboardController.
[ "Adds", "items", "to", "dashboard", "menu", "." ]
8494eb4a4ad61603479015a8054d23ff488364e8
https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/applications/vanilla/settings/class.hooks.php#L539-L546
237,125
bishopb/vanilla
applications/vanilla/settings/class.hooks.php
VanillaHooks.Setup
public function Setup() { $Database = Gdn::Database(); $Config = Gdn::Factory(Gdn::AliasConfig); $Drop = Gdn::Config('Vanilla.Version') === FALSE ? TRUE : FALSE; $Explicit = TRUE; // Call structure.php to update database $Validation = new Gdn_Validation(); // Needed by structu...
php
public function Setup() { $Database = Gdn::Database(); $Config = Gdn::Factory(Gdn::AliasConfig); $Drop = Gdn::Config('Vanilla.Version') === FALSE ? TRUE : FALSE; $Explicit = TRUE; // Call structure.php to update database $Validation = new Gdn_Validation(); // Needed by structu...
[ "public", "function", "Setup", "(", ")", "{", "$", "Database", "=", "Gdn", "::", "Database", "(", ")", ";", "$", "Config", "=", "Gdn", "::", "Factory", "(", "Gdn", "::", "AliasConfig", ")", ";", "$", "Drop", "=", "Gdn", "::", "Config", "(", "'Vanil...
Automatically executed when application is enabled. @since 2.0.0 @package Vanilla
[ "Automatically", "executed", "when", "application", "is", "enabled", "." ]
8494eb4a4ad61603479015a8054d23ff488364e8
https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/applications/vanilla/settings/class.hooks.php#L554-L565
237,126
phossa2/libs
src/Phossa2/Di/Traits/InstanceFactoryTrait.php
InstanceFactoryTrait.getInstance
protected function getInstance(/*# string */ $id, array $args) { // get id & scope info list($rawId, $scopedId, $scope) = $this->realScopeInfo($id); // get from the pool if (isset($this->pool[$scopedId])) { return $this->pool[$scopedId]; } // create inst...
php
protected function getInstance(/*# string */ $id, array $args) { // get id & scope info list($rawId, $scopedId, $scope) = $this->realScopeInfo($id); // get from the pool if (isset($this->pool[$scopedId])) { return $this->pool[$scopedId]; } // create inst...
[ "protected", "function", "getInstance", "(", "/*# string */", "$", "id", ",", "array", "$", "args", ")", "{", "// get id & scope info", "list", "(", "$", "rawId", ",", "$", "scopedId", ",", "$", "scope", ")", "=", "$", "this", "->", "realScopeInfo", "(", ...
Get the instance either from the pool or create it @param string $id service id with or without the scope @param array $args arguments for the constructor @return object @throws LogicException if instantiation goes wrong @throws RuntimeException if method execution goes wrong @access protected
[ "Get", "the", "instance", "either", "from", "the", "pool", "or", "create", "it" ]
921e485c8cc29067f279da2cdd06f47a9bddd115
https://github.com/phossa2/libs/blob/921e485c8cc29067f279da2cdd06f47a9bddd115/src/Phossa2/Di/Traits/InstanceFactoryTrait.php#L68-L87
237,127
phossa2/libs
src/Phossa2/Di/Traits/InstanceFactoryTrait.php
InstanceFactoryTrait.realScopeInfo
protected function realScopeInfo(/*# string */ $id)/*# : array */ { list($rawId, $scope) = $this->scopedInfo($id); // special treatment if $scope is a '#service_id' if (isset($this->loop[$scope])) { $scope .= '_' . $this->loop[$scope]; } return [$rawId, $this->s...
php
protected function realScopeInfo(/*# string */ $id)/*# : array */ { list($rawId, $scope) = $this->scopedInfo($id); // special treatment if $scope is a '#service_id' if (isset($this->loop[$scope])) { $scope .= '_' . $this->loop[$scope]; } return [$rawId, $this->s...
[ "protected", "function", "realScopeInfo", "(", "/*# string */", "$", "id", ")", "/*# : array */", "{", "list", "(", "$", "rawId", ",", "$", "scope", ")", "=", "$", "this", "->", "scopedInfo", "(", "$", "id", ")", ";", "// special treatment if $scope is a '#ser...
Full scope info with consideration of ancestor instances @param string $id @return array @access protected
[ "Full", "scope", "info", "with", "consideration", "of", "ancestor", "instances" ]
921e485c8cc29067f279da2cdd06f47a9bddd115
https://github.com/phossa2/libs/blob/921e485c8cc29067f279da2cdd06f47a9bddd115/src/Phossa2/Di/Traits/InstanceFactoryTrait.php#L96-L106
237,128
phossa2/libs
src/Phossa2/Di/Traits/InstanceFactoryTrait.php
InstanceFactoryTrait.createInstance
protected function createInstance(/*# string */ $rawId, array $args) { // conver 'service_id' to '#service_id' $serviceId = ObjectResolver::getServiceId($rawId); if (isset($this->loop[$serviceId])) { throw new LogicException( Message::get(Message::DI_LOOP_DETECTE...
php
protected function createInstance(/*# string */ $rawId, array $args) { // conver 'service_id' to '#service_id' $serviceId = ObjectResolver::getServiceId($rawId); if (isset($this->loop[$serviceId])) { throw new LogicException( Message::get(Message::DI_LOOP_DETECTE...
[ "protected", "function", "createInstance", "(", "/*# string */", "$", "rawId", ",", "array", "$", "args", ")", "{", "// conver 'service_id' to '#service_id'", "$", "serviceId", "=", "ObjectResolver", "::", "getServiceId", "(", "$", "rawId", ")", ";", "if", "(", ...
Create the instance with loop detection Loop: an instance depends on itself in the creation chain. @param string $rawId @param array $args arguments for the constructor if any @return object @throws LogicException if instantiation goes wrong or loop detected @access protected
[ "Create", "the", "instance", "with", "loop", "detection" ]
921e485c8cc29067f279da2cdd06f47a9bddd115
https://github.com/phossa2/libs/blob/921e485c8cc29067f279da2cdd06f47a9bddd115/src/Phossa2/Di/Traits/InstanceFactoryTrait.php#L119-L135
237,129
phossa2/libs
src/Phossa2/Di/Traits/InstanceFactoryTrait.php
InstanceFactoryTrait.initContainer
protected function initContainer() { $initNode = $this->getResolver()->getSectionId('', 'init'); if ($this->getResolver()->has($initNode)) { $this->getFactory()->executeMethodBatch( $this->getResolver()->get($initNode) ); } return $this; }
php
protected function initContainer() { $initNode = $this->getResolver()->getSectionId('', 'init'); if ($this->getResolver()->has($initNode)) { $this->getFactory()->executeMethodBatch( $this->getResolver()->get($initNode) ); } return $this; }
[ "protected", "function", "initContainer", "(", ")", "{", "$", "initNode", "=", "$", "this", "->", "getResolver", "(", ")", "->", "getSectionId", "(", "''", ",", "'init'", ")", ";", "if", "(", "$", "this", "->", "getResolver", "(", ")", "->", "has", "...
execute init methods defined in 'di.init' node @return $this @throws RuntimeException if anything goes wrong @access protected
[ "execute", "init", "methods", "defined", "in", "di", ".", "init", "node" ]
921e485c8cc29067f279da2cdd06f47a9bddd115
https://github.com/phossa2/libs/blob/921e485c8cc29067f279da2cdd06f47a9bddd115/src/Phossa2/Di/Traits/InstanceFactoryTrait.php#L144-L154
237,130
easy-system/es-http
src/Response/SapiEmitter.php
SapiEmitter.emit
public function emit(ResponseInterface $response) { $filename = $linenum = null; if (headers_sent($filename, $linenum)) { throw new RuntimeException(sprintf( 'Unable to emit response; headers already sent in "%s" ' . 'on line "%s".', $filen...
php
public function emit(ResponseInterface $response) { $filename = $linenum = null; if (headers_sent($filename, $linenum)) { throw new RuntimeException(sprintf( 'Unable to emit response; headers already sent in "%s" ' . 'on line "%s".', $filen...
[ "public", "function", "emit", "(", "ResponseInterface", "$", "response", ")", "{", "$", "filename", "=", "$", "linenum", "=", "null", ";", "if", "(", "headers_sent", "(", "$", "filename", ",", "$", "linenum", ")", ")", "{", "throw", "new", "RuntimeExcept...
Emits the response. @param \Psr\Http\Message\ResponseInterface $response The response @throws \RuntimeException If headers is already sent
[ "Emits", "the", "response", "." ]
dd5852e94901e147a7546a8715133408ece767a1
https://github.com/easy-system/es-http/blob/dd5852e94901e147a7546a8715133408ece767a1/src/Response/SapiEmitter.php#L27-L42
237,131
easy-system/es-http
src/Response/SapiEmitter.php
SapiEmitter.emitStatusLine
protected function emitStatusLine(ResponseInterface $response) { $reasonPhrase = $response->getReasonPhrase(); header(sprintf( 'HTTP/%s %d%s', $response->getProtocolVersion(), $response->getStatusCode(), ($reasonPhrase ? ' ' . $reasonPhrase : '') ...
php
protected function emitStatusLine(ResponseInterface $response) { $reasonPhrase = $response->getReasonPhrase(); header(sprintf( 'HTTP/%s %d%s', $response->getProtocolVersion(), $response->getStatusCode(), ($reasonPhrase ? ' ' . $reasonPhrase : '') ...
[ "protected", "function", "emitStatusLine", "(", "ResponseInterface", "$", "response", ")", "{", "$", "reasonPhrase", "=", "$", "response", "->", "getReasonPhrase", "(", ")", ";", "header", "(", "sprintf", "(", "'HTTP/%s %d%s'", ",", "$", "response", "->", "get...
Emits the status line. @param \Psr\Http\Message\ResponseInterface $response The response @return self
[ "Emits", "the", "status", "line", "." ]
dd5852e94901e147a7546a8715133408ece767a1
https://github.com/easy-system/es-http/blob/dd5852e94901e147a7546a8715133408ece767a1/src/Response/SapiEmitter.php#L51-L62
237,132
easy-system/es-http
src/Response/SapiEmitter.php
SapiEmitter.emitHeaders
protected function emitHeaders(ResponseInterface $response) { $normalize = function ($headerName) { $name = str_replace('-', ' ', $headerName); $filtered = str_replace(' ', '-', ucwords($name)); return $filtered; }; foreach ($response->getHeaders() as...
php
protected function emitHeaders(ResponseInterface $response) { $normalize = function ($headerName) { $name = str_replace('-', ' ', $headerName); $filtered = str_replace(' ', '-', ucwords($name)); return $filtered; }; foreach ($response->getHeaders() as...
[ "protected", "function", "emitHeaders", "(", "ResponseInterface", "$", "response", ")", "{", "$", "normalize", "=", "function", "(", "$", "headerName", ")", "{", "$", "name", "=", "str_replace", "(", "'-'", ",", "' '", ",", "$", "headerName", ")", ";", "...
Emits headers. @param \Psr\Http\Message\ResponseInterface $response The response @return self
[ "Emits", "headers", "." ]
dd5852e94901e147a7546a8715133408ece767a1
https://github.com/easy-system/es-http/blob/dd5852e94901e147a7546a8715133408ece767a1/src/Response/SapiEmitter.php#L71-L93
237,133
easy-system/es-http
src/Response/SapiEmitter.php
SapiEmitter.emitBody
protected function emitBody(ResponseInterface $response) { while (ob_get_level()) { ob_end_flush(); } $body = $response->getBody(); if ($body->getSize()) { echo $body; } return $this; }
php
protected function emitBody(ResponseInterface $response) { while (ob_get_level()) { ob_end_flush(); } $body = $response->getBody(); if ($body->getSize()) { echo $body; } return $this; }
[ "protected", "function", "emitBody", "(", "ResponseInterface", "$", "response", ")", "{", "while", "(", "ob_get_level", "(", ")", ")", "{", "ob_end_flush", "(", ")", ";", "}", "$", "body", "=", "$", "response", "->", "getBody", "(", ")", ";", "if", "("...
Emits body. @param \Psr\Http\Message\ResponseInterface $response The response @return self
[ "Emits", "body", "." ]
dd5852e94901e147a7546a8715133408ece767a1
https://github.com/easy-system/es-http/blob/dd5852e94901e147a7546a8715133408ece767a1/src/Response/SapiEmitter.php#L102-L114
237,134
reflex-php/lockdown
src/Reflex/Lockdown/Roles/Eloquent/Provider.php
Provider.findWithPermission
public function findWithPermission($permission) { return array_filter( $this->findAll(), function ($role) use ($permission) { return $role->has($permission); } ); }
php
public function findWithPermission($permission) { return array_filter( $this->findAll(), function ($role) use ($permission) { return $role->has($permission); } ); }
[ "public", "function", "findWithPermission", "(", "$", "permission", ")", "{", "return", "array_filter", "(", "$", "this", "->", "findAll", "(", ")", ",", "function", "(", "$", "role", ")", "use", "(", "$", "permission", ")", "{", "return", "$", "role", ...
Find roles with permission @param \Reflex\Lockdown\Permissions\PermissionInterface $permission Permission instance @return mixed
[ "Find", "roles", "with", "permission" ]
2798e448608eef469f2924d75013deccfd6aca44
https://github.com/reflex-php/lockdown/blob/2798e448608eef469f2924d75013deccfd6aca44/src/Reflex/Lockdown/Roles/Eloquent/Provider.php#L128-L136
237,135
reflex-php/lockdown
src/Reflex/Lockdown/Roles/Eloquent/Provider.php
Provider.findWithoutPermission
public function findWithoutPermission($permission) { return array_filter( $this->findAll(), function ($role) use ($permission) { return $role->hasnt($permission); } ); }
php
public function findWithoutPermission($permission) { return array_filter( $this->findAll(), function ($role) use ($permission) { return $role->hasnt($permission); } ); }
[ "public", "function", "findWithoutPermission", "(", "$", "permission", ")", "{", "return", "array_filter", "(", "$", "this", "->", "findAll", "(", ")", ",", "function", "(", "$", "role", ")", "use", "(", "$", "permission", ")", "{", "return", "$", "role"...
Find roles without permission @param \Reflex\Lockdown\Permissions\PermissionInterface $permission Permission instance @return mixed
[ "Find", "roles", "without", "permission" ]
2798e448608eef469f2924d75013deccfd6aca44
https://github.com/reflex-php/lockdown/blob/2798e448608eef469f2924d75013deccfd6aca44/src/Reflex/Lockdown/Roles/Eloquent/Provider.php#L144-L152
237,136
monomelodies/ornament
src/Adapter/Pdo.php
Pdo.load
public function load(Container $object) { $pks = []; $values = $this->parameters; $identifier = $this->identifier; foreach ($this->primaryKey as $key) { if (isset($object->$key)) { $pks[$key] = sprintf('%s.%s = ?', $identifier, $key); $valu...
php
public function load(Container $object) { $pks = []; $values = $this->parameters; $identifier = $this->identifier; foreach ($this->primaryKey as $key) { if (isset($object->$key)) { $pks[$key] = sprintf('%s.%s = ?', $identifier, $key); $valu...
[ "public", "function", "load", "(", "Container", "$", "object", ")", "{", "$", "pks", "=", "[", "]", ";", "$", "values", "=", "$", "this", "->", "parameters", ";", "$", "identifier", "=", "$", "this", "->", "identifier", ";", "foreach", "(", "$", "t...
Load data into a single model. @param Container $object A container object. @return void @throws Ornament\Exception\PrimaryKey if no primary key was set or could be determined, and loading would inevitably fail.
[ "Load", "data", "into", "a", "single", "model", "." ]
d7d070ad11f5731be141cf55c2756accaaf51402
https://github.com/monomelodies/ornament/blob/d7d070ad11f5731be141cf55c2756accaaf51402/src/Adapter/Pdo.php#L107-L136
237,137
monomelodies/ornament
src/Adapter/Pdo.php
Pdo.generateJoin
protected function generateJoin(array &$fields) { $annotations = $this->annotations['class']; $props = $this->annotations['properties']; $table = ''; foreach (['Require' => '', 'Include' => 'LEFT '] as $type => $join) { if (isset($annotations[$type])) { fo...
php
protected function generateJoin(array &$fields) { $annotations = $this->annotations['class']; $props = $this->annotations['properties']; $table = ''; foreach (['Require' => '', 'Include' => 'LEFT '] as $type => $join) { if (isset($annotations[$type])) { fo...
[ "protected", "function", "generateJoin", "(", "array", "&", "$", "fields", ")", "{", "$", "annotations", "=", "$", "this", "->", "annotations", "[", "'class'", "]", ";", "$", "props", "=", "$", "this", "->", "annotations", "[", "'properties'", "]", ";", ...
Internal helper to generate a JOIN statement. @param array $fields Array of fields to extend. @return string The JOIN statement to append to the query string.
[ "Internal", "helper", "to", "generate", "a", "JOIN", "statement", "." ]
d7d070ad11f5731be141cf55c2756accaaf51402
https://github.com/monomelodies/ornament/blob/d7d070ad11f5731be141cf55c2756accaaf51402/src/Adapter/Pdo.php#L144-L198
237,138
monomelodies/ornament
src/Adapter/Pdo.php
Pdo.getStatement
protected function getStatement($sql) { if (!isset($this->statements[$sql])) { $this->statements[$sql] = $this->adapter->prepare($sql); } return $this->statements[$sql]; }
php
protected function getStatement($sql) { if (!isset($this->statements[$sql])) { $this->statements[$sql] = $this->adapter->prepare($sql); } return $this->statements[$sql]; }
[ "protected", "function", "getStatement", "(", "$", "sql", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "statements", "[", "$", "sql", "]", ")", ")", "{", "$", "this", "->", "statements", "[", "$", "sql", "]", "=", "$", "this", "->",...
Protected helper to either get or create a PDOStatement. @param string $sql SQL to prepare the statement with. @return PDOStatement A PDOStatement.
[ "Protected", "helper", "to", "either", "get", "or", "create", "a", "PDOStatement", "." ]
d7d070ad11f5731be141cf55c2756accaaf51402
https://github.com/monomelodies/ornament/blob/d7d070ad11f5731be141cf55c2756accaaf51402/src/Adapter/Pdo.php#L206-L212
237,139
thunderwolf/twAdminPlugin
lib/twAdmin.class.php
twAdmin.routeExists
public static function routeExists($route, sfContext $context) { try { if ($route{0} == '@') { $context->getRouting()->generate(substr($route, 1)); } return true; } catch (Exception $e) { return false; } }
php
public static function routeExists($route, sfContext $context) { try { if ($route{0} == '@') { $context->getRouting()->generate(substr($route, 1)); } return true; } catch (Exception $e) { return false; } }
[ "public", "static", "function", "routeExists", "(", "$", "route", ",", "sfContext", "$", "context", ")", "{", "try", "{", "if", "(", "$", "route", "{", "0", "}", "==", "'@'", ")", "{", "$", "context", "->", "getRouting", "(", ")", "->", "generate", ...
Check if the supplied route exists @param string $route @param sfContext $context @return boolean
[ "Check", "if", "the", "supplied", "route", "exists" ]
85a4af0f49a535b6c8327567524f770f805d6454
https://github.com/thunderwolf/twAdminPlugin/blob/85a4af0f49a535b6c8327567524f770f805d6454/lib/twAdmin.class.php#L44-L54
237,140
agalbourdin/agl-core
src/Mysql/Query/Raw.php
Raw.query
public function query($pQuery, array $pParams = array()) { $this->_stm = Agl::app()->getDb()->getConnection()->prepare($pQuery); if (! $this->_stm->execute($pParams)) { $error = $this->_stm->errorInfo(); throw new Exception("The query failed with message '" . $error[2] . "'"...
php
public function query($pQuery, array $pParams = array()) { $this->_stm = Agl::app()->getDb()->getConnection()->prepare($pQuery); if (! $this->_stm->execute($pParams)) { $error = $this->_stm->errorInfo(); throw new Exception("The query failed with message '" . $error[2] . "'"...
[ "public", "function", "query", "(", "$", "pQuery", ",", "array", "$", "pParams", "=", "array", "(", ")", ")", "{", "$", "this", "->", "_stm", "=", "Agl", "::", "app", "(", ")", "->", "getDb", "(", ")", "->", "getConnection", "(", ")", "->", "prep...
Commit the query to the database and return the result. @return Select
[ "Commit", "the", "query", "to", "the", "database", "and", "return", "the", "result", "." ]
1db556f9a49488aa9fab6887fefb7141a79ad97d
https://github.com/agalbourdin/agl-core/blob/1db556f9a49488aa9fab6887fefb7141a79ad97d/src/Mysql/Query/Raw.php#L34-L48
237,141
halimonalexander/sid
src/Sid.php
Sid.extractConstants
private static function extractConstants() { $oClass = new \ReflectionClass(get_called_class()); $constants = $oClass->getConstants(); unset( $constants['IS_IMPLICIT_ABSTRACT'], $constants['IS_EXPLICIT_ABSTRACT'], $constants['IS_FINAL'] ); ...
php
private static function extractConstants() { $oClass = new \ReflectionClass(get_called_class()); $constants = $oClass->getConstants(); unset( $constants['IS_IMPLICIT_ABSTRACT'], $constants['IS_EXPLICIT_ABSTRACT'], $constants['IS_FINAL'] ); ...
[ "private", "static", "function", "extractConstants", "(", ")", "{", "$", "oClass", "=", "new", "\\", "ReflectionClass", "(", "get_called_class", "(", ")", ")", ";", "$", "constants", "=", "$", "oClass", "->", "getConstants", "(", ")", ";", "unset", "(", ...
Extract constants using ReflectionClass
[ "Extract", "constants", "using", "ReflectionClass" ]
7bfa551af1b941c95e9be81812e5edecd9d9bd16
https://github.com/halimonalexander/sid/blob/7bfa551af1b941c95e9be81812e5edecd9d9bd16/src/Sid.php#L56-L67
237,142
halimonalexander/sid
src/Sid.php
Sid.updateHiddenValue
protected static function updateHiddenValue($list, $name) { $sid = $list[$name]; unset($list[$name]); preg_match("/" . self::$hiddenSidNamePattern . "/", $name, $match); $list[$match[1]] = $sid; return $list; }
php
protected static function updateHiddenValue($list, $name) { $sid = $list[$name]; unset($list[$name]); preg_match("/" . self::$hiddenSidNamePattern . "/", $name, $match); $list[$match[1]] = $sid; return $list; }
[ "protected", "static", "function", "updateHiddenValue", "(", "$", "list", ",", "$", "name", ")", "{", "$", "sid", "=", "$", "list", "[", "$", "name", "]", ";", "unset", "(", "$", "list", "[", "$", "name", "]", ")", ";", "preg_match", "(", "\"/\"", ...
Update hidden value's name by removing leading _ @param $list @param $name @return mixed
[ "Update", "hidden", "value", "s", "name", "by", "removing", "leading", "_" ]
7bfa551af1b941c95e9be81812e5edecd9d9bd16
https://github.com/halimonalexander/sid/blob/7bfa551af1b941c95e9be81812e5edecd9d9bd16/src/Sid.php#L134-L143
237,143
halimonalexander/sid
src/Sid.php
Sid.getList
public static function getList(bool $full = false) { $class = get_called_class(); if (empty(self::$list[$class])) { self::$list[$class] = self::loadList(); } $list = self::$list[$class]; foreach ($list as $name => $sid) { if (static::...
php
public static function getList(bool $full = false) { $class = get_called_class(); if (empty(self::$list[$class])) { self::$list[$class] = self::loadList(); } $list = self::$list[$class]; foreach ($list as $name => $sid) { if (static::...
[ "public", "static", "function", "getList", "(", "bool", "$", "full", "=", "false", ")", "{", "$", "class", "=", "get_called_class", "(", ")", ";", "if", "(", "empty", "(", "self", "::", "$", "list", "[", "$", "class", "]", ")", ")", "{", "self", ...
Get full sid list @param bool $full @return array List of values as: Name => Sid
[ "Get", "full", "sid", "list" ]
7bfa551af1b941c95e9be81812e5edecd9d9bd16
https://github.com/halimonalexander/sid/blob/7bfa551af1b941c95e9be81812e5edecd9d9bd16/src/Sid.php#L199-L218
237,144
halimonalexander/sid
src/Sid.php
Sid.getNameById
public static function getNameById($sid) { $list = self::getList(true); $key = array_search($sid, $list); if ($key === false) throw new SidItemNotFound('Sid not exists'); return $key; }
php
public static function getNameById($sid) { $list = self::getList(true); $key = array_search($sid, $list); if ($key === false) throw new SidItemNotFound('Sid not exists'); return $key; }
[ "public", "static", "function", "getNameById", "(", "$", "sid", ")", "{", "$", "list", "=", "self", "::", "getList", "(", "true", ")", ";", "$", "key", "=", "array_search", "(", "$", "sid", ",", "$", "list", ")", ";", "if", "(", "$", "key", "==="...
Return constant name from SID. @param int $id SID to find @return string Name of constant. @throws SidItemNotFound
[ "Return", "constant", "name", "from", "SID", "." ]
7bfa551af1b941c95e9be81812e5edecd9d9bd16
https://github.com/halimonalexander/sid/blob/7bfa551af1b941c95e9be81812e5edecd9d9bd16/src/Sid.php#L239-L247
237,145
halimonalexander/sid
src/Sid.php
Sid.getTitle
public static function getTitle($id, $lang, $context = 'default') { $name = self::getNameById($id); $class = self::getClassWithoutNamespace(); return call_user_func(self::getCallback($lang), $name, $class, $context); }
php
public static function getTitle($id, $lang, $context = 'default') { $name = self::getNameById($id); $class = self::getClassWithoutNamespace(); return call_user_func(self::getCallback($lang), $name, $class, $context); }
[ "public", "static", "function", "getTitle", "(", "$", "id", ",", "$", "lang", ",", "$", "context", "=", "'default'", ")", "{", "$", "name", "=", "self", "::", "getNameById", "(", "$", "id", ")", ";", "$", "class", "=", "self", "::", "getClassWithoutN...
Get Sid title from vocabulary @param int $id @param string $lang @param string $context @return mixed
[ "Get", "Sid", "title", "from", "vocabulary" ]
7bfa551af1b941c95e9be81812e5edecd9d9bd16
https://github.com/halimonalexander/sid/blob/7bfa551af1b941c95e9be81812e5edecd9d9bd16/src/Sid.php#L258-L264
237,146
setrun/setrun-component-sys
src/behaviors/TimeAgoBehavior.php
TimeAgoBehavior.getTimeAgo
public function getTimeAgo($field = null, $options = []){ $attribute = $this->attribute; if ($field !== null) { $attribute = $field; } $year = $options['year'] ?? 'full:{day} {month} {year}'; $month = $options['month'] ?? 'full:{day} {month}'; if ($this->o...
php
public function getTimeAgo($field = null, $options = []){ $attribute = $this->attribute; if ($field !== null) { $attribute = $field; } $year = $options['year'] ?? 'full:{day} {month} {year}'; $month = $options['month'] ?? 'full:{day} {month}'; if ($this->o...
[ "public", "function", "getTimeAgo", "(", "$", "field", "=", "null", ",", "$", "options", "=", "[", "]", ")", "{", "$", "attribute", "=", "$", "this", "->", "attribute", ";", "if", "(", "$", "field", "!==", "null", ")", "{", "$", "attribute", "=", ...
Get a date in the time ago format @return string @throws \Exception
[ "Get", "a", "date", "in", "the", "time", "ago", "format" ]
ad9a6442a2921e0f061ed4e455b050c56029d565
https://github.com/setrun/setrun-component-sys/blob/ad9a6442a2921e0f061ed4e455b050c56029d565/src/behaviors/TimeAgoBehavior.php#L31-L59
237,147
PsyduckMans/PHPX-Propel
src/PHPX/Propel/Util/Ext/Direct/Criteria.php
Criteria.bindSort
public static function bindSort(\Criteria $criteria, $sort) { $direction = $sort['direction']; switch($direction) { case self::SORT_DIRECTION_DESC: $criteria->addDescendingOrderByColumn($sort['column']); break; case self::SORT_DIRECTION_ASC: ...
php
public static function bindSort(\Criteria $criteria, $sort) { $direction = $sort['direction']; switch($direction) { case self::SORT_DIRECTION_DESC: $criteria->addDescendingOrderByColumn($sort['column']); break; case self::SORT_DIRECTION_ASC: ...
[ "public", "static", "function", "bindSort", "(", "\\", "Criteria", "$", "criteria", ",", "$", "sort", ")", "{", "$", "direction", "=", "$", "sort", "[", "'direction'", "]", ";", "switch", "(", "$", "direction", ")", "{", "case", "self", "::", "SORT_DIR...
bind Ext direct sort to Propel Criteria @param \Criteria $criteria @param $sort array( 'direction' => 'DESC', 'column' => UserPeer::ID ) @throws RuntimeException @return void
[ "bind", "Ext", "direct", "sort", "to", "Propel", "Criteria" ]
5d251d577d47352c568cf04576b94104754dd7da
https://github.com/PsyduckMans/PHPX-Propel/blob/5d251d577d47352c568cf04576b94104754dd7da/src/PHPX/Propel/Util/Ext/Direct/Criteria.php#L38-L50
237,148
zoopcommerce/shard
lib/Zoop/Shard/AccessControl/AccessController.php
AccessController.areAllowed
public function areAllowed(array $actions, ClassMetadata $metadata, $document = null, ChangeSet $changeSet = null) { if (!$metadata->hasProperty('permissions')) { return new AllowedResult(false); } //first check the generic 'guest' role $result = $this->checkRolesAgainst...
php
public function areAllowed(array $actions, ClassMetadata $metadata, $document = null, ChangeSet $changeSet = null) { if (!$metadata->hasProperty('permissions')) { return new AllowedResult(false); } //first check the generic 'guest' role $result = $this->checkRolesAgainst...
[ "public", "function", "areAllowed", "(", "array", "$", "actions", ",", "ClassMetadata", "$", "metadata", ",", "$", "document", "=", "null", ",", "ChangeSet", "$", "changeSet", "=", "null", ")", "{", "if", "(", "!", "$", "metadata", "->", "hasProperty", "...
Determines if an action can be done by the current User @param array $action @param \Doctrine\Common\Persistence\Mapping\ClassMetadata $metadata @param type $document @return \Zoop\Shard\AccessControl\IsAllowedResult
[ "Determines", "if", "an", "action", "can", "be", "done", "by", "the", "current", "User" ]
14dde6ff25bc3125ad35667c8ff65cb755750b27
https://github.com/zoopcommerce/shard/blob/14dde6ff25bc3125ad35667c8ff65cb755750b27/lib/Zoop/Shard/AccessControl/AccessController.php#L37-L57
237,149
webignition/html-document-link-url-finder
src/HtmlDocumentLinkUrlFinder.php
HtmlDocumentLinkUrlFinder.looksLikeConcatenatedJsString
private function looksLikeConcatenatedJsString(string $url): bool { $patternBody = "^'\s+\+\s+.*\s+\+\s+'$"; $pattern = '/'.$patternBody.'/i'; return preg_match($pattern, $url) > 0; }
php
private function looksLikeConcatenatedJsString(string $url): bool { $patternBody = "^'\s+\+\s+.*\s+\+\s+'$"; $pattern = '/'.$patternBody.'/i'; return preg_match($pattern, $url) > 0; }
[ "private", "function", "looksLikeConcatenatedJsString", "(", "string", "$", "url", ")", ":", "bool", "{", "$", "patternBody", "=", "\"^'\\s+\\+\\s+.*\\s+\\+\\s+'$\"", ";", "$", "pattern", "=", "'/'", ".", "$", "patternBody", ".", "'/i'", ";", "return", "preg_mat...
Determine if the URL value from an element attribute looks like a concatenated JS string Some documents contain script elements which concatenate JS values together to make URLs for elements that are inserted into the DOM. This is all fine. e.g. VimeoList.push('<img src="' + value['ListImage'] + '" />'); A subset of ...
[ "Determine", "if", "the", "URL", "value", "from", "an", "element", "attribute", "looks", "like", "a", "concatenated", "JS", "string" ]
247820dd8c7d68ddd7f61c21dfc51fa7ed46bfbf
https://github.com/webignition/html-document-link-url-finder/blob/247820dd8c7d68ddd7f61c21dfc51fa7ed46bfbf/src/HtmlDocumentLinkUrlFinder.php#L130-L136
237,150
diatem-net/jin-dataformat
src/DataFormat/Csv.php
Csv.fputcsv
protected function fputcsv($filePointer, $dataArray, $delimiter = ",", $enclosure = "\"") { // Build the string $string = ""; // No leading delimiter $writeDelimiter = false; foreach ($dataArray as $dataElement) { // Replaces a double quote with two double quotes $dataElement...
php
protected function fputcsv($filePointer, $dataArray, $delimiter = ",", $enclosure = "\"") { // Build the string $string = ""; // No leading delimiter $writeDelimiter = false; foreach ($dataArray as $dataElement) { // Replaces a double quote with two double quotes $dataElement...
[ "protected", "function", "fputcsv", "(", "$", "filePointer", ",", "$", "dataArray", ",", "$", "delimiter", "=", "\",\"", ",", "$", "enclosure", "=", "\"\\\"\"", ")", "{", "// Build the string\r", "$", "string", "=", "\"\"", ";", "// No leading delimiter\r", "$...
Write a line to a file @param string $filePointer File resource to write in @param array $dataArray Data to write out @param string $delimiter Field separator @param string $enclosure Enclosure
[ "Write", "a", "line", "to", "a", "file" ]
3d8b0aeb8dcf0b81dc319faf79006ddea9cfa6dd
https://github.com/diatem-net/jin-dataformat/blob/3d8b0aeb8dcf0b81dc319faf79006ddea9cfa6dd/src/DataFormat/Csv.php#L177-L203
237,151
diatem-net/jin-dataformat
src/DataFormat/Csv.php
Csv.writeDataInIO
protected function writeDataInIO($fp) { // Écriture des données if ($this->useAssociativeArray) { foreach ($this->data as $donnee) { foreach ($donnee as &$champ) { $champ = (is_string($champ)) ? iconv("UTF-8", "Windows-1252//TRANSLIT", $champ) : $champ; } $this-...
php
protected function writeDataInIO($fp) { // Écriture des données if ($this->useAssociativeArray) { foreach ($this->data as $donnee) { foreach ($donnee as &$champ) { $champ = (is_string($champ)) ? iconv("UTF-8", "Windows-1252//TRANSLIT", $champ) : $champ; } $this-...
[ "protected", "function", "writeDataInIO", "(", "$", "fp", ")", "{", "// Écriture des données\r", "if", "(", "$", "this", "->", "useAssociativeArray", ")", "{", "foreach", "(", "$", "this", "->", "data", "as", "$", "donnee", ")", "{", "foreach", "(", "$", ...
Ecrit dans le flux de sortie @param ressource $fp
[ "Ecrit", "dans", "le", "flux", "de", "sortie" ]
3d8b0aeb8dcf0b81dc319faf79006ddea9cfa6dd
https://github.com/diatem-net/jin-dataformat/blob/3d8b0aeb8dcf0b81dc319faf79006ddea9cfa6dd/src/DataFormat/Csv.php#L210-L227
237,152
seeren/application
src/Application.php
Application.sendErrorDocument
private function sendErrorDocument( ResponseInterface $response): ResponseInterface { if ($this->errorDocument && preg_match( "/^(4|5){1}[0-2]{1}[0-9]{1}$/", $response->getStatusCode()) ) { $this->errorDocument = str_replace( "{status}", $r...
php
private function sendErrorDocument( ResponseInterface $response): ResponseInterface { if ($this->errorDocument && preg_match( "/^(4|5){1}[0-2]{1}[0-9]{1}$/", $response->getStatusCode()) ) { $this->errorDocument = str_replace( "{status}", $r...
[ "private", "function", "sendErrorDocument", "(", "ResponseInterface", "$", "response", ")", ":", "ResponseInterface", "{", "if", "(", "$", "this", "->", "errorDocument", "&&", "preg_match", "(", "\"/^(4|5){1}[0-2]{1}[0-9]{1}$/\"", ",", "$", "response", "->", "getSta...
Send error document @param ResponseInterface $response psr-7 response @return ResponseInterface psr-7 response
[ "Send", "error", "document" ]
bd36ec219fa24f33cd8686f3aaae70deb9cf61ea
https://github.com/seeren/application/blob/bd36ec219fa24f33cd8686f3aaae70deb9cf61ea/src/Application.php#L54-L71
237,153
vakata/router
src/Router.php
Router.setPrefix
public function setPrefix(string $prefix) : RouterInterface { $prefix = trim($prefix, '/'); $this->prefix = $prefix.(strlen($prefix) ? '/' : ''); return $this; }
php
public function setPrefix(string $prefix) : RouterInterface { $prefix = trim($prefix, '/'); $this->prefix = $prefix.(strlen($prefix) ? '/' : ''); return $this; }
[ "public", "function", "setPrefix", "(", "string", "$", "prefix", ")", ":", "RouterInterface", "{", "$", "prefix", "=", "trim", "(", "$", "prefix", ",", "'/'", ")", ";", "$", "this", "->", "prefix", "=", "$", "prefix", ".", "(", "strlen", "(", "$", ...
Set the prefix for all future URLs, used mainly internally. @param string $prefix the prefix to prepend @return self
[ "Set", "the", "prefix", "for", "all", "future", "URLs", "used", "mainly", "internally", "." ]
de392bdc8ed1353a59529c3bcf78574e1ad72545
https://github.com/vakata/router/blob/de392bdc8ed1353a59529c3bcf78574e1ad72545/src/Router.php#L130-L134
237,154
vakata/router
src/Router.php
Router.add
public function add($method, $url = null, $handler = null) : RouterInterface { $temp = [ 'method' => [ 'GET', 'POST' ], 'url' => '', 'handler' => null ]; foreach (func_get_args() as $arg) { if (is_callable($arg)) { $temp['handler'] = $arg; } else if (in_array(...
php
public function add($method, $url = null, $handler = null) : RouterInterface { $temp = [ 'method' => [ 'GET', 'POST' ], 'url' => '', 'handler' => null ]; foreach (func_get_args() as $arg) { if (is_callable($arg)) { $temp['handler'] = $arg; } else if (in_array(...
[ "public", "function", "add", "(", "$", "method", ",", "$", "url", "=", "null", ",", "$", "handler", "=", "null", ")", ":", "RouterInterface", "{", "$", "temp", "=", "[", "'method'", "=>", "[", "'GET'", ",", "'POST'", "]", ",", "'url'", "=>", "''", ...
Add a route. All params are optional and each of them can be omitted independently. @param array|string $method HTTP verbs for which this route is valid @param string $url the route URL (check the usage docs for information on supported formats) @param callable $handler the handler to execute when the...
[ "Add", "a", "route", ".", "All", "params", "are", "optional", "and", "each", "of", "them", "can", "be", "omitted", "independently", "." ]
de392bdc8ed1353a59529c3bcf78574e1ad72545
https://github.com/vakata/router/blob/de392bdc8ed1353a59529c3bcf78574e1ad72545/src/Router.php#L155-L196
237,155
WaddlingCo/streamperk-bundle
ServerBundle/Entity/Server.php
Server.userHasAccess
public function userHasAccess(User $user) { if ($this->getWhitelisted() === false) { return true; } $criteria = Criteria::create() ->where(Criteria::expr()->eq('user', $user)) ->setMaxResults(1); $serverUsers = $this->users->matching($cri...
php
public function userHasAccess(User $user) { if ($this->getWhitelisted() === false) { return true; } $criteria = Criteria::create() ->where(Criteria::expr()->eq('user', $user)) ->setMaxResults(1); $serverUsers = $this->users->matching($cri...
[ "public", "function", "userHasAccess", "(", "User", "$", "user", ")", "{", "if", "(", "$", "this", "->", "getWhitelisted", "(", ")", "===", "false", ")", "{", "return", "true", ";", "}", "$", "criteria", "=", "Criteria", "::", "create", "(", ")", "->...
Get whether the user has access @return boolean
[ "Get", "whether", "the", "user", "has", "access" ]
bb930778690a9a5e0f0a7308d9449c03239c5e35
https://github.com/WaddlingCo/streamperk-bundle/blob/bb930778690a9a5e0f0a7308d9449c03239c5e35/ServerBundle/Entity/Server.php#L635-L661
237,156
bruery/platform-core
src/bundles/UserBundle/Form/Type/ProfileType.php
ProfileType.buildUserForm
protected function buildUserForm(FormBuilderInterface $builder, array $options) { $now = new \DateTime(); $builder ->add('username', null, array('label' => 'form.label_username', 'translation_domain' => 'SonataUserBundle')) ->add('email', 'email', array('label' => 'form.labe...
php
protected function buildUserForm(FormBuilderInterface $builder, array $options) { $now = new \DateTime(); $builder ->add('username', null, array('label' => 'form.label_username', 'translation_domain' => 'SonataUserBundle')) ->add('email', 'email', array('label' => 'form.labe...
[ "protected", "function", "buildUserForm", "(", "FormBuilderInterface", "$", "builder", ",", "array", "$", "options", ")", "{", "$", "now", "=", "new", "\\", "DateTime", "(", ")", ";", "$", "builder", "->", "add", "(", "'username'", ",", "null", ",", "arr...
Builds the embedded form representing the user. @param FormBuilderInterface $builder @param array $options
[ "Builds", "the", "embedded", "form", "representing", "the", "user", "." ]
46153c181b2d852763afa30f7378bcbc1b2f4ef3
https://github.com/bruery/platform-core/blob/46153c181b2d852763afa30f7378bcbc1b2f4ef3/src/bundles/UserBundle/Form/Type/ProfileType.php#L90-L118
237,157
crysalead/validator
src/Validator.php
Validator.set
public function set($name, $rule = null) { if (!is_array($name)) { $name = [$name => $rule]; } $this->_handlers = $name + $this->_handlers; }
php
public function set($name, $rule = null) { if (!is_array($name)) { $name = [$name => $rule]; } $this->_handlers = $name + $this->_handlers; }
[ "public", "function", "set", "(", "$", "name", ",", "$", "rule", "=", "null", ")", "{", "if", "(", "!", "is_array", "(", "$", "name", ")", ")", "{", "$", "name", "=", "[", "$", "name", "=>", "$", "rule", "]", ";", "}", "$", "this", "->", "_...
Sets one or several validation rules. For example: {{{ $validator = new Validator(); $validator->set('zeroToNine', '/^[0-9]$/'); $isValid = $validator->isZeroToNine('5'); // true $isValid = $validator->isZeroToNine('20'); // false }}} Alternatively, the first parameter may be an array of rules expressed as key/value ...
[ "Sets", "one", "or", "several", "validation", "rules", "." ]
37070c0753351f250096c8495874544fbb6620cb
https://github.com/crysalead/validator/blob/37070c0753351f250096c8495874544fbb6620cb/src/Validator.php#L157-L163
237,158
crysalead/validator
src/Validator.php
Validator.has
public function has($name) { $checker = $this->_classes['checker']; return isset($this->_handlers[$name]) || $checker::has($name); }
php
public function has($name) { $checker = $this->_classes['checker']; return isset($this->_handlers[$name]) || $checker::has($name); }
[ "public", "function", "has", "(", "$", "name", ")", "{", "$", "checker", "=", "$", "this", "->", "_classes", "[", "'checker'", "]", ";", "return", "isset", "(", "$", "this", "->", "_handlers", "[", "$", "name", "]", ")", "||", "$", "checker", "::",...
Checks if a validation handler exists. @param string $name A validation handler name.
[ "Checks", "if", "a", "validation", "handler", "exists", "." ]
37070c0753351f250096c8495874544fbb6620cb
https://github.com/crysalead/validator/blob/37070c0753351f250096c8495874544fbb6620cb/src/Validator.php#L170-L174
237,159
crysalead/validator
src/Validator.php
Validator.get
public function get($name) { if (isset($this->_handlers[$name])) { return $this->_handlers[$name]; } $checker = $this->_classes['checker']; if ($checker::has($name)) { return $checker::get($name); } throw new InvalidArgumentException("Unexisting ...
php
public function get($name) { if (isset($this->_handlers[$name])) { return $this->_handlers[$name]; } $checker = $this->_classes['checker']; if ($checker::has($name)) { return $checker::get($name); } throw new InvalidArgumentException("Unexisting ...
[ "public", "function", "get", "(", "$", "name", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "_handlers", "[", "$", "name", "]", ")", ")", "{", "return", "$", "this", "->", "_handlers", "[", "$", "name", "]", ";", "}", "$", "checker", "...
Returns a validation handler. @param string $name A validation handler name.
[ "Returns", "a", "validation", "handler", "." ]
37070c0753351f250096c8495874544fbb6620cb
https://github.com/crysalead/validator/blob/37070c0753351f250096c8495874544fbb6620cb/src/Validator.php#L181-L191
237,160
crysalead/validator
src/Validator.php
Validator.rule
public function rule($field, $rules = []) { $defaults = [ 'message' => null, 'required' => true, 'skipEmpty' => false, 'format' => 'any', 'not' => false, 'on' => null ]; $rules = $rules ? (array) $rules : []; f...
php
public function rule($field, $rules = []) { $defaults = [ 'message' => null, 'required' => true, 'skipEmpty' => false, 'format' => 'any', 'not' => false, 'on' => null ]; $rules = $rules ? (array) $rules : []; f...
[ "public", "function", "rule", "(", "$", "field", ",", "$", "rules", "=", "[", "]", ")", "{", "$", "defaults", "=", "[", "'message'", "=>", "null", ",", "'required'", "=>", "true", ",", "'skipEmpty'", "=>", "false", ",", "'format'", "=>", "'any'", ","...
Sets a rule. @param mixed $name A fieldname. @param string $handler A validation handler name.
[ "Sets", "a", "rule", "." ]
37070c0753351f250096c8495874544fbb6620cb
https://github.com/crysalead/validator/blob/37070c0753351f250096c8495874544fbb6620cb/src/Validator.php#L220-L244
237,161
crysalead/validator
src/Validator.php
Validator.validates
public function validates($data, $options = []) { $events = (array) (isset($options['events']) ? $options['events'] : null); $this->_errors = []; $error = $this->_error; foreach ($this->_rules as $field => $rules) { $values = static::values($data, explode('.', $field));...
php
public function validates($data, $options = []) { $events = (array) (isset($options['events']) ? $options['events'] : null); $this->_errors = []; $error = $this->_error; foreach ($this->_rules as $field => $rules) { $values = static::values($data, explode('.', $field));...
[ "public", "function", "validates", "(", "$", "data", ",", "$", "options", "=", "[", "]", ")", "{", "$", "events", "=", "(", "array", ")", "(", "isset", "(", "$", "options", "[", "'events'", "]", ")", "?", "$", "options", "[", "'events'", "]", ":"...
Validates a set of values against a specified rules list. This method may be used to validate any arbitrary array of data against a set of validation rules. @param array $data An array of key/value pairs, where the values are to be checked. @param array $rules An array of rules to check the values in `$values` ag...
[ "Validates", "a", "set", "of", "values", "against", "a", "specified", "rules", "list", ".", "This", "method", "may", "be", "used", "to", "validate", "any", "arbitrary", "array", "of", "data", "against", "a", "set", "of", "validation", "rules", "." ]
37070c0753351f250096c8495874544fbb6620cb
https://github.com/crysalead/validator/blob/37070c0753351f250096c8495874544fbb6620cb/src/Validator.php#L298-L333
237,162
crysalead/validator
src/Validator.php
Validator.is
public function is($name, $value, $options = [], &$params = []) { $not = false; if (strncmp($name, 'not:', 4) === 0) { $name = substr($name, 4); $not = true; } $handlers = $this->get($name); $handlers = is_array($handlers) ? $handlers : [$handlers]; ...
php
public function is($name, $value, $options = [], &$params = []) { $not = false; if (strncmp($name, 'not:', 4) === 0) { $name = substr($name, 4); $not = true; } $handlers = $this->get($name); $handlers = is_array($handlers) ? $handlers : [$handlers]; ...
[ "public", "function", "is", "(", "$", "name", ",", "$", "value", ",", "$", "options", "=", "[", "]", ",", "&", "$", "params", "=", "[", "]", ")", "{", "$", "not", "=", "false", ";", "if", "(", "strncmp", "(", "$", "name", ",", "'not:'", ",", ...
Checks a single value against a validation handler. @param string $rule The validation handler name. @param mixed $value The value to check. @param array $options The options array. @return boolean Returns `true` or `false` indicating whether the validation rule check succeeded or failed.
[ "Checks", "a", "single", "value", "against", "a", "validation", "handler", "." ]
37070c0753351f250096c8495874544fbb6620cb
https://github.com/crysalead/validator/blob/37070c0753351f250096c8495874544fbb6620cb/src/Validator.php#L354-L366
237,163
crysalead/validator
src/Validator.php
Validator.values
public static function values($data, $path = [], $base = null) { if (!$path) { $base = $base ?: 0; return [$base => $data]; } $field = array_shift($path); if ($field === '*') { $values = []; foreach ($data as $key => $value) { ...
php
public static function values($data, $path = [], $base = null) { if (!$path) { $base = $base ?: 0; return [$base => $data]; } $field = array_shift($path); if ($field === '*') { $values = []; foreach ($data as $key => $value) { ...
[ "public", "static", "function", "values", "(", "$", "data", ",", "$", "path", "=", "[", "]", ",", "$", "base", "=", "null", ")", "{", "if", "(", "!", "$", "path", ")", "{", "$", "base", "=", "$", "base", "?", ":", "0", ";", "return", "[", "...
Extracts all values corresponding to a field names path. @param array $data The data. @param array $path An array of field names. @param array $base The dotted fielname path of the data. @return array The extracted values.
[ "Extracts", "all", "values", "corresponding", "to", "a", "field", "names", "path", "." ]
37070c0753351f250096c8495874544fbb6620cb
https://github.com/crysalead/validator/blob/37070c0753351f250096c8495874544fbb6620cb/src/Validator.php#L397-L419
237,164
kherge-abandoned/Wisdom
src/lib/KevinGH/Wisdom/Wisdom.php
Wisdom.addLoader
public function addLoader(Loader $loader) { $loader->setLocator($this->locator); $this->resolver->addLoader($loader); }
php
public function addLoader(Loader $loader) { $loader->setLocator($this->locator); $this->resolver->addLoader($loader); }
[ "public", "function", "addLoader", "(", "Loader", "$", "loader", ")", "{", "$", "loader", "->", "setLocator", "(", "$", "this", "->", "locator", ")", ";", "$", "this", "->", "resolver", "->", "addLoader", "(", "$", "loader", ")", ";", "}" ]
Adds the loader. @param Loader $loader The loader.
[ "Adds", "the", "loader", "." ]
eb5b1dadde0729f2ccd1b241c2cecebc778e22f3
https://github.com/kherge-abandoned/Wisdom/blob/eb5b1dadde0729f2ccd1b241c2cecebc778e22f3/src/lib/KevinGH/Wisdom/Wisdom.php#L98-L103
237,165
kherge-abandoned/Wisdom
src/lib/KevinGH/Wisdom/Wisdom.php
Wisdom.get
public function get($file, $values = null, array &$imported = array()) { if ((null !== $values) && (false === is_array($values))) { if (false === ($values instanceof ArrayAccess)) { throw new InvalidArgumentException( 'The value of $values is not an array or a...
php
public function get($file, $values = null, array &$imported = array()) { if ((null !== $values) && (false === is_array($values))) { if (false === ($values instanceof ArrayAccess)) { throw new InvalidArgumentException( 'The value of $values is not an array or a...
[ "public", "function", "get", "(", "$", "file", ",", "$", "values", "=", "null", ",", "array", "&", "$", "imported", "=", "array", "(", ")", ")", "{", "if", "(", "(", "null", "!==", "$", "values", ")", "&&", "(", "false", "===", "is_array", "(", ...
Returns the data for the configuration file. @param string $file The file name. @param array|object $values The new replacement values. @param array &$imported The list of imported resources. @return array The configuration data. @throws InvalidArgumentException If the value is not supported. @t...
[ "Returns", "the", "data", "for", "the", "configuration", "file", "." ]
eb5b1dadde0729f2ccd1b241c2cecebc778e22f3
https://github.com/kherge-abandoned/Wisdom/blob/eb5b1dadde0729f2ccd1b241c2cecebc778e22f3/src/lib/KevinGH/Wisdom/Wisdom.php#L117-L188
237,166
kherge-abandoned/Wisdom
src/lib/KevinGH/Wisdom/Wisdom.php
Wisdom.import
public function import(array $data, $values = null, array &$imported = array()) { if (false === isset($data['imports'])) { return $data; } $imports = $data['imports']; unset($data['imports']); foreach ($imports as $resource) { $data = array_replace_...
php
public function import(array $data, $values = null, array &$imported = array()) { if (false === isset($data['imports'])) { return $data; } $imports = $data['imports']; unset($data['imports']); foreach ($imports as $resource) { $data = array_replace_...
[ "public", "function", "import", "(", "array", "$", "data", ",", "$", "values", "=", "null", ",", "array", "&", "$", "imported", "=", "array", "(", ")", ")", "{", "if", "(", "false", "===", "isset", "(", "$", "data", "[", "'imports'", "]", ")", ")...
Manages the "imports" directive in configuration files. @param array $data The current data. @param array|object $values The new replacement values. @param array &$imported The list of imported resources. @return array The data merged with the imported resources. @throws LogicException If a cir...
[ "Manages", "the", "imports", "directive", "in", "configuration", "files", "." ]
eb5b1dadde0729f2ccd1b241c2cecebc778e22f3
https://github.com/kherge-abandoned/Wisdom/blob/eb5b1dadde0729f2ccd1b241c2cecebc778e22f3/src/lib/KevinGH/Wisdom/Wisdom.php#L201-L219
237,167
kherge-abandoned/Wisdom
src/lib/KevinGH/Wisdom/Wisdom.php
Wisdom.setValues
public function setValues($values) { if ((null !== $values) && (false === is_array($values))) { if (false === ($values instanceof ArrayAccess)) { throw new InvalidArgumentException( 'The value of $values is not an array or an instance of ArrayAccess.' ...
php
public function setValues($values) { if ((null !== $values) && (false === is_array($values))) { if (false === ($values instanceof ArrayAccess)) { throw new InvalidArgumentException( 'The value of $values is not an array or an instance of ArrayAccess.' ...
[ "public", "function", "setValues", "(", "$", "values", ")", "{", "if", "(", "(", "null", "!==", "$", "values", ")", "&&", "(", "false", "===", "is_array", "(", "$", "values", ")", ")", ")", "{", "if", "(", "false", "===", "(", "$", "values", "ins...
Sets the default replacement values. @param array|object The replacement values. @throws InvalidArgumentException If the value is not supported.
[ "Sets", "the", "default", "replacement", "values", "." ]
eb5b1dadde0729f2ccd1b241c2cecebc778e22f3
https://github.com/kherge-abandoned/Wisdom/blob/eb5b1dadde0729f2ccd1b241c2cecebc778e22f3/src/lib/KevinGH/Wisdom/Wisdom.php#L258-L269
237,168
kherge-abandoned/Wisdom
src/lib/KevinGH/Wisdom/Wisdom.php
Wisdom.mergeValues
private function mergeValues($a, $b) { $x = array(); $y = array(); if (is_array($a)) { $x = $a; } foreach ($b as $key => $value) { $x[$key] = $value; } return $x; }
php
private function mergeValues($a, $b) { $x = array(); $y = array(); if (is_array($a)) { $x = $a; } foreach ($b as $key => $value) { $x[$key] = $value; } return $x; }
[ "private", "function", "mergeValues", "(", "$", "a", ",", "$", "b", ")", "{", "$", "x", "=", "array", "(", ")", ";", "$", "y", "=", "array", "(", ")", ";", "if", "(", "is_array", "(", "$", "a", ")", ")", "{", "$", "x", "=", "$", "a", ";",...
Merges two sets of replacement values. @param array|object $a The replacement values. @param array|object $b The replacement values. @return array The merged values.
[ "Merges", "two", "sets", "of", "replacement", "values", "." ]
eb5b1dadde0729f2ccd1b241c2cecebc778e22f3
https://github.com/kherge-abandoned/Wisdom/blob/eb5b1dadde0729f2ccd1b241c2cecebc778e22f3/src/lib/KevinGH/Wisdom/Wisdom.php#L279-L293
237,169
Softpampa/moip-sdk-php
src/Subscriptions/Resources/Subscriptions.php
Subscriptions.suspend
public function suspend($code = null) { if (! $code) { $code = $this->data->code; } $response = $this->client->put('/{code}/suspend', [$code]); if (! $response->hasErrors()) { $this->event->dispatch('SUBSCRIPTION.SUSPENDED', new SubscriptionsEvent($this->dat...
php
public function suspend($code = null) { if (! $code) { $code = $this->data->code; } $response = $this->client->put('/{code}/suspend', [$code]); if (! $response->hasErrors()) { $this->event->dispatch('SUBSCRIPTION.SUSPENDED', new SubscriptionsEvent($this->dat...
[ "public", "function", "suspend", "(", "$", "code", "=", "null", ")", "{", "if", "(", "!", "$", "code", ")", "{", "$", "code", "=", "$", "this", "->", "data", "->", "code", ";", "}", "$", "response", "=", "$", "this", "->", "client", "->", "put"...
Suspend a subscription @param string $code @return $this
[ "Suspend", "a", "subscription" ]
621a71bd2ef1f9b690cd3431507af608152f6ad2
https://github.com/Softpampa/moip-sdk-php/blob/621a71bd2ef1f9b690cd3431507af608152f6ad2/src/Subscriptions/Resources/Subscriptions.php#L85-L98
237,170
Softpampa/moip-sdk-php
src/Subscriptions/Resources/Subscriptions.php
Subscriptions.setNextInvoiceDate
public function setNextInvoiceDate($date) { $date = DateTime::createFromFormat('Y-m-d', $date); $this->next_invoice_date = new stdClass(); $this->next_invoice_date->day = $date->format('d'); $this->next_invoice_date->month = $date->format('m'); $this->next_invoice_date->year...
php
public function setNextInvoiceDate($date) { $date = DateTime::createFromFormat('Y-m-d', $date); $this->next_invoice_date = new stdClass(); $this->next_invoice_date->day = $date->format('d'); $this->next_invoice_date->month = $date->format('m'); $this->next_invoice_date->year...
[ "public", "function", "setNextInvoiceDate", "(", "$", "date", ")", "{", "$", "date", "=", "DateTime", "::", "createFromFormat", "(", "'Y-m-d'", ",", "$", "date", ")", ";", "$", "this", "->", "next_invoice_date", "=", "new", "stdClass", "(", ")", ";", "$"...
Set next invoice date @param string $date @return $this
[ "Set", "next", "invoice", "date" ]
621a71bd2ef1f9b690cd3431507af608152f6ad2
https://github.com/Softpampa/moip-sdk-php/blob/621a71bd2ef1f9b690cd3431507af608152f6ad2/src/Subscriptions/Resources/Subscriptions.php#L202-L212
237,171
Softpampa/moip-sdk-php
src/Subscriptions/Resources/Subscriptions.php
Subscriptions.setNewCustomer
public function setNewCustomer(Customers $customer) { $this->client->addQueryString('new_customer', true); $this->data->customer = $customer->jsonSerialize(); return $this; }
php
public function setNewCustomer(Customers $customer) { $this->client->addQueryString('new_customer', true); $this->data->customer = $customer->jsonSerialize(); return $this; }
[ "public", "function", "setNewCustomer", "(", "Customers", "$", "customer", ")", "{", "$", "this", "->", "client", "->", "addQueryString", "(", "'new_customer'", ",", "true", ")", ";", "$", "this", "->", "data", "->", "customer", "=", "$", "customer", "->",...
Set New Customer @param Customers $customer @return $this
[ "Set", "New", "Customer" ]
621a71bd2ef1f9b690cd3431507af608152f6ad2
https://github.com/Softpampa/moip-sdk-php/blob/621a71bd2ef1f9b690cd3431507af608152f6ad2/src/Subscriptions/Resources/Subscriptions.php#L267-L274
237,172
fazland/elastica-odm
src/Configuration.php
Configuration.getRepositoryFactory
public function getRepositoryFactory(): RepositoryFactoryInterface { if (null !== $this->repositoryFactory) { return $this->repositoryFactory; } $factory = new DefaultRepositoryFactory(); $factory->setDefaultRepositoryClassName($this->getDefaultRepositoryClassName()); ...
php
public function getRepositoryFactory(): RepositoryFactoryInterface { if (null !== $this->repositoryFactory) { return $this->repositoryFactory; } $factory = new DefaultRepositoryFactory(); $factory->setDefaultRepositoryClassName($this->getDefaultRepositoryClassName()); ...
[ "public", "function", "getRepositoryFactory", "(", ")", ":", "RepositoryFactoryInterface", "{", "if", "(", "null", "!==", "$", "this", "->", "repositoryFactory", ")", "{", "return", "$", "this", "->", "repositoryFactory", ";", "}", "$", "factory", "=", "new", ...
Sets the repository factory. @return RepositoryFactoryInterface
[ "Sets", "the", "repository", "factory", "." ]
9d7276ea9ea9103c670f13f889bf59568ff35274
https://github.com/fazland/elastica-odm/blob/9d7276ea9ea9103c670f13f889bf59568ff35274/src/Configuration.php#L195-L205
237,173
marando/phpSOFA
src/Marando/IAU/iauUtctai.php
iauUtctai.Utctai
public static function Utctai($utc1, $utc2, &$tai1, &$tai2) { $big1; $iy; $im; $id; $j; $iyt; $imt; $idt; $u1; $u2; $fd; $dat0; $dat12; $w; $dat24; $dlod; $dleap; $z1; $z2; $a2; /* Put the two parts of the UTC into big-first order. */ ...
php
public static function Utctai($utc1, $utc2, &$tai1, &$tai2) { $big1; $iy; $im; $id; $j; $iyt; $imt; $idt; $u1; $u2; $fd; $dat0; $dat12; $w; $dat24; $dlod; $dleap; $z1; $z2; $a2; /* Put the two parts of the UTC into big-first order. */ ...
[ "public", "static", "function", "Utctai", "(", "$", "utc1", ",", "$", "utc2", ",", "&", "$", "tai1", ",", "&", "$", "tai2", ")", "{", "$", "big1", ";", "$", "iy", ";", "$", "im", ";", "$", "id", ";", "$", "j", ";", "$", "iyt", ";", "$", "...
- - - - - - - - - - i a u U t c t a i - - - - - - - - - - Time scale transformation: Coordinated Universal Time, UTC, to International Atomic Time, TAI. This function is part of the International Astronomical Union's SOFA (Standards of Fundamental Astronomy) software collection. Status: canonical. Given: utc1,utc...
[ "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "i", "a", "u", "U", "t", "c", "t", "a", "i", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-" ]
757fa49fe335ae1210eaa7735473fd4388b13f07
https://github.com/marando/phpSOFA/blob/757fa49fe335ae1210eaa7735473fd4388b13f07/src/Marando/IAU/iauUtctai.php#L76-L159
237,174
slickframework/mvc
src/Router/Builder/RouteFactory.php
RouteFactory.simpleRoute
protected function simpleRoute($name, $data) { if (is_string($data)) { return $this->map->get($name, $data); } return $this->createRoute($name, $data); }
php
protected function simpleRoute($name, $data) { if (is_string($data)) { return $this->map->get($name, $data); } return $this->createRoute($name, $data); }
[ "protected", "function", "simpleRoute", "(", "$", "name", ",", "$", "data", ")", "{", "if", "(", "is_string", "(", "$", "data", ")", ")", "{", "return", "$", "this", "->", "map", "->", "get", "(", "$", "name", ",", "$", "data", ")", ";", "}", "...
Check if the data is a simple string, create a get with it If not a string pass the data to the construction chain where the route will be set with the data array passed @param string $name The route name @param string|array $data Meta data fo the route @return Route
[ "Check", "if", "the", "data", "is", "a", "simple", "string", "create", "a", "get", "with", "it" ]
91a6c512f8aaa5a7fb9c1a96f8012d2274dc30ab
https://github.com/slickframework/mvc/blob/91a6c512f8aaa5a7fb9c1a96f8012d2274dc30ab/src/Router/Builder/RouteFactory.php#L55-L61
237,175
slickframework/mvc
src/Router/Builder/RouteFactory.php
RouteFactory.setRouteProperties
protected function setRouteProperties(Route $route, array $data) { $methods = get_class_methods(Route::class); $methods = array_diff($methods, ["allows", "path"]); foreach($data as $method => $args) { if (in_array($method, $methods)) { $route->$method($args); ...
php
protected function setRouteProperties(Route $route, array $data) { $methods = get_class_methods(Route::class); $methods = array_diff($methods, ["allows", "path"]); foreach($data as $method => $args) { if (in_array($method, $methods)) { $route->$method($args); ...
[ "protected", "function", "setRouteProperties", "(", "Route", "$", "route", ",", "array", "$", "data", ")", "{", "$", "methods", "=", "get_class_methods", "(", "Route", "::", "class", ")", ";", "$", "methods", "=", "array_diff", "(", "$", "methods", ",", ...
Parses data array to set route properties @param Route $route @param array $data @return Route
[ "Parses", "data", "array", "to", "set", "route", "properties" ]
91a6c512f8aaa5a7fb9c1a96f8012d2274dc30ab
https://github.com/slickframework/mvc/blob/91a6c512f8aaa5a7fb9c1a96f8012d2274dc30ab/src/Router/Builder/RouteFactory.php#L93-L103
237,176
wollanup/php-api-rest
src/Service/Request/QueryModifier/Modifier/Base/ModifierBase.php
ModifierBase.apply
public function apply(ModelCriteria $query) { if (!empty($this->modifiers)) { foreach ($this->modifiers as $modifier) { if ($this->hasAllRequiredData($modifier)) { $modifier['property'] = str_replace('/', '.', $modifier['property']); # Chec...
php
public function apply(ModelCriteria $query) { if (!empty($this->modifiers)) { foreach ($this->modifiers as $modifier) { if ($this->hasAllRequiredData($modifier)) { $modifier['property'] = str_replace('/', '.', $modifier['property']); # Chec...
[ "public", "function", "apply", "(", "ModelCriteria", "$", "query", ")", "{", "if", "(", "!", "empty", "(", "$", "this", "->", "modifiers", ")", ")", "{", "foreach", "(", "$", "this", "->", "modifiers", "as", "$", "modifier", ")", "{", "if", "(", "$...
Apply the filter to the ModelQuery @param \Propel\Runtime\ActiveQuery\ModelCriteria $query
[ "Apply", "the", "filter", "to", "the", "ModelQuery" ]
185eac8a8412e5997d8e292ebd0e38787ae4b949
https://github.com/wollanup/php-api-rest/blob/185eac8a8412e5997d8e292ebd0e38787ae4b949/src/Service/Request/QueryModifier/Modifier/Base/ModifierBase.php#L76-L102
237,177
CatLabInteractive/Neuron
src/Neuron/Tools/Text.php
Text.get
public static function get ($message1, $message2 = null, $n = null) { $in = self::getInstance (); return $in->getText ($message1, $message2, $n); }
php
public static function get ($message1, $message2 = null, $n = null) { $in = self::getInstance (); return $in->getText ($message1, $message2, $n); }
[ "public", "static", "function", "get", "(", "$", "message1", ",", "$", "message2", "=", "null", ",", "$", "n", "=", "null", ")", "{", "$", "in", "=", "self", "::", "getInstance", "(", ")", ";", "return", "$", "in", "->", "getText", "(", "$", "mes...
Little helper method. @param string $message1 @param string|null $message2 @param string|null $n @return string
[ "Little", "helper", "method", "." ]
67dca5349891e23b31a96dcdead893b9491a1b8b
https://github.com/CatLabInteractive/Neuron/blob/67dca5349891e23b31a96dcdead893b9491a1b8b/src/Neuron/Tools/Text.php#L70-L74
237,178
digipolisgent/openbib-id-api
src/Value/UserActivities/ExpenseCollection.php
ExpenseCollection.fromXml
public static function fromXml(\DOMNodeList $xml) { $items = array(); foreach ($xml as $xmlTag) { $items[] = Expense::fromXml($xmlTag); } return new static($items); }
php
public static function fromXml(\DOMNodeList $xml) { $items = array(); foreach ($xml as $xmlTag) { $items[] = Expense::fromXml($xmlTag); } return new static($items); }
[ "public", "static", "function", "fromXml", "(", "\\", "DOMNodeList", "$", "xml", ")", "{", "$", "items", "=", "array", "(", ")", ";", "foreach", "(", "$", "xml", "as", "$", "xmlTag", ")", "{", "$", "items", "[", "]", "=", "Expense", "::", "fromXml"...
Builds a ExpenseCollection object from XML. @param \DOMNodeList $xml The list of xml tags representing the expenses. @return ExpenseCollection A ExpenseCollection object
[ "Builds", "a", "ExpenseCollection", "object", "from", "XML", "." ]
79f58dec53a91f44333d10fa4ef79f85f31fc2de
https://github.com/digipolisgent/openbib-id-api/blob/79f58dec53a91f44333d10fa4ef79f85f31fc2de/src/Value/UserActivities/ExpenseCollection.php#L18-L25
237,179
easy-system/es-http
src/Factory/UriQueryFactory.php
UriQueryFactory.make
public static function make(array $server = null) { if (empty($server)) { $server = $_SERVER; } if (isset($server['REQUEST_URI'])) { return parse_url($server['REQUEST_URI'], PHP_URL_QUERY); } }
php
public static function make(array $server = null) { if (empty($server)) { $server = $_SERVER; } if (isset($server['REQUEST_URI'])) { return parse_url($server['REQUEST_URI'], PHP_URL_QUERY); } }
[ "public", "static", "function", "make", "(", "array", "$", "server", "=", "null", ")", "{", "if", "(", "empty", "(", "$", "server", ")", ")", "{", "$", "server", "=", "$", "_SERVER", ";", "}", "if", "(", "isset", "(", "$", "server", "[", "'REQUES...
Makes a string with Uri query. @param array $server Optional; null by default or empty array means global $_SERVER. The source data @return string|null Returns the Uri query if any, null otherwise
[ "Makes", "a", "string", "with", "Uri", "query", "." ]
dd5852e94901e147a7546a8715133408ece767a1
https://github.com/easy-system/es-http/blob/dd5852e94901e147a7546a8715133408ece767a1/src/Factory/UriQueryFactory.php#L25-L34
237,180
harmony-project/modular-routing
source/EventListener/RoutingSubscriber.php
RoutingSubscriber.onKernelRequest
public function onKernelRequest(GetResponseEvent $event) { if (null === $module = $event->getRequest()->get('module')) { return; } if (!$module instanceof ModuleInterface) { $module = $this->getModularRouter()->getModuleByRequest($event->getRequest()); } ...
php
public function onKernelRequest(GetResponseEvent $event) { if (null === $module = $event->getRequest()->get('module')) { return; } if (!$module instanceof ModuleInterface) { $module = $this->getModularRouter()->getModuleByRequest($event->getRequest()); } ...
[ "public", "function", "onKernelRequest", "(", "GetResponseEvent", "$", "event", ")", "{", "if", "(", "null", "===", "$", "module", "=", "$", "event", "->", "getRequest", "(", ")", "->", "get", "(", "'module'", ")", ")", "{", "return", ";", "}", "if", ...
Handles actions before the kernel matches the controller. @param GetResponseEvent $event
[ "Handles", "actions", "before", "the", "kernel", "matches", "the", "controller", "." ]
399bb427678ddc17c67295c738b96faea485e2d8
https://github.com/harmony-project/modular-routing/blob/399bb427678ddc17c67295c738b96faea485e2d8/source/EventListener/RoutingSubscriber.php#L78-L90
237,181
kevindierkx/elicit
src/Connector/AbstractConnector.php
AbstractConnector.createConnection
public function createConnection(array $config) { if (! isset($config['host'])) { throw new InvalidArgumentException("No host provided."); } $this->setHost($config['host']); // We check the configuration for request headers. Some API's require // certain headers...
php
public function createConnection(array $config) { if (! isset($config['host'])) { throw new InvalidArgumentException("No host provided."); } $this->setHost($config['host']); // We check the configuration for request headers. Some API's require // certain headers...
[ "public", "function", "createConnection", "(", "array", "$", "config", ")", "{", "if", "(", "!", "isset", "(", "$", "config", "[", "'host'", "]", ")", ")", "{", "throw", "new", "InvalidArgumentException", "(", "\"No host provided.\"", ")", ";", "}", "$", ...
Initialize connector. @param array $config @return self @throws InvalidArgumentException
[ "Initialize", "connector", "." ]
c277942f5f5f63b175bc37e9d392faa946888f65
https://github.com/kevindierkx/elicit/blob/c277942f5f5f63b175bc37e9d392faa946888f65/src/Connector/AbstractConnector.php#L56-L72
237,182
kevindierkx/elicit
src/Connector/AbstractConnector.php
AbstractConnector.prepare
public function prepare(array $query) { $client = new Client; $this->client = $client; $this->request = $client->createRequest( $this->prepareMethod($query), $this->prepareRequestUrl($query), [ 'headers' => $this->prepareHeaders($query), ...
php
public function prepare(array $query) { $client = new Client; $this->client = $client; $this->request = $client->createRequest( $this->prepareMethod($query), $this->prepareRequestUrl($query), [ 'headers' => $this->prepareHeaders($query), ...
[ "public", "function", "prepare", "(", "array", "$", "query", ")", "{", "$", "client", "=", "new", "Client", ";", "$", "this", "->", "client", "=", "$", "client", ";", "$", "this", "->", "request", "=", "$", "client", "->", "createRequest", "(", "$", ...
Prepare a new request for execution. @param array $query @return self
[ "Prepare", "a", "new", "request", "for", "execution", "." ]
c277942f5f5f63b175bc37e9d392faa946888f65
https://github.com/kevindierkx/elicit/blob/c277942f5f5f63b175bc37e9d392faa946888f65/src/Connector/AbstractConnector.php#L80-L95
237,183
kevindierkx/elicit
src/Connector/AbstractConnector.php
AbstractConnector.prepareRequestUrl
protected function prepareRequestUrl(array $query) { $path = isset($query['from']['path']) ? $query['from']['path'] : null; $wheres = isset($query['wheres']) ? $query['wheres'] : null; $baseUrl = $this->host.$path; // Here we validate that there are any wheres in the // re...
php
protected function prepareRequestUrl(array $query) { $path = isset($query['from']['path']) ? $query['from']['path'] : null; $wheres = isset($query['wheres']) ? $query['wheres'] : null; $baseUrl = $this->host.$path; // Here we validate that there are any wheres in the // re...
[ "protected", "function", "prepareRequestUrl", "(", "array", "$", "query", ")", "{", "$", "path", "=", "isset", "(", "$", "query", "[", "'from'", "]", "[", "'path'", "]", ")", "?", "$", "query", "[", "'from'", "]", "[", "'path'", "]", ":", "null", "...
Prepare request URL from query. @param array $query @return string
[ "Prepare", "request", "URL", "from", "query", "." ]
c277942f5f5f63b175bc37e9d392faa946888f65
https://github.com/kevindierkx/elicit/blob/c277942f5f5f63b175bc37e9d392faa946888f65/src/Connector/AbstractConnector.php#L114-L130
237,184
kevindierkx/elicit
src/Connector/AbstractConnector.php
AbstractConnector.prepareBody
protected function prepareBody(array $query) { $method = isset($query['from']['method']) ? $query['from']['method'] : null; if ($method === 'POST') { // The query grammar already parsed the body for us. // We return the value of the query and guzzle does the rest. ...
php
protected function prepareBody(array $query) { $method = isset($query['from']['method']) ? $query['from']['method'] : null; if ($method === 'POST') { // The query grammar already parsed the body for us. // We return the value of the query and guzzle does the rest. ...
[ "protected", "function", "prepareBody", "(", "array", "$", "query", ")", "{", "$", "method", "=", "isset", "(", "$", "query", "[", "'from'", "]", "[", "'method'", "]", ")", "?", "$", "query", "[", "'from'", "]", "[", "'method'", "]", ":", "null", "...
Prepare body from query. @param array $query @return string|array|null
[ "Prepare", "body", "from", "query", "." ]
c277942f5f5f63b175bc37e9d392faa946888f65
https://github.com/kevindierkx/elicit/blob/c277942f5f5f63b175bc37e9d392faa946888f65/src/Connector/AbstractConnector.php#L156-L165
237,185
kevindierkx/elicit
src/Connector/AbstractConnector.php
AbstractConnector.parseResponse
protected function parseResponse(Response $response) { $contentType = explode(';', $response->getHeader('content-type'))[0]; switch ($contentType) { case 'application/json': case 'application/vnd.api+json': return $response->json(); case 'applica...
php
protected function parseResponse(Response $response) { $contentType = explode(';', $response->getHeader('content-type'))[0]; switch ($contentType) { case 'application/json': case 'application/vnd.api+json': return $response->json(); case 'applica...
[ "protected", "function", "parseResponse", "(", "Response", "$", "response", ")", "{", "$", "contentType", "=", "explode", "(", "';'", ",", "$", "response", "->", "getHeader", "(", "'content-type'", ")", ")", "[", "0", "]", ";", "switch", "(", "$", "conte...
Parse the returned response. @param \GuzzleHttp\Message\Response $response @return array @throws RuntimeException
[ "Parse", "the", "returned", "response", "." ]
c277942f5f5f63b175bc37e9d392faa946888f65
https://github.com/kevindierkx/elicit/blob/c277942f5f5f63b175bc37e9d392faa946888f65/src/Connector/AbstractConnector.php#L190-L204
237,186
phPoirot/Module-Authorization
src/Authorization/Guard/GuardRestrictIP.php
GuardRestrictIP.attachToEvent
function attachToEvent(iEvent $event) { if ( \Poirot\isCommandLine() ) // Restriction IP Only Work With Http Sapi return $this; $self = $this; $event->on(EventHeapOfSapi::EVENT_APP_MATCH_REQUEST, function() use ($self) { $self->_assertAccess(); }...
php
function attachToEvent(iEvent $event) { if ( \Poirot\isCommandLine() ) // Restriction IP Only Work With Http Sapi return $this; $self = $this; $event->on(EventHeapOfSapi::EVENT_APP_MATCH_REQUEST, function() use ($self) { $self->_assertAccess(); }...
[ "function", "attachToEvent", "(", "iEvent", "$", "event", ")", "{", "if", "(", "\\", "Poirot", "\\", "isCommandLine", "(", ")", ")", "// Restriction IP Only Work With Http Sapi", "return", "$", "this", ";", "$", "self", "=", "$", "this", ";", "$", "event", ...
Attach To Event note: not throw any exception if event type is unknown! @param iEvent|EventHeapOfSapi $event @return $this
[ "Attach", "To", "Event" ]
1adcb85d01bb7cfaa6cc6b0cbcb9907ef4778e06
https://github.com/phPoirot/Module-Authorization/blob/1adcb85d01bb7cfaa6cc6b0cbcb9907ef4778e06/src/Authorization/Guard/GuardRestrictIP.php#L59-L72
237,187
phPoirot/Module-Authorization
src/Authorization/Guard/GuardRestrictIP.php
GuardRestrictIP.setBlockList
function setBlockList($list) { if ($list instanceof \Traversable) $list = \Poirot\Std\cast($list)->toArray(); if (! is_array($list) ) throw new \InvalidArgumentException(sprintf( 'List must instanceof Traversable or array; given (%s).' , \Poir...
php
function setBlockList($list) { if ($list instanceof \Traversable) $list = \Poirot\Std\cast($list)->toArray(); if (! is_array($list) ) throw new \InvalidArgumentException(sprintf( 'List must instanceof Traversable or array; given (%s).' , \Poir...
[ "function", "setBlockList", "(", "$", "list", ")", "{", "if", "(", "$", "list", "instanceof", "\\", "Traversable", ")", "$", "list", "=", "\\", "Poirot", "\\", "Std", "\\", "cast", "(", "$", "list", ")", "->", "toArray", "(", ")", ";", "if", "(", ...
Set IP Block List @param array|\Traversable $list @return $this
[ "Set", "IP", "Block", "List" ]
1adcb85d01bb7cfaa6cc6b0cbcb9907ef4778e06
https://github.com/phPoirot/Module-Authorization/blob/1adcb85d01bb7cfaa6cc6b0cbcb9907ef4778e06/src/Authorization/Guard/GuardRestrictIP.php#L98-L111
237,188
tekkla/core-framework
Core/Framework/Page/Head/Meta.php
Meta.setViewport
public function setViewport($width = 'device-width', $initial_scale = '1', $user_scalable = '', $minimum_scale = '', $maximum_scale = '') { $tag = [ 'name' => 'viewport', 'content' => 'width=' . $width . ', initial-scale=' . $initial_scale ]; if ($user_scalable) { ...
php
public function setViewport($width = 'device-width', $initial_scale = '1', $user_scalable = '', $minimum_scale = '', $maximum_scale = '') { $tag = [ 'name' => 'viewport', 'content' => 'width=' . $width . ', initial-scale=' . $initial_scale ]; if ($user_scalable) { ...
[ "public", "function", "setViewport", "(", "$", "width", "=", "'device-width'", ",", "$", "initial_scale", "=", "'1'", ",", "$", "user_scalable", "=", "''", ",", "$", "minimum_scale", "=", "''", ",", "$", "maximum_scale", "=", "''", ")", "{", "$", "tag", ...
Sets vieport tag @param string $width Description of used device width @param string $initial_scale Initial scale factor (Default: '1') @param string $user_scalable @param string $minimum_scale @param string $maximum_scale
[ "Sets", "vieport", "tag" ]
ad69e9f15ee3644b6ca376edc30d8f5555399892
https://github.com/tekkla/core-framework/blob/ad69e9f15ee3644b6ca376edc30d8f5555399892/Core/Framework/Page/Head/Meta.php#L50-L70
237,189
morrelinko/simple-photo
src/DataStore/MySqlDataStore.php
MySqlDataStore.createConnection
public function createConnection($parameters) { $connection = new \PDO( 'mysql:host=' . $parameters['host'] . ';dbname=' . $parameters['database'], $parameters['username'], $parameters['password'] ); if (isset($parameters['charset'])) { $conne...
php
public function createConnection($parameters) { $connection = new \PDO( 'mysql:host=' . $parameters['host'] . ';dbname=' . $parameters['database'], $parameters['username'], $parameters['password'] ); if (isset($parameters['charset'])) { $conne...
[ "public", "function", "createConnection", "(", "$", "parameters", ")", "{", "$", "connection", "=", "new", "\\", "PDO", "(", "'mysql:host='", ".", "$", "parameters", "[", "'host'", "]", ".", "';dbname='", ".", "$", "parameters", "[", "'database'", "]", ","...
Creates a MySql Connection @param array $parameters Connection parameters <pre> host: eg. localhost database: eg. my_app username: eg. root password: eg. 123456 charset: (Optional) </pre> @return \PDO
[ "Creates", "a", "MySql", "Connection" ]
be1fbe3139d32eb39e88cff93f847154bb6a8cb2
https://github.com/morrelinko/simple-photo/blob/be1fbe3139d32eb39e88cff93f847154bb6a8cb2/src/DataStore/MySqlDataStore.php#L33-L46
237,190
MehrAlsNix/Notifier
src/Notify.php
Notify.fetch
protected static function fetch() { $command = array( 'LINUX' => new Commands\Linux(), 'MAC' => new Commands\Mac(), 'WIN' => new Commands\Windows() ); $instance = 'No valid desktop notifier found.'; if ($command['WIN']->isAvailable()) { ...
php
protected static function fetch() { $command = array( 'LINUX' => new Commands\Linux(), 'MAC' => new Commands\Mac(), 'WIN' => new Commands\Windows() ); $instance = 'No valid desktop notifier found.'; if ($command['WIN']->isAvailable()) { ...
[ "protected", "static", "function", "fetch", "(", ")", "{", "$", "command", "=", "array", "(", "'LINUX'", "=>", "new", "Commands", "\\", "Linux", "(", ")", ",", "'MAC'", "=>", "new", "Commands", "\\", "Mac", "(", ")", ",", "'WIN'", "=>", "new", "Comma...
Fetches an instance by checking for ability. @return Commands\Linux|Commands\Mac|Commands\Windows @throws \RuntimeException
[ "Fetches", "an", "instance", "by", "checking", "for", "ability", "." ]
9ac9fed8880537157091ac0607965b30dab20bca
https://github.com/MehrAlsNix/Notifier/blob/9ac9fed8880537157091ac0607965b30dab20bca/src/Notify.php#L63-L86
237,191
tenside/core
src/Task/Composer/WrappedCommand/WrappedCommandTrait.php
WrappedCommandTrait.getComposer
public function getComposer($required = true, $disablePlugins = false) { if (null === $this->composer) { if ($this->composerFactory) { $this->composer = call_user_func($this->composerFactory, $required, $disablePlugins); } if ($required && !$this->compose...
php
public function getComposer($required = true, $disablePlugins = false) { if (null === $this->composer) { if ($this->composerFactory) { $this->composer = call_user_func($this->composerFactory, $required, $disablePlugins); } if ($required && !$this->compose...
[ "public", "function", "getComposer", "(", "$", "required", "=", "true", ",", "$", "disablePlugins", "=", "false", ")", "{", "if", "(", "null", "===", "$", "this", "->", "composer", ")", "{", "if", "(", "$", "this", "->", "composerFactory", ")", "{", ...
Retrieve the composer instance. @param bool $required Flag if the instance is required. @param bool $disablePlugins Flag if plugins shall get disabled. @return Composer|null @throws \RuntimeException When no factory closure has been set.
[ "Retrieve", "the", "composer", "instance", "." ]
56422fa8cdecf03cb431bb6654c2942ade39bf7b
https://github.com/tenside/core/blob/56422fa8cdecf03cb431bb6654c2942ade39bf7b/src/Task/Composer/WrappedCommand/WrappedCommandTrait.php#L55-L71
237,192
flipbox/skeleton
src/Collections/AbstractModelCollection.php
AbstractModelCollection.getErrors
public function getErrors($attribute = null) { $itemErrors = []; foreach ($this->getItems() as $item) { if ($item->hasErrors($attribute)) { $itemErrors[$this->getItemId($item)] = $item->getErrors($attribute); } } return array_merge( ...
php
public function getErrors($attribute = null) { $itemErrors = []; foreach ($this->getItems() as $item) { if ($item->hasErrors($attribute)) { $itemErrors[$this->getItemId($item)] = $item->getErrors($attribute); } } return array_merge( ...
[ "public", "function", "getErrors", "(", "$", "attribute", "=", "null", ")", "{", "$", "itemErrors", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "getItems", "(", ")", "as", "$", "item", ")", "{", "if", "(", "$", "item", "->", "hasErrors",...
Merge errors from all @inheritdoc
[ "Merge", "errors", "from", "all" ]
98ed2a8f4c201f34135e6573f3071b2a75a67907
https://github.com/flipbox/skeleton/blob/98ed2a8f4c201f34135e6573f3071b2a75a67907/src/Collections/AbstractModelCollection.php#L42-L56
237,193
webriq/core
module/Paragraph/src/Grid/Paragraph/Model/Snippet/Rpc.php
Rpc.isNameAvailable
public function isNameAvailable( $name, $fields = array() ) { $fields = (object) $fields; return ! $this->getMapper() ->isNameExists( $name . ( empty( $fields->type ) ? '' : '.' . $fields->type ) )...
php
public function isNameAvailable( $name, $fields = array() ) { $fields = (object) $fields; return ! $this->getMapper() ->isNameExists( $name . ( empty( $fields->type ) ? '' : '.' . $fields->type ) )...
[ "public", "function", "isNameAvailable", "(", "$", "name", ",", "$", "fields", "=", "array", "(", ")", ")", "{", "$", "fields", "=", "(", "object", ")", "$", "fields", ";", "return", "!", "$", "this", "->", "getMapper", "(", ")", "->", "isNameExists"...
Find a structure is available @param string $name @param array|object $fields [optional] @return bool
[ "Find", "a", "structure", "is", "available" ]
cfeb6e8a4732561c2215ec94e736c07f9b8bc990
https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Paragraph/src/Grid/Paragraph/Model/Snippet/Rpc.php#L39-L48
237,194
rezzza/jobflow
src/Rezzza/Jobflow/JobFactory.php
JobFactory.createBuilder
public function createBuilder($type = 'job', array $initOptions = array(), array $execOptions = array()) { $name = $type instanceof JobTypeInterface || $type instanceof ResolvedJob ? $type->getName() : $type; return $this->createNamedBuilder($name, $type, $initOptions, $exec...
php
public function createBuilder($type = 'job', array $initOptions = array(), array $execOptions = array()) { $name = $type instanceof JobTypeInterface || $type instanceof ResolvedJob ? $type->getName() : $type; return $this->createNamedBuilder($name, $type, $initOptions, $exec...
[ "public", "function", "createBuilder", "(", "$", "type", "=", "'job'", ",", "array", "$", "initOptions", "=", "array", "(", ")", ",", "array", "$", "execOptions", "=", "array", "(", ")", ")", "{", "$", "name", "=", "$", "type", "instanceof", "JobTypeIn...
Create a builder @param mixed $type The JobTypeInterface or the alias of the job type registered as a service @return JobBuilder
[ "Create", "a", "builder" ]
80ded8ac6ed6a2f4500b8f86e2958701ec84fd65
https://github.com/rezzza/jobflow/blob/80ded8ac6ed6a2f4500b8f86e2958701ec84fd65/src/Rezzza/Jobflow/JobFactory.php#L45-L52
237,195
rezzza/jobflow
src/Rezzza/Jobflow/JobFactory.php
JobFactory.resolveType
public function resolveType(JobTypeInterface $type) { $parentType = $type->getParent(); if ($parentType instanceof JobTypeInterface) { $parentType = $this->resolveType($parentType); } elseif (null !== $parentType) { $parentType = $this->registry->getType($parentType)...
php
public function resolveType(JobTypeInterface $type) { $parentType = $type->getParent(); if ($parentType instanceof JobTypeInterface) { $parentType = $this->resolveType($parentType); } elseif (null !== $parentType) { $parentType = $this->registry->getType($parentType)...
[ "public", "function", "resolveType", "(", "JobTypeInterface", "$", "type", ")", "{", "$", "parentType", "=", "$", "type", "->", "getParent", "(", ")", ";", "if", "(", "$", "parentType", "instanceof", "JobTypeInterface", ")", "{", "$", "parentType", "=", "$...
Creates wrapper for combination of JobType and JobConnector @param JobTypeInterface $type @return ResolvedJob
[ "Creates", "wrapper", "for", "combination", "of", "JobType", "and", "JobConnector" ]
80ded8ac6ed6a2f4500b8f86e2958701ec84fd65
https://github.com/rezzza/jobflow/blob/80ded8ac6ed6a2f4500b8f86e2958701ec84fd65/src/Rezzza/Jobflow/JobFactory.php#L82-L93
237,196
vinala/kernel
src/Processes/Command.php
Command.set
public static function set($file, $command, $database) { $database = $database ? 'true' : 'false'; // $txt = "<?php\n\nnamespace Vinala\App\Support\Lumos;\n\n"; $txt .= "use Vinala\Kernel\Console\Command\Commands;\n\n"; $txt .= self::docs("$file Command"); $txt .= "...
php
public static function set($file, $command, $database) { $database = $database ? 'true' : 'false'; // $txt = "<?php\n\nnamespace Vinala\App\Support\Lumos;\n\n"; $txt .= "use Vinala\Kernel\Console\Command\Commands;\n\n"; $txt .= self::docs("$file Command"); $txt .= "...
[ "public", "static", "function", "set", "(", "$", "file", ",", "$", "command", ",", "$", "database", ")", "{", "$", "database", "=", "$", "database", "?", "'true'", ":", "'false'", ";", "//", "$", "txt", "=", "\"<?php\\n\\nnamespace Vinala\\App\\Support\\Lumo...
prepare the text to put in command file.
[ "prepare", "the", "text", "to", "put", "in", "command", "file", "." ]
346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a
https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Processes/Command.php#L31-L49
237,197
wasabi-cms/core
src/MenuItem.php
MenuItem.alias
public function alias($alias = null) { if ($alias === null) { return $this->_alias; } $this->_alias = $alias; return $this; }
php
public function alias($alias = null) { if ($alias === null) { return $this->_alias; } $this->_alias = $alias; return $this; }
[ "public", "function", "alias", "(", "$", "alias", "=", "null", ")", "{", "if", "(", "$", "alias", "===", "null", ")", "{", "return", "$", "this", "->", "_alias", ";", "}", "$", "this", "->", "_alias", "=", "$", "alias", ";", "return", "$", "this"...
Get or set the alias. @param null|string $alias @return MenuItem|string
[ "Get", "or", "set", "the", "alias", "." ]
0eadbb64d2fc201bacc63c93814adeca70e08f90
https://github.com/wasabi-cms/core/blob/0eadbb64d2fc201bacc63c93814adeca70e08f90/src/MenuItem.php#L83-L91
237,198
wasabi-cms/core
src/MenuItem.php
MenuItem.name
public function name($name = null) { if ($name === null) { return $name; } $this->_name = $name; return $this; }
php
public function name($name = null) { if ($name === null) { return $name; } $this->_name = $name; return $this; }
[ "public", "function", "name", "(", "$", "name", "=", "null", ")", "{", "if", "(", "$", "name", "===", "null", ")", "{", "return", "$", "name", ";", "}", "$", "this", "->", "_name", "=", "$", "name", ";", "return", "$", "this", ";", "}" ]
Get or set the name. @param string $name @return MenuItem|string
[ "Get", "or", "set", "the", "name", "." ]
0eadbb64d2fc201bacc63c93814adeca70e08f90
https://github.com/wasabi-cms/core/blob/0eadbb64d2fc201bacc63c93814adeca70e08f90/src/MenuItem.php#L99-L107
237,199
wasabi-cms/core
src/MenuItem.php
MenuItem.shortName
public function shortName($name = null) { if ($name === null) { return $this->_nameShort; } $this->_nameShort = $name; return $this; }
php
public function shortName($name = null) { if ($name === null) { return $this->_nameShort; } $this->_nameShort = $name; return $this; }
[ "public", "function", "shortName", "(", "$", "name", "=", "null", ")", "{", "if", "(", "$", "name", "===", "null", ")", "{", "return", "$", "this", "->", "_nameShort", ";", "}", "$", "this", "->", "_nameShort", "=", "$", "name", ";", "return", "$",...
Get or set the short name. @param null|string $name @return MenuItem|string
[ "Get", "or", "set", "the", "short", "name", "." ]
0eadbb64d2fc201bacc63c93814adeca70e08f90
https://github.com/wasabi-cms/core/blob/0eadbb64d2fc201bacc63c93814adeca70e08f90/src/MenuItem.php#L115-L123