id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
237,500 | bugotech/io | src/Filesystem.php | Filesystem.saveConfig | public function saveConfig($group, $environment = '')
{
// Path do arquivo
$path = config_path();
// Itens
$items = config($group, []);
// Nome do arquivo
$file = (! $environment || ($environment == 'production'))
? "{$path}/{$group}.php"
: "... | php | public function saveConfig($group, $environment = '')
{
// Path do arquivo
$path = config_path();
// Itens
$items = config($group, []);
// Nome do arquivo
$file = (! $environment || ($environment == 'production'))
? "{$path}/{$group}.php"
: "... | [
"public",
"function",
"saveConfig",
"(",
"$",
"group",
",",
"$",
"environment",
"=",
"''",
")",
"{",
"// Path do arquivo",
"$",
"path",
"=",
"config_path",
"(",
")",
";",
"// Itens",
"$",
"items",
"=",
"config",
"(",
"$",
"group",
",",
"[",
"]",
")",
... | Salvar arquivo Config.
@param $group
@param string $environment | [
"Salvar",
"arquivo",
"Config",
"."
] | 3c7601af1839d1cdfa2ba5c43bf33d6d79117ae0 | https://github.com/bugotech/io/blob/3c7601af1839d1cdfa2ba5c43bf33d6d79117ae0/src/Filesystem.php#L176-L193 |
237,501 | indigophp-archive/codeception-fuel-module | fuel/fuel/packages/orm/classes/relation.php | Relation.select | public function select($table)
{
$props = call_user_func(array($this->model_to, 'properties'));
$i = 0;
$properties = array();
foreach ($props as $pk => $pv)
{
$properties[] = array($table.'.'.$pk, $table.'_c'.$i);
$i++;
}
return $properties;
} | php | public function select($table)
{
$props = call_user_func(array($this->model_to, 'properties'));
$i = 0;
$properties = array();
foreach ($props as $pk => $pv)
{
$properties[] = array($table.'.'.$pk, $table.'_c'.$i);
$i++;
}
return $properties;
} | [
"public",
"function",
"select",
"(",
"$",
"table",
")",
"{",
"$",
"props",
"=",
"call_user_func",
"(",
"array",
"(",
"$",
"this",
"->",
"model_to",
",",
"'properties'",
")",
")",
";",
"$",
"i",
"=",
"0",
";",
"$",
"properties",
"=",
"array",
"(",
"... | Should get the properties as associative array with alias => property, the table alias is
given to be included with the property
@param string
@return array | [
"Should",
"get",
"the",
"properties",
"as",
"associative",
"array",
"with",
"alias",
"=",
">",
"property",
"the",
"table",
"alias",
"is",
"given",
"to",
"be",
"included",
"with",
"the",
"property"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/packages/orm/classes/relation.php#L88-L100 |
237,502 | asbsoft/yii2-common_2_170212 | helpers/BaseConfigsBuilder.php | BaseConfigsBuilder.includeConfigFile | public static function includeConfigFile($filename, $application = null)
{
if (empty($application)) {
$application = Yii::$app;
}
$appKey = UniApplication::appKey($application);
if (!isset(self::$_configFiles[$appKey][$filename])) {
if (is_file($filename)) {
... | php | public static function includeConfigFile($filename, $application = null)
{
if (empty($application)) {
$application = Yii::$app;
}
$appKey = UniApplication::appKey($application);
if (!isset(self::$_configFiles[$appKey][$filename])) {
if (is_file($filename)) {
... | [
"public",
"static",
"function",
"includeConfigFile",
"(",
"$",
"filename",
",",
"$",
"application",
"=",
"null",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"application",
")",
")",
"{",
"$",
"application",
"=",
"Yii",
"::",
"$",
"app",
";",
"}",
"$",
"a... | Get, save in cache and return result of include file
@param string $filename
@param Application $application
Note if config has some calculations caching may be not correct. | [
"Get",
"save",
"in",
"cache",
"and",
"return",
"result",
"of",
"include",
"file"
] | 6c58012ff89225d7d4e42b200cf39e009e9d9dac | https://github.com/asbsoft/yii2-common_2_170212/blob/6c58012ff89225d7d4e42b200cf39e009e9d9dac/helpers/BaseConfigsBuilder.php#L31-L45 |
237,503 | asbsoft/yii2-common_2_170212 | helpers/BaseConfigsBuilder.php | BaseConfigsBuilder.cleanConfigFileCache | public static function cleanConfigFileCache($application = null)
{
if (empty($application)) {
$application = Yii::$app;
}
$appKey = UniApplication::appKey($application);
static::$_configFiles[$appKey] = [];
} | php | public static function cleanConfigFileCache($application = null)
{
if (empty($application)) {
$application = Yii::$app;
}
$appKey = UniApplication::appKey($application);
static::$_configFiles[$appKey] = [];
} | [
"public",
"static",
"function",
"cleanConfigFileCache",
"(",
"$",
"application",
"=",
"null",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"application",
")",
")",
"{",
"$",
"application",
"=",
"Yii",
"::",
"$",
"app",
";",
"}",
"$",
"appKey",
"=",
"UniAppl... | Clean included files cache | [
"Clean",
"included",
"files",
"cache"
] | 6c58012ff89225d7d4e42b200cf39e009e9d9dac | https://github.com/asbsoft/yii2-common_2_170212/blob/6c58012ff89225d7d4e42b200cf39e009e9d9dac/helpers/BaseConfigsBuilder.php#L47-L54 |
237,504 | a15lam/workspace | src/Utility/Logger.php | Logger.write | protected function write($level, $msg)
{
$time = date('Y-m-d H:i:s', time());
$msg = "[" . $time . "][" . static::getLevelName($level) . "] " . $msg . PHP_EOL;
if($this->debugOutput === true){
echo $msg;
}
if (static::$silent) {
return false;
... | php | protected function write($level, $msg)
{
$time = date('Y-m-d H:i:s', time());
$msg = "[" . $time . "][" . static::getLevelName($level) . "] " . $msg . PHP_EOL;
if($this->debugOutput === true){
echo $msg;
}
if (static::$silent) {
return false;
... | [
"protected",
"function",
"write",
"(",
"$",
"level",
",",
"$",
"msg",
")",
"{",
"$",
"time",
"=",
"date",
"(",
"'Y-m-d H:i:s'",
",",
"time",
"(",
")",
")",
";",
"$",
"msg",
"=",
"\"[\"",
".",
"$",
"time",
".",
"\"][\"",
".",
"static",
"::",
"getL... | Writes to log file.
@param int $level
@param string $msg
@return bool
@throws \Exception | [
"Writes",
"to",
"log",
"file",
"."
] | a17508b47b2db11a6e203a3cbd43b886a85e25aa | https://github.com/a15lam/workspace/blob/a17508b47b2db11a6e203a3cbd43b886a85e25aa/src/Utility/Logger.php#L65-L85 |
237,505 | a15lam/workspace | src/Utility/Logger.php | Logger.getLevelName | protected static function getLevelName($value)
{
$map = array_flip((new \ReflectionClass(self::class))->getConstants());
return (array_key_exists($value, $map) ? $map[$value] : null);
} | php | protected static function getLevelName($value)
{
$map = array_flip((new \ReflectionClass(self::class))->getConstants());
return (array_key_exists($value, $map) ? $map[$value] : null);
} | [
"protected",
"static",
"function",
"getLevelName",
"(",
"$",
"value",
")",
"{",
"$",
"map",
"=",
"array_flip",
"(",
"(",
"new",
"\\",
"ReflectionClass",
"(",
"self",
"::",
"class",
")",
")",
"->",
"getConstants",
"(",
")",
")",
";",
"return",
"(",
"arr... | Gets the log level name by value
@param int $value
@return null|string | [
"Gets",
"the",
"log",
"level",
"name",
"by",
"value"
] | a17508b47b2db11a6e203a3cbd43b886a85e25aa | https://github.com/a15lam/workspace/blob/a17508b47b2db11a6e203a3cbd43b886a85e25aa/src/Utility/Logger.php#L110-L115 |
237,506 | a15lam/workspace | src/Utility/Logger.php | Logger.getLevelValue | public static function getLevelValue($name)
{
$name = strtoupper($name);
$map = (new \ReflectionClass(self::class))->getConstants();
return (isset($map[$name]))? $map[$name] : null;
} | php | public static function getLevelValue($name)
{
$name = strtoupper($name);
$map = (new \ReflectionClass(self::class))->getConstants();
return (isset($map[$name]))? $map[$name] : null;
} | [
"public",
"static",
"function",
"getLevelValue",
"(",
"$",
"name",
")",
"{",
"$",
"name",
"=",
"strtoupper",
"(",
"$",
"name",
")",
";",
"$",
"map",
"=",
"(",
"new",
"\\",
"ReflectionClass",
"(",
"self",
"::",
"class",
")",
")",
"->",
"getConstants",
... | Gets the log level value by name
@param $name
@return null | [
"Gets",
"the",
"log",
"level",
"value",
"by",
"name"
] | a17508b47b2db11a6e203a3cbd43b886a85e25aa | https://github.com/a15lam/workspace/blob/a17508b47b2db11a6e203a3cbd43b886a85e25aa/src/Utility/Logger.php#L124-L130 |
237,507 | Attibee/Bumble-Validation | src/BaseValidator.php | BaseValidator.error | protected function error( $messageKey, $value = null ) {
//was a global message set? let's use the global key then
if( key_exists( self::GLOBAL_MESSAGE_KEY, $this->templates ) )
$messageKey = self::GLOBAL_MESSAGE_KEY;
//invalide message key
if( !key_exists( $me... | php | protected function error( $messageKey, $value = null ) {
//was a global message set? let's use the global key then
if( key_exists( self::GLOBAL_MESSAGE_KEY, $this->templates ) )
$messageKey = self::GLOBAL_MESSAGE_KEY;
//invalide message key
if( !key_exists( $me... | [
"protected",
"function",
"error",
"(",
"$",
"messageKey",
",",
"$",
"value",
"=",
"null",
")",
"{",
"//was a global message set? let's use the global key then\r",
"if",
"(",
"key_exists",
"(",
"self",
"::",
"GLOBAL_MESSAGE_KEY",
",",
"$",
"this",
"->",
"templates",
... | Adds an error message to the list of errors.
@param $messageKey The key of the message template.
@param $value The value that is being validated.
@throws Exception\MessageTemplateDoesNotExist The message template does not exist. | [
"Adds",
"an",
"error",
"message",
"to",
"the",
"list",
"of",
"errors",
"."
] | 4623b4a9b8592e3f36e615391fd7ec9ab2344a03 | https://github.com/Attibee/Bumble-Validation/blob/4623b4a9b8592e3f36e615391fd7ec9ab2344a03/src/BaseValidator.php#L105-L115 |
237,508 | Attibee/Bumble-Validation | src/BaseValidator.php | BaseValidator.updateMessageTemplate | private function updateMessageTemplate( $template, $key ) {
//invalide message key
if( !key_exists( $messageKey, $this->templates ) && $key != self::DEFAULT_KEY )
throw new Exception\MessageTemplateDoesNotExist( "A message template does not exist for key $messageKey" );
$th... | php | private function updateMessageTemplate( $template, $key ) {
//invalide message key
if( !key_exists( $messageKey, $this->templates ) && $key != self::DEFAULT_KEY )
throw new Exception\MessageTemplateDoesNotExist( "A message template does not exist for key $messageKey" );
$th... | [
"private",
"function",
"updateMessageTemplate",
"(",
"$",
"template",
",",
"$",
"key",
")",
"{",
"//invalide message key\r",
"if",
"(",
"!",
"key_exists",
"(",
"$",
"messageKey",
",",
"$",
"this",
"->",
"templates",
")",
"&&",
"$",
"key",
"!=",
"self",
"::... | Updates the message template. This overrides existing message templates.
@param $template The message template.
@param $key The message key. | [
"Updates",
"the",
"message",
"template",
".",
"This",
"overrides",
"existing",
"message",
"templates",
"."
] | 4623b4a9b8592e3f36e615391fd7ec9ab2344a03 | https://github.com/Attibee/Bumble-Validation/blob/4623b4a9b8592e3f36e615391fd7ec9ab2344a03/src/BaseValidator.php#L122-L128 |
237,509 | benkle-libs/feed-parser | src/Standards/Atom/Rules/SimpleAtomFieldRule.php | SimpleAtomFieldRule.getNodeContent | private function getNodeContent(\DOMNode $node)
{
$type = $node->attributes->getNamedItem('type');
if ($type && strtolower($type->nodeValue) == 'xhtml') {
$result = '';
foreach ($node->childNodes as $childNode) {
$result .= $node->ownerDocument->save($childNod... | php | private function getNodeContent(\DOMNode $node)
{
$type = $node->attributes->getNamedItem('type');
if ($type && strtolower($type->nodeValue) == 'xhtml') {
$result = '';
foreach ($node->childNodes as $childNode) {
$result .= $node->ownerDocument->save($childNod... | [
"private",
"function",
"getNodeContent",
"(",
"\\",
"DOMNode",
"$",
"node",
")",
"{",
"$",
"type",
"=",
"$",
"node",
"->",
"attributes",
"->",
"getNamedItem",
"(",
"'type'",
")",
";",
"if",
"(",
"$",
"type",
"&&",
"strtolower",
"(",
"$",
"type",
"->",
... | Enable XHTML types.
@param \DOMNode $node
@return string
@codeCoverageIgnore | [
"Enable",
"XHTML",
"types",
"."
] | 8b86daf9dfe57e6e7ccae83dbc65ac7ce462144f | https://github.com/benkle-libs/feed-parser/blob/8b86daf9dfe57e6e7ccae83dbc65ac7ce462144f/src/Standards/Atom/Rules/SimpleAtomFieldRule.php#L85-L97 |
237,510 | unforge/array-toolkit | src/Arr.php | Arr.getInt | public static function getInt(array $array, $key, int $default = 0) : int
{
$key = (string) $key;
if ($array[$key] ?? 0) {
return (int) $array[$key];
}
return $default;
} | php | public static function getInt(array $array, $key, int $default = 0) : int
{
$key = (string) $key;
if ($array[$key] ?? 0) {
return (int) $array[$key];
}
return $default;
} | [
"public",
"static",
"function",
"getInt",
"(",
"array",
"$",
"array",
",",
"$",
"key",
",",
"int",
"$",
"default",
"=",
"0",
")",
":",
"int",
"{",
"$",
"key",
"=",
"(",
"string",
")",
"$",
"key",
";",
"if",
"(",
"$",
"array",
"[",
"$",
"key",
... | Return INT value from array
@param array $array
@param string|int $key
@param int $default
@return int | [
"Return",
"INT",
"value",
"from",
"array"
] | 734992061dca91e593b33bee5f4b48112749dc60 | https://github.com/unforge/array-toolkit/blob/734992061dca91e593b33bee5f4b48112749dc60/src/Arr.php#L55-L64 |
237,511 | unforge/array-toolkit | src/Arr.php | Arr.getFloat | public static function getFloat(array $array, $key, float $default = 0.0) : float
{
$key = (string) $key;
if ($array[$key] ?? 0) {
return (float) $array[$key];
}
return $default;
} | php | public static function getFloat(array $array, $key, float $default = 0.0) : float
{
$key = (string) $key;
if ($array[$key] ?? 0) {
return (float) $array[$key];
}
return $default;
} | [
"public",
"static",
"function",
"getFloat",
"(",
"array",
"$",
"array",
",",
"$",
"key",
",",
"float",
"$",
"default",
"=",
"0.0",
")",
":",
"float",
"{",
"$",
"key",
"=",
"(",
"string",
")",
"$",
"key",
";",
"if",
"(",
"$",
"array",
"[",
"$",
... | Return FLOAT value from array
@param array $array
@param string|int $key
@param float $default
@return float | [
"Return",
"FLOAT",
"value",
"from",
"array"
] | 734992061dca91e593b33bee5f4b48112749dc60 | https://github.com/unforge/array-toolkit/blob/734992061dca91e593b33bee5f4b48112749dc60/src/Arr.php#L75-L84 |
237,512 | unforge/array-toolkit | src/Arr.php | Arr.getString | public static function getString(array $array, $key, string $default = '') : string
{
$key = (string) $key;
if ($array[$key] ?? 0) {
return (string) $array[$key];
}
return $default;
} | php | public static function getString(array $array, $key, string $default = '') : string
{
$key = (string) $key;
if ($array[$key] ?? 0) {
return (string) $array[$key];
}
return $default;
} | [
"public",
"static",
"function",
"getString",
"(",
"array",
"$",
"array",
",",
"$",
"key",
",",
"string",
"$",
"default",
"=",
"''",
")",
":",
"string",
"{",
"$",
"key",
"=",
"(",
"string",
")",
"$",
"key",
";",
"if",
"(",
"$",
"array",
"[",
"$",
... | Return STRING value from array
@param array $array
@param string|int $key
@param string $default
@return string | [
"Return",
"STRING",
"value",
"from",
"array"
] | 734992061dca91e593b33bee5f4b48112749dc60 | https://github.com/unforge/array-toolkit/blob/734992061dca91e593b33bee5f4b48112749dc60/src/Arr.php#L95-L104 |
237,513 | unforge/array-toolkit | src/Arr.php | Arr.getBool | public static function getBool(array $array, $key, bool $default = false) : bool
{
$key = (string) $key;
if ($array[$key] ?? 0) {
return (bool) $array[$key];
}
return $default;
} | php | public static function getBool(array $array, $key, bool $default = false) : bool
{
$key = (string) $key;
if ($array[$key] ?? 0) {
return (bool) $array[$key];
}
return $default;
} | [
"public",
"static",
"function",
"getBool",
"(",
"array",
"$",
"array",
",",
"$",
"key",
",",
"bool",
"$",
"default",
"=",
"false",
")",
":",
"bool",
"{",
"$",
"key",
"=",
"(",
"string",
")",
"$",
"key",
";",
"if",
"(",
"$",
"array",
"[",
"$",
"... | Return BOOL value from array
@param array $array
@param string|int $key
@param bool $default
@return bool | [
"Return",
"BOOL",
"value",
"from",
"array"
] | 734992061dca91e593b33bee5f4b48112749dc60 | https://github.com/unforge/array-toolkit/blob/734992061dca91e593b33bee5f4b48112749dc60/src/Arr.php#L115-L124 |
237,514 | headzoo/core | src/Headzoo/Core/FunctionsTrait.php | FunctionsTrait.swapArgs | protected static function swapArgs(&$optional, &$swap, $default = null, $swap_required = true)
{
$is_swapped = false;
if (empty($swap) && !empty($optional)) {
$swap = $optional;
$optional = $default;
$is_swapped = true;
}
if ($swap_required... | php | protected static function swapArgs(&$optional, &$swap, $default = null, $swap_required = true)
{
$is_swapped = false;
if (empty($swap) && !empty($optional)) {
$swap = $optional;
$optional = $default;
$is_swapped = true;
}
if ($swap_required... | [
"protected",
"static",
"function",
"swapArgs",
"(",
"&",
"$",
"optional",
",",
"&",
"$",
"swap",
",",
"$",
"default",
"=",
"null",
",",
"$",
"swap_required",
"=",
"true",
")",
"{",
"$",
"is_swapped",
"=",
"false",
";",
"if",
"(",
"empty",
"(",
"$",
... | Swaps two values when the second is empty and the first is not
Returns true when the arguments were swapped, and false if not.
Example:
```php
$env = "live";
$values = null;
public function fetch($env, $values = null)
{
$is_swapped = $this->swapArgs($env, $values, "dev");
var_dump($is_swapped);
var_dump($env);
var... | [
"Swaps",
"two",
"values",
"when",
"the",
"second",
"is",
"empty",
"and",
"the",
"first",
"is",
"not"
] | 1e574813e197aa827b3e952f8caa81be31a8b5b5 | https://github.com/headzoo/core/blob/1e574813e197aa827b3e952f8caa81be31a8b5b5/src/Headzoo/Core/FunctionsTrait.php#L57-L75 |
237,515 | headzoo/core | src/Headzoo/Core/FunctionsTrait.php | FunctionsTrait.swapCallable | protected static function swapCallable(&$optional, &$callable, $default = null, $callable_required = true)
{
$is_swapped = false;
if (is_callable($optional)) {
$callable = $optional;
$optional = $default;
$is_swapped = true;
}
if ($callable_requir... | php | protected static function swapCallable(&$optional, &$callable, $default = null, $callable_required = true)
{
$is_swapped = false;
if (is_callable($optional)) {
$callable = $optional;
$optional = $default;
$is_swapped = true;
}
if ($callable_requir... | [
"protected",
"static",
"function",
"swapCallable",
"(",
"&",
"$",
"optional",
",",
"&",
"$",
"callable",
",",
"$",
"default",
"=",
"null",
",",
"$",
"callable_required",
"=",
"true",
")",
"{",
"$",
"is_swapped",
"=",
"false",
";",
"if",
"(",
"is_callable... | Swaps two variables when the second is a callable object
Used to create functions/methods which have callbacks as the final argument, and
it's desirable to make middle argument optional, while the callback remains the
final argument.
Throws an exception when $callable_required is true, and the callable object is
empt... | [
"Swaps",
"two",
"variables",
"when",
"the",
"second",
"is",
"a",
"callable",
"object"
] | 1e574813e197aa827b3e952f8caa81be31a8b5b5 | https://github.com/headzoo/core/blob/1e574813e197aa827b3e952f8caa81be31a8b5b5/src/Headzoo/Core/FunctionsTrait.php#L114-L129 |
237,516 | headzoo/core | src/Headzoo/Core/FunctionsTrait.php | FunctionsTrait.throwOnInvalidArgument | protected static function throwOnInvalidArgument($arg, $type)
{
$args = func_get_args();
$arg = array_shift($args);
$arg_type = gettype($arg);
$found = false;
foreach($args as $type) {
if ((in_array($type, self::$native_php_types) && $arg_type ==... | php | protected static function throwOnInvalidArgument($arg, $type)
{
$args = func_get_args();
$arg = array_shift($args);
$arg_type = gettype($arg);
$found = false;
foreach($args as $type) {
if ((in_array($type, self::$native_php_types) && $arg_type ==... | [
"protected",
"static",
"function",
"throwOnInvalidArgument",
"(",
"$",
"arg",
",",
"$",
"type",
")",
"{",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"$",
"arg",
"=",
"array_shift",
"(",
"$",
"args",
")",
";",
"$",
"arg_type",
"=",
"gettype",
"("... | Throws an InvalidArgumentException when the argument is not one of the given types
The $type argument should be one of the native PHP types returned by gettype() or the name of
a class, in which case the argument must be an instance of that class.
This method always returns true.
Example:
public function fetch($valu... | [
"Throws",
"an",
"InvalidArgumentException",
"when",
"the",
"argument",
"is",
"not",
"one",
"of",
"the",
"given",
"types"
] | 1e574813e197aa827b3e952f8caa81be31a8b5b5 | https://github.com/headzoo/core/blob/1e574813e197aa827b3e952f8caa81be31a8b5b5/src/Headzoo/Core/FunctionsTrait.php#L201-L225 |
237,517 | guru-digital/framework-types | GDM/Framework/Types/Url.php | Url.parse | private function parse()
{
$this->parameters = [];
$this->pathSegments = [];
$parsedUrl = parse_url($this->returnValue);
foreach ($parsedUrl as $key => $value) {
if ($key == 'query') {
parse_str($value, $this->parameters);
} elseif (... | php | private function parse()
{
$this->parameters = [];
$this->pathSegments = [];
$parsedUrl = parse_url($this->returnValue);
foreach ($parsedUrl as $key => $value) {
if ($key == 'query') {
parse_str($value, $this->parameters);
} elseif (... | [
"private",
"function",
"parse",
"(",
")",
"{",
"$",
"this",
"->",
"parameters",
"=",
"[",
"]",
";",
"$",
"this",
"->",
"pathSegments",
"=",
"[",
"]",
";",
"$",
"parsedUrl",
"=",
"parse_url",
"(",
"$",
"this",
"->",
"returnValue",
")",
";",
"foreach",... | Parses the current returnValue and fills this objects properties
@return $this | [
"Parses",
"the",
"current",
"returnValue",
"and",
"fills",
"this",
"objects",
"properties"
] | f14e9b1e6cc2571414ba7d561bb205644e28e17d | https://github.com/guru-digital/framework-types/blob/f14e9b1e6cc2571414ba7d561bb205644e28e17d/GDM/Framework/Types/Url.php#L27-L42 |
237,518 | guru-digital/framework-types | GDM/Framework/Types/Url.php | Url.compareTo | public function compareTo($url, $caseSensitive = true, $includeQuery = false, $ignoreSpecialChars = false)
{
/* @var $urlObj Url */
$urlObj = $url instanceof Url ? $url : self::create($url)->decodePath();
/* @var $urlObj2 Url */
$urlObj2 = clone $this;
$urlObj2->decodePath()... | php | public function compareTo($url, $caseSensitive = true, $includeQuery = false, $ignoreSpecialChars = false)
{
/* @var $urlObj Url */
$urlObj = $url instanceof Url ? $url : self::create($url)->decodePath();
/* @var $urlObj2 Url */
$urlObj2 = clone $this;
$urlObj2->decodePath()... | [
"public",
"function",
"compareTo",
"(",
"$",
"url",
",",
"$",
"caseSensitive",
"=",
"true",
",",
"$",
"includeQuery",
"=",
"false",
",",
"$",
"ignoreSpecialChars",
"=",
"false",
")",
"{",
"/* @var $urlObj Url */",
"$",
"urlObj",
"=",
"$",
"url",
"instanceof"... | Checks if this url object is equal to another.
@param string $str2 <p>
The string to compare against
</p>
@param bool $caseSensitive [optional] <p>
If true the string comparision is case sensitive
</p>
</p>
@param bool $includeQuery [optional] <p>
If true the query string is ignored from the string comparision
</p>
@pa... | [
"Checks",
"if",
"this",
"url",
"object",
"is",
"equal",
"to",
"another",
"."
] | f14e9b1e6cc2571414ba7d561bb205644e28e17d | https://github.com/guru-digital/framework-types/blob/f14e9b1e6cc2571414ba7d561bb205644e28e17d/GDM/Framework/Types/Url.php#L123-L139 |
237,519 | guru-digital/framework-types | GDM/Framework/Types/Url.php | Url.fromObject | function fromObject($value)
{
$this->clear();
$this->orignalValue = $this->returnValue = (string) (method_exists($value, '__toString') ? $value : null);
return $this->parse();
} | php | function fromObject($value)
{
$this->clear();
$this->orignalValue = $this->returnValue = (string) (method_exists($value, '__toString') ? $value : null);
return $this->parse();
} | [
"function",
"fromObject",
"(",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"clear",
"(",
")",
";",
"$",
"this",
"->",
"orignalValue",
"=",
"$",
"this",
"->",
"returnValue",
"=",
"(",
"string",
")",
"(",
"method_exists",
"(",
"$",
"value",
",",
"'__toS... | Create a Url instance from an object.
@param object $value
@return $this | [
"Create",
"a",
"Url",
"instance",
"from",
"an",
"object",
"."
] | f14e9b1e6cc2571414ba7d561bb205644e28e17d | https://github.com/guru-digital/framework-types/blob/f14e9b1e6cc2571414ba7d561bb205644e28e17d/GDM/Framework/Types/Url.php#L175-L180 |
237,520 | guru-digital/framework-types | GDM/Framework/Types/Url.php | Url.fromString | function fromString($value)
{
$this->clear();
$this->orignalValue = $this->returnValue = (string) $value;
return $this->parse();
} | php | function fromString($value)
{
$this->clear();
$this->orignalValue = $this->returnValue = (string) $value;
return $this->parse();
} | [
"function",
"fromString",
"(",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"clear",
"(",
")",
";",
"$",
"this",
"->",
"orignalValue",
"=",
"$",
"this",
"->",
"returnValue",
"=",
"(",
"string",
")",
"$",
"value",
";",
"return",
"$",
"this",
"->",
"pa... | Create a Url instance from a string.
@param string $value
@return $this | [
"Create",
"a",
"Url",
"instance",
"from",
"a",
"string",
"."
] | f14e9b1e6cc2571414ba7d561bb205644e28e17d | https://github.com/guru-digital/framework-types/blob/f14e9b1e6cc2571414ba7d561bb205644e28e17d/GDM/Framework/Types/Url.php#L188-L193 |
237,521 | guru-digital/framework-types | GDM/Framework/Types/Url.php | Url.fromResource | function fromResource($value)
{
$this->clear();
$this->orignalValue = $this->returnValue = stream_get_contents($value);
return $this->parse();
} | php | function fromResource($value)
{
$this->clear();
$this->orignalValue = $this->returnValue = stream_get_contents($value);
return $this->parse();
} | [
"function",
"fromResource",
"(",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"clear",
"(",
")",
";",
"$",
"this",
"->",
"orignalValue",
"=",
"$",
"this",
"->",
"returnValue",
"=",
"stream_get_contents",
"(",
"$",
"value",
")",
";",
"return",
"$",
"this"... | Create a Url instance from a resource.
@param resource $value
@return $this | [
"Create",
"a",
"Url",
"instance",
"from",
"a",
"resource",
"."
] | f14e9b1e6cc2571414ba7d561bb205644e28e17d | https://github.com/guru-digital/framework-types/blob/f14e9b1e6cc2571414ba7d561bb205644e28e17d/GDM/Framework/Types/Url.php#L201-L206 |
237,522 | guru-digital/framework-types | GDM/Framework/Types/Url.php | Url.clear | protected function clear()
{
$this->scheme = null;
$this->host = null;
$this->port = null;
$this->user = null;
$this->pass = null;
$this->pathSegments = [];
$this->parameters = [];
$this->fragment = null;
... | php | protected function clear()
{
$this->scheme = null;
$this->host = null;
$this->port = null;
$this->user = null;
$this->pass = null;
$this->pathSegments = [];
$this->parameters = [];
$this->fragment = null;
... | [
"protected",
"function",
"clear",
"(",
")",
"{",
"$",
"this",
"->",
"scheme",
"=",
"null",
";",
"$",
"this",
"->",
"host",
"=",
"null",
";",
"$",
"this",
"->",
"port",
"=",
"null",
";",
"$",
"this",
"->",
"user",
"=",
"null",
";",
"$",
"this",
... | Empties the values of this Url
@return $this | [
"Empties",
"the",
"values",
"of",
"this",
"Url"
] | f14e9b1e6cc2571414ba7d561bb205644e28e17d | https://github.com/guru-digital/framework-types/blob/f14e9b1e6cc2571414ba7d561bb205644e28e17d/GDM/Framework/Types/Url.php#L213-L225 |
237,523 | guru-digital/framework-types | GDM/Framework/Types/Url.php | Url.offsetGet | public function offsetGet($offset)
{
return isset($this->pathSegments[$offset]) ? $this->pathSegments[$offset] : null;
} | php | public function offsetGet($offset)
{
return isset($this->pathSegments[$offset]) ? $this->pathSegments[$offset] : null;
} | [
"public",
"function",
"offsetGet",
"(",
"$",
"offset",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"pathSegments",
"[",
"$",
"offset",
"]",
")",
"?",
"$",
"this",
"->",
"pathSegments",
"[",
"$",
"offset",
"]",
":",
"null",
";",
"}"
] | Retrieve path segment
@link http://php.net/manual/en/arrayaccess.offsetget.php
@param int $offset <p>
The path segment offset to retrieve.
</p>
@return string|null The value of the path segement at the give offset or null if not set. | [
"Retrieve",
"path",
"segment"
] | f14e9b1e6cc2571414ba7d561bb205644e28e17d | https://github.com/guru-digital/framework-types/blob/f14e9b1e6cc2571414ba7d561bb205644e28e17d/GDM/Framework/Types/Url.php#L262-L265 |
237,524 | guru-digital/framework-types | GDM/Framework/Types/Url.php | Url.current | public function current($includeQuery = true)
{
$url = "";
if (!$this->serverVars && php_sapi_name() == 'cli') {
$url = "cli";
} else {
$url .= $this->currentScheme().$this->currentHost();
$port = $this->currentPort();
if (!in_array($port, [ fa... | php | public function current($includeQuery = true)
{
$url = "";
if (!$this->serverVars && php_sapi_name() == 'cli') {
$url = "cli";
} else {
$url .= $this->currentScheme().$this->currentHost();
$port = $this->currentPort();
if (!in_array($port, [ fa... | [
"public",
"function",
"current",
"(",
"$",
"includeQuery",
"=",
"true",
")",
"{",
"$",
"url",
"=",
"\"\"",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"serverVars",
"&&",
"php_sapi_name",
"(",
")",
"==",
"'cli'",
")",
"{",
"$",
"url",
"=",
"\"cli\"",
"... | Get the URL of current request.
@param bool $includeQuery <p>Include the query string in the result</p>
@return Url The URL of the current request or cli if called from the command line | [
"Get",
"the",
"URL",
"of",
"current",
"request",
"."
] | f14e9b1e6cc2571414ba7d561bb205644e28e17d | https://github.com/guru-digital/framework-types/blob/f14e9b1e6cc2571414ba7d561bb205644e28e17d/GDM/Framework/Types/Url.php#L332-L352 |
237,525 | guru-digital/framework-types | GDM/Framework/Types/Url.php | Url.currentPath | public function currentPath()
{
$requestURI = $this->serverVar('REQUEST_URI');
$sciptName = $this->serverVar('SCRIPT_NAME');
return rtrim(parse_url($requestURI? : $sciptName, PHP_URL_PATH), '/');
} | php | public function currentPath()
{
$requestURI = $this->serverVar('REQUEST_URI');
$sciptName = $this->serverVar('SCRIPT_NAME');
return rtrim(parse_url($requestURI? : $sciptName, PHP_URL_PATH), '/');
} | [
"public",
"function",
"currentPath",
"(",
")",
"{",
"$",
"requestURI",
"=",
"$",
"this",
"->",
"serverVar",
"(",
"'REQUEST_URI'",
")",
";",
"$",
"sciptName",
"=",
"$",
"this",
"->",
"serverVar",
"(",
"'SCRIPT_NAME'",
")",
";",
"return",
"rtrim",
"(",
"pa... | Get the path of the current request.
@return string | [
"Get",
"the",
"path",
"of",
"the",
"current",
"request",
"."
] | f14e9b1e6cc2571414ba7d561bb205644e28e17d | https://github.com/guru-digital/framework-types/blob/f14e9b1e6cc2571414ba7d561bb205644e28e17d/GDM/Framework/Types/Url.php#L399-L404 |
237,526 | guru-digital/framework-types | GDM/Framework/Types/Url.php | Url.fetch | public function fetch($forwardCookie = true, $contextOptions = [])
{
$cookie = $this->serverVar('HTTP_COOKIE');
if ($forwardCookie && $cookie !== false) {
$cookie = ['http' => ['header' => 'Cookie: '.$cookie."\r\n"]];
$contextOptions = array_merge($cookie, $contextOpt... | php | public function fetch($forwardCookie = true, $contextOptions = [])
{
$cookie = $this->serverVar('HTTP_COOKIE');
if ($forwardCookie && $cookie !== false) {
$cookie = ['http' => ['header' => 'Cookie: '.$cookie."\r\n"]];
$contextOptions = array_merge($cookie, $contextOpt... | [
"public",
"function",
"fetch",
"(",
"$",
"forwardCookie",
"=",
"true",
",",
"$",
"contextOptions",
"=",
"[",
"]",
")",
"{",
"$",
"cookie",
"=",
"$",
"this",
"->",
"serverVar",
"(",
"'HTTP_COOKIE'",
")",
";",
"if",
"(",
"$",
"forwardCookie",
"&&",
"$",
... | Make a request to the URL and retieve the result as a string
@param bool $forwardCookie <p>If true, the current request cookie will be forwarded in the request</p>
@param type $contextOptions [optional] <p>
Must be an associative array in the format
$arr['parameter'] = $value.
Refer to context parameters for
a listin... | [
"Make",
"a",
"request",
"to",
"the",
"URL",
"and",
"retieve",
"the",
"result",
"as",
"a",
"string"
] | f14e9b1e6cc2571414ba7d561bb205644e28e17d | https://github.com/guru-digital/framework-types/blob/f14e9b1e6cc2571414ba7d561bb205644e28e17d/GDM/Framework/Types/Url.php#L420-L429 |
237,527 | guru-digital/framework-types | GDM/Framework/Types/Url.php | Url.toString | public function toString()
{
$result = "";
if ($this->scheme) {
$result .= $this->scheme.'://';
}
if ($this->user) {
$result .= $this->user;
if ($this->pass) {
$result .= $this->user;
}
$result .= '@';
... | php | public function toString()
{
$result = "";
if ($this->scheme) {
$result .= $this->scheme.'://';
}
if ($this->user) {
$result .= $this->user;
if ($this->pass) {
$result .= $this->user;
}
$result .= '@';
... | [
"public",
"function",
"toString",
"(",
")",
"{",
"$",
"result",
"=",
"\"\"",
";",
"if",
"(",
"$",
"this",
"->",
"scheme",
")",
"{",
"$",
"result",
".=",
"$",
"this",
"->",
"scheme",
".",
"'://'",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"user",
... | Gets the current URL as a string
@return string The resulting URL as a string | [
"Gets",
"the",
"current",
"URL",
"as",
"a",
"string"
] | f14e9b1e6cc2571414ba7d561bb205644e28e17d | https://github.com/guru-digital/framework-types/blob/f14e9b1e6cc2571414ba7d561bb205644e28e17d/GDM/Framework/Types/Url.php#L454-L483 |
237,528 | yii2lab/yii2-test | src/traits/UnitAssertTrait.php | UnitAssertTrait.normalizeArrayForNewLines | private function normalizeArrayForNewLines(array $data) {
foreach($data as $k => $item) {
if(is_string($item)) {
$data[$k] = str_replace(["\r\n", "\n\r", "\r"], "\n", $item);
} elseif(is_array($item)) {
$data[$k] = $this->normalizeArrayForNewLines($item);
}
}
return $data;
} | php | private function normalizeArrayForNewLines(array $data) {
foreach($data as $k => $item) {
if(is_string($item)) {
$data[$k] = str_replace(["\r\n", "\n\r", "\r"], "\n", $item);
} elseif(is_array($item)) {
$data[$k] = $this->normalizeArrayForNewLines($item);
}
}
return $data;
} | [
"private",
"function",
"normalizeArrayForNewLines",
"(",
"array",
"$",
"data",
")",
"{",
"foreach",
"(",
"$",
"data",
"as",
"$",
"k",
"=>",
"$",
"item",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"item",
")",
")",
"{",
"$",
"data",
"[",
"$",
"k",
... | crutch for linux and windows | [
"crutch",
"for",
"linux",
"and",
"windows"
] | 68cccc925c0365daeb4344bbd7839d9217992357 | https://github.com/yii2lab/yii2-test/blob/68cccc925c0365daeb4344bbd7839d9217992357/src/traits/UnitAssertTrait.php#L79-L88 |
237,529 | samurai-fw/samurai | src/Samurai/Component/Spec/PHPSpec/DIContainerMaintainer.php | DIContainerMaintainer.isUseableRaikiri | public function isUseableRaikiri($class)
{
$traits = [];
do {
$traits = array_merge($traits, class_uses($class));
} while ($class = get_parent_class($class));
foreach ($traits as $trait) {
$traits = array_merge($traits, class_uses($trait));
}
... | php | public function isUseableRaikiri($class)
{
$traits = [];
do {
$traits = array_merge($traits, class_uses($class));
} while ($class = get_parent_class($class));
foreach ($traits as $trait) {
$traits = array_merge($traits, class_uses($trait));
}
... | [
"public",
"function",
"isUseableRaikiri",
"(",
"$",
"class",
")",
"{",
"$",
"traits",
"=",
"[",
"]",
";",
"do",
"{",
"$",
"traits",
"=",
"array_merge",
"(",
"$",
"traits",
",",
"class_uses",
"(",
"$",
"class",
")",
")",
";",
"}",
"while",
"(",
"$",... | useable raikiri ?
@param string $class
@return boolean | [
"useable",
"raikiri",
"?"
] | 7ca3847b13f86e2847a17ab5e8e4e20893021d5a | https://github.com/samurai-fw/samurai/blob/7ca3847b13f86e2847a17ab5e8e4e20893021d5a/src/Samurai/Component/Spec/PHPSpec/DIContainerMaintainer.php#L67-L78 |
237,530 | maiklez/multimedia | src/Http/Controllers/EventosController.php | EventosController.show | public function show(Request $request, Evento $evento)
{
Debugbar::info($evento);
return view('multimedia::eventos/show', [
'evento' => $evento,
]);
} | php | public function show(Request $request, Evento $evento)
{
Debugbar::info($evento);
return view('multimedia::eventos/show', [
'evento' => $evento,
]);
} | [
"public",
"function",
"show",
"(",
"Request",
"$",
"request",
",",
"Evento",
"$",
"evento",
")",
"{",
"Debugbar",
"::",
"info",
"(",
"$",
"evento",
")",
";",
"return",
"view",
"(",
"'multimedia::eventos/show'",
",",
"[",
"'evento'",
"=>",
"$",
"evento",
... | show the given task.
@param Request $request
@param Task $task
@return Response | [
"show",
"the",
"given",
"task",
"."
] | 581a559f6670eea09c21ba1784aff20c363c29f7 | https://github.com/maiklez/multimedia/blob/581a559f6670eea09c21ba1784aff20c363c29f7/src/Http/Controllers/EventosController.php#L90-L96 |
237,531 | aerialls/MadalynnPlumBundle | Command/DeployCommand.php | DeployCommand.deploy | protected function deploy($server, $deployer, OutputInterface $output)
{
$plum = $this->getContainer()->get('madalynn.plum');
$options = $plum->getOptions($server);
$dryrun = '';
if (isset($options['dry_run']) && $options['dry_run']) {
$dryrun = '<comment>(dry run mod... | php | protected function deploy($server, $deployer, OutputInterface $output)
{
$plum = $this->getContainer()->get('madalynn.plum');
$options = $plum->getOptions($server);
$dryrun = '';
if (isset($options['dry_run']) && $options['dry_run']) {
$dryrun = '<comment>(dry run mod... | [
"protected",
"function",
"deploy",
"(",
"$",
"server",
",",
"$",
"deployer",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"plum",
"=",
"$",
"this",
"->",
"getContainer",
"(",
")",
"->",
"get",
"(",
"'madalynn.plum'",
")",
";",
"$",
"options",
... | Deploys the application to another server using a deployer.
@param string $server The server name
@param string $deployer The deployer name
@param OutputInterface $output The output object | [
"Deploys",
"the",
"application",
"to",
"another",
"server",
"using",
"a",
"deployer",
"."
] | 6f7032db7c31d8fcbf378c266cd82f032a2ee963 | https://github.com/aerialls/MadalynnPlumBundle/blob/6f7032db7c31d8fcbf378c266cd82f032a2ee963/Command/DeployCommand.php#L70-L86 |
237,532 | mrcoco/phalms-core | user/controllers/ProfilesController.php | ProfilesController.searchAction | public function searchAction()
{
$numberPage = 1;
if ($this->request->isPost()) {
$query = Criteria::fromInput($this->di, 'Modules\User\Models\Profiles', $this->request->getPost());
$this->persistent->searchParams = $query->getParams();
} else {
$numberPag... | php | public function searchAction()
{
$numberPage = 1;
if ($this->request->isPost()) {
$query = Criteria::fromInput($this->di, 'Modules\User\Models\Profiles', $this->request->getPost());
$this->persistent->searchParams = $query->getParams();
} else {
$numberPag... | [
"public",
"function",
"searchAction",
"(",
")",
"{",
"$",
"numberPage",
"=",
"1",
";",
"if",
"(",
"$",
"this",
"->",
"request",
"->",
"isPost",
"(",
")",
")",
"{",
"$",
"query",
"=",
"Criteria",
"::",
"fromInput",
"(",
"$",
"this",
"->",
"di",
",",... | Searches for profiles | [
"Searches",
"for",
"profiles"
] | 23486c3e75077896e708f0d2e257cde280a79ad4 | https://github.com/mrcoco/phalms-core/blob/23486c3e75077896e708f0d2e257cde280a79ad4/user/controllers/ProfilesController.php#L47-L79 |
237,533 | mrcoco/phalms-core | user/controllers/ProfilesController.php | ProfilesController.createAction | public function createAction()
{
if ($this->request->isPost()) {
$profile = new Profiles([
'name' => $this->request->getPost('name', 'striptags'),
'active' => $this->request->getPost('active')
]);
if (!$profile->save()) {
... | php | public function createAction()
{
if ($this->request->isPost()) {
$profile = new Profiles([
'name' => $this->request->getPost('name', 'striptags'),
'active' => $this->request->getPost('active')
]);
if (!$profile->save()) {
... | [
"public",
"function",
"createAction",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"request",
"->",
"isPost",
"(",
")",
")",
"{",
"$",
"profile",
"=",
"new",
"Profiles",
"(",
"[",
"'name'",
"=>",
"$",
"this",
"->",
"request",
"->",
"getPost",
"(",
... | Creates a new Profile | [
"Creates",
"a",
"new",
"Profile"
] | 23486c3e75077896e708f0d2e257cde280a79ad4 | https://github.com/mrcoco/phalms-core/blob/23486c3e75077896e708f0d2e257cde280a79ad4/user/controllers/ProfilesController.php#L84-L103 |
237,534 | mrcoco/phalms-core | user/controllers/ProfilesController.php | ProfilesController.editAction | public function editAction($id)
{
$profile = Profiles::findFirstById($id);
if (!$profile) {
$this->flash->error("Profile was not found");
return $this->dispatcher->forward([
'action' => 'index'
]);
}
if ($this->request->isPost()) {... | php | public function editAction($id)
{
$profile = Profiles::findFirstById($id);
if (!$profile) {
$this->flash->error("Profile was not found");
return $this->dispatcher->forward([
'action' => 'index'
]);
}
if ($this->request->isPost()) {... | [
"public",
"function",
"editAction",
"(",
"$",
"id",
")",
"{",
"$",
"profile",
"=",
"Profiles",
"::",
"findFirstById",
"(",
"$",
"id",
")",
";",
"if",
"(",
"!",
"$",
"profile",
")",
"{",
"$",
"this",
"->",
"flash",
"->",
"error",
"(",
"\"Profile was n... | Edits an existing Profile
@param int $id | [
"Edits",
"an",
"existing",
"Profile"
] | 23486c3e75077896e708f0d2e257cde280a79ad4 | https://github.com/mrcoco/phalms-core/blob/23486c3e75077896e708f0d2e257cde280a79ad4/user/controllers/ProfilesController.php#L110-L141 |
237,535 | mrcoco/phalms-core | user/controllers/ProfilesController.php | ProfilesController.deleteAction | public function deleteAction($id)
{
$profile = Profiles::findFirstById($id);
if (!$profile) {
$this->flash->error("Profile was not found");
return $this->dispatcher->forward([
'action' => 'index'
]);
}
if (!$profile->delete()) {
... | php | public function deleteAction($id)
{
$profile = Profiles::findFirstById($id);
if (!$profile) {
$this->flash->error("Profile was not found");
return $this->dispatcher->forward([
'action' => 'index'
]);
}
if (!$profile->delete()) {
... | [
"public",
"function",
"deleteAction",
"(",
"$",
"id",
")",
"{",
"$",
"profile",
"=",
"Profiles",
"::",
"findFirstById",
"(",
"$",
"id",
")",
";",
"if",
"(",
"!",
"$",
"profile",
")",
"{",
"$",
"this",
"->",
"flash",
"->",
"error",
"(",
"\"Profile was... | Deletes a Profile
@param int $id | [
"Deletes",
"a",
"Profile"
] | 23486c3e75077896e708f0d2e257cde280a79ad4 | https://github.com/mrcoco/phalms-core/blob/23486c3e75077896e708f0d2e257cde280a79ad4/user/controllers/ProfilesController.php#L148-L169 |
237,536 | heyday/heystack-ecommerce-core | src/Currency/CurrencyService.php | CurrencyService.restoreState | public function restoreState()
{
if ($activeCurrency = $this->stateService->getByKey(self::ACTIVE_CURRENCY_KEY)) {
$this->activeCurrency = $activeCurrency;
}
} | php | public function restoreState()
{
if ($activeCurrency = $this->stateService->getByKey(self::ACTIVE_CURRENCY_KEY)) {
$this->activeCurrency = $activeCurrency;
}
} | [
"public",
"function",
"restoreState",
"(",
")",
"{",
"if",
"(",
"$",
"activeCurrency",
"=",
"$",
"this",
"->",
"stateService",
"->",
"getByKey",
"(",
"self",
"::",
"ACTIVE_CURRENCY_KEY",
")",
")",
"{",
"$",
"this",
"->",
"activeCurrency",
"=",
"$",
"active... | Uses the State service to retrieve the active currency's identifier and sets the active currency.
If the retrieved identifier is not an instance of the Identifier Interface, then it checks if it is a string,
which it uses to create a new Identifier object to set the active currency.
@return void | [
"Uses",
"the",
"State",
"service",
"to",
"retrieve",
"the",
"active",
"currency",
"s",
"identifier",
"and",
"sets",
"the",
"active",
"currency",
"."
] | b56c83839cd3396da6bc881d843fcb4f28b74685 | https://github.com/heyday/heystack-ecommerce-core/blob/b56c83839cd3396da6bc881d843fcb4f28b74685/src/Currency/CurrencyService.php#L96-L101 |
237,537 | heyday/heystack-ecommerce-core | src/Currency/CurrencyService.php | CurrencyService.convert | public function convert(Money $amount, IdentifierInterface $to)
{
if (!$toCurrency = $this->getCurrency($to)) {
throw new \InvalidArgumentException("Currency not supported");
}
/** @var \Heystack\Ecommerce\Currency\Interfaces\CurrencyInterface $fromCurrency */
$fromCurre... | php | public function convert(Money $amount, IdentifierInterface $to)
{
if (!$toCurrency = $this->getCurrency($to)) {
throw new \InvalidArgumentException("Currency not supported");
}
/** @var \Heystack\Ecommerce\Currency\Interfaces\CurrencyInterface $fromCurrency */
$fromCurre... | [
"public",
"function",
"convert",
"(",
"Money",
"$",
"amount",
",",
"IdentifierInterface",
"$",
"to",
")",
"{",
"if",
"(",
"!",
"$",
"toCurrency",
"=",
"$",
"this",
"->",
"getCurrency",
"(",
"$",
"to",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgume... | Converts amount from one currency to another using the currency's identifier
Warning this method can lose precision!
@param \SebastianBergmann\Money\Money $amount
@param \Heystack\Core\Identifier\IdentifierInterface $to
@return \SebastianBergmann\Money\Money
@throws \InvalidArgumentException | [
"Converts",
"amount",
"from",
"one",
"currency",
"to",
"another",
"using",
"the",
"currency",
"s",
"identifier"
] | b56c83839cd3396da6bc881d843fcb4f28b74685 | https://github.com/heyday/heystack-ecommerce-core/blob/b56c83839cd3396da6bc881d843fcb4f28b74685/src/Currency/CurrencyService.php#L179-L189 |
237,538 | xinc-develop/xinc-core | src/Build/Scheduler/DefaultScheduler.php | DefaultScheduler.getNextBuildTime | public function getNextBuildTime(BuildInterface $build)
{
if ($build->getLastBuild()->getBuildTime() == null
&& $build->getStatus() !== BuildInterface::STOPPED
) {
if (!isset($this->_nextBuildTime)) {
$this->_nextBuildTime = time();
}
... | php | public function getNextBuildTime(BuildInterface $build)
{
if ($build->getLastBuild()->getBuildTime() == null
&& $build->getStatus() !== BuildInterface::STOPPED
) {
if (!isset($this->_nextBuildTime)) {
$this->_nextBuildTime = time();
}
... | [
"public",
"function",
"getNextBuildTime",
"(",
"BuildInterface",
"$",
"build",
")",
"{",
"if",
"(",
"$",
"build",
"->",
"getLastBuild",
"(",
")",
"->",
"getBuildTime",
"(",
")",
"==",
"null",
"&&",
"$",
"build",
"->",
"getStatus",
"(",
")",
"!==",
"Build... | Calculates the next build timestamp
this is a build once scheduler.
@return int | [
"Calculates",
"the",
"next",
"build",
"timestamp",
"this",
"is",
"a",
"build",
"once",
"scheduler",
"."
] | 4bb69a6afe19e1186950a3122cbfe0989823e0d6 | https://github.com/xinc-develop/xinc-core/blob/4bb69a6afe19e1186950a3122cbfe0989823e0d6/src/Build/Scheduler/DefaultScheduler.php#L47-L60 |
237,539 | open-orchestra/open-orchestra-bbcode-bundle | BBcodeBundle/ElementNode/BBcodeDocumentElement.php | BBcodeDocumentElement.getAsPreviewHTML | public function getAsPreviewHTML()
{
$html = "";
foreach ($this->getChildren() as $child) {
$html .= $child->getAsPreviewHTML();
}
return $html;
} | php | public function getAsPreviewHTML()
{
$html = "";
foreach ($this->getChildren() as $child) {
$html .= $child->getAsPreviewHTML();
}
return $html;
} | [
"public",
"function",
"getAsPreviewHTML",
"(",
")",
"{",
"$",
"html",
"=",
"\"\"",
";",
"foreach",
"(",
"$",
"this",
"->",
"getChildren",
"(",
")",
"as",
"$",
"child",
")",
"{",
"$",
"html",
".=",
"$",
"child",
"->",
"getAsPreviewHTML",
"(",
")",
";"... | Iterates through the document's children to return a html version,
in a preview context
@return string | [
"Iterates",
"through",
"the",
"document",
"s",
"children",
"to",
"return",
"a",
"html",
"version",
"in",
"a",
"preview",
"context"
] | 4c3ccd668c9b6d2f5c0c8bac384da0c2cd08ad54 | https://github.com/open-orchestra/open-orchestra-bbcode-bundle/blob/4c3ccd668c9b6d2f5c0c8bac384da0c2cd08ad54/BBcodeBundle/ElementNode/BBcodeDocumentElement.php#L18-L26 |
237,540 | AnonymPHP/Anonym-Library | src/Anonym/Filesystem/Adapter.php | Adapter.chmod | public function chmod($path, $mod = 0777)
{
if ($this->adapter instanceof Local) {
return chmod($path, $mod);
}
return false;
} | php | public function chmod($path, $mod = 0777)
{
if ($this->adapter instanceof Local) {
return chmod($path, $mod);
}
return false;
} | [
"public",
"function",
"chmod",
"(",
"$",
"path",
",",
"$",
"mod",
"=",
"0777",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"adapter",
"instanceof",
"Local",
")",
"{",
"return",
"chmod",
"(",
"$",
"path",
",",
"$",
"mod",
")",
";",
"}",
"return",
"fal... | set the chmod to the file
@param string $path
@param int $mod
@return bool | [
"set",
"the",
"chmod",
"to",
"the",
"file"
] | c967ad804f84e8fb204593a0959cda2fed5ae075 | https://github.com/AnonymPHP/Anonym-Library/blob/c967ad804f84e8fb204593a0959cda2fed5ae075/src/Anonym/Filesystem/Adapter.php#L43-L50 |
237,541 | cityware/city-utility | src/Recursivity/Tree.php | Tree.getNodes | public function getNodes()
{
$nodes = array();
foreach ($this->nodes[$this->options['rootid']]->getDescendants() as $subnode) {
$nodes[] = $subnode;
}
return $nodes;
} | php | public function getNodes()
{
$nodes = array();
foreach ($this->nodes[$this->options['rootid']]->getDescendants() as $subnode) {
$nodes[] = $subnode;
}
return $nodes;
} | [
"public",
"function",
"getNodes",
"(",
")",
"{",
"$",
"nodes",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"nodes",
"[",
"$",
"this",
"->",
"options",
"[",
"'rootid'",
"]",
"]",
"->",
"getDescendants",
"(",
")",
"as",
"$",
"subn... | Returns a flat, sorted array of all node objects in the tree.
@return Node[] Nodes, sorted as if the tree was hierarchical,
i.e.: the first level 1 item, then the children of
the first level 1 item (and their children), then
the second level 1 item and so on. | [
"Returns",
"a",
"flat",
"sorted",
"array",
"of",
"all",
"node",
"objects",
"in",
"the",
"tree",
"."
] | fadd33233cdaf743d87c3c30e341f2b96e96e476 | https://github.com/cityware/city-utility/blob/fadd33233cdaf743d87c3c30e341f2b96e96e476/src/Recursivity/Tree.php#L86-L93 |
237,542 | cityware/city-utility | src/Recursivity/Tree.php | Tree.getNodeById | public function getNodeById($id)
{
if (empty($this->nodes[$id])) {
throw new \InvalidArgumentException("Invalid node primary key $id");
}
return $this->nodes[$id];
} | php | public function getNodeById($id)
{
if (empty($this->nodes[$id])) {
throw new \InvalidArgumentException("Invalid node primary key $id");
}
return $this->nodes[$id];
} | [
"public",
"function",
"getNodeById",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"nodes",
"[",
"$",
"id",
"]",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"\"Invalid node primary key $id\"",
")",
";",
"... | Returns a single node from the tree, identified by its ID.
@param int $id Node ID
@throws \InvalidArgumentException
@return Node | [
"Returns",
"a",
"single",
"node",
"from",
"the",
"tree",
"identified",
"by",
"its",
"ID",
"."
] | fadd33233cdaf743d87c3c30e341f2b96e96e476 | https://github.com/cityware/city-utility/blob/fadd33233cdaf743d87c3c30e341f2b96e96e476/src/Recursivity/Tree.php#L104-L110 |
237,543 | cityware/city-utility | src/Recursivity/Tree.php | Tree.getNodeByValuePath | public function getNodeByValuePath($name, array $search)
{
$findNested = function (array $nodes, array $tokens) use ($name, &$findNested) {
$token = array_shift($tokens);
foreach ($nodes as $node) {
$nodeName = $node->get($name);
if ($nodeName === $tok... | php | public function getNodeByValuePath($name, array $search)
{
$findNested = function (array $nodes, array $tokens) use ($name, &$findNested) {
$token = array_shift($tokens);
foreach ($nodes as $node) {
$nodeName = $node->get($name);
if ($nodeName === $tok... | [
"public",
"function",
"getNodeByValuePath",
"(",
"$",
"name",
",",
"array",
"$",
"search",
")",
"{",
"$",
"findNested",
"=",
"function",
"(",
"array",
"$",
"nodes",
",",
"array",
"$",
"tokens",
")",
"use",
"(",
"$",
"name",
",",
"&",
"$",
"findNested",... | Returns the first node for which a specific property's values of all ancestors
and the node are equal to the values in the given argument.
Example: If nodes have property "name", and on the root level there is a node with
name "A" which has a child with name "B" which has a child which has node "C", you
would get the ... | [
"Returns",
"the",
"first",
"node",
"for",
"which",
"a",
"specific",
"property",
"s",
"values",
"of",
"all",
"ancestors",
"and",
"the",
"node",
"are",
"equal",
"to",
"the",
"values",
"in",
"the",
"given",
"argument",
"."
] | fadd33233cdaf743d87c3c30e341f2b96e96e476 | https://github.com/cityware/city-utility/blob/fadd33233cdaf743d87c3c30e341f2b96e96e476/src/Recursivity/Tree.php#L136-L157 |
237,544 | cityware/city-utility | src/Recursivity/Tree.php | Tree.build | private function build(array $data)
{
$children = array();
// Create the root node
$this->nodes[$this->options['rootid']] = $this->createNode(
array(
'id' => $this->options['rootid'],
'parent' => null,
)
);
foreach... | php | private function build(array $data)
{
$children = array();
// Create the root node
$this->nodes[$this->options['rootid']] = $this->createNode(
array(
'id' => $this->options['rootid'],
'parent' => null,
)
);
foreach... | [
"private",
"function",
"build",
"(",
"array",
"$",
"data",
")",
"{",
"$",
"children",
"=",
"array",
"(",
")",
";",
"// Create the root node",
"$",
"this",
"->",
"nodes",
"[",
"$",
"this",
"->",
"options",
"[",
"'rootid'",
"]",
"]",
"=",
"$",
"this",
... | Core method for creating the tree
@param array $data The data from which to generate the tree
@throws InvalidParentException | [
"Core",
"method",
"for",
"creating",
"the",
"tree"
] | fadd33233cdaf743d87c3c30e341f2b96e96e476 | https://github.com/cityware/city-utility/blob/fadd33233cdaf743d87c3c30e341f2b96e96e476/src/Recursivity/Tree.php#L166-L203 |
237,545 | headzoo/core | src/Headzoo/Core/ErrorHandler.php | ErrorHandler.setRunningEnvironment | public function setRunningEnvironment($running_env)
{
$running_env = (string)$running_env;
if (empty($running_env)) {
$this->toss(
"InvalidArgument",
"The environment name cannot be empty."
);
}
$previous = $this->runni... | php | public function setRunningEnvironment($running_env)
{
$running_env = (string)$running_env;
if (empty($running_env)) {
$this->toss(
"InvalidArgument",
"The environment name cannot be empty."
);
}
$previous = $this->runni... | [
"public",
"function",
"setRunningEnvironment",
"(",
"$",
"running_env",
")",
"{",
"$",
"running_env",
"=",
"(",
"string",
")",
"$",
"running_env",
";",
"if",
"(",
"empty",
"(",
"$",
"running_env",
")",
")",
"{",
"$",
"this",
"->",
"toss",
"(",
"\"Invalid... | Sets the current runtime environment
Automatically sets the default error callback for this environment if none has been
set already. Returns the previously set running environment.
@param string $running_env Name of the environment
@return string | [
"Sets",
"the",
"current",
"runtime",
"environment"
] | 1e574813e197aa827b3e952f8caa81be31a8b5b5 | https://github.com/headzoo/core/blob/1e574813e197aa827b3e952f8caa81be31a8b5b5/src/Headzoo/Core/ErrorHandler.php#L258-L278 |
237,546 | headzoo/core | src/Headzoo/Core/ErrorHandler.php | ErrorHandler.handle | public function handle($running_env = self::DEFAULT_ENVIRONMENT, callable $callback = null)
{
$is_handled = false;
if (!$this->is_handling && !$this->last_error) {
$this->swapCallable($running_env, $callback, $this->running_env, false);
$this->setRunningEnvironment($running_e... | php | public function handle($running_env = self::DEFAULT_ENVIRONMENT, callable $callback = null)
{
$is_handled = false;
if (!$this->is_handling && !$this->last_error) {
$this->swapCallable($running_env, $callback, $this->running_env, false);
$this->setRunningEnvironment($running_e... | [
"public",
"function",
"handle",
"(",
"$",
"running_env",
"=",
"self",
"::",
"DEFAULT_ENVIRONMENT",
",",
"callable",
"$",
"callback",
"=",
"null",
")",
"{",
"$",
"is_handled",
"=",
"false",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"is_handling",
"&&",
"!",... | Starts handling errors
Returns true when errors are now being handled, or false when errors were already
being handled. Possibly because ::handle() had already been called, or an error has
already been handled.
Examples:
```
$handler = new ErrorHandler();
$handler->handle();
$handler = new ErrorHandler();
$handler->... | [
"Starts",
"handling",
"errors"
] | 1e574813e197aa827b3e952f8caa81be31a8b5b5 | https://github.com/headzoo/core/blob/1e574813e197aa827b3e952f8caa81be31a8b5b5/src/Headzoo/Core/ErrorHandler.php#L309-L337 |
237,547 | headzoo/core | src/Headzoo/Core/ErrorHandler.php | ErrorHandler.unhandle | public function unhandle()
{
$is_unhandled = false;
if ($this->is_handling && !$this->last_error) {
if ($this->prev_exception_handler) {
set_exception_handler($this->prev_exception_handler);
$this->prev_exception_handler = null;
}
i... | php | public function unhandle()
{
$is_unhandled = false;
if ($this->is_handling && !$this->last_error) {
if ($this->prev_exception_handler) {
set_exception_handler($this->prev_exception_handler);
$this->prev_exception_handler = null;
}
i... | [
"public",
"function",
"unhandle",
"(",
")",
"{",
"$",
"is_unhandled",
"=",
"false",
";",
"if",
"(",
"$",
"this",
"->",
"is_handling",
"&&",
"!",
"$",
"this",
"->",
"last_error",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"prev_exception_handler",
")",
"{"... | Stop handling errors
Restores the original uncaught exception handler, core error handler, and stops
handling errors.
Returns true when the original error handling state has been restored, or false when
the class was not handling errors. Possibly because ::handle() was never called, or
::unhandle() was already called... | [
"Stop",
"handling",
"errors"
] | 1e574813e197aa827b3e952f8caa81be31a8b5b5 | https://github.com/headzoo/core/blob/1e574813e197aa827b3e952f8caa81be31a8b5b5/src/Headzoo/Core/ErrorHandler.php#L351-L368 |
237,548 | headzoo/core | src/Headzoo/Core/ErrorHandler.php | ErrorHandler.setCallback | public function setCallback($env, callable $callable = null)
{
$this->swapCallable($env, $callable, $this->running_env);
$this->callbacks[$env] = $callable;
if (empty($this->errors[$env])) {
$this->setCoreErrors($env, self::getDefaultCoreErrors());
}
if (... | php | public function setCallback($env, callable $callable = null)
{
$this->swapCallable($env, $callable, $this->running_env);
$this->callbacks[$env] = $callable;
if (empty($this->errors[$env])) {
$this->setCoreErrors($env, self::getDefaultCoreErrors());
}
if (... | [
"public",
"function",
"setCallback",
"(",
"$",
"env",
",",
"callable",
"$",
"callable",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"swapCallable",
"(",
"$",
"env",
",",
"$",
"callable",
",",
"$",
"this",
"->",
"running_env",
")",
";",
"$",
"this",
"->... | Sets the callback that will be called when an error is handled
Uses the currently running environment when none is given.
Examples:
```php
$handler->setCallback(function($handler) {
// The $handler parameter is the ErrorHandler instance.
// The $handler->getLastError() method returns an exception which
// describes t... | [
"Sets",
"the",
"callback",
"that",
"will",
"be",
"called",
"when",
"an",
"error",
"is",
"handled"
] | 1e574813e197aa827b3e952f8caa81be31a8b5b5 | https://github.com/headzoo/core/blob/1e574813e197aa827b3e952f8caa81be31a8b5b5/src/Headzoo/Core/ErrorHandler.php#L408-L421 |
237,549 | headzoo/core | src/Headzoo/Core/ErrorHandler.php | ErrorHandler.getCallback | public function getCallback($env = null)
{
$env = $env ?: $this->running_env;
return isset($this->callbacks[$env]) ? $this->callbacks[$env] : null;
} | php | public function getCallback($env = null)
{
$env = $env ?: $this->running_env;
return isset($this->callbacks[$env]) ? $this->callbacks[$env] : null;
} | [
"public",
"function",
"getCallback",
"(",
"$",
"env",
"=",
"null",
")",
"{",
"$",
"env",
"=",
"$",
"env",
"?",
":",
"$",
"this",
"->",
"running_env",
";",
"return",
"isset",
"(",
"$",
"this",
"->",
"callbacks",
"[",
"$",
"env",
"]",
")",
"?",
"$"... | Returns the callback that will be called when an error is handled
Uses the currently running environment when none is given.
@param string|null $env Name of the environment
@return callable | [
"Returns",
"the",
"callback",
"that",
"will",
"be",
"called",
"when",
"an",
"error",
"is",
"handled"
] | 1e574813e197aa827b3e952f8caa81be31a8b5b5 | https://github.com/headzoo/core/blob/1e574813e197aa827b3e952f8caa81be31a8b5b5/src/Headzoo/Core/ErrorHandler.php#L432-L436 |
237,550 | headzoo/core | src/Headzoo/Core/ErrorHandler.php | ErrorHandler.defaultCallback | public function defaultCallback($handler)
{
$exception = $handler->getLastError();
if (php_sapi_name() != "cli") {
$message = htmlspecialchars($exception->getMessage());
$trace = nl2br(htmlspecialchars($exception->getTraceAsString()));
echo "<!DOCTYPE html><... | php | public function defaultCallback($handler)
{
$exception = $handler->getLastError();
if (php_sapi_name() != "cli") {
$message = htmlspecialchars($exception->getMessage());
$trace = nl2br(htmlspecialchars($exception->getTraceAsString()));
echo "<!DOCTYPE html><... | [
"public",
"function",
"defaultCallback",
"(",
"$",
"handler",
")",
"{",
"$",
"exception",
"=",
"$",
"handler",
"->",
"getLastError",
"(",
")",
";",
"if",
"(",
"php_sapi_name",
"(",
")",
"!=",
"\"cli\"",
")",
"{",
"$",
"message",
"=",
"htmlspecialchars",
... | The default error callback
This is the default error callback. It displays a web page with error information.
This should not be used in production. Ever.
@param ErrorHandler $handler The object that handled the error
@return mixed | [
"The",
"default",
"error",
"callback"
] | 1e574813e197aa827b3e952f8caa81be31a8b5b5 | https://github.com/headzoo/core/blob/1e574813e197aa827b3e952f8caa81be31a8b5b5/src/Headzoo/Core/ErrorHandler.php#L463-L476 |
237,551 | headzoo/core | src/Headzoo/Core/ErrorHandler.php | ErrorHandler.setCoreErrors | public function setCoreErrors($env, $errors = 0)
{
$this->swapArgs($env, $errors, $this->running_env, false);
$this->errors[$env] = $errors;
if (!$this->getCallback($env)) {
$this->setCallback($env, $this->getDefaultCallback());
}
return $this;
... | php | public function setCoreErrors($env, $errors = 0)
{
$this->swapArgs($env, $errors, $this->running_env, false);
$this->errors[$env] = $errors;
if (!$this->getCallback($env)) {
$this->setCallback($env, $this->getDefaultCallback());
}
return $this;
... | [
"public",
"function",
"setCoreErrors",
"(",
"$",
"env",
",",
"$",
"errors",
"=",
"0",
")",
"{",
"$",
"this",
"->",
"swapArgs",
"(",
"$",
"env",
",",
"$",
"errors",
",",
"$",
"this",
"->",
"running_env",
",",
"false",
")",
";",
"$",
"this",
"->",
... | Sets the core errors which will be handled
By default only a few fatal errors are handled, but you can specify exactly which
errors to handle with this method.
Uses the currently running environment when none is given.
Examples:
```php
$handler->setCoreErrors(E_ERROR | E_WARNING | E_DEPRECIATED);
$handler->setCoreE... | [
"Sets",
"the",
"core",
"errors",
"which",
"will",
"be",
"handled"
] | 1e574813e197aa827b3e952f8caa81be31a8b5b5 | https://github.com/headzoo/core/blob/1e574813e197aa827b3e952f8caa81be31a8b5b5/src/Headzoo/Core/ErrorHandler.php#L500-L510 |
237,552 | headzoo/core | src/Headzoo/Core/ErrorHandler.php | ErrorHandler.getCoreErrors | public function getCoreErrors($env = null)
{
$env = $env ?: $this->running_env;
return isset($this->errors[$env]) ? $this->errors[$env] : 0;
} | php | public function getCoreErrors($env = null)
{
$env = $env ?: $this->running_env;
return isset($this->errors[$env]) ? $this->errors[$env] : 0;
} | [
"public",
"function",
"getCoreErrors",
"(",
"$",
"env",
"=",
"null",
")",
"{",
"$",
"env",
"=",
"$",
"env",
"?",
":",
"$",
"this",
"->",
"running_env",
";",
"return",
"isset",
"(",
"$",
"this",
"->",
"errors",
"[",
"$",
"env",
"]",
")",
"?",
"$",... | Returns the core errors which are being handled
Uses the currently running environment when none is given.
@param string|null $env Name of the environment
@return int | [
"Returns",
"the",
"core",
"errors",
"which",
"are",
"being",
"handled"
] | 1e574813e197aa827b3e952f8caa81be31a8b5b5 | https://github.com/headzoo/core/blob/1e574813e197aa827b3e952f8caa81be31a8b5b5/src/Headzoo/Core/ErrorHandler.php#L521-L525 |
237,553 | headzoo/core | src/Headzoo/Core/ErrorHandler.php | ErrorHandler.removeCoreError | public function removeCoreError($env, $error = 0)
{
$this->swapArgs($env, $error, $this->running_env);
$is_removed = false;
if (isset($this->errors[$env])) {
$orig = $this->errors[$env];
$this->errors[$env] = ($this->errors[$env] & ~ $error);
$is_... | php | public function removeCoreError($env, $error = 0)
{
$this->swapArgs($env, $error, $this->running_env);
$is_removed = false;
if (isset($this->errors[$env])) {
$orig = $this->errors[$env];
$this->errors[$env] = ($this->errors[$env] & ~ $error);
$is_... | [
"public",
"function",
"removeCoreError",
"(",
"$",
"env",
",",
"$",
"error",
"=",
"0",
")",
"{",
"$",
"this",
"->",
"swapArgs",
"(",
"$",
"env",
",",
"$",
"error",
",",
"$",
"this",
"->",
"running_env",
")",
";",
"$",
"is_removed",
"=",
"false",
";... | Stops handling a core error
Uses the currently running environment when none is given. Passing E_ALL removes all error handling
for the given environment.
Examples:
```php
$handler->removeCoreError(E_NOTICE);
$handler->removeCoreError("live", E_NOTICE);
$handler->removeCoreError("dev", E_NOTICE | E_DEPRECIATED);
``... | [
"Stops",
"handling",
"a",
"core",
"error"
] | 1e574813e197aa827b3e952f8caa81be31a8b5b5 | https://github.com/headzoo/core/blob/1e574813e197aa827b3e952f8caa81be31a8b5b5/src/Headzoo/Core/ErrorHandler.php#L547-L559 |
237,554 | headzoo/core | src/Headzoo/Core/ErrorHandler.php | ErrorHandler.setUncaughtExceptions | public function setUncaughtExceptions($env, array $exceptions = [])
{
$this->swapArgs($env, $exceptions, $this->running_env, false);
$this->exceptions[$env] = [];
if (!empty($exceptions)) {
foreach($exceptions as $exception) {
$this->exceptions[$env][] = ... | php | public function setUncaughtExceptions($env, array $exceptions = [])
{
$this->swapArgs($env, $exceptions, $this->running_env, false);
$this->exceptions[$env] = [];
if (!empty($exceptions)) {
foreach($exceptions as $exception) {
$this->exceptions[$env][] = ... | [
"public",
"function",
"setUncaughtExceptions",
"(",
"$",
"env",
",",
"array",
"$",
"exceptions",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"swapArgs",
"(",
"$",
"env",
",",
"$",
"exceptions",
",",
"$",
"this",
"->",
"running_env",
",",
"false",
")",
... | Sets the uncaught exceptions which will be handled
By default every uncaught exception is handled, but specific types may be
specified using this method. The $exceptions argument may be an array of class
names, or array of objects.
Uncaught exceptions will not be handled when this method is given an empty
array.
Use... | [
"Sets",
"the",
"uncaught",
"exceptions",
"which",
"will",
"be",
"handled"
] | 1e574813e197aa827b3e952f8caa81be31a8b5b5 | https://github.com/headzoo/core/blob/1e574813e197aa827b3e952f8caa81be31a8b5b5/src/Headzoo/Core/ErrorHandler.php#L587-L602 |
237,555 | headzoo/core | src/Headzoo/Core/ErrorHandler.php | ErrorHandler.getUncaughtExceptions | public function getUncaughtExceptions($env = null)
{
$env = $env ?: $this->running_env;
return isset($this->exceptions[$env]) ? $this->exceptions[$env] : [];
} | php | public function getUncaughtExceptions($env = null)
{
$env = $env ?: $this->running_env;
return isset($this->exceptions[$env]) ? $this->exceptions[$env] : [];
} | [
"public",
"function",
"getUncaughtExceptions",
"(",
"$",
"env",
"=",
"null",
")",
"{",
"$",
"env",
"=",
"$",
"env",
"?",
":",
"$",
"this",
"->",
"running_env",
";",
"return",
"isset",
"(",
"$",
"this",
"->",
"exceptions",
"[",
"$",
"env",
"]",
")",
... | Returns the types of uncaught exceptions which are being handled
Returns an array of class names representing the types of uncaught exceptions the
class is handling.
Uses the currently running environment when none is given.
@param string|null $env Name of the environment
@return string[] | [
"Returns",
"the",
"types",
"of",
"uncaught",
"exceptions",
"which",
"are",
"being",
"handled"
] | 1e574813e197aa827b3e952f8caa81be31a8b5b5 | https://github.com/headzoo/core/blob/1e574813e197aa827b3e952f8caa81be31a8b5b5/src/Headzoo/Core/ErrorHandler.php#L616-L620 |
237,556 | headzoo/core | src/Headzoo/Core/ErrorHandler.php | ErrorHandler.removeUncaughtException | public function removeUncaughtException($env, $exception = null)
{
$this->swapArgs($env, $exception, $this->running_env);
$is_removed = false;
if (isset($this->exceptions[$env])) {
$exception = Objects::getFullName($exception);
$is_removed = (bool)Arrays::re... | php | public function removeUncaughtException($env, $exception = null)
{
$this->swapArgs($env, $exception, $this->running_env);
$is_removed = false;
if (isset($this->exceptions[$env])) {
$exception = Objects::getFullName($exception);
$is_removed = (bool)Arrays::re... | [
"public",
"function",
"removeUncaughtException",
"(",
"$",
"env",
",",
"$",
"exception",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"swapArgs",
"(",
"$",
"env",
",",
"$",
"exception",
",",
"$",
"this",
"->",
"running_env",
")",
";",
"$",
"is_removed",
"... | Stops handling an uncaught exception
Tells the class to stop handling the given type of exception, which may be either
a class name, or object. Returns true if the exception type has been successfully
unhandled. A false return value means the class wasn't handling the given
exception.
Uses the currently running envir... | [
"Stops",
"handling",
"an",
"uncaught",
"exception"
] | 1e574813e197aa827b3e952f8caa81be31a8b5b5 | https://github.com/headzoo/core/blob/1e574813e197aa827b3e952f8caa81be31a8b5b5/src/Headzoo/Core/ErrorHandler.php#L646-L657 |
237,557 | headzoo/core | src/Headzoo/Core/ErrorHandler.php | ErrorHandler.isHandlingCoreError | public function isHandlingCoreError($env, $error = 0)
{
$this->swapArgs($env, $error, $this->running_env);
return isset($this->errors[$env]) && (($this->errors[$env] & $error) === $error);
} | php | public function isHandlingCoreError($env, $error = 0)
{
$this->swapArgs($env, $error, $this->running_env);
return isset($this->errors[$env]) && (($this->errors[$env] & $error) === $error);
} | [
"public",
"function",
"isHandlingCoreError",
"(",
"$",
"env",
",",
"$",
"error",
"=",
"0",
")",
"{",
"$",
"this",
"->",
"swapArgs",
"(",
"$",
"env",
",",
"$",
"error",
",",
"$",
"this",
"->",
"running_env",
")",
";",
"return",
"isset",
"(",
"$",
"t... | Returns whether errors of the given type are being handled
Returns true when the given error -- one of the E_ERROR constants -- is one of
the errors being handled. Otherwise false is returned.
Uses the currently running environment when none is given.
Examples:
```php
$is_handled = $handler->isHandlingCoreError(E_WA... | [
"Returns",
"whether",
"errors",
"of",
"the",
"given",
"type",
"are",
"being",
"handled"
] | 1e574813e197aa827b3e952f8caa81be31a8b5b5 | https://github.com/headzoo/core/blob/1e574813e197aa827b3e952f8caa81be31a8b5b5/src/Headzoo/Core/ErrorHandler.php#L679-L683 |
237,558 | headzoo/core | src/Headzoo/Core/ErrorHandler.php | ErrorHandler.isHandlingUncaughtException | public function isHandlingUncaughtException($env, $exception = null)
{
$this->swapArgs($env, $exception, $this->running_env);
$is_handling = false;
if (isset($this->exceptions[$env])) {
if (is_object($exception)) {
$exception = Objects::getFullName($excep... | php | public function isHandlingUncaughtException($env, $exception = null)
{
$this->swapArgs($env, $exception, $this->running_env);
$is_handling = false;
if (isset($this->exceptions[$env])) {
if (is_object($exception)) {
$exception = Objects::getFullName($excep... | [
"public",
"function",
"isHandlingUncaughtException",
"(",
"$",
"env",
",",
"$",
"exception",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"swapArgs",
"(",
"$",
"env",
",",
"$",
"exception",
",",
"$",
"this",
"->",
"running_env",
")",
";",
"$",
"is_handling"... | Returns whether the given exception is being handled
Returns true when the given exception is one of the exceptions being handled for
the given running environment. Otherwise false is returned. The $exception
argument can be a class name or object.
Uses the currently running environment when none is given.
Examples:... | [
"Returns",
"whether",
"the",
"given",
"exception",
"is",
"being",
"handled"
] | 1e574813e197aa827b3e952f8caa81be31a8b5b5 | https://github.com/headzoo/core/blob/1e574813e197aa827b3e952f8caa81be31a8b5b5/src/Headzoo/Core/ErrorHandler.php#L706-L724 |
237,559 | headzoo/core | src/Headzoo/Core/ErrorHandler.php | ErrorHandler.handleCoreError | public function handleCoreError($type, $message, $file, $line)
{
$is_handled = false;
if ($this->is_handling && $this->isHandlingCoreError($type)) {
$exception = new Exceptions\PHPErrorException(
$message,
$type,
$file,
$lin... | php | public function handleCoreError($type, $message, $file, $line)
{
$is_handled = false;
if ($this->is_handling && $this->isHandlingCoreError($type)) {
$exception = new Exceptions\PHPErrorException(
$message,
$type,
$file,
$lin... | [
"public",
"function",
"handleCoreError",
"(",
"$",
"type",
",",
"$",
"message",
",",
"$",
"file",
",",
"$",
"line",
")",
"{",
"$",
"is_handled",
"=",
"false",
";",
"if",
"(",
"$",
"this",
"->",
"is_handling",
"&&",
"$",
"this",
"->",
"isHandlingCoreErr... | Handles core errors
Called by PHP when an error occures. This method determines whether the error is one
of the errors being handled. If it is, the the error will be captured, and the
error callback is called.
@param int $type The level of the error raised
@param string $message The error message
@param str... | [
"Handles",
"core",
"errors"
] | 1e574813e197aa827b3e952f8caa81be31a8b5b5 | https://github.com/headzoo/core/blob/1e574813e197aa827b3e952f8caa81be31a8b5b5/src/Headzoo/Core/ErrorHandler.php#L740-L754 |
237,560 | headzoo/core | src/Headzoo/Core/ErrorHandler.php | ErrorHandler.getCoreErrorHandler | public function getCoreErrorHandler()
{
return function($type, $message, $file, $line) {
return $this->handleCoreError($type, $message, $file, $line);
};
} | php | public function getCoreErrorHandler()
{
return function($type, $message, $file, $line) {
return $this->handleCoreError($type, $message, $file, $line);
};
} | [
"public",
"function",
"getCoreErrorHandler",
"(",
")",
"{",
"return",
"function",
"(",
"$",
"type",
",",
"$",
"message",
",",
"$",
"file",
",",
"$",
"line",
")",
"{",
"return",
"$",
"this",
"->",
"handleCoreError",
"(",
"$",
"type",
",",
"$",
"message"... | Returns the callback being used to handle core errors
This method is primarily used internally when setting up error callbacks, but
is left public for testing purposes. It essentially returns a reference to
the ::handleCoreError() method.
The returned closure has the following signature:
```php
function(int $type, st... | [
"Returns",
"the",
"callback",
"being",
"used",
"to",
"handle",
"core",
"errors"
] | 1e574813e197aa827b3e952f8caa81be31a8b5b5 | https://github.com/headzoo/core/blob/1e574813e197aa827b3e952f8caa81be31a8b5b5/src/Headzoo/Core/ErrorHandler.php#L791-L796 |
237,561 | headzoo/core | src/Headzoo/Core/ErrorHandler.php | ErrorHandler.triggerError | protected function triggerError(Exception $exception, $label)
{
$this->unhandle();
$this->last_error = $exception;
if ($exception instanceof Exceptions\PHPErrorException) {
$type = Errors::toString($exception->getCode());
} else {
$code = $exception->... | php | protected function triggerError(Exception $exception, $label)
{
$this->unhandle();
$this->last_error = $exception;
if ($exception instanceof Exceptions\PHPErrorException) {
$type = Errors::toString($exception->getCode());
} else {
$code = $exception->... | [
"protected",
"function",
"triggerError",
"(",
"Exception",
"$",
"exception",
",",
"$",
"label",
")",
"{",
"$",
"this",
"->",
"unhandle",
"(",
")",
";",
"$",
"this",
"->",
"last_error",
"=",
"$",
"exception",
";",
"if",
"(",
"$",
"exception",
"instanceof"... | Calls the error callback
Called by ::handleCoreError() and ::handleUncaughtException() when the type of error
captured matches an error being handled. This method calls the error callback, and
effectively shuts down the handler.
@param Exception $exception The error
@param string $label Label for the reason ... | [
"Calls",
"the",
"error",
"callback"
] | 1e574813e197aa827b3e952f8caa81be31a8b5b5 | https://github.com/headzoo/core/blob/1e574813e197aa827b3e952f8caa81be31a8b5b5/src/Headzoo/Core/ErrorHandler.php#L831-L859 |
237,562 | dlabas/DlcDoctrine | src/DlcDoctrine/Module.php | Module.onBootstrap | public function onBootstrap($e)
{
$eventManager = $e->getApplication()->getEventManager();
$serviceManager = $e->getApplication()->getServiceManager();
$options = $serviceManager->get('dlcdoctrine_module_options');
if ($options->getEnableAutoFlushFinishListener()) {... | php | public function onBootstrap($e)
{
$eventManager = $e->getApplication()->getEventManager();
$serviceManager = $e->getApplication()->getServiceManager();
$options = $serviceManager->get('dlcdoctrine_module_options');
if ($options->getEnableAutoFlushFinishListener()) {... | [
"public",
"function",
"onBootstrap",
"(",
"$",
"e",
")",
"{",
"$",
"eventManager",
"=",
"$",
"e",
"->",
"getApplication",
"(",
")",
"->",
"getEventManager",
"(",
")",
";",
"$",
"serviceManager",
"=",
"$",
"e",
"->",
"getApplication",
"(",
")",
"->",
"g... | Registering module-specific listeners
@param \Zend\Mvc\MvcEvent $e The MvcEvent instance
@return void | [
"Registering",
"module",
"-",
"specific",
"listeners"
] | 1e754c208197e9aa7a9d58efcc726e109aaa6edf | https://github.com/dlabas/DlcDoctrine/blob/1e754c208197e9aa7a9d58efcc726e109aaa6edf/src/DlcDoctrine/Module.php#L18-L28 |
237,563 | poliander/rio | src/Rio/Common/SchemaGenerator.php | SchemaGenerator.generate | private function generate()
{
$schema = [];
foreach ($this->getTables() as $table) {
$schema[$table] = $this->getTableDefinition($table);
};
foreach (array_keys($schema) as $table) {
$constraints = $this->driver->getConstraints($table);
foreach ... | php | private function generate()
{
$schema = [];
foreach ($this->getTables() as $table) {
$schema[$table] = $this->getTableDefinition($table);
};
foreach (array_keys($schema) as $table) {
$constraints = $this->driver->getConstraints($table);
foreach ... | [
"private",
"function",
"generate",
"(",
")",
"{",
"$",
"schema",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"getTables",
"(",
")",
"as",
"$",
"table",
")",
"{",
"$",
"schema",
"[",
"$",
"table",
"]",
"=",
"$",
"this",
"->",
"getTableD... | Generate database schema definition
@return array | [
"Generate",
"database",
"schema",
"definition"
] | d760ea6f0b93b88d5ca0b004a800d22359653321 | https://github.com/poliander/rio/blob/d760ea6f0b93b88d5ca0b004a800d22359653321/src/Rio/Common/SchemaGenerator.php#L46-L65 |
237,564 | poliander/rio | src/Rio/Common/SchemaGenerator.php | SchemaGenerator.get | public function get($table = null)
{
$schema = $this->generate();
if ($table !== null) {
if (isset($schema[$table]) === false) {
throw new Exception('Unknown table "' . $table . '"');
}
$schema = $schema[$table];
}
return $schema... | php | public function get($table = null)
{
$schema = $this->generate();
if ($table !== null) {
if (isset($schema[$table]) === false) {
throw new Exception('Unknown table "' . $table . '"');
}
$schema = $schema[$table];
}
return $schema... | [
"public",
"function",
"get",
"(",
"$",
"table",
"=",
"null",
")",
"{",
"$",
"schema",
"=",
"$",
"this",
"->",
"generate",
"(",
")",
";",
"if",
"(",
"$",
"table",
"!==",
"null",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"schema",
"[",
"$",
"table"... | Get schema definition for database or given table
@param string|null $table
@return array
@throws \Rio\Exception | [
"Get",
"schema",
"definition",
"for",
"database",
"or",
"given",
"table"
] | d760ea6f0b93b88d5ca0b004a800d22359653321 | https://github.com/poliander/rio/blob/d760ea6f0b93b88d5ca0b004a800d22359653321/src/Rio/Common/SchemaGenerator.php#L156-L169 |
237,565 | ionutmilica/ionix-framework | src/Routing/ControllerDispatcher.php | ControllerDispatcher.dispatch | public function dispatch(Route $route)
{
$callback = $route->getCallback();
$params = array_values($route->getData());
if ($callback instanceof Closure) {
return $this->container->resolveClosure($callback, $params);
}
$class = $this->container->make($callback[0]... | php | public function dispatch(Route $route)
{
$callback = $route->getCallback();
$params = array_values($route->getData());
if ($callback instanceof Closure) {
return $this->container->resolveClosure($callback, $params);
}
$class = $this->container->make($callback[0]... | [
"public",
"function",
"dispatch",
"(",
"Route",
"$",
"route",
")",
"{",
"$",
"callback",
"=",
"$",
"route",
"->",
"getCallback",
"(",
")",
";",
"$",
"params",
"=",
"array_values",
"(",
"$",
"route",
"->",
"getData",
"(",
")",
")",
";",
"if",
"(",
"... | Get and serve the controller
@param Route $route
@return mixed
@throws \Exception | [
"Get",
"and",
"serve",
"the",
"controller"
] | a0363667ff677f1772bdd9ac9530a9f4710f9321 | https://github.com/ionutmilica/ionix-framework/blob/a0363667ff677f1772bdd9ac9530a9f4710f9321/src/Routing/ControllerDispatcher.php#L27-L38 |
237,566 | academic/VipaImportBundle | Importer/PKP/ArticleImporter.php | ArticleImporter.importJournalArticles | public function importJournalArticles($oldJournalId, $newJournalId, $issueIds, $sectionIds)
{
$articleSql = "SELECT article_id FROM articles WHERE journal_id = :journal_id";
$articleStatement = $this->dbalConnection->prepare($articleSql);
$articleStatement->bindValue('journal_id', $oldJourna... | php | public function importJournalArticles($oldJournalId, $newJournalId, $issueIds, $sectionIds)
{
$articleSql = "SELECT article_id FROM articles WHERE journal_id = :journal_id";
$articleStatement = $this->dbalConnection->prepare($articleSql);
$articleStatement->bindValue('journal_id', $oldJourna... | [
"public",
"function",
"importJournalArticles",
"(",
"$",
"oldJournalId",
",",
"$",
"newJournalId",
",",
"$",
"issueIds",
",",
"$",
"sectionIds",
")",
"{",
"$",
"articleSql",
"=",
"\"SELECT article_id FROM articles WHERE journal_id = :journal_id\"",
";",
"$",
"articleSta... | Imports the articles of given Journal.
@param int $oldJournalId Old journal's ID
@param int $newJournalId New journal's ID
@param array $issueIds Issue IDs of journal
@param array $sectionIds Section IDs of journal
@throws Exception
@throws \Doctrine\DBAL\ConnectionException
@throws \Doctrine\DBAL\DBALException | [
"Imports",
"the",
"articles",
"of",
"given",
"Journal",
"."
] | cee7d9e51613706a4fd6e2eade44041ce1af9ad3 | https://github.com/academic/VipaImportBundle/blob/cee7d9e51613706a4fd6e2eade44041ce1af9ad3/Importer/PKP/ArticleImporter.php#L62-L71 |
237,567 | academic/VipaImportBundle | Importer/PKP/ArticleImporter.php | ArticleImporter.importCitations | public function importCitations($oldArticleId, $article)
{
$this->consoleOutput->writeln("Reading citations...");
$citationSql = "SELECT * FROM citations WHERE assoc_id = :id";
$citationStatement = $this->dbalConnection->prepare($citationSql);
$citationStatement->bindValue('id', $ol... | php | public function importCitations($oldArticleId, $article)
{
$this->consoleOutput->writeln("Reading citations...");
$citationSql = "SELECT * FROM citations WHERE assoc_id = :id";
$citationStatement = $this->dbalConnection->prepare($citationSql);
$citationStatement->bindValue('id', $ol... | [
"public",
"function",
"importCitations",
"(",
"$",
"oldArticleId",
",",
"$",
"article",
")",
"{",
"$",
"this",
"->",
"consoleOutput",
"->",
"writeln",
"(",
"\"Reading citations...\"",
")",
";",
"$",
"citationSql",
"=",
"\"SELECT * FROM citations WHERE assoc_id = :id\"... | Imports citations of the given article.
@param int $oldArticleId Old article's ID
@param Article $article Newly imported Article's entity | [
"Imports",
"citations",
"of",
"the",
"given",
"article",
"."
] | cee7d9e51613706a4fd6e2eade44041ce1af9ad3 | https://github.com/academic/VipaImportBundle/blob/cee7d9e51613706a4fd6e2eade44041ce1af9ad3/Importer/PKP/ArticleImporter.php#L278-L297 |
237,568 | academic/VipaImportBundle | Importer/PKP/ArticleImporter.php | ArticleImporter.importAuthors | public function importAuthors($oldArticleId, $article)
{
$this->consoleOutput->writeln("Reading authors...");
$authorSql = "SELECT first_name, last_name, email, seq FROM authors " .
"WHERE submission_id = :id ORDER BY first_name, last_name, email";
$authorStatement = $this->dbal... | php | public function importAuthors($oldArticleId, $article)
{
$this->consoleOutput->writeln("Reading authors...");
$authorSql = "SELECT first_name, last_name, email, seq FROM authors " .
"WHERE submission_id = :id ORDER BY first_name, last_name, email";
$authorStatement = $this->dbal... | [
"public",
"function",
"importAuthors",
"(",
"$",
"oldArticleId",
",",
"$",
"article",
")",
"{",
"$",
"this",
"->",
"consoleOutput",
"->",
"writeln",
"(",
"\"Reading authors...\"",
")",
";",
"$",
"authorSql",
"=",
"\"SELECT first_name, last_name, email, seq FROM author... | Imports authors of the given article.
@param int $oldArticleId Old article's ID
@param Article $article Newly imported Article entity | [
"Imports",
"authors",
"of",
"the",
"given",
"article",
"."
] | cee7d9e51613706a4fd6e2eade44041ce1af9ad3 | https://github.com/academic/VipaImportBundle/blob/cee7d9e51613706a4fd6e2eade44041ce1af9ad3/Importer/PKP/ArticleImporter.php#L304-L331 |
237,569 | tenside/core-bundle | src/Command/RunTaskCommand.php | RunTaskCommand.fork | private function fork()
{
/** @var LoggerInterface $logger */
$logger = $this->getContainer()->get('logger');
if (!$this->getContainer()->get('tenside.config')->isForkingAvailable()) {
$logger->warning('Forking disabled by configuration, execution will block until the command has... | php | private function fork()
{
/** @var LoggerInterface $logger */
$logger = $this->getContainer()->get('logger');
if (!$this->getContainer()->get('tenside.config')->isForkingAvailable()) {
$logger->warning('Forking disabled by configuration, execution will block until the command has... | [
"private",
"function",
"fork",
"(",
")",
"{",
"/** @var LoggerInterface $logger */",
"$",
"logger",
"=",
"$",
"this",
"->",
"getContainer",
"(",
")",
"->",
"get",
"(",
"'logger'",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"getContainer",
"(",
")",
"->... | Try to fork.
The return value determines if the caller shall exit (when forking was successful and it is the forking process)
or rather proceed execution (is the fork or unable to fork).
True means exit, false means go on in this process.
@return bool
@throws \RuntimeException When the forking caused an error. | [
"Try",
"to",
"fork",
"."
] | a7ffad3649cddac1e5594b4f8b65a5504363fccd | https://github.com/tenside/core-bundle/blob/a7ffad3649cddac1e5594b4f8b65a5504363fccd/src/Command/RunTaskCommand.php#L98-L123 |
237,570 | scholtz/AsyncWeb | src/AsyncWeb/Connectors/Page.php | Page.resolve_url | function resolve_url($base, $url) {
if (!strlen($base)) return $url;
// Step 2
if (!strlen($url)) return $base;
// Step 3
if (preg_match('!^[a-z]+:!i', $url)) return $url;
$base = parse_url($base);
if ($url{0} == "#") {
// Step 2 (fragment)
... | php | function resolve_url($base, $url) {
if (!strlen($base)) return $url;
// Step 2
if (!strlen($url)) return $base;
// Step 3
if (preg_match('!^[a-z]+:!i', $url)) return $url;
$base = parse_url($base);
if ($url{0} == "#") {
// Step 2 (fragment)
... | [
"function",
"resolve_url",
"(",
"$",
"base",
",",
"$",
"url",
")",
"{",
"if",
"(",
"!",
"strlen",
"(",
"$",
"base",
")",
")",
"return",
"$",
"url",
";",
"// Step 2",
"if",
"(",
"!",
"strlen",
"(",
"$",
"url",
")",
")",
"return",
"$",
"base",
";... | Resolve a URL relative to a base path. This happens to work with POSIX
filenames as well. This is based on RFC 2396 section 5.2. | [
"Resolve",
"a",
"URL",
"relative",
"to",
"a",
"base",
"path",
".",
"This",
"happens",
"to",
"work",
"with",
"POSIX",
"filenames",
"as",
"well",
".",
"This",
"is",
"based",
"on",
"RFC",
"2396",
"section",
"5",
".",
"2",
"."
] | 66a906298080c2c66d8f0fb85211b6100b3776bf | https://github.com/scholtz/AsyncWeb/blob/66a906298080c2c66d8f0fb85211b6100b3776bf/src/AsyncWeb/Connectors/Page.php#L144-L196 |
237,571 | idandtrust/goodid-phpasn1 | lib/ASN1/Object.php | Object.getIdentifier | public function getIdentifier()
{
$firstOctet = $this->getType();
if (Identifier::isLongForm($firstOctet)) {
throw new LogicException(sprintf('Identifier of %s uses the long form and must therefor override "Object::getIdentifier()".', get_class($this)));
}
return chr($f... | php | public function getIdentifier()
{
$firstOctet = $this->getType();
if (Identifier::isLongForm($firstOctet)) {
throw new LogicException(sprintf('Identifier of %s uses the long form and must therefor override "Object::getIdentifier()".', get_class($this)));
}
return chr($f... | [
"public",
"function",
"getIdentifier",
"(",
")",
"{",
"$",
"firstOctet",
"=",
"$",
"this",
"->",
"getType",
"(",
")",
";",
"if",
"(",
"Identifier",
"::",
"isLongForm",
"(",
"$",
"firstOctet",
")",
")",
"{",
"throw",
"new",
"LogicException",
"(",
"sprintf... | Returns all identifier octets. If an inheriting class models a tag with
the long form identifier format, it MUST reimplement this method to
return all octets of the identifier.
@throws LogicException If the identifier format is long form
@return string Identifier as a set of octets | [
"Returns",
"all",
"identifier",
"octets",
".",
"If",
"an",
"inheriting",
"class",
"models",
"a",
"tag",
"with",
"the",
"long",
"form",
"identifier",
"format",
"it",
"MUST",
"reimplement",
"this",
"method",
"to",
"return",
"all",
"octets",
"of",
"the",
"ident... | b95183bb85e51fbaf725d5e318dee1dbc3416b80 | https://github.com/idandtrust/goodid-phpasn1/blob/b95183bb85e51fbaf725d5e318dee1dbc3416b80/lib/ASN1/Object.php#L91-L100 |
237,572 | adammbalogh/key-value-store-memcached | src/Adapter/MemcachedAdapter/ValueTrait.php | ValueTrait.get | public function get($key)
{
$getResult = $this->getValue($key);
$unserialized = @unserialize($getResult);
if (Util::hasInternalExpireTime($unserialized)) {
$getResult = $unserialized['v'];
}
return $getResult;
} | php | public function get($key)
{
$getResult = $this->getValue($key);
$unserialized = @unserialize($getResult);
if (Util::hasInternalExpireTime($unserialized)) {
$getResult = $unserialized['v'];
}
return $getResult;
} | [
"public",
"function",
"get",
"(",
"$",
"key",
")",
"{",
"$",
"getResult",
"=",
"$",
"this",
"->",
"getValue",
"(",
"$",
"key",
")",
";",
"$",
"unserialized",
"=",
"@",
"unserialize",
"(",
"$",
"getResult",
")",
";",
"if",
"(",
"Util",
"::",
"hasInt... | Gets the value of a key.
@param string $key
@return mixed The value of the key.
@throws KeyNotFoundException
@throws \Exception | [
"Gets",
"the",
"value",
"of",
"a",
"key",
"."
] | e9919d6ef75badf0b2caf4ad45629666af21cd67 | https://github.com/adammbalogh/key-value-store-memcached/blob/e9919d6ef75badf0b2caf4ad45629666af21cd67/src/Adapter/MemcachedAdapter/ValueTrait.php#L24-L34 |
237,573 | flowcode/AmulenShopBundle | src/Flowcode/ShopBundle/Controller/StockTransferItemController.php | StockTransferItemController.newAction | public function newAction(StockTransfer $stockTransfer)
{
$stocktransferitem = new StockTransferItem();
$stocktransferitem->setStockTransfer($stockTransfer);
$form = $this->createForm(new StockTransferItemType(), $stocktransferitem);
return array(
'stocktransferitem' => ... | php | public function newAction(StockTransfer $stockTransfer)
{
$stocktransferitem = new StockTransferItem();
$stocktransferitem->setStockTransfer($stockTransfer);
$form = $this->createForm(new StockTransferItemType(), $stocktransferitem);
return array(
'stocktransferitem' => ... | [
"public",
"function",
"newAction",
"(",
"StockTransfer",
"$",
"stockTransfer",
")",
"{",
"$",
"stocktransferitem",
"=",
"new",
"StockTransferItem",
"(",
")",
";",
"$",
"stocktransferitem",
"->",
"setStockTransfer",
"(",
"$",
"stockTransfer",
")",
";",
"$",
"form... | Displays a form to create a new StockTransferItem entity.
@Route("/{id}/new", name="stock_transfersitem_new")
@Method("GET")
@Template() | [
"Displays",
"a",
"form",
"to",
"create",
"a",
"new",
"StockTransferItem",
"entity",
"."
] | 500aaf4364be3c42fca69ecd10a449da03993814 | https://github.com/flowcode/AmulenShopBundle/blob/500aaf4364be3c42fca69ecd10a449da03993814/src/Flowcode/ShopBundle/Controller/StockTransferItemController.php#L30-L40 |
237,574 | flowcode/AmulenShopBundle | src/Flowcode/ShopBundle/Controller/StockTransferItemController.php | StockTransferItemController.createAction | public function createAction(Request $request)
{
$stocktransferitem = new StockTransferItem();
$form = $this->createForm(new StockTransferItemType(), $stocktransferitem);
if ($form->handleRequest($request)->isValid()) {
$em = $this->getDoctrine()->getManager();
$em->p... | php | public function createAction(Request $request)
{
$stocktransferitem = new StockTransferItem();
$form = $this->createForm(new StockTransferItemType(), $stocktransferitem);
if ($form->handleRequest($request)->isValid()) {
$em = $this->getDoctrine()->getManager();
$em->p... | [
"public",
"function",
"createAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"stocktransferitem",
"=",
"new",
"StockTransferItem",
"(",
")",
";",
"$",
"form",
"=",
"$",
"this",
"->",
"createForm",
"(",
"new",
"StockTransferItemType",
"(",
")",
",",
... | Creates a new StockTransferItem entity.
@Route("/create", name="stock_transfersitem_create")
@Method("POST")
@Template("FlowerStockBundle:StockTransferItem:new.html.twig") | [
"Creates",
"a",
"new",
"StockTransferItem",
"entity",
"."
] | 500aaf4364be3c42fca69ecd10a449da03993814 | https://github.com/flowcode/AmulenShopBundle/blob/500aaf4364be3c42fca69ecd10a449da03993814/src/Flowcode/ShopBundle/Controller/StockTransferItemController.php#L49-L67 |
237,575 | flowcode/AmulenShopBundle | src/Flowcode/ShopBundle/Controller/StockTransferItemController.php | StockTransferItemController.editAction | public function editAction(StockTransferItem $stocktransferitem)
{
$editForm = $this->createForm(new StockTransferItemType(), $stocktransferitem, array(
'action' => $this->generateUrl('stock_transfersitem_update', array('id' => $stocktransferitem->getid())),
'method' => 'PUT',
... | php | public function editAction(StockTransferItem $stocktransferitem)
{
$editForm = $this->createForm(new StockTransferItemType(), $stocktransferitem, array(
'action' => $this->generateUrl('stock_transfersitem_update', array('id' => $stocktransferitem->getid())),
'method' => 'PUT',
... | [
"public",
"function",
"editAction",
"(",
"StockTransferItem",
"$",
"stocktransferitem",
")",
"{",
"$",
"editForm",
"=",
"$",
"this",
"->",
"createForm",
"(",
"new",
"StockTransferItemType",
"(",
")",
",",
"$",
"stocktransferitem",
",",
"array",
"(",
"'action'",
... | Displays a form to edit an existing StockTransferItem entity.
@Route("/{id}/edit", name="stock_transfersitem_edit", requirements={"id"="\d+"})
@Method("GET")
@Template() | [
"Displays",
"a",
"form",
"to",
"edit",
"an",
"existing",
"StockTransferItem",
"entity",
"."
] | 500aaf4364be3c42fca69ecd10a449da03993814 | https://github.com/flowcode/AmulenShopBundle/blob/500aaf4364be3c42fca69ecd10a449da03993814/src/Flowcode/ShopBundle/Controller/StockTransferItemController.php#L76-L89 |
237,576 | flowcode/AmulenShopBundle | src/Flowcode/ShopBundle/Controller/StockTransferItemController.php | StockTransferItemController.updateAction | public function updateAction(StockTransferItem $stocktransferitem, Request $request)
{
$editForm = $this->createForm(new StockTransferItemType(), $stocktransferitem, array(
'action' => $this->generateUrl('stock_transfersitem_update', array('id' => $stocktransferitem->getid())),
'meth... | php | public function updateAction(StockTransferItem $stocktransferitem, Request $request)
{
$editForm = $this->createForm(new StockTransferItemType(), $stocktransferitem, array(
'action' => $this->generateUrl('stock_transfersitem_update', array('id' => $stocktransferitem->getid())),
'meth... | [
"public",
"function",
"updateAction",
"(",
"StockTransferItem",
"$",
"stocktransferitem",
",",
"Request",
"$",
"request",
")",
"{",
"$",
"editForm",
"=",
"$",
"this",
"->",
"createForm",
"(",
"new",
"StockTransferItemType",
"(",
")",
",",
"$",
"stocktransferitem... | Edits an existing StockTransferItem entity.
@Route("/{id}/update", name="stock_transfersitem_update", requirements={"id"="\d+"})
@Method("PUT")
@Template("FlowerStockBundle:StockTransferItem:edit.html.twig") | [
"Edits",
"an",
"existing",
"StockTransferItem",
"entity",
"."
] | 500aaf4364be3c42fca69ecd10a449da03993814 | https://github.com/flowcode/AmulenShopBundle/blob/500aaf4364be3c42fca69ecd10a449da03993814/src/Flowcode/ShopBundle/Controller/StockTransferItemController.php#L98-L116 |
237,577 | mszewcz/php-light-framework | src/Config/Reader/Ini.php | Ini.processNode | private function processNode(array $node): array
{
$config = [];
foreach ($node as $name => $value) {
if (\preg_match('/^num__([0-9]+)$/', $name, $matches)) {
$name = $matches[1];
}
if (\count($nameEx = \explode('.', $name)) > 1) {
... | php | private function processNode(array $node): array
{
$config = [];
foreach ($node as $name => $value) {
if (\preg_match('/^num__([0-9]+)$/', $name, $matches)) {
$name = $matches[1];
}
if (\count($nameEx = \explode('.', $name)) > 1) {
... | [
"private",
"function",
"processNode",
"(",
"array",
"$",
"node",
")",
":",
"array",
"{",
"$",
"config",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"node",
"as",
"$",
"name",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"\\",
"preg_match",
"(",
"'/^num__(... | Processes INI config node
@param array $node
@return array | [
"Processes",
"INI",
"config",
"node"
] | 4d3b46781c387202c2dfbdb8760151b3ae8ef49c | https://github.com/mszewcz/php-light-framework/blob/4d3b46781c387202c2dfbdb8760151b3ae8ef49c/src/Config/Reader/Ini.php#L50-L69 |
237,578 | mszewcz/php-light-framework | src/Config/Reader/Ini.php | Ini.castValue | private function castValue(string $value)
{
$value = $this->normalize($value);
if (\preg_match('/^[0-9]+$/', $value)) {
$value = (int)$value;
} elseif (\preg_match('/^[0-9\.]+$/', $value)) {
$value = (float)$value;
} elseif (\preg_match('/^true|false$/', $valu... | php | private function castValue(string $value)
{
$value = $this->normalize($value);
if (\preg_match('/^[0-9]+$/', $value)) {
$value = (int)$value;
} elseif (\preg_match('/^[0-9\.]+$/', $value)) {
$value = (float)$value;
} elseif (\preg_match('/^true|false$/', $valu... | [
"private",
"function",
"castValue",
"(",
"string",
"$",
"value",
")",
"{",
"$",
"value",
"=",
"$",
"this",
"->",
"normalize",
"(",
"$",
"value",
")",
";",
"if",
"(",
"\\",
"preg_match",
"(",
"'/^[0-9]+$/'",
",",
"$",
"value",
")",
")",
"{",
"$",
"v... | Casts value to a specified type
@param string $value
@return mixed | [
"Casts",
"value",
"to",
"a",
"specified",
"type"
] | 4d3b46781c387202c2dfbdb8760151b3ae8ef49c | https://github.com/mszewcz/php-light-framework/blob/4d3b46781c387202c2dfbdb8760151b3ae8ef49c/src/Config/Reader/Ini.php#L77-L88 |
237,579 | mszewcz/php-light-framework | src/Config/Reader/Ini.php | Ini.normalize | private function normalize(string $string): string
{
return \str_replace($this->normalizeFrom, $this->normalizeTo, $string);
} | php | private function normalize(string $string): string
{
return \str_replace($this->normalizeFrom, $this->normalizeTo, $string);
} | [
"private",
"function",
"normalize",
"(",
"string",
"$",
"string",
")",
":",
"string",
"{",
"return",
"\\",
"str_replace",
"(",
"$",
"this",
"->",
"normalizeFrom",
",",
"$",
"this",
"->",
"normalizeTo",
",",
"$",
"string",
")",
";",
"}"
] | Changes some characters from their utf-8 to normal representation
@param string $string
@return string | [
"Changes",
"some",
"characters",
"from",
"their",
"utf",
"-",
"8",
"to",
"normal",
"representation"
] | 4d3b46781c387202c2dfbdb8760151b3ae8ef49c | https://github.com/mszewcz/php-light-framework/blob/4d3b46781c387202c2dfbdb8760151b3ae8ef49c/src/Config/Reader/Ini.php#L96-L99 |
237,580 | Briareos/mongodb-odm | lib/Doctrine/ODM/MongoDB/Hydrator/HydratorFactory.php | HydratorFactory.hydrate | public function hydrate($document, $data, array $hints = array())
{
$metadata = $this->dm->getClassMetadata(get_class($document));
// Invoke preLoad lifecycle events and listeners
if ( ! empty($metadata->lifecycleCallbacks[Events::preLoad])) {
$args = array(&$data);
$... | php | public function hydrate($document, $data, array $hints = array())
{
$metadata = $this->dm->getClassMetadata(get_class($document));
// Invoke preLoad lifecycle events and listeners
if ( ! empty($metadata->lifecycleCallbacks[Events::preLoad])) {
$args = array(&$data);
$... | [
"public",
"function",
"hydrate",
"(",
"$",
"document",
",",
"$",
"data",
",",
"array",
"$",
"hints",
"=",
"array",
"(",
")",
")",
"{",
"$",
"metadata",
"=",
"$",
"this",
"->",
"dm",
"->",
"getClassMetadata",
"(",
"get_class",
"(",
"$",
"document",
")... | Hydrate array of MongoDB document data into the given document object.
@param object $document The document object to hydrate the data into.
@param array $data The array of document data.
@param array $hints Any hints to account for during reconstitution/lookup of the document.
@return array $values The array of hydr... | [
"Hydrate",
"array",
"of",
"MongoDB",
"document",
"data",
"into",
"the",
"given",
"document",
"object",
"."
] | 29e28bed9a265efd7d05473b0a909fb7c83f76e0 | https://github.com/Briareos/mongodb-odm/blob/29e28bed9a265efd7d05473b0a909fb7c83f76e0/lib/Doctrine/ODM/MongoDB/Hydrator/HydratorFactory.php#L403-L442 |
237,581 | lasallecrm/lasallecrm-l5-listmanagement-pkg | src/Helpers/Helpers.php | Helpers.isEmailAddressPrimaryType | public function isEmailAddressPrimaryType($emailID) {
// Must we accept "primary" email type only?
if (!Config::get('lasallecrmlistmanagement.listmgmt_emails_in_list_primary_type_only')) {
return false;
}
// "primary" type is #1
if ($this->getEmailType($emailID) != ... | php | public function isEmailAddressPrimaryType($emailID) {
// Must we accept "primary" email type only?
if (!Config::get('lasallecrmlistmanagement.listmgmt_emails_in_list_primary_type_only')) {
return false;
}
// "primary" type is #1
if ($this->getEmailType($emailID) != ... | [
"public",
"function",
"isEmailAddressPrimaryType",
"(",
"$",
"emailID",
")",
"{",
"// Must we accept \"primary\" email type only?",
"if",
"(",
"!",
"Config",
"::",
"get",
"(",
"'lasallecrmlistmanagement.listmgmt_emails_in_list_primary_type_only'",
")",
")",
"{",
"return",
"... | Is the email type "primary" AND must we accept "primary" type only?
Both conditions must be true to return true
@param int $emailID Emails db table's ID
@return bool | [
"Is",
"the",
"email",
"type",
"primary",
"AND",
"must",
"we",
"accept",
"primary",
"type",
"only?"
] | 4b5da1af5d25d5fb4be5199f3cf22da313d475f3 | https://github.com/lasallecrm/lasallecrm-l5-listmanagement-pkg/blob/4b5da1af5d25d5fb4be5199f3cf22da313d475f3/src/Helpers/Helpers.php#L103-L116 |
237,582 | faustbrian/binary | src/UnsignedInteger/Reader.php | Reader.bit16 | public static function bit16(string $data, int $offset = 0, $endianness = false): int
{
// big-endian
if (true === $endianness) {
return unpack('n', $data, $offset)[1];
}
// little-endian
if (false === $endianness) {
return unpack('v', $data, $offset)... | php | public static function bit16(string $data, int $offset = 0, $endianness = false): int
{
// big-endian
if (true === $endianness) {
return unpack('n', $data, $offset)[1];
}
// little-endian
if (false === $endianness) {
return unpack('v', $data, $offset)... | [
"public",
"static",
"function",
"bit16",
"(",
"string",
"$",
"data",
",",
"int",
"$",
"offset",
"=",
"0",
",",
"$",
"endianness",
"=",
"false",
")",
":",
"int",
"{",
"// big-endian",
"if",
"(",
"true",
"===",
"$",
"endianness",
")",
"{",
"return",
"u... | Read an unsigned 16 bit integer.
@param string $data
@param int $offset
@param mixed $endianness
@return int | [
"Read",
"an",
"unsigned",
"16",
"bit",
"integer",
"."
] | 7d845497460c2dabf7e369ec8e55baf989ef74cb | https://github.com/faustbrian/binary/blob/7d845497460c2dabf7e369ec8e55baf989ef74cb/src/UnsignedInteger/Reader.php#L45-L61 |
237,583 | faustbrian/binary | src/UnsignedInteger/Reader.php | Reader.bit64 | public static function bit64(string $data, int $offset = 0, bool $endianness = false): int
{
// big-endian
if (true === $endianness) {
return unpack('J', $data, $offset)[1];
}
// little-endian
if (false === $endianness) {
return unpack('P', $data, $of... | php | public static function bit64(string $data, int $offset = 0, bool $endianness = false): int
{
// big-endian
if (true === $endianness) {
return unpack('J', $data, $offset)[1];
}
// little-endian
if (false === $endianness) {
return unpack('P', $data, $of... | [
"public",
"static",
"function",
"bit64",
"(",
"string",
"$",
"data",
",",
"int",
"$",
"offset",
"=",
"0",
",",
"bool",
"$",
"endianness",
"=",
"false",
")",
":",
"int",
"{",
"// big-endian",
"if",
"(",
"true",
"===",
"$",
"endianness",
")",
"{",
"ret... | Read an unsigned 64 bit integer.
@param string $data
@param int $offset
@param mixed $endianness
@return int | [
"Read",
"an",
"unsigned",
"64",
"bit",
"integer",
"."
] | 7d845497460c2dabf7e369ec8e55baf989ef74cb | https://github.com/faustbrian/binary/blob/7d845497460c2dabf7e369ec8e55baf989ef74cb/src/UnsignedInteger/Reader.php#L99-L115 |
237,584 | samsonos/cms_app_materialtable | src/MaterialTableTable.php | MaterialTableTable.row | public function row(& $material, Pager & $pager = null, $module = NULL)
{
/** @var string $tdHTML Table cell HTML code */
$tdHTML = '';
$input = null;
/** @var \samson\cms\CMSField $field Field of current table structure (Table column) */
foreach ($this->fields as $field) {
... | php | public function row(& $material, Pager & $pager = null, $module = NULL)
{
/** @var string $tdHTML Table cell HTML code */
$tdHTML = '';
$input = null;
/** @var \samson\cms\CMSField $field Field of current table structure (Table column) */
foreach ($this->fields as $field) {
... | [
"public",
"function",
"row",
"(",
"&",
"$",
"material",
",",
"Pager",
"&",
"$",
"pager",
"=",
"null",
",",
"$",
"module",
"=",
"NULL",
")",
"{",
"/** @var string $tdHTML Table cell HTML code */",
"$",
"tdHTML",
"=",
"''",
";",
"$",
"input",
"=",
"null",
... | Function to view table row
@param \samson\activerecord\material $material Tale material represented as row
@param Pager $pager Pager for multi page table
@return string | [
"Function",
"to",
"view",
"table",
"row"
] | 550fb1916070b6cf8cbd4fa7d61a19ca9a2d090e | https://github.com/samsonos/cms_app_materialtable/blob/550fb1916070b6cf8cbd4fa7d61a19ca9a2d090e/src/MaterialTableTable.php#L143-L197 |
237,585 | jamiehannaford/php-opencloud-zf2 | src/Factory/AbstractProviderFactory.php | AbstractProviderFactory.extractAuthEndpoint | private function extractAuthEndpoint()
{
$auth = empty($this->config['auth_endpoint']) ? self::DEFAULT_AUTH_ENDPOINT : $this->config['auth_endpoint'];
switch ($auth) {
case Endpoint::UK:
$endpoint = Rackspace::UK_IDENTITY_ENDPOINT;
break;
case... | php | private function extractAuthEndpoint()
{
$auth = empty($this->config['auth_endpoint']) ? self::DEFAULT_AUTH_ENDPOINT : $this->config['auth_endpoint'];
switch ($auth) {
case Endpoint::UK:
$endpoint = Rackspace::UK_IDENTITY_ENDPOINT;
break;
case... | [
"private",
"function",
"extractAuthEndpoint",
"(",
")",
"{",
"$",
"auth",
"=",
"empty",
"(",
"$",
"this",
"->",
"config",
"[",
"'auth_endpoint'",
"]",
")",
"?",
"self",
"::",
"DEFAULT_AUTH_ENDPOINT",
":",
"$",
"this",
"->",
"config",
"[",
"'auth_endpoint'",
... | Searchs the configuration values provided and attempts to build a suitable URL for authentication.
@return \Guzzle\Http\Url | [
"Searchs",
"the",
"configuration",
"values",
"provided",
"and",
"attempts",
"to",
"build",
"a",
"suitable",
"URL",
"for",
"authentication",
"."
] | 74140adaffc0b46d7bbe1d7b3441c61f2cf6a656 | https://github.com/jamiehannaford/php-opencloud-zf2/blob/74140adaffc0b46d7bbe1d7b3441c61f2cf6a656/src/Factory/AbstractProviderFactory.php#L83-L100 |
237,586 | emaphp/eMapper | lib/eMapper/Cache/Key/CacheKeyFormatter.php | CacheKeyFormatter.getDefaultTypeHandler | protected function getDefaultTypeHandler($value) {
//get value type
$type = gettype($value);
switch ($type) {
case 'null':
return null;
case 'array':
//check empty array
if (count($value) == 0)
return null;
elseif (count($value) == 1) //get first value type hanlder
return $this->... | php | protected function getDefaultTypeHandler($value) {
//get value type
$type = gettype($value);
switch ($type) {
case 'null':
return null;
case 'array':
//check empty array
if (count($value) == 0)
return null;
elseif (count($value) == 1) //get first value type hanlder
return $this->... | [
"protected",
"function",
"getDefaultTypeHandler",
"(",
"$",
"value",
")",
"{",
"//get value type",
"$",
"type",
"=",
"gettype",
"(",
"$",
"value",
")",
";",
"switch",
"(",
"$",
"type",
")",
"{",
"case",
"'null'",
":",
"return",
"null",
";",
"case",
"'arr... | Obtains the default type handler for a given value
@param mixed $value
@throws \RuntimeException
@return NULL | TypeHandler | [
"Obtains",
"the",
"default",
"type",
"handler",
"for",
"a",
"given",
"value"
] | df7100e601d2a1363d07028a786b6ceb22271829 | https://github.com/emaphp/eMapper/blob/df7100e601d2a1363d07028a786b6ceb22271829/lib/eMapper/Cache/Key/CacheKeyFormatter.php#L66-L110 |
237,587 | emaphp/eMapper | lib/eMapper/Cache/Key/CacheKeyFormatter.php | CacheKeyFormatter.castArray | protected function castArray($value, TypeHandler $typeHandler, $join_string = ',') {
$list = [];
//build expression list
foreach ($value as $val) {
$val = $typeHandler->castParameter($val);
if (is_null($val))
$new_elem = 'NULL';
else {
$new_elem = $typeHandler->setParameter($val);
if (is_... | php | protected function castArray($value, TypeHandler $typeHandler, $join_string = ',') {
$list = [];
//build expression list
foreach ($value as $val) {
$val = $typeHandler->castParameter($val);
if (is_null($val))
$new_elem = 'NULL';
else {
$new_elem = $typeHandler->setParameter($val);
if (is_... | [
"protected",
"function",
"castArray",
"(",
"$",
"value",
",",
"TypeHandler",
"$",
"typeHandler",
",",
"$",
"join_string",
"=",
"','",
")",
"{",
"$",
"list",
"=",
"[",
"]",
";",
"//build expression list",
"foreach",
"(",
"$",
"value",
"as",
"$",
"val",
")... | Casts all elements in an array with the given type handler
@param array $value
@param TypeHandler $typeHandler
@param string $join_string
@return string | [
"Casts",
"all",
"elements",
"in",
"an",
"array",
"with",
"the",
"given",
"type",
"handler"
] | df7100e601d2a1363d07028a786b6ceb22271829 | https://github.com/emaphp/eMapper/blob/df7100e601d2a1363d07028a786b6ceb22271829/lib/eMapper/Cache/Key/CacheKeyFormatter.php#L119-L141 |
237,588 | emaphp/eMapper | lib/eMapper/Cache/Key/CacheKeyFormatter.php | CacheKeyFormatter.castParameter | protected function castParameter($value, $type = null) {
//check null value
if (is_null($value))
return 'NULL';
elseif (is_null($type)) {
//obtain default type handler
$typeHandler = $this->getDefaultTypeHandler($value);
if (is_null($typeHandler))
return 'NULL';
if (is_array($value))
return... | php | protected function castParameter($value, $type = null) {
//check null value
if (is_null($value))
return 'NULL';
elseif (is_null($type)) {
//obtain default type handler
$typeHandler = $this->getDefaultTypeHandler($value);
if (is_null($typeHandler))
return 'NULL';
if (is_array($value))
return... | [
"protected",
"function",
"castParameter",
"(",
"$",
"value",
",",
"$",
"type",
"=",
"null",
")",
"{",
"//check null value",
"if",
"(",
"is_null",
"(",
"$",
"value",
")",
")",
"return",
"'NULL'",
";",
"elseif",
"(",
"is_null",
"(",
"$",
"type",
")",
")"... | Casts a value to a given type
@param mixed $value
@param string $type
@return string
@throws \RuntimeException | [
"Casts",
"a",
"value",
"to",
"a",
"given",
"type"
] | df7100e601d2a1363d07028a786b6ceb22271829 | https://github.com/emaphp/eMapper/blob/df7100e601d2a1363d07028a786b6ceb22271829/lib/eMapper/Cache/Key/CacheKeyFormatter.php#L150-L188 |
237,589 | emaphp/eMapper | lib/eMapper/Cache/Key/CacheKeyFormatter.php | CacheKeyFormatter.replaceConfigExpression | protected function replaceConfigExpression($matches) {
$property = $matches[1];
//check key existence
if (!array_key_exists($property, $this->config))
return '';
//convert to string, if possible
if (($str = $this->toString($this->config[$property])) === false)
return '';
return $str;
} | php | protected function replaceConfigExpression($matches) {
$property = $matches[1];
//check key existence
if (!array_key_exists($property, $this->config))
return '';
//convert to string, if possible
if (($str = $this->toString($this->config[$property])) === false)
return '';
return $str;
} | [
"protected",
"function",
"replaceConfigExpression",
"(",
"$",
"matches",
")",
"{",
"$",
"property",
"=",
"$",
"matches",
"[",
"1",
"]",
";",
"//check key existence",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"property",
",",
"$",
"this",
"->",
"config",
... | Returns a string that replaces a configuration expression within a string
@param array $matches
@return string | [
"Returns",
"a",
"string",
"that",
"replaces",
"a",
"configuration",
"expression",
"within",
"a",
"string"
] | df7100e601d2a1363d07028a786b6ceb22271829 | https://github.com/emaphp/eMapper/blob/df7100e601d2a1363d07028a786b6ceb22271829/lib/eMapper/Cache/Key/CacheKeyFormatter.php#L360-L369 |
237,590 | emaphp/eMapper | lib/eMapper/Cache/Key/CacheKeyFormatter.php | CacheKeyFormatter.replacePropertyExpression | protected function replacePropertyExpression($matches) {
//count available matches
//this indicates the type of expression to replace
$total_matches = count($matches);
$type = $subindex = null;
switch ($total_matches) {
/*
* Property
*/
case 4: //#{PROPERTY@1[INDEX]@2?:TYPE@3}
$type = subs... | php | protected function replacePropertyExpression($matches) {
//count available matches
//this indicates the type of expression to replace
$total_matches = count($matches);
$type = $subindex = null;
switch ($total_matches) {
/*
* Property
*/
case 4: //#{PROPERTY@1[INDEX]@2?:TYPE@3}
$type = subs... | [
"protected",
"function",
"replacePropertyExpression",
"(",
"$",
"matches",
")",
"{",
"//count available matches",
"//this indicates the type of expression to replace",
"$",
"total_matches",
"=",
"count",
"(",
"$",
"matches",
")",
";",
"$",
"type",
"=",
"$",
"subindex",
... | Returns a string that replaces a property expression
@param array $matches
@return string | [
"Returns",
"a",
"string",
"that",
"replaces",
"a",
"property",
"expression"
] | df7100e601d2a1363d07028a786b6ceb22271829 | https://github.com/emaphp/eMapper/blob/df7100e601d2a1363d07028a786b6ceb22271829/lib/eMapper/Cache/Key/CacheKeyFormatter.php#L376-L423 |
237,591 | emaphp/eMapper | lib/eMapper/Cache/Key/CacheKeyFormatter.php | CacheKeyFormatter.replaceArgumentExpression | protected function replaceArgumentExpression($matches) {
//count available matches
//this indicates the type of expression to replace
$total_matches = count($matches);
$type = $subindex = null;
//%{TYPE|CLASS@1}
if ($total_matches == 2) {
//check if there are arguments left
if ($this->counter >= cou... | php | protected function replaceArgumentExpression($matches) {
//count available matches
//this indicates the type of expression to replace
$total_matches = count($matches);
$type = $subindex = null;
//%{TYPE|CLASS@1}
if ($total_matches == 2) {
//check if there are arguments left
if ($this->counter >= cou... | [
"protected",
"function",
"replaceArgumentExpression",
"(",
"$",
"matches",
")",
"{",
"//count available matches",
"//this indicates the type of expression to replace",
"$",
"total_matches",
"=",
"count",
"(",
"$",
"matches",
")",
";",
"$",
"type",
"=",
"$",
"subindex",
... | Returns a string that replaces an argument expression
@param array$matches
@throws \OutOfBoundsException
@throws \InvalidArgumentException
@return string | [
"Returns",
"a",
"string",
"that",
"replaces",
"an",
"argument",
"expression"
] | df7100e601d2a1363d07028a786b6ceb22271829 | https://github.com/emaphp/eMapper/blob/df7100e601d2a1363d07028a786b6ceb22271829/lib/eMapper/Cache/Key/CacheKeyFormatter.php#L432-L479 |
237,592 | novuso/system | src/Utility/Validate.php | Validate.isEmail | public static function isEmail($value): bool
{
if (!static::isStringCastable($value)) {
return false;
}
return filter_var((string) $value, FILTER_VALIDATE_EMAIL) !== false;
} | php | public static function isEmail($value): bool
{
if (!static::isStringCastable($value)) {
return false;
}
return filter_var((string) $value, FILTER_VALIDATE_EMAIL) !== false;
} | [
"public",
"static",
"function",
"isEmail",
"(",
"$",
"value",
")",
":",
"bool",
"{",
"if",
"(",
"!",
"static",
"::",
"isStringCastable",
"(",
"$",
"value",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"filter_var",
"(",
"(",
"string",
")",
"... | Checks if value is an email address
@param mixed $value The value
@return bool | [
"Checks",
"if",
"value",
"is",
"an",
"email",
"address"
] | e34038b391826edc68d0b5fccfba96642de9d6f0 | https://github.com/novuso/system/blob/e34038b391826edc68d0b5fccfba96642de9d6f0/src/Utility/Validate.php#L338-L345 |
237,593 | novuso/system | src/Utility/Validate.php | Validate.isIpAddress | public static function isIpAddress($value): bool
{
if (!static::isStringCastable($value)) {
return false;
}
return filter_var((string) $value, FILTER_VALIDATE_IP) !== false;
} | php | public static function isIpAddress($value): bool
{
if (!static::isStringCastable($value)) {
return false;
}
return filter_var((string) $value, FILTER_VALIDATE_IP) !== false;
} | [
"public",
"static",
"function",
"isIpAddress",
"(",
"$",
"value",
")",
":",
"bool",
"{",
"if",
"(",
"!",
"static",
"::",
"isStringCastable",
"(",
"$",
"value",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"filter_var",
"(",
"(",
"string",
")",... | Checks if value is an IP address
@param mixed $value The value
@return bool | [
"Checks",
"if",
"value",
"is",
"an",
"IP",
"address"
] | e34038b391826edc68d0b5fccfba96642de9d6f0 | https://github.com/novuso/system/blob/e34038b391826edc68d0b5fccfba96642de9d6f0/src/Utility/Validate.php#L354-L361 |
237,594 | novuso/system | src/Utility/Validate.php | Validate.isIpV4Address | public static function isIpV4Address($value): bool
{
if (!static::isStringCastable($value)) {
return false;
}
return filter_var((string) $value, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) !== false;
} | php | public static function isIpV4Address($value): bool
{
if (!static::isStringCastable($value)) {
return false;
}
return filter_var((string) $value, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) !== false;
} | [
"public",
"static",
"function",
"isIpV4Address",
"(",
"$",
"value",
")",
":",
"bool",
"{",
"if",
"(",
"!",
"static",
"::",
"isStringCastable",
"(",
"$",
"value",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"filter_var",
"(",
"(",
"string",
")... | Checks if value is an IPv4 address
@param mixed $value The value
@return bool | [
"Checks",
"if",
"value",
"is",
"an",
"IPv4",
"address"
] | e34038b391826edc68d0b5fccfba96642de9d6f0 | https://github.com/novuso/system/blob/e34038b391826edc68d0b5fccfba96642de9d6f0/src/Utility/Validate.php#L370-L377 |
237,595 | novuso/system | src/Utility/Validate.php | Validate.isIpV6Address | public static function isIpV6Address($value): bool
{
if (!static::isStringCastable($value)) {
return false;
}
return filter_var((string) $value, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) !== false;
} | php | public static function isIpV6Address($value): bool
{
if (!static::isStringCastable($value)) {
return false;
}
return filter_var((string) $value, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) !== false;
} | [
"public",
"static",
"function",
"isIpV6Address",
"(",
"$",
"value",
")",
":",
"bool",
"{",
"if",
"(",
"!",
"static",
"::",
"isStringCastable",
"(",
"$",
"value",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"filter_var",
"(",
"(",
"string",
")... | Checks if value is an IPv6 address
@param mixed $value The value
@return bool | [
"Checks",
"if",
"value",
"is",
"an",
"IPv6",
"address"
] | e34038b391826edc68d0b5fccfba96642de9d6f0 | https://github.com/novuso/system/blob/e34038b391826edc68d0b5fccfba96642de9d6f0/src/Utility/Validate.php#L386-L393 |
237,596 | novuso/system | src/Utility/Validate.php | Validate.isUri | public static function isUri($value): bool
{
if (!static::isStringCastable($value)) {
return false;
}
// http://tools.ietf.org/html/rfc3986
//
// URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
// hier-part = "//" authority path-abempt... | php | public static function isUri($value): bool
{
if (!static::isStringCastable($value)) {
return false;
}
// http://tools.ietf.org/html/rfc3986
//
// URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
// hier-part = "//" authority path-abempt... | [
"public",
"static",
"function",
"isUri",
"(",
"$",
"value",
")",
":",
"bool",
"{",
"if",
"(",
"!",
"static",
"::",
"isStringCastable",
"(",
"$",
"value",
")",
")",
"{",
"return",
"false",
";",
"}",
"// http://tools.ietf.org/html/rfc3986",
"//",
"// URI ... | Checks if value is a URI
@param mixed $value The value
@return bool | [
"Checks",
"if",
"value",
"is",
"a",
"URI"
] | e34038b391826edc68d0b5fccfba96642de9d6f0 | https://github.com/novuso/system/blob/e34038b391826edc68d0b5fccfba96642de9d6f0/src/Utility/Validate.php#L402-L428 |
237,597 | novuso/system | src/Utility/Validate.php | Validate.isUrn | public static function isUrn($value): bool
{
if (!static::isStringCastable($value)) {
return false;
}
// http://tools.ietf.org/html/rfc2141#section-2.1
// To avoid confusion with the "urn:" identifier, the NID "urn" is
// reserved and MUST NOT be used
if ... | php | public static function isUrn($value): bool
{
if (!static::isStringCastable($value)) {
return false;
}
// http://tools.ietf.org/html/rfc2141#section-2.1
// To avoid confusion with the "urn:" identifier, the NID "urn" is
// reserved and MUST NOT be used
if ... | [
"public",
"static",
"function",
"isUrn",
"(",
"$",
"value",
")",
":",
"bool",
"{",
"if",
"(",
"!",
"static",
"::",
"isStringCastable",
"(",
"$",
"value",
")",
")",
"{",
"return",
"false",
";",
"}",
"// http://tools.ietf.org/html/rfc2141#section-2.1",
"// To av... | Checks if value is a URN
@param mixed $value The value
@return bool | [
"Checks",
"if",
"value",
"is",
"a",
"URN"
] | e34038b391826edc68d0b5fccfba96642de9d6f0 | https://github.com/novuso/system/blob/e34038b391826edc68d0b5fccfba96642de9d6f0/src/Utility/Validate.php#L437-L490 |
237,598 | novuso/system | src/Utility/Validate.php | Validate.isUuid | public static function isUuid($value): bool
{
if (!static::isStringCastable($value)) {
return false;
}
// http://tools.ietf.org/html/rfc4122
//
// UUID = time-low "-" time-mid "-"
// time-high-and-version "-"
... | php | public static function isUuid($value): bool
{
if (!static::isStringCastable($value)) {
return false;
}
// http://tools.ietf.org/html/rfc4122
//
// UUID = time-low "-" time-mid "-"
// time-high-and-version "-"
... | [
"public",
"static",
"function",
"isUuid",
"(",
"$",
"value",
")",
":",
"bool",
"{",
"if",
"(",
"!",
"static",
"::",
"isStringCastable",
"(",
"$",
"value",
")",
")",
"{",
"return",
"false",
";",
"}",
"// http://tools.ietf.org/html/rfc4122",
"//",
"// UUID ... | Checks if value is a UUID
@param mixed $value The value
@return bool | [
"Checks",
"if",
"value",
"is",
"a",
"UUID"
] | e34038b391826edc68d0b5fccfba96642de9d6f0 | https://github.com/novuso/system/blob/e34038b391826edc68d0b5fccfba96642de9d6f0/src/Utility/Validate.php#L499-L535 |
237,599 | novuso/system | src/Utility/Validate.php | Validate.isTimezone | public static function isTimezone($value): bool
{
if ($value instanceof DateTimeZone) {
return true;
}
if (!static::isStringCastable($value)) {
return false;
}
return self::isValidTimezone((string) $value);
} | php | public static function isTimezone($value): bool
{
if ($value instanceof DateTimeZone) {
return true;
}
if (!static::isStringCastable($value)) {
return false;
}
return self::isValidTimezone((string) $value);
} | [
"public",
"static",
"function",
"isTimezone",
"(",
"$",
"value",
")",
":",
"bool",
"{",
"if",
"(",
"$",
"value",
"instanceof",
"DateTimeZone",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"!",
"static",
"::",
"isStringCastable",
"(",
"$",
"value",
... | Checks if value is a timezone
@param mixed $value The value
@return bool | [
"Checks",
"if",
"value",
"is",
"a",
"timezone"
] | e34038b391826edc68d0b5fccfba96642de9d6f0 | https://github.com/novuso/system/blob/e34038b391826edc68d0b5fccfba96642de9d6f0/src/Utility/Validate.php#L544-L555 |
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.