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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
205,000 | ekyna/AdminBundle | DependencyInjection/PoolBuilder.php | PoolBuilder.createOperatorDefinition | private function createOperatorDefinition()
{
$id = $this->getServiceId('operator');
if (!$this->container->has($id)) {
$definition = new Definition($this->getServiceClass('operator'));
$definition->setArguments([
new Reference($this->getManagerServiceId()),
... | php | private function createOperatorDefinition()
{
$id = $this->getServiceId('operator');
if (!$this->container->has($id)) {
$definition = new Definition($this->getServiceClass('operator'));
$definition->setArguments([
new Reference($this->getManagerServiceId()),
... | [
"private",
"function",
"createOperatorDefinition",
"(",
")",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"getServiceId",
"(",
"'operator'",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"container",
"->",
"has",
"(",
"$",
"id",
")",
")",
"{",
"$",
"defini... | Creates the operator service definition.
@TODO Swap with ResourceManager when ready. | [
"Creates",
"the",
"operator",
"service",
"definition",
"."
] | 3f58e253ae9cf651add7f3d587caec80eaea459a | https://github.com/ekyna/AdminBundle/blob/3f58e253ae9cf651add7f3d587caec80eaea459a/DependencyInjection/PoolBuilder.php#L372-L385 |
205,001 | ekyna/AdminBundle | DependencyInjection/PoolBuilder.php | PoolBuilder.createControllerDefinition | private function createControllerDefinition()
{
$id = $this->getServiceId('controller');
if (!$this->container->has($id)) {
$definition = new Definition($this->getServiceClass('controller'));
$definition
->addMethodCall('setConfiguration', [new Reference($this... | php | private function createControllerDefinition()
{
$id = $this->getServiceId('controller');
if (!$this->container->has($id)) {
$definition = new Definition($this->getServiceClass('controller'));
$definition
->addMethodCall('setConfiguration', [new Reference($this... | [
"private",
"function",
"createControllerDefinition",
"(",
")",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"getServiceId",
"(",
"'controller'",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"container",
"->",
"has",
"(",
"$",
"id",
")",
")",
"{",
"$",
"de... | Creates the Controller service definition. | [
"Creates",
"the",
"Controller",
"service",
"definition",
"."
] | 3f58e253ae9cf651add7f3d587caec80eaea459a | https://github.com/ekyna/AdminBundle/blob/3f58e253ae9cf651add7f3d587caec80eaea459a/DependencyInjection/PoolBuilder.php#L390-L401 |
205,002 | ekyna/AdminBundle | DependencyInjection/PoolBuilder.php | PoolBuilder.configureTranslations | private function configureTranslations()
{
if (null !== array_key_exists('translation', $this->options) && is_array($this->options['translation'])) {
$translatable = $this->options['entity'];
$translation = $this->options['translation']['entity'];
$id = sprintf('%s.%s_tr... | php | private function configureTranslations()
{
if (null !== array_key_exists('translation', $this->options) && is_array($this->options['translation'])) {
$translatable = $this->options['entity'];
$translation = $this->options['translation']['entity'];
$id = sprintf('%s.%s_tr... | [
"private",
"function",
"configureTranslations",
"(",
")",
"{",
"if",
"(",
"null",
"!==",
"array_key_exists",
"(",
"'translation'",
",",
"$",
"this",
"->",
"options",
")",
"&&",
"is_array",
"(",
"$",
"this",
"->",
"options",
"[",
"'translation'",
"]",
")",
... | Configure the translation | [
"Configure",
"the",
"translation"
] | 3f58e253ae9cf651add7f3d587caec80eaea459a | https://github.com/ekyna/AdminBundle/blob/3f58e253ae9cf651add7f3d587caec80eaea459a/DependencyInjection/PoolBuilder.php#L442-L468 |
205,003 | ekyna/AdminBundle | DependencyInjection/PoolBuilder.php | PoolBuilder.configureInheritanceMapping | private function configureInheritanceMapping($id, $entity, $repository)
{
$entities = [
$id => [
'class' => $entity,
'repository' => $repository,
],
];
if ($this->container->hasParameter('ekyna_core.entities')) {
$enti... | php | private function configureInheritanceMapping($id, $entity, $repository)
{
$entities = [
$id => [
'class' => $entity,
'repository' => $repository,
],
];
if ($this->container->hasParameter('ekyna_core.entities')) {
$enti... | [
"private",
"function",
"configureInheritanceMapping",
"(",
"$",
"id",
",",
"$",
"entity",
",",
"$",
"repository",
")",
"{",
"$",
"entities",
"=",
"[",
"$",
"id",
"=>",
"[",
"'class'",
"=>",
"$",
"entity",
",",
"'repository'",
"=>",
"$",
"repository",
","... | Configures mapping inheritance.
@param string $id
@param string $entity
@param string $repository | [
"Configures",
"mapping",
"inheritance",
"."
] | 3f58e253ae9cf651add7f3d587caec80eaea459a | https://github.com/ekyna/AdminBundle/blob/3f58e253ae9cf651add7f3d587caec80eaea459a/DependencyInjection/PoolBuilder.php#L477-L490 |
205,004 | ekyna/AdminBundle | DependencyInjection/PoolBuilder.php | PoolBuilder.getServiceClass | private function getServiceClass($name)
{
$serviceId = $this->getServiceId($name);
$parameterId = $serviceId.'.class';
if ($this->container->hasParameter($parameterId)) {
$class = $this->container->getParameter($parameterId);
} elseif (array_key_exists($name, $this->optio... | php | private function getServiceClass($name)
{
$serviceId = $this->getServiceId($name);
$parameterId = $serviceId.'.class';
if ($this->container->hasParameter($parameterId)) {
$class = $this->container->getParameter($parameterId);
} elseif (array_key_exists($name, $this->optio... | [
"private",
"function",
"getServiceClass",
"(",
"$",
"name",
")",
"{",
"$",
"serviceId",
"=",
"$",
"this",
"->",
"getServiceId",
"(",
"$",
"name",
")",
";",
"$",
"parameterId",
"=",
"$",
"serviceId",
".",
"'.class'",
";",
"if",
"(",
"$",
"this",
"->",
... | Returns the service class for the given name.
@param string $name
@throws \RuntimeException
@return string|null | [
"Returns",
"the",
"service",
"class",
"for",
"the",
"given",
"name",
"."
] | 3f58e253ae9cf651add7f3d587caec80eaea459a | https://github.com/ekyna/AdminBundle/blob/3f58e253ae9cf651add7f3d587caec80eaea459a/DependencyInjection/PoolBuilder.php#L533-L545 |
205,005 | schpill/thin | src/Html/Qwerly/User.php | User.getDescription | public function getDescription()
{
return isset($this->_data[self::PROFILE][self::DESCRIPTION]) ? $this->_data[self::PROFILE][self::DESCRIPTION] : null;
} | php | public function getDescription()
{
return isset($this->_data[self::PROFILE][self::DESCRIPTION]) ? $this->_data[self::PROFILE][self::DESCRIPTION] : null;
} | [
"public",
"function",
"getDescription",
"(",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"_data",
"[",
"self",
"::",
"PROFILE",
"]",
"[",
"self",
"::",
"DESCRIPTION",
"]",
")",
"?",
"$",
"this",
"->",
"_data",
"[",
"self",
"::",
"PROFILE",
"... | Retrieves the user's description.
@return string | [
"Retrieves",
"the",
"user",
"s",
"description",
"."
] | a9102d9d6f70e8b0f6be93153f70849f46489ee1 | https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Html/Qwerly/User.php#L32-L35 |
205,006 | schpill/thin | src/Html/Qwerly/User.php | User.getName | public function getName()
{
return isset($this->_data[self::PROFILE][self::NAME]) ? $this->_data[self::PROFILE][self::NAME] : null;
} | php | public function getName()
{
return isset($this->_data[self::PROFILE][self::NAME]) ? $this->_data[self::PROFILE][self::NAME] : null;
} | [
"public",
"function",
"getName",
"(",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"_data",
"[",
"self",
"::",
"PROFILE",
"]",
"[",
"self",
"::",
"NAME",
"]",
")",
"?",
"$",
"this",
"->",
"_data",
"[",
"self",
"::",
"PROFILE",
"]",
"[",
"... | Retrieves the user's name.
@return string | [
"Retrieves",
"the",
"user",
"s",
"name",
"."
] | a9102d9d6f70e8b0f6be93153f70849f46489ee1 | https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Html/Qwerly/User.php#L42-L45 |
205,007 | schpill/thin | src/Html/Qwerly/User.php | User.getLocation | public function getLocation()
{
return isset($this->_data[self::PROFILE][self::LOCATION]) ? $this->_data[self::PROFILE][self::LOCATION] : null;
} | php | public function getLocation()
{
return isset($this->_data[self::PROFILE][self::LOCATION]) ? $this->_data[self::PROFILE][self::LOCATION] : null;
} | [
"public",
"function",
"getLocation",
"(",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"_data",
"[",
"self",
"::",
"PROFILE",
"]",
"[",
"self",
"::",
"LOCATION",
"]",
")",
"?",
"$",
"this",
"->",
"_data",
"[",
"self",
"::",
"PROFILE",
"]",
... | Retrieves the user's location.
@return string | [
"Retrieves",
"the",
"user",
"s",
"location",
"."
] | a9102d9d6f70e8b0f6be93153f70849f46489ee1 | https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Html/Qwerly/User.php#L53-L56 |
205,008 | schpill/thin | src/Html/Qwerly/User.php | User.getTwitter | public function getTwitter()
{
return isset($this->_data[self::PROFILE][self::TWITTER_USERNAME]) ? $this->_data[self::PROFILE][self::TWITTER_USERNAME] : null;
} | php | public function getTwitter()
{
return isset($this->_data[self::PROFILE][self::TWITTER_USERNAME]) ? $this->_data[self::PROFILE][self::TWITTER_USERNAME] : null;
} | [
"public",
"function",
"getTwitter",
"(",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"_data",
"[",
"self",
"::",
"PROFILE",
"]",
"[",
"self",
"::",
"TWITTER_USERNAME",
"]",
")",
"?",
"$",
"this",
"->",
"_data",
"[",
"self",
"::",
"PROFILE",
... | Retrieves the user's twitter username.
@return string | [
"Retrieves",
"the",
"user",
"s",
"twitter",
"username",
"."
] | a9102d9d6f70e8b0f6be93153f70849f46489ee1 | https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Html/Qwerly/User.php#L63-L66 |
205,009 | schpill/thin | src/Html/Qwerly/User.php | User.getWebsite | public function getWebsite()
{
return isset($this->_data[self::PROFILE][self::WEBSITE]) ? $this->_data[self::PROFILE][self::WEBSITE] : null;
} | php | public function getWebsite()
{
return isset($this->_data[self::PROFILE][self::WEBSITE]) ? $this->_data[self::PROFILE][self::WEBSITE] : null;
} | [
"public",
"function",
"getWebsite",
"(",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"_data",
"[",
"self",
"::",
"PROFILE",
"]",
"[",
"self",
"::",
"WEBSITE",
"]",
")",
"?",
"$",
"this",
"->",
"_data",
"[",
"self",
"::",
"PROFILE",
"]",
"[... | Retrievs the user's website.
@return string | [
"Retrievs",
"the",
"user",
"s",
"website",
"."
] | a9102d9d6f70e8b0f6be93153f70849f46489ee1 | https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Html/Qwerly/User.php#L73-L76 |
205,010 | schpill/thin | src/Html/Qwerly/User.php | User.getServices | public function getServices()
{
return isset($this->_data[self::PROFILE][self::SERVICES]) ? $this->_data[self::PROFILE][self::SERVICES] : null;
} | php | public function getServices()
{
return isset($this->_data[self::PROFILE][self::SERVICES]) ? $this->_data[self::PROFILE][self::SERVICES] : null;
} | [
"public",
"function",
"getServices",
"(",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"_data",
"[",
"self",
"::",
"PROFILE",
"]",
"[",
"self",
"::",
"SERVICES",
"]",
")",
"?",
"$",
"this",
"->",
"_data",
"[",
"self",
"::",
"PROFILE",
"]",
... | Retrieves the user's services.
@return array | [
"Retrieves",
"the",
"user",
"s",
"services",
"."
] | a9102d9d6f70e8b0f6be93153f70849f46489ee1 | https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Html/Qwerly/User.php#L83-L86 |
205,011 | schpill/thin | src/Html/Qwerly/User.php | User.getQwerly | public function getQwerly()
{
return isset($this->_data[self::PROFILE][self::QWERLY]) ? $this->_data[self::PROFILE][self::QWERLY] : null;
} | php | public function getQwerly()
{
return isset($this->_data[self::PROFILE][self::QWERLY]) ? $this->_data[self::PROFILE][self::QWERLY] : null;
} | [
"public",
"function",
"getQwerly",
"(",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"_data",
"[",
"self",
"::",
"PROFILE",
"]",
"[",
"self",
"::",
"QWERLY",
"]",
")",
"?",
"$",
"this",
"->",
"_data",
"[",
"self",
"::",
"PROFILE",
"]",
"[",... | Retrieves the user's qwerly username.
@return string | [
"Retrieves",
"the",
"user",
"s",
"qwerly",
"username",
"."
] | a9102d9d6f70e8b0f6be93153f70849f46489ee1 | https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Html/Qwerly/User.php#L93-L96 |
205,012 | schpill/thin | src/Html/Qwerly/User.php | User.getFacebook | public function getFacebook()
{
return isset($this->_data[self::PROFILE][self::FACEBOOK_ID]) ? $this->_data[self::PROFILE][self::FACEBOOK_ID] : null;
} | php | public function getFacebook()
{
return isset($this->_data[self::PROFILE][self::FACEBOOK_ID]) ? $this->_data[self::PROFILE][self::FACEBOOK_ID] : null;
} | [
"public",
"function",
"getFacebook",
"(",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"_data",
"[",
"self",
"::",
"PROFILE",
"]",
"[",
"self",
"::",
"FACEBOOK_ID",
"]",
")",
"?",
"$",
"this",
"->",
"_data",
"[",
"self",
"::",
"PROFILE",
"]",... | Retrieves the user's facebook id.
@return int | [
"Retrieves",
"the",
"user",
"s",
"facebook",
"id",
"."
] | a9102d9d6f70e8b0f6be93153f70849f46489ee1 | https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Html/Qwerly/User.php#L103-L106 |
205,013 | oliwierptak/Everon1 | src/Everon/Helper/AlphaId.php | AlphaId.alphaId | function alphaId($in, $to_num = false, $pad_up = false, $pass_key = null)
{
$out = '';
$index = 'abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';
$base = strlen($index);
if ($pass_key !== null) {
// Although this function's purpose is to just make th... | php | function alphaId($in, $to_num = false, $pad_up = false, $pass_key = null)
{
$out = '';
$index = 'abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';
$base = strlen($index);
if ($pass_key !== null) {
// Although this function's purpose is to just make th... | [
"function",
"alphaId",
"(",
"$",
"in",
",",
"$",
"to_num",
"=",
"false",
",",
"$",
"pad_up",
"=",
"false",
",",
"$",
"pass_key",
"=",
"null",
")",
"{",
"$",
"out",
"=",
"''",
";",
"$",
"index",
"=",
"'abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRS... | Translates a number to a short alhanumeric version
Translated any number up to 9007199254740992
to a shorter version in letters e.g.:
9007199254740989 --> PpQXn7COf
specifiying the second argument true, it will
translate back e.g.:
PpQXn7COf --> 9007199254740989
this function is based on any2dec && dec2any by
fragme... | [
"Translates",
"a",
"number",
"to",
"a",
"short",
"alhanumeric",
"version"
] | ac93793d1fa517a8394db5f00062f1925dc218a3 | https://github.com/oliwierptak/Everon1/blob/ac93793d1fa517a8394db5f00062f1925dc218a3/src/Everon/Helper/AlphaId.php#L107-L170 |
205,014 | RadialCorp/magento-core | src/app/code/community/Radial/Core/Model/Cancel.php | EbayEnterprise_Order_Model_Cancel._buildRequest | protected function _buildRequest()
{
$this->_request = $this->_factory
->getNewCancelBuildRequest($this->_api, $this->_order)
->build();
return $this;
} | php | protected function _buildRequest()
{
$this->_request = $this->_factory
->getNewCancelBuildRequest($this->_api, $this->_order)
->build();
return $this;
} | [
"protected",
"function",
"_buildRequest",
"(",
")",
"{",
"$",
"this",
"->",
"_request",
"=",
"$",
"this",
"->",
"_factory",
"->",
"getNewCancelBuildRequest",
"(",
"$",
"this",
"->",
"_api",
",",
"$",
"this",
"->",
"_order",
")",
"->",
"build",
"(",
")",
... | Build order cancel payload.
@return self | [
"Build",
"order",
"cancel",
"payload",
"."
] | 9bb5f218d9caf79eab8598f4f8447037a0cc6355 | https://github.com/RadialCorp/magento-core/blob/9bb5f218d9caf79eab8598f4f8447037a0cc6355/src/app/code/community/Radial/Core/Model/Cancel.php#L105-L111 |
205,015 | RadialCorp/magento-core | src/app/code/community/Radial/Core/Model/Cancel.php | EbayEnterprise_Order_Model_Cancel._sendRequest | protected function _sendRequest()
{
$this->_response = $this->_factory
->getNewCancelSendRequest($this->_api, $this->_request)
->send();
return $this;
} | php | protected function _sendRequest()
{
$this->_response = $this->_factory
->getNewCancelSendRequest($this->_api, $this->_request)
->send();
return $this;
} | [
"protected",
"function",
"_sendRequest",
"(",
")",
"{",
"$",
"this",
"->",
"_response",
"=",
"$",
"this",
"->",
"_factory",
"->",
"getNewCancelSendRequest",
"(",
"$",
"this",
"->",
"_api",
",",
"$",
"this",
"->",
"_request",
")",
"->",
"send",
"(",
")",
... | Send order cancel payload.
@return self | [
"Send",
"order",
"cancel",
"payload",
"."
] | 9bb5f218d9caf79eab8598f4f8447037a0cc6355 | https://github.com/RadialCorp/magento-core/blob/9bb5f218d9caf79eab8598f4f8447037a0cc6355/src/app/code/community/Radial/Core/Model/Cancel.php#L118-L124 |
205,016 | RadialCorp/magento-core | src/app/code/community/Radial/Core/Model/Cancel.php | EbayEnterprise_Order_Model_Cancel._processResponse | protected function _processResponse()
{
$this->_factory
->getNewCancelProcessResponse($this->_response, $this->_order)
->process();
return $this;
} | php | protected function _processResponse()
{
$this->_factory
->getNewCancelProcessResponse($this->_response, $this->_order)
->process();
return $this;
} | [
"protected",
"function",
"_processResponse",
"(",
")",
"{",
"$",
"this",
"->",
"_factory",
"->",
"getNewCancelProcessResponse",
"(",
"$",
"this",
"->",
"_response",
",",
"$",
"this",
"->",
"_order",
")",
"->",
"process",
"(",
")",
";",
"return",
"$",
"this... | Process order cancel response.
@return self | [
"Process",
"order",
"cancel",
"response",
"."
] | 9bb5f218d9caf79eab8598f4f8447037a0cc6355 | https://github.com/RadialCorp/magento-core/blob/9bb5f218d9caf79eab8598f4f8447037a0cc6355/src/app/code/community/Radial/Core/Model/Cancel.php#L131-L137 |
205,017 | chippyash/Currency | src/Chippyash/Currency/Factory.php | Factory.create | public static function create($code, $value = 0)
{
$cd = strtoupper($code);
list($symbol, $precision, $name) = self::getDefinition($cd);
$crcy = new Currency($value, $cd, $symbol, $precision, $name);
$crcy->setLocale(self::getLocale());
return $crcy;
} | php | public static function create($code, $value = 0)
{
$cd = strtoupper($code);
list($symbol, $precision, $name) = self::getDefinition($cd);
$crcy = new Currency($value, $cd, $symbol, $precision, $name);
$crcy->setLocale(self::getLocale());
return $crcy;
} | [
"public",
"static",
"function",
"create",
"(",
"$",
"code",
",",
"$",
"value",
"=",
"0",
")",
"{",
"$",
"cd",
"=",
"strtoupper",
"(",
"$",
"code",
")",
";",
"list",
"(",
"$",
"symbol",
",",
"$",
"precision",
",",
"$",
"name",
")",
"=",
"self",
... | Create a currency
@param string $code Currency 3 letter ISO4217 code
@param int $value initial value for currency
@return Currency
@throws \ErrorException | [
"Create",
"a",
"currency"
] | d2c6a3da2d1443818b98206ec2cb8f34c2a3be84 | https://github.com/chippyash/Currency/blob/d2c6a3da2d1443818b98206ec2cb8f34c2a3be84/src/Chippyash/Currency/Factory.php#L41-L49 |
205,018 | chippyash/Currency | src/Chippyash/Currency/Factory.php | Factory.getDefinition | protected static function getDefinition($code)
{
$currencies = self::getDefinitions();
$nodes = $currencies->xpath("//currency[@code='{$code}']");
if (empty($nodes)) {
throw new \InvalidArgumentException("Unknown currency: {$code}");
}
$cNode = $nodes[0];
... | php | protected static function getDefinition($code)
{
$currencies = self::getDefinitions();
$nodes = $currencies->xpath("//currency[@code='{$code}']");
if (empty($nodes)) {
throw new \InvalidArgumentException("Unknown currency: {$code}");
}
$cNode = $nodes[0];
... | [
"protected",
"static",
"function",
"getDefinition",
"(",
"$",
"code",
")",
"{",
"$",
"currencies",
"=",
"self",
"::",
"getDefinitions",
"(",
")",
";",
"$",
"nodes",
"=",
"$",
"currencies",
"->",
"xpath",
"(",
"\"//currency[@code='{$code}']\"",
")",
";",
"if"... | Get a currency definition
@param string $code ISO4217 currency code
@return array ['symbol','precision', 'name']
@throws \ErrorException | [
"Get",
"a",
"currency",
"definition"
] | d2c6a3da2d1443818b98206ec2cb8f34c2a3be84 | https://github.com/chippyash/Currency/blob/d2c6a3da2d1443818b98206ec2cb8f34c2a3be84/src/Chippyash/Currency/Factory.php#L84-L101 |
205,019 | chippyash/Currency | src/Chippyash/Currency/Factory.php | Factory.getDefinitions | protected static function getDefinitions()
{
if (empty(self::$definitions)) {
self::$definitions = \simplexml_load_file(__DIR__ . '/currencies.xml');
}
return self::$definitions;
} | php | protected static function getDefinitions()
{
if (empty(self::$definitions)) {
self::$definitions = \simplexml_load_file(__DIR__ . '/currencies.xml');
}
return self::$definitions;
} | [
"protected",
"static",
"function",
"getDefinitions",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"self",
"::",
"$",
"definitions",
")",
")",
"{",
"self",
"::",
"$",
"definitions",
"=",
"\\",
"simplexml_load_file",
"(",
"__DIR__",
".",
"'/currencies.xml'",
")",
... | Load currency definitions
@return \SimpleXMLElement | [
"Load",
"currency",
"definitions"
] | d2c6a3da2d1443818b98206ec2cb8f34c2a3be84 | https://github.com/chippyash/Currency/blob/d2c6a3da2d1443818b98206ec2cb8f34c2a3be84/src/Chippyash/Currency/Factory.php#L108-L115 |
205,020 | chippyash/Currency | src/Chippyash/Currency/Factory.php | Factory.createSymbol | protected static function createSymbol(\SimpleXMLElement $sNode, $code)
{
switch((string) $sNode['type']) {
case 'UCS':
$symbol = (string) $sNode['UTF-8'];
break;
case null: //no symbol - use code
default:
$symbol = $code;
... | php | protected static function createSymbol(\SimpleXMLElement $sNode, $code)
{
switch((string) $sNode['type']) {
case 'UCS':
$symbol = (string) $sNode['UTF-8'];
break;
case null: //no symbol - use code
default:
$symbol = $code;
... | [
"protected",
"static",
"function",
"createSymbol",
"(",
"\\",
"SimpleXMLElement",
"$",
"sNode",
",",
"$",
"code",
")",
"{",
"switch",
"(",
"(",
"string",
")",
"$",
"sNode",
"[",
"'type'",
"]",
")",
"{",
"case",
"'UCS'",
":",
"$",
"symbol",
"=",
"(",
... | Create currency symbol from the symbol node
@param \SimpleXMLElement $sNode
@param string $code currency code
@return string | [
"Create",
"currency",
"symbol",
"from",
"the",
"symbol",
"node"
] | d2c6a3da2d1443818b98206ec2cb8f34c2a3be84 | https://github.com/chippyash/Currency/blob/d2c6a3da2d1443818b98206ec2cb8f34c2a3be84/src/Chippyash/Currency/Factory.php#L125-L138 |
205,021 | chippyash/Currency | src/Chippyash/Currency/Factory.php | Factory.createName | protected static function createName(\SimpleXMLElement $currency)
{
$locale = self::getLocale();
//first - see if we have an exact locale match
$nodes = $currency->xpath("name[@lang='{$locale}']");
if (count($nodes) > 0) {
return (string) $nodes[0];
}
//n... | php | protected static function createName(\SimpleXMLElement $currency)
{
$locale = self::getLocale();
//first - see if we have an exact locale match
$nodes = $currency->xpath("name[@lang='{$locale}']");
if (count($nodes) > 0) {
return (string) $nodes[0];
}
//n... | [
"protected",
"static",
"function",
"createName",
"(",
"\\",
"SimpleXMLElement",
"$",
"currency",
")",
"{",
"$",
"locale",
"=",
"self",
"::",
"getLocale",
"(",
")",
";",
"//first - see if we have an exact locale match",
"$",
"nodes",
"=",
"$",
"currency",
"->",
"... | Find closest matching name for a currency based on currently set locale.
Default to 'en' entry if none more suitable found
@param \SimpleXMLElement $currency
@return string | [
"Find",
"closest",
"matching",
"name",
"for",
"a",
"currency",
"based",
"on",
"currently",
"set",
"locale",
".",
"Default",
"to",
"en",
"entry",
"if",
"none",
"more",
"suitable",
"found"
] | d2c6a3da2d1443818b98206ec2cb8f34c2a3be84 | https://github.com/chippyash/Currency/blob/d2c6a3da2d1443818b98206ec2cb8f34c2a3be84/src/Chippyash/Currency/Factory.php#L148-L167 |
205,022 | gplcart/file_manager | handlers/commands/Command.php | Command.getTotal | protected function getTotal($directory, array $options = array())
{
$options['count'] = true;
return (int) $this->scanner->scan($directory, $options);
} | php | protected function getTotal($directory, array $options = array())
{
$options['count'] = true;
return (int) $this->scanner->scan($directory, $options);
} | [
"protected",
"function",
"getTotal",
"(",
"$",
"directory",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"options",
"[",
"'count'",
"]",
"=",
"true",
";",
"return",
"(",
"int",
")",
"$",
"this",
"->",
"scanner",
"->",
"scan",
... | Returns a total number of scanned files
@param string $directory
@param array $options
@return integer | [
"Returns",
"a",
"total",
"number",
"of",
"scanned",
"files"
] | 45424e93eafea75d31af6410ac9cf110f08e500a | https://github.com/gplcart/file_manager/blob/45424e93eafea75d31af6410ac9cf110f08e500a/handlers/commands/Command.php#L59-L63 |
205,023 | gplcart/file_manager | handlers/commands/Command.php | Command.getRelativePath | protected function getRelativePath($path = null)
{
if (!isset($path)) {
$path = $this->scanner->getInitialPath(true);
}
return gplcart_path_normalize(gplcart_path_relative($path));
} | php | protected function getRelativePath($path = null)
{
if (!isset($path)) {
$path = $this->scanner->getInitialPath(true);
}
return gplcart_path_normalize(gplcart_path_relative($path));
} | [
"protected",
"function",
"getRelativePath",
"(",
"$",
"path",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"path",
")",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"scanner",
"->",
"getInitialPath",
"(",
"true",
")",
";",
"}",
"retu... | Returns a relative file path or initial directory
@param null|string $path
@return string | [
"Returns",
"a",
"relative",
"file",
"path",
"or",
"initial",
"directory"
] | 45424e93eafea75d31af6410ac9cf110f08e500a | https://github.com/gplcart/file_manager/blob/45424e93eafea75d31af6410ac9cf110f08e500a/handlers/commands/Command.php#L91-L98 |
205,024 | gplcart/file_manager | handlers/commands/Command.php | Command.move | protected function move($src, $dest, &$errors = 0, &$success = 0)
{
$this->copy($src, $dest, $errors, $success);
if (empty($errors)) {
gplcart_file_delete_recursive($src, $errors);
}
return empty($errors);
} | php | protected function move($src, $dest, &$errors = 0, &$success = 0)
{
$this->copy($src, $dest, $errors, $success);
if (empty($errors)) {
gplcart_file_delete_recursive($src, $errors);
}
return empty($errors);
} | [
"protected",
"function",
"move",
"(",
"$",
"src",
",",
"$",
"dest",
",",
"&",
"$",
"errors",
"=",
"0",
",",
"&",
"$",
"success",
"=",
"0",
")",
"{",
"$",
"this",
"->",
"copy",
"(",
"$",
"src",
",",
"$",
"dest",
",",
"$",
"errors",
",",
"$",
... | Moves a file to a new destination
@param string $src
@param string $dest
@param int $errors
@param int $success
@return bool | [
"Moves",
"a",
"file",
"to",
"a",
"new",
"destination"
] | 45424e93eafea75d31af6410ac9cf110f08e500a | https://github.com/gplcart/file_manager/blob/45424e93eafea75d31af6410ac9cf110f08e500a/handlers/commands/Command.php#L118-L127 |
205,025 | gplcart/file_manager | handlers/commands/Command.php | Command.isInitialPath | protected function isInitialPath($file)
{
$current_path = gplcart_path_normalize($file->getRealPath());
$initial_path = gplcart_path_normalize($this->scanner->getInitialPath(true));
return $current_path === $initial_path;
} | php | protected function isInitialPath($file)
{
$current_path = gplcart_path_normalize($file->getRealPath());
$initial_path = gplcart_path_normalize($this->scanner->getInitialPath(true));
return $current_path === $initial_path;
} | [
"protected",
"function",
"isInitialPath",
"(",
"$",
"file",
")",
"{",
"$",
"current_path",
"=",
"gplcart_path_normalize",
"(",
"$",
"file",
"->",
"getRealPath",
"(",
")",
")",
";",
"$",
"initial_path",
"=",
"gplcart_path_normalize",
"(",
"$",
"this",
"->",
"... | Whether the current file is the initial file manager path
@param \SplFileInfo $file
@return bool | [
"Whether",
"the",
"current",
"file",
"is",
"the",
"initial",
"file",
"manager",
"path"
] | 45424e93eafea75d31af6410ac9cf110f08e500a | https://github.com/gplcart/file_manager/blob/45424e93eafea75d31af6410ac9cf110f08e500a/handlers/commands/Command.php#L184-L190 |
205,026 | heliopsis/ezforms-bundle | Heliopsis/eZFormsBundle/FormHandler/MultiplexerHandler.php | MultiplexerHandler.setLocation | public function setLocation( Location $location )
{
foreach ( $this->handlers as $handler )
{
if ( $handler instanceof LocationAwareHandlerInterface )
{
$handler->setLocation( $location );
}
}
} | php | public function setLocation( Location $location )
{
foreach ( $this->handlers as $handler )
{
if ( $handler instanceof LocationAwareHandlerInterface )
{
$handler->setLocation( $location );
}
}
} | [
"public",
"function",
"setLocation",
"(",
"Location",
"$",
"location",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"handlers",
"as",
"$",
"handler",
")",
"{",
"if",
"(",
"$",
"handler",
"instanceof",
"LocationAwareHandlerInterface",
")",
"{",
"$",
"handler"... | Passes location to location aware handlers
@param \eZ\Publish\API\Repository\Values\Content\Location $location | [
"Passes",
"location",
"to",
"location",
"aware",
"handlers"
] | ed87feeb76fcdcd4a4e355d4bc60b83077ba90b4 | https://github.com/heliopsis/ezforms-bundle/blob/ed87feeb76fcdcd4a4e355d4bc60b83077ba90b4/Heliopsis/eZFormsBundle/FormHandler/MultiplexerHandler.php#L62-L71 |
205,027 | heliopsis/ezforms-bundle | Heliopsis/eZFormsBundle/FormHandler/MultiplexerHandler.php | MultiplexerHandler.setContent | public function setContent( Content $content )
{
foreach ( $this->handlers as $handler )
{
if ( $handler instanceof ContentAwareHandlerInterface )
{
$handler->setContent( $content );
}
}
} | php | public function setContent( Content $content )
{
foreach ( $this->handlers as $handler )
{
if ( $handler instanceof ContentAwareHandlerInterface )
{
$handler->setContent( $content );
}
}
} | [
"public",
"function",
"setContent",
"(",
"Content",
"$",
"content",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"handlers",
"as",
"$",
"handler",
")",
"{",
"if",
"(",
"$",
"handler",
"instanceof",
"ContentAwareHandlerInterface",
")",
"{",
"$",
"handler",
... | Passes content to content aware handlers
@param \eZ\Publish\API\Repository\Values\Content\Content $content | [
"Passes",
"content",
"to",
"content",
"aware",
"handlers"
] | ed87feeb76fcdcd4a4e355d4bc60b83077ba90b4 | https://github.com/heliopsis/ezforms-bundle/blob/ed87feeb76fcdcd4a4e355d4bc60b83077ba90b4/Heliopsis/eZFormsBundle/FormHandler/MultiplexerHandler.php#L77-L86 |
205,028 | valu-digital/valuso | src/ValuSo/Controller/ServiceController.php | ServiceController.httpAction | public function httpAction()
{
$status = self::STATUS_SUCCESS;
$responses = array();
$exception = null;
$data = null;
$debug = $this->getRouteParam('debug', false);
try {
$service = $this->fetchService();
$operation = $service ? $this->f... | php | public function httpAction()
{
$status = self::STATUS_SUCCESS;
$responses = array();
$exception = null;
$data = null;
$debug = $this->getRouteParam('debug', false);
try {
$service = $this->fetchService();
$operation = $service ? $this->f... | [
"public",
"function",
"httpAction",
"(",
")",
"{",
"$",
"status",
"=",
"self",
"::",
"STATUS_SUCCESS",
";",
"$",
"responses",
"=",
"array",
"(",
")",
";",
"$",
"exception",
"=",
"null",
";",
"$",
"data",
"=",
"null",
";",
"$",
"debug",
"=",
"$",
"t... | Performs service operation matched by HTTP router
@throws \Exception
@return Response | [
"Performs",
"service",
"operation",
"matched",
"by",
"HTTP",
"router"
] | c96bed0f6bd21551822334fe6cfe913a7436dd17 | https://github.com/valu-digital/valuso/blob/c96bed0f6bd21551822334fe6cfe913a7436dd17/src/ValuSo/Controller/ServiceController.php#L184-L250 |
205,029 | valu-digital/valuso | src/ValuSo/Controller/ServiceController.php | ServiceController.consoleAction | public function consoleAction()
{
$request = $this->getRequest();
$service = $this->fetchService();
$operation = $this->fetchOperation();
$query = $this->fetchConsoleQuery();
if (!$request instanceof ConsoleRequest) {
throw new \RuntimeException('You can only use this ac... | php | public function consoleAction()
{
$request = $this->getRequest();
$service = $this->fetchService();
$operation = $this->fetchOperation();
$query = $this->fetchConsoleQuery();
if (!$request instanceof ConsoleRequest) {
throw new \RuntimeException('You can only use this ac... | [
"public",
"function",
"consoleAction",
"(",
")",
"{",
"$",
"request",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
";",
"$",
"service",
"=",
"$",
"this",
"->",
"fetchService",
"(",
")",
";",
"$",
"operation",
"=",
"$",
"this",
"->",
"fetchOperation"... | Performs service operation routed by console router | [
"Performs",
"service",
"operation",
"routed",
"by",
"console",
"router"
] | c96bed0f6bd21551822334fe6cfe913a7436dd17 | https://github.com/valu-digital/valuso/blob/c96bed0f6bd21551822334fe6cfe913a7436dd17/src/ValuSo/Controller/ServiceController.php#L255-L283 |
205,030 | valu-digital/valuso | src/ValuSo/Controller/ServiceController.php | ServiceController.prepareHttpResponse | protected function prepareHttpResponse($data, $status, $exception = null)
{
$error = $this->getRequest()->getHeader(
self::HEADER_ERRORS,
self::HEADER_ERRORS_DEFAULT);
$forceHtmlContentType = $this->getRequest()->getHeader(
self::HEADER_FORCE_CONTENT_HTML,
... | php | protected function prepareHttpResponse($data, $status, $exception = null)
{
$error = $this->getRequest()->getHeader(
self::HEADER_ERRORS,
self::HEADER_ERRORS_DEFAULT);
$forceHtmlContentType = $this->getRequest()->getHeader(
self::HEADER_FORCE_CONTENT_HTML,
... | [
"protected",
"function",
"prepareHttpResponse",
"(",
"$",
"data",
",",
"$",
"status",
",",
"$",
"exception",
"=",
"null",
")",
"{",
"$",
"error",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
"->",
"getHeader",
"(",
"self",
"::",
"HEADER_ERRORS",
",",
... | Prepares HTTP response
@param mixed $data
@param int $status
@param \Exception|null $exception
@return Response | [
"Prepares",
"HTTP",
"response"
] | c96bed0f6bd21551822334fe6cfe913a7436dd17 | https://github.com/valu-digital/valuso/blob/c96bed0f6bd21551822334fe6cfe913a7436dd17/src/ValuSo/Controller/ServiceController.php#L312-L427 |
205,031 | valu-digital/valuso | src/ValuSo/Controller/ServiceController.php | ServiceController.prepareConsoleResponse | protected function prepareConsoleResponse($data, \Exception $exception = null, $verbose = false, $silent = false)
{
$response = new ConsoleResponse();
try {
if (is_array($data) || is_object($data)) {
$json = JsonEncoder::encode($data, true);
$data = Json::prettyPrint(... | php | protected function prepareConsoleResponse($data, \Exception $exception = null, $verbose = false, $silent = false)
{
$response = new ConsoleResponse();
try {
if (is_array($data) || is_object($data)) {
$json = JsonEncoder::encode($data, true);
$data = Json::prettyPrint(... | [
"protected",
"function",
"prepareConsoleResponse",
"(",
"$",
"data",
",",
"\\",
"Exception",
"$",
"exception",
"=",
"null",
",",
"$",
"verbose",
"=",
"false",
",",
"$",
"silent",
"=",
"false",
")",
"{",
"$",
"response",
"=",
"new",
"ConsoleResponse",
"(",
... | Prepares console response
@param mixed $data
@param \Exception|null $exception
@param boolean $verbose
@param boolean $silent
@return ConsoleResponse | [
"Prepares",
"console",
"response"
] | c96bed0f6bd21551822334fe6cfe913a7436dd17 | https://github.com/valu-digital/valuso/blob/c96bed0f6bd21551822334fe6cfe913a7436dd17/src/ValuSo/Controller/ServiceController.php#L438-L474 |
205,032 | valu-digital/valuso | src/ValuSo/Controller/ServiceController.php | ServiceController.fetchService | protected function fetchService()
{
$service = $this->getRouteParam('service');
$service = $this->parseCanonicalName($service, true);
if (preg_match($this->servicePattern, $service)) {
return $service;
} else {
return false;
}
} | php | protected function fetchService()
{
$service = $this->getRouteParam('service');
$service = $this->parseCanonicalName($service, true);
if (preg_match($this->servicePattern, $service)) {
return $service;
} else {
return false;
}
} | [
"protected",
"function",
"fetchService",
"(",
")",
"{",
"$",
"service",
"=",
"$",
"this",
"->",
"getRouteParam",
"(",
"'service'",
")",
";",
"$",
"service",
"=",
"$",
"this",
"->",
"parseCanonicalName",
"(",
"$",
"service",
",",
"true",
")",
";",
"if",
... | Parse service name from request
@return string|boolean | [
"Parse",
"service",
"name",
"from",
"request"
] | c96bed0f6bd21551822334fe6cfe913a7436dd17 | https://github.com/valu-digital/valuso/blob/c96bed0f6bd21551822334fe6cfe913a7436dd17/src/ValuSo/Controller/ServiceController.php#L481-L491 |
205,033 | valu-digital/valuso | src/ValuSo/Controller/ServiceController.php | ServiceController.fetchOperation | protected function fetchOperation()
{
$operation = $this->getRouteParam('operation');
if ($operation !== null) {
$operation = $this->parseCanonicalName($operation);
if (preg_match($this->operationPattern, $operation)) {
return $operation;
... | php | protected function fetchOperation()
{
$operation = $this->getRouteParam('operation');
if ($operation !== null) {
$operation = $this->parseCanonicalName($operation);
if (preg_match($this->operationPattern, $operation)) {
return $operation;
... | [
"protected",
"function",
"fetchOperation",
"(",
")",
"{",
"$",
"operation",
"=",
"$",
"this",
"->",
"getRouteParam",
"(",
"'operation'",
")",
";",
"if",
"(",
"$",
"operation",
"!==",
"null",
")",
"{",
"$",
"operation",
"=",
"$",
"this",
"->",
"parseCanon... | Parse operation name from request
@return string|boolean | [
"Parse",
"operation",
"name",
"from",
"request"
] | c96bed0f6bd21551822334fe6cfe913a7436dd17 | https://github.com/valu-digital/valuso/blob/c96bed0f6bd21551822334fe6cfe913a7436dd17/src/ValuSo/Controller/ServiceController.php#L498-L521 |
205,034 | valu-digital/valuso | src/ValuSo/Controller/ServiceController.php | ServiceController.fetchParams | protected function fetchParams()
{
$contentType = $this->getRequest()->getHeaders()->get('Content-Type');
if ($contentType) {
$contentTypeParts = explode(';', $contentType->getFieldValue());
$contentType = strtolower(trim($contentTypeParts[0]));
}
if ($contentType === 'a... | php | protected function fetchParams()
{
$contentType = $this->getRequest()->getHeaders()->get('Content-Type');
if ($contentType) {
$contentTypeParts = explode(';', $contentType->getFieldValue());
$contentType = strtolower(trim($contentTypeParts[0]));
}
if ($contentType === 'a... | [
"protected",
"function",
"fetchParams",
"(",
")",
"{",
"$",
"contentType",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
"->",
"getHeaders",
"(",
")",
"->",
"get",
"(",
"'Content-Type'",
")",
";",
"if",
"(",
"$",
"contentType",
")",
"{",
"$",
"conten... | Parse parameters from request
@return array | [
"Parse",
"parameters",
"from",
"request"
] | c96bed0f6bd21551822334fe6cfe913a7436dd17 | https://github.com/valu-digital/valuso/blob/c96bed0f6bd21551822334fe6cfe913a7436dd17/src/ValuSo/Controller/ServiceController.php#L528-L585 |
205,035 | krakphp/cargo | src/Container/AutoWireContainer.php | AutoWireContainer.get | public function get($id, Cargo\Container $container = null) {
if ($this->container->has($id) || !class_exists($id)) {
return $this->container->get($id, $container ?: $this);
}
$this->add($id, null);
return $this->get($id, $container);
} | php | public function get($id, Cargo\Container $container = null) {
if ($this->container->has($id) || !class_exists($id)) {
return $this->container->get($id, $container ?: $this);
}
$this->add($id, null);
return $this->get($id, $container);
} | [
"public",
"function",
"get",
"(",
"$",
"id",
",",
"Cargo",
"\\",
"Container",
"$",
"container",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"container",
"->",
"has",
"(",
"$",
"id",
")",
"||",
"!",
"class_exists",
"(",
"$",
"id",
")",
")... | fetch from container, or if the service is a class name, we'll try to resolve it
automatically | [
"fetch",
"from",
"container",
"or",
"if",
"the",
"service",
"is",
"a",
"class",
"name",
"we",
"ll",
"try",
"to",
"resolve",
"it",
"automatically"
] | ed5ee24dfe4112b33f0fdcf7131d82a2bf96d191 | https://github.com/krakphp/cargo/blob/ed5ee24dfe4112b33f0fdcf7131d82a2bf96d191/src/Container/AutoWireContainer.php#L19-L26 |
205,036 | valu-digital/valuso | src/ValuSo/Broker/ServiceLoader.php | ServiceLoader.setOptions | public function setOptions($options)
{
if (!is_array($options) && !$options instanceof Traversable) {
throw new \InvalidArgumentException(sprintf(
'Expected an array or Traversable; received "%s"',
(is_object($options) ? get_class($options) : gettype($options))
));
}
foreach ($options as $key =>... | php | public function setOptions($options)
{
if (!is_array($options) && !$options instanceof Traversable) {
throw new \InvalidArgumentException(sprintf(
'Expected an array or Traversable; received "%s"',
(is_object($options) ? get_class($options) : gettype($options))
));
}
foreach ($options as $key =>... | [
"public",
"function",
"setOptions",
"(",
"$",
"options",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"options",
")",
"&&",
"!",
"$",
"options",
"instanceof",
"Traversable",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"sprintf",
"("... | Configure service loader
@param array|\Traversable $options
@throws \InvalidArgumentException
@return \ValuSo\Broker\ServiceLoader | [
"Configure",
"service",
"loader"
] | c96bed0f6bd21551822334fe6cfe913a7436dd17 | https://github.com/valu-digital/valuso/blob/c96bed0f6bd21551822334fe6cfe913a7436dd17/src/ValuSo/Broker/ServiceLoader.php#L66-L94 |
205,037 | valu-digital/valuso | src/ValuSo/Broker/ServiceLoader.php | ServiceLoader.getCommandManager | public function getCommandManager()
{
if ($this->commandManager === null) {
$this->commandManager = new CommandManager();
$this->commandManager->setServiceLoader($this);
}
return $this->commandManager;
} | php | public function getCommandManager()
{
if ($this->commandManager === null) {
$this->commandManager = new CommandManager();
$this->commandManager->setServiceLoader($this);
}
return $this->commandManager;
} | [
"public",
"function",
"getCommandManager",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"commandManager",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"commandManager",
"=",
"new",
"CommandManager",
"(",
")",
";",
"$",
"this",
"->",
"commandManager",
"->",
... | Retrieve command manager
@return \ValuSo\Command\CommandManager | [
"Retrieve",
"command",
"manager"
] | c96bed0f6bd21551822334fe6cfe913a7436dd17 | https://github.com/valu-digital/valuso/blob/c96bed0f6bd21551822334fe6cfe913a7436dd17/src/ValuSo/Broker/ServiceLoader.php#L158-L166 |
205,038 | valu-digital/valuso | src/ValuSo/Broker/ServiceLoader.php | ServiceLoader.registerServices | public function registerServices($services)
{
if (!is_array($services) && !($services instanceof Traversable)) {
throw new Exception\InvalidArgumentException(sprintf(
'Expected an array or Traversable; received "%s"',
(is_object($services) ? get_class($services) : ge... | php | public function registerServices($services)
{
if (!is_array($services) && !($services instanceof Traversable)) {
throw new Exception\InvalidArgumentException(sprintf(
'Expected an array or Traversable; received "%s"',
(is_object($services) ? get_class($services) : ge... | [
"public",
"function",
"registerServices",
"(",
"$",
"services",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"services",
")",
"&&",
"!",
"(",
"$",
"services",
"instanceof",
"Traversable",
")",
")",
"{",
"throw",
"new",
"Exception",
"\\",
"InvalidArgumen... | Batch register services
@param array|\Traversable $services
@throws \InvalidArgumentException
@return \ValuSo\Broker\ServiceLoader | [
"Batch",
"register",
"services"
] | c96bed0f6bd21551822334fe6cfe913a7436dd17 | https://github.com/valu-digital/valuso/blob/c96bed0f6bd21551822334fe6cfe913a7436dd17/src/ValuSo/Broker/ServiceLoader.php#L175-L223 |
205,039 | valu-digital/valuso | src/ValuSo/Broker/ServiceLoader.php | ServiceLoader.load | public function load($id, $options = null)
{
$id = $this->normalizeServiceId($id);
if(!isset($this->services[$id])){
throw new Exception\ServiceNotFoundException(
sprintf('Service ID "%s" does not exist', $id)
);
}
if($options == null){
$... | php | public function load($id, $options = null)
{
$id = $this->normalizeServiceId($id);
if(!isset($this->services[$id])){
throw new Exception\ServiceNotFoundException(
sprintf('Service ID "%s" does not exist', $id)
);
}
if($options == null){
$... | [
"public",
"function",
"load",
"(",
"$",
"id",
",",
"$",
"options",
"=",
"null",
")",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"normalizeServiceId",
"(",
"$",
"id",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"services",
"[",
"$",
... | Loads specific service by ID
@param string $name Service name
@param array $options Options to apply when first initialized
@return ServiceInterface | [
"Loads",
"specific",
"service",
"by",
"ID"
] | c96bed0f6bd21551822334fe6cfe913a7436dd17 | https://github.com/valu-digital/valuso/blob/c96bed0f6bd21551822334fe6cfe913a7436dd17/src/ValuSo/Broker/ServiceLoader.php#L329-L344 |
205,040 | valu-digital/valuso | src/ValuSo/Broker/ServiceLoader.php | ServiceLoader.getServiceOptions | public function getServiceOptions($id)
{
$id = $this->normalizeServiceId($id);
if(!isset($this->services[$id])){
throw new Exception\ServiceNotFoundException(
sprintf('Service ID "%s" does not exist', $id)
);
}
return $this->services[$id]['options'];
} | php | public function getServiceOptions($id)
{
$id = $this->normalizeServiceId($id);
if(!isset($this->services[$id])){
throw new Exception\ServiceNotFoundException(
sprintf('Service ID "%s" does not exist', $id)
);
}
return $this->services[$id]['options'];
} | [
"public",
"function",
"getServiceOptions",
"(",
"$",
"id",
")",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"normalizeServiceId",
"(",
"$",
"id",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"services",
"[",
"$",
"id",
"]",
")",
")",
"{... | Retrieve options for service
@param string $id
@return array|null
@throws Exception\ServiceNotFoundException | [
"Retrieve",
"options",
"for",
"service"
] | c96bed0f6bd21551822334fe6cfe913a7436dd17 | https://github.com/valu-digital/valuso/blob/c96bed0f6bd21551822334fe6cfe913a7436dd17/src/ValuSo/Broker/ServiceLoader.php#L363-L374 |
205,041 | valu-digital/valuso | src/ValuSo/Broker/ServiceLoader.php | ServiceLoader.exists | public function exists($name)
{
$name = $this->normalizeServiceName($name);
return $this->getCommandManager()->hasListeners($name);
} | php | public function exists($name)
{
$name = $this->normalizeServiceName($name);
return $this->getCommandManager()->hasListeners($name);
} | [
"public",
"function",
"exists",
"(",
"$",
"name",
")",
"{",
"$",
"name",
"=",
"$",
"this",
"->",
"normalizeServiceName",
"(",
"$",
"name",
")",
";",
"return",
"$",
"this",
"->",
"getCommandManager",
"(",
")",
"->",
"hasListeners",
"(",
"$",
"name",
")"... | Test if a service exists
Any services that are currently disabled, are not
taken into account.
@param string $name | [
"Test",
"if",
"a",
"service",
"exists"
] | c96bed0f6bd21551822334fe6cfe913a7436dd17 | https://github.com/valu-digital/valuso/blob/c96bed0f6bd21551822334fe6cfe913a7436dd17/src/ValuSo/Broker/ServiceLoader.php#L404-L408 |
205,042 | valu-digital/valuso | src/ValuSo/Broker/ServiceLoader.php | ServiceLoader.getServicePluginManager | public function getServicePluginManager()
{
if($this->servicePluginManager === null){
$this->servicePluginManager = new ServicePluginManager();
$that = $this;
$this->servicePluginManager->addInitializer(function ($instance, $serviceManager) use ($that) {
$n... | php | public function getServicePluginManager()
{
if($this->servicePluginManager === null){
$this->servicePluginManager = new ServicePluginManager();
$that = $this;
$this->servicePluginManager->addInitializer(function ($instance, $serviceManager) use ($that) {
$n... | [
"public",
"function",
"getServicePluginManager",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"servicePluginManager",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"servicePluginManager",
"=",
"new",
"ServicePluginManager",
"(",
")",
";",
"$",
"that",
"=",
"$"... | Retrieve service manager
@return \ValuSo\Broker\ServicePluginManager | [
"Retrieve",
"service",
"manager"
] | c96bed0f6bd21551822334fe6cfe913a7436dd17 | https://github.com/valu-digital/valuso/blob/c96bed0f6bd21551822334fe6cfe913a7436dd17/src/ValuSo/Broker/ServiceLoader.php#L415-L438 |
205,043 | raideer/tweech-framework | src/Tweech/Command/CommandRegistry.php | CommandRegistry.register | public function register(CommandInterface $command)
{
/*
* Gets the name of the command
* @var string
*/
$name = $command->getCommand();
/*
* Check if the command isn't already registered
* otherwise throw an exception
*/
if (arr... | php | public function register(CommandInterface $command)
{
/*
* Gets the name of the command
* @var string
*/
$name = $command->getCommand();
/*
* Check if the command isn't already registered
* otherwise throw an exception
*/
if (arr... | [
"public",
"function",
"register",
"(",
"CommandInterface",
"$",
"command",
")",
"{",
"/*\n * Gets the name of the command\n * @var string\n */",
"$",
"name",
"=",
"$",
"command",
"->",
"getCommand",
"(",
")",
";",
"/*\n * Check if the command i... | Registers a command.
@param CommandInterface $command
@return void | [
"Registers",
"a",
"command",
"."
] | 4aeb5fbf78f96baa67cb62ff676867c4fce1f16c | https://github.com/raideer/tweech-framework/blob/4aeb5fbf78f96baa67cb62ff676867c4fce1f16c/src/Tweech/Command/CommandRegistry.php#L28-L48 |
205,044 | raideer/tweech-framework | src/Tweech/Command/CommandRegistry.php | CommandRegistry.getCommandIfExists | public function getCommandIfExists($string)
{
if (starts_with($string, $this->id)) {
foreach ($this->commands as $commandName => $command) {
if (starts_with($string, $this->id.$commandName)) {
return $command;
}
}
}
} | php | public function getCommandIfExists($string)
{
if (starts_with($string, $this->id)) {
foreach ($this->commands as $commandName => $command) {
if (starts_with($string, $this->id.$commandName)) {
return $command;
}
}
}
} | [
"public",
"function",
"getCommandIfExists",
"(",
"$",
"string",
")",
"{",
"if",
"(",
"starts_with",
"(",
"$",
"string",
",",
"$",
"this",
"->",
"id",
")",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"commands",
"as",
"$",
"commandName",
"=>",
"$",
"... | Check if the given string contains a command
if so, return the registered command.
@param string $string Received Message
@return Command Returns the command or null | [
"Check",
"if",
"the",
"given",
"string",
"contains",
"a",
"command",
"if",
"so",
"return",
"the",
"registered",
"command",
"."
] | 4aeb5fbf78f96baa67cb62ff676867c4fce1f16c | https://github.com/raideer/tweech-framework/blob/4aeb5fbf78f96baa67cb62ff676867c4fce1f16c/src/Tweech/Command/CommandRegistry.php#L68-L77 |
205,045 | jtallant/skimpy-engine | src/Database/Populator.php | Populator.rebuildDatabase | protected function rebuildDatabase()
{
# 2. Drop the existing database schema
$this->schemaTool->dropDatabase();
# 3. Create the new database schema based on (1)
$entityMeta = $this->em->getMetadataFactory()->getAllMetadata();
$this->schemaTool->updateSchema($entityMeta);
... | php | protected function rebuildDatabase()
{
# 2. Drop the existing database schema
$this->schemaTool->dropDatabase();
# 3. Create the new database schema based on (1)
$entityMeta = $this->em->getMetadataFactory()->getAllMetadata();
$this->schemaTool->updateSchema($entityMeta);
... | [
"protected",
"function",
"rebuildDatabase",
"(",
")",
"{",
"# 2. Drop the existing database schema",
"$",
"this",
"->",
"schemaTool",
"->",
"dropDatabase",
"(",
")",
";",
"# 3. Create the new database schema based on (1)",
"$",
"entityMeta",
"=",
"$",
"this",
"->",
"em"... | Builds the DB Schema
@return void | [
"Builds",
"the",
"DB",
"Schema"
] | 2fce5bc16f8745e54fd66a1c291fcea47fc1b4b2 | https://github.com/jtallant/skimpy-engine/blob/2fce5bc16f8745e54fd66a1c291fcea47fc1b4b2/src/Database/Populator.php#L62-L70 |
205,046 | widoz/template-loader | src/Loader.php | Loader.locateFile | private function locateFile()
{
// Try to retrieve the theme file path from child or parent for first.
// Fallback to Plugin templates path.
$filePath = locate_template($this->templatesPath, false, false);
// Looking for the file within the plugin if allowed.
if (! $filePath... | php | private function locateFile()
{
// Try to retrieve the theme file path from child or parent for first.
// Fallback to Plugin templates path.
$filePath = locate_template($this->templatesPath, false, false);
// Looking for the file within the plugin if allowed.
if (! $filePath... | [
"private",
"function",
"locateFile",
"(",
")",
"{",
"// Try to retrieve the theme file path from child or parent for first.",
"// Fallback to Plugin templates path.",
"$",
"filePath",
"=",
"locate_template",
"(",
"$",
"this",
"->",
"templatesPath",
",",
"false",
",",
"false",... | Locate template file
Locate the file path for the view, hierarchy try to find the file within the child, parent
and last within the plugin.
@uses locate_template() To locate the view file within the theme (child or parent).
@since 2.1.0
@return string The found file path. Empty string if not found. | [
"Locate",
"template",
"file"
] | 6fa0f74047505fe7f2f37c76b61f4e2058e22868 | https://github.com/widoz/template-loader/blob/6fa0f74047505fe7f2f37c76b61f4e2058e22868/src/Loader.php#L222-L234 |
205,047 | mojopollo/laravel-helpers | src/Mojopollo/Helpers/DateTimeHelper.php | DateTimeHelper.daysOfWeek | public function daysOfWeek($daysOfWeek)
{
// Check for empty, string or no value
if (empty($daysOfWeek) || is_string($daysOfWeek) === false || strlen($daysOfWeek) < 3) {
// Return with a null parse
return null;
}
// Separate days of the week by comma
$daysOfWeek = explode(',', $daysO... | php | public function daysOfWeek($daysOfWeek)
{
// Check for empty, string or no value
if (empty($daysOfWeek) || is_string($daysOfWeek) === false || strlen($daysOfWeek) < 3) {
// Return with a null parse
return null;
}
// Separate days of the week by comma
$daysOfWeek = explode(',', $daysO... | [
"public",
"function",
"daysOfWeek",
"(",
"$",
"daysOfWeek",
")",
"{",
"// Check for empty, string or no value",
"if",
"(",
"empty",
"(",
"$",
"daysOfWeek",
")",
"||",
"is_string",
"(",
"$",
"daysOfWeek",
")",
"===",
"false",
"||",
"strlen",
"(",
"$",
"daysOfWe... | Parses a string like "mon,tue,wed,thu,fri,sat,sun" into a array
@param string $daysOfWeek example: mon,tue,wed,thu,fri,sat,sun mon,wed,fri
@return null|array null if there was a parsing error or a array with parsed days of the week | [
"Parses",
"a",
"string",
"like",
"mon",
"tue",
"wed",
"thu",
"fri",
"sat",
"sun",
"into",
"a",
"array"
] | 0becb5e0f4202a0f489fb5e384c01dacb8f29dc5 | https://github.com/mojopollo/laravel-helpers/blob/0becb5e0f4202a0f489fb5e384c01dacb8f29dc5/src/Mojopollo/Helpers/DateTimeHelper.php#L23-L51 |
205,048 | phavour/phavour | Phavour/Runnable/View.php | View.setPackage | public function setPackage($package)
{
if ($package != $this->package) {
$this->layoutLocation = null;
}
$this->package = $this->treatPackageName($package);
} | php | public function setPackage($package)
{
if ($package != $this->package) {
$this->layoutLocation = null;
}
$this->package = $this->treatPackageName($package);
} | [
"public",
"function",
"setPackage",
"(",
"$",
"package",
")",
"{",
"if",
"(",
"$",
"package",
"!=",
"$",
"this",
"->",
"package",
")",
"{",
"$",
"this",
"->",
"layoutLocation",
"=",
"null",
";",
"}",
"$",
"this",
"->",
"package",
"=",
"$",
"this",
... | Set the package name
@param string $package | [
"Set",
"the",
"package",
"name"
] | 2246f78203312eb2e23fdb0f776f790e81b4d20f | https://github.com/phavour/phavour/blob/2246f78203312eb2e23fdb0f776f790e81b4d20f/Phavour/Runnable/View.php#L190-L196 |
205,049 | phavour/phavour | Phavour/Runnable/View.php | View.setLayout | public function setLayout($file)
{
if (strstr($file, '::')) {
$file = explode('::', $file);
$package = $file[0];
$file = $file[1];
} else {
$package = $this->package;
}
$this->assignDeclaredLayout($package, $file);
} | php | public function setLayout($file)
{
if (strstr($file, '::')) {
$file = explode('::', $file);
$package = $file[0];
$file = $file[1];
} else {
$package = $this->package;
}
$this->assignDeclaredLayout($package, $file);
} | [
"public",
"function",
"setLayout",
"(",
"$",
"file",
")",
"{",
"if",
"(",
"strstr",
"(",
"$",
"file",
",",
"'::'",
")",
")",
"{",
"$",
"file",
"=",
"explode",
"(",
"'::'",
",",
"$",
"file",
")",
";",
"$",
"package",
"=",
"$",
"file",
"[",
"0",
... | Set the layout location
@param string $file | [
"Set",
"the",
"layout",
"location"
] | 2246f78203312eb2e23fdb0f776f790e81b4d20f | https://github.com/phavour/phavour/blob/2246f78203312eb2e23fdb0f776f790e81b4d20f/Phavour/Runnable/View.php#L365-L376 |
205,050 | phavour/phavour | Phavour/Runnable/View.php | View.assignDeclaredLayout | private function assignDeclaredLayout($package, $file)
{
$file = lcfirst($file);
if (substr(strtolower($file), -6) == '.phtml') {
$file = substr($file, 0, -6);
}
$package = $this->app->getPackage($package);
$pathPieces = array($package['package_path'], 'res', 'la... | php | private function assignDeclaredLayout($package, $file)
{
$file = lcfirst($file);
if (substr(strtolower($file), -6) == '.phtml') {
$file = substr($file, 0, -6);
}
$package = $this->app->getPackage($package);
$pathPieces = array($package['package_path'], 'res', 'la... | [
"private",
"function",
"assignDeclaredLayout",
"(",
"$",
"package",
",",
"$",
"file",
")",
"{",
"$",
"file",
"=",
"lcfirst",
"(",
"$",
"file",
")",
";",
"if",
"(",
"substr",
"(",
"strtolower",
"(",
"$",
"file",
")",
",",
"-",
"6",
")",
"==",
"'.pht... | Assign the path to the layout file
@param string $package
@param string $file
@throws LayoutFileNotFoundException
@throws \Phavour\Application\Exception\PackageNotFoundException
@return boolean | [
"Assign",
"the",
"path",
"to",
"the",
"layout",
"file"
] | 2246f78203312eb2e23fdb0f776f790e81b4d20f | https://github.com/phavour/phavour/blob/2246f78203312eb2e23fdb0f776f790e81b4d20f/Phavour/Runnable/View.php#L433-L450 |
205,051 | phavour/phavour | Phavour/Runnable/View.php | View.getPathForView | private function getPathForView()
{
$methodName = lcfirst($this->method);
$className = lcfirst($this->class);
$package = $this->app->getPackage($this->package);
$pathPieces = array($package['package_path'], 'res', 'view', $className, $methodName);
$path = implode(self::DS, $... | php | private function getPathForView()
{
$methodName = lcfirst($this->method);
$className = lcfirst($this->class);
$package = $this->app->getPackage($this->package);
$pathPieces = array($package['package_path'], 'res', 'view', $className, $methodName);
$path = implode(self::DS, $... | [
"private",
"function",
"getPathForView",
"(",
")",
"{",
"$",
"methodName",
"=",
"lcfirst",
"(",
"$",
"this",
"->",
"method",
")",
";",
"$",
"className",
"=",
"lcfirst",
"(",
"$",
"this",
"->",
"class",
")",
";",
"$",
"package",
"=",
"$",
"this",
"->"... | Get the path for a view file.
@throws \Phavour\Application\Exception\PackageNotFoundException
@throws ViewFileNotFoundException
@return string | [
"Get",
"the",
"path",
"for",
"a",
"view",
"file",
"."
] | 2246f78203312eb2e23fdb0f776f790e81b4d20f | https://github.com/phavour/phavour/blob/2246f78203312eb2e23fdb0f776f790e81b4d20f/Phavour/Runnable/View.php#L458-L472 |
205,052 | phavour/phavour | Phavour/Runnable/View.php | View.inflate | private function inflate($filePath)
{
$currentDirectory = rtrim(dirname($this->currentView), self::DS);
$currentDirectory .= self::DS;
if (substr($filePath, -6, 6) != '.phtml') {
$filePath .= '.phtml';
}
$searchPath = realpath($currentDirectory . $filePath);
... | php | private function inflate($filePath)
{
$currentDirectory = rtrim(dirname($this->currentView), self::DS);
$currentDirectory .= self::DS;
if (substr($filePath, -6, 6) != '.phtml') {
$filePath .= '.phtml';
}
$searchPath = realpath($currentDirectory . $filePath);
... | [
"private",
"function",
"inflate",
"(",
"$",
"filePath",
")",
"{",
"$",
"currentDirectory",
"=",
"rtrim",
"(",
"dirname",
"(",
"$",
"this",
"->",
"currentView",
")",
",",
"self",
"::",
"DS",
")",
";",
"$",
"currentDirectory",
".=",
"self",
"::",
"DS",
"... | Inflate a given
@param string $filePath
@throws \Phavour\Runnable\View\Exception\ViewFileNotFoundException | [
"Inflate",
"a",
"given"
] | 2246f78203312eb2e23fdb0f776f790e81b4d20f | https://github.com/phavour/phavour/blob/2246f78203312eb2e23fdb0f776f790e81b4d20f/Phavour/Runnable/View.php#L479-L505 |
205,053 | zbox/UnifiedPush | src/Zbox/UnifiedPush/NotificationService/ServiceCredentialsFactory.php | ServiceCredentialsFactory.getCredentialsByService | public function getCredentialsByService($serviceName)
{
if (!in_array($serviceName, $this->getInitializedServices())) {
throw new DomainException(
sprintf("Credentials for service '%s' was not initialized", $serviceName)
);
}
return $this->serviceCred... | php | public function getCredentialsByService($serviceName)
{
if (!in_array($serviceName, $this->getInitializedServices())) {
throw new DomainException(
sprintf("Credentials for service '%s' was not initialized", $serviceName)
);
}
return $this->serviceCred... | [
"public",
"function",
"getCredentialsByService",
"(",
"$",
"serviceName",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"serviceName",
",",
"$",
"this",
"->",
"getInitializedServices",
"(",
")",
")",
")",
"{",
"throw",
"new",
"DomainException",
"(",
"sprin... | Returns credentials for notification service
@param string $serviceName
@throws DomainException
@return CredentialsInterface | [
"Returns",
"credentials",
"for",
"notification",
"service"
] | 47da2d0577b18ac709cd947c68541014001e1866 | https://github.com/zbox/UnifiedPush/blob/47da2d0577b18ac709cd947c68541014001e1866/src/Zbox/UnifiedPush/NotificationService/ServiceCredentialsFactory.php#L76-L85 |
205,054 | romaricdrigon/OrchestraBundle | Core/Pool/Factory/RepositoryPoolFactory.php | RepositoryPoolFactory.addRepository | public function addRepository($repositoryClass, $serviceId, $entityClass)
{
$repositoryDefinition = $this->definitionFactory->build($repositoryClass, $serviceId, $entityClass);
// this array is not ordered by slug
$this->definitions[] = $repositoryDefinition;
} | php | public function addRepository($repositoryClass, $serviceId, $entityClass)
{
$repositoryDefinition = $this->definitionFactory->build($repositoryClass, $serviceId, $entityClass);
// this array is not ordered by slug
$this->definitions[] = $repositoryDefinition;
} | [
"public",
"function",
"addRepository",
"(",
"$",
"repositoryClass",
",",
"$",
"serviceId",
",",
"$",
"entityClass",
")",
"{",
"$",
"repositoryDefinition",
"=",
"$",
"this",
"->",
"definitionFactory",
"->",
"build",
"(",
"$",
"repositoryClass",
",",
"$",
"servi... | Add a repository, service from Symfony DIC, to the pool
@param string $repositoryClass
@param string $serviceId
@param string $entityClass | [
"Add",
"a",
"repository",
"service",
"from",
"Symfony",
"DIC",
"to",
"the",
"pool"
] | 4abb9736fcb6b23ed08ebd14ab169867339a4785 | https://github.com/romaricdrigon/OrchestraBundle/blob/4abb9736fcb6b23ed08ebd14ab169867339a4785/Core/Pool/Factory/RepositoryPoolFactory.php#L48-L54 |
205,055 | romaricdrigon/OrchestraBundle | Core/Pool/Factory/RepositoryPoolFactory.php | RepositoryPoolFactory.createPool | public function createPool()
{
$pool = new RepositoryPool();
foreach ($this->definitions as $definition) {
$pool->addRepositoryDefinition($definition);
}
return $pool;
} | php | public function createPool()
{
$pool = new RepositoryPool();
foreach ($this->definitions as $definition) {
$pool->addRepositoryDefinition($definition);
}
return $pool;
} | [
"public",
"function",
"createPool",
"(",
")",
"{",
"$",
"pool",
"=",
"new",
"RepositoryPool",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"definitions",
"as",
"$",
"definition",
")",
"{",
"$",
"pool",
"->",
"addRepositoryDefinition",
"(",
"$",
"def... | Factory method for the EntityPool
@return RepositoryPoolInterface | [
"Factory",
"method",
"for",
"the",
"EntityPool"
] | 4abb9736fcb6b23ed08ebd14ab169867339a4785 | https://github.com/romaricdrigon/OrchestraBundle/blob/4abb9736fcb6b23ed08ebd14ab169867339a4785/Core/Pool/Factory/RepositoryPoolFactory.php#L61-L70 |
205,056 | schpill/thin | src/Prototype.php | Prototype.from | static public function from($class)
{
if (is_object($class)) {
$class = get_class($class);
}
if (empty(self::$prototypes[$class])) {
self::$prototypes[$class] = new static($class);
}
return self::$prototypes[$class];
... | php | static public function from($class)
{
if (is_object($class)) {
$class = get_class($class);
}
if (empty(self::$prototypes[$class])) {
self::$prototypes[$class] = new static($class);
}
return self::$prototypes[$class];
... | [
"static",
"public",
"function",
"from",
"(",
"$",
"class",
")",
"{",
"if",
"(",
"is_object",
"(",
"$",
"class",
")",
")",
"{",
"$",
"class",
"=",
"get_class",
"(",
"$",
"class",
")",
";",
"}",
"if",
"(",
"empty",
"(",
"self",
"::",
"$",
"prototyp... | Returns the prototype associated with the specified class or object.
@param string|object $class Class name or instance.
@return Prototype | [
"Returns",
"the",
"prototype",
"associated",
"with",
"the",
"specified",
"class",
"or",
"object",
"."
] | a9102d9d6f70e8b0f6be93153f70849f46489ee1 | https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Prototype.php#L27-L38 |
205,057 | schpill/thin | src/Prototype.php | Prototype.getConsolidatedMethods | protected function getConsolidatedMethods()
{
if ($this->consolidatedMethods !== null) {
return $this->consolidatedMethods;
}
$methods = $this->methods;
if ($this->parent) {
$methods += $this->parent->getConsolidatedMethods();
... | php | protected function getConsolidatedMethods()
{
if ($this->consolidatedMethods !== null) {
return $this->consolidatedMethods;
}
$methods = $this->methods;
if ($this->parent) {
$methods += $this->parent->getConsolidatedMethods();
... | [
"protected",
"function",
"getConsolidatedMethods",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"consolidatedMethods",
"!==",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"consolidatedMethods",
";",
"}",
"$",
"methods",
"=",
"$",
"this",
"->",
"methods",
... | Consolidate the methods of the prototype.
The method creates a single array from the prototype methods and those of its parents.
@return array[string]callable | [
"Consolidate",
"the",
"methods",
"of",
"the",
"prototype",
"."
] | a9102d9d6f70e8b0f6be93153f70849f46489ee1 | https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Prototype.php#L110-L123 |
205,058 | schpill/thin | src/Prototype.php | Prototype.revokeConsolidatedMethods | protected function revokeConsolidatedMethods()
{
$class = $this->class;
foreach (self::$prototypes as $prototype) {
if (!is_subclass_of($prototype->class, $class)) {
continue;
}
$prototype->consolidatedMethods = null;
... | php | protected function revokeConsolidatedMethods()
{
$class = $this->class;
foreach (self::$prototypes as $prototype) {
if (!is_subclass_of($prototype->class, $class)) {
continue;
}
$prototype->consolidatedMethods = null;
... | [
"protected",
"function",
"revokeConsolidatedMethods",
"(",
")",
"{",
"$",
"class",
"=",
"$",
"this",
"->",
"class",
";",
"foreach",
"(",
"self",
"::",
"$",
"prototypes",
"as",
"$",
"prototype",
")",
"{",
"if",
"(",
"!",
"is_subclass_of",
"(",
"$",
"proto... | Revokes the consolidated methods of the prototype.
The method must be invoked when prototype methods are modified. | [
"Revokes",
"the",
"consolidated",
"methods",
"of",
"the",
"prototype",
"."
] | a9102d9d6f70e8b0f6be93153f70849f46489ee1 | https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Prototype.php#L130-L143 |
205,059 | schpill/thin | src/Prototype.php | Prototype.offsetSet | public function offsetSet($method, $callback)
{
self::$prototypes[$this->class]->methods[$method] = $callback;
$this->revokeConsolidatedMethods();
} | php | public function offsetSet($method, $callback)
{
self::$prototypes[$this->class]->methods[$method] = $callback;
$this->revokeConsolidatedMethods();
} | [
"public",
"function",
"offsetSet",
"(",
"$",
"method",
",",
"$",
"callback",
")",
"{",
"self",
"::",
"$",
"prototypes",
"[",
"$",
"this",
"->",
"class",
"]",
"->",
"methods",
"[",
"$",
"method",
"]",
"=",
"$",
"callback",
";",
"$",
"this",
"->",
"r... | Adds or replaces the specified method of the prototype.
@param string $method The name of the method.
@param callable $callback | [
"Adds",
"or",
"replaces",
"the",
"specified",
"method",
"of",
"the",
"prototype",
"."
] | a9102d9d6f70e8b0f6be93153f70849f46489ee1 | https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Prototype.php#L152-L157 |
205,060 | schpill/thin | src/Prototype.php | Prototype.offsetGet | public function offsetGet($method)
{
$methods = $this->getConsolidatedMethods();
if (!isset($methods[$method])) {
throw new Exception("$method, $this->class");
}
return $methods[$method];
} | php | public function offsetGet($method)
{
$methods = $this->getConsolidatedMethods();
if (!isset($methods[$method])) {
throw new Exception("$method, $this->class");
}
return $methods[$method];
} | [
"public",
"function",
"offsetGet",
"(",
"$",
"method",
")",
"{",
"$",
"methods",
"=",
"$",
"this",
"->",
"getConsolidatedMethods",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"methods",
"[",
"$",
"method",
"]",
")",
")",
"{",
"throw",
"new",
... | Returns the callback associated with the specified method.
@param string $method The name of the method.
@throws Exception if the method is not defined.
@return callable | [
"Returns",
"the",
"callback",
"associated",
"with",
"the",
"specified",
"method",
"."
] | a9102d9d6f70e8b0f6be93153f70849f46489ee1 | https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Prototype.php#L194-L203 |
205,061 | fxpio/fxp-doctrine-console | Util/ObjectFieldUtil.php | ObjectFieldUtil.addOptions | public static function addOptions(InputDefinition $definition, array $fields, $description)
{
foreach ($fields as $field => $type) {
$mode = 'array' === $type
? InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY
: InputOption::VALUE_REQUIRED;
i... | php | public static function addOptions(InputDefinition $definition, array $fields, $description)
{
foreach ($fields as $field => $type) {
$mode = 'array' === $type
? InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY
: InputOption::VALUE_REQUIRED;
i... | [
"public",
"static",
"function",
"addOptions",
"(",
"InputDefinition",
"$",
"definition",
",",
"array",
"$",
"fields",
",",
"$",
"description",
")",
"{",
"foreach",
"(",
"$",
"fields",
"as",
"$",
"field",
"=>",
"$",
"type",
")",
"{",
"$",
"mode",
"=",
"... | Add options in input definition.
@param InputDefinition $definition The input definition
@param array $fields The fields
@param string $description The option description | [
"Add",
"options",
"in",
"input",
"definition",
"."
] | 2fc16d7a4eb0f247075c50de225ec2670ca5479a | https://github.com/fxpio/fxp-doctrine-console/blob/2fc16d7a4eb0f247075c50de225ec2670ca5479a/Util/ObjectFieldUtil.php#L32-L43 |
205,062 | fxpio/fxp-doctrine-console | Util/ObjectFieldUtil.php | ObjectFieldUtil.getFieldValue | public static function getFieldValue(InputInterface $input, $fieldName)
{
$value = null;
if ($input->hasArgument($fieldName)) {
$value = $input->getArgument($fieldName);
} elseif ($input->hasOption($fieldName)) {
$value = $input->getOption($fieldName);
}
... | php | public static function getFieldValue(InputInterface $input, $fieldName)
{
$value = null;
if ($input->hasArgument($fieldName)) {
$value = $input->getArgument($fieldName);
} elseif ($input->hasOption($fieldName)) {
$value = $input->getOption($fieldName);
}
... | [
"public",
"static",
"function",
"getFieldValue",
"(",
"InputInterface",
"$",
"input",
",",
"$",
"fieldName",
")",
"{",
"$",
"value",
"=",
"null",
";",
"if",
"(",
"$",
"input",
"->",
"hasArgument",
"(",
"$",
"fieldName",
")",
")",
"{",
"$",
"value",
"="... | Get field value in console input.
@param InputInterface $input The console input
@param string $fieldName The field name
@return mixed|null | [
"Get",
"field",
"value",
"in",
"console",
"input",
"."
] | 2fc16d7a4eb0f247075c50de225ec2670ca5479a | https://github.com/fxpio/fxp-doctrine-console/blob/2fc16d7a4eb0f247075c50de225ec2670ca5479a/Util/ObjectFieldUtil.php#L53-L64 |
205,063 | rbone/phactory | lib/Phactory/Factory.php | Factory.create | public function create($type, $override, $persisted)
{
$base = $this->factory->blueprint();
$variation = $this->getVariation($type);
$blueprint = array_merge($base, $variation, $override);
return new Blueprint($this->name, $type, $blueprint, $this->isFixture($type), $persisted);
... | php | public function create($type, $override, $persisted)
{
$base = $this->factory->blueprint();
$variation = $this->getVariation($type);
$blueprint = array_merge($base, $variation, $override);
return new Blueprint($this->name, $type, $blueprint, $this->isFixture($type), $persisted);
... | [
"public",
"function",
"create",
"(",
"$",
"type",
",",
"$",
"override",
",",
"$",
"persisted",
")",
"{",
"$",
"base",
"=",
"$",
"this",
"->",
"factory",
"->",
"blueprint",
"(",
")",
";",
"$",
"variation",
"=",
"$",
"this",
"->",
"getVariation",
"(",
... | Creates a new blueprint
@param string $type variation or fixture
@param array $override attributes values overrides
@param boolean $persisted wether it will save the object or not
@return \Phactory\Blueprint | [
"Creates",
"a",
"new",
"blueprint"
] | f1c474084f9b310d171f393fe196e8a2a7aae1ec | https://github.com/rbone/phactory/blob/f1c474084f9b310d171f393fe196e8a2a7aae1ec/lib/Phactory/Factory.php#L40-L48 |
205,064 | rbone/phactory | lib/Phactory/Factory.php | Factory.getVariation | private function getVariation($type)
{
if ($type == 'blueprint') {
return array();
} elseif (method_exists($this->factory, "{$type}Fixture")) {
return call_user_func(array($this->factory, "{$type}Fixture"));
} elseif (method_exists($this->factory, "{$type}_fixture")) ... | php | private function getVariation($type)
{
if ($type == 'blueprint') {
return array();
} elseif (method_exists($this->factory, "{$type}Fixture")) {
return call_user_func(array($this->factory, "{$type}Fixture"));
} elseif (method_exists($this->factory, "{$type}_fixture")) ... | [
"private",
"function",
"getVariation",
"(",
"$",
"type",
")",
"{",
"if",
"(",
"$",
"type",
"==",
"'blueprint'",
")",
"{",
"return",
"array",
"(",
")",
";",
"}",
"elseif",
"(",
"method_exists",
"(",
"$",
"this",
"->",
"factory",
",",
"\"{$type}Fixture\"",... | Applies a variation to the basic blueprint or calls the fixture
@param string $type variation or fixture
@return array
@throws \BadMethodCallException | [
"Applies",
"a",
"variation",
"to",
"the",
"basic",
"blueprint",
"or",
"calls",
"the",
"fixture"
] | f1c474084f9b310d171f393fe196e8a2a7aae1ec | https://github.com/rbone/phactory/blob/f1c474084f9b310d171f393fe196e8a2a7aae1ec/lib/Phactory/Factory.php#L56-L69 |
205,065 | emaphp/omocha | lib/AnnotationBag.php | AnnotationBag.replace | public function replace(array $annotations) {
$this->annotations = $annotations;
$this->names = [];
$index = 0;
foreach ($annotations as $annotation) {
$name = $annotation->getName();
if (!array_key_exists($name, $this->names)) {
$this->names[$name] = [];
}
$this->names[$name][] = $index++;
... | php | public function replace(array $annotations) {
$this->annotations = $annotations;
$this->names = [];
$index = 0;
foreach ($annotations as $annotation) {
$name = $annotation->getName();
if (!array_key_exists($name, $this->names)) {
$this->names[$name] = [];
}
$this->names[$name][] = $index++;
... | [
"public",
"function",
"replace",
"(",
"array",
"$",
"annotations",
")",
"{",
"$",
"this",
"->",
"annotations",
"=",
"$",
"annotations",
";",
"$",
"this",
"->",
"names",
"=",
"[",
"]",
";",
"$",
"index",
"=",
"0",
";",
"foreach",
"(",
"$",
"annotation... | Replaces a set of annotations values
@param array $annotations | [
"Replaces",
"a",
"set",
"of",
"annotations",
"values"
] | 6635b2a7d5feeb7c8627a1a50a871220b1861024 | https://github.com/emaphp/omocha/blob/6635b2a7d5feeb7c8627a1a50a871220b1861024/lib/AnnotationBag.php#L25-L37 |
205,066 | emaphp/omocha | lib/AnnotationBag.php | AnnotationBag.get | public function get($key) {
if ($this->has($key)) {
return $this->annotations[$this->names[$key][0]];
}
return null;
} | php | public function get($key) {
if ($this->has($key)) {
return $this->annotations[$this->names[$key][0]];
}
return null;
} | [
"public",
"function",
"get",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"has",
"(",
"$",
"key",
")",
")",
"{",
"return",
"$",
"this",
"->",
"annotations",
"[",
"$",
"this",
"->",
"names",
"[",
"$",
"key",
"]",
"[",
"0",
"]",
"]"... | Retrieves a single annotation
@param string $key
@return Annotation|NULL | [
"Retrieves",
"a",
"single",
"annotation"
] | 6635b2a7d5feeb7c8627a1a50a871220b1861024 | https://github.com/emaphp/omocha/blob/6635b2a7d5feeb7c8627a1a50a871220b1861024/lib/AnnotationBag.php#L61-L66 |
205,067 | emaphp/omocha | lib/AnnotationBag.php | AnnotationBag.find | public function find($key, $filter = null) {
if (!$this->has($key)) {
return [];
}
$annotations = [];
foreach ($this->names[$key] as $index) {
if (!is_int($filter)) {
$annotations[] = $this->annotations[$index];
continue;
}
$annotation = $this->annotations[$index];
$flags = 0;
... | php | public function find($key, $filter = null) {
if (!$this->has($key)) {
return [];
}
$annotations = [];
foreach ($this->names[$key] as $index) {
if (!is_int($filter)) {
$annotations[] = $this->annotations[$index];
continue;
}
$annotation = $this->annotations[$index];
$flags = 0;
... | [
"public",
"function",
"find",
"(",
"$",
"key",
",",
"$",
"filter",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"has",
"(",
"$",
"key",
")",
")",
"{",
"return",
"[",
"]",
";",
"}",
"$",
"annotations",
"=",
"[",
"]",
";",
"foreach... | Retrieves a list of annotations by name
@param string $key
@param int $filter
@return array | [
"Retrieves",
"a",
"list",
"of",
"annotations",
"by",
"name"
] | 6635b2a7d5feeb7c8627a1a50a871220b1861024 | https://github.com/emaphp/omocha/blob/6635b2a7d5feeb7c8627a1a50a871220b1861024/lib/AnnotationBag.php#L74-L133 |
205,068 | emaphp/omocha | lib/AnnotationBag.php | AnnotationBag.filter | public function filter(\Closure $callback, $reindex = true) {
$result = array_filter($this->annotations, $callback);
if ($reindex) {
$result = array_values($result);
}
return $result;
} | php | public function filter(\Closure $callback, $reindex = true) {
$result = array_filter($this->annotations, $callback);
if ($reindex) {
$result = array_values($result);
}
return $result;
} | [
"public",
"function",
"filter",
"(",
"\\",
"Closure",
"$",
"callback",
",",
"$",
"reindex",
"=",
"true",
")",
"{",
"$",
"result",
"=",
"array_filter",
"(",
"$",
"this",
"->",
"annotations",
",",
"$",
"callback",
")",
";",
"if",
"(",
"$",
"reindex",
"... | Filters elements with the given callback
@param \Closure $callback
@param boolean $reindex Reset indexes
@return array | [
"Filters",
"elements",
"with",
"the",
"given",
"callback"
] | 6635b2a7d5feeb7c8627a1a50a871220b1861024 | https://github.com/emaphp/omocha/blob/6635b2a7d5feeb7c8627a1a50a871220b1861024/lib/AnnotationBag.php#L141-L149 |
205,069 | gplcart/base | Main.php | Main.checkRequiredModules | protected function checkRequiredModules(array $data, &$result)
{
if ($data['installer'] === 'base'
&& empty($data['step'])
&& !$this->getModel()->hasAllRequiredModules()) {
$result = array(
'redirect' => '',
'severity' => 'warning',
... | php | protected function checkRequiredModules(array $data, &$result)
{
if ($data['installer'] === 'base'
&& empty($data['step'])
&& !$this->getModel()->hasAllRequiredModules()) {
$result = array(
'redirect' => '',
'severity' => 'warning',
... | [
"protected",
"function",
"checkRequiredModules",
"(",
"array",
"$",
"data",
",",
"&",
"$",
"result",
")",
"{",
"if",
"(",
"$",
"data",
"[",
"'installer'",
"]",
"===",
"'base'",
"&&",
"empty",
"(",
"$",
"data",
"[",
"'step'",
"]",
")",
"&&",
"!",
"$",... | Check if all required modules in place
@param array $data
@param array $result | [
"Check",
"if",
"all",
"required",
"modules",
"in",
"place"
] | bbcd87604d25333a0a1b84d79299fa06ec5dd39e | https://github.com/gplcart/base/blob/bbcd87604d25333a0a1b84d79299fa06ec5dd39e/Main.php#L104-L116 |
205,070 | factorio-item-browser/api-client | src/Exception/ExceptionFactory.php | ExceptionFactory.create | public static function create(
int $statusCode,
string $message,
string $request,
string $response
): ApiClientException {
switch ($statusCode) {
case 400:
$exception = new BadRequestException($message, $request, $response);
break;
... | php | public static function create(
int $statusCode,
string $message,
string $request,
string $response
): ApiClientException {
switch ($statusCode) {
case 400:
$exception = new BadRequestException($message, $request, $response);
break;
... | [
"public",
"static",
"function",
"create",
"(",
"int",
"$",
"statusCode",
",",
"string",
"$",
"message",
",",
"string",
"$",
"request",
",",
"string",
"$",
"response",
")",
":",
"ApiClientException",
"{",
"switch",
"(",
"$",
"statusCode",
")",
"{",
"case",
... | Creates the exception corresponding to the specified status code.
@param int $statusCode
@param string $message
@param string $request
@param string $response
@return ApiClientException | [
"Creates",
"the",
"exception",
"corresponding",
"to",
"the",
"specified",
"status",
"code",
"."
] | ebda897483bd537c310a17ff868ca40c0568f728 | https://github.com/factorio-item-browser/api-client/blob/ebda897483bd537c310a17ff868ca40c0568f728/src/Exception/ExceptionFactory.php#L23-L47 |
205,071 | danhanly/signalert | src/Signalert/Storage/SessionDriver.php | SessionDriver.store | public function store($message, $bucket)
{
// Get current messages for bucket
$messages = $this->fetch($bucket);
// Check current message does not exist
if (true === in_array($message, $messages)) {
// If message already exists, do not add the duplicate
return... | php | public function store($message, $bucket)
{
// Get current messages for bucket
$messages = $this->fetch($bucket);
// Check current message does not exist
if (true === in_array($message, $messages)) {
// If message already exists, do not add the duplicate
return... | [
"public",
"function",
"store",
"(",
"$",
"message",
",",
"$",
"bucket",
")",
"{",
"// Get current messages for bucket",
"$",
"messages",
"=",
"$",
"this",
"->",
"fetch",
"(",
"$",
"bucket",
")",
";",
"// Check current message does not exist",
"if",
"(",
"true",
... | Store the notifications using the driver
@param string $message
@param string $bucket
@return bool | [
"Store",
"the",
"notifications",
"using",
"the",
"driver"
] | 21ee50e3fc0352306a2966b555984b5c9eada582 | https://github.com/danhanly/signalert/blob/21ee50e3fc0352306a2966b555984b5c9eada582/src/Signalert/Storage/SessionDriver.php#L19-L34 |
205,072 | danhanly/signalert | src/Signalert/Storage/SessionDriver.php | SessionDriver.fetch | public function fetch($bucket, $flush = true)
{
// Ensure that the root node exists
if (true === empty($_SESSION[self::ROOT_NODE])) {
$_SESSION[self::ROOT_NODE] = [];
}
// Ensure that the bucket exists
if (true === empty($_SESSION[self::ROOT_NODE][$bucket])) {
... | php | public function fetch($bucket, $flush = true)
{
// Ensure that the root node exists
if (true === empty($_SESSION[self::ROOT_NODE])) {
$_SESSION[self::ROOT_NODE] = [];
}
// Ensure that the bucket exists
if (true === empty($_SESSION[self::ROOT_NODE][$bucket])) {
... | [
"public",
"function",
"fetch",
"(",
"$",
"bucket",
",",
"$",
"flush",
"=",
"true",
")",
"{",
"// Ensure that the root node exists",
"if",
"(",
"true",
"===",
"empty",
"(",
"$",
"_SESSION",
"[",
"self",
"::",
"ROOT_NODE",
"]",
")",
")",
"{",
"$",
"_SESSIO... | Fetch the notifications from the driver
@param string $bucket
@param bool $flush
@return array | [
"Fetch",
"the",
"notifications",
"from",
"the",
"driver"
] | 21ee50e3fc0352306a2966b555984b5c9eada582 | https://github.com/danhanly/signalert/blob/21ee50e3fc0352306a2966b555984b5c9eada582/src/Signalert/Storage/SessionDriver.php#L43-L61 |
205,073 | danhanly/signalert | src/Signalert/Storage/SessionDriver.php | SessionDriver.flush | public function flush($bucket)
{
if (false === empty($_SESSION[self::ROOT_NODE][$bucket])) {
$_SESSION[self::ROOT_NODE][$bucket] = [];
return true;
}
return false;
} | php | public function flush($bucket)
{
if (false === empty($_SESSION[self::ROOT_NODE][$bucket])) {
$_SESSION[self::ROOT_NODE][$bucket] = [];
return true;
}
return false;
} | [
"public",
"function",
"flush",
"(",
"$",
"bucket",
")",
"{",
"if",
"(",
"false",
"===",
"empty",
"(",
"$",
"_SESSION",
"[",
"self",
"::",
"ROOT_NODE",
"]",
"[",
"$",
"bucket",
"]",
")",
")",
"{",
"$",
"_SESSION",
"[",
"self",
"::",
"ROOT_NODE",
"]"... | Flush all notifications from the driver
@param string $bucket
@return bool | [
"Flush",
"all",
"notifications",
"from",
"the",
"driver"
] | 21ee50e3fc0352306a2966b555984b5c9eada582 | https://github.com/danhanly/signalert/blob/21ee50e3fc0352306a2966b555984b5c9eada582/src/Signalert/Storage/SessionDriver.php#L69-L77 |
205,074 | brick/validation | src/AbstractValidator.php | AbstractValidator.addFailureMessage | final protected function addFailureMessage(string $messageKey) : void
{
$messages = $this->getPossibleMessages();
if (! isset($messages[$messageKey])) {
throw new \RuntimeException('Unknown message key: ' . $messageKey);
}
$this->failureMessages[$messageKey] = $messages... | php | final protected function addFailureMessage(string $messageKey) : void
{
$messages = $this->getPossibleMessages();
if (! isset($messages[$messageKey])) {
throw new \RuntimeException('Unknown message key: ' . $messageKey);
}
$this->failureMessages[$messageKey] = $messages... | [
"final",
"protected",
"function",
"addFailureMessage",
"(",
"string",
"$",
"messageKey",
")",
":",
"void",
"{",
"$",
"messages",
"=",
"$",
"this",
"->",
"getPossibleMessages",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"messages",
"[",
"$",
"messa... | Adds a failure message.
@param string $messageKey The message key.
@return void
@throws \RuntimeException If the message key is unknown. | [
"Adds",
"a",
"failure",
"message",
"."
] | b33593f75df80530417007bde97c4772807563ab | https://github.com/brick/validation/blob/b33593f75df80530417007bde97c4772807563ab/src/AbstractValidator.php#L47-L56 |
205,075 | alekitto/metadata | lib/Factory/AbstractMetadataFactory.php | AbstractMetadataFactory.dispatchClassMetadataLoadedEvent | protected function dispatchClassMetadataLoadedEvent(ClassMetadataInterface $classMetadata): void
{
if (null === $this->eventDispatcher) {
return;
}
$this->eventDispatcher->dispatch(
ClassMetadataLoadedEvent::LOADED_EVENT,
new ClassMetadataLoadedEvent($cla... | php | protected function dispatchClassMetadataLoadedEvent(ClassMetadataInterface $classMetadata): void
{
if (null === $this->eventDispatcher) {
return;
}
$this->eventDispatcher->dispatch(
ClassMetadataLoadedEvent::LOADED_EVENT,
new ClassMetadataLoadedEvent($cla... | [
"protected",
"function",
"dispatchClassMetadataLoadedEvent",
"(",
"ClassMetadataInterface",
"$",
"classMetadata",
")",
":",
"void",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"eventDispatcher",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"eventDispat... | Dispatches a class metadata loaded event for the given class.
@param ClassMetadataInterface $classMetadata | [
"Dispatches",
"a",
"class",
"metadata",
"loaded",
"event",
"for",
"the",
"given",
"class",
"."
] | 0422ac8d7fe72d5fa8cc51b6f1e173866e8afb2c | https://github.com/alekitto/metadata/blob/0422ac8d7fe72d5fa8cc51b6f1e173866e8afb2c/lib/Factory/AbstractMetadataFactory.php#L137-L147 |
205,076 | alekitto/metadata | lib/Factory/AbstractMetadataFactory.php | AbstractMetadataFactory.getFromCache | private function getFromCache(string $class): ?ClassMetadataInterface
{
if (null === $this->cache) {
return null;
}
if ($this->cache instanceof Cache) {
$cached = $this->cache->fetch($class) ?: null;
} else {
$class = preg_replace('#[\{\}\(\)/\\\\... | php | private function getFromCache(string $class): ?ClassMetadataInterface
{
if (null === $this->cache) {
return null;
}
if ($this->cache instanceof Cache) {
$cached = $this->cache->fetch($class) ?: null;
} else {
$class = preg_replace('#[\{\}\(\)/\\\\... | [
"private",
"function",
"getFromCache",
"(",
"string",
"$",
"class",
")",
":",
"?",
"ClassMetadataInterface",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"cache",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"cache",
"instan... | Check a cache pool for cached metadata.
@param string $class
@return null|ClassMetadataInterface | [
"Check",
"a",
"cache",
"pool",
"for",
"cached",
"metadata",
"."
] | 0422ac8d7fe72d5fa8cc51b6f1e173866e8afb2c | https://github.com/alekitto/metadata/blob/0422ac8d7fe72d5fa8cc51b6f1e173866e8afb2c/lib/Factory/AbstractMetadataFactory.php#L156-L171 |
205,077 | alekitto/metadata | lib/Factory/AbstractMetadataFactory.php | AbstractMetadataFactory.saveInCache | private function saveInCache(string $class, ClassMetadataInterface $classMetadata): void
{
if (null === $this->cache) {
return;
}
if ($this->cache instanceof Cache) {
$this->cache->save($class, $classMetadata);
} else {
$class = preg_replace('#[\{... | php | private function saveInCache(string $class, ClassMetadataInterface $classMetadata): void
{
if (null === $this->cache) {
return;
}
if ($this->cache instanceof Cache) {
$this->cache->save($class, $classMetadata);
} else {
$class = preg_replace('#[\{... | [
"private",
"function",
"saveInCache",
"(",
"string",
"$",
"class",
",",
"ClassMetadataInterface",
"$",
"classMetadata",
")",
":",
"void",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"cache",
")",
"{",
"return",
";",
"}",
"if",
"(",
"$",
"this",
"... | Saves a metadata into a cache pool.
@param string $class
@param ClassMetadataInterface $classMetadata | [
"Saves",
"a",
"metadata",
"into",
"a",
"cache",
"pool",
"."
] | 0422ac8d7fe72d5fa8cc51b6f1e173866e8afb2c | https://github.com/alekitto/metadata/blob/0422ac8d7fe72d5fa8cc51b6f1e173866e8afb2c/lib/Factory/AbstractMetadataFactory.php#L179-L194 |
205,078 | alekitto/metadata | lib/Factory/AbstractMetadataFactory.php | AbstractMetadataFactory.getClass | private function getClass($value)
{
if (! is_object($value) && ! is_string($value)) {
return false;
}
if (is_object($value)) {
$value = get_class($value);
}
return ltrim($value, '\\');
} | php | private function getClass($value)
{
if (! is_object($value) && ! is_string($value)) {
return false;
}
if (is_object($value)) {
$value = get_class($value);
}
return ltrim($value, '\\');
} | [
"private",
"function",
"getClass",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"is_object",
"(",
"$",
"value",
")",
"&&",
"!",
"is_string",
"(",
"$",
"value",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"is_object",
"(",
"$",
"value",
... | Get the class name from a string or an object.
@param string|object $value
@return string|bool | [
"Get",
"the",
"class",
"name",
"from",
"a",
"string",
"or",
"an",
"object",
"."
] | 0422ac8d7fe72d5fa8cc51b6f1e173866e8afb2c | https://github.com/alekitto/metadata/blob/0422ac8d7fe72d5fa8cc51b6f1e173866e8afb2c/lib/Factory/AbstractMetadataFactory.php#L203-L214 |
205,079 | easy-system/es-loader | src/ClassLoader.php | ClassLoader.register | public function register()
{
if (! $this->isRegistered) {
spl_autoload_register([$this, 'load'], true, true);
$this->isRegistered = true;
}
return $this;
} | php | public function register()
{
if (! $this->isRegistered) {
spl_autoload_register([$this, 'load'], true, true);
$this->isRegistered = true;
}
return $this;
} | [
"public",
"function",
"register",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isRegistered",
")",
"{",
"spl_autoload_register",
"(",
"[",
"$",
"this",
",",
"'load'",
"]",
",",
"true",
",",
"true",
")",
";",
"$",
"this",
"->",
"isRegistered",
"... | Register the autoloader with spl_autoload.
@return self | [
"Register",
"the",
"autoloader",
"with",
"spl_autoload",
"."
] | 4525867ab14e516b7837bbe1e5632ef3cbb3ffff | https://github.com/easy-system/es-loader/blob/4525867ab14e516b7837bbe1e5632ef3cbb3ffff/src/ClassLoader.php#L59-L67 |
205,080 | easy-system/es-loader | src/ClassLoader.php | ClassLoader.registerPath | public function registerPath($namespace, $path, $prepend = false)
{
$namespace = Normalizer::ns($namespace, true);
$index = substr($namespace, 0, 4);
$this->indexes[$index] = true;
$path = Normalizer::path($path, true);
if (! isset($this->paths[$namespace])) {
... | php | public function registerPath($namespace, $path, $prepend = false)
{
$namespace = Normalizer::ns($namespace, true);
$index = substr($namespace, 0, 4);
$this->indexes[$index] = true;
$path = Normalizer::path($path, true);
if (! isset($this->paths[$namespace])) {
... | [
"public",
"function",
"registerPath",
"(",
"$",
"namespace",
",",
"$",
"path",
",",
"$",
"prepend",
"=",
"false",
")",
"{",
"$",
"namespace",
"=",
"Normalizer",
"::",
"ns",
"(",
"$",
"namespace",
",",
"true",
")",
";",
"$",
"index",
"=",
"substr",
"(... | Registers a PSR-4 directory for a given namespace.
@param string $namespace The namespace
@param string $path The PSR-4 root directory
@param bool $prepend Whether to prepend the directories
@return self | [
"Registers",
"a",
"PSR",
"-",
"4",
"directory",
"for",
"a",
"given",
"namespace",
"."
] | 4525867ab14e516b7837bbe1e5632ef3cbb3ffff | https://github.com/easy-system/es-loader/blob/4525867ab14e516b7837bbe1e5632ef3cbb3ffff/src/ClassLoader.php#L117-L137 |
205,081 | easy-system/es-loader | src/ClassLoader.php | ClassLoader.addClassMap | public function addClassMap(array $map)
{
if (empty($this->classMap)) {
$this->classMap = $map;
return $this;
}
$this->classMap = array_merge($this->classMap, $map);
return $this;
} | php | public function addClassMap(array $map)
{
if (empty($this->classMap)) {
$this->classMap = $map;
return $this;
}
$this->classMap = array_merge($this->classMap, $map);
return $this;
} | [
"public",
"function",
"addClassMap",
"(",
"array",
"$",
"map",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"classMap",
")",
")",
"{",
"$",
"this",
"->",
"classMap",
"=",
"$",
"map",
";",
"return",
"$",
"this",
";",
"}",
"$",
"this",
"->... | Adds the map of classes.
@param array $map The map of classes
@return self | [
"Adds",
"the",
"map",
"of",
"classes",
"."
] | 4525867ab14e516b7837bbe1e5632ef3cbb3ffff | https://github.com/easy-system/es-loader/blob/4525867ab14e516b7837bbe1e5632ef3cbb3ffff/src/ClassLoader.php#L157-L167 |
205,082 | easy-system/es-loader | src/ClassLoader.php | ClassLoader.findFile | public function findFile($class)
{
$class = Normalizer::ns($class, false);
if (isset($this->classMap[$class])) {
return $this->classMap[$class];
}
$index = substr($class, 0, 4);
if (isset($this->indexes[$index])) {
$namespace = $class;
whil... | php | public function findFile($class)
{
$class = Normalizer::ns($class, false);
if (isset($this->classMap[$class])) {
return $this->classMap[$class];
}
$index = substr($class, 0, 4);
if (isset($this->indexes[$index])) {
$namespace = $class;
whil... | [
"public",
"function",
"findFile",
"(",
"$",
"class",
")",
"{",
"$",
"class",
"=",
"Normalizer",
"::",
"ns",
"(",
"$",
"class",
",",
"false",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"classMap",
"[",
"$",
"class",
"]",
")",
")",
"{",
... | Finds the path to the file, that contains the specified class.
@param string $class The fully-qualified class name
@return string|false The path if found, false otherwise | [
"Finds",
"the",
"path",
"to",
"the",
"file",
"that",
"contains",
"the",
"specified",
"class",
"."
] | 4525867ab14e516b7837bbe1e5632ef3cbb3ffff | https://github.com/easy-system/es-loader/blob/4525867ab14e516b7837bbe1e5632ef3cbb3ffff/src/ClassLoader.php#L204-L240 |
205,083 | as3io/modlr | src/Rest/RestConfiguration.php | RestConfiguration.setEntityFormat | public function setEntityFormat($format)
{
$this->validator->isFormatValid($format);
$this->entityFormat = $format;
return $this;
} | php | public function setEntityFormat($format)
{
$this->validator->isFormatValid($format);
$this->entityFormat = $format;
return $this;
} | [
"public",
"function",
"setEntityFormat",
"(",
"$",
"format",
")",
"{",
"$",
"this",
"->",
"validator",
"->",
"isFormatValid",
"(",
"$",
"format",
")",
";",
"$",
"this",
"->",
"entityFormat",
"=",
"$",
"format",
";",
"return",
"$",
"this",
";",
"}"
] | Sets the entity type format.
@param string $format
@return self | [
"Sets",
"the",
"entity",
"type",
"format",
"."
] | 7e684b88bb22a2e18397df9402075c6533084b16 | https://github.com/as3io/modlr/blob/7e684b88bb22a2e18397df9402075c6533084b16/src/Rest/RestConfiguration.php#L109-L114 |
205,084 | as3io/modlr | src/Rest/RestConfiguration.php | RestConfiguration.setFieldKeyFormat | public function setFieldKeyFormat($format)
{
$this->validator->isFormatValid($format);
$this->fieldKeyFormat = $format;
return $this;
} | php | public function setFieldKeyFormat($format)
{
$this->validator->isFormatValid($format);
$this->fieldKeyFormat = $format;
return $this;
} | [
"public",
"function",
"setFieldKeyFormat",
"(",
"$",
"format",
")",
"{",
"$",
"this",
"->",
"validator",
"->",
"isFormatValid",
"(",
"$",
"format",
")",
";",
"$",
"this",
"->",
"fieldKeyFormat",
"=",
"$",
"format",
";",
"return",
"$",
"this",
";",
"}"
] | Sets the field key format.
@param string $format
@return self | [
"Sets",
"the",
"field",
"key",
"format",
"."
] | 7e684b88bb22a2e18397df9402075c6533084b16 | https://github.com/as3io/modlr/blob/7e684b88bb22a2e18397df9402075c6533084b16/src/Rest/RestConfiguration.php#L132-L137 |
205,085 | DarkGigaByte/rollout | src/DarkGigaByte/Rollout/RolloutAbstract.php | RolloutAbstract.getFeatures | public function getFeatures()
{
$featuresString = $this->storage->get($this->getFeaturesKey());
$features = explode(',', $featuresString);
return $features;
} | php | public function getFeatures()
{
$featuresString = $this->storage->get($this->getFeaturesKey());
$features = explode(',', $featuresString);
return $features;
} | [
"public",
"function",
"getFeatures",
"(",
")",
"{",
"$",
"featuresString",
"=",
"$",
"this",
"->",
"storage",
"->",
"get",
"(",
"$",
"this",
"->",
"getFeaturesKey",
"(",
")",
")",
";",
"$",
"features",
"=",
"explode",
"(",
"','",
",",
"$",
"featuresStr... | Get all feature names
@return string[] | [
"Get",
"all",
"feature",
"names"
] | bff5f79df2211c9ebcfc35d4cba74daeeca19bcc | https://github.com/DarkGigaByte/rollout/blob/bff5f79df2211c9ebcfc35d4cba74daeeca19bcc/src/DarkGigaByte/Rollout/RolloutAbstract.php#L45-L50 |
205,086 | DarkGigaByte/rollout | src/DarkGigaByte/Rollout/RolloutAbstract.php | RolloutAbstract.saveFeature | protected function saveFeature(RolloutableInterface $feature)
{
$this->storage->set($this->getKey($feature->getName()), (string)$feature);
$features = $this->getFeatures();
if (false === in_array($feature->getName(), $features)) {
$features[] = $feature->getName();
}
... | php | protected function saveFeature(RolloutableInterface $feature)
{
$this->storage->set($this->getKey($feature->getName()), (string)$feature);
$features = $this->getFeatures();
if (false === in_array($feature->getName(), $features)) {
$features[] = $feature->getName();
}
... | [
"protected",
"function",
"saveFeature",
"(",
"RolloutableInterface",
"$",
"feature",
")",
"{",
"$",
"this",
"->",
"storage",
"->",
"set",
"(",
"$",
"this",
"->",
"getKey",
"(",
"$",
"feature",
"->",
"getName",
"(",
")",
")",
",",
"(",
"string",
")",
"$... | Saves a feature to the storage
@param RolloutableInterface $feature | [
"Saves",
"a",
"feature",
"to",
"the",
"storage"
] | bff5f79df2211c9ebcfc35d4cba74daeeca19bcc | https://github.com/DarkGigaByte/rollout/blob/bff5f79df2211c9ebcfc35d4cba74daeeca19bcc/src/DarkGigaByte/Rollout/RolloutAbstract.php#L56-L64 |
205,087 | DarkGigaByte/rollout | src/DarkGigaByte/Rollout/RolloutAbstract.php | RolloutAbstract.activateRole | public function activateRole($featureName, $roleName)
{
$feature = $this->getFeature($featureName);
$feature->addRole($roleName);
$this->saveFeature($feature);
} | php | public function activateRole($featureName, $roleName)
{
$feature = $this->getFeature($featureName);
$feature->addRole($roleName);
$this->saveFeature($feature);
} | [
"public",
"function",
"activateRole",
"(",
"$",
"featureName",
",",
"$",
"roleName",
")",
"{",
"$",
"feature",
"=",
"$",
"this",
"->",
"getFeature",
"(",
"$",
"featureName",
")",
";",
"$",
"feature",
"->",
"addRole",
"(",
"$",
"roleName",
")",
";",
"$"... | Activates a feature for a specific role
@param string $featureName
@param string $roleName | [
"Activates",
"a",
"feature",
"for",
"a",
"specific",
"role"
] | bff5f79df2211c9ebcfc35d4cba74daeeca19bcc | https://github.com/DarkGigaByte/rollout/blob/bff5f79df2211c9ebcfc35d4cba74daeeca19bcc/src/DarkGigaByte/Rollout/RolloutAbstract.php#L112-L117 |
205,088 | DarkGigaByte/rollout | src/DarkGigaByte/Rollout/RolloutAbstract.php | RolloutAbstract.deactivateRole | public function deactivateRole($featureName, $roleName)
{
$feature = $this->getFeature($featureName);
$feature->removeRole($roleName);
$this->saveFeature($feature);
} | php | public function deactivateRole($featureName, $roleName)
{
$feature = $this->getFeature($featureName);
$feature->removeRole($roleName);
$this->saveFeature($feature);
} | [
"public",
"function",
"deactivateRole",
"(",
"$",
"featureName",
",",
"$",
"roleName",
")",
"{",
"$",
"feature",
"=",
"$",
"this",
"->",
"getFeature",
"(",
"$",
"featureName",
")",
";",
"$",
"feature",
"->",
"removeRole",
"(",
"$",
"roleName",
")",
";",
... | Deactivates a feature for a specific role.
@param string $featureName
@param string $roleName | [
"Deactivates",
"a",
"feature",
"for",
"a",
"specific",
"role",
"."
] | bff5f79df2211c9ebcfc35d4cba74daeeca19bcc | https://github.com/DarkGigaByte/rollout/blob/bff5f79df2211c9ebcfc35d4cba74daeeca19bcc/src/DarkGigaByte/Rollout/RolloutAbstract.php#L124-L129 |
205,089 | DarkGigaByte/rollout | src/DarkGigaByte/Rollout/RolloutAbstract.php | RolloutAbstract.activateGroup | public function activateGroup($featureName, $groupName)
{
$feature = $this->getFeature($featureName);
$feature->addGroup($groupName);
$this->saveFeature($feature);
} | php | public function activateGroup($featureName, $groupName)
{
$feature = $this->getFeature($featureName);
$feature->addGroup($groupName);
$this->saveFeature($feature);
} | [
"public",
"function",
"activateGroup",
"(",
"$",
"featureName",
",",
"$",
"groupName",
")",
"{",
"$",
"feature",
"=",
"$",
"this",
"->",
"getFeature",
"(",
"$",
"featureName",
")",
";",
"$",
"feature",
"->",
"addGroup",
"(",
"$",
"groupName",
")",
";",
... | Activates a feature for a specific group
@param string $featureName
@param string $groupName | [
"Activates",
"a",
"feature",
"for",
"a",
"specific",
"group"
] | bff5f79df2211c9ebcfc35d4cba74daeeca19bcc | https://github.com/DarkGigaByte/rollout/blob/bff5f79df2211c9ebcfc35d4cba74daeeca19bcc/src/DarkGigaByte/Rollout/RolloutAbstract.php#L136-L141 |
205,090 | DarkGigaByte/rollout | src/DarkGigaByte/Rollout/RolloutAbstract.php | RolloutAbstract.deactivateGroup | public function deactivateGroup($featureName, $groupName)
{
$feature = $this->getFeature($featureName);
$feature->removeGroup($groupName);
$this->saveFeature($feature);
} | php | public function deactivateGroup($featureName, $groupName)
{
$feature = $this->getFeature($featureName);
$feature->removeGroup($groupName);
$this->saveFeature($feature);
} | [
"public",
"function",
"deactivateGroup",
"(",
"$",
"featureName",
",",
"$",
"groupName",
")",
"{",
"$",
"feature",
"=",
"$",
"this",
"->",
"getFeature",
"(",
"$",
"featureName",
")",
";",
"$",
"feature",
"->",
"removeGroup",
"(",
"$",
"groupName",
")",
"... | Deactivates a feature for a specific group.
@param string $featureName
@param string $groupName | [
"Deactivates",
"a",
"feature",
"for",
"a",
"specific",
"group",
"."
] | bff5f79df2211c9ebcfc35d4cba74daeeca19bcc | https://github.com/DarkGigaByte/rollout/blob/bff5f79df2211c9ebcfc35d4cba74daeeca19bcc/src/DarkGigaByte/Rollout/RolloutAbstract.php#L148-L153 |
205,091 | DarkGigaByte/rollout | src/DarkGigaByte/Rollout/RolloutAbstract.php | RolloutAbstract.activateUser | public function activateUser($featureName, $userId)
{
$feature = $this->getFeature($featureName);
$feature->addUser($userId);
$this->saveFeature($feature);
} | php | public function activateUser($featureName, $userId)
{
$feature = $this->getFeature($featureName);
$feature->addUser($userId);
$this->saveFeature($feature);
} | [
"public",
"function",
"activateUser",
"(",
"$",
"featureName",
",",
"$",
"userId",
")",
"{",
"$",
"feature",
"=",
"$",
"this",
"->",
"getFeature",
"(",
"$",
"featureName",
")",
";",
"$",
"feature",
"->",
"addUser",
"(",
"$",
"userId",
")",
";",
"$",
... | Activates a feature for a specific user
@param string $featureName
@param integer $userId | [
"Activates",
"a",
"feature",
"for",
"a",
"specific",
"user"
] | bff5f79df2211c9ebcfc35d4cba74daeeca19bcc | https://github.com/DarkGigaByte/rollout/blob/bff5f79df2211c9ebcfc35d4cba74daeeca19bcc/src/DarkGigaByte/Rollout/RolloutAbstract.php#L160-L165 |
205,092 | DarkGigaByte/rollout | src/DarkGigaByte/Rollout/RolloutAbstract.php | RolloutAbstract.deactivateUser | public function deactivateUser($featureName, $userId)
{
$feature = $this->getFeature($featureName);
$feature->removeUser($userId);
$this->saveFeature($feature);
} | php | public function deactivateUser($featureName, $userId)
{
$feature = $this->getFeature($featureName);
$feature->removeUser($userId);
$this->saveFeature($feature);
} | [
"public",
"function",
"deactivateUser",
"(",
"$",
"featureName",
",",
"$",
"userId",
")",
"{",
"$",
"feature",
"=",
"$",
"this",
"->",
"getFeature",
"(",
"$",
"featureName",
")",
";",
"$",
"feature",
"->",
"removeUser",
"(",
"$",
"userId",
")",
";",
"$... | Deactivates a feature for a specific user
@param string $featureName
@param integer $userId | [
"Deactivates",
"a",
"feature",
"for",
"a",
"specific",
"user"
] | bff5f79df2211c9ebcfc35d4cba74daeeca19bcc | https://github.com/DarkGigaByte/rollout/blob/bff5f79df2211c9ebcfc35d4cba74daeeca19bcc/src/DarkGigaByte/Rollout/RolloutAbstract.php#L172-L177 |
205,093 | DarkGigaByte/rollout | src/DarkGigaByte/Rollout/RolloutAbstract.php | RolloutAbstract.activatePercentage | public function activatePercentage($featureName, $percentage)
{
$feature = $this->getFeature($featureName);
$feature->setPercentage($percentage);
$this->saveFeature($feature);
} | php | public function activatePercentage($featureName, $percentage)
{
$feature = $this->getFeature($featureName);
$feature->setPercentage($percentage);
$this->saveFeature($feature);
} | [
"public",
"function",
"activatePercentage",
"(",
"$",
"featureName",
",",
"$",
"percentage",
")",
"{",
"$",
"feature",
"=",
"$",
"this",
"->",
"getFeature",
"(",
"$",
"featureName",
")",
";",
"$",
"feature",
"->",
"setPercentage",
"(",
"$",
"percentage",
"... | Activates a feature for a percentage of users
@param string $featureName
@param integer $percentage | [
"Activates",
"a",
"feature",
"for",
"a",
"percentage",
"of",
"users"
] | bff5f79df2211c9ebcfc35d4cba74daeeca19bcc | https://github.com/DarkGigaByte/rollout/blob/bff5f79df2211c9ebcfc35d4cba74daeeca19bcc/src/DarkGigaByte/Rollout/RolloutAbstract.php#L184-L189 |
205,094 | DarkGigaByte/rollout | src/DarkGigaByte/Rollout/RolloutAbstract.php | RolloutAbstract.deactivatePercentage | public function deactivatePercentage($featureName)
{
$feature = $this->getFeature($featureName);
$feature->setPercentage(0);
$this->saveFeature($feature);
} | php | public function deactivatePercentage($featureName)
{
$feature = $this->getFeature($featureName);
$feature->setPercentage(0);
$this->saveFeature($feature);
} | [
"public",
"function",
"deactivatePercentage",
"(",
"$",
"featureName",
")",
"{",
"$",
"feature",
"=",
"$",
"this",
"->",
"getFeature",
"(",
"$",
"featureName",
")",
";",
"$",
"feature",
"->",
"setPercentage",
"(",
"0",
")",
";",
"$",
"this",
"->",
"saveF... | Deactivates the percentage activation for a feature
@param string $featureName | [
"Deactivates",
"the",
"percentage",
"activation",
"for",
"a",
"feature"
] | bff5f79df2211c9ebcfc35d4cba74daeeca19bcc | https://github.com/DarkGigaByte/rollout/blob/bff5f79df2211c9ebcfc35d4cba74daeeca19bcc/src/DarkGigaByte/Rollout/RolloutAbstract.php#L195-L200 |
205,095 | DarkGigaByte/rollout | src/DarkGigaByte/Rollout/RolloutAbstract.php | RolloutAbstract.isActive | public function isActive($featureName, DeterminableUserInterface $user = null)
{
$feature = $this->getFeature($featureName);
return $feature->isActive($this, $user);
} | php | public function isActive($featureName, DeterminableUserInterface $user = null)
{
$feature = $this->getFeature($featureName);
return $feature->isActive($this, $user);
} | [
"public",
"function",
"isActive",
"(",
"$",
"featureName",
",",
"DeterminableUserInterface",
"$",
"user",
"=",
"null",
")",
"{",
"$",
"feature",
"=",
"$",
"this",
"->",
"getFeature",
"(",
"$",
"featureName",
")",
";",
"return",
"$",
"feature",
"->",
"isAct... | Checks if a feature is active
@param string $featureName
@param DeterminableUserInterface $user
@return bool | [
"Checks",
"if",
"a",
"feature",
"is",
"active"
] | bff5f79df2211c9ebcfc35d4cba74daeeca19bcc | https://github.com/DarkGigaByte/rollout/blob/bff5f79df2211c9ebcfc35d4cba74daeeca19bcc/src/DarkGigaByte/Rollout/RolloutAbstract.php#L208-L212 |
205,096 | DarkGigaByte/rollout | src/DarkGigaByte/Rollout/RolloutAbstract.php | RolloutAbstract.userHasRole | public function userHasRole($roleName, DeterminableUserInterface $user)
{
$userHasRole = false;
if (true === in_array($roleName, $user->getRoles())) {
$userHasRole = true;
}
return $userHasRole;
} | php | public function userHasRole($roleName, DeterminableUserInterface $user)
{
$userHasRole = false;
if (true === in_array($roleName, $user->getRoles())) {
$userHasRole = true;
}
return $userHasRole;
} | [
"public",
"function",
"userHasRole",
"(",
"$",
"roleName",
",",
"DeterminableUserInterface",
"$",
"user",
")",
"{",
"$",
"userHasRole",
"=",
"false",
";",
"if",
"(",
"true",
"===",
"in_array",
"(",
"$",
"roleName",
",",
"$",
"user",
"->",
"getRoles",
"(",
... | Checks if a user has the given role
@param string $roleName
@param DeterminableUserInterface $user
@return bool | [
"Checks",
"if",
"a",
"user",
"has",
"the",
"given",
"role"
] | bff5f79df2211c9ebcfc35d4cba74daeeca19bcc | https://github.com/DarkGigaByte/rollout/blob/bff5f79df2211c9ebcfc35d4cba74daeeca19bcc/src/DarkGigaByte/Rollout/RolloutAbstract.php#L220-L227 |
205,097 | DarkGigaByte/rollout | src/DarkGigaByte/Rollout/RolloutAbstract.php | RolloutAbstract.userHasGroup | public function userHasGroup($groupName, DeterminableUserInterface $user)
{
$userHasGroup = false;
if (true === in_array($groupName, $user->getGroups())) {
$userHasGroup = true;
}
return $userHasGroup;
} | php | public function userHasGroup($groupName, DeterminableUserInterface $user)
{
$userHasGroup = false;
if (true === in_array($groupName, $user->getGroups())) {
$userHasGroup = true;
}
return $userHasGroup;
} | [
"public",
"function",
"userHasGroup",
"(",
"$",
"groupName",
",",
"DeterminableUserInterface",
"$",
"user",
")",
"{",
"$",
"userHasGroup",
"=",
"false",
";",
"if",
"(",
"true",
"===",
"in_array",
"(",
"$",
"groupName",
",",
"$",
"user",
"->",
"getGroups",
... | Checks if a user has the given group
@param string $groupName
@param DeterminableUserInterface $user
@return bool | [
"Checks",
"if",
"a",
"user",
"has",
"the",
"given",
"group"
] | bff5f79df2211c9ebcfc35d4cba74daeeca19bcc | https://github.com/DarkGigaByte/rollout/blob/bff5f79df2211c9ebcfc35d4cba74daeeca19bcc/src/DarkGigaByte/Rollout/RolloutAbstract.php#L235-L242 |
205,098 | pmdevelopment/tool-bundle | Framework/Utilities/CollectionUtility.php | CollectionUtility.isValid | public static function isValid($collection)
{
if (false === is_array($collection) && false === ($collection instanceof Collection)) {
return false;
}
return true;
} | php | public static function isValid($collection)
{
if (false === is_array($collection) && false === ($collection instanceof Collection)) {
return false;
}
return true;
} | [
"public",
"static",
"function",
"isValid",
"(",
"$",
"collection",
")",
"{",
"if",
"(",
"false",
"===",
"is_array",
"(",
"$",
"collection",
")",
"&&",
"false",
"===",
"(",
"$",
"collection",
"instanceof",
"Collection",
")",
")",
"{",
"return",
"false",
"... | Is Valid Collection
@param mixed $collection
@return bool | [
"Is",
"Valid",
"Collection"
] | 2cbc9f82c5b33fd7a9d389edd3676e9f70ea8129 | https://github.com/pmdevelopment/tool-bundle/blob/2cbc9f82c5b33fd7a9d389edd3676e9f70ea8129/Framework/Utilities/CollectionUtility.php#L28-L35 |
205,099 | pmdevelopment/tool-bundle | Framework/Utilities/CollectionUtility.php | CollectionUtility.find | public static function find($collection, $id)
{
$id = intval($id);
foreach ($collection as $entity) {
if ($id === $entity->getId()) {
return $entity;
}
}
return null;
} | php | public static function find($collection, $id)
{
$id = intval($id);
foreach ($collection as $entity) {
if ($id === $entity->getId()) {
return $entity;
}
}
return null;
} | [
"public",
"static",
"function",
"find",
"(",
"$",
"collection",
",",
"$",
"id",
")",
"{",
"$",
"id",
"=",
"intval",
"(",
"$",
"id",
")",
";",
"foreach",
"(",
"$",
"collection",
"as",
"$",
"entity",
")",
"{",
"if",
"(",
"$",
"id",
"===",
"$",
"e... | Find By Id
@param Collection|array $collection
@param int $id
@return null|object | [
"Find",
"By",
"Id"
] | 2cbc9f82c5b33fd7a9d389edd3676e9f70ea8129 | https://github.com/pmdevelopment/tool-bundle/blob/2cbc9f82c5b33fd7a9d389edd3676e9f70ea8129/Framework/Utilities/CollectionUtility.php#L136-L146 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.