id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
223,700 | puli/manager | src/Api/Installation/NotInstallableException.php | NotInstallableException.installerNotFound | public static function installerNotFound($installerName, Exception $cause = null)
{
return new static(sprintf(
'The installer "%s" does not exist.',
$installerName
), self::INSTALLER_NOT_FOUND, $cause);
} | php | public static function installerNotFound($installerName, Exception $cause = null)
{
return new static(sprintf(
'The installer "%s" does not exist.',
$installerName
), self::INSTALLER_NOT_FOUND, $cause);
} | [
"public",
"static",
"function",
"installerNotFound",
"(",
"$",
"installerName",
",",
"Exception",
"$",
"cause",
"=",
"null",
")",
"{",
"return",
"new",
"static",
"(",
"sprintf",
"(",
"'The installer \"%s\" does not exist.'",
",",
"$",
"installerName",
")",
",",
... | Creates an exception for an installer name that was not found.
@param string $installerName The installer name.
@param Exception|null $cause The exception that caused this
exception.
@return static The created exception. | [
"Creates",
"an",
"exception",
"for",
"an",
"installer",
"name",
"that",
"was",
"not",
"found",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Installation/NotInstallableException.php#L112-L118 |
223,701 | puli/manager | src/Api/Installation/NotInstallableException.php | NotInstallableException.noResourceMatches | public static function noResourceMatches($glob, Exception $cause = null)
{
return new static(sprintf(
'The glob "%s" did not return any resources.',
$glob
), self::NO_RESOURCE_MATCHES, $cause);
} | php | public static function noResourceMatches($glob, Exception $cause = null)
{
return new static(sprintf(
'The glob "%s" did not return any resources.',
$glob
), self::NO_RESOURCE_MATCHES, $cause);
} | [
"public",
"static",
"function",
"noResourceMatches",
"(",
"$",
"glob",
",",
"Exception",
"$",
"cause",
"=",
"null",
")",
"{",
"return",
"new",
"static",
"(",
"sprintf",
"(",
"'The glob \"%s\" did not return any resources.'",
",",
"$",
"glob",
")",
",",
"self",
... | Creates an exception for an glob that did not return any matches.
@param string $glob The resource glob.
@param Exception|null $cause The exception that caused this exception.
@return static The created exception. | [
"Creates",
"an",
"exception",
"for",
"an",
"glob",
"that",
"did",
"not",
"return",
"any",
"matches",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Installation/NotInstallableException.php#L128-L134 |
223,702 | puli/manager | src/Api/Installation/NotInstallableException.php | NotInstallableException.serverNotFound | public static function serverNotFound($serverName, Exception $cause = null)
{
return new static(sprintf(
'The asset server "%s" does not exist.',
$serverName
), self::SERVER_NOT_FOUND, $cause);
} | php | public static function serverNotFound($serverName, Exception $cause = null)
{
return new static(sprintf(
'The asset server "%s" does not exist.',
$serverName
), self::SERVER_NOT_FOUND, $cause);
} | [
"public",
"static",
"function",
"serverNotFound",
"(",
"$",
"serverName",
",",
"Exception",
"$",
"cause",
"=",
"null",
")",
"{",
"return",
"new",
"static",
"(",
"sprintf",
"(",
"'The asset server \"%s\" does not exist.'",
",",
"$",
"serverName",
")",
",",
"self"... | Creates an exception for a server name that was not found.
@param string $serverName The server name.
@param Exception|null $cause The exception that caused this
exception.
@return static The created exception. | [
"Creates",
"an",
"exception",
"for",
"a",
"server",
"name",
"that",
"was",
"not",
"found",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Installation/NotInstallableException.php#L145-L151 |
223,703 | puli/manager | src/Api/Installation/NotInstallableException.php | NotInstallableException.installerClassNotFound | public static function installerClassNotFound($installerClass, Exception $cause = null)
{
return new static(sprintf(
'The installer class "%s" does not exist.',
$installerClass
), self::INSTALLER_CLASS_NOT_FOUND, $cause);
} | php | public static function installerClassNotFound($installerClass, Exception $cause = null)
{
return new static(sprintf(
'The installer class "%s" does not exist.',
$installerClass
), self::INSTALLER_CLASS_NOT_FOUND, $cause);
} | [
"public",
"static",
"function",
"installerClassNotFound",
"(",
"$",
"installerClass",
",",
"Exception",
"$",
"cause",
"=",
"null",
")",
"{",
"return",
"new",
"static",
"(",
"sprintf",
"(",
"'The installer class \"%s\" does not exist.'",
",",
"$",
"installerClass",
"... | Creates an exception for an installer class that was not found.
@param string $installerClass The installer class.
@param Exception|null $cause The exception that caused this
exception.
@return static The created exception. | [
"Creates",
"an",
"exception",
"for",
"an",
"installer",
"class",
"that",
"was",
"not",
"found",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Installation/NotInstallableException.php#L162-L168 |
223,704 | puli/manager | src/Api/Installation/NotInstallableException.php | NotInstallableException.installerClassNoDefaultConstructor | public static function installerClassNoDefaultConstructor($installerClass, Exception $cause = null)
{
return new static(sprintf(
'The constructor of class "%s" must not have required parameters.',
$installerClass
), self::INSTALLER_CLASS_NO_DEFAULT_CONSTRUCTOR, $cause);
} | php | public static function installerClassNoDefaultConstructor($installerClass, Exception $cause = null)
{
return new static(sprintf(
'The constructor of class "%s" must not have required parameters.',
$installerClass
), self::INSTALLER_CLASS_NO_DEFAULT_CONSTRUCTOR, $cause);
} | [
"public",
"static",
"function",
"installerClassNoDefaultConstructor",
"(",
"$",
"installerClass",
",",
"Exception",
"$",
"cause",
"=",
"null",
")",
"{",
"return",
"new",
"static",
"(",
"sprintf",
"(",
"'The constructor of class \"%s\" must not have required parameters.'",
... | Creates an exception for an installer class that has no default
constructor.
@param string $installerClass The installer class.
@param Exception|null $cause The exception that caused this
exception.
@return static The created exception. | [
"Creates",
"an",
"exception",
"for",
"an",
"installer",
"class",
"that",
"has",
"no",
"default",
"constructor",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Installation/NotInstallableException.php#L180-L186 |
223,705 | ongr-io/FilterManagerBundle | DependencyInjection/Compiler/FilterPass.php | FilterPass.addRelation | private function addRelation(Definition $definition, $filter, $urlType, $relationType)
{
if (empty($filter['relations'][$urlType][$relationType])) {
return;
}
$relation = new Definition(
sprintf('ONGR\FilterManagerBundle\Relation\%sRelation', ucfirst($relationType)),... | php | private function addRelation(Definition $definition, $filter, $urlType, $relationType)
{
if (empty($filter['relations'][$urlType][$relationType])) {
return;
}
$relation = new Definition(
sprintf('ONGR\FilterManagerBundle\Relation\%sRelation', ucfirst($relationType)),... | [
"private",
"function",
"addRelation",
"(",
"Definition",
"$",
"definition",
",",
"$",
"filter",
",",
"$",
"urlType",
",",
"$",
"relationType",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"filter",
"[",
"'relations'",
"]",
"[",
"$",
"urlType",
"]",
"[",
"$"... | Adds relation to filter.
@param Definition $definition
@param array $filter
@param string $urlType
@param string $relationType | [
"Adds",
"relation",
"to",
"filter",
"."
] | 26c1125457f0440019b9bf20090bf23ba4bb1905 | https://github.com/ongr-io/FilterManagerBundle/blob/26c1125457f0440019b9bf20090bf23ba4bb1905/DependencyInjection/Compiler/FilterPass.php#L99-L113 |
223,706 | puli/manager | src/Api/Discovery/BindingState.php | BindingState.all | public static function all()
{
return array(
self::ENABLED,
self::DISABLED,
self::TYPE_NOT_FOUND,
self::TYPE_NOT_ENABLED,
self::INVALID,
);
} | php | public static function all()
{
return array(
self::ENABLED,
self::DISABLED,
self::TYPE_NOT_FOUND,
self::TYPE_NOT_ENABLED,
self::INVALID,
);
} | [
"public",
"static",
"function",
"all",
"(",
")",
"{",
"return",
"array",
"(",
"self",
"::",
"ENABLED",
",",
"self",
"::",
"DISABLED",
",",
"self",
"::",
"TYPE_NOT_FOUND",
",",
"self",
"::",
"TYPE_NOT_ENABLED",
",",
"self",
"::",
"INVALID",
",",
")",
";",... | Returns all binding states.
@return int[] The binding states. | [
"Returns",
"all",
"binding",
"states",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Discovery/BindingState.php#L53-L62 |
223,707 | puli/manager | src/Util/TwoDimensionalHashMap.php | TwoDimensionalHashMap.set | public function set($primaryKey, $secondaryKey, $value)
{
if (!isset($this->values[$primaryKey])) {
$this->values[$primaryKey] = array();
}
$this->values[$primaryKey][$secondaryKey] = $value;
} | php | public function set($primaryKey, $secondaryKey, $value)
{
if (!isset($this->values[$primaryKey])) {
$this->values[$primaryKey] = array();
}
$this->values[$primaryKey][$secondaryKey] = $value;
} | [
"public",
"function",
"set",
"(",
"$",
"primaryKey",
",",
"$",
"secondaryKey",
",",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"values",
"[",
"$",
"primaryKey",
"]",
")",
")",
"{",
"$",
"this",
"->",
"values",
"[",
"... | Sets a value in the store.
@param int|string $primaryKey The primary key.
@param int|string $secondaryKey The secondary key.
@param mixed $value The value. | [
"Sets",
"a",
"value",
"in",
"the",
"store",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Util/TwoDimensionalHashMap.php#L42-L49 |
223,708 | puli/manager | src/Util/TwoDimensionalHashMap.php | TwoDimensionalHashMap.remove | public function remove($primaryKey, $secondaryKey)
{
unset($this->values[$primaryKey][$secondaryKey]);
if (isset($this->values[$primaryKey]) && 0 === count($this->values[$primaryKey])) {
unset($this->values[$primaryKey]);
}
} | php | public function remove($primaryKey, $secondaryKey)
{
unset($this->values[$primaryKey][$secondaryKey]);
if (isset($this->values[$primaryKey]) && 0 === count($this->values[$primaryKey])) {
unset($this->values[$primaryKey]);
}
} | [
"public",
"function",
"remove",
"(",
"$",
"primaryKey",
",",
"$",
"secondaryKey",
")",
"{",
"unset",
"(",
"$",
"this",
"->",
"values",
"[",
"$",
"primaryKey",
"]",
"[",
"$",
"secondaryKey",
"]",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
... | Removes a value from the store.
This method ignores non-existing keys.
@param int|string $primaryKey The primary key.
@param int|string $secondaryKey The secondary key. | [
"Removes",
"a",
"value",
"from",
"the",
"store",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Util/TwoDimensionalHashMap.php#L59-L66 |
223,709 | puli/manager | src/Util/TwoDimensionalHashMap.php | TwoDimensionalHashMap.get | public function get($primaryKey, $secondaryKey)
{
if (!isset($this->values[$primaryKey][$secondaryKey])) {
throw new OutOfBoundsException(sprintf(
'The key ("%s","%s") does not exist.',
$primaryKey,
$secondaryKey
));
}
... | php | public function get($primaryKey, $secondaryKey)
{
if (!isset($this->values[$primaryKey][$secondaryKey])) {
throw new OutOfBoundsException(sprintf(
'The key ("%s","%s") does not exist.',
$primaryKey,
$secondaryKey
));
}
... | [
"public",
"function",
"get",
"(",
"$",
"primaryKey",
",",
"$",
"secondaryKey",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"values",
"[",
"$",
"primaryKey",
"]",
"[",
"$",
"secondaryKey",
"]",
")",
")",
"{",
"throw",
"new",
"OutOfBound... | Returns a value from the store.
@param int|string $primaryKey The primary key.
@param int|string $secondaryKey The secondary key.
@return mixed The value.
@throws OutOfBoundsException If no value is set for the given keys. | [
"Returns",
"a",
"value",
"from",
"the",
"store",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Util/TwoDimensionalHashMap.php#L90-L101 |
223,710 | puli/manager | src/Util/TwoDimensionalHashMap.php | TwoDimensionalHashMap.getFirst | public function getFirst($primaryKey)
{
if (!isset($this->values[$primaryKey])) {
throw new OutOfBoundsException(sprintf(
'The key "%s" does not exist.',
$primaryKey
));
}
return reset($this->values[$primaryKey]);
} | php | public function getFirst($primaryKey)
{
if (!isset($this->values[$primaryKey])) {
throw new OutOfBoundsException(sprintf(
'The key "%s" does not exist.',
$primaryKey
));
}
return reset($this->values[$primaryKey]);
} | [
"public",
"function",
"getFirst",
"(",
"$",
"primaryKey",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"values",
"[",
"$",
"primaryKey",
"]",
")",
")",
"{",
"throw",
"new",
"OutOfBoundsException",
"(",
"sprintf",
"(",
"'The key \"%s\" does no... | Returns the first value set for the given primary key.
@param int|string $primaryKey The primary key.
@return mixed The value.
@throws OutOfBoundsException If the primary key does not exist. | [
"Returns",
"the",
"first",
"value",
"set",
"for",
"the",
"given",
"primary",
"key",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Util/TwoDimensionalHashMap.php#L133-L143 |
223,711 | puli/manager | src/Util/TwoDimensionalHashMap.php | TwoDimensionalHashMap.getLast | public function getLast($primaryKey)
{
if (!isset($this->values[$primaryKey])) {
throw new OutOfBoundsException(sprintf(
'The key "%s" does not exist.',
$primaryKey
));
}
return end($this->values[$primaryKey]);
} | php | public function getLast($primaryKey)
{
if (!isset($this->values[$primaryKey])) {
throw new OutOfBoundsException(sprintf(
'The key "%s" does not exist.',
$primaryKey
));
}
return end($this->values[$primaryKey]);
} | [
"public",
"function",
"getLast",
"(",
"$",
"primaryKey",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"values",
"[",
"$",
"primaryKey",
"]",
")",
")",
"{",
"throw",
"new",
"OutOfBoundsException",
"(",
"sprintf",
"(",
"'The key \"%s\" does not... | Returns the last value set for the given primary key.
@param int|string $primaryKey The primary key.
@return mixed The value.
@throws OutOfBoundsException If the primary key does not exist. | [
"Returns",
"the",
"last",
"value",
"set",
"for",
"the",
"given",
"primary",
"key",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Util/TwoDimensionalHashMap.php#L154-L164 |
223,712 | puli/manager | src/Util/TwoDimensionalHashMap.php | TwoDimensionalHashMap.getCount | public function getCount($primaryKey)
{
if (!isset($this->values[$primaryKey])) {
throw new OutOfBoundsException(sprintf(
'The key "%s" does not exist.',
$primaryKey
));
}
return count($this->values[$primaryKey]);
} | php | public function getCount($primaryKey)
{
if (!isset($this->values[$primaryKey])) {
throw new OutOfBoundsException(sprintf(
'The key "%s" does not exist.',
$primaryKey
));
}
return count($this->values[$primaryKey]);
} | [
"public",
"function",
"getCount",
"(",
"$",
"primaryKey",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"values",
"[",
"$",
"primaryKey",
"]",
")",
")",
"{",
"throw",
"new",
"OutOfBoundsException",
"(",
"sprintf",
"(",
"'The key \"%s\" does no... | Returns the number of secondary keys set for the given primary key.
@param int|string $primaryKey The primary key.
@return int The number of secondary keys set for the primary key.
@throws OutOfBoundsException If the primary key does not exist. | [
"Returns",
"the",
"number",
"of",
"secondary",
"keys",
"set",
"for",
"the",
"given",
"primary",
"key",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Util/TwoDimensionalHashMap.php#L175-L185 |
223,713 | puli/manager | src/Util/TwoDimensionalHashMap.php | TwoDimensionalHashMap.listByPrimaryKey | public function listByPrimaryKey($primaryKey)
{
if (!isset($this->values[$primaryKey])) {
throw new OutOfBoundsException(sprintf(
'The key "%s" does not exist.',
$primaryKey
));
}
return $this->values[$primaryKey];
} | php | public function listByPrimaryKey($primaryKey)
{
if (!isset($this->values[$primaryKey])) {
throw new OutOfBoundsException(sprintf(
'The key "%s" does not exist.',
$primaryKey
));
}
return $this->values[$primaryKey];
} | [
"public",
"function",
"listByPrimaryKey",
"(",
"$",
"primaryKey",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"values",
"[",
"$",
"primaryKey",
"]",
")",
")",
"{",
"throw",
"new",
"OutOfBoundsException",
"(",
"sprintf",
"(",
"'The key \"%s\"... | Returns all values set for the given primary key.
@param int|string $primaryKey The primary key.
@return array The values indexed by their secondary keys.
@throws OutOfBoundsException If the primary key does not exist. | [
"Returns",
"all",
"values",
"set",
"for",
"the",
"given",
"primary",
"key",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Util/TwoDimensionalHashMap.php#L196-L206 |
223,714 | puli/manager | src/Util/TwoDimensionalHashMap.php | TwoDimensionalHashMap.listBySecondaryKey | public function listBySecondaryKey($secondaryKey)
{
$list = array();
foreach ($this->values as $primaryKey => $valuesBySecondaryKey) {
if (isset($valuesBySecondaryKey[$secondaryKey])) {
$list[$primaryKey] = $valuesBySecondaryKey[$secondaryKey];
}
}
... | php | public function listBySecondaryKey($secondaryKey)
{
$list = array();
foreach ($this->values as $primaryKey => $valuesBySecondaryKey) {
if (isset($valuesBySecondaryKey[$secondaryKey])) {
$list[$primaryKey] = $valuesBySecondaryKey[$secondaryKey];
}
}
... | [
"public",
"function",
"listBySecondaryKey",
"(",
"$",
"secondaryKey",
")",
"{",
"$",
"list",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"values",
"as",
"$",
"primaryKey",
"=>",
"$",
"valuesBySecondaryKey",
")",
"{",
"if",
"(",
"isset... | Returns all values set for the given secondary key.
@param int|string $secondaryKey The secondary key.
@return array The values indexed by their primary keys.
@throws OutOfBoundsException If the secondary key does not exist. | [
"Returns",
"all",
"values",
"set",
"for",
"the",
"given",
"secondary",
"key",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Util/TwoDimensionalHashMap.php#L217-L235 |
223,715 | puli/manager | src/Util/TwoDimensionalHashMap.php | TwoDimensionalHashMap.getSecondaryKeys | public function getSecondaryKeys($primaryKey = null)
{
if ($primaryKey) {
if (!isset($this->values[$primaryKey])) {
throw new OutOfBoundsException(sprintf(
'The key "%s" does not exist.',
$primaryKey
));
}
... | php | public function getSecondaryKeys($primaryKey = null)
{
if ($primaryKey) {
if (!isset($this->values[$primaryKey])) {
throw new OutOfBoundsException(sprintf(
'The key "%s" does not exist.',
$primaryKey
));
}
... | [
"public",
"function",
"getSecondaryKeys",
"(",
"$",
"primaryKey",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"primaryKey",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"values",
"[",
"$",
"primaryKey",
"]",
")",
")",
"{",
"throw",
"new",
... | Returns the secondary keys for the given primary key.
The primary key is optional. If this argument is not provided, all secondary keys will be returned.
@param int|string|null $primaryKey The primary key.
@return int[]|string[] The secondary keys.
@throws OutOfBoundsException If the primary key does not exist. | [
"Returns",
"the",
"secondary",
"keys",
"for",
"the",
"given",
"primary",
"key",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Util/TwoDimensionalHashMap.php#L248-L270 |
223,716 | puli/manager | src/Util/TwoDimensionalHashMap.php | TwoDimensionalHashMap.sortPrimaryKeys | public function sortPrimaryKeys(array $order = null)
{
if (!$order) {
ksort($this->values);
return;
}
$orderedKeys = array_intersect_key(array_flip($order), $this->values);
$this->values = array_replace($orderedKeys, $this->values);
} | php | public function sortPrimaryKeys(array $order = null)
{
if (!$order) {
ksort($this->values);
return;
}
$orderedKeys = array_intersect_key(array_flip($order), $this->values);
$this->values = array_replace($orderedKeys, $this->values);
} | [
"public",
"function",
"sortPrimaryKeys",
"(",
"array",
"$",
"order",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"order",
")",
"{",
"ksort",
"(",
"$",
"this",
"->",
"values",
")",
";",
"return",
";",
"}",
"$",
"orderedKeys",
"=",
"array_intersect_key",... | Sorts the primary keys of the map.
@param int[]|string[]|null $order The keys in the desired order. | [
"Sorts",
"the",
"primary",
"keys",
"of",
"the",
"map",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Util/TwoDimensionalHashMap.php#L308-L319 |
223,717 | puli/manager | src/Util/TwoDimensionalHashMap.php | TwoDimensionalHashMap.sortSecondaryKeys | public function sortSecondaryKeys($primaryKey, array $order = null)
{
if (!isset($this->values[$primaryKey])) {
throw new OutOfBoundsException(sprintf(
'The key "%s" does not exist.',
$primaryKey
));
}
if (!$order) {
ksort(... | php | public function sortSecondaryKeys($primaryKey, array $order = null)
{
if (!isset($this->values[$primaryKey])) {
throw new OutOfBoundsException(sprintf(
'The key "%s" does not exist.',
$primaryKey
));
}
if (!$order) {
ksort(... | [
"public",
"function",
"sortSecondaryKeys",
"(",
"$",
"primaryKey",
",",
"array",
"$",
"order",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"values",
"[",
"$",
"primaryKey",
"]",
")",
")",
"{",
"throw",
"new",
"OutOfBoundsExc... | Sorts the secondary keys of a map entry.
@param int|string $primaryKey The primary key.
@param int[]|string[]|null $order The keys in the desired order. | [
"Sorts",
"the",
"secondary",
"keys",
"of",
"a",
"map",
"entry",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Util/TwoDimensionalHashMap.php#L327-L345 |
223,718 | puli/manager | src/Factory/FactoryManagerImpl.php | FactoryManagerImpl.camelizeKeys | private function camelizeKeys(array $array)
{
$camelized = array();
foreach ($array as $key => $value) {
$camelized[$this->camelize($key)] = is_array($value)
? $this->camelizeKeys($value)
: $value;
}
return $camelized;
} | php | private function camelizeKeys(array $array)
{
$camelized = array();
foreach ($array as $key => $value) {
$camelized[$this->camelize($key)] = is_array($value)
? $this->camelizeKeys($value)
: $value;
}
return $camelized;
} | [
"private",
"function",
"camelizeKeys",
"(",
"array",
"$",
"array",
")",
"{",
"$",
"camelized",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"array",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"camelized",
"[",
"$",
"this",
"->",
"cam... | Recursively camelizes the keys of an array.
@param array $array The array to process.
@return array The input array with camelized keys. | [
"Recursively",
"camelizes",
"the",
"keys",
"of",
"an",
"array",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Factory/FactoryManagerImpl.php#L442-L453 |
223,719 | puli/manager | src/Api/Discovery/BindingTypeDescriptor.php | BindingTypeDescriptor.load | public function load(Module $containingModule)
{
if (null !== $this->state) {
throw new AlreadyLoadedException('The type descriptor is already loaded.');
}
$this->containingModule = $containingModule;
$this->state = BindingTypeState::ENABLED;
} | php | public function load(Module $containingModule)
{
if (null !== $this->state) {
throw new AlreadyLoadedException('The type descriptor is already loaded.');
}
$this->containingModule = $containingModule;
$this->state = BindingTypeState::ENABLED;
} | [
"public",
"function",
"load",
"(",
"Module",
"$",
"containingModule",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"state",
")",
"{",
"throw",
"new",
"AlreadyLoadedException",
"(",
"'The type descriptor is already loaded.'",
")",
";",
"}",
"$",
"this... | Loads the type descriptor.
@param Module $containingModule The module that contains the type
descriptor.
@throws AlreadyLoadedException If the descriptor is already loaded. | [
"Loads",
"the",
"type",
"descriptor",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Discovery/BindingTypeDescriptor.php#L99-L107 |
223,720 | puli/manager | src/Api/Discovery/BindingTypeDescriptor.php | BindingTypeDescriptor.unload | public function unload()
{
if (null === $this->state) {
throw new NotLoadedException('The type descriptor is not loaded.');
}
$this->containingModule = null;
$this->state = null;
} | php | public function unload()
{
if (null === $this->state) {
throw new NotLoadedException('The type descriptor is not loaded.');
}
$this->containingModule = null;
$this->state = null;
} | [
"public",
"function",
"unload",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"state",
")",
"{",
"throw",
"new",
"NotLoadedException",
"(",
"'The type descriptor is not loaded.'",
")",
";",
"}",
"$",
"this",
"->",
"containingModule",
"=",
"null... | Unloads the type descriptor.
All memory allocated during {@link load()} is freed.
@throws NotLoadedException If the descriptor is not loaded. | [
"Unloads",
"the",
"type",
"descriptor",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Discovery/BindingTypeDescriptor.php#L116-L124 |
223,721 | puli/manager | src/Api/Discovery/BindingTypeDescriptor.php | BindingTypeDescriptor.markDuplicate | public function markDuplicate($duplicate)
{
Assert::boolean($duplicate);
if (null === $this->state) {
throw new NotLoadedException('The type descriptor is not loaded.');
}
$this->state = $duplicate ? BindingTypeState::DUPLICATE : BindingTypeState::ENABLED;
} | php | public function markDuplicate($duplicate)
{
Assert::boolean($duplicate);
if (null === $this->state) {
throw new NotLoadedException('The type descriptor is not loaded.');
}
$this->state = $duplicate ? BindingTypeState::DUPLICATE : BindingTypeState::ENABLED;
} | [
"public",
"function",
"markDuplicate",
"(",
"$",
"duplicate",
")",
"{",
"Assert",
"::",
"boolean",
"(",
"$",
"duplicate",
")",
";",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"state",
")",
"{",
"throw",
"new",
"NotLoadedException",
"(",
"'The type descri... | Marks or unmarks the type as duplicate.
The method {@link load()} needs to be called before calling this method,
otherwise an exception is thrown.
@param bool $duplicate Whether or not the type is a duplicate.
@throws NotLoadedException If the descriptor is not loaded. | [
"Marks",
"or",
"unmarks",
"the",
"type",
"as",
"duplicate",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Discovery/BindingTypeDescriptor.php#L146-L155 |
223,722 | puli/manager | src/Api/Discovery/BindingTypeDescriptor.php | BindingTypeDescriptor.getParameterDescription | public function getParameterDescription($parameterName)
{
if (!$this->type->hasParameter($parameterName)) {
throw new NoSuchParameterException(sprintf(
'The parameter "%s" does not exist.',
$parameterName
));
}
if (!isset($this->parame... | php | public function getParameterDescription($parameterName)
{
if (!$this->type->hasParameter($parameterName)) {
throw new NoSuchParameterException(sprintf(
'The parameter "%s" does not exist.',
$parameterName
));
}
if (!isset($this->parame... | [
"public",
"function",
"getParameterDescription",
"(",
"$",
"parameterName",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"type",
"->",
"hasParameter",
"(",
"$",
"parameterName",
")",
")",
"{",
"throw",
"new",
"NoSuchParameterException",
"(",
"sprintf",
"(",
... | Returns the description for a parameter.
@param string $parameterName The parameter name.
@return string The description of the parameter.
@throws NoSuchParameterException If the parameter does not exist.
@throws OutOfBoundsException If the parameter has no description. | [
"Returns",
"the",
"description",
"for",
"a",
"parameter",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Discovery/BindingTypeDescriptor.php#L207-L224 |
223,723 | madeyourday/contao-rocksolid-frontend-helper | src/FrontendHelperUser.php | FrontendHelperUser.authenticate | public function authenticate()
{
// Backwards compatibility for Contao 4.4
if (!$this instanceof UserInterface) {
if ($this->frontendHelperUserAuthenticated === null) {
$this->frontendHelperUserAuthenticated = \User::authenticate();
}
return $this->frontendHelperUserAuthenticated;
}
return $this-... | php | public function authenticate()
{
// Backwards compatibility for Contao 4.4
if (!$this instanceof UserInterface) {
if ($this->frontendHelperUserAuthenticated === null) {
$this->frontendHelperUserAuthenticated = \User::authenticate();
}
return $this->frontendHelperUserAuthenticated;
}
return $this-... | [
"public",
"function",
"authenticate",
"(",
")",
"{",
"// Backwards compatibility for Contao 4.4",
"if",
"(",
"!",
"$",
"this",
"instanceof",
"UserInterface",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"frontendHelperUserAuthenticated",
"===",
"null",
")",
"{",
"$",
... | Disable BackendUser authentication redirect and cache the result | [
"Disable",
"BackendUser",
"authentication",
"redirect",
"and",
"cache",
"the",
"result"
] | 1a0bf45a3d3913f8436ccd284965e7c37a463f28 | https://github.com/madeyourday/contao-rocksolid-frontend-helper/blob/1a0bf45a3d3913f8436ccd284965e7c37a463f28/src/FrontendHelperUser.php#L36-L47 |
223,724 | madeyourday/contao-rocksolid-frontend-helper | src/FrontendHelperUser.php | FrontendHelperUser.setUserFromDb | protected function setUserFromDb()
{
$this->intId = $this->id;
foreach ($this->arrData as $key => $value) {
if (! is_numeric($value)) {
$this->$key = \StringUtil::deserialize($value);
}
}
$always = array('alexf');
$depends = array();
if (is_array($GLOBALS['TL_PERMISSIONS']) && ! empty($GLOBALS... | php | protected function setUserFromDb()
{
$this->intId = $this->id;
foreach ($this->arrData as $key => $value) {
if (! is_numeric($value)) {
$this->$key = \StringUtil::deserialize($value);
}
}
$always = array('alexf');
$depends = array();
if (is_array($GLOBALS['TL_PERMISSIONS']) && ! empty($GLOBALS... | [
"protected",
"function",
"setUserFromDb",
"(",
")",
"{",
"$",
"this",
"->",
"intId",
"=",
"$",
"this",
"->",
"id",
";",
"foreach",
"(",
"$",
"this",
"->",
"arrData",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"is_numeric",
"(",... | set all user properties from a database record | [
"set",
"all",
"user",
"properties",
"from",
"a",
"database",
"record"
] | 1a0bf45a3d3913f8436ccd284965e7c37a463f28 | https://github.com/madeyourday/contao-rocksolid-frontend-helper/blob/1a0bf45a3d3913f8436ccd284965e7c37a463f28/src/FrontendHelperUser.php#L57-L101 |
223,725 | OXID-eSales/oxid-eshop-ide-helper | src/Generator.php | Generator.generate | public function generate()
{
$output = $this->generateIdeHelperOutput();
$this->writeIdeHelperFile($output, '.ide-helper.php');
$outputForPhpStormIde = $this->generatePhpStormIdeHelperOutput();
$this->writeIdeHelperFile($outputForPhpStormIde, '.phpstorm.meta.php/oxid.meta.php');
... | php | public function generate()
{
$output = $this->generateIdeHelperOutput();
$this->writeIdeHelperFile($output, '.ide-helper.php');
$outputForPhpStormIde = $this->generatePhpStormIdeHelperOutput();
$this->writeIdeHelperFile($outputForPhpStormIde, '.phpstorm.meta.php/oxid.meta.php');
... | [
"public",
"function",
"generate",
"(",
")",
"{",
"$",
"output",
"=",
"$",
"this",
"->",
"generateIdeHelperOutput",
"(",
")",
";",
"$",
"this",
"->",
"writeIdeHelperFile",
"(",
"$",
"output",
",",
"'.ide-helper.php'",
")",
";",
"$",
"outputForPhpStormIde",
"=... | Generate a helper file for IDE auto-completion | [
"Generate",
"a",
"helper",
"file",
"for",
"IDE",
"auto",
"-",
"completion"
] | e29836a482e7e2386ebb1cefd01e31240e2b3847 | https://github.com/OXID-eSales/oxid-eshop-ide-helper/blob/e29836a482e7e2386ebb1cefd01e31240e2b3847/src/Generator.php#L68-L75 |
223,726 | OXID-eSales/oxid-eshop-ide-helper | src/Generator.php | Generator.getSmarty | protected function getSmarty()
{
$smarty = new \Smarty();
$currentDirectory = dirname(__FILE__);
$smarty->template_dir = realpath(
$currentDirectory . DIRECTORY_SEPARATOR .
'smarty' . DIRECTORY_SEPARATOR .
'templates' . DIRECTORY_SEPARATOR
);
... | php | protected function getSmarty()
{
$smarty = new \Smarty();
$currentDirectory = dirname(__FILE__);
$smarty->template_dir = realpath(
$currentDirectory . DIRECTORY_SEPARATOR .
'smarty' . DIRECTORY_SEPARATOR .
'templates' . DIRECTORY_SEPARATOR
);
... | [
"protected",
"function",
"getSmarty",
"(",
")",
"{",
"$",
"smarty",
"=",
"new",
"\\",
"Smarty",
"(",
")",
";",
"$",
"currentDirectory",
"=",
"dirname",
"(",
"__FILE__",
")",
";",
"$",
"smarty",
"->",
"template_dir",
"=",
"realpath",
"(",
"$",
"currentDir... | Return an instance of smarty
@return \Smarty | [
"Return",
"an",
"instance",
"of",
"smarty"
] | e29836a482e7e2386ebb1cefd01e31240e2b3847 | https://github.com/OXID-eSales/oxid-eshop-ide-helper/blob/e29836a482e7e2386ebb1cefd01e31240e2b3847/src/Generator.php#L170-L188 |
223,727 | ongr-io/FilterManagerBundle | Twig/PagerExtension.php | PagerExtension.path | public function path($route, $page, array $parameters = [])
{
$fieldName = 'page';
if (isset($parameters['_page'])) {
$fieldName = $parameters['_page'];
unset($parameters['_page']);
}
$parameters[$fieldName] = $page;
return $this->router->generate($... | php | public function path($route, $page, array $parameters = [])
{
$fieldName = 'page';
if (isset($parameters['_page'])) {
$fieldName = $parameters['_page'];
unset($parameters['_page']);
}
$parameters[$fieldName] = $page;
return $this->router->generate($... | [
"public",
"function",
"path",
"(",
"$",
"route",
",",
"$",
"page",
",",
"array",
"$",
"parameters",
"=",
"[",
"]",
")",
"{",
"$",
"fieldName",
"=",
"'page'",
";",
"if",
"(",
"isset",
"(",
"$",
"parameters",
"[",
"'_page'",
"]",
")",
")",
"{",
"$"... | Generates url to certain page.
@param string $route
@param string $page
@param array $parameters
@return string | [
"Generates",
"url",
"to",
"certain",
"page",
"."
] | 26c1125457f0440019b9bf20090bf23ba4bb1905 | https://github.com/ongr-io/FilterManagerBundle/blob/26c1125457f0440019b9bf20090bf23ba4bb1905/Twig/PagerExtension.php#L89-L101 |
223,728 | QoboLtd/cakephp-calendar | src/Shell/Task/SyncTask.php | SyncTask.getOptionParser | public function getOptionParser()
{
$parser = parent::getOptionParser();
$parser->setDescription(
(string)__('Synchronize local and remote calendars with the database')
);
$parser->addOption('start', [
'description' => (string)__('Specify start interval for t... | php | public function getOptionParser()
{
$parser = parent::getOptionParser();
$parser->setDescription(
(string)__('Synchronize local and remote calendars with the database')
);
$parser->addOption('start', [
'description' => (string)__('Specify start interval for t... | [
"public",
"function",
"getOptionParser",
"(",
")",
"{",
"$",
"parser",
"=",
"parent",
"::",
"getOptionParser",
"(",
")",
";",
"$",
"parser",
"->",
"setDescription",
"(",
"(",
"string",
")",
"__",
"(",
"'Synchronize local and remote calendars with the database'",
"... | Manage available options via Parser
@return \Cake\Console\ConsoleOptionParser | [
"Manage",
"available",
"options",
"via",
"Parser"
] | e0ea2c4dd4257a6af972707f206151d01bb4dfbb | https://github.com/QoboLtd/cakephp-calendar/blob/e0ea2c4dd4257a6af972707f206151d01bb4dfbb/src/Shell/Task/SyncTask.php#L42-L60 |
223,729 | QoboLtd/cakephp-calendar | src/Shell/Task/SyncTask.php | SyncTask.setDefaultTimePeriod | protected function setDefaultTimePeriod(array $params = []): array
{
$options = [];
if (!empty($params['start'])) {
$options['period']['start_date'] = $params['start'];
}
if (!empty($params['end'])) {
$options['period']['end_date'] = $params['end'];
}... | php | protected function setDefaultTimePeriod(array $params = []): array
{
$options = [];
if (!empty($params['start'])) {
$options['period']['start_date'] = $params['start'];
}
if (!empty($params['end'])) {
$options['period']['end_date'] = $params['end'];
}... | [
"protected",
"function",
"setDefaultTimePeriod",
"(",
"array",
"$",
"params",
"=",
"[",
"]",
")",
":",
"array",
"{",
"$",
"options",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"params",
"[",
"'start'",
"]",
")",
")",
"{",
"$",
"options"... | Set Default Time period
@param mixed[] $params with CLI period options
@return mixed[] $options with prepopulated opts. | [
"Set",
"Default",
"Time",
"period"
] | e0ea2c4dd4257a6af972707f206151d01bb4dfbb | https://github.com/QoboLtd/cakephp-calendar/blob/e0ea2c4dd4257a6af972707f206151d01bb4dfbb/src/Shell/Task/SyncTask.php#L150-L162 |
223,730 | QoboLtd/cakephp-calendar | src/Object/ObjectFactory.php | ObjectFactory.getModuleFiles | public static function getModuleFiles(?string $path = null): array
{
$configs = [];
if (empty($path)) {
throw new InvalidArgumentException((string)__('Specify [path] for the JSON configs'));
}
$folder = new Folder($path);
$files = $folder->findRecursive('.*\.jso... | php | public static function getModuleFiles(?string $path = null): array
{
$configs = [];
if (empty($path)) {
throw new InvalidArgumentException((string)__('Specify [path] for the JSON configs'));
}
$folder = new Folder($path);
$files = $folder->findRecursive('.*\.jso... | [
"public",
"static",
"function",
"getModuleFiles",
"(",
"?",
"string",
"$",
"path",
"=",
"null",
")",
":",
"array",
"{",
"$",
"configs",
"=",
"[",
"]",
";",
"if",
"(",
"empty",
"(",
"$",
"path",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",... | Get JSON config files to map entities
@param string|null $path to map directory config/Modules/Integrations/
@return string[] | [
"Get",
"JSON",
"config",
"files",
"to",
"map",
"entities"
] | e0ea2c4dd4257a6af972707f206151d01bb4dfbb | https://github.com/QoboLtd/cakephp-calendar/blob/e0ea2c4dd4257a6af972707f206151d01bb4dfbb/src/Object/ObjectFactory.php#L138-L154 |
223,731 | QoboLtd/cakephp-calendar | src/Object/ObjectFactory.php | ObjectFactory.getModuleConfigNames | public static function getModuleConfigNames(string $entityName, array $files = [], string $path = ''): array
{
$configs = [];
foreach ($files as $k => $file) {
$label = str_replace($path, '', $file);
$label = str_replace('.json', '', $label);
$parts = array_filte... | php | public static function getModuleConfigNames(string $entityName, array $files = [], string $path = ''): array
{
$configs = [];
foreach ($files as $k => $file) {
$label = str_replace($path, '', $file);
$label = str_replace('.json', '', $label);
$parts = array_filte... | [
"public",
"static",
"function",
"getModuleConfigNames",
"(",
"string",
"$",
"entityName",
",",
"array",
"$",
"files",
"=",
"[",
"]",
",",
"string",
"$",
"path",
"=",
"''",
")",
":",
"array",
"{",
"$",
"configs",
"=",
"[",
"]",
";",
"foreach",
"(",
"$... | Trim down the list of configs based on the file paths
@param string $entityName of the object, aka 'Calls'
@param string[] $files from the given config directory
@param string $path of the basename
@return mixed[] $configs with files converted to human-readable format | [
"Trim",
"down",
"the",
"list",
"of",
"configs",
"based",
"on",
"the",
"file",
"paths"
] | e0ea2c4dd4257a6af972707f206151d01bb4dfbb | https://github.com/QoboLtd/cakephp-calendar/blob/e0ea2c4dd4257a6af972707f206151d01bb4dfbb/src/Object/ObjectFactory.php#L165-L186 |
223,732 | szmnmichalowski/ZF2-NoCaptcha | src/NoCaptcha/Service/ReCaptcha.php | ReCaptcha.verify | public function verify($response)
{
if (!$this->secretKey) {
throw new Exception('Missing secret key');
}
$params = array(
'secret' => $this->secretKey,
'response' => $response,
);
if ($this->ip !== null) {
$params['remoteip']... | php | public function verify($response)
{
if (!$this->secretKey) {
throw new Exception('Missing secret key');
}
$params = array(
'secret' => $this->secretKey,
'response' => $response,
);
if ($this->ip !== null) {
$params['remoteip']... | [
"public",
"function",
"verify",
"(",
"$",
"response",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"secretKey",
")",
"{",
"throw",
"new",
"Exception",
"(",
"'Missing secret key'",
")",
";",
"}",
"$",
"params",
"=",
"array",
"(",
"'secret'",
"=>",
"$",
... | Verify the user input
@param $response
@return Response
@throws \Exception | [
"Verify",
"the",
"user",
"input"
] | f839e9a6b2e9f400b1c6777be0ece995f691cbdb | https://github.com/szmnmichalowski/ZF2-NoCaptcha/blob/f839e9a6b2e9f400b1c6777be0ece995f691cbdb/src/NoCaptcha/Service/ReCaptcha.php#L85-L111 |
223,733 | szmnmichalowski/ZF2-NoCaptcha | src/NoCaptcha/Service/ReCaptcha.php | ReCaptcha.setOptions | public function setOptions($options = array())
{
if ($options instanceof Traversable) {
$options = ArrayUtils::iteratorToArray($options);
}
if (!is_array($options)) {
throw new \Exception('Config parameter is not a valid');
}
foreach ($options as $ke... | php | public function setOptions($options = array())
{
if ($options instanceof Traversable) {
$options = ArrayUtils::iteratorToArray($options);
}
if (!is_array($options)) {
throw new \Exception('Config parameter is not a valid');
}
foreach ($options as $ke... | [
"public",
"function",
"setOptions",
"(",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"$",
"options",
"instanceof",
"Traversable",
")",
"{",
"$",
"options",
"=",
"ArrayUtils",
"::",
"iteratorToArray",
"(",
"$",
"options",
")",
";",
"}",
... | Set configuration parameters for HTTP client
@param array|Traversable $options
@throws \Exception
@return $this | [
"Set",
"configuration",
"parameters",
"for",
"HTTP",
"client"
] | f839e9a6b2e9f400b1c6777be0ece995f691cbdb | https://github.com/szmnmichalowski/ZF2-NoCaptcha/blob/f839e9a6b2e9f400b1c6777be0ece995f691cbdb/src/NoCaptcha/Service/ReCaptcha.php#L129-L144 |
223,734 | QoboLtd/cakephp-calendar | src/Model/Table/Traits/ObjectTrait.php | ObjectTrait.getObjectInstance | public function getObjectInstance(EntityInterface $entity, $map, ArrayObject $options)
{
$object = null;
$object = new EventObject();
foreach ($map as $field => $config) {
$method = Inflector::variable('set ' . Inflector::variable($field));
if ('field' == $config->t... | php | public function getObjectInstance(EntityInterface $entity, $map, ArrayObject $options)
{
$object = null;
$object = new EventObject();
foreach ($map as $field => $config) {
$method = Inflector::variable('set ' . Inflector::variable($field));
if ('field' == $config->t... | [
"public",
"function",
"getObjectInstance",
"(",
"EntityInterface",
"$",
"entity",
",",
"$",
"map",
",",
"ArrayObject",
"$",
"options",
")",
"{",
"$",
"object",
"=",
"null",
";",
"$",
"object",
"=",
"new",
"EventObject",
"(",
")",
";",
"foreach",
"(",
"$"... | Get Object Type instance
Return prepopulated Object instance for being later saved in the db.
@param \Cake\Datasource\EntityInterface $entity to be converted
@param \stdClass $map containing ORM\Entity translation to Object instance
@param \ArrayObject $options with passed from the app
@return \Qobo\Calendar\Object\... | [
"Get",
"Object",
"Type",
"instance"
] | e0ea2c4dd4257a6af972707f206151d01bb4dfbb | https://github.com/QoboLtd/cakephp-calendar/blob/e0ea2c4dd4257a6af972707f206151d01bb4dfbb/src/Model/Table/Traits/ObjectTrait.php#L28-L52 |
223,735 | QoboLtd/cakephp-calendar | src/Model/Table/Traits/ObjectTrait.php | ObjectTrait.getEventType | public function getEventType(EntityInterface $entity, ArrayObject $options, $map = null)
{
$result = 'Json::' . $entity->getSource() . '::Default';
if (! empty($options['event_type'])) {
$result = $options['event_type'];
}
return $result;
} | php | public function getEventType(EntityInterface $entity, ArrayObject $options, $map = null)
{
$result = 'Json::' . $entity->getSource() . '::Default';
if (! empty($options['event_type'])) {
$result = $options['event_type'];
}
return $result;
} | [
"public",
"function",
"getEventType",
"(",
"EntityInterface",
"$",
"entity",
",",
"ArrayObject",
"$",
"options",
",",
"$",
"map",
"=",
"null",
")",
"{",
"$",
"result",
"=",
"'Json::'",
".",
"$",
"entity",
"->",
"getSource",
"(",
")",
".",
"'::Default'",
... | Get Default Event Type
@param \Cake\Datasource\EntityInterface $entity resource
@param \ArrayObject $options of the entity
@param mixed|null $map to transfer the object
@return string $result of event type | [
"Get",
"Default",
"Event",
"Type"
] | e0ea2c4dd4257a6af972707f206151d01bb4dfbb | https://github.com/QoboLtd/cakephp-calendar/blob/e0ea2c4dd4257a6af972707f206151d01bb4dfbb/src/Model/Table/Traits/ObjectTrait.php#L63-L72 |
223,736 | QoboLtd/cakephp-calendar | src/Model/Table/Traits/ObjectTrait.php | ObjectTrait.getCalendarId | public function getCalendarId(EntityInterface $entity, ArrayObject $options, $map = null)
{
$result = null;
if (empty($options['calendar'])) {
return $result;
}
$result = $options['calendar']->id;
return $result;
} | php | public function getCalendarId(EntityInterface $entity, ArrayObject $options, $map = null)
{
$result = null;
if (empty($options['calendar'])) {
return $result;
}
$result = $options['calendar']->id;
return $result;
} | [
"public",
"function",
"getCalendarId",
"(",
"EntityInterface",
"$",
"entity",
",",
"ArrayObject",
"$",
"options",
",",
"$",
"map",
"=",
"null",
")",
"{",
"$",
"result",
"=",
"null",
";",
"if",
"(",
"empty",
"(",
"$",
"options",
"[",
"'calendar'",
"]",
... | Get Calendar ID.
@param \Cake\Datasource\EntityInterface $entity of the received record
@param \ArrayObject $options passed from the event
@param array $map of the object
@return string|null $result of the record | [
"Get",
"Calendar",
"ID",
"."
] | e0ea2c4dd4257a6af972707f206151d01bb4dfbb | https://github.com/QoboLtd/cakephp-calendar/blob/e0ea2c4dd4257a6af972707f206151d01bb4dfbb/src/Model/Table/Traits/ObjectTrait.php#L83-L94 |
223,737 | QoboLtd/cakephp-calendar | src/Model/Table/Traits/ObjectTrait.php | ObjectTrait.getCalendarEventEndDate | public function getCalendarEventEndDate(EntityInterface $entity, ArrayObject $options, $map = null)
{
$source = $map->end_date->options->source;
$ts = Time::parse($entity->get($source));
$endDate = $ts->modify('+ 1 hour')->i18nFormat('yyyy-MM-dd HH:mm');
$result = new Time($endDate... | php | public function getCalendarEventEndDate(EntityInterface $entity, ArrayObject $options, $map = null)
{
$source = $map->end_date->options->source;
$ts = Time::parse($entity->get($source));
$endDate = $ts->modify('+ 1 hour')->i18nFormat('yyyy-MM-dd HH:mm');
$result = new Time($endDate... | [
"public",
"function",
"getCalendarEventEndDate",
"(",
"EntityInterface",
"$",
"entity",
",",
"ArrayObject",
"$",
"options",
",",
"$",
"map",
"=",
"null",
")",
"{",
"$",
"source",
"=",
"$",
"map",
"->",
"end_date",
"->",
"options",
"->",
"source",
";",
"$",... | Get Calendar Event end_date
@param \Cake\Datasource\EntityInterface $entity of the event
@param \ArrayObject $options based on the configs
@param array $map of the config
@return \Cake\I18n\Time | [
"Get",
"Calendar",
"Event",
"end_date"
] | e0ea2c4dd4257a6af972707f206151d01bb4dfbb | https://github.com/QoboLtd/cakephp-calendar/blob/e0ea2c4dd4257a6af972707f206151d01bb4dfbb/src/Model/Table/Traits/ObjectTrait.php#L105-L115 |
223,738 | QoboLtd/cakephp-calendar | src/Model/Table/Traits/ObjectTrait.php | ObjectTrait.getCalendarEventTitle | public function getCalendarEventTitle(EntityInterface $entity, ArrayObject $options, $map = null)
{
$table = TableRegistry::getTableLocator()->get($entity->source());
$displayField = $entity->get($table->getDisplayField());
$result = sprintf("%s - %s", Inflector::humanize($entity->source()... | php | public function getCalendarEventTitle(EntityInterface $entity, ArrayObject $options, $map = null)
{
$table = TableRegistry::getTableLocator()->get($entity->source());
$displayField = $entity->get($table->getDisplayField());
$result = sprintf("%s - %s", Inflector::humanize($entity->source()... | [
"public",
"function",
"getCalendarEventTitle",
"(",
"EntityInterface",
"$",
"entity",
",",
"ArrayObject",
"$",
"options",
",",
"$",
"map",
"=",
"null",
")",
"{",
"$",
"table",
"=",
"TableRegistry",
"::",
"getTableLocator",
"(",
")",
"->",
"get",
"(",
"$",
... | Get Calendar Event Title
@param \Cake\Datasource\EntityInterface $entity of the event
@param \ArrayObject $options of the configs
@param array $map of the config fields
@return string | [
"Get",
"Calendar",
"Event",
"Title"
] | e0ea2c4dd4257a6af972707f206151d01bb4dfbb | https://github.com/QoboLtd/cakephp-calendar/blob/e0ea2c4dd4257a6af972707f206151d01bb4dfbb/src/Model/Table/Traits/ObjectTrait.php#L126-L135 |
223,739 | QoboLtd/cakephp-calendar | src/Model/Table/Traits/ObjectTrait.php | ObjectTrait.getCalendarEventContent | public function getCalendarEventContent(EntityInterface $entity, ArrayObject $options, $map = null)
{
$source = $map->content->options->source;
$result = $entity->get($source);
if (!empty($options['viewEntity'])) {
$url = $options['viewEntity']->Html->link(__('Source'), ['action... | php | public function getCalendarEventContent(EntityInterface $entity, ArrayObject $options, $map = null)
{
$source = $map->content->options->source;
$result = $entity->get($source);
if (!empty($options['viewEntity'])) {
$url = $options['viewEntity']->Html->link(__('Source'), ['action... | [
"public",
"function",
"getCalendarEventContent",
"(",
"EntityInterface",
"$",
"entity",
",",
"ArrayObject",
"$",
"options",
",",
"$",
"map",
"=",
"null",
")",
"{",
"$",
"source",
"=",
"$",
"map",
"->",
"content",
"->",
"options",
"->",
"source",
";",
"$",
... | Get Calendar Event Content
Prepopulate content of the calendar event with backlink to source
@param \Cake\Datasource\EntityInterface $entity of the origin orm
@param \ArrayObject $options of the configs
@param array $map of the config conversion
@return string | [
"Get",
"Calendar",
"Event",
"Content"
] | e0ea2c4dd4257a6af972707f206151d01bb4dfbb | https://github.com/QoboLtd/cakephp-calendar/blob/e0ea2c4dd4257a6af972707f206151d01bb4dfbb/src/Model/Table/Traits/ObjectTrait.php#L148-L160 |
223,740 | puli/manager | src/Api/Server/Server.php | Server.getParameterValue | public function getParameterValue($name)
{
if (!isset($this->parameterValues[$name])) {
throw NoSuchParameterException::forParameterName($name, $this->installerName);
}
return $this->parameterValues[$name];
} | php | public function getParameterValue($name)
{
if (!isset($this->parameterValues[$name])) {
throw NoSuchParameterException::forParameterName($name, $this->installerName);
}
return $this->parameterValues[$name];
} | [
"public",
"function",
"getParameterValue",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"parameterValues",
"[",
"$",
"name",
"]",
")",
")",
"{",
"throw",
"NoSuchParameterException",
"::",
"forParameterName",
"(",
"$",
"name"... | Returns the value of the given parameter.
@param string $name The parameter name.
@return string The parameter value.
@throws NoSuchParameterException If the parameter was not found. | [
"Returns",
"the",
"value",
"of",
"the",
"given",
"parameter",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Server/Server.php#L154-L161 |
223,741 | apoutchika/MediaBundle | Services/Filter.php | Filter.set | public function set($name)
{
$filters = array_unique ($this->session->get('filters', array()));
if (in_array ($name, $filters)) {
return array_search ($name, $filters);
}
$filterKey = 'filter_'.sha1(microtime(true).mt_rand().$name);
$filters[$filterKey] ... | php | public function set($name)
{
$filters = array_unique ($this->session->get('filters', array()));
if (in_array ($name, $filters)) {
return array_search ($name, $filters);
}
$filterKey = 'filter_'.sha1(microtime(true).mt_rand().$name);
$filters[$filterKey] ... | [
"public",
"function",
"set",
"(",
"$",
"name",
")",
"{",
"$",
"filters",
"=",
"array_unique",
"(",
"$",
"this",
"->",
"session",
"->",
"get",
"(",
"'filters'",
",",
"array",
"(",
")",
")",
")",
";",
"if",
"(",
"in_array",
"(",
"$",
"name",
",",
"... | set filter.
@param string $name
@return string Key of new filter | [
"set",
"filter",
"."
] | dd52efed4a4463041da73af2cb25bdbe00365fcc | https://github.com/apoutchika/MediaBundle/blob/dd52efed4a4463041da73af2cb25bdbe00365fcc/Services/Filter.php#L42-L55 |
223,742 | puli/manager | src/Api/Config/Config.php | Config.get | public function get($key, $default = null, $fallback = true)
{
return $this->replacePlaceholders($this->getRaw($key, $default, $fallback), $fallback);
} | php | public function get($key, $default = null, $fallback = true)
{
return $this->replacePlaceholders($this->getRaw($key, $default, $fallback), $fallback);
} | [
"public",
"function",
"get",
"(",
"$",
"key",
",",
"$",
"default",
"=",
"null",
",",
"$",
"fallback",
"=",
"true",
")",
"{",
"return",
"$",
"this",
"->",
"replacePlaceholders",
"(",
"$",
"this",
"->",
"getRaw",
"(",
"$",
"key",
",",
"$",
"default",
... | Returns the value of a configuration key.
If fallback is enabled, the value of the base configuration is returned
if the key was not set.
You can also pass a default value in the second parameter. This default
value is returned if the configuration key was neither found in this nor
in its fallback configuration.
@pa... | [
"Returns",
"the",
"value",
"of",
"a",
"configuration",
"key",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Config/Config.php#L287-L290 |
223,743 | puli/manager | src/Api/Config/Config.php | Config.getRaw | public function getRaw($key, $default = null, $fallback = true)
{
if (isset(self::$compositeKeys[$key])) {
return array_replace_recursive(
is_array($default) ? $default : array(),
$fallback && $this->baseConfig ? $this->baseConfig->getRaw($key) : array(),
... | php | public function getRaw($key, $default = null, $fallback = true)
{
if (isset(self::$compositeKeys[$key])) {
return array_replace_recursive(
is_array($default) ? $default : array(),
$fallback && $this->baseConfig ? $this->baseConfig->getRaw($key) : array(),
... | [
"public",
"function",
"getRaw",
"(",
"$",
"key",
",",
"$",
"default",
"=",
"null",
",",
"$",
"fallback",
"=",
"true",
")",
"{",
"if",
"(",
"isset",
"(",
"self",
"::",
"$",
"compositeKeys",
"[",
"$",
"key",
"]",
")",
")",
"{",
"return",
"array_repla... | Returns the raw value of a configuration key.
Unlike {@link get()}, this method does not resolve placeholders:
```php
$config = new Config();
$config->set(Config::PULI_DIR, '.puli');
$config->set(Config::INSTALL_FILE, '{$puli-dir}/install-file.json');
echo $config->get(Config::PULI_DIR);
// => .puli/install-file.jso... | [
"Returns",
"the",
"raw",
"value",
"of",
"a",
"configuration",
"key",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Config/Config.php#L318-L337 |
223,744 | puli/manager | src/Api/Config/Config.php | Config.contains | public function contains($key, $fallback = true)
{
if (!isset(self::$compositeKeys[$key]) && !isset(self::$keys[$key])) {
throw NoSuchConfigKeyException::forKey($key);
}
if (array_key_exists($key, $this->values)) {
return true;
}
if (isset(self::$com... | php | public function contains($key, $fallback = true)
{
if (!isset(self::$compositeKeys[$key]) && !isset(self::$keys[$key])) {
throw NoSuchConfigKeyException::forKey($key);
}
if (array_key_exists($key, $this->values)) {
return true;
}
if (isset(self::$com... | [
"public",
"function",
"contains",
"(",
"$",
"key",
",",
"$",
"fallback",
"=",
"true",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"compositeKeys",
"[",
"$",
"key",
"]",
")",
"&&",
"!",
"isset",
"(",
"self",
"::",
"$",
"keys",
"[",
... | Returns whether a configuration key is set.
@param string $key The configuration key to search.
@param bool $fallback Whether to check the base configuration if the
key is not found.
@return bool Returns `true` if the configuration key is set.
@throws NoSuchConfigKeyException If the configuration key is inval... | [
"Returns",
"whether",
"a",
"configuration",
"key",
"is",
"set",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Config/Config.php#L350-L369 |
223,745 | puli/manager | src/Api/Config/Config.php | Config.set | public function set($key, $value)
{
if (isset(self::$compositeKeys[$key])) {
$this->assertArray($key, $value);
$this->removeByKeyPrefix($key.'.');
foreach ($value as $k => $v) {
$this->set($key.'.'.$k, $v);
}
return;
}
... | php | public function set($key, $value)
{
if (isset(self::$compositeKeys[$key])) {
$this->assertArray($key, $value);
$this->removeByKeyPrefix($key.'.');
foreach ($value as $k => $v) {
$this->set($key.'.'.$k, $v);
}
return;
}
... | [
"public",
"function",
"set",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"if",
"(",
"isset",
"(",
"self",
"::",
"$",
"compositeKeys",
"[",
"$",
"key",
"]",
")",
")",
"{",
"$",
"this",
"->",
"assertArray",
"(",
"$",
"key",
",",
"$",
"value",
"... | Sets the value of a configuration key.
@param string $key The configuration key.
@param mixed $value The value to set.
@throws NoSuchConfigKeyException If the configuration key is invalid.
@throws InvalidConfigException If the value is invalid. | [
"Sets",
"the",
"value",
"of",
"a",
"configuration",
"key",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Config/Config.php#L380-L400 |
223,746 | puli/manager | src/Api/Config/Config.php | Config.remove | public function remove($key)
{
if (isset(self::$compositeKeys[$key])) {
$this->removeByKeyPrefix($key.'.');
return;
}
if (!isset(self::$keys[$key])) {
throw NoSuchConfigKeyException::forKey($key);
}
unset($this->values[$key]);
} | php | public function remove($key)
{
if (isset(self::$compositeKeys[$key])) {
$this->removeByKeyPrefix($key.'.');
return;
}
if (!isset(self::$keys[$key])) {
throw NoSuchConfigKeyException::forKey($key);
}
unset($this->values[$key]);
} | [
"public",
"function",
"remove",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"isset",
"(",
"self",
"::",
"$",
"compositeKeys",
"[",
"$",
"key",
"]",
")",
")",
"{",
"$",
"this",
"->",
"removeByKeyPrefix",
"(",
"$",
"key",
".",
"'.'",
")",
";",
"return",
... | Removes a configuration key.
If the configuration has a base configuration, the default value will
be returned by {@link get()} after removing the key.
@param string $key The configuration key to remove.
@throws NoSuchConfigKeyException If the configuration key is invalid. | [
"Removes",
"a",
"configuration",
"key",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Config/Config.php#L441-L454 |
223,747 | puli/manager | src/Api/Config/Config.php | Config.toFlatRawArray | public function toFlatRawArray($includeFallback = true)
{
return $includeFallback && $this->baseConfig
? array_replace($this->baseConfig->toFlatRawArray(), $this->values)
: $this->values;
} | php | public function toFlatRawArray($includeFallback = true)
{
return $includeFallback && $this->baseConfig
? array_replace($this->baseConfig->toFlatRawArray(), $this->values)
: $this->values;
} | [
"public",
"function",
"toFlatRawArray",
"(",
"$",
"includeFallback",
"=",
"true",
")",
"{",
"return",
"$",
"includeFallback",
"&&",
"$",
"this",
"->",
"baseConfig",
"?",
"array_replace",
"(",
"$",
"this",
"->",
"baseConfig",
"->",
"toFlatRawArray",
"(",
")",
... | Returns all raw configuration values as flat array.
Unlike {@link toFlatArray()}, this method does not resolve placeholders:
```php
$config = new Config();
$config->set(Config::PULI_DIR, '.puli');
$config->set(Config::REGISTRY_FILE, '{$puli-dir}/ServiceRegistry.php');
print_r($config->toFlatArray());
// Array(
// ... | [
"Returns",
"all",
"raw",
"configuration",
"values",
"as",
"flat",
"array",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Config/Config.php#L508-L513 |
223,748 | puli/manager | src/Api/Config/Config.php | Config.toRawArray | public function toRawArray($includeFallback = true)
{
$values = array();
foreach ($this->values as $key => $value) {
$this->addKeyValue($key, $value, $values);
}
return $includeFallback && $this->baseConfig
? array_replace_recursive($this->baseConfig->toRawA... | php | public function toRawArray($includeFallback = true)
{
$values = array();
foreach ($this->values as $key => $value) {
$this->addKeyValue($key, $value, $values);
}
return $includeFallback && $this->baseConfig
? array_replace_recursive($this->baseConfig->toRawA... | [
"public",
"function",
"toRawArray",
"(",
"$",
"includeFallback",
"=",
"true",
")",
"{",
"$",
"values",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"values",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"add... | Returns all raw configuration values as nested array.
Unlike {@link toArray()}, this method does not resolve placeholders:
```php
$config = new Config();
$config->set(Config::PULI_DIR, '.puli');
$config->set(Config::REPO_STORAGE_DIR, '{$puli-dir}/repository');
print_r($config->toArray());
// Array(
// 'puli-dir'... | [
"Returns",
"all",
"raw",
"configuration",
"values",
"as",
"nested",
"array",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Config/Config.php#L560-L571 |
223,749 | puli/manager | src/Api/Config/Config.php | Config.isEmpty | public function isEmpty($includeFallback = true)
{
if (!empty($this->values)) {
return false;
}
return $includeFallback && $this->baseConfig
? $this->baseConfig->isEmpty(true)
: true;
} | php | public function isEmpty($includeFallback = true)
{
if (!empty($this->values)) {
return false;
}
return $includeFallback && $this->baseConfig
? $this->baseConfig->isEmpty(true)
: true;
} | [
"public",
"function",
"isEmpty",
"(",
"$",
"includeFallback",
"=",
"true",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"values",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"$",
"includeFallback",
"&&",
"$",
"this",
"->",
"ba... | Returns whether the configuration is empty.
@param bool $includeFallback Whether to include values set in the base
configuration passed to {@link __construct()}.
@return bool Returns `true` if no key is set and `false` otherwise. | [
"Returns",
"whether",
"the",
"configuration",
"is",
"empty",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Config/Config.php#L581-L590 |
223,750 | puli/manager | src/Repository/Mapping/ConflictCollection.php | ConflictCollection.get | public function get($repositoryPath)
{
if (!isset($this->conflicts[$repositoryPath])) {
throw new OutOfBoundsException(sprintf(
'No conflict is stored for the path "%s".',
$repositoryPath
));
}
return $this->conflicts[$repositoryPath];... | php | public function get($repositoryPath)
{
if (!isset($this->conflicts[$repositoryPath])) {
throw new OutOfBoundsException(sprintf(
'No conflict is stored for the path "%s".',
$repositoryPath
));
}
return $this->conflicts[$repositoryPath];... | [
"public",
"function",
"get",
"(",
"$",
"repositoryPath",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"conflicts",
"[",
"$",
"repositoryPath",
"]",
")",
")",
"{",
"throw",
"new",
"OutOfBoundsException",
"(",
"sprintf",
"(",
"'No conflict is s... | Get a path conflict.
@param string $repositoryPath The repository path
@throws OutOfBoundsException If the collection does not contain a conflict for the given repository path.
@return PathConflict The path conflict | [
"Get",
"a",
"path",
"conflict",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Repository/Mapping/ConflictCollection.php#L67-L77 |
223,751 | puli/manager | src/Api/Repository/DuplicatePathMappingException.php | DuplicatePathMappingException.forRepositoryPath | public static function forRepositoryPath($repositoryPath, $moduleName, Exception $cause = null)
{
return new static(sprintf(
'The path "%s" is already mapped in module "%s".',
$repositoryPath,
$moduleName
), 0, $cause);
} | php | public static function forRepositoryPath($repositoryPath, $moduleName, Exception $cause = null)
{
return new static(sprintf(
'The path "%s" is already mapped in module "%s".',
$repositoryPath,
$moduleName
), 0, $cause);
} | [
"public",
"static",
"function",
"forRepositoryPath",
"(",
"$",
"repositoryPath",
",",
"$",
"moduleName",
",",
"Exception",
"$",
"cause",
"=",
"null",
")",
"{",
"return",
"new",
"static",
"(",
"sprintf",
"(",
"'The path \"%s\" is already mapped in module \"%s\".'",
"... | Creates an exception for a duplicate repository path.
@param string $repositoryPath The mapped repository path.
@param string $moduleName The name of the module containing
the mapping.
@param Exception|null $cause The exception that caused this
exception.
@return static The created except... | [
"Creates",
"an",
"exception",
"for",
"a",
"duplicate",
"repository",
"path",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Repository/DuplicatePathMappingException.php#L37-L44 |
223,752 | yosymfony/config-loader | src/ConfigLoader.php | ConfigLoader.load | public function load($resource, $type = null) : RepositoryInterface
{
$repository = $this->resolveLoader($resource, $type)->load($resource, $type);
return $repository;
} | php | public function load($resource, $type = null) : RepositoryInterface
{
$repository = $this->resolveLoader($resource, $type)->load($resource, $type);
return $repository;
} | [
"public",
"function",
"load",
"(",
"$",
"resource",
",",
"$",
"type",
"=",
"null",
")",
":",
"RepositoryInterface",
"{",
"$",
"repository",
"=",
"$",
"this",
"->",
"resolveLoader",
"(",
"$",
"resource",
",",
"$",
"type",
")",
"->",
"load",
"(",
"$",
... | Loads a resource such as a file or an inline configuration
@param string $resource Filename or string representation
@param string $type The resource type. Doesn't set this argument in
case of a filename passes as resource
@return RepositoryInterface
@throws LoaderLoadException If the loader not found | [
"Loads",
"a",
"resource",
"such",
"as",
"a",
"file",
"or",
"an",
"inline",
"configuration"
] | 47c97f5014e2d1134f8655a1f14fd3504c997cf2 | https://github.com/yosymfony/config-loader/blob/47c97f5014e2d1134f8655a1f14fd3504c997cf2/src/ConfigLoader.php#L47-L52 |
223,753 | simplesamlphp/simplesamlphp-module-openidprovider | lib/Server.php | sspmod_openidProvider_Server.getUserId | public function getUserId() {
if (!$this->authSource->isAuthenticated()) {
return NULL;
}
$attributes = $this->authSource->getAttributes();
if (!array_key_exists($this->usernameAttribute, $attributes)) {
throw new SimpleSAML_Error_Exception('Missing username attribute ' .
var_export($this->usernameA... | php | public function getUserId() {
if (!$this->authSource->isAuthenticated()) {
return NULL;
}
$attributes = $this->authSource->getAttributes();
if (!array_key_exists($this->usernameAttribute, $attributes)) {
throw new SimpleSAML_Error_Exception('Missing username attribute ' .
var_export($this->usernameA... | [
"public",
"function",
"getUserId",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"authSource",
"->",
"isAuthenticated",
"(",
")",
")",
"{",
"return",
"NULL",
";",
"}",
"$",
"attributes",
"=",
"$",
"this",
"->",
"authSource",
"->",
"getAttributes",
... | Retrieve the current user ID.
@return string The current user ID, or NULL if the user isn't authenticated. | [
"Retrieve",
"the",
"current",
"user",
"ID",
"."
] | 1b2c50660712fd87946d43e73032e1b1830ebf61 | https://github.com/simplesamlphp/simplesamlphp-module-openidprovider/blob/1b2c50660712fd87946d43e73032e1b1830ebf61/lib/Server.php#L133-L155 |
223,754 | simplesamlphp/simplesamlphp-module-openidprovider | lib/Server.php | sspmod_openidProvider_Server.getIdentity | public function getIdentity() {
$userId = $this->getUserId();
if ($userId === NULL) {
return NULL;
}
$identity = SimpleSAML\Module::getModuleURL('openidProvider/user.php/' . $userId);
return $identity;
} | php | public function getIdentity() {
$userId = $this->getUserId();
if ($userId === NULL) {
return NULL;
}
$identity = SimpleSAML\Module::getModuleURL('openidProvider/user.php/' . $userId);
return $identity;
} | [
"public",
"function",
"getIdentity",
"(",
")",
"{",
"$",
"userId",
"=",
"$",
"this",
"->",
"getUserId",
"(",
")",
";",
"if",
"(",
"$",
"userId",
"===",
"NULL",
")",
"{",
"return",
"NULL",
";",
"}",
"$",
"identity",
"=",
"SimpleSAML",
"\\",
"Module",
... | Retrieve the current identity.
@return string The current identity, or NULL if the user isn't authenticated. | [
"Retrieve",
"the",
"current",
"identity",
"."
] | 1b2c50660712fd87946d43e73032e1b1830ebf61 | https://github.com/simplesamlphp/simplesamlphp-module-openidprovider/blob/1b2c50660712fd87946d43e73032e1b1830ebf61/lib/Server.php#L163-L172 |
223,755 | simplesamlphp/simplesamlphp-module-openidprovider | lib/Server.php | sspmod_openidProvider_Server.addTrustRoot | public function addTrustRoot($identity, $trustRoot) {
assert('is_string($identity)');
assert('is_string($trustRoot)');
$trs = $this->getTrustRoots($identity);
if (!in_array($trustRoot, $trs, TRUE)) {
$trs[] = $trustRoot;
}
$this->saveTrustRoots($identity, $trs);
} | php | public function addTrustRoot($identity, $trustRoot) {
assert('is_string($identity)');
assert('is_string($trustRoot)');
$trs = $this->getTrustRoots($identity);
if (!in_array($trustRoot, $trs, TRUE)) {
$trs[] = $trustRoot;
}
$this->saveTrustRoots($identity, $trs);
} | [
"public",
"function",
"addTrustRoot",
"(",
"$",
"identity",
",",
"$",
"trustRoot",
")",
"{",
"assert",
"(",
"'is_string($identity)'",
")",
";",
"assert",
"(",
"'is_string($trustRoot)'",
")",
";",
"$",
"trs",
"=",
"$",
"this",
"->",
"getTrustRoots",
"(",
"$",... | Add the given trust root to the user.
@param string $identity The identity of the user.
@param string $trustRoot The trust root. | [
"Add",
"the",
"given",
"trust",
"root",
"to",
"the",
"user",
"."
] | 1b2c50660712fd87946d43e73032e1b1830ebf61 | https://github.com/simplesamlphp/simplesamlphp-module-openidprovider/blob/1b2c50660712fd87946d43e73032e1b1830ebf61/lib/Server.php#L264-L274 |
223,756 | simplesamlphp/simplesamlphp-module-openidprovider | lib/Server.php | sspmod_openidProvider_Server.removeTrustRoot | public function removeTrustRoot($identity, $trustRoot) {
assert('is_string($identity)');
assert('is_string($trustRoot)');
$trs = $this->getTrustRoots($identity);
$i = array_search($trustRoot, $trs, TRUE);
if ($i === FALSE) {
return;
}
array_splice($trs, $i, 1, array());
$this->saveTrustRoots($ident... | php | public function removeTrustRoot($identity, $trustRoot) {
assert('is_string($identity)');
assert('is_string($trustRoot)');
$trs = $this->getTrustRoots($identity);
$i = array_search($trustRoot, $trs, TRUE);
if ($i === FALSE) {
return;
}
array_splice($trs, $i, 1, array());
$this->saveTrustRoots($ident... | [
"public",
"function",
"removeTrustRoot",
"(",
"$",
"identity",
",",
"$",
"trustRoot",
")",
"{",
"assert",
"(",
"'is_string($identity)'",
")",
";",
"assert",
"(",
"'is_string($trustRoot)'",
")",
";",
"$",
"trs",
"=",
"$",
"this",
"->",
"getTrustRoots",
"(",
"... | Remove the given trust root from the trust list of the user.
@param string $identity The identity of the user.
@param string $trustRoot The trust root. | [
"Remove",
"the",
"given",
"trust",
"root",
"from",
"the",
"trust",
"list",
"of",
"the",
"user",
"."
] | 1b2c50660712fd87946d43e73032e1b1830ebf61 | https://github.com/simplesamlphp/simplesamlphp-module-openidprovider/blob/1b2c50660712fd87946d43e73032e1b1830ebf61/lib/Server.php#L283-L295 |
223,757 | simplesamlphp/simplesamlphp-module-openidprovider | lib/Server.php | sspmod_openidProvider_Server.isTrusted | private function isTrusted($identity, $trustRoot) {
assert('is_string($identity)');
assert('is_string($trustRoot)');
$trs = $this->getTrustRoots($identity);
return in_array($trustRoot, $trs, TRUE);
} | php | private function isTrusted($identity, $trustRoot) {
assert('is_string($identity)');
assert('is_string($trustRoot)');
$trs = $this->getTrustRoots($identity);
return in_array($trustRoot, $trs, TRUE);
} | [
"private",
"function",
"isTrusted",
"(",
"$",
"identity",
",",
"$",
"trustRoot",
")",
"{",
"assert",
"(",
"'is_string($identity)'",
")",
";",
"assert",
"(",
"'is_string($trustRoot)'",
")",
";",
"$",
"trs",
"=",
"$",
"this",
"->",
"getTrustRoots",
"(",
"$",
... | Is the given trust root trusted by the user?
@param string $identity The identity of the user.
@param string $trustRoot The trust root.
@return TRUE if it is trusted, FALSE if not. | [
"Is",
"the",
"given",
"trust",
"root",
"trusted",
"by",
"the",
"user?"
] | 1b2c50660712fd87946d43e73032e1b1830ebf61 | https://github.com/simplesamlphp/simplesamlphp-module-openidprovider/blob/1b2c50660712fd87946d43e73032e1b1830ebf61/lib/Server.php#L305-L311 |
223,758 | simplesamlphp/simplesamlphp-module-openidprovider | lib/Server.php | sspmod_openidProvider_Server.getStateURL | private function getStateURL($page, array $state) {
assert('is_string($page)');
$stateId = SimpleSAML_Auth_State::saveState($state, 'openidProvider:resumeState');
$stateURL = SimpleSAML\Module::getModuleURL('openidProvider/' . $page);
$stateURL = \SimpleSAML\Utils\HTTP::addURLParameters($stateURL, array('State... | php | private function getStateURL($page, array $state) {
assert('is_string($page)');
$stateId = SimpleSAML_Auth_State::saveState($state, 'openidProvider:resumeState');
$stateURL = SimpleSAML\Module::getModuleURL('openidProvider/' . $page);
$stateURL = \SimpleSAML\Utils\HTTP::addURLParameters($stateURL, array('State... | [
"private",
"function",
"getStateURL",
"(",
"$",
"page",
",",
"array",
"$",
"state",
")",
"{",
"assert",
"(",
"'is_string($page)'",
")",
";",
"$",
"stateId",
"=",
"SimpleSAML_Auth_State",
"::",
"saveState",
"(",
"$",
"state",
",",
"'openidProvider:resumeState'",
... | Save the state, and return a URL that can contain a reference to the state.
@param string $page The name of the page.
@param array $state The state array.
@return string A URL with the state ID as a parameter. | [
"Save",
"the",
"state",
"and",
"return",
"a",
"URL",
"that",
"can",
"contain",
"a",
"reference",
"to",
"the",
"state",
"."
] | 1b2c50660712fd87946d43e73032e1b1830ebf61 | https://github.com/simplesamlphp/simplesamlphp-module-openidprovider/blob/1b2c50660712fd87946d43e73032e1b1830ebf61/lib/Server.php#L321-L329 |
223,759 | simplesamlphp/simplesamlphp-module-openidprovider | lib/Server.php | sspmod_openidProvider_Server.sendResponse | private function sendResponse(Auth_OpenID_ServerResponse $response) {
SimpleSAML\Logger::debug('openidProvider::sendResponse');
$webresponse = $this->server->encodeResponse($response);
if ($webresponse->code !== 200) {
header('HTTP/1.1 ' . $webresponse->code, TRUE, $webresponse->code);
}
foreach ($webr... | php | private function sendResponse(Auth_OpenID_ServerResponse $response) {
SimpleSAML\Logger::debug('openidProvider::sendResponse');
$webresponse = $this->server->encodeResponse($response);
if ($webresponse->code !== 200) {
header('HTTP/1.1 ' . $webresponse->code, TRUE, $webresponse->code);
}
foreach ($webr... | [
"private",
"function",
"sendResponse",
"(",
"Auth_OpenID_ServerResponse",
"$",
"response",
")",
"{",
"SimpleSAML",
"\\",
"Logger",
"::",
"debug",
"(",
"'openidProvider::sendResponse'",
")",
";",
"$",
"webresponse",
"=",
"$",
"this",
"->",
"server",
"->",
"encodeRe... | Send an OpenID response.
This function never returns.
@param Auth_OpenID_ServerResponse $response The response. | [
"Send",
"an",
"OpenID",
"response",
"."
] | 1b2c50660712fd87946d43e73032e1b1830ebf61 | https://github.com/simplesamlphp/simplesamlphp-module-openidprovider/blob/1b2c50660712fd87946d43e73032e1b1830ebf61/lib/Server.php#L352-L369 |
223,760 | simplesamlphp/simplesamlphp-module-openidprovider | lib/Server.php | sspmod_openidProvider_Server.receiveRequest | public function receiveRequest() {
$request = $this->server->decodeRequest();
if (!in_array($request->mode, array('checkid_immediate', 'checkid_setup'), TRUE)) {
$this->sendResponse($this->server->handleRequest($request));
}
$state = array(
'request' => $request,
);
$this->processRequest($state);
... | php | public function receiveRequest() {
$request = $this->server->decodeRequest();
if (!in_array($request->mode, array('checkid_immediate', 'checkid_setup'), TRUE)) {
$this->sendResponse($this->server->handleRequest($request));
}
$state = array(
'request' => $request,
);
$this->processRequest($state);
... | [
"public",
"function",
"receiveRequest",
"(",
")",
"{",
"$",
"request",
"=",
"$",
"this",
"->",
"server",
"->",
"decodeRequest",
"(",
")",
";",
"if",
"(",
"!",
"in_array",
"(",
"$",
"request",
"->",
"mode",
",",
"array",
"(",
"'checkid_immediate'",
",",
... | Receive an incoming request.
This function never returns. | [
"Receive",
"an",
"incoming",
"request",
"."
] | 1b2c50660712fd87946d43e73032e1b1830ebf61 | https://github.com/simplesamlphp/simplesamlphp-module-openidprovider/blob/1b2c50660712fd87946d43e73032e1b1830ebf61/lib/Server.php#L470-L483 |
223,761 | apoutchika/MediaBundle | DependencyInjection/ApoutchikaMediaExtension.php | ApoutchikaMediaExtension.addParameters | private function addParameters(ContainerBuilder $container, array $parameters)
{
foreach ($parameters as $key => $value) {
$container->setParameter('apoutchika_media.'.$key, $value);
}
} | php | private function addParameters(ContainerBuilder $container, array $parameters)
{
foreach ($parameters as $key => $value) {
$container->setParameter('apoutchika_media.'.$key, $value);
}
} | [
"private",
"function",
"addParameters",
"(",
"ContainerBuilder",
"$",
"container",
",",
"array",
"$",
"parameters",
")",
"{",
"foreach",
"(",
"$",
"parameters",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"container",
"->",
"setParameter",
"(",
"'... | Add parameter in container.
@param ContainerBuilder $container
@param array $parameter List of parameters with keys / values (without base parameter name) | [
"Add",
"parameter",
"in",
"container",
"."
] | dd52efed4a4463041da73af2cb25bdbe00365fcc | https://github.com/apoutchika/MediaBundle/blob/dd52efed4a4463041da73af2cb25bdbe00365fcc/DependencyInjection/ApoutchikaMediaExtension.php#L74-L79 |
223,762 | ongr-io/FilterManagerBundle | Filter/Widget/Choice/MultiTermChoice.php | MultiTermChoice.getOptionUrlParameters | protected function getOptionUrlParameters($key, ViewData $data)
{
$parameters = $data->getUrlParameters();
if (isset($parameters[$this->getRequestField()])) {
$parameters[$this->getRequestField()][] = $key;
} else {
$parameters[$this->getRequestField()] = [$key];
... | php | protected function getOptionUrlParameters($key, ViewData $data)
{
$parameters = $data->getUrlParameters();
if (isset($parameters[$this->getRequestField()])) {
$parameters[$this->getRequestField()][] = $key;
} else {
$parameters[$this->getRequestField()] = [$key];
... | [
"protected",
"function",
"getOptionUrlParameters",
"(",
"$",
"key",
",",
"ViewData",
"$",
"data",
")",
"{",
"$",
"parameters",
"=",
"$",
"data",
"->",
"getUrlParameters",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"parameters",
"[",
"$",
"this",
"->",
... | Returns url with selected term applied.
@param string $key
@param ViewData $data
@return array | [
"Returns",
"url",
"with",
"selected",
"term",
"applied",
"."
] | 26c1125457f0440019b9bf20090bf23ba4bb1905 | https://github.com/ongr-io/FilterManagerBundle/blob/26c1125457f0440019b9bf20090bf23ba4bb1905/Filter/Widget/Choice/MultiTermChoice.php#L59-L70 |
223,763 | ongr-io/FilterManagerBundle | Controller/ManagerController.php | ManagerController.getFilterManagerResponse | protected function getFilterManagerResponse(Request $request, $managerName)
{
return [
'filter_manager' => $this->get(ONGRFilterManagerExtension::getFilterManagerId($managerName))
->handleRequest($request)
];
} | php | protected function getFilterManagerResponse(Request $request, $managerName)
{
return [
'filter_manager' => $this->get(ONGRFilterManagerExtension::getFilterManagerId($managerName))
->handleRequest($request)
];
} | [
"protected",
"function",
"getFilterManagerResponse",
"(",
"Request",
"$",
"request",
",",
"$",
"managerName",
")",
"{",
"return",
"[",
"'filter_manager'",
"=>",
"$",
"this",
"->",
"get",
"(",
"ONGRFilterManagerExtension",
"::",
"getFilterManagerId",
"(",
"$",
"man... | Returns search response results from filter manager.
@param Request $request Request.
@param string $managerName Filter manager name.
@return array | [
"Returns",
"search",
"response",
"results",
"from",
"filter",
"manager",
"."
] | 26c1125457f0440019b9bf20090bf23ba4bb1905 | https://github.com/ongr-io/FilterManagerBundle/blob/26c1125457f0440019b9bf20090bf23ba4bb1905/Controller/ManagerController.php#L50-L56 |
223,764 | ongr-io/FilterManagerBundle | Controller/ManagerController.php | ManagerController.jsonAction | public function jsonAction(Request $request, $managerName)
{
$data = $this->get(ONGRFilterManagerExtension::getFilterManagerId($managerName))
->handleRequest($request)
->getSerializableData();
$response = new JsonResponse($data);
if ($request->query->has('pretty')) ... | php | public function jsonAction(Request $request, $managerName)
{
$data = $this->get(ONGRFilterManagerExtension::getFilterManagerId($managerName))
->handleRequest($request)
->getSerializableData();
$response = new JsonResponse($data);
if ($request->query->has('pretty')) ... | [
"public",
"function",
"jsonAction",
"(",
"Request",
"$",
"request",
",",
"$",
"managerName",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"get",
"(",
"ONGRFilterManagerExtension",
"::",
"getFilterManagerId",
"(",
"$",
"managerName",
")",
")",
"->",
"handle... | Returns JSON response with search response data.
@param Request $request Request.
@param string $name Filter manager name.
@return JsonResponse | [
"Returns",
"JSON",
"response",
"with",
"search",
"response",
"data",
"."
] | 26c1125457f0440019b9bf20090bf23ba4bb1905 | https://github.com/ongr-io/FilterManagerBundle/blob/26c1125457f0440019b9bf20090bf23ba4bb1905/Controller/ManagerController.php#L66-L79 |
223,765 | apoutchika/MediaBundle | Services/FileInfo.php | FileInfo.getMimeType | public function getMimeType()
{
if ($this->file instanceof UploadedFile) {
return $this->file->getClientMimeType();
}
return $this->file->getMimeType();
} | php | public function getMimeType()
{
if ($this->file instanceof UploadedFile) {
return $this->file->getClientMimeType();
}
return $this->file->getMimeType();
} | [
"public",
"function",
"getMimeType",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"file",
"instanceof",
"UploadedFile",
")",
"{",
"return",
"$",
"this",
"->",
"file",
"->",
"getClientMimeType",
"(",
")",
";",
"}",
"return",
"$",
"this",
"->",
"file",
"... | Get mime type of file.
@return string | [
"Get",
"mime",
"type",
"of",
"file",
"."
] | dd52efed4a4463041da73af2cb25bdbe00365fcc | https://github.com/apoutchika/MediaBundle/blob/dd52efed4a4463041da73af2cb25bdbe00365fcc/Services/FileInfo.php#L52-L59 |
223,766 | apoutchika/MediaBundle | Services/FileInfo.php | FileInfo.getName | public function getName()
{
if ($this->file instanceof UploadedFile) {
return $this->file->getClientOriginalName();
}
return $this->file->getFilename();
} | php | public function getName()
{
if ($this->file instanceof UploadedFile) {
return $this->file->getClientOriginalName();
}
return $this->file->getFilename();
} | [
"public",
"function",
"getName",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"file",
"instanceof",
"UploadedFile",
")",
"{",
"return",
"$",
"this",
"->",
"file",
"->",
"getClientOriginalName",
"(",
")",
";",
"}",
"return",
"$",
"this",
"->",
"file",
"... | Get original name of file.
@return string | [
"Get",
"original",
"name",
"of",
"file",
"."
] | dd52efed4a4463041da73af2cb25bdbe00365fcc | https://github.com/apoutchika/MediaBundle/blob/dd52efed4a4463041da73af2cb25bdbe00365fcc/Services/FileInfo.php#L66-L73 |
223,767 | apoutchika/MediaBundle | Services/FileInfo.php | FileInfo.getType | public function getType()
{
$mimeType = preg_replace('#^([^/]+)/.*$#', '$1', $this->getMimeType());
if ($mimeType == 'video') {
return Media::VIDEO;
}
if ($mimeType == 'audio') {
return Media::AUDIO;
}
if ($mimeType == 'image') {
... | php | public function getType()
{
$mimeType = preg_replace('#^([^/]+)/.*$#', '$1', $this->getMimeType());
if ($mimeType == 'video') {
return Media::VIDEO;
}
if ($mimeType == 'audio') {
return Media::AUDIO;
}
if ($mimeType == 'image') {
... | [
"public",
"function",
"getType",
"(",
")",
"{",
"$",
"mimeType",
"=",
"preg_replace",
"(",
"'#^([^/]+)/.*$#'",
",",
"'$1'",
",",
"$",
"this",
"->",
"getMimeType",
"(",
")",
")",
";",
"if",
"(",
"$",
"mimeType",
"==",
"'video'",
")",
"{",
"return",
"Med... | Get type of file. It's a constace in Media class.
@return int | [
"Get",
"type",
"of",
"file",
".",
"It",
"s",
"a",
"constace",
"in",
"Media",
"class",
"."
] | dd52efed4a4463041da73af2cb25bdbe00365fcc | https://github.com/apoutchika/MediaBundle/blob/dd52efed4a4463041da73af2cb25bdbe00365fcc/Services/FileInfo.php#L80-L111 |
223,768 | puli/manager | src/Api/Repository/PathMapping.php | PathMapping.load | public function load(Module $containingModule, ModuleList $modules)
{
if (null !== $this->state) {
throw new AlreadyLoadedException('The mapping is already loaded.');
}
$filesystemPaths = array();
$pathMappings = array();
$loadErrors = array();
foreach (... | php | public function load(Module $containingModule, ModuleList $modules)
{
if (null !== $this->state) {
throw new AlreadyLoadedException('The mapping is already loaded.');
}
$filesystemPaths = array();
$pathMappings = array();
$loadErrors = array();
foreach (... | [
"public",
"function",
"load",
"(",
"Module",
"$",
"containingModule",
",",
"ModuleList",
"$",
"modules",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"state",
")",
"{",
"throw",
"new",
"AlreadyLoadedException",
"(",
"'The mapping is already loaded.'",
... | Loads the mapping.
@param Module $containingModule The module that contains the
mapping.
@param ModuleList $modules A list of modules that can
be referenced using
`@vendor/module:` prefixes
in the path references.
@throws AlreadyLoadedException If the mapping is already loaded. | [
"Loads",
"the",
"mapping",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Repository/PathMapping.php#L123-L186 |
223,769 | puli/manager | src/Api/Repository/PathMapping.php | PathMapping.unload | public function unload()
{
if (null === $this->state) {
throw new NotLoadedException('The mapping is not loaded.');
}
$conflictsToRelease = $this->conflicts;
$this->conflicts = array();
foreach ($conflictsToRelease as $conflict) {
$conflict->removeM... | php | public function unload()
{
if (null === $this->state) {
throw new NotLoadedException('The mapping is not loaded.');
}
$conflictsToRelease = $this->conflicts;
$this->conflicts = array();
foreach ($conflictsToRelease as $conflict) {
$conflict->removeM... | [
"public",
"function",
"unload",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"state",
")",
"{",
"throw",
"new",
"NotLoadedException",
"(",
"'The mapping is not loaded.'",
")",
";",
"}",
"$",
"conflictsToRelease",
"=",
"$",
"this",
"->",
"con... | Unloads the mapping.
This method reverses the effects of {@link load()}. Additionally, all
associated conflicts are dereferenced.
@throws NotLoadedException If the mapping is not loaded. | [
"Unloads",
"the",
"mapping",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Repository/PathMapping.php#L196-L216 |
223,770 | puli/manager | src/Api/Repository/PathMapping.php | PathMapping.addConflict | public function addConflict(PathConflict $conflict)
{
if (null === $this->state) {
throw new NotLoadedException('The mapping is not loaded.');
}
if (!Path::isBasePath($this->repositoryPath, $conflict->getRepositoryPath())) {
throw new InvalidArgumentException(sprintf... | php | public function addConflict(PathConflict $conflict)
{
if (null === $this->state) {
throw new NotLoadedException('The mapping is not loaded.');
}
if (!Path::isBasePath($this->repositoryPath, $conflict->getRepositoryPath())) {
throw new InvalidArgumentException(sprintf... | [
"public",
"function",
"addConflict",
"(",
"PathConflict",
"$",
"conflict",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"state",
")",
"{",
"throw",
"new",
"NotLoadedException",
"(",
"'The mapping is not loaded.'",
")",
";",
"}",
"if",
"(",
"!",
"... | Adds a conflict to the mapping.
A mapping can refer to at most one conflict per conflicting repository
path. If the same conflict is added twice, the second addition is
ignored. If a different conflict is added for an existing repository
path, the previous conflict is removed before adding the new conflict
for the rep... | [
"Adds",
"a",
"conflict",
"to",
"the",
"mapping",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Repository/PathMapping.php#L373-L403 |
223,771 | puli/manager | src/Api/Repository/PathMapping.php | PathMapping.removeConflict | public function removeConflict(PathConflict $conflict)
{
if (null === $this->state) {
throw new NotLoadedException('The mapping is not loaded.');
}
$repositoryPath = $conflict->getRepositoryPath();
if (!isset($this->conflicts[$repositoryPath]) || $conflict !== $this->co... | php | public function removeConflict(PathConflict $conflict)
{
if (null === $this->state) {
throw new NotLoadedException('The mapping is not loaded.');
}
$repositoryPath = $conflict->getRepositoryPath();
if (!isset($this->conflicts[$repositoryPath]) || $conflict !== $this->co... | [
"public",
"function",
"removeConflict",
"(",
"PathConflict",
"$",
"conflict",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"state",
")",
"{",
"throw",
"new",
"NotLoadedException",
"(",
"'The mapping is not loaded.'",
")",
";",
"}",
"$",
"repositoryPa... | Removes a conflict from the mapping.
The method {@link load()} needs to be called before calling this method,
otherwise an exception is thrown.
@param PathConflict $conflict The conflict to remove.
@throws NotLoadedException If the mapping is not loaded. | [
"Removes",
"a",
"conflict",
"from",
"the",
"mapping",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Repository/PathMapping.php#L415-L431 |
223,772 | puli/manager | src/Api/Repository/PathMapping.php | PathMapping.getConflictingModules | public function getConflictingModules()
{
if (null === $this->state) {
throw new NotLoadedException('The mapping is not loaded.');
}
$collection = new ModuleList();
foreach ($this->conflicts as $conflict) {
foreach ($conflict->getMappings() as $mapping) {
... | php | public function getConflictingModules()
{
if (null === $this->state) {
throw new NotLoadedException('The mapping is not loaded.');
}
$collection = new ModuleList();
foreach ($this->conflicts as $conflict) {
foreach ($conflict->getMappings() as $mapping) {
... | [
"public",
"function",
"getConflictingModules",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"state",
")",
"{",
"throw",
"new",
"NotLoadedException",
"(",
"'The mapping is not loaded.'",
")",
";",
"}",
"$",
"collection",
"=",
"new",
"ModuleList",... | Returns all modules with conflicting path mappings.
The method {@link load()} needs to be called before calling this method,
otherwise an exception is thrown.
@return ModuleList The conflicting modules.
@throws NotLoadedException If the mapping is not loaded. | [
"Returns",
"all",
"modules",
"with",
"conflicting",
"path",
"mappings",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Repository/PathMapping.php#L462-L481 |
223,773 | puli/manager | src/Api/Repository/PathMapping.php | PathMapping.getConflictingMappings | public function getConflictingMappings()
{
if (null === $this->state) {
throw new NotLoadedException('The mapping is not loaded.');
}
$conflictingMappings = array();
foreach ($this->conflicts as $conflict) {
foreach ($conflict->getMappings() as $mapping) {
... | php | public function getConflictingMappings()
{
if (null === $this->state) {
throw new NotLoadedException('The mapping is not loaded.');
}
$conflictingMappings = array();
foreach ($this->conflicts as $conflict) {
foreach ($conflict->getMappings() as $mapping) {
... | [
"public",
"function",
"getConflictingMappings",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"state",
")",
"{",
"throw",
"new",
"NotLoadedException",
"(",
"'The mapping is not loaded.'",
")",
";",
"}",
"$",
"conflictingMappings",
"=",
"array",
"... | Returns all conflicting path mappings.
The method {@link load()} needs to be called before calling this method,
otherwise an exception is thrown.
@return PathMapping[] The conflicting path mappings.
@throws NotLoadedException If the mapping is not loaded. | [
"Returns",
"all",
"conflicting",
"path",
"mappings",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Repository/PathMapping.php#L493-L512 |
223,774 | puli/manager | src/Api/Php/Clazz.php | Clazz.setClassName | public function setClassName($className)
{
Assert::stringNotEmpty($className, 'The class name must be a non-empty string. Got: %s');
$pos = strrpos($className, '\\');
if (false === $pos) {
$this->namespaceName = '';
$this->shortClassName = $className;
} else... | php | public function setClassName($className)
{
Assert::stringNotEmpty($className, 'The class name must be a non-empty string. Got: %s');
$pos = strrpos($className, '\\');
if (false === $pos) {
$this->namespaceName = '';
$this->shortClassName = $className;
} else... | [
"public",
"function",
"setClassName",
"(",
"$",
"className",
")",
"{",
"Assert",
"::",
"stringNotEmpty",
"(",
"$",
"className",
",",
"'The class name must be a non-empty string. Got: %s'",
")",
";",
"$",
"pos",
"=",
"strrpos",
"(",
"$",
"className",
",",
"'\\\\'",... | Sets the fully-qualified name of the factory class.
@param string $className The fully-qualified class name.
@return static The current instance. | [
"Sets",
"the",
"fully",
"-",
"qualified",
"name",
"of",
"the",
"factory",
"class",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Php/Clazz.php#L95-L110 |
223,775 | puli/manager | src/Api/Php/Clazz.php | Clazz.setDirectory | public function setDirectory($directory)
{
Assert::stringNotEmpty($directory, 'The factory directory must be a non-empty string. Got: %s');
$this->directory = Path::canonicalize($directory);
return $this;
} | php | public function setDirectory($directory)
{
Assert::stringNotEmpty($directory, 'The factory directory must be a non-empty string. Got: %s');
$this->directory = Path::canonicalize($directory);
return $this;
} | [
"public",
"function",
"setDirectory",
"(",
"$",
"directory",
")",
"{",
"Assert",
"::",
"stringNotEmpty",
"(",
"$",
"directory",
",",
"'The factory directory must be a non-empty string. Got: %s'",
")",
";",
"$",
"this",
"->",
"directory",
"=",
"Path",
"::",
"canonica... | Sets the path to the directory holding the factory class file.
@param string $directory The absolute directory path.
@return static The current instance. | [
"Sets",
"the",
"path",
"to",
"the",
"directory",
"holding",
"the",
"factory",
"class",
"file",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Php/Clazz.php#L162-L169 |
223,776 | puli/manager | src/Api/Php/Clazz.php | Clazz.setFilePath | public function setFilePath($filePath)
{
Assert::stringNotEmpty($filePath, 'The factory file path must be a non-empty string. Got: %s');
$this->setDirectory(Path::getDirectory($filePath));
$this->setFileName(Path::getFilename($filePath));
return $this;
} | php | public function setFilePath($filePath)
{
Assert::stringNotEmpty($filePath, 'The factory file path must be a non-empty string. Got: %s');
$this->setDirectory(Path::getDirectory($filePath));
$this->setFileName(Path::getFilename($filePath));
return $this;
} | [
"public",
"function",
"setFilePath",
"(",
"$",
"filePath",
")",
"{",
"Assert",
"::",
"stringNotEmpty",
"(",
"$",
"filePath",
",",
"'The factory file path must be a non-empty string. Got: %s'",
")",
";",
"$",
"this",
"->",
"setDirectory",
"(",
"Path",
"::",
"getDirec... | Sets the absolute file path of the factory class file.
@param string $filePath The absolute file path.
@return static The current instance. | [
"Sets",
"the",
"absolute",
"file",
"path",
"of",
"the",
"factory",
"class",
"file",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Php/Clazz.php#L236-L244 |
223,777 | puli/manager | src/Api/Php/Clazz.php | Clazz.addImplementedInterface | public function addImplementedInterface($interfaceName)
{
Assert::stringNotEmpty($interfaceName, 'The interface name must be a non-empty string. Got: %s');
$this->implementedInterfaces[$interfaceName] = true;
return $this;
} | php | public function addImplementedInterface($interfaceName)
{
Assert::stringNotEmpty($interfaceName, 'The interface name must be a non-empty string. Got: %s');
$this->implementedInterfaces[$interfaceName] = true;
return $this;
} | [
"public",
"function",
"addImplementedInterface",
"(",
"$",
"interfaceName",
")",
"{",
"Assert",
"::",
"stringNotEmpty",
"(",
"$",
"interfaceName",
",",
"'The interface name must be a non-empty string. Got: %s'",
")",
";",
"$",
"this",
"->",
"implementedInterfaces",
"[",
... | Adds an implemented interface to the class definition.
If you don't pass a fully-qualified name, make sure to import the name
with {@link addImport()}.
@param string $interfaceName The name of the added interfaces.
@return static The current instance. | [
"Adds",
"an",
"implemented",
"interface",
"to",
"the",
"class",
"definition",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Php/Clazz.php#L372-L379 |
223,778 | puli/manager | src/Api/Php/Clazz.php | Clazz.addImport | public function addImport(Import $import)
{
if (isset($this->imports[$import->getClassName()])) {
return $this;
}
$symbol = $import->getAlias() ?: $import->getShortClassName();
if (isset($this->importedSymbols[$symbol])) {
throw new RuntimeException(sprintf(... | php | public function addImport(Import $import)
{
if (isset($this->imports[$import->getClassName()])) {
return $this;
}
$symbol = $import->getAlias() ?: $import->getShortClassName();
if (isset($this->importedSymbols[$symbol])) {
throw new RuntimeException(sprintf(... | [
"public",
"function",
"addImport",
"(",
"Import",
"$",
"import",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"imports",
"[",
"$",
"import",
"->",
"getClassName",
"(",
")",
"]",
")",
")",
"{",
"return",
"$",
"this",
";",
"}",
"$",
"symbol"... | Adds an import statement to the class file.
@param Import $import The imported fully-qualified class name.
@return static The current instance. | [
"Adds",
"an",
"import",
"statement",
"to",
"the",
"class",
"file",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Php/Clazz.php#L471-L492 |
223,779 | puli/manager | src/Api/Php/Clazz.php | Clazz.removeImport | public function removeImport($className)
{
if (isset($this->imports[$className])) {
$import = $this->imports[$className];
$symbol = $import->getAlias() ?: $import->getShortClassName();
unset($this->imports[$className]);
unset($this->importedSymbols[$symbol]);... | php | public function removeImport($className)
{
if (isset($this->imports[$className])) {
$import = $this->imports[$className];
$symbol = $import->getAlias() ?: $import->getShortClassName();
unset($this->imports[$className]);
unset($this->importedSymbols[$symbol]);... | [
"public",
"function",
"removeImport",
"(",
"$",
"className",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"imports",
"[",
"$",
"className",
"]",
")",
")",
"{",
"$",
"import",
"=",
"$",
"this",
"->",
"imports",
"[",
"$",
"className",
"]",
"... | Removes an import statement from the class file.
If the import statement is not found, this method does nothing.
@param string $className The removed imported class name.
@return static The current instance. | [
"Removes",
"an",
"import",
"statement",
"from",
"the",
"class",
"file",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Php/Clazz.php#L503-L514 |
223,780 | puli/manager | src/Api/Php/Clazz.php | Clazz.getMethod | public function getMethod($name)
{
if (!isset($this->methods[$name])) {
throw new OutOfBoundsException(sprintf(
'The method "%s" does not exist.',
$name
));
}
return $this->methods[$name];
} | php | public function getMethod($name)
{
if (!isset($this->methods[$name])) {
throw new OutOfBoundsException(sprintf(
'The method "%s" does not exist.',
$name
));
}
return $this->methods[$name];
} | [
"public",
"function",
"getMethod",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"methods",
"[",
"$",
"name",
"]",
")",
")",
"{",
"throw",
"new",
"OutOfBoundsException",
"(",
"sprintf",
"(",
"'The method \"%s\" does not exist... | Returns the method with the given name.
@param string $name The name of the method.
@return Method The method.
@throws OutOfBoundsException If the method with the given name does not
exist. | [
"Returns",
"the",
"method",
"with",
"the",
"given",
"name",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Php/Clazz.php#L548-L558 |
223,781 | puli/manager | src/Api/Php/Clazz.php | Clazz.addMethod | public function addMethod(Method $method)
{
if (isset($this->methods[$method->getName()])) {
throw new RuntimeException(sprintf(
'The method "%s" exists already.',
$method->getName()
));
}
$this->methods[$method->getName()] = $method;
... | php | public function addMethod(Method $method)
{
if (isset($this->methods[$method->getName()])) {
throw new RuntimeException(sprintf(
'The method "%s" exists already.',
$method->getName()
));
}
$this->methods[$method->getName()] = $method;
... | [
"public",
"function",
"addMethod",
"(",
"Method",
"$",
"method",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"methods",
"[",
"$",
"method",
"->",
"getName",
"(",
")",
"]",
")",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"sprintf",
"... | Adds a method to the class.
@param Method $method The method to add to the class.
@return static The current instance. | [
"Adds",
"a",
"method",
"to",
"the",
"class",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Php/Clazz.php#L627-L641 |
223,782 | QoboLtd/cakephp-calendar | src/Controller/CalendarEventsController.php | CalendarEventsController.add | public function add()
{
$this->request->allowMethod(['post', 'patch', 'put']);
$response = [
'success' => false,
'data' => [],
'errors' => [],
];
$calendarsTable = TableRegistry::get('Calendars');
$data = $this->request->getData();
... | php | public function add()
{
$this->request->allowMethod(['post', 'patch', 'put']);
$response = [
'success' => false,
'data' => [],
'errors' => [],
];
$calendarsTable = TableRegistry::get('Calendars');
$data = $this->request->getData();
... | [
"public",
"function",
"add",
"(",
")",
"{",
"$",
"this",
"->",
"request",
"->",
"allowMethod",
"(",
"[",
"'post'",
",",
"'patch'",
",",
"'put'",
"]",
")",
";",
"$",
"response",
"=",
"[",
"'success'",
"=>",
"false",
",",
"'data'",
"=>",
"[",
"]",
",... | Create Event via AJAX call
@return \Cake\Http\Response|void|null | [
"Create",
"Event",
"via",
"AJAX",
"call"
] | e0ea2c4dd4257a6af972707f206151d01bb4dfbb | https://github.com/QoboLtd/cakephp-calendar/blob/e0ea2c4dd4257a6af972707f206151d01bb4dfbb/src/Controller/CalendarEventsController.php#L58-L102 |
223,783 | QoboLtd/cakephp-calendar | src/Controller/CalendarEventsController.php | CalendarEventsController.view | public function view()
{
$response = [
'success' => false,
'data' => [],
'errors' => []
];
if ($this->request->is(['post', 'patch', 'put'])) {
$data = $this->request->getData();
$result = $this->CalendarEvents->getEventInfo($data['... | php | public function view()
{
$response = [
'success' => false,
'data' => [],
'errors' => []
];
if ($this->request->is(['post', 'patch', 'put'])) {
$data = $this->request->getData();
$result = $this->CalendarEvents->getEventInfo($data['... | [
"public",
"function",
"view",
"(",
")",
"{",
"$",
"response",
"=",
"[",
"'success'",
"=>",
"false",
",",
"'data'",
"=>",
"[",
"]",
",",
"'errors'",
"=>",
"[",
"]",
"]",
";",
"if",
"(",
"$",
"this",
"->",
"request",
"->",
"is",
"(",
"[",
"'post'",... | View Event via AJAX
@return \Cake\Http\Response|void|null | [
"View",
"Event",
"via",
"AJAX"
] | e0ea2c4dd4257a6af972707f206151d01bb4dfbb | https://github.com/QoboLtd/cakephp-calendar/blob/e0ea2c4dd4257a6af972707f206151d01bb4dfbb/src/Controller/CalendarEventsController.php#L109-L131 |
223,784 | QoboLtd/cakephp-calendar | src/Controller/CalendarEventsController.php | CalendarEventsController.getEventTypes | public function getEventTypes()
{
$this->request->allowMethod(['post', 'patch', 'put']);
$calendarsTable = TableRegistry::Get('Qobo/Calendar.Calendars');
$eventTypes = [];
$data = $this->request->getData();
$calendar = $calendarsTable->get($data['calendar_id']);
$ty... | php | public function getEventTypes()
{
$this->request->allowMethod(['post', 'patch', 'put']);
$calendarsTable = TableRegistry::Get('Qobo/Calendar.Calendars');
$eventTypes = [];
$data = $this->request->getData();
$calendar = $calendarsTable->get($data['calendar_id']);
$ty... | [
"public",
"function",
"getEventTypes",
"(",
")",
"{",
"$",
"this",
"->",
"request",
"->",
"allowMethod",
"(",
"[",
"'post'",
",",
"'patch'",
",",
"'put'",
"]",
")",
";",
"$",
"calendarsTable",
"=",
"TableRegistry",
"::",
"Get",
"(",
"'Qobo/Calendar.Calendars... | Get Event types based on the calendar id
@return \Cake\Http\Response|void|null | [
"Get",
"Event",
"types",
"based",
"on",
"the",
"calendar",
"id"
] | e0ea2c4dd4257a6af972707f206151d01bb4dfbb | https://github.com/QoboLtd/cakephp-calendar/blob/e0ea2c4dd4257a6af972707f206151d01bb4dfbb/src/Controller/CalendarEventsController.php#L138-L171 |
223,785 | QoboLtd/cakephp-calendar | src/Controller/CalendarEventsController.php | CalendarEventsController.eventTypeConfig | public function eventTypeConfig()
{
$this->request->allowMethod(['post', 'put', 'patch']);
$response = [
'success' => false,
'data' => [],
'errors' => [],
];
$data = $this->request->getData();
try {
$config = ObjectFactory::g... | php | public function eventTypeConfig()
{
$this->request->allowMethod(['post', 'put', 'patch']);
$response = [
'success' => false,
'data' => [],
'errors' => [],
];
$data = $this->request->getData();
try {
$config = ObjectFactory::g... | [
"public",
"function",
"eventTypeConfig",
"(",
")",
"{",
"$",
"this",
"->",
"request",
"->",
"allowMethod",
"(",
"[",
"'post'",
",",
"'put'",
",",
"'patch'",
"]",
")",
";",
"$",
"response",
"=",
"[",
"'success'",
"=>",
"false",
",",
"'data'",
"=>",
"[",... | Event Type Config getter method
Return event type configuration from ObjectFactory
@return \Cake\Http\Response|void|null | [
"Event",
"Type",
"Config",
"getter",
"method"
] | e0ea2c4dd4257a6af972707f206151d01bb4dfbb | https://github.com/QoboLtd/cakephp-calendar/blob/e0ea2c4dd4257a6af972707f206151d01bb4dfbb/src/Controller/CalendarEventsController.php#L202-L228 |
223,786 | ongr-io/FilterManagerBundle | Filter/ViewData/PagerAwareViewData.php | PagerAwareViewData.setData | public function setData($totalItems, $currentPage, $itemsPerPage = 12, $maxPages = 10)
{
$this->totalItems = $totalItems;
$this->currentPage = $currentPage;
$this->itemsPerPage = $itemsPerPage;
// if ($maxPages < 3) {
// throw new \InvalidArgumentException('Max pages has t... | php | public function setData($totalItems, $currentPage, $itemsPerPage = 12, $maxPages = 10)
{
$this->totalItems = $totalItems;
$this->currentPage = $currentPage;
$this->itemsPerPage = $itemsPerPage;
// if ($maxPages < 3) {
// throw new \InvalidArgumentException('Max pages has t... | [
"public",
"function",
"setData",
"(",
"$",
"totalItems",
",",
"$",
"currentPage",
",",
"$",
"itemsPerPage",
"=",
"12",
",",
"$",
"maxPages",
"=",
"10",
")",
"{",
"$",
"this",
"->",
"totalItems",
"=",
"$",
"totalItems",
";",
"$",
"this",
"->",
"currentP... | Initializes data for pagination.
@param $totalItems
@param $currentPage
@param int $itemsPerPage
@param int $maxPages | [
"Initializes",
"data",
"for",
"pagination",
"."
] | 26c1125457f0440019b9bf20090bf23ba4bb1905 | https://github.com/ongr-io/FilterManagerBundle/blob/26c1125457f0440019b9bf20090bf23ba4bb1905/Filter/ViewData/PagerAwareViewData.php#L57-L69 |
223,787 | puli/manager | src/Api/Asset/DuplicateAssetMappingException.php | DuplicateAssetMappingException.forUuid | public static function forUuid(Uuid $uuid, Exception $cause = null)
{
return new static(sprintf(
'The asset mapping "%s" exists already.',
$uuid->toString()
), 0, $cause);
} | php | public static function forUuid(Uuid $uuid, Exception $cause = null)
{
return new static(sprintf(
'The asset mapping "%s" exists already.',
$uuid->toString()
), 0, $cause);
} | [
"public",
"static",
"function",
"forUuid",
"(",
"Uuid",
"$",
"uuid",
",",
"Exception",
"$",
"cause",
"=",
"null",
")",
"{",
"return",
"new",
"static",
"(",
"sprintf",
"(",
"'The asset mapping \"%s\" exists already.'",
",",
"$",
"uuid",
"->",
"toString",
"(",
... | Creates an exception for a UUID that exists already.
@param Uuid $uuid The UUID of the mapping.
@param Exception|null $cause The exception that caused this exception.
@return static The created exception. | [
"Creates",
"an",
"exception",
"for",
"a",
"UUID",
"that",
"exists",
"already",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Asset/DuplicateAssetMappingException.php#L34-L40 |
223,788 | madeyourday/contao-rocksolid-columns | src/Element/ColumnsStart.php | ColumnsStart.getColumnsConfiguration | public static function getColumnsConfiguration(array $data)
{
$config = array();
$lastColumns = null;
foreach (array('large', 'medium', 'small') as $media) {
$columns = isset($data['rs_columns_' . $media])
? $data['rs_columns_' . $media]
: null;
if (!$columns) {
$columns = $lastColumns ?: '2'... | php | public static function getColumnsConfiguration(array $data)
{
$config = array();
$lastColumns = null;
foreach (array('large', 'medium', 'small') as $media) {
$columns = isset($data['rs_columns_' . $media])
? $data['rs_columns_' . $media]
: null;
if (!$columns) {
$columns = $lastColumns ?: '2'... | [
"public",
"static",
"function",
"getColumnsConfiguration",
"(",
"array",
"$",
"data",
")",
"{",
"$",
"config",
"=",
"array",
"(",
")",
";",
"$",
"lastColumns",
"=",
"null",
";",
"foreach",
"(",
"array",
"(",
"'large'",
",",
"'medium'",
",",
"'small'",
")... | Generate the columns configuration
@param array $data Data array
@return array Columns configuration | [
"Generate",
"the",
"columns",
"configuration"
] | 35ca1f9b17c19fd0b774ed3307a85b58fa4b2705 | https://github.com/madeyourday/contao-rocksolid-columns/blob/35ca1f9b17c19fd0b774ed3307a85b58fa4b2705/src/Element/ColumnsStart.php#L79-L116 |
223,789 | yosymfony/config-loader | src/ConfigFileLoader.php | ConfigFileLoader.parseImports | protected function parseImports(RepositoryInterface $repository, string $file) : RepositoryInterface
{
if (!isset($repository[self::IMPORT_KEY])) {
return $repository;
}
if (!is_array($repository[self::IMPORT_KEY])) {
$keyName = self::IMPORT_KEY;
$message... | php | protected function parseImports(RepositoryInterface $repository, string $file) : RepositoryInterface
{
if (!isset($repository[self::IMPORT_KEY])) {
return $repository;
}
if (!is_array($repository[self::IMPORT_KEY])) {
$keyName = self::IMPORT_KEY;
$message... | [
"protected",
"function",
"parseImports",
"(",
"RepositoryInterface",
"$",
"repository",
",",
"string",
"$",
"file",
")",
":",
"RepositoryInterface",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"repository",
"[",
"self",
"::",
"IMPORT_KEY",
"]",
")",
")",
"{",
... | Parses the repositories in "imports" key
@param Repository $repository
@param string $file
@return RepositoryInterface
@throws InvalidArgumentException If error with "imports" key | [
"Parses",
"the",
"repositories",
"in",
"imports",
"key"
] | 47c97f5014e2d1134f8655a1f14fd3504c997cf2 | https://github.com/yosymfony/config-loader/blob/47c97f5014e2d1134f8655a1f14fd3504c997cf2/src/ConfigFileLoader.php#L123-L152 |
223,790 | yosymfony/config-loader | src/ConfigFileLoader.php | ConfigFileLoader.readFile | protected function readFile(string $file) : string
{
if (is_file($file) === false) {
throw new BadFileException("The file \"{$file}\" is not a file.", $file);
}
if (is_readable($file) === false) {
throw new BadFileException("Unable to open \"{$file}\" as the file is ... | php | protected function readFile(string $file) : string
{
if (is_file($file) === false) {
throw new BadFileException("The file \"{$file}\" is not a file.", $file);
}
if (is_readable($file) === false) {
throw new BadFileException("Unable to open \"{$file}\" as the file is ... | [
"protected",
"function",
"readFile",
"(",
"string",
"$",
"file",
")",
":",
"string",
"{",
"if",
"(",
"is_file",
"(",
"$",
"file",
")",
"===",
"false",
")",
"{",
"throw",
"new",
"BadFileException",
"(",
"\"The file \\\"{$file}\\\" is not a file.\"",
",",
"$",
... | Reads a file
@param string $file The name of the file
@return string The file's content
@throws BadFileException If the file is not a file or it is not readable | [
"Reads",
"a",
"file"
] | 47c97f5014e2d1134f8655a1f14fd3504c997cf2 | https://github.com/yosymfony/config-loader/blob/47c97f5014e2d1134f8655a1f14fd3504c997cf2/src/ConfigFileLoader.php#L177-L188 |
223,791 | simplesamlphp/simplesamlphp-module-openidprovider | lib/Utils.php | sspmod_openidProvider_Utils.maskErrors | public static function maskErrors($mask)
{
if (!is_int($mask)) {
throw new \InvalidArgumentException('Invalid input parameters.');
}
$currentEnabled = error_reporting();
self::$logLevelStack[] = array($currentEnabled, self::$logMask);
$currentEnabled &= ~$mask;
... | php | public static function maskErrors($mask)
{
if (!is_int($mask)) {
throw new \InvalidArgumentException('Invalid input parameters.');
}
$currentEnabled = error_reporting();
self::$logLevelStack[] = array($currentEnabled, self::$logMask);
$currentEnabled &= ~$mask;
... | [
"public",
"static",
"function",
"maskErrors",
"(",
"$",
"mask",
")",
"{",
"if",
"(",
"!",
"is_int",
"(",
"$",
"mask",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'Invalid input parameters.'",
")",
";",
"}",
"$",
"currentEnabled",
... | Disable reporting of the given log levels.
Every call to this function must be followed by a call to popErrorMask();
@param int $mask The log levels that should be masked.
@throws \InvalidArgumentException If $mask is not an integer.
@author Olav Morken, UNINETT AS <olav.morken@uninett.no> | [
"Disable",
"reporting",
"of",
"the",
"given",
"log",
"levels",
"."
] | 1b2c50660712fd87946d43e73032e1b1830ebf61 | https://github.com/simplesamlphp/simplesamlphp-module-openidprovider/blob/1b2c50660712fd87946d43e73032e1b1830ebf61/lib/Utils.php#L43-L55 |
223,792 | simplesamlphp/simplesamlphp-module-openidprovider | lib/Utils.php | sspmod_openidProvider_Utils.popErrorMask | public static function popErrorMask()
{
$lastMask = array_pop(self::$logLevelStack);
error_reporting($lastMask[0]);
self::$logMask = $lastMask[1];
} | php | public static function popErrorMask()
{
$lastMask = array_pop(self::$logLevelStack);
error_reporting($lastMask[0]);
self::$logMask = $lastMask[1];
} | [
"public",
"static",
"function",
"popErrorMask",
"(",
")",
"{",
"$",
"lastMask",
"=",
"array_pop",
"(",
"self",
"::",
"$",
"logLevelStack",
")",
";",
"error_reporting",
"(",
"$",
"lastMask",
"[",
"0",
"]",
")",
";",
"self",
"::",
"$",
"logMask",
"=",
"$... | Pop an error mask.
This function restores the previous error mask.
@author Olav Morken, UNINETT AS <olav.morken@uninett.no> | [
"Pop",
"an",
"error",
"mask",
"."
] | 1b2c50660712fd87946d43e73032e1b1830ebf61 | https://github.com/simplesamlphp/simplesamlphp-module-openidprovider/blob/1b2c50660712fd87946d43e73032e1b1830ebf61/lib/Utils.php#L65-L70 |
223,793 | QoboLtd/cakephp-calendar | src/Model/Table/CalendarAttendeesTable.php | CalendarAttendeesTable.saveAttendee | public function saveAttendee(array $entity): array
{
$response = [
'status' => false,
'errors' => [],
'entity' => null,
];
if (empty($entity['id'])) {
unset($entity['id']);
}
$query = $this->find()
->where([
... | php | public function saveAttendee(array $entity): array
{
$response = [
'status' => false,
'errors' => [],
'entity' => null,
];
if (empty($entity['id'])) {
unset($entity['id']);
}
$query = $this->find()
->where([
... | [
"public",
"function",
"saveAttendee",
"(",
"array",
"$",
"entity",
")",
":",
"array",
"{",
"$",
"response",
"=",
"[",
"'status'",
"=>",
"false",
",",
"'errors'",
"=>",
"[",
"]",
",",
"'entity'",
"=>",
"null",
",",
"]",
";",
"if",
"(",
"empty",
"(",
... | Save Calendar Attendees
@param mixed[] $entity of the attendee
@return mixed[] $response containing save state and saved record | [
"Save",
"Calendar",
"Attendees"
] | e0ea2c4dd4257a6af972707f206151d01bb4dfbb | https://github.com/QoboLtd/cakephp-calendar/blob/e0ea2c4dd4257a6af972707f206151d01bb4dfbb/src/Model/Table/CalendarAttendeesTable.php#L104-L146 |
223,794 | apoutchika/MediaBundle | Filesystem/FilesystemManipulator.php | FilesystemManipulator.saveContent | public function saveContent($key, $content)
{
$this->master->getFilesystem()->write($key, $content, true);
foreach ($this->slaves as $slave) {
$slave->getFilesystem()->write($key, $content, true);
}
} | php | public function saveContent($key, $content)
{
$this->master->getFilesystem()->write($key, $content, true);
foreach ($this->slaves as $slave) {
$slave->getFilesystem()->write($key, $content, true);
}
} | [
"public",
"function",
"saveContent",
"(",
"$",
"key",
",",
"$",
"content",
")",
"{",
"$",
"this",
"->",
"master",
"->",
"getFilesystem",
"(",
")",
"->",
"write",
"(",
"$",
"key",
",",
"$",
"content",
",",
"true",
")",
";",
"foreach",
"(",
"$",
"thi... | Save file from string, in master and slaves.
@param string $key Path of file
@param string content of file | [
"Save",
"file",
"from",
"string",
"in",
"master",
"and",
"slaves",
"."
] | dd52efed4a4463041da73af2cb25bdbe00365fcc | https://github.com/apoutchika/MediaBundle/blob/dd52efed4a4463041da73af2cb25bdbe00365fcc/Filesystem/FilesystemManipulator.php#L116-L123 |
223,795 | apoutchika/MediaBundle | Filesystem/FilesystemManipulator.php | FilesystemManipulator.delete | public function delete($key)
{
$this->master->getFilesystem()->delete($key);
foreach ($this->slaves as $slave) {
$slave->getFilesystem()->delete($key);
}
} | php | public function delete($key)
{
$this->master->getFilesystem()->delete($key);
foreach ($this->slaves as $slave) {
$slave->getFilesystem()->delete($key);
}
} | [
"public",
"function",
"delete",
"(",
"$",
"key",
")",
"{",
"$",
"this",
"->",
"master",
"->",
"getFilesystem",
"(",
")",
"->",
"delete",
"(",
"$",
"key",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"slaves",
"as",
"$",
"slave",
")",
"{",
"$",
"s... | delete file in master and slaves.
@param string $key Path of file | [
"delete",
"file",
"in",
"master",
"and",
"slaves",
"."
] | dd52efed4a4463041da73af2cb25bdbe00365fcc | https://github.com/apoutchika/MediaBundle/blob/dd52efed4a4463041da73af2cb25bdbe00365fcc/Filesystem/FilesystemManipulator.php#L142-L149 |
223,796 | apoutchika/MediaBundle | Factory/AliasManipulatorFactory.php | AliasManipulatorFactory.setAlias | public function setAlias($alias)
{
$aliasManipulator = new AliasManipulator($this->originalDir, $this->alias);
$aliasManipulator->setAlias($alias);
return $aliasManipulator;
} | php | public function setAlias($alias)
{
$aliasManipulator = new AliasManipulator($this->originalDir, $this->alias);
$aliasManipulator->setAlias($alias);
return $aliasManipulator;
} | [
"public",
"function",
"setAlias",
"(",
"$",
"alias",
")",
"{",
"$",
"aliasManipulator",
"=",
"new",
"AliasManipulator",
"(",
"$",
"this",
"->",
"originalDir",
",",
"$",
"this",
"->",
"alias",
")",
";",
"$",
"aliasManipulator",
"->",
"setAlias",
"(",
"$",
... | Set alias, and return AliasManipulator.
@param array|string|null $alias
@return AliasManipulator | [
"Set",
"alias",
"and",
"return",
"AliasManipulator",
"."
] | dd52efed4a4463041da73af2cb25bdbe00365fcc | https://github.com/apoutchika/MediaBundle/blob/dd52efed4a4463041da73af2cb25bdbe00365fcc/Factory/AliasManipulatorFactory.php#L54-L60 |
223,797 | OXID-eSales/oxid-eshop-ide-helper | src/Core/ModuleMetadataParser.php | ModuleMetadataParser.getChainExtendedClasses | public function getChainExtendedClasses()
{
$chainExtendMap = [];
$paths = $this->scanner->getFilePaths();
foreach ($paths as $path) {
$aModule = [];
include($path);
if (isset($aModule['extend'])) {
$chainExtendMap = array_merge($chainExte... | php | public function getChainExtendedClasses()
{
$chainExtendMap = [];
$paths = $this->scanner->getFilePaths();
foreach ($paths as $path) {
$aModule = [];
include($path);
if (isset($aModule['extend'])) {
$chainExtendMap = array_merge($chainExte... | [
"public",
"function",
"getChainExtendedClasses",
"(",
")",
"{",
"$",
"chainExtendMap",
"=",
"[",
"]",
";",
"$",
"paths",
"=",
"$",
"this",
"->",
"scanner",
"->",
"getFilePaths",
"(",
")",
";",
"foreach",
"(",
"$",
"paths",
"as",
"$",
"path",
")",
"{",
... | Get all module chain extensions.
Key is module class, value is shop class.
@return array | [
"Get",
"all",
"module",
"chain",
"extensions",
".",
"Key",
"is",
"module",
"class",
"value",
"is",
"shop",
"class",
"."
] | e29836a482e7e2386ebb1cefd01e31240e2b3847 | https://github.com/OXID-eSales/oxid-eshop-ide-helper/blob/e29836a482e7e2386ebb1cefd01e31240e2b3847/src/Core/ModuleMetadataParser.php#L35-L48 |
223,798 | middlewares/negotiation | src/ContentType.php | ContentType.detectCharset | private function detectCharset(ServerRequestInterface $request)
{
$accept = $request->getHeaderLine('Accept-Charset');
return $this->negotiateHeader($accept, new CharsetNegotiator(), $this->charsets);
} | php | private function detectCharset(ServerRequestInterface $request)
{
$accept = $request->getHeaderLine('Accept-Charset');
return $this->negotiateHeader($accept, new CharsetNegotiator(), $this->charsets);
} | [
"private",
"function",
"detectCharset",
"(",
"ServerRequestInterface",
"$",
"request",
")",
"{",
"$",
"accept",
"=",
"$",
"request",
"->",
"getHeaderLine",
"(",
"'Accept-Charset'",
")",
";",
"return",
"$",
"this",
"->",
"negotiateHeader",
"(",
"$",
"accept",
"... | Returns the charset accepted.
@return null|string | [
"Returns",
"the",
"charset",
"accepted",
"."
] | 107d31132cd5af446be97827bfd0202f15189a34 | https://github.com/middlewares/negotiation/blob/107d31132cd5af446be97827bfd0202f15189a34/src/ContentType.php#L175-L180 |
223,799 | apoutchika/MediaBundle | Services/Image/BaseImage.php | BaseImage.apply | public function apply($aliasName = null)
{
$reset = false;
if ($aliasName === null) {
$aliasName = $this->mediaManager->getOriginalDir();
$reset = true;
}
$this->updateFile($this->image);
$this->updateFocus($this->media);
$fs = $this
... | php | public function apply($aliasName = null)
{
$reset = false;
if ($aliasName === null) {
$aliasName = $this->mediaManager->getOriginalDir();
$reset = true;
}
$this->updateFile($this->image);
$this->updateFocus($this->media);
$fs = $this
... | [
"public",
"function",
"apply",
"(",
"$",
"aliasName",
"=",
"null",
")",
"{",
"$",
"reset",
"=",
"false",
";",
"if",
"(",
"$",
"aliasName",
"===",
"null",
")",
"{",
"$",
"aliasName",
"=",
"$",
"this",
"->",
"mediaManager",
"->",
"getOriginalDir",
"(",
... | Apply the filter.
@param string $aliasName | [
"Apply",
"the",
"filter",
"."
] | dd52efed4a4463041da73af2cb25bdbe00365fcc | https://github.com/apoutchika/MediaBundle/blob/dd52efed4a4463041da73af2cb25bdbe00365fcc/Services/Image/BaseImage.php#L56-L83 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.