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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
198,000 | frogsystem/legacy-polls | src/Services/Routes.php | Routes.registerRoutes | public function registerRoutes(Map $map)
{
$map->attach('legacy.', '/', function (Map $map) {
$map->get('polls', 'polls/', $this->controller(PollsController::class, 'polls'))->allows(['POST']);
});
} | php | public function registerRoutes(Map $map)
{
$map->attach('legacy.', '/', function (Map $map) {
$map->get('polls', 'polls/', $this->controller(PollsController::class, 'polls'))->allows(['POST']);
});
} | [
"public",
"function",
"registerRoutes",
"(",
"Map",
"$",
"map",
")",
"{",
"$",
"map",
"->",
"attach",
"(",
"'legacy.'",
",",
"'/'",
",",
"function",
"(",
"Map",
"$",
"map",
")",
"{",
"$",
"map",
"->",
"get",
"(",
"'polls'",
",",
"'polls/'",
",",
"$... | Add the legacy route
@param Map $map
@return mixed|void | [
"Add",
"the",
"legacy",
"route"
] | 25f5f28ac6d0dda327e84b7e587f602da6995703 | https://github.com/frogsystem/legacy-polls/blob/25f5f28ac6d0dda327e84b7e587f602da6995703/src/Services/Routes.php#L19-L24 |
198,001 | SlaxWeb/Config | src/Container.php | Container.load | public function load(
string $resourceName,
bool $prependResourceName = false
) {
switch ($this->_handler->load($resourceName, $prependResourceName)) {
case Handler::CONFIG_PARSE_ERROR:
throw new Exception\ConfigParseException(
"Error parsing '... | php | public function load(
string $resourceName,
bool $prependResourceName = false
) {
switch ($this->_handler->load($resourceName, $prependResourceName)) {
case Handler::CONFIG_PARSE_ERROR:
throw new Exception\ConfigParseException(
"Error parsing '... | [
"public",
"function",
"load",
"(",
"string",
"$",
"resourceName",
",",
"bool",
"$",
"prependResourceName",
"=",
"false",
")",
"{",
"switch",
"(",
"$",
"this",
"->",
"_handler",
"->",
"load",
"(",
"$",
"resourceName",
",",
"$",
"prependResourceName",
")",
"... | Load config resource
Combine the received configuration resource name with the
'_configLocation' protected property, and pass it to the config handler.
@param string $resourceName Name of the configuration resource
@param bool $prependResourceName If the resource name should be prepended
to each config key
@return vo... | [
"Load",
"config",
"resource"
] | 92e75c3538d3903e00f5c52507bc0a322c4d1f11 | https://github.com/SlaxWeb/Config/blob/92e75c3538d3903e00f5c52507bc0a322c4d1f11/src/Container.php#L115-L129 |
198,002 | AdamB7586/menu-builder | src/Navigation.php | Navigation.setNavigationClass | public function setNavigationClass($class) {
if(is_string($class) && !empty(trim($class))){
$this->menuElements['ul_class'] = $class;
}
if((is_string($class) && empty(trim($class))) || $class === false){
$this->menuElements['ul_class'] = '';
}
return $this... | php | public function setNavigationClass($class) {
if(is_string($class) && !empty(trim($class))){
$this->menuElements['ul_class'] = $class;
}
if((is_string($class) && empty(trim($class))) || $class === false){
$this->menuElements['ul_class'] = '';
}
return $this... | [
"public",
"function",
"setNavigationClass",
"(",
"$",
"class",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"class",
")",
"&&",
"!",
"empty",
"(",
"trim",
"(",
"$",
"class",
")",
")",
")",
"{",
"$",
"this",
"->",
"menuElements",
"[",
"'ul_class'",
"]"... | Set the main navigation UL class
@param string|false $class This should be a string containing the class you want to set on the main UL element
@return $this | [
"Set",
"the",
"main",
"navigation",
"UL",
"class"
] | dbc192bca7d59475068c19d1a07a039e5f997ee4 | https://github.com/AdamB7586/menu-builder/blob/dbc192bca7d59475068c19d1a07a039e5f997ee4/src/Navigation.php#L94-L102 |
198,003 | AdamB7586/menu-builder | src/Navigation.php | Navigation.setNavigationID | public function setNavigationID($id) {
if(is_string($id) && !empty(trim($id))){
$this->menuElements['ul_id'] = $id;
}
if((is_string($id) && empty(trim($id))) || $id === false){
$this->menuElements['ul_id'] = '';
}
return $this;
} | php | public function setNavigationID($id) {
if(is_string($id) && !empty(trim($id))){
$this->menuElements['ul_id'] = $id;
}
if((is_string($id) && empty(trim($id))) || $id === false){
$this->menuElements['ul_id'] = '';
}
return $this;
} | [
"public",
"function",
"setNavigationID",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"id",
")",
"&&",
"!",
"empty",
"(",
"trim",
"(",
"$",
"id",
")",
")",
")",
"{",
"$",
"this",
"->",
"menuElements",
"[",
"'ul_id'",
"]",
"=",
"$",... | Set the main navigation ID element
@param string $id This should be a string containing the id you want to set on the main UL element
@return $this | [
"Set",
"the",
"main",
"navigation",
"ID",
"element"
] | dbc192bca7d59475068c19d1a07a039e5f997ee4 | https://github.com/AdamB7586/menu-builder/blob/dbc192bca7d59475068c19d1a07a039e5f997ee4/src/Navigation.php#L117-L125 |
198,004 | AdamB7586/menu-builder | src/Navigation.php | Navigation.setDefaultClass | public function setDefaultClass($class, $element = 'li'){
if(in_array($element, ['a', 'li', 'ul']) && ((is_string($class) && !empty(trim($class))) || is_bool($class))) {
$this->menuElements[strtolower($element).'_default'] = $class;
}
elseif(in_array($element, $this->allowedElements)... | php | public function setDefaultClass($class, $element = 'li'){
if(in_array($element, ['a', 'li', 'ul']) && ((is_string($class) && !empty(trim($class))) || is_bool($class))) {
$this->menuElements[strtolower($element).'_default'] = $class;
}
elseif(in_array($element, $this->allowedElements)... | [
"public",
"function",
"setDefaultClass",
"(",
"$",
"class",
",",
"$",
"element",
"=",
"'li'",
")",
"{",
"if",
"(",
"in_array",
"(",
"$",
"element",
",",
"[",
"'a'",
",",
"'li'",
",",
"'ul'",
"]",
")",
"&&",
"(",
"(",
"is_string",
"(",
"$",
"class",... | Change the default class assigned to all elements of a certain type in the menu
@param string|boolean $class This should be the class you want to assign to all elements or false for no default
@param string $element The element that you are changing the default for can be 'a', 'li' or 'ul'
@return $this | [
"Change",
"the",
"default",
"class",
"assigned",
"to",
"all",
"elements",
"of",
"a",
"certain",
"type",
"in",
"the",
"menu"
] | dbc192bca7d59475068c19d1a07a039e5f997ee4 | https://github.com/AdamB7586/menu-builder/blob/dbc192bca7d59475068c19d1a07a039e5f997ee4/src/Navigation.php#L161-L169 |
198,005 | AdamB7586/menu-builder | src/Navigation.php | Navigation.setCurrentURI | public function setCurrentURI($uri) {
if(is_string($uri) && !empty(trim($uri))){
$this->currentURI = $uri;
$this->currentArray = Levels::getCurrent($this->navigation, $this->currentURI);
}
else{
throw new InvalidArgumentException(
'$uri must be... | php | public function setCurrentURI($uri) {
if(is_string($uri) && !empty(trim($uri))){
$this->currentURI = $uri;
$this->currentArray = Levels::getCurrent($this->navigation, $this->currentURI);
}
else{
throw new InvalidArgumentException(
'$uri must be... | [
"public",
"function",
"setCurrentURI",
"(",
"$",
"uri",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"uri",
")",
"&&",
"!",
"empty",
"(",
"trim",
"(",
"$",
"uri",
")",
")",
")",
"{",
"$",
"this",
"->",
"currentURI",
"=",
"$",
"uri",
";",
"$",
"t... | Sets the current active URI
@param string $uri This should be the string URI of the active link
@return $this | [
"Sets",
"the",
"current",
"active",
"URI"
] | dbc192bca7d59475068c19d1a07a039e5f997ee4 | https://github.com/AdamB7586/menu-builder/blob/dbc192bca7d59475068c19d1a07a039e5f997ee4/src/Navigation.php#L176-L187 |
198,006 | AdamB7586/menu-builder | src/Navigation.php | Navigation.hasLink | public function hasLink($link) {
$found = false;
array_walk_recursive($this->navigation, function($value, $key) use (&$found, $link) {
if ($value == $link && $key === 'uri') {
$found = true;
}
});
return $found;
} | php | public function hasLink($link) {
$found = false;
array_walk_recursive($this->navigation, function($value, $key) use (&$found, $link) {
if ($value == $link && $key === 'uri') {
$found = true;
}
});
return $found;
} | [
"public",
"function",
"hasLink",
"(",
"$",
"link",
")",
"{",
"$",
"found",
"=",
"false",
";",
"array_walk_recursive",
"(",
"$",
"this",
"->",
"navigation",
",",
"function",
"(",
"$",
"value",
",",
"$",
"key",
")",
"use",
"(",
"&",
"$",
"found",
",",
... | Checks to see if a link exists within the current navigation array
@param string $link The link you are checking to see if the exists in the array
@return boolean If the link exists returns true else returns false | [
"Checks",
"to",
"see",
"if",
"a",
"link",
"exists",
"within",
"the",
"current",
"navigation",
"array"
] | dbc192bca7d59475068c19d1a07a039e5f997ee4 | https://github.com/AdamB7586/menu-builder/blob/dbc192bca7d59475068c19d1a07a039e5f997ee4/src/Navigation.php#L277-L285 |
198,007 | AdamB7586/menu-builder | src/Navigation.php | Navigation.hasLinks | public function hasLinks($array) {
if(is_array($array)) {
foreach($array as $link) {
if($this->hasLink($link) === false) {
return false;
}
}
return true;
}
return false;
} | php | public function hasLinks($array) {
if(is_array($array)) {
foreach($array as $link) {
if($this->hasLink($link) === false) {
return false;
}
}
return true;
}
return false;
} | [
"public",
"function",
"hasLinks",
"(",
"$",
"array",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"array",
")",
")",
"{",
"foreach",
"(",
"$",
"array",
"as",
"$",
"link",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasLink",
"(",
"$",
"link",
")",
"... | Checks to see if an array of links exist within the current navigation array
@param array $array an array containing the links
@return boolean If all of the links exist within the current navigation array return true else returns false | [
"Checks",
"to",
"see",
"if",
"an",
"array",
"of",
"links",
"exist",
"within",
"the",
"current",
"navigation",
"array"
] | dbc192bca7d59475068c19d1a07a039e5f997ee4 | https://github.com/AdamB7586/menu-builder/blob/dbc192bca7d59475068c19d1a07a039e5f997ee4/src/Navigation.php#L292-L302 |
198,008 | AdamB7586/menu-builder | src/Navigation.php | Navigation.render | public function render() {
return Menu::build($this->navigation, $this->menuElements, $this->currentArray, $this->getActiveClass(), $this->getStartLevel(), $this->getMaxLevels(), $this->caretElement, $this->dropdownLinkExtras);
} | php | public function render() {
return Menu::build($this->navigation, $this->menuElements, $this->currentArray, $this->getActiveClass(), $this->getStartLevel(), $this->getMaxLevels(), $this->caretElement, $this->dropdownLinkExtras);
} | [
"public",
"function",
"render",
"(",
")",
"{",
"return",
"Menu",
"::",
"build",
"(",
"$",
"this",
"->",
"navigation",
",",
"$",
"this",
"->",
"menuElements",
",",
"$",
"this",
"->",
"currentArray",
",",
"$",
"this",
"->",
"getActiveClass",
"(",
")",
",... | Returns the HTML navigation string
@return string THe formatted menu item will be returned | [
"Returns",
"the",
"HTML",
"navigation",
"string"
] | dbc192bca7d59475068c19d1a07a039e5f997ee4 | https://github.com/AdamB7586/menu-builder/blob/dbc192bca7d59475068c19d1a07a039e5f997ee4/src/Navigation.php#L316-L318 |
198,009 | AdamB7586/menu-builder | src/Navigation.php | Navigation.renderBreadcrumb | public function renderBreadcrumb($class = 'breadcrumb', $itemClass = 'breadcrumb-item', $list = true) {
$breadcrumb = new Breadcrumb();
$breadcrumb->navArray = $this->navigation;
return $breadcrumb->setBreacrumbLinks($this->currentArray)->createBreadcrumb($class, $itemClass, $list);
} | php | public function renderBreadcrumb($class = 'breadcrumb', $itemClass = 'breadcrumb-item', $list = true) {
$breadcrumb = new Breadcrumb();
$breadcrumb->navArray = $this->navigation;
return $breadcrumb->setBreacrumbLinks($this->currentArray)->createBreadcrumb($class, $itemClass, $list);
} | [
"public",
"function",
"renderBreadcrumb",
"(",
"$",
"class",
"=",
"'breadcrumb'",
",",
"$",
"itemClass",
"=",
"'breadcrumb-item'",
",",
"$",
"list",
"=",
"true",
")",
"{",
"$",
"breadcrumb",
"=",
"new",
"Breadcrumb",
"(",
")",
";",
"$",
"breadcrumb",
"->",... | Renders a breadcrumb menu
@param string $class The class to assign to the element
@param string $itemClass The class to assign to each item
@param boolean $list If the menu is a list set to true else set to false
@return string | [
"Renders",
"a",
"breadcrumb",
"menu"
] | dbc192bca7d59475068c19d1a07a039e5f997ee4 | https://github.com/AdamB7586/menu-builder/blob/dbc192bca7d59475068c19d1a07a039e5f997ee4/src/Navigation.php#L327-L331 |
198,010 | narrowspark/arr | src/Arr/Arr.php | Arr.get | public static function get(array $array, $key = null, $default = null)
{
if ($key === null) {
return $array;
}
if (isset($array[$key])) {
return static::value($array[$key]);
}
foreach (explode('.', (string) $key) as $segment) {
if (! arra... | php | public static function get(array $array, $key = null, $default = null)
{
if ($key === null) {
return $array;
}
if (isset($array[$key])) {
return static::value($array[$key]);
}
foreach (explode('.', (string) $key) as $segment) {
if (! arra... | [
"public",
"static",
"function",
"get",
"(",
"array",
"$",
"array",
",",
"$",
"key",
"=",
"null",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"key",
"===",
"null",
")",
"{",
"return",
"$",
"array",
";",
"}",
"if",
"(",
"isset",
"... | Get an item from an array using "dot" notation.
If key dont exist, you get a default value back.
@param array $array
@param string|int|null $key
@param mixed $default
@return mixed | [
"Get",
"an",
"item",
"from",
"an",
"array",
"using",
"dot",
"notation",
".",
"If",
"key",
"dont",
"exist",
"you",
"get",
"a",
"default",
"value",
"back",
"."
] | 0429f3509d99c020fc80c44a7ad0ecf6d0bfc053 | https://github.com/narrowspark/arr/blob/0429f3509d99c020fc80c44a7ad0ecf6d0bfc053/src/Arr/Arr.php#L94-L113 |
198,011 | narrowspark/arr | src/Arr/Arr.php | Arr.add | public static function add(array $array, $key, $value): array
{
$target = static::get($array, $key, []);
if (! is_array($target)) {
$target = [$target];
}
$target[] = $value;
$array = static::set($array, $key, $target);
return $array;
} | php | public static function add(array $array, $key, $value): array
{
$target = static::get($array, $key, []);
if (! is_array($target)) {
$target = [$target];
}
$target[] = $value;
$array = static::set($array, $key, $target);
return $array;
} | [
"public",
"static",
"function",
"add",
"(",
"array",
"$",
"array",
",",
"$",
"key",
",",
"$",
"value",
")",
":",
"array",
"{",
"$",
"target",
"=",
"static",
"::",
"get",
"(",
"$",
"array",
",",
"$",
"key",
",",
"[",
"]",
")",
";",
"if",
"(",
... | Add an element to the array at a specific location
using the "dot" notation.
@param array $array
@param string[]|callable|null $key
@param mixed $value
@return array | [
"Add",
"an",
"element",
"to",
"the",
"array",
"at",
"a",
"specific",
"location",
"using",
"the",
"dot",
"notation",
"."
] | 0429f3509d99c020fc80c44a7ad0ecf6d0bfc053 | https://github.com/narrowspark/arr/blob/0429f3509d99c020fc80c44a7ad0ecf6d0bfc053/src/Arr/Arr.php#L125-L137 |
198,012 | narrowspark/arr | src/Arr/Arr.php | Arr.any | public static function any(array $array, $keys): bool
{
foreach ((array) $keys as $key) {
if (static::has($array, $key)) {
return true;
}
}
return false;
} | php | public static function any(array $array, $keys): bool
{
foreach ((array) $keys as $key) {
if (static::has($array, $key)) {
return true;
}
}
return false;
} | [
"public",
"static",
"function",
"any",
"(",
"array",
"$",
"array",
",",
"$",
"keys",
")",
":",
"bool",
"{",
"foreach",
"(",
"(",
"array",
")",
"$",
"keys",
"as",
"$",
"key",
")",
"{",
"if",
"(",
"static",
"::",
"has",
"(",
"$",
"array",
",",
"$... | Check if any item or items exist in an array using "dot" notation.
@param array $array
@param string|array $keys
@return bool | [
"Check",
"if",
"any",
"item",
"or",
"items",
"exist",
"in",
"an",
"array",
"using",
"dot",
"notation",
"."
] | 0429f3509d99c020fc80c44a7ad0ecf6d0bfc053 | https://github.com/narrowspark/arr/blob/0429f3509d99c020fc80c44a7ad0ecf6d0bfc053/src/Arr/Arr.php#L147-L156 |
198,013 | narrowspark/arr | src/Arr/Arr.php | Arr.update | public static function update(array $array, string $key, callable $callback)
{
$keys = explode('.', $key);
$current = &$array;
foreach ($keys as $key) {
if (! isset($current[$key])) {
return $array;
}
$current = &$current[$key];
}... | php | public static function update(array $array, string $key, callable $callback)
{
$keys = explode('.', $key);
$current = &$array;
foreach ($keys as $key) {
if (! isset($current[$key])) {
return $array;
}
$current = &$current[$key];
}... | [
"public",
"static",
"function",
"update",
"(",
"array",
"$",
"array",
",",
"string",
"$",
"key",
",",
"callable",
"$",
"callback",
")",
"{",
"$",
"keys",
"=",
"explode",
"(",
"'.'",
",",
"$",
"key",
")",
";",
"$",
"current",
"=",
"&",
"$",
"array",... | Updates data at the given path.
@param array $array
@param sting $key
@param callable $callback Callback to update the value.
@return mixed Updated data. | [
"Updates",
"data",
"at",
"the",
"given",
"path",
"."
] | 0429f3509d99c020fc80c44a7ad0ecf6d0bfc053 | https://github.com/narrowspark/arr/blob/0429f3509d99c020fc80c44a7ad0ecf6d0bfc053/src/Arr/Arr.php#L227-L243 |
198,014 | narrowspark/arr | src/Arr/Arr.php | Arr.closest | public static function closest(array $array, string $value)
{
sort($array);
$closest = $array[0];
for ($i = 1, $j = count($array), $k = 0; $i < $j; $i++, $k++) {
$middleValue = ((int) $array[$i] - (int) $array[$k]) / 2 + (int) $array[$k];
if ($value >= $middleValue)... | php | public static function closest(array $array, string $value)
{
sort($array);
$closest = $array[0];
for ($i = 1, $j = count($array), $k = 0; $i < $j; $i++, $k++) {
$middleValue = ((int) $array[$i] - (int) $array[$k]) / 2 + (int) $array[$k];
if ($value >= $middleValue)... | [
"public",
"static",
"function",
"closest",
"(",
"array",
"$",
"array",
",",
"string",
"$",
"value",
")",
"{",
"sort",
"(",
"$",
"array",
")",
";",
"$",
"closest",
"=",
"$",
"array",
"[",
"0",
"]",
";",
"for",
"(",
"$",
"i",
"=",
"1",
",",
"$",
... | Return the closest found value from array.
@param array $array
@param string $value
@return mixed | [
"Return",
"the",
"closest",
"found",
"value",
"from",
"array",
"."
] | 0429f3509d99c020fc80c44a7ad0ecf6d0bfc053 | https://github.com/narrowspark/arr/blob/0429f3509d99c020fc80c44a7ad0ecf6d0bfc053/src/Arr/Arr.php#L395-L409 |
198,015 | narrowspark/arr | src/Arr/Arr.php | Arr.every | public static function every(array $array, int $step, int $offset = 0): array
{
$new = [];
$position = 0;
foreach ($array as $key => $item) {
if ($position % $step === $offset) {
$new[] = $item;
}
++$position;
}
return $... | php | public static function every(array $array, int $step, int $offset = 0): array
{
$new = [];
$position = 0;
foreach ($array as $key => $item) {
if ($position % $step === $offset) {
$new[] = $item;
}
++$position;
}
return $... | [
"public",
"static",
"function",
"every",
"(",
"array",
"$",
"array",
",",
"int",
"$",
"step",
",",
"int",
"$",
"offset",
"=",
"0",
")",
":",
"array",
"{",
"$",
"new",
"=",
"[",
"]",
";",
"$",
"position",
"=",
"0",
";",
"foreach",
"(",
"$",
"arr... | Create a new array consisting of every n-th element.
@param array $array
@param int $step
@param int $offset
@return array | [
"Create",
"a",
"new",
"array",
"consisting",
"of",
"every",
"n",
"-",
"th",
"element",
"."
] | 0429f3509d99c020fc80c44a7ad0ecf6d0bfc053 | https://github.com/narrowspark/arr/blob/0429f3509d99c020fc80c44a7ad0ecf6d0bfc053/src/Arr/Arr.php#L463-L478 |
198,016 | narrowspark/arr | src/Arr/Arr.php | Arr.combine | public static function combine(array $array, callable $callback, bool $overwrite = true): array
{
$combined = [];
foreach ($array as $key => $value) {
$combinator = $callback($value, $key);
// fix for hhvm #1871 bug
if (defined('HHVM_VERSION') && version_compare... | php | public static function combine(array $array, callable $callback, bool $overwrite = true): array
{
$combined = [];
foreach ($array as $key => $value) {
$combinator = $callback($value, $key);
// fix for hhvm #1871 bug
if (defined('HHVM_VERSION') && version_compare... | [
"public",
"static",
"function",
"combine",
"(",
"array",
"$",
"array",
",",
"callable",
"$",
"callback",
",",
"bool",
"$",
"overwrite",
"=",
"true",
")",
":",
"array",
"{",
"$",
"combined",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"array",
"as",
"$",... | Indexes an array depending on the values it contains.
@param array $array
@param callable $callback Function to combine values.
@param bool $overwrite Should duplicate keys be overwritten?
@return array Indexed values. | [
"Indexes",
"an",
"array",
"depending",
"on",
"the",
"values",
"it",
"contains",
"."
] | 0429f3509d99c020fc80c44a7ad0ecf6d0bfc053 | https://github.com/narrowspark/arr/blob/0429f3509d99c020fc80c44a7ad0ecf6d0bfc053/src/Arr/Arr.php#L489-L509 |
198,017 | narrowspark/arr | src/Arr/Arr.php | Arr.collapse | public static function collapse(array $array): array
{
$newArray = [];
foreach ($array as $key => $value) {
if (is_array($value)) {
// strip any manually added '.'
if (preg_match('/\./', (string) $key)) {
$key = substr($key, 0, -2);
... | php | public static function collapse(array $array): array
{
$newArray = [];
foreach ($array as $key => $value) {
if (is_array($value)) {
// strip any manually added '.'
if (preg_match('/\./', (string) $key)) {
$key = substr($key, 0, -2);
... | [
"public",
"static",
"function",
"collapse",
"(",
"array",
"$",
"array",
")",
":",
"array",
"{",
"$",
"newArray",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"array",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"v... | Collapse a nested array down to an array of flat key=>value pairs.
@param array $array
@return array | [
"Collapse",
"a",
"nested",
"array",
"down",
"to",
"an",
"array",
"of",
"flat",
"key",
"=",
">",
"value",
"pairs",
"."
] | 0429f3509d99c020fc80c44a7ad0ecf6d0bfc053 | https://github.com/narrowspark/arr/blob/0429f3509d99c020fc80c44a7ad0ecf6d0bfc053/src/Arr/Arr.php#L518-L536 |
198,018 | narrowspark/arr | src/Arr/Arr.php | Arr.reindex | public static function reindex(array $array, array $map, bool $unmapped = true): array
{
$reindexed = $unmapped
? $array
: [];
foreach ($map as $from => $to) {
if (isset($array[$from])) {
$reindexed[$to] = $array[$from];
}
}
... | php | public static function reindex(array $array, array $map, bool $unmapped = true): array
{
$reindexed = $unmapped
? $array
: [];
foreach ($map as $from => $to) {
if (isset($array[$from])) {
$reindexed[$to] = $array[$from];
}
}
... | [
"public",
"static",
"function",
"reindex",
"(",
"array",
"$",
"array",
",",
"array",
"$",
"map",
",",
"bool",
"$",
"unmapped",
"=",
"true",
")",
":",
"array",
"{",
"$",
"reindexed",
"=",
"$",
"unmapped",
"?",
"$",
"array",
":",
"[",
"]",
";",
"fore... | Reindexes a list of values.
@param array $array
@param array $map An map of correspondances of the form
['currentIndex' => 'newIndex'].
@param bool $unmapped Whether or not to keep keys that are not
remapped.
@return array | [
"Reindexes",
"a",
"list",
"of",
"values",
"."
] | 0429f3509d99c020fc80c44a7ad0ecf6d0bfc053 | https://github.com/narrowspark/arr/blob/0429f3509d99c020fc80c44a7ad0ecf6d0bfc053/src/Arr/Arr.php#L598-L611 |
198,019 | narrowspark/arr | src/Arr/Arr.php | Arr.extend | public static function extend(): array
{
$merged = [];
foreach (func_get_args() as $array) {
foreach ($array as $key => $value) {
if (is_array($value) && static::has($merged, $key) && is_array($merged[$key])) {
$merged[$key] = static::extend($merged[$... | php | public static function extend(): array
{
$merged = [];
foreach (func_get_args() as $array) {
foreach ($array as $key => $value) {
if (is_array($value) && static::has($merged, $key) && is_array($merged[$key])) {
$merged[$key] = static::extend($merged[$... | [
"public",
"static",
"function",
"extend",
"(",
")",
":",
"array",
"{",
"$",
"merged",
"=",
"[",
"]",
";",
"foreach",
"(",
"func_get_args",
"(",
")",
"as",
"$",
"array",
")",
"{",
"foreach",
"(",
"$",
"array",
"as",
"$",
"key",
"=>",
"$",
"value",
... | Extend one array with another.
@return array | [
"Extend",
"one",
"array",
"with",
"another",
"."
] | 0429f3509d99c020fc80c44a7ad0ecf6d0bfc053 | https://github.com/narrowspark/arr/blob/0429f3509d99c020fc80c44a7ad0ecf6d0bfc053/src/Arr/Arr.php#L674-L689 |
198,020 | narrowspark/arr | src/Arr/Arr.php | Arr.asHierarchy | public static function asHierarchy(array $array): array
{
$hierarchy = [];
foreach ($array as $key => $value) {
$segments = explode('.', (string) $key);
$valueSegment = array_pop($segments);
$branch = &$hierarchy;
foreach ($segments as $segment) {
... | php | public static function asHierarchy(array $array): array
{
$hierarchy = [];
foreach ($array as $key => $value) {
$segments = explode('.', (string) $key);
$valueSegment = array_pop($segments);
$branch = &$hierarchy;
foreach ($segments as $segment) {
... | [
"public",
"static",
"function",
"asHierarchy",
"(",
"array",
"$",
"array",
")",
":",
"array",
"{",
"$",
"hierarchy",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"array",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"segments",
"=",
"explode",
... | Transforms a 1-dimensional array into a multi-dimensional one,
exploding keys according to a separator.
@param array $array
@return array | [
"Transforms",
"a",
"1",
"-",
"dimensional",
"array",
"into",
"a",
"multi",
"-",
"dimensional",
"one",
"exploding",
"keys",
"according",
"to",
"a",
"separator",
"."
] | 0429f3509d99c020fc80c44a7ad0ecf6d0bfc053 | https://github.com/narrowspark/arr/blob/0429f3509d99c020fc80c44a7ad0ecf6d0bfc053/src/Arr/Arr.php#L699-L720 |
198,021 | narrowspark/arr | src/Arr/Arr.php | Arr.groupBy | public static function groupBy(array $array, callable $callback = null): array
{
$callback = $callback ?: function ($value) {
return $value;
};
return array_reduce(
$array,
function ($buckets, $value) use ($callback) {
$key = $callback($va... | php | public static function groupBy(array $array, callable $callback = null): array
{
$callback = $callback ?: function ($value) {
return $value;
};
return array_reduce(
$array,
function ($buckets, $value) use ($callback) {
$key = $callback($va... | [
"public",
"static",
"function",
"groupBy",
"(",
"array",
"$",
"array",
",",
"callable",
"$",
"callback",
"=",
"null",
")",
":",
"array",
"{",
"$",
"callback",
"=",
"$",
"callback",
"?",
":",
"function",
"(",
"$",
"value",
")",
"{",
"return",
"$",
"va... | Separates elements from an array into groups.
The function maps an element to the key that will be used for grouping.
If no function is passed, the element itself will be used as key.
@param array $array
@param callable|null $callback
@return array | [
"Separates",
"elements",
"from",
"an",
"array",
"into",
"groups",
".",
"The",
"function",
"maps",
"an",
"element",
"to",
"the",
"key",
"that",
"will",
"be",
"used",
"for",
"grouping",
".",
"If",
"no",
"function",
"is",
"passed",
"the",
"element",
"itself",... | 0429f3509d99c020fc80c44a7ad0ecf6d0bfc053 | https://github.com/narrowspark/arr/blob/0429f3509d99c020fc80c44a7ad0ecf6d0bfc053/src/Arr/Arr.php#L732-L753 |
198,022 | narrowspark/arr | src/Arr/Arr.php | Arr.flatten | public static function flatten(array $array, string $separator = null, string $prepend = ''): array
{
$flattened = [];
foreach ($array as $key => $value) {
if (is_array($value)) {
$flattened = array_merge($flattened, static::flatten($value, $separator, $prepend . $key . ... | php | public static function flatten(array $array, string $separator = null, string $prepend = ''): array
{
$flattened = [];
foreach ($array as $key => $value) {
if (is_array($value)) {
$flattened = array_merge($flattened, static::flatten($value, $separator, $prepend . $key . ... | [
"public",
"static",
"function",
"flatten",
"(",
"array",
"$",
"array",
",",
"string",
"$",
"separator",
"=",
"null",
",",
"string",
"$",
"prepend",
"=",
"''",
")",
":",
"array",
"{",
"$",
"flattened",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"array",... | Flatten a nested array to a separated key.
@param array $array
@param string|null $separator
@param string $prepend
@return array | [
"Flatten",
"a",
"nested",
"array",
"to",
"a",
"separated",
"key",
"."
] | 0429f3509d99c020fc80c44a7ad0ecf6d0bfc053 | https://github.com/narrowspark/arr/blob/0429f3509d99c020fc80c44a7ad0ecf6d0bfc053/src/Arr/Arr.php#L822-L835 |
198,023 | narrowspark/arr | src/Arr/Arr.php | Arr.expand | public static function expand(array $array, string $prepend = ''): array
{
$results = [];
if ($prepend) {
$prepend .= '.';
}
foreach ($array as $key => $value) {
if ($prepend) {
$pos = strpos($key, $prepend);
if ($pos === 0) ... | php | public static function expand(array $array, string $prepend = ''): array
{
$results = [];
if ($prepend) {
$prepend .= '.';
}
foreach ($array as $key => $value) {
if ($prepend) {
$pos = strpos($key, $prepend);
if ($pos === 0) ... | [
"public",
"static",
"function",
"expand",
"(",
"array",
"$",
"array",
",",
"string",
"$",
"prepend",
"=",
"''",
")",
":",
"array",
"{",
"$",
"results",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"prepend",
")",
"{",
"$",
"prepend",
".=",
"'.'",
";",
"}"... | Expand a flattened array with dots to a multi-dimensional associative array.
@param array $array
@param string $prepend
@return array | [
"Expand",
"a",
"flattened",
"array",
"with",
"dots",
"to",
"a",
"multi",
"-",
"dimensional",
"associative",
"array",
"."
] | 0429f3509d99c020fc80c44a7ad0ecf6d0bfc053 | https://github.com/narrowspark/arr/blob/0429f3509d99c020fc80c44a7ad0ecf6d0bfc053/src/Arr/Arr.php#L845-L866 |
198,024 | narrowspark/arr | src/Arr/Arr.php | Arr.extendDistinct | public static function extendDistinct()
{
$merged = [];
foreach (func_get_args() as $array) {
foreach ($array as $key => $value) {
if (is_array($value) && static::has($merged, $key) && is_array($merged[$key])) {
if (static::isAssoc($value) && static::... | php | public static function extendDistinct()
{
$merged = [];
foreach (func_get_args() as $array) {
foreach ($array as $key => $value) {
if (is_array($value) && static::has($merged, $key) && is_array($merged[$key])) {
if (static::isAssoc($value) && static::... | [
"public",
"static",
"function",
"extendDistinct",
"(",
")",
"{",
"$",
"merged",
"=",
"[",
"]",
";",
"foreach",
"(",
"func_get_args",
"(",
")",
"as",
"$",
"array",
")",
"{",
"foreach",
"(",
"$",
"array",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{... | Extend one array with another. Non associative arrays will not be merged
but rather replaced.
@return array | [
"Extend",
"one",
"array",
"with",
"another",
".",
"Non",
"associative",
"arrays",
"will",
"not",
"be",
"merged",
"but",
"rather",
"replaced",
"."
] | 0429f3509d99c020fc80c44a7ad0ecf6d0bfc053 | https://github.com/narrowspark/arr/blob/0429f3509d99c020fc80c44a7ad0ecf6d0bfc053/src/Arr/Arr.php#L902-L921 |
198,025 | narrowspark/arr | src/Arr/Arr.php | Arr.sort | public static function sort(
array $array,
callable $callback,
int $options = SORT_REGULAR,
bool $descending = false
): array {
$results = [];
// First we will loop through the items and get the comparator from a callback
// function which we were given. Then... | php | public static function sort(
array $array,
callable $callback,
int $options = SORT_REGULAR,
bool $descending = false
): array {
$results = [];
// First we will loop through the items and get the comparator from a callback
// function which we were given. Then... | [
"public",
"static",
"function",
"sort",
"(",
"array",
"$",
"array",
",",
"callable",
"$",
"callback",
",",
"int",
"$",
"options",
"=",
"SORT_REGULAR",
",",
"bool",
"$",
"descending",
"=",
"false",
")",
":",
"array",
"{",
"$",
"results",
"=",
"[",
"]",
... | Sort the array using the given callback.
@param array $array
@param callable $callback
@param int $options
@param bool $descending
@return array | [
"Sort",
"the",
"array",
"using",
"the",
"given",
"callback",
"."
] | 0429f3509d99c020fc80c44a7ad0ecf6d0bfc053 | https://github.com/narrowspark/arr/blob/0429f3509d99c020fc80c44a7ad0ecf6d0bfc053/src/Arr/Arr.php#L933-L958 |
198,026 | narrowspark/arr | src/Arr/Arr.php | Arr.map | public static function map(array $array, callable $callback)
{
$newArray = [];
foreach ($array as $key => $item) {
$result = $callback($item, $key);
$newArray = is_array($result) ?
array_replace_recursive($array, $result) :
array_merge_recurs... | php | public static function map(array $array, callable $callback)
{
$newArray = [];
foreach ($array as $key => $item) {
$result = $callback($item, $key);
$newArray = is_array($result) ?
array_replace_recursive($array, $result) :
array_merge_recurs... | [
"public",
"static",
"function",
"map",
"(",
"array",
"$",
"array",
",",
"callable",
"$",
"callback",
")",
"{",
"$",
"newArray",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"array",
"as",
"$",
"key",
"=>",
"$",
"item",
")",
"{",
"$",
"result",
"=",
"... | Applies the callback to the elements of the given arrays
@param array $array
@param callable $callback
@return array | [
"Applies",
"the",
"callback",
"to",
"the",
"elements",
"of",
"the",
"given",
"arrays"
] | 0429f3509d99c020fc80c44a7ad0ecf6d0bfc053 | https://github.com/narrowspark/arr/blob/0429f3509d99c020fc80c44a7ad0ecf6d0bfc053/src/Arr/Arr.php#L1024-L1037 |
198,027 | narrowspark/arr | src/Arr/Arr.php | Arr.all | public static function all(array $array, callable $predicate)
{
foreach ($array as $key => $value) {
if (! $predicate($value, $key, $array)) {
return false;
}
}
return true;
} | php | public static function all(array $array, callable $predicate)
{
foreach ($array as $key => $value) {
if (! $predicate($value, $key, $array)) {
return false;
}
}
return true;
} | [
"public",
"static",
"function",
"all",
"(",
"array",
"$",
"array",
",",
"callable",
"$",
"predicate",
")",
"{",
"foreach",
"(",
"$",
"array",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"$",
"predicate",
"(",
"$",
"value",
",",
... | Returns whether every element of the array satisfies the given predicate or not.
Works with Iterators too.
@param array $array
@param callable $predicate
@return bool | [
"Returns",
"whether",
"every",
"element",
"of",
"the",
"array",
"satisfies",
"the",
"given",
"predicate",
"or",
"not",
".",
"Works",
"with",
"Iterators",
"too",
"."
] | 0429f3509d99c020fc80c44a7ad0ecf6d0bfc053 | https://github.com/narrowspark/arr/blob/0429f3509d99c020fc80c44a7ad0ecf6d0bfc053/src/Arr/Arr.php#L1061-L1070 |
198,028 | Wedeto/FileFormats | src/JSON/Writer.php | Writer.writeJSON | public static function writeJSON($obj, $buf = null)
{
$output = json_encode($obj);
if ($output === false && json_last_error() === JSON_ERROR_UTF8)
{
$obj_fixed = Encoding::fixUTF8($obj);
$output = json_encode($obj_fixed);
if ($output === false && json_las... | php | public static function writeJSON($obj, $buf = null)
{
$output = json_encode($obj);
if ($output === false && json_last_error() === JSON_ERROR_UTF8)
{
$obj_fixed = Encoding::fixUTF8($obj);
$output = json_encode($obj_fixed);
if ($output === false && json_las... | [
"public",
"static",
"function",
"writeJSON",
"(",
"$",
"obj",
",",
"$",
"buf",
"=",
"null",
")",
"{",
"$",
"output",
"=",
"json_encode",
"(",
"$",
"obj",
")",
";",
"if",
"(",
"$",
"output",
"===",
"false",
"&&",
"json_last_error",
"(",
")",
"===",
... | Encode the specified entity, catching UTF8 errors.
@param mixed $obj The data to output
@param resource $buf The buffer to write to. If this is specified, nothing is returned.
@return string The JSON encoded data if no buffer was specified. | [
"Encode",
"the",
"specified",
"entity",
"catching",
"UTF8",
"errors",
"."
] | 65b71fbd38a2ee6b504622aca4f4047ce9d31e9f | https://github.com/Wedeto/FileFormats/blob/65b71fbd38a2ee6b504622aca4f4047ce9d31e9f/src/JSON/Writer.php#L80-L106 |
198,029 | Wedeto/FileFormats | src/JSON/Writer.php | Writer.pprintJSON | public static function pprintJSON($obj, $indent = 0, $json_array = null, $buf = null)
{
if (!is_object($obj) && !is_array($obj))
return self::writeJSON($obj, $buf);
// Make sure objects are traversable, or otherwise convert it to array
if (method_exists($obj, "jsonSerialize"))
... | php | public static function pprintJSON($obj, $indent = 0, $json_array = null, $buf = null)
{
if (!is_object($obj) && !is_array($obj))
return self::writeJSON($obj, $buf);
// Make sure objects are traversable, or otherwise convert it to array
if (method_exists($obj, "jsonSerialize"))
... | [
"public",
"static",
"function",
"pprintJSON",
"(",
"$",
"obj",
",",
"$",
"indent",
"=",
"0",
",",
"$",
"json_array",
"=",
"null",
",",
"$",
"buf",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_object",
"(",
"$",
"obj",
")",
"&&",
"!",
"is_array",
"(... | PrettyPrint the specified output.
@param JSONSerializable $obj The data to output
@param bool $json_array When set to true, output will be formatted as a
JSON array, rather than an object. If this is set to null
the keys will be examined to auto-detect the proper value.
@param resource $buf The buffer to write to. If ... | [
"PrettyPrint",
"the",
"specified",
"output",
"."
] | 65b71fbd38a2ee6b504622aca4f4047ce9d31e9f | https://github.com/Wedeto/FileFormats/blob/65b71fbd38a2ee6b504622aca4f4047ce9d31e9f/src/JSON/Writer.php#L120-L195 |
198,030 | as3io/As3ModlrBundle | DependencyInjection/ServiceLoader/MetadataDrivers.php | MetadataDrivers.createFileLocator | private function createFileLocator($modelDir, $mixinDir, $embedDir)
{
$definition = new Definition(
Utility::getLibraryClass('Metadata\Driver\FileLocator'),
[$modelDir, $mixinDir, $embedDir]
);
$definition->setPublic(false);
return $definition;
} | php | private function createFileLocator($modelDir, $mixinDir, $embedDir)
{
$definition = new Definition(
Utility::getLibraryClass('Metadata\Driver\FileLocator'),
[$modelDir, $mixinDir, $embedDir]
);
$definition->setPublic(false);
return $definition;
} | [
"private",
"function",
"createFileLocator",
"(",
"$",
"modelDir",
",",
"$",
"mixinDir",
",",
"$",
"embedDir",
")",
"{",
"$",
"definition",
"=",
"new",
"Definition",
"(",
"Utility",
"::",
"getLibraryClass",
"(",
"'Metadata\\Driver\\FileLocator'",
")",
",",
"[",
... | Creates the file locator service definition.
@param string $modelDir
@param string $mixinDir
@param string $embedDir
@return Definition | [
"Creates",
"the",
"file",
"locator",
"service",
"definition",
"."
] | 7ce2abb7390c7eaf4081c5b7e00b96e7001774a4 | https://github.com/as3io/As3ModlrBundle/blob/7ce2abb7390c7eaf4081c5b7e00b96e7001774a4/DependencyInjection/ServiceLoader/MetadataDrivers.php#L25-L33 |
198,031 | as3io/As3ModlrBundle | DependencyInjection/ServiceLoader/MetadataDrivers.php | MetadataDrivers.createYmlDriver | private function createYmlDriver($driverName, array $driverConfig, ContainerBuilder $container)
{
// Definition directories
list($modelDir, $mixinDir, $embedDir) = $this->getDefinitionDirs($driverConfig, $container);
// Set the directories to the dirs container parameter.
Utility::a... | php | private function createYmlDriver($driverName, array $driverConfig, ContainerBuilder $container)
{
// Definition directories
list($modelDir, $mixinDir, $embedDir) = $this->getDefinitionDirs($driverConfig, $container);
// Set the directories to the dirs container parameter.
Utility::a... | [
"private",
"function",
"createYmlDriver",
"(",
"$",
"driverName",
",",
"array",
"$",
"driverConfig",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"// Definition directories",
"list",
"(",
"$",
"modelDir",
",",
"$",
"mixinDir",
",",
"$",
"embedDir",
")",
... | Creates the YAML metadata driver service definition.
@param string $driverName
@param array $driverConfig
@param ContainerBuilder $container
@return Definition | [
"Creates",
"the",
"YAML",
"metadata",
"driver",
"service",
"definition",
"."
] | 7ce2abb7390c7eaf4081c5b7e00b96e7001774a4 | https://github.com/as3io/As3ModlrBundle/blob/7ce2abb7390c7eaf4081c5b7e00b96e7001774a4/DependencyInjection/ServiceLoader/MetadataDrivers.php#L43-L66 |
198,032 | as3io/As3ModlrBundle | DependencyInjection/ServiceLoader/MetadataDrivers.php | MetadataDrivers.getDefinitionDir | private function getDefinitionDir($type, array $driverConfig, ContainerBuilder $container)
{
$defaultDir = sprintf('%s/Resources/As3ModlrBundle', $container->getParameter('kernel.root_dir'));
$folder = sprintf('%ss', $type);
$key = sprintf('%s_dir', $type);
return isset($driverConf... | php | private function getDefinitionDir($type, array $driverConfig, ContainerBuilder $container)
{
$defaultDir = sprintf('%s/Resources/As3ModlrBundle', $container->getParameter('kernel.root_dir'));
$folder = sprintf('%ss', $type);
$key = sprintf('%s_dir', $type);
return isset($driverConf... | [
"private",
"function",
"getDefinitionDir",
"(",
"$",
"type",
",",
"array",
"$",
"driverConfig",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"defaultDir",
"=",
"sprintf",
"(",
"'%s/Resources/As3ModlrBundle'",
",",
"$",
"container",
"->",
"getParameter... | Gets the directory for a definition type.
@param string $type
@param array $driverConfig
@param ContainerBuilder $container
@return string | [
"Gets",
"the",
"directory",
"for",
"a",
"definition",
"type",
"."
] | 7ce2abb7390c7eaf4081c5b7e00b96e7001774a4 | https://github.com/as3io/As3ModlrBundle/blob/7ce2abb7390c7eaf4081c5b7e00b96e7001774a4/DependencyInjection/ServiceLoader/MetadataDrivers.php#L76-L87 |
198,033 | as3io/As3ModlrBundle | DependencyInjection/ServiceLoader/MetadataDrivers.php | MetadataDrivers.getDefinitionDirs | private function getDefinitionDirs(array $driverConfig, ContainerBuilder $container)
{
$modelDir = $this->getDefinitionDir('model', $driverConfig, $container);
$mixinDir = $this->getDefinitionDir('mixin', $driverConfig, $container);
$embedDir = $this->getDefinitionDir('embed', $driverConfig,... | php | private function getDefinitionDirs(array $driverConfig, ContainerBuilder $container)
{
$modelDir = $this->getDefinitionDir('model', $driverConfig, $container);
$mixinDir = $this->getDefinitionDir('mixin', $driverConfig, $container);
$embedDir = $this->getDefinitionDir('embed', $driverConfig,... | [
"private",
"function",
"getDefinitionDirs",
"(",
"array",
"$",
"driverConfig",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"modelDir",
"=",
"$",
"this",
"->",
"getDefinitionDir",
"(",
"'model'",
",",
"$",
"driverConfig",
",",
"$",
"container",
")... | Gets the definition directories for models and mixins and returns as a tuple.
@param array $driverConfig
@param ContainerBuilder $container
@return string[] | [
"Gets",
"the",
"definition",
"directories",
"for",
"models",
"and",
"mixins",
"and",
"returns",
"as",
"a",
"tuple",
"."
] | 7ce2abb7390c7eaf4081c5b7e00b96e7001774a4 | https://github.com/as3io/As3ModlrBundle/blob/7ce2abb7390c7eaf4081c5b7e00b96e7001774a4/DependencyInjection/ServiceLoader/MetadataDrivers.php#L96-L102 |
198,034 | faustbrian/HTTP | src/PendingHttpRequest.php | PendingHttpRequest.bodyFormat | public function bodyFormat(string $format): self
{
return tap($this, function ($request) use ($format) {
$this->bodyFormat = $format;
});
} | php | public function bodyFormat(string $format): self
{
return tap($this, function ($request) use ($format) {
$this->bodyFormat = $format;
});
} | [
"public",
"function",
"bodyFormat",
"(",
"string",
"$",
"format",
")",
":",
"self",
"{",
"return",
"tap",
"(",
"$",
"this",
",",
"function",
"(",
"$",
"request",
")",
"use",
"(",
"$",
"format",
")",
"{",
"$",
"this",
"->",
"bodyFormat",
"=",
"$",
"... | Set the request body fomrat.
@param string $format
@return \BrianFaust\Http\PendingHttpRequest | [
"Set",
"the",
"request",
"body",
"fomrat",
"."
] | ab24b37ea211eb106237a813ec8d47ec1d4fe199 | https://github.com/faustbrian/HTTP/blob/ab24b37ea211eb106237a813ec8d47ec1d4fe199/src/PendingHttpRequest.php#L86-L91 |
198,035 | faustbrian/HTTP | src/PendingHttpRequest.php | PendingHttpRequest.withBaseUri | public function withBaseUri(string $uri): self
{
return tap($this, function ($request) use ($uri) {
return $this->options = array_merge_recursive($this->options, [
'base_uri' => $uri,
]);
});
} | php | public function withBaseUri(string $uri): self
{
return tap($this, function ($request) use ($uri) {
return $this->options = array_merge_recursive($this->options, [
'base_uri' => $uri,
]);
});
} | [
"public",
"function",
"withBaseUri",
"(",
"string",
"$",
"uri",
")",
":",
"self",
"{",
"return",
"tap",
"(",
"$",
"this",
",",
"function",
"(",
"$",
"request",
")",
"use",
"(",
"$",
"uri",
")",
"{",
"return",
"$",
"this",
"->",
"options",
"=",
"arr... | Set the base uri for all requests.
@param string $uri
@return \BrianFaust\Http\PendingHttpRequest | [
"Set",
"the",
"base",
"uri",
"for",
"all",
"requests",
"."
] | ab24b37ea211eb106237a813ec8d47ec1d4fe199 | https://github.com/faustbrian/HTTP/blob/ab24b37ea211eb106237a813ec8d47ec1d4fe199/src/PendingHttpRequest.php#L164-L171 |
198,036 | faustbrian/HTTP | src/PendingHttpRequest.php | PendingHttpRequest.withHeaders | public function withHeaders(array $headers): self
{
return tap($this, function ($request) use ($headers) {
return $this->options = array_merge_recursive($this->options, [
'headers' => $headers,
]);
});
} | php | public function withHeaders(array $headers): self
{
return tap($this, function ($request) use ($headers) {
return $this->options = array_merge_recursive($this->options, [
'headers' => $headers,
]);
});
} | [
"public",
"function",
"withHeaders",
"(",
"array",
"$",
"headers",
")",
":",
"self",
"{",
"return",
"tap",
"(",
"$",
"this",
",",
"function",
"(",
"$",
"request",
")",
"use",
"(",
"$",
"headers",
")",
"{",
"return",
"$",
"this",
"->",
"options",
"=",... | Send headers with the request.
@param array $headers
@return \BrianFaust\Http\PendingHttpRequest | [
"Send",
"headers",
"with",
"the",
"request",
"."
] | ab24b37ea211eb106237a813ec8d47ec1d4fe199 | https://github.com/faustbrian/HTTP/blob/ab24b37ea211eb106237a813ec8d47ec1d4fe199/src/PendingHttpRequest.php#L239-L246 |
198,037 | faustbrian/HTTP | src/PendingHttpRequest.php | PendingHttpRequest.withCookies | public function withCookies(): self
{
return tap($this, function ($request) {
return $this->options = array_merge_recursive($this->options, [
'cookies' => static::getCookieJar(),
]);
});
} | php | public function withCookies(): self
{
return tap($this, function ($request) {
return $this->options = array_merge_recursive($this->options, [
'cookies' => static::getCookieJar(),
]);
});
} | [
"public",
"function",
"withCookies",
"(",
")",
":",
"self",
"{",
"return",
"tap",
"(",
"$",
"this",
",",
"function",
"(",
"$",
"request",
")",
"{",
"return",
"$",
"this",
"->",
"options",
"=",
"array_merge_recursive",
"(",
"$",
"this",
"->",
"options",
... | Store any cookies in a cookie jar.
@return \BrianFaust\Http\PendingHttpRequest | [
"Store",
"any",
"cookies",
"in",
"a",
"cookie",
"jar",
"."
] | ab24b37ea211eb106237a813ec8d47ec1d4fe199 | https://github.com/faustbrian/HTTP/blob/ab24b37ea211eb106237a813ec8d47ec1d4fe199/src/PendingHttpRequest.php#L281-L288 |
198,038 | faustbrian/HTTP | src/PendingHttpRequest.php | PendingHttpRequest.withHandler | public function withHandler($handler): self
{
return tap($this, function ($request) use ($handler) {
return $this->handler = $handler;
});
} | php | public function withHandler($handler): self
{
return tap($this, function ($request) use ($handler) {
return $this->handler = $handler;
});
} | [
"public",
"function",
"withHandler",
"(",
"$",
"handler",
")",
":",
"self",
"{",
"return",
"tap",
"(",
"$",
"this",
",",
"function",
"(",
"$",
"request",
")",
"use",
"(",
"$",
"handler",
")",
"{",
"return",
"$",
"this",
"->",
"handler",
"=",
"$",
"... | Handle requests with the given class.
@param mixed $handler
@return \BrianFaust\Http\PendingHttpRequest | [
"Handle",
"requests",
"with",
"the",
"given",
"class",
"."
] | ab24b37ea211eb106237a813ec8d47ec1d4fe199 | https://github.com/faustbrian/HTTP/blob/ab24b37ea211eb106237a813ec8d47ec1d4fe199/src/PendingHttpRequest.php#L307-L312 |
198,039 | faustbrian/HTTP | src/PendingHttpRequest.php | PendingHttpRequest.timeout | public function timeout(int $seconds): self
{
return tap($this, function () use ($seconds) {
return $this->options = array_merge_recursive($this->options, [
'timeout' => $seconds,
]);
});
} | php | public function timeout(int $seconds): self
{
return tap($this, function () use ($seconds) {
return $this->options = array_merge_recursive($this->options, [
'timeout' => $seconds,
]);
});
} | [
"public",
"function",
"timeout",
"(",
"int",
"$",
"seconds",
")",
":",
"self",
"{",
"return",
"tap",
"(",
"$",
"this",
",",
"function",
"(",
")",
"use",
"(",
"$",
"seconds",
")",
"{",
"return",
"$",
"this",
"->",
"options",
"=",
"array_merge_recursive"... | Timeout of the request in seconds.
@param int $seconds
@return \BrianFaust\Http\PendingHttpRequest | [
"Timeout",
"of",
"the",
"request",
"in",
"seconds",
"."
] | ab24b37ea211eb106237a813ec8d47ec1d4fe199 | https://github.com/faustbrian/HTTP/blob/ab24b37ea211eb106237a813ec8d47ec1d4fe199/src/PendingHttpRequest.php#L321-L328 |
198,040 | faustbrian/HTTP | src/PendingHttpRequest.php | PendingHttpRequest.beforeSending | public function beforeSending(Closure $callback): self
{
return tap($this, function () use ($callback) {
$this->beforeSendingCallbacks[] = $callback;
});
} | php | public function beforeSending(Closure $callback): self
{
return tap($this, function () use ($callback) {
$this->beforeSendingCallbacks[] = $callback;
});
} | [
"public",
"function",
"beforeSending",
"(",
"Closure",
"$",
"callback",
")",
":",
"self",
"{",
"return",
"tap",
"(",
"$",
"this",
",",
"function",
"(",
")",
"use",
"(",
"$",
"callback",
")",
"{",
"$",
"this",
"->",
"beforeSendingCallbacks",
"[",
"]",
"... | Set the pre-request Callback.
@param \Closure $callback
@return \BrianFaust\Http\PendingHttpRequest | [
"Set",
"the",
"pre",
"-",
"request",
"Callback",
"."
] | ab24b37ea211eb106237a813ec8d47ec1d4fe199 | https://github.com/faustbrian/HTTP/blob/ab24b37ea211eb106237a813ec8d47ec1d4fe199/src/PendingHttpRequest.php#L337-L342 |
198,041 | faustbrian/HTTP | src/PendingHttpRequest.php | PendingHttpRequest.post | public function post(string $url, $params = null): HttpResponse
{
return $this->send('POST', $url, [
$this->bodyFormat => $params,
]);
} | php | public function post(string $url, $params = null): HttpResponse
{
return $this->send('POST', $url, [
$this->bodyFormat => $params,
]);
} | [
"public",
"function",
"post",
"(",
"string",
"$",
"url",
",",
"$",
"params",
"=",
"null",
")",
":",
"HttpResponse",
"{",
"return",
"$",
"this",
"->",
"send",
"(",
"'POST'",
",",
"$",
"url",
",",
"[",
"$",
"this",
"->",
"bodyFormat",
"=>",
"$",
"par... | Create and send an Http "POST" request.
@param string $url
@param null|string|array $params
@return \BrianFaust\Http\HttpResponse | [
"Create",
"and",
"send",
"an",
"Http",
"POST",
"request",
"."
] | ab24b37ea211eb106237a813ec8d47ec1d4fe199 | https://github.com/faustbrian/HTTP/blob/ab24b37ea211eb106237a813ec8d47ec1d4fe199/src/PendingHttpRequest.php#L367-L372 |
198,042 | faustbrian/HTTP | src/PendingHttpRequest.php | PendingHttpRequest.delete | public function delete(string $url, array $params = []): HttpResponse
{
return $this->send('DELETE', $url, [
$this->bodyFormat => $params,
]);
} | php | public function delete(string $url, array $params = []): HttpResponse
{
return $this->send('DELETE', $url, [
$this->bodyFormat => $params,
]);
} | [
"public",
"function",
"delete",
"(",
"string",
"$",
"url",
",",
"array",
"$",
"params",
"=",
"[",
"]",
")",
":",
"HttpResponse",
"{",
"return",
"$",
"this",
"->",
"send",
"(",
"'DELETE'",
",",
"$",
"url",
",",
"[",
"$",
"this",
"->",
"bodyFormat",
... | Create and send an Http "DELETE" request.
@param string $url
@param array $params
@return \BrianFaust\Http\HttpResponse | [
"Create",
"and",
"send",
"an",
"Http",
"DELETE",
"request",
"."
] | ab24b37ea211eb106237a813ec8d47ec1d4fe199 | https://github.com/faustbrian/HTTP/blob/ab24b37ea211eb106237a813ec8d47ec1d4fe199/src/PendingHttpRequest.php#L412-L417 |
198,043 | faustbrian/HTTP | src/PendingHttpRequest.php | PendingHttpRequest.send | public function send(string $method, string $url, array $options): HttpResponse
{
try {
return new HttpResponse($this->buildClient()->request($method, $url, $this->mergeOptions([
'query' => $this->parseQueryParams($url),
], $options)));
} catch (\GuzzleHttp\Ex... | php | public function send(string $method, string $url, array $options): HttpResponse
{
try {
return new HttpResponse($this->buildClient()->request($method, $url, $this->mergeOptions([
'query' => $this->parseQueryParams($url),
], $options)));
} catch (\GuzzleHttp\Ex... | [
"public",
"function",
"send",
"(",
"string",
"$",
"method",
",",
"string",
"$",
"url",
",",
"array",
"$",
"options",
")",
":",
"HttpResponse",
"{",
"try",
"{",
"return",
"new",
"HttpResponse",
"(",
"$",
"this",
"->",
"buildClient",
"(",
")",
"->",
"req... | Create and send an Http request.
@param string $method
@param string $url
@param array $options
@return \BrianFaust\Http\HttpResponse | [
"Create",
"and",
"send",
"an",
"Http",
"request",
"."
] | ab24b37ea211eb106237a813ec8d47ec1d4fe199 | https://github.com/faustbrian/HTTP/blob/ab24b37ea211eb106237a813ec8d47ec1d4fe199/src/PendingHttpRequest.php#L428-L437 |
198,044 | faustbrian/HTTP | src/PendingHttpRequest.php | PendingHttpRequest.buildHandlerStack | public function buildHandlerStack(): HandlerStack
{
static $handler;
if (!$handler) {
$handler = $this->handler ?? \GuzzleHttp\choose_handler();
}
if ($handler instanceof HandlerStack) {
$stack = $handler;
}
return tap($stack ?? HandlerStack... | php | public function buildHandlerStack(): HandlerStack
{
static $handler;
if (!$handler) {
$handler = $this->handler ?? \GuzzleHttp\choose_handler();
}
if ($handler instanceof HandlerStack) {
$stack = $handler;
}
return tap($stack ?? HandlerStack... | [
"public",
"function",
"buildHandlerStack",
"(",
")",
":",
"HandlerStack",
"{",
"static",
"$",
"handler",
";",
"if",
"(",
"!",
"$",
"handler",
")",
"{",
"$",
"handler",
"=",
"$",
"this",
"->",
"handler",
"??",
"\\",
"GuzzleHttp",
"\\",
"choose_handler",
"... | Create a new Guzzle HandlerStack instance.
@return \GuzzleHttp\HandlerStack | [
"Create",
"a",
"new",
"Guzzle",
"HandlerStack",
"instance",
"."
] | ab24b37ea211eb106237a813ec8d47ec1d4fe199 | https://github.com/faustbrian/HTTP/blob/ab24b37ea211eb106237a813ec8d47ec1d4fe199/src/PendingHttpRequest.php#L454-L469 |
198,045 | faustbrian/HTTP | src/PendingHttpRequest.php | PendingHttpRequest.runBeforeSendingCallbacks | public function runBeforeSendingCallbacks(Request $request): Request
{
return tap($request, function ($request) {
$this->beforeSendingCallbacks->each->__invoke(new HttpRequest($request));
});
} | php | public function runBeforeSendingCallbacks(Request $request): Request
{
return tap($request, function ($request) {
$this->beforeSendingCallbacks->each->__invoke(new HttpRequest($request));
});
} | [
"public",
"function",
"runBeforeSendingCallbacks",
"(",
"Request",
"$",
"request",
")",
":",
"Request",
"{",
"return",
"tap",
"(",
"$",
"request",
",",
"function",
"(",
"$",
"request",
")",
"{",
"$",
"this",
"->",
"beforeSendingCallbacks",
"->",
"each",
"->"... | Run the pre-request callback.
@param \GuzzleHttp\Psr7\Request $request
@return \GuzzleHttp\Psr7\Request | [
"Run",
"the",
"pre",
"-",
"request",
"callback",
"."
] | ab24b37ea211eb106237a813ec8d47ec1d4fe199 | https://github.com/faustbrian/HTTP/blob/ab24b37ea211eb106237a813ec8d47ec1d4fe199/src/PendingHttpRequest.php#L492-L497 |
198,046 | faustbrian/HTTP | src/PendingHttpRequest.php | PendingHttpRequest.parseQueryParams | public function parseQueryParams(string $url): array
{
return tap([], function (&$query) use ($url) {
parse_str(parse_url($url, PHP_URL_QUERY) ?? '', $query);
});
} | php | public function parseQueryParams(string $url): array
{
return tap([], function (&$query) use ($url) {
parse_str(parse_url($url, PHP_URL_QUERY) ?? '', $query);
});
} | [
"public",
"function",
"parseQueryParams",
"(",
"string",
"$",
"url",
")",
":",
"array",
"{",
"return",
"tap",
"(",
"[",
"]",
",",
"function",
"(",
"&",
"$",
"query",
")",
"use",
"(",
"$",
"url",
")",
"{",
"parse_str",
"(",
"parse_url",
"(",
"$",
"u... | Parse the given URL and return its query.
@param string $url
@return array | [
"Parse",
"the",
"given",
"URL",
"and",
"return",
"its",
"query",
"."
] | ab24b37ea211eb106237a813ec8d47ec1d4fe199 | https://github.com/faustbrian/HTTP/blob/ab24b37ea211eb106237a813ec8d47ec1d4fe199/src/PendingHttpRequest.php#L518-L523 |
198,047 | DavidePastore/paris-model-generator | src/DavidePastore/ParisModelGenerator/Config.php | Config.createFromComposer | public function createFromComposer($file = 'composer.json'){
$composer = $this->readComposerDotJson($file);
//Default values
$this->setNamespace('');
$this->setDestinationFolder('generated\\');
if(isset($composer['extra']) && isset($composer['extra']['paris-model-generator'])){
$configuration = $comp... | php | public function createFromComposer($file = 'composer.json'){
$composer = $this->readComposerDotJson($file);
//Default values
$this->setNamespace('');
$this->setDestinationFolder('generated\\');
if(isset($composer['extra']) && isset($composer['extra']['paris-model-generator'])){
$configuration = $comp... | [
"public",
"function",
"createFromComposer",
"(",
"$",
"file",
"=",
"'composer.json'",
")",
"{",
"$",
"composer",
"=",
"$",
"this",
"->",
"readComposerDotJson",
"(",
"$",
"file",
")",
";",
"//Default values",
"$",
"this",
"->",
"setNamespace",
"(",
"''",
")",... | Set parameters from the given composer.json file path.
@param string $file The composer.json file path. | [
"Set",
"parameters",
"from",
"the",
"given",
"composer",
".",
"json",
"file",
"path",
"."
] | cd056dd7a2218b1c56fa17dcc6311e01a2570030 | https://github.com/DavidePastore/paris-model-generator/blob/cd056dd7a2218b1c56fa17dcc6311e01a2570030/src/DavidePastore/ParisModelGenerator/Config.php#L99-L151 |
198,048 | gplcart/cli | controllers/commands/ImageStyle.php | ImageStyle.cmdUpdateImageStyle | public function cmdUpdateImageStyle()
{
$params = $this->getParam();
if (empty($params[0]) || count($params) < 2) {
$this->errorAndExit($this->text('Invalid command'));
}
if (!is_numeric($params[0])) {
$this->errorAndExit($this->text('Invalid argument'));
... | php | public function cmdUpdateImageStyle()
{
$params = $this->getParam();
if (empty($params[0]) || count($params) < 2) {
$this->errorAndExit($this->text('Invalid command'));
}
if (!is_numeric($params[0])) {
$this->errorAndExit($this->text('Invalid argument'));
... | [
"public",
"function",
"cmdUpdateImageStyle",
"(",
")",
"{",
"$",
"params",
"=",
"$",
"this",
"->",
"getParam",
"(",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"params",
"[",
"0",
"]",
")",
"||",
"count",
"(",
"$",
"params",
")",
"<",
"2",
")",
"{",
... | Callback for "imagestyle-update" | [
"Callback",
"for",
"imagestyle",
"-",
"update"
] | e57dba53e291a225b4bff0c0d9b23d685dd1c125 | https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/ImageStyle.php#L40-L59 |
198,049 | gplcart/cli | controllers/commands/ImageStyle.php | ImageStyle.cmdDeleteImageStyle | public function cmdDeleteImageStyle()
{
$id = $this->getParam(0);
if (empty($id) || !is_numeric($id)) {
$this->errorAndExit($this->text('Invalid argument'));
}
if (!$this->image_style->delete($id)) {
$this->errorAndExit($this->text('Unexpected result'));
... | php | public function cmdDeleteImageStyle()
{
$id = $this->getParam(0);
if (empty($id) || !is_numeric($id)) {
$this->errorAndExit($this->text('Invalid argument'));
}
if (!$this->image_style->delete($id)) {
$this->errorAndExit($this->text('Unexpected result'));
... | [
"public",
"function",
"cmdDeleteImageStyle",
"(",
")",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"getParam",
"(",
"0",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"id",
")",
"||",
"!",
"is_numeric",
"(",
"$",
"id",
")",
")",
"{",
"$",
"this",
"->",
"... | Callback for "imagestyle-delete" command | [
"Callback",
"for",
"imagestyle",
"-",
"delete",
"command"
] | e57dba53e291a225b4bff0c0d9b23d685dd1c125 | https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/ImageStyle.php#L78-L91 |
198,050 | gplcart/cli | controllers/commands/ImageStyle.php | ImageStyle.cmdClearImageStyle | public function cmdClearImageStyle()
{
$id = $this->getParam(0);
$all = $this->getParam('all');
if (!isset($id) && empty($all)) {
$this->errorAndExit($this->text('Invalid command'));
}
$result = false;
if (isset($id)) {
if (!is_numeric($id)... | php | public function cmdClearImageStyle()
{
$id = $this->getParam(0);
$all = $this->getParam('all');
if (!isset($id) && empty($all)) {
$this->errorAndExit($this->text('Invalid command'));
}
$result = false;
if (isset($id)) {
if (!is_numeric($id)... | [
"public",
"function",
"cmdClearImageStyle",
"(",
")",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"getParam",
"(",
"0",
")",
";",
"$",
"all",
"=",
"$",
"this",
"->",
"getParam",
"(",
"'all'",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"id",
")",
... | Callback for "imagestyle-clear" command | [
"Callback",
"for",
"imagestyle",
"-",
"clear",
"command"
] | e57dba53e291a225b4bff0c0d9b23d685dd1c125 | https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/ImageStyle.php#L96-L123 |
198,051 | gplcart/cli | controllers/commands/ImageStyle.php | ImageStyle.cmdGetImageStyle | public function cmdGetImageStyle()
{
$list = $this->getListImageStyle();
$this->outputFormat($list);
$this->outputFormatTableImageStyle($list);
$this->output();
} | php | public function cmdGetImageStyle()
{
$list = $this->getListImageStyle();
$this->outputFormat($list);
$this->outputFormatTableImageStyle($list);
$this->output();
} | [
"public",
"function",
"cmdGetImageStyle",
"(",
")",
"{",
"$",
"list",
"=",
"$",
"this",
"->",
"getListImageStyle",
"(",
")",
";",
"$",
"this",
"->",
"outputFormat",
"(",
"$",
"list",
")",
";",
"$",
"this",
"->",
"outputFormatTableImageStyle",
"(",
"$",
"... | Callback for "imagestyle-get" command | [
"Callback",
"for",
"imagestyle",
"-",
"get",
"command"
] | e57dba53e291a225b4bff0c0d9b23d685dd1c125 | https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/ImageStyle.php#L128-L134 |
198,052 | gplcart/cli | controllers/commands/ImageStyle.php | ImageStyle.submitAddImageStyle | protected function submitAddImageStyle()
{
$this->setSubmitted(null, $this->getParam());
$this->setSubmittedList('actions');
$this->validateComponent('image_style');
$this->addImageStyle();
} | php | protected function submitAddImageStyle()
{
$this->setSubmitted(null, $this->getParam());
$this->setSubmittedList('actions');
$this->validateComponent('image_style');
$this->addImageStyle();
} | [
"protected",
"function",
"submitAddImageStyle",
"(",
")",
"{",
"$",
"this",
"->",
"setSubmitted",
"(",
"null",
",",
"$",
"this",
"->",
"getParam",
"(",
")",
")",
";",
"$",
"this",
"->",
"setSubmittedList",
"(",
"'actions'",
")",
";",
"$",
"this",
"->",
... | Add an image style at once | [
"Add",
"an",
"image",
"style",
"at",
"once"
] | e57dba53e291a225b4bff0c0d9b23d685dd1c125 | https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/ImageStyle.php#L220-L226 |
198,053 | gplcart/cli | controllers/commands/ImageStyle.php | ImageStyle.wizardAddImageStyle | protected function wizardAddImageStyle()
{
$this->validatePrompt('name', $this->text('Name'), 'image_style');
$this->validatePromptList('actions', $this->text('Actions'), 'image_style');
$this->validatePrompt('status', $this->text('Status'), 'image_style', 0);
$this->setSubmittedList... | php | protected function wizardAddImageStyle()
{
$this->validatePrompt('name', $this->text('Name'), 'image_style');
$this->validatePromptList('actions', $this->text('Actions'), 'image_style');
$this->validatePrompt('status', $this->text('Status'), 'image_style', 0);
$this->setSubmittedList... | [
"protected",
"function",
"wizardAddImageStyle",
"(",
")",
"{",
"$",
"this",
"->",
"validatePrompt",
"(",
"'name'",
",",
"$",
"this",
"->",
"text",
"(",
"'Name'",
")",
",",
"'image_style'",
")",
";",
"$",
"this",
"->",
"validatePromptList",
"(",
"'actions'",
... | Adds an image style step-by-step | [
"Adds",
"an",
"image",
"style",
"step",
"-",
"by",
"-",
"step"
] | e57dba53e291a225b4bff0c0d9b23d685dd1c125 | https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/ImageStyle.php#L231-L240 |
198,054 | oliverde8/AssociativeArraySimplified | src/AssociativeArray.php | AssociativeArray.set | public function set($key, $value) {
$this->checkReadOnly();
self::setFromKey($this->data, $key, $value, $this->separator);
} | php | public function set($key, $value) {
$this->checkReadOnly();
self::setFromKey($this->data, $key, $value, $this->separator);
} | [
"public",
"function",
"set",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"checkReadOnly",
"(",
")",
";",
"self",
"::",
"setFromKey",
"(",
"$",
"this",
"->",
"data",
",",
"$",
"key",
",",
"$",
"value",
",",
"$",
"this",
"->",
... | Set data inside
@param string[]|string $key Key or path to the value to set
(either array or string separated with the separator)
@param mixed $value Value to put | [
"Set",
"data",
"inside"
] | aa1af7c404d62879140a76e8e9404584c7776b5f | https://github.com/oliverde8/AssociativeArraySimplified/blob/aa1af7c404d62879140a76e8e9404584c7776b5f/src/AssociativeArray.php#L82-L85 |
198,055 | oliverde8/AssociativeArraySimplified | src/AssociativeArray.php | AssociativeArray.recursiveGetFromKey | private static function recursiveGetFromKey($data, $key, $default)
{
if (empty($key)) {
return $data;
} else {
$currentKey = array_shift($key);
return isset($data[$currentKey]) ? self::recursiveGetFromKey($data[$currentKey], $key, $default) : $default;
}
... | php | private static function recursiveGetFromKey($data, $key, $default)
{
if (empty($key)) {
return $data;
} else {
$currentKey = array_shift($key);
return isset($data[$currentKey]) ? self::recursiveGetFromKey($data[$currentKey], $key, $default) : $default;
}
... | [
"private",
"static",
"function",
"recursiveGetFromKey",
"(",
"$",
"data",
",",
"$",
"key",
",",
"$",
"default",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"key",
")",
")",
"{",
"return",
"$",
"data",
";",
"}",
"else",
"{",
"$",
"currentKey",
"=",
"arr... | Private unsecured function for getFromKey
@param $data
@param $key
@param $default
@return mixed | [
"Private",
"unsecured",
"function",
"for",
"getFromKey"
] | aa1af7c404d62879140a76e8e9404584c7776b5f | https://github.com/oliverde8/AssociativeArraySimplified/blob/aa1af7c404d62879140a76e8e9404584c7776b5f/src/AssociativeArray.php#L163-L171 |
198,056 | oliverde8/AssociativeArraySimplified | src/AssociativeArray.php | AssociativeArray.setFromKey | public static function setFromKey(&$data, $key, $value, $separator = '/')
{
if (is_string($key)) {
$key = explode($separator, $key);
}
$data = self::recursiveSetFromKey($data, $key, $value);
} | php | public static function setFromKey(&$data, $key, $value, $separator = '/')
{
if (is_string($key)) {
$key = explode($separator, $key);
}
$data = self::recursiveSetFromKey($data, $key, $value);
} | [
"public",
"static",
"function",
"setFromKey",
"(",
"&",
"$",
"data",
",",
"$",
"key",
",",
"$",
"value",
",",
"$",
"separator",
"=",
"'/'",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"key",
")",
")",
"{",
"$",
"key",
"=",
"explode",
"(",
"$",
... | Set data inside an array
@param array $data array to set new value in
@param string[]|string $key Key or path to the value to set
(either array or string separated with the separator)
@param mixed $value Value to put
@param string $separator separator to use with the string | [
"Set",
"data",
"inside",
"an",
"array"
] | aa1af7c404d62879140a76e8e9404584c7776b5f | https://github.com/oliverde8/AssociativeArraySimplified/blob/aa1af7c404d62879140a76e8e9404584c7776b5f/src/AssociativeArray.php#L219-L225 |
198,057 | oliverde8/AssociativeArraySimplified | src/AssociativeArray.php | AssociativeArray.recursiveSetFromKey | private static function recursiveSetFromKey($data, $key, $value)
{
if (empty($key)) {
return $value;
} else {
if (!is_array($data)) {
$data = [];
}
$currentKey = array_shift($key);
if (!isset($data[$currentKey])) {
... | php | private static function recursiveSetFromKey($data, $key, $value)
{
if (empty($key)) {
return $value;
} else {
if (!is_array($data)) {
$data = [];
}
$currentKey = array_shift($key);
if (!isset($data[$currentKey])) {
... | [
"private",
"static",
"function",
"recursiveSetFromKey",
"(",
"$",
"data",
",",
"$",
"key",
",",
"$",
"value",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"key",
")",
")",
"{",
"return",
"$",
"value",
";",
"}",
"else",
"{",
"if",
"(",
"!",
"is_array",
... | Private unsecured method to set data in array
@param $data
@param $key
@param $value
@return array | [
"Private",
"unsecured",
"method",
"to",
"set",
"data",
"in",
"array"
] | aa1af7c404d62879140a76e8e9404584c7776b5f | https://github.com/oliverde8/AssociativeArraySimplified/blob/aa1af7c404d62879140a76e8e9404584c7776b5f/src/AssociativeArray.php#L236-L253 |
198,058 | PenoaksDev/Milky-Framework | src/Milky/Account/Guards/SessionGuard.php | SessionGuard.id | public function id()
{
if ( $this->loggedOut )
return null;
$id = $this->session->get( $this->getName() );
if ( is_null( $id ) && $this->acct() )
$id = $this->acct()->getId();
return $id;
} | php | public function id()
{
if ( $this->loggedOut )
return null;
$id = $this->session->get( $this->getName() );
if ( is_null( $id ) && $this->acct() )
$id = $this->acct()->getId();
return $id;
} | [
"public",
"function",
"id",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"loggedOut",
")",
"return",
"null",
";",
"$",
"id",
"=",
"$",
"this",
"->",
"session",
"->",
"get",
"(",
"$",
"this",
"->",
"getName",
"(",
")",
")",
";",
"if",
"(",
"is_n... | Get the ID for the currently authenticated acct.
@return int|null | [
"Get",
"the",
"ID",
"for",
"the",
"currently",
"authenticated",
"acct",
"."
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Account/Guards/SessionGuard.php#L142-L153 |
198,059 | PenoaksDev/Milky-Framework | src/Milky/Account/Guards/SessionGuard.php | SessionGuard.getAcctByRecaller | protected function getAcctByRecaller( $recaller )
{
if ( $this->validRecaller( $recaller ) && !$this->tokenRetrievalAttempted )
{
$this->tokenRetrievalAttempted = true;
list( $id, $token ) = explode( '|', $recaller, 2 );
$this->viaRemember = !is_null( $acct = $this->auth->retrieveByToken( $id, $token ) );... | php | protected function getAcctByRecaller( $recaller )
{
if ( $this->validRecaller( $recaller ) && !$this->tokenRetrievalAttempted )
{
$this->tokenRetrievalAttempted = true;
list( $id, $token ) = explode( '|', $recaller, 2 );
$this->viaRemember = !is_null( $acct = $this->auth->retrieveByToken( $id, $token ) );... | [
"protected",
"function",
"getAcctByRecaller",
"(",
"$",
"recaller",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"validRecaller",
"(",
"$",
"recaller",
")",
"&&",
"!",
"$",
"this",
"->",
"tokenRetrievalAttempted",
")",
"{",
"$",
"this",
"->",
"tokenRetrievalAttem... | Pull a acct from the repository by its recaller ID.
@param string $recaller
@return mixed | [
"Pull",
"a",
"acct",
"from",
"the",
"repository",
"by",
"its",
"recaller",
"ID",
"."
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Account/Guards/SessionGuard.php#L161-L173 |
198,060 | PenoaksDev/Milky-Framework | src/Milky/Account/Guards/SessionGuard.php | SessionGuard.getRecallerId | protected function getRecallerId()
{
if ( $this->validRecaller( $recaller = $this->getRecaller() ) )
return head( explode( '|', $recaller ) );
return null;
} | php | protected function getRecallerId()
{
if ( $this->validRecaller( $recaller = $this->getRecaller() ) )
return head( explode( '|', $recaller ) );
return null;
} | [
"protected",
"function",
"getRecallerId",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"validRecaller",
"(",
"$",
"recaller",
"=",
"$",
"this",
"->",
"getRecaller",
"(",
")",
")",
")",
"return",
"head",
"(",
"explode",
"(",
"'|'",
",",
"$",
"recaller",... | Get the acct ID from the recaller cookie.
@return string|null | [
"Get",
"the",
"acct",
"ID",
"from",
"the",
"recaller",
"cookie",
"."
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Account/Guards/SessionGuard.php#L190-L196 |
198,061 | PenoaksDev/Milky-Framework | src/Milky/Account/Guards/SessionGuard.php | SessionGuard.once | public function once( array $credentials = [] )
{
if ( $this->validate( $credentials ) )
{
$this->setAcct( $this->lastAttempted );
return true;
}
return false;
} | php | public function once( array $credentials = [] )
{
if ( $this->validate( $credentials ) )
{
$this->setAcct( $this->lastAttempted );
return true;
}
return false;
} | [
"public",
"function",
"once",
"(",
"array",
"$",
"credentials",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"validate",
"(",
"$",
"credentials",
")",
")",
"{",
"$",
"this",
"->",
"setAcct",
"(",
"$",
"this",
"->",
"lastAttempted",
")",
"... | Log a acct into the application without sessions or cookies.
@param array $credentials
@return bool | [
"Log",
"a",
"acct",
"into",
"the",
"application",
"without",
"sessions",
"or",
"cookies",
"."
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Account/Guards/SessionGuard.php#L220-L230 |
198,062 | PenoaksDev/Milky-Framework | src/Milky/Account/Guards/SessionGuard.php | SessionGuard.hasValidCredentials | protected function hasValidCredentials( $acct, $credentials )
{
return !is_null( $acct ) && $this->auth->validateCredentials( $acct, $credentials );
} | php | protected function hasValidCredentials( $acct, $credentials )
{
return !is_null( $acct ) && $this->auth->validateCredentials( $acct, $credentials );
} | [
"protected",
"function",
"hasValidCredentials",
"(",
"$",
"acct",
",",
"$",
"credentials",
")",
"{",
"return",
"!",
"is_null",
"(",
"$",
"acct",
")",
"&&",
"$",
"this",
"->",
"auth",
"->",
"validateCredentials",
"(",
"$",
"acct",
",",
"$",
"credentials",
... | Determine if the acct matches the credentials.
@param mixed $acct
@param array $credentials
@return bool | [
"Determine",
"if",
"the",
"acct",
"matches",
"the",
"credentials",
"."
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Account/Guards/SessionGuard.php#L364-L367 |
198,063 | PenoaksDev/Milky-Framework | src/Milky/Account/Guards/SessionGuard.php | SessionGuard.onceUsingId | public function onceUsingId( $id )
{
$acct = $this->auth->retrieveById( $id );
if ( !is_null( $acct ) )
{
$this->setAcct( $acct );
return true;
}
return false;
} | php | public function onceUsingId( $id )
{
$acct = $this->auth->retrieveById( $id );
if ( !is_null( $acct ) )
{
$this->setAcct( $acct );
return true;
}
return false;
} | [
"public",
"function",
"onceUsingId",
"(",
"$",
"id",
")",
"{",
"$",
"acct",
"=",
"$",
"this",
"->",
"auth",
"->",
"retrieveById",
"(",
"$",
"id",
")",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"acct",
")",
")",
"{",
"$",
"this",
"->",
"setAcct",
... | Log the given acct ID into the application without sessions or cookies.
@param mixed $id
@return bool | [
"Log",
"the",
"given",
"acct",
"ID",
"into",
"the",
"application",
"without",
"sessions",
"or",
"cookies",
"."
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Account/Guards/SessionGuard.php#L480-L492 |
198,064 | PenoaksDev/Milky-Framework | src/Milky/Account/Guards/SessionGuard.php | SessionGuard.logout | public function logout()
{
$acct = $this->acct();
// If we have an event dispatcher instance, we can fire off the logout event
// so any further processing can be done. This allows the developer to be
// listening for anytime a acct signs out of this application manually.
$this->clearAcctDataFromStorage();
... | php | public function logout()
{
$acct = $this->acct();
// If we have an event dispatcher instance, we can fire off the logout event
// so any further processing can be done. This allows the developer to be
// listening for anytime a acct signs out of this application manually.
$this->clearAcctDataFromStorage();
... | [
"public",
"function",
"logout",
"(",
")",
"{",
"$",
"acct",
"=",
"$",
"this",
"->",
"acct",
"(",
")",
";",
"// If we have an event dispatcher instance, we can fire off the logout event",
"// so any further processing can be done. This allows the developer to be",
"// listening fo... | Log the acct out of the application. | [
"Log",
"the",
"acct",
"out",
"of",
"the",
"application",
"."
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Account/Guards/SessionGuard.php#L521-L540 |
198,065 | PenoaksDev/Milky-Framework | src/Milky/Account/Guards/SessionGuard.php | SessionGuard.clearAcctDataFromStorage | protected function clearAcctDataFromStorage()
{
$this->session->remove( $this->getName() );
if ( !is_null( $this->getRecaller() ) )
{
$recaller = $this->getRecallerName();
$this->getCookieJar()->queue( $this->getCookieJar()->forget( $recaller ) );
}
} | php | protected function clearAcctDataFromStorage()
{
$this->session->remove( $this->getName() );
if ( !is_null( $this->getRecaller() ) )
{
$recaller = $this->getRecallerName();
$this->getCookieJar()->queue( $this->getCookieJar()->forget( $recaller ) );
}
} | [
"protected",
"function",
"clearAcctDataFromStorage",
"(",
")",
"{",
"$",
"this",
"->",
"session",
"->",
"remove",
"(",
"$",
"this",
"->",
"getName",
"(",
")",
")",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"this",
"->",
"getRecaller",
"(",
")",
")",
... | Remove the acct data from the session and cookies. | [
"Remove",
"the",
"acct",
"data",
"from",
"the",
"session",
"and",
"cookies",
"."
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Account/Guards/SessionGuard.php#L546-L555 |
198,066 | PenoaksDev/Milky-Framework | src/Milky/Account/Guards/SessionGuard.php | SessionGuard.refreshRememberToken | protected function refreshRememberToken( Account $acct )
{
$acct->setRememberToken( $token = Str::random( 60 ) );
$this->auth->updateRememberToken( $acct, $token );
} | php | protected function refreshRememberToken( Account $acct )
{
$acct->setRememberToken( $token = Str::random( 60 ) );
$this->auth->updateRememberToken( $acct, $token );
} | [
"protected",
"function",
"refreshRememberToken",
"(",
"Account",
"$",
"acct",
")",
"{",
"$",
"acct",
"->",
"setRememberToken",
"(",
"$",
"token",
"=",
"Str",
"::",
"random",
"(",
"60",
")",
")",
";",
"$",
"this",
"->",
"auth",
"->",
"updateRememberToken",
... | Refresh the "remember me" token for the acct.
@param Account $acct | [
"Refresh",
"the",
"remember",
"me",
"token",
"for",
"the",
"acct",
"."
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Account/Guards/SessionGuard.php#L562-L566 |
198,067 | PenoaksDev/Milky-Framework | src/Milky/Account/Guards/SessionGuard.php | SessionGuard.setAcct | public function setAcct( Account $acct )
{
$this->acct = $acct;
$this->loggedOut = false;
return $this;
} | php | public function setAcct( Account $acct )
{
$this->acct = $acct;
$this->loggedOut = false;
return $this;
} | [
"public",
"function",
"setAcct",
"(",
"Account",
"$",
"acct",
")",
"{",
"$",
"this",
"->",
"acct",
"=",
"$",
"acct",
";",
"$",
"this",
"->",
"loggedOut",
"=",
"false",
";",
"return",
"$",
"this",
";",
"}"
] | Set the current acct.
@param Account $acct
@return $this | [
"Set",
"the",
"current",
"acct",
"."
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Account/Guards/SessionGuard.php#L630-L636 |
198,068 | zapheus/zapheus | src/Http/Server/Dispatcher.php | Dispatcher.transform | protected function transform($middleware)
{
if (is_string($middleware))
{
return $this->container->get($middleware);
}
if (is_callable($middleware))
{
return new ClosureMiddleware($middleware);
}
return $middleware;
} | php | protected function transform($middleware)
{
if (is_string($middleware))
{
return $this->container->get($middleware);
}
if (is_callable($middleware))
{
return new ClosureMiddleware($middleware);
}
return $middleware;
} | [
"protected",
"function",
"transform",
"(",
"$",
"middleware",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"middleware",
")",
")",
"{",
"return",
"$",
"this",
"->",
"container",
"->",
"get",
"(",
"$",
"middleware",
")",
";",
"}",
"if",
"(",
"is_callable... | Transforms the specified input into a middleware.
@param mixed $middleware
@return \Zapheus\Http\Server\MiddlewareInterface | [
"Transforms",
"the",
"specified",
"input",
"into",
"a",
"middleware",
"."
] | 96618b5cee7d20b6700d0475e4334ae4b5163a6b | https://github.com/zapheus/zapheus/blob/96618b5cee7d20b6700d0475e4334ae4b5163a6b/src/Http/Server/Dispatcher.php#L108-L121 |
198,069 | zapheus/zapheus | src/Http/Server/Dispatcher.php | Dispatcher.resolve | protected function resolve($index)
{
if (! isset($this->stack[$index]))
{
return new ErrorHandler;
}
$next = $this->resolve($index + 1);
$item = $this->stack[(integer) $index];
return new NextHandler($item, $next);
} | php | protected function resolve($index)
{
if (! isset($this->stack[$index]))
{
return new ErrorHandler;
}
$next = $this->resolve($index + 1);
$item = $this->stack[(integer) $index];
return new NextHandler($item, $next);
} | [
"protected",
"function",
"resolve",
"(",
"$",
"index",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"stack",
"[",
"$",
"index",
"]",
")",
")",
"{",
"return",
"new",
"ErrorHandler",
";",
"}",
"$",
"next",
"=",
"$",
"this",
"->",
"res... | Resolves the whole stack through its index.
@param integer $index
@return \Zapheus\Http\Server\HandlerInterface | [
"Resolves",
"the",
"whole",
"stack",
"through",
"its",
"index",
"."
] | 96618b5cee7d20b6700d0475e4334ae4b5163a6b | https://github.com/zapheus/zapheus/blob/96618b5cee7d20b6700d0475e4334ae4b5163a6b/src/Http/Server/Dispatcher.php#L129-L141 |
198,070 | freialib/hlin.tools | src/Text.php | Text.reindent | static function reindent($source, $indent = '', $tabs_to_spaces = 4, $ignore_zero_indent = true) {
// unify tabs
if ($tabs_to_spaces !== null) {
$source = str_replace("\t", str_repeat(' ', $tabs_to_spaces), $source);
}
// split into lines
$lines = explode("\n", $source);
// detect indent level
$min_l... | php | static function reindent($source, $indent = '', $tabs_to_spaces = 4, $ignore_zero_indent = true) {
// unify tabs
if ($tabs_to_spaces !== null) {
$source = str_replace("\t", str_repeat(' ', $tabs_to_spaces), $source);
}
// split into lines
$lines = explode("\n", $source);
// detect indent level
$min_l... | [
"static",
"function",
"reindent",
"(",
"$",
"source",
",",
"$",
"indent",
"=",
"''",
",",
"$",
"tabs_to_spaces",
"=",
"4",
",",
"$",
"ignore_zero_indent",
"=",
"true",
")",
"{",
"// unify tabs",
"if",
"(",
"$",
"tabs_to_spaces",
"!==",
"null",
")",
"{",
... | Uniforms indentation. Useful when printing.
If you do not wish tabs to be converted to spaces set the value of
$tabs_to_spaces to null.
@return string | [
"Uniforms",
"indentation",
".",
"Useful",
"when",
"printing",
"."
] | 42ad9e9fe081918d2ee5d52b72d174ccdcf7cbe7 | https://github.com/freialib/hlin.tools/blob/42ad9e9fe081918d2ee5d52b72d174ccdcf7cbe7/src/Text.php#L18-L55 |
198,071 | AlexyaFramework/FileSystem | Alexya/FileSystem/Directory.php | Directory.make | public static function make(string $path, int $ifExists = Directory::MAKE_DIRECTORY_EXISTS_THROW_EXCEPTION) : Directory
{
$exists = Directory::exists($path);
if($exists) {
if($ifExists === Directory::MAKE_DIRECTORY_EXISTS_OVERWRITE) {
unlink($path);
} else if... | php | public static function make(string $path, int $ifExists = Directory::MAKE_DIRECTORY_EXISTS_THROW_EXCEPTION) : Directory
{
$exists = Directory::exists($path);
if($exists) {
if($ifExists === Directory::MAKE_DIRECTORY_EXISTS_OVERWRITE) {
unlink($path);
} else if... | [
"public",
"static",
"function",
"make",
"(",
"string",
"$",
"path",
",",
"int",
"$",
"ifExists",
"=",
"Directory",
"::",
"MAKE_DIRECTORY_EXISTS_THROW_EXCEPTION",
")",
":",
"Directory",
"{",
"$",
"exists",
"=",
"Directory",
"::",
"exists",
"(",
"$",
"path",
"... | Makes a directory.
The second parameter specifies what to do in case directory already exists:
* `\Alexya\FileSystem\Directory::MAKE_DIRECTORY_EXISTS_THROW_EXCEPTION`, throws an exception (default).
* `\Alexya\FileSystem\Directory::MAKE_DIRECTORY_EXISTS_OVERWRITE`, deletes the directory and recreates it.
* `\Alexya\F... | [
"Makes",
"a",
"directory",
"."
] | 1f2a848c4bd508c0ce0e14f49e231522cc059424 | https://github.com/AlexyaFramework/FileSystem/blob/1f2a848c4bd508c0ce0e14f49e231522cc059424/Alexya/FileSystem/Directory.php#L96-L115 |
198,072 | AlexyaFramework/FileSystem | Alexya/FileSystem/Directory.php | Directory.fileExists | public function fileExists(string $name)
{
if(!$this->_isLoaded) {
$this->load();
}
return in_array($name, $this->_files);
} | php | public function fileExists(string $name)
{
if(!$this->_isLoaded) {
$this->load();
}
return in_array($name, $this->_files);
} | [
"public",
"function",
"fileExists",
"(",
"string",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_isLoaded",
")",
"{",
"$",
"this",
"->",
"load",
"(",
")",
";",
"}",
"return",
"in_array",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"_f... | Checks if a file exists in this directory.
@param string $name File name.
@return bool `true` if `$name` exists as a file in this directory, `false` if not. | [
"Checks",
"if",
"a",
"file",
"exists",
"in",
"this",
"directory",
"."
] | 1f2a848c4bd508c0ce0e14f49e231522cc059424 | https://github.com/AlexyaFramework/FileSystem/blob/1f2a848c4bd508c0ce0e14f49e231522cc059424/Alexya/FileSystem/Directory.php#L211-L218 |
198,073 | AlexyaFramework/FileSystem | Alexya/FileSystem/Directory.php | Directory.getFile | public function getFile(string $name, int $ifNotExists = Directory::GET_FILE_NOT_EXISTS_THROW_EXCEPTION) : File
{
$path = $this->getPath(). DIRECTORY_SEPARATOR .$name;
if($this->fileExists($name)) {
return new File($path);
}
if($ifNotExists === Directory::GET_FILE_NOT_E... | php | public function getFile(string $name, int $ifNotExists = Directory::GET_FILE_NOT_EXISTS_THROW_EXCEPTION) : File
{
$path = $this->getPath(). DIRECTORY_SEPARATOR .$name;
if($this->fileExists($name)) {
return new File($path);
}
if($ifNotExists === Directory::GET_FILE_NOT_E... | [
"public",
"function",
"getFile",
"(",
"string",
"$",
"name",
",",
"int",
"$",
"ifNotExists",
"=",
"Directory",
"::",
"GET_FILE_NOT_EXISTS_THROW_EXCEPTION",
")",
":",
"File",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"getPath",
"(",
")",
".",
"DIRECTORY_SEPAR... | Returns a file from the directory.
The second parameter specifies what to do in case file doesn't exist:
* `\Alexya\FileSystem\Directory::GET_FILE_NOT_EXISTS_THROW_EXCEPTION`, throws an exception (default).
* `\Alexya\FileSystem\Directory::GET_FILE_NOT_EXISTS_CREATE`, creates the file.
@param string $name Fi... | [
"Returns",
"a",
"file",
"from",
"the",
"directory",
"."
] | 1f2a848c4bd508c0ce0e14f49e231522cc059424 | https://github.com/AlexyaFramework/FileSystem/blob/1f2a848c4bd508c0ce0e14f49e231522cc059424/Alexya/FileSystem/Directory.php#L236-L251 |
198,074 | AlexyaFramework/FileSystem | Alexya/FileSystem/Directory.php | Directory.getFiles | public function getFiles() : array
{
if(!$this->_isLoaded) {
$this->load();
}
return array_map(function($file) {
return new File($this->getPath(). DIRECTORY_SEPARATOR .$file);
}, $this->_files);
} | php | public function getFiles() : array
{
if(!$this->_isLoaded) {
$this->load();
}
return array_map(function($file) {
return new File($this->getPath(). DIRECTORY_SEPARATOR .$file);
}, $this->_files);
} | [
"public",
"function",
"getFiles",
"(",
")",
":",
"array",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_isLoaded",
")",
"{",
"$",
"this",
"->",
"load",
"(",
")",
";",
"}",
"return",
"array_map",
"(",
"function",
"(",
"$",
"file",
")",
"{",
"return",
... | Returns an array with all files of the directory.
@return File[] Array with `\Alexya\FileSystem\File` objects for each file on the directory. | [
"Returns",
"an",
"array",
"with",
"all",
"files",
"of",
"the",
"directory",
"."
] | 1f2a848c4bd508c0ce0e14f49e231522cc059424 | https://github.com/AlexyaFramework/FileSystem/blob/1f2a848c4bd508c0ce0e14f49e231522cc059424/Alexya/FileSystem/Directory.php#L258-L267 |
198,075 | AlexyaFramework/FileSystem | Alexya/FileSystem/Directory.php | Directory.directoryExists | public function directoryExists(string $name)
{
if(!$this->_isLoaded) {
$this->load();
}
return in_array($name, $this->_directories);
} | php | public function directoryExists(string $name)
{
if(!$this->_isLoaded) {
$this->load();
}
return in_array($name, $this->_directories);
} | [
"public",
"function",
"directoryExists",
"(",
"string",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_isLoaded",
")",
"{",
"$",
"this",
"->",
"load",
"(",
")",
";",
"}",
"return",
"in_array",
"(",
"$",
"name",
",",
"$",
"this",
"->",
... | Checks if a directory exists in this directory.
@param string $name Directory name.
@return bool `true` if `$name` exists as a directory in this directory, `false` if not. | [
"Checks",
"if",
"a",
"directory",
"exists",
"in",
"this",
"directory",
"."
] | 1f2a848c4bd508c0ce0e14f49e231522cc059424 | https://github.com/AlexyaFramework/FileSystem/blob/1f2a848c4bd508c0ce0e14f49e231522cc059424/Alexya/FileSystem/Directory.php#L276-L283 |
198,076 | AlexyaFramework/FileSystem | Alexya/FileSystem/Directory.php | Directory.getDirectory | public function getDirectory(string $name, int $ifNotExists = Directory::GET_DIRECTORY_NOT_EXISTS_THROW_EXCEPTION) : Directory
{
$path = $this->getPath(). DIRECTORY_SEPARATOR .$name;
if($this->directoryExists($name)) {
return new Directory($path);
}
if($ifNotExists === ... | php | public function getDirectory(string $name, int $ifNotExists = Directory::GET_DIRECTORY_NOT_EXISTS_THROW_EXCEPTION) : Directory
{
$path = $this->getPath(). DIRECTORY_SEPARATOR .$name;
if($this->directoryExists($name)) {
return new Directory($path);
}
if($ifNotExists === ... | [
"public",
"function",
"getDirectory",
"(",
"string",
"$",
"name",
",",
"int",
"$",
"ifNotExists",
"=",
"Directory",
"::",
"GET_DIRECTORY_NOT_EXISTS_THROW_EXCEPTION",
")",
":",
"Directory",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"getPath",
"(",
")",
".",
"... | Returns a directory from the directory.
The second parameter specifies what to do in case directory doesn't exist:
* `\Alexya\FileSystem\Directory::GET_DIRECTORY_NOT_EXISTS_THROW_EXCEPTION`, throws an exception (default).
* `\Alexya\FileSystem\Directory::GET_DIRECTORY_NOT_EXISTS_CREATE`, creates the directory.
@para... | [
"Returns",
"a",
"directory",
"from",
"the",
"directory",
"."
] | 1f2a848c4bd508c0ce0e14f49e231522cc059424 | https://github.com/AlexyaFramework/FileSystem/blob/1f2a848c4bd508c0ce0e14f49e231522cc059424/Alexya/FileSystem/Directory.php#L301-L314 |
198,077 | AlexyaFramework/FileSystem | Alexya/FileSystem/Directory.php | Directory.getDirectories | public function getDirectories() : array
{
if(!$this->_isLoaded) {
$this->load();
}
return array_map(function($directory) {
return new Directory($this->getPath(). DIRECTORY_SEPARATOR .$directory);
}, $this->_directories);
} | php | public function getDirectories() : array
{
if(!$this->_isLoaded) {
$this->load();
}
return array_map(function($directory) {
return new Directory($this->getPath(). DIRECTORY_SEPARATOR .$directory);
}, $this->_directories);
} | [
"public",
"function",
"getDirectories",
"(",
")",
":",
"array",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_isLoaded",
")",
"{",
"$",
"this",
"->",
"load",
"(",
")",
";",
"}",
"return",
"array_map",
"(",
"function",
"(",
"$",
"directory",
")",
"{",
"... | Returns an array with all directories of the directory.
@return Directory[] Array with `\Alexya\FileSystem\Directory` objects for each directory on the directory. | [
"Returns",
"an",
"array",
"with",
"all",
"directories",
"of",
"the",
"directory",
"."
] | 1f2a848c4bd508c0ce0e14f49e231522cc059424 | https://github.com/AlexyaFramework/FileSystem/blob/1f2a848c4bd508c0ce0e14f49e231522cc059424/Alexya/FileSystem/Directory.php#L321-L330 |
198,078 | AlexyaFramework/FileSystem | Alexya/FileSystem/Directory.php | Directory.load | public function load()
{
$files = scandir($this->getPath());
foreach($files as $file) {
if(
$file === "." ||
$file === ".."
) {
continue;
}
if(is_file($this->getPath().$file)) {
$this->_... | php | public function load()
{
$files = scandir($this->getPath());
foreach($files as $file) {
if(
$file === "." ||
$file === ".."
) {
continue;
}
if(is_file($this->getPath().$file)) {
$this->_... | [
"public",
"function",
"load",
"(",
")",
"{",
"$",
"files",
"=",
"scandir",
"(",
"$",
"this",
"->",
"getPath",
"(",
")",
")",
";",
"foreach",
"(",
"$",
"files",
"as",
"$",
"file",
")",
"{",
"if",
"(",
"$",
"file",
"===",
"\".\"",
"||",
"$",
"fil... | Loads directories and files. | [
"Loads",
"directories",
"and",
"files",
"."
] | 1f2a848c4bd508c0ce0e14f49e231522cc059424 | https://github.com/AlexyaFramework/FileSystem/blob/1f2a848c4bd508c0ce0e14f49e231522cc059424/Alexya/FileSystem/Directory.php#L335-L353 |
198,079 | AlexyaFramework/FileSystem | Alexya/FileSystem/Directory.php | Directory.setLocation | public function setLocation(string $location)
{
$dir = Directory::make($location, Directory::MAKE_DIRECTORY_EXISTS_OPEN);
$old = $this->getPath();
$new = $dir->getPath();
if(rename($old, $new)) {
$this->_location = $dir->getPath();
}
} | php | public function setLocation(string $location)
{
$dir = Directory::make($location, Directory::MAKE_DIRECTORY_EXISTS_OPEN);
$old = $this->getPath();
$new = $dir->getPath();
if(rename($old, $new)) {
$this->_location = $dir->getPath();
}
} | [
"public",
"function",
"setLocation",
"(",
"string",
"$",
"location",
")",
"{",
"$",
"dir",
"=",
"Directory",
"::",
"make",
"(",
"$",
"location",
",",
"Directory",
"::",
"MAKE_DIRECTORY_EXISTS_OPEN",
")",
";",
"$",
"old",
"=",
"$",
"this",
"->",
"getPath",
... | Moves the file to the specified location.
@param string $location New file location. | [
"Moves",
"the",
"file",
"to",
"the",
"specified",
"location",
"."
] | 1f2a848c4bd508c0ce0e14f49e231522cc059424 | https://github.com/AlexyaFramework/FileSystem/blob/1f2a848c4bd508c0ce0e14f49e231522cc059424/Alexya/FileSystem/Directory.php#L363-L373 |
198,080 | AlexyaFramework/FileSystem | Alexya/FileSystem/Directory.php | Directory.setPath | public function setPath(string $path)
{
$info = pathinfo($path);
$this->setLocation($info["dirname"] ?? "");
$this->setName($info["filename"] ?? "");
} | php | public function setPath(string $path)
{
$info = pathinfo($path);
$this->setLocation($info["dirname"] ?? "");
$this->setName($info["filename"] ?? "");
} | [
"public",
"function",
"setPath",
"(",
"string",
"$",
"path",
")",
"{",
"$",
"info",
"=",
"pathinfo",
"(",
"$",
"path",
")",
";",
"$",
"this",
"->",
"setLocation",
"(",
"$",
"info",
"[",
"\"dirname\"",
"]",
"??",
"\"\"",
")",
";",
"$",
"this",
"->",... | Sets new file location, name and extension.
@param string $path New path to file (location + name + extension). | [
"Sets",
"new",
"file",
"location",
"name",
"and",
"extension",
"."
] | 1f2a848c4bd508c0ce0e14f49e231522cc059424 | https://github.com/AlexyaFramework/FileSystem/blob/1f2a848c4bd508c0ce0e14f49e231522cc059424/Alexya/FileSystem/Directory.php#L395-L401 |
198,081 | linpax/microphp-framework | src/cli/Threads.php | Threads.createIPCSegment | protected function createIPCSegment()
{
$this->fileIPC1 = '/tmp/'.mt_rand().md5($this->getName()).'.shm';
touch($this->fileIPC1);
$shm_key = ftok($this->fileIPC1, 't');
if ($shm_key === -1) {
throw new Exception('Fatal exception creating SHM segment (ftok)');
}
... | php | protected function createIPCSegment()
{
$this->fileIPC1 = '/tmp/'.mt_rand().md5($this->getName()).'.shm';
touch($this->fileIPC1);
$shm_key = ftok($this->fileIPC1, 't');
if ($shm_key === -1) {
throw new Exception('Fatal exception creating SHM segment (ftok)');
}
... | [
"protected",
"function",
"createIPCSegment",
"(",
")",
"{",
"$",
"this",
"->",
"fileIPC1",
"=",
"'/tmp/'",
".",
"mt_rand",
"(",
")",
".",
"md5",
"(",
"$",
"this",
"->",
"getName",
"(",
")",
")",
".",
"'.shm'",
";",
"touch",
"(",
"$",
"this",
"->",
... | Create IPC segment
@access protected
@return bool
@throws Exception | [
"Create",
"IPC",
"segment"
] | 11f3370f3f64c516cce9b84ecd8276c6e9ae8df9 | https://github.com/linpax/microphp-framework/blob/11f3370f3f64c516cce9b84ecd8276c6e9ae8df9/src/cli/Threads.php#L91-L108 |
198,082 | linpax/microphp-framework | src/cli/Threads.php | Threads.createIPCSemaphore | protected function createIPCSemaphore()
{
$this->fileIPC2 = '/tmp/'.mt_rand().md5($this->getName()).'.sem';
touch($this->fileIPC2);
$sem_key = ftok($this->fileIPC2, 't');
if ($sem_key === -1) {
throw new Exception('Fatal exception creating semaphore (ftok)');
}
... | php | protected function createIPCSemaphore()
{
$this->fileIPC2 = '/tmp/'.mt_rand().md5($this->getName()).'.sem';
touch($this->fileIPC2);
$sem_key = ftok($this->fileIPC2, 't');
if ($sem_key === -1) {
throw new Exception('Fatal exception creating semaphore (ftok)');
}
... | [
"protected",
"function",
"createIPCSemaphore",
"(",
")",
"{",
"$",
"this",
"->",
"fileIPC2",
"=",
"'/tmp/'",
".",
"mt_rand",
"(",
")",
".",
"md5",
"(",
"$",
"this",
"->",
"getName",
"(",
")",
")",
".",
"'.sem'",
";",
"touch",
"(",
"$",
"this",
"->",
... | Create IPC semaphore
@access protected
@return bool
@throws Exception | [
"Create",
"IPC",
"semaphore"
] | 11f3370f3f64c516cce9b84ecd8276c6e9ae8df9 | https://github.com/linpax/microphp-framework/blob/11f3370f3f64c516cce9b84ecd8276c6e9ae8df9/src/cli/Threads.php#L143-L160 |
198,083 | linpax/microphp-framework | src/cli/Threads.php | Threads.writeToIPCSegment | protected function writeToIPCSegment()
{
if (shmop_read($this->internalSemaphoreKey, 1, 1) === 1) {
return;
}
$serialized_IPC_array = serialize($this->internalIPCArray);
$shm_bytes_written = shmop_write($this->internalIPCKey, $serialized_IPC_array, 0);
if ($shm_... | php | protected function writeToIPCSegment()
{
if (shmop_read($this->internalSemaphoreKey, 1, 1) === 1) {
return;
}
$serialized_IPC_array = serialize($this->internalIPCArray);
$shm_bytes_written = shmop_write($this->internalIPCKey, $serialized_IPC_array, 0);
if ($shm_... | [
"protected",
"function",
"writeToIPCSegment",
"(",
")",
"{",
"if",
"(",
"shmop_read",
"(",
"$",
"this",
"->",
"internalSemaphoreKey",
",",
"1",
",",
"1",
")",
"===",
"1",
")",
"{",
"return",
";",
"}",
"$",
"serialized_IPC_array",
"=",
"serialize",
"(",
"... | Write to IPC segment
@access protected
@return void
@throws Exception | [
"Write",
"to",
"IPC",
"segment"
] | 11f3370f3f64c516cce9b84ecd8276c6e9ae8df9 | https://github.com/linpax/microphp-framework/blob/11f3370f3f64c516cce9b84ecd8276c6e9ae8df9/src/cli/Threads.php#L210-L225 |
198,084 | linpax/microphp-framework | src/cli/Threads.php | Threads.readFromIPCSegment | protected function readFromIPCSegment()
{
$serialized_IPC_array = shmop_read($this->internalIPCKey, 0, shmop_size($this->internalIPCKey));
if (!$serialized_IPC_array) {
throw new Exception('Fatal exception reading SHM segment (shmop_read)'."\n");
}
unset($this->internal... | php | protected function readFromIPCSegment()
{
$serialized_IPC_array = shmop_read($this->internalIPCKey, 0, shmop_size($this->internalIPCKey));
if (!$serialized_IPC_array) {
throw new Exception('Fatal exception reading SHM segment (shmop_read)'."\n");
}
unset($this->internal... | [
"protected",
"function",
"readFromIPCSegment",
"(",
")",
"{",
"$",
"serialized_IPC_array",
"=",
"shmop_read",
"(",
"$",
"this",
"->",
"internalIPCKey",
",",
"0",
",",
"shmop_size",
"(",
"$",
"this",
"->",
"internalIPCKey",
")",
")",
";",
"if",
"(",
"!",
"$... | Read from IPC segment
@access public
@return void
@throws Exception | [
"Read",
"from",
"IPC",
"segment"
] | 11f3370f3f64c516cce9b84ecd8276c6e9ae8df9 | https://github.com/linpax/microphp-framework/blob/11f3370f3f64c516cce9b84ecd8276c6e9ae8df9/src/cli/Threads.php#L268-L279 |
198,085 | linpax/microphp-framework | src/cli/Threads.php | Threads.register_callback_func | public function register_callback_func($argList, $methodName)
{
if (is_array($argList) && count($argList) > 1) {
if ($argList[1] === -2) {
$this->internalIPCArray['_call_type'] = -2;
} else {
$this->internalIPCArray['_call_type'] = -1;
}
... | php | public function register_callback_func($argList, $methodName)
{
if (is_array($argList) && count($argList) > 1) {
if ($argList[1] === -2) {
$this->internalIPCArray['_call_type'] = -2;
} else {
$this->internalIPCArray['_call_type'] = -1;
}
... | [
"public",
"function",
"register_callback_func",
"(",
"$",
"argList",
",",
"$",
"methodName",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"argList",
")",
"&&",
"count",
"(",
"$",
"argList",
")",
">",
"1",
")",
"{",
"if",
"(",
"$",
"argList",
"[",
"1",
... | Register callback func into shared memory
@access public
@param mixed $argList
@param string $methodName
@return mixed|void
@throws \Micro\Base\Exception | [
"Register",
"callback",
"func",
"into",
"shared",
"memory"
] | 11f3370f3f64c516cce9b84ecd8276c6e9ae8df9 | https://github.com/linpax/microphp-framework/blob/11f3370f3f64c516cce9b84ecd8276c6e9ae8df9/src/cli/Threads.php#L303-L338 |
198,086 | linpax/microphp-framework | src/cli/Threads.php | Threads.cleanThreadContext | protected function cleanThreadContext()
{
shmop_delete($this->internalIPCKey);
shmop_delete($this->internalSemaphoreKey);
shmop_close($this->internalIPCKey);
shmop_close($this->internalSemaphoreKey);
unlink($this->fileIPC1);
unlink($this->fileIPC2);
$this->... | php | protected function cleanThreadContext()
{
shmop_delete($this->internalIPCKey);
shmop_delete($this->internalSemaphoreKey);
shmop_close($this->internalIPCKey);
shmop_close($this->internalSemaphoreKey);
unlink($this->fileIPC1);
unlink($this->fileIPC2);
$this->... | [
"protected",
"function",
"cleanThreadContext",
"(",
")",
"{",
"shmop_delete",
"(",
"$",
"this",
"->",
"internalIPCKey",
")",
";",
"shmop_delete",
"(",
"$",
"this",
"->",
"internalSemaphoreKey",
")",
";",
"shmop_close",
"(",
"$",
"this",
"->",
"internalIPCKey",
... | Clean thread context
@access protected
@return void | [
"Clean",
"thread",
"context"
] | 11f3370f3f64c516cce9b84ecd8276c6e9ae8df9 | https://github.com/linpax/microphp-framework/blob/11f3370f3f64c516cce9b84ecd8276c6e9ae8df9/src/cli/Threads.php#L447-L460 |
198,087 | joomla-x/orm-joomla3 | src/ORM.php | ORM.createContainer | protected static function createContainer()
{
$app = JFactory::getApplication();
if (is_null($app->get('container', null))) {
$app->set('container', new Container());
}
$container = $app->get('container');
if (!method_exists($container, 'set')) {
$c... | php | protected static function createContainer()
{
$app = JFactory::getApplication();
if (is_null($app->get('container', null))) {
$app->set('container', new Container());
}
$container = $app->get('container');
if (!method_exists($container, 'set')) {
$c... | [
"protected",
"static",
"function",
"createContainer",
"(",
")",
"{",
"$",
"app",
"=",
"JFactory",
"::",
"getApplication",
"(",
")",
";",
"if",
"(",
"is_null",
"(",
"$",
"app",
"->",
"get",
"(",
"'container'",
",",
"null",
")",
")",
")",
"{",
"$",
"ap... | Ensure container exists
@return Container | [
"Ensure",
"container",
"exists"
] | 560c4a1ea9f00760d7c05f36147e7e33fdf7e234 | https://github.com/joomla-x/orm-joomla3/blob/560c4a1ea9f00760d7c05f36147e7e33fdf7e234/src/ORM.php#L47-L62 |
198,088 | joomla-x/orm-joomla3 | src/ORM.php | ORM.createDatabaseConfiguration | protected static function createDatabaseConfiguration()
{
$config = new JConfig();
$dsn = $config->dbtype . '://' . $config->user . ':' . $config->password . '@' . $config->host . '/' . $config->db;
$dataMapperClass = PrefixedDoctrineDataMapper::class;
$ini = <<... | php | protected static function createDatabaseConfiguration()
{
$config = new JConfig();
$dsn = $config->dbtype . '://' . $config->user . ':' . $config->password . '@' . $config->host . '/' . $config->db;
$dataMapperClass = PrefixedDoctrineDataMapper::class;
$ini = <<... | [
"protected",
"static",
"function",
"createDatabaseConfiguration",
"(",
")",
"{",
"$",
"config",
"=",
"new",
"JConfig",
"(",
")",
";",
"$",
"dsn",
"=",
"$",
"config",
"->",
"dbtype",
".",
"'://'",
".",
"$",
"config",
"->",
"user",
".",
"':'",
".",
"$",
... | Create DB configuration | [
"Create",
"DB",
"configuration"
] | 560c4a1ea9f00760d7c05f36147e7e33fdf7e234 | https://github.com/joomla-x/orm-joomla3/blob/560c4a1ea9f00760d7c05f36147e7e33fdf7e234/src/ORM.php#L67-L79 |
198,089 | mtils/cmsable | src/Cmsable/Routing/TreeScope/RootNodeRepository.php | RootNodeRepository.getByModelRootId | public function getByModelRootId($rootId){
$this->fillScopes();
if(!isset($this->scopeByModelRootId[$rootId])){
throw new OutOfBoundsException("No scope with modelRootId '$rootId' found");
}
return $this->scopeByModelRootId[$rootId];
} | php | public function getByModelRootId($rootId){
$this->fillScopes();
if(!isset($this->scopeByModelRootId[$rootId])){
throw new OutOfBoundsException("No scope with modelRootId '$rootId' found");
}
return $this->scopeByModelRootId[$rootId];
} | [
"public",
"function",
"getByModelRootId",
"(",
"$",
"rootId",
")",
"{",
"$",
"this",
"->",
"fillScopes",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"scopeByModelRootId",
"[",
"$",
"rootId",
"]",
")",
")",
"{",
"throw",
"new",
"Ou... | Returns the scope by modelRootId
@throws OutOfBoundsException If no scope with root-id $rootId was found
@return \Cmsable\Routing\TreeScope\TreeScope | [
"Returns",
"the",
"scope",
"by",
"modelRootId"
] | 03ae84ee3c7d46146f2a1cf687e5c29d6de4286d | https://github.com/mtils/cmsable/blob/03ae84ee3c7d46146f2a1cf687e5c29d6de4286d/src/Cmsable/Routing/TreeScope/RootNodeRepository.php#L113-L123 |
198,090 | mtils/cmsable | src/Cmsable/Routing/TreeScope/RootNodeRepository.php | RootNodeRepository.fillScopes | protected function fillScopes(){
if($this->scopes !== null){
return;
}
$this->scopes = [];
foreach($this->treeModel->rootNodes() as $rootNode){
$this->addToScopes($this->node2Scope($rootNode));
}
foreach ($this->manualScopes as $scope) {
... | php | protected function fillScopes(){
if($this->scopes !== null){
return;
}
$this->scopes = [];
foreach($this->treeModel->rootNodes() as $rootNode){
$this->addToScopes($this->node2Scope($rootNode));
}
foreach ($this->manualScopes as $scope) {
... | [
"protected",
"function",
"fillScopes",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"scopes",
"!==",
"null",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"scopes",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"treeModel",
"->",
"rootN... | Fills the scope array for fast lookups
@return void | [
"Fills",
"the",
"scope",
"array",
"for",
"fast",
"lookups"
] | 03ae84ee3c7d46146f2a1cf687e5c29d6de4286d | https://github.com/mtils/cmsable/blob/03ae84ee3c7d46146f2a1cf687e5c29d6de4286d/src/Cmsable/Routing/TreeScope/RootNodeRepository.php#L140-L159 |
198,091 | mtils/cmsable | src/Cmsable/Routing/TreeScope/RootNodeRepository.php | RootNodeRepository.addToScopes | protected function addToScopes(TreeScope $scope)
{
$this->scopes[] = $scope;
$this->scopeByName[$scope->getName()] = $scope;
$this->scopeByModelRootId[$scope->getModelRootId()] = $scope;
$this->scopeByPathPrefix[$scope->getPathPrefix()] = $scope;
} | php | protected function addToScopes(TreeScope $scope)
{
$this->scopes[] = $scope;
$this->scopeByName[$scope->getName()] = $scope;
$this->scopeByModelRootId[$scope->getModelRootId()] = $scope;
$this->scopeByPathPrefix[$scope->getPathPrefix()] = $scope;
} | [
"protected",
"function",
"addToScopes",
"(",
"TreeScope",
"$",
"scope",
")",
"{",
"$",
"this",
"->",
"scopes",
"[",
"]",
"=",
"$",
"scope",
";",
"$",
"this",
"->",
"scopeByName",
"[",
"$",
"scope",
"->",
"getName",
"(",
")",
"]",
"=",
"$",
"scope",
... | Adds the passed scope to the scope array
@param \Cmsable\Routing\TreeScope\TreeScope $treeScope
@return void | [
"Adds",
"the",
"passed",
"scope",
"to",
"the",
"scope",
"array"
] | 03ae84ee3c7d46146f2a1cf687e5c29d6de4286d | https://github.com/mtils/cmsable/blob/03ae84ee3c7d46146f2a1cf687e5c29d6de4286d/src/Cmsable/Routing/TreeScope/RootNodeRepository.php#L167-L173 |
198,092 | mtils/cmsable | src/Cmsable/Routing/TreeScope/RootNodeRepository.php | RootNodeRepository.node2Scope | public function node2Scope(SiteTreeNodeInterface $node){
$scope = new TreeScope();
$urlSegment = trim($node->getUrlSegment(),'/');
$name = $urlSegment ? $urlSegment : TreeScope::DEFAULT_NAME;
$scope->setPathPrefix($node->getUrlSegment());
$scope->setName($name);
$scope... | php | public function node2Scope(SiteTreeNodeInterface $node){
$scope = new TreeScope();
$urlSegment = trim($node->getUrlSegment(),'/');
$name = $urlSegment ? $urlSegment : TreeScope::DEFAULT_NAME;
$scope->setPathPrefix($node->getUrlSegment());
$scope->setName($name);
$scope... | [
"public",
"function",
"node2Scope",
"(",
"SiteTreeNodeInterface",
"$",
"node",
")",
"{",
"$",
"scope",
"=",
"new",
"TreeScope",
"(",
")",
";",
"$",
"urlSegment",
"=",
"trim",
"(",
"$",
"node",
"->",
"getUrlSegment",
"(",
")",
",",
"'/'",
")",
";",
"$",... | Convert a root node to a scope
@param \Cmsable\Model\SiteTreeNodeInterface $node
@return \Cmsable\Routing\TreeScope\TreeScope | [
"Convert",
"a",
"root",
"node",
"to",
"a",
"scope"
] | 03ae84ee3c7d46146f2a1cf687e5c29d6de4286d | https://github.com/mtils/cmsable/blob/03ae84ee3c7d46146f2a1cf687e5c29d6de4286d/src/Cmsable/Routing/TreeScope/RootNodeRepository.php#L181-L195 |
198,093 | brunschgi/TerrificComposerBundle | Service/PageManager.php | PageManager.getPages | public function getPages()
{
$pages = array();
foreach ($this->router->getRouteCollection()->all() as $route) {
if ($method = $this->getReflectionMethod($route->getDefault('_controller'))) {
if ($composerAnnotation = $this->reader->getMethodAnnotation($method, self::COMP... | php | public function getPages()
{
$pages = array();
foreach ($this->router->getRouteCollection()->all() as $route) {
if ($method = $this->getReflectionMethod($route->getDefault('_controller'))) {
if ($composerAnnotation = $this->reader->getMethodAnnotation($method, self::COMP... | [
"public",
"function",
"getPages",
"(",
")",
"{",
"$",
"pages",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"router",
"->",
"getRouteCollection",
"(",
")",
"->",
"all",
"(",
")",
"as",
"$",
"route",
")",
"{",
"if",
"(",
"$",
"m... | Gets all existing Pages
@return array All existing Page instances | [
"Gets",
"all",
"existing",
"Pages"
] | 6eef4ace887c19ef166ab6654de385bc1ffbf5f1 | https://github.com/brunschgi/TerrificComposerBundle/blob/6eef4ace887c19ef166ab6654de385bc1ffbf5f1/Service/PageManager.php#L62-L93 |
198,094 | brunschgi/TerrificComposerBundle | Service/PageManager.php | PageManager.getReflectionMethod | private function getReflectionMethod($controller)
{
if (preg_match('#(.+)::([\w]+)#', $controller, $matches)) {
$class = $matches[1];
$method = $matches[2];
} elseif (preg_match('#(.+):([\w]+)#', $controller, $matches)) {
$controller = $matches[1];
$me... | php | private function getReflectionMethod($controller)
{
if (preg_match('#(.+)::([\w]+)#', $controller, $matches)) {
$class = $matches[1];
$method = $matches[2];
} elseif (preg_match('#(.+):([\w]+)#', $controller, $matches)) {
$controller = $matches[1];
$me... | [
"private",
"function",
"getReflectionMethod",
"(",
"$",
"controller",
")",
"{",
"if",
"(",
"preg_match",
"(",
"'#(.+)::([\\w]+)#'",
",",
"$",
"controller",
",",
"$",
"matches",
")",
")",
"{",
"$",
"class",
"=",
"$",
"matches",
"[",
"1",
"]",
";",
"$",
... | Returns the ReflectionMethod for the given controller string
@param string $controller
@return ReflectionMethod|null | [
"Returns",
"the",
"ReflectionMethod",
"for",
"the",
"given",
"controller",
"string"
] | 6eef4ace887c19ef166ab6654de385bc1ffbf5f1 | https://github.com/brunschgi/TerrificComposerBundle/blob/6eef4ace887c19ef166ab6654de385bc1ffbf5f1/Service/PageManager.php#L101-L125 |
198,095 | fulgurio/LightCMSBundle | Repository/PageRepository.php | PageRepository.upPagesPosition | public function upPagesPosition($parentId, $position, $positionLimit = NULL)
{
if (is_null($positionLimit))
{
$query = $this->getEntityManager()->createQuery('UPDATE FulgurioLightCMSBundle:Page p SET p.position=p.position-1 WHERE p.position>=:position AND p.parent=:parentId AND p.page_ty... | php | public function upPagesPosition($parentId, $position, $positionLimit = NULL)
{
if (is_null($positionLimit))
{
$query = $this->getEntityManager()->createQuery('UPDATE FulgurioLightCMSBundle:Page p SET p.position=p.position-1 WHERE p.position>=:position AND p.parent=:parentId AND p.page_ty... | [
"public",
"function",
"upPagesPosition",
"(",
"$",
"parentId",
",",
"$",
"position",
",",
"$",
"positionLimit",
"=",
"NULL",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"positionLimit",
")",
")",
"{",
"$",
"query",
"=",
"$",
"this",
"->",
"getEntityManager... | Up pages position
@param number $parentId
@param number $position
@param number $positionLimit | [
"Up",
"pages",
"position"
] | 66319af52b97b6552b7c391ee370538263f42d10 | https://github.com/fulgurio/LightCMSBundle/blob/66319af52b97b6552b7c391ee370538263f42d10/Repository/PageRepository.php#L30-L45 |
198,096 | fulgurio/LightCMSBundle | Repository/PageRepository.php | PageRepository.getNextPosition | public function getNextPosition($parentId)
{
$query = $this->getEntityManager()->createQuery('SELECT MAX(p.position) FROM FulgurioLightCMSBundle:Page p WHERE p.parent=:parentId AND p.page_type=:pageType');
$query->setParameter('pageType', 'page');
$query->setParameter('parentId', $parentId);... | php | public function getNextPosition($parentId)
{
$query = $this->getEntityManager()->createQuery('SELECT MAX(p.position) FROM FulgurioLightCMSBundle:Page p WHERE p.parent=:parentId AND p.page_type=:pageType');
$query->setParameter('pageType', 'page');
$query->setParameter('parentId', $parentId);... | [
"public",
"function",
"getNextPosition",
"(",
"$",
"parentId",
")",
"{",
"$",
"query",
"=",
"$",
"this",
"->",
"getEntityManager",
"(",
")",
"->",
"createQuery",
"(",
"'SELECT MAX(p.position) FROM FulgurioLightCMSBundle:Page p WHERE p.parent=:parentId AND p.page_type=:pageTyp... | Get next position in tree
@param number $parentId
@return number | [
"Get",
"next",
"position",
"in",
"tree"
] | 66319af52b97b6552b7c391ee370538263f42d10 | https://github.com/fulgurio/LightCMSBundle/blob/66319af52b97b6552b7c391ee370538263f42d10/Repository/PageRepository.php#L77-L83 |
198,097 | wb-crowdfusion/crowdfusion | system/core/classes/nodedb/utils/TagUtils.php | TagUtils.validateTags | public static function validateTags(array &$array, $direction = null)
{
foreach ($array as $key => $tag) {
$array[$key] = self::validateTag($tag, $direction);
}
return $array;
} | php | public static function validateTags(array &$array, $direction = null)
{
foreach ($array as $key => $tag) {
$array[$key] = self::validateTag($tag, $direction);
}
return $array;
} | [
"public",
"static",
"function",
"validateTags",
"(",
"array",
"&",
"$",
"array",
",",
"$",
"direction",
"=",
"null",
")",
"{",
"foreach",
"(",
"$",
"array",
"as",
"$",
"key",
"=>",
"$",
"tag",
")",
"{",
"$",
"array",
"[",
"$",
"key",
"]",
"=",
"s... | Validates that the given array contains all valid Tag entries
@param array &$array An array of strings or Tag objects
@param string $direction Either 'in' or 'out'. Used to specify the direction for all tags in the array
@return void
@throws Exception if any items are invalid. | [
"Validates",
"that",
"the",
"given",
"array",
"contains",
"all",
"valid",
"Tag",
"entries"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/nodedb/utils/TagUtils.php#L49-L56 |
198,098 | wb-crowdfusion/crowdfusion | system/core/classes/nodedb/utils/TagUtils.php | TagUtils.matchTags | public static function matchTags(array $tags1, array $tags2)
{
if (count(self::diffTags($tags1, $tags2)) == 0 &&
count(self::diffTags($tags2, $tags1)) == 0)
return true;
return false;
} | php | public static function matchTags(array $tags1, array $tags2)
{
if (count(self::diffTags($tags1, $tags2)) == 0 &&
count(self::diffTags($tags2, $tags1)) == 0)
return true;
return false;
} | [
"public",
"static",
"function",
"matchTags",
"(",
"array",
"$",
"tags1",
",",
"array",
"$",
"tags2",
")",
"{",
"if",
"(",
"count",
"(",
"self",
"::",
"diffTags",
"(",
"$",
"tags1",
",",
"$",
"tags2",
")",
")",
"==",
"0",
"&&",
"count",
"(",
"self",... | Determines if the tags in both arrays are a match
@param array $tags1 An array of Tag objects
@param array $tags2 An Array of Tag objects
@return boolean true if both array contain the same tags | [
"Determines",
"if",
"the",
"tags",
"in",
"both",
"arrays",
"are",
"a",
"match"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/nodedb/utils/TagUtils.php#L220-L228 |
198,099 | Xsaven/laravel-intelect-admin | src/Addons/JWTAuth/Claims/Claim.php | Claim.setValue | public function setValue($value)
{
if (! $this->validate($value)) {
throw new InvalidClaimException('Invalid value provided for claim "'.$this->getName().'": '.$value);
}
$this->value = $value;
return $this;
} | php | public function setValue($value)
{
if (! $this->validate($value)) {
throw new InvalidClaimException('Invalid value provided for claim "'.$this->getName().'": '.$value);
}
$this->value = $value;
return $this;
} | [
"public",
"function",
"setValue",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"validate",
"(",
"$",
"value",
")",
")",
"{",
"throw",
"new",
"InvalidClaimException",
"(",
"'Invalid value provided for claim \"'",
".",
"$",
"this",
"->",
"... | Set the claim value, and call a validate method if available.
@param $value
@throws \Lia\Addons\JWTAuth\Exceptions\InvalidClaimException
@return $this | [
"Set",
"the",
"claim",
"value",
"and",
"call",
"a",
"validate",
"method",
"if",
"available",
"."
] | 592574633d12c74cf25b43dd6694fee496abefcb | https://github.com/Xsaven/laravel-intelect-admin/blob/592574633d12c74cf25b43dd6694fee496abefcb/src/Addons/JWTAuth/Claims/Claim.php#L38-L47 |
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.