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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
10,500 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/theme.php | Theme.presenter | public function presenter($view, $method = 'view', $auto_filter = null)
{
return \Presenter::forge($view, $method, $auto_filter, $this->find_file($view));
} | php | public function presenter($view, $method = 'view', $auto_filter = null)
{
return \Presenter::forge($view, $method, $auto_filter, $this->find_file($view));
} | [
"public",
"function",
"presenter",
"(",
"$",
"view",
",",
"$",
"method",
"=",
"'view'",
",",
"$",
"auto_filter",
"=",
"null",
")",
"{",
"return",
"\\",
"Presenter",
"::",
"forge",
"(",
"$",
"view",
",",
"$",
"method",
",",
"$",
"auto_filter",
",",
"$... | Loads a presenter, and have it use the view from the currently active theme,
the fallback theme, or the standard FuelPHP cascading file system
@param string Presenter classname without Presenter_ prefix or full classname
@param string Method to execute
@param bool $auto_filter Auto filter the view data
@re... | [
"Loads",
"a",
"presenter",
"and",
"have",
"it",
"use",
"the",
"view",
"from",
"the",
"currently",
"active",
"theme",
"the",
"fallback",
"theme",
"or",
"the",
"standard",
"FuelPHP",
"cascading",
"file",
"system"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/theme.php#L239-L242 |
10,501 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/theme.php | Theme.asset_path | public function asset_path($path)
{
if ($this->active['path'] === null)
{
throw new \ThemeException('You must set an active theme.');
}
if ($this->active['asset_base'])
{
return $this->active['asset_base'].$path;
}
else
{
return $this->active['path'].$path;
}
} | php | public function asset_path($path)
{
if ($this->active['path'] === null)
{
throw new \ThemeException('You must set an active theme.');
}
if ($this->active['asset_base'])
{
return $this->active['asset_base'].$path;
}
else
{
return $this->active['path'].$path;
}
} | [
"public",
"function",
"asset_path",
"(",
"$",
"path",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"active",
"[",
"'path'",
"]",
"===",
"null",
")",
"{",
"throw",
"new",
"\\",
"ThemeException",
"(",
"'You must set an active theme.'",
")",
";",
"}",
"if",
"(",... | Loads an asset from the currently loaded theme.
@param string $path Relative path to the asset
@return string Full asset URL or path if outside docroot | [
"Loads",
"an",
"asset",
"from",
"the",
"currently",
"loaded",
"theme",
"."
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/theme.php#L250-L265 |
10,502 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/theme.php | Theme.set_template | public function set_template($template)
{
// make sure the template is a View
if (is_string($template))
{
$this->template = $this->view($template);
}
else
{
$this->template = $template;
}
// return the template view for chaining
return $this->template;
} | php | public function set_template($template)
{
// make sure the template is a View
if (is_string($template))
{
$this->template = $this->view($template);
}
else
{
$this->template = $template;
}
// return the template view for chaining
return $this->template;
} | [
"public",
"function",
"set_template",
"(",
"$",
"template",
")",
"{",
"// make sure the template is a View",
"if",
"(",
"is_string",
"(",
"$",
"template",
")",
")",
"{",
"$",
"this",
"->",
"template",
"=",
"$",
"this",
"->",
"view",
"(",
"$",
"template",
"... | Sets a template for a theme
@param string $template Name of the template view
@return View | [
"Sets",
"a",
"template",
"for",
"a",
"theme"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/theme.php#L273-L287 |
10,503 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/theme.php | Theme.render | public function render()
{
// make sure the template to be rendered is defined
if (empty($this->template))
{
throw new \ThemeException('No valid template could be found. Use set_template() to define a page template.');
}
// storage for rendered results
$rendered = array();
// pre-process all defined... | php | public function render()
{
// make sure the template to be rendered is defined
if (empty($this->template))
{
throw new \ThemeException('No valid template could be found. Use set_template() to define a page template.');
}
// storage for rendered results
$rendered = array();
// pre-process all defined... | [
"public",
"function",
"render",
"(",
")",
"{",
"// make sure the template to be rendered is defined",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"template",
")",
")",
"{",
"throw",
"new",
"\\",
"ThemeException",
"(",
"'No valid template could be found. Use set_template... | Render the partials and the theme template
@return string|View
@throws \ThemeException | [
"Render",
"the",
"partials",
"and",
"the",
"theme",
"template"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/theme.php#L313-L352 |
10,504 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/theme.php | Theme.set_partial | public function set_partial($section, $view, $overwrite = false)
{
// make sure the partial entry exists
array_key_exists($section, $this->partials) or $this->partials[$section] = array();
// make sure the partial is a view
if (is_string($view))
{
$name = $view;
$view = $this->view($view);
}
else
... | php | public function set_partial($section, $view, $overwrite = false)
{
// make sure the partial entry exists
array_key_exists($section, $this->partials) or $this->partials[$section] = array();
// make sure the partial is a view
if (is_string($view))
{
$name = $view;
$view = $this->view($view);
}
else
... | [
"public",
"function",
"set_partial",
"(",
"$",
"section",
",",
"$",
"view",
",",
"$",
"overwrite",
"=",
"false",
")",
"{",
"// make sure the partial entry exists",
"array_key_exists",
"(",
"$",
"section",
",",
"$",
"this",
"->",
"partials",
")",
"or",
"$",
"... | Sets a partial for the current template
@param string $section Name of the partial section in the template
@param string|View|ViewModel|Presenter $view View, or name of the view
@param bool $overwrite If true overwrite any already defined partials for this section
@return View | [
"Sets",
"a",
"partial",
"for",
"the",
"current",
"template"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/theme.php#L362-L390 |
10,505 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/theme.php | Theme.get_partial | public function get_partial($section, $view)
{
// make sure the partial entry exists
if ( ! array_key_exists($section, $this->partials) or ! array_key_exists($view, $this->partials[$section]))
{
throw new \ThemeException(sprintf('No partial named "%s" can be found in the "%s" section.', $view, $section));
}... | php | public function get_partial($section, $view)
{
// make sure the partial entry exists
if ( ! array_key_exists($section, $this->partials) or ! array_key_exists($view, $this->partials[$section]))
{
throw new \ThemeException(sprintf('No partial named "%s" can be found in the "%s" section.', $view, $section));
}... | [
"public",
"function",
"get_partial",
"(",
"$",
"section",
",",
"$",
"view",
")",
"{",
"// make sure the partial entry exists",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"section",
",",
"$",
"this",
"->",
"partials",
")",
"or",
"!",
"array_key_exists",
"(",... | Get a partial so it can be manipulated
@param string $section Name of the partial section in the template
@param string $view name of the view
@return View
@throws \ThemeException | [
"Get",
"a",
"partial",
"so",
"it",
"can",
"be",
"manipulated"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/theme.php#L400-L409 |
10,506 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/theme.php | Theme.partial_count | public function partial_count($section)
{
// return the defined partial count
return array_key_exists($section, $this->partials) ? count($this->partials[$section]) : 0;
} | php | public function partial_count($section)
{
// return the defined partial count
return array_key_exists($section, $this->partials) ? count($this->partials[$section]) : 0;
} | [
"public",
"function",
"partial_count",
"(",
"$",
"section",
")",
"{",
"// return the defined partial count",
"return",
"array_key_exists",
"(",
"$",
"section",
",",
"$",
"this",
"->",
"partials",
")",
"?",
"count",
"(",
"$",
"this",
"->",
"partials",
"[",
"$",... | Returns the number of partials defined for a section
@param string $section Name of the partial section in the template
@return int | [
"Returns",
"the",
"number",
"of",
"partials",
"defined",
"for",
"a",
"section"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/theme.php#L428-L432 |
10,507 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/theme.php | Theme.set_chrome | public function set_chrome($section, $view, $var = 'content')
{
// make sure the chrome is a view
if (is_string($view))
{
$view = $this->view($view);
}
$this->chrome[$section] = array('var' => $var, 'view' => $view);
return $view;
} | php | public function set_chrome($section, $view, $var = 'content')
{
// make sure the chrome is a view
if (is_string($view))
{
$view = $this->view($view);
}
$this->chrome[$section] = array('var' => $var, 'view' => $view);
return $view;
} | [
"public",
"function",
"set_chrome",
"(",
"$",
"section",
",",
"$",
"view",
",",
"$",
"var",
"=",
"'content'",
")",
"{",
"// make sure the chrome is a view",
"if",
"(",
"is_string",
"(",
"$",
"view",
")",
")",
"{",
"$",
"view",
"=",
"$",
"this",
"->",
"... | Sets a chrome for a partial
@param string $section Name of the partial section in the template
@param string|View|ViewModel|Presenter $view chrome View, or name of the view
@param string $var Name of the variable in the chome that will output the partial
@return View|ViewModel|Presenter, the ... | [
"Sets",
"a",
"chrome",
"for",
"a",
"partial"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/theme.php#L443-L454 |
10,508 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/theme.php | Theme.get_chrome | public function get_chrome($section)
{
// make sure the partial entry exists
if ( ! array_key_exists($section, $this->chrome))
{
throw new \ThemeException(sprintf('No chrome for a partial named "%s" can be found.', $section));
}
return $this->chrome[$section]['view'];
} | php | public function get_chrome($section)
{
// make sure the partial entry exists
if ( ! array_key_exists($section, $this->chrome))
{
throw new \ThemeException(sprintf('No chrome for a partial named "%s" can be found.', $section));
}
return $this->chrome[$section]['view'];
} | [
"public",
"function",
"get_chrome",
"(",
"$",
"section",
")",
"{",
"// make sure the partial entry exists",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"section",
",",
"$",
"this",
"->",
"chrome",
")",
")",
"{",
"throw",
"new",
"\\",
"ThemeException",
"(",
... | Get a set chrome view
@param string $section Name of the partial section in the template
@param string|View|ViewModel|Presenter $view chrome View, or name of the view
@param string $var Name of the variable in the chome that will output the partial
@return void | [
"Get",
"a",
"set",
"chrome",
"view"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/theme.php#L465-L474 |
10,509 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/theme.php | Theme.find | public function find($theme)
{
foreach ($this->paths as $path)
{
if (is_dir($path.$theme))
{
return $path.$theme.DS;
}
}
return false;
} | php | public function find($theme)
{
foreach ($this->paths as $path)
{
if (is_dir($path.$theme))
{
return $path.$theme.DS;
}
}
return false;
} | [
"public",
"function",
"find",
"(",
"$",
"theme",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"paths",
"as",
"$",
"path",
")",
"{",
"if",
"(",
"is_dir",
"(",
"$",
"path",
".",
"$",
"theme",
")",
")",
"{",
"return",
"$",
"path",
".",
"$",
"theme... | Finds the given theme by searching through all of the theme paths. If
found it will return the path, else it will return `false`.
@param string $theme Theme to find
@return string|false Path or false if not found | [
"Finds",
"the",
"given",
"theme",
"by",
"searching",
"through",
"all",
"of",
"the",
"theme",
"paths",
".",
"If",
"found",
"it",
"will",
"return",
"the",
"path",
"else",
"it",
"will",
"return",
"false",
"."
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/theme.php#L505-L516 |
10,510 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/theme.php | Theme.all | public function all()
{
$themes = array();
foreach ($this->paths as $path)
{
$iterator = new \GlobIterator($path.'*');
foreach($iterator as $theme)
{
$themes[] = $theme->getFilename();
}
}
sort($themes);
return $themes;
} | php | public function all()
{
$themes = array();
foreach ($this->paths as $path)
{
$iterator = new \GlobIterator($path.'*');
foreach($iterator as $theme)
{
$themes[] = $theme->getFilename();
}
}
sort($themes);
return $themes;
} | [
"public",
"function",
"all",
"(",
")",
"{",
"$",
"themes",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"paths",
"as",
"$",
"path",
")",
"{",
"$",
"iterator",
"=",
"new",
"\\",
"GlobIterator",
"(",
"$",
"path",
".",
"'*'",
")",... | Gets an array of all themes in all theme paths, sorted alphabetically.
@return array | [
"Gets",
"an",
"array",
"of",
"all",
"themes",
"in",
"all",
"theme",
"paths",
"sorted",
"alphabetically",
"."
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/theme.php#L523-L537 |
10,511 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/theme.php | Theme.get_info | public function get_info($var = null, $default = null, $theme = null)
{
// if no theme is given
if ($theme === null)
{
// if no var to search is given return the entire active info array
if ($var === null)
{
return $this->active['info'];
}
// find the value in the active theme info
if (($v... | php | public function get_info($var = null, $default = null, $theme = null)
{
// if no theme is given
if ($theme === null)
{
// if no var to search is given return the entire active info array
if ($var === null)
{
return $this->active['info'];
}
// find the value in the active theme info
if (($v... | [
"public",
"function",
"get_info",
"(",
"$",
"var",
"=",
"null",
",",
"$",
"default",
"=",
"null",
",",
"$",
"theme",
"=",
"null",
")",
"{",
"// if no theme is given",
"if",
"(",
"$",
"theme",
"===",
"null",
")",
"{",
"// if no var to search is given return t... | Get a value from the info array
@return mixed | [
"Get",
"a",
"value",
"from",
"the",
"info",
"array"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/theme.php#L544-L580 |
10,512 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/theme.php | Theme.set_info | public function set_info($var, $value = null, $type = 'active')
{
if ($type == 'active')
{
\Arr::set($this->active['info'], $var, $value);
}
elseif ($type == 'fallback')
{
\Arr::set($this->fallback['info'], $var, $value);
}
// return for chaining
return $this;
} | php | public function set_info($var, $value = null, $type = 'active')
{
if ($type == 'active')
{
\Arr::set($this->active['info'], $var, $value);
}
elseif ($type == 'fallback')
{
\Arr::set($this->fallback['info'], $var, $value);
}
// return for chaining
return $this;
} | [
"public",
"function",
"set_info",
"(",
"$",
"var",
",",
"$",
"value",
"=",
"null",
",",
"$",
"type",
"=",
"'active'",
")",
"{",
"if",
"(",
"$",
"type",
"==",
"'active'",
")",
"{",
"\\",
"Arr",
"::",
"set",
"(",
"$",
"this",
"->",
"active",
"[",
... | Set a value in the info array
@return Theme | [
"Set",
"a",
"value",
"in",
"the",
"info",
"array"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/theme.php#L587-L600 |
10,513 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/theme.php | Theme.set_theme | protected function set_theme($theme = null, $type = 'active')
{
// set the theme if given
if ($theme !== null)
{
// remove the defined theme asset paths from the asset instance
empty($this->active['asset_path']) or $this->asset->remove_path($this->active['asset_path']);
empty($this->fallback['asset_path... | php | protected function set_theme($theme = null, $type = 'active')
{
// set the theme if given
if ($theme !== null)
{
// remove the defined theme asset paths from the asset instance
empty($this->active['asset_path']) or $this->asset->remove_path($this->active['asset_path']);
empty($this->fallback['asset_path... | [
"protected",
"function",
"set_theme",
"(",
"$",
"theme",
"=",
"null",
",",
"$",
"type",
"=",
"'active'",
")",
"{",
"// set the theme if given",
"if",
"(",
"$",
"theme",
"!==",
"null",
")",
"{",
"// remove the defined theme asset paths from the asset instance",
"empt... | Sets a theme.
@param string $theme Theme name to set active
@param string $type name of the internal theme array to set
@return array The theme array
@throws \ThemeException | [
"Sets",
"a",
"theme",
"."
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/theme.php#L775-L793 |
10,514 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/theme.php | Theme.create_theme_array | protected function create_theme_array($theme)
{
if ( ! is_array($theme))
{
if ( ! $path = $this->find($theme))
{
throw new \ThemeException(sprintf('Theme "%s" could not be found.', $theme));
}
$theme = array(
'name' => $theme,
'path' => $path,
);
}
else
{
if ( ! isset($theme['n... | php | protected function create_theme_array($theme)
{
if ( ! is_array($theme))
{
if ( ! $path = $this->find($theme))
{
throw new \ThemeException(sprintf('Theme "%s" could not be found.', $theme));
}
$theme = array(
'name' => $theme,
'path' => $path,
);
}
else
{
if ( ! isset($theme['n... | [
"protected",
"function",
"create_theme_array",
"(",
"$",
"theme",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"theme",
")",
")",
"{",
"if",
"(",
"!",
"$",
"path",
"=",
"$",
"this",
"->",
"find",
"(",
"$",
"theme",
")",
")",
"{",
"throw",
"new... | Creates a theme array by locating the given theme and setting all of the
option. It will throw a \ThemeException if it cannot locate the theme.
@param string $theme Theme name to set active
@return array The theme array
@throws \ThemeException | [
"Creates",
"a",
"theme",
"array",
"by",
"locating",
"the",
"given",
"theme",
"and",
"setting",
"all",
"of",
"the",
"option",
".",
"It",
"will",
"throw",
"a",
"\\",
"ThemeException",
"if",
"it",
"cannot",
"locate",
"the",
"theme",
"."
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/theme.php#L803-L859 |
10,515 | ellipsephp/http | src/Exceptions/Inspector.php | Inspector.linearize | private function linearize(Throwable $e): array
{
$previous = $e->getPrevious();
if (is_null($previous)) return [$e];
return array_merge($this->linearize($previous), [$e]);
} | php | private function linearize(Throwable $e): array
{
$previous = $e->getPrevious();
if (is_null($previous)) return [$e];
return array_merge($this->linearize($previous), [$e]);
} | [
"private",
"function",
"linearize",
"(",
"Throwable",
"$",
"e",
")",
":",
"array",
"{",
"$",
"previous",
"=",
"$",
"e",
"->",
"getPrevious",
"(",
")",
";",
"if",
"(",
"is_null",
"(",
"$",
"previous",
")",
")",
"return",
"[",
"$",
"e",
"]",
";",
"... | Return an array containing the given exception and all its previous
exceptions.
@param \Throwable $e
@return array | [
"Return",
"an",
"array",
"containing",
"the",
"given",
"exception",
"and",
"all",
"its",
"previous",
"exceptions",
"."
] | 20a2b0ae1d3a149a905b93ae0993203eb7d414e1 | https://github.com/ellipsephp/http/blob/20a2b0ae1d3a149a905b93ae0993203eb7d414e1/src/Exceptions/Inspector.php#L63-L70 |
10,516 | Niirrty/Niirrty.DB | src/Driver/Attribute/Support.php | Support.getAttributes | protected function getAttributes( array $attributes ) : array
{
$result = [];
foreach ( $attributes as $attribute )
{
if ( ! ( $attribute instanceof Descriptor ) )
{
continue;
}
$result[ $attribute->getName() ] = $attribute;
}
return $r... | php | protected function getAttributes( array $attributes ) : array
{
$result = [];
foreach ( $attributes as $attribute )
{
if ( ! ( $attribute instanceof Descriptor ) )
{
continue;
}
$result[ $attribute->getName() ] = $attribute;
}
return $r... | [
"protected",
"function",
"getAttributes",
"(",
"array",
"$",
"attributes",
")",
":",
"array",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"attributes",
"as",
"$",
"attribute",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"attribute",
"instanceo... | Results array of items.
@param array $attributes
@return \Niirrty\DB\Driver\Attribute\Descriptor[] | [
"Results",
"array",
"of",
"items",
"."
] | 72741fc06293f9f0ee408ebb1ccc18af53a35330 | https://github.com/Niirrty/Niirrty.DB/blob/72741fc06293f9f0ee408ebb1ccc18af53a35330/src/Driver/Attribute/Support.php#L79-L95 |
10,517 | Niirrty/Niirrty.DB | src/Driver/Attribute/Support.php | Support.add | public function add( Descriptor $argDescriptor ) : Support
{
$this->_attributes[ $argDescriptor->getName() ] = $argDescriptor;
return $this;
} | php | public function add( Descriptor $argDescriptor ) : Support
{
$this->_attributes[ $argDescriptor->getName() ] = $argDescriptor;
return $this;
} | [
"public",
"function",
"add",
"(",
"Descriptor",
"$",
"argDescriptor",
")",
":",
"Support",
"{",
"$",
"this",
"->",
"_attributes",
"[",
"$",
"argDescriptor",
"->",
"getName",
"(",
")",
"]",
"=",
"$",
"argDescriptor",
";",
"return",
"$",
"this",
";",
"}"
] | Adds or overwrites a argument descriptor.
@param \Niirrty\DB\Driver\Attribute\Descriptor $argDescriptor
@return \Niirrty\DB\Driver\Attribute\Support | [
"Adds",
"or",
"overwrites",
"a",
"argument",
"descriptor",
"."
] | 72741fc06293f9f0ee408ebb1ccc18af53a35330 | https://github.com/Niirrty/Niirrty.DB/blob/72741fc06293f9f0ee408ebb1ccc18af53a35330/src/Driver/Attribute/Support.php#L147-L154 |
10,518 | Niirrty/Niirrty.DB | src/Driver/Attribute/Support.php | Support.remove | public function remove( string $argName ) : Support
{
if ( ! $this->has( $argName ) )
{
return $this;
}
unset( $this->_attributes[ $argName ] );
return $this;
} | php | public function remove( string $argName ) : Support
{
if ( ! $this->has( $argName ) )
{
return $this;
}
unset( $this->_attributes[ $argName ] );
return $this;
} | [
"public",
"function",
"remove",
"(",
"string",
"$",
"argName",
")",
":",
"Support",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"has",
"(",
"$",
"argName",
")",
")",
"{",
"return",
"$",
"this",
";",
"}",
"unset",
"(",
"$",
"this",
"->",
"_attributes",
... | Removes the DSN argument descriptor with defined name
@param string $argName
@return \Niirrty\DB\Driver\Attribute\Support | [
"Removes",
"the",
"DSN",
"argument",
"descriptor",
"with",
"defined",
"name"
] | 72741fc06293f9f0ee408ebb1ccc18af53a35330 | https://github.com/Niirrty/Niirrty.DB/blob/72741fc06293f9f0ee408ebb1ccc18af53a35330/src/Driver/Attribute/Support.php#L162-L174 |
10,519 | Niirrty/Niirrty.DB | src/Driver/Attribute/Support.php | Support.getSQLParamNames | public function getSQLParamNames() : array
{
$out = [];
foreach ( $this->_attributes as $attributeName => $attribute )
{
if ( Type::INIT_SQL === $attribute->getType() )
{
$out[] = $attributeName;
}
}
return $out;
} | php | public function getSQLParamNames() : array
{
$out = [];
foreach ( $this->_attributes as $attributeName => $attribute )
{
if ( Type::INIT_SQL === $attribute->getType() )
{
$out[] = $attributeName;
}
}
return $out;
} | [
"public",
"function",
"getSQLParamNames",
"(",
")",
":",
"array",
"{",
"$",
"out",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"_attributes",
"as",
"$",
"attributeName",
"=>",
"$",
"attribute",
")",
"{",
"if",
"(",
"Type",
"::",
"INIT_SQL",
... | Gets the names of the parameters that should be used as SQL queries, called after connection open.
@return array | [
"Gets",
"the",
"names",
"of",
"the",
"parameters",
"that",
"should",
"be",
"used",
"as",
"SQL",
"queries",
"called",
"after",
"connection",
"open",
"."
] | 72741fc06293f9f0ee408ebb1ccc18af53a35330 | https://github.com/Niirrty/Niirrty.DB/blob/72741fc06293f9f0ee408ebb1ccc18af53a35330/src/Driver/Attribute/Support.php#L377-L392 |
10,520 | Niirrty/Niirrty.DB | src/Driver/Attribute/Support.php | Support.validate | public function validate( string $attributeName, $attributeValue ) : ValidationResult
{
$result = new ValidationResult();
if ( false === $this->has( $attributeName ) )
{
// Unknown argument name
return $result
->setErrorMessage( 'Unknown Driver attribute name "' . $a... | php | public function validate( string $attributeName, $attributeValue ) : ValidationResult
{
$result = new ValidationResult();
if ( false === $this->has( $attributeName ) )
{
// Unknown argument name
return $result
->setErrorMessage( 'Unknown Driver attribute name "' . $a... | [
"public",
"function",
"validate",
"(",
"string",
"$",
"attributeName",
",",
"$",
"attributeValue",
")",
":",
"ValidationResult",
"{",
"$",
"result",
"=",
"new",
"ValidationResult",
"(",
")",
";",
"if",
"(",
"false",
"===",
"$",
"this",
"->",
"has",
"(",
... | Validates a Driver argument with defined name and value. At least it checks if the Driver knows the
argument and if the value is valid.
@param string $attributeName
@param $attributeValue
@return \Niirrty\DB\Driver\Attribute\ValidationResult | [
"Validates",
"a",
"Driver",
"argument",
"with",
"defined",
"name",
"and",
"value",
".",
"At",
"least",
"it",
"checks",
"if",
"the",
"Driver",
"knows",
"the",
"argument",
"and",
"if",
"the",
"value",
"is",
"valid",
"."
] | 72741fc06293f9f0ee408ebb1ccc18af53a35330 | https://github.com/Niirrty/Niirrty.DB/blob/72741fc06293f9f0ee408ebb1ccc18af53a35330/src/Driver/Attribute/Support.php#L402-L435 |
10,521 | ManifestWebDesign/dabl-adapter | src/Propel/Model/Database.php | Database.addTable | public function addTable($data)
{
if ($data instanceof Table) {
$tbl = $data; // alias
$tbl->setDatabase($this);
if ($tbl->getSchema() === null) $tbl->setSchema($this->getSchema());
if (isset($this->tablesByName[$tbl->getName()])) {
return;
// throw new EngineException("Duplicate table declared: "... | php | public function addTable($data)
{
if ($data instanceof Table) {
$tbl = $data; // alias
$tbl->setDatabase($this);
if ($tbl->getSchema() === null) $tbl->setSchema($this->getSchema());
if (isset($this->tablesByName[$tbl->getName()])) {
return;
// throw new EngineException("Duplicate table declared: "... | [
"public",
"function",
"addTable",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"$",
"data",
"instanceof",
"Table",
")",
"{",
"$",
"tbl",
"=",
"$",
"data",
";",
"// alias",
"$",
"tbl",
"->",
"setDatabase",
"(",
"$",
"this",
")",
";",
"if",
"(",
"$",
"tb... | An utility method to add a new table from an xml attribute. | [
"An",
"utility",
"method",
"to",
"add",
"a",
"new",
"table",
"from",
"an",
"xml",
"attribute",
"."
] | 98579ed23bec832d764e762ee2f93f0a88ef9cd3 | https://github.com/ManifestWebDesign/dabl-adapter/blob/98579ed23bec832d764e762ee2f93f0a88ef9cd3/src/Propel/Model/Database.php#L366-L400 |
10,522 | bariew/yii2-notice-cms-module | controllers/EmailConfigController.php | EmailConfigController.actionEvents | public function actionEvents()
{
Yii::$app->response->format = Response::FORMAT_JSON;
$result = ($post = Yii::$app->request->post('depdrop_parents'))
? array_flip(ClassCrawler::getEventNames($post[0]))
: [];
$output = [];
foreach ($result as $id => $name) {
... | php | public function actionEvents()
{
Yii::$app->response->format = Response::FORMAT_JSON;
$result = ($post = Yii::$app->request->post('depdrop_parents'))
? array_flip(ClassCrawler::getEventNames($post[0]))
: [];
$output = [];
foreach ($result as $id => $name) {
... | [
"public",
"function",
"actionEvents",
"(",
")",
"{",
"Yii",
"::",
"$",
"app",
"->",
"response",
"->",
"format",
"=",
"Response",
"::",
"FORMAT_JSON",
";",
"$",
"result",
"=",
"(",
"$",
"post",
"=",
"Yii",
"::",
"$",
"app",
"->",
"request",
"->",
"pos... | Returns json event list for form DepDrop widget. | [
"Returns",
"json",
"event",
"list",
"for",
"form",
"DepDrop",
"widget",
"."
] | 1dc9798b3ed2c511937e9d3e44867412c9f5a7b6 | https://github.com/bariew/yii2-notice-cms-module/blob/1dc9798b3ed2c511937e9d3e44867412c9f5a7b6/controllers/EmailConfigController.php#L100-L111 |
10,523 | ppetermann/knight23 | src/Knight23.php | Knight23.run | public function run($argc, $argv)
{
$this->addDefaultCommands();
// @todo place better command parser here
if ($argc == 1) {
$run = $this->getDefaultCommand();
$argv = [];
} else {
$run = $argv[1];
$argv = array_slice($argv, 2);
... | php | public function run($argc, $argv)
{
$this->addDefaultCommands();
// @todo place better command parser here
if ($argc == 1) {
$run = $this->getDefaultCommand();
$argv = [];
} else {
$run = $argv[1];
$argv = array_slice($argv, 2);
... | [
"public",
"function",
"run",
"(",
"$",
"argc",
",",
"$",
"argv",
")",
"{",
"$",
"this",
"->",
"addDefaultCommands",
"(",
")",
";",
"// @todo place better command parser here",
"if",
"(",
"$",
"argc",
"==",
"1",
")",
"{",
"$",
"run",
"=",
"$",
"this",
"... | execute the actuall run | [
"execute",
"the",
"actuall",
"run"
] | 890cae845b45df9d8c7c6dc0b5b334974fb5bd76 | https://github.com/ppetermann/knight23/blob/890cae845b45df9d8c7c6dc0b5b334974fb5bd76/src/Knight23.php#L62-L95 |
10,524 | FiveLab/Transactional | src/Proxy/Generator/ProxyCodeGenerator.php | ProxyCodeGenerator.getProxyMethods | private function getProxyMethods(): array
{
if (null !== $this->reflectionProxyMethods) {
return $this->reflectionProxyMethods;
}
$proxyMethods = [];
$methods = $this->getClassMethods();
foreach ($methods as $method) {
$docComment = $method->getDocCo... | php | private function getProxyMethods(): array
{
if (null !== $this->reflectionProxyMethods) {
return $this->reflectionProxyMethods;
}
$proxyMethods = [];
$methods = $this->getClassMethods();
foreach ($methods as $method) {
$docComment = $method->getDocCo... | [
"private",
"function",
"getProxyMethods",
"(",
")",
":",
"array",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"reflectionProxyMethods",
")",
"{",
"return",
"$",
"this",
"->",
"reflectionProxyMethods",
";",
"}",
"$",
"proxyMethods",
"=",
"[",
"]",
";"... | Get proxy methods
@return array|\ReflectionMethod[] | [
"Get",
"proxy",
"methods"
] | d2a406543f9eab35ad618d7f4436090487508fc9 | https://github.com/FiveLab/Transactional/blob/d2a406543f9eab35ad618d7f4436090487508fc9/src/Proxy/Generator/ProxyCodeGenerator.php#L99-L126 |
10,525 | FiveLab/Transactional | src/Proxy/Generator/ProxyCodeGenerator.php | ProxyCodeGenerator.getClassMethods | private function getClassMethods(): array
{
if (null !== $this->reflectionMethods) {
return $this->reflectionMethods;
}
$this->reflectionMethods = [];
$class = $this->reflectionClass;
do {
$this->reflectionMethods = \array_merge(
$th... | php | private function getClassMethods(): array
{
if (null !== $this->reflectionMethods) {
return $this->reflectionMethods;
}
$this->reflectionMethods = [];
$class = $this->reflectionClass;
do {
$this->reflectionMethods = \array_merge(
$th... | [
"private",
"function",
"getClassMethods",
"(",
")",
":",
"array",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"reflectionMethods",
")",
"{",
"return",
"$",
"this",
"->",
"reflectionMethods",
";",
"}",
"$",
"this",
"->",
"reflectionMethods",
"=",
"[",... | Get all methods from class
@return \ReflectionMethod[] | [
"Get",
"all",
"methods",
"from",
"class"
] | d2a406543f9eab35ad618d7f4436090487508fc9 | https://github.com/FiveLab/Transactional/blob/d2a406543f9eab35ad618d7f4436090487508fc9/src/Proxy/Generator/ProxyCodeGenerator.php#L133-L151 |
10,526 | FiveLab/Transactional | src/Proxy/Generator/ProxyCodeGenerator.php | ProxyCodeGenerator.getAllUseStatementsMarkedAsAnnotation | private function getAllUseStatementsMarkedAsAnnotation(\ReflectionClass $class): array
{
$tokens = \token_get_all(\file_get_contents($class->getFileName()));
$uses = [];
$buffer = '';
$startUseParse = false;
foreach ($tokens as $token) {
if (\is_scalar($token)) ... | php | private function getAllUseStatementsMarkedAsAnnotation(\ReflectionClass $class): array
{
$tokens = \token_get_all(\file_get_contents($class->getFileName()));
$uses = [];
$buffer = '';
$startUseParse = false;
foreach ($tokens as $token) {
if (\is_scalar($token)) ... | [
"private",
"function",
"getAllUseStatementsMarkedAsAnnotation",
"(",
"\\",
"ReflectionClass",
"$",
"class",
")",
":",
"array",
"{",
"$",
"tokens",
"=",
"\\",
"token_get_all",
"(",
"\\",
"file_get_contents",
"(",
"$",
"class",
"->",
"getFileName",
"(",
")",
")",
... | Get all use statements from class
@param \ReflectionClass $class
@return array | [
"Get",
"all",
"use",
"statements",
"from",
"class"
] | d2a406543f9eab35ad618d7f4436090487508fc9 | https://github.com/FiveLab/Transactional/blob/d2a406543f9eab35ad618d7f4436090487508fc9/src/Proxy/Generator/ProxyCodeGenerator.php#L160-L240 |
10,527 | FiveLab/Transactional | src/Proxy/Generator/ProxyCodeGenerator.php | ProxyCodeGenerator.generateProxyClass | private function generateProxyClass(): string
{
$class = $this->reflectionClass;
if ($class->isFinal()) {
throw new \RuntimeException(sprintf(
'Can not generate proxy for final class "%s".',
$class->getName()
));
}
if ($class-... | php | private function generateProxyClass(): string
{
$class = $this->reflectionClass;
if ($class->isFinal()) {
throw new \RuntimeException(sprintf(
'Can not generate proxy for final class "%s".',
$class->getName()
));
}
if ($class-... | [
"private",
"function",
"generateProxyClass",
"(",
")",
":",
"string",
"{",
"$",
"class",
"=",
"$",
"this",
"->",
"reflectionClass",
";",
"if",
"(",
"$",
"class",
"->",
"isFinal",
"(",
")",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"sprintf... | Generate proxy class
@return string | [
"Generate",
"proxy",
"class"
] | d2a406543f9eab35ad618d7f4436090487508fc9 | https://github.com/FiveLab/Transactional/blob/d2a406543f9eab35ad618d7f4436090487508fc9/src/Proxy/Generator/ProxyCodeGenerator.php#L247-L302 |
10,528 | FiveLab/Transactional | src/Proxy/Generator/ProxyCodeGenerator.php | ProxyCodeGenerator.appendTabulationCharacter | private function appendTabulationCharacter($text, $count): string
{
$lines = \explode("\n", $text);
foreach ($lines as $index => $line) {
$lines[$index] = \str_repeat(" ", $count).rtrim($line);
}
return \implode(PHP_EOL, $lines);
} | php | private function appendTabulationCharacter($text, $count): string
{
$lines = \explode("\n", $text);
foreach ($lines as $index => $line) {
$lines[$index] = \str_repeat(" ", $count).rtrim($line);
}
return \implode(PHP_EOL, $lines);
} | [
"private",
"function",
"appendTabulationCharacter",
"(",
"$",
"text",
",",
"$",
"count",
")",
":",
"string",
"{",
"$",
"lines",
"=",
"\\",
"explode",
"(",
"\"\\n\"",
",",
"$",
"text",
")",
";",
"foreach",
"(",
"$",
"lines",
"as",
"$",
"index",
"=>",
... | Append tabulation character for lines
@param string $text
@param integer $count
@return string | [
"Append",
"tabulation",
"character",
"for",
"lines"
] | d2a406543f9eab35ad618d7f4436090487508fc9 | https://github.com/FiveLab/Transactional/blob/d2a406543f9eab35ad618d7f4436090487508fc9/src/Proxy/Generator/ProxyCodeGenerator.php#L532-L541 |
10,529 | cube-group/myaf-utils | src/FileUtil.php | FileUtil.move | public static function move($source, $des)
{
if (!is_file($source)) {
return false;
}
try {
@rename($source, $des);
return true;
} catch (\Exception $e) {
return false;
}
} | php | public static function move($source, $des)
{
if (!is_file($source)) {
return false;
}
try {
@rename($source, $des);
return true;
} catch (\Exception $e) {
return false;
}
} | [
"public",
"static",
"function",
"move",
"(",
"$",
"source",
",",
"$",
"des",
")",
"{",
"if",
"(",
"!",
"is_file",
"(",
"$",
"source",
")",
")",
"{",
"return",
"false",
";",
"}",
"try",
"{",
"@",
"rename",
"(",
"$",
"source",
",",
"$",
"des",
")... | move the file or dir.
@param $source
@param $des
@return bool | [
"move",
"the",
"file",
"or",
"dir",
"."
] | febc3e1936ebdf763cf5478647e5ba22b3fd2812 | https://github.com/cube-group/myaf-utils/blob/febc3e1936ebdf763cf5478647e5ba22b3fd2812/src/FileUtil.php#L21-L32 |
10,530 | cube-group/myaf-utils | src/FileUtil.php | FileUtil.copy | public static function copy($source, $des)
{
if (!is_file($source)) {
return false;
}
try {
@copy($source, $des);
return true;
} catch (\Exception $e) {
return false;
}
} | php | public static function copy($source, $des)
{
if (!is_file($source)) {
return false;
}
try {
@copy($source, $des);
return true;
} catch (\Exception $e) {
return false;
}
} | [
"public",
"static",
"function",
"copy",
"(",
"$",
"source",
",",
"$",
"des",
")",
"{",
"if",
"(",
"!",
"is_file",
"(",
"$",
"source",
")",
")",
"{",
"return",
"false",
";",
"}",
"try",
"{",
"@",
"copy",
"(",
"$",
"source",
",",
"$",
"des",
")",... | copy the file.
@param $source
@param $des
@return bool | [
"copy",
"the",
"file",
"."
] | febc3e1936ebdf763cf5478647e5ba22b3fd2812 | https://github.com/cube-group/myaf-utils/blob/febc3e1936ebdf763cf5478647e5ba22b3fd2812/src/FileUtil.php#L41-L52 |
10,531 | cube-group/myaf-utils | src/FileUtil.php | FileUtil.remove | public static function remove($source)
{
if (!is_file($source)) {
return false;
}
try {
@unlink($source);
return true;
} catch (\Exception $e) {
return false;
}
} | php | public static function remove($source)
{
if (!is_file($source)) {
return false;
}
try {
@unlink($source);
return true;
} catch (\Exception $e) {
return false;
}
} | [
"public",
"static",
"function",
"remove",
"(",
"$",
"source",
")",
"{",
"if",
"(",
"!",
"is_file",
"(",
"$",
"source",
")",
")",
"{",
"return",
"false",
";",
"}",
"try",
"{",
"@",
"unlink",
"(",
"$",
"source",
")",
";",
"return",
"true",
";",
"}"... | delete the file.
@param $source
@return bool | [
"delete",
"the",
"file",
"."
] | febc3e1936ebdf763cf5478647e5ba22b3fd2812 | https://github.com/cube-group/myaf-utils/blob/febc3e1936ebdf763cf5478647e5ba22b3fd2812/src/FileUtil.php#L60-L71 |
10,532 | cube-group/myaf-utils | src/FileUtil.php | FileUtil.create | public static function create($source, $data)
{
try {
$file = @fopen($source, 'w');
@fwrite($file, $data);
@fclose($file);
return true;
} catch (\Exception $e) {
return false;
}
} | php | public static function create($source, $data)
{
try {
$file = @fopen($source, 'w');
@fwrite($file, $data);
@fclose($file);
return true;
} catch (\Exception $e) {
return false;
}
} | [
"public",
"static",
"function",
"create",
"(",
"$",
"source",
",",
"$",
"data",
")",
"{",
"try",
"{",
"$",
"file",
"=",
"@",
"fopen",
"(",
"$",
"source",
",",
"'w'",
")",
";",
"@",
"fwrite",
"(",
"$",
"file",
",",
"$",
"data",
")",
";",
"@",
... | create the file.
@param $source
@param $data
@return bool | [
"create",
"the",
"file",
"."
] | febc3e1936ebdf763cf5478647e5ba22b3fd2812 | https://github.com/cube-group/myaf-utils/blob/febc3e1936ebdf763cf5478647e5ba22b3fd2812/src/FileUtil.php#L80-L90 |
10,533 | cube-group/myaf-utils | src/FileUtil.php | FileUtil.append | public static function append($source, $data)
{
try {
if (is_file($source)) {
$file = @fopen($source, 'a');
@fwrite($file, $data);
@fclose($file);
return true;
}
} catch (\Exception $e) {
}
return... | php | public static function append($source, $data)
{
try {
if (is_file($source)) {
$file = @fopen($source, 'a');
@fwrite($file, $data);
@fclose($file);
return true;
}
} catch (\Exception $e) {
}
return... | [
"public",
"static",
"function",
"append",
"(",
"$",
"source",
",",
"$",
"data",
")",
"{",
"try",
"{",
"if",
"(",
"is_file",
"(",
"$",
"source",
")",
")",
"{",
"$",
"file",
"=",
"@",
"fopen",
"(",
"$",
"source",
",",
"'a'",
")",
";",
"@",
"fwrit... | append the content to the file.
@param $source
@param $data
@return bool | [
"append",
"the",
"content",
"to",
"the",
"file",
"."
] | febc3e1936ebdf763cf5478647e5ba22b3fd2812 | https://github.com/cube-group/myaf-utils/blob/febc3e1936ebdf763cf5478647e5ba22b3fd2812/src/FileUtil.php#L99-L111 |
10,534 | cube-group/myaf-utils | src/FileUtil.php | FileUtil.read | public static function read($source, $length = 0)
{
if (!is_file($source) || !is_readable($source)) {
return false;
}
try {
if ($length <= 0 || $length > filesize($source)) {
return file_get_contents($source);
}
$file = @fopen(... | php | public static function read($source, $length = 0)
{
if (!is_file($source) || !is_readable($source)) {
return false;
}
try {
if ($length <= 0 || $length > filesize($source)) {
return file_get_contents($source);
}
$file = @fopen(... | [
"public",
"static",
"function",
"read",
"(",
"$",
"source",
",",
"$",
"length",
"=",
"0",
")",
"{",
"if",
"(",
"!",
"is_file",
"(",
"$",
"source",
")",
"||",
"!",
"is_readable",
"(",
"$",
"source",
")",
")",
"{",
"return",
"false",
";",
"}",
"try... | read the content from the fle.
@param $source
@param $length int
@return bool|string | [
"read",
"the",
"content",
"from",
"the",
"fle",
"."
] | febc3e1936ebdf763cf5478647e5ba22b3fd2812 | https://github.com/cube-group/myaf-utils/blob/febc3e1936ebdf763cf5478647e5ba22b3fd2812/src/FileUtil.php#L120-L137 |
10,535 | cube-group/myaf-utils | src/FileUtil.php | FileUtil.saveInputAsFile | public static function saveInputAsFile($content, $tmpDir = '', $key = '')
{
if (!$tmpDir) {
$tmpDir = ini_get('upload_tmp_dir');
}
if (!is_dir($tmpDir)) {
return false;
}
if (!$key) {
$key = uniqid();
}
if (!$content) {
... | php | public static function saveInputAsFile($content, $tmpDir = '', $key = '')
{
if (!$tmpDir) {
$tmpDir = ini_get('upload_tmp_dir');
}
if (!is_dir($tmpDir)) {
return false;
}
if (!$key) {
$key = uniqid();
}
if (!$content) {
... | [
"public",
"static",
"function",
"saveInputAsFile",
"(",
"$",
"content",
",",
"$",
"tmpDir",
"=",
"''",
",",
"$",
"key",
"=",
"''",
")",
"{",
"if",
"(",
"!",
"$",
"tmpDir",
")",
"{",
"$",
"tmpDir",
"=",
"ini_get",
"(",
"'upload_tmp_dir'",
")",
";",
... | put the format php input stream into the temporary file.
return [
['name'=>'file name','path'=>'/var/cache/a.txt']
];
@param $content string
@param $tmpDir string
@param $key string
@return array|bool
@throws \Exception | [
"put",
"the",
"format",
"php",
"input",
"stream",
"into",
"the",
"temporary",
"file",
"."
] | febc3e1936ebdf763cf5478647e5ba22b3fd2812 | https://github.com/cube-group/myaf-utils/blob/febc3e1936ebdf763cf5478647e5ba22b3fd2812/src/FileUtil.php#L188-L208 |
10,536 | Djeg/Minibus | src/Knp/Minibus/Line/Line.php | Line.lead | public function lead(MinibusInterface $minibus)
{
// start the lead.
$startEvent = $this->eventFactory->createStart($minibus);
$this->dispatcher->dispatch(LineEvents::START, $startEvent);
$minibus = $startEvent->getMinibus();
// launch the stations
foreach ($this->s... | php | public function lead(MinibusInterface $minibus)
{
// start the lead.
$startEvent = $this->eventFactory->createStart($minibus);
$this->dispatcher->dispatch(LineEvents::START, $startEvent);
$minibus = $startEvent->getMinibus();
// launch the stations
foreach ($this->s... | [
"public",
"function",
"lead",
"(",
"MinibusInterface",
"$",
"minibus",
")",
"{",
"// start the lead.",
"$",
"startEvent",
"=",
"$",
"this",
"->",
"eventFactory",
"->",
"createStart",
"(",
"$",
"minibus",
")",
";",
"$",
"this",
"->",
"dispatcher",
"->",
"disp... | Lead the minibus thrie all the stations. If you have defined a Terminus
then the terminus resolved data should be return else the minibus is return.
This method also dispatch events
@see LineEvents
@param Minibus $minibus
@return Minibus|mixed | [
"Lead",
"the",
"minibus",
"thrie",
"all",
"the",
"stations",
".",
"If",
"you",
"have",
"defined",
"a",
"Terminus",
"then",
"the",
"terminus",
"resolved",
"data",
"should",
"be",
"return",
"else",
"the",
"minibus",
"is",
"return",
".",
"This",
"method",
"al... | 59a9c348469294fc97f305cd5002e488e8b12370 | https://github.com/Djeg/Minibus/blob/59a9c348469294fc97f305cd5002e488e8b12370/src/Knp/Minibus/Line/Line.php#L82-L133 |
10,537 | themichaelhall/bluemvc-core | src/Base/AbstractRequest.php | AbstractRequest.getCookieValue | public function getCookieValue(string $name): ?string
{
$cookie = $this->cookies->get($name);
return $cookie !== null ? $cookie->getValue() : null;
} | php | public function getCookieValue(string $name): ?string
{
$cookie = $this->cookies->get($name);
return $cookie !== null ? $cookie->getValue() : null;
} | [
"public",
"function",
"getCookieValue",
"(",
"string",
"$",
"name",
")",
":",
"?",
"string",
"{",
"$",
"cookie",
"=",
"$",
"this",
"->",
"cookies",
"->",
"get",
"(",
"$",
"name",
")",
";",
"return",
"$",
"cookie",
"!==",
"null",
"?",
"$",
"cookie",
... | Returns the cookie value by cookie name if it exists, null otherwise.
@since 1.1.0
@param string $name The cookie name.
@return string|null The cookie value by cookie name if it exists, false otherwise. | [
"Returns",
"the",
"cookie",
"value",
"by",
"cookie",
"name",
"if",
"it",
"exists",
"null",
"otherwise",
"."
] | cbc8ccf8ed4f15ec6105837b29c2bd3db3f93680 | https://github.com/themichaelhall/bluemvc-core/blob/cbc8ccf8ed4f15ec6105837b29c2bd3db3f93680/src/Base/AbstractRequest.php#L80-L85 |
10,538 | themichaelhall/bluemvc-core | src/Base/AbstractRequest.php | AbstractRequest.getReferrer | public function getReferrer(): ?UrlInterface
{
$referrerHeader = $this->getHeader('Referer');
if ($referrerHeader === null) {
return null;
}
return Url::tryParse($referrerHeader);
} | php | public function getReferrer(): ?UrlInterface
{
$referrerHeader = $this->getHeader('Referer');
if ($referrerHeader === null) {
return null;
}
return Url::tryParse($referrerHeader);
} | [
"public",
"function",
"getReferrer",
"(",
")",
":",
"?",
"UrlInterface",
"{",
"$",
"referrerHeader",
"=",
"$",
"this",
"->",
"getHeader",
"(",
"'Referer'",
")",
";",
"if",
"(",
"$",
"referrerHeader",
"===",
"null",
")",
"{",
"return",
"null",
";",
"}",
... | Returns the referrer or null if request has no or invalid referrer.
@since 1.1.0
@return UrlInterface|null The referrer or null if request has no or invalid referrer. | [
"Returns",
"the",
"referrer",
"or",
"null",
"if",
"request",
"has",
"no",
"or",
"invalid",
"referrer",
"."
] | cbc8ccf8ed4f15ec6105837b29c2bd3db3f93680 | https://github.com/themichaelhall/bluemvc-core/blob/cbc8ccf8ed4f15ec6105837b29c2bd3db3f93680/src/Base/AbstractRequest.php#L196-L204 |
10,539 | themichaelhall/bluemvc-core | src/Base/AbstractRequest.php | AbstractRequest.setSessionItem | public function setSessionItem(string $name, $value): void
{
$this->sessionItems->set($name, $value);
} | php | public function setSessionItem(string $name, $value): void
{
$this->sessionItems->set($name, $value);
} | [
"public",
"function",
"setSessionItem",
"(",
"string",
"$",
"name",
",",
"$",
"value",
")",
":",
"void",
"{",
"$",
"this",
"->",
"sessionItems",
"->",
"set",
"(",
"$",
"name",
",",
"$",
"value",
")",
";",
"}"
] | Sets a session item.
@since 2.0.0
@param string $name The session item name.
@param mixed $value The session item value. | [
"Sets",
"a",
"session",
"item",
"."
] | cbc8ccf8ed4f15ec6105837b29c2bd3db3f93680 | https://github.com/themichaelhall/bluemvc-core/blob/cbc8ccf8ed4f15ec6105837b29c2bd3db3f93680/src/Base/AbstractRequest.php#L302-L305 |
10,540 | phplegends/legion | src/Routing/Dispatcher.php | Dispatcher.buildRouteAction | protected function buildRouteAction(Route $route)
{
$action = $route->getAction();
if ($action instanceof \Closure) {
$controller = new Controller();
return $action->bindTo($controller, get_class($controller));
}
list ($class, $method) = $action;
... | php | protected function buildRouteAction(Route $route)
{
$action = $route->getAction();
if ($action instanceof \Closure) {
$controller = new Controller();
return $action->bindTo($controller, get_class($controller));
}
list ($class, $method) = $action;
... | [
"protected",
"function",
"buildRouteAction",
"(",
"Route",
"$",
"route",
")",
"{",
"$",
"action",
"=",
"$",
"route",
"->",
"getAction",
"(",
")",
";",
"if",
"(",
"$",
"action",
"instanceof",
"\\",
"Closure",
")",
"{",
"$",
"controller",
"=",
"new",
"Co... | Overwrites buildRouteAction of Trait
@param PHPLegends\Routes\Route $route
@return callable | [
"Overwrites",
"buildRouteAction",
"of",
"Trait"
] | 270eae47bdb27abda0d77d07f8af0fdf99c86ef1 | https://github.com/phplegends/legion/blob/270eae47bdb27abda0d77d07f8af0fdf99c86ef1/src/Routing/Dispatcher.php#L127-L143 |
10,541 | nice-php/doctrine-key-value | src/Extension/DoctrineKeyValueExtension.php | DoctrineKeyValueExtension.configureStorage | private function configureStorage(array $config, ContainerBuilder $container)
{
$container->register('doctrine.key_value.storage', 'Doctrine\KeyValueStore\Storage\DoctrineCacheStorage')
->setPublic(false)
->addArgument(new Reference('cache.' . $config['cache_driver']));
} | php | private function configureStorage(array $config, ContainerBuilder $container)
{
$container->register('doctrine.key_value.storage', 'Doctrine\KeyValueStore\Storage\DoctrineCacheStorage')
->setPublic(false)
->addArgument(new Reference('cache.' . $config['cache_driver']));
} | [
"private",
"function",
"configureStorage",
"(",
"array",
"$",
"config",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"container",
"->",
"register",
"(",
"'doctrine.key_value.storage'",
",",
"'Doctrine\\KeyValueStore\\Storage\\DoctrineCacheStorage'",
")",
"->"... | Configure the data store.
@param array $config
@param ContainerBuilder $container | [
"Configure",
"the",
"data",
"store",
"."
] | dbfa2bce94c940f2384737a64b42729cfcc141cd | https://github.com/nice-php/doctrine-key-value/blob/dbfa2bce94c940f2384737a64b42729cfcc141cd/src/Extension/DoctrineKeyValueExtension.php#L64-L69 |
10,542 | nice-php/doctrine-key-value | src/Extension/DoctrineKeyValueExtension.php | DoctrineKeyValueExtension.configureMetadataDriver | private function configureMetadataDriver(array $config, ContainerBuilder $container)
{
$container->register('doctrine.key_value.metadata.annotation.reader', 'Doctrine\Common\Annotations\AnnotationReader')
->setPublic(false);
$container->register('doctrine.key_value.metadata.annotation',... | php | private function configureMetadataDriver(array $config, ContainerBuilder $container)
{
$container->register('doctrine.key_value.metadata.annotation.reader', 'Doctrine\Common\Annotations\AnnotationReader')
->setPublic(false);
$container->register('doctrine.key_value.metadata.annotation',... | [
"private",
"function",
"configureMetadataDriver",
"(",
"array",
"$",
"config",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"container",
"->",
"register",
"(",
"'doctrine.key_value.metadata.annotation.reader'",
",",
"'Doctrine\\Common\\Annotations\\AnnotationRead... | Configure the metadata driver.
@param array $config
@param ContainerBuilder $container | [
"Configure",
"the",
"metadata",
"driver",
"."
] | dbfa2bce94c940f2384737a64b42729cfcc141cd | https://github.com/nice-php/doctrine-key-value/blob/dbfa2bce94c940f2384737a64b42729cfcc141cd/src/Extension/DoctrineKeyValueExtension.php#L77-L85 |
10,543 | nice-php/doctrine-key-value | src/Extension/DoctrineKeyValueExtension.php | DoctrineKeyValueExtension.configureEntityManager | private function configureEntityManager(array $config, ContainerBuilder $container)
{
$container->register('doctrine.key_value.configuration', 'Doctrine\KeyValueStore\Configuration')
->addMethodCall('setMappingDriverImpl', array(new Reference('doctrine.key_value.metadata.annotation')));
... | php | private function configureEntityManager(array $config, ContainerBuilder $container)
{
$container->register('doctrine.key_value.configuration', 'Doctrine\KeyValueStore\Configuration')
->addMethodCall('setMappingDriverImpl', array(new Reference('doctrine.key_value.metadata.annotation')));
... | [
"private",
"function",
"configureEntityManager",
"(",
"array",
"$",
"config",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"container",
"->",
"register",
"(",
"'doctrine.key_value.configuration'",
",",
"'Doctrine\\KeyValueStore\\Configuration'",
")",
"->",
... | Configure the entity manager.
@param array $config
@param ContainerBuilder $container | [
"Configure",
"the",
"entity",
"manager",
"."
] | dbfa2bce94c940f2384737a64b42729cfcc141cd | https://github.com/nice-php/doctrine-key-value/blob/dbfa2bce94c940f2384737a64b42729cfcc141cd/src/Extension/DoctrineKeyValueExtension.php#L93-L101 |
10,544 | xjtuana-dev/xjtu-api-php | lib/XjtuApi.php | XjtuApi.http | protected function http() {
// 若$this->http不是\GuzzleHttp\Client实例,则创建一个
if (!$this->http instanceof Client) {
$this->http = new Client(
array_merge(
[ 'base_uri' => $this->url ],
$this->options
)
);
}... | php | protected function http() {
// 若$this->http不是\GuzzleHttp\Client实例,则创建一个
if (!$this->http instanceof Client) {
$this->http = new Client(
array_merge(
[ 'base_uri' => $this->url ],
$this->options
)
);
}... | [
"protected",
"function",
"http",
"(",
")",
"{",
"// 若$this->http不是\\GuzzleHttp\\Client实例,则创建一个",
"if",
"(",
"!",
"$",
"this",
"->",
"http",
"instanceof",
"Client",
")",
"{",
"$",
"this",
"->",
"http",
"=",
"new",
"Client",
"(",
"array_merge",
"(",
"[",
"'bas... | Get the http client instance
@return \GuzzleHttp\Client | [
"Get",
"the",
"http",
"client",
"instance"
] | e9cc1574b7546d9e35abda27bfabe251a639d547 | https://github.com/xjtuana-dev/xjtu-api-php/blob/e9cc1574b7546d9e35abda27bfabe251a639d547/lib/XjtuApi.php#L68-L80 |
10,545 | xloit/xloit-bridge-zend-authentication | src/AuthenticationService.php | AuthenticationService.getEvent | public function getEvent()
{
if (null === $this->event) {
$event = new AuthenticationEvent();
$this->setEvent($event);
}
return $this->event;
} | php | public function getEvent()
{
if (null === $this->event) {
$event = new AuthenticationEvent();
$this->setEvent($event);
}
return $this->event;
} | [
"public",
"function",
"getEvent",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"event",
")",
"{",
"$",
"event",
"=",
"new",
"AuthenticationEvent",
"(",
")",
";",
"$",
"this",
"->",
"setEvent",
"(",
"$",
"event",
")",
";",
"}",
"retur... | Get the auth event.
@return AuthenticationEvent
@throws \Zend\EventManager\Exception\InvalidArgumentException | [
"Get",
"the",
"auth",
"event",
"."
] | 299c6ad8d5756c8db040b39a50ecfcc137c42b72 | https://github.com/xloit/xloit-bridge-zend-authentication/blob/299c6ad8d5756c8db040b39a50ecfcc137c42b72/src/AuthenticationService.php#L164-L173 |
10,546 | xloit/xloit-bridge-zend-authentication | src/AuthenticationService.php | AuthenticationService.setEvent | public function setEvent(EventInterface $event)
{
$target = $this;
if (!($event instanceof AuthenticationEvent)) {
$eventParams = $event->getParams();
$eventTarget = $event->getTarget();
if ($eventTarget) {
$target = $eventTarget;
}
... | php | public function setEvent(EventInterface $event)
{
$target = $this;
if (!($event instanceof AuthenticationEvent)) {
$eventParams = $event->getParams();
$eventTarget = $event->getTarget();
if ($eventTarget) {
$target = $eventTarget;
}
... | [
"public",
"function",
"setEvent",
"(",
"EventInterface",
"$",
"event",
")",
"{",
"$",
"target",
"=",
"$",
"this",
";",
"if",
"(",
"!",
"(",
"$",
"event",
"instanceof",
"AuthenticationEvent",
")",
")",
"{",
"$",
"eventParams",
"=",
"$",
"event",
"->",
"... | Set an event to use during dispatch.
By default, will re-cast to AdapterChainEvent if another event type is provided.
@param EventInterface $event
@return $this
@throws \Zend\EventManager\Exception\InvalidArgumentException | [
"Set",
"an",
"event",
"to",
"use",
"during",
"dispatch",
".",
"By",
"default",
"will",
"re",
"-",
"cast",
"to",
"AdapterChainEvent",
"if",
"another",
"event",
"type",
"is",
"provided",
"."
] | 299c6ad8d5756c8db040b39a50ecfcc137c42b72 | https://github.com/xloit/xloit-bridge-zend-authentication/blob/299c6ad8d5756c8db040b39a50ecfcc137c42b72/src/AuthenticationService.php#L184-L206 |
10,547 | xloit/xloit-bridge-zend-authentication | src/AuthenticationService.php | AuthenticationService.sign | public function sign($username, $password, Adapter\AdapterInterface $adapter = null, Request $request = null)
{
/** @var Adapter\AdapterInterface $adapter */
/** @noinspection CallableParameterUseCaseInTypeContextInspection */
$adapter = $adapter ?: $this->getAdapter();
$adapter->se... | php | public function sign($username, $password, Adapter\AdapterInterface $adapter = null, Request $request = null)
{
/** @var Adapter\AdapterInterface $adapter */
/** @noinspection CallableParameterUseCaseInTypeContextInspection */
$adapter = $adapter ?: $this->getAdapter();
$adapter->se... | [
"public",
"function",
"sign",
"(",
"$",
"username",
",",
"$",
"password",
",",
"Adapter",
"\\",
"AdapterInterface",
"$",
"adapter",
"=",
"null",
",",
"Request",
"$",
"request",
"=",
"null",
")",
"{",
"/** @var Adapter\\AdapterInterface $adapter */",
"/** @noinspec... | Sign-in and provides an authentication result.
@param string $username
@param string $password
@param Adapter\AdapterInterface|null $adapter
@param Request $request
@return AuthenticationResult
@throws \Xloit\Bridge\Zend\Authentication\Exception\Auth... | [
"Sign",
"-",
"in",
"and",
"provides",
"an",
"authentication",
"result",
"."
] | 299c6ad8d5756c8db040b39a50ecfcc137c42b72 | https://github.com/xloit/xloit-bridge-zend-authentication/blob/299c6ad8d5756c8db040b39a50ecfcc137c42b72/src/AuthenticationService.php#L301-L311 |
10,548 | xloit/xloit-bridge-zend-authentication | src/AuthenticationService.php | AuthenticationService.logout | public function logout(Adapter\AdapterInterface $adapter = null, Request $request = null)
{
$event = $this->prepareEvent($adapter, $request);
$event->setResult($event->getAdapter()->logout());
$this->clearIdentity();
return $this->triggerEventResult(AuthenticationEvent::AUTH_LOGOU... | php | public function logout(Adapter\AdapterInterface $adapter = null, Request $request = null)
{
$event = $this->prepareEvent($adapter, $request);
$event->setResult($event->getAdapter()->logout());
$this->clearIdentity();
return $this->triggerEventResult(AuthenticationEvent::AUTH_LOGOU... | [
"public",
"function",
"logout",
"(",
"Adapter",
"\\",
"AdapterInterface",
"$",
"adapter",
"=",
"null",
",",
"Request",
"$",
"request",
"=",
"null",
")",
"{",
"$",
"event",
"=",
"$",
"this",
"->",
"prepareEvent",
"(",
"$",
"adapter",
",",
"$",
"request",
... | Logout and provides an authentication result.
@param Adapter\AdapterInterface|null $adapter
@param Request $request
@return AuthenticationResult
@throws \Xloit\Bridge\Zend\Authentication\Exception\AuthenticationStopException
@throws \Xloit\Bridge\Zend\Authentication\Exception\RuntimeException
@t... | [
"Logout",
"and",
"provides",
"an",
"authentication",
"result",
"."
] | 299c6ad8d5756c8db040b39a50ecfcc137c42b72 | https://github.com/xloit/xloit-bridge-zend-authentication/blob/299c6ad8d5756c8db040b39a50ecfcc137c42b72/src/AuthenticationService.php#L325-L334 |
10,549 | AthensFramework/Core | src/field/Field.php | Field.getSubmitted | public function getSubmitted()
{
$fieldType = $this->getType();
$data = array_key_exists($this->getSlug(), $_POST) === true ? $_POST[$this->getSlug()]: "";
if (in_array($fieldType, [static::TYPE_CHOICE, static::TYPE_MULTIPLE_CHOICE]) === true) {
$data = $this->parseChoiceSlugs(... | php | public function getSubmitted()
{
$fieldType = $this->getType();
$data = array_key_exists($this->getSlug(), $_POST) === true ? $_POST[$this->getSlug()]: "";
if (in_array($fieldType, [static::TYPE_CHOICE, static::TYPE_MULTIPLE_CHOICE]) === true) {
$data = $this->parseChoiceSlugs(... | [
"public",
"function",
"getSubmitted",
"(",
")",
"{",
"$",
"fieldType",
"=",
"$",
"this",
"->",
"getType",
"(",
")",
";",
"$",
"data",
"=",
"array_key_exists",
"(",
"$",
"this",
"->",
"getSlug",
"(",
")",
",",
"$",
"_POST",
")",
"===",
"true",
"?",
... | Provides the data that was submitted to this field, if applicable.
@return string | [
"Provides",
"the",
"data",
"that",
"was",
"submitted",
"to",
"this",
"field",
"if",
"applicable",
"."
] | 6237b914b9f6aef6b2fcac23094b657a86185340 | https://github.com/AthensFramework/Core/blob/6237b914b9f6aef6b2fcac23094b657a86185340/src/field/Field.php#L116-L135 |
10,550 | AthensFramework/Core | src/field/Field.php | Field.getChoiceSlugs | protected function getChoiceSlugs()
{
$choiceSlugs = [];
foreach ($this->choices as $index => $choice) {
$choiceSlugs[] = StringUtils::slugify("$index-{$choice->getAlias()}");
}
return $choiceSlugs;
} | php | protected function getChoiceSlugs()
{
$choiceSlugs = [];
foreach ($this->choices as $index => $choice) {
$choiceSlugs[] = StringUtils::slugify("$index-{$choice->getAlias()}");
}
return $choiceSlugs;
} | [
"protected",
"function",
"getChoiceSlugs",
"(",
")",
"{",
"$",
"choiceSlugs",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"choices",
"as",
"$",
"index",
"=>",
"$",
"choice",
")",
"{",
"$",
"choiceSlugs",
"[",
"]",
"=",
"StringUtils",
"::",
... | Provides the slugs which shall be used to identify valid submissions to this field.
@return string[] | [
"Provides",
"the",
"slugs",
"which",
"shall",
"be",
"used",
"to",
"identify",
"valid",
"submissions",
"to",
"this",
"field",
"."
] | 6237b914b9f6aef6b2fcac23094b657a86185340 | https://github.com/AthensFramework/Core/blob/6237b914b9f6aef6b2fcac23094b657a86185340/src/field/Field.php#L184-L192 |
10,551 | AthensFramework/Core | src/field/Field.php | Field.setInitial | public function setInitial($value)
{
if ($value instanceof DateTime) {
$value = new DateTimeWrapper($value->format('c'));
}
$this->initial = $value;
return $this;
} | php | public function setInitial($value)
{
if ($value instanceof DateTime) {
$value = new DateTimeWrapper($value->format('c'));
}
$this->initial = $value;
return $this;
} | [
"public",
"function",
"setInitial",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"instanceof",
"DateTime",
")",
"{",
"$",
"value",
"=",
"new",
"DateTimeWrapper",
"(",
"$",
"value",
"->",
"format",
"(",
"'c'",
")",
")",
";",
"}",
"$",
"this",... | Sets the initial value to be displayed by the field.
@param string $value
@return FieldInterface | [
"Sets",
"the",
"initial",
"value",
"to",
"be",
"displayed",
"by",
"the",
"field",
"."
] | 6237b914b9f6aef6b2fcac23094b657a86185340 | https://github.com/AthensFramework/Core/blob/6237b914b9f6aef6b2fcac23094b657a86185340/src/field/Field.php#L332-L340 |
10,552 | AthensFramework/Core | src/field/Field.php | Field.validate | public function validate()
{
$data = $this->wasSubmitted() === true ? $this->getSubmitted() : null;
// Invalid selection on choice/multiple choice field
if ($data === []) {
$this->addError("Unrecognized choice.");
}
if ($this->isRequired() === true && $data === ... | php | public function validate()
{
$data = $this->wasSubmitted() === true ? $this->getSubmitted() : null;
// Invalid selection on choice/multiple choice field
if ($data === []) {
$this->addError("Unrecognized choice.");
}
if ($this->isRequired() === true && $data === ... | [
"public",
"function",
"validate",
"(",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"wasSubmitted",
"(",
")",
"===",
"true",
"?",
"$",
"this",
"->",
"getSubmitted",
"(",
")",
":",
"null",
";",
"// Invalid selection on choice/multiple choice field",
"if",
"... | Perform basic validation on the field, add any apparent errors, and
mark valid data.
@return void | [
"Perform",
"basic",
"validation",
"on",
"the",
"field",
"add",
"any",
"apparent",
"errors",
"and",
"mark",
"valid",
"data",
"."
] | 6237b914b9f6aef6b2fcac23094b657a86185340 | https://github.com/AthensFramework/Core/blob/6237b914b9f6aef6b2fcac23094b657a86185340/src/field/Field.php#L393-L409 |
10,553 | InnoGr/FivePercent-Api | src/EventListener/ApiAuthorizationSubscriber.php | ApiAuthorizationSubscriber.authorize | public function authorize(ActionDispatchEvent $event)
{
$callable = $event->getCallable();
if (!$callable->isMethod() && !$callable->isMethodStatic()) {
// Native function or \Closure
return;
}
$class = $callable->getReflection()->getDeclaringClass()->getNam... | php | public function authorize(ActionDispatchEvent $event)
{
$callable = $event->getCallable();
if (!$callable->isMethod() && !$callable->isMethodStatic()) {
// Native function or \Closure
return;
}
$class = $callable->getReflection()->getDeclaringClass()->getNam... | [
"public",
"function",
"authorize",
"(",
"ActionDispatchEvent",
"$",
"event",
")",
"{",
"$",
"callable",
"=",
"$",
"event",
"->",
"getCallable",
"(",
")",
";",
"if",
"(",
"!",
"$",
"callable",
"->",
"isMethod",
"(",
")",
"&&",
"!",
"$",
"callable",
"->"... | Authorize and authenticate on API method
@param ActionDispatchEvent $event | [
"Authorize",
"and",
"authenticate",
"on",
"API",
"method"
] | 57b78ddc3c9d91a7139c276711e5792824ceab9c | https://github.com/InnoGr/FivePercent-Api/blob/57b78ddc3c9d91a7139c276711e5792824ceab9c/src/EventListener/ApiAuthorizationSubscriber.php#L48-L70 |
10,554 | loevgaard/dandomain-foundation-bundle | Updater/DeliveryUpdater.php | DeliveryUpdater.updateFromEmbeddedApiResponse | public function updateFromEmbeddedApiResponse(array $data, DeliveryInterface $delivery = null): DeliveryInterface
{
if (!$delivery) {
$delivery = new Delivery();
}
$delivery
->setAddress($data['address'])
->setAddress2($data['address2'])
->set... | php | public function updateFromEmbeddedApiResponse(array $data, DeliveryInterface $delivery = null): DeliveryInterface
{
if (!$delivery) {
$delivery = new Delivery();
}
$delivery
->setAddress($data['address'])
->setAddress2($data['address2'])
->set... | [
"public",
"function",
"updateFromEmbeddedApiResponse",
"(",
"array",
"$",
"data",
",",
"DeliveryInterface",
"$",
"delivery",
"=",
"null",
")",
":",
"DeliveryInterface",
"{",
"if",
"(",
"!",
"$",
"delivery",
")",
"{",
"$",
"delivery",
"=",
"new",
"Delivery",
... | This method is called when a delivery object is embedded in another object, i.e. orders.
@param array $data
@param DeliveryInterface|null $delivery
@return DeliveryInterface | [
"This",
"method",
"is",
"called",
"when",
"a",
"delivery",
"object",
"is",
"embedded",
"in",
"another",
"object",
"i",
".",
"e",
".",
"orders",
"."
] | f3658aadf499d03f88465aa0b144626866c57b84 | https://github.com/loevgaard/dandomain-foundation-bundle/blob/f3658aadf499d03f88465aa0b144626866c57b84/Updater/DeliveryUpdater.php#L18-L42 |
10,555 | phPoirot/Module-Authorization | src/Authorization/Services/ServiceAuthenticatorsContainer.php | ServiceAuthenticatorsContainer._getConf | protected function _getConf()
{
// retrieve and cache config
$services = $this->services();
/** @var aSapi $config */
$config = $services->get('/sapi');
$orig = $config = $config->config();
/** @var DataEntity $config */
$config = $config->get(\Module\A... | php | protected function _getConf()
{
// retrieve and cache config
$services = $this->services();
/** @var aSapi $config */
$config = $services->get('/sapi');
$orig = $config = $config->config();
/** @var DataEntity $config */
$config = $config->get(\Module\A... | [
"protected",
"function",
"_getConf",
"(",
")",
"{",
"// retrieve and cache config",
"$",
"services",
"=",
"$",
"this",
"->",
"services",
"(",
")",
";",
"/** @var aSapi $config */",
"$",
"config",
"=",
"$",
"services",
"->",
"get",
"(",
"'/sapi'",
")",
";",
"... | Get Config Values
@return mixed|null
@throws \Exception | [
"Get",
"Config",
"Values"
] | 1adcb85d01bb7cfaa6cc6b0cbcb9907ef4778e06 | https://github.com/phPoirot/Module-Authorization/blob/1adcb85d01bb7cfaa6cc6b0cbcb9907ef4778e06/src/Authorization/Services/ServiceAuthenticatorsContainer.php#L43-L60 |
10,556 | asbsoft/yii2-common_2_170212 | i18n/BaseLangHelper.php | BaseLangHelper.activeLanguagesArray | public static function activeLanguagesArray()
{
if (!empty(Yii::$app->langManager) && !empty(Yii::$app->langManager->langsConfig)) {
return Yii::$app->langManager->langsConfig;
} else {
return include(dirname(__DIR__) . '/config/langs-default.php');
}
} | php | public static function activeLanguagesArray()
{
if (!empty(Yii::$app->langManager) && !empty(Yii::$app->langManager->langsConfig)) {
return Yii::$app->langManager->langsConfig;
} else {
return include(dirname(__DIR__) . '/config/langs-default.php');
}
} | [
"public",
"static",
"function",
"activeLanguagesArray",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"Yii",
"::",
"$",
"app",
"->",
"langManager",
")",
"&&",
"!",
"empty",
"(",
"Yii",
"::",
"$",
"app",
"->",
"langManager",
"->",
"langsConfig",
")",
")"... | Get basic active languages array according to sort criteria.
@return array of Lang objects | [
"Get",
"basic",
"active",
"languages",
"array",
"according",
"to",
"sort",
"criteria",
"."
] | 6c58012ff89225d7d4e42b200cf39e009e9d9dac | https://github.com/asbsoft/yii2-common_2_170212/blob/6c58012ff89225d7d4e42b200cf39e009e9d9dac/i18n/BaseLangHelper.php#L18-L25 |
10,557 | asbsoft/yii2-common_2_170212 | i18n/BaseLangHelper.php | BaseLangHelper.findLanguageByCode2 | public static function findLanguageByCode2($langCode2)
{
$langList = static::activeLanguagesArray();
foreach ($langList as $lang) {
if ($lang['code2'] == $langCode2) return $lang;
}
return false;
} | php | public static function findLanguageByCode2($langCode2)
{
$langList = static::activeLanguagesArray();
foreach ($langList as $lang) {
if ($lang['code2'] == $langCode2) return $lang;
}
return false;
} | [
"public",
"static",
"function",
"findLanguageByCode2",
"(",
"$",
"langCode2",
")",
"{",
"$",
"langList",
"=",
"static",
"::",
"activeLanguagesArray",
"(",
")",
";",
"foreach",
"(",
"$",
"langList",
"as",
"$",
"lang",
")",
"{",
"if",
"(",
"$",
"lang",
"["... | Find language by 2-symbols language code
@param string 2-symbols language code
@return Lang|false object | [
"Find",
"language",
"by",
"2",
"-",
"symbols",
"language",
"code"
] | 6c58012ff89225d7d4e42b200cf39e009e9d9dac | https://github.com/asbsoft/yii2-common_2_170212/blob/6c58012ff89225d7d4e42b200cf39e009e9d9dac/i18n/BaseLangHelper.php#L112-L119 |
10,558 | pletfix/core | src/Services/AssetManager.php | AssetManager.build | private function build($dest = null, $plugin = null)
{
if ($plugin !== null) {
/** @noinspection PhpIncludeInspection */
$builds = file_exists($this->pluginManifestOfAssets) ? include $this->pluginManifestOfAssets : [];
if (!isset($builds[$plugin])) {
thro... | php | private function build($dest = null, $plugin = null)
{
if ($plugin !== null) {
/** @noinspection PhpIncludeInspection */
$builds = file_exists($this->pluginManifestOfAssets) ? include $this->pluginManifestOfAssets : [];
if (!isset($builds[$plugin])) {
thro... | [
"private",
"function",
"build",
"(",
"$",
"dest",
"=",
"null",
",",
"$",
"plugin",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"plugin",
"!==",
"null",
")",
"{",
"/** @noinspection PhpIncludeInspection */",
"$",
"builds",
"=",
"file_exists",
"(",
"$",
"this",
... | Get the build information array.
@param string|null $dest
@param string|null $plugin
@return array | [
"Get",
"the",
"build",
"information",
"array",
"."
] | 974945500f278eb6c1779832e08bbfca1007a7b3 | https://github.com/pletfix/core/blob/974945500f278eb6c1779832e08bbfca1007a7b3/src/Services/AssetManager.php#L111-L146 |
10,559 | pletfix/core | src/Services/AssetManager.php | AssetManager.buildUniqueFile | private function buildUniqueFile($file)
{
// be sure the folder public/build is exist
$dir = public_path('build');
if (!file_exists($dir)) {
if (!make_dir($dir, 0755)) { // @codeCoverageIgnore
throw new RuntimeException('Unable to create directory ' . $dir); // @c... | php | private function buildUniqueFile($file)
{
// be sure the folder public/build is exist
$dir = public_path('build');
if (!file_exists($dir)) {
if (!make_dir($dir, 0755)) { // @codeCoverageIgnore
throw new RuntimeException('Unable to create directory ' . $dir); // @c... | [
"private",
"function",
"buildUniqueFile",
"(",
"$",
"file",
")",
"{",
"// be sure the folder public/build is exist",
"$",
"dir",
"=",
"public_path",
"(",
"'build'",
")",
";",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"dir",
")",
")",
"{",
"if",
"(",
"!",
"m... | Build an unique file and update the manifest
@param string $file Name of the file relative to public path. | [
"Build",
"an",
"unique",
"file",
"and",
"update",
"the",
"manifest"
] | 974945500f278eb6c1779832e08bbfca1007a7b3 | https://github.com/pletfix/core/blob/974945500f278eb6c1779832e08bbfca1007a7b3/src/Services/AssetManager.php#L250-L284 |
10,560 | pletfix/core | src/Services/AssetManager.php | AssetManager.removeUniqueFile | private function removeUniqueFile($file)
{
if (!isset($this->manifest[$file])) {
return;
}
// delete unique file
$uniqueFile = public_path($this->manifest[$file]);
if ($uniqueFile !== null && file_exists($uniqueFile)) {
unlink($uniqueFile);
}
... | php | private function removeUniqueFile($file)
{
if (!isset($this->manifest[$file])) {
return;
}
// delete unique file
$uniqueFile = public_path($this->manifest[$file]);
if ($uniqueFile !== null && file_exists($uniqueFile)) {
unlink($uniqueFile);
}
... | [
"private",
"function",
"removeUniqueFile",
"(",
"$",
"file",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"manifest",
"[",
"$",
"file",
"]",
")",
")",
"{",
"return",
";",
"}",
"// delete unique file",
"$",
"uniqueFile",
"=",
"public_path",
... | Remove unique file and update the manifest
@param string $file Name of the file relative to public path. | [
"Remove",
"unique",
"file",
"and",
"update",
"the",
"manifest"
] | 974945500f278eb6c1779832e08bbfca1007a7b3 | https://github.com/pletfix/core/blob/974945500f278eb6c1779832e08bbfca1007a7b3/src/Services/AssetManager.php#L326-L343 |
10,561 | a2c/BaconUserBundle | Controller/GroupController.php | GroupController.listAction | public function listAction()
{
$acl = $this->get('bacon_acl.service.authorization');
if (!$acl->authorize('groups', 'INDEX')) {
throw $this->createAccessDeniedException();
}
$groups = $this->get('fos_user.group_manager')->findGroups();
return $this->render('FOS... | php | public function listAction()
{
$acl = $this->get('bacon_acl.service.authorization');
if (!$acl->authorize('groups', 'INDEX')) {
throw $this->createAccessDeniedException();
}
$groups = $this->get('fos_user.group_manager')->findGroups();
return $this->render('FOS... | [
"public",
"function",
"listAction",
"(",
")",
"{",
"$",
"acl",
"=",
"$",
"this",
"->",
"get",
"(",
"'bacon_acl.service.authorization'",
")",
";",
"if",
"(",
"!",
"$",
"acl",
"->",
"authorize",
"(",
"'groups'",
",",
"'INDEX'",
")",
")",
"{",
"throw",
"$... | Show all groups | [
"Show",
"all",
"groups"
] | 2d192aaa05edabb75b66ce8fae02e436333adc03 | https://github.com/a2c/BaconUserBundle/blob/2d192aaa05edabb75b66ce8fae02e436333adc03/Controller/GroupController.php#L35-L48 |
10,562 | a2c/BaconUserBundle | Controller/GroupController.php | GroupController.showAction | public function showAction($groupName)
{
$acl = $this->get('bacon_acl.service.authorization');
if (!$acl->authorize('groups', 'show')) {
throw $this->createAccessDeniedException();
}
$group = $this->findGroupBy('name', $groupName);
return $this->render('FOSUser... | php | public function showAction($groupName)
{
$acl = $this->get('bacon_acl.service.authorization');
if (!$acl->authorize('groups', 'show')) {
throw $this->createAccessDeniedException();
}
$group = $this->findGroupBy('name', $groupName);
return $this->render('FOSUser... | [
"public",
"function",
"showAction",
"(",
"$",
"groupName",
")",
"{",
"$",
"acl",
"=",
"$",
"this",
"->",
"get",
"(",
"'bacon_acl.service.authorization'",
")",
";",
"if",
"(",
"!",
"$",
"acl",
"->",
"authorize",
"(",
"'groups'",
",",
"'show'",
")",
")",
... | Show one group | [
"Show",
"one",
"group"
] | 2d192aaa05edabb75b66ce8fae02e436333adc03 | https://github.com/a2c/BaconUserBundle/blob/2d192aaa05edabb75b66ce8fae02e436333adc03/Controller/GroupController.php#L53-L66 |
10,563 | a2c/BaconUserBundle | Controller/GroupController.php | GroupController.editAction | public function editAction(Request $request, $groupName)
{
$acl = $this->get('bacon_acl.service.authorization');
if (!$acl->authorize('groups', 'EDIT')) {
throw $this->createAccessDeniedException();
}
$group = $this->findGroupBy('name', $groupName);
/** @var $d... | php | public function editAction(Request $request, $groupName)
{
$acl = $this->get('bacon_acl.service.authorization');
if (!$acl->authorize('groups', 'EDIT')) {
throw $this->createAccessDeniedException();
}
$group = $this->findGroupBy('name', $groupName);
/** @var $d... | [
"public",
"function",
"editAction",
"(",
"Request",
"$",
"request",
",",
"$",
"groupName",
")",
"{",
"$",
"acl",
"=",
"$",
"this",
"->",
"get",
"(",
"'bacon_acl.service.authorization'",
")",
";",
"if",
"(",
"!",
"$",
"acl",
"->",
"authorize",
"(",
"'grou... | Edit one group, show the edit form | [
"Edit",
"one",
"group",
"show",
"the",
"edit",
"form"
] | 2d192aaa05edabb75b66ce8fae02e436333adc03 | https://github.com/a2c/BaconUserBundle/blob/2d192aaa05edabb75b66ce8fae02e436333adc03/Controller/GroupController.php#L71-L129 |
10,564 | a2c/BaconUserBundle | Controller/GroupController.php | GroupController.deleteAction | public function deleteAction(Request $request, $groupName)
{
$acl = $this->get('bacon_acl.service.authorization');
if (!$acl->authorize('groups', 'DELETE')) {
throw $this->createAccessDeniedException();
}
$group = $this->findGroupBy('name', $groupName);
$this->g... | php | public function deleteAction(Request $request, $groupName)
{
$acl = $this->get('bacon_acl.service.authorization');
if (!$acl->authorize('groups', 'DELETE')) {
throw $this->createAccessDeniedException();
}
$group = $this->findGroupBy('name', $groupName);
$this->g... | [
"public",
"function",
"deleteAction",
"(",
"Request",
"$",
"request",
",",
"$",
"groupName",
")",
"{",
"$",
"acl",
"=",
"$",
"this",
"->",
"get",
"(",
"'bacon_acl.service.authorization'",
")",
";",
"if",
"(",
"!",
"$",
"acl",
"->",
"authorize",
"(",
"'gr... | Delete one group | [
"Delete",
"one",
"group"
] | 2d192aaa05edabb75b66ce8fae02e436333adc03 | https://github.com/a2c/BaconUserBundle/blob/2d192aaa05edabb75b66ce8fae02e436333adc03/Controller/GroupController.php#L182-L205 |
10,565 | a2c/BaconUserBundle | Controller/GroupController.php | GroupController.findGroupBy | protected function findGroupBy($key, $value)
{
if (!empty($value)) {
$group = $this->get('fos_user.group_manager')->{'findGroupBy'.ucfirst($key)}($value);
}
if (empty($group)) {
throw new NotFoundHttpException(sprintf('The group with "%s" does not exist for value "%s... | php | protected function findGroupBy($key, $value)
{
if (!empty($value)) {
$group = $this->get('fos_user.group_manager')->{'findGroupBy'.ucfirst($key)}($value);
}
if (empty($group)) {
throw new NotFoundHttpException(sprintf('The group with "%s" does not exist for value "%s... | [
"protected",
"function",
"findGroupBy",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"value",
")",
")",
"{",
"$",
"group",
"=",
"$",
"this",
"->",
"get",
"(",
"'fos_user.group_manager'",
")",
"->",
"{",
"'findGroup... | Find a group by a specific property
@param string $key property name
@param mixed $value property value
@throws NotFoundHttpException if user does not exist
@return \FOS\UserBundle\Model\GroupInterface | [
"Find",
"a",
"group",
"by",
"a",
"specific",
"property"
] | 2d192aaa05edabb75b66ce8fae02e436333adc03 | https://github.com/a2c/BaconUserBundle/blob/2d192aaa05edabb75b66ce8fae02e436333adc03/Controller/GroupController.php#L216-L227 |
10,566 | marando/phpSOFA | src/Marando/IAU/iauUt1utc.php | iauUt1utc.Ut1utc | public static function Ut1utc($ut11, $ut12, $dut1, &$utc1, &$utc2) {
$big1;
$i;
$iy;
$im;
$id;
$js;
$duts;
$u1;
$u2;
$d1;
$dats1;
$d2;
$fd;
$dats2;
$ddats;
$us1;
$us2;
$du;
/* UT1-UTC in seconds. */
$duts = $dut1;
/* Put the two parts... | php | public static function Ut1utc($ut11, $ut12, $dut1, &$utc1, &$utc2) {
$big1;
$i;
$iy;
$im;
$id;
$js;
$duts;
$u1;
$u2;
$d1;
$dats1;
$d2;
$fd;
$dats2;
$ddats;
$us1;
$us2;
$du;
/* UT1-UTC in seconds. */
$duts = $dut1;
/* Put the two parts... | [
"public",
"static",
"function",
"Ut1utc",
"(",
"$",
"ut11",
",",
"$",
"ut12",
",",
"$",
"dut1",
",",
"&",
"$",
"utc1",
",",
"&",
"$",
"utc2",
")",
"{",
"$",
"big1",
";",
"$",
"i",
";",
"$",
"iy",
";",
"$",
"im",
";",
"$",
"id",
";",
"$",
... | - - - - - - - - - -
i a u U t 1 u t c
- - - - - - - - - -
Time scale transformation: Universal Time, UT1, to Coordinated
Universal Time, UTC.
This function is part of the International Astronomical Union's
SOFA (Standards of Fundamental Astronomy) software collection.
Status: canonical.
Given:
ut11,ut12 double ... | [
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"i",
"a",
"u",
"U",
"t",
"1",
"u",
"t",
"c",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-"
] | 757fa49fe335ae1210eaa7735473fd4388b13f07 | https://github.com/marando/phpSOFA/blob/757fa49fe335ae1210eaa7735473fd4388b13f07/src/Marando/IAU/iauUt1utc.php#L78-L170 |
10,567 | zepi/turbo-base | Zepi/Web/General/src/EventHandler/LoadAssetContent.php | LoadAssetContent.deliverContent | protected function deliverContent(Response $response, $type, $hash, $version, $content)
{
// Define the if modified since timestamp
$cachedAssetTimestamp = $this->assetCacheManager->getCachedAssetTimestamp($type, $hash, $version);
$ifModifiedSince = -1;
if ($this->isHeaderSetAndNotEm... | php | protected function deliverContent(Response $response, $type, $hash, $version, $content)
{
// Define the if modified since timestamp
$cachedAssetTimestamp = $this->assetCacheManager->getCachedAssetTimestamp($type, $hash, $version);
$ifModifiedSince = -1;
if ($this->isHeaderSetAndNotEm... | [
"protected",
"function",
"deliverContent",
"(",
"Response",
"$",
"response",
",",
"$",
"type",
",",
"$",
"hash",
",",
"$",
"version",
",",
"$",
"content",
")",
"{",
"// Define the if modified since timestamp",
"$",
"cachedAssetTimestamp",
"=",
"$",
"this",
"->",... | Adds the needed headers and prepares the content
@param \Zepi\Turbo\Response\Response $response
@param string $type
@param string $hash
@param string $version
@param string $content | [
"Adds",
"the",
"needed",
"headers",
"and",
"prepares",
"the",
"content"
] | 9a36d8c7649317f55f91b2adf386bd1f04ec02a3 | https://github.com/zepi/turbo-base/blob/9a36d8c7649317f55f91b2adf386bd1f04ec02a3/Zepi/Web/General/src/EventHandler/LoadAssetContent.php#L115-L153 |
10,568 | zepi/turbo-base | Zepi/Web/General/src/EventHandler/LoadAssetContent.php | LoadAssetContent.getContentType | protected function getContentType($type, $version)
{
if ($type === 'css') {
return 'text/css';
} else if ($type === 'js') {
return 'text/javascript';
} else if ($type === 'image') {
$fileExtension = pathinfo($version, PATHINFO_EXTENSION);
... | php | protected function getContentType($type, $version)
{
if ($type === 'css') {
return 'text/css';
} else if ($type === 'js') {
return 'text/javascript';
} else if ($type === 'image') {
$fileExtension = pathinfo($version, PATHINFO_EXTENSION);
... | [
"protected",
"function",
"getContentType",
"(",
"$",
"type",
",",
"$",
"version",
")",
"{",
"if",
"(",
"$",
"type",
"===",
"'css'",
")",
"{",
"return",
"'text/css'",
";",
"}",
"else",
"if",
"(",
"$",
"type",
"===",
"'js'",
")",
"{",
"return",
"'text/... | Returns the content type for the given asset type.
@access protected
@param string $type
@param string $version
@return string | [
"Returns",
"the",
"content",
"type",
"for",
"the",
"given",
"asset",
"type",
"."
] | 9a36d8c7649317f55f91b2adf386bd1f04ec02a3 | https://github.com/zepi/turbo-base/blob/9a36d8c7649317f55f91b2adf386bd1f04ec02a3/Zepi/Web/General/src/EventHandler/LoadAssetContent.php#L174-L193 |
10,569 | webforge-labs/webforge-utils | src/php/Webforge/Common/Exception.php | Exception.toString | public function toString($format = 'text', $relativeDir = NULL, $relativeDirLabel = NULL) {
return self::getExceptionText($this, $format, $relativeDir, $relativeDirLabel);
} | php | public function toString($format = 'text', $relativeDir = NULL, $relativeDirLabel = NULL) {
return self::getExceptionText($this, $format, $relativeDir, $relativeDirLabel);
} | [
"public",
"function",
"toString",
"(",
"$",
"format",
"=",
"'text'",
",",
"$",
"relativeDir",
"=",
"NULL",
",",
"$",
"relativeDirLabel",
"=",
"NULL",
")",
"{",
"return",
"self",
"::",
"getExceptionText",
"(",
"$",
"this",
",",
"$",
"format",
",",
"$",
... | Returns a nicer string Representation for the Exception
@param string $format text|html
@return string | [
"Returns",
"a",
"nicer",
"string",
"Representation",
"for",
"the",
"Exception"
] | a476eeec046c22ad91794b0ab9fe15a1d3f92bfc | https://github.com/webforge-labs/webforge-utils/blob/a476eeec046c22ad91794b0ab9fe15a1d3f92bfc/src/php/Webforge/Common/Exception.php#L39-L41 |
10,570 | opsbears/piccolo-web | src/WebApplication.php | WebApplication.execute | public function execute() {
$dic = $this->getDIC();
/**
* @var InputProcessor $input
*/
$inputProcessor = $dic->make(InputProcessor::class);
/**
* @var RequestProcessor $request
*/
$requestProcessor = $dic->make(RequestProcessor::class);
/**
* @var ResponseInterface $response
*/
$resp... | php | public function execute() {
$dic = $this->getDIC();
/**
* @var InputProcessor $input
*/
$inputProcessor = $dic->make(InputProcessor::class);
/**
* @var RequestProcessor $request
*/
$requestProcessor = $dic->make(RequestProcessor::class);
/**
* @var ResponseInterface $response
*/
$resp... | [
"public",
"function",
"execute",
"(",
")",
"{",
"$",
"dic",
"=",
"$",
"this",
"->",
"getDIC",
"(",
")",
";",
"/**\n\t\t * @var InputProcessor $input\n\t\t */",
"$",
"inputProcessor",
"=",
"$",
"dic",
"->",
"make",
"(",
"InputProcessor",
"::",
"class",
")",
"... | Process a web request using the designated InputProcessor, RequestProcessor and OutputProcessor
Warning! This method contains hidden dependencies which will be initialized using the Dependency Injection
Container!
@see InputProcessor
@see RequestProcessor
@see OutputProcessor | [
"Process",
"a",
"web",
"request",
"using",
"the",
"designated",
"InputProcessor",
"RequestProcessor",
"and",
"OutputProcessor"
] | ac98224c77d6f32dd4d5fa559a2dc8f1ed8e6355 | https://github.com/opsbears/piccolo-web/blob/ac98224c77d6f32dd4d5fa559a2dc8f1ed8e6355/src/WebApplication.php#L27-L53 |
10,571 | dmeikle/pesedget | src/Gossamer/Pesedget/Commands/ListCommand.php | ListCommand.execute | public function execute($params = array()){
if($this->entity instanceof OneToOneJoinInterface) {
if(array_key_exists('locale', $params)) {
$this->getQueryBuilder()->where($params['locale']);
}
$this->getQueryBuilder()->join($this->entity->getJo... | php | public function execute($params = array()){
if($this->entity instanceof OneToOneJoinInterface) {
if(array_key_exists('locale', $params)) {
$this->getQueryBuilder()->where($params['locale']);
}
$this->getQueryBuilder()->join($this->entity->getJo... | [
"public",
"function",
"execute",
"(",
"$",
"params",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"entity",
"instanceof",
"OneToOneJoinInterface",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"'locale'",
",",
"$",
"params",
")",
")",
... | retrieves a multiple rows from the database
@param array URI params
@param array POST params | [
"retrieves",
"a",
"multiple",
"rows",
"from",
"the",
"database"
] | bcfca25569d1f47c073f08906a710ed895f77b4d | https://github.com/dmeikle/pesedget/blob/bcfca25569d1f47c073f08906a710ed895f77b4d/src/Gossamer/Pesedget/Commands/ListCommand.php#L25-L43 |
10,572 | OWeb/OWeb-Framework | OWeb/types/Header.php | Header.getCode | public function getCode($id=""){
switch($this->type){
case Headers::javascript :
$code = '<script id="'.$id.'" type="text/javascript" src="'.$this->code.'"></script>'."\n";
break;
case Headers::css :
$code = '<link id="'.$id.'" href="'.$t... | php | public function getCode($id=""){
switch($this->type){
case Headers::javascript :
$code = '<script id="'.$id.'" type="text/javascript" src="'.$this->code.'"></script>'."\n";
break;
case Headers::css :
$code = '<link id="'.$id.'" href="'.$t... | [
"public",
"function",
"getCode",
"(",
"$",
"id",
"=",
"\"\"",
")",
"{",
"switch",
"(",
"$",
"this",
"->",
"type",
")",
"{",
"case",
"Headers",
"::",
"javascript",
":",
"$",
"code",
"=",
"'<script id=\"'",
".",
"$",
"id",
".",
"'\" type=\"text/javascript\... | Returns the string od this header.
@return type The code of the Header | [
"Returns",
"the",
"string",
"od",
"this",
"header",
"."
] | fb441f51afb16860b0c946a55c36c789fbb125fa | https://github.com/OWeb/OWeb-Framework/blob/fb441f51afb16860b0c946a55c36c789fbb125fa/OWeb/types/Header.php#L51-L68 |
10,573 | vidhyar2612/enveditor | src/EnveditorStore.php | EnveditorStore.has | public function has($key , $value=null) {
return CoreManager::has($this->path,$key,$value);
} | php | public function has($key , $value=null) {
return CoreManager::has($this->path,$key,$value);
} | [
"public",
"function",
"has",
"(",
"$",
"key",
",",
"$",
"value",
"=",
"null",
")",
"{",
"return",
"CoreManager",
"::",
"has",
"(",
"$",
"this",
"->",
"path",
",",
"$",
"key",
",",
"$",
"value",
")",
";",
"}"
] | Check the key exists
@param string $key
@param string $value
@return boolean | [
"Check",
"the",
"key",
"exists"
] | 90a67b728e8bd06680eed463657e63ba5b2d61a2 | https://github.com/vidhyar2612/enveditor/blob/90a67b728e8bd06680eed463657e63ba5b2d61a2/src/EnveditorStore.php#L105-L107 |
10,574 | vidhyar2612/enveditor | src/EnveditorStore.php | EnveditorStore.create | public function create($key , $value=null) {
if($this->check_path()) {
return CoreManager::create($this->path,$key,$value);
}
return false;
} | php | public function create($key , $value=null) {
if($this->check_path()) {
return CoreManager::create($this->path,$key,$value);
}
return false;
} | [
"public",
"function",
"create",
"(",
"$",
"key",
",",
"$",
"value",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"check_path",
"(",
")",
")",
"{",
"return",
"CoreManager",
"::",
"create",
"(",
"$",
"this",
"->",
"path",
",",
"$",
"key",
"... | Create a key with an value
@param string $key
@param string $value
@return boolean | [
"Create",
"a",
"key",
"with",
"an",
"value"
] | 90a67b728e8bd06680eed463657e63ba5b2d61a2 | https://github.com/vidhyar2612/enveditor/blob/90a67b728e8bd06680eed463657e63ba5b2d61a2/src/EnveditorStore.php#L118-L126 |
10,575 | erdemkeren/jet-sms-php | src/JetSmsService.php | JetSmsService.sendShortMessage | public function sendShortMessage($receivers, $body = null)
{
if (! $receivers instanceof ShortMessage) {
$receivers = $this->factory->create($receivers, $body);
}
if (is_callable($this->beforeSingleShortMessageCallback)) {
call_user_func_array($this->beforeSingleShor... | php | public function sendShortMessage($receivers, $body = null)
{
if (! $receivers instanceof ShortMessage) {
$receivers = $this->factory->create($receivers, $body);
}
if (is_callable($this->beforeSingleShortMessageCallback)) {
call_user_func_array($this->beforeSingleShor... | [
"public",
"function",
"sendShortMessage",
"(",
"$",
"receivers",
",",
"$",
"body",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"receivers",
"instanceof",
"ShortMessage",
")",
"{",
"$",
"receivers",
"=",
"$",
"this",
"->",
"factory",
"->",
"create",
"(",
... | Send the given body to the given receivers.
@param array|string|ShortMessage $receivers The receiver(s) of the message or the message object.
@param string|null $body The body of the message or null when using short message object.
@return JetSmsResponseInterface The parsed JetSms response object... | [
"Send",
"the",
"given",
"body",
"to",
"the",
"given",
"receivers",
"."
] | 5b103a980bd2a8dce003964a17e2568736dfcf4e | https://github.com/erdemkeren/jet-sms-php/blob/5b103a980bd2a8dce003964a17e2568736dfcf4e/src/JetSmsService.php#L99-L116 |
10,576 | erdemkeren/jet-sms-php | src/JetSmsService.php | JetSmsService.sendShortMessages | public function sendShortMessages($messages)
{
if (! $messages instanceof ShortMessageCollection) {
$collection = $this->collectionFactory->create();
foreach ($messages as $message) {
$collection->push($this->factory->create(
$message['recipient']... | php | public function sendShortMessages($messages)
{
if (! $messages instanceof ShortMessageCollection) {
$collection = $this->collectionFactory->create();
foreach ($messages as $message) {
$collection->push($this->factory->create(
$message['recipient']... | [
"public",
"function",
"sendShortMessages",
"(",
"$",
"messages",
")",
"{",
"if",
"(",
"!",
"$",
"messages",
"instanceof",
"ShortMessageCollection",
")",
"{",
"$",
"collection",
"=",
"$",
"this",
"->",
"collectionFactory",
"->",
"create",
"(",
")",
";",
"fore... | Send the given short messages.
@param array|ShortMessageCollection $messages An array containing short message arrays or collection.
@return JetSmsResponseInterface The parsed JetSms response object. | [
"Send",
"the",
"given",
"short",
"messages",
"."
] | 5b103a980bd2a8dce003964a17e2568736dfcf4e | https://github.com/erdemkeren/jet-sms-php/blob/5b103a980bd2a8dce003964a17e2568736dfcf4e/src/JetSmsService.php#L125-L151 |
10,577 | praxisnetau/silverware-google | src/Extensions/PageExtension.php | PageExtension.MetaTags | public function MetaTags(&$tags)
{
if ($code = GoogleAPI::singleton()->getVerificationCode()) {
// Add New Line (if does not exist):
if (!preg_match('/[\n]$/', $tags)) {
$tags .= "\n";
}
// Add Verificatio... | php | public function MetaTags(&$tags)
{
if ($code = GoogleAPI::singleton()->getVerificationCode()) {
// Add New Line (if does not exist):
if (!preg_match('/[\n]$/', $tags)) {
$tags .= "\n";
}
// Add Verificatio... | [
"public",
"function",
"MetaTags",
"(",
"&",
"$",
"tags",
")",
"{",
"if",
"(",
"$",
"code",
"=",
"GoogleAPI",
"::",
"singleton",
"(",
")",
"->",
"getVerificationCode",
"(",
")",
")",
"{",
"// Add New Line (if does not exist):",
"if",
"(",
"!",
"preg_match",
... | Appends the additional Google tags to the provided meta tags.
@param string $tags
@return void | [
"Appends",
"the",
"additional",
"Google",
"tags",
"to",
"the",
"provided",
"meta",
"tags",
"."
] | 573632d33fe99c9d943fec8733fa5bbce57586f5 | https://github.com/praxisnetau/silverware-google/blob/573632d33fe99c9d943fec8733fa5bbce57586f5/src/Extensions/PageExtension.php#L48-L67 |
10,578 | frogsystem/metamorphosis | src/frogsystem/metamorphosis/Services/FileConfig.php | FileConfig.getFileIterator | protected function getFileIterator($path, $pattern = '/^.+\.php$/')
{
if (is_dir($path)) {
return new \RegexIterator(new \DirectoryIterator($path), $pattern, \RegexIterator::GET_MATCH);
}
if (is_file($path) && 1 === preg_match($pattern, $path)) {
return [new \SplFileI... | php | protected function getFileIterator($path, $pattern = '/^.+\.php$/')
{
if (is_dir($path)) {
return new \RegexIterator(new \DirectoryIterator($path), $pattern, \RegexIterator::GET_MATCH);
}
if (is_file($path) && 1 === preg_match($pattern, $path)) {
return [new \SplFileI... | [
"protected",
"function",
"getFileIterator",
"(",
"$",
"path",
",",
"$",
"pattern",
"=",
"'/^.+\\.php$/'",
")",
"{",
"if",
"(",
"is_dir",
"(",
"$",
"path",
")",
")",
"{",
"return",
"new",
"\\",
"RegexIterator",
"(",
"new",
"\\",
"DirectoryIterator",
"(",
... | Get the iterator for specified config files.
@param $path
@param string $pattern
@return array|\RegexIterator | [
"Get",
"the",
"iterator",
"for",
"specified",
"config",
"files",
"."
] | 27bceaab2a21c6c88b39037e2117d9ff7eb6c814 | https://github.com/frogsystem/metamorphosis/blob/27bceaab2a21c6c88b39037e2117d9ff7eb6c814/src/frogsystem/metamorphosis/Services/FileConfig.php#L40-L49 |
10,579 | velkuns/eureka-package-user | src/User/DataMapper/Mapper/User/UserMapper.php | UserMapper.findFromSession | public function findFromSession(Session $session)
{
$this->addWhere('user_email', $session->get('email'));
$this->addWhere('user_id', (int) $session->get('id'));
$this->addWhere('user_is_activated', 1);
try {
$user = $this->selectOne();
} catch (ExceptionNoDat... | php | public function findFromSession(Session $session)
{
$this->addWhere('user_email', $session->get('email'));
$this->addWhere('user_id', (int) $session->get('id'));
$this->addWhere('user_is_activated', 1);
try {
$user = $this->selectOne();
} catch (ExceptionNoDat... | [
"public",
"function",
"findFromSession",
"(",
"Session",
"$",
"session",
")",
"{",
"$",
"this",
"->",
"addWhere",
"(",
"'user_email'",
",",
"$",
"session",
"->",
"get",
"(",
"'email'",
")",
")",
";",
"$",
"this",
"->",
"addWhere",
"(",
"'user_id'",
",",
... | Find user with data from Session.
@param Session $session
@return User
@throws \Exception | [
"Find",
"user",
"with",
"data",
"from",
"Session",
"."
] | b5a60b5a234162558b390ee3d452e4254c790f2b | https://github.com/velkuns/eureka-package-user/blob/b5a60b5a234162558b390ee3d452e4254c790f2b/src/User/DataMapper/Mapper/User/UserMapper.php#L53-L66 |
10,580 | amulen/nps-bundle | src/Amulen/NpsBundle/Utils/PaymentMethod.php | PaymentMethod.getOptions | public static function getOptions()
{
$options = [];
$options[] = [
'id' => Operation::PRODUCT_VISA,
'label' => "Visa",
];
$options[] = [
'id' => Operation::PRODUCT_MASTERCARD,
'label' => "Mastercard",
];
$options[] = [... | php | public static function getOptions()
{
$options = [];
$options[] = [
'id' => Operation::PRODUCT_VISA,
'label' => "Visa",
];
$options[] = [
'id' => Operation::PRODUCT_MASTERCARD,
'label' => "Mastercard",
];
$options[] = [... | [
"public",
"static",
"function",
"getOptions",
"(",
")",
"{",
"$",
"options",
"=",
"[",
"]",
";",
"$",
"options",
"[",
"]",
"=",
"[",
"'id'",
"=>",
"Operation",
"::",
"PRODUCT_VISA",
",",
"'label'",
"=>",
"\"Visa\"",
",",
"]",
";",
"$",
"options",
"["... | Payment options.
@return array | [
"Payment",
"options",
"."
] | 10c9e139c0cf1138e6b710477c182c6a28c92f07 | https://github.com/amulen/nps-bundle/blob/10c9e139c0cf1138e6b710477c182c6a28c92f07/src/Amulen/NpsBundle/Utils/PaymentMethod.php#L16-L39 |
10,581 | unimatrix/cake | src/View/Helper/DebugHelper.php | DebugHelper.requestStartTime | public static function requestStartTime($test = false) {
if(defined('TIME_START') && $test === false) $startTime = TIME_START;
elseif(isset($GLOBALS['TIME_START'])) $startTime = $GLOBALS['TIME_START'];
else $startTime = env('REQUEST_TIME');
return $startTime;
} | php | public static function requestStartTime($test = false) {
if(defined('TIME_START') && $test === false) $startTime = TIME_START;
elseif(isset($GLOBALS['TIME_START'])) $startTime = $GLOBALS['TIME_START'];
else $startTime = env('REQUEST_TIME');
return $startTime;
} | [
"public",
"static",
"function",
"requestStartTime",
"(",
"$",
"test",
"=",
"false",
")",
"{",
"if",
"(",
"defined",
"(",
"'TIME_START'",
")",
"&&",
"$",
"test",
"===",
"false",
")",
"$",
"startTime",
"=",
"TIME_START",
";",
"elseif",
"(",
"isset",
"(",
... | Get the time the current request started.
@param bool $test Stub to help test the code by avoiding the constant
@return float time of request start | [
"Get",
"the",
"time",
"the",
"current",
"request",
"started",
"."
] | 23003aba497822bd473fdbf60514052dda1874fc | https://github.com/unimatrix/cake/blob/23003aba497822bd473fdbf60514052dda1874fc/src/View/Helper/DebugHelper.php#L45-L51 |
10,582 | bfitech/zapmin | src/AdminStorePrepare.php | AdminStorePrepare.adm_get_safe_user_data | public function adm_get_safe_user_data() {
if (!$this->store_is_logged_in())
return [AdminStoreError::USER_NOT_LOGGED_IN];
$data = $this->user_data;
foreach (['upass', 'usalt', 'sid', 'token', 'expire'] as $key)
unset($data[$key]);
return [0, $data];
} | php | public function adm_get_safe_user_data() {
if (!$this->store_is_logged_in())
return [AdminStoreError::USER_NOT_LOGGED_IN];
$data = $this->user_data;
foreach (['upass', 'usalt', 'sid', 'token', 'expire'] as $key)
unset($data[$key]);
return [0, $data];
} | [
"public",
"function",
"adm_get_safe_user_data",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"store_is_logged_in",
"(",
")",
")",
"return",
"[",
"AdminStoreError",
"::",
"USER_NOT_LOGGED_IN",
"]",
";",
"$",
"data",
"=",
"$",
"this",
"->",
"user_data",
... | Get user data excluding sensitive info. | [
"Get",
"user",
"data",
"excluding",
"sensitive",
"info",
"."
] | 4aebbe0e727328a9632f80b2e6ba4aef6a2fabfe | https://github.com/bfitech/zapmin/blob/4aebbe0e727328a9632f80b2e6ba4aef6a2fabfe/src/AdminStorePrepare.php#L95-L102 |
10,583 | detailnet/dfw-mail | src/Detail/Mail/MtMail/OverrideHeadersComposerPlugin.php | OverrideHeadersComposerPlugin.attach | public function attach(EventManagerInterface $events)
{
$this->listeners[] = $events->attach(
ComposerEvent::EVENT_HEADERS_POST,
array($this, 'injectOverrideHeaders'),
-100 // The priority needs to be lower than the other plugins
);
} | php | public function attach(EventManagerInterface $events)
{
$this->listeners[] = $events->attach(
ComposerEvent::EVENT_HEADERS_POST,
array($this, 'injectOverrideHeaders'),
-100 // The priority needs to be lower than the other plugins
);
} | [
"public",
"function",
"attach",
"(",
"EventManagerInterface",
"$",
"events",
")",
"{",
"$",
"this",
"->",
"listeners",
"[",
"]",
"=",
"$",
"events",
"->",
"attach",
"(",
"ComposerEvent",
"::",
"EVENT_HEADERS_POST",
",",
"array",
"(",
"$",
"this",
",",
"'in... | Attach listener.
@param EventManagerInterface $events | [
"Attach",
"listener",
"."
] | 87e9f72d5aefc0cfbd2afe75135dc3a343d01138 | https://github.com/detailnet/dfw-mail/blob/87e9f72d5aefc0cfbd2afe75135dc3a343d01138/src/Detail/Mail/MtMail/OverrideHeadersComposerPlugin.php#L42-L49 |
10,584 | starbs/http | src/Controllers/AbstractController.php | AbstractController.index | public function index(Request $request, Response $response, array $args)
{
$this->request = $request;
$this->response = $response;
$this->args = $args;
return $this->fire();
} | php | public function index(Request $request, Response $response, array $args)
{
$this->request = $request;
$this->response = $response;
$this->args = $args;
return $this->fire();
} | [
"public",
"function",
"index",
"(",
"Request",
"$",
"request",
",",
"Response",
"$",
"response",
",",
"array",
"$",
"args",
")",
"{",
"$",
"this",
"->",
"request",
"=",
"$",
"request",
";",
"$",
"this",
"->",
"response",
"=",
"$",
"response",
";",
"$... | Setup the controller, then run the fire method.
@param \Symfony\Component\HttpFoundation\Request $request
@param \Symfony\Component\HttpFoundation\Response $response
@param string[] $args
@return \Symfony\Component\HttpFoundation\Response | [
"Setup",
"the",
"controller",
"then",
"run",
"the",
"fire",
"method",
"."
] | 71201c9ecd912e43d44dee7bd6a6c2f64b8b0941 | https://github.com/starbs/http/blob/71201c9ecd912e43d44dee7bd6a6c2f64b8b0941/src/Controllers/AbstractController.php#L74-L81 |
10,585 | starbs/http | src/Controllers/AbstractController.php | AbstractController.success | protected function success(array $data, $code = 200)
{
$this->response->setStatusCode($code);
$this->response->headers->add(['Content-Type' => 'application/json']);
$this->response->setContent(json_encode(['success' => $data], JSON_PRETTY_PRINT));
return $this->response;
} | php | protected function success(array $data, $code = 200)
{
$this->response->setStatusCode($code);
$this->response->headers->add(['Content-Type' => 'application/json']);
$this->response->setContent(json_encode(['success' => $data], JSON_PRETTY_PRINT));
return $this->response;
} | [
"protected",
"function",
"success",
"(",
"array",
"$",
"data",
",",
"$",
"code",
"=",
"200",
")",
"{",
"$",
"this",
"->",
"response",
"->",
"setStatusCode",
"(",
"$",
"code",
")",
";",
"$",
"this",
"->",
"response",
"->",
"headers",
"->",
"add",
"(",... | Get a success response json.
@param string[] $data
@param int $code
@return \Symfony\Component\HttpFoundation\Response | [
"Get",
"a",
"success",
"response",
"json",
"."
] | 71201c9ecd912e43d44dee7bd6a6c2f64b8b0941 | https://github.com/starbs/http/blob/71201c9ecd912e43d44dee7bd6a6c2f64b8b0941/src/Controllers/AbstractController.php#L98-L105 |
10,586 | starbs/http | src/Controllers/AbstractController.php | AbstractController.redirect | protected function redirect($url, $code = 302)
{
$this->response->setStatusCode($code);
$this->response->headers->set('Location', $url);
return $this->response;
} | php | protected function redirect($url, $code = 302)
{
$this->response->setStatusCode($code);
$this->response->headers->set('Location', $url);
return $this->response;
} | [
"protected",
"function",
"redirect",
"(",
"$",
"url",
",",
"$",
"code",
"=",
"302",
")",
"{",
"$",
"this",
"->",
"response",
"->",
"setStatusCode",
"(",
"$",
"code",
")",
";",
"$",
"this",
"->",
"response",
"->",
"headers",
"->",
"set",
"(",
"'Locati... | Get a redirection response.
@param string $url
@param int $code
@return \Symfony\Component\HttpFoundation\Response | [
"Get",
"a",
"redirection",
"response",
"."
] | 71201c9ecd912e43d44dee7bd6a6c2f64b8b0941 | https://github.com/starbs/http/blob/71201c9ecd912e43d44dee7bd6a6c2f64b8b0941/src/Controllers/AbstractController.php#L115-L121 |
10,587 | starbs/http | src/Controllers/AbstractController.php | AbstractController.raw | protected function raw($data, $mime, $code = 200)
{
$this->response->setStatusCode($code);
$this->response->headers->add(['Content-Type' => $mime]);
$this->response->setContent($data);
return $this->response;
} | php | protected function raw($data, $mime, $code = 200)
{
$this->response->setStatusCode($code);
$this->response->headers->add(['Content-Type' => $mime]);
$this->response->setContent($data);
return $this->response;
} | [
"protected",
"function",
"raw",
"(",
"$",
"data",
",",
"$",
"mime",
",",
"$",
"code",
"=",
"200",
")",
"{",
"$",
"this",
"->",
"response",
"->",
"setStatusCode",
"(",
"$",
"code",
")",
";",
"$",
"this",
"->",
"response",
"->",
"headers",
"->",
"add... | Get a custom response.
@param string $data
@param string $mime
@param int $code
@return \Symfony\Component\HttpFoundation\Response | [
"Get",
"a",
"custom",
"response",
"."
] | 71201c9ecd912e43d44dee7bd6a6c2f64b8b0941 | https://github.com/starbs/http/blob/71201c9ecd912e43d44dee7bd6a6c2f64b8b0941/src/Controllers/AbstractController.php#L149-L156 |
10,588 | JamesRezo/webhelper-parser | src/Directive/InclusionDirective.php | InclusionDirective.setFiles | public function setFiles()
{
$this->files = [];
$path = $this->getValue();
if (!preg_match('#^/#', $path)) {
$path = $this->parser->getServer()->getPrefix().'/'.$path;
}
$iterator = new GlobIterator($path);
foreach ($iterator as $path) {
$thi... | php | public function setFiles()
{
$this->files = [];
$path = $this->getValue();
if (!preg_match('#^/#', $path)) {
$path = $this->parser->getServer()->getPrefix().'/'.$path;
}
$iterator = new GlobIterator($path);
foreach ($iterator as $path) {
$thi... | [
"public",
"function",
"setFiles",
"(",
")",
"{",
"$",
"this",
"->",
"files",
"=",
"[",
"]",
";",
"$",
"path",
"=",
"$",
"this",
"->",
"getValue",
"(",
")",
";",
"if",
"(",
"!",
"preg_match",
"(",
"'#^/#'",
",",
"$",
"path",
")",
")",
"{",
"$",
... | Detects and memoizes the included files. | [
"Detects",
"and",
"memoizes",
"the",
"included",
"files",
"."
] | 0b39e7abe8f35afbeacdd6681fa9d0767888c646 | https://github.com/JamesRezo/webhelper-parser/blob/0b39e7abe8f35afbeacdd6681fa9d0767888c646/src/Directive/InclusionDirective.php#L69-L84 |
10,589 | JamesRezo/webhelper-parser | src/Directive/InclusionDirective.php | InclusionDirective.compileFiles | public function compileFiles()
{
foreach ($this->files as $file) {
$activeConfig = $this->parser->setConfigFile($file)->getActiveConfig();
$this->add($activeConfig);
}
return $this;
} | php | public function compileFiles()
{
foreach ($this->files as $file) {
$activeConfig = $this->parser->setConfigFile($file)->getActiveConfig();
$this->add($activeConfig);
}
return $this;
} | [
"public",
"function",
"compileFiles",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"files",
"as",
"$",
"file",
")",
"{",
"$",
"activeConfig",
"=",
"$",
"this",
"->",
"parser",
"->",
"setConfigFile",
"(",
"$",
"file",
")",
"->",
"getActiveConfig",
... | Fills the block directives by compiling the memoized files. | [
"Fills",
"the",
"block",
"directives",
"by",
"compiling",
"the",
"memoized",
"files",
"."
] | 0b39e7abe8f35afbeacdd6681fa9d0767888c646 | https://github.com/JamesRezo/webhelper-parser/blob/0b39e7abe8f35afbeacdd6681fa9d0767888c646/src/Directive/InclusionDirective.php#L89-L97 |
10,590 | novuso/common | src/Domain/Value/DateTime/Timezone.php | Timezone.compareParts | protected function compareParts(array $thisParts, array $thatParts): int
{
$compMajor = strnatcmp($thisParts[0], $thatParts[0]);
if ($compMajor > 0) {
return 1;
}
if ($compMajor < 0) {
return -1;
}
$compMinor = strnatcmp($thisParts[1], $thatPar... | php | protected function compareParts(array $thisParts, array $thatParts): int
{
$compMajor = strnatcmp($thisParts[0], $thatParts[0]);
if ($compMajor > 0) {
return 1;
}
if ($compMajor < 0) {
return -1;
}
$compMinor = strnatcmp($thisParts[1], $thatPar... | [
"protected",
"function",
"compareParts",
"(",
"array",
"$",
"thisParts",
",",
"array",
"$",
"thatParts",
")",
":",
"int",
"{",
"$",
"compMajor",
"=",
"strnatcmp",
"(",
"$",
"thisParts",
"[",
"0",
"]",
",",
"$",
"thatParts",
"[",
"0",
"]",
")",
";",
"... | Compares two timezones by segments
@param array $thisParts This parts
@param array $thatParts Other parts
@return int | [
"Compares",
"two",
"timezones",
"by",
"segments"
] | 7d0e5a4f4c79c9622e068efc8b7c70815c460863 | https://github.com/novuso/common/blob/7d0e5a4f4c79c9622e068efc8b7c70815c460863/src/Domain/Value/DateTime/Timezone.php#L120-L143 |
10,591 | marando/phpSOFA | src/Marando/IAU/iauApco.php | iauApco.Apco | public static function Apco($date1, $date2, array $ebpv, array $ehp, $x,
$y, $s, $theta, $elong, $phi, $hm, $xp, $yp, $sp, $refa, $refb,
iauASTROM &$astrom) {
$sl;
$cl;
$r = [];
$pvc = [];
$pv = [[],[]];
/* Longitude with adjustment for TIO locator s'. */
$astrom->al... | php | public static function Apco($date1, $date2, array $ebpv, array $ehp, $x,
$y, $s, $theta, $elong, $phi, $hm, $xp, $yp, $sp, $refa, $refb,
iauASTROM &$astrom) {
$sl;
$cl;
$r = [];
$pvc = [];
$pv = [[],[]];
/* Longitude with adjustment for TIO locator s'. */
$astrom->al... | [
"public",
"static",
"function",
"Apco",
"(",
"$",
"date1",
",",
"$",
"date2",
",",
"array",
"$",
"ebpv",
",",
"array",
"$",
"ehp",
",",
"$",
"x",
",",
"$",
"y",
",",
"$",
"s",
",",
"$",
"theta",
",",
"$",
"elong",
",",
"$",
"phi",
",",
"$",
... | - - - - - - - -
i a u A p c o
- - - - - - - -
For a terrestrial observer, prepare star-independent astrometry
parameters for transformations between ICRS and observed
coordinates. The caller supplies the Earth ephemeris, the Earth
rotation information and the refraction constants as well as the
site coordinates.
Thi... | [
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"i",
"a",
"u",
"A",
"p",
"c",
"o",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-"
] | 757fa49fe335ae1210eaa7735473fd4388b13f07 | https://github.com/marando/phpSOFA/blob/757fa49fe335ae1210eaa7735473fd4388b13f07/src/Marando/IAU/iauApco.php#L163-L212 |
10,592 | GustavSoftware/Cache | src/Configuration.php | Configuration.setImplementation | public function setImplementation(string $className): Configuration
{
if(!\is_subclass_of($className, ACacheManager::class)) {
throw CacheException::invalidImplementation($className);
}
$this->_implementation = $className;
return $this;
} | php | public function setImplementation(string $className): Configuration
{
if(!\is_subclass_of($className, ACacheManager::class)) {
throw CacheException::invalidImplementation($className);
}
$this->_implementation = $className;
return $this;
} | [
"public",
"function",
"setImplementation",
"(",
"string",
"$",
"className",
")",
":",
"Configuration",
"{",
"if",
"(",
"!",
"\\",
"is_subclass_of",
"(",
"$",
"className",
",",
"ACacheManager",
"::",
"class",
")",
")",
"{",
"throw",
"CacheException",
"::",
"i... | Sets the class name of the implementation of the cache manager that
should be used on runtime. Consider that this class name has to extent
the \Gustav\Cache\ACacheManager class. Otherwise this method will throw
an CacheException.
@param string $className
The class name of the implementation to use here
@return \Gustav... | [
"Sets",
"the",
"class",
"name",
"of",
"the",
"implementation",
"of",
"the",
"cache",
"manager",
"that",
"should",
"be",
"used",
"on",
"runtime",
".",
"Consider",
"that",
"this",
"class",
"name",
"has",
"to",
"extent",
"the",
"\\",
"Gustav",
"\\",
"Cache",
... | 2a70db567aa13499487c24b399f7c9d46937df0d | https://github.com/GustavSoftware/Cache/blob/2a70db567aa13499487c24b399f7c9d46937df0d/src/Configuration.php#L87-L94 |
10,593 | bugotech/foundation | src/Application.php | Application.path | public function path($type, $path = null)
{
$instance = sprintf('path.%s', $type);
$base = $this->basePath;
// Verificar se foi instanciado um path diferente
if (array_key_exists($instance, $this->instances)) {
$base = $this->instances[$instance];
}
// V... | php | public function path($type, $path = null)
{
$instance = sprintf('path.%s', $type);
$base = $this->basePath;
// Verificar se foi instanciado um path diferente
if (array_key_exists($instance, $this->instances)) {
$base = $this->instances[$instance];
}
// V... | [
"public",
"function",
"path",
"(",
"$",
"type",
",",
"$",
"path",
"=",
"null",
")",
"{",
"$",
"instance",
"=",
"sprintf",
"(",
"'path.%s'",
",",
"$",
"type",
")",
";",
"$",
"base",
"=",
"$",
"this",
"->",
"basePath",
";",
"// Verificar se foi instancia... | Return path of type.
@param $type
@param null $path
@return string | [
"Return",
"path",
"of",
"type",
"."
] | e4b96cd1cef117e9c5f2c6f5671d260853317658 | https://github.com/bugotech/foundation/blob/e4b96cd1cef117e9c5f2c6f5671d260853317658/src/Application.php#L283-L309 |
10,594 | bugotech/foundation | src/Application.php | Application.registerContainerBase | protected function registerContainerBase()
{
// Composer
$this->singleton('composer', function ($app) {
return new Composer($app->make('files'), $this->basePath());
});
// Config
$this->singleton('config', function () {
return new ConfigRepository();
... | php | protected function registerContainerBase()
{
// Composer
$this->singleton('composer', function ($app) {
return new Composer($app->make('files'), $this->basePath());
});
// Config
$this->singleton('config', function () {
return new ConfigRepository();
... | [
"protected",
"function",
"registerContainerBase",
"(",
")",
"{",
"// Composer",
"$",
"this",
"->",
"singleton",
"(",
"'composer'",
",",
"function",
"(",
"$",
"app",
")",
"{",
"return",
"new",
"Composer",
"(",
"$",
"app",
"->",
"make",
"(",
"'files'",
")",
... | Register the core conteiner base structures.
@return void | [
"Register",
"the",
"core",
"conteiner",
"base",
"structures",
"."
] | e4b96cd1cef117e9c5f2c6f5671d260853317658 | https://github.com/bugotech/foundation/blob/e4b96cd1cef117e9c5f2c6f5671d260853317658/src/Application.php#L372-L408 |
10,595 | unyx/diagnostics | debug/Handler.php | Handler.apply | public function apply($condition, callable $onMatch = null) : self
{
if (!is_callable($condition)) {
if (!$condition instanceof Condition) {
throw new \InvalidArgumentException('Expected a \nyx\diagnostics\Condition or a callable as first argument, got ['.diagnostics\Debug::getT... | php | public function apply($condition, callable $onMatch = null) : self
{
if (!is_callable($condition)) {
if (!$condition instanceof Condition) {
throw new \InvalidArgumentException('Expected a \nyx\diagnostics\Condition or a callable as first argument, got ['.diagnostics\Debug::getT... | [
"public",
"function",
"apply",
"(",
"$",
"condition",
",",
"callable",
"$",
"onMatch",
"=",
"null",
")",
":",
"self",
"{",
"if",
"(",
"!",
"is_callable",
"(",
"$",
"condition",
")",
")",
"{",
"if",
"(",
"!",
"$",
"condition",
"instanceof",
"Condition",... | Applies a Condition to this Handler.
@param Condition|callable $condition Either a Condition instance or a 'matcher' callable accepting one
two arguments - an Exception and a Handler instance, and
returning true/false when the given Exception is a match or not.
When a callable is given, the second argument to this... | [
"Applies",
"a",
"Condition",
"to",
"this",
"Handler",
"."
] | 024dbe138dc27ff1797e74cd7d1bc7e3f81ab80e | https://github.com/unyx/diagnostics/blob/024dbe138dc27ff1797e74cd7d1bc7e3f81ab80e/debug/Handler.php#L60-L81 |
10,596 | unyx/diagnostics | debug/Handler.php | Handler.runConditions | protected function runConditions(\Exception $exception) : bool
{
$prevent = false;
foreach ($this->conditions as $condition) {
// We can call the methods on a Condition instance directly.
if ($condition instanceof Condition) {
if (true === $condition->matches... | php | protected function runConditions(\Exception $exception) : bool
{
$prevent = false;
foreach ($this->conditions as $condition) {
// We can call the methods on a Condition instance directly.
if ($condition instanceof Condition) {
if (true === $condition->matches... | [
"protected",
"function",
"runConditions",
"(",
"\\",
"Exception",
"$",
"exception",
")",
":",
"bool",
"{",
"$",
"prevent",
"=",
"false",
";",
"foreach",
"(",
"$",
"this",
"->",
"conditions",
"as",
"$",
"condition",
")",
"{",
"// We can call the methods on a Co... | Runs through the registered Conditions and invokes their callbacks when they match the given Exception.
@param \Exception $exception The Exception conditions should match
@return bool True when any Condition returns the PREVENT signal, false otherwise. | [
"Runs",
"through",
"the",
"registered",
"Conditions",
"and",
"invokes",
"their",
"callbacks",
"when",
"they",
"match",
"the",
"given",
"Exception",
"."
] | 024dbe138dc27ff1797e74cd7d1bc7e3f81ab80e | https://github.com/unyx/diagnostics/blob/024dbe138dc27ff1797e74cd7d1bc7e3f81ab80e/debug/Handler.php#L111-L150 |
10,597 | unyx/diagnostics | debug/Handler.php | Handler.emitDebugEvent | protected function emitDebugEvent($name, \Throwable $exception)
{
// Don't proceed when we've got no Emitter.
if (null === $this->emitter) {
return null;
}
$this->emitter->emit($name, $event = new Event($exception, $this));
// Event Listeners may override the Ex... | php | protected function emitDebugEvent($name, \Throwable $exception)
{
// Don't proceed when we've got no Emitter.
if (null === $this->emitter) {
return null;
}
$this->emitter->emit($name, $event = new Event($exception, $this));
// Event Listeners may override the Ex... | [
"protected",
"function",
"emitDebugEvent",
"(",
"$",
"name",
",",
"\\",
"Throwable",
"$",
"exception",
")",
"{",
"// Don't proceed when we've got no Emitter.",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"emitter",
")",
"{",
"return",
"null",
";",
"}",
"$",
... | Helper method which emits a diagnostics\events\Debug event with the given name and the given initial
Exception and returns the Exception set in the Event after emission is done. All of it assuming an Emitter
is set for the Handler. False will be returned if that is not the case.
@param string $name Th... | [
"Helper",
"method",
"which",
"emits",
"a",
"diagnostics",
"\\",
"events",
"\\",
"Debug",
"event",
"with",
"the",
"given",
"name",
"and",
"the",
"given",
"initial",
"Exception",
"and",
"returns",
"the",
"Exception",
"set",
"in",
"the",
"Event",
"after",
"emis... | 024dbe138dc27ff1797e74cd7d1bc7e3f81ab80e | https://github.com/unyx/diagnostics/blob/024dbe138dc27ff1797e74cd7d1bc7e3f81ab80e/debug/Handler.php#L162-L173 |
10,598 | phossa2/libs | src/Phossa2/Session/Session.php | Session.checkStopped | protected function checkStopped()
{
if (null === $this->data) {
throw new RuntimeException(
Message::get(Message::SESSION_STOPPED),
Message::SESSION_STOPPED
);
}
} | php | protected function checkStopped()
{
if (null === $this->data) {
throw new RuntimeException(
Message::get(Message::SESSION_STOPPED),
Message::SESSION_STOPPED
);
}
} | [
"protected",
"function",
"checkStopped",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"data",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"Message",
"::",
"get",
"(",
"Message",
"::",
"SESSION_STOPPED",
")",
",",
"Message",
"::",
"S... | Throw RuntimeException if stopped
@throws RuntimeException if session stopped
@access protected | [
"Throw",
"RuntimeException",
"if",
"stopped"
] | 921e485c8cc29067f279da2cdd06f47a9bddd115 | https://github.com/phossa2/libs/blob/921e485c8cc29067f279da2cdd06f47a9bddd115/src/Phossa2/Session/Session.php#L250-L258 |
10,599 | jaztec/jaztec-admin | src/JaztecAdmin/Direct/Framework.php | Framework.getControllers | public function getControllers(array $values)
{
$config = $this->getServiceLocator()->get('Config');
/* $config array */
if (!isset($config['jaztec_admin']['modules']['controllers']['paths'])) {
return array();
}
$values['paths'] = $config['jaztec_admin'... | php | public function getControllers(array $values)
{
$config = $this->getServiceLocator()->get('Config');
/* $config array */
if (!isset($config['jaztec_admin']['modules']['controllers']['paths'])) {
return array();
}
$values['paths'] = $config['jaztec_admin'... | [
"public",
"function",
"getControllers",
"(",
"array",
"$",
"values",
")",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"getServiceLocator",
"(",
")",
"->",
"get",
"(",
"'Config'",
")",
";",
"/* $config array */",
"if",
"(",
"!",
"isset",
"(",
"$",
"config... | Scans the paths set in the KJSencha path loader to collect the controllers
and scans them against the ACL returning only the controllers the user is
allowed to use.
The reader will scan for Ext.define statements with a .controller. name.
@param array $values Client side params
@return array An array of the allowed c... | [
"Scans",
"the",
"paths",
"set",
"in",
"the",
"KJSencha",
"path",
"loader",
"to",
"collect",
"the",
"controllers",
"and",
"scans",
"them",
"against",
"the",
"ACL",
"returning",
"only",
"the",
"controllers",
"the",
"user",
"is",
"allowed",
"to",
"use",
"."
] | c05b84077f05ed26529e2795f6adfe7b4ebd0edf | https://github.com/jaztec/jaztec-admin/blob/c05b84077f05ed26529e2795f6adfe7b4ebd0edf/src/JaztecAdmin/Direct/Framework.php#L34-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.