repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
php-lug/lug | src/Component/Translation/Repository/Doctrine/ORM/TranslatableRepository.php | TranslatableRepository.createQueryBuilder | public function createQueryBuilder($alias = null, $indexBy = null)
{
$queryBuilder = parent::createQueryBuilder($alias, $indexBy);
$queryBuilder
->addSelect($alias = $this->getTranslationAlias($queryBuilder))
->leftJoin($this->getProperty('translations', $queryBuilder), $alia... | php | public function createQueryBuilder($alias = null, $indexBy = null)
{
$queryBuilder = parent::createQueryBuilder($alias, $indexBy);
$queryBuilder
->addSelect($alias = $this->getTranslationAlias($queryBuilder))
->leftJoin($this->getProperty('translations', $queryBuilder), $alia... | [
"public",
"function",
"createQueryBuilder",
"(",
"$",
"alias",
"=",
"null",
",",
"$",
"indexBy",
"=",
"null",
")",
"{",
"$",
"queryBuilder",
"=",
"parent",
"::",
"createQueryBuilder",
"(",
"$",
"alias",
",",
"$",
"indexBy",
")",
";",
"$",
"queryBuilder",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Translation/Repository/Doctrine/ORM/TranslatableRepository.php#L57-L65 |
php-lug/lug | src/Component/Translation/Repository/Doctrine/ORM/TranslatableRepository.php | TranslatableRepository.createQueryBuilderForCollection | public function createQueryBuilderForCollection($alias = null, $indexBy = null)
{
$queryBuilder = parent::createQueryBuilder($alias, $indexBy);
$queryBuilder
->addSelect($alias = $this->getTranslationAlias($queryBuilder))
->innerJoin(
$this->getProperty('trans... | php | public function createQueryBuilderForCollection($alias = null, $indexBy = null)
{
$queryBuilder = parent::createQueryBuilder($alias, $indexBy);
$queryBuilder
->addSelect($alias = $this->getTranslationAlias($queryBuilder))
->innerJoin(
$this->getProperty('trans... | [
"public",
"function",
"createQueryBuilderForCollection",
"(",
"$",
"alias",
"=",
"null",
",",
"$",
"indexBy",
"=",
"null",
")",
"{",
"$",
"queryBuilder",
"=",
"parent",
"::",
"createQueryBuilder",
"(",
"$",
"alias",
",",
"$",
"indexBy",
")",
";",
"$",
"que... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Translation/Repository/Doctrine/ORM/TranslatableRepository.php#L70-L83 |
php-lug/lug | src/Component/Translation/Repository/Doctrine/ORM/TranslatableRepository.php | TranslatableRepository.getProperty | public function getProperty($property, $root = null)
{
if ($this->cache === null) {
$translationMetadata = $this
->getEntityManager()
->getClassMetadata($this->getClassMetadata()->getAssociationMapping('translations')['targetEntity']);
$this->cache = ... | php | public function getProperty($property, $root = null)
{
if ($this->cache === null) {
$translationMetadata = $this
->getEntityManager()
->getClassMetadata($this->getClassMetadata()->getAssociationMapping('translations')['targetEntity']);
$this->cache = ... | [
"public",
"function",
"getProperty",
"(",
"$",
"property",
",",
"$",
"root",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"cache",
"===",
"null",
")",
"{",
"$",
"translationMetadata",
"=",
"$",
"this",
"->",
"getEntityManager",
"(",
")",
"->",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Translation/Repository/Doctrine/ORM/TranslatableRepository.php#L88-L106 |
php-lug/lug | src/Component/Translation/Repository/Doctrine/ORM/TranslatableRepository.php | TranslatableRepository.getRootProperty | private function getRootProperty($property)
{
return ($pos = strpos($property, '.')) !== false ? substr($property, 0, $pos) : $property;
} | php | private function getRootProperty($property)
{
return ($pos = strpos($property, '.')) !== false ? substr($property, 0, $pos) : $property;
} | [
"private",
"function",
"getRootProperty",
"(",
"$",
"property",
")",
"{",
"return",
"(",
"$",
"pos",
"=",
"strpos",
"(",
"$",
"property",
",",
"'.'",
")",
")",
"!==",
"false",
"?",
"substr",
"(",
"$",
"property",
",",
"0",
",",
"$",
"pos",
")",
":"... | @param string $property
@return string | [
"@param",
"string",
"$property"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Translation/Repository/Doctrine/ORM/TranslatableRepository.php#L150-L153 |
flowcode/AmulenUserBundle | src/Flowcode/UserBundle/Service/UserNotificationService.php | UserNotificationService.notifyPasswordReset | public function notifyPasswordReset(User $user, $plainPassword)
{
$fromEmail = $this->container->getParameter("default_mail_from");
$fromName = $this->container->getParameter("default_mail_from_name");
$appName = $this->container->getParameter("default_app_name");
$subject = "[$appNa... | php | public function notifyPasswordReset(User $user, $plainPassword)
{
$fromEmail = $this->container->getParameter("default_mail_from");
$fromName = $this->container->getParameter("default_mail_from_name");
$appName = $this->container->getParameter("default_app_name");
$subject = "[$appNa... | [
"public",
"function",
"notifyPasswordReset",
"(",
"User",
"$",
"user",
",",
"$",
"plainPassword",
")",
"{",
"$",
"fromEmail",
"=",
"$",
"this",
"->",
"container",
"->",
"getParameter",
"(",
"\"default_mail_from\"",
")",
";",
"$",
"fromName",
"=",
"$",
"this"... | Notify Password reset.
@param User $user [description]
@param [type] $plainPassword [description] | [
"Notify",
"Password",
"reset",
"."
] | train | https://github.com/flowcode/AmulenUserBundle/blob/00055834d9f094e63dcd8d66e2fedb822fcddee0/src/Flowcode/UserBundle/Service/UserNotificationService.php#L43-L54 |
stk2k/net-driver | src/NetDriver/AbstractNetDriver.php | AbstractNetDriver.fireOnSendingRequest | public function fireOnSendingRequest(HttpRequest $request)
{
$event = EnumEvent::REQUEST;
if (isset($this->listeners[$event]) && is_array($this->listeners[$event]))
{
foreach($this->listeners[$event] as $l)
{
$ret = $l($request);
if ($r... | php | public function fireOnSendingRequest(HttpRequest $request)
{
$event = EnumEvent::REQUEST;
if (isset($this->listeners[$event]) && is_array($this->listeners[$event]))
{
foreach($this->listeners[$event] as $l)
{
$ret = $l($request);
if ($r... | [
"public",
"function",
"fireOnSendingRequest",
"(",
"HttpRequest",
"$",
"request",
")",
"{",
"$",
"event",
"=",
"EnumEvent",
"::",
"REQUEST",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"listeners",
"[",
"$",
"event",
"]",
")",
"&&",
"is_array",
"(",... | Fire event before sending HTTP request
@param HttpRequest $request
@return HttpRequest | [
"Fire",
"event",
"before",
"sending",
"HTTP",
"request"
] | train | https://github.com/stk2k/net-driver/blob/75e0bc1a95ba430dd9ed9e69f6a0a5dd8f2e7b1c/src/NetDriver/AbstractNetDriver.php#L120-L134 |
stk2k/net-driver | src/NetDriver/AbstractNetDriver.php | AbstractNetDriver.fireOnReceivedVerbose | public function fireOnReceivedVerbose($strerr, $header, $output)
{
$event = EnumEvent::VERBOSE;
if (isset($this->listeners[$event]) && is_array($this->listeners[$event]))
{
foreach($this->listeners[$event] as $l)
{
$l($strerr, $header, $output);
... | php | public function fireOnReceivedVerbose($strerr, $header, $output)
{
$event = EnumEvent::VERBOSE;
if (isset($this->listeners[$event]) && is_array($this->listeners[$event]))
{
foreach($this->listeners[$event] as $l)
{
$l($strerr, $header, $output);
... | [
"public",
"function",
"fireOnReceivedVerbose",
"(",
"$",
"strerr",
",",
"$",
"header",
",",
"$",
"output",
")",
"{",
"$",
"event",
"=",
"EnumEvent",
"::",
"VERBOSE",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"listeners",
"[",
"$",
"event",
"]",
... | Fire event after received verbose
@param string $strerr
@param string $header
@param string $output | [
"Fire",
"event",
"after",
"received",
"verbose"
] | train | https://github.com/stk2k/net-driver/blob/75e0bc1a95ba430dd9ed9e69f6a0a5dd8f2e7b1c/src/NetDriver/AbstractNetDriver.php#L143-L153 |
stk2k/net-driver | src/NetDriver/AbstractNetDriver.php | AbstractNetDriver.fireOnReceivedResponse | public function fireOnReceivedResponse(HttpResponse $response)
{
$event = EnumEvent::RESPONSE;
if (isset($this->listeners[$event]) && is_array($this->listeners[$event]))
{
foreach($this->listeners[$event] as $l)
{
$l($response);
}
}... | php | public function fireOnReceivedResponse(HttpResponse $response)
{
$event = EnumEvent::RESPONSE;
if (isset($this->listeners[$event]) && is_array($this->listeners[$event]))
{
foreach($this->listeners[$event] as $l)
{
$l($response);
}
}... | [
"public",
"function",
"fireOnReceivedResponse",
"(",
"HttpResponse",
"$",
"response",
")",
"{",
"$",
"event",
"=",
"EnumEvent",
"::",
"RESPONSE",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"listeners",
"[",
"$",
"event",
"]",
")",
"&&",
"is_array",
... | Fire event after received HTTP response
@param HttpResponse $response | [
"Fire",
"event",
"after",
"received",
"HTTP",
"response"
] | train | https://github.com/stk2k/net-driver/blob/75e0bc1a95ba430dd9ed9e69f6a0a5dd8f2e7b1c/src/NetDriver/AbstractNetDriver.php#L160-L170 |
zicht/z | src/Zicht/Tool/Script/Token.php | Token.match | public function match($type, $value = null)
{
if ($this->type === $type || (is_array($type) && in_array($this->type, $type))) {
if (null === $value || $this->value == $value || (is_array($value) && in_array($this->value, $value))) {
return true;
}
}
re... | php | public function match($type, $value = null)
{
if ($this->type === $type || (is_array($type) && in_array($this->type, $type))) {
if (null === $value || $this->value == $value || (is_array($value) && in_array($this->value, $value))) {
return true;
}
}
re... | [
"public",
"function",
"match",
"(",
"$",
"type",
",",
"$",
"value",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"type",
"===",
"$",
"type",
"||",
"(",
"is_array",
"(",
"$",
"type",
")",
"&&",
"in_array",
"(",
"$",
"this",
"->",
"type",
... | Checks if the token matches the passed type and/or value
@param mixed $type
@param mixed $value
@return bool | [
"Checks",
"if",
"the",
"token",
"matches",
"the",
"passed",
"type",
"and",
"/",
"or",
"value"
] | train | https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Script/Token.php#L91-L99 |
gromver/yii2-models | DynamicModel.php | DynamicModel.defineAttribute | public function defineAttribute($name, $field)
{
$field = BaseField::createField($field);
$field->link($this, $name);
$this->_attributes[$name] = $field;
} | php | public function defineAttribute($name, $field)
{
$field = BaseField::createField($field);
$field->link($this, $name);
$this->_attributes[$name] = $field;
} | [
"public",
"function",
"defineAttribute",
"(",
"$",
"name",
",",
"$",
"field",
")",
"{",
"$",
"field",
"=",
"BaseField",
"::",
"createField",
"(",
"$",
"field",
")",
";",
"$",
"field",
"->",
"link",
"(",
"$",
"this",
",",
"$",
"name",
")",
";",
"$",... | Defines an attribute.
@param string $name the attribute name
@param BaseField|string|array $field the attribute value | [
"Defines",
"an",
"attribute",
"."
] | train | https://github.com/gromver/yii2-models/blob/1be954f19ebf90f330d89974ffd6022c766332e1/DynamicModel.php#L81-L88 |
maestroprog/saw-php | src/Config/ApplicationConfig.php | ApplicationConfig.getApplicationIdByClass | public function getApplicationIdByClass(string $class): string
{
foreach ($this->applications as $appId => $appConfig) {
if ($appConfig['class'] === $class) {
return $appId;
}
}
throw new \RuntimeException('Application id not found.', Saw::ERROR_APPLIC... | php | public function getApplicationIdByClass(string $class): string
{
foreach ($this->applications as $appId => $appConfig) {
if ($appConfig['class'] === $class) {
return $appId;
}
}
throw new \RuntimeException('Application id not found.', Saw::ERROR_APPLIC... | [
"public",
"function",
"getApplicationIdByClass",
"(",
"string",
"$",
"class",
")",
":",
"string",
"{",
"foreach",
"(",
"$",
"this",
"->",
"applications",
"as",
"$",
"appId",
"=>",
"$",
"appConfig",
")",
"{",
"if",
"(",
"$",
"appConfig",
"[",
"'class'",
"... | Вернёт id приложения по его классу.
Если одному классу приложения соответсвует несколько id,
то лучше этот метод не использовать.
@param string $class
@return string | [
"Вернёт",
"id",
"приложения",
"по",
"его",
"классу",
".",
"Если",
"одному",
"классу",
"приложения",
"соответсвует",
"несколько",
"id",
"то",
"лучше",
"этот",
"метод",
"не",
"использовать",
"."
] | train | https://github.com/maestroprog/saw-php/blob/159215a4d7a951cca2a9c2eed3e1aa4f5b624cfb/src/Config/ApplicationConfig.php#L59-L67 |
maestroprog/saw-php | src/Config/ApplicationConfig.php | ApplicationConfig.getApplicationArguments | public function getApplicationArguments(string $applicationId): array
{
if (!isset($this->applications[$applicationId])) {
throw new \UnexpectedValueException('Unexpected application id: ' . $applicationId);
}
return $this->applications[$applicationId]['arguments'] ?? [];
} | php | public function getApplicationArguments(string $applicationId): array
{
if (!isset($this->applications[$applicationId])) {
throw new \UnexpectedValueException('Unexpected application id: ' . $applicationId);
}
return $this->applications[$applicationId]['arguments'] ?? [];
} | [
"public",
"function",
"getApplicationArguments",
"(",
"string",
"$",
"applicationId",
")",
":",
"array",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"applications",
"[",
"$",
"applicationId",
"]",
")",
")",
"{",
"throw",
"new",
"\\",
"UnexpectedV... | Вернёт в виде массива список аргументов, необходимых для создания инстанса объекта приложения.
@param string $applicationId
@return array | [
"Вернёт",
"в",
"виде",
"массива",
"список",
"аргументов",
"необходимых",
"для",
"создания",
"инстанса",
"объекта",
"приложения",
"."
] | train | https://github.com/maestroprog/saw-php/blob/159215a4d7a951cca2a9c2eed3e1aa4f5b624cfb/src/Config/ApplicationConfig.php#L86-L92 |
thelia-modules/CustomerGroup | Model/Base/CustomerGroupQuery.php | CustomerGroupQuery.filterByIsDefault | public function filterByIsDefault($isDefault = null, $comparison = null)
{
if (is_string($isDefault)) {
$is_default = in_array(strtolower($isDefault), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;
}
return $this->addUsingAlias(CustomerGroupTableMap::IS_DEFAULT,... | php | public function filterByIsDefault($isDefault = null, $comparison = null)
{
if (is_string($isDefault)) {
$is_default = in_array(strtolower($isDefault), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;
}
return $this->addUsingAlias(CustomerGroupTableMap::IS_DEFAULT,... | [
"public",
"function",
"filterByIsDefault",
"(",
"$",
"isDefault",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"isDefault",
")",
")",
"{",
"$",
"is_default",
"=",
"in_array",
"(",
"strtolower",
"(",
"$",
... | Filter the query on the is_default column
Example usage:
<code>
$query->filterByIsDefault(true); // WHERE is_default = true
$query->filterByIsDefault('yes'); // WHERE is_default = true
</code>
@param boolean|string $isDefault The value to use as filter.
Non-boolean arguments are converted using the following rule... | [
"Filter",
"the",
"query",
"on",
"the",
"is_default",
"column"
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroupQuery.php#L291-L298 |
thelia-modules/CustomerGroup | Model/Base/CustomerGroupQuery.php | CustomerGroupQuery.filterByCustomerCustomerGroup | public function filterByCustomerCustomerGroup($customerCustomerGroup, $comparison = null)
{
if ($customerCustomerGroup instanceof \CustomerGroup\Model\CustomerCustomerGroup) {
return $this
->addUsingAlias(CustomerGroupTableMap::ID, $customerCustomerGroup->getCustomerGroupId(), $c... | php | public function filterByCustomerCustomerGroup($customerCustomerGroup, $comparison = null)
{
if ($customerCustomerGroup instanceof \CustomerGroup\Model\CustomerCustomerGroup) {
return $this
->addUsingAlias(CustomerGroupTableMap::ID, $customerCustomerGroup->getCustomerGroupId(), $c... | [
"public",
"function",
"filterByCustomerCustomerGroup",
"(",
"$",
"customerCustomerGroup",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"customerCustomerGroup",
"instanceof",
"\\",
"CustomerGroup",
"\\",
"Model",
"\\",
"CustomerCustomerGroup",
")",
... | Filter the query by a related \CustomerGroup\Model\CustomerCustomerGroup object
@param \CustomerGroup\Model\CustomerCustomerGroup|ObjectCollection $customerCustomerGroup the related object to use as filter
@param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
@return ChildC... | [
"Filter",
"the",
"query",
"by",
"a",
"related",
"\\",
"CustomerGroup",
"\\",
"Model",
"\\",
"CustomerCustomerGroup",
"object"
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroupQuery.php#L476-L489 |
thelia-modules/CustomerGroup | Model/Base/CustomerGroupQuery.php | CustomerGroupQuery.useCustomerCustomerGroupQuery | public function useCustomerCustomerGroupQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinCustomerCustomerGroup($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'CustomerCustomerGroup', '\CustomerGroup\Model\CustomerCustomerGro... | php | public function useCustomerCustomerGroupQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinCustomerCustomerGroup($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'CustomerCustomerGroup', '\CustomerGroup\Model\CustomerCustomerGro... | [
"public",
"function",
"useCustomerCustomerGroupQuery",
"(",
"$",
"relationAlias",
"=",
"null",
",",
"$",
"joinType",
"=",
"Criteria",
"::",
"INNER_JOIN",
")",
"{",
"return",
"$",
"this",
"->",
"joinCustomerCustomerGroup",
"(",
"$",
"relationAlias",
",",
"$",
"jo... | Use the CustomerCustomerGroup relation CustomerCustomerGroup object
@see useQuery()
@param string $relationAlias optional alias for the relation,
to be used as main alias in the secondary query
@param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
@return \CustomerGroup\... | [
"Use",
"the",
"CustomerCustomerGroup",
"relation",
"CustomerCustomerGroup",
"object"
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroupQuery.php#L534-L539 |
thelia-modules/CustomerGroup | Model/Base/CustomerGroupQuery.php | CustomerGroupQuery.filterByCustomerGroupI18n | public function filterByCustomerGroupI18n($customerGroupI18n, $comparison = null)
{
if ($customerGroupI18n instanceof \CustomerGroup\Model\CustomerGroupI18n) {
return $this
->addUsingAlias(CustomerGroupTableMap::ID, $customerGroupI18n->getId(), $comparison);
} elseif ($cu... | php | public function filterByCustomerGroupI18n($customerGroupI18n, $comparison = null)
{
if ($customerGroupI18n instanceof \CustomerGroup\Model\CustomerGroupI18n) {
return $this
->addUsingAlias(CustomerGroupTableMap::ID, $customerGroupI18n->getId(), $comparison);
} elseif ($cu... | [
"public",
"function",
"filterByCustomerGroupI18n",
"(",
"$",
"customerGroupI18n",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"customerGroupI18n",
"instanceof",
"\\",
"CustomerGroup",
"\\",
"Model",
"\\",
"CustomerGroupI18n",
")",
"{",
"return",... | Filter the query by a related \CustomerGroup\Model\CustomerGroupI18n object
@param \CustomerGroup\Model\CustomerGroupI18n|ObjectCollection $customerGroupI18n the related object to use as filter
@param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
@return ChildCustomerGroup... | [
"Filter",
"the",
"query",
"by",
"a",
"related",
"\\",
"CustomerGroup",
"\\",
"Model",
"\\",
"CustomerGroupI18n",
"object"
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroupQuery.php#L549-L562 |
thelia-modules/CustomerGroup | Model/Base/CustomerGroupQuery.php | CustomerGroupQuery.useCustomerGroupI18nQuery | public function useCustomerGroupI18nQuery($relationAlias = null, $joinType = 'LEFT JOIN')
{
return $this
->joinCustomerGroupI18n($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'CustomerGroupI18n', '\CustomerGroup\Model\CustomerGroupI18nQuery');
} | php | public function useCustomerGroupI18nQuery($relationAlias = null, $joinType = 'LEFT JOIN')
{
return $this
->joinCustomerGroupI18n($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'CustomerGroupI18n', '\CustomerGroup\Model\CustomerGroupI18nQuery');
} | [
"public",
"function",
"useCustomerGroupI18nQuery",
"(",
"$",
"relationAlias",
"=",
"null",
",",
"$",
"joinType",
"=",
"'LEFT JOIN'",
")",
"{",
"return",
"$",
"this",
"->",
"joinCustomerGroupI18n",
"(",
"$",
"relationAlias",
",",
"$",
"joinType",
")",
"->",
"us... | Use the CustomerGroupI18n relation CustomerGroupI18n object
@see useQuery()
@param string $relationAlias optional alias for the relation,
to be used as main alias in the secondary query
@param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
@return \CustomerGroup\Model\Cu... | [
"Use",
"the",
"CustomerGroupI18n",
"relation",
"CustomerGroupI18n",
"object"
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroupQuery.php#L607-L612 |
thelia-modules/CustomerGroup | Model/Base/CustomerGroupQuery.php | CustomerGroupQuery.filterByCustomer | public function filterByCustomer($customer, $comparison = Criteria::EQUAL)
{
return $this
->useCustomerCustomerGroupQuery()
->filterByCustomer($customer, $comparison)
->endUse();
} | php | public function filterByCustomer($customer, $comparison = Criteria::EQUAL)
{
return $this
->useCustomerCustomerGroupQuery()
->filterByCustomer($customer, $comparison)
->endUse();
} | [
"public",
"function",
"filterByCustomer",
"(",
"$",
"customer",
",",
"$",
"comparison",
"=",
"Criteria",
"::",
"EQUAL",
")",
"{",
"return",
"$",
"this",
"->",
"useCustomerCustomerGroupQuery",
"(",
")",
"->",
"filterByCustomer",
"(",
"$",
"customer",
",",
"$",
... | Filter the query by a related Customer object
using the customer_customer_group table as cross reference
@param Customer $customer the related object to use as filter
@param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
@return ChildCustomerGroupQuery The current query, for... | [
"Filter",
"the",
"query",
"by",
"a",
"related",
"Customer",
"object",
"using",
"the",
"customer_customer_group",
"table",
"as",
"cross",
"reference"
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroupQuery.php#L623-L629 |
thelia-modules/CustomerGroup | Model/Base/CustomerGroupQuery.php | CustomerGroupQuery.prune | public function prune($customerGroup = null)
{
if ($customerGroup) {
$this->addUsingAlias(CustomerGroupTableMap::ID, $customerGroup->getId(), Criteria::NOT_EQUAL);
}
return $this;
} | php | public function prune($customerGroup = null)
{
if ($customerGroup) {
$this->addUsingAlias(CustomerGroupTableMap::ID, $customerGroup->getId(), Criteria::NOT_EQUAL);
}
return $this;
} | [
"public",
"function",
"prune",
"(",
"$",
"customerGroup",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"customerGroup",
")",
"{",
"$",
"this",
"->",
"addUsingAlias",
"(",
"CustomerGroupTableMap",
"::",
"ID",
",",
"$",
"customerGroup",
"->",
"getId",
"(",
")",
... | Exclude object from result
@param ChildCustomerGroup $customerGroup Object to remove from the list of results
@return ChildCustomerGroupQuery The current query, for fluid interface | [
"Exclude",
"object",
"from",
"result"
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroupQuery.php#L638-L645 |
thelia-modules/CustomerGroup | Model/Base/CustomerGroupQuery.php | CustomerGroupQuery.orderByRank | public function orderByRank($order = Criteria::ASC)
{
$order = strtoupper($order);
switch ($order) {
case Criteria::ASC:
return $this->addAscendingOrderByColumn($this->getAliasedColName(CustomerGroupTableMap::RANK_COL));
break;
case Criteria::D... | php | public function orderByRank($order = Criteria::ASC)
{
$order = strtoupper($order);
switch ($order) {
case Criteria::ASC:
return $this->addAscendingOrderByColumn($this->getAliasedColName(CustomerGroupTableMap::RANK_COL));
break;
case Criteria::D... | [
"public",
"function",
"orderByRank",
"(",
"$",
"order",
"=",
"Criteria",
"::",
"ASC",
")",
"{",
"$",
"order",
"=",
"strtoupper",
"(",
"$",
"order",
")",
";",
"switch",
"(",
"$",
"order",
")",
"{",
"case",
"Criteria",
"::",
"ASC",
":",
"return",
"$",
... | Order the query based on the rank in the list.
Using the default $order, returns the item with the lowest rank first
@param string $order either Criteria::ASC (default) or Criteria::DESC
@return ChildCustomerGroupQuery The current query, for fluid interface | [
"Order",
"the",
"query",
"based",
"on",
"the",
"rank",
"in",
"the",
"list",
".",
"Using",
"the",
"default",
"$order",
"returns",
"the",
"item",
"with",
"the",
"lowest",
"rank",
"first"
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroupQuery.php#L869-L882 |
thelia-modules/CustomerGroup | Model/Base/CustomerGroupQuery.php | CustomerGroupQuery.findOneByRank | public function findOneByRank($rank, ConnectionInterface $con = null)
{
return $this
->filterByRank($rank)
->findOne($con);
} | php | public function findOneByRank($rank, ConnectionInterface $con = null)
{
return $this
->filterByRank($rank)
->findOne($con);
} | [
"public",
"function",
"findOneByRank",
"(",
"$",
"rank",
",",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"filterByRank",
"(",
"$",
"rank",
")",
"->",
"findOne",
"(",
"$",
"con",
")",
";",
"}"
] | Get an item from the list based on its rank
@param integer $rank rank
@param ConnectionInterface $con optional connection
@return ChildCustomerGroup | [
"Get",
"an",
"item",
"from",
"the",
"list",
"based",
"on",
"its",
"rank"
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroupQuery.php#L892-L898 |
thelia-modules/CustomerGroup | Model/Base/CustomerGroupQuery.php | CustomerGroupQuery.getMaxRank | public function getMaxRank(ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getReadConnection(CustomerGroupTableMap::DATABASE_NAME);
}
// shift the objects with a position lower than the one of object
$this->addSelectColumn('MA... | php | public function getMaxRank(ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getReadConnection(CustomerGroupTableMap::DATABASE_NAME);
}
// shift the objects with a position lower than the one of object
$this->addSelectColumn('MA... | [
"public",
"function",
"getMaxRank",
"(",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"con",
")",
"{",
"$",
"con",
"=",
"Propel",
"::",
"getServiceContainer",
"(",
")",
"->",
"getReadConnection",
"(",
"CustomerGr... | Get the highest rank
@param ConnectionInterface optional connection
@return integer highest position | [
"Get",
"the",
"highest",
"rank"
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroupQuery.php#L922-L932 |
thelia-modules/CustomerGroup | Model/Base/CustomerGroupQuery.php | CustomerGroupQuery.getMaxRankArray | public function getMaxRankArray(ConnectionInterface $con = null)
{
if ($con === null) {
$con = Propel::getConnection(CustomerGroupTableMap::DATABASE_NAME);
}
// shift the objects with a position lower than the one of object
$this->addSelectColumn('MAX(' . CustomerGroupTab... | php | public function getMaxRankArray(ConnectionInterface $con = null)
{
if ($con === null) {
$con = Propel::getConnection(CustomerGroupTableMap::DATABASE_NAME);
}
// shift the objects with a position lower than the one of object
$this->addSelectColumn('MAX(' . CustomerGroupTab... | [
"public",
"function",
"getMaxRankArray",
"(",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"con",
"===",
"null",
")",
"{",
"$",
"con",
"=",
"Propel",
"::",
"getConnection",
"(",
"CustomerGroupTableMap",
"::",
"DATABASE_NAME",
")"... | Get the highest rank by a scope with a array format.
@param ConnectionInterface optional connection
@return integer highest position | [
"Get",
"the",
"highest",
"rank",
"by",
"a",
"scope",
"with",
"a",
"array",
"format",
"."
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroupQuery.php#L941-L951 |
thelia-modules/CustomerGroup | Model/Base/CustomerGroupQuery.php | CustomerGroupQuery.retrieveByRank | static public function retrieveByRank($rank, ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getReadConnection(CustomerGroupTableMap::DATABASE_NAME);
}
$c = new Criteria;
$c->add(CustomerGroupTableMap::RANK_COL, $rank);
... | php | static public function retrieveByRank($rank, ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getReadConnection(CustomerGroupTableMap::DATABASE_NAME);
}
$c = new Criteria;
$c->add(CustomerGroupTableMap::RANK_COL, $rank);
... | [
"static",
"public",
"function",
"retrieveByRank",
"(",
"$",
"rank",
",",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"con",
")",
"{",
"$",
"con",
"=",
"Propel",
"::",
"getServiceContainer",
"(",
")",
"->",
"... | Get an item from the list based on its rank
@param integer $rank rank
@param ConnectionInterface $con optional connection
@return ChildCustomerGroup | [
"Get",
"an",
"item",
"from",
"the",
"list",
"based",
"on",
"its",
"rank"
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroupQuery.php#L961-L971 |
thelia-modules/CustomerGroup | Model/Base/CustomerGroupQuery.php | CustomerGroupQuery.reorder | public function reorder($order, ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getReadConnection(CustomerGroupTableMap::DATABASE_NAME);
}
$con->beginTransaction();
try {
$ids = array_keys($order);
$ob... | php | public function reorder($order, ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getReadConnection(CustomerGroupTableMap::DATABASE_NAME);
}
$con->beginTransaction();
try {
$ids = array_keys($order);
$ob... | [
"public",
"function",
"reorder",
"(",
"$",
"order",
",",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"con",
")",
"{",
"$",
"con",
"=",
"Propel",
"::",
"getServiceContainer",
"(",
")",
"->",
"getReadConnection"... | Reorder a set of sortable objects based on a list of id/position
Beware that there is no check made on the positions passed
So incoherent positions will result in an incoherent list
@param mixed $order id => rank pairs
@param ConnectionInterface $con optional connection
@return boolean true... | [
"Reorder",
"a",
"set",
"of",
"sortable",
"objects",
"based",
"on",
"a",
"list",
"of",
"id",
"/",
"position",
"Beware",
"that",
"there",
"is",
"no",
"check",
"made",
"on",
"the",
"positions",
"passed",
"So",
"incoherent",
"positions",
"will",
"result",
"in"... | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroupQuery.php#L983-L1007 |
thelia-modules/CustomerGroup | Model/Base/CustomerGroupQuery.php | CustomerGroupQuery.doSelectOrderByRank | static public function doSelectOrderByRank(Criteria $criteria = null, $order = Criteria::ASC, ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getReadConnection(CustomerGroupTableMap::DATABASE_NAME);
}
if (null === $criteria) {
... | php | static public function doSelectOrderByRank(Criteria $criteria = null, $order = Criteria::ASC, ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getReadConnection(CustomerGroupTableMap::DATABASE_NAME);
}
if (null === $criteria) {
... | [
"static",
"public",
"function",
"doSelectOrderByRank",
"(",
"Criteria",
"$",
"criteria",
"=",
"null",
",",
"$",
"order",
"=",
"Criteria",
"::",
"ASC",
",",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"con",
")... | Return an array of sortable objects ordered by position
@param Criteria $criteria optional criteria object
@param string $order sorting order, to be chosen between Criteria::ASC (default) and Criteria::DESC
@param ConnectionInterface $con optional connection
@return array list of sortabl... | [
"Return",
"an",
"array",
"of",
"sortable",
"objects",
"ordered",
"by",
"position"
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroupQuery.php#L1018-L1039 |
thelia-modules/CustomerGroup | Model/Base/CustomerGroupQuery.php | CustomerGroupQuery.sortableShiftRank | static public function sortableShiftRank($delta, $first, $last = null, ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(CustomerGroupTableMap::DATABASE_NAME);
}
$whereCriteria = new Criteria(CustomerGroupTableMap::D... | php | static public function sortableShiftRank($delta, $first, $last = null, ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(CustomerGroupTableMap::DATABASE_NAME);
}
$whereCriteria = new Criteria(CustomerGroupTableMap::D... | [
"static",
"public",
"function",
"sortableShiftRank",
"(",
"$",
"delta",
",",
"$",
"first",
",",
"$",
"last",
"=",
"null",
",",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"con",
")",
"{",
"$",
"con",
"=",
... | Adds $delta to all Rank values that are >= $first and <= $last.
'$delta' can also be negative.
@param int $delta Value to be shifted by, can be negative
@param int $first First node to be shifted
@param int $last Last node to be shifted
@param ConnectionInterface $con Connection to use. | [
"Adds",
"$delta",
"to",
"all",
"Rank",
"values",
"that",
"are",
">",
"=",
"$first",
"and",
"<",
"=",
"$last",
".",
"$delta",
"can",
"also",
"be",
"negative",
"."
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroupQuery.php#L1050-L1068 |
php-lug/lug | src/Component/Grid/Model/Builder/SortBuilder.php | SortBuilder.build | public function build(array $config)
{
return new Sort(
$this->buildName($config),
$this->buildType($config),
$this->buildOptions($config)
);
} | php | public function build(array $config)
{
return new Sort(
$this->buildName($config),
$this->buildType($config),
$this->buildOptions($config)
);
} | [
"public",
"function",
"build",
"(",
"array",
"$",
"config",
")",
"{",
"return",
"new",
"Sort",
"(",
"$",
"this",
"->",
"buildName",
"(",
"$",
"config",
")",
",",
"$",
"this",
"->",
"buildType",
"(",
"$",
"config",
")",
",",
"$",
"this",
"->",
"buil... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Grid/Model/Builder/SortBuilder.php#L24-L31 |
flowcode/AmulenUserBundle | src/Flowcode/UserBundle/Controller/UserGroupController.php | UserGroupController.createEditForm | private function createEditForm(UserGroup $entity) {
$form = $this->createForm(new UserGroupType(), $entity, array(
'action' => $this->generateUrl('admin_usergroup_update', array('id' => $entity->getId())),
'method' => 'PUT',
));
$form->add('submit', 'submit', array('lab... | php | private function createEditForm(UserGroup $entity) {
$form = $this->createForm(new UserGroupType(), $entity, array(
'action' => $this->generateUrl('admin_usergroup_update', array('id' => $entity->getId())),
'method' => 'PUT',
));
$form->add('submit', 'submit', array('lab... | [
"private",
"function",
"createEditForm",
"(",
"UserGroup",
"$",
"entity",
")",
"{",
"$",
"form",
"=",
"$",
"this",
"->",
"createForm",
"(",
"new",
"UserGroupType",
"(",
")",
",",
"$",
"entity",
",",
"array",
"(",
"'action'",
"=>",
"$",
"this",
"->",
"g... | Creates a form to edit a UserGroup entity.
@param UserGroup $entity The entity
@return \Symfony\Component\Form\Form The form | [
"Creates",
"a",
"form",
"to",
"edit",
"a",
"UserGroup",
"entity",
"."
] | train | https://github.com/flowcode/AmulenUserBundle/blob/00055834d9f094e63dcd8d66e2fedb822fcddee0/src/Flowcode/UserBundle/Controller/UserGroupController.php#L141-L150 |
flowcode/AmulenUserBundle | src/Flowcode/UserBundle/Controller/UserGroupController.php | UserGroupController.deleteAction | public function deleteAction(Request $request, $id) {
$form = $this->createDeleteForm($id);
$form->handleRequest($request);
if ($form->isValid()) {
$em = $this->getDoctrine()->getManager();
$userGroup = $em->getRepository('AmulenUserBundle:UserGroup')->find($id);
... | php | public function deleteAction(Request $request, $id) {
$form = $this->createDeleteForm($id);
$form->handleRequest($request);
if ($form->isValid()) {
$em = $this->getDoctrine()->getManager();
$userGroup = $em->getRepository('AmulenUserBundle:UserGroup')->find($id);
... | [
"public",
"function",
"deleteAction",
"(",
"Request",
"$",
"request",
",",
"$",
"id",
")",
"{",
"$",
"form",
"=",
"$",
"this",
"->",
"createDeleteForm",
"(",
"$",
"id",
")",
";",
"$",
"form",
"->",
"handleRequest",
"(",
"$",
"request",
")",
";",
"if"... | Deletes a UserGroup entity.
@Route("/{id}", name="admin_usergroup_delete")
@Method("DELETE") | [
"Deletes",
"a",
"UserGroup",
"entity",
"."
] | train | https://github.com/flowcode/AmulenUserBundle/blob/00055834d9f094e63dcd8d66e2fedb822fcddee0/src/Flowcode/UserBundle/Controller/UserGroupController.php#L191-L224 |
flowcode/AmulenUserBundle | src/Flowcode/UserBundle/Controller/UserGroupController.php | UserGroupController.createCreateForm | private function createCreateForm(UserGroup $entity)
{
$options = array ('action' => $this->generateUrl('admin_usergroup_create'),
'method' => 'POST'
);
$form = $this->createForm(new UserGroupType(), $entity, $options);
return $form;
} | php | private function createCreateForm(UserGroup $entity)
{
$options = array ('action' => $this->generateUrl('admin_usergroup_create'),
'method' => 'POST'
);
$form = $this->createForm(new UserGroupType(), $entity, $options);
return $form;
} | [
"private",
"function",
"createCreateForm",
"(",
"UserGroup",
"$",
"entity",
")",
"{",
"$",
"options",
"=",
"array",
"(",
"'action'",
"=>",
"$",
"this",
"->",
"generateUrl",
"(",
"'admin_usergroup_create'",
")",
",",
"'method'",
"=>",
"'POST'",
")",
";",
"$",... | Creates a form to create a UserGroup entity.
@param UserGroup $entity The entity
@return \Symfony\Component\Form\Form The form | [
"Creates",
"a",
"form",
"to",
"create",
"a",
"UserGroup",
"entity",
"."
] | train | https://github.com/flowcode/AmulenUserBundle/blob/00055834d9f094e63dcd8d66e2fedb822fcddee0/src/Flowcode/UserBundle/Controller/UserGroupController.php#L253-L262 |
flowcode/AmulenUserBundle | src/Flowcode/UserBundle/Controller/UserGroupController.php | UserGroupController.getUsersByUserGroup | private function getUsersByUserGroup(UserGroup $userGroup)
{
return 10;
$em = $this->getDoctrine()->getEntityManager();
$query = $em->createQuery('SELECT '
. ' u, g '
. ' FROM Flowcode\UserBundle\Entity\User u'
... | php | private function getUsersByUserGroup(UserGroup $userGroup)
{
return 10;
$em = $this->getDoctrine()->getEntityManager();
$query = $em->createQuery('SELECT '
. ' u, g '
. ' FROM Flowcode\UserBundle\Entity\User u'
... | [
"private",
"function",
"getUsersByUserGroup",
"(",
"UserGroup",
"$",
"userGroup",
")",
"{",
"return",
"10",
";",
"$",
"em",
"=",
"$",
"this",
"->",
"getDoctrine",
"(",
")",
"->",
"getEntityManager",
"(",
")",
";",
"$",
"query",
"=",
"$",
"em",
"->",
"c... | Get Users by user group. Dado un grupo de roles de usuario, retorna todos
los usuarios que pertenecen al grupo.
@param UserGroup $userGroup El grupo.
@return array() Los usuarios. | [
"Get",
"Users",
"by",
"user",
"group",
".",
"Dado",
"un",
"grupo",
"de",
"roles",
"de",
"usuario",
"retorna",
"todos",
"los",
"usuarios",
"que",
"pertenecen",
"al",
"grupo",
"."
] | train | https://github.com/flowcode/AmulenUserBundle/blob/00055834d9f094e63dcd8d66e2fedb822fcddee0/src/Flowcode/UserBundle/Controller/UserGroupController.php#L273-L287 |
mvccore/ext-router-module | src/MvcCore/Ext/Routers/Module/RewriteRoutingChecks.php | RewriteRoutingChecks.rewriteRoutingCheckRoute | protected function rewriteRoutingCheckRoute (\MvcCore\IRoute & $route, array $additionalInfo) {
list ($requestMethod) = $additionalInfo;
$routeMethod = $route->GetMethod();
if ($routeMethod !== NULL && $routeMethod !== $requestMethod) return TRUE;
$modules = $route->GetAdvancedConfigProperty(\MvcCore\Ext\Rout... | php | protected function rewriteRoutingCheckRoute (\MvcCore\IRoute & $route, array $additionalInfo) {
list ($requestMethod) = $additionalInfo;
$routeMethod = $route->GetMethod();
if ($routeMethod !== NULL && $routeMethod !== $requestMethod) return TRUE;
$modules = $route->GetAdvancedConfigProperty(\MvcCore\Ext\Rout... | [
"protected",
"function",
"rewriteRoutingCheckRoute",
"(",
"\\",
"MvcCore",
"\\",
"IRoute",
"&",
"$",
"route",
",",
"array",
"$",
"additionalInfo",
")",
"{",
"list",
"(",
"$",
"requestMethod",
")",
"=",
"$",
"additionalInfo",
";",
"$",
"routeMethod",
"=",
"$"... | Return `TRUE` if there is possible by additional info array records
to route request by given route as first argument. For example if route
object has defined http method and request has the same method or not
or if route is allowed in currently routed module.
@param \MvcCore\IRoute $route
@param array $additionalInfo
... | [
"Return",
"TRUE",
"if",
"there",
"is",
"possible",
"by",
"additional",
"info",
"array",
"records",
"to",
"route",
"request",
"by",
"given",
"route",
"as",
"first",
"argument",
".",
"For",
"example",
"if",
"route",
"object",
"has",
"defined",
"http",
"method"... | train | https://github.com/mvccore/ext-router-module/blob/7695784a451db86cca6a43c98d076803cd0a50a7/src/MvcCore/Ext/Routers/Module/RewriteRoutingChecks.php#L27-L37 |
xiewulong/yii2-fileupload | oss/libs/symfony/event-dispatcher/Symfony/Component/EventDispatcher/GenericEvent.php | GenericEvent.getArgument | public function getArgument($key)
{
if ($this->hasArgument($key)) {
return $this->arguments[$key];
}
throw new \InvalidArgumentException(sprintf('%s not found in %s', $key, $this->getName()));
} | php | public function getArgument($key)
{
if ($this->hasArgument($key)) {
return $this->arguments[$key];
}
throw new \InvalidArgumentException(sprintf('%s not found in %s', $key, $this->getName()));
} | [
"public",
"function",
"getArgument",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasArgument",
"(",
"$",
"key",
")",
")",
"{",
"return",
"$",
"this",
"->",
"arguments",
"[",
"$",
"key",
"]",
";",
"}",
"throw",
"new",
"\\",
"InvalidArg... | Get argument by key.
@param string $key Key.
@throws \InvalidArgumentException If key is not found.
@return mixed Contents of array key. | [
"Get",
"argument",
"by",
"key",
"."
] | train | https://github.com/xiewulong/yii2-fileupload/blob/3e75b17a4a18dd8466e3f57c63136de03470ca82/oss/libs/symfony/event-dispatcher/Symfony/Component/EventDispatcher/GenericEvent.php#L68-L75 |
phPoirot/psr7 | UploadedFile.php | UploadedFile.moveTo | function moveTo($targetPath)
{
if ($this->isFileMoved)
throw new \RuntimeException('Cannot move file; already moved!');
$targetPath = (string) $targetPath;
if (empty($targetPath))
throw new \InvalidArgumentException(
'Invalid path provided for move o... | php | function moveTo($targetPath)
{
if ($this->isFileMoved)
throw new \RuntimeException('Cannot move file; already moved!');
$targetPath = (string) $targetPath;
if (empty($targetPath))
throw new \InvalidArgumentException(
'Invalid path provided for move o... | [
"function",
"moveTo",
"(",
"$",
"targetPath",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isFileMoved",
")",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"'Cannot move file; already moved!'",
")",
";",
"$",
"targetPath",
"=",
"(",
"string",
")",
"$",
"targetP... | {@inheritdoc}
@see http://php.net/is_uploaded_file
@see http://php.net/move_uploaded_file
@param string $targetPath Path to which to move the uploaded file.
@throws \InvalidArgumentException if the $path specified is invalid.
@throws \RuntimeException on any error during the move operation, or on
the second or subsequ... | [
"{",
"@inheritdoc",
"}"
] | train | https://github.com/phPoirot/psr7/blob/e90295e806dc2eb0cc422f315075f673c63a0780/UploadedFile.php#L73-L92 |
phPoirot/psr7 | UploadedFile.php | UploadedFile.getStream | function getStream()
{
if ($err = $this->getError() !== UPLOAD_ERR_OK)
// TODO Handle Upload With Exception Error
throw new \RuntimeException(sprintf(
'Cannot retrieve stream due to upload error. error: (%s).'
, getUploadErrorMessageFromCode($err)
... | php | function getStream()
{
if ($err = $this->getError() !== UPLOAD_ERR_OK)
// TODO Handle Upload With Exception Error
throw new \RuntimeException(sprintf(
'Cannot retrieve stream due to upload error. error: (%s).'
, getUploadErrorMessageFromCode($err)
... | [
"function",
"getStream",
"(",
")",
"{",
"if",
"(",
"$",
"err",
"=",
"$",
"this",
"->",
"getError",
"(",
")",
"!==",
"UPLOAD_ERR_OK",
")",
"// TODO Handle Upload With Exception Error",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"sprintf",
"(",
"'Cannot retrie... | Get Streamed Object Of Uploaded File
@return StreamInterface | [
"Get",
"Streamed",
"Object",
"Of",
"Uploaded",
"File"
] | train | https://github.com/phPoirot/psr7/blob/e90295e806dc2eb0cc422f315075f673c63a0780/UploadedFile.php#L99-L119 |
phPoirot/psr7 | UploadedFile.php | UploadedFile.setStream | protected function setStream($resource)
{
if (!$resource instanceof StreamInterface && ! is_resource($resource))
throw new \InvalidArgumentException(
'Stream must instance of StreamInterface or php resource.'
.' given: "%s"'
, \Poirot\Std\flatten($... | php | protected function setStream($resource)
{
if (!$resource instanceof StreamInterface && ! is_resource($resource))
throw new \InvalidArgumentException(
'Stream must instance of StreamInterface or php resource.'
.' given: "%s"'
, \Poirot\Std\flatten($... | [
"protected",
"function",
"setStream",
"(",
"$",
"resource",
")",
"{",
"if",
"(",
"!",
"$",
"resource",
"instanceof",
"StreamInterface",
"&&",
"!",
"is_resource",
"(",
"$",
"resource",
")",
")",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'Stream mu... | Set Stream
@param StreamInterface|resource $resource
@return $this | [
"Set",
"Stream"
] | train | https://github.com/phPoirot/psr7/blob/e90295e806dc2eb0cc422f315075f673c63a0780/UploadedFile.php#L171-L185 |
phPoirot/psr7 | UploadedFile.php | UploadedFile.setTmpName | protected function setTmpName($filepath)
{
$this->tmpName = (string) $filepath;
$this->stream = null;
$this->_c_givenResource = $filepath; # stream will made of this when requested
return $this;
} | php | protected function setTmpName($filepath)
{
$this->tmpName = (string) $filepath;
$this->stream = null;
$this->_c_givenResource = $filepath; # stream will made of this when requested
return $this;
} | [
"protected",
"function",
"setTmpName",
"(",
"$",
"filepath",
")",
"{",
"$",
"this",
"->",
"tmpName",
"=",
"(",
"string",
")",
"$",
"filepath",
";",
"$",
"this",
"->",
"stream",
"=",
"null",
";",
"$",
"this",
"->",
"_c_givenResource",
"=",
"$",
"filepat... | Set tmp_name of Uploaded File
@param string $filepath
@return $this | [
"Set",
"tmp_name",
"of",
"Uploaded",
"File"
] | train | https://github.com/phPoirot/psr7/blob/e90295e806dc2eb0cc422f315075f673c63a0780/UploadedFile.php#L194-L201 |
phPoirot/psr7 | UploadedFile.php | UploadedFile.setType | protected function setType($type)
{
if ($type == '*/*' || $type == 'application/octet-stream')
{
$type = \Module\HttpFoundation\getMimeTypeOfFile($this->getTmpName(), false);
if ( empty($type) )
if ( null !== $solved = \Module\HttpFoundation\getMimeTypeOfFile(... | php | protected function setType($type)
{
if ($type == '*/*' || $type == 'application/octet-stream')
{
$type = \Module\HttpFoundation\getMimeTypeOfFile($this->getTmpName(), false);
if ( empty($type) )
if ( null !== $solved = \Module\HttpFoundation\getMimeTypeOfFile(... | [
"protected",
"function",
"setType",
"(",
"$",
"type",
")",
"{",
"if",
"(",
"$",
"type",
"==",
"'*/*'",
"||",
"$",
"type",
"==",
"'application/octet-stream'",
")",
"{",
"$",
"type",
"=",
"\\",
"Module",
"\\",
"HttpFoundation",
"\\",
"getMimeTypeOfFile",
"("... | Set File Type
@param string $type
@return $this | [
"Set",
"File",
"Type"
] | train | https://github.com/phPoirot/psr7/blob/e90295e806dc2eb0cc422f315075f673c63a0780/UploadedFile.php#L243-L257 |
phPoirot/psr7 | UploadedFile.php | UploadedFile.setError | protected function setError($errorStatus)
{
# error status
if (! is_int($errorStatus)
|| 0 > $errorStatus
|| 8 < $errorStatus
)
throw new \InvalidArgumentException(
'Invalid error status for UploadedFile; must be an UPLOAD_ERR_* constant'
... | php | protected function setError($errorStatus)
{
# error status
if (! is_int($errorStatus)
|| 0 > $errorStatus
|| 8 < $errorStatus
)
throw new \InvalidArgumentException(
'Invalid error status for UploadedFile; must be an UPLOAD_ERR_* constant'
... | [
"protected",
"function",
"setError",
"(",
"$",
"errorStatus",
")",
"{",
"# error status",
"if",
"(",
"!",
"is_int",
"(",
"$",
"errorStatus",
")",
"||",
"0",
">",
"$",
"errorStatus",
"||",
"8",
"<",
"$",
"errorStatus",
")",
"throw",
"new",
"\\",
"InvalidA... | Set Error Status Code
@param int $errorStatus
@return $this | [
"Set",
"Error",
"Status",
"Code"
] | train | https://github.com/phPoirot/psr7/blob/e90295e806dc2eb0cc422f315075f673c63a0780/UploadedFile.php#L293-L306 |
unclecheese/silverstripe-blubber | code/CSSBlubberTask.php | CSSBlubberTask.index | public function index() {
$this->theme = Config::inst()->get('SSViewer', 'theme');
$this->cssDir = self::config()->theme_css_dir
? Controller::join_links(BASE_PATH, self::config()->theme_css_dir)
: Controller::join_links(BASE_PATH, $this->ThemeDir());
$this->gatherCSSFiles();
$this->output->wri... | php | public function index() {
$this->theme = Config::inst()->get('SSViewer', 'theme');
$this->cssDir = self::config()->theme_css_dir
? Controller::join_links(BASE_PATH, self::config()->theme_css_dir)
: Controller::join_links(BASE_PATH, $this->ThemeDir());
$this->gatherCSSFiles();
$this->output->wri... | [
"public",
"function",
"index",
"(",
")",
"{",
"$",
"this",
"->",
"theme",
"=",
"Config",
"::",
"inst",
"(",
")",
"->",
"get",
"(",
"'SSViewer'",
",",
"'theme'",
")",
";",
"$",
"this",
"->",
"cssDir",
"=",
"self",
"::",
"config",
"(",
")",
"->",
"... | Runs the task | [
"Runs",
"the",
"task"
] | train | https://github.com/unclecheese/silverstripe-blubber/blob/f2549bd5eddeb0ca0303a3c09be4a8136fcc6661/code/CSSBlubberTask.php#L83-L154 |
unclecheese/silverstripe-blubber | code/CSSBlubberTask.php | CSSBlubberTask.gatherCSSFiles | protected function gatherCSSFiles() {
$this->output->writeln('Scanning theme "'.$this->theme.'" for CSS files');
$this->finder
->files()
->in($this->themeDir)
->name('*.css')
->notName('*.blubber.css')
->notName('*.lean.css');
foreach($this->finder as $file) {
$filename = basename(... | php | protected function gatherCSSFiles() {
$this->output->writeln('Scanning theme "'.$this->theme.'" for CSS files');
$this->finder
->files()
->in($this->themeDir)
->name('*.css')
->notName('*.blubber.css')
->notName('*.lean.css');
foreach($this->finder as $file) {
$filename = basename(... | [
"protected",
"function",
"gatherCSSFiles",
"(",
")",
"{",
"$",
"this",
"->",
"output",
"->",
"writeln",
"(",
"'Scanning theme \"'",
".",
"$",
"this",
"->",
"theme",
".",
"'\" for CSS files'",
")",
";",
"$",
"this",
"->",
"finder",
"->",
"files",
"(",
")",
... | Collects all the CSS files per the user's approval | [
"Collects",
"all",
"the",
"CSS",
"files",
"per",
"the",
"user",
"s",
"approval"
] | train | https://github.com/unclecheese/silverstripe-blubber/blob/f2549bd5eddeb0ca0303a3c09be4a8136fcc6661/code/CSSBlubberTask.php#L159-L175 |
unclecheese/silverstripe-blubber | code/CSSBlubberTask.php | CSSBlubberTask.loadTemplates | protected function loadTemplates() {
$manifest = SS_TemplateLoader::instance()->getManifest();
$templates = $manifest->getTemplates();
$total = sizeof($templates);
$count = 0;
$this->output->clearProgress();
foreach($templates as $name => $data) {
foreach($manifest->getCandidateTemplate($name, $this... | php | protected function loadTemplates() {
$manifest = SS_TemplateLoader::instance()->getManifest();
$templates = $manifest->getTemplates();
$total = sizeof($templates);
$count = 0;
$this->output->clearProgress();
foreach($templates as $name => $data) {
foreach($manifest->getCandidateTemplate($name, $this... | [
"protected",
"function",
"loadTemplates",
"(",
")",
"{",
"$",
"manifest",
"=",
"SS_TemplateLoader",
"::",
"instance",
"(",
")",
"->",
"getManifest",
"(",
")",
";",
"$",
"templates",
"=",
"$",
"manifest",
"->",
"getTemplates",
"(",
")",
";",
"$",
"total",
... | Loads all the static .ss templates as HTML into memory | [
"Loads",
"all",
"the",
"static",
".",
"ss",
"templates",
"as",
"HTML",
"into",
"memory"
] | train | https://github.com/unclecheese/silverstripe-blubber/blob/f2549bd5eddeb0ca0303a3c09be4a8136fcc6661/code/CSSBlubberTask.php#L180-L196 |
unclecheese/silverstripe-blubber | code/CSSBlubberTask.php | CSSBlubberTask.loadURLs | protected function loadURLs() {
$omissions = self::config()->omit;
$dataobjects = self::config()->extra_dataobjects;
$i = 0;
$classes = ClassInfo::subclassesFor('SiteTree');
array_shift($classes);
$sampler = Sampler::create($classes)
->setDefaultLimit(self::config()->default_limit)
->setOmissi... | php | protected function loadURLs() {
$omissions = self::config()->omit;
$dataobjects = self::config()->extra_dataobjects;
$i = 0;
$classes = ClassInfo::subclassesFor('SiteTree');
array_shift($classes);
$sampler = Sampler::create($classes)
->setDefaultLimit(self::config()->default_limit)
->setOmissi... | [
"protected",
"function",
"loadURLs",
"(",
")",
"{",
"$",
"omissions",
"=",
"self",
"::",
"config",
"(",
")",
"->",
"omit",
";",
"$",
"dataobjects",
"=",
"self",
"::",
"config",
"(",
")",
"->",
"extra_dataobjects",
";",
"$",
"i",
"=",
"0",
";",
"$",
... | Loads all URLs to sample rendered content, per confirguration | [
"Loads",
"all",
"URLs",
"to",
"sample",
"rendered",
"content",
"per",
"confirguration"
] | train | https://github.com/unclecheese/silverstripe-blubber/blob/f2549bd5eddeb0ca0303a3c09be4a8136fcc6661/code/CSSBlubberTask.php#L201-L254 |
unclecheese/silverstripe-blubber | code/CSSBlubberTask.php | CSSBlubberTask.getSampleForObject | protected function getSampleForObject(DataObject $record) {
$response = Director::test($record->Link());
if($response->getStatusCode() === 200) {
return $response->getBody();
}
return false;
} | php | protected function getSampleForObject(DataObject $record) {
$response = Director::test($record->Link());
if($response->getStatusCode() === 200) {
return $response->getBody();
}
return false;
} | [
"protected",
"function",
"getSampleForObject",
"(",
"DataObject",
"$",
"record",
")",
"{",
"$",
"response",
"=",
"Director",
"::",
"test",
"(",
"$",
"record",
"->",
"Link",
"(",
")",
")",
";",
"if",
"(",
"$",
"response",
"->",
"getStatusCode",
"(",
")",
... | Given a DataObject, get an actual SS_HTTPResponse of rendered HTML
@param DataObject $record
@return string The rendered HTML | [
"Given",
"a",
"DataObject",
"get",
"an",
"actual",
"SS_HTTPResponse",
"of",
"rendered",
"HTML"
] | train | https://github.com/unclecheese/silverstripe-blubber/blob/f2549bd5eddeb0ca0303a3c09be4a8136fcc6661/code/CSSBlubberTask.php#L261-L269 |
GrupaZero/social | src/Gzero/Social/ServiceProvider.php | ServiceProvider.boot | public function boot()
{
$viewPath = __DIR__ . '/../../resources/views';
$translationPath = __DIR__ . '/../../resources/lang';
$this->loadMigrationsFrom(__DIR__ . '/../../../database/migrations');
$this->loadViewsFrom($viewPath, 'gzero-social');
$this->loadTranslations... | php | public function boot()
{
$viewPath = __DIR__ . '/../../resources/views';
$translationPath = __DIR__ . '/../../resources/lang';
$this->loadMigrationsFrom(__DIR__ . '/../../../database/migrations');
$this->loadViewsFrom($viewPath, 'gzero-social');
$this->loadTranslations... | [
"public",
"function",
"boot",
"(",
")",
"{",
"$",
"viewPath",
"=",
"__DIR__",
".",
"'/../../resources/views'",
";",
"$",
"translationPath",
"=",
"__DIR__",
".",
"'/../../resources/lang'",
";",
"$",
"this",
"->",
"loadMigrationsFrom",
"(",
"__DIR__",
".",
"'/../.... | Bootstrap the application events.
WARNING: Order of execution functions in boot is important, because we're using translations in our routes
@return void | [
"Bootstrap",
"the",
"application",
"events",
".",
"WARNING",
":",
"Order",
"of",
"execution",
"functions",
"in",
"boot",
"is",
"important",
"because",
"we",
"re",
"using",
"translations",
"in",
"our",
"routes"
] | train | https://github.com/GrupaZero/social/blob/f7cbf50765bd228010a2c61d950f915828306cf7/src/Gzero/Social/ServiceProvider.php#L53-L75 |
nabab/bbn | src/bbn/models/tts/optional.php | optional.optional_init | protected static function optional_init(){
if ( !self::$optional_is_init ){
$opt = bbn\appui\options::get_instance();
if ( !$opt ){
die("There is no options object as needed by ".__CLASS__);
}
if ( !\defined("BBN_APPUI") ){
\define('BBN_APPUI', $opt->from_code('appui'));
... | php | protected static function optional_init(){
if ( !self::$optional_is_init ){
$opt = bbn\appui\options::get_instance();
if ( !$opt ){
die("There is no options object as needed by ".__CLASS__);
}
if ( !\defined("BBN_APPUI") ){
\define('BBN_APPUI', $opt->from_code('appui'));
... | [
"protected",
"static",
"function",
"optional_init",
"(",
")",
"{",
"if",
"(",
"!",
"self",
"::",
"$",
"optional_is_init",
")",
"{",
"$",
"opt",
"=",
"bbn",
"\\",
"appui",
"\\",
"options",
"::",
"get_instance",
"(",
")",
";",
"if",
"(",
"!",
"$",
"opt... | Returns the option's root ID for the current class based on {@link $option_root_code}
@return false|int | [
"Returns",
"the",
"option",
"s",
"root",
"ID",
"for",
"the",
"current",
"class",
"based",
"on",
"{",
"@link",
"$option_root_code",
"}"
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/models/tts/optional.php#L36-L63 |
nabab/bbn | src/bbn/models/tts/optional.php | optional.get_appui_option_id | public static function get_appui_option_id(){
return bbn\appui\options::get_instance()->from_code(...self::_treat_args(func_get_args(), true));
} | php | public static function get_appui_option_id(){
return bbn\appui\options::get_instance()->from_code(...self::_treat_args(func_get_args(), true));
} | [
"public",
"static",
"function",
"get_appui_option_id",
"(",
")",
"{",
"return",
"bbn",
"\\",
"appui",
"\\",
"options",
"::",
"get_instance",
"(",
")",
"->",
"from_code",
"(",
"...",
"self",
"::",
"_treat_args",
"(",
"func_get_args",
"(",
")",
",",
"true",
... | Returns The option's ID of a category, i.e. direct children of option's root
@param string $code
@return int|false | [
"Returns",
"The",
"option",
"s",
"ID",
"of",
"a",
"category",
"i",
".",
"e",
".",
"direct",
"children",
"of",
"option",
"s",
"root"
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/models/tts/optional.php#L115-L117 |
php-lug/lug | src/Component/Grid/Model/Builder/BatchBuilder.php | BatchBuilder.build | public function build(array $config)
{
return new Batch(
$this->buildName($config),
$this->buildLabel($config),
$this->buildType($config),
$this->buildOptions($config)
);
} | php | public function build(array $config)
{
return new Batch(
$this->buildName($config),
$this->buildLabel($config),
$this->buildType($config),
$this->buildOptions($config)
);
} | [
"public",
"function",
"build",
"(",
"array",
"$",
"config",
")",
"{",
"return",
"new",
"Batch",
"(",
"$",
"this",
"->",
"buildName",
"(",
"$",
"config",
")",
",",
"$",
"this",
"->",
"buildLabel",
"(",
"$",
"config",
")",
",",
"$",
"this",
"->",
"bu... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Grid/Model/Builder/BatchBuilder.php#L25-L33 |
kusanagi/katana-sdk-php7 | src/Api/TypeCatalog.php | TypeCatalog.getDefault | public function getDefault(string $type)
{
switch ($type) {
case self::TYPE_NULL:
return null;
case self::TYPE_BOOLEAN:
return false;
case self::TYPE_INTEGER:
case self::TYPE_FLOAT:
return 0;
case sel... | php | public function getDefault(string $type)
{
switch ($type) {
case self::TYPE_NULL:
return null;
case self::TYPE_BOOLEAN:
return false;
case self::TYPE_INTEGER:
case self::TYPE_FLOAT:
return 0;
case sel... | [
"public",
"function",
"getDefault",
"(",
"string",
"$",
"type",
")",
"{",
"switch",
"(",
"$",
"type",
")",
"{",
"case",
"self",
"::",
"TYPE_NULL",
":",
"return",
"null",
";",
"case",
"self",
"::",
"TYPE_BOOLEAN",
":",
"return",
"false",
";",
"case",
"s... | Return the default value for a given type.
@param string $type
@return mixed
@throws InvalidValueException | [
"Return",
"the",
"default",
"value",
"for",
"a",
"given",
"type",
"."
] | train | https://github.com/kusanagi/katana-sdk-php7/blob/91e7860a1852c3ce79a7034f8c36f41840e69e1f/src/Api/TypeCatalog.php#L63-L82 |
kusanagi/katana-sdk-php7 | src/Api/TypeCatalog.php | TypeCatalog.validate | public function validate(string $type, $value): bool
{
switch ($type) {
case self::TYPE_NULL:
return is_null($value);
case self::TYPE_BOOLEAN:
return is_bool($value);
case self::TYPE_INTEGER:
return is_integer($value);
... | php | public function validate(string $type, $value): bool
{
switch ($type) {
case self::TYPE_NULL:
return is_null($value);
case self::TYPE_BOOLEAN:
return is_bool($value);
case self::TYPE_INTEGER:
return is_integer($value);
... | [
"public",
"function",
"validate",
"(",
"string",
"$",
"type",
",",
"$",
"value",
")",
":",
"bool",
"{",
"switch",
"(",
"$",
"type",
")",
"{",
"case",
"self",
"::",
"TYPE_NULL",
":",
"return",
"is_null",
"(",
"$",
"value",
")",
";",
"case",
"self",
... | Validates a value against a type.
@param mixed $value
@param string $type
@return bool
@throws InvalidValueException | [
"Validates",
"a",
"value",
"against",
"a",
"type",
"."
] | train | https://github.com/kusanagi/katana-sdk-php7/blob/91e7860a1852c3ce79a7034f8c36f41840e69e1f/src/Api/TypeCatalog.php#L92-L120 |
mustardandrew/muan-laravel-acl | src/Commands/Role/DetachPermissionCommand.php | DetachPermissionCommand.handle | public function handle()
{
$roleName = $this->argument('role');
if (! $role = Role::whereName($roleName)->first()) {
$this->warn("Role {$roleName} not exists.");
return 1;
}
$attachList = array_merge($this->option('id'), $this->option('name'));
$rol... | php | public function handle()
{
$roleName = $this->argument('role');
if (! $role = Role::whereName($roleName)->first()) {
$this->warn("Role {$roleName} not exists.");
return 1;
}
$attachList = array_merge($this->option('id'), $this->option('name'));
$rol... | [
"public",
"function",
"handle",
"(",
")",
"{",
"$",
"roleName",
"=",
"$",
"this",
"->",
"argument",
"(",
"'role'",
")",
";",
"if",
"(",
"!",
"$",
"role",
"=",
"Role",
"::",
"whereName",
"(",
"$",
"roleName",
")",
"->",
"first",
"(",
")",
")",
"{"... | Execute the console command.
@return mixed | [
"Execute",
"the",
"console",
"command",
"."
] | train | https://github.com/mustardandrew/muan-laravel-acl/blob/b5f23340b5536babb98d9fd0d727a7a3371c97d5/src/Commands/Role/DetachPermissionCommand.php#L36-L51 |
j-d/draggy | src/Draggy/Autocode/Templates/Java/Entity.php | Entity.getAttributeDocumentationLinesBasePart | public function getAttributeDocumentationLinesBasePart(JavaAttribute $attribute)
{
$lines = [];
if (null !== $attribute->getDescription()) {
$lines[] = $attribute->getDescription();
$lines[] = '';
}
$lines[] = '@var ' . $attribute->getType() . ' ' . $attribu... | php | public function getAttributeDocumentationLinesBasePart(JavaAttribute $attribute)
{
$lines = [];
if (null !== $attribute->getDescription()) {
$lines[] = $attribute->getDescription();
$lines[] = '';
}
$lines[] = '@var ' . $attribute->getType() . ' ' . $attribu... | [
"public",
"function",
"getAttributeDocumentationLinesBasePart",
"(",
"JavaAttribute",
"$",
"attribute",
")",
"{",
"$",
"lines",
"=",
"[",
"]",
";",
"if",
"(",
"null",
"!==",
"$",
"attribute",
"->",
"getDescription",
"(",
")",
")",
"{",
"$",
"lines",
"[",
"... | <editor-fold desc="Attributes"> | [
"<editor",
"-",
"fold",
"desc",
"=",
"Attributes",
">"
] | train | https://github.com/j-d/draggy/blob/97ffc66e1aacb5f685d7aac5251c4abb8888d4bb/src/Draggy/Autocode/Templates/Java/Entity.php#L86-L98 |
j-d/draggy | src/Draggy/Autocode/Templates/Java/Entity.php | Entity.getSetterCodeDocumentationParameterLines | public function getSetterCodeDocumentationParameterLines(JavaAttribute $attribute)
{
$lines = [];
$lines[] = '@param ' . $attribute->getType() . ' ' . $attribute->getLowerFullName();
return $lines;
} | php | public function getSetterCodeDocumentationParameterLines(JavaAttribute $attribute)
{
$lines = [];
$lines[] = '@param ' . $attribute->getType() . ' ' . $attribute->getLowerFullName();
return $lines;
} | [
"public",
"function",
"getSetterCodeDocumentationParameterLines",
"(",
"JavaAttribute",
"$",
"attribute",
")",
"{",
"$",
"lines",
"=",
"[",
"]",
";",
"$",
"lines",
"[",
"]",
"=",
"'@param '",
".",
"$",
"attribute",
"->",
"getType",
"(",
")",
".",
"' '",
".... | <editor-fold desc="Setters"> | [
"<editor",
"-",
"fold",
"desc",
"=",
"Setters",
">"
] | train | https://github.com/j-d/draggy/blob/97ffc66e1aacb5f685d7aac5251c4abb8888d4bb/src/Draggy/Autocode/Templates/Java/Entity.php#L122-L129 |
j-d/draggy | src/Draggy/Autocode/Templates/Java/Entity.php | Entity.getGetterCodeDocumentationLines | public function getGetterCodeDocumentationLines(JavaAttribute $attribute)
{
$lines = [];
$lines[] = 'Get ' . $attribute->getLowerFullName();
$lines[] = '';
$lines[] = '@return ' . ('object' === $attribute->getType() ? $attribute->getEntitySubtype()->getName() : $attribute->getType()... | php | public function getGetterCodeDocumentationLines(JavaAttribute $attribute)
{
$lines = [];
$lines[] = 'Get ' . $attribute->getLowerFullName();
$lines[] = '';
$lines[] = '@return ' . ('object' === $attribute->getType() ? $attribute->getEntitySubtype()->getName() : $attribute->getType()... | [
"public",
"function",
"getGetterCodeDocumentationLines",
"(",
"JavaAttribute",
"$",
"attribute",
")",
"{",
"$",
"lines",
"=",
"[",
"]",
";",
"$",
"lines",
"[",
"]",
"=",
"'Get '",
".",
"$",
"attribute",
"->",
"getLowerFullName",
"(",
")",
";",
"$",
"lines"... | <editor-fold desc="Getters"> | [
"<editor",
"-",
"fold",
"desc",
"=",
"Getters",
">"
] | train | https://github.com/j-d/draggy/blob/97ffc66e1aacb5f685d7aac5251c4abb8888d4bb/src/Draggy/Autocode/Templates/Java/Entity.php#L195-L204 |
j-d/draggy | src/Draggy/Autocode/Templates/Java/Entity.php | Entity.getEntityToStringDocumentationLines | public function getEntityToStringDocumentationLines()
{
$lines = [];
$line = $this->getEntity()->getName() . ' to string ';
$line .= null === $this->getEntity()->getToString()
? '(Default)'
: '(' . $this->getEntity()->getToString() . ')';
$lines[] = $line;... | php | public function getEntityToStringDocumentationLines()
{
$lines = [];
$line = $this->getEntity()->getName() . ' to string ';
$line .= null === $this->getEntity()->getToString()
? '(Default)'
: '(' . $this->getEntity()->getToString() . ')';
$lines[] = $line;... | [
"public",
"function",
"getEntityToStringDocumentationLines",
"(",
")",
"{",
"$",
"lines",
"=",
"[",
"]",
";",
"$",
"line",
"=",
"$",
"this",
"->",
"getEntity",
"(",
")",
"->",
"getName",
"(",
")",
".",
"' to string '",
";",
"$",
"line",
".=",
"null",
"... | <editor-fold desc="toString"> | [
"<editor",
"-",
"fold",
"desc",
"=",
"toString",
">"
] | train | https://github.com/j-d/draggy/blob/97ffc66e1aacb5f685d7aac5251c4abb8888d4bb/src/Draggy/Autocode/Templates/Java/Entity.php#L231-L248 |
crysalead/inflector | src/Inflector.php | Inflector.camelize | public static function camelize($word)
{
$upper = function($matches) {
return strtoupper($matches[0]);
};
$word = preg_replace('/([a-z])([A-Z])/', '$1_$2', $word);
$camelized = str_replace(' ', '', ucwords(str_replace(['_', '-'], ' ', strtolower($word))));
return ... | php | public static function camelize($word)
{
$upper = function($matches) {
return strtoupper($matches[0]);
};
$word = preg_replace('/([a-z])([A-Z])/', '$1_$2', $word);
$camelized = str_replace(' ', '', ucwords(str_replace(['_', '-'], ' ', strtolower($word))));
return ... | [
"public",
"static",
"function",
"camelize",
"(",
"$",
"word",
")",
"{",
"$",
"upper",
"=",
"function",
"(",
"$",
"matches",
")",
"{",
"return",
"strtoupper",
"(",
"$",
"matches",
"[",
"0",
"]",
")",
";",
"}",
";",
"$",
"word",
"=",
"preg_replace",
... | Takes a under_scored word and turns it into a camelcased word.
@param string $word An underscored or slugged word (i.e. `'red_bike'` or `'red-bike'`).
@param array $on List of characters to camelize on.
@return string Camel cased version of the word (i.e. `'RedBike'`). | [
"Takes",
"a",
"under_scored",
"word",
"and",
"turns",
"it",
"into",
"a",
"camelcased",
"word",
"."
] | train | https://github.com/crysalead/inflector/blob/07a890c43debebcfaeffe1c30a504f954e9a463c/src/Inflector.php#L29-L37 |
crysalead/inflector | src/Inflector.php | Inflector.slug | public static function slug($string, $replacement = '-')
{
$transliterated = static::transliterate($string);
$spaced = preg_replace('/[^\w\s]/', ' ', $transliterated);
return preg_replace('/\\s+/', $replacement, trim($spaced));
} | php | public static function slug($string, $replacement = '-')
{
$transliterated = static::transliterate($string);
$spaced = preg_replace('/[^\w\s]/', ' ', $transliterated);
return preg_replace('/\\s+/', $replacement, trim($spaced));
} | [
"public",
"static",
"function",
"slug",
"(",
"$",
"string",
",",
"$",
"replacement",
"=",
"'-'",
")",
"{",
"$",
"transliterated",
"=",
"static",
"::",
"transliterate",
"(",
"$",
"string",
")",
";",
"$",
"spaced",
"=",
"preg_replace",
"(",
"'/[^\\w\\s]/'",
... | Returns a string with all spaces converted to given replacement and non word characters removed.
Maps special characters to ASCII using `transliterator_transliterate`.
@param string $string An arbitrary string to convert.
@param string $replacement The replacement to use for spaces.
@return string ... | [
"Returns",
"a",
"string",
"with",
"all",
"spaces",
"converted",
"to",
"given",
"replacement",
"and",
"non",
"word",
"characters",
"removed",
".",
"Maps",
"special",
"characters",
"to",
"ASCII",
"using",
"transliterator_transliterate",
"."
] | train | https://github.com/crysalead/inflector/blob/07a890c43debebcfaeffe1c30a504f954e9a463c/src/Inflector.php#L81-L86 |
crysalead/inflector | src/Inflector.php | Inflector.parameterize | public static function parameterize($string, $replacement = '-')
{
$transliterated = static::transliterate($string);
return strtolower(static::slug($string, $replacement));
} | php | public static function parameterize($string, $replacement = '-')
{
$transliterated = static::transliterate($string);
return strtolower(static::slug($string, $replacement));
} | [
"public",
"static",
"function",
"parameterize",
"(",
"$",
"string",
",",
"$",
"replacement",
"=",
"'-'",
")",
"{",
"$",
"transliterated",
"=",
"static",
"::",
"transliterate",
"(",
"$",
"string",
")",
";",
"return",
"strtolower",
"(",
"static",
"::",
"slug... | Returns a lowercased string with all spaces converted to given replacement and non word characters removed.
Maps special characters to ASCII using `transliterator_transliterate`.
@param string $string An arbitrary string to convert.
@param string $replacement The replacement to use for spaces.
@return string ... | [
"Returns",
"a",
"lowercased",
"string",
"with",
"all",
"spaces",
"converted",
"to",
"given",
"replacement",
"and",
"non",
"word",
"characters",
"removed",
".",
"Maps",
"special",
"characters",
"to",
"ASCII",
"using",
"transliterator_transliterate",
"."
] | train | https://github.com/crysalead/inflector/blob/07a890c43debebcfaeffe1c30a504f954e9a463c/src/Inflector.php#L96-L100 |
crysalead/inflector | src/Inflector.php | Inflector._inflect | protected static function _inflect($type, $rule, $replacement, $locale)
{
$rules = & static::${$type};
if (!isset($rules[$locale])) {
$rules[$locale] = [];
}
$rules[$locale] = [$rule => $replacement] + $rules[$locale];
} | php | protected static function _inflect($type, $rule, $replacement, $locale)
{
$rules = & static::${$type};
if (!isset($rules[$locale])) {
$rules[$locale] = [];
}
$rules[$locale] = [$rule => $replacement] + $rules[$locale];
} | [
"protected",
"static",
"function",
"_inflect",
"(",
"$",
"type",
",",
"$",
"rule",
",",
"$",
"replacement",
",",
"$",
"locale",
")",
"{",
"$",
"rules",
"=",
"&",
"static",
"::",
"$",
"{",
"$",
"type",
"}",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
... | Set a new inflection rule and its replacement.
@param string $type The inflection type.
@param string $rule A regular expression.
@param string $replacement The replacement expression.
@param string $locale The locale where this rule will be applied. | [
"Set",
"a",
"new",
"inflection",
"rule",
"and",
"its",
"replacement",
"."
] | train | https://github.com/crysalead/inflector/blob/07a890c43debebcfaeffe1c30a504f954e9a463c/src/Inflector.php#L159-L166 |
crysalead/inflector | src/Inflector.php | Inflector._inflectize | protected static function _inflectize($rules, $word, $locale)
{
if (!$word || !isset($rules[$locale])) {
return $word;
}
$result = $word;
foreach ($rules[$locale] as $rule => $replacement) {
$result = preg_replace($rule, $replacement, $word, -1, $count);
... | php | protected static function _inflectize($rules, $word, $locale)
{
if (!$word || !isset($rules[$locale])) {
return $word;
}
$result = $word;
foreach ($rules[$locale] as $rule => $replacement) {
$result = preg_replace($rule, $replacement, $word, -1, $count);
... | [
"protected",
"static",
"function",
"_inflectize",
"(",
"$",
"rules",
",",
"$",
"word",
",",
"$",
"locale",
")",
"{",
"if",
"(",
"!",
"$",
"word",
"||",
"!",
"isset",
"(",
"$",
"rules",
"[",
"$",
"locale",
"]",
")",
")",
"{",
"return",
"$",
"word"... | Changes the form of a word.
@param string $rules The inflection rules array.
@param string $word A word.
@param string $locale The locale to use for rules.
@return string The inflectized word. | [
"Changes",
"the",
"form",
"of",
"a",
"word",
"."
] | train | https://github.com/crysalead/inflector/blob/07a890c43debebcfaeffe1c30a504f954e9a463c/src/Inflector.php#L202-L215 |
crysalead/inflector | src/Inflector.php | Inflector.irregular | public static function irregular($singular, $plural, $locale = 'default')
{
$rules = !is_array($singular) ? [$singular => $plural] : $singular;
$len = min(strlen($singular), strlen($plural));
$prefix = '';
$index = 0;
while ($index < $len && ($singular[$index] === $plural[$... | php | public static function irregular($singular, $plural, $locale = 'default')
{
$rules = !is_array($singular) ? [$singular => $plural] : $singular;
$len = min(strlen($singular), strlen($plural));
$prefix = '';
$index = 0;
while ($index < $len && ($singular[$index] === $plural[$... | [
"public",
"static",
"function",
"irregular",
"(",
"$",
"singular",
",",
"$",
"plural",
",",
"$",
"locale",
"=",
"'default'",
")",
"{",
"$",
"rules",
"=",
"!",
"is_array",
"(",
"$",
"singular",
")",
"?",
"[",
"$",
"singular",
"=>",
"$",
"plural",
"]",... | Set a new exception in inflection.
@param string $singular The singular form of the word.
@param string $plural The plural form of the word.
@param string $locale The locale where this irregularity will be applied. | [
"Set",
"a",
"new",
"exception",
"in",
"inflection",
"."
] | train | https://github.com/crysalead/inflector/blob/07a890c43debebcfaeffe1c30a504f954e9a463c/src/Inflector.php#L224-L247 |
crysalead/inflector | src/Inflector.php | Inflector.reset | public static function reset($lang = null)
{
if (is_string($lang)) {
unset(static::$_singular[$lang]);
unset(static::$_plural[$lang]);
return;
}
static::$_singular = [];
static::$_plural = [];
if ($lang === true) {
return;
... | php | public static function reset($lang = null)
{
if (is_string($lang)) {
unset(static::$_singular[$lang]);
unset(static::$_plural[$lang]);
return;
}
static::$_singular = [];
static::$_plural = [];
if ($lang === true) {
return;
... | [
"public",
"static",
"function",
"reset",
"(",
"$",
"lang",
"=",
"null",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"lang",
")",
")",
"{",
"unset",
"(",
"static",
"::",
"$",
"_singular",
"[",
"$",
"lang",
"]",
")",
";",
"unset",
"(",
"static",
":... | Clears all inflection rules.
@param string|boolean $lang The language name to reset or `true` to reset all even defaults. | [
"Clears",
"all",
"inflection",
"rules",
"."
] | train | https://github.com/crysalead/inflector/blob/07a890c43debebcfaeffe1c30a504f954e9a463c/src/Inflector.php#L266-L464 |
jasny/controller | src/Controller/View/Twig.php | Twig.getViewer | public function getViewer()
{
if (!isset($this->viewer)) {
$this->viewer = $this->createTwigView(['path' => $this->getViewPath()]);
$this->viewer->addDefaultExtensions();
}
return $this->viewer;
} | php | public function getViewer()
{
if (!isset($this->viewer)) {
$this->viewer = $this->createTwigView(['path' => $this->getViewPath()]);
$this->viewer->addDefaultExtensions();
}
return $this->viewer;
} | [
"public",
"function",
"getViewer",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"viewer",
")",
")",
"{",
"$",
"this",
"->",
"viewer",
"=",
"$",
"this",
"->",
"createTwigView",
"(",
"[",
"'path'",
"=>",
"$",
"this",
"->",
"getView... | Get the template engine abstraction
@return TwigView | [
"Get",
"the",
"template",
"engine",
"abstraction"
] | train | https://github.com/jasny/controller/blob/28edf64343f1d8218c166c0c570128e1ee6153d8/src/Controller/View/Twig.php#L20-L28 |
Eresus/EresusCMS | src/core/Client/FrontController.php | Eresus_Client_FrontController.dispatch | public function dispatch()
{
Eresus_Kernel::log(__METHOD__, LOG_DEBUG, 'starting...');
/** @var TClientUI $page */
$page = $this->getPage();
$response = $page->render($this->getRequest());
Eresus_Kernel::log(__METHOD__, LOG_DEBUG, 'done');
return $response;
} | php | public function dispatch()
{
Eresus_Kernel::log(__METHOD__, LOG_DEBUG, 'starting...');
/** @var TClientUI $page */
$page = $this->getPage();
$response = $page->render($this->getRequest());
Eresus_Kernel::log(__METHOD__, LOG_DEBUG, 'done');
return $response;
} | [
"public",
"function",
"dispatch",
"(",
")",
"{",
"Eresus_Kernel",
"::",
"log",
"(",
"__METHOD__",
",",
"LOG_DEBUG",
",",
"'starting...'",
")",
";",
"/** @var TClientUI $page */",
"$",
"page",
"=",
"$",
"this",
"->",
"getPage",
"(",
")",
";",
"$",
"response",... | Выполняет действия контроллера и возвращает ответ
@return Eresus_HTTP_Response
@since 3.01 | [
"Выполняет",
"действия",
"контроллера",
"и",
"возвращает",
"ответ"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/Client/FrontController.php#L43-L52 |
ShaoZeMing/laravel-merchant | src/Form/Field/HasMany.php | HasMany.setupScriptForDefaultView | protected function setupScriptForDefaultView($templateScript)
{
$removeClass = NestedForm::REMOVE_FLAG_CLASS;
$defaultKey = NestedForm::DEFAULT_KEY_NAME;
/**
* When add a new sub form, replace all element key in new sub form.
*
* @example comments[new___key__][tit... | php | protected function setupScriptForDefaultView($templateScript)
{
$removeClass = NestedForm::REMOVE_FLAG_CLASS;
$defaultKey = NestedForm::DEFAULT_KEY_NAME;
/**
* When add a new sub form, replace all element key in new sub form.
*
* @example comments[new___key__][tit... | [
"protected",
"function",
"setupScriptForDefaultView",
"(",
"$",
"templateScript",
")",
"{",
"$",
"removeClass",
"=",
"NestedForm",
"::",
"REMOVE_FLAG_CLASS",
";",
"$",
"defaultKey",
"=",
"NestedForm",
"::",
"DEFAULT_KEY_NAME",
";",
"/**\n * When add a new sub form... | Setup default template script.
@param string $templateScript
@return void | [
"Setup",
"default",
"template",
"script",
"."
] | train | https://github.com/ShaoZeMing/laravel-merchant/blob/20801b1735e7832a6e58b37c2c391328f8d626fa/src/Form/Field/HasMany.php#L391-L424 |
dragonmantank/fillet | src/Fillet/Parser/WordpressExport.php | WordpressExport.parse | public function parse($inputFile)
{
$DCNamespace = 'http://purl.org/rss/1.0/modules/content/';
$WPNamespace = 'http://wordpress.org/export/1.2/';
$reader = new \XMLReader();
$dom = new \DOMDocument('1.0', 'UTF-8');
$reader->open($inputFile);
while ($reader->read() &&... | php | public function parse($inputFile)
{
$DCNamespace = 'http://purl.org/rss/1.0/modules/content/';
$WPNamespace = 'http://wordpress.org/export/1.2/';
$reader = new \XMLReader();
$dom = new \DOMDocument('1.0', 'UTF-8');
$reader->open($inputFile);
while ($reader->read() &&... | [
"public",
"function",
"parse",
"(",
"$",
"inputFile",
")",
"{",
"$",
"DCNamespace",
"=",
"'http://purl.org/rss/1.0/modules/content/'",
";",
"$",
"WPNamespace",
"=",
"'http://wordpress.org/export/1.2/'",
";",
"$",
"reader",
"=",
"new",
"\\",
"XMLReader",
"(",
")",
... | Parses a specific XML file
@param string $inputFile File to parse
@return \Generator | [
"Parses",
"a",
"specific",
"XML",
"file"
] | train | https://github.com/dragonmantank/fillet/blob/b197947608c05ac2318e8f6b296345494004d9c6/src/Fillet/Parser/WordpressExport.php#L18-L61 |
david-mk/mail-map | src/MailMap/MailMap.php | MailMap.query | public function query($inbox = 'INBOX', callable $queryCall = null)
{
$query = new Query;
if (!is_null($queryCall)) {
$query = $queryCall($query);
}
return $query->get($this->factory->create($inbox), $this->mailFactory);
} | php | public function query($inbox = 'INBOX', callable $queryCall = null)
{
$query = new Query;
if (!is_null($queryCall)) {
$query = $queryCall($query);
}
return $query->get($this->factory->create($inbox), $this->mailFactory);
} | [
"public",
"function",
"query",
"(",
"$",
"inbox",
"=",
"'INBOX'",
",",
"callable",
"$",
"queryCall",
"=",
"null",
")",
"{",
"$",
"query",
"=",
"new",
"Query",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"queryCall",
")",
")",
"{",
"$",
"query",
"=",
... | Execute query on a new connection and wrap results in Mail wrappers.
Provide a callable to set conditions, sorting, and limits on query.
The query instance will be provided as the single arguement to the
callable.
@param string $inbox
@param callable $queryCall
@return array | [
"Execute",
"query",
"on",
"a",
"new",
"connection",
"and",
"wrap",
"results",
"in",
"Mail",
"wrappers",
"."
] | train | https://github.com/david-mk/mail-map/blob/4eea346ece9fa35c0d309b5a909f657ad83e1e6a/src/MailMap/MailMap.php#L53-L62 |
ekuiter/feature-php | FeaturePhp/Model/XmlConfiguration.php | XmlConfiguration.fromString | public static function fromString($str, $directory = null) {
return new self((new fphp\Helper\XmlParser())->parseString($str));
} | php | public static function fromString($str, $directory = null) {
return new self((new fphp\Helper\XmlParser())->parseString($str));
} | [
"public",
"static",
"function",
"fromString",
"(",
"$",
"str",
",",
"$",
"directory",
"=",
"null",
")",
"{",
"return",
"new",
"self",
"(",
"(",
"new",
"fphp",
"\\",
"Helper",
"\\",
"XmlParser",
"(",
")",
")",
"->",
"parseString",
"(",
"$",
"str",
")"... | Creates an XML configuration from an XML string.
@param string $str
@param string $directory ignored
@return XmlConfiguration | [
"Creates",
"an",
"XML",
"configuration",
"from",
"an",
"XML",
"string",
"."
] | train | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Model/XmlConfiguration.php#L85-L87 |
ekuiter/feature-php | FeaturePhp/Model/XmlConfiguration.php | XmlConfiguration.fromRequest | public static function fromRequest($key, $allowEmpty = false) {
if (empty($_REQUEST[$key]) && !$allowEmpty)
throw new XmlConfigurationException("no configuration in request");
else if (empty($_REQUEST[$key]))
return self::emptyInstance();
else
$str = $_REQUEST... | php | public static function fromRequest($key, $allowEmpty = false) {
if (empty($_REQUEST[$key]) && !$allowEmpty)
throw new XmlConfigurationException("no configuration in request");
else if (empty($_REQUEST[$key]))
return self::emptyInstance();
else
$str = $_REQUEST... | [
"public",
"static",
"function",
"fromRequest",
"(",
"$",
"key",
",",
"$",
"allowEmpty",
"=",
"false",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"_REQUEST",
"[",
"$",
"key",
"]",
")",
"&&",
"!",
"$",
"allowEmpty",
")",
"throw",
"new",
"XmlConfigurationExc... | Creates an XML configuration from a request variable.
For simple usage, the configuration can be read from GET, POST or cookie.
A note on security: This function is safe to use in production scenarios
(assuming the safety of the SimpleXML parser) because a configuration is
always validated against the feature model.
@p... | [
"Creates",
"an",
"XML",
"configuration",
"from",
"a",
"request",
"variable",
".",
"For",
"simple",
"usage",
"the",
"configuration",
"can",
"be",
"read",
"from",
"GET",
"POST",
"or",
"cookie",
".",
"A",
"note",
"on",
"security",
":",
"This",
"function",
"is... | train | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Model/XmlConfiguration.php#L99-L107 |
shabbyrobe/amiss | src/Sql/Type/Date.php | Date.prepareDateTime | protected function prepareDateTime($value)
{
if ($this->requireAppTimeZone && !static::timeZoneEqual($value->getTimeZone(), $this->appTimeZone)) {
// Actually performing this conversion may not be an issue. Wait
// until it is raised before making a decision.
throw new \U... | php | protected function prepareDateTime($value)
{
if ($this->requireAppTimeZone && !static::timeZoneEqual($value->getTimeZone(), $this->appTimeZone)) {
// Actually performing this conversion may not be an issue. Wait
// until it is raised before making a decision.
throw new \U... | [
"protected",
"function",
"prepareDateTime",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"requireAppTimeZone",
"&&",
"!",
"static",
"::",
"timeZoneEqual",
"(",
"$",
"value",
"->",
"getTimeZone",
"(",
")",
",",
"$",
"this",
"->",
"appTimeZone"... | Don't type hint here - there's no common interface between DateTime and DateTimeImmutable
at 5.6 that supports all the methods we are using, though both objects remain largely interchangeable. | [
"Don",
"t",
"type",
"hint",
"here",
"-",
"there",
"s",
"no",
"common",
"interface",
"between",
"DateTime",
"and",
"DateTimeImmutable",
"at",
"5",
".",
"6",
"that",
"supports",
"all",
"the",
"methods",
"we",
"are",
"using",
"though",
"both",
"objects",
"rem... | train | https://github.com/shabbyrobe/amiss/blob/ba261f0d1f985ed36e9fd2903ac0df86c5b9498d/src/Sql/Type/Date.php#L140-L155 |
soloproyectos-php/text-parser | src/text/parser/TextParser.php | TextParser.parse | public function parse($string = "")
{
if (func_num_args() > 0) {
$this->string = $string;
$this->offset = 0;
}
$ungreedy = TextParser::UNGREEDY & $this->_flags;
$ret = $this->evaluate();
if ($ret) {
if ($this->_target instanceof TextParse... | php | public function parse($string = "")
{
if (func_num_args() > 0) {
$this->string = $string;
$this->offset = 0;
}
$ungreedy = TextParser::UNGREEDY & $this->_flags;
$ret = $this->evaluate();
if ($ret) {
if ($this->_target instanceof TextParse... | [
"public",
"function",
"parse",
"(",
"$",
"string",
"=",
"\"\"",
")",
"{",
"if",
"(",
"func_num_args",
"(",
")",
">",
"0",
")",
"{",
"$",
"this",
"->",
"string",
"=",
"$",
"string",
";",
"$",
"this",
"->",
"offset",
"=",
"0",
";",
"}",
"$",
"ung... | Parses a string.
This function parses a string and throws an exception if unsuccessful.
For example:
```php
// parses a string
$p = new MyCustomParser($string);
try {
$info = $p->parse();
} catch(TextParserException $e) {
echo $e->getPrintableMessage();
}
if (!$info) {
echo "This is not a valid expressión";
} else {... | [
"Parses",
"a",
"string",
"."
] | train | https://github.com/soloproyectos-php/text-parser/blob/3ef2e8a26f7c53b170383d74ccf4106b0f3dd8b1/src/text/parser/TextParser.php#L100-L119 |
soloproyectos-php/text-parser | src/text/parser/TextParser.php | TextParser.is | protected function is($methodName /*, $arg1, $arg2, $arg3 ... */)
{
if (!method_exists($this, $methodName)) {
throw new TextParserException(
"The method `$methodName` does not exist"
);
}
if (!is_callable(array($this, $methodName))) {
thro... | php | protected function is($methodName /*, $arg1, $arg2, $arg3 ... */)
{
if (!method_exists($this, $methodName)) {
throw new TextParserException(
"The method `$methodName` does not exist"
);
}
if (!is_callable(array($this, $methodName))) {
thro... | [
"protected",
"function",
"is",
"(",
"$",
"methodName",
"/*, $arg1, $arg2, $arg3 ... */",
")",
"{",
"if",
"(",
"!",
"method_exists",
"(",
"$",
"this",
",",
"$",
"methodName",
")",
")",
"{",
"throw",
"new",
"TextParserException",
"(",
"\"The method `$methodName` doe... | Does the next thing satisfies a given method?
Matches the string against a function and moves the offset forward if the
function returns true.
@param string $methodName Method name
@throws TextParserException
@return mixed | [
"Does",
"the",
"next",
"thing",
"satisfies",
"a",
"given",
"method?"
] | train | https://github.com/soloproyectos-php/text-parser/blob/3ef2e8a26f7c53b170383d74ccf4106b0f3dd8b1/src/text/parser/TextParser.php#L132-L161 |
php-lug/lug | src/Bundle/ResourceBundle/Routing/ParameterResolver.php | ParameterResolver.resolveApi | public function resolveApi()
{
if (($request = $this->resolveRequest()) === null) {
return true;
}
return $this->resolveParameter('api', false) || $request->getRequestFormat() !== 'html';
} | php | public function resolveApi()
{
if (($request = $this->resolveRequest()) === null) {
return true;
}
return $this->resolveParameter('api', false) || $request->getRequestFormat() !== 'html';
} | [
"public",
"function",
"resolveApi",
"(",
")",
"{",
"if",
"(",
"(",
"$",
"request",
"=",
"$",
"this",
"->",
"resolveRequest",
"(",
")",
")",
"===",
"null",
")",
"{",
"return",
"true",
";",
"}",
"return",
"$",
"this",
"->",
"resolveParameter",
"(",
"'a... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/ResourceBundle/Routing/ParameterResolver.php#L49-L56 |
php-lug/lug | src/Bundle/ResourceBundle/Routing/ParameterResolver.php | ParameterResolver.resolveCriteria | public function resolveCriteria($mandatory = false)
{
if (($request = $this->resolveRequest()) === null) {
if ($mandatory) {
throw new RequestNotFoundException();
}
return [];
}
$value = $this->resolveParameter('criteria', ['id']);
... | php | public function resolveCriteria($mandatory = false)
{
if (($request = $this->resolveRequest()) === null) {
if ($mandatory) {
throw new RequestNotFoundException();
}
return [];
}
$value = $this->resolveParameter('criteria', ['id']);
... | [
"public",
"function",
"resolveCriteria",
"(",
"$",
"mandatory",
"=",
"false",
")",
"{",
"if",
"(",
"(",
"$",
"request",
"=",
"$",
"this",
"->",
"resolveRequest",
"(",
")",
")",
"===",
"null",
")",
"{",
"if",
"(",
"$",
"mandatory",
")",
"{",
"throw",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/ResourceBundle/Routing/ParameterResolver.php#L61-L97 |
php-lug/lug | src/Bundle/ResourceBundle/Routing/ParameterResolver.php | ParameterResolver.resolveGrid | public function resolveGrid(ResourceInterface $resource)
{
if (($request = $this->resolveRequest()) === null) {
throw new RequestNotFoundException();
}
return array_merge(['resource' => $resource], $this->resolveParameter('grid', []));
} | php | public function resolveGrid(ResourceInterface $resource)
{
if (($request = $this->resolveRequest()) === null) {
throw new RequestNotFoundException();
}
return array_merge(['resource' => $resource], $this->resolveParameter('grid', []));
} | [
"public",
"function",
"resolveGrid",
"(",
"ResourceInterface",
"$",
"resource",
")",
"{",
"if",
"(",
"(",
"$",
"request",
"=",
"$",
"this",
"->",
"resolveRequest",
"(",
")",
")",
"===",
"null",
")",
"{",
"throw",
"new",
"RequestNotFoundException",
"(",
")"... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/ResourceBundle/Routing/ParameterResolver.php#L124-L131 |
php-lug/lug | src/Bundle/ResourceBundle/Routing/ParameterResolver.php | ParameterResolver.resolveLocationRoute | public function resolveLocationRoute()
{
if (($request = $this->resolveRequest()) === null) {
throw new RequestNotFoundException();
}
$locationRoute = $this->resolveParameter('location_route');
if (empty($locationRoute)) {
throw new RuntimeException(sprintf(... | php | public function resolveLocationRoute()
{
if (($request = $this->resolveRequest()) === null) {
throw new RequestNotFoundException();
}
$locationRoute = $this->resolveParameter('location_route');
if (empty($locationRoute)) {
throw new RuntimeException(sprintf(... | [
"public",
"function",
"resolveLocationRoute",
"(",
")",
"{",
"if",
"(",
"(",
"$",
"request",
"=",
"$",
"this",
"->",
"resolveRequest",
"(",
")",
")",
"===",
"null",
")",
"{",
"throw",
"new",
"RequestNotFoundException",
"(",
")",
";",
"}",
"$",
"locationR... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/ResourceBundle/Routing/ParameterResolver.php#L144-L160 |
php-lug/lug | src/Bundle/ResourceBundle/Routing/ParameterResolver.php | ParameterResolver.resolveMaxPerPage | public function resolveMaxPerPage()
{
$default = $this->resolveParameter('max_per_page', 10);
if (($request = $this->resolveRequest()) === null) {
return $default;
}
$maxPerPage = $request->get('limit', $default);
if ($maxPerPage <= 0) {
return $def... | php | public function resolveMaxPerPage()
{
$default = $this->resolveParameter('max_per_page', 10);
if (($request = $this->resolveRequest()) === null) {
return $default;
}
$maxPerPage = $request->get('limit', $default);
if ($maxPerPage <= 0) {
return $def... | [
"public",
"function",
"resolveMaxPerPage",
"(",
")",
"{",
"$",
"default",
"=",
"$",
"this",
"->",
"resolveParameter",
"(",
"'max_per_page'",
",",
"10",
")",
";",
"if",
"(",
"(",
"$",
"request",
"=",
"$",
"this",
"->",
"resolveRequest",
"(",
")",
")",
"... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/ResourceBundle/Routing/ParameterResolver.php#L173-L192 |
php-lug/lug | src/Bundle/ResourceBundle/Routing/ParameterResolver.php | ParameterResolver.resolveRedirectRoute | public function resolveRedirectRoute()
{
if (($request = $this->resolveRequest()) === null) {
throw new RequestNotFoundException();
}
$redirectRoute = $this->resolveParameter('redirect_route');
if (empty($redirectRoute)) {
throw new RuntimeException(sprintf(... | php | public function resolveRedirectRoute()
{
if (($request = $this->resolveRequest()) === null) {
throw new RequestNotFoundException();
}
$redirectRoute = $this->resolveParameter('redirect_route');
if (empty($redirectRoute)) {
throw new RuntimeException(sprintf(... | [
"public",
"function",
"resolveRedirectRoute",
"(",
")",
"{",
"if",
"(",
"(",
"$",
"request",
"=",
"$",
"this",
"->",
"resolveRequest",
"(",
")",
")",
"===",
"null",
")",
"{",
"throw",
"new",
"RequestNotFoundException",
"(",
")",
";",
"}",
"$",
"redirectR... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/ResourceBundle/Routing/ParameterResolver.php#L197-L213 |
php-lug/lug | src/Bundle/ResourceBundle/Routing/ParameterResolver.php | ParameterResolver.resolveRedirectRouteParameters | public function resolveRedirectRouteParameters($object = null, $forwardParameters = false)
{
$routeParameters = $this->resolveRouteParameter('redirect_route_parameters', $object);
if ($forwardParameters && ($request = $this->resolveRequest()) !== null) {
return array_replace_recursive($... | php | public function resolveRedirectRouteParameters($object = null, $forwardParameters = false)
{
$routeParameters = $this->resolveRouteParameter('redirect_route_parameters', $object);
if ($forwardParameters && ($request = $this->resolveRequest()) !== null) {
return array_replace_recursive($... | [
"public",
"function",
"resolveRedirectRouteParameters",
"(",
"$",
"object",
"=",
"null",
",",
"$",
"forwardParameters",
"=",
"false",
")",
"{",
"$",
"routeParameters",
"=",
"$",
"this",
"->",
"resolveRouteParameter",
"(",
"'redirect_route_parameters'",
",",
"$",
"... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/ResourceBundle/Routing/ParameterResolver.php#L218-L227 |
php-lug/lug | src/Bundle/ResourceBundle/Routing/ParameterResolver.php | ParameterResolver.resolveTemplate | public function resolveTemplate()
{
if (($request = $this->resolveRequest()) === null) {
throw new RequestNotFoundException();
}
$template = $this->resolveParameter('template');
if (empty($template)) {
throw new RuntimeException(sprintf(
'The... | php | public function resolveTemplate()
{
if (($request = $this->resolveRequest()) === null) {
throw new RequestNotFoundException();
}
$template = $this->resolveParameter('template');
if (empty($template)) {
throw new RuntimeException(sprintf(
'The... | [
"public",
"function",
"resolveTemplate",
"(",
")",
"{",
"if",
"(",
"(",
"$",
"request",
"=",
"$",
"this",
"->",
"resolveRequest",
"(",
")",
")",
"===",
"null",
")",
"{",
"throw",
"new",
"RequestNotFoundException",
"(",
")",
";",
"}",
"$",
"template",
"... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/ResourceBundle/Routing/ParameterResolver.php#L280-L296 |
php-lug/lug | src/Bundle/ResourceBundle/Routing/ParameterResolver.php | ParameterResolver.resolveParameter | private function resolveParameter($parameter, $default = null)
{
if (($request = $this->resolveRequest()) === null) {
return $default;
}
return $request->attributes->get('_lug_'.$parameter, $default);
} | php | private function resolveParameter($parameter, $default = null)
{
if (($request = $this->resolveRequest()) === null) {
return $default;
}
return $request->attributes->get('_lug_'.$parameter, $default);
} | [
"private",
"function",
"resolveParameter",
"(",
"$",
"parameter",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"(",
"$",
"request",
"=",
"$",
"this",
"->",
"resolveRequest",
"(",
")",
")",
"===",
"null",
")",
"{",
"return",
"$",
"default",
... | @param string $parameter
@param mixed $default
@return mixed | [
"@param",
"string",
"$parameter",
"@param",
"mixed",
"$default"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/ResourceBundle/Routing/ParameterResolver.php#L339-L346 |
php-lug/lug | src/Bundle/ResourceBundle/Routing/ParameterResolver.php | ParameterResolver.resolveRouteParameter | private function resolveRouteParameter($parameter, $object = null)
{
$propertyPaths = $this->resolveParameter($parameter, []);
$parameters = [];
if ($object === null) {
if (!empty($propertyPaths)) {
throw new RuntimeException(sprintf(
'The rou... | php | private function resolveRouteParameter($parameter, $object = null)
{
$propertyPaths = $this->resolveParameter($parameter, []);
$parameters = [];
if ($object === null) {
if (!empty($propertyPaths)) {
throw new RuntimeException(sprintf(
'The rou... | [
"private",
"function",
"resolveRouteParameter",
"(",
"$",
"parameter",
",",
"$",
"object",
"=",
"null",
")",
"{",
"$",
"propertyPaths",
"=",
"$",
"this",
"->",
"resolveParameter",
"(",
"$",
"parameter",
",",
"[",
"]",
")",
";",
"$",
"parameters",
"=",
"[... | @param string $parameter
@param object|null $object
@return mixed[] | [
"@param",
"string",
"$parameter",
"@param",
"object|null",
"$object"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/ResourceBundle/Routing/ParameterResolver.php#L362-L383 |
activecollab/controller | src/Controller.php | Controller.getControllerName | public function getControllerName()
{
if (empty($this->controller_name)) {
$controller_class = get_class($this);
if (($pos = strrpos($controller_class, '\\')) !== false) {
$this->controller_name = substr($controller_class, $pos + 1);
} else {
... | php | public function getControllerName()
{
if (empty($this->controller_name)) {
$controller_class = get_class($this);
if (($pos = strrpos($controller_class, '\\')) !== false) {
$this->controller_name = substr($controller_class, $pos + 1);
} else {
... | [
"public",
"function",
"getControllerName",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"controller_name",
")",
")",
"{",
"$",
"controller_class",
"=",
"get_class",
"(",
"$",
"this",
")",
";",
"if",
"(",
"(",
"$",
"pos",
"=",
"strrpos",
... | Return controller name, without namespace.
@return string | [
"Return",
"controller",
"name",
"without",
"namespace",
"."
] | train | https://github.com/activecollab/controller/blob/51d24f3f203f7f5ae56edde2e35b5ef2d9293caa/src/Controller.php#L165-L178 |
activecollab/controller | src/Controller.php | Controller.getParsedBodyParam | protected function getParsedBodyParam(ServerRequestInterface $request, $param_name, $default = null)
{
$parsed_body = $request->getParsedBody();
if ($parsed_body) {
if (is_array($parsed_body) && array_key_exists($param_name, $parsed_body)) {
return $parsed_body[$param_na... | php | protected function getParsedBodyParam(ServerRequestInterface $request, $param_name, $default = null)
{
$parsed_body = $request->getParsedBody();
if ($parsed_body) {
if (is_array($parsed_body) && array_key_exists($param_name, $parsed_body)) {
return $parsed_body[$param_na... | [
"protected",
"function",
"getParsedBodyParam",
"(",
"ServerRequestInterface",
"$",
"request",
",",
"$",
"param_name",
",",
"$",
"default",
"=",
"null",
")",
"{",
"$",
"parsed_body",
"=",
"$",
"request",
"->",
"getParsedBody",
"(",
")",
";",
"if",
"(",
"$",
... | Return a param from a parsed body.
This method is NULL or object safe - it will check for body type, and do it's best to return a value without
breaking or throwing a warning.
@param ServerRequestInterface $request
@param $param_name
@param null $default
@return mixed|null | [
"Return",
"a",
"param",
"from",
"a",
"parsed",
"body",
"."
] | train | https://github.com/activecollab/controller/blob/51d24f3f203f7f5ae56edde2e35b5ef2d9293caa/src/Controller.php#L230-L243 |
blast-project/BaseEntitiesBundle | src/Entity/Traits/Searchable.php | Searchable.analyseField | public function analyseField($field)
{
try {
$accessor = PropertyAccess::createPropertyAccessor();
$data = $accessor->getValue($this, $field);
} catch (\Exception $exc) {
throw new \Exception("Property $field does not exist for " . get_class());
}
... | php | public function analyseField($field)
{
try {
$accessor = PropertyAccess::createPropertyAccessor();
$data = $accessor->getValue($this, $field);
} catch (\Exception $exc) {
throw new \Exception("Property $field does not exist for " . get_class());
}
... | [
"public",
"function",
"analyseField",
"(",
"$",
"field",
")",
"{",
"try",
"{",
"$",
"accessor",
"=",
"PropertyAccess",
"::",
"createPropertyAccessor",
"(",
")",
";",
"$",
"data",
"=",
"$",
"accessor",
"->",
"getValue",
"(",
"$",
"this",
",",
"$",
"field"... | @param string $field
@return array
@throws \Exception | [
"@param",
"string",
"$field"
] | train | https://github.com/blast-project/BaseEntitiesBundle/blob/abd06891fc38922225ab7e4fcb437a286ba2c0c4/src/Entity/Traits/Searchable.php#L63-L74 |
eghojansu/moe | src/tools/web/Geo.php | Geo.tzinfo | function tzinfo($zone) {
$ref=new DateTimeZone($zone);
$loc=$ref->getLocation();
$trn=$ref->getTransitions($now=time(),$now);
$out=array(
'offset'=>$ref->
getOffset(new DateTime('now',new DateTimeZone('GMT')))/3600,
'country'=>$loc['country_code'],
'latitude'=>$loc['latitude'],
'longitude'=>$loc... | php | function tzinfo($zone) {
$ref=new DateTimeZone($zone);
$loc=$ref->getLocation();
$trn=$ref->getTransitions($now=time(),$now);
$out=array(
'offset'=>$ref->
getOffset(new DateTime('now',new DateTimeZone('GMT')))/3600,
'country'=>$loc['country_code'],
'latitude'=>$loc['latitude'],
'longitude'=>$loc... | [
"function",
"tzinfo",
"(",
"$",
"zone",
")",
"{",
"$",
"ref",
"=",
"new",
"DateTimeZone",
"(",
"$",
"zone",
")",
";",
"$",
"loc",
"=",
"$",
"ref",
"->",
"getLocation",
"(",
")",
";",
"$",
"trn",
"=",
"$",
"ref",
"->",
"getTransitions",
"(",
"$",
... | Return information about specified Unix time zone
@return array
@param $zone string | [
"Return",
"information",
"about",
"specified",
"Unix",
"time",
"zone"
] | train | https://github.com/eghojansu/moe/blob/f58ec75a3116d1a572782256e2b38bb9aab95e3c/src/tools/web/Geo.php#L19-L33 |
eghojansu/moe | src/tools/web/Geo.php | Geo.location | function location($ip=NULL) {
$fw=Base::instance();
$web=Web::instance();
if (!$ip)
$ip=$fw->get('IP');
$public=filter_var($ip,FILTER_VALIDATE_IP,
FILTER_FLAG_IPV4|FILTER_FLAG_IPV6|
FILTER_FLAG_NO_RES_RANGE|FILTER_FLAG_NO_PRIV_RANGE);
if (function_exists('geoip_db_avail') &&
geoip_db_avail(GEOIP_C... | php | function location($ip=NULL) {
$fw=Base::instance();
$web=Web::instance();
if (!$ip)
$ip=$fw->get('IP');
$public=filter_var($ip,FILTER_VALIDATE_IP,
FILTER_FLAG_IPV4|FILTER_FLAG_IPV6|
FILTER_FLAG_NO_RES_RANGE|FILTER_FLAG_NO_PRIV_RANGE);
if (function_exists('geoip_db_avail') &&
geoip_db_avail(GEOIP_C... | [
"function",
"location",
"(",
"$",
"ip",
"=",
"NULL",
")",
"{",
"$",
"fw",
"=",
"Base",
"::",
"instance",
"(",
")",
";",
"$",
"web",
"=",
"Web",
"::",
"instance",
"(",
")",
";",
"if",
"(",
"!",
"$",
"ip",
")",
"$",
"ip",
"=",
"$",
"fw",
"->"... | Return geolocation data based on specified/auto-detected IP address
@return array|FALSE
@param $ip string | [
"Return",
"geolocation",
"data",
"based",
"on",
"specified",
"/",
"auto",
"-",
"detected",
"IP",
"address"
] | train | https://github.com/eghojansu/moe/blob/f58ec75a3116d1a572782256e2b38bb9aab95e3c/src/tools/web/Geo.php#L40-L69 |
eghojansu/moe | src/tools/web/Geo.php | Geo.weather | function weather($latitude,$longitude) {
$fw=Base::instance();
$web=Web::instance();
$query=array(
'lat'=>$latitude,
'lon'=>$longitude
);
$req=$web->request(
'http://api.openweathermap.org/data/2.5/weather?'.
http_build_query($query));
return ($req=$web->request(
'http://api.openweathermap.o... | php | function weather($latitude,$longitude) {
$fw=Base::instance();
$web=Web::instance();
$query=array(
'lat'=>$latitude,
'lon'=>$longitude
);
$req=$web->request(
'http://api.openweathermap.org/data/2.5/weather?'.
http_build_query($query));
return ($req=$web->request(
'http://api.openweathermap.o... | [
"function",
"weather",
"(",
"$",
"latitude",
",",
"$",
"longitude",
")",
"{",
"$",
"fw",
"=",
"Base",
"::",
"instance",
"(",
")",
";",
"$",
"web",
"=",
"Web",
"::",
"instance",
"(",
")",
";",
"$",
"query",
"=",
"array",
"(",
"'lat'",
"=>",
"$",
... | Return weather data based on specified latitude/longitude
@return array|FALSE
@param $latitude float
@param $longitude float | [
"Return",
"weather",
"data",
"based",
"on",
"specified",
"latitude",
"/",
"longitude"
] | train | https://github.com/eghojansu/moe/blob/f58ec75a3116d1a572782256e2b38bb9aab95e3c/src/tools/web/Geo.php#L77-L92 |
maestroprog/saw-php | src/Standalone/Controller/ThreadDistributor.php | ThreadDistributor.work | public function work()
{
while (!$this->threadRunQueue->isEmpty()) {
/** @var $thread ControlledThread */
$thread = $this->threadRunQueue->shift();
try {
if ($thread instanceof BroadcastThread) {
$this->threadBroadcast($thread);
... | php | public function work()
{
while (!$this->threadRunQueue->isEmpty()) {
/** @var $thread ControlledThread */
$thread = $this->threadRunQueue->shift();
try {
if ($thread instanceof BroadcastThread) {
$this->threadBroadcast($thread);
... | [
"public",
"function",
"work",
"(",
")",
"{",
"while",
"(",
"!",
"$",
"this",
"->",
"threadRunQueue",
"->",
"isEmpty",
"(",
")",
")",
"{",
"/** @var $thread ControlledThread */",
"$",
"thread",
"=",
"$",
"this",
"->",
"threadRunQueue",
"->",
"shift",
"(",
"... | Перераспределяет потоки по воркерам.
@return void
@throws \Exception | [
"Перераспределяет",
"потоки",
"по",
"воркерам",
"."
] | train | https://github.com/maestroprog/saw-php/blob/159215a4d7a951cca2a9c2eed3e1aa4f5b624cfb/src/Standalone/Controller/ThreadDistributor.php#L137-L157 |
maestroprog/saw-php | src/Standalone/Controller/ThreadDistributor.php | ThreadDistributor.threadKnow | public function threadKnow(Worker $worker, AbstractThread $thread)
{
$this->threadKnownIndex->add($thread);
$worker->addThreadToKnownList($thread);
} | php | public function threadKnow(Worker $worker, AbstractThread $thread)
{
$this->threadKnownIndex->add($thread);
$worker->addThreadToKnownList($thread);
} | [
"public",
"function",
"threadKnow",
"(",
"Worker",
"$",
"worker",
",",
"AbstractThread",
"$",
"thread",
")",
"{",
"$",
"this",
"->",
"threadKnownIndex",
"->",
"add",
"(",
"$",
"thread",
")",
";",
"$",
"worker",
"->",
"addThreadToKnownList",
"(",
"$",
"thre... | Метод, который будет вызван,
когда воркер сообщит о новом потоке, который он только что узнал.
@param Worker $worker
@param AbstractThread $thread
@return void | [
"Метод",
"который",
"будет",
"вызван",
"когда",
"воркер",
"сообщит",
"о",
"новом",
"потоке",
"который",
"он",
"только",
"что",
"узнал",
"."
] | train | https://github.com/maestroprog/saw-php/blob/159215a4d7a951cca2a9c2eed3e1aa4f5b624cfb/src/Standalone/Controller/ThreadDistributor.php#L167-L171 |
maestroprog/saw-php | src/Standalone/Controller/ThreadDistributor.php | ThreadDistributor.threadRun | public function threadRun(Worker $worker, AbstractThread $sourceThread)
{
static $runId = 0;
$runThread = (new ControlledThread(
++$runId,
$sourceThread->getApplicationId(),
$sourceThread->getUniqueId(),
$worker->getClient()
))->setArguments($... | php | public function threadRun(Worker $worker, AbstractThread $sourceThread)
{
static $runId = 0;
$runThread = (new ControlledThread(
++$runId,
$sourceThread->getApplicationId(),
$sourceThread->getUniqueId(),
$worker->getClient()
))->setArguments($... | [
"public",
"function",
"threadRun",
"(",
"Worker",
"$",
"worker",
",",
"AbstractThread",
"$",
"sourceThread",
")",
"{",
"static",
"$",
"runId",
"=",
"0",
";",
"$",
"runThread",
"=",
"(",
"new",
"ControlledThread",
"(",
"++",
"$",
"runId",
",",
"$",
"sourc... | Выполняет постановку задачи на выполнение потока указанному воркеру.
@param Worker $worker Воркер, которому предстоит передать поток на выполнение
@param AbstractThread $sourceThread Исходный поток, который будет передан на выполнение
@return void | [
"Выполняет",
"постановку",
"задачи",
"на",
"выполнение",
"потока",
"указанному",
"воркеру",
"."
] | train | https://github.com/maestroprog/saw-php/blob/159215a4d7a951cca2a9c2eed3e1aa4f5b624cfb/src/Standalone/Controller/ThreadDistributor.php#L180-L216 |
maestroprog/saw-php | src/Standalone/Controller/ThreadDistributor.php | ThreadDistributor.threadBroadcast | public function threadBroadcast(BroadcastThread $sourceThread)
{
/** @var Worker $worker */
foreach ($this->workerPool as $worker) {
$this->threadRun($worker, $sourceThread);
// todo сделать оповещение об успешном выполнении потока
}
} | php | public function threadBroadcast(BroadcastThread $sourceThread)
{
/** @var Worker $worker */
foreach ($this->workerPool as $worker) {
$this->threadRun($worker, $sourceThread);
// todo сделать оповещение об успешном выполнении потока
}
} | [
"public",
"function",
"threadBroadcast",
"(",
"BroadcastThread",
"$",
"sourceThread",
")",
"{",
"/** @var Worker $worker */",
"foreach",
"(",
"$",
"this",
"->",
"workerPool",
"as",
"$",
"worker",
")",
"{",
"$",
"this",
"->",
"threadRun",
"(",
"$",
"worker",
",... | Выполняет постановку задачи на выполнение потока указанному воркеру.
@param BroadcastThread $sourceThread Исходный поток, который будет передан на выполнение
@return void | [
"Выполняет",
"постановку",
"задачи",
"на",
"выполнение",
"потока",
"указанному",
"воркеру",
"."
] | train | https://github.com/maestroprog/saw-php/blob/159215a4d7a951cca2a9c2eed3e1aa4f5b624cfb/src/Standalone/Controller/ThreadDistributor.php#L224-L231 |
maestroprog/saw-php | src/Standalone/Controller/ThreadDistributor.php | ThreadDistributor.threadResult | public function threadResult(Worker $worker, int $runId, $result)
{
$runThread = $this->threadRunWork->getThreadById($runId);
$sourceThread = $this->threadLinks->getLinkedThread($runThread);
// отвязываем поток для выполнения от исходного потока
$this->threadLinks->unlinkThreads($run... | php | public function threadResult(Worker $worker, int $runId, $result)
{
$runThread = $this->threadRunWork->getThreadById($runId);
$sourceThread = $this->threadLinks->getLinkedThread($runThread);
// отвязываем поток для выполнения от исходного потока
$this->threadLinks->unlinkThreads($run... | [
"public",
"function",
"threadResult",
"(",
"Worker",
"$",
"worker",
",",
"int",
"$",
"runId",
",",
"$",
"result",
")",
"{",
"$",
"runThread",
"=",
"$",
"this",
"->",
"threadRunWork",
"->",
"getThreadById",
"(",
"$",
"runId",
")",
";",
"$",
"sourceThread"... | Выполняет обработку результата выполнения потока,
и перенаправляет его к исходному постановщику задачи.
@param Worker $worker От кого пришёл результат
@param int $runId По какому потоку пришёл результат
@param mixed $result Результат выполнения потока
@return void | [
"Выполняет",
"обработку",
"результата",
"выполнения",
"потока",
"и",
"перенаправляет",
"его",
"к",
"исходному",
"постановщику",
"задачи",
"."
] | train | https://github.com/maestroprog/saw-php/blob/159215a4d7a951cca2a9c2eed3e1aa4f5b624cfb/src/Standalone/Controller/ThreadDistributor.php#L242-L283 |
oroinc/OroLayoutComponent | LayoutFactory.php | LayoutFactory.createLayoutBuilder | public function createLayoutBuilder()
{
$rawLayoutBuilder = $this->createRawLayoutBuilder();
$layoutManipulator = $this->createLayoutManipulator($rawLayoutBuilder);
$blockFactory = $this->createBlockFactory($layoutManipulator);
return new LayoutBuilder(
$this->regi... | php | public function createLayoutBuilder()
{
$rawLayoutBuilder = $this->createRawLayoutBuilder();
$layoutManipulator = $this->createLayoutManipulator($rawLayoutBuilder);
$blockFactory = $this->createBlockFactory($layoutManipulator);
return new LayoutBuilder(
$this->regi... | [
"public",
"function",
"createLayoutBuilder",
"(",
")",
"{",
"$",
"rawLayoutBuilder",
"=",
"$",
"this",
"->",
"createRawLayoutBuilder",
"(",
")",
";",
"$",
"layoutManipulator",
"=",
"$",
"this",
"->",
"createLayoutManipulator",
"(",
"$",
"rawLayoutBuilder",
")",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/LayoutFactory.php#L90-L105 |
ShaoZeMing/laravel-merchant | src/Merchant.php | Merchant.js | public static function js($js = null)
{
if (!is_null($js)) {
self::$js = array_merge(self::$js, (array) $js);
return;
}
$js = array_get(Form::collectFieldAssets(), 'js', []);
static::$js = array_merge(static::$js, $js);
return view('merchant::parti... | php | public static function js($js = null)
{
if (!is_null($js)) {
self::$js = array_merge(self::$js, (array) $js);
return;
}
$js = array_get(Form::collectFieldAssets(), 'js', []);
static::$js = array_merge(static::$js, $js);
return view('merchant::parti... | [
"public",
"static",
"function",
"js",
"(",
"$",
"js",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"js",
")",
")",
"{",
"self",
"::",
"$",
"js",
"=",
"array_merge",
"(",
"self",
"::",
"$",
"js",
",",
"(",
"array",
")",
"$",
"js... | Add js or get all js.
@param null $js
@return \Illuminate\Contracts\View\Factory|\Illuminate\View\View|void | [
"Add",
"js",
"or",
"get",
"all",
"js",
"."
] | train | https://github.com/ShaoZeMing/laravel-merchant/blob/20801b1735e7832a6e58b37c2c391328f8d626fa/src/Merchant.php#L136-L149 |
ShaoZeMing/laravel-merchant | src/Merchant.php | Merchant.script | public static function script($script = '')
{
if (!empty($script)) {
self::$script = array_merge(self::$script, (array) $script);
return;
}
return view('merchant::partials.script', ['script' => array_unique(self::$script)]);
} | php | public static function script($script = '')
{
if (!empty($script)) {
self::$script = array_merge(self::$script, (array) $script);
return;
}
return view('merchant::partials.script', ['script' => array_unique(self::$script)]);
} | [
"public",
"static",
"function",
"script",
"(",
"$",
"script",
"=",
"''",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"script",
")",
")",
"{",
"self",
"::",
"$",
"script",
"=",
"array_merge",
"(",
"self",
"::",
"$",
"script",
",",
"(",
"array",
"... | @param string $script
@return \Illuminate\Contracts\View\Factory|\Illuminate\View\View|void | [
"@param",
"string",
"$script"
] | train | https://github.com/ShaoZeMing/laravel-merchant/blob/20801b1735e7832a6e58b37c2c391328f8d626fa/src/Merchant.php#L156-L165 |
ShaoZeMing/laravel-merchant | src/Merchant.php | Merchant.registerAuthRoutes | public function registerAuthRoutes()
{
$attributes = [
'prefix' => config('merchant.route.prefix'),
'namespace' => 'ShaoZeMing\Merchant\Controllers',
'middleware' => config('merchant.route.middleware'),
];
Route::group($attributes, function ($router)... | php | public function registerAuthRoutes()
{
$attributes = [
'prefix' => config('merchant.route.prefix'),
'namespace' => 'ShaoZeMing\Merchant\Controllers',
'middleware' => config('merchant.route.middleware'),
];
Route::group($attributes, function ($router)... | [
"public",
"function",
"registerAuthRoutes",
"(",
")",
"{",
"$",
"attributes",
"=",
"[",
"'prefix'",
"=>",
"config",
"(",
"'merchant.route.prefix'",
")",
",",
"'namespace'",
"=>",
"'ShaoZeMing\\Merchant\\Controllers'",
",",
"'middleware'",
"=>",
"config",
"(",
"'merc... | Register the auth routes.
@return void | [
"Register",
"the",
"auth",
"routes",
"."
] | train | https://github.com/ShaoZeMing/laravel-merchant/blob/20801b1735e7832a6e58b37c2c391328f8d626fa/src/Merchant.php#L232-L275 |
skeeks-cms/cms-dadata-suggest | src/CmsDadataSuggestComponent.php | CmsDadataSuggestComponent.saveAddress | public function saveAddress($data = [])
{
\Yii::$app->session->set($this->sessionName, $data);
return $this;
} | php | public function saveAddress($data = [])
{
\Yii::$app->session->set($this->sessionName, $data);
return $this;
} | [
"public",
"function",
"saveAddress",
"(",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"\\",
"Yii",
"::",
"$",
"app",
"->",
"session",
"->",
"set",
"(",
"$",
"this",
"->",
"sessionName",
",",
"$",
"data",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Сохранение определенных данных
@param array $data данные полученные из api dadata
@return $this | [
"Сохранение",
"определенных",
"данных"
] | train | https://github.com/skeeks-cms/cms-dadata-suggest/blob/966b4a3a6e3824deb54fa09b7bfe82494760571e/src/CmsDadataSuggestComponent.php#L118-L122 |
surebert/surebert-framework | src/sb/Controller/Google/Auth.php | Auth.login | public function login(){
if ($this->getGet('code')) {
$this->client->authenticate($this->getGet('code'));
$this->setSession('token', $this->client->getAccessToken());
$redirect = $this->config->redirect_uris[0];
header('Location: ' . filter_var($redirect, FILTER_... | php | public function login(){
if ($this->getGet('code')) {
$this->client->authenticate($this->getGet('code'));
$this->setSession('token', $this->client->getAccessToken());
$redirect = $this->config->redirect_uris[0];
header('Location: ' . filter_var($redirect, FILTER_... | [
"public",
"function",
"login",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getGet",
"(",
"'code'",
")",
")",
"{",
"$",
"this",
"->",
"client",
"->",
"authenticate",
"(",
"$",
"this",
"->",
"getGet",
"(",
"'code'",
")",
")",
";",
"$",
"this",
"-... | Logs in the user
@return \stdClass
@servable true | [
"Logs",
"in",
"the",
"user"
] | train | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Controller/Google/Auth.php#L98-L119 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.