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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
235,700 | tacowordpress/util | src/Util/Collection.php | Collection.uniq | public static function uniq($collection = null, $is_sorted = null, $iterator = null)
{
$return = array();
if (count($collection) === 0) {
return $return;
}
$calculated = array();
foreach ($collection as $item) {
$val = (!is_null($iterator)) ? ... | php | public static function uniq($collection = null, $is_sorted = null, $iterator = null)
{
$return = array();
if (count($collection) === 0) {
return $return;
}
$calculated = array();
foreach ($collection as $item) {
$val = (!is_null($iterator)) ? ... | [
"public",
"static",
"function",
"uniq",
"(",
"$",
"collection",
"=",
"null",
",",
"$",
"is_sorted",
"=",
"null",
",",
"$",
"iterator",
"=",
"null",
")",
"{",
"$",
"return",
"=",
"array",
"(",
")",
";",
"if",
"(",
"count",
"(",
"$",
"collection",
")... | Return an array of the unique values | [
"Return",
"an",
"array",
"of",
"the",
"unique",
"values"
] | a27f6f1c3f96a908c7480f359fd44028e89f26c3 | https://github.com/tacowordpress/util/blob/a27f6f1c3f96a908c7480f359fd44028e89f26c3/src/Util/Collection.php#L64-L81 |
235,701 | tacowordpress/util | src/Util/Collection.php | Collection.first | public static function first($collection = null, $n = null)
{
if ($n === 0) {
return array();
}
if (is_null($n)) {
return current(array_splice($collection, 0, 1, true));
}
return array_splice($collection, 0, $n, true);
} | php | public static function first($collection = null, $n = null)
{
if ($n === 0) {
return array();
}
if (is_null($n)) {
return current(array_splice($collection, 0, 1, true));
}
return array_splice($collection, 0, $n, true);
} | [
"public",
"static",
"function",
"first",
"(",
"$",
"collection",
"=",
"null",
",",
"$",
"n",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"n",
"===",
"0",
")",
"{",
"return",
"array",
"(",
")",
";",
"}",
"if",
"(",
"is_null",
"(",
"$",
"n",
")",
")... | Get the first element of an array. Passing n returns the first n elements. | [
"Get",
"the",
"first",
"element",
"of",
"an",
"array",
".",
"Passing",
"n",
"returns",
"the",
"first",
"n",
"elements",
"."
] | a27f6f1c3f96a908c7480f359fd44028e89f26c3 | https://github.com/tacowordpress/util/blob/a27f6f1c3f96a908c7480f359fd44028e89f26c3/src/Util/Collection.php#L84-L93 |
235,702 | tacowordpress/util | src/Util/Collection.php | Collection.rest | public static function rest($collection = null, $index = null)
{
if (is_null($index)) {
$index = 1;
}
return array_splice($collection, $index);
} | php | public static function rest($collection = null, $index = null)
{
if (is_null($index)) {
$index = 1;
}
return array_splice($collection, $index);
} | [
"public",
"static",
"function",
"rest",
"(",
"$",
"collection",
"=",
"null",
",",
"$",
"index",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"index",
")",
")",
"{",
"$",
"index",
"=",
"1",
";",
"}",
"return",
"array_splice",
"(",
"$",
"... | Get the rest of the array elements. Passing n returns from that index onward. | [
"Get",
"the",
"rest",
"of",
"the",
"array",
"elements",
".",
"Passing",
"n",
"returns",
"from",
"that",
"index",
"onward",
"."
] | a27f6f1c3f96a908c7480f359fd44028e89f26c3 | https://github.com/tacowordpress/util/blob/a27f6f1c3f96a908c7480f359fd44028e89f26c3/src/Util/Collection.php#L109-L115 |
235,703 | tacowordpress/util | src/Util/Collection.php | Collection.filter | public function filter($collection = null, $iterator = null)
{
$return = array();
foreach ($collection as $val) {
if (call_user_func($iterator, $val)) {
$return[] = $val;
}
}
return $return;
} | php | public function filter($collection = null, $iterator = null)
{
$return = array();
foreach ($collection as $val) {
if (call_user_func($iterator, $val)) {
$return[] = $val;
}
}
return $return;
} | [
"public",
"function",
"filter",
"(",
"$",
"collection",
"=",
"null",
",",
"$",
"iterator",
"=",
"null",
")",
"{",
"$",
"return",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"collection",
"as",
"$",
"val",
")",
"{",
"if",
"(",
"call_user_func",
... | Return an array of values that pass the truth iterator test | [
"Return",
"an",
"array",
"of",
"values",
"that",
"pass",
"the",
"truth",
"iterator",
"test"
] | a27f6f1c3f96a908c7480f359fd44028e89f26c3 | https://github.com/tacowordpress/util/blob/a27f6f1c3f96a908c7480f359fd44028e89f26c3/src/Util/Collection.php#L118-L127 |
235,704 | loopsframework/base | src/Loops/Misc.php | Misc.getRelativePath | public static function getRelativePath($frompath, $topath = "")
{
if(empty($topath)) {
$topath = $frompath;
$frompath = getcwd();
}
if($frompath == ".") $frompath = getcwd();
if($topath == ".") $topath = getcwd();
if($frompath[0] != DIRECTORY_SEPARAT... | php | public static function getRelativePath($frompath, $topath = "")
{
if(empty($topath)) {
$topath = $frompath;
$frompath = getcwd();
}
if($frompath == ".") $frompath = getcwd();
if($topath == ".") $topath = getcwd();
if($frompath[0] != DIRECTORY_SEPARAT... | [
"public",
"static",
"function",
"getRelativePath",
"(",
"$",
"frompath",
",",
"$",
"topath",
"=",
"\"\"",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"topath",
")",
")",
"{",
"$",
"topath",
"=",
"$",
"frompath",
";",
"$",
"frompath",
"=",
"getcwd",
"(",
... | Get the relative path between 2 folders.
@var string $frompath The path from which the relative path should be computed.
@var string $topath The target path. If empty or not specified the current working directory will be used.
@return string The relative path. "$frompath$result" will resolve to $topath | [
"Get",
"the",
"relative",
"path",
"between",
"2",
"folders",
"."
] | 5a15172ed4e543d7d5ecd8bd65e31f26bab3d192 | https://github.com/loopsframework/base/blob/5a15172ed4e543d7d5ecd8bd65e31f26bab3d192/src/Loops/Misc.php#L44-L85 |
235,705 | loopsframework/base | src/Loops/Misc.php | Misc.readPartialFile | public static function readPartialFile($file, $from = 0, $to = 0, $filesize = FALSE, $force = FALSE, $context = NULL) {
if(!$force) {
if(!@file_exists($file)) {
return 404;
}
if(!@is_readable($file)) {
return 403;
}
}
... | php | public static function readPartialFile($file, $from = 0, $to = 0, $filesize = FALSE, $force = FALSE, $context = NULL) {
if(!$force) {
if(!@file_exists($file)) {
return 404;
}
if(!@is_readable($file)) {
return 403;
}
}
... | [
"public",
"static",
"function",
"readPartialFile",
"(",
"$",
"file",
",",
"$",
"from",
"=",
"0",
",",
"$",
"to",
"=",
"0",
",",
"$",
"filesize",
"=",
"FALSE",
",",
"$",
"force",
"=",
"FALSE",
",",
"$",
"context",
"=",
"NULL",
")",
"{",
"if",
"(",... | Like PHPs readfile, but the range of the output can be specified
<code>
use Loops\Misc;
Misc::readpartialfile("example.png", 500, 1000);
</code>
Instead of integer ranges an array containing a Content-Range header can be passed.
The values found in this header will be used to output the partial file, making it
possib... | [
"Like",
"PHPs",
"readfile",
"but",
"the",
"range",
"of",
"the",
"output",
"can",
"be",
"specified"
] | 5a15172ed4e543d7d5ecd8bd65e31f26bab3d192 | https://github.com/loopsframework/base/blob/5a15172ed4e543d7d5ecd8bd65e31f26bab3d192/src/Loops/Misc.php#L383-L435 |
235,706 | loopsframework/base | src/Loops/Misc.php | Misc.flattenArray | public static function flattenArray($array, $delimiter = '.', $prefix = '') {
if(!is_array($array)) {
return $array;
}
$result = array();
foreach($array as $key => $value) {
if(is_array($value)) {
$result = array_merge($result, self::flattenArray... | php | public static function flattenArray($array, $delimiter = '.', $prefix = '') {
if(!is_array($array)) {
return $array;
}
$result = array();
foreach($array as $key => $value) {
if(is_array($value)) {
$result = array_merge($result, self::flattenArray... | [
"public",
"static",
"function",
"flattenArray",
"(",
"$",
"array",
",",
"$",
"delimiter",
"=",
"'.'",
",",
"$",
"prefix",
"=",
"''",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"array",
")",
")",
"{",
"return",
"$",
"array",
";",
"}",
"$",
"r... | Flattens an array, preserving keys delimited by a delimiter
@param array $array The array that will be flattened
@param string $delimiter The used delimiter.
@param string $prefix Will be added in front of every key
@return array<mixed> The resulting array | [
"Flattens",
"an",
"array",
"preserving",
"keys",
"delimited",
"by",
"a",
"delimiter"
] | 5a15172ed4e543d7d5ecd8bd65e31f26bab3d192 | https://github.com/loopsframework/base/blob/5a15172ed4e543d7d5ecd8bd65e31f26bab3d192/src/Loops/Misc.php#L445-L462 |
235,707 | loopsframework/base | src/Loops/Misc.php | Misc.unflattenArray | public static function unflattenArray($array, $delimiter = '.') {
if(!is_array($array)) {
return $array;
}
$add = array();
foreach($array as $key => $value) {
if(strpos($key, $delimiter) === FALSE) {
continue;
}
$add[] = ... | php | public static function unflattenArray($array, $delimiter = '.') {
if(!is_array($array)) {
return $array;
}
$add = array();
foreach($array as $key => $value) {
if(strpos($key, $delimiter) === FALSE) {
continue;
}
$add[] = ... | [
"public",
"static",
"function",
"unflattenArray",
"(",
"$",
"array",
",",
"$",
"delimiter",
"=",
"'.'",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"array",
")",
")",
"{",
"return",
"$",
"array",
";",
"}",
"$",
"add",
"=",
"array",
"(",
")",
... | Unflattens an array by a delimiter.
This is particulary useful to pass complex structures via get/post requests from
forms.
Note: Using a json string should also be considered as an alternative.
<code>
use Loops\Misc;
$flatarray = array(
'a' => 1,
'b.a' => 2,
'b.b' => 3
);
Misc::unflattenArray($flatarray);
... | [
"Unflattens",
"an",
"array",
"by",
"a",
"delimiter",
"."
] | 5a15172ed4e543d7d5ecd8bd65e31f26bab3d192 | https://github.com/loopsframework/base/blob/5a15172ed4e543d7d5ecd8bd65e31f26bab3d192/src/Loops/Misc.php#L495-L531 |
235,708 | loopsframework/base | src/Loops/Misc.php | Misc.redirect | public static function redirect($target, $status_code = 302, $loops = NULL) {
if(!$loops) {
$loops = Loops::getCurrentLoops();
}
$config = $loops->getService("config");
$request = $loops->getService("request");
$response = $loops->getService("response");
$... | php | public static function redirect($target, $status_code = 302, $loops = NULL) {
if(!$loops) {
$loops = Loops::getCurrentLoops();
}
$config = $loops->getService("config");
$request = $loops->getService("request");
$response = $loops->getService("response");
$... | [
"public",
"static",
"function",
"redirect",
"(",
"$",
"target",
",",
"$",
"status_code",
"=",
"302",
",",
"$",
"loops",
"=",
"NULL",
")",
"{",
"if",
"(",
"!",
"$",
"loops",
")",
"{",
"$",
"loops",
"=",
"Loops",
"::",
"getCurrentLoops",
"(",
")",
";... | Sets up redirect headers in the response
This function returns the desired http status code and thus can be conveniently use.
If a loops element is passed, the page path of that element will be used for redirection.
<code>
use Loops\Misc;
...
public function action($parameter) {
return Misc::redirect("http://www.exam... | [
"Sets",
"up",
"redirect",
"headers",
"in",
"the",
"response"
] | 5a15172ed4e543d7d5ecd8bd65e31f26bab3d192 | https://github.com/loopsframework/base/blob/5a15172ed4e543d7d5ecd8bd65e31f26bab3d192/src/Loops/Misc.php#L560-L581 |
235,709 | loopsframework/base | src/Loops/Misc.php | Misc.recursiveUnlink | public static function recursiveUnlink($dir) {
$result = TRUE;
if(is_dir($dir)) {
foreach(scandir($dir) as $sub) {
if(in_array($sub, ['.', '..'])) continue;
$result &= self::recursiveUnlink("$dir/$sub");
}
$result &= rmdir($dir);
... | php | public static function recursiveUnlink($dir) {
$result = TRUE;
if(is_dir($dir)) {
foreach(scandir($dir) as $sub) {
if(in_array($sub, ['.', '..'])) continue;
$result &= self::recursiveUnlink("$dir/$sub");
}
$result &= rmdir($dir);
... | [
"public",
"static",
"function",
"recursiveUnlink",
"(",
"$",
"dir",
")",
"{",
"$",
"result",
"=",
"TRUE",
";",
"if",
"(",
"is_dir",
"(",
"$",
"dir",
")",
")",
"{",
"foreach",
"(",
"scandir",
"(",
"$",
"dir",
")",
"as",
"$",
"sub",
")",
"{",
"if",... | Recursively unlinks a directory
@param string $dir The target directory that will be removed
@param bool TRUE on success or FALSE on failure | [
"Recursively",
"unlinks",
"a",
"directory"
] | 5a15172ed4e543d7d5ecd8bd65e31f26bab3d192 | https://github.com/loopsframework/base/blob/5a15172ed4e543d7d5ecd8bd65e31f26bab3d192/src/Loops/Misc.php#L694-L713 |
235,710 | loopsframework/base | src/Loops/Misc.php | Misc.recursiveMkdir | public static function recursiveMkdir($pathname, $mode = 0777, $recursive = TRUE, $context = NULL) {
if(is_dir($pathname)) {
return TRUE;
}
if($context) {
return mkdir($pathname, $mode, $recursive, $context);
}
else {
return mkdir($pathname, $... | php | public static function recursiveMkdir($pathname, $mode = 0777, $recursive = TRUE, $context = NULL) {
if(is_dir($pathname)) {
return TRUE;
}
if($context) {
return mkdir($pathname, $mode, $recursive, $context);
}
else {
return mkdir($pathname, $... | [
"public",
"static",
"function",
"recursiveMkdir",
"(",
"$",
"pathname",
",",
"$",
"mode",
"=",
"0777",
",",
"$",
"recursive",
"=",
"TRUE",
",",
"$",
"context",
"=",
"NULL",
")",
"{",
"if",
"(",
"is_dir",
"(",
"$",
"pathname",
")",
")",
"{",
"return",... | Recursively created a directory
Like PHPs mkdir but this method will set the recursive flag to TRUE on default
@param string $pathname The directory that should be created
@param integer $mode Permission that the directories are created with
@param string $recursive Set to TRUE on default
@param mixed $context The co... | [
"Recursively",
"created",
"a",
"directory"
] | 5a15172ed4e543d7d5ecd8bd65e31f26bab3d192 | https://github.com/loopsframework/base/blob/5a15172ed4e543d7d5ecd8bd65e31f26bab3d192/src/Loops/Misc.php#L726-L737 |
235,711 | loopsframework/base | src/Loops/Misc.php | Misc.reflectionInstance | public static function reflectionInstance($classname, $arguments = [], $set_remaining = FALSE, $set_include = FALSE, $set_exclude = FALSE) {
$reflection = new ReflectionClass($classname);
if(!$constructor = $reflection->getConstructor()) {
return new $classname;
}
$args = se... | php | public static function reflectionInstance($classname, $arguments = [], $set_remaining = FALSE, $set_include = FALSE, $set_exclude = FALSE) {
$reflection = new ReflectionClass($classname);
if(!$constructor = $reflection->getConstructor()) {
return new $classname;
}
$args = se... | [
"public",
"static",
"function",
"reflectionInstance",
"(",
"$",
"classname",
",",
"$",
"arguments",
"=",
"[",
"]",
",",
"$",
"set_remaining",
"=",
"FALSE",
",",
"$",
"set_include",
"=",
"FALSE",
",",
"$",
"set_exclude",
"=",
"FALSE",
")",
"{",
"$",
"refl... | Invokes constructors by assembling arguments from an array with the help of the reflection API.
The array values will be passed to the constructor based on the argument names of the constructor signature.
Numeric keys can also be used to specify arguments. A number denotes the n-th argument of the constructor.
This is... | [
"Invokes",
"constructors",
"by",
"assembling",
"arguments",
"from",
"an",
"array",
"with",
"the",
"help",
"of",
"the",
"reflection",
"API",
"."
] | 5a15172ed4e543d7d5ecd8bd65e31f26bab3d192 | https://github.com/loopsframework/base/blob/5a15172ed4e543d7d5ecd8bd65e31f26bab3d192/src/Loops/Misc.php#L800-L834 |
235,712 | loopsframework/base | src/Loops/Misc.php | Misc.reflectionFunction | public static function reflectionFunction($function, $arguments = []) {
$method = is_array($function);
if($method) {
$reflection = new ReflectionMethod($function[0], $function[1]);
}
else {
$reflection = new ReflectionFunction($function);
}
$args... | php | public static function reflectionFunction($function, $arguments = []) {
$method = is_array($function);
if($method) {
$reflection = new ReflectionMethod($function[0], $function[1]);
}
else {
$reflection = new ReflectionFunction($function);
}
$args... | [
"public",
"static",
"function",
"reflectionFunction",
"(",
"$",
"function",
",",
"$",
"arguments",
"=",
"[",
"]",
")",
"{",
"$",
"method",
"=",
"is_array",
"(",
"$",
"function",
")",
";",
"if",
"(",
"$",
"method",
")",
"{",
"$",
"reflection",
"=",
"n... | Invokes functions by assembling arguments from an array with the help of the reflection API.
@todo Better doc here - refer to getReflectionArgs | [
"Invokes",
"functions",
"by",
"assembling",
"arguments",
"from",
"an",
"array",
"with",
"the",
"help",
"of",
"the",
"reflection",
"API",
"."
] | 5a15172ed4e543d7d5ecd8bd65e31f26bab3d192 | https://github.com/loopsframework/base/blob/5a15172ed4e543d7d5ecd8bd65e31f26bab3d192/src/Loops/Misc.php#L842-L865 |
235,713 | loopsframework/base | src/Loops/Misc.php | Misc.lastChange | public static function lastChange($dirs, Cache $cache = NULL, &$cache_key = "") {
$files = call_user_func_array("array_merge", array_map(function($dir) {
if(!is_dir($dir)) return [];
return iterator_to_array(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir)));
},... | php | public static function lastChange($dirs, Cache $cache = NULL, &$cache_key = "") {
$files = call_user_func_array("array_merge", array_map(function($dir) {
if(!is_dir($dir)) return [];
return iterator_to_array(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir)));
},... | [
"public",
"static",
"function",
"lastChange",
"(",
"$",
"dirs",
",",
"Cache",
"$",
"cache",
"=",
"NULL",
",",
"&",
"$",
"cache_key",
"=",
"\"\"",
")",
"{",
"$",
"files",
"=",
"call_user_func_array",
"(",
"\"array_merge\"",
",",
"array_map",
"(",
"function"... | Finds the lastest change in a directory since the last call, if there were any.
To implement this feature across requests, the last change time is stored into a Doctrine\Common\Cache\Cache.
@params array<string>|string $dirs A single directories or an array of multiple directories that are going to be checked for cha... | [
"Finds",
"the",
"lastest",
"change",
"in",
"a",
"directory",
"since",
"the",
"last",
"call",
"if",
"there",
"were",
"any",
"."
] | 5a15172ed4e543d7d5ecd8bd65e31f26bab3d192 | https://github.com/loopsframework/base/blob/5a15172ed4e543d7d5ecd8bd65e31f26bab3d192/src/Loops/Misc.php#L906-L942 |
235,714 | loopsframework/base | src/Loops/Misc.php | Misc.fullPath | public static function fullPath($path, $cwd = NULL, $allow_parent = FALSE) {
//unix style full paths
if(substr($path, 0, 1) == DIRECTORY_SEPARATOR) {
return $path;
}
//windows style full paths
if(substr($path, 1, 2) == ":\\") {
return $path;
}
... | php | public static function fullPath($path, $cwd = NULL, $allow_parent = FALSE) {
//unix style full paths
if(substr($path, 0, 1) == DIRECTORY_SEPARATOR) {
return $path;
}
//windows style full paths
if(substr($path, 1, 2) == ":\\") {
return $path;
}
... | [
"public",
"static",
"function",
"fullPath",
"(",
"$",
"path",
",",
"$",
"cwd",
"=",
"NULL",
",",
"$",
"allow_parent",
"=",
"FALSE",
")",
"{",
"//unix style full paths",
"if",
"(",
"substr",
"(",
"$",
"path",
",",
"0",
",",
"1",
")",
"==",
"DIRECTORY_SE... | Gets the full path from relative paths
This function will leave already full paths as they are.
Parent paths in $path are allowed if $allow_parent is set to true. Otherwise an exception is thrown.
If an impossible parent path was passed, an exception will also be thrown.
@param string $path The input path
@param stri... | [
"Gets",
"the",
"full",
"path",
"from",
"relative",
"paths"
] | 5a15172ed4e543d7d5ecd8bd65e31f26bab3d192 | https://github.com/loopsframework/base/blob/5a15172ed4e543d7d5ecd8bd65e31f26bab3d192/src/Loops/Misc.php#L1032-L1086 |
235,715 | ionutmilica/ionix-framework | src/Foundation/App.php | App.init | public function init()
{
self::$app = $this;
spl_autoload_register(array($this['loader'], 'load'));
$this->registerProviders();
$this->registerAliases();
} | php | public function init()
{
self::$app = $this;
spl_autoload_register(array($this['loader'], 'load'));
$this->registerProviders();
$this->registerAliases();
} | [
"public",
"function",
"init",
"(",
")",
"{",
"self",
"::",
"$",
"app",
"=",
"$",
"this",
";",
"spl_autoload_register",
"(",
"array",
"(",
"$",
"this",
"[",
"'loader'",
"]",
",",
"'load'",
")",
")",
";",
"$",
"this",
"->",
"registerProviders",
"(",
")... | Register the auto-loader | [
"Register",
"the",
"auto",
"-",
"loader"
] | a0363667ff677f1772bdd9ac9530a9f4710f9321 | https://github.com/ionutmilica/ionix-framework/blob/a0363667ff677f1772bdd9ac9530a9f4710f9321/src/Foundation/App.php#L38-L46 |
235,716 | ionutmilica/ionix-framework | src/Foundation/App.php | App.registerProviders | public function registerProviders()
{
$providers = $this['config']->get('app.providers');
foreach ($providers as $provider) {
$this->providers[$provider] = new $provider($this);
$this->providers[$provider]->register();
}
} | php | public function registerProviders()
{
$providers = $this['config']->get('app.providers');
foreach ($providers as $provider) {
$this->providers[$provider] = new $provider($this);
$this->providers[$provider]->register();
}
} | [
"public",
"function",
"registerProviders",
"(",
")",
"{",
"$",
"providers",
"=",
"$",
"this",
"[",
"'config'",
"]",
"->",
"get",
"(",
"'app.providers'",
")",
";",
"foreach",
"(",
"$",
"providers",
"as",
"$",
"provider",
")",
"{",
"$",
"this",
"->",
"pr... | Register all the providers | [
"Register",
"all",
"the",
"providers"
] | a0363667ff677f1772bdd9ac9530a9f4710f9321 | https://github.com/ionutmilica/ionix-framework/blob/a0363667ff677f1772bdd9ac9530a9f4710f9321/src/Foundation/App.php#L63-L71 |
235,717 | ionutmilica/ionix-framework | src/Foundation/App.php | App.initDefaultClasses | private function initDefaultClasses()
{
$this['loader'] = $this->share(function ($app) {
return new ClassLoader();
});
$this['config'] = $this->share(function ($app) {
$config = new Config();
$config->addHint($app['path.root'] . '/resources/config/');
return $config;
});
$this->instance('app', ... | php | private function initDefaultClasses()
{
$this['loader'] = $this->share(function ($app) {
return new ClassLoader();
});
$this['config'] = $this->share(function ($app) {
$config = new Config();
$config->addHint($app['path.root'] . '/resources/config/');
return $config;
});
$this->instance('app', ... | [
"private",
"function",
"initDefaultClasses",
"(",
")",
"{",
"$",
"this",
"[",
"'loader'",
"]",
"=",
"$",
"this",
"->",
"share",
"(",
"function",
"(",
"$",
"app",
")",
"{",
"return",
"new",
"ClassLoader",
"(",
")",
";",
"}",
")",
";",
"$",
"this",
"... | Init default classes used by the application | [
"Init",
"default",
"classes",
"used",
"by",
"the",
"application"
] | a0363667ff677f1772bdd9ac9530a9f4710f9321 | https://github.com/ionutmilica/ionix-framework/blob/a0363667ff677f1772bdd9ac9530a9f4710f9321/src/Foundation/App.php#L105-L118 |
235,718 | emaphp/eMapper | lib/eMapper/Reflection/ClassProfile.php | ClassProfile.isDynamicAttribute | protected function isDynamicAttribute(AnnotationBag $propertyAnnotations) {
return $propertyAnnotations->has('Query') ||
$propertyAnnotations->has('Statement') ||
$propertyAnnotations->has('Procedure') ||
$propertyAnnotations->has('Eval');
} | php | protected function isDynamicAttribute(AnnotationBag $propertyAnnotations) {
return $propertyAnnotations->has('Query') ||
$propertyAnnotations->has('Statement') ||
$propertyAnnotations->has('Procedure') ||
$propertyAnnotations->has('Eval');
} | [
"protected",
"function",
"isDynamicAttribute",
"(",
"AnnotationBag",
"$",
"propertyAnnotations",
")",
"{",
"return",
"$",
"propertyAnnotations",
"->",
"has",
"(",
"'Query'",
")",
"||",
"$",
"propertyAnnotations",
"->",
"has",
"(",
"'Statement'",
")",
"||",
"$",
... | Determines if a given property is a dyamic attribute
@param \Omocha\AnnotationBag $propertyAnnotations
@return boolean | [
"Determines",
"if",
"a",
"given",
"property",
"is",
"a",
"dyamic",
"attribute"
] | df7100e601d2a1363d07028a786b6ceb22271829 | https://github.com/emaphp/eMapper/blob/df7100e601d2a1363d07028a786b6ceb22271829/lib/eMapper/Reflection/ClassProfile.php#L110-L115 |
235,719 | emaphp/eMapper | lib/eMapper/Reflection/ClassProfile.php | ClassProfile.parseDynamicAttribute | protected function parseDynamicAttribute($propertyName, \ReflectionProperty $reflectionProperty, AnnotationBag $propertyAnnotations) {
if ($propertyAnnotations->has('Query'))
$attribute = new Query($propertyName, $reflectionProperty, $propertyAnnotations);
elseif ($propertyAnnotations->has('Statement'))
$attr... | php | protected function parseDynamicAttribute($propertyName, \ReflectionProperty $reflectionProperty, AnnotationBag $propertyAnnotations) {
if ($propertyAnnotations->has('Query'))
$attribute = new Query($propertyName, $reflectionProperty, $propertyAnnotations);
elseif ($propertyAnnotations->has('Statement'))
$attr... | [
"protected",
"function",
"parseDynamicAttribute",
"(",
"$",
"propertyName",
",",
"\\",
"ReflectionProperty",
"$",
"reflectionProperty",
",",
"AnnotationBag",
"$",
"propertyAnnotations",
")",
"{",
"if",
"(",
"$",
"propertyAnnotations",
"->",
"has",
"(",
"'Query'",
")... | Parses a dynamic attribute
@param string$propertyName
@param \ReflectionProperty $reflectionProperty
@param \Omocha\AnnotationBag $propertyAnnotations | [
"Parses",
"a",
"dynamic",
"attribute"
] | df7100e601d2a1363d07028a786b6ceb22271829 | https://github.com/emaphp/eMapper/blob/df7100e601d2a1363d07028a786b6ceb22271829/lib/eMapper/Reflection/ClassProfile.php#L123-L137 |
235,720 | emaphp/eMapper | lib/eMapper/Reflection/ClassProfile.php | ClassProfile.isAssociation | protected function isAssociation(AnnotationBag $propertyAnnotations) {
return $propertyAnnotations->has('OneToOne') ||
$propertyAnnotations->has('OneToMany') ||
$propertyAnnotations->has('ManyToOne') ||
$propertyAnnotations->has('ManyToMany');
} | php | protected function isAssociation(AnnotationBag $propertyAnnotations) {
return $propertyAnnotations->has('OneToOne') ||
$propertyAnnotations->has('OneToMany') ||
$propertyAnnotations->has('ManyToOne') ||
$propertyAnnotations->has('ManyToMany');
} | [
"protected",
"function",
"isAssociation",
"(",
"AnnotationBag",
"$",
"propertyAnnotations",
")",
"{",
"return",
"$",
"propertyAnnotations",
"->",
"has",
"(",
"'OneToOne'",
")",
"||",
"$",
"propertyAnnotations",
"->",
"has",
"(",
"'OneToMany'",
")",
"||",
"$",
"p... | Determines if a given property is an association
@param \Omocha\AnnotationBag $propertyAnnotations
@return boolean | [
"Determines",
"if",
"a",
"given",
"property",
"is",
"an",
"association"
] | df7100e601d2a1363d07028a786b6ceb22271829 | https://github.com/emaphp/eMapper/blob/df7100e601d2a1363d07028a786b6ceb22271829/lib/eMapper/Reflection/ClassProfile.php#L144-L149 |
235,721 | emaphp/eMapper | lib/eMapper/Reflection/ClassProfile.php | ClassProfile.parseAssociation | protected function parseAssociation($propertyName, \ReflectionProperty $reflectionProperty, AnnotationBag $propertyAnnotations) {
if ($propertyAnnotations->has('OneToOne')) {
$association = new OneToOne($propertyName, $reflectionProperty, $propertyAnnotations);
if ($association->isForeignKey()) {
$attri... | php | protected function parseAssociation($propertyName, \ReflectionProperty $reflectionProperty, AnnotationBag $propertyAnnotations) {
if ($propertyAnnotations->has('OneToOne')) {
$association = new OneToOne($propertyName, $reflectionProperty, $propertyAnnotations);
if ($association->isForeignKey()) {
$attri... | [
"protected",
"function",
"parseAssociation",
"(",
"$",
"propertyName",
",",
"\\",
"ReflectionProperty",
"$",
"reflectionProperty",
",",
"AnnotationBag",
"$",
"propertyAnnotations",
")",
"{",
"if",
"(",
"$",
"propertyAnnotations",
"->",
"has",
"(",
"'OneToOne'",
")",... | Parses an entity association
@param string $propertyName
@param \ReflectionProperty $reflectionProperty
@param \Omocha\AnnotationBag $propertyAnnotations | [
"Parses",
"an",
"entity",
"association"
] | df7100e601d2a1363d07028a786b6ceb22271829 | https://github.com/emaphp/eMapper/blob/df7100e601d2a1363d07028a786b6ceb22271829/lib/eMapper/Reflection/ClassProfile.php#L157-L187 |
235,722 | emaphp/eMapper | lib/eMapper/Reflection/ClassProfile.php | ClassProfile.parseProperties | protected function parseProperties() {
if ($this->isEntity()) {
//property mapping
$this->propertyMap = [];
//associations
$this->foreignkeys = $this->references = [];
//read-only properties
$this->readOnlyProperties = [];
//duplicate checks
$this->duplicateChecks = [];
}
$properties = ... | php | protected function parseProperties() {
if ($this->isEntity()) {
//property mapping
$this->propertyMap = [];
//associations
$this->foreignkeys = $this->references = [];
//read-only properties
$this->readOnlyProperties = [];
//duplicate checks
$this->duplicateChecks = [];
}
$properties = ... | [
"protected",
"function",
"parseProperties",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isEntity",
"(",
")",
")",
"{",
"//property mapping",
"$",
"this",
"->",
"propertyMap",
"=",
"[",
"]",
";",
"//associations",
"$",
"this",
"->",
"foreignkeys",
"=",
... | Parses the properties of the current class | [
"Parses",
"the",
"properties",
"of",
"the",
"current",
"class"
] | df7100e601d2a1363d07028a786b6ceb22271829 | https://github.com/emaphp/eMapper/blob/df7100e601d2a1363d07028a786b6ceb22271829/lib/eMapper/Reflection/ClassProfile.php#L192-L232 |
235,723 | emaphp/eMapper | lib/eMapper/Reflection/ClassProfile.php | ClassProfile.isSafe | public function isSafe() {
if ($this->classAnnotations->has('Safe'))
return (bool) $this->classAnnotations->get('Safe')->getValue();
return false;
} | php | public function isSafe() {
if ($this->classAnnotations->has('Safe'))
return (bool) $this->classAnnotations->get('Safe')->getValue();
return false;
} | [
"public",
"function",
"isSafe",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"classAnnotations",
"->",
"has",
"(",
"'Safe'",
")",
")",
"return",
"(",
"bool",
")",
"$",
"this",
"->",
"classAnnotations",
"->",
"get",
"(",
"'Safe'",
")",
"->",
"getValue",... | DEtermines if a type handler provides safe values
@return boolean | [
"DEtermines",
"if",
"a",
"type",
"handler",
"provides",
"safe",
"values"
] | df7100e601d2a1363d07028a786b6ceb22271829 | https://github.com/emaphp/eMapper/blob/df7100e601d2a1363d07028a786b6ceb22271829/lib/eMapper/Reflection/ClassProfile.php#L454-L459 |
235,724 | phPoirot/Storage | src/aDataStore.php | aDataStore.import | function import($data)
{
if ($data === null)
return $this;
if (!(is_array($data) || $data instanceof \Traversable || $data instanceof \stdClass))
throw new \InvalidArgumentException(sprintf(
'Data must be instance of \Traversable, \stdClass or array. given: (... | php | function import($data)
{
if ($data === null)
return $this;
if (!(is_array($data) || $data instanceof \Traversable || $data instanceof \stdClass))
throw new \InvalidArgumentException(sprintf(
'Data must be instance of \Traversable, \stdClass or array. given: (... | [
"function",
"import",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"$",
"data",
"===",
"null",
")",
"return",
"$",
"this",
";",
"if",
"(",
"!",
"(",
"is_array",
"(",
"$",
"data",
")",
"||",
"$",
"data",
"instanceof",
"\\",
"Traversable",
"||",
"$",
"da... | Import Data Into Current Realm
@param array|\Traversable|null $data
@throws \InvalidArgumentException
@return $this | [
"Import",
"Data",
"Into",
"Current",
"Realm"
] | a942de2f1c4245f5cb564c6a32ec619e4ab63d40 | https://github.com/phPoirot/Storage/blob/a942de2f1c4245f5cb564c6a32ec619e4ab63d40/src/aDataStore.php#L64-L83 |
235,725 | wigedev/simple-mvc | src/Utility/Configuration.php | Configuration.parseFile | public function parseFile(string $path): bool
{
static::$iteration++;
if (static::$iteration > 10) exit();
if (in_array($path, $this->parsed_files)) {
// The file has already been parsed, don't parse it again
return true;
}
$this->parsed_files[] = $pat... | php | public function parseFile(string $path): bool
{
static::$iteration++;
if (static::$iteration > 10) exit();
if (in_array($path, $this->parsed_files)) {
// The file has already been parsed, don't parse it again
return true;
}
$this->parsed_files[] = $pat... | [
"public",
"function",
"parseFile",
"(",
"string",
"$",
"path",
")",
":",
"bool",
"{",
"static",
"::",
"$",
"iteration",
"++",
";",
"if",
"(",
"static",
"::",
"$",
"iteration",
">",
"10",
")",
"exit",
"(",
")",
";",
"if",
"(",
"in_array",
"(",
"$",
... | Process a single file's configuration settings.
@param string $path The path to the configuration file
@return bool True if the file is parsed successfully or skipped because it has already been parsed | [
"Process",
"a",
"single",
"file",
"s",
"configuration",
"settings",
"."
] | b722eff02c5dcd8c6f09c8d78f72bc71cb9e1a94 | https://github.com/wigedev/simple-mvc/blob/b722eff02c5dcd8c6f09c8d78f72bc71cb9e1a94/src/Utility/Configuration.php#L51-L76 |
235,726 | pickles2/lib-plum | php/main.php | main.init | private function init() {
$current_dir = realpath('.');
$output = "";
$result = array('status' => true,
'message' => '');
$server_list = $this->options->preview_server;
array_push($server_list, json_decode(json_encode(array(
'name'=>'master',
'path'=>$this->options->git->repository,
))));
... | php | private function init() {
$current_dir = realpath('.');
$output = "";
$result = array('status' => true,
'message' => '');
$server_list = $this->options->preview_server;
array_push($server_list, json_decode(json_encode(array(
'name'=>'master',
'path'=>$this->options->git->repository,
))));
... | [
"private",
"function",
"init",
"(",
")",
"{",
"$",
"current_dir",
"=",
"realpath",
"(",
"'.'",
")",
";",
"$",
"output",
"=",
"\"\"",
";",
"$",
"result",
"=",
"array",
"(",
"'status'",
"=>",
"true",
",",
"'message'",
"=>",
"''",
")",
";",
"$",
"serv... | initialize GIT Repository
Gitリポジトリをクローンし、ローカル環境を整えます。
ツールのセットアップ時に1回実行してください。
GUIから、 "Initialize" ボタンを実行すると呼び出されます。
@return array result
- $result['status'] boolean 初期化に成功した場合に true
- $result['message'] string エラー発生時にエラーメッセージが格納される | [
"initialize",
"GIT",
"Repository"
] | 8e656727573eb767dd44645c708d5cf3d6c1fc21 | https://github.com/pickles2/lib-plum/blob/8e656727573eb767dd44645c708d5cf3d6c1fc21/php/main.php#L94-L181 |
235,727 | ViPErCZ/composer_slimORM | src/EntityManager.php | EntityManager.generateRepository | private function generateRepository($className) {
$table = EntityReflexion::getTable($className);
if ($table === NULL) {
throw new RepositoryException("Entity \"" . $className . " has no annotation \"table\"");
} else {
$genClassName = $this->generateRepositoryName($className);
if (!class_exists($genClas... | php | private function generateRepository($className) {
$table = EntityReflexion::getTable($className);
if ($table === NULL) {
throw new RepositoryException("Entity \"" . $className . " has no annotation \"table\"");
} else {
$genClassName = $this->generateRepositoryName($className);
if (!class_exists($genClas... | [
"private",
"function",
"generateRepository",
"(",
"$",
"className",
")",
"{",
"$",
"table",
"=",
"EntityReflexion",
"::",
"getTable",
"(",
"$",
"className",
")",
";",
"if",
"(",
"$",
"table",
"===",
"NULL",
")",
"{",
"throw",
"new",
"RepositoryException",
... | Generate repository class
@param $className
@throws RepositoryException
@throws \ErrorException | [
"Generate",
"repository",
"class"
] | 2206f4ab4557e2b21b2ae4e2ded7cb5ca3d829bf | https://github.com/ViPErCZ/composer_slimORM/blob/2206f4ab4557e2b21b2ae4e2ded7cb5ca3d829bf/src/EntityManager.php#L101-L156 |
235,728 | ViPErCZ/composer_slimORM | src/EntityManager.php | EntityManager.generateEntity | private function generateEntity($className) {
$genClassName = EntityManager::PREFIX . str_replace("\\", "", $className) . "Entity";
$table = EntityReflexion::getTable($className);
if ($table === NULL) {
throw new RepositoryException("Entity \"" . $className . " has no annotation \"table\"");
} else {
if (... | php | private function generateEntity($className) {
$genClassName = EntityManager::PREFIX . str_replace("\\", "", $className) . "Entity";
$table = EntityReflexion::getTable($className);
if ($table === NULL) {
throw new RepositoryException("Entity \"" . $className . " has no annotation \"table\"");
} else {
if (... | [
"private",
"function",
"generateEntity",
"(",
"$",
"className",
")",
"{",
"$",
"genClassName",
"=",
"EntityManager",
"::",
"PREFIX",
".",
"str_replace",
"(",
"\"\\\\\"",
",",
"\"\"",
",",
"$",
"className",
")",
".",
"\"Entity\"",
";",
"$",
"table",
"=",
"E... | Generate entity class
@param $className
@throws RepositoryException
@throws \ErrorException | [
"Generate",
"entity",
"class"
] | 2206f4ab4557e2b21b2ae4e2ded7cb5ca3d829bf | https://github.com/ViPErCZ/composer_slimORM/blob/2206f4ab4557e2b21b2ae4e2ded7cb5ca3d829bf/src/EntityManager.php#L164-L207 |
235,729 | dan-har/presentit | src/Resource/Item.php | Item.transform | public function transform()
{
if( ! $this->transformer) {
return [];
}
$presentation = $this->transformer->transform($this->resource);
return $this->transformToArray($presentation);
} | php | public function transform()
{
if( ! $this->transformer) {
return [];
}
$presentation = $this->transformer->transform($this->resource);
return $this->transformToArray($presentation);
} | [
"public",
"function",
"transform",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"transformer",
")",
"{",
"return",
"[",
"]",
";",
"}",
"$",
"presentation",
"=",
"$",
"this",
"->",
"transformer",
"->",
"transform",
"(",
"$",
"this",
"->",
"resour... | Present the item using a transformer.
@return array | [
"Present",
"the",
"item",
"using",
"a",
"transformer",
"."
] | 283db977d5b6d91bc2c139ec377c05010935682d | https://github.com/dan-har/presentit/blob/283db977d5b6d91bc2c139ec377c05010935682d/src/Resource/Item.php#L53-L62 |
235,730 | dan-har/presentit | src/Resource/Item.php | Item.transformToArray | protected function transformToArray(array $presentation)
{
$array = [];
// iterate over all the presentation values and search for arrays and
// for the nested special entities, Presentation and Hidden objects
// and handle each entity in the appropriate way.
foreach ($prese... | php | protected function transformToArray(array $presentation)
{
$array = [];
// iterate over all the presentation values and search for arrays and
// for the nested special entities, Presentation and Hidden objects
// and handle each entity in the appropriate way.
foreach ($prese... | [
"protected",
"function",
"transformToArray",
"(",
"array",
"$",
"presentation",
")",
"{",
"$",
"array",
"=",
"[",
"]",
";",
"// iterate over all the presentation values and search for arrays and",
"// for the nested special entities, Presentation and Hidden objects",
"// and handle... | Transform a presentation to an array.
@param array $presentation
@return array | [
"Transform",
"a",
"presentation",
"to",
"an",
"array",
"."
] | 283db977d5b6d91bc2c139ec377c05010935682d | https://github.com/dan-har/presentit/blob/283db977d5b6d91bc2c139ec377c05010935682d/src/Resource/Item.php#L70-L105 |
235,731 | WellCommerce/CmsBundle | Form/Admin/PageFormBuilder.php | PageFormBuilder.addMainFieldset | private function addMainFieldset(FormInterface $form)
{
$mainData = $form->addChild($this->getElement('nested_fieldset', [
'name' => 'main_data',
'label' => 'common.fieldset.general',
]));
$languageData = $mainData->addChild($this->getElement('language_field... | php | private function addMainFieldset(FormInterface $form)
{
$mainData = $form->addChild($this->getElement('nested_fieldset', [
'name' => 'main_data',
'label' => 'common.fieldset.general',
]));
$languageData = $mainData->addChild($this->getElement('language_field... | [
"private",
"function",
"addMainFieldset",
"(",
"FormInterface",
"$",
"form",
")",
"{",
"$",
"mainData",
"=",
"$",
"form",
"->",
"addChild",
"(",
"$",
"this",
"->",
"getElement",
"(",
"'nested_fieldset'",
",",
"[",
"'name'",
"=>",
"'main_data'",
",",
"'label'... | Adds main settings fieldset to form
@param FormInterface $form | [
"Adds",
"main",
"settings",
"fieldset",
"to",
"form"
] | 2056ab01e17d3402ffae5dd01b4df61279fa60f9 | https://github.com/WellCommerce/CmsBundle/blob/2056ab01e17d3402ffae5dd01b4df61279fa60f9/Form/Admin/PageFormBuilder.php#L48-L122 |
235,732 | mimmi20/ua-data-mapper | src/MakerMapper.php | MakerMapper.mapMaker | public function mapMaker(?string $maker): ?string
{
if (null === $maker) {
return null;
}
switch (mb_strtolower(trim($maker))) {
case '':
case 'unknown':
case 'other':
case 'bot':
case 'various':
$maker ... | php | public function mapMaker(?string $maker): ?string
{
if (null === $maker) {
return null;
}
switch (mb_strtolower(trim($maker))) {
case '':
case 'unknown':
case 'other':
case 'bot':
case 'various':
$maker ... | [
"public",
"function",
"mapMaker",
"(",
"?",
"string",
"$",
"maker",
")",
":",
"?",
"string",
"{",
"if",
"(",
"null",
"===",
"$",
"maker",
")",
"{",
"return",
"null",
";",
"}",
"switch",
"(",
"mb_strtolower",
"(",
"trim",
"(",
"$",
"maker",
")",
")"... | maps the maker of the browser, os, engine or device
@param string|null $maker
@return string|null | [
"maps",
"the",
"maker",
"of",
"the",
"browser",
"os",
"engine",
"or",
"device"
] | fdb249045066a4e793fb481c6304c736605996eb | https://github.com/mimmi20/ua-data-mapper/blob/fdb249045066a4e793fb481c6304c736605996eb/src/MakerMapper.php#L31-L110 |
235,733 | webforge-labs/webforge-dom | lib/Webforge/DOM/XMLUtil.php | XMLUtil.docPart | public static function docPart($htmlPart, $encoding = 'utf-8', $docType = NULL) {
if (!is_string($htmlPart))
$htmlPart = self::export($htmlPart);
if (mb_strpos(trim($htmlPart), '<!DOCTYPE') === 0) {
$document = $htmlPart;
} else {
// DOMDocument setzt so oder so einen default, also kö... | php | public static function docPart($htmlPart, $encoding = 'utf-8', $docType = NULL) {
if (!is_string($htmlPart))
$htmlPart = self::export($htmlPart);
if (mb_strpos(trim($htmlPart), '<!DOCTYPE') === 0) {
$document = $htmlPart;
} else {
// DOMDocument setzt so oder so einen default, also kö... | [
"public",
"static",
"function",
"docPart",
"(",
"$",
"htmlPart",
",",
"$",
"encoding",
"=",
"'utf-8'",
",",
"$",
"docType",
"=",
"NULL",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"htmlPart",
")",
")",
"$",
"htmlPart",
"=",
"self",
"::",
"expor... | Takes any HTML snippet and makes a correct DOMDocument out of it
nimmt als default
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">';
an
@param string $html ein HTML Schnipsel
@return DOMDocument | [
"Takes",
"any",
"HTML",
"snippet",
"and",
"makes",
"a",
"correct",
"DOMDocument",
"out",
"of",
"it"
] | 79bc03e8cb1a483e122e700d15bbb9ac607dd39b | https://github.com/webforge-labs/webforge-dom/blob/79bc03e8cb1a483e122e700d15bbb9ac607dd39b/lib/Webforge/DOM/XMLUtil.php#L43-L64 |
235,734 | linusshops/behat-contexts | src/LinusShops/Contexts/Generic.php | Generic.waitFor | public function waitFor(callable $lambda, $attempts = 10, $waitInterval = 1)
{
for ($i = 0; $i < $attempts; $i++) {
try {
if ($lambda($this) === true) {
return;
}
} catch (\Exception $e) {
//Do nothing and pass on to... | php | public function waitFor(callable $lambda, $attempts = 10, $waitInterval = 1)
{
for ($i = 0; $i < $attempts; $i++) {
try {
if ($lambda($this) === true) {
return;
}
} catch (\Exception $e) {
//Do nothing and pass on to... | [
"public",
"function",
"waitFor",
"(",
"callable",
"$",
"lambda",
",",
"$",
"attempts",
"=",
"10",
",",
"$",
"waitInterval",
"=",
"1",
")",
"{",
"for",
"(",
"$",
"i",
"=",
"0",
";",
"$",
"i",
"<",
"$",
"attempts",
";",
"$",
"i",
"++",
")",
"{",
... | Attempt the given function a configurable number of times, waiting X seconds
between each attempt. If the step does not succeed in any of the attempts,
success being defined as the lambda returning true, then throw an exception.
@param callable $lambda - some action to attempt. Will be reattempted until
successful or ... | [
"Attempt",
"the",
"given",
"function",
"a",
"configurable",
"number",
"of",
"times",
"waiting",
"X",
"seconds",
"between",
"each",
"attempt",
".",
"If",
"the",
"step",
"does",
"not",
"succeed",
"in",
"any",
"of",
"the",
"attempts",
"success",
"being",
"defin... | b90fc268114de2a71c441cfaaa2964b55fca2dbf | https://github.com/linusshops/behat-contexts/blob/b90fc268114de2a71c441cfaaa2964b55fca2dbf/src/LinusShops/Contexts/Generic.php#L26-L43 |
235,735 | lciolecki/zf-extensions-library | library/Extlib/Paginator/Adapter/Doctrine.php | Doctrine.setRowCount | public function setRowCount($rowCount)
{
if ($rowCount instanceof \Doctrine_Query) {
$sql = $rowCount->getSql();
if (false === strpos($sql, self::ROW_COUNT_COLUMN)) {
throw new \Zend_Paginator_Exception('Row count column not found');
}
$resul... | php | public function setRowCount($rowCount)
{
if ($rowCount instanceof \Doctrine_Query) {
$sql = $rowCount->getSql();
if (false === strpos($sql, self::ROW_COUNT_COLUMN)) {
throw new \Zend_Paginator_Exception('Row count column not found');
}
$resul... | [
"public",
"function",
"setRowCount",
"(",
"$",
"rowCount",
")",
"{",
"if",
"(",
"$",
"rowCount",
"instanceof",
"\\",
"Doctrine_Query",
")",
"{",
"$",
"sql",
"=",
"$",
"rowCount",
"->",
"getSql",
"(",
")",
";",
"if",
"(",
"false",
"===",
"strpos",
"(",
... | Sets the total row count, either directly or through a supplied query
@param \Doctrine_Query|integer $totalRowCount Total row count integer
or query
@return \Zend_Paginator_Adapter_Doctrine $this
@throws \Zend_Paginator_Exception | [
"Sets",
"the",
"total",
"row",
"count",
"either",
"directly",
"or",
"through",
"a",
"supplied",
"query"
] | f479a63188d17f1488b392d4fc14fe47a417ea55 | https://github.com/lciolecki/zf-extensions-library/blob/f479a63188d17f1488b392d4fc14fe47a417ea55/library/Extlib/Paginator/Adapter/Doctrine.php#L68-L87 |
235,736 | znframework/package-generator | GrandVision.php | GrandVision.generate | public function generate(...$database)
{
$databases = $this->getDatabaseList($database);
foreach( $databases as $connection => $database )
{
$this->setDatabaseConfiguration($connection, $database, $configs);
$this->createVisionDirectoryByDatabaseName($database);
... | php | public function generate(...$database)
{
$databases = $this->getDatabaseList($database);
foreach( $databases as $connection => $database )
{
$this->setDatabaseConfiguration($connection, $database, $configs);
$this->createVisionDirectoryByDatabaseName($database);
... | [
"public",
"function",
"generate",
"(",
"...",
"$",
"database",
")",
"{",
"$",
"databases",
"=",
"$",
"this",
"->",
"getDatabaseList",
"(",
"$",
"database",
")",
";",
"foreach",
"(",
"$",
"databases",
"as",
"$",
"connection",
"=>",
"$",
"database",
")",
... | Generate Grand Vision
@param mixed ...$database | [
"Generate",
"Grand",
"Vision"
] | 4524c28c607d8a5799b60bd39bee8be4fd1e7fba | https://github.com/znframework/package-generator/blob/4524c28c607d8a5799b60bd39bee8be4fd1e7fba/GrandVision.php#L42-L54 |
235,737 | znframework/package-generator | GrandVision.php | GrandVision.setDatabaseConfiguration | protected function setDatabaseConfiguration($connection, &$database, &$configs)
{
$configs = [];
if( is_array($database) )
{
$configs = $database;
$database = $connection;
}
$configs['database'] = $database ?: $this->defaultDatabaseName;
} | php | protected function setDatabaseConfiguration($connection, &$database, &$configs)
{
$configs = [];
if( is_array($database) )
{
$configs = $database;
$database = $connection;
}
$configs['database'] = $database ?: $this->defaultDatabaseName;
} | [
"protected",
"function",
"setDatabaseConfiguration",
"(",
"$",
"connection",
",",
"&",
"$",
"database",
",",
"&",
"$",
"configs",
")",
"{",
"$",
"configs",
"=",
"[",
"]",
";",
"if",
"(",
"is_array",
"(",
"$",
"database",
")",
")",
"{",
"$",
"configs",
... | Protected set database configuration | [
"Protected",
"set",
"database",
"configuration"
] | 4524c28c607d8a5799b60bd39bee8be4fd1e7fba | https://github.com/znframework/package-generator/blob/4524c28c607d8a5799b60bd39bee8be4fd1e7fba/GrandVision.php#L84-L95 |
235,738 | znframework/package-generator | GrandVision.php | GrandVision.createVisionModelFile | protected function createVisionModelFile($database, $configs)
{
$tables = $this->getTableList($database);
$database = ucfirst($database);
foreach( $tables as $table )
{
(new File)->object
(
'model',
$this->getDatabaseVisionCl... | php | protected function createVisionModelFile($database, $configs)
{
$tables = $this->getTableList($database);
$database = ucfirst($database);
foreach( $tables as $table )
{
(new File)->object
(
'model',
$this->getDatabaseVisionCl... | [
"protected",
"function",
"createVisionModelFile",
"(",
"$",
"database",
",",
"$",
"configs",
")",
"{",
"$",
"tables",
"=",
"$",
"this",
"->",
"getTableList",
"(",
"$",
"database",
")",
";",
"$",
"database",
"=",
"ucfirst",
"(",
"$",
"database",
")",
";",... | Protected create vision model file | [
"Protected",
"create",
"vision",
"model",
"file"
] | 4524c28c607d8a5799b60bd39bee8be4fd1e7fba | https://github.com/znframework/package-generator/blob/4524c28c607d8a5799b60bd39bee8be4fd1e7fba/GrandVision.php#L116-L141 |
235,739 | znframework/package-generator | GrandVision.php | GrandVision.getDatabaseList | protected function getDatabaseList($database)
{
$databases = $database;
if( is_array(($database[0] ?? NULL)) )
{
$databases = $database[0];
}
if( empty($database) )
{
$databases = $this->tool->listDatabases();
}
return $datab... | php | protected function getDatabaseList($database)
{
$databases = $database;
if( is_array(($database[0] ?? NULL)) )
{
$databases = $database[0];
}
if( empty($database) )
{
$databases = $this->tool->listDatabases();
}
return $datab... | [
"protected",
"function",
"getDatabaseList",
"(",
"$",
"database",
")",
"{",
"$",
"databases",
"=",
"$",
"database",
";",
"if",
"(",
"is_array",
"(",
"(",
"$",
"database",
"[",
"0",
"]",
"??",
"NULL",
")",
")",
")",
"{",
"$",
"databases",
"=",
"$",
... | Protected get database list | [
"Protected",
"get",
"database",
"list"
] | 4524c28c607d8a5799b60bd39bee8be4fd1e7fba | https://github.com/znframework/package-generator/blob/4524c28c607d8a5799b60bd39bee8be4fd1e7fba/GrandVision.php#L154-L169 |
235,740 | znframework/package-generator | GrandVision.php | GrandVision.deleteVisionFile | protected function deleteVisionFile($database, $tables)
{
foreach( $tables as $table )
{
unlink($this->getVisionFilePath($database, $table));
}
} | php | protected function deleteVisionFile($database, $tables)
{
foreach( $tables as $table )
{
unlink($this->getVisionFilePath($database, $table));
}
} | [
"protected",
"function",
"deleteVisionFile",
"(",
"$",
"database",
",",
"$",
"tables",
")",
"{",
"foreach",
"(",
"$",
"tables",
"as",
"$",
"table",
")",
"{",
"unlink",
"(",
"$",
"this",
"->",
"getVisionFilePath",
"(",
"$",
"database",
",",
"$",
"table",
... | Protected delete vision file | [
"Protected",
"delete",
"vision",
"file"
] | 4524c28c607d8a5799b60bd39bee8be4fd1e7fba | https://github.com/znframework/package-generator/blob/4524c28c607d8a5799b60bd39bee8be4fd1e7fba/GrandVision.php#L198-L204 |
235,741 | znframework/package-generator | GrandVision.php | GrandVision.getDatabaseVisionClassName | protected function getDatabaseVisionClassName($database, $table)
{
return INTERNAL_ACCESS . ( strtolower($database) === strtolower($this->defaultDatabaseName) ? NULL : ucfirst($database) ) . ucfirst($table) . 'Vision';
} | php | protected function getDatabaseVisionClassName($database, $table)
{
return INTERNAL_ACCESS . ( strtolower($database) === strtolower($this->defaultDatabaseName) ? NULL : ucfirst($database) ) . ucfirst($table) . 'Vision';
} | [
"protected",
"function",
"getDatabaseVisionClassName",
"(",
"$",
"database",
",",
"$",
"table",
")",
"{",
"return",
"INTERNAL_ACCESS",
".",
"(",
"strtolower",
"(",
"$",
"database",
")",
"===",
"strtolower",
"(",
"$",
"this",
"->",
"defaultDatabaseName",
")",
"... | Protected get database vision class name | [
"Protected",
"get",
"database",
"vision",
"class",
"name"
] | 4524c28c607d8a5799b60bd39bee8be4fd1e7fba | https://github.com/znframework/package-generator/blob/4524c28c607d8a5799b60bd39bee8be4fd1e7fba/GrandVision.php#L217-L220 |
235,742 | znframework/package-generator | GrandVision.php | GrandVision.getVisionFilePath | protected function getVisionFilePath($database, $table)
{
return $this->getVisionDirectory() . Base::suffix(ucfirst($database)) . $this->getDatabaseVisionClassName($database, $table) . '.php';
} | php | protected function getVisionFilePath($database, $table)
{
return $this->getVisionDirectory() . Base::suffix(ucfirst($database)) . $this->getDatabaseVisionClassName($database, $table) . '.php';
} | [
"protected",
"function",
"getVisionFilePath",
"(",
"$",
"database",
",",
"$",
"table",
")",
"{",
"return",
"$",
"this",
"->",
"getVisionDirectory",
"(",
")",
".",
"Base",
"::",
"suffix",
"(",
"ucfirst",
"(",
"$",
"database",
")",
")",
".",
"$",
"this",
... | Protected get vision file path | [
"Protected",
"get",
"vision",
"file",
"path"
] | 4524c28c607d8a5799b60bd39bee8be4fd1e7fba | https://github.com/znframework/package-generator/blob/4524c28c607d8a5799b60bd39bee8be4fd1e7fba/GrandVision.php#L225-L228 |
235,743 | znframework/package-generator | GrandVision.php | GrandVision.stringArray | protected function stringArray(Array $data)
{
$str = EOL . HT . '[' . EOL;
foreach( $data as $key => $val )
{
$str .= HT . HT . "'" . $key . "' => '" . $val . "'," . EOL;
}
$str = Base::removeSuffix($str, ',' . EOL);
$str .= EOL . HT . ']';
ret... | php | protected function stringArray(Array $data)
{
$str = EOL . HT . '[' . EOL;
foreach( $data as $key => $val )
{
$str .= HT . HT . "'" . $key . "' => '" . $val . "'," . EOL;
}
$str = Base::removeSuffix($str, ',' . EOL);
$str .= EOL . HT . ']';
ret... | [
"protected",
"function",
"stringArray",
"(",
"Array",
"$",
"data",
")",
"{",
"$",
"str",
"=",
"EOL",
".",
"HT",
".",
"'['",
".",
"EOL",
";",
"foreach",
"(",
"$",
"data",
"as",
"$",
"key",
"=>",
"$",
"val",
")",
"{",
"$",
"str",
".=",
"HT",
".",... | Protected String Array
@param array $data
@return string | [
"Protected",
"String",
"Array"
] | 4524c28c607d8a5799b60bd39bee8be4fd1e7fba | https://github.com/znframework/package-generator/blob/4524c28c607d8a5799b60bd39bee8be4fd1e7fba/GrandVision.php#L245-L258 |
235,744 | comodojo/rpcserver | src/Comodojo/RpcServer/RpcServer.php | RpcServer.uncan | private function uncan($payload) {
$decoded = null;
if ( empty($payload) || !is_string($payload) ) throw new RpcException("Invalid Request", -32600);
if ( substr($payload, 0, 27) == 'comodojo_encrypted_request-' ) {
if ( empty($this->encrypt) ) throw new RpcException("Transport e... | php | private function uncan($payload) {
$decoded = null;
if ( empty($payload) || !is_string($payload) ) throw new RpcException("Invalid Request", -32600);
if ( substr($payload, 0, 27) == 'comodojo_encrypted_request-' ) {
if ( empty($this->encrypt) ) throw new RpcException("Transport e... | [
"private",
"function",
"uncan",
"(",
"$",
"payload",
")",
"{",
"$",
"decoded",
"=",
"null",
";",
"if",
"(",
"empty",
"(",
"$",
"payload",
")",
"||",
"!",
"is_string",
"(",
"$",
"payload",
")",
")",
"throw",
"new",
"RpcException",
"(",
"\"Invalid Reques... | Uncan the provided payload
@param string $payload
@return mixed
@throws RpcException | [
"Uncan",
"the",
"provided",
"payload"
] | 6b4766f1554f6fe6b06199c0c1fb97e1b5a8bb1c | https://github.com/comodojo/rpcserver/blob/6b4766f1554f6fe6b06199c0c1fb97e1b5a8bb1c/src/Comodojo/RpcServer/RpcServer.php#L386-L442 |
235,745 | comodojo/rpcserver | src/Comodojo/RpcServer/RpcServer.php | RpcServer.can | private function can($response, $error) {
$encoded = null;
if ( $this->protocol == 'xml' ) {
$encoder = new XmlrpcEncoder();
$encoder->setEncoding($this->encoding);
try {
$encoded = $error ? $encoder->encodeError($response->getCode(), $response->... | php | private function can($response, $error) {
$encoded = null;
if ( $this->protocol == 'xml' ) {
$encoder = new XmlrpcEncoder();
$encoder->setEncoding($this->encoding);
try {
$encoded = $error ? $encoder->encodeError($response->getCode(), $response->... | [
"private",
"function",
"can",
"(",
"$",
"response",
",",
"$",
"error",
")",
"{",
"$",
"encoded",
"=",
"null",
";",
"if",
"(",
"$",
"this",
"->",
"protocol",
"==",
"'xml'",
")",
"{",
"$",
"encoder",
"=",
"new",
"XmlrpcEncoder",
"(",
")",
";",
"$",
... | Can the RPC response
@param mixed $response
@param boolean $error
@return string
@throws RpcException | [
"Can",
"the",
"RPC",
"response"
] | 6b4766f1554f6fe6b06199c0c1fb97e1b5a8bb1c | https://github.com/comodojo/rpcserver/blob/6b4766f1554f6fe6b06199c0c1fb97e1b5a8bb1c/src/Comodojo/RpcServer/RpcServer.php#L453-L513 |
235,746 | comodojo/rpcserver | src/Comodojo/RpcServer/RpcServer.php | RpcServer.setIntrospectionMethods | private static function setIntrospectionMethods($methods) {
$methods->add(RpcMethod::create("system.getCapabilities", '\Comodojo\RpcServer\Reserved\GetCapabilities::execute')
->setDescription("This method lists all the capabilites that the RPC server has: the (more or less standard) extensions to t... | php | private static function setIntrospectionMethods($methods) {
$methods->add(RpcMethod::create("system.getCapabilities", '\Comodojo\RpcServer\Reserved\GetCapabilities::execute')
->setDescription("This method lists all the capabilites that the RPC server has: the (more or less standard) extensions to t... | [
"private",
"static",
"function",
"setIntrospectionMethods",
"(",
"$",
"methods",
")",
"{",
"$",
"methods",
"->",
"add",
"(",
"RpcMethod",
"::",
"create",
"(",
"\"system.getCapabilities\"",
",",
"'\\Comodojo\\RpcServer\\Reserved\\GetCapabilities::execute'",
")",
"->",
"s... | Inject introspection and reserved RPC methods
@param Methods $methods | [
"Inject",
"introspection",
"and",
"reserved",
"RPC",
"methods"
] | 6b4766f1554f6fe6b06199c0c1fb97e1b5a8bb1c | https://github.com/comodojo/rpcserver/blob/6b4766f1554f6fe6b06199c0c1fb97e1b5a8bb1c/src/Comodojo/RpcServer/RpcServer.php#L520-L551 |
235,747 | comodojo/rpcserver | src/Comodojo/RpcServer/RpcServer.php | RpcServer.setCapabilities | private static function setCapabilities($capabilities) {
$supported_capabilities = array(
'xmlrpc' => array('http://www.xmlrpc.com/spec', 1),
'system.multicall' => array('http://www.xmlrpc.com/discuss/msgReader$1208', 1),
'introspection' => array('http://phpxmlrpc.sourceforg... | php | private static function setCapabilities($capabilities) {
$supported_capabilities = array(
'xmlrpc' => array('http://www.xmlrpc.com/spec', 1),
'system.multicall' => array('http://www.xmlrpc.com/discuss/msgReader$1208', 1),
'introspection' => array('http://phpxmlrpc.sourceforg... | [
"private",
"static",
"function",
"setCapabilities",
"(",
"$",
"capabilities",
")",
"{",
"$",
"supported_capabilities",
"=",
"array",
"(",
"'xmlrpc'",
"=>",
"array",
"(",
"'http://www.xmlrpc.com/spec'",
",",
"1",
")",
",",
"'system.multicall'",
"=>",
"array",
"(",
... | Inject supported capabilities
@param Capabilities $capabilities | [
"Inject",
"supported",
"capabilities"
] | 6b4766f1554f6fe6b06199c0c1fb97e1b5a8bb1c | https://github.com/comodojo/rpcserver/blob/6b4766f1554f6fe6b06199c0c1fb97e1b5a8bb1c/src/Comodojo/RpcServer/RpcServer.php#L558-L575 |
235,748 | comodojo/rpcserver | src/Comodojo/RpcServer/RpcServer.php | RpcServer.setErrors | private static function setErrors($errors) {
$std_rpc_errors = array(
-32700 => "Parse error",
-32701 => "Parse error - Unsupported encoding",
-32702 => "Parse error - Invalid character for encoding",
-32600 => "Invalid Request",
-32601 => "Method not... | php | private static function setErrors($errors) {
$std_rpc_errors = array(
-32700 => "Parse error",
-32701 => "Parse error - Unsupported encoding",
-32702 => "Parse error - Invalid character for encoding",
-32600 => "Invalid Request",
-32601 => "Method not... | [
"private",
"static",
"function",
"setErrors",
"(",
"$",
"errors",
")",
"{",
"$",
"std_rpc_errors",
"=",
"array",
"(",
"-",
"32700",
"=>",
"\"Parse error\"",
",",
"-",
"32701",
"=>",
"\"Parse error - Unsupported encoding\"",
",",
"-",
"32702",
"=>",
"\"Parse erro... | Inject standard and RPC errors
@param Errors $errors | [
"Inject",
"standard",
"and",
"RPC",
"errors"
] | 6b4766f1554f6fe6b06199c0c1fb97e1b5a8bb1c | https://github.com/comodojo/rpcserver/blob/6b4766f1554f6fe6b06199c0c1fb97e1b5a8bb1c/src/Comodojo/RpcServer/RpcServer.php#L582-L606 |
235,749 | wasabi-cms/core | src/Model/Table/UsersGroupsTable.php | UsersGroupsTable.findUserIdsWithOnlyOneGroup | public function findUserIdsWithOnlyOneGroup()
{
$query = $this->find();
return $query
->select([
'user_id',
'group_count' => $query->func()->count('*')
])
->group('user_id')
->having([
'group_count = 1'
... | php | public function findUserIdsWithOnlyOneGroup()
{
$query = $this->find();
return $query
->select([
'user_id',
'group_count' => $query->func()->count('*')
])
->group('user_id')
->having([
'group_count = 1'
... | [
"public",
"function",
"findUserIdsWithOnlyOneGroup",
"(",
")",
"{",
"$",
"query",
"=",
"$",
"this",
"->",
"find",
"(",
")",
";",
"return",
"$",
"query",
"->",
"select",
"(",
"[",
"'user_id'",
",",
"'group_count'",
"=>",
"$",
"query",
"->",
"func",
"(",
... | Find all user ids of users assigned to only one group.
@return array | [
"Find",
"all",
"user",
"ids",
"of",
"users",
"assigned",
"to",
"only",
"one",
"group",
"."
] | 0eadbb64d2fc201bacc63c93814adeca70e08f90 | https://github.com/wasabi-cms/core/blob/0eadbb64d2fc201bacc63c93814adeca70e08f90/src/Model/Table/UsersGroupsTable.php#L56-L70 |
235,750 | prototypemvc/prototypemvc | Core/Text.php | Text.contains | public static function contains($string = false, $substring = false) {
if ($substring && $substring && strpos($string, $substring) !== false) {
return true;
}
return false;
} | php | public static function contains($string = false, $substring = false) {
if ($substring && $substring && strpos($string, $substring) !== false) {
return true;
}
return false;
} | [
"public",
"static",
"function",
"contains",
"(",
"$",
"string",
"=",
"false",
",",
"$",
"substring",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"substring",
"&&",
"$",
"substring",
"&&",
"strpos",
"(",
"$",
"string",
",",
"$",
"substring",
")",
"!==",
"... | Check if the given string contains a specific substring.
@param string full string
@param string substring
@return boolean | [
"Check",
"if",
"the",
"given",
"string",
"contains",
"a",
"specific",
"substring",
"."
] | 039e238857d4b627e40ba681a376583b0821cd36 | https://github.com/prototypemvc/prototypemvc/blob/039e238857d4b627e40ba681a376583b0821cd36/Core/Text.php#L13-L21 |
235,751 | prototypemvc/prototypemvc | Core/Text.php | Text.count | public static function count($string = false, $selector = false) {
if ($string) {
switch ($selector) {
case 'words':
return str_word_count($string);
default:
if (self::substring($selector, 0, 1) === ':') {
... | php | public static function count($string = false, $selector = false) {
if ($string) {
switch ($selector) {
case 'words':
return str_word_count($string);
default:
if (self::substring($selector, 0, 1) === ':') {
... | [
"public",
"static",
"function",
"count",
"(",
"$",
"string",
"=",
"false",
",",
"$",
"selector",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"string",
")",
"{",
"switch",
"(",
"$",
"selector",
")",
"{",
"case",
"'words'",
":",
"return",
"str_word_count",
... | Get string length, number of words or the occurences of specific word.
@param string full string
@param string selector
@example count('hello world') - will return length of string which is 11
@example count('hello world', 'words') - will return number of words which is 2
@example count('hello world', ':hello') - will ... | [
"Get",
"string",
"length",
"number",
"of",
"words",
"or",
"the",
"occurences",
"of",
"specific",
"word",
"."
] | 039e238857d4b627e40ba681a376583b0821cd36 | https://github.com/prototypemvc/prototypemvc/blob/039e238857d4b627e40ba681a376583b0821cd36/Core/Text.php#L32-L48 |
235,752 | prototypemvc/prototypemvc | Core/Text.php | Text.lowercase | public static function lowercase($string = false, $selector = false) {
if ($string) {
switch ($selector) {
case 'first':
return lcfirst($string);
case 'words':
return lcwords($string);
default:
... | php | public static function lowercase($string = false, $selector = false) {
if ($string) {
switch ($selector) {
case 'first':
return lcfirst($string);
case 'words':
return lcwords($string);
default:
... | [
"public",
"static",
"function",
"lowercase",
"(",
"$",
"string",
"=",
"false",
",",
"$",
"selector",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"string",
")",
"{",
"switch",
"(",
"$",
"selector",
")",
"{",
"case",
"'first'",
":",
"return",
"lcfirst",
"(... | Get string in lowercase.
@param string full string
@return string in lowercase | [
"Get",
"string",
"in",
"lowercase",
"."
] | 039e238857d4b627e40ba681a376583b0821cd36 | https://github.com/prototypemvc/prototypemvc/blob/039e238857d4b627e40ba681a376583b0821cd36/Core/Text.php#L85-L100 |
235,753 | prototypemvc/prototypemvc | Core/Text.php | Text.replace | public static function replace($string = false, $find = false, $replaceWith = '') {
if ($string && $find) {
return str_replace($find, $replaceWith, $string);
}
return false;
} | php | public static function replace($string = false, $find = false, $replaceWith = '') {
if ($string && $find) {
return str_replace($find, $replaceWith, $string);
}
return false;
} | [
"public",
"static",
"function",
"replace",
"(",
"$",
"string",
"=",
"false",
",",
"$",
"find",
"=",
"false",
",",
"$",
"replaceWith",
"=",
"''",
")",
"{",
"if",
"(",
"$",
"string",
"&&",
"$",
"find",
")",
"{",
"return",
"str_replace",
"(",
"$",
"fi... | Get string with specific substring replaced.
@param string full string
@param string substring to find and replace
@param string replace with this value
@return string trimmed | [
"Get",
"string",
"with",
"specific",
"substring",
"replaced",
"."
] | 039e238857d4b627e40ba681a376583b0821cd36 | https://github.com/prototypemvc/prototypemvc/blob/039e238857d4b627e40ba681a376583b0821cd36/Core/Text.php#L109-L117 |
235,754 | prototypemvc/prototypemvc | Core/Text.php | Text.substring | public static function substring($string = false, $firstIndex = 0, $maxStringLength = false) {
if ($string) {
if (!$maxStringLength) {
$maxStringLength = (self::length($string) - $firstIndex);
}
return substr($string, $firstIndex, $maxStringLength);
... | php | public static function substring($string = false, $firstIndex = 0, $maxStringLength = false) {
if ($string) {
if (!$maxStringLength) {
$maxStringLength = (self::length($string) - $firstIndex);
}
return substr($string, $firstIndex, $maxStringLength);
... | [
"public",
"static",
"function",
"substring",
"(",
"$",
"string",
"=",
"false",
",",
"$",
"firstIndex",
"=",
"0",
",",
"$",
"maxStringLength",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"string",
")",
"{",
"if",
"(",
"!",
"$",
"maxStringLength",
")",
"{"... | Get substring.
@param string full string
@param int first index (starting point)
@param int max string length
@return string substring | [
"Get",
"substring",
"."
] | 039e238857d4b627e40ba681a376583b0821cd36 | https://github.com/prototypemvc/prototypemvc/blob/039e238857d4b627e40ba681a376583b0821cd36/Core/Text.php#L210-L223 |
235,755 | prototypemvc/prototypemvc | Core/Text.php | Text.uppercase | public static function uppercase($string = false, $selector = false) {
if ($string) {
switch ($selector) {
case 'first':
return ucfirst($string);
case 'words':
return ucwords($string);
default:
... | php | public static function uppercase($string = false, $selector = false) {
if ($string) {
switch ($selector) {
case 'first':
return ucfirst($string);
case 'words':
return ucwords($string);
default:
... | [
"public",
"static",
"function",
"uppercase",
"(",
"$",
"string",
"=",
"false",
",",
"$",
"selector",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"string",
")",
"{",
"switch",
"(",
"$",
"selector",
")",
"{",
"case",
"'first'",
":",
"return",
"ucfirst",
"(... | Get string in uppercase.
@param string full string
@return string in uppercase | [
"Get",
"string",
"in",
"uppercase",
"."
] | 039e238857d4b627e40ba681a376583b0821cd36 | https://github.com/prototypemvc/prototypemvc/blob/039e238857d4b627e40ba681a376583b0821cd36/Core/Text.php#L230-L245 |
235,756 | kambo-1st/HttpMessage | src/ServerRequest.php | ServerRequest.validateUploadedFiles | private function validateUploadedFiles(array $uploadedFiles)
{
foreach ($uploadedFiles as $file) {
if (is_array($file)) {
$this->validateUploadedFiles($file);
} elseif (!$file instanceof UploadedFileInterface) {
throw new InvalidArgumentException('Inva... | php | private function validateUploadedFiles(array $uploadedFiles)
{
foreach ($uploadedFiles as $file) {
if (is_array($file)) {
$this->validateUploadedFiles($file);
} elseif (!$file instanceof UploadedFileInterface) {
throw new InvalidArgumentException('Inva... | [
"private",
"function",
"validateUploadedFiles",
"(",
"array",
"$",
"uploadedFiles",
")",
"{",
"foreach",
"(",
"$",
"uploadedFiles",
"as",
"$",
"file",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"file",
")",
")",
"{",
"$",
"this",
"->",
"validateUploadedFil... | Validate the structure in an uploaded files array.
@param array $uploadedFiles
@throws InvalidArgumentException if any entry is not an UploadedFileInterface instance. | [
"Validate",
"the",
"structure",
"in",
"an",
"uploaded",
"files",
"array",
"."
] | 38877b9d895f279fdd5bdf957d8f23f9808a940a | https://github.com/kambo-1st/HttpMessage/blob/38877b9d895f279fdd5bdf957d8f23f9808a940a/src/ServerRequest.php#L491-L500 |
235,757 | Niirrty/Niirrty.Locale | src/Locale.php | Locale.Create | public static function Create(
Locale $fallbackLocale, bool $useUrlPath = true, array $acceptedRequestParams = [ 'locale', 'language', 'lang' ] )
: Locale
{
if ( $useUrlPath && static::TryParseUrlPath( $refLocale ) )
{
return $refLocale;
}
if ( Locale::TryParseBrowserIn... | php | public static function Create(
Locale $fallbackLocale, bool $useUrlPath = true, array $acceptedRequestParams = [ 'locale', 'language', 'lang' ] )
: Locale
{
if ( $useUrlPath && static::TryParseUrlPath( $refLocale ) )
{
return $refLocale;
}
if ( Locale::TryParseBrowserIn... | [
"public",
"static",
"function",
"Create",
"(",
"Locale",
"$",
"fallbackLocale",
",",
"bool",
"$",
"useUrlPath",
"=",
"true",
",",
"array",
"$",
"acceptedRequestParams",
"=",
"[",
"'locale'",
",",
"'language'",
",",
"'lang'",
"]",
")",
":",
"Locale",
"{",
"... | Creates a locale with all available methods. If no method can create a Locale the defined fallback locale is used.
First a locale
@param \Niirrty\Locale\Locale $fallbackLocale
@param bool $useUrlPath
@param array $acceptedRequestParams
@return \Niirrty\Locale\Locale | [
"Creates",
"a",
"locale",
"with",
"all",
"available",
"methods",
".",
"If",
"no",
"method",
"can",
"create",
"a",
"Locale",
"the",
"defined",
"fallback",
"locale",
"is",
"used",
"."
] | 704ac3b56734c0bbbe8e3b2e2f038242495704ab | https://github.com/Niirrty/Niirrty.Locale/blob/704ac3b56734c0bbbe8e3b2e2f038242495704ab/src/Locale.php#L659-L702 |
235,758 | jinraynor1/threading | src/Pcntl/ThreadQueue.php | ThreadQueue.cleanup | private function cleanup()
{
foreach ($this->threads as $i => $szal)
if (!$szal->isAlive()) {
$this->results[] = $this->threads[$i]->result;
unset($this->threads[$i]);
}
return count($this->threads);
} | php | private function cleanup()
{
foreach ($this->threads as $i => $szal)
if (!$szal->isAlive()) {
$this->results[] = $this->threads[$i]->result;
unset($this->threads[$i]);
}
return count($this->threads);
} | [
"private",
"function",
"cleanup",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"threads",
"as",
"$",
"i",
"=>",
"$",
"szal",
")",
"if",
"(",
"!",
"$",
"szal",
"->",
"isAlive",
"(",
")",
")",
"{",
"$",
"this",
"->",
"results",
"[",
"]",
"="... | Removes closed threads from queue | [
"Removes",
"closed",
"threads",
"from",
"queue"
] | 8b63c75fe4fcc2523d26f060a75af1694dd020d4 | https://github.com/jinraynor1/threading/blob/8b63c75fe4fcc2523d26f060a75af1694dd020d4/src/Pcntl/ThreadQueue.php#L59-L67 |
235,759 | jinraynor1/threading | src/Pcntl/ThreadQueue.php | ThreadQueue.tick | public function tick()
{
$this->cleanup();
if ((count($this->threads) < $this->queueSize) && count($this->jobs)) {
$this->threads[] = $szal = new Thread($this->callable, $this->message_length);
$szal->start(array_shift($this->jobs));
}
usleep(ThreadQueue::TI... | php | public function tick()
{
$this->cleanup();
if ((count($this->threads) < $this->queueSize) && count($this->jobs)) {
$this->threads[] = $szal = new Thread($this->callable, $this->message_length);
$szal->start(array_shift($this->jobs));
}
usleep(ThreadQueue::TI... | [
"public",
"function",
"tick",
"(",
")",
"{",
"$",
"this",
"->",
"cleanup",
"(",
")",
";",
"if",
"(",
"(",
"count",
"(",
"$",
"this",
"->",
"threads",
")",
"<",
"$",
"this",
"->",
"queueSize",
")",
"&&",
"count",
"(",
"$",
"this",
"->",
"jobs",
... | Starts new threads if needed
@return int queue size | [
"Starts",
"new",
"threads",
"if",
"needed"
] | 8b63c75fe4fcc2523d26f060a75af1694dd020d4 | https://github.com/jinraynor1/threading/blob/8b63c75fe4fcc2523d26f060a75af1694dd020d4/src/Pcntl/ThreadQueue.php#L76-L87 |
235,760 | vnejedly/database | src/Query/Param/MultiParam.php | MultiParam._transform | protected function _transform()
{
$index = 1;
foreach ($this->_values as $value) {
$paramName = "{$this->_name}_{$index}";
$this->_params[$paramName] = new Param($this->_type, $value);
$index++;
}
} | php | protected function _transform()
{
$index = 1;
foreach ($this->_values as $value) {
$paramName = "{$this->_name}_{$index}";
$this->_params[$paramName] = new Param($this->_type, $value);
$index++;
}
} | [
"protected",
"function",
"_transform",
"(",
")",
"{",
"$",
"index",
"=",
"1",
";",
"foreach",
"(",
"$",
"this",
"->",
"_values",
"as",
"$",
"value",
")",
"{",
"$",
"paramName",
"=",
"\"{$this->_name}_{$index}\"",
";",
"$",
"this",
"->",
"_params",
"[",
... | Transforms values to new params | [
"Transforms",
"values",
"to",
"new",
"params"
] | 015daae19cd497de6fecf6b1eb14bc7f48287a92 | https://github.com/vnejedly/database/blob/015daae19cd497de6fecf6b1eb14bc7f48287a92/src/Query/Param/MultiParam.php#L62-L70 |
235,761 | anklimsk/cakephp-basic-functions | Lib/Utility/Language.php | Language.getCurrentUiLang | public function getCurrentUiLang($isTwoLetter = false) {
$uiLcid3 = Configure::read('Config.language');
if (empty($uiLcid3)) {
$uiLcid3 = 'eng';
}
$uiLcid3 = mb_strtolower($uiLcid3);
if (!$isTwoLetter) {
return $uiLcid3;
}
return $this->convertLangCode($uiLcid3, 'iso639-1');
} | php | public function getCurrentUiLang($isTwoLetter = false) {
$uiLcid3 = Configure::read('Config.language');
if (empty($uiLcid3)) {
$uiLcid3 = 'eng';
}
$uiLcid3 = mb_strtolower($uiLcid3);
if (!$isTwoLetter) {
return $uiLcid3;
}
return $this->convertLangCode($uiLcid3, 'iso639-1');
} | [
"public",
"function",
"getCurrentUiLang",
"(",
"$",
"isTwoLetter",
"=",
"false",
")",
"{",
"$",
"uiLcid3",
"=",
"Configure",
"::",
"read",
"(",
"'Config.language'",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"uiLcid3",
")",
")",
"{",
"$",
"uiLcid3",
"=",
... | Get current UI language in format `ISO 639-1` or `ISO 693-2`
@param bool $isTwoLetter Flag of using `ISO 639-1` if True.
Use `ISO 693-2` otherwise.
@return string Current UI language | [
"Get",
"current",
"UI",
"language",
"in",
"format",
"ISO",
"639",
"-",
"1",
"or",
"ISO",
"693",
"-",
"2"
] | 7554e8b0b420fd3155593af7bf76b7ccbdc8701e | https://github.com/anklimsk/cakephp-basic-functions/blob/7554e8b0b420fd3155593af7bf76b7ccbdc8701e/Lib/Utility/Language.php#L60-L71 |
235,762 | anklimsk/cakephp-basic-functions | Lib/Utility/Language.php | Language.convertLangCode | public function convertLangCode($langCode = null, $output = null) {
$result = '';
if (empty($langCode) || empty($output)) {
return $result;
}
$cachePath = 'lang_code_info_' . md5(serialize(func_get_args()));
$cached = Cache::read($cachePath, CAKE_BASIC_FUNC_CACHE_KEY_LANG_CODE);
if (!empty($cached)) {
... | php | public function convertLangCode($langCode = null, $output = null) {
$result = '';
if (empty($langCode) || empty($output)) {
return $result;
}
$cachePath = 'lang_code_info_' . md5(serialize(func_get_args()));
$cached = Cache::read($cachePath, CAKE_BASIC_FUNC_CACHE_KEY_LANG_CODE);
if (!empty($cached)) {
... | [
"public",
"function",
"convertLangCode",
"(",
"$",
"langCode",
"=",
"null",
",",
"$",
"output",
"=",
"null",
")",
"{",
"$",
"result",
"=",
"''",
";",
"if",
"(",
"empty",
"(",
"$",
"langCode",
")",
"||",
"empty",
"(",
"$",
"output",
")",
")",
"{",
... | Convert language from format `ISO 693-2` to `ISO 639-1`
@param string $langCode Languge code for converting
@param string $output Output format:
- name: The international (often english) name of the language;
- native: The language name written in native representation/s;
- iso639-1: The ISO 639-1 (two-letters code) l... | [
"Convert",
"language",
"from",
"format",
"ISO",
"693",
"-",
"2",
"to",
"ISO",
"639",
"-",
"1"
] | 7554e8b0b420fd3155593af7bf76b7ccbdc8701e | https://github.com/anklimsk/cakephp-basic-functions/blob/7554e8b0b420fd3155593af7bf76b7ccbdc8701e/Lib/Utility/Language.php#L88-L106 |
235,763 | anklimsk/cakephp-basic-functions | Lib/Utility/Language.php | Language.getLangForNumberText | public function getLangForNumberText($langCode = null) {
$cachePath = 'lang_code_number_name_' . md5(serialize(func_get_args()));
$cached = Cache::read($cachePath, CAKE_BASIC_FUNC_CACHE_KEY_LANG_CODE);
if (!empty($cached)) {
return $cached;
}
if (!empty($langCode)) {
$langUI = $this->convertLangCode($l... | php | public function getLangForNumberText($langCode = null) {
$cachePath = 'lang_code_number_name_' . md5(serialize(func_get_args()));
$cached = Cache::read($cachePath, CAKE_BASIC_FUNC_CACHE_KEY_LANG_CODE);
if (!empty($cached)) {
return $cached;
}
if (!empty($langCode)) {
$langUI = $this->convertLangCode($l... | [
"public",
"function",
"getLangForNumberText",
"(",
"$",
"langCode",
"=",
"null",
")",
"{",
"$",
"cachePath",
"=",
"'lang_code_number_name_'",
".",
"md5",
"(",
"serialize",
"(",
"func_get_args",
"(",
")",
")",
")",
";",
"$",
"cached",
"=",
"Cache",
"::",
"r... | Return current UI language name for library Tools.NumberTextLib in format RFC5646.
@param string $langCode Languge code in format `ISO 639-1` or `ISO 639-2`
@return string Return language name in format RFC5646.
@link http://numbertext.org/ Universal number to text conversion languag | [
"Return",
"current",
"UI",
"language",
"name",
"for",
"library",
"Tools",
".",
"NumberTextLib",
"in",
"format",
"RFC5646",
"."
] | 7554e8b0b420fd3155593af7bf76b7ccbdc8701e | https://github.com/anklimsk/cakephp-basic-functions/blob/7554e8b0b420fd3155593af7bf76b7ccbdc8701e/Lib/Utility/Language.php#L115-L170 |
235,764 | zicht/goggle | src/Zicht/ConfigTool/Writer/Impl/AbstractTextWriter.php | AbstractTextWriter.toScalarTable | public static function toScalarTable($list)
{
return iter\iterable($list)
->map(
function ($record) {
return self::toScalarValues($record);
}
);
} | php | public static function toScalarTable($list)
{
return iter\iterable($list)
->map(
function ($record) {
return self::toScalarValues($record);
}
);
} | [
"public",
"static",
"function",
"toScalarTable",
"(",
"$",
"list",
")",
"{",
"return",
"iter",
"\\",
"iterable",
"(",
"$",
"list",
")",
"->",
"map",
"(",
"function",
"(",
"$",
"record",
")",
"{",
"return",
"self",
"::",
"toScalarValues",
"(",
"$",
"rec... | Helper to convert a n-dimensional array with n > 2 to all scalar values
@param mixed[][] $list
@return string[][] | [
"Helper",
"to",
"convert",
"a",
"n",
"-",
"dimensional",
"array",
"with",
"n",
">",
"2",
"to",
"all",
"scalar",
"values"
] | f3b42bda9d3821ef2d387aef1091cba8afe2cff2 | https://github.com/zicht/goggle/blob/f3b42bda9d3821ef2d387aef1091cba8afe2cff2/src/Zicht/ConfigTool/Writer/Impl/AbstractTextWriter.php#L45-L53 |
235,765 | razielsd/webdriverlib | WebDriver/WebDriver.php | WebDriver.forward | public function forward()
{
$this->getDriver()->curl($this->getDriver()->factoryCommand('forward', WebDriver_Command::METHOD_POST));
return $this;
} | php | public function forward()
{
$this->getDriver()->curl($this->getDriver()->factoryCommand('forward', WebDriver_Command::METHOD_POST));
return $this;
} | [
"public",
"function",
"forward",
"(",
")",
"{",
"$",
"this",
"->",
"getDriver",
"(",
")",
"->",
"curl",
"(",
"$",
"this",
"->",
"getDriver",
"(",
")",
"->",
"factoryCommand",
"(",
"'forward'",
",",
"WebDriver_Command",
"::",
"METHOD_POST",
")",
")",
";",... | Navigate forwards in the browser history, if possible. | [
"Navigate",
"forwards",
"in",
"the",
"browser",
"history",
"if",
"possible",
"."
] | e498afc36a8cdeab5b6ca95016420557baf32f36 | https://github.com/razielsd/webdriverlib/blob/e498afc36a8cdeab5b6ca95016420557baf32f36/WebDriver/WebDriver.php#L310-L314 |
235,766 | razielsd/webdriverlib | WebDriver/WebDriver.php | WebDriver.back | public function back()
{
$this->getDriver()->curl($this->getDriver()->factoryCommand('back', WebDriver_Command::METHOD_POST));
return $this;
} | php | public function back()
{
$this->getDriver()->curl($this->getDriver()->factoryCommand('back', WebDriver_Command::METHOD_POST));
return $this;
} | [
"public",
"function",
"back",
"(",
")",
"{",
"$",
"this",
"->",
"getDriver",
"(",
")",
"->",
"curl",
"(",
"$",
"this",
"->",
"getDriver",
"(",
")",
"->",
"factoryCommand",
"(",
"'back'",
",",
"WebDriver_Command",
"::",
"METHOD_POST",
")",
")",
";",
"re... | Navigate backwards in the browser history, if possible. | [
"Navigate",
"backwards",
"in",
"the",
"browser",
"history",
"if",
"possible",
"."
] | e498afc36a8cdeab5b6ca95016420557baf32f36 | https://github.com/razielsd/webdriverlib/blob/e498afc36a8cdeab5b6ca95016420557baf32f36/WebDriver/WebDriver.php#L320-L324 |
235,767 | razielsd/webdriverlib | WebDriver/WebDriver.php | WebDriver.refresh | public function refresh()
{
$this->getDriver()->curl($this->getDriver()->factoryCommand('refresh', WebDriver_Command::METHOD_POST));
return $this;
} | php | public function refresh()
{
$this->getDriver()->curl($this->getDriver()->factoryCommand('refresh', WebDriver_Command::METHOD_POST));
return $this;
} | [
"public",
"function",
"refresh",
"(",
")",
"{",
"$",
"this",
"->",
"getDriver",
"(",
")",
"->",
"curl",
"(",
"$",
"this",
"->",
"getDriver",
"(",
")",
"->",
"factoryCommand",
"(",
"'refresh'",
",",
"WebDriver_Command",
"::",
"METHOD_POST",
")",
")",
";",... | Refresh the current page. | [
"Refresh",
"the",
"current",
"page",
"."
] | e498afc36a8cdeab5b6ca95016420557baf32f36 | https://github.com/razielsd/webdriverlib/blob/e498afc36a8cdeab5b6ca95016420557baf32f36/WebDriver/WebDriver.php#L330-L334 |
235,768 | razielsd/webdriverlib | WebDriver/WebDriver.php | WebDriver.execute | public function execute($js, $args = [])
{
$params = ['script' => $js, 'args' => $args];
$result = $this->getDriver()->curl(
$this->getDriver()->factoryCommand('execute', WebDriver_Command::METHOD_POST, $params)
);
return isset($result['value'])?$result['value']:false;
... | php | public function execute($js, $args = [])
{
$params = ['script' => $js, 'args' => $args];
$result = $this->getDriver()->curl(
$this->getDriver()->factoryCommand('execute', WebDriver_Command::METHOD_POST, $params)
);
return isset($result['value'])?$result['value']:false;
... | [
"public",
"function",
"execute",
"(",
"$",
"js",
",",
"$",
"args",
"=",
"[",
"]",
")",
"{",
"$",
"params",
"=",
"[",
"'script'",
"=>",
"$",
"js",
",",
"'args'",
"=>",
"$",
"args",
"]",
";",
"$",
"result",
"=",
"$",
"this",
"->",
"getDriver",
"(... | Inject a snippet of JavaScript into the page for execution in the context of the currently selected frame
@param string $js
@param array $args
@return mixed | [
"Inject",
"a",
"snippet",
"of",
"JavaScript",
"into",
"the",
"page",
"for",
"execution",
"in",
"the",
"context",
"of",
"the",
"currently",
"selected",
"frame"
] | e498afc36a8cdeab5b6ca95016420557baf32f36 | https://github.com/razielsd/webdriverlib/blob/e498afc36a8cdeab5b6ca95016420557baf32f36/WebDriver/WebDriver.php#L344-L351 |
235,769 | razielsd/webdriverlib | WebDriver/WebDriver.php | WebDriver.screenshotAsImage | public function screenshotAsImage($asBase64 = false)
{
$image = $this->getDriver()->curl(
$this->getDriver()->factoryCommand('screenshot', WebDriver_Command::METHOD_GET)
);
$image = $image['value'];
if (!$asBase64) {
$image = base64_decode($image);
}
... | php | public function screenshotAsImage($asBase64 = false)
{
$image = $this->getDriver()->curl(
$this->getDriver()->factoryCommand('screenshot', WebDriver_Command::METHOD_GET)
);
$image = $image['value'];
if (!$asBase64) {
$image = base64_decode($image);
}
... | [
"public",
"function",
"screenshotAsImage",
"(",
"$",
"asBase64",
"=",
"false",
")",
"{",
"$",
"image",
"=",
"$",
"this",
"->",
"getDriver",
"(",
")",
"->",
"curl",
"(",
"$",
"this",
"->",
"getDriver",
"(",
")",
"->",
"factoryCommand",
"(",
"'screenshot'"... | Returns screenshot of current page as binary string.
@param bool $asBase64 - return base64 data, "as is" from server
@return string; | [
"Returns",
"screenshot",
"of",
"current",
"page",
"as",
"binary",
"string",
"."
] | e498afc36a8cdeab5b6ca95016420557baf32f36 | https://github.com/razielsd/webdriverlib/blob/e498afc36a8cdeab5b6ca95016420557baf32f36/WebDriver/WebDriver.php#L384-L394 |
235,770 | razielsd/webdriverlib | WebDriver/WebDriver.php | WebDriver.findAll | public function findAll($locator, $parent = null)
{
$commandUri = empty($parent) ? "elements" : "element/{$parent->getElementId()}/elements";
$command = $this->getDriver()->factoryCommand(
$commandUri,
WebDriver_Command::METHOD_POST,
WebDriver_Util::parseLocator($... | php | public function findAll($locator, $parent = null)
{
$commandUri = empty($parent) ? "elements" : "element/{$parent->getElementId()}/elements";
$command = $this->getDriver()->factoryCommand(
$commandUri,
WebDriver_Command::METHOD_POST,
WebDriver_Util::parseLocator($... | [
"public",
"function",
"findAll",
"(",
"$",
"locator",
",",
"$",
"parent",
"=",
"null",
")",
"{",
"$",
"commandUri",
"=",
"empty",
"(",
"$",
"parent",
")",
"?",
"\"elements\"",
":",
"\"element/{$parent->getElementId()}/elements\"",
";",
"$",
"command",
"=",
"... | Search for multiple elements on the page
@param $locator
@param WebDriver_Element $parent
@throws WebDriver_Exception
@return WebDriver_Element[] | [
"Search",
"for",
"multiple",
"elements",
"on",
"the",
"page"
] | e498afc36a8cdeab5b6ca95016420557baf32f36 | https://github.com/razielsd/webdriverlib/blob/e498afc36a8cdeab5b6ca95016420557baf32f36/WebDriver/WebDriver.php#L420-L440 |
235,771 | razielsd/webdriverlib | WebDriver/WebDriver.php | WebDriver.keys | public function keys($charList)
{
$this->getDriver()->curl(
$this->getDriver()->factoryCommand(
'keys',
WebDriver_Command::METHOD_POST,
['value' => WebDriver_Util::prepareKeyStrokes($charList)]
)
);
return $this;
} | php | public function keys($charList)
{
$this->getDriver()->curl(
$this->getDriver()->factoryCommand(
'keys',
WebDriver_Command::METHOD_POST,
['value' => WebDriver_Util::prepareKeyStrokes($charList)]
)
);
return $this;
} | [
"public",
"function",
"keys",
"(",
"$",
"charList",
")",
"{",
"$",
"this",
"->",
"getDriver",
"(",
")",
"->",
"curl",
"(",
"$",
"this",
"->",
"getDriver",
"(",
")",
"->",
"factoryCommand",
"(",
"'keys'",
",",
"WebDriver_Command",
"::",
"METHOD_POST",
","... | Sends keystroke sequence. Active modifiers are not cancelled after call, which lets to use them
with mouse events.
@param array|int|string $charList
@return $this
@throws WebDriver_Exception | [
"Sends",
"keystroke",
"sequence",
".",
"Active",
"modifiers",
"are",
"not",
"cancelled",
"after",
"call",
"which",
"lets",
"to",
"use",
"them",
"with",
"mouse",
"events",
"."
] | e498afc36a8cdeab5b6ca95016420557baf32f36 | https://github.com/razielsd/webdriverlib/blob/e498afc36a8cdeab5b6ca95016420557baf32f36/WebDriver/WebDriver.php#L480-L490 |
235,772 | razielsd/webdriverlib | WebDriver/WebDriver.php | WebDriver.source | public function source()
{
$command = $this->getDriver()->factoryCommand('source', WebDriver_Command::METHOD_GET);
$result = $this->getDriver()->curl($command);
return $result['value'];
} | php | public function source()
{
$command = $this->getDriver()->factoryCommand('source', WebDriver_Command::METHOD_GET);
$result = $this->getDriver()->curl($command);
return $result['value'];
} | [
"public",
"function",
"source",
"(",
")",
"{",
"$",
"command",
"=",
"$",
"this",
"->",
"getDriver",
"(",
")",
"->",
"factoryCommand",
"(",
"'source'",
",",
"WebDriver_Command",
"::",
"METHOD_GET",
")",
";",
"$",
"result",
"=",
"$",
"this",
"->",
"getDriv... | Get the current page source.
@return string | [
"Get",
"the",
"current",
"page",
"source",
"."
] | e498afc36a8cdeab5b6ca95016420557baf32f36 | https://github.com/razielsd/webdriverlib/blob/e498afc36a8cdeab5b6ca95016420557baf32f36/WebDriver/WebDriver.php#L507-L512 |
235,773 | razielsd/webdriverlib | WebDriver/WebDriver.php | WebDriver.cache | public function cache()
{
if (null === $this->cache) {
$this->cache = new WebDriver_Cache($this);
}
return $this->cache;
} | php | public function cache()
{
if (null === $this->cache) {
$this->cache = new WebDriver_Cache($this);
}
return $this->cache;
} | [
"public",
"function",
"cache",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"cache",
")",
"{",
"$",
"this",
"->",
"cache",
"=",
"new",
"WebDriver_Cache",
"(",
"$",
"this",
")",
";",
"}",
"return",
"$",
"this",
"->",
"cache",
";",
"... | Get current context.
@return WebDriver_Cache | [
"Get",
"current",
"context",
"."
] | e498afc36a8cdeab5b6ca95016420557baf32f36 | https://github.com/razielsd/webdriverlib/blob/e498afc36a8cdeab5b6ca95016420557baf32f36/WebDriver/WebDriver.php#L533-L539 |
235,774 | in2pire/in2pire-utility | NestedArray.php | NestedArray.mergeDeepArray | public static function mergeDeepArray(array $arrays, $preserve_integer_keys = false)
{
$result = [];
foreach ($arrays as $array) {
foreach ($array as $key => $value) {
if (is_integer($key) && !$preserve_integer_keys) {
// Renumber integer keys as arra... | php | public static function mergeDeepArray(array $arrays, $preserve_integer_keys = false)
{
$result = [];
foreach ($arrays as $array) {
foreach ($array as $key => $value) {
if (is_integer($key) && !$preserve_integer_keys) {
// Renumber integer keys as arra... | [
"public",
"static",
"function",
"mergeDeepArray",
"(",
"array",
"$",
"arrays",
",",
"$",
"preserve_integer_keys",
"=",
"false",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"arrays",
"as",
"$",
"array",
")",
"{",
"foreach",
"(",
"$... | Merges multiple arrays, recursively, and returns the merged array.
This function is equivalent to NestedArray::mergeDeep(), except the
input arrays are passed as a single array parameter rather than a variable
parameter list.
The following are equivalent:
- NestedArray::mergeDeep($a, $b);
- NestedArray::mergeDeepArra... | [
"Merges",
"multiple",
"arrays",
"recursively",
"and",
"returns",
"the",
"merged",
"array",
"."
] | c16776e98ef45bd9733dd508ec07e38daf9b875f | https://github.com/in2pire/in2pire-utility/blob/c16776e98ef45bd9733dd508ec07e38daf9b875f/NestedArray.php#L353-L375 |
235,775 | emaphp/eMapper | lib/eMapper/ORM/Dynamic/DynamicAttribute.php | DynamicAttribute.parseArguments | protected function parseArguments(AnnotationBag $propertyAnnotations) {
$this->args = [];
//parse additional arguments
$parameters = $propertyAnnotations->find('Param');
foreach ($parameters as $param) {
if ($param->hasArgument()) {
$arg = $param->getArgument();
if (strtolower($arg) == 'se... | php | protected function parseArguments(AnnotationBag $propertyAnnotations) {
$this->args = [];
//parse additional arguments
$parameters = $propertyAnnotations->find('Param');
foreach ($parameters as $param) {
if ($param->hasArgument()) {
$arg = $param->getArgument();
if (strtolower($arg) == 'se... | [
"protected",
"function",
"parseArguments",
"(",
"AnnotationBag",
"$",
"propertyAnnotations",
")",
"{",
"$",
"this",
"->",
"args",
"=",
"[",
"]",
";",
"//parse additional arguments",
"$",
"parameters",
"=",
"$",
"propertyAnnotations",
"->",
"find",
"(",
"'Param'",
... | Parses attribute argument list
@param \Omocha\AnnotationBag $propertyAnnotations | [
"Parses",
"attribute",
"argument",
"list"
] | df7100e601d2a1363d07028a786b6ceb22271829 | https://github.com/emaphp/eMapper/blob/df7100e601d2a1363d07028a786b6ceb22271829/lib/eMapper/ORM/Dynamic/DynamicAttribute.php#L82-L104 |
235,776 | emaphp/eMapper | lib/eMapper/ORM/Dynamic/DynamicAttribute.php | DynamicAttribute.parseConfig | protected function parseConfig(AnnotationBag $propertyAnnotations) {
$this->config = [];
//mapping type expression
if (isset($this->type))
$this->config['map.type'] = $this->type;
//result map
if ($propertyAnnotations->has('ResultMap'))
$this->config['map.result'] = $propertyAnnotations->get('Resu... | php | protected function parseConfig(AnnotationBag $propertyAnnotations) {
$this->config = [];
//mapping type expression
if (isset($this->type))
$this->config['map.type'] = $this->type;
//result map
if ($propertyAnnotations->has('ResultMap'))
$this->config['map.result'] = $propertyAnnotations->get('Resu... | [
"protected",
"function",
"parseConfig",
"(",
"AnnotationBag",
"$",
"propertyAnnotations",
")",
"{",
"$",
"this",
"->",
"config",
"=",
"[",
"]",
";",
"//mapping type expression",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"type",
")",
")",
"$",
"this",
"->... | Parses attribute configuration
@param \Omocha\AnnotationBag $propertyAnnotations | [
"Parses",
"attribute",
"configuration"
] | df7100e601d2a1363d07028a786b6ceb22271829 | https://github.com/emaphp/eMapper/blob/df7100e601d2a1363d07028a786b6ceb22271829/lib/eMapper/ORM/Dynamic/DynamicAttribute.php#L110-L159 |
235,777 | emaphp/eMapper | lib/eMapper/ORM/Dynamic/DynamicAttribute.php | DynamicAttribute.evaluateCondition | protected function evaluateCondition($row, $config) {
if (isset($this->condition))
return call_user_func($this->condition, $row, $config);
return true;
} | php | protected function evaluateCondition($row, $config) {
if (isset($this->condition))
return call_user_func($this->condition, $row, $config);
return true;
} | [
"protected",
"function",
"evaluateCondition",
"(",
"$",
"row",
",",
"$",
"config",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"condition",
")",
")",
"return",
"call_user_func",
"(",
"$",
"this",
"->",
"condition",
",",
"$",
"row",
",",
"$",
... | Evaluates attribute condition
@param array | object $row
@param array $config
@return bool | [
"Evaluates",
"attribute",
"condition"
] | df7100e601d2a1363d07028a786b6ceb22271829 | https://github.com/emaphp/eMapper/blob/df7100e601d2a1363d07028a786b6ceb22271829/lib/eMapper/ORM/Dynamic/DynamicAttribute.php#L189-L193 |
235,778 | activecollab/payments | src/Subscription/SubscriptionEvent/Implementation.php | Implementation.getSubscription | public function getSubscription()
{
if ($this->getGateway() instanceof GatewayInterface) {
return $this->getGateway()->getSubscriptionByReference($this->getSubscriptionReference());
}
throw new RuntimeException('Gateway is not set');
} | php | public function getSubscription()
{
if ($this->getGateway() instanceof GatewayInterface) {
return $this->getGateway()->getSubscriptionByReference($this->getSubscriptionReference());
}
throw new RuntimeException('Gateway is not set');
} | [
"public",
"function",
"getSubscription",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getGateway",
"(",
")",
"instanceof",
"GatewayInterface",
")",
"{",
"return",
"$",
"this",
"->",
"getGateway",
"(",
")",
"->",
"getSubscriptionByReference",
"(",
"$",
"this... | Return subscription by subscription reference.
@return SubscriptionInterface | [
"Return",
"subscription",
"by",
"subscription",
"reference",
"."
] | 9fab8060ccc496756cf6aed36e3006acfa0c1546 | https://github.com/activecollab/payments/blob/9fab8060ccc496756cf6aed36e3006acfa0c1546/src/Subscription/SubscriptionEvent/Implementation.php#L42-L49 |
235,779 | ideil/generic-file | src/Tools/Hasher.php | Hasher.file | public function file(SplFileInfo $file)
{
return substr($this->base(hash_file('sha256', $file->getRealPath(), true)), 0, 32);
} | php | public function file(SplFileInfo $file)
{
return substr($this->base(hash_file('sha256', $file->getRealPath(), true)), 0, 32);
} | [
"public",
"function",
"file",
"(",
"SplFileInfo",
"$",
"file",
")",
"{",
"return",
"substr",
"(",
"$",
"this",
"->",
"base",
"(",
"hash_file",
"(",
"'sha256'",
",",
"$",
"file",
"->",
"getRealPath",
"(",
")",
",",
"true",
")",
")",
",",
"0",
",",
"... | Make hash from uploaded file.
@param SplFileInfo $file
@return string | [
"Make",
"hash",
"from",
"uploaded",
"file",
"."
] | 0506ab15dc88f2acbd59c99d6c679a670735d0f9 | https://github.com/ideil/generic-file/blob/0506ab15dc88f2acbd59c99d6c679a670735d0f9/src/Tools/Hasher.php#L15-L18 |
235,780 | arvici/framework | src/Arvici/Heart/Database/Query/Parser.php | Parser.parse | private function parse()
{
// Skip if already parsed!
if ($this->parsed) {
return;
}
// Type switch
switch($this->query->mode){
case Query::MODE_SELECT:
$this->parseSelectQuery(); break;
case Query::MODE_INSERT:
... | php | private function parse()
{
// Skip if already parsed!
if ($this->parsed) {
return;
}
// Type switch
switch($this->query->mode){
case Query::MODE_SELECT:
$this->parseSelectQuery(); break;
case Query::MODE_INSERT:
... | [
"private",
"function",
"parse",
"(",
")",
"{",
"// Skip if already parsed!",
"if",
"(",
"$",
"this",
"->",
"parsed",
")",
"{",
"return",
";",
"}",
"// Type switch",
"switch",
"(",
"$",
"this",
"->",
"query",
"->",
"mode",
")",
"{",
"case",
"Query",
"::",... | Parse the Query object.
@throws QueryBuilderParseException
@throws \Exception | [
"Parse",
"the",
"Query",
"object",
"."
] | 4d0933912fef8f9edc756ef1ace009e96d9fc4b1 | https://github.com/arvici/framework/blob/4d0933912fef8f9edc756ef1ace009e96d9fc4b1/src/Arvici/Heart/Database/Query/Parser.php#L95-L125 |
235,781 | arvici/framework | src/Arvici/Heart/Database/Query/Parser.php | Parser.parseSelectQuery | private function parseSelectQuery()
{
// Parse select ?
$selectSql = Column::generateQueryString($this->query->select);
// Parse table
$fromSql = Table::generateQueryString($this->query->table);
$whereSql = null;
$whereBind = array();
$sql = [
... | php | private function parseSelectQuery()
{
// Parse select ?
$selectSql = Column::generateQueryString($this->query->select);
// Parse table
$fromSql = Table::generateQueryString($this->query->table);
$whereSql = null;
$whereBind = array();
$sql = [
... | [
"private",
"function",
"parseSelectQuery",
"(",
")",
"{",
"// Parse select ?",
"$",
"selectSql",
"=",
"Column",
"::",
"generateQueryString",
"(",
"$",
"this",
"->",
"query",
"->",
"select",
")",
";",
"// Parse table",
"$",
"fromSql",
"=",
"Table",
"::",
"gener... | Select Mode Parser. | [
"Select",
"Mode",
"Parser",
"."
] | 4d0933912fef8f9edc756ef1ace009e96d9fc4b1 | https://github.com/arvici/framework/blob/4d0933912fef8f9edc756ef1ace009e96d9fc4b1/src/Arvici/Heart/Database/Query/Parser.php#L131-L156 |
235,782 | arvici/framework | src/Arvici/Heart/Database/Query/Parser.php | Parser.combineSelectQuery | private function combineSelectQuery($sqlParts)
{
// Add select columns and tables.
$output = "SELECT " . $sqlParts['select'] . " FROM " . $sqlParts['from'];
// Add where when defined.
if ($sqlParts['where'] !== null) {
// Add where
$output .= " WHERE " . $sql... | php | private function combineSelectQuery($sqlParts)
{
// Add select columns and tables.
$output = "SELECT " . $sqlParts['select'] . " FROM " . $sqlParts['from'];
// Add where when defined.
if ($sqlParts['where'] !== null) {
// Add where
$output .= " WHERE " . $sql... | [
"private",
"function",
"combineSelectQuery",
"(",
"$",
"sqlParts",
")",
"{",
"// Add select columns and tables.",
"$",
"output",
"=",
"\"SELECT \"",
".",
"$",
"sqlParts",
"[",
"'select'",
"]",
".",
"\" FROM \"",
".",
"$",
"sqlParts",
"[",
"'from'",
"]",
";",
"... | Combine select query.
@param array $sqlParts
@return string | [
"Combine",
"select",
"query",
"."
] | 4d0933912fef8f9edc756ef1ace009e96d9fc4b1 | https://github.com/arvici/framework/blob/4d0933912fef8f9edc756ef1ace009e96d9fc4b1/src/Arvici/Heart/Database/Query/Parser.php#L165-L180 |
235,783 | ManifestWebDesign/dabl-adapter | src/Propel/Model/Diff/PropelIndexComparator.php | PropelIndexComparator.computeDiff | static public function computeDiff(Index $fromIndex, Index $toIndex, $caseInsensitive = false)
{
// Check for removed index columns in $toIndex
$fromIndexColumns = $fromIndex->getColumns();
for($i = 0; $i < count($fromIndexColumns); $i++) {
$indexColumn = $fromIndexColumns[$i];
if (!$toIndex->hasColumnAtPo... | php | static public function computeDiff(Index $fromIndex, Index $toIndex, $caseInsensitive = false)
{
// Check for removed index columns in $toIndex
$fromIndexColumns = $fromIndex->getColumns();
for($i = 0; $i < count($fromIndexColumns); $i++) {
$indexColumn = $fromIndexColumns[$i];
if (!$toIndex->hasColumnAtPo... | [
"static",
"public",
"function",
"computeDiff",
"(",
"Index",
"$",
"fromIndex",
",",
"Index",
"$",
"toIndex",
",",
"$",
"caseInsensitive",
"=",
"false",
")",
"{",
"// Check for removed index columns in $toIndex",
"$",
"fromIndexColumns",
"=",
"$",
"fromIndex",
"->",
... | Compute the difference between two index objects
@param Index $fromIndex
@param Index $toIndex
@param boolean $caseInsensitive Whether the comparison is case insensitive.
False by default.
@return boolean false if the two indices are similar, true if they have differences | [
"Compute",
"the",
"difference",
"between",
"two",
"index",
"objects"
] | 98579ed23bec832d764e762ee2f93f0a88ef9cd3 | https://github.com/ManifestWebDesign/dabl-adapter/blob/98579ed23bec832d764e762ee2f93f0a88ef9cd3/src/Propel/Model/Diff/PropelIndexComparator.php#L33-L59 |
235,784 | jelix/php-redis-plugin | plugins/cache/redis_php/redis_php.cache.php | redis_phpCacheDriver.get | public function get($key) {
$used_key = $this->getUsedKey($key);
$res = $this->redis->get($used_key);
if ($res === null)
return false;
$res = $this->unesc($res);
if (is_array($key)) {
return array_combine($key, $res);
}
else {
r... | php | public function get($key) {
$used_key = $this->getUsedKey($key);
$res = $this->redis->get($used_key);
if ($res === null)
return false;
$res = $this->unesc($res);
if (is_array($key)) {
return array_combine($key, $res);
}
else {
r... | [
"public",
"function",
"get",
"(",
"$",
"key",
")",
"{",
"$",
"used_key",
"=",
"$",
"this",
"->",
"getUsedKey",
"(",
"$",
"key",
")",
";",
"$",
"res",
"=",
"$",
"this",
"->",
"redis",
"->",
"get",
"(",
"$",
"used_key",
")",
";",
"if",
"(",
"$",
... | read a specific data in the cache.
@param mixed $key key or array of keys used for storing data in the cache
@return mixed $data array of data or false if failure | [
"read",
"a",
"specific",
"data",
"in",
"the",
"cache",
"."
] | bcb6f4a5265eeecfcfa8448f1b8571a9c336f92b | https://github.com/jelix/php-redis-plugin/blob/bcb6f4a5265eeecfcfa8448f1b8571a9c336f92b/plugins/cache/redis_php/redis_php.cache.php#L130-L142 |
235,785 | jelix/php-redis-plugin | plugins/cache/redis_php/redis_php.cache.php | redis_phpCacheDriver.set | public function set($key, $value, $ttl = 0) {
if (is_resource($value)) {
return false;
}
$used_key = $this->getUsedKey($key);
$res = $this->redis->set($used_key, $this->esc($value));
if ($res !== 'OK') {
return false;
}
if ($ttl === 0) {
... | php | public function set($key, $value, $ttl = 0) {
if (is_resource($value)) {
return false;
}
$used_key = $this->getUsedKey($key);
$res = $this->redis->set($used_key, $this->esc($value));
if ($res !== 'OK') {
return false;
}
if ($ttl === 0) {
... | [
"public",
"function",
"set",
"(",
"$",
"key",
",",
"$",
"value",
",",
"$",
"ttl",
"=",
"0",
")",
"{",
"if",
"(",
"is_resource",
"(",
"$",
"value",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"used_key",
"=",
"$",
"this",
"->",
"getUsedKey",
... | set a specific data in the cache
@param string $key key used for storing data
@param mixed $var data to store
@param int $ttl data time expiration
@return boolean false if failure | [
"set",
"a",
"specific",
"data",
"in",
"the",
"cache"
] | bcb6f4a5265eeecfcfa8448f1b8571a9c336f92b | https://github.com/jelix/php-redis-plugin/blob/bcb6f4a5265eeecfcfa8448f1b8571a9c336f92b/plugins/cache/redis_php/redis_php.cache.php#L151-L173 |
235,786 | jelix/php-redis-plugin | plugins/cache/redis_php/redis_php.cache.php | redis_phpCacheDriver.delete | public function delete($key) {
$used_key = $this->getUsedKey($key);
return ($this->redis->delete($used_key) > 0);
} | php | public function delete($key) {
$used_key = $this->getUsedKey($key);
return ($this->redis->delete($used_key) > 0);
} | [
"public",
"function",
"delete",
"(",
"$",
"key",
")",
"{",
"$",
"used_key",
"=",
"$",
"this",
"->",
"getUsedKey",
"(",
"$",
"key",
")",
";",
"return",
"(",
"$",
"this",
"->",
"redis",
"->",
"delete",
"(",
"$",
"used_key",
")",
">",
"0",
")",
";",... | delete a specific data in the cache
@param string $key key used for storing data in the cache
@return boolean false if failure | [
"delete",
"a",
"specific",
"data",
"in",
"the",
"cache"
] | bcb6f4a5265eeecfcfa8448f1b8571a9c336f92b | https://github.com/jelix/php-redis-plugin/blob/bcb6f4a5265eeecfcfa8448f1b8571a9c336f92b/plugins/cache/redis_php/redis_php.cache.php#L180-L183 |
235,787 | jelix/php-redis-plugin | plugins/cache/redis_php/redis_php.cache.php | redis_phpCacheDriver.flush | public function flush() {
if (!$this->key_prefix) {
return ($this->redis->flushdb() == 'OK');
}
switch($this->key_prefix_flush_method) {
case 'direct':
$this->redis->flushByPrefix($this->key_prefix);
return true;
case 'event':
... | php | public function flush() {
if (!$this->key_prefix) {
return ($this->redis->flushdb() == 'OK');
}
switch($this->key_prefix_flush_method) {
case 'direct':
$this->redis->flushByPrefix($this->key_prefix);
return true;
case 'event':
... | [
"public",
"function",
"flush",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"key_prefix",
")",
"{",
"return",
"(",
"$",
"this",
"->",
"redis",
"->",
"flushdb",
"(",
")",
"==",
"'OK'",
")",
";",
"}",
"switch",
"(",
"$",
"this",
"->",
"key_pre... | clear all data in the cache.
If key_prefix is set, only keys with that prefix will be removed.
Note that in that case, it can result in a huge performance issue.
See key_prefix_flush_method to configure the best method for your
app and your server.
@return boolean false if failure | [
"clear",
"all",
"data",
"in",
"the",
"cache",
"."
] | bcb6f4a5265eeecfcfa8448f1b8571a9c336f92b | https://github.com/jelix/php-redis-plugin/blob/bcb6f4a5265eeecfcfa8448f1b8571a9c336f92b/plugins/cache/redis_php/redis_php.cache.php#L266-L283 |
235,788 | lazyguru/jira | src/JiraService.php | JiraService.setWorklog | public function setWorklog($date, $ticket, $timeSpent, $comment = '')
{
$this->uri = "{$this->site}/rest/api/2/issue/{$ticket}/worklog";
if (is_numeric($timeSpent)) {
$timeSpent .= 'h';
}
$startedDate = $this->_formatTimestamp($date);
$data = [
'time... | php | public function setWorklog($date, $ticket, $timeSpent, $comment = '')
{
$this->uri = "{$this->site}/rest/api/2/issue/{$ticket}/worklog";
if (is_numeric($timeSpent)) {
$timeSpent .= 'h';
}
$startedDate = $this->_formatTimestamp($date);
$data = [
'time... | [
"public",
"function",
"setWorklog",
"(",
"$",
"date",
",",
"$",
"ticket",
",",
"$",
"timeSpent",
",",
"$",
"comment",
"=",
"''",
")",
"{",
"$",
"this",
"->",
"uri",
"=",
"\"{$this->site}/rest/api/2/issue/{$ticket}/worklog\"",
";",
"if",
"(",
"is_numeric",
"(... | Create worklog entry in Jira
@param array $site
@param string $date
@param string $ticket
@param mixed $timeSpent
@param string $comment
@throws Exception
@return mixed | [
"Create",
"worklog",
"entry",
"in",
"Jira"
] | 79e5e1f2b2c65b45faae5f8fe0f045e3eaba048b | https://github.com/lazyguru/jira/blob/79e5e1f2b2c65b45faae5f8fe0f045e3eaba048b/src/JiraService.php#L48-L69 |
235,789 | tenside/core | src/Task/Composer/ComposerTaskFactory.php | ComposerTaskFactory.createUpgrade | protected function createUpgrade($metaData)
{
$this->ensureHomePath($metaData);
if (!$metaData->has(UpgradeTask::SETTING_DATA_DIR)) {
$metaData->set(UpgradeTask::SETTING_DATA_DIR, $this->home->tensideDataDir());
}
return new UpgradeTask($metaData);
} | php | protected function createUpgrade($metaData)
{
$this->ensureHomePath($metaData);
if (!$metaData->has(UpgradeTask::SETTING_DATA_DIR)) {
$metaData->set(UpgradeTask::SETTING_DATA_DIR, $this->home->tensideDataDir());
}
return new UpgradeTask($metaData);
} | [
"protected",
"function",
"createUpgrade",
"(",
"$",
"metaData",
")",
"{",
"$",
"this",
"->",
"ensureHomePath",
"(",
"$",
"metaData",
")",
";",
"if",
"(",
"!",
"$",
"metaData",
"->",
"has",
"(",
"UpgradeTask",
"::",
"SETTING_DATA_DIR",
")",
")",
"{",
"$",... | Create an upgrade task instance.
@param JsonArray $metaData The meta data for the task.
@return UpgradeTask | [
"Create",
"an",
"upgrade",
"task",
"instance",
"."
] | 56422fa8cdecf03cb431bb6654c2942ade39bf7b | https://github.com/tenside/core/blob/56422fa8cdecf03cb431bb6654c2942ade39bf7b/src/Task/Composer/ComposerTaskFactory.php#L68-L75 |
235,790 | tenside/core | src/Task/Composer/ComposerTaskFactory.php | ComposerTaskFactory.ensureHomePath | private function ensureHomePath(JsonArray $metaData)
{
if ($metaData->has(AbstractPackageManipulatingTask::SETTING_HOME)) {
return;
}
$metaData->set(AbstractPackageManipulatingTask::SETTING_HOME, $this->home->homeDir());
} | php | private function ensureHomePath(JsonArray $metaData)
{
if ($metaData->has(AbstractPackageManipulatingTask::SETTING_HOME)) {
return;
}
$metaData->set(AbstractPackageManipulatingTask::SETTING_HOME, $this->home->homeDir());
} | [
"private",
"function",
"ensureHomePath",
"(",
"JsonArray",
"$",
"metaData",
")",
"{",
"if",
"(",
"$",
"metaData",
"->",
"has",
"(",
"AbstractPackageManipulatingTask",
"::",
"SETTING_HOME",
")",
")",
"{",
"return",
";",
"}",
"$",
"metaData",
"->",
"set",
"(",... | Ensure the home path has been set in the passed meta data.
@param JsonArray $metaData The meta data to examine.
@return void | [
"Ensure",
"the",
"home",
"path",
"has",
"been",
"set",
"in",
"the",
"passed",
"meta",
"data",
"."
] | 56422fa8cdecf03cb431bb6654c2942ade39bf7b | https://github.com/tenside/core/blob/56422fa8cdecf03cb431bb6654c2942ade39bf7b/src/Task/Composer/ComposerTaskFactory.php#L110-L116 |
235,791 | SergioMadness/framework | framework/components/eventhandler/traits/EventTrait.php | EventTrait.on | public function on($type, $callback)
{
if (!isset($this->callbacks[$type])) {
$this->callbacks[$type] = [];
}
$this->callbacks[$type][] = $callback;
return $this;
} | php | public function on($type, $callback)
{
if (!isset($this->callbacks[$type])) {
$this->callbacks[$type] = [];
}
$this->callbacks[$type][] = $callback;
return $this;
} | [
"public",
"function",
"on",
"(",
"$",
"type",
",",
"$",
"callback",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"callbacks",
"[",
"$",
"type",
"]",
")",
")",
"{",
"$",
"this",
"->",
"callbacks",
"[",
"$",
"type",
"]",
"=",
"[",
... | Register event handler
@param string $type
@param \Closure|array|string $callback
@return $this | [
"Register",
"event",
"handler"
] | a5038eb926a5038b9a331d0cb6a68d7fc3cf1f1e | https://github.com/SergioMadness/framework/blob/a5038eb926a5038b9a331d0cb6a68d7fc3cf1f1e/framework/components/eventhandler/traits/EventTrait.php#L17-L24 |
235,792 | asbsoft/yii2module-news_2b_161124 | models/NewsArchieve.php | NewsArchieve.preSaveText | public static function preSaveText($text, $controller, $transTable = [])
{
$module = Module::getModuleByClassname(Module::className());
$editorContentHelper = $module->contentHelper;
$text = trim($text);
if (empty($text)) return '';
$text = $editorContentHelper... | php | public static function preSaveText($text, $controller, $transTable = [])
{
$module = Module::getModuleByClassname(Module::className());
$editorContentHelper = $module->contentHelper;
$text = trim($text);
if (empty($text)) return '';
$text = $editorContentHelper... | [
"public",
"static",
"function",
"preSaveText",
"(",
"$",
"text",
",",
"$",
"controller",
",",
"$",
"transTable",
"=",
"[",
"]",
")",
"{",
"$",
"module",
"=",
"Module",
"::",
"getModuleByClassname",
"(",
"Module",
"::",
"className",
"(",
")",
")",
";",
... | Processing text before saving.
@param string $text
@param Controller $controller
@param array $transTable
@return string | [
"Processing",
"text",
"before",
"saving",
"."
] | 9e9a7fdb458c88c7cdcd060cdc07cc4a7664690d | https://github.com/asbsoft/yii2module-news_2b_161124/blob/9e9a7fdb458c88c7cdcd060cdc07cc4a7664690d/models/NewsArchieve.php#L112-L131 |
235,793 | asbsoft/yii2module-news_2b_161124 | models/NewsArchieve.php | NewsArchieve.getSlug | public static function getSlug($model)
{
$i18nModels = $model->i18n;
$slugs = [];
foreach ($i18nModels as $i18nModel) {
if (empty($i18nModel->body)) continue; // skip languages for news without body
$slugs[$i18nModel->lang_code] = $i18nModel->slug;
}
... | php | public static function getSlug($model)
{
$i18nModels = $model->i18n;
$slugs = [];
foreach ($i18nModels as $i18nModel) {
if (empty($i18nModel->body)) continue; // skip languages for news without body
$slugs[$i18nModel->lang_code] = $i18nModel->slug;
}
... | [
"public",
"static",
"function",
"getSlug",
"(",
"$",
"model",
")",
"{",
"$",
"i18nModels",
"=",
"$",
"model",
"->",
"i18n",
";",
"$",
"slugs",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"i18nModels",
"as",
"$",
"i18nModel",
")",
"{",
"if",
"(",
"empt... | Get first non-empty slug of news. Search in default languages priority.
@param News $model
@return string | [
"Get",
"first",
"non",
"-",
"empty",
"slug",
"of",
"news",
".",
"Search",
"in",
"default",
"languages",
"priority",
"."
] | 9e9a7fdb458c88c7cdcd060cdc07cc4a7664690d | https://github.com/asbsoft/yii2module-news_2b_161124/blob/9e9a7fdb458c88c7cdcd060cdc07cc4a7664690d/models/NewsArchieve.php#L138-L163 |
235,794 | bmdevel/php-index | classes/Range.php | Range.contains | public function contains($key)
{
if ($this->inclusive && in_array($key, array($this->min, $this->max))) {
return true;
}
return $key > $this->min && $key < $this->max;
} | php | public function contains($key)
{
if ($this->inclusive && in_array($key, array($this->min, $this->max))) {
return true;
}
return $key > $this->min && $key < $this->max;
} | [
"public",
"function",
"contains",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"inclusive",
"&&",
"in_array",
"(",
"$",
"key",
",",
"array",
"(",
"$",
"this",
"->",
"min",
",",
"$",
"this",
"->",
"max",
")",
")",
")",
"{",
"return",
... | Returns true if key is inside this range
@param String $key
@return bool | [
"Returns",
"true",
"if",
"key",
"is",
"inside",
"this",
"range"
] | 6a6b476f1706b9524bfb34f6ce0963b1aea91259 | https://github.com/bmdevel/php-index/blob/6a6b476f1706b9524bfb34f6ce0963b1aea91259/classes/Range.php#L70-L77 |
235,795 | mickeyhead7/mickeyhead7-rsvp | src/Response/JsonapiResponse.php | JsonApiResponse.setLinks | public function setLinks()
{
// Only required for collections as items contain links by default
if ($this->resource instanceof Collection && $paginator = $this->resource->getPaginator()) {
$pagination = new Pagination($paginator);
$this->links = $pagination->generateCollectio... | php | public function setLinks()
{
// Only required for collections as items contain links by default
if ($this->resource instanceof Collection && $paginator = $this->resource->getPaginator()) {
$pagination = new Pagination($paginator);
$this->links = $pagination->generateCollectio... | [
"public",
"function",
"setLinks",
"(",
")",
"{",
"// Only required for collections as items contain links by default",
"if",
"(",
"$",
"this",
"->",
"resource",
"instanceof",
"Collection",
"&&",
"$",
"paginator",
"=",
"$",
"this",
"->",
"resource",
"->",
"getPaginator... | Set the response links data
@return $this Instance of self | [
"Set",
"the",
"response",
"links",
"data"
] | 36a780acd8b26bc9f313d7d2ebe44250f1aa6731 | https://github.com/mickeyhead7/mickeyhead7-rsvp/blob/36a780acd8b26bc9f313d7d2ebe44250f1aa6731/src/Response/JsonapiResponse.php#L49-L60 |
235,796 | mickeyhead7/mickeyhead7-rsvp | src/Response/JsonapiResponse.php | JsonApiResponse.setData | public function setData()
{
// Process a collection
if ($this->resource instanceof Collection) {
$this->data = [];
foreach ($this->resource->getData() as $resource) {
$this->parseItem(new Item($resource, $this->resource->getTransformer()));
}
... | php | public function setData()
{
// Process a collection
if ($this->resource instanceof Collection) {
$this->data = [];
foreach ($this->resource->getData() as $resource) {
$this->parseItem(new Item($resource, $this->resource->getTransformer()));
}
... | [
"public",
"function",
"setData",
"(",
")",
"{",
"// Process a collection",
"if",
"(",
"$",
"this",
"->",
"resource",
"instanceof",
"Collection",
")",
"{",
"$",
"this",
"->",
"data",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"resource",
"->",... | Creates the response
@return $this Instance of self | [
"Creates",
"the",
"response"
] | 36a780acd8b26bc9f313d7d2ebe44250f1aa6731 | https://github.com/mickeyhead7/mickeyhead7-rsvp/blob/36a780acd8b26bc9f313d7d2ebe44250f1aa6731/src/Response/JsonapiResponse.php#L67-L84 |
235,797 | mickeyhead7/mickeyhead7-rsvp | src/Response/JsonapiResponse.php | JsonApiResponse.parseItem | private function parseItem(Item $item)
{
// Get and format an item
$tmp = $this->getFormattedItem($item);
// Get related data
$relationships = $this->getRelationships($item);
// Closure function to internally parse related includes
$parseRelationships = function($ke... | php | private function parseItem(Item $item)
{
// Get and format an item
$tmp = $this->getFormattedItem($item);
// Get related data
$relationships = $this->getRelationships($item);
// Closure function to internally parse related includes
$parseRelationships = function($ke... | [
"private",
"function",
"parseItem",
"(",
"Item",
"$",
"item",
")",
"{",
"// Get and format an item",
"$",
"tmp",
"=",
"$",
"this",
"->",
"getFormattedItem",
"(",
"$",
"item",
")",
";",
"// Get related data",
"$",
"relationships",
"=",
"$",
"this",
"->",
"get... | Parses an item into response data
@param Item $item Resource item
@return $this Instance of self | [
"Parses",
"an",
"item",
"into",
"response",
"data"
] | 36a780acd8b26bc9f313d7d2ebe44250f1aa6731 | https://github.com/mickeyhead7/mickeyhead7-rsvp/blob/36a780acd8b26bc9f313d7d2ebe44250f1aa6731/src/Response/JsonapiResponse.php#L92-L137 |
235,798 | mickeyhead7/mickeyhead7-rsvp | src/Response/JsonapiResponse.php | JsonApiResponse.getFormattedItem | private function getFormattedItem(Item $item)
{
$data = [
'type' => $this->getFormattedName($item->getTransformer()),
'id' => $item->getData()->id,
'attributes' => $item->sanitize(),
];
if ($links = $item->getLinks()) {
$data['li... | php | private function getFormattedItem(Item $item)
{
$data = [
'type' => $this->getFormattedName($item->getTransformer()),
'id' => $item->getData()->id,
'attributes' => $item->sanitize(),
];
if ($links = $item->getLinks()) {
$data['li... | [
"private",
"function",
"getFormattedItem",
"(",
"Item",
"$",
"item",
")",
"{",
"$",
"data",
"=",
"[",
"'type'",
"=>",
"$",
"this",
"->",
"getFormattedName",
"(",
"$",
"item",
"->",
"getTransformer",
"(",
")",
")",
",",
"'id'",
"=>",
"$",
"item",
"->",
... | Formats an item ready for response
@param Item $item Resource item
@return array Formatted item data | [
"Formats",
"an",
"item",
"ready",
"for",
"response"
] | 36a780acd8b26bc9f313d7d2ebe44250f1aa6731 | https://github.com/mickeyhead7/mickeyhead7-rsvp/blob/36a780acd8b26bc9f313d7d2ebe44250f1aa6731/src/Response/JsonapiResponse.php#L145-L158 |
235,799 | mickeyhead7/mickeyhead7-rsvp | src/Response/JsonapiResponse.php | JsonApiResponse.getFormattedName | private function getFormattedName($class)
{
$class_name = (substr(strrchr(get_class($class), "\\"), 1));
$underscored = preg_replace('/([a-z])([A-Z])/', '$1_$2', $class_name);
return strtolower($underscored);
} | php | private function getFormattedName($class)
{
$class_name = (substr(strrchr(get_class($class), "\\"), 1));
$underscored = preg_replace('/([a-z])([A-Z])/', '$1_$2', $class_name);
return strtolower($underscored);
} | [
"private",
"function",
"getFormattedName",
"(",
"$",
"class",
")",
"{",
"$",
"class_name",
"=",
"(",
"substr",
"(",
"strrchr",
"(",
"get_class",
"(",
"$",
"class",
")",
",",
"\"\\\\\"",
")",
",",
"1",
")",
")",
";",
"$",
"underscored",
"=",
"preg_repla... | Formats a class name for readable use in the response
@param $class Class name to format
@return string Formatted name | [
"Formats",
"a",
"class",
"name",
"for",
"readable",
"use",
"in",
"the",
"response"
] | 36a780acd8b26bc9f313d7d2ebe44250f1aa6731 | https://github.com/mickeyhead7/mickeyhead7-rsvp/blob/36a780acd8b26bc9f313d7d2ebe44250f1aa6731/src/Response/JsonapiResponse.php#L166-L172 |
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.