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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
6,500 | OWeb/OWeb-Framework | OWeb/OWeb.php | OWeb.loadSettings | private function loadSettings()
{
$settings = $this->manage_settings->getSetting($this);
if (isset($settings['extensions'])) {
//loading all extensions
try {
$this->loadExtensions($settings['extensions']);
} catch (\Exception $ex) {
... | php | private function loadSettings()
{
$settings = $this->manage_settings->getSetting($this);
if (isset($settings['extensions'])) {
//loading all extensions
try {
$this->loadExtensions($settings['extensions']);
} catch (\Exception $ex) {
... | [
"private",
"function",
"loadSettings",
"(",
")",
"{",
"$",
"settings",
"=",
"$",
"this",
"->",
"manage_settings",
"->",
"getSetting",
"(",
"$",
"this",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"settings",
"[",
"'extensions'",
"]",
")",
")",
"{",
"//load... | Will load the settings from the Default config file. And will after loads the extensions
@throws \OWeb\Exception If there is any error while loading the Settings | [
"Will",
"load",
"the",
"settings",
"from",
"the",
"Default",
"config",
"file",
".",
"And",
"will",
"after",
"loads",
"the",
"extensions"
] | fb441f51afb16860b0c946a55c36c789fbb125fa | https://github.com/OWeb/OWeb-Framework/blob/fb441f51afb16860b0c946a55c36c789fbb125fa/OWeb/OWeb.php#L200-L213 |
6,501 | eghojansu/nutrition | src/Utils/Breadcrumb.php | Breadcrumb.setRoot | public function setRoot($route, array $args = null, $label = null)
{
array_unshift($this->hierarchy, [
'label' => $label ?: static::titleIze($route),
'route' => $route,
'args' => (array) $args
]);
$this->lastKey = null;
return $this;
} | php | public function setRoot($route, array $args = null, $label = null)
{
array_unshift($this->hierarchy, [
'label' => $label ?: static::titleIze($route),
'route' => $route,
'args' => (array) $args
]);
$this->lastKey = null;
return $this;
} | [
"public",
"function",
"setRoot",
"(",
"$",
"route",
",",
"array",
"$",
"args",
"=",
"null",
",",
"$",
"label",
"=",
"null",
")",
"{",
"array_unshift",
"(",
"$",
"this",
"->",
"hierarchy",
",",
"[",
"'label'",
"=>",
"$",
"label",
"?",
":",
"static",
... | Set breadcrumb root
@param string $route
@param array|null $args
@param string $label | [
"Set",
"breadcrumb",
"root"
] | 3941c62aeb6dafda55349a38dd4107d521f8964a | https://github.com/eghojansu/nutrition/blob/3941c62aeb6dafda55349a38dd4107d521f8964a/src/Utils/Breadcrumb.php#L35-L45 |
6,502 | eghojansu/nutrition | src/Utils/Breadcrumb.php | Breadcrumb.add | public function add($route, array $args = null, $label = null)
{
$this->hierarchy[] = [
'label' => $label ?: static::titleIze($route),
'route' => $route,
'args' => (array) $args
];
$this->lastKey = null;
return $this;
} | php | public function add($route, array $args = null, $label = null)
{
$this->hierarchy[] = [
'label' => $label ?: static::titleIze($route),
'route' => $route,
'args' => (array) $args
];
$this->lastKey = null;
return $this;
} | [
"public",
"function",
"add",
"(",
"$",
"route",
",",
"array",
"$",
"args",
"=",
"null",
",",
"$",
"label",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"hierarchy",
"[",
"]",
"=",
"[",
"'label'",
"=>",
"$",
"label",
"?",
":",
"static",
"::",
"titleI... | Append to breadcrumb
@param string $route
@param array|null $args
@param string $label | [
"Append",
"to",
"breadcrumb"
] | 3941c62aeb6dafda55349a38dd4107d521f8964a | https://github.com/eghojansu/nutrition/blob/3941c62aeb6dafda55349a38dd4107d521f8964a/src/Utils/Breadcrumb.php#L53-L63 |
6,503 | eghojansu/nutrition | src/Utils/Breadcrumb.php | Breadcrumb.addCurrentRoute | public function addCurrentRoute($label = null)
{
$base = Base::instance();
$args = ($base['PARAMS'] ?: []) + ($base['GET'] ?: []);
unset($args[0]);
return $this->add($base['ALIAS'], $args, $label);
} | php | public function addCurrentRoute($label = null)
{
$base = Base::instance();
$args = ($base['PARAMS'] ?: []) + ($base['GET'] ?: []);
unset($args[0]);
return $this->add($base['ALIAS'], $args, $label);
} | [
"public",
"function",
"addCurrentRoute",
"(",
"$",
"label",
"=",
"null",
")",
"{",
"$",
"base",
"=",
"Base",
"::",
"instance",
"(",
")",
";",
"$",
"args",
"=",
"(",
"$",
"base",
"[",
"'PARAMS'",
"]",
"?",
":",
"[",
"]",
")",
"+",
"(",
"$",
"bas... | Add current route to breadcrumb
@param string $label | [
"Add",
"current",
"route",
"to",
"breadcrumb"
] | 3941c62aeb6dafda55349a38dd4107d521f8964a | https://github.com/eghojansu/nutrition/blob/3941c62aeb6dafda55349a38dd4107d521f8964a/src/Utils/Breadcrumb.php#L69-L76 |
6,504 | eghojansu/nutrition | src/Utils/Breadcrumb.php | Breadcrumb.addGroup | public function addGroup(
GroupChecker $groupChecker,
$firstLabel = null,
$route = null,
array $routeArgs = null
) {
$routeArgs = (array) $routeArgs;
if (empty($route)) {
$base = Base::instance();
$routeArgs = ($base['PARAMS'] ?: []) + ($base['... | php | public function addGroup(
GroupChecker $groupChecker,
$firstLabel = null,
$route = null,
array $routeArgs = null
) {
$routeArgs = (array) $routeArgs;
if (empty($route)) {
$base = Base::instance();
$routeArgs = ($base['PARAMS'] ?: []) + ($base['... | [
"public",
"function",
"addGroup",
"(",
"GroupChecker",
"$",
"groupChecker",
",",
"$",
"firstLabel",
"=",
"null",
",",
"$",
"route",
"=",
"null",
",",
"array",
"$",
"routeArgs",
"=",
"null",
")",
"{",
"$",
"routeArgs",
"=",
"(",
"array",
")",
"$",
"rout... | Add Group to breadcrumb
@param GroupChecker $groupChecker
@param string $firstLabel
@param string $route
@param array|null $routeArgs | [
"Add",
"Group",
"to",
"breadcrumb"
] | 3941c62aeb6dafda55349a38dd4107d521f8964a | https://github.com/eghojansu/nutrition/blob/3941c62aeb6dafda55349a38dd4107d521f8964a/src/Utils/Breadcrumb.php#L85-L114 |
6,505 | eghojansu/nutrition | src/Utils/Breadcrumb.php | Breadcrumb.isLast | public function isLast($key)
{
if (null === $this->lastKey) {
end($this->hierarchy);
$this->lastKey = key($this->hierarchy);
}
return $key === $this->lastKey;
} | php | public function isLast($key)
{
if (null === $this->lastKey) {
end($this->hierarchy);
$this->lastKey = key($this->hierarchy);
}
return $key === $this->lastKey;
} | [
"public",
"function",
"isLast",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"lastKey",
")",
"{",
"end",
"(",
"$",
"this",
"->",
"hierarchy",
")",
";",
"$",
"this",
"->",
"lastKey",
"=",
"key",
"(",
"$",
"this",
"->",
... | Check if key is las key
@param mixed $key
@return boolean | [
"Check",
"if",
"key",
"is",
"las",
"key"
] | 3941c62aeb6dafda55349a38dd4107d521f8964a | https://github.com/eghojansu/nutrition/blob/3941c62aeb6dafda55349a38dd4107d521f8964a/src/Utils/Breadcrumb.php#L130-L138 |
6,506 | Persata/SymfonyApiExtension | src/ApiClient.php | ApiClient.reset | public function reset(): ApiClient
{
$this->internalRequest = new InternalRequest($this->baseUrl, 'GET');
$this->request = null;
$this->response = null;
$this->profiler = false;
$this->hasPerformedRequest = false;
$this->kernel->shutdown();
$this->kernel->boot();
... | php | public function reset(): ApiClient
{
$this->internalRequest = new InternalRequest($this->baseUrl, 'GET');
$this->request = null;
$this->response = null;
$this->profiler = false;
$this->hasPerformedRequest = false;
$this->kernel->shutdown();
$this->kernel->boot();
... | [
"public",
"function",
"reset",
"(",
")",
":",
"ApiClient",
"{",
"$",
"this",
"->",
"internalRequest",
"=",
"new",
"InternalRequest",
"(",
"$",
"this",
"->",
"baseUrl",
",",
"'GET'",
")",
";",
"$",
"this",
"->",
"request",
"=",
"null",
";",
"$",
"this",... | Reset the internal state of the API client | [
"Reset",
"the",
"internal",
"state",
"of",
"the",
"API",
"client"
] | 89fcfbd13b462c184ab208215b8b12199e8647dd | https://github.com/Persata/SymfonyApiExtension/blob/89fcfbd13b462c184ab208215b8b12199e8647dd/src/ApiClient.php#L78-L91 |
6,507 | rodchyn/elephant-lang | lib/ParserGenerator/PHP/ParserGenerator/State.php | PHP_ParserGenerator_State.stateResortCompare | static function stateResortCompare($a, $b)
{
$n = $b->nNtAct - $a->nNtAct;
if ($n === 0) {
$n = $b->nTknAct - $a->nTknAct;
}
return $n;
} | php | static function stateResortCompare($a, $b)
{
$n = $b->nNtAct - $a->nNtAct;
if ($n === 0) {
$n = $b->nTknAct - $a->nTknAct;
}
return $n;
} | [
"static",
"function",
"stateResortCompare",
"(",
"$",
"a",
",",
"$",
"b",
")",
"{",
"$",
"n",
"=",
"$",
"b",
"->",
"nNtAct",
"-",
"$",
"a",
"->",
"nNtAct",
";",
"if",
"(",
"$",
"n",
"===",
"0",
")",
"{",
"$",
"n",
"=",
"$",
"b",
"->",
"nTkn... | Compare two states for sorting purposes. The smaller state is the
one with the most non-terminal actions. If they have the same number
of non-terminal actions, then the smaller is the one with the most
token actions. | [
"Compare",
"two",
"states",
"for",
"sorting",
"purposes",
".",
"The",
"smaller",
"state",
"is",
"the",
"one",
"with",
"the",
"most",
"non",
"-",
"terminal",
"actions",
".",
"If",
"they",
"have",
"the",
"same",
"number",
"of",
"non",
"-",
"terminal",
"act... | e0acc26eec1ab4dbfcc90ad79efc23318eaba5cf | https://github.com/rodchyn/elephant-lang/blob/e0acc26eec1ab4dbfcc90ad79efc23318eaba5cf/lib/ParserGenerator/PHP/ParserGenerator/State.php#L155-L162 |
6,508 | rodchyn/elephant-lang | lib/ParserGenerator/PHP/ParserGenerator/State.php | PHP_ParserGenerator_State.statecmp | static function statecmp($a, $b)
{
for ($rc = 0; $rc == 0 && $a && $b; $a = $a->bp, $b = $b->bp) {
$rc = $a->rp->index - $b->rp->index;
if ($rc === 0) {
$rc = $a->dot - $b->dot;
}
}
if ($rc == 0) {
if ($a) {
$rc... | php | static function statecmp($a, $b)
{
for ($rc = 0; $rc == 0 && $a && $b; $a = $a->bp, $b = $b->bp) {
$rc = $a->rp->index - $b->rp->index;
if ($rc === 0) {
$rc = $a->dot - $b->dot;
}
}
if ($rc == 0) {
if ($a) {
$rc... | [
"static",
"function",
"statecmp",
"(",
"$",
"a",
",",
"$",
"b",
")",
"{",
"for",
"(",
"$",
"rc",
"=",
"0",
";",
"$",
"rc",
"==",
"0",
"&&",
"$",
"a",
"&&",
"$",
"b",
";",
"$",
"a",
"=",
"$",
"a",
"->",
"bp",
",",
"$",
"b",
"=",
"$",
"... | Compare two states based on their configurations
@param PHP_ParserGenerator_Config|0 $a
@param PHP_ParserGenerator_Config|0 $b
@return int | [
"Compare",
"two",
"states",
"based",
"on",
"their",
"configurations"
] | e0acc26eec1ab4dbfcc90ad79efc23318eaba5cf | https://github.com/rodchyn/elephant-lang/blob/e0acc26eec1ab4dbfcc90ad79efc23318eaba5cf/lib/ParserGenerator/PHP/ParserGenerator/State.php#L171-L188 |
6,509 | rodchyn/elephant-lang | lib/ParserGenerator/PHP/ParserGenerator/State.php | PHP_ParserGenerator_State.statehash | private static function statehash(PHP_ParserGenerator_Config $a)
{
$h = 0;
while ($a) {
$h = $h * 571 + $a->rp->index * 37 + $a->dot;
$a = $a->bp;
}
return (int) $h;
} | php | private static function statehash(PHP_ParserGenerator_Config $a)
{
$h = 0;
while ($a) {
$h = $h * 571 + $a->rp->index * 37 + $a->dot;
$a = $a->bp;
}
return (int) $h;
} | [
"private",
"static",
"function",
"statehash",
"(",
"PHP_ParserGenerator_Config",
"$",
"a",
")",
"{",
"$",
"h",
"=",
"0",
";",
"while",
"(",
"$",
"a",
")",
"{",
"$",
"h",
"=",
"$",
"h",
"*",
"571",
"+",
"$",
"a",
"->",
"rp",
"->",
"index",
"*",
... | Hash a state based on its configuration
@return int | [
"Hash",
"a",
"state",
"based",
"on",
"its",
"configuration"
] | e0acc26eec1ab4dbfcc90ad79efc23318eaba5cf | https://github.com/rodchyn/elephant-lang/blob/e0acc26eec1ab4dbfcc90ad79efc23318eaba5cf/lib/ParserGenerator/PHP/ParserGenerator/State.php#L195-L203 |
6,510 | nia-php/translating | sources/Filter/ValueFormatterFilter.php | ValueFormatterFilter.extractArguments | private function extractArguments(string $argumentList): array
{
$arguments = [];
foreach (array_map('trim', explode(',', $argumentList)) as $rawArgument) {
if ($rawArgument === '') {
continue;
}
list ($argumentName, $argumentValue) = array_map('... | php | private function extractArguments(string $argumentList): array
{
$arguments = [];
foreach (array_map('trim', explode(',', $argumentList)) as $rawArgument) {
if ($rawArgument === '') {
continue;
}
list ($argumentName, $argumentValue) = array_map('... | [
"private",
"function",
"extractArguments",
"(",
"string",
"$",
"argumentList",
")",
":",
"array",
"{",
"$",
"arguments",
"=",
"[",
"]",
";",
"foreach",
"(",
"array_map",
"(",
"'trim'",
",",
"explode",
"(",
"','",
",",
"$",
"argumentList",
")",
")",
"as",... | Extracts the arguments for a raw argument list.
@param string $argumentList
The raw argument list.
@return string[] Native map with extracted arguments. | [
"Extracts",
"the",
"arguments",
"for",
"a",
"raw",
"argument",
"list",
"."
] | 9348eeef0216b08c3efb102abc02e8d07c043dca | https://github.com/nia-php/translating/blob/9348eeef0216b08c3efb102abc02e8d07c043dca/sources/Filter/ValueFormatterFilter.php#L132-L150 |
6,511 | mikegibson/sentient | src/Utility/StringHelper.php | StringHelper.wrap | public function wrap($text, $options = array()) {
if (is_numeric($options)) {
$options = array('width' => $options);
}
$options += array('width' => 72, 'wordWrap' => true, 'indent' => null, 'indentAt' => 0);
if ($options['wordWrap']) {
$wrapped = $this->wordWrap($text, $options['width'], "\n");
} else ... | php | public function wrap($text, $options = array()) {
if (is_numeric($options)) {
$options = array('width' => $options);
}
$options += array('width' => 72, 'wordWrap' => true, 'indent' => null, 'indentAt' => 0);
if ($options['wordWrap']) {
$wrapped = $this->wordWrap($text, $options['width'], "\n");
} else ... | [
"public",
"function",
"wrap",
"(",
"$",
"text",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"is_numeric",
"(",
"$",
"options",
")",
")",
"{",
"$",
"options",
"=",
"array",
"(",
"'width'",
"=>",
"$",
"options",
")",
";",
"}",... | Wraps text to a specific width, can optionally wrap at word breaks.
### Options
- `width` The width to wrap to. Defaults to 72.
- `wordWrap` Only wrap on words breaks (spaces) Defaults to true.
- `indent` String to indent with. Defaults to null.
- `indentAt` 0 based index to start indenting at. Defaults to 0.
@param... | [
"Wraps",
"text",
"to",
"a",
"specific",
"width",
"can",
"optionally",
"wrap",
"at",
"word",
"breaks",
"."
] | 05aaaa0cd8e649d2b526df52a59c9fb53c114338 | https://github.com/mikegibson/sentient/blob/05aaaa0cd8e649d2b526df52a59c9fb53c114338/src/Utility/StringHelper.php#L276-L297 |
6,512 | mikegibson/sentient | src/Utility/StringHelper.php | StringHelper.wordWrap | public function wordWrap($text, $width = 72, $break = "\n", $cut = false) {
if ($cut) {
$parts = array();
while (mb_strlen($text) > 0) {
$part = mb_substr($text, 0, $width);
$parts[] = trim($part);
$text = trim(mb_substr($text, mb_strlen($part)));
}
return implode($break, $parts);
}
$pa... | php | public function wordWrap($text, $width = 72, $break = "\n", $cut = false) {
if ($cut) {
$parts = array();
while (mb_strlen($text) > 0) {
$part = mb_substr($text, 0, $width);
$parts[] = trim($part);
$text = trim(mb_substr($text, mb_strlen($part)));
}
return implode($break, $parts);
}
$pa... | [
"public",
"function",
"wordWrap",
"(",
"$",
"text",
",",
"$",
"width",
"=",
"72",
",",
"$",
"break",
"=",
"\"\\n\"",
",",
"$",
"cut",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"cut",
")",
"{",
"$",
"parts",
"=",
"array",
"(",
")",
";",
"while",
... | Unicode aware version of wordwrap.
@param string $text The text to format.
@param integer $width The width to wrap to. Defaults to 72.
@param string $break The line is broken using the optional break parameter. Defaults to '\n'.
@param boolean $cut If the cut is set to true, the string is always wrapped at the specifi... | [
"Unicode",
"aware",
"version",
"of",
"wordwrap",
"."
] | 05aaaa0cd8e649d2b526df52a59c9fb53c114338 | https://github.com/mikegibson/sentient/blob/05aaaa0cd8e649d2b526df52a59c9fb53c114338/src/Utility/StringHelper.php#L308-L349 |
6,513 | mikegibson/sentient | src/Utility/StringHelper.php | StringHelper.ascii | public function ascii($array) {
$ascii = '';
foreach ($array as $utf8) {
if ($utf8 < 128) {
$ascii .= chr($utf8);
} elseif ($utf8 < 2048) {
$ascii .= chr(192 + (($utf8 - ($utf8 % 64)) / 64));
$ascii .= chr(128 + ($utf8 % 64));
} else {
$ascii .= chr(224 + (($utf8 - ($utf8 % 4096)) / 4096)... | php | public function ascii($array) {
$ascii = '';
foreach ($array as $utf8) {
if ($utf8 < 128) {
$ascii .= chr($utf8);
} elseif ($utf8 < 2048) {
$ascii .= chr(192 + (($utf8 - ($utf8 % 64)) / 64));
$ascii .= chr(128 + ($utf8 % 64));
} else {
$ascii .= chr(224 + (($utf8 - ($utf8 % 4096)) / 4096)... | [
"public",
"function",
"ascii",
"(",
"$",
"array",
")",
"{",
"$",
"ascii",
"=",
"''",
";",
"foreach",
"(",
"$",
"array",
"as",
"$",
"utf8",
")",
"{",
"if",
"(",
"$",
"utf8",
"<",
"128",
")",
"{",
"$",
"ascii",
".=",
"chr",
"(",
"$",
"utf8",
")... | Converts the decimal value of a multibyte character string
to a string
@param array $array
@return string | [
"Converts",
"the",
"decimal",
"value",
"of",
"a",
"multibyte",
"character",
"string",
"to",
"a",
"string"
] | 05aaaa0cd8e649d2b526df52a59c9fb53c114338 | https://github.com/mikegibson/sentient/blob/05aaaa0cd8e649d2b526df52a59c9fb53c114338/src/Utility/StringHelper.php#L720-L739 |
6,514 | common-libs/storage | src/Options.php | Options.setPath | public function setPath(File $path) {
$this->path = $path;
if ($this->isCreateIfNotExists() && !$path->isFile()) {
$path->getParent()->mkdir();
$path->write("");
$this->setCreateDefault(true);
if (!$path->isFile()) {
throw new FileNotFoundException($path);
}
}
$this->content = $path->getConte... | php | public function setPath(File $path) {
$this->path = $path;
if ($this->isCreateIfNotExists() && !$path->isFile()) {
$path->getParent()->mkdir();
$path->write("");
$this->setCreateDefault(true);
if (!$path->isFile()) {
throw new FileNotFoundException($path);
}
}
$this->content = $path->getConte... | [
"public",
"function",
"setPath",
"(",
"File",
"$",
"path",
")",
"{",
"$",
"this",
"->",
"path",
"=",
"$",
"path",
";",
"if",
"(",
"$",
"this",
"->",
"isCreateIfNotExists",
"(",
")",
"&&",
"!",
"$",
"path",
"->",
"isFile",
"(",
")",
")",
"{",
"$",... | sets file path
@param File $path file path
@since 0.2.1
@throws FileNotFoundException | [
"sets",
"file",
"path"
] | 7bfc8b551baf600d49a8762f343d829cbe25a361 | https://github.com/common-libs/storage/blob/7bfc8b551baf600d49a8762f343d829cbe25a361/src/Options.php#L99-L110 |
6,515 | budkit/budkit-framework | src/Budkit/Application/Instance.php | Instance.createRequestFromGlobals | protected function createRequestFromGlobals()
{
$_ATTRIBUTES = array_merge([], isset($_SESSION) ? $_SESSION : []);
$SERVER = $_SERVER;
if (isset($_POST["_method"])) {
//Hack to allow PATCH, DELETE, OPTIONS etc!
$SERVER['REQUEST_METHOD'] = $_POST["_method"];
... | php | protected function createRequestFromGlobals()
{
$_ATTRIBUTES = array_merge([], isset($_SESSION) ? $_SESSION : []);
$SERVER = $_SERVER;
if (isset($_POST["_method"])) {
//Hack to allow PATCH, DELETE, OPTIONS etc!
$SERVER['REQUEST_METHOD'] = $_POST["_method"];
... | [
"protected",
"function",
"createRequestFromGlobals",
"(",
")",
"{",
"$",
"_ATTRIBUTES",
"=",
"array_merge",
"(",
"[",
"]",
",",
"isset",
"(",
"$",
"_SESSION",
")",
"?",
"$",
"_SESSION",
":",
"[",
"]",
")",
";",
"$",
"SERVER",
"=",
"$",
"_SERVER",
";",
... | Creates an Http\Request object
- Captures global request variables `$_ENV`, `$_SESSION`, `$_SERVER`, `$_POST`, `$_GET`, `$_COOKIE`, `$_FILES`.
- These global variables (except `$_POST`) are sanitized, then destroyed by the created Request object.
*Hint: To handle non HTTP Request, fork this class and overwrite this m... | [
"Creates",
"an",
"Http",
"\\",
"Request",
"object"
] | 0635061815fe07a8c63f9514b845d199b3c0d485 | https://github.com/budkit/budkit-framework/blob/0635061815fe07a8c63f9514b845d199b3c0d485/src/Budkit/Application/Instance.php#L93-L105 |
6,516 | budkit/budkit-framework | src/Budkit/Application/Instance.php | Instance.execute | public function execute(Request $request = null)
{
$request = $request ?: $this->request;
$this->dispatcher->dispatch($request, $this->response);
} | php | public function execute(Request $request = null)
{
$request = $request ?: $this->request;
$this->dispatcher->dispatch($request, $this->response);
} | [
"public",
"function",
"execute",
"(",
"Request",
"$",
"request",
"=",
"null",
")",
"{",
"$",
"request",
"=",
"$",
"request",
"?",
":",
"$",
"this",
"->",
"request",
";",
"$",
"this",
"->",
"dispatcher",
"->",
"dispatch",
"(",
"$",
"request",
",",
"$"... | Dispatches the request to the router;
@param \Budkit\Protocol\Request $request [#](?file=Budkit/Protocol/Request.php) | [
"Dispatches",
"the",
"request",
"to",
"the",
"router",
";"
] | 0635061815fe07a8c63f9514b845d199b3c0d485 | https://github.com/budkit/budkit-framework/blob/0635061815fe07a8c63f9514b845d199b3c0d485/src/Budkit/Application/Instance.php#L113-L119 |
6,517 | remote-office/libx | src/External/LocationServer/Api/LocationServerClient.php | LocationServerClient.suggest | public function suggest($zipcode, $number, $addition = null)
{
// Concat url
$url = self::API_URL . '/suggest?q=' . $zipcode . '-' . $number . (!empty($addition) ? '-' . $addition : '');
// Create a REST request
$request = new \LibX\Net\Rest\Request($url, \LibX\Net\Rest\Request::REQUEST_MET... | php | public function suggest($zipcode, $number, $addition = null)
{
// Concat url
$url = self::API_URL . '/suggest?q=' . $zipcode . '-' . $number . (!empty($addition) ? '-' . $addition : '');
// Create a REST request
$request = new \LibX\Net\Rest\Request($url, \LibX\Net\Rest\Request::REQUEST_MET... | [
"public",
"function",
"suggest",
"(",
"$",
"zipcode",
",",
"$",
"number",
",",
"$",
"addition",
"=",
"null",
")",
"{",
"// Concat url",
"$",
"url",
"=",
"self",
"::",
"API_URL",
".",
"'/suggest?q='",
".",
"$",
"zipcode",
".",
"'-'",
".",
"$",
"number",... | Suggest an address id
@param string $zipcode
@param integer $number
@param string $addition
@return string | [
"Suggest",
"an",
"address",
"id"
] | 8baeaae99a6110e7c588bc0388df89a0dc0768b5 | https://github.com/remote-office/libx/blob/8baeaae99a6110e7c588bc0388df89a0dc0768b5/src/External/LocationServer/Api/LocationServerClient.php#L26-L54 |
6,518 | remote-office/libx | src/External/LocationServer/Api/LocationServerClient.php | LocationServerClient.lookup | public function lookup($id)
{
// Concat url
$url = self::API_URL . '/lookup?id=' . $id;
// Create a REST request
$request = new \LibX\Net\Rest\Request($url, \LibX\Net\Rest\Request::REQUEST_METHOD_GET);
// Create a REST response
$response = new \LibX\Net\Rest\Response();
... | php | public function lookup($id)
{
// Concat url
$url = self::API_URL . '/lookup?id=' . $id;
// Create a REST request
$request = new \LibX\Net\Rest\Request($url, \LibX\Net\Rest\Request::REQUEST_METHOD_GET);
// Create a REST response
$response = new \LibX\Net\Rest\Response();
... | [
"public",
"function",
"lookup",
"(",
"$",
"id",
")",
"{",
"// Concat url",
"$",
"url",
"=",
"self",
"::",
"API_URL",
".",
"'/lookup?id='",
".",
"$",
"id",
";",
"// Create a REST request",
"$",
"request",
"=",
"new",
"\\",
"LibX",
"\\",
"Net",
"\\",
"Rest... | Lookup an address id
@param string $id
@return string | [
"Lookup",
"an",
"address",
"id"
] | 8baeaae99a6110e7c588bc0388df89a0dc0768b5 | https://github.com/remote-office/libx/blob/8baeaae99a6110e7c588bc0388df89a0dc0768b5/src/External/LocationServer/Api/LocationServerClient.php#L62-L135 |
6,519 | Dhii/i18n-helper-base | src/StringTranslatorAwareTrait.php | StringTranslatorAwareTrait._setTranslator | protected function _setTranslator($translator)
{
if (!(is_null($translator) || $translator instanceof StringTranslatorInterface)) {
throw new InvalidArgumentException('Invalid translator');
}
$this->translator = $translator;
return $this;
} | php | protected function _setTranslator($translator)
{
if (!(is_null($translator) || $translator instanceof StringTranslatorInterface)) {
throw new InvalidArgumentException('Invalid translator');
}
$this->translator = $translator;
return $this;
} | [
"protected",
"function",
"_setTranslator",
"(",
"$",
"translator",
")",
"{",
"if",
"(",
"!",
"(",
"is_null",
"(",
"$",
"translator",
")",
"||",
"$",
"translator",
"instanceof",
"StringTranslatorInterface",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException... | Assigns the translator to be used by this instance.
@since [*next-version*]
@param StringTranslatorInterface|null $translator The translator.
@throws InvalidArgumentException If translator is invalid.
@return $this | [
"Assigns",
"the",
"translator",
"to",
"be",
"used",
"by",
"this",
"instance",
"."
] | fc4c881f3e528ea918588831ebeffb92738f8dd5 | https://github.com/Dhii/i18n-helper-base/blob/fc4c881f3e528ea918588831ebeffb92738f8dd5/src/StringTranslatorAwareTrait.php#L34-L43 |
6,520 | jeromeklam/freefw | src/FreeFW/Application/Config.php | Config.readConfig | protected function readConfig()
{
if ($this->loaded == false) {
$this->config = $this->loader->getDatas();
$this->loaded = true;
}
return $this;
} | php | protected function readConfig()
{
if ($this->loaded == false) {
$this->config = $this->loader->getDatas();
$this->loaded = true;
}
return $this;
} | [
"protected",
"function",
"readConfig",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"loaded",
"==",
"false",
")",
"{",
"$",
"this",
"->",
"config",
"=",
"$",
"this",
"->",
"loader",
"->",
"getDatas",
"(",
")",
";",
"$",
"this",
"->",
"loaded",
"=",... | Lecture de la configuration
@return \FreeFW\Application\Config | [
"Lecture",
"de",
"la",
"configuration"
] | 16ecf24192375c920a070296f396b9d3fd994a1e | https://github.com/jeromeklam/freefw/blob/16ecf24192375c920a070296f396b9d3fd994a1e/src/FreeFW/Application/Config.php#L68-L76 |
6,521 | jeromeklam/freefw | src/FreeFW/Application/Config.php | Config.getFactory | public static function getFactory($p_name, $p_file = null)
{
if (self::$factory === null) {
self::$factory = array();
}
if (!array_key_exists($p_name, self::$factory)) {
self::$factory[$p_name] = new self($p_file);
}
return self::$factory[$p_name];
... | php | public static function getFactory($p_name, $p_file = null)
{
if (self::$factory === null) {
self::$factory = array();
}
if (!array_key_exists($p_name, self::$factory)) {
self::$factory[$p_name] = new self($p_file);
}
return self::$factory[$p_name];
... | [
"public",
"static",
"function",
"getFactory",
"(",
"$",
"p_name",
",",
"$",
"p_file",
"=",
"null",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"factory",
"===",
"null",
")",
"{",
"self",
"::",
"$",
"factory",
"=",
"array",
"(",
")",
";",
"}",
"if",
"... | Retourne l'instance
@var string $p_name
@var string $p_file
@return \FreeFW\Application\Config | [
"Retourne",
"l",
"instance"
] | 16ecf24192375c920a070296f396b9d3fd994a1e | https://github.com/jeromeklam/freefw/blob/16ecf24192375c920a070296f396b9d3fd994a1e/src/FreeFW/Application/Config.php#L98-L108 |
6,522 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/num.php | Num._init | public static function _init()
{
\Lang::load('byte_units', true);
static::$config = \Config::load('num', true);
static::$byte_units = \Lang::get('byte_units');
} | php | public static function _init()
{
\Lang::load('byte_units', true);
static::$config = \Config::load('num', true);
static::$byte_units = \Lang::get('byte_units');
} | [
"public",
"static",
"function",
"_init",
"(",
")",
"{",
"\\",
"Lang",
"::",
"load",
"(",
"'byte_units'",
",",
"true",
")",
";",
"static",
"::",
"$",
"config",
"=",
"\\",
"Config",
"::",
"load",
"(",
"'num'",
",",
"true",
")",
";",
"static",
"::",
"... | Class initialization callback
@return void | [
"Class",
"initialization",
"callback"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/num.php#L51-L57 |
6,523 | Dhii/tokenizer-abstract | src/TokenAwareTrait.php | TokenAwareTrait._setToken | protected function _setToken($token)
{
if ($token !== null && !($token instanceof TokenInterface)) {
throw $this->_createInvalidArgumentException($this->__('Invalid token'), null, null, $token);
}
$this->token = $token;
} | php | protected function _setToken($token)
{
if ($token !== null && !($token instanceof TokenInterface)) {
throw $this->_createInvalidArgumentException($this->__('Invalid token'), null, null, $token);
}
$this->token = $token;
} | [
"protected",
"function",
"_setToken",
"(",
"$",
"token",
")",
"{",
"if",
"(",
"$",
"token",
"!==",
"null",
"&&",
"!",
"(",
"$",
"token",
"instanceof",
"TokenInterface",
")",
")",
"{",
"throw",
"$",
"this",
"->",
"_createInvalidArgumentException",
"(",
"$",... | Assigns a token to this instance.
@since [*next-version*]
@param TokenInterface|null $token The token. | [
"Assigns",
"a",
"token",
"to",
"this",
"instance",
"."
] | 45588113b1fca6daf62b776aade8627d08970565 | https://github.com/Dhii/tokenizer-abstract/blob/45588113b1fca6daf62b776aade8627d08970565/src/TokenAwareTrait.php#L41-L48 |
6,524 | bfitech/zapmin | src/AdminStore.php | AdminStore.adm_login | public function adm_login($args) {
$this->init();
$logger = $this->logger;
if ($this->store_is_logged_in())
return [AdminStoreError::USER_ALREADY_LOGGED_IN];
if (!isset($args['post']))
return [AdminStoreError::DATA_INCOMPLETE];
if (!Common::check_idict($args['post'], ['uname', 'upass']))
return [Ad... | php | public function adm_login($args) {
$this->init();
$logger = $this->logger;
if ($this->store_is_logged_in())
return [AdminStoreError::USER_ALREADY_LOGGED_IN];
if (!isset($args['post']))
return [AdminStoreError::DATA_INCOMPLETE];
if (!Common::check_idict($args['post'], ['uname', 'upass']))
return [Ad... | [
"public",
"function",
"adm_login",
"(",
"$",
"args",
")",
"{",
"$",
"this",
"->",
"init",
"(",
")",
";",
"$",
"logger",
"=",
"$",
"this",
"->",
"logger",
";",
"if",
"(",
"$",
"this",
"->",
"store_is_logged_in",
"(",
")",
")",
"return",
"[",
"AdminS... | Sign in.
@param array $args Dict with keys: `uname`, `upass`.
@return array An array of the form:
@code
(array)[
(int errno),
(dict){
'uid': (int uid),
'uname': (string uname),
'token': (string token)
}
]
@endcode | [
"Sign",
"in",
"."
] | 4aebbe0e727328a9632f80b2e6ba4aef6a2fabfe | https://github.com/bfitech/zapmin/blob/4aebbe0e727328a9632f80b2e6ba4aef6a2fabfe/src/AdminStore.php#L39-L96 |
6,525 | bfitech/zapmin | src/AdminStore.php | AdminStore.adm_logout | public function adm_logout() {
if (!$this->store_is_logged_in())
return [AdminStoreError::USER_NOT_LOGGED_IN];
# this just close sessions with current sid, whether it exists
# or not, including the case of account self-deletion
$this->store_close_session($this->user_data['sid']);
# reset status
$this->... | php | public function adm_logout() {
if (!$this->store_is_logged_in())
return [AdminStoreError::USER_NOT_LOGGED_IN];
# this just close sessions with current sid, whether it exists
# or not, including the case of account self-deletion
$this->store_close_session($this->user_data['sid']);
# reset status
$this->... | [
"public",
"function",
"adm_logout",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"store_is_logged_in",
"(",
")",
")",
"return",
"[",
"AdminStoreError",
"::",
"USER_NOT_LOGGED_IN",
"]",
";",
"# this just close sessions with current sid, whether it exists",
"# or n... | Sign out.
@note Using _GET is enough for this operation. | [
"Sign",
"out",
"."
] | 4aebbe0e727328a9632f80b2e6ba4aef6a2fabfe | https://github.com/bfitech/zapmin/blob/4aebbe0e727328a9632f80b2e6ba4aef6a2fabfe/src/AdminStore.php#L103-L121 |
6,526 | bfitech/zapmin | src/AdminStore.php | AdminStore.adm_change_bio | public function adm_change_bio($args) {
if (!$this->store_is_logged_in())
return [AdminStoreError::USER_NOT_LOGGED_IN];
if (!isset($args['post']))
return [AdminStoreError::DATA_INCOMPLETE];
$post = $args['post'];
$vars = [];
foreach (['fname', 'site'] as $key) {
if (!isset($post[$key]))
continue... | php | public function adm_change_bio($args) {
if (!$this->store_is_logged_in())
return [AdminStoreError::USER_NOT_LOGGED_IN];
if (!isset($args['post']))
return [AdminStoreError::DATA_INCOMPLETE];
$post = $args['post'];
$vars = [];
foreach (['fname', 'site'] as $key) {
if (!isset($post[$key]))
continue... | [
"public",
"function",
"adm_change_bio",
"(",
"$",
"args",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"store_is_logged_in",
"(",
")",
")",
"return",
"[",
"AdminStoreError",
"::",
"USER_NOT_LOGGED_IN",
"]",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"args",... | Change user info.
@param array $args Dict with keys: `fname`, `site`.
@manonly
@SuppressWarnings(PHPMD.CyclomaticComplexity)
@SuppressWarnings(PHPMD.NPathComplexity)
@endmanonly | [
"Change",
"user",
"info",
"."
] | 4aebbe0e727328a9632f80b2e6ba4aef6a2fabfe | https://github.com/bfitech/zapmin/blob/4aebbe0e727328a9632f80b2e6ba4aef6a2fabfe/src/AdminStore.php#L204-L262 |
6,527 | bfitech/zapmin | src/AdminStore.php | AdminStore._add_user_verify_name | private function _add_user_verify_name($addname) {
$logger = $this->logger;
# check name, allow multi-byte chars but not whitespace
if (strlen($addname) > 64) {
# max 64 chars
$logger->warning(
"Zapmin: usradd: name invalid: '$addname'.");
return AdminStoreError::USERNAME_TOO_LONG;
}
foreach([" ... | php | private function _add_user_verify_name($addname) {
$logger = $this->logger;
# check name, allow multi-byte chars but not whitespace
if (strlen($addname) > 64) {
# max 64 chars
$logger->warning(
"Zapmin: usradd: name invalid: '$addname'.");
return AdminStoreError::USERNAME_TOO_LONG;
}
foreach([" ... | [
"private",
"function",
"_add_user_verify_name",
"(",
"$",
"addname",
")",
"{",
"$",
"logger",
"=",
"$",
"this",
"->",
"logger",
";",
"# check name, allow multi-byte chars but not whitespace",
"if",
"(",
"strlen",
"(",
"$",
"addname",
")",
">",
"64",
")",
"{",
... | Verify username of new user. | [
"Verify",
"username",
"of",
"new",
"user",
"."
] | 4aebbe0e727328a9632f80b2e6ba4aef6a2fabfe | https://github.com/bfitech/zapmin/blob/4aebbe0e727328a9632f80b2e6ba4aef6a2fabfe/src/AdminStore.php#L276-L302 |
6,528 | bfitech/zapmin | src/AdminStore.php | AdminStore._add_user_verify_email | private function _add_user_verify_email($email, $addname) {
$logger = $this->logger;
if (!self::verify_email_address($email)) {
$logger->warning(sprintf(
"Zapmin: usradd: email invalid: '%s' <- '%s'.",
$addname, $email));
return AdminStoreError::EMAIL_INVALID;
}
if ($this->store->query(
"SELE... | php | private function _add_user_verify_email($email, $addname) {
$logger = $this->logger;
if (!self::verify_email_address($email)) {
$logger->warning(sprintf(
"Zapmin: usradd: email invalid: '%s' <- '%s'.",
$addname, $email));
return AdminStoreError::EMAIL_INVALID;
}
if ($this->store->query(
"SELE... | [
"private",
"function",
"_add_user_verify_email",
"(",
"$",
"email",
",",
"$",
"addname",
")",
"{",
"$",
"logger",
"=",
"$",
"this",
"->",
"logger",
";",
"if",
"(",
"!",
"self",
"::",
"verify_email_address",
"(",
"$",
"email",
")",
")",
"{",
"$",
"logge... | Verify email of new user. | [
"Verify",
"email",
"of",
"new",
"user",
"."
] | 4aebbe0e727328a9632f80b2e6ba4aef6a2fabfe | https://github.com/bfitech/zapmin/blob/4aebbe0e727328a9632f80b2e6ba4aef6a2fabfe/src/AdminStore.php#L307-L328 |
6,529 | bfitech/zapmin | src/AdminStore.php | AdminStore.adm_self_add_user | public function adm_self_add_user(
$args, $pass_twice=null, $email_required=null
) {
if ($this->store_is_logged_in())
return [AdminStoreError::USER_ALREADY_LOGGED_IN];
return $this->adm_add_user(
$args, $pass_twice, true, $email_required);
} | php | public function adm_self_add_user(
$args, $pass_twice=null, $email_required=null
) {
if ($this->store_is_logged_in())
return [AdminStoreError::USER_ALREADY_LOGGED_IN];
return $this->adm_add_user(
$args, $pass_twice, true, $email_required);
} | [
"public",
"function",
"adm_self_add_user",
"(",
"$",
"args",
",",
"$",
"pass_twice",
"=",
"null",
",",
"$",
"email_required",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"store_is_logged_in",
"(",
")",
")",
"return",
"[",
"AdminStoreError",
"::",
... | Self-register.
@note This is just a special case of adm_add_user() with
additional condition: user must not be authenticated.
@param array $args Dict with keys: `addname`, `addpass1`,
and optional `addpass2` unless `$pass_twice` is set to true.
@param bool $pass_twice Whether password must be entered twice.
@param bo... | [
"Self",
"-",
"register",
"."
] | 4aebbe0e727328a9632f80b2e6ba4aef6a2fabfe | https://github.com/bfitech/zapmin/blob/4aebbe0e727328a9632f80b2e6ba4aef6a2fabfe/src/AdminStore.php#L433-L440 |
6,530 | bfitech/zapmin | src/AdminStore.php | AdminStore.adm_self_add_user_passwordless | public function adm_self_add_user_passwordless($args) {
if ($this->store_is_logged_in())
return [AdminStoreError::USER_ALREADY_LOGGED_IN];
# check vars
if (!isset($args['service']))
return [AdminStoreError::DATA_INCOMPLETE];
$uname = $uservice = null;
$service = Common::check_idict($args['service'],
... | php | public function adm_self_add_user_passwordless($args) {
if ($this->store_is_logged_in())
return [AdminStoreError::USER_ALREADY_LOGGED_IN];
# check vars
if (!isset($args['service']))
return [AdminStoreError::DATA_INCOMPLETE];
$uname = $uservice = null;
$service = Common::check_idict($args['service'],
... | [
"public",
"function",
"adm_self_add_user_passwordless",
"(",
"$",
"args",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"store_is_logged_in",
"(",
")",
")",
"return",
"[",
"AdminStoreError",
"::",
"USER_ALREADY_LOGGED_IN",
"]",
";",
"# check vars",
"if",
"(",
"!",
"... | Passwordless self-registration.
This byway registration doesn't differ sign in and sign up.
Use this with caution, e.g. with proper authentication via
OAuth*, SMTP or the like. Unlike add user with password, this
also returns `sid` to associate `session.sid` with a column
on different table.
@param array $args Dict o... | [
"Passwordless",
"self",
"-",
"registration",
"."
] | 4aebbe0e727328a9632f80b2e6ba4aef6a2fabfe | https://github.com/bfitech/zapmin/blob/4aebbe0e727328a9632f80b2e6ba4aef6a2fabfe/src/AdminStore.php#L474-L528 |
6,531 | bfitech/zapmin | src/AdminStore.php | AdminStore.authz_delete_user | public function authz_delete_user($uid) {
$udata = $this->user_data;
if ($udata['uid'] == 1 && $uid != 1)
return true;
if ($udata['uid'] == $uid)
return true;
return false;
} | php | public function authz_delete_user($uid) {
$udata = $this->user_data;
if ($udata['uid'] == 1 && $uid != 1)
return true;
if ($udata['uid'] == $uid)
return true;
return false;
} | [
"public",
"function",
"authz_delete_user",
"(",
"$",
"uid",
")",
"{",
"$",
"udata",
"=",
"$",
"this",
"->",
"user_data",
";",
"if",
"(",
"$",
"udata",
"[",
"'uid'",
"]",
"==",
"1",
"&&",
"$",
"uid",
"!=",
"1",
")",
"return",
"true",
";",
"if",
"(... | Default method to decide if user deletion is allowed.
This succeeds if current user is root, or if it's a case of
self-deletion for non-root user.
@param int $uid User ID to delete. | [
"Default",
"method",
"to",
"decide",
"if",
"user",
"deletion",
"is",
"allowed",
"."
] | 4aebbe0e727328a9632f80b2e6ba4aef6a2fabfe | https://github.com/bfitech/zapmin/blob/4aebbe0e727328a9632f80b2e6ba4aef6a2fabfe/src/AdminStore.php#L538-L545 |
6,532 | bfitech/zapmin | src/AdminStore.php | AdminStore.adm_list_user | public function adm_list_user($args) {
$this->init();
if (!$this->store_is_logged_in())
return [AdminStoreError::USER_NOT_LOGGED_IN];
if (!$this->authz_list_user())
return [AdminStoreError::USER_NOT_AUTHORIZED];
extract($args['post']);
$page = isset($page) ? (int)$page : 0;
if ($page < 0)
$page... | php | public function adm_list_user($args) {
$this->init();
if (!$this->store_is_logged_in())
return [AdminStoreError::USER_NOT_LOGGED_IN];
if (!$this->authz_list_user())
return [AdminStoreError::USER_NOT_AUTHORIZED];
extract($args['post']);
$page = isset($page) ? (int)$page : 0;
if ($page < 0)
$page... | [
"public",
"function",
"adm_list_user",
"(",
"$",
"args",
")",
"{",
"$",
"this",
"->",
"init",
"(",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"store_is_logged_in",
"(",
")",
")",
"return",
"[",
"AdminStoreError",
"::",
"USER_NOT_LOGGED_IN",
"]",
";",
... | List all users.
@param array $args Dict with keys: `page`, `limit`, `order`
where `order` is `ASC` or `DESC`.
@manonly
@SuppressWarnings(PHPMD.CyclomaticComplexity)
@SuppressWarnings(PHPMD.NPathComplexity)
@endmanonly | [
"List",
"all",
"users",
"."
] | 4aebbe0e727328a9632f80b2e6ba4aef6a2fabfe | https://github.com/bfitech/zapmin/blob/4aebbe0e727328a9632f80b2e6ba4aef6a2fabfe/src/AdminStore.php#L614-L646 |
6,533 | edunola13/enolaphp-framework | src/Support/View.php | View.urlFor | function urlFor($internalUri, $locale = NULL){
$internalUri= ltrim($internalUri, '/');
if($locale == NULL)return $this->request->realBaseUrl . $internalUri;
else return $this->request->realBaseUrl . $locale . '/' . $internalUri;
} | php | function urlFor($internalUri, $locale = NULL){
$internalUri= ltrim($internalUri, '/');
if($locale == NULL)return $this->request->realBaseUrl . $internalUri;
else return $this->request->realBaseUrl . $locale . '/' . $internalUri;
} | [
"function",
"urlFor",
"(",
"$",
"internalUri",
",",
"$",
"locale",
"=",
"NULL",
")",
"{",
"$",
"internalUri",
"=",
"ltrim",
"(",
"$",
"internalUri",
",",
"'/'",
")",
";",
"if",
"(",
"$",
"locale",
"==",
"NULL",
")",
"return",
"$",
"this",
"->",
"re... | Arma una url para una URI interna
@param type $internalUri
@param type $locale
@return string | [
"Arma",
"una",
"url",
"para",
"una",
"URI",
"interna"
] | a962bfcd53d7bc129d8c9946aaa71d264285229d | https://github.com/edunola13/enolaphp-framework/blob/a962bfcd53d7bc129d8c9946aaa71d264285229d/src/Support/View.php#L79-L83 |
6,534 | edunola13/enolaphp-framework | src/Support/View.php | View.i18n | function i18n($file, $locale = NULL){
$this->fileName= $file;
$this->i18nContent= NULL;
if($locale != NULL){
if(file_exists(PATHAPP . 'src/content/' . $file . "_$locale" . '.txt')){
$this->i18nContent= \E_fn\load_application_file('src/content/' . $file . "_$locale" . ... | php | function i18n($file, $locale = NULL){
$this->fileName= $file;
$this->i18nContent= NULL;
if($locale != NULL){
if(file_exists(PATHAPP . 'src/content/' . $file . "_$locale" . '.txt')){
$this->i18nContent= \E_fn\load_application_file('src/content/' . $file . "_$locale" . ... | [
"function",
"i18n",
"(",
"$",
"file",
",",
"$",
"locale",
"=",
"NULL",
")",
"{",
"$",
"this",
"->",
"fileName",
"=",
"$",
"file",
";",
"$",
"this",
"->",
"i18nContent",
"=",
"NULL",
";",
"if",
"(",
"$",
"locale",
"!=",
"NULL",
")",
"{",
"if",
"... | Carga un archivo de internacionalizacion. Si no se especifica el locale carga el archivo por defecto, si no
le agrega el locale pasado como parametro
@param string $file
@param string $locale | [
"Carga",
"un",
"archivo",
"de",
"internacionalizacion",
".",
"Si",
"no",
"se",
"especifica",
"el",
"locale",
"carga",
"el",
"archivo",
"por",
"defecto",
"si",
"no",
"le",
"agrega",
"el",
"locale",
"pasado",
"como",
"parametro"
] | a962bfcd53d7bc129d8c9946aaa71d264285229d | https://github.com/edunola13/enolaphp-framework/blob/a962bfcd53d7bc129d8c9946aaa71d264285229d/src/Support/View.php#L132-L147 |
6,535 | edunola13/enolaphp-framework | src/Support/View.php | View.i18n_change_locale | function i18n_change_locale($locale){
if(isset($this->fileName)){
i18n($this->fileName, $locale);
}
else{
\Enola\Error::general_error('I18n Error', 'Before call i18n_change_locale is necesary call i18n');
}
} | php | function i18n_change_locale($locale){
if(isset($this->fileName)){
i18n($this->fileName, $locale);
}
else{
\Enola\Error::general_error('I18n Error', 'Before call i18n_change_locale is necesary call i18n');
}
} | [
"function",
"i18n_change_locale",
"(",
"$",
"locale",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"fileName",
")",
")",
"{",
"i18n",
"(",
"$",
"this",
"->",
"fileName",
",",
"$",
"locale",
")",
";",
"}",
"else",
"{",
"\\",
"Enola",
"\\",
... | Cambia el archivo de internacionalizacion cargado. Lo cambia segun el locale pasado
@param string $locale | [
"Cambia",
"el",
"archivo",
"de",
"internacionalizacion",
"cargado",
".",
"Lo",
"cambia",
"segun",
"el",
"locale",
"pasado"
] | a962bfcd53d7bc129d8c9946aaa71d264285229d | https://github.com/edunola13/enolaphp-framework/blob/a962bfcd53d7bc129d8c9946aaa71d264285229d/src/Support/View.php#L152-L159 |
6,536 | edunola13/enolaphp-framework | src/Support/View.php | View.i18n_value | function i18n_value($val_key, $params = NULL){
if(isset($this->i18nContent)){
if(isset($this->i18nContent[$val_key])){
$mensaje= $this->i18nContent[$val_key];
//Analiza si se pasaron parametros y si se pasaron cambia los valores correspondientes
... | php | function i18n_value($val_key, $params = NULL){
if(isset($this->i18nContent)){
if(isset($this->i18nContent[$val_key])){
$mensaje= $this->i18nContent[$val_key];
//Analiza si se pasaron parametros y si se pasaron cambia los valores correspondientes
... | [
"function",
"i18n_value",
"(",
"$",
"val_key",
",",
"$",
"params",
"=",
"NULL",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"i18nContent",
")",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"i18nContent",
"[",
"$",
"val_key",
"]",... | Devuelve el valor segun el archivo de internacionalizacion que se encuentre cargado
@param string $val_key
@param array $params
@return string | [
"Devuelve",
"el",
"valor",
"segun",
"el",
"archivo",
"de",
"internacionalizacion",
"que",
"se",
"encuentre",
"cargado"
] | a962bfcd53d7bc129d8c9946aaa71d264285229d | https://github.com/edunola13/enolaphp-framework/blob/a962bfcd53d7bc129d8c9946aaa71d264285229d/src/Support/View.php#L166-L183 |
6,537 | vinala/kernel | src/Atomium/Compiler/AtomiumCompileInstruction.php | AtomiumCompileInstruction.openTag | public static function openTag($script, $openTag, $phpOpenTag, $endOpenTag, $phpEndOpenTag)
{
$data = Strings::splite($script, $openTag);
//
$output = $data[0];
//
for ($i = 1; $i < Collection::count($data); $i++) {
$output .= $phpOpenTag;
//
... | php | public static function openTag($script, $openTag, $phpOpenTag, $endOpenTag, $phpEndOpenTag)
{
$data = Strings::splite($script, $openTag);
//
$output = $data[0];
//
for ($i = 1; $i < Collection::count($data); $i++) {
$output .= $phpOpenTag;
//
... | [
"public",
"static",
"function",
"openTag",
"(",
"$",
"script",
",",
"$",
"openTag",
",",
"$",
"phpOpenTag",
",",
"$",
"endOpenTag",
",",
"$",
"phpEndOpenTag",
")",
"{",
"$",
"data",
"=",
"Strings",
"::",
"splite",
"(",
"$",
"script",
",",
"$",
"openTag... | To replace open tag end it's end with PHP tag.
@var string | [
"To",
"replace",
"open",
"tag",
"end",
"it",
"s",
"end",
"with",
"PHP",
"tag",
"."
] | 346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a | https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Atomium/Compiler/AtomiumCompileInstruction.php#L15-L37 |
6,538 | morrelinko/simple-photo | src/Toolbox/ArrayUtils.php | ArrayUtils.hasKeys | public static function hasKeys(array $haystack)
{
$fails = false;
$keys = func_get_args();
array_shift($keys);
foreach ($keys as $key) {
if (!array_key_exists($key, $haystack)) {
$fails = true;
break;
}
}
retur... | php | public static function hasKeys(array $haystack)
{
$fails = false;
$keys = func_get_args();
array_shift($keys);
foreach ($keys as $key) {
if (!array_key_exists($key, $haystack)) {
$fails = true;
break;
}
}
retur... | [
"public",
"static",
"function",
"hasKeys",
"(",
"array",
"$",
"haystack",
")",
"{",
"$",
"fails",
"=",
"false",
";",
"$",
"keys",
"=",
"func_get_args",
"(",
")",
";",
"array_shift",
"(",
"$",
"keys",
")",
";",
"foreach",
"(",
"$",
"keys",
"as",
"$",
... | Ensures that specified keys exists in the array
@param array $haystack
@return bool | [
"Ensures",
"that",
"specified",
"keys",
"exists",
"in",
"the",
"array"
] | be1fbe3139d32eb39e88cff93f847154bb6a8cb2 | https://github.com/morrelinko/simple-photo/blob/be1fbe3139d32eb39e88cff93f847154bb6a8cb2/src/Toolbox/ArrayUtils.php#L34-L48 |
6,539 | 2upmedia/hooky | src/HooksTrait.php | HooksTrait.checkCallable | private static function checkCallable(
$classInstance,
callable $callable,
$method = null
) {
// if there are args and debug mode is on
if ($method && self::$checkCallableParameters) {
$originalMethodReflection = new \ReflectionMethod($classInstance, $method);
... | php | private static function checkCallable(
$classInstance,
callable $callable,
$method = null
) {
// if there are args and debug mode is on
if ($method && self::$checkCallableParameters) {
$originalMethodReflection = new \ReflectionMethod($classInstance, $method);
... | [
"private",
"static",
"function",
"checkCallable",
"(",
"$",
"classInstance",
",",
"callable",
"$",
"callable",
",",
"$",
"method",
"=",
"null",
")",
"{",
"// if there are args and debug mode is on",
"if",
"(",
"$",
"method",
"&&",
"self",
"::",
"$",
"checkCallab... | Currently checks for mismatching parameters
@param object|string $classInstance
@param callable $callable
@param string $method [optional] | [
"Currently",
"checks",
"for",
"mismatching",
"parameters"
] | 06a461762492d2daf77b18c7e3fd8cf6d3fbf97b | https://github.com/2upmedia/hooky/blob/06a461762492d2daf77b18c7e3fd8cf6d3fbf97b/src/HooksTrait.php#L823-L898 |
6,540 | nattreid/app-manager | src/Helpers/Files.php | Files.clearCss | public function clearCss(): void
{
foreach ($this->webLoaderDir as $dir) {
if (file_exists($dir)) {
foreach (Finder::findFiles('*.css')
->exclude('.htaccess', 'web.config')
->in($dir) as $file) {
unlink((string) $file);
}
}
}
} | php | public function clearCss(): void
{
foreach ($this->webLoaderDir as $dir) {
if (file_exists($dir)) {
foreach (Finder::findFiles('*.css')
->exclude('.htaccess', 'web.config')
->in($dir) as $file) {
unlink((string) $file);
}
}
}
} | [
"public",
"function",
"clearCss",
"(",
")",
":",
"void",
"{",
"foreach",
"(",
"$",
"this",
"->",
"webLoaderDir",
"as",
"$",
"dir",
")",
"{",
"if",
"(",
"file_exists",
"(",
"$",
"dir",
")",
")",
"{",
"foreach",
"(",
"Finder",
"::",
"findFiles",
"(",
... | Smaze CSS cache | [
"Smaze",
"CSS",
"cache"
] | 7821d09a0b3e58ba9c6eb81d44e35aacce55de75 | https://github.com/nattreid/app-manager/blob/7821d09a0b3e58ba9c6eb81d44e35aacce55de75/src/Helpers/Files.php#L117-L128 |
6,541 | novuso/system | src/Collection/Chain/SetBucketChain.php | SetBucketChain.current | public function current()
{
if ($this->current instanceof TerminalBucket) {
return null;
}
/** @var ItemBucket $current */
$current = $this->current;
return $current->item();
} | php | public function current()
{
if ($this->current instanceof TerminalBucket) {
return null;
}
/** @var ItemBucket $current */
$current = $this->current;
return $current->item();
} | [
"public",
"function",
"current",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"current",
"instanceof",
"TerminalBucket",
")",
"{",
"return",
"null",
";",
"}",
"/** @var ItemBucket $current */",
"$",
"current",
"=",
"$",
"this",
"->",
"current",
";",
"return"... | Retrieves the item from the current bucket
Returns null if the pointer is not at a valid offset.
@return mixed | [
"Retrieves",
"the",
"item",
"from",
"the",
"current",
"bucket"
] | e34038b391826edc68d0b5fccfba96642de9d6f0 | https://github.com/novuso/system/blob/e34038b391826edc68d0b5fccfba96642de9d6f0/src/Collection/Chain/SetBucketChain.php#L232-L242 |
6,542 | novuso/system | src/Collection/Chain/SetBucketChain.php | SetBucketChain.locate | protected function locate($item): ?ItemBucket
{
for ($this->rewind(); $this->valid(); $this->next()) {
/** @var ItemBucket $current */
$current = $this->current;
if (Validate::areEqual($item, $current->item())) {
return $current;
}
}
... | php | protected function locate($item): ?ItemBucket
{
for ($this->rewind(); $this->valid(); $this->next()) {
/** @var ItemBucket $current */
$current = $this->current;
if (Validate::areEqual($item, $current->item())) {
return $current;
}
}
... | [
"protected",
"function",
"locate",
"(",
"$",
"item",
")",
":",
"?",
"ItemBucket",
"{",
"for",
"(",
"$",
"this",
"->",
"rewind",
"(",
")",
";",
"$",
"this",
"->",
"valid",
"(",
")",
";",
"$",
"this",
"->",
"next",
"(",
")",
")",
"{",
"/** @var Ite... | Locates a bucket by item
Returns null if the item is not found.
@param mixed $item The item
@return ItemBucket|null | [
"Locates",
"a",
"bucket",
"by",
"item"
] | e34038b391826edc68d0b5fccfba96642de9d6f0 | https://github.com/novuso/system/blob/e34038b391826edc68d0b5fccfba96642de9d6f0/src/Collection/Chain/SetBucketChain.php#L279-L290 |
6,543 | novuso/system | src/Collection/Chain/SetBucketChain.php | SetBucketChain.insertBetween | protected function insertBetween($item, Bucket $prev, Bucket $next): void
{
$bucket = new ItemBucket($item);
$prev->setNext($bucket);
$next->setPrev($bucket);
$bucket->setPrev($prev);
$bucket->setNext($next);
$this->current = $bucket;
$this->count++;
} | php | protected function insertBetween($item, Bucket $prev, Bucket $next): void
{
$bucket = new ItemBucket($item);
$prev->setNext($bucket);
$next->setPrev($bucket);
$bucket->setPrev($prev);
$bucket->setNext($next);
$this->current = $bucket;
$this->count++;
} | [
"protected",
"function",
"insertBetween",
"(",
"$",
"item",
",",
"Bucket",
"$",
"prev",
",",
"Bucket",
"$",
"next",
")",
":",
"void",
"{",
"$",
"bucket",
"=",
"new",
"ItemBucket",
"(",
"$",
"item",
")",
";",
"$",
"prev",
"->",
"setNext",
"(",
"$",
... | Inserts an item between two nodes
@param mixed $item The item
@param Bucket $prev The previous bucket
@param Bucket $next The next bucket
@return void | [
"Inserts",
"an",
"item",
"between",
"two",
"nodes"
] | e34038b391826edc68d0b5fccfba96642de9d6f0 | https://github.com/novuso/system/blob/e34038b391826edc68d0b5fccfba96642de9d6f0/src/Collection/Chain/SetBucketChain.php#L319-L331 |
6,544 | webriq/core | module/Core/src/Grid/Core/View/Helper/ViewWidget.php | ViewWidget.addWidget | public function addWidget( $widget, $service, $priority = null )
{
if ( ! isset( $this->widgets[$widget] ) )
{
$this->widgets[$widget] = new PriorityQueue;
}
if ( ! is_a( $service, static::WIDGET_INTERFACE, true ) )
{
throw new \InvalidArgumentExcepti... | php | public function addWidget( $widget, $service, $priority = null )
{
if ( ! isset( $this->widgets[$widget] ) )
{
$this->widgets[$widget] = new PriorityQueue;
}
if ( ! is_a( $service, static::WIDGET_INTERFACE, true ) )
{
throw new \InvalidArgumentExcepti... | [
"public",
"function",
"addWidget",
"(",
"$",
"widget",
",",
"$",
"service",
",",
"$",
"priority",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"widgets",
"[",
"$",
"widget",
"]",
")",
")",
"{",
"$",
"this",
"->",
"widge... | Add a widget
@param string $widget
@param string $service
@param int|null $priority
@return ViewWidget | [
"Add",
"a",
"widget"
] | cfeb6e8a4732561c2215ec94e736c07f9b8bc990 | https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Core/src/Grid/Core/View/Helper/ViewWidget.php#L59-L81 |
6,545 | codenamephp/prototype.utils | src/main/php/de/codenamephp/prototype/utils/answerCollector/FromSerializedArrayFile.php | FromSerializedArrayFile.getAnswers | public function getAnswers(\SplFileInfo $file): array {
if($file->isReadable()) {
return unserialize($file->openFile()->fread($file->getSize()));
}
throw new \InvalidArgumentException(sprintf('Given file does not exist or is not readable: "%s"', $file->getPathname()));
} | php | public function getAnswers(\SplFileInfo $file): array {
if($file->isReadable()) {
return unserialize($file->openFile()->fread($file->getSize()));
}
throw new \InvalidArgumentException(sprintf('Given file does not exist or is not readable: "%s"', $file->getPathname()));
} | [
"public",
"function",
"getAnswers",
"(",
"\\",
"SplFileInfo",
"$",
"file",
")",
":",
"array",
"{",
"if",
"(",
"$",
"file",
"->",
"isReadable",
"(",
")",
")",
"{",
"return",
"unserialize",
"(",
"$",
"file",
"->",
"openFile",
"(",
")",
"->",
"fread",
"... | Checks if the given file is readable. If so, the file is read an unserialized. No further checking of the content is performed!
If the file is not readable (e.g. it does not exist or has no read permissions) a \InvalidArgumentException is thrown.
@param \SplFileInfo $file The file to read the serialized array from
@r... | [
"Checks",
"if",
"the",
"given",
"file",
"is",
"readable",
".",
"If",
"so",
"the",
"file",
"is",
"read",
"an",
"unserialized",
".",
"No",
"further",
"checking",
"of",
"the",
"content",
"is",
"performed!"
] | aeb81e1e03624534e8b3e38d6466efda04e435d6 | https://github.com/codenamephp/prototype.utils/blob/aeb81e1e03624534e8b3e38d6466efda04e435d6/src/main/php/de/codenamephp/prototype/utils/answerCollector/FromSerializedArrayFile.php#L41-L46 |
6,546 | titon/g11n | src/Titon/G11n/Locale.php | Locale.addResourcePath | public function addResourcePath($domain, $path) {
$code = $this->getCode();
$this->getLocaleBundle()->addPath($domain, sprintf('%s/locales/%s', $path, $code));
$this->getMessageBundle()->addPaths($domain, [
sprintf('%s/messages/%s', $path, $code),
sprintf('%s/messages/%... | php | public function addResourcePath($domain, $path) {
$code = $this->getCode();
$this->getLocaleBundle()->addPath($domain, sprintf('%s/locales/%s', $path, $code));
$this->getMessageBundle()->addPaths($domain, [
sprintf('%s/messages/%s', $path, $code),
sprintf('%s/messages/%... | [
"public",
"function",
"addResourcePath",
"(",
"$",
"domain",
",",
"$",
"path",
")",
"{",
"$",
"code",
"=",
"$",
"this",
"->",
"getCode",
"(",
")",
";",
"$",
"this",
"->",
"getLocaleBundle",
"(",
")",
"->",
"addPath",
"(",
"$",
"domain",
",",
"sprintf... | Add resource path lookups for locales and messages.
@param string $domain
@param string $path
@return $this | [
"Add",
"resource",
"path",
"lookups",
"for",
"locales",
"and",
"messages",
"."
] | 4b3192055c868167f557b7fb58c37ea620de8df3 | https://github.com/titon/g11n/blob/4b3192055c868167f557b7fb58c37ea620de8df3/src/Titon/G11n/Locale.php#L80-L91 |
6,547 | titon/g11n | src/Titon/G11n/Locale.php | Locale.initialize | public function initialize() {
if ($data = $this->getLocaleBundle()->loadResource(null, 'locale')) {
$data = \Locale::parseLocale($data['code']) + $data;
$config = $this->allConfig();
unset($config['code'], $config['initialize']);
$this->addConfig($config + $dat... | php | public function initialize() {
if ($data = $this->getLocaleBundle()->loadResource(null, 'locale')) {
$data = \Locale::parseLocale($data['code']) + $data;
$config = $this->allConfig();
unset($config['code'], $config['initialize']);
$this->addConfig($config + $dat... | [
"public",
"function",
"initialize",
"(",
")",
"{",
"if",
"(",
"$",
"data",
"=",
"$",
"this",
"->",
"getLocaleBundle",
"(",
")",
"->",
"loadResource",
"(",
"null",
",",
"'locale'",
")",
")",
"{",
"$",
"data",
"=",
"\\",
"Locale",
"::",
"parseLocale",
... | Instantiate the locale and message bundles using the resource paths.
@uses Locale
@uses Titon\Common\Config
@return $this | [
"Instantiate",
"the",
"locale",
"and",
"message",
"bundles",
"using",
"the",
"resource",
"paths",
"."
] | 4b3192055c868167f557b7fb58c37ea620de8df3 | https://github.com/titon/g11n/blob/4b3192055c868167f557b7fb58c37ea620de8df3/src/Titon/G11n/Locale.php#L116-L130 |
6,548 | titon/g11n | src/Titon/G11n/Locale.php | Locale.getParentLocale | public function getParentLocale() {
if ($this->_parent) {
return $this->_parent;
}
if (!$this->hasConfig('parent')) {
return null;
}
$parent = new Locale($this->getConfig('parent'));
$parent->initialize();
// Merge parent config
... | php | public function getParentLocale() {
if ($this->_parent) {
return $this->_parent;
}
if (!$this->hasConfig('parent')) {
return null;
}
$parent = new Locale($this->getConfig('parent'));
$parent->initialize();
// Merge parent config
... | [
"public",
"function",
"getParentLocale",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_parent",
")",
"{",
"return",
"$",
"this",
"->",
"_parent",
";",
"}",
"if",
"(",
"!",
"$",
"this",
"->",
"hasConfig",
"(",
"'parent'",
")",
")",
"{",
"return",
"... | Return the parent locale if it exists.
@uses Titon\G11n\Locale
@return \Titon\G11n\Locale | [
"Return",
"the",
"parent",
"locale",
"if",
"it",
"exists",
"."
] | 4b3192055c868167f557b7fb58c37ea620de8df3 | https://github.com/titon/g11n/blob/4b3192055c868167f557b7fb58c37ea620de8df3/src/Titon/G11n/Locale.php#L184-L202 |
6,549 | titon/g11n | src/Titon/G11n/Locale.php | Locale._loadResource | protected function _loadResource($resource) {
return $this->cache([__METHOD__, $resource], function() use ($resource) {
$data = $this->getLocaleBundle()->loadResource(null, $resource);
if ($parent = $this->getParentLocale()) {
$data = array_merge(
$pa... | php | protected function _loadResource($resource) {
return $this->cache([__METHOD__, $resource], function() use ($resource) {
$data = $this->getLocaleBundle()->loadResource(null, $resource);
if ($parent = $this->getParentLocale()) {
$data = array_merge(
$pa... | [
"protected",
"function",
"_loadResource",
"(",
"$",
"resource",
")",
"{",
"return",
"$",
"this",
"->",
"cache",
"(",
"[",
"__METHOD__",
",",
"$",
"resource",
"]",
",",
"function",
"(",
")",
"use",
"(",
"$",
"resource",
")",
"{",
"$",
"data",
"=",
"$"... | Load a resource from the locale bundle and merge with the parent if possible.
@param string $resource
@return array | [
"Load",
"a",
"resource",
"from",
"the",
"locale",
"bundle",
"and",
"merge",
"with",
"the",
"parent",
"if",
"possible",
"."
] | 4b3192055c868167f557b7fb58c37ea620de8df3 | https://github.com/titon/g11n/blob/4b3192055c868167f557b7fb58c37ea620de8df3/src/Titon/G11n/Locale.php#L228-L241 |
6,550 | needle-project/common | src/Util/ErrorToExceptionConverter.php | ErrorToExceptionConverter.convertErrorsToExceptions | public function convertErrorsToExceptions($level = null, $exceptionClass = null)
{
$this->isHandledLocal = true;
if (is_null($level)) {
$level = E_ALL;
}
if (is_null($exceptionClass)) {
$exceptionClass = static::EXCEPTION_THROW_CLASS;
}
set_err... | php | public function convertErrorsToExceptions($level = null, $exceptionClass = null)
{
$this->isHandledLocal = true;
if (is_null($level)) {
$level = E_ALL;
}
if (is_null($exceptionClass)) {
$exceptionClass = static::EXCEPTION_THROW_CLASS;
}
set_err... | [
"public",
"function",
"convertErrorsToExceptions",
"(",
"$",
"level",
"=",
"null",
",",
"$",
"exceptionClass",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"isHandledLocal",
"=",
"true",
";",
"if",
"(",
"is_null",
"(",
"$",
"level",
")",
")",
"{",
"$",
"l... | Converts errors to exceptions
@param int|null $level The error level to be handled.
See http://php.net/manual/en/errorfunc.constants.php
@param string|null $exceptionClass | [
"Converts",
"errors",
"to",
"exceptions"
] | 07630d51a7d4ffe31e3d39e8fa3b106055290dad | https://github.com/needle-project/common/blob/07630d51a7d4ffe31e3d39e8fa3b106055290dad/src/Util/ErrorToExceptionConverter.php#L38-L53 |
6,551 | vincenttouzet/AdminConfigurationBundle | Manager/ConfigValueManager.php | ConfigValueManager.set | public function set($path, $value)
{
$configValue = $this->getRepository()->findOneByPath($path);
if ($configValue) {
$configValue->setValue($value);
$this->update($configValue);
}
} | php | public function set($path, $value)
{
$configValue = $this->getRepository()->findOneByPath($path);
if ($configValue) {
$configValue->setValue($value);
$this->update($configValue);
}
} | [
"public",
"function",
"set",
"(",
"$",
"path",
",",
"$",
"value",
")",
"{",
"$",
"configValue",
"=",
"$",
"this",
"->",
"getRepository",
"(",
")",
"->",
"findOneByPath",
"(",
"$",
"path",
")",
";",
"if",
"(",
"$",
"configValue",
")",
"{",
"$",
"con... | Set the value of config value
@param string $path [description]
@param string $value [description]
@return null | [
"Set",
"the",
"value",
"of",
"config",
"value"
] | 8e7edd0810d88aa1d1be4bd303bcc14cbfd0caeb | https://github.com/vincenttouzet/AdminConfigurationBundle/blob/8e7edd0810d88aa1d1be4bd303bcc14cbfd0caeb/Manager/ConfigValueManager.php#L54-L61 |
6,552 | Silvestra/Silvestra | src/Silvestra/Component/Banner/BannerZoneSynchronizer.php | BannerZoneSynchronizer.synchronize | public function synchronize($locale)
{
$existingSystemZones = $this->manager->findSystemSlugs();
$newZones = array();
foreach ($this->registry->getConfigs() as $config) {
if (false === in_array($config->getSlug(), $existingSystemZones)) {
$newZones[] = $this->cre... | php | public function synchronize($locale)
{
$existingSystemZones = $this->manager->findSystemSlugs();
$newZones = array();
foreach ($this->registry->getConfigs() as $config) {
if (false === in_array($config->getSlug(), $existingSystemZones)) {
$newZones[] = $this->cre... | [
"public",
"function",
"synchronize",
"(",
"$",
"locale",
")",
"{",
"$",
"existingSystemZones",
"=",
"$",
"this",
"->",
"manager",
"->",
"findSystemSlugs",
"(",
")",
";",
"$",
"newZones",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"... | Synchronize system banner zones.
@param string $locale | [
"Synchronize",
"system",
"banner",
"zones",
"."
] | b7367601b01495ae3c492b42042f804dee13ab06 | https://github.com/Silvestra/Silvestra/blob/b7367601b01495ae3c492b42042f804dee13ab06/src/Silvestra/Component/Banner/BannerZoneSynchronizer.php#L76-L94 |
6,553 | Silvestra/Silvestra | src/Silvestra/Component/Banner/BannerZoneSynchronizer.php | BannerZoneSynchronizer.createZone | private function createZone(BannerZoneConfig $config)
{
list($width, $height) = $config->getSize();
$zone = $this->manager->create();
$name = $config->getName();
if ($config->getTranslationDomain()) {
$name = $this->translator->trans($name, array(), $config->getTranslati... | php | private function createZone(BannerZoneConfig $config)
{
list($width, $height) = $config->getSize();
$zone = $this->manager->create();
$name = $config->getName();
if ($config->getTranslationDomain()) {
$name = $this->translator->trans($name, array(), $config->getTranslati... | [
"private",
"function",
"createZone",
"(",
"BannerZoneConfig",
"$",
"config",
")",
"{",
"list",
"(",
"$",
"width",
",",
"$",
"height",
")",
"=",
"$",
"config",
"->",
"getSize",
"(",
")",
";",
"$",
"zone",
"=",
"$",
"this",
"->",
"manager",
"->",
"crea... | Create banner zone.
@param BannerZoneConfig $config
@return BannerZoneInterface | [
"Create",
"banner",
"zone",
"."
] | b7367601b01495ae3c492b42042f804dee13ab06 | https://github.com/Silvestra/Silvestra/blob/b7367601b01495ae3c492b42042f804dee13ab06/src/Silvestra/Component/Banner/BannerZoneSynchronizer.php#L103-L122 |
6,554 | Celarius/nofuzz-framework | src/Application.php | Application.createLogger | protected function createLogger(string $loggerName)
{
# Create the Logger Object
$this->logger = new \Nofuzz\Log\Logger($loggerName);
# Get the conf options
$logLevel = $this->getConfig()->get('log.level','error');
$logDriver = $this->getConfig()->get('log.driver','file');
$logDateFormat = $... | php | protected function createLogger(string $loggerName)
{
# Create the Logger Object
$this->logger = new \Nofuzz\Log\Logger($loggerName);
# Get the conf options
$logLevel = $this->getConfig()->get('log.level','error');
$logDriver = $this->getConfig()->get('log.driver','file');
$logDateFormat = $... | [
"protected",
"function",
"createLogger",
"(",
"string",
"$",
"loggerName",
")",
"{",
"# Create the Logger Object",
"$",
"this",
"->",
"logger",
"=",
"new",
"\\",
"Nofuzz",
"\\",
"Log",
"\\",
"Logger",
"(",
"$",
"loggerName",
")",
";",
"# Get the conf options",
... | Creates and Initializes the Logger
@return self | [
"Creates",
"and",
"Initializes",
"the",
"Logger"
] | 867c5150baa431e8f800624a26ba80e95eebd4e5 | https://github.com/Celarius/nofuzz-framework/blob/867c5150baa431e8f800624a26ba80e95eebd4e5/src/Application.php#L111-L151 |
6,555 | Celarius/nofuzz-framework | src/Application.php | Application.loadRoutes | protected function loadRoutes(string $filename)
{
$filename = realpath($filename);
if ( file_exists($filename) ) {
$routesFile = json_decode( file_get_contents($filename), true );
if ($routesFile) {
$routeGroups = $routesFile['groups'] ?? [];
# Add each RouteGroup
foreach ... | php | protected function loadRoutes(string $filename)
{
$filename = realpath($filename);
if ( file_exists($filename) ) {
$routesFile = json_decode( file_get_contents($filename), true );
if ($routesFile) {
$routeGroups = $routesFile['groups'] ?? [];
# Add each RouteGroup
foreach ... | [
"protected",
"function",
"loadRoutes",
"(",
"string",
"$",
"filename",
")",
"{",
"$",
"filename",
"=",
"realpath",
"(",
"$",
"filename",
")",
";",
"if",
"(",
"file_exists",
"(",
"$",
"filename",
")",
")",
"{",
"$",
"routesFile",
"=",
"json_decode",
"(",
... | Load the "routes.json" and create all RouteGroups
@param string $filename [description]
@return bool | [
"Load",
"the",
"routes",
".",
"json",
"and",
"create",
"all",
"RouteGroups"
] | 867c5150baa431e8f800624a26ba80e95eebd4e5 | https://github.com/Celarius/nofuzz-framework/blob/867c5150baa431e8f800624a26ba80e95eebd4e5/src/Application.php#L411-L444 |
6,556 | Celarius/nofuzz-framework | src/Application.php | Application.existsRouteGroup | public function existsRouteGroup(string $groupName): bool
{
foreach ($this->routeGroups as $routeGroup)
{
if ( strcasecmp($routeGroup->getName(),$groupName)==0 ) {
return true;
}
}
return false;
} | php | public function existsRouteGroup(string $groupName): bool
{
foreach ($this->routeGroups as $routeGroup)
{
if ( strcasecmp($routeGroup->getName(),$groupName)==0 ) {
return true;
}
}
return false;
} | [
"public",
"function",
"existsRouteGroup",
"(",
"string",
"$",
"groupName",
")",
":",
"bool",
"{",
"foreach",
"(",
"$",
"this",
"->",
"routeGroups",
"as",
"$",
"routeGroup",
")",
"{",
"if",
"(",
"strcasecmp",
"(",
"$",
"routeGroup",
"->",
"getName",
"(",
... | Checks if a RouteGroup exists
@param string $groupName [description]
@return bool | [
"Checks",
"if",
"a",
"RouteGroup",
"exists"
] | 867c5150baa431e8f800624a26ba80e95eebd4e5 | https://github.com/Celarius/nofuzz-framework/blob/867c5150baa431e8f800624a26ba80e95eebd4e5/src/Application.php#L480-L490 |
6,557 | sharkodlak/php-gettext | src/SprintfTranslatorDecorator.php | SprintfTranslatorDecorator.gettext | public function gettext($message) {
$args = func_get_args();
$methodArgsNumber = 1;
$message = $this->callMethodAndSprintf(__FUNCTION__, $args, $methodArgsNumber);
return $message;
} | php | public function gettext($message) {
$args = func_get_args();
$methodArgsNumber = 1;
$message = $this->callMethodAndSprintf(__FUNCTION__, $args, $methodArgsNumber);
return $message;
} | [
"public",
"function",
"gettext",
"(",
"$",
"message",
")",
"{",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"$",
"methodArgsNumber",
"=",
"1",
";",
"$",
"message",
"=",
"$",
"this",
"->",
"callMethodAndSprintf",
"(",
"__FUNCTION__",
",",
"$",
"args... | Call sprintf on the translation result.
@param string $message Message to translate (in singular form).
@param mixed $arg,... First argument that will be formated according to
format specified in translated $message. | [
"Call",
"sprintf",
"on",
"the",
"translation",
"result",
"."
] | 383162b6cd4d3f33787f7cc614dafe5509b4924d | https://github.com/sharkodlak/php-gettext/blob/383162b6cd4d3f33787f7cc614dafe5509b4924d/src/SprintfTranslatorDecorator.php#L57-L62 |
6,558 | MattRWallace/Exegesis | annotationparser.php | AnnotationParser.getAnnotationArray | public function getAnnotationArray() {
// lazy instantiation of the annotations array
if (empty($this->annotations)) {
// custom parser?
if (self::$parser) {
$parser = new self::$parser($this->docs);
$this->annotations = $parser->getAnnotationArray();
}
// use built in parser
else
$this->... | php | public function getAnnotationArray() {
// lazy instantiation of the annotations array
if (empty($this->annotations)) {
// custom parser?
if (self::$parser) {
$parser = new self::$parser($this->docs);
$this->annotations = $parser->getAnnotationArray();
}
// use built in parser
else
$this->... | [
"public",
"function",
"getAnnotationArray",
"(",
")",
"{",
"// lazy instantiation of the annotations array",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"annotations",
")",
")",
"{",
"// custom parser?",
"if",
"(",
"self",
"::",
"$",
"parser",
")",
"{",
"$",
"... | Returns an array of the parsed annotations
@access public
@return void | [
"Returns",
"an",
"array",
"of",
"the",
"parsed",
"annotations"
] | 8e7ba6494fa2ab4f0b9dcfb14015f967c40464d4 | https://github.com/MattRWallace/Exegesis/blob/8e7ba6494fa2ab4f0b9dcfb14015f967c40464d4/annotationparser.php#L160-L173 |
6,559 | wasabi-cms/core | src/Nav.php | Nav.getMenu | public static function getMenu($alias, $ordered = false)
{
if (!isset(self::$_menus[$alias])) {
throw new Exception(__d('wasabi_core', 'No menu with alias "{0}" does exist.', $alias));
}
if (!$ordered) {
return self::$_menus[$alias];
}
return self::$_... | php | public static function getMenu($alias, $ordered = false)
{
if (!isset(self::$_menus[$alias])) {
throw new Exception(__d('wasabi_core', 'No menu with alias "{0}" does exist.', $alias));
}
if (!$ordered) {
return self::$_menus[$alias];
}
return self::$_... | [
"public",
"static",
"function",
"getMenu",
"(",
"$",
"alias",
",",
"$",
"ordered",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"_menus",
"[",
"$",
"alias",
"]",
")",
")",
"{",
"throw",
"new",
"Exception",
"(",
"__d",
... | Get a Menu instance or an ordered array
of menu items of a menu.
@param string $alias the alias of the menu
@param bool $ordered true: return array of priority ordered menu items, false: return WasabiMenu instance
@throws Exception
@return array|Menu | [
"Get",
"a",
"Menu",
"instance",
"or",
"an",
"ordered",
"array",
"of",
"menu",
"items",
"of",
"a",
"menu",
"."
] | 0eadbb64d2fc201bacc63c93814adeca70e08f90 | https://github.com/wasabi-cms/core/blob/0eadbb64d2fc201bacc63c93814adeca70e08f90/src/Nav.php#L53-L63 |
6,560 | phlexible/indexer-bundle | Storage/Operation/Operator.php | Operator.queue | public function queue(Operations $operations)
{
foreach ($operations->getOperations() as $operation) {
if ($operation instanceof AddDocumentOperation) {
$identity = $operation->getDocument()->getIdentity();
$job = new Job('indexer:add', array((string) $identity));... | php | public function queue(Operations $operations)
{
foreach ($operations->getOperations() as $operation) {
if ($operation instanceof AddDocumentOperation) {
$identity = $operation->getDocument()->getIdentity();
$job = new Job('indexer:add', array((string) $identity));... | [
"public",
"function",
"queue",
"(",
"Operations",
"$",
"operations",
")",
"{",
"foreach",
"(",
"$",
"operations",
"->",
"getOperations",
"(",
")",
"as",
"$",
"operation",
")",
"{",
"if",
"(",
"$",
"operation",
"instanceof",
"AddDocumentOperation",
")",
"{",
... | Queue operations.
@param Operations $operations
@return bool | [
"Queue",
"operations",
"."
] | 5c568d056f6c71f7cb80a7ff9e36d35bc487f7f8 | https://github.com/phlexible/indexer-bundle/blob/5c568d056f6c71f7cb80a7ff9e36d35bc487f7f8/Storage/Operation/Operator.php#L69-L110 |
6,561 | phlexible/indexer-bundle | Storage/Operation/Operator.php | Operator.execute | public function execute(StorageInterface $storage, Operations $operations)
{
foreach ($operations->getOperations() as $operation) {
if ($operation instanceof AddDocumentOperation) {
$document = $operation->getDocument();
$event = new DocumentEvent($document);
... | php | public function execute(StorageInterface $storage, Operations $operations)
{
foreach ($operations->getOperations() as $operation) {
if ($operation instanceof AddDocumentOperation) {
$document = $operation->getDocument();
$event = new DocumentEvent($document);
... | [
"public",
"function",
"execute",
"(",
"StorageInterface",
"$",
"storage",
",",
"Operations",
"$",
"operations",
")",
"{",
"foreach",
"(",
"$",
"operations",
"->",
"getOperations",
"(",
")",
"as",
"$",
"operation",
")",
"{",
"if",
"(",
"$",
"operation",
"in... | Execute operations.
@param StorageInterface $storage
@param Operations $operations
@return bool | [
"Execute",
"operations",
"."
] | 5c568d056f6c71f7cb80a7ff9e36d35bc487f7f8 | https://github.com/phlexible/indexer-bundle/blob/5c568d056f6c71f7cb80a7ff9e36d35bc487f7f8/Storage/Operation/Operator.php#L120-L179 |
6,562 | elastification/php-client | src/ClientVersionMap.php | ClientVersionMap.getVersion | public function getVersion($version)
{
foreach ($this->versions as $versionPattern) {
if (preg_match($versionPattern['regex'], $version)) {
return $versionPattern['version'];
}
}
throw new VersionException('Version not found');
} | php | public function getVersion($version)
{
foreach ($this->versions as $versionPattern) {
if (preg_match($versionPattern['regex'], $version)) {
return $versionPattern['version'];
}
}
throw new VersionException('Version not found');
} | [
"public",
"function",
"getVersion",
"(",
"$",
"version",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"versions",
"as",
"$",
"versionPattern",
")",
"{",
"if",
"(",
"preg_match",
"(",
"$",
"versionPattern",
"[",
"'regex'",
"]",
",",
"$",
"version",
")",
... | Get the defined version for folders.
We throw an exception in case of a non-matching version.
@param string $version A version string in the schema of 0.90.x.
@return string The internal namespace/folder
@throws VersionException
@author Daniel Wendlandt | [
"Get",
"the",
"defined",
"version",
"for",
"folders",
".",
"We",
"throw",
"an",
"exception",
"in",
"case",
"of",
"a",
"non",
"-",
"matching",
"version",
"."
] | eb01be0905dd1eba7baa62f84492d82e4b3cae61 | https://github.com/elastification/php-client/blob/eb01be0905dd1eba7baa62f84492d82e4b3cae61/src/ClientVersionMap.php#L49-L59 |
6,563 | AnonymPHP/Anonym-Library | src/Anonym/View/LanguageManager.php | LanguageManager.getLanguage | public function getLanguage($file = '')
{
$path = $this->path . DIRECTORY_SEPARATOR . $file . '.php';
if (file_exists($path)) {
$variables = require $path;
return $variables;
} else {
return false;
}
} | php | public function getLanguage($file = '')
{
$path = $this->path . DIRECTORY_SEPARATOR . $file . '.php';
if (file_exists($path)) {
$variables = require $path;
return $variables;
} else {
return false;
}
} | [
"public",
"function",
"getLanguage",
"(",
"$",
"file",
"=",
"''",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"path",
".",
"DIRECTORY_SEPARATOR",
".",
"$",
"file",
".",
"'.php'",
";",
"if",
"(",
"file_exists",
"(",
"$",
"path",
")",
")",
"{",
"$... | get the language variables with file path
@param string $file the file name
@return array|bool registered varibles on file | [
"get",
"the",
"language",
"variables",
"with",
"file",
"path"
] | c967ad804f84e8fb204593a0959cda2fed5ae075 | https://github.com/AnonymPHP/Anonym-Library/blob/c967ad804f84e8fb204593a0959cda2fed5ae075/src/Anonym/View/LanguageManager.php#L41-L50 |
6,564 | synapsestudios/synapse-base | src/Synapse/Application/Services.php | Services.registerSecurityFirewalls | public function registerSecurityFirewalls(Application $app)
{
$app['security.firewalls'] = $app->share(function () {
return [
'base.api' => [
'pattern' => '^/',
'oauth' => true,
],
];
});
$app[... | php | public function registerSecurityFirewalls(Application $app)
{
$app['security.firewalls'] = $app->share(function () {
return [
'base.api' => [
'pattern' => '^/',
'oauth' => true,
],
];
});
$app[... | [
"public",
"function",
"registerSecurityFirewalls",
"(",
"Application",
"$",
"app",
")",
"{",
"$",
"app",
"[",
"'security.firewalls'",
"]",
"=",
"$",
"app",
"->",
"share",
"(",
"function",
"(",
")",
"{",
"return",
"[",
"'base.api'",
"=>",
"[",
"'pattern'",
... | Register the security firewalls for use with the Security Context in SecurityServiceProvider
How to add application-specific firewalls:
$app->extend('security.firewalls', function ($firewalls, $app) {
$newFirewalls = [...];
return array_merge($newFirewalls, $firewalls);
});
It's important to return an array with $f... | [
"Register",
"the",
"security",
"firewalls",
"for",
"use",
"with",
"the",
"Security",
"Context",
"in",
"SecurityServiceProvider"
] | 60c830550491742a077ab063f924e2f0b63825da | https://github.com/synapsestudios/synapse-base/blob/60c830550491742a077ab063f924e2f0b63825da/src/Synapse/Application/Services.php#L110-L124 |
6,565 | artscorestudio/website-bundle | Controller/PublicController.php | PublicController.pageAction | public function pageAction($path)
{
$parts = explode('/', $path);
$result = $this->get('asf_document.page.manager')->getRepository()->findBySlug($path);
if ( count($result) == 0 ) {
throw new NotFoundHttpException('Ooops ! Page not found.');
}
$page = $result[0];
... | php | public function pageAction($path)
{
$parts = explode('/', $path);
$result = $this->get('asf_document.page.manager')->getRepository()->findBySlug($path);
if ( count($result) == 0 ) {
throw new NotFoundHttpException('Ooops ! Page not found.');
}
$page = $result[0];
... | [
"public",
"function",
"pageAction",
"(",
"$",
"path",
")",
"{",
"$",
"parts",
"=",
"explode",
"(",
"'/'",
",",
"$",
"path",
")",
";",
"$",
"result",
"=",
"$",
"this",
"->",
"get",
"(",
"'asf_document.page.manager'",
")",
"->",
"getRepository",
"(",
")"... | Website Page Controller
@param string $path
@throws \Exception
@return \Symfony\Component\HttpFoundation\Response | [
"Website",
"Page",
"Controller"
] | 016d62d7558cd8c2fe821ae2645735149c5e6ee5 | https://github.com/artscorestudio/website-bundle/blob/016d62d7558cd8c2fe821ae2645735149c5e6ee5/Controller/PublicController.php#L40-L55 |
6,566 | easy-system/es-models | src/ValueObject.php | ValueObject.getItem | public function getItem($key, $default = null)
{
if (isset($this->container[$key])) {
return $this->container[$key];
}
return $default;
} | php | public function getItem($key, $default = null)
{
if (isset($this->container[$key])) {
return $this->container[$key];
}
return $default;
} | [
"public",
"function",
"getItem",
"(",
"$",
"key",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"container",
"[",
"$",
"key",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"container",
"[",
"$",
"key",... | Gets the item value.
@param int|string $key The key of item
@param mixed $default Optional; null by default. The default value
@return mixed Returns the item value, if any, $default otherwise | [
"Gets",
"the",
"item",
"value",
"."
] | e03b2d3b4de70b02090ec0a74ae37d1b8a231d4e | https://github.com/easy-system/es-models/blob/e03b2d3b4de70b02090ec0a74ae37d1b8a231d4e/src/ValueObject.php#L58-L65 |
6,567 | easy-system/es-container | src/Merging/MergingTrait.php | MergingTrait.merge | public function merge($source)
{
if ($source instanceof MergingInterface) {
$source = $source->toArray();
} elseif ($source instanceof Traversable) {
$source = iterator_to_array($source);
} elseif ($source instanceof \stdClass) {
$source = (array) $source;... | php | public function merge($source)
{
if ($source instanceof MergingInterface) {
$source = $source->toArray();
} elseif ($source instanceof Traversable) {
$source = iterator_to_array($source);
} elseif ($source instanceof \stdClass) {
$source = (array) $source;... | [
"public",
"function",
"merge",
"(",
"$",
"source",
")",
"{",
"if",
"(",
"$",
"source",
"instanceof",
"MergingInterface",
")",
"{",
"$",
"source",
"=",
"$",
"source",
"->",
"toArray",
"(",
")",
";",
"}",
"elseif",
"(",
"$",
"source",
"instanceof",
"Trav... | Merges data from other data sources.
Any available data source will be converted into an array.
The values, that have an string keys, will be overwritten.
The values, that have an integer keys, will be added.
Any object that presents in the data source and implements the
MergingInterface, will be converted into array.... | [
"Merges",
"data",
"from",
"other",
"data",
"sources",
"."
] | 0e917d8ff2c3622f53b82d34436295539858be7d | https://github.com/easy-system/es-container/blob/0e917d8ff2c3622f53b82d34436295539858be7d/src/Merging/MergingTrait.php#L38-L53 |
6,568 | easy-system/es-container | src/Merging/MergingTrait.php | MergingTrait.arrayMerge | protected function arrayMerge(array $target, array $source)
{
foreach ($source as $key => $value) {
if ($value instanceof MergingInterface) {
$value = $value->toArray();
}
if (isset($target[$key]) || array_key_exists($key, $target)) {
if (i... | php | protected function arrayMerge(array $target, array $source)
{
foreach ($source as $key => $value) {
if ($value instanceof MergingInterface) {
$value = $value->toArray();
}
if (isset($target[$key]) || array_key_exists($key, $target)) {
if (i... | [
"protected",
"function",
"arrayMerge",
"(",
"array",
"$",
"target",
",",
"array",
"$",
"source",
")",
"{",
"foreach",
"(",
"$",
"source",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"instanceof",
"MergingInterface",
")",
"{... | Merge data from two arrays.
@param array $target The target array
@param array $source The sourse array
@return array The result of merging | [
"Merge",
"data",
"from",
"two",
"arrays",
"."
] | 0e917d8ff2c3622f53b82d34436295539858be7d | https://github.com/easy-system/es-container/blob/0e917d8ff2c3622f53b82d34436295539858be7d/src/Merging/MergingTrait.php#L63-L83 |
6,569 | marando/phpSOFA | src/Marando/IAU/iauAf2a.php | iauAf2a.Af2a | public static function Af2a($s, $ideg, $iamin, $asec, &$rad) {
/* Compute the interval. */
$rad = ( $s == '-' ? -1.0 : 1.0 ) *
( 60.0 * ( 60.0 * ( (double)abs($ideg) ) +
( (double)abs($iamin) ) ) +
abs($asec) ) * DAS2R;
/* Validate arguments and return status. */
if ... | php | public static function Af2a($s, $ideg, $iamin, $asec, &$rad) {
/* Compute the interval. */
$rad = ( $s == '-' ? -1.0 : 1.0 ) *
( 60.0 * ( 60.0 * ( (double)abs($ideg) ) +
( (double)abs($iamin) ) ) +
abs($asec) ) * DAS2R;
/* Validate arguments and return status. */
if ... | [
"public",
"static",
"function",
"Af2a",
"(",
"$",
"s",
",",
"$",
"ideg",
",",
"$",
"iamin",
",",
"$",
"asec",
",",
"&",
"$",
"rad",
")",
"{",
"/* Compute the interval. */",
"$",
"rad",
"=",
"(",
"$",
"s",
"==",
"'-'",
"?",
"-",
"1.0",
":",
"1.0",... | - - - - - - - -
i a u A f 2 a
- - - - - - - -
Convert degrees, arcminutes, arcseconds to radians.
This function is part of the International Astronomical Union's
SOFA (Standards of Fundamental Astronomy) software collection.
Status: support function.
Given:
s char sign: '-' = negative, otherwise positi... | [
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"i",
"a",
"u",
"A",
"f",
"2",
"a",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-"
] | 757fa49fe335ae1210eaa7735473fd4388b13f07 | https://github.com/marando/phpSOFA/blob/757fa49fe335ae1210eaa7735473fd4388b13f07/src/Marando/IAU/iauAf2a.php#L50-L65 |
6,570 | Flowpack/Flowpack.SingleSignOn.Client | Classes/Flowpack/SingleSignOn/Client/Security/RequestPattern/ConjunctionPattern.php | ConjunctionPattern.matchRequest | public function matchRequest(\TYPO3\Flow\Mvc\RequestInterface $request) {
/** @var \TYPO3\Flow\Security\RequestPatternInterface $pattern */
foreach ($this->subPatterns as $pattern) {
if ($pattern->matchRequest($request) === FALSE) {
return FALSE;
}
}
return TRUE;
} | php | public function matchRequest(\TYPO3\Flow\Mvc\RequestInterface $request) {
/** @var \TYPO3\Flow\Security\RequestPatternInterface $pattern */
foreach ($this->subPatterns as $pattern) {
if ($pattern->matchRequest($request) === FALSE) {
return FALSE;
}
}
return TRUE;
} | [
"public",
"function",
"matchRequest",
"(",
"\\",
"TYPO3",
"\\",
"Flow",
"\\",
"Mvc",
"\\",
"RequestInterface",
"$",
"request",
")",
"{",
"/** @var \\TYPO3\\Flow\\Security\\RequestPatternInterface $pattern */",
"foreach",
"(",
"$",
"this",
"->",
"subPatterns",
"as",
"$... | Matches a \TYPO3\Flow\Mvc\RequestInterface against its set pattern rules
@param \TYPO3\Flow\Mvc\RequestInterface $request The request that should be matched
@return boolean TRUE if the pattern matched, FALSE otherwise | [
"Matches",
"a",
"\\",
"TYPO3",
"\\",
"Flow",
"\\",
"Mvc",
"\\",
"RequestInterface",
"against",
"its",
"set",
"pattern",
"rules"
] | 0512b66bba7cf31fd03c9608a1e4c67a7c1c0e00 | https://github.com/Flowpack/Flowpack.SingleSignOn.Client/blob/0512b66bba7cf31fd03c9608a1e4c67a7c1c0e00/Classes/Flowpack/SingleSignOn/Client/Security/RequestPattern/ConjunctionPattern.php#L71-L80 |
6,571 | phossa2/libs | src/Phossa2/Db/Manager.php | Manager.addDriver | public function addDriver(DriverInterface $driver, /*# int */ $factor = 1)
{
// get unique driver id
$id = $this->getDriverId($driver);
// fix factor range: 1 - 10
$this->factors[$id] = $this->fixFactor($factor);
// add to the pool
$this->drivers[$id] = $driver;
... | php | public function addDriver(DriverInterface $driver, /*# int */ $factor = 1)
{
// get unique driver id
$id = $this->getDriverId($driver);
// fix factor range: 1 - 10
$this->factors[$id] = $this->fixFactor($factor);
// add to the pool
$this->drivers[$id] = $driver;
... | [
"public",
"function",
"addDriver",
"(",
"DriverInterface",
"$",
"driver",
",",
"/*# int */",
"$",
"factor",
"=",
"1",
")",
"{",
"// get unique driver id",
"$",
"id",
"=",
"$",
"this",
"->",
"getDriverId",
"(",
"$",
"driver",
")",
";",
"// fix factor range: 1 -... | Specify a weighting factor for the driver. normally 1 - 10
{@inheritDoc}
@param int $factor weight factor for round-robin | [
"Specify",
"a",
"weighting",
"factor",
"for",
"the",
"driver",
".",
"normally",
"1",
"-",
"10"
] | 921e485c8cc29067f279da2cdd06f47a9bddd115 | https://github.com/phossa2/libs/blob/921e485c8cc29067f279da2cdd06f47a9bddd115/src/Phossa2/Db/Manager.php#L99-L111 |
6,572 | phossa2/libs | src/Phossa2/Db/Manager.php | Manager.getDriver | public function getDriver(/*# string */ $tag = '')/*# : DriverInterface */
{
// match drivers
$matched = $this->driverMatcher($tag);
if (count($matched) > 0) {
return $this->drivers[$matched[rand(1, count($matched)) - 1]];
} else {
throw new NotFoundException... | php | public function getDriver(/*# string */ $tag = '')/*# : DriverInterface */
{
// match drivers
$matched = $this->driverMatcher($tag);
if (count($matched) > 0) {
return $this->drivers[$matched[rand(1, count($matched)) - 1]];
} else {
throw new NotFoundException... | [
"public",
"function",
"getDriver",
"(",
"/*# string */",
"$",
"tag",
"=",
"''",
")",
"/*# : DriverInterface */",
"{",
"// match drivers",
"$",
"matched",
"=",
"$",
"this",
"->",
"driverMatcher",
"(",
"$",
"tag",
")",
";",
"if",
"(",
"count",
"(",
"$",
"mat... | Get a driver with a tag matched
{@inheritDoc} | [
"Get",
"a",
"driver",
"with",
"a",
"tag",
"matched"
] | 921e485c8cc29067f279da2cdd06f47a9bddd115 | https://github.com/phossa2/libs/blob/921e485c8cc29067f279da2cdd06f47a9bddd115/src/Phossa2/Db/Manager.php#L118-L131 |
6,573 | phossa2/libs | src/Phossa2/Db/Manager.php | Manager.driverMatcher | protected function driverMatcher(/*# string */ $tag)/*# : array */
{
$matched = [];
foreach ($this->drivers as $id => $driver) {
if ($this->tagMatched($tag, $driver) && $this->pingDriver($driver)) {
$this->expandWithFactor($matched, $id);
}
}
r... | php | protected function driverMatcher(/*# string */ $tag)/*# : array */
{
$matched = [];
foreach ($this->drivers as $id => $driver) {
if ($this->tagMatched($tag, $driver) && $this->pingDriver($driver)) {
$this->expandWithFactor($matched, $id);
}
}
r... | [
"protected",
"function",
"driverMatcher",
"(",
"/*# string */",
"$",
"tag",
")",
"/*# : array */",
"{",
"$",
"matched",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"drivers",
"as",
"$",
"id",
"=>",
"$",
"driver",
")",
"{",
"if",
"(",
"$",
... | Match drivers with tag
@param string $tag tag to match
@return array
@access protected | [
"Match",
"drivers",
"with",
"tag"
] | 921e485c8cc29067f279da2cdd06f47a9bddd115 | https://github.com/phossa2/libs/blob/921e485c8cc29067f279da2cdd06f47a9bddd115/src/Phossa2/Db/Manager.php#L165-L174 |
6,574 | naturalweb/FileStorage | src/NaturalWeb/FileStorage/Storage/FileSystemStorage.php | FileSystemStorage.copyDir | private function copyDir($from, $to)
{
mkdir($to, 0777, true);
$items = new FilesystemIterator($from);
foreach ($items as $item)
{
$pattern = preg_quote($from, "/");
$Key = preg_replace("/^{$pattern}/", "", $item);
$subFrom = strval($ite... | php | private function copyDir($from, $to)
{
mkdir($to, 0777, true);
$items = new FilesystemIterator($from);
foreach ($items as $item)
{
$pattern = preg_quote($from, "/");
$Key = preg_replace("/^{$pattern}/", "", $item);
$subFrom = strval($ite... | [
"private",
"function",
"copyDir",
"(",
"$",
"from",
",",
"$",
"to",
")",
"{",
"mkdir",
"(",
"$",
"to",
",",
"0777",
",",
"true",
")",
";",
"$",
"items",
"=",
"new",
"FilesystemIterator",
"(",
"$",
"from",
")",
";",
"foreach",
"(",
"$",
"items",
"... | Copy Directory Recursive
@param string $from Path From
@param string $to Path To
@return bool
@access private | [
"Copy",
"Directory",
"Recursive"
] | 3d2c9b0187685da8fc71bdf08456da8732f751dd | https://github.com/naturalweb/FileStorage/blob/3d2c9b0187685da8fc71bdf08456da8732f751dd/src/NaturalWeb/FileStorage/Storage/FileSystemStorage.php#L283-L306 |
6,575 | digitalicagroup/slack-hook-framework | lib/SlackHookFramework/AbstractCommand.php | AbstractCommand.post | public function post() {
$json = $this->result->toJson ();
$this->log->debug ( "AbstractCommand (" . get_class ( $this ) . "): response json: $json" );
$result = Util::post ( $this->config->slack_webhook_url, $json );
if (! $result) {
$this->log->error ( "AbstractCommand: Error sending json: $json to slack h... | php | public function post() {
$json = $this->result->toJson ();
$this->log->debug ( "AbstractCommand (" . get_class ( $this ) . "): response json: $json" );
$result = Util::post ( $this->config->slack_webhook_url, $json );
if (! $result) {
$this->log->error ( "AbstractCommand: Error sending json: $json to slack h... | [
"public",
"function",
"post",
"(",
")",
"{",
"$",
"json",
"=",
"$",
"this",
"->",
"result",
"->",
"toJson",
"(",
")",
";",
"$",
"this",
"->",
"log",
"->",
"debug",
"(",
"\"AbstractCommand (\"",
".",
"get_class",
"(",
"$",
"this",
")",
".",
"\"): resp... | Post the SlackResult json representation to the Slack Incoming WebHook. | [
"Post",
"the",
"SlackResult",
"json",
"representation",
"to",
"the",
"Slack",
"Incoming",
"WebHook",
"."
] | b2357275d6042e49cb082e375716effd4c001ee0 | https://github.com/digitalicagroup/slack-hook-framework/blob/b2357275d6042e49cb082e375716effd4c001ee0/lib/SlackHookFramework/AbstractCommand.php#L117-L125 |
6,576 | vinala/kernel | src/Lumos/Commands/NewViewCommand.php | NewViewCommand.name | private function name($extra)
{
$file = $extra[0];
$file = str_replace('.', '/', $file);
//
switch ($extra[1]) {
case 'smarty': $extention = '.tpl.php'; break;
case 'atom': $extention = '.atom'; break;
default: $extention = '.php'; break;
}... | php | private function name($extra)
{
$file = $extra[0];
$file = str_replace('.', '/', $file);
//
switch ($extra[1]) {
case 'smarty': $extention = '.tpl.php'; break;
case 'atom': $extention = '.atom'; break;
default: $extention = '.php'; break;
}... | [
"private",
"function",
"name",
"(",
"$",
"extra",
")",
"{",
"$",
"file",
"=",
"$",
"extra",
"[",
"0",
"]",
";",
"$",
"file",
"=",
"str_replace",
"(",
"'.'",
",",
"'/'",
",",
"$",
"file",
")",
";",
"//",
"switch",
"(",
"$",
"extra",
"[",
"1",
... | Get the path , name , and type of view.
@param string $name
@return string | [
"Get",
"the",
"path",
"name",
"and",
"type",
"of",
"view",
"."
] | 346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a | https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Lumos/Commands/NewViewCommand.php#L96-L108 |
6,577 | dzegarra/jsonrpcsmd | src/Greplab/Jsonrpcsmd/Smd/Parameter.php | Parameter.toArray | public function toArray()
{
return array(
//'name' => $this->param->getName(),
'optional' => $this->param->isOptional(),
'default' => $this->param->isDefaultValueAvailable() ? $this->param->getDefaultValue() : null
);
} | php | public function toArray()
{
return array(
//'name' => $this->param->getName(),
'optional' => $this->param->isOptional(),
'default' => $this->param->isDefaultValueAvailable() ? $this->param->getDefaultValue() : null
);
} | [
"public",
"function",
"toArray",
"(",
")",
"{",
"return",
"array",
"(",
"//'name' => $this->param->getName(),",
"'optional'",
"=>",
"$",
"this",
"->",
"param",
"->",
"isOptional",
"(",
")",
",",
"'default'",
"=>",
"$",
"this",
"->",
"param",
"->",
"isDefaultVa... | Return a representation of the current param.
@return array | [
"Return",
"a",
"representation",
"of",
"the",
"current",
"param",
"."
] | 2f423b575d34d9ef2370495b89b9efd96f0cd30b | https://github.com/dzegarra/jsonrpcsmd/blob/2f423b575d34d9ef2370495b89b9efd96f0cd30b/src/Greplab/Jsonrpcsmd/Smd/Parameter.php#L36-L43 |
6,578 | easy-system/es-system | src/System.php | System.init | public static function init(array $config = [], $devMode = false)
{
if (static::$instance instanceof static) {
return;
}
$system = static::$instance = new static();
$system->devMode = (bool) $devMode;
$services = $system->getServices();
$services->set('... | php | public static function init(array $config = [], $devMode = false)
{
if (static::$instance instanceof static) {
return;
}
$system = static::$instance = new static();
$system->devMode = (bool) $devMode;
$services = $system->getServices();
$services->set('... | [
"public",
"static",
"function",
"init",
"(",
"array",
"$",
"config",
"=",
"[",
"]",
",",
"$",
"devMode",
"=",
"false",
")",
"{",
"if",
"(",
"static",
"::",
"$",
"instance",
"instanceof",
"static",
")",
"{",
"return",
";",
"}",
"$",
"system",
"=",
"... | Initializes system.
Returns an instance of the system only once at initialization.
@param array $config Optional; the system configuration
@param bool $devMode Optional; false by default. The system mode
@return self|void Returns the instance of System only once | [
"Initializes",
"system",
".",
"Returns",
"an",
"instance",
"of",
"the",
"system",
"only",
"once",
"at",
"initialization",
"."
] | 750632b7a57f8c65d98c61cd0c29d2da3a9a04cc | https://github.com/easy-system/es-system/blob/750632b7a57f8c65d98c61cd0c29d2da3a9a04cc/src/System.php#L63-L98 |
6,579 | easy-system/es-system | src/System.php | System.run | public function run()
{
$services = $this->getServices();
$events = $services->get('Events');
$event = $this->getEvent();
$event->setContext($this);
$course = [
SystemEvent::BOOTSTRAP,
SystemEvent::ROUTE,
SystemEvent::DISPATCH,
... | php | public function run()
{
$services = $this->getServices();
$events = $services->get('Events');
$event = $this->getEvent();
$event->setContext($this);
$course = [
SystemEvent::BOOTSTRAP,
SystemEvent::ROUTE,
SystemEvent::DISPATCH,
... | [
"public",
"function",
"run",
"(",
")",
"{",
"$",
"services",
"=",
"$",
"this",
"->",
"getServices",
"(",
")",
";",
"$",
"events",
"=",
"$",
"services",
"->",
"get",
"(",
"'Events'",
")",
";",
"$",
"event",
"=",
"$",
"this",
"->",
"getEvent",
"(",
... | Runs system. | [
"Runs",
"system",
"."
] | 750632b7a57f8c65d98c61cd0c29d2da3a9a04cc | https://github.com/easy-system/es-system/blob/750632b7a57f8c65d98c61cd0c29d2da3a9a04cc/src/System.php#L113-L144 |
6,580 | phpthinktank/blast-config | src/Factory.php | Factory.create | public function create($repository)
{
//if repository is a string
//given repository should be a valid directory path
if (is_string($repository)) {
//clear stat cache to avoid loading cached files,
//which where unlinked in system
clearstatcache(TRUE);
... | php | public function create($repository)
{
//if repository is a string
//given repository should be a valid directory path
if (is_string($repository)) {
//clear stat cache to avoid loading cached files,
//which where unlinked in system
clearstatcache(TRUE);
... | [
"public",
"function",
"create",
"(",
"$",
"repository",
")",
"{",
"//if repository is a string",
"//given repository should be a valid directory path",
"if",
"(",
"is_string",
"(",
"$",
"repository",
")",
")",
"{",
"//clear stat cache to avoid loading cached files,",
"//which... | Create locator from repository. Repository could be a FilesystemRepository or a valid path
@param string|FilesystemRepository $repository
@return Locator | [
"Create",
"locator",
"from",
"repository",
".",
"Repository",
"could",
"be",
"a",
"FilesystemRepository",
"or",
"a",
"valid",
"path"
] | ffa9645425091c7f0da115f1181c195dce2a5393 | https://github.com/phpthinktank/blast-config/blob/ffa9645425091c7f0da115f1181c195dce2a5393/src/Factory.php#L26-L50 |
6,581 | phpthinktank/blast-config | src/Factory.php | Factory.load | public function load($path, LocatorInterface $locator, array $loaders = [], array $config = [])
{
$resource = $locator->locate($path);
if(count($loaders) < 1){
$loaders = [
new PhpLoader(),
new JsonLoader()
];
}
foreach($loade... | php | public function load($path, LocatorInterface $locator, array $loaders = [], array $config = [])
{
$resource = $locator->locate($path);
if(count($loaders) < 1){
$loaders = [
new PhpLoader(),
new JsonLoader()
];
}
foreach($loade... | [
"public",
"function",
"load",
"(",
"$",
"path",
",",
"LocatorInterface",
"$",
"locator",
",",
"array",
"$",
"loaders",
"=",
"[",
"]",
",",
"array",
"$",
"config",
"=",
"[",
"]",
")",
"{",
"$",
"resource",
"=",
"$",
"locator",
"->",
"locate",
"(",
"... | Load configuration from locator
@param string $path Path to configuration, relative to configured locator repository path e.g. /config/config.php
@param LocatorInterface $locator
@param LoaderInterface[] $loaders If is empty, PhpLoader and JsonLoader is loading by default
@param array $config Default configuration, ove... | [
"Load",
"configuration",
"from",
"locator"
] | ffa9645425091c7f0da115f1181c195dce2a5393 | https://github.com/phpthinktank/blast-config/blob/ffa9645425091c7f0da115f1181c195dce2a5393/src/Factory.php#L60-L81 |
6,582 | pdenis/SnideTravinizerBundle | Helper/GithubHelper.php | GithubHelper.getRawFileUrl | public function getRawFileUrl($slug, $branch, $path)
{
return sprintf(
'%s/%s/%s/%s',
$this->rawHost,
$slug,
$branch,
$path
);
} | php | public function getRawFileUrl($slug, $branch, $path)
{
return sprintf(
'%s/%s/%s/%s',
$this->rawHost,
$slug,
$branch,
$path
);
} | [
"public",
"function",
"getRawFileUrl",
"(",
"$",
"slug",
",",
"$",
"branch",
",",
"$",
"path",
")",
"{",
"return",
"sprintf",
"(",
"'%s/%s/%s/%s'",
",",
"$",
"this",
"->",
"rawHost",
",",
"$",
"slug",
",",
"$",
"branch",
",",
"$",
"path",
")",
";",
... | Get repository raw file
@param string $slug Repository slug
@param string $branch Repository branch
@param string $path File path
@return string | [
"Get",
"repository",
"raw",
"file"
] | 53a6fd647280d81a496018d379e4b5c446f81729 | https://github.com/pdenis/SnideTravinizerBundle/blob/53a6fd647280d81a496018d379e4b5c446f81729/Helper/GithubHelper.php#L64-L73 |
6,583 | glynnforrest/reform | src/Reform/Helper/Html.php | Html.attributes | public static function attributes(array $attributes = array())
{
$text = array();
foreach ($attributes as $key => $value) {
//if we have numeric keys (e.g. checked), set the value as
//the $key (e.g. checked="checked"), but only if it
//doesn't exist already
... | php | public static function attributes(array $attributes = array())
{
$text = array();
foreach ($attributes as $key => $value) {
//if we have numeric keys (e.g. checked), set the value as
//the $key (e.g. checked="checked"), but only if it
//doesn't exist already
... | [
"public",
"static",
"function",
"attributes",
"(",
"array",
"$",
"attributes",
"=",
"array",
"(",
")",
")",
"{",
"$",
"text",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"attributes",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"//if we hav... | Create a string of attributes to use in an HTML tag.
@param array $attributes An array of keys and values
@return string The attributes with a leading space | [
"Create",
"a",
"string",
"of",
"attributes",
"to",
"use",
"in",
"an",
"HTML",
"tag",
"."
] | a2a33dfa73933875f9c1dd0691b21e678a541a9e | https://github.com/glynnforrest/reform/blob/a2a33dfa73933875f9c1dd0691b21e678a541a9e/src/Reform/Helper/Html.php#L18-L36 |
6,584 | glynnforrest/reform | src/Reform/Helper/Html.php | Html.addToAttribute | public static function addToAttribute($attribute, $addition)
{
$new = array_unique(array_merge(explode(' ', $attribute), explode(' ', $addition)));
//strip out any empty strings from extra whitespace between values
//e.g. class=" foo bar baz "
$new = array_filter($new, function(... | php | public static function addToAttribute($attribute, $addition)
{
$new = array_unique(array_merge(explode(' ', $attribute), explode(' ', $addition)));
//strip out any empty strings from extra whitespace between values
//e.g. class=" foo bar baz "
$new = array_filter($new, function(... | [
"public",
"static",
"function",
"addToAttribute",
"(",
"$",
"attribute",
",",
"$",
"addition",
")",
"{",
"$",
"new",
"=",
"array_unique",
"(",
"array_merge",
"(",
"explode",
"(",
"' '",
",",
"$",
"attribute",
")",
",",
"explode",
"(",
"' '",
",",
"$",
... | Add to the value of an attribute, checking for duplicates. This
could be used to add css classes when css classes already
exist.
@param string $attribute The value of the attribute
@param string $addition The text to add | [
"Add",
"to",
"the",
"value",
"of",
"an",
"attribute",
"checking",
"for",
"duplicates",
".",
"This",
"could",
"be",
"used",
"to",
"add",
"css",
"classes",
"when",
"css",
"classes",
"already",
"exist",
"."
] | a2a33dfa73933875f9c1dd0691b21e678a541a9e | https://github.com/glynnforrest/reform/blob/a2a33dfa73933875f9c1dd0691b21e678a541a9e/src/Reform/Helper/Html.php#L46-L57 |
6,585 | glynnforrest/reform | src/Reform/Helper/Html.php | Html.addToAttributeArray | public static function addToAttributeArray(array $attributes, $name, $addition)
{
$attribute = isset($attributes[$name]) ? $attributes[$name] : '';
$attributes[$name] = self::addToAttribute($attribute, $addition);
return $attributes;
} | php | public static function addToAttributeArray(array $attributes, $name, $addition)
{
$attribute = isset($attributes[$name]) ? $attributes[$name] : '';
$attributes[$name] = self::addToAttribute($attribute, $addition);
return $attributes;
} | [
"public",
"static",
"function",
"addToAttributeArray",
"(",
"array",
"$",
"attributes",
",",
"$",
"name",
",",
"$",
"addition",
")",
"{",
"$",
"attribute",
"=",
"isset",
"(",
"$",
"attributes",
"[",
"$",
"name",
"]",
")",
"?",
"$",
"attributes",
"[",
"... | Add to the value of an attribute in an array of attributes. The
attribute will be created if it doesn't exist.
@param array $attributes The attributes
@param string $name The name of the attribute to add to
@param string $addition The text to add | [
"Add",
"to",
"the",
"value",
"of",
"an",
"attribute",
"in",
"an",
"array",
"of",
"attributes",
".",
"The",
"attribute",
"will",
"be",
"created",
"if",
"it",
"doesn",
"t",
"exist",
"."
] | a2a33dfa73933875f9c1dd0691b21e678a541a9e | https://github.com/glynnforrest/reform/blob/a2a33dfa73933875f9c1dd0691b21e678a541a9e/src/Reform/Helper/Html.php#L67-L73 |
6,586 | glynnforrest/reform | src/Reform/Helper/Html.php | Html.tag | public static function tag($tag, $content = null, array $attributes = array())
{
return self::openTag($tag, $attributes) . $content . self::closeTag($tag);
} | php | public static function tag($tag, $content = null, array $attributes = array())
{
return self::openTag($tag, $attributes) . $content . self::closeTag($tag);
} | [
"public",
"static",
"function",
"tag",
"(",
"$",
"tag",
",",
"$",
"content",
"=",
"null",
",",
"array",
"$",
"attributes",
"=",
"array",
"(",
")",
")",
"{",
"return",
"self",
"::",
"openTag",
"(",
"$",
"tag",
",",
"$",
"attributes",
")",
".",
"$",
... | Create an HTML tag.
@param string $tag The name of the tag
@param string $content The HTML content of the tag
@param array $attributes An array of html attributes
@return string The tag | [
"Create",
"an",
"HTML",
"tag",
"."
] | a2a33dfa73933875f9c1dd0691b21e678a541a9e | https://github.com/glynnforrest/reform/blob/a2a33dfa73933875f9c1dd0691b21e678a541a9e/src/Reform/Helper/Html.php#L106-L109 |
6,587 | glynnforrest/reform | src/Reform/Helper/Html.php | Html.label | public static function label($for, $content = null, array $attributes = array())
{
$attributes = array_merge(array('for' => $for), $attributes);
return self::tag('label', $content, $attributes);
} | php | public static function label($for, $content = null, array $attributes = array())
{
$attributes = array_merge(array('for' => $for), $attributes);
return self::tag('label', $content, $attributes);
} | [
"public",
"static",
"function",
"label",
"(",
"$",
"for",
",",
"$",
"content",
"=",
"null",
",",
"array",
"$",
"attributes",
"=",
"array",
"(",
")",
")",
"{",
"$",
"attributes",
"=",
"array_merge",
"(",
"array",
"(",
"'for'",
"=>",
"$",
"for",
")",
... | Create a label tag.
@param string $for The name of the input the label is for
@param string $content The content of the label, if any
@param array $attributes An array of html attributes
@return string The label tag | [
"Create",
"a",
"label",
"tag",
"."
] | a2a33dfa73933875f9c1dd0691b21e678a541a9e | https://github.com/glynnforrest/reform/blob/a2a33dfa73933875f9c1dd0691b21e678a541a9e/src/Reform/Helper/Html.php#L213-L218 |
6,588 | novuso/common | src/Application/Service/ServiceContainer.php | ServiceContainer.set | public function set(string $name, callable $callback): void
{
$this->services[$name] = function ($c) use ($callback) {
static $object;
if ($object === null) {
$object = $callback($c);
}
return $object;
};
} | php | public function set(string $name, callable $callback): void
{
$this->services[$name] = function ($c) use ($callback) {
static $object;
if ($object === null) {
$object = $callback($c);
}
return $object;
};
} | [
"public",
"function",
"set",
"(",
"string",
"$",
"name",
",",
"callable",
"$",
"callback",
")",
":",
"void",
"{",
"$",
"this",
"->",
"services",
"[",
"$",
"name",
"]",
"=",
"function",
"(",
"$",
"c",
")",
"use",
"(",
"$",
"callback",
")",
"{",
"s... | Defines a shared service
@param string $name The service name
@param callable $callback The service factory callback
@return void | [
"Defines",
"a",
"shared",
"service"
] | 7d0e5a4f4c79c9622e068efc8b7c70815c460863 | https://github.com/novuso/common/blob/7d0e5a4f4c79c9622e068efc8b7c70815c460863/src/Application/Service/ServiceContainer.php#L53-L64 |
6,589 | novuso/common | src/Application/Service/ServiceContainer.php | ServiceContainer.get | public function get($name)
{
if (!isset($this->services[$name])) {
throw ServiceNotFoundException::fromName($name);
}
return $this->services[$name]($this);
} | php | public function get($name)
{
if (!isset($this->services[$name])) {
throw ServiceNotFoundException::fromName($name);
}
return $this->services[$name]($this);
} | [
"public",
"function",
"get",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"services",
"[",
"$",
"name",
"]",
")",
")",
"{",
"throw",
"ServiceNotFoundException",
"::",
"fromName",
"(",
"$",
"name",
")",
";",
"}",
"ret... | Retrieves a service by name
@param string $name The service name
@return mixed
@throws ServiceNotFoundException When the service is not found | [
"Retrieves",
"a",
"service",
"by",
"name"
] | 7d0e5a4f4c79c9622e068efc8b7c70815c460863 | https://github.com/novuso/common/blob/7d0e5a4f4c79c9622e068efc8b7c70815c460863/src/Application/Service/ServiceContainer.php#L75-L82 |
6,590 | novuso/common | src/Application/Service/ServiceContainer.php | ServiceContainer.hasParameter | public function hasParameter(string $name): bool
{
return isset($this->parameters[$name]) || array_key_exists($name, $this->parameters);
} | php | public function hasParameter(string $name): bool
{
return isset($this->parameters[$name]) || array_key_exists($name, $this->parameters);
} | [
"public",
"function",
"hasParameter",
"(",
"string",
"$",
"name",
")",
":",
"bool",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"parameters",
"[",
"$",
"name",
"]",
")",
"||",
"array_key_exists",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"parameter... | Checks if a parameter exists
@param string $name The parameter name
@return bool | [
"Checks",
"if",
"a",
"parameter",
"exists"
] | 7d0e5a4f4c79c9622e068efc8b7c70815c460863 | https://github.com/novuso/common/blob/7d0e5a4f4c79c9622e068efc8b7c70815c460863/src/Application/Service/ServiceContainer.php#L145-L148 |
6,591 | dlin-me/geocoder | src/Dlin/Geocoder/Geocoder.php | Geocoder.forward | public function forward($address, $countryCode=null){
$attempt = 0;
while( $this->getCurrentGeocoding() && $attempt <= count($this->sourceConfig)){
if($parsedAddress = $this->getCurrentGeocoding()->forward($address, $countryCode)){
return $parsedAddress;
}else{... | php | public function forward($address, $countryCode=null){
$attempt = 0;
while( $this->getCurrentGeocoding() && $attempt <= count($this->sourceConfig)){
if($parsedAddress = $this->getCurrentGeocoding()->forward($address, $countryCode)){
return $parsedAddress;
}else{... | [
"public",
"function",
"forward",
"(",
"$",
"address",
",",
"$",
"countryCode",
"=",
"null",
")",
"{",
"$",
"attempt",
"=",
"0",
";",
"while",
"(",
"$",
"this",
"->",
"getCurrentGeocoding",
"(",
")",
"&&",
"$",
"attempt",
"<=",
"count",
"(",
"$",
"thi... | Forward Geocoding is the process of taking a given location in address format and returning the
closes known coordinates to the address provided. The address can be a country, county, city,
state, zip code, street address, or any combination of these.
@param $address
@param $countryCode, optional country code (e.g. AU... | [
"Forward",
"Geocoding",
"is",
"the",
"process",
"of",
"taking",
"a",
"given",
"location",
"in",
"address",
"format",
"and",
"returning",
"the",
"closes",
"known",
"coordinates",
"to",
"the",
"address",
"provided",
".",
"The",
"address",
"can",
"be",
"a",
"co... | 50596ff3dcaccd95034e5799ae02fd1c753b5cd2 | https://github.com/dlin-me/geocoder/blob/50596ff3dcaccd95034e5799ae02fd1c753b5cd2/src/Dlin/Geocoder/Geocoder.php#L138-L151 |
6,592 | eix/core | src/php/main/Eix/Core/Responses/Http/Media/XslPage.php | XslPage.prepare | protected function prepare()
{
// Set data into dataDocument structure;
if (is_array($this->data)) {
foreach ($this->data as $key => $value) {
$this->addData($key, $value);
}
}
Logger::get()->debug("Response data:\n" . $this->dataDocument->toStri... | php | protected function prepare()
{
// Set data into dataDocument structure;
if (is_array($this->data)) {
foreach ($this->data as $key => $value) {
$this->addData($key, $value);
}
}
Logger::get()->debug("Response data:\n" . $this->dataDocument->toStri... | [
"protected",
"function",
"prepare",
"(",
")",
"{",
"// Set data into dataDocument structure;",
"if",
"(",
"is_array",
"(",
"$",
"this",
"->",
"data",
")",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"data",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{"... | Prepares the document by merging
the template and the data. | [
"Prepares",
"the",
"document",
"by",
"merging",
"the",
"template",
"and",
"the",
"data",
"."
] | a5b4c09cc168221e85804fdfeb78e519a0415466 | https://github.com/eix/core/blob/a5b4c09cc168221e85804fdfeb78e519a0415466/src/php/main/Eix/Core/Responses/Http/Media/XslPage.php#L111-L124 |
6,593 | strident/Trident | src/Trident/Component/Templating/Templating.php | Templating.render | public function render($template, array $parameters = array(), Response $response = null)
{
if ( ! $response instanceof Response) {
$response = new Response();
}
$response->setContent($this->engine->render($template, $parameters));
return $response;
} | php | public function render($template, array $parameters = array(), Response $response = null)
{
if ( ! $response instanceof Response) {
$response = new Response();
}
$response->setContent($this->engine->render($template, $parameters));
return $response;
} | [
"public",
"function",
"render",
"(",
"$",
"template",
",",
"array",
"$",
"parameters",
"=",
"array",
"(",
")",
",",
"Response",
"$",
"response",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"response",
"instanceof",
"Response",
")",
"{",
"$",
"response"... | Render a template with the template engine
@param string $template
@param array $parameters
@return Response | [
"Render",
"a",
"template",
"with",
"the",
"template",
"engine"
] | a112f0b75601b897c470a49d85791dc386c29952 | https://github.com/strident/Trident/blob/a112f0b75601b897c470a49d85791dc386c29952/src/Trident/Component/Templating/Templating.php#L37-L46 |
6,594 | docit/core | src/Providers/RouteServiceProvider.php | RouteServiceProvider.map | public function map(Router $router)
{
$router->group([ 'prefix' => config('docit.base_route'), 'namespace' => $this->namespace ], function ($router)
{
require(realpath(__DIR__ . '/../Http/routes.php'));
});
} | php | public function map(Router $router)
{
$router->group([ 'prefix' => config('docit.base_route'), 'namespace' => $this->namespace ], function ($router)
{
require(realpath(__DIR__ . '/../Http/routes.php'));
});
} | [
"public",
"function",
"map",
"(",
"Router",
"$",
"router",
")",
"{",
"$",
"router",
"->",
"group",
"(",
"[",
"'prefix'",
"=>",
"config",
"(",
"'docit.base_route'",
")",
",",
"'namespace'",
"=>",
"$",
"this",
"->",
"namespace",
"]",
",",
"function",
"(",
... | Define the routes for Docit.
@param Illuminate\Routing\Router $router
@return void | [
"Define",
"the",
"routes",
"for",
"Docit",
"."
] | 448e1cdca18a8ffb6c08430cad8d22162171ac35 | https://github.com/docit/core/blob/448e1cdca18a8ffb6c08430cad8d22162171ac35/src/Providers/RouteServiceProvider.php#L53-L60 |
6,595 | phox-pro/pulsar-core | src/app/Logic/ENV.php | ENV.set | public static function set(string $key, string $value, bool $to_file = true, bool $put = true, bool $set = true)
{
if ($to_file) {
self::toFile($key, $value);
}
if ($put) {
putenv("$key=$value");
}
if ($set) {
$_ENV[$key] = $value;
... | php | public static function set(string $key, string $value, bool $to_file = true, bool $put = true, bool $set = true)
{
if ($to_file) {
self::toFile($key, $value);
}
if ($put) {
putenv("$key=$value");
}
if ($set) {
$_ENV[$key] = $value;
... | [
"public",
"static",
"function",
"set",
"(",
"string",
"$",
"key",
",",
"string",
"$",
"value",
",",
"bool",
"$",
"to_file",
"=",
"true",
",",
"bool",
"$",
"put",
"=",
"true",
",",
"bool",
"$",
"set",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"to_fil... | Replaces the value of the env variable in the .env file
@param string $key
@param string $value
@return bool If the file was overwritten, it returns true. When the error appears false | [
"Replaces",
"the",
"value",
"of",
"the",
"env",
"variable",
"in",
"the",
".",
"env",
"file"
] | fa9c66f6578180253a65c91edf422fc3c51b32ba | https://github.com/phox-pro/pulsar-core/blob/fa9c66f6578180253a65c91edf422fc3c51b32ba/src/app/Logic/ENV.php#L14-L27 |
6,596 | EarthlingInteractive/PHPCMIPREST | lib/EarthIT/CMIPREST/RequestParser/Util.php | EarthIT_CMIPREST_RequestParser_Util.parseFilter2 | public static function parseFilter2( array $requestFilters, EarthIT_Schema_ResourceClass $rc, EarthIT_Schema $schema ) {
$filterComponents = array();
foreach( $requestFilters as $filter ) {
$filterComponents[] = EarthIT_Storage_ItemFilters::parsePattern(
$filter['fieldName'], $filter['pattern'],
$rc, $sc... | php | public static function parseFilter2( array $requestFilters, EarthIT_Schema_ResourceClass $rc, EarthIT_Schema $schema ) {
$filterComponents = array();
foreach( $requestFilters as $filter ) {
$filterComponents[] = EarthIT_Storage_ItemFilters::parsePattern(
$filter['fieldName'], $filter['pattern'],
$rc, $sc... | [
"public",
"static",
"function",
"parseFilter2",
"(",
"array",
"$",
"requestFilters",
",",
"EarthIT_Schema_ResourceClass",
"$",
"rc",
",",
"EarthIT_Schema",
"$",
"schema",
")",
"{",
"$",
"filterComponents",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"req... | Better than the first one! | [
"Better",
"than",
"the",
"first",
"one!"
] | db0398ea4fc07fa62f2de9ba43f2f3137170d9f0 | https://github.com/EarthlingInteractive/PHPCMIPREST/blob/db0398ea4fc07fa62f2de9ba43f2f3137170d9f0/lib/EarthIT/CMIPREST/RequestParser/Util.php#L106-L114 |
6,597 | themichaelhall/bluemvc-core | src/Collections/UploadedFileCollection.php | UploadedFileCollection.get | public function get(string $name): ?UploadedFileInterface
{
if (!isset($this->uploadedFiles[$name])) {
return null;
}
return $this->uploadedFiles[$name];
} | php | public function get(string $name): ?UploadedFileInterface
{
if (!isset($this->uploadedFiles[$name])) {
return null;
}
return $this->uploadedFiles[$name];
} | [
"public",
"function",
"get",
"(",
"string",
"$",
"name",
")",
":",
"?",
"UploadedFileInterface",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"uploadedFiles",
"[",
"$",
"name",
"]",
")",
")",
"{",
"return",
"null",
";",
"}",
"return",
"$",
... | Returns the uploaded file by name if it exists, null otherwise.
@since 1.0.0
@param string $name The name.
@return UploadedFileInterface|null The the uploaded file by name if it exists, null otherwise. | [
"Returns",
"the",
"uploaded",
"file",
"by",
"name",
"if",
"it",
"exists",
"null",
"otherwise",
"."
] | cbc8ccf8ed4f15ec6105837b29c2bd3db3f93680 | https://github.com/themichaelhall/bluemvc-core/blob/cbc8ccf8ed4f15ec6105837b29c2bd3db3f93680/src/Collections/UploadedFileCollection.php#L64-L71 |
6,598 | themichaelhall/bluemvc-core | src/Collections/UploadedFileCollection.php | UploadedFileCollection.set | public function set(string $name, UploadedFileInterface $uploadedFile): void
{
$this->uploadedFiles[$name] = $uploadedFile;
} | php | public function set(string $name, UploadedFileInterface $uploadedFile): void
{
$this->uploadedFiles[$name] = $uploadedFile;
} | [
"public",
"function",
"set",
"(",
"string",
"$",
"name",
",",
"UploadedFileInterface",
"$",
"uploadedFile",
")",
":",
"void",
"{",
"$",
"this",
"->",
"uploadedFiles",
"[",
"$",
"name",
"]",
"=",
"$",
"uploadedFile",
";",
"}"
] | Sets an uploaded file by name.
@since 1.0.0
@param string $name The name.
@param UploadedFileInterface $uploadedFile The uploaded file. | [
"Sets",
"an",
"uploaded",
"file",
"by",
"name",
"."
] | cbc8ccf8ed4f15ec6105837b29c2bd3db3f93680 | https://github.com/themichaelhall/bluemvc-core/blob/cbc8ccf8ed4f15ec6105837b29c2bd3db3f93680/src/Collections/UploadedFileCollection.php#L113-L116 |
6,599 | mtils/beetree | src/BeeTree/Eloquent/AdjacencyList/WholeTreeModelTrait.php | WholeTreeModelTrait.tree | public function tree($rootId, array $columns=[])
{
$columns = $this->pickColumns($columns);
$columnsId = $this->getColumnsCacheId($columns);
if (isset($this->_hierachyCache[$columnsId][$rootId])) {
return $this->_hierachyCache[$columnsId][$rootId];
}
$result = ... | php | public function tree($rootId, array $columns=[])
{
$columns = $this->pickColumns($columns);
$columnsId = $this->getColumnsCacheId($columns);
if (isset($this->_hierachyCache[$columnsId][$rootId])) {
return $this->_hierachyCache[$columnsId][$rootId];
}
$result = ... | [
"public",
"function",
"tree",
"(",
"$",
"rootId",
",",
"array",
"$",
"columns",
"=",
"[",
"]",
")",
"{",
"$",
"columns",
"=",
"$",
"this",
"->",
"pickColumns",
"(",
"$",
"columns",
")",
";",
"$",
"columnsId",
"=",
"$",
"this",
"->",
"getColumnsCacheI... | Retrieve a tree by its rootId
@param mixed $rootId The id of its root node, which is the same as node->getRootId()
@param array $columns (Optional) Determine which columns have to be fetched from persistence
@return \BeeTree\NodeInterface | [
"Retrieve",
"a",
"tree",
"by",
"its",
"rootId"
] | 4a68fc94ec14d5faef773b1628c9060db7bf1ce2 | https://github.com/mtils/beetree/blob/4a68fc94ec14d5faef773b1628c9060db7bf1ce2/src/BeeTree/Eloquent/AdjacencyList/WholeTreeModelTrait.php#L28-L45 |
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.