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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
195,700 | squareproton/Bond | src/Bond/Normality.php | Normality.getEntityGenerator | public function getEntityGenerator( PgClass $pgclass, array $options, $entityFileStore )
{
// build entity
$tags = $this->getNormalityTags();
$generators = array(
'Entity' => '\Bond\Normality\Generate\Entity',
'Link' => '\Bond\Normality\Generate\Entity\Link',
... | php | public function getEntityGenerator( PgClass $pgclass, array $options, $entityFileStore )
{
// build entity
$tags = $this->getNormalityTags();
$generators = array(
'Entity' => '\Bond\Normality\Generate\Entity',
'Link' => '\Bond\Normality\Generate\Entity\Link',
... | [
"public",
"function",
"getEntityGenerator",
"(",
"PgClass",
"$",
"pgclass",
",",
"array",
"$",
"options",
",",
"$",
"entityFileStore",
")",
"{",
"// build entity",
"$",
"tags",
"=",
"$",
"this",
"->",
"getNormalityTags",
"(",
")",
";",
"$",
"generators",
"="... | Get the entity type. Defaults to 'base'. Set by '@normality-entity: ignore';
The code that handles the output of this function can be found in 'Normality::buildRelation';
@return string | [
"Get",
"the",
"entity",
"type",
".",
"Defaults",
"to",
"base",
".",
"Set",
"by"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Normality.php#L328-L361 |
195,701 | FusePump/cli.php | lib/FusePump/Cli/Timer.php | Timer.startAvg | public function startAvg($block)
{
if ($this->enabled) {
if (!isset($this->avgs[$block])) {
$this->avgs[$block] = array();
$this->avgs[$block]['count'] = 0;
$this->avgs[$block]['total'] = 0;
}
$this->avgs[$block]['start'] =... | php | public function startAvg($block)
{
if ($this->enabled) {
if (!isset($this->avgs[$block])) {
$this->avgs[$block] = array();
$this->avgs[$block]['count'] = 0;
$this->avgs[$block]['total'] = 0;
}
$this->avgs[$block]['start'] =... | [
"public",
"function",
"startAvg",
"(",
"$",
"block",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"enabled",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"avgs",
"[",
"$",
"block",
"]",
")",
")",
"{",
"$",
"this",
"->",
"avgs",
"[",
... | Start average block timer
@param string $block - key to identify block | [
"Start",
"average",
"block",
"timer"
] | 2cc92f09ce7b2f73d5cbc09f5ae4f31f3f9ae3b4 | https://github.com/FusePump/cli.php/blob/2cc92f09ce7b2f73d5cbc09f5ae4f31f3f9ae3b4/lib/FusePump/Cli/Timer.php#L116-L138 |
195,702 | FusePump/cli.php | lib/FusePump/Cli/Timer.php | Timer.stopAvg | public function stopAvg($block)
{
if ($this->enabled) {
if (!isset($this->avgs[$block])) {
throw new \Exception('Average block '.$block.' has not been started!');
}
$this->avgs[$block]['stop'] = microtime(true);
if (!isset($this->avgs[$block][... | php | public function stopAvg($block)
{
if ($this->enabled) {
if (!isset($this->avgs[$block])) {
throw new \Exception('Average block '.$block.' has not been started!');
}
$this->avgs[$block]['stop'] = microtime(true);
if (!isset($this->avgs[$block][... | [
"public",
"function",
"stopAvg",
"(",
"$",
"block",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"enabled",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"avgs",
"[",
"$",
"block",
"]",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
... | Stop average block and calculate average
@param string $block - average block identifier
@throws \Exception if block not defined | [
"Stop",
"average",
"block",
"and",
"calculate",
"average"
] | 2cc92f09ce7b2f73d5cbc09f5ae4f31f3f9ae3b4 | https://github.com/FusePump/cli.php/blob/2cc92f09ce7b2f73d5cbc09f5ae4f31f3f9ae3b4/lib/FusePump/Cli/Timer.php#L147-L174 |
195,703 | FusePump/cli.php | lib/FusePump/Cli/Timer.php | Timer.printAvgBlock | private function printAvgBlock($block)
{
if (!array_key_exists($block, $this->avgs)) {
throw new \Exception('Average block '.$block.' not defined');
}
$this->finishAvgBlock($block);
$output = "";
$output .= " $block";
$output .= " [".$this->avgs[$block... | php | private function printAvgBlock($block)
{
if (!array_key_exists($block, $this->avgs)) {
throw new \Exception('Average block '.$block.' not defined');
}
$this->finishAvgBlock($block);
$output = "";
$output .= " $block";
$output .= " [".$this->avgs[$block... | [
"private",
"function",
"printAvgBlock",
"(",
"$",
"block",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"block",
",",
"$",
"this",
"->",
"avgs",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"'Average block '",
".",
"$",
"block",
".... | Print average block
@param string $block - key to identify block
@return string output
@throws \Exception if block not defined | [
"Print",
"average",
"block"
] | 2cc92f09ce7b2f73d5cbc09f5ae4f31f3f9ae3b4 | https://github.com/FusePump/cli.php/blob/2cc92f09ce7b2f73d5cbc09f5ae4f31f3f9ae3b4/lib/FusePump/Cli/Timer.php#L249-L270 |
195,704 | FusePump/cli.php | lib/FusePump/Cli/Timer.php | Timer.get | public function get($block)
{
if ($this->enabled) {
if (!array_key_exists($block, $this->blocks)) {
throw new \Exception('Block '.$block.' not defined');
}
$this->finishBlock($block);
return $this->blocks[$block];
}
} | php | public function get($block)
{
if ($this->enabled) {
if (!array_key_exists($block, $this->blocks)) {
throw new \Exception('Block '.$block.' not defined');
}
$this->finishBlock($block);
return $this->blocks[$block];
}
} | [
"public",
"function",
"get",
"(",
"$",
"block",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"enabled",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"block",
",",
"$",
"this",
"->",
"blocks",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
... | Get block info
@param string $block - key to identify block
@return mixed - associative array
@throws \Exception if block not defined | [
"Get",
"block",
"info"
] | 2cc92f09ce7b2f73d5cbc09f5ae4f31f3f9ae3b4 | https://github.com/FusePump/cli.php/blob/2cc92f09ce7b2f73d5cbc09f5ae4f31f3f9ae3b4/lib/FusePump/Cli/Timer.php#L291-L302 |
195,705 | FusePump/cli.php | lib/FusePump/Cli/Timer.php | Timer.getAvg | public function getAvg($block)
{
if ($this->enabled) {
if (!array_key_exists($block, $this->avgs)) {
throw new \Exception('Average block '.$block.' not defined');
}
$this->finishAvgBlock($block);
return $this->avgs[$block];
}
} | php | public function getAvg($block)
{
if ($this->enabled) {
if (!array_key_exists($block, $this->avgs)) {
throw new \Exception('Average block '.$block.' not defined');
}
$this->finishAvgBlock($block);
return $this->avgs[$block];
}
} | [
"public",
"function",
"getAvg",
"(",
"$",
"block",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"enabled",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"block",
",",
"$",
"this",
"->",
"avgs",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",... | Get average block info
@param string $block - key to identify block
@return mixed - associative array
@throws \Exception | [
"Get",
"average",
"block",
"info"
] | 2cc92f09ce7b2f73d5cbc09f5ae4f31f3f9ae3b4 | https://github.com/FusePump/cli.php/blob/2cc92f09ce7b2f73d5cbc09f5ae4f31f3f9ae3b4/lib/FusePump/Cli/Timer.php#L312-L323 |
195,706 | FusePump/cli.php | lib/FusePump/Cli/Timer.php | Timer.finishAvgBlock | private function finishAvgBlock($block)
{
if (!array_key_exists($block, $this->avgs)) {
throw new \Exception('Average block '.$block.' not defined');
}
$this->avgs[$block]['avg'] = $this->avgs[$block]['total'] / $this->avgs[$block]['count'];
return $this->avgs[$block];
... | php | private function finishAvgBlock($block)
{
if (!array_key_exists($block, $this->avgs)) {
throw new \Exception('Average block '.$block.' not defined');
}
$this->avgs[$block]['avg'] = $this->avgs[$block]['total'] / $this->avgs[$block]['count'];
return $this->avgs[$block];
... | [
"private",
"function",
"finishAvgBlock",
"(",
"$",
"block",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"block",
",",
"$",
"this",
"->",
"avgs",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"'Average block '",
".",
"$",
"block",
"... | Finish average block
@param string $block - key to identify block
@return mixed
@throws \Exception | [
"Finish",
"average",
"block"
] | 2cc92f09ce7b2f73d5cbc09f5ae4f31f3f9ae3b4 | https://github.com/FusePump/cli.php/blob/2cc92f09ce7b2f73d5cbc09f5ae4f31f3f9ae3b4/lib/FusePump/Cli/Timer.php#L351-L359 |
195,707 | marando/Units | src/Marando/Units/Distance.php | Distance.create | public static function create($value, $symbol)
{
// Find the conversion factor to meters
$factor = static::factorToMeters($symbol);
// Ensure proper formatting of value and factor for bc math
$value = number_format($value, static::$s, '.', '');
$factor = number_format($fact... | php | public static function create($value, $symbol)
{
// Find the conversion factor to meters
$factor = static::factorToMeters($symbol);
// Ensure proper formatting of value and factor for bc math
$value = number_format($value, static::$s, '.', '');
$factor = number_format($fact... | [
"public",
"static",
"function",
"create",
"(",
"$",
"value",
",",
"$",
"symbol",
")",
"{",
"// Find the conversion factor to meters",
"$",
"factor",
"=",
"static",
"::",
"factorToMeters",
"(",
"$",
"symbol",
")",
";",
"// Ensure proper formatting of value and factor f... | Creates a new distance from a value and symbol.
@param double|string $value Value of the distance
@param string $symbol Symbol of the distance, e.g. m or km
@return static | [
"Creates",
"a",
"new",
"distance",
"from",
"a",
"value",
"and",
"symbol",
"."
] | 1721f16a2fdbd3fd8acb9061d393ce9ef1ce6e70 | https://github.com/marando/Units/blob/1721f16a2fdbd3fd8acb9061d393ce9ef1ce6e70/src/Marando/Units/Distance.php#L88-L105 |
195,708 | marando/Units | src/Marando/Units/Distance.php | Distance.unit | public function unit($symbol, $string = false)
{
// Format instance's meter value and factor to the specified unit.
$m = number_format($this->m, static::$s, '.', '');
$fact = number_format(static::factorToMeters($symbol), static::$s, '.',
'');
// Divide the meters by th... | php | public function unit($symbol, $string = false)
{
// Format instance's meter value and factor to the specified unit.
$m = number_format($this->m, static::$s, '.', '');
$fact = number_format(static::factorToMeters($symbol), static::$s, '.',
'');
// Divide the meters by th... | [
"public",
"function",
"unit",
"(",
"$",
"symbol",
",",
"$",
"string",
"=",
"false",
")",
"{",
"// Format instance's meter value and factor to the specified unit.",
"$",
"m",
"=",
"number_format",
"(",
"$",
"this",
"->",
"m",
",",
"static",
"::",
"$",
"s",
",",... | Returns the value of this instance at the specified unit optionally as
a string with higher precision.
@param string $symbol Symbol of the unit to obtain
@param bool $string True to return as string, false for double
@return double|string | [
"Returns",
"the",
"value",
"of",
"this",
"instance",
"at",
"the",
"specified",
"unit",
"optionally",
"as",
"a",
"string",
"with",
"higher",
"precision",
"."
] | 1721f16a2fdbd3fd8acb9061d393ce9ef1ce6e70 | https://github.com/marando/Units/blob/1721f16a2fdbd3fd8acb9061d393ce9ef1ce6e70/src/Marando/Units/Distance.php#L449-L462 |
195,709 | marando/Units | src/Marando/Units/Distance.php | Distance.add | public function add(Distance $b)
{
return Distance::m(bcadd($this->m, $b->m), static::$s);
} | php | public function add(Distance $b)
{
return Distance::m(bcadd($this->m, $b->m), static::$s);
} | [
"public",
"function",
"add",
"(",
"Distance",
"$",
"b",
")",
"{",
"return",
"Distance",
"::",
"m",
"(",
"bcadd",
"(",
"$",
"this",
"->",
"m",
",",
"$",
"b",
"->",
"m",
")",
",",
"static",
"::",
"$",
"s",
")",
";",
"}"
] | Adds another distance to this instance and returns a new instance with
the sum.
@param Distance $b Distance to add
@return static Sum of the two distances | [
"Adds",
"another",
"distance",
"to",
"this",
"instance",
"and",
"returns",
"a",
"new",
"instance",
"with",
"the",
"sum",
"."
] | 1721f16a2fdbd3fd8acb9061d393ce9ef1ce6e70 | https://github.com/marando/Units/blob/1721f16a2fdbd3fd8acb9061d393ce9ef1ce6e70/src/Marando/Units/Distance.php#L502-L505 |
195,710 | marando/Units | src/Marando/Units/Distance.php | Distance.sub | public function sub(Distance $b)
{
return Distance::m(bcsub($this->m, $b->m), static::$s);
} | php | public function sub(Distance $b)
{
return Distance::m(bcsub($this->m, $b->m), static::$s);
} | [
"public",
"function",
"sub",
"(",
"Distance",
"$",
"b",
")",
"{",
"return",
"Distance",
"::",
"m",
"(",
"bcsub",
"(",
"$",
"this",
"->",
"m",
",",
"$",
"b",
"->",
"m",
")",
",",
"static",
"::",
"$",
"s",
")",
";",
"}"
] | Subtracts another distance from this instance and returns a new instance
with the difference.
@param Distance $b Distance to subtract
@return static Difference of the two distances | [
"Subtracts",
"another",
"distance",
"from",
"this",
"instance",
"and",
"returns",
"a",
"new",
"instance",
"with",
"the",
"difference",
"."
] | 1721f16a2fdbd3fd8acb9061d393ce9ef1ce6e70 | https://github.com/marando/Units/blob/1721f16a2fdbd3fd8acb9061d393ce9ef1ce6e70/src/Marando/Units/Distance.php#L515-L518 |
195,711 | marando/Units | src/Marando/Units/Distance.php | Distance.format | public function format($format)
{
// Sprintf and unit regex
$pattern = '/(%(?:\d+\$)?[+-]?(?:[ 0]|\'.{1})?-?\d*(?:\.\d+)?[bcdeEufFgGosxX])(.*)/';
// Check if string has sprintf and unit...
if (preg_match_all($pattern, $format, $m)) {
// Valid format, save to instance.
... | php | public function format($format)
{
// Sprintf and unit regex
$pattern = '/(%(?:\d+\$)?[+-]?(?:[ 0]|\'.{1})?-?\d*(?:\.\d+)?[bcdeEufFgGosxX])(.*)/';
// Check if string has sprintf and unit...
if (preg_match_all($pattern, $format, $m)) {
// Valid format, save to instance.
... | [
"public",
"function",
"format",
"(",
"$",
"format",
")",
"{",
"// Sprintf and unit regex",
"$",
"pattern",
"=",
"'/(%(?:\\d+\\$)?[+-]?(?:[ 0]|\\'.{1})?-?\\d*(?:\\.\\d+)?[bcdeEufFgGosxX])(.*)/'",
";",
"// Check if string has sprintf and unit...",
"if",
"(",
"preg_match_all",
"(",
... | Formats this instance in the specified strign format.
@param string $format Formatter string, e.g. %01.3f au
@return string | [
"Formats",
"this",
"instance",
"in",
"the",
"specified",
"strign",
"format",
"."
] | 1721f16a2fdbd3fd8acb9061d393ce9ef1ce6e70 | https://github.com/marando/Units/blob/1721f16a2fdbd3fd8acb9061d393ce9ef1ce6e70/src/Marando/Units/Distance.php#L563-L601 |
195,712 | ekyna/MediaBundle | Listener/MediaListener.php | MediaListener.cleanTranslations | private function cleanTranslations(MediaInterface $media)
{
foreach ($media->getTranslations() as $trans) {
if (0 == strlen($trans->getTitle()) && 0 == strlen($trans->getDescription())) {
$media->removeTranslation($trans);
}
}
} | php | private function cleanTranslations(MediaInterface $media)
{
foreach ($media->getTranslations() as $trans) {
if (0 == strlen($trans->getTitle()) && 0 == strlen($trans->getDescription())) {
$media->removeTranslation($trans);
}
}
} | [
"private",
"function",
"cleanTranslations",
"(",
"MediaInterface",
"$",
"media",
")",
"{",
"foreach",
"(",
"$",
"media",
"->",
"getTranslations",
"(",
")",
"as",
"$",
"trans",
")",
"{",
"if",
"(",
"0",
"==",
"strlen",
"(",
"$",
"trans",
"->",
"getTitle",... | Removes empty translations
@param MediaInterface $media | [
"Removes",
"empty",
"translations"
] | 512cf86c801a130a9f17eba8b48d646d23acdbab | https://github.com/ekyna/MediaBundle/blob/512cf86c801a130a9f17eba8b48d646d23acdbab/Listener/MediaListener.php#L96-L103 |
195,713 | agentmedia/phine-core | src/Core/Modules/Backend/AjaxPageParams.php | AjaxPageParams.AddOptionalParamsField | private function AddOptionalParamsField()
{
$name = 'OptionalParameters';
$field = new Textarea($name, $this->OptionalParamsText());
$this->AddField($field);
$this->SetTransAttribute($name, 'placeholder');
} | php | private function AddOptionalParamsField()
{
$name = 'OptionalParameters';
$field = new Textarea($name, $this->OptionalParamsText());
$this->AddField($field);
$this->SetTransAttribute($name, 'placeholder');
} | [
"private",
"function",
"AddOptionalParamsField",
"(",
")",
"{",
"$",
"name",
"=",
"'OptionalParameters'",
";",
"$",
"field",
"=",
"new",
"Textarea",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"OptionalParamsText",
"(",
")",
")",
";",
"$",
"this",
"->",
"A... | Adds the optional parameters textarea | [
"Adds",
"the",
"optional",
"parameters",
"textarea"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Modules/Backend/AjaxPageParams.php#L76-L82 |
195,714 | agentmedia/phine-core | src/Core/Modules/Backend/AjaxPageParams.php | AjaxPageParams.AddFragmentField | private function AddFragmentField()
{
$name = 'Fragment';
$field = Input::Text($name, Request::GetData($this->prefix . 'Fragment'));
$this->AddField($field);
$this->SetTransAttribute($name, 'placeholder');
} | php | private function AddFragmentField()
{
$name = 'Fragment';
$field = Input::Text($name, Request::GetData($this->prefix . 'Fragment'));
$this->AddField($field);
$this->SetTransAttribute($name, 'placeholder');
} | [
"private",
"function",
"AddFragmentField",
"(",
")",
"{",
"$",
"name",
"=",
"'Fragment'",
";",
"$",
"field",
"=",
"Input",
"::",
"Text",
"(",
"$",
"name",
",",
"Request",
"::",
"GetData",
"(",
"$",
"this",
"->",
"prefix",
".",
"'Fragment'",
")",
")",
... | Adds the fragment field | [
"Adds",
"the",
"fragment",
"field"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Modules/Backend/AjaxPageParams.php#L86-L92 |
195,715 | agentmedia/phine-core | src/Core/Modules/Backend/AjaxPageParams.php | AjaxPageParams.OptionalParamsText | private function OptionalParamsText()
{
$params = $this->params;
foreach ($this->oblParams as $name)
{
unset($params[$name]);
}
return $this->serializer->ArrayToLines($params);
} | php | private function OptionalParamsText()
{
$params = $this->params;
foreach ($this->oblParams as $name)
{
unset($params[$name]);
}
return $this->serializer->ArrayToLines($params);
} | [
"private",
"function",
"OptionalParamsText",
"(",
")",
"{",
"$",
"params",
"=",
"$",
"this",
"->",
"params",
";",
"foreach",
"(",
"$",
"this",
"->",
"oblParams",
"as",
"$",
"name",
")",
"{",
"unset",
"(",
"$",
"params",
"[",
"$",
"name",
"]",
")",
... | The field value of the optional paramaters
@return string Returns the optional parameters as multiline text | [
"The",
"field",
"value",
"of",
"the",
"optional",
"paramaters"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Modules/Backend/AjaxPageParams.php#L97-L105 |
195,716 | agentmedia/phine-core | src/Core/Modules/Backend/AjaxPageParams.php | AjaxPageParams.OnSuccess | protected function OnSuccess()
{
$allParams = array();
foreach ($this->oblParams as $param)
{
if ($this->Value($param)) {
$allParams[$param] = $this->Value($param);
}
}
$optParams = $this->serializer->LinesToArray($this->Value('Optional... | php | protected function OnSuccess()
{
$allParams = array();
foreach ($this->oblParams as $param)
{
if ($this->Value($param)) {
$allParams[$param] = $this->Value($param);
}
}
$optParams = $this->serializer->LinesToArray($this->Value('Optional... | [
"protected",
"function",
"OnSuccess",
"(",
")",
"{",
"$",
"allParams",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"oblParams",
"as",
"$",
"param",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"Value",
"(",
"$",
"param",
")",
")",
... | Saves the page selection | [
"Saves",
"the",
"page",
"selection"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Modules/Backend/AjaxPageParams.php#L110-L132 |
195,717 | pickles2/px2-publish-ex | php/publish.php | publish.cli_header | private function cli_header(){
ob_start();
print $this->px->pxcmd()->get_cli_header();
print 'publish directory(tmp): '.$this->path_tmp_publish."\n";
print 'lockfile: '.$this->path_lockfile."\n";
print 'publish directory: '.$this->path_publish_dir."\n";
print 'domain: '.$this->domain."\n";
print 'd... | php | private function cli_header(){
ob_start();
print $this->px->pxcmd()->get_cli_header();
print 'publish directory(tmp): '.$this->path_tmp_publish."\n";
print 'lockfile: '.$this->path_lockfile."\n";
print 'publish directory: '.$this->path_publish_dir."\n";
print 'domain: '.$this->domain."\n";
print 'd... | [
"private",
"function",
"cli_header",
"(",
")",
"{",
"ob_start",
"(",
")",
";",
"print",
"$",
"this",
"->",
"px",
"->",
"pxcmd",
"(",
")",
"->",
"get_cli_header",
"(",
")",
";",
"print",
"'publish directory(tmp): '",
".",
"$",
"this",
"->",
"path_tmp_publis... | print CLI header | [
"print",
"CLI",
"header"
] | 5b6c375cacb01183f3102bfc111e3bf132f774f5 | https://github.com/pickles2/px2-publish-ex/blob/5b6c375cacb01183f3102bfc111e3bf132f774f5/php/publish.php#L268-L294 |
195,718 | pickles2/px2-publish-ex | php/publish.php | publish.make_list_by_sitemap | private function make_list_by_sitemap(){
$sitemap = $this->px->site()->get_sitemap();
foreach( $sitemap as $page_info ){
set_time_limit(30);
$href = $this->px->href( $page_info['path'] );
if( preg_match('/^(?:[a-zA-Z0-9]+\:)?\/\//', $href) ){
// プロトコル名、またはドメイン名から始まるリンク先はスキップ
continue;
}
... | php | private function make_list_by_sitemap(){
$sitemap = $this->px->site()->get_sitemap();
foreach( $sitemap as $page_info ){
set_time_limit(30);
$href = $this->px->href( $page_info['path'] );
if( preg_match('/^(?:[a-zA-Z0-9]+\:)?\/\//', $href) ){
// プロトコル名、またはドメイン名から始まるリンク先はスキップ
continue;
}
... | [
"private",
"function",
"make_list_by_sitemap",
"(",
")",
"{",
"$",
"sitemap",
"=",
"$",
"this",
"->",
"px",
"->",
"site",
"(",
")",
"->",
"get_sitemap",
"(",
")",
";",
"foreach",
"(",
"$",
"sitemap",
"as",
"$",
"page_info",
")",
"{",
"set_time_limit",
... | make list by sitemap
@return bool 常に `true` を返します。 | [
"make",
"list",
"by",
"sitemap"
] | 5b6c375cacb01183f3102bfc111e3bf132f774f5 | https://github.com/pickles2/px2-publish-ex/blob/5b6c375cacb01183f3102bfc111e3bf132f774f5/php/publish.php#L1068-L1082 |
195,719 | skimia/AngularBundle | Components/BundleManager/BundleManager.php | BundleManager.hasBundle | public function hasBundle($name) {
if (isset($this->_globalConfig['bundles'][$name])) {
return true;
} else {
foreach ($this->_bundleConfig as $value) {
if ($value['short_name'] == $name) {
return true;
}
}
... | php | public function hasBundle($name) {
if (isset($this->_globalConfig['bundles'][$name])) {
return true;
} else {
foreach ($this->_bundleConfig as $value) {
if ($value['short_name'] == $name) {
return true;
}
}
... | [
"public",
"function",
"hasBundle",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_globalConfig",
"[",
"'bundles'",
"]",
"[",
"$",
"name",
"]",
")",
")",
"{",
"return",
"true",
";",
"}",
"else",
"{",
"foreach",
"(",
"$",
... | Can use shortName or Symfony Bundle Name | [
"Can",
"use",
"shortName",
"or",
"Symfony",
"Bundle",
"Name"
] | ce12fbc03f8554a7879467e73a739ede8991ec48 | https://github.com/skimia/AngularBundle/blob/ce12fbc03f8554a7879467e73a739ede8991ec48/Components/BundleManager/BundleManager.php#L22-L33 |
195,720 | shrink0r/php-schema | src/Property/StringProperty.php | StringProperty.validate | public function validate($value)
{
return is_string($value) ? Ok::unit() : Error::unit([ Error::NON_STRING ]);
} | php | public function validate($value)
{
return is_string($value) ? Ok::unit() : Error::unit([ Error::NON_STRING ]);
} | [
"public",
"function",
"validate",
"(",
"$",
"value",
")",
"{",
"return",
"is_string",
"(",
"$",
"value",
")",
"?",
"Ok",
"::",
"unit",
"(",
")",
":",
"Error",
"::",
"unit",
"(",
"[",
"Error",
"::",
"NON_STRING",
"]",
")",
";",
"}"
] | Tells if a given value is a valid string.
@param mixed $value
@return ResultInterface Returns Ok if the value is valid, otherwise an Error is returned. | [
"Tells",
"if",
"a",
"given",
"value",
"is",
"a",
"valid",
"string",
"."
] | 94293fe897af376dd9d05962e2c516079409dd29 | https://github.com/shrink0r/php-schema/blob/94293fe897af376dd9d05962e2c516079409dd29/src/Property/StringProperty.php#L18-L21 |
195,721 | nochso/ORM2 | src/DBA/LogEntry.php | LogEntry.finish | public function finish()
{
$this->end = microtime(true);
$this->duration = $this->end - $this->start;
DBA::addLog($this);
} | php | public function finish()
{
$this->end = microtime(true);
$this->duration = $this->end - $this->start;
DBA::addLog($this);
} | [
"public",
"function",
"finish",
"(",
")",
"{",
"$",
"this",
"->",
"end",
"=",
"microtime",
"(",
"true",
")",
";",
"$",
"this",
"->",
"duration",
"=",
"$",
"this",
"->",
"end",
"-",
"$",
"this",
"->",
"start",
";",
"DBA",
"::",
"addLog",
"(",
"$",... | Add the finished entry to the log | [
"Add",
"the",
"finished",
"entry",
"to",
"the",
"log"
] | 89f9a5c61ad5f575fbdd52990171b52d54f8bfbc | https://github.com/nochso/ORM2/blob/89f9a5c61ad5f575fbdd52990171b52d54f8bfbc/src/DBA/LogEntry.php#L38-L43 |
195,722 | nochso/ORM2 | src/DBA/LogEntry.php | LogEntry.getPrettyStatement | public function getPrettyStatement()
{
$assoc = [];
$statement = $this->statement;
foreach ($this->data as $key => $value) {
if (is_numeric($key)) {
$statement = $this->strReplaceOnce('?', "'" . $value . "'", $statement);
} else {
$asso... | php | public function getPrettyStatement()
{
$assoc = [];
$statement = $this->statement;
foreach ($this->data as $key => $value) {
if (is_numeric($key)) {
$statement = $this->strReplaceOnce('?', "'" . $value . "'", $statement);
} else {
$asso... | [
"public",
"function",
"getPrettyStatement",
"(",
")",
"{",
"$",
"assoc",
"=",
"[",
"]",
";",
"$",
"statement",
"=",
"$",
"this",
"->",
"statement",
";",
"foreach",
"(",
"$",
"this",
"->",
"data",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if"... | Returns a readable SQL statement with the parameters merged inline.
Both numeric and hashed arrays work, but they can't be mixed.
@return string | [
"Returns",
"a",
"readable",
"SQL",
"statement",
"with",
"the",
"parameters",
"merged",
"inline",
".",
"Both",
"numeric",
"and",
"hashed",
"arrays",
"work",
"but",
"they",
"can",
"t",
"be",
"mixed",
"."
] | 89f9a5c61ad5f575fbdd52990171b52d54f8bfbc | https://github.com/nochso/ORM2/blob/89f9a5c61ad5f575fbdd52990171b52d54f8bfbc/src/DBA/LogEntry.php#L61-L86 |
195,723 | mtils/file-db | src/FileDB/Controller/FileController.php | FileController.index | public function index($dirId=null)
{
if ($dirId == 'index') {
$dirId = NULL;
}
$parentDir = NULL;
$params = $this->getPassThruParams();
$dir = $this->getDirectory($dirId);
if ( isset($params['type']) && $params['type'] == 'image') {
$this-... | php | public function index($dirId=null)
{
if ($dirId == 'index') {
$dirId = NULL;
}
$parentDir = NULL;
$params = $this->getPassThruParams();
$dir = $this->getDirectory($dirId);
if ( isset($params['type']) && $params['type'] == 'image') {
$this-... | [
"public",
"function",
"index",
"(",
"$",
"dirId",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"dirId",
"==",
"'index'",
")",
"{",
"$",
"dirId",
"=",
"NULL",
";",
"}",
"$",
"parentDir",
"=",
"NULL",
";",
"$",
"params",
"=",
"$",
"this",
"->",
"getPassT... | List a directory or the root directory.
@param int $dirId (optional)
@return mixed | [
"List",
"a",
"directory",
"or",
"the",
"root",
"directory",
"."
] | 270ebc26b0fa3d2c996ca8861507fa63d2db6814 | https://github.com/mtils/file-db/blob/270ebc26b0fa3d2c996ca8861507fa63d2db6814/src/FileDB/Controller/FileController.php#L112-L142 |
195,724 | mtils/file-db | src/FileDB/Controller/FileController.php | FileController.upload | public function upload(Request $request, $dirId)
{
try {
$folder = $this->getDirOrFail($dirId);
if (!$request->hasFile('uploadedFile')) {
throw new RuntimeException('Uploaded File not found');
}
$uploadedFile = $request->file('uploadedFile'... | php | public function upload(Request $request, $dirId)
{
try {
$folder = $this->getDirOrFail($dirId);
if (!$request->hasFile('uploadedFile')) {
throw new RuntimeException('Uploaded File not found');
}
$uploadedFile = $request->file('uploadedFile'... | [
"public",
"function",
"upload",
"(",
"Request",
"$",
"request",
",",
"$",
"dirId",
")",
"{",
"try",
"{",
"$",
"folder",
"=",
"$",
"this",
"->",
"getDirOrFail",
"(",
"$",
"dirId",
")",
";",
"if",
"(",
"!",
"$",
"request",
"->",
"hasFile",
"(",
"'upl... | Upload a file into the file db.
@param Request $request
@param int $dirId
@return RedirectResponse | [
"Upload",
"a",
"file",
"into",
"the",
"file",
"db",
"."
] | 270ebc26b0fa3d2c996ca8861507fa63d2db6814 | https://github.com/mtils/file-db/blob/270ebc26b0fa3d2c996ca8861507fa63d2db6814/src/FileDB/Controller/FileController.php#L180-L214 |
195,725 | mtils/file-db | src/FileDB/Controller/FileController.php | FileController.sync | public function sync($dirId)
{
$dir = $this->getDirOrFail($dirId);
$this->fileDB->syncWithFs($dir, 1);
return $this->redirectTo('index', [$dir->getId()]);
} | php | public function sync($dirId)
{
$dir = $this->getDirOrFail($dirId);
$this->fileDB->syncWithFs($dir, 1);
return $this->redirectTo('index', [$dir->getId()]);
} | [
"public",
"function",
"sync",
"(",
"$",
"dirId",
")",
"{",
"$",
"dir",
"=",
"$",
"this",
"->",
"getDirOrFail",
"(",
"$",
"dirId",
")",
";",
"$",
"this",
"->",
"fileDB",
"->",
"syncWithFs",
"(",
"$",
"dir",
",",
"1",
")",
";",
"return",
"$",
"this... | Synchronize the filesystem into the db in this folder.
@param int $dirId
@return RedirectResponse | [
"Synchronize",
"the",
"filesystem",
"into",
"the",
"db",
"in",
"this",
"folder",
"."
] | 270ebc26b0fa3d2c996ca8861507fa63d2db6814 | https://github.com/mtils/file-db/blob/270ebc26b0fa3d2c996ca8861507fa63d2db6814/src/FileDB/Controller/FileController.php#L223-L228 |
195,726 | mtils/file-db | src/FileDB/Controller/FileController.php | FileController.provideOpenLinkAttributes | public function provideOpenLinkAttributes($context, Closure $closure)
{
$closure->bindTo($this);
$this->extend($this->getContextExtendName($context), $closure);
return $this;
} | php | public function provideOpenLinkAttributes($context, Closure $closure)
{
$closure->bindTo($this);
$this->extend($this->getContextExtendName($context), $closure);
return $this;
} | [
"public",
"function",
"provideOpenLinkAttributes",
"(",
"$",
"context",
",",
"Closure",
"$",
"closure",
")",
"{",
"$",
"closure",
"->",
"bindTo",
"(",
"$",
"this",
")",
";",
"$",
"this",
"->",
"extend",
"(",
"$",
"this",
"->",
"getContextExtendName",
"(",
... | Assign a callable to manipulate the attributes for the "open" links to
open files.
@param string $context
@param Closure $closure
@return $this | [
"Assign",
"a",
"callable",
"to",
"manipulate",
"the",
"attributes",
"for",
"the",
"open",
"links",
"to",
"open",
"files",
"."
] | 270ebc26b0fa3d2c996ca8861507fa63d2db6814 | https://github.com/mtils/file-db/blob/270ebc26b0fa3d2c996ca8861507fa63d2db6814/src/FileDB/Controller/FileController.php#L400-L405 |
195,727 | mtils/file-db | src/FileDB/Controller/FileController.php | FileController.getPassThruParams | protected function getPassThruParams()
{
if ($this->passThruParams !== null) {
return $this->passThruParams;
}
$this->passThruParams = [];
$all = Input::all();
$filtered = array_except($all, ['sync','uploadedFile','folderName']);
// Security check
... | php | protected function getPassThruParams()
{
if ($this->passThruParams !== null) {
return $this->passThruParams;
}
$this->passThruParams = [];
$all = Input::all();
$filtered = array_except($all, ['sync','uploadedFile','folderName']);
// Security check
... | [
"protected",
"function",
"getPassThruParams",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"passThruParams",
"!==",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"passThruParams",
";",
"}",
"$",
"this",
"->",
"passThruParams",
"=",
"[",
"]",
";",
"$",
... | Get some parameters that should be added to every link.
@return array | [
"Get",
"some",
"parameters",
"that",
"should",
"be",
"added",
"to",
"every",
"link",
"."
] | 270ebc26b0fa3d2c996ca8861507fa63d2db6814 | https://github.com/mtils/file-db/blob/270ebc26b0fa3d2c996ca8861507fa63d2db6814/src/FileDB/Controller/FileController.php#L412-L436 |
195,728 | mtils/file-db | src/FileDB/Controller/FileController.php | FileController.getAttributeProvider | protected function getAttributeProvider($context)
{
$extendName = $this->getContextExtendName($context);
if ($this->hasExtension($extendName)) {
return $this->getExtension($extendName);
}
return function($file) {
return [
'href' =>$file->ur... | php | protected function getAttributeProvider($context)
{
$extendName = $this->getContextExtendName($context);
if ($this->hasExtension($extendName)) {
return $this->getExtension($extendName);
}
return function($file) {
return [
'href' =>$file->ur... | [
"protected",
"function",
"getAttributeProvider",
"(",
"$",
"context",
")",
"{",
"$",
"extendName",
"=",
"$",
"this",
"->",
"getContextExtendName",
"(",
"$",
"context",
")",
";",
"if",
"(",
"$",
"this",
"->",
"hasExtension",
"(",
"$",
"extendName",
")",
")"... | Return the attribute provider to provide attributes for the open links.
@see self::provideOpenLinkAttributes()
@param string $context
@return callable | [
"Return",
"the",
"attribute",
"provider",
"to",
"provide",
"attributes",
"for",
"the",
"open",
"links",
"."
] | 270ebc26b0fa3d2c996ca8861507fa63d2db6814 | https://github.com/mtils/file-db/blob/270ebc26b0fa3d2c996ca8861507fa63d2db6814/src/FileDB/Controller/FileController.php#L478-L494 |
195,729 | loevgaard/dandomain-foundation-entities | src/Entity/Order.php | Order.createMoney | private function createMoney(int $amount = 0): ?Money
{
if (!$this->currency) {
return null;
}
return DandomainFoundation\createMoney($this->currency->getIsoCodeAlpha(), $amount);
} | php | private function createMoney(int $amount = 0): ?Money
{
if (!$this->currency) {
return null;
}
return DandomainFoundation\createMoney($this->currency->getIsoCodeAlpha(), $amount);
} | [
"private",
"function",
"createMoney",
"(",
"int",
"$",
"amount",
"=",
"0",
")",
":",
"?",
"Money",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"currency",
")",
"{",
"return",
"null",
";",
"}",
"return",
"DandomainFoundation",
"\\",
"createMoney",
"(",
"$",... | A helper method for creating a Money object from a float based on the shared currency.
@param int $amount
@return Money|null | [
"A",
"helper",
"method",
"for",
"creating",
"a",
"Money",
"object",
"from",
"a",
"float",
"based",
"on",
"the",
"shared",
"currency",
"."
] | 256f7aa8b40d2bd9488046c3c2b1e04e982d78ad | https://github.com/loevgaard/dandomain-foundation-entities/blob/256f7aa8b40d2bd9488046c3c2b1e04e982d78ad/src/Entity/Order.php#L1265-L1272 |
195,730 | koolkode/meta | src/DocComment.php | DocComment.getDescription | public function getDescription($short = false)
{
if($short)
{
if($pos = strpos($this->description, "\r"))
{
return substr($this->description, 0, $pos);
}
if($pos = strpos($this->description, "\n"))
{
return substr($this->description, 0, $pos);
}
}
return $this->description;
} | php | public function getDescription($short = false)
{
if($short)
{
if($pos = strpos($this->description, "\r"))
{
return substr($this->description, 0, $pos);
}
if($pos = strpos($this->description, "\n"))
{
return substr($this->description, 0, $pos);
}
}
return $this->description;
} | [
"public",
"function",
"getDescription",
"(",
"$",
"short",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"short",
")",
"{",
"if",
"(",
"$",
"pos",
"=",
"strpos",
"(",
"$",
"this",
"->",
"description",
",",
"\"\\r\"",
")",
")",
"{",
"return",
"substr",
"(... | Get the description from this doc comment.
@param boolean $short Return the short description (first paragraph)?
@return string | [
"Get",
"the",
"description",
"from",
"this",
"doc",
"comment",
"."
] | 339db24d3ce461190f552c96e243bca21010f360 | https://github.com/koolkode/meta/blob/339db24d3ce461190f552c96e243bca21010f360/src/DocComment.php#L48-L64 |
195,731 | koolkode/meta | src/DocComment.php | DocComment.getTagValue | public function getTagValue($tag)
{
if(!$this->hasTag($tag))
{
throw new \OutOfBoundsException('Tag ' . $tag . ' is not set');
}
if(empty($this->tags[$tag]))
{
throw new \OutOfBoundsException('Tag ' . $tag . ' does not have a value');
}
return $this->tags[$tag][0];
} | php | public function getTagValue($tag)
{
if(!$this->hasTag($tag))
{
throw new \OutOfBoundsException('Tag ' . $tag . ' is not set');
}
if(empty($this->tags[$tag]))
{
throw new \OutOfBoundsException('Tag ' . $tag . ' does not have a value');
}
return $this->tags[$tag][0];
} | [
"public",
"function",
"getTagValue",
"(",
"$",
"tag",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasTag",
"(",
"$",
"tag",
")",
")",
"{",
"throw",
"new",
"\\",
"OutOfBoundsException",
"(",
"'Tag '",
".",
"$",
"tag",
".",
"' is not set'",
")",
";",... | Get the value of a tag.
@param string $tag
@return string
@throws \OutOfBoundsException | [
"Get",
"the",
"value",
"of",
"a",
"tag",
"."
] | 339db24d3ce461190f552c96e243bca21010f360 | https://github.com/koolkode/meta/blob/339db24d3ce461190f552c96e243bca21010f360/src/DocComment.php#L95-L108 |
195,732 | koolkode/meta | src/DocComment.php | DocComment.getFieldType | public function getFieldType(NamespaceContext $context = NULL)
{
try
{
$var = $this->getTagValue('var');
}
catch(\Exception $e)
{
return new MetaType(MetaType::TYPE_MIXED);
}
return $this->parseTypeInfo($var, ($context === NULL) ? new NamespaceContext() : $context);
} | php | public function getFieldType(NamespaceContext $context = NULL)
{
try
{
$var = $this->getTagValue('var');
}
catch(\Exception $e)
{
return new MetaType(MetaType::TYPE_MIXED);
}
return $this->parseTypeInfo($var, ($context === NULL) ? new NamespaceContext() : $context);
} | [
"public",
"function",
"getFieldType",
"(",
"NamespaceContext",
"$",
"context",
"=",
"NULL",
")",
"{",
"try",
"{",
"$",
"var",
"=",
"$",
"this",
"->",
"getTagValue",
"(",
"'var'",
")",
";",
"}",
"catch",
"(",
"\\",
"Exception",
"$",
"e",
")",
"{",
"re... | Get the type of the field this doc comment belongs to.
@param NamespaceContext $context
@return MetaType | [
"Get",
"the",
"type",
"of",
"the",
"field",
"this",
"doc",
"comment",
"belongs",
"to",
"."
] | 339db24d3ce461190f552c96e243bca21010f360 | https://github.com/koolkode/meta/blob/339db24d3ce461190f552c96e243bca21010f360/src/DocComment.php#L132-L144 |
195,733 | koolkode/meta | src/DocComment.php | DocComment.parse | protected function parse($comment)
{
$this->description = '';
$this->tags = [];
$comment = preg_replace("'^\s*/*\**'m", '', substr($comment, 0, -2));
$parts = preg_split("'^\s*@([a-zA-Z][a-zA-Z0-9]*)'m", $comment, -1, PREG_SPLIT_DELIM_CAPTURE);
$this->description = preg_replace("'^\h+'m", '', trim($parts... | php | protected function parse($comment)
{
$this->description = '';
$this->tags = [];
$comment = preg_replace("'^\s*/*\**'m", '', substr($comment, 0, -2));
$parts = preg_split("'^\s*@([a-zA-Z][a-zA-Z0-9]*)'m", $comment, -1, PREG_SPLIT_DELIM_CAPTURE);
$this->description = preg_replace("'^\h+'m", '', trim($parts... | [
"protected",
"function",
"parse",
"(",
"$",
"comment",
")",
"{",
"$",
"this",
"->",
"description",
"=",
"''",
";",
"$",
"this",
"->",
"tags",
"=",
"[",
"]",
";",
"$",
"comment",
"=",
"preg_replace",
"(",
"\"'^\\s*/*\\**'m\"",
",",
"''",
",",
"substr",
... | Parse the given doc comment and populate description and tags.
@param string $comment | [
"Parse",
"the",
"given",
"doc",
"comment",
"and",
"populate",
"description",
"and",
"tags",
"."
] | 339db24d3ce461190f552c96e243bca21010f360 | https://github.com/koolkode/meta/blob/339db24d3ce461190f552c96e243bca21010f360/src/DocComment.php#L171-L187 |
195,734 | bound1ess/essence | src/Essence/Matchers/AbstractMatcher.php | AbstractMatcher.setMessage | protected function setMessage($message, array $parameters = [])
{
$message = sprintf(
"%s: %s.",
(new \ReflectionClass($this))->getShortName(),
$message
);
$parameters = array_map([$this->getDumper(), "dump"], $parameters);
$this->message = call_... | php | protected function setMessage($message, array $parameters = [])
{
$message = sprintf(
"%s: %s.",
(new \ReflectionClass($this))->getShortName(),
$message
);
$parameters = array_map([$this->getDumper(), "dump"], $parameters);
$this->message = call_... | [
"protected",
"function",
"setMessage",
"(",
"$",
"message",
",",
"array",
"$",
"parameters",
"=",
"[",
"]",
")",
"{",
"$",
"message",
"=",
"sprintf",
"(",
"\"%s: %s.\"",
",",
"(",
"new",
"\\",
"ReflectionClass",
"(",
"$",
"this",
")",
")",
"->",
"getSh... | Sets the error message.
@see Essence\Matchers\AbstractMatcher::$message
@param string $message
@param array $parameters
@return void | [
"Sets",
"the",
"error",
"message",
"."
] | b773d3f17e192d7c7184ffd3640c668e7d74f69b | https://github.com/bound1ess/essence/blob/b773d3f17e192d7c7184ffd3640c668e7d74f69b/src/Essence/Matchers/AbstractMatcher.php#L130-L144 |
195,735 | MinyFramework/Miny-Core | src/Extendable.php | Extendable.addMethod | public function addMethod($method, callable $callback)
{
if (!is_string($method)) {
throw new \InvalidArgumentException('$method must be string');
}
$this->plugins[$method] = $callback;
} | php | public function addMethod($method, callable $callback)
{
if (!is_string($method)) {
throw new \InvalidArgumentException('$method must be string');
}
$this->plugins[$method] = $callback;
} | [
"public",
"function",
"addMethod",
"(",
"$",
"method",
",",
"callable",
"$",
"callback",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"method",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'$method must be string'",
")",
";",
... | Dynamically add a method to the class.
@param string $method
@param callable $callback
@throws \InvalidArgumentException | [
"Dynamically",
"add",
"a",
"method",
"to",
"the",
"class",
"."
] | a1bfe801a44a49cf01f16411cb4663473e9c827c | https://github.com/MinyFramework/Miny-Core/blob/a1bfe801a44a49cf01f16411cb4663473e9c827c/src/Extendable.php#L32-L38 |
195,736 | MinyFramework/Miny-Core | src/Extendable.php | Extendable.addSetters | public function addSetters(array $setters)
{
foreach ($setters as $property => $setter) {
if (is_int($property)) {
$property = $setter;
$setter = 'set' . ucfirst($setter);
}
$this->setters[$setter] = $property;
}
} | php | public function addSetters(array $setters)
{
foreach ($setters as $property => $setter) {
if (is_int($property)) {
$property = $setter;
$setter = 'set' . ucfirst($setter);
}
$this->setters[$setter] = $property;
}
} | [
"public",
"function",
"addSetters",
"(",
"array",
"$",
"setters",
")",
"{",
"foreach",
"(",
"$",
"setters",
"as",
"$",
"property",
"=>",
"$",
"setter",
")",
"{",
"if",
"(",
"is_int",
"(",
"$",
"property",
")",
")",
"{",
"$",
"property",
"=",
"$",
"... | Register multiple property setters.
@param array $setters | [
"Register",
"multiple",
"property",
"setters",
"."
] | a1bfe801a44a49cf01f16411cb4663473e9c827c | https://github.com/MinyFramework/Miny-Core/blob/a1bfe801a44a49cf01f16411cb4663473e9c827c/src/Extendable.php#L87-L96 |
195,737 | anime-db/catalog-bundle | src/Controller/ItemController.php | ItemController.addManuallyAction | public function addManuallyAction(Request $request)
{
$response = $this->getCacheTimeKeeper()->getResponse();
// response was not modified for this request
if ($response->isNotModified($request)) {
return $response;
}
$item = new Item();
/* @var $form Fo... | php | public function addManuallyAction(Request $request)
{
$response = $this->getCacheTimeKeeper()->getResponse();
// response was not modified for this request
if ($response->isNotModified($request)) {
return $response;
}
$item = new Item();
/* @var $form Fo... | [
"public",
"function",
"addManuallyAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"getCacheTimeKeeper",
"(",
")",
"->",
"getResponse",
"(",
")",
";",
"// response was not modified for this request",
"if",
"(",
"$",
"re... | Addition form.
@param Request $request
@return Response | [
"Addition",
"form",
"."
] | 631b6f92a654e91bee84f46218c52cf42bdb8606 | https://github.com/anime-db/catalog-bundle/blob/631b6f92a654e91bee84f46218c52cf42bdb8606/src/Controller/ItemController.php#L154-L185 |
195,738 | anime-db/catalog-bundle | src/Controller/ItemController.php | ItemController.changeAction | public function changeAction(Item $item, Request $request)
{
/* @var $form Form */
$form = $this->createForm('entity_item', $item)
->handleRequest($request);
if ($form->isValid()) {
$em = $this->getDoctrine()->getManager();
$em->persist($item);
... | php | public function changeAction(Item $item, Request $request)
{
/* @var $form Form */
$form = $this->createForm('entity_item', $item)
->handleRequest($request);
if ($form->isValid()) {
$em = $this->getDoctrine()->getManager();
$em->persist($item);
... | [
"public",
"function",
"changeAction",
"(",
"Item",
"$",
"item",
",",
"Request",
"$",
"request",
")",
"{",
"/* @var $form Form */",
"$",
"form",
"=",
"$",
"this",
"->",
"createForm",
"(",
"'entity_item'",
",",
"$",
"item",
")",
"->",
"handleRequest",
"(",
"... | Change item.
@param Item $item
@param Request $request
@return Response | [
"Change",
"item",
"."
] | 631b6f92a654e91bee84f46218c52cf42bdb8606 | https://github.com/anime-db/catalog-bundle/blob/631b6f92a654e91bee84f46218c52cf42bdb8606/src/Controller/ItemController.php#L195-L215 |
195,739 | anime-db/catalog-bundle | src/Controller/ItemController.php | ItemController.deleteAction | public function deleteAction(Item $item)
{
$em = $this->getDoctrine()->getManager();
$em->remove($item);
$em->flush();
return $this->redirect($this->generateUrl('home'));
} | php | public function deleteAction(Item $item)
{
$em = $this->getDoctrine()->getManager();
$em->remove($item);
$em->flush();
return $this->redirect($this->generateUrl('home'));
} | [
"public",
"function",
"deleteAction",
"(",
"Item",
"$",
"item",
")",
"{",
"$",
"em",
"=",
"$",
"this",
"->",
"getDoctrine",
"(",
")",
"->",
"getManager",
"(",
")",
";",
"$",
"em",
"->",
"remove",
"(",
"$",
"item",
")",
";",
"$",
"em",
"->",
"flus... | Delete item.
@param Item $item
@return Response | [
"Delete",
"item",
"."
] | 631b6f92a654e91bee84f46218c52cf42bdb8606 | https://github.com/anime-db/catalog-bundle/blob/631b6f92a654e91bee84f46218c52cf42bdb8606/src/Controller/ItemController.php#L224-L231 |
195,740 | anime-db/catalog-bundle | src/Controller/ItemController.php | ItemController.importAction | public function importAction($plugin, Request $request)
{
/* @var $chain ChainSearch */
$chain = $this->get('anime_db.plugin.import');
/* @var $import ImportInterface */
if (!($import = $chain->getPlugin($plugin))) {
throw $this->createNotFoundException('Plugin \''.$plugi... | php | public function importAction($plugin, Request $request)
{
/* @var $chain ChainSearch */
$chain = $this->get('anime_db.plugin.import');
/* @var $import ImportInterface */
if (!($import = $chain->getPlugin($plugin))) {
throw $this->createNotFoundException('Plugin \''.$plugi... | [
"public",
"function",
"importAction",
"(",
"$",
"plugin",
",",
"Request",
"$",
"request",
")",
"{",
"/* @var $chain ChainSearch */",
"$",
"chain",
"=",
"$",
"this",
"->",
"get",
"(",
"'anime_db.plugin.import'",
")",
";",
"/* @var $import ImportInterface */",
"if",
... | Import items.
@param string $plugin
@param Request $request
@return Response | [
"Import",
"items",
"."
] | 631b6f92a654e91bee84f46218c52cf42bdb8606 | https://github.com/anime-db/catalog-bundle/blob/631b6f92a654e91bee84f46218c52cf42bdb8606/src/Controller/ItemController.php#L241-L273 |
195,741 | anime-db/catalog-bundle | src/Controller/ItemController.php | ItemController.duplicateAction | public function duplicateAction(Request $request)
{
/* @var $rep ItemRepository */
$rep = $this->getDoctrine()->getRepository('AnimeDbCatalogBundle:Item');
// get store item
$item = $request->getSession()->get(self::NAME_ITEM_ADDED);
if (!($item instanceof Item)) {
... | php | public function duplicateAction(Request $request)
{
/* @var $rep ItemRepository */
$rep = $this->getDoctrine()->getRepository('AnimeDbCatalogBundle:Item');
// get store item
$item = $request->getSession()->get(self::NAME_ITEM_ADDED);
if (!($item instanceof Item)) {
... | [
"public",
"function",
"duplicateAction",
"(",
"Request",
"$",
"request",
")",
"{",
"/* @var $rep ItemRepository */",
"$",
"rep",
"=",
"$",
"this",
"->",
"getDoctrine",
"(",
")",
"->",
"getRepository",
"(",
"'AnimeDbCatalogBundle:Item'",
")",
";",
"// get store item"... | Confirm duplicate item.
@param Request $request
@return Response | [
"Confirm",
"duplicate",
"item",
"."
] | 631b6f92a654e91bee84f46218c52cf42bdb8606 | https://github.com/anime-db/catalog-bundle/blob/631b6f92a654e91bee84f46218c52cf42bdb8606/src/Controller/ItemController.php#L282-L314 |
195,742 | anime-db/catalog-bundle | src/Controller/ItemController.php | ItemController.limitControlAction | public function limitControlAction(Request $request, $total = '')
{
/* @var $controls ListControls */
$controls = $this->get('anime_db.item.list_controls');
if (!is_numeric($total) || $total < 0) {
/* @var $rep ItemRepository */
$rep = $this->getDoctrine()->getReposi... | php | public function limitControlAction(Request $request, $total = '')
{
/* @var $controls ListControls */
$controls = $this->get('anime_db.item.list_controls');
if (!is_numeric($total) || $total < 0) {
/* @var $rep ItemRepository */
$rep = $this->getDoctrine()->getReposi... | [
"public",
"function",
"limitControlAction",
"(",
"Request",
"$",
"request",
",",
"$",
"total",
"=",
"''",
")",
"{",
"/* @var $controls ListControls */",
"$",
"controls",
"=",
"$",
"this",
"->",
"get",
"(",
"'anime_db.item.list_controls'",
")",
";",
"if",
"(",
... | List items limit control.
@param Request $request
@param string|int $total
@return Response | [
"List",
"items",
"limit",
"control",
"."
] | 631b6f92a654e91bee84f46218c52cf42bdb8606 | https://github.com/anime-db/catalog-bundle/blob/631b6f92a654e91bee84f46218c52cf42bdb8606/src/Controller/ItemController.php#L343-L358 |
195,743 | anime-db/catalog-bundle | src/Controller/ItemController.php | ItemController.sortControlAction | public function sortControlAction(Request $request)
{
/* @var $controls ListControls */
$controls = $this->get('anime_db.item.list_controls');
$direction = $controls->getSortDirection($request->query->all());
$sort_direction = [
'type' => $direction == 'ASC' ? 'DESC' : '... | php | public function sortControlAction(Request $request)
{
/* @var $controls ListControls */
$controls = $this->get('anime_db.item.list_controls');
$direction = $controls->getSortDirection($request->query->all());
$sort_direction = [
'type' => $direction == 'ASC' ? 'DESC' : '... | [
"public",
"function",
"sortControlAction",
"(",
"Request",
"$",
"request",
")",
"{",
"/* @var $controls ListControls */",
"$",
"controls",
"=",
"$",
"this",
"->",
"get",
"(",
"'anime_db.item.list_controls'",
")",
";",
"$",
"direction",
"=",
"$",
"controls",
"->",
... | List items sort control.
@param Request $request
@return Response | [
"List",
"items",
"sort",
"control",
"."
] | 631b6f92a654e91bee84f46218c52cf42bdb8606 | https://github.com/anime-db/catalog-bundle/blob/631b6f92a654e91bee84f46218c52cf42bdb8606/src/Controller/ItemController.php#L367-L382 |
195,744 | jenskooij/cloudcontrol | src/util/Cms.php | Cms.editDocumentLink | public static function editDocumentLink($path)
{
if (self::isLoggedIn()) {
$path = 0 === strpos($path, '/') ? substr($path, 1) : $path;
return Request::$subfolders . 'cms/documents/edit-document?slug=' . urlencode($path);
} else {
return '';
}
} | php | public static function editDocumentLink($path)
{
if (self::isLoggedIn()) {
$path = 0 === strpos($path, '/') ? substr($path, 1) : $path;
return Request::$subfolders . 'cms/documents/edit-document?slug=' . urlencode($path);
} else {
return '';
}
} | [
"public",
"static",
"function",
"editDocumentLink",
"(",
"$",
"path",
")",
"{",
"if",
"(",
"self",
"::",
"isLoggedIn",
"(",
")",
")",
"{",
"$",
"path",
"=",
"0",
"===",
"strpos",
"(",
"$",
"path",
",",
"'/'",
")",
"?",
"substr",
"(",
"$",
"path",
... | Returns the cms link for editing a document
@param $path
@return string
@throws \Exception | [
"Returns",
"the",
"cms",
"link",
"for",
"editing",
"a",
"document"
] | 76e5d9ac8f9c50d06d39a995d13cc03742536548 | https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/util/Cms.php#L39-L47 |
195,745 | jenskooij/cloudcontrol | src/util/Cms.php | Cms.newDocument | public static function newDocument($path = '/', $documentType = '')
{
if (self::isLoggedIn()) {
$return = self::getAssetsIfNotIncluded();
return $return . '<a title="New Document" data-href="' . self::newDocumentLink($path,
$documentType) . '" class="ccEditDocumen... | php | public static function newDocument($path = '/', $documentType = '')
{
if (self::isLoggedIn()) {
$return = self::getAssetsIfNotIncluded();
return $return . '<a title="New Document" data-href="' . self::newDocumentLink($path,
$documentType) . '" class="ccEditDocumen... | [
"public",
"static",
"function",
"newDocument",
"(",
"$",
"path",
"=",
"'/'",
",",
"$",
"documentType",
"=",
"''",
")",
"{",
"if",
"(",
"self",
"::",
"isLoggedIn",
"(",
")",
")",
"{",
"$",
"return",
"=",
"self",
"::",
"getAssetsIfNotIncluded",
"(",
")",... | Returns a button with a link for creating a new document
@param string $path
@param string $documentType
@return string
@throws \Exception | [
"Returns",
"a",
"button",
"with",
"a",
"link",
"for",
"creating",
"a",
"new",
"document"
] | 76e5d9ac8f9c50d06d39a995d13cc03742536548 | https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/util/Cms.php#L56-L65 |
195,746 | jenskooij/cloudcontrol | src/util/Cms.php | Cms.newDocumentLink | public static function newDocumentLink($path = '/', $documentType = '')
{
if (self::isLoggedIn()) {
$path = 0 === strpos($path, '/') ? $path : '/' . $path;
$linkPostFix = '';
if ($documentType !== '') {
$linkPostFix = '&documentType=' . $documentType;
... | php | public static function newDocumentLink($path = '/', $documentType = '')
{
if (self::isLoggedIn()) {
$path = 0 === strpos($path, '/') ? $path : '/' . $path;
$linkPostFix = '';
if ($documentType !== '') {
$linkPostFix = '&documentType=' . $documentType;
... | [
"public",
"static",
"function",
"newDocumentLink",
"(",
"$",
"path",
"=",
"'/'",
",",
"$",
"documentType",
"=",
"''",
")",
"{",
"if",
"(",
"self",
"::",
"isLoggedIn",
"(",
")",
")",
"{",
"$",
"path",
"=",
"0",
"===",
"strpos",
"(",
"$",
"path",
","... | Returns the cms link for creating a new document
@param string $path
@param string $documentType
@return string
@throws \Exception | [
"Returns",
"the",
"cms",
"link",
"for",
"creating",
"a",
"new",
"document"
] | 76e5d9ac8f9c50d06d39a995d13cc03742536548 | https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/util/Cms.php#L74-L86 |
195,747 | wb-crowdfusion/crowdfusion | system/core/classes/libraries/storagefacility/AbstractStorageFacility.php | AbstractStorageFacility.resolveFile | public function resolveFile(StorageFacilityParams $params, $fileid)
{
return new StorageFacilityFile($fileid, $this->generateStoragePath($params, $fileid), $this->generateUrl($params, $fileid));
} | php | public function resolveFile(StorageFacilityParams $params, $fileid)
{
return new StorageFacilityFile($fileid, $this->generateStoragePath($params, $fileid), $this->generateUrl($params, $fileid));
} | [
"public",
"function",
"resolveFile",
"(",
"StorageFacilityParams",
"$",
"params",
",",
"$",
"fileid",
")",
"{",
"return",
"new",
"StorageFacilityFile",
"(",
"$",
"fileid",
",",
"$",
"this",
"->",
"generateStoragePath",
"(",
"$",
"params",
",",
"$",
"fileid",
... | Using storage facility params, generate a StorageFacilityFile object without querying storage
@param StorageFacilityParams $params Parameters used to determine storage location and URL
@param string $fileid File identifier of stored file, ex. /path/to/file.jpg
@return StorageFacilityFile | [
"Using",
"storage",
"facility",
"params",
"generate",
"a",
"StorageFacilityFile",
"object",
"without",
"querying",
"storage"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/storagefacility/AbstractStorageFacility.php#L232-L235 |
195,748 | Evozon-PHP/Tissue | Adapter/AbstractAdapter.php | AbstractAdapter.createProcessBuilder | protected function createProcessBuilder(array $arguments = [], $timeout = null): ProcessBuilder
{
$pb = new ProcessBuilder($arguments);
if (null !== $timeout) {
$pb->setTimeout($timeout);
}
return $pb;
} | php | protected function createProcessBuilder(array $arguments = [], $timeout = null): ProcessBuilder
{
$pb = new ProcessBuilder($arguments);
if (null !== $timeout) {
$pb->setTimeout($timeout);
}
return $pb;
} | [
"protected",
"function",
"createProcessBuilder",
"(",
"array",
"$",
"arguments",
"=",
"[",
"]",
",",
"$",
"timeout",
"=",
"null",
")",
":",
"ProcessBuilder",
"{",
"$",
"pb",
"=",
"new",
"ProcessBuilder",
"(",
"$",
"arguments",
")",
";",
"if",
"(",
"null"... | Creates a new process builder that your might use to interact with your virus-scanner's executable.
@param array $arguments An optional array of arguments
@param int|null $timeout An optional number of seconds for the process' timeout limit
@return ProcessBuilder A new process builder
@codeCoverageIgnore | [
"Creates",
"a",
"new",
"process",
"builder",
"that",
"your",
"might",
"use",
"to",
"interact",
"with",
"your",
"virus",
"-",
"scanner",
"s",
"executable",
"."
] | 9c9624322e3849abf3e154d94b4467833ae73135 | https://github.com/Evozon-PHP/Tissue/blob/9c9624322e3849abf3e154d94b4467833ae73135/Adapter/AbstractAdapter.php#L169-L178 |
195,749 | ciims/ciims-modules-hybridauth | controllers/DefaultController.php | DefaultController.getUserProfile | public function getUserProfile()
{
if ($this->_userProfile == NULL)
$this->_userProfile = $this->getAdapter()->getUserProfile();
return $this->_userProfile;
} | php | public function getUserProfile()
{
if ($this->_userProfile == NULL)
$this->_userProfile = $this->getAdapter()->getUserProfile();
return $this->_userProfile;
} | [
"public",
"function",
"getUserProfile",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_userProfile",
"==",
"NULL",
")",
"$",
"this",
"->",
"_userProfile",
"=",
"$",
"this",
"->",
"getAdapter",
"(",
")",
"->",
"getUserProfile",
"(",
")",
";",
"return",
... | Caches the getUserProfile request to prevent rate limiting issues.
@return object | [
"Caches",
"the",
"getUserProfile",
"request",
"to",
"prevent",
"rate",
"limiting",
"issues",
"."
] | 417b2682bf3468dd509164a9b773d886359a7aec | https://github.com/ciims/ciims-modules-hybridauth/blob/417b2682bf3468dd509164a9b773d886359a7aec/controllers/DefaultController.php#L59-L65 |
195,750 | ciims/ciims-modules-hybridauth | controllers/DefaultController.php | DefaultController.setProvider | public function setProvider($provider=NULL)
{
// Prevent the provider from being NULL
if ($provider == NULL)
throw new CException(Yii::t('Hybridauth.main', "You haven't supplied a provider"));
// Set the property
$this->_provider = $provider;
return $this->_prov... | php | public function setProvider($provider=NULL)
{
// Prevent the provider from being NULL
if ($provider == NULL)
throw new CException(Yii::t('Hybridauth.main', "You haven't supplied a provider"));
// Set the property
$this->_provider = $provider;
return $this->_prov... | [
"public",
"function",
"setProvider",
"(",
"$",
"provider",
"=",
"NULL",
")",
"{",
"// Prevent the provider from being NULL",
"if",
"(",
"$",
"provider",
"==",
"NULL",
")",
"throw",
"new",
"CException",
"(",
"Yii",
"::",
"t",
"(",
"'Hybridauth.main'",
",",
"\"Y... | Sets the provider for this controller to use
@param string $provider The Provider Name
@return $provider | [
"Sets",
"the",
"provider",
"for",
"this",
"controller",
"to",
"use"
] | 417b2682bf3468dd509164a9b773d886359a7aec | https://github.com/ciims/ciims-modules-hybridauth/blob/417b2682bf3468dd509164a9b773d886359a7aec/controllers/DefaultController.php#L72-L82 |
195,751 | ciims/ciims-modules-hybridauth | controllers/DefaultController.php | DefaultController.hybridAuth | private function hybridAuth()
{
// Preload some configuration options
if (strtolower($this->getProvider()) == 'openid')
{
if (!isset($_GET['openid-identity']))
throw new CException(Yii::t('Hybridauth.main', "You chose OpenID but didn't provide an OpenID identifier"));
else
$params = arr... | php | private function hybridAuth()
{
// Preload some configuration options
if (strtolower($this->getProvider()) == 'openid')
{
if (!isset($_GET['openid-identity']))
throw new CException(Yii::t('Hybridauth.main', "You chose OpenID but didn't provide an OpenID identifier"));
else
$params = arr... | [
"private",
"function",
"hybridAuth",
"(",
")",
"{",
"// Preload some configuration options",
"if",
"(",
"strtolower",
"(",
"$",
"this",
"->",
"getProvider",
"(",
")",
")",
"==",
"'openid'",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"_GET",
"[",
"'openid... | Handles authenticating the user against the remote identity | [
"Handles",
"authenticating",
"the",
"user",
"against",
"the",
"remote",
"identity"
] | 417b2682bf3468dd509164a9b773d886359a7aec | https://github.com/ciims/ciims-modules-hybridauth/blob/417b2682bf3468dd509164a9b773d886359a7aec/controllers/DefaultController.php#L124-L168 |
195,752 | ciims/ciims-modules-hybridauth | controllers/DefaultController.php | DefaultController.authenticate | private function authenticate()
{
$form = new RemoteIdentityForm;
$form->attributes = array(
'adapter' => $this->getUserProfile(),
'provider' => $this->getProvider()
);
return $form->login();
} | php | private function authenticate()
{
$form = new RemoteIdentityForm;
$form->attributes = array(
'adapter' => $this->getUserProfile(),
'provider' => $this->getProvider()
);
return $form->login();
} | [
"private",
"function",
"authenticate",
"(",
")",
"{",
"$",
"form",
"=",
"new",
"RemoteIdentityForm",
";",
"$",
"form",
"->",
"attributes",
"=",
"array",
"(",
"'adapter'",
"=>",
"$",
"this",
"->",
"getUserProfile",
"(",
")",
",",
"'provider'",
"=>",
"$",
... | Authenticates in as the user
@return boolean | [
"Authenticates",
"in",
"as",
"the",
"user"
] | 417b2682bf3468dd509164a9b773d886359a7aec | https://github.com/ciims/ciims-modules-hybridauth/blob/417b2682bf3468dd509164a9b773d886359a7aec/controllers/DefaultController.php#L174-L183 |
195,753 | ciims/ciims-modules-hybridauth | controllers/DefaultController.php | DefaultController.renderLinkForm | private function renderLinkForm()
{
$this->layout = '//layouts/main';
$this->setPageTitle(Yii::t('HybridAuth.main', '{{app_name}} | {{label}}', array(
'{{app_name}}' => Cii::getConfig('name', Yii::app()->name),
'{{label}}' => Yii::t('HybridAuth.main', 'Link Your Account')
)));
... | php | private function renderLinkForm()
{
$this->layout = '//layouts/main';
$this->setPageTitle(Yii::t('HybridAuth.main', '{{app_name}} | {{label}}', array(
'{{app_name}}' => Cii::getConfig('name', Yii::app()->name),
'{{label}}' => Yii::t('HybridAuth.main', 'Link Your Account')
)));
... | [
"private",
"function",
"renderLinkForm",
"(",
")",
"{",
"$",
"this",
"->",
"layout",
"=",
"'//layouts/main'",
";",
"$",
"this",
"->",
"setPageTitle",
"(",
"Yii",
"::",
"t",
"(",
"'HybridAuth.main'",
",",
"'{{app_name}} | {{label}}'",
",",
"array",
"(",
"'{{app... | Renders the linking form | [
"Renders",
"the",
"linking",
"form"
] | 417b2682bf3468dd509164a9b773d886359a7aec | https://github.com/ciims/ciims-modules-hybridauth/blob/417b2682bf3468dd509164a9b773d886359a7aec/controllers/DefaultController.php#L188-L218 |
195,754 | frameworkwtf/core | src/Config.php | Config.getGroup | protected function getGroup(string $name): array
{
if (!$this->container->has('config_'.$name)) {
$this->loadGroup($name);
}
return $this->container->get('config_'.$name);
} | php | protected function getGroup(string $name): array
{
if (!$this->container->has('config_'.$name)) {
$this->loadGroup($name);
}
return $this->container->get('config_'.$name);
} | [
"protected",
"function",
"getGroup",
"(",
"string",
"$",
"name",
")",
":",
"array",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"container",
"->",
"has",
"(",
"'config_'",
".",
"$",
"name",
")",
")",
"{",
"$",
"this",
"->",
"loadGroup",
"(",
"$",
"name... | Loads a group configuration file it has not been loaded before and
returns its options. If the group doesn't exist creates an empty one.
@param string $name Name of the configuration group to load
@return array Array of options for this group | [
"Loads",
"a",
"group",
"configuration",
"file",
"it",
"has",
"not",
"been",
"loaded",
"before",
"and",
"returns",
"its",
"options",
".",
"If",
"the",
"group",
"doesn",
"t",
"exist",
"creates",
"an",
"empty",
"one",
"."
] | 8104ca140ec287c26724389780e5e1dba57a030a | https://github.com/frameworkwtf/core/blob/8104ca140ec287c26724389780e5e1dba57a030a/src/Config.php#L72-L79 |
195,755 | frameworkwtf/core | src/Config.php | Config.loadGroup | protected function loadGroup(string $name): void
{
$file = $this->container->get('config_dir').'/'.$name.'.php';
$data = \is_file($file) ? include($file) : [];
$this->container['config_'.$name] = $data;
} | php | protected function loadGroup(string $name): void
{
$file = $this->container->get('config_dir').'/'.$name.'.php';
$data = \is_file($file) ? include($file) : [];
$this->container['config_'.$name] = $data;
} | [
"protected",
"function",
"loadGroup",
"(",
"string",
"$",
"name",
")",
":",
"void",
"{",
"$",
"file",
"=",
"$",
"this",
"->",
"container",
"->",
"get",
"(",
"'config_dir'",
")",
".",
"'/'",
".",
"$",
"name",
".",
"'.php'",
";",
"$",
"data",
"=",
"\... | Load group from file by group name.
@param string $name | [
"Load",
"group",
"from",
"file",
"by",
"group",
"name",
"."
] | 8104ca140ec287c26724389780e5e1dba57a030a | https://github.com/frameworkwtf/core/blob/8104ca140ec287c26724389780e5e1dba57a030a/src/Config.php#L86-L91 |
195,756 | PenoaksDev/Milky-Framework | src/Milky/Filesystem/FilesystemManager.php | FilesystemManager.get | protected function get( $name )
{
return isset( $this->disks[$name] ) ? $this->disks[$name] : $this->resolve( $name );
} | php | protected function get( $name )
{
return isset( $this->disks[$name] ) ? $this->disks[$name] : $this->resolve( $name );
} | [
"protected",
"function",
"get",
"(",
"$",
"name",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"disks",
"[",
"$",
"name",
"]",
")",
"?",
"$",
"this",
"->",
"disks",
"[",
"$",
"name",
"]",
":",
"$",
"this",
"->",
"resolve",
"(",
"$",
"na... | Attempt to get the disk from the local cache.
@param string $name
@return Filesystem | [
"Attempt",
"to",
"get",
"the",
"disk",
"from",
"the",
"local",
"cache",
"."
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Filesystem/FilesystemManager.php#L75-L78 |
195,757 | zicht/tinymce-bundle | src/Zicht/Bundle/TinymceBundle/DependencyInjection/ZichtTinymceExtension.php | ZichtTinymceExtension.load | public function load(array $configs, ContainerBuilder $container)
{
// Get default configuration of the bundle
$config = $this->processConfiguration(new Configuration(), $configs);
if (empty($config['theme'])) {
$config['theme'] = array(
'simple' => array(),
... | php | public function load(array $configs, ContainerBuilder $container)
{
// Get default configuration of the bundle
$config = $this->processConfiguration(new Configuration(), $configs);
if (empty($config['theme'])) {
$config['theme'] = array(
'simple' => array(),
... | [
"public",
"function",
"load",
"(",
"array",
"$",
"configs",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"// Get default configuration of the bundle",
"$",
"config",
"=",
"$",
"this",
"->",
"processConfiguration",
"(",
"new",
"Configuration",
"(",
")",
","... | Loads the ZichtTinymce configuration.
@param array $configs An array of configuration values
@param ContainerBuilder $container A ContainerBuilder instance | [
"Loads",
"the",
"ZichtTinymce",
"configuration",
"."
] | 43d2eb4eb3f7f0e4752fb496f4aada6f2d805c96 | https://github.com/zicht/tinymce-bundle/blob/43d2eb4eb3f7f0e4752fb496f4aada6f2d805c96/src/Zicht/Bundle/TinymceBundle/DependencyInjection/ZichtTinymceExtension.php#L21-L45 |
195,758 | ZFrapid/zf2rapid-domain | src/ZF2rapidDomain/TableGateway/AbstractTableGateway.php | AbstractTableGateway.fetchCollection | protected function fetchCollection(Select $select)
{
$collection = [];
/** @var EntityInterface $entity */
foreach ($this->selectWith($select) as $entity) {
$collection[$entity->getIdentifier()] = $entity;
}
return $collection;
} | php | protected function fetchCollection(Select $select)
{
$collection = [];
/** @var EntityInterface $entity */
foreach ($this->selectWith($select) as $entity) {
$collection[$entity->getIdentifier()] = $entity;
}
return $collection;
} | [
"protected",
"function",
"fetchCollection",
"(",
"Select",
"$",
"select",
")",
"{",
"$",
"collection",
"=",
"[",
"]",
";",
"/** @var EntityInterface $entity */",
"foreach",
"(",
"$",
"this",
"->",
"selectWith",
"(",
"$",
"select",
")",
"as",
"$",
"entity",
"... | Fetch array collection of entities
@param Select $select
@return array | [
"Fetch",
"array",
"collection",
"of",
"entities"
] | 9455689cac06b42025c144878604d27c28b4bb04 | https://github.com/ZFrapid/zf2rapid-domain/blob/9455689cac06b42025c144878604d27c28b4bb04/src/ZF2rapidDomain/TableGateway/AbstractTableGateway.php#L48-L58 |
195,759 | ZFrapid/zf2rapid-domain | src/ZF2rapidDomain/TableGateway/AbstractTableGateway.php | AbstractTableGateway.insertEntity | public function insertEntity(EntityInterface $entity)
{
$insert = $this->getSql()->insert();
$insert->values($this->getHydrator()->extract($entity));
try {
$this->insertWith($insert);
} catch (RuntimeException $e) {
return false;
}
return tru... | php | public function insertEntity(EntityInterface $entity)
{
$insert = $this->getSql()->insert();
$insert->values($this->getHydrator()->extract($entity));
try {
$this->insertWith($insert);
} catch (RuntimeException $e) {
return false;
}
return tru... | [
"public",
"function",
"insertEntity",
"(",
"EntityInterface",
"$",
"entity",
")",
"{",
"$",
"insert",
"=",
"$",
"this",
"->",
"getSql",
"(",
")",
"->",
"insert",
"(",
")",
";",
"$",
"insert",
"->",
"values",
"(",
"$",
"this",
"->",
"getHydrator",
"(",
... | Insert an new entity
@param EntityInterface $entity
@return bool | [
"Insert",
"an",
"new",
"entity"
] | 9455689cac06b42025c144878604d27c28b4bb04 | https://github.com/ZFrapid/zf2rapid-domain/blob/9455689cac06b42025c144878604d27c28b4bb04/src/ZF2rapidDomain/TableGateway/AbstractTableGateway.php#L145-L157 |
195,760 | ZFrapid/zf2rapid-domain | src/ZF2rapidDomain/TableGateway/AbstractTableGateway.php | AbstractTableGateway.updateEntity | public function updateEntity(EntityInterface $entity)
{
$update = $this->getSql()->update();
$update->set($this->getHydrator()->extract($entity));
$update->where->equalTo($this->getPrimaryKey(), $entity->getIdentifier());
try {
$this->updateWith($update);
} catch... | php | public function updateEntity(EntityInterface $entity)
{
$update = $this->getSql()->update();
$update->set($this->getHydrator()->extract($entity));
$update->where->equalTo($this->getPrimaryKey(), $entity->getIdentifier());
try {
$this->updateWith($update);
} catch... | [
"public",
"function",
"updateEntity",
"(",
"EntityInterface",
"$",
"entity",
")",
"{",
"$",
"update",
"=",
"$",
"this",
"->",
"getSql",
"(",
")",
"->",
"update",
"(",
")",
";",
"$",
"update",
"->",
"set",
"(",
"$",
"this",
"->",
"getHydrator",
"(",
"... | Update an existing entity
@param EntityInterface $entity
@return bool | [
"Update",
"an",
"existing",
"entity"
] | 9455689cac06b42025c144878604d27c28b4bb04 | https://github.com/ZFrapid/zf2rapid-domain/blob/9455689cac06b42025c144878604d27c28b4bb04/src/ZF2rapidDomain/TableGateway/AbstractTableGateway.php#L166-L179 |
195,761 | agentmedia/phine-core | src/Core/Logic/Installation/Installer.php | Installer.UpdateBundleVersions | private function UpdateBundleVersions()
{
$this->ClearInstalledBundles();
$bundles = PathUtil::Bundles();
foreach ($bundles as $bundle)
{
if (!array_key_exists($bundle, $this->failedBundles))
{
$this->UpdateBundleVersion($bundle);
}... | php | private function UpdateBundleVersions()
{
$this->ClearInstalledBundles();
$bundles = PathUtil::Bundles();
foreach ($bundles as $bundle)
{
if (!array_key_exists($bundle, $this->failedBundles))
{
$this->UpdateBundleVersion($bundle);
}... | [
"private",
"function",
"UpdateBundleVersions",
"(",
")",
"{",
"$",
"this",
"->",
"ClearInstalledBundles",
"(",
")",
";",
"$",
"bundles",
"=",
"PathUtil",
"::",
"Bundles",
"(",
")",
";",
"foreach",
"(",
"$",
"bundles",
"as",
"$",
"bundle",
")",
"{",
"if",... | Updates database to store current bundle versions | [
"Updates",
"database",
"to",
"store",
"current",
"bundle",
"versions"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Installation/Installer.php#L169-L180 |
195,762 | agentmedia/phine-core | src/Core/Logic/Installation/Installer.php | Installer.UpdateBundleVersion | private function UpdateBundleVersion($bundle)
{
$instBundle = InstalledBundle::Schema()->ByBundle($bundle);
if (!$instBundle)
{
$instBundle = new InstalledBundle();
}
$instBundle->SetVersion($this->installedBundles[$bundle]);
$instBundle->SetBundle($bundle... | php | private function UpdateBundleVersion($bundle)
{
$instBundle = InstalledBundle::Schema()->ByBundle($bundle);
if (!$instBundle)
{
$instBundle = new InstalledBundle();
}
$instBundle->SetVersion($this->installedBundles[$bundle]);
$instBundle->SetBundle($bundle... | [
"private",
"function",
"UpdateBundleVersion",
"(",
"$",
"bundle",
")",
"{",
"$",
"instBundle",
"=",
"InstalledBundle",
"::",
"Schema",
"(",
")",
"->",
"ByBundle",
"(",
"$",
"bundle",
")",
";",
"if",
"(",
"!",
"$",
"instBundle",
")",
"{",
"$",
"instBundle... | Updates the version of the bundle
@param string $bundle The bundle name | [
"Updates",
"the",
"version",
"of",
"the",
"bundle"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Installation/Installer.php#L186-L197 |
195,763 | agentmedia/phine-core | src/Core/Logic/Installation/Installer.php | Installer.ClearInstalledBundles | private function ClearInstalledBundles()
{
//Clear bundles without code folder
$bundles = PathUtil::Bundles();
$sql = new Sql\Builder($this->connection);
$inList = $sql->InListFromValues($bundles);
$tbl = InstalledBundle::Schema()->Table();
$where = $sql->Not... | php | private function ClearInstalledBundles()
{
//Clear bundles without code folder
$bundles = PathUtil::Bundles();
$sql = new Sql\Builder($this->connection);
$inList = $sql->InListFromValues($bundles);
$tbl = InstalledBundle::Schema()->Table();
$where = $sql->Not... | [
"private",
"function",
"ClearInstalledBundles",
"(",
")",
"{",
"//Clear bundles without code folder",
"$",
"bundles",
"=",
"PathUtil",
"::",
"Bundles",
"(",
")",
";",
"$",
"sql",
"=",
"new",
"Sql",
"\\",
"Builder",
"(",
"$",
"this",
"->",
"connection",
")",
... | Clears installed bundles | [
"Clears",
"installed",
"bundles"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Installation/Installer.php#L203-L219 |
195,764 | agentmedia/phine-core | src/Core/Logic/Installation/Installer.php | Installer.InstallBundle | private function InstallBundle($bundle)
{
$manifest = ClassFinder::Manifest($bundle);
foreach ($manifest->Dependencies() as $dependency)
{
if (!$this->InstallDependency($dependency))
{
return false;
}
}
$bundleInstaller = ne... | php | private function InstallBundle($bundle)
{
$manifest = ClassFinder::Manifest($bundle);
foreach ($manifest->Dependencies() as $dependency)
{
if (!$this->InstallDependency($dependency))
{
return false;
}
}
$bundleInstaller = ne... | [
"private",
"function",
"InstallBundle",
"(",
"$",
"bundle",
")",
"{",
"$",
"manifest",
"=",
"ClassFinder",
"::",
"Manifest",
"(",
"$",
"bundle",
")",
";",
"foreach",
"(",
"$",
"manifest",
"->",
"Dependencies",
"(",
")",
"as",
"$",
"dependency",
")",
"{",... | Installs a single bundle
@param string $bundle
@return boolean | [
"Installs",
"a",
"single",
"bundle"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Installation/Installer.php#L237-L261 |
195,765 | agentmedia/phine-core | src/Core/Logic/Installation/Installer.php | Installer.InstallDependency | private function InstallDependency(BundleDependency $dependency)
{
$bundle = $dependency->BundleName();
if (array_key_exists($bundle, $this->failedBundles))
{
return false;
}
$installedVersion = $this->InstalledVersion($bundle);
$manifest = ClassFinder::Ma... | php | private function InstallDependency(BundleDependency $dependency)
{
$bundle = $dependency->BundleName();
if (array_key_exists($bundle, $this->failedBundles))
{
return false;
}
$installedVersion = $this->InstalledVersion($bundle);
$manifest = ClassFinder::Ma... | [
"private",
"function",
"InstallDependency",
"(",
"BundleDependency",
"$",
"dependency",
")",
"{",
"$",
"bundle",
"=",
"$",
"dependency",
"->",
"BundleName",
"(",
")",
";",
"if",
"(",
"array_key_exists",
"(",
"$",
"bundle",
",",
"$",
"this",
"->",
"failedBund... | Installs a dependency
@param BundleDependency $dependency
@return boolean | [
"Installs",
"a",
"dependency"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Installation/Installer.php#L267-L284 |
195,766 | prolic/HumusPHPUnitModule | src/HumusPHPUnitModule/Runner.php | Runner.getModuleOutput | protected function getModuleOutput($module)
{
$console = $this->console;
$head = sprintf(
"%s\n%s\n%s\n",
str_repeat(
'-',
$console->getWidth()
),
'Testing Module: ' . $module,
str_repeat(
'-... | php | protected function getModuleOutput($module)
{
$console = $this->console;
$head = sprintf(
"%s\n%s\n%s\n",
str_repeat(
'-',
$console->getWidth()
),
'Testing Module: ' . $module,
str_repeat(
'-... | [
"protected",
"function",
"getModuleOutput",
"(",
"$",
"module",
")",
"{",
"$",
"console",
"=",
"$",
"this",
"->",
"console",
";",
"$",
"head",
"=",
"sprintf",
"(",
"\"%s\\n%s\\n%s\\n\"",
",",
"str_repeat",
"(",
"'-'",
",",
"$",
"console",
"->",
"getWidth",... | Get module output
@param string $module
@return string | [
"Get",
"module",
"output"
] | ee7c4a01c915a53506c5395e41ec8c26ac4ed7e9 | https://github.com/prolic/HumusPHPUnitModule/blob/ee7c4a01c915a53506c5395e41ec8c26ac4ed7e9/src/HumusPHPUnitModule/Runner.php#L272-L290 |
195,767 | prolic/HumusPHPUnitModule | src/HumusPHPUnitModule/Runner.php | Runner.renderTable | protected function renderTable($data, $cols, $consoleWidth)
{
$result = '';
$padding = 2;
// If there is only 1 column, just concatenate it
if ($cols == 1) {
foreach ($data as $row) {
$result .= $row[0] . "\n";
}
return $result;
... | php | protected function renderTable($data, $cols, $consoleWidth)
{
$result = '';
$padding = 2;
// If there is only 1 column, just concatenate it
if ($cols == 1) {
foreach ($data as $row) {
$result .= $row[0] . "\n";
}
return $result;
... | [
"protected",
"function",
"renderTable",
"(",
"$",
"data",
",",
"$",
"cols",
",",
"$",
"consoleWidth",
")",
"{",
"$",
"result",
"=",
"''",
";",
"$",
"padding",
"=",
"2",
";",
"// If there is only 1 column, just concatenate it",
"if",
"(",
"$",
"cols",
"==",
... | Render a text table containing the data provided, that will fit inside console window's width.
@param $data
@param $cols
@param $consoleWidth
@return string | [
"Render",
"a",
"text",
"table",
"containing",
"the",
"data",
"provided",
"that",
"will",
"fit",
"inside",
"console",
"window",
"s",
"width",
"."
] | ee7c4a01c915a53506c5395e41ec8c26ac4ed7e9 | https://github.com/prolic/HumusPHPUnitModule/blob/ee7c4a01c915a53506c5395e41ec8c26ac4ed7e9/src/HumusPHPUnitModule/Runner.php#L300-L360 |
195,768 | clacy-builders/graphics-php | src/Angle.php | Angle.copy | public function copy()
{
$angle = new Angle();
$angle->radians = $this->radians;
$angle->sin = $this->sin;
$angle->cos = $this->cos;
$angle->tan = $this->tan;
return $angle;
} | php | public function copy()
{
$angle = new Angle();
$angle->radians = $this->radians;
$angle->sin = $this->sin;
$angle->cos = $this->cos;
$angle->tan = $this->tan;
return $angle;
} | [
"public",
"function",
"copy",
"(",
")",
"{",
"$",
"angle",
"=",
"new",
"Angle",
"(",
")",
";",
"$",
"angle",
"->",
"radians",
"=",
"$",
"this",
"->",
"radians",
";",
"$",
"angle",
"->",
"sin",
"=",
"$",
"this",
"->",
"sin",
";",
"$",
"angle",
"... | Returns a copy of the current angle.
@return Angle | [
"Returns",
"a",
"copy",
"of",
"the",
"current",
"angle",
"."
] | c56556c9265ea4537efdc14ae89a8f36454812d9 | https://github.com/clacy-builders/graphics-php/blob/c56556c9265ea4537efdc14ae89a8f36454812d9/src/Angle.php#L38-L46 |
195,769 | clacy-builders/graphics-php | src/Angle.php | Angle.set | public function set($radians)
{
$this->radians = $radians;
$this->sin = sin($radians);
$this->cos = cos($radians);
$this->tan = tan($radians);
return $this;
} | php | public function set($radians)
{
$this->radians = $radians;
$this->sin = sin($radians);
$this->cos = cos($radians);
$this->tan = tan($radians);
return $this;
} | [
"public",
"function",
"set",
"(",
"$",
"radians",
")",
"{",
"$",
"this",
"->",
"radians",
"=",
"$",
"radians",
";",
"$",
"this",
"->",
"sin",
"=",
"sin",
"(",
"$",
"radians",
")",
";",
"$",
"this",
"->",
"cos",
"=",
"cos",
"(",
"$",
"radians",
... | Resets the angle in radians.
@param float $radians | [
"Resets",
"the",
"angle",
"in",
"radians",
"."
] | c56556c9265ea4537efdc14ae89a8f36454812d9 | https://github.com/clacy-builders/graphics-php/blob/c56556c9265ea4537efdc14ae89a8f36454812d9/src/Angle.php#L53-L60 |
195,770 | ekyna/Resource | Doctrine/ORM/Listener/EntityListener.php | EntityListener.onFlush | public function onFlush(OnFlushEventArgs $eventArgs)
{
$this->eventQueue->setOpened(true);
$uow = $eventArgs->getEntityManager()->getUnitOfWork();
foreach ($uow->getScheduledEntityInsertions() as $entity) {
if ($entity instanceof ResourceInterface) {
$this->even... | php | public function onFlush(OnFlushEventArgs $eventArgs)
{
$this->eventQueue->setOpened(true);
$uow = $eventArgs->getEntityManager()->getUnitOfWork();
foreach ($uow->getScheduledEntityInsertions() as $entity) {
if ($entity instanceof ResourceInterface) {
$this->even... | [
"public",
"function",
"onFlush",
"(",
"OnFlushEventArgs",
"$",
"eventArgs",
")",
"{",
"$",
"this",
"->",
"eventQueue",
"->",
"setOpened",
"(",
"true",
")",
";",
"$",
"uow",
"=",
"$",
"eventArgs",
"->",
"getEntityManager",
"(",
")",
"->",
"getUnitOfWork",
"... | On flush event handler.
@param OnFlushEventArgs $eventArgs
@see \Doctrine\ORM\UniOfWork::commit | [
"On",
"flush",
"event",
"handler",
"."
] | 96ee3d28e02bd9513705408e3bb7f88a76e52f56 | https://github.com/ekyna/Resource/blob/96ee3d28e02bd9513705408e3bb7f88a76e52f56/Doctrine/ORM/Listener/EntityListener.php#L41-L92 |
195,771 | dsv-su/daisy-api-client-php | src/CourseSegmentInstance.php | CourseSegmentInstance.find | public static function find(array $query)
{
if (isset($query['semester']) &&
$query['semester'] instanceof Semester) {
$query['semester'] = $query['semester']->daisyFormat();
}
$csis = Client::get("courseSegment", $query);
return array_map(function ($data) { r... | php | public static function find(array $query)
{
if (isset($query['semester']) &&
$query['semester'] instanceof Semester) {
$query['semester'] = $query['semester']->daisyFormat();
}
$csis = Client::get("courseSegment", $query);
return array_map(function ($data) { r... | [
"public",
"static",
"function",
"find",
"(",
"array",
"$",
"query",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"query",
"[",
"'semester'",
"]",
")",
"&&",
"$",
"query",
"[",
"'semester'",
"]",
"instanceof",
"Semester",
")",
"{",
"$",
"query",
"[",
"'sem... | Retrieve an array of CourseSegmentInstance objects according to
a search query.
@param array $query The query.
@return CourseSegmentInstance[] | [
"Retrieve",
"an",
"array",
"of",
"CourseSegmentInstance",
"objects",
"according",
"to",
"a",
"search",
"query",
"."
] | aa6817ed45fdf3629c9683ea8a8e70a80f59b441 | https://github.com/dsv-su/daisy-api-client-php/blob/aa6817ed45fdf3629c9683ea8a8e70a80f59b441/src/CourseSegmentInstance.php#L18-L26 |
195,772 | congraphcms/core | Validation/Validator.php | Validator.addUniqueRuleException | protected function addUniqueRuleException(array $rules, $id)
{
// update all unique rules
foreach ($rules as $key => &$rule)
{
if(is_array($rule))
{
$rule = $this->addUniqueRuleException($rule, $id);
continue;
}
// check for unique rule
$unique_pos = strpos($rule, 'unique:');
// if rul... | php | protected function addUniqueRuleException(array $rules, $id)
{
// update all unique rules
foreach ($rules as $key => &$rule)
{
if(is_array($rule))
{
$rule = $this->addUniqueRuleException($rule, $id);
continue;
}
// check for unique rule
$unique_pos = strpos($rule, 'unique:');
// if rul... | [
"protected",
"function",
"addUniqueRuleException",
"(",
"array",
"$",
"rules",
",",
"$",
"id",
")",
"{",
"// update all unique rules",
"foreach",
"(",
"$",
"rules",
"as",
"$",
"key",
"=>",
"&",
"$",
"rule",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"rul... | Add exception to any unique rules for given object id
@param array $params
@param array $rules
@return array | [
"Add",
"exception",
"to",
"any",
"unique",
"rules",
"for",
"given",
"object",
"id"
] | d017d3951b446fb2ac93b8fcee120549bb125b17 | https://github.com/congraphcms/core/blob/d017d3951b446fb2ac93b8fcee120549bb125b17/Validation/Validator.php#L125-L162 |
195,773 | congraphcms/core | Validation/Validator.php | Validator.newValidator | public function newValidator(array &$params, array $rules, $clean = true)
{
// if validating update params
// unique rule should skip entry with this id
// check if these are update params
if(!empty($params['id']))
{
// add exception for this id on all unique rules
$rules = $this->addUniqueRuleExc... | php | public function newValidator(array &$params, array $rules, $clean = true)
{
// if validating update params
// unique rule should skip entry with this id
// check if these are update params
if(!empty($params['id']))
{
// add exception for this id on all unique rules
$rules = $this->addUniqueRuleExc... | [
"public",
"function",
"newValidator",
"(",
"array",
"&",
"$",
"params",
",",
"array",
"$",
"rules",
",",
"$",
"clean",
"=",
"true",
")",
"{",
"// if validating update params ",
"// unique rule should skip entry with this id",
"// check if these are update params",
"if",
... | Set new validator instance
@param array $params
@param array $rules
@return Illuminate\Validation\Validator | [
"Set",
"new",
"validator",
"instance"
] | d017d3951b446fb2ac93b8fcee120549bb125b17 | https://github.com/congraphcms/core/blob/d017d3951b446fb2ac93b8fcee120549bb125b17/Validation/Validator.php#L182-L201 |
195,774 | horntell/php-sdk | lib/guzzle/GuzzleHttp/Post/PostBody.php | PostBody.getBody | private function getBody()
{
if ($this->body) {
return $this->body;
} elseif ($this->files || $this->forceMultipart) {
return $this->body = $this->createMultipart();
} elseif ($this->fields) {
return $this->body = $this->createUrlEncoded();
} else ... | php | private function getBody()
{
if ($this->body) {
return $this->body;
} elseif ($this->files || $this->forceMultipart) {
return $this->body = $this->createMultipart();
} elseif ($this->fields) {
return $this->body = $this->createUrlEncoded();
} else ... | [
"private",
"function",
"getBody",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"body",
")",
"{",
"return",
"$",
"this",
"->",
"body",
";",
"}",
"elseif",
"(",
"$",
"this",
"->",
"files",
"||",
"$",
"this",
"->",
"forceMultipart",
")",
"{",
"return"... | Return a stream object that is built from the POST fields and files.
If one has already been created, the previously created stream will be
returned. | [
"Return",
"a",
"stream",
"object",
"that",
"is",
"built",
"from",
"the",
"POST",
"fields",
"and",
"files",
"."
] | e5205e9396a21b754d5651a8aa5898da5922a1b7 | https://github.com/horntell/php-sdk/blob/e5205e9396a21b754d5651a8aa5898da5922a1b7/lib/guzzle/GuzzleHttp/Post/PostBody.php#L226-L237 |
195,775 | Kris-Kuiper/sFire-Framework | src/Utils/URLParser.php | URLParser.generate | public function generate($till = self :: UNTIL_FRAGMENT) {
$url = null !== $this -> getScheme() ? $this -> getScheme() . '://' : '';
if($till !== self :: UNTIL_SCHEME) {
$url .= null !== $this -> getUser() ? $this -> getUser() . ':' : '';
if($till !== self :: UNTIL_USER) {
$url .= null !... | php | public function generate($till = self :: UNTIL_FRAGMENT) {
$url = null !== $this -> getScheme() ? $this -> getScheme() . '://' : '';
if($till !== self :: UNTIL_SCHEME) {
$url .= null !== $this -> getUser() ? $this -> getUser() . ':' : '';
if($till !== self :: UNTIL_USER) {
$url .= null !... | [
"public",
"function",
"generate",
"(",
"$",
"till",
"=",
"self",
"::",
"UNTIL_FRAGMENT",
")",
"{",
"$",
"url",
"=",
"null",
"!==",
"$",
"this",
"->",
"getScheme",
"(",
")",
"?",
"$",
"this",
"->",
"getScheme",
"(",
")",
".",
"'://'",
":",
"''",
";"... | Adds all the components of the url until the end or until the first parameter has been reached to generate a URL
@param string $till
@return string | [
"Adds",
"all",
"the",
"components",
"of",
"the",
"url",
"until",
"the",
"end",
"or",
"until",
"the",
"first",
"parameter",
"has",
"been",
"reached",
"to",
"generate",
"a",
"URL"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Utils/URLParser.php#L161-L195 |
195,776 | jmfeurprier/perf-database | lib/perf/Db/Connection.php | Connection.pdoPrepare | private function pdoPrepare($sql)
{
try {
$pdoStatement = $this->getPdo()->prepare($sql);
} catch (\PDOException $e) {
throw new \RuntimeException("Failed to prepare SQL query: {$sql} << {$e->getMessage()}", 0, $e);
}
return $pdoStatement;
} | php | private function pdoPrepare($sql)
{
try {
$pdoStatement = $this->getPdo()->prepare($sql);
} catch (\PDOException $e) {
throw new \RuntimeException("Failed to prepare SQL query: {$sql} << {$e->getMessage()}", 0, $e);
}
return $pdoStatement;
} | [
"private",
"function",
"pdoPrepare",
"(",
"$",
"sql",
")",
"{",
"try",
"{",
"$",
"pdoStatement",
"=",
"$",
"this",
"->",
"getPdo",
"(",
")",
"->",
"prepare",
"(",
"$",
"sql",
")",
";",
"}",
"catch",
"(",
"\\",
"PDOException",
"$",
"e",
")",
"{",
... | Prepares a PDO statement.
@param string $sql
@return \PDOStatement
@throws \RuntimeException | [
"Prepares",
"a",
"PDO",
"statement",
"."
] | 9b39dc76be9f8a33d02aadc168fdb74d786f0ff2 | https://github.com/jmfeurprier/perf-database/blob/9b39dc76be9f8a33d02aadc168fdb74d786f0ff2/lib/perf/Db/Connection.php#L165-L174 |
195,777 | jmfeurprier/perf-database | lib/perf/Db/Connection.php | Connection.escapeAndQuote | public function escapeAndQuote($value)
{
if (null === $value) {
$pdoType = \PDO::PARAM_NULL;
} else {
$pdoType = \PDO::PARAM_STR;
}
return $this->getPdo()->quote($value, $pdoType);
} | php | public function escapeAndQuote($value)
{
if (null === $value) {
$pdoType = \PDO::PARAM_NULL;
} else {
$pdoType = \PDO::PARAM_STR;
}
return $this->getPdo()->quote($value, $pdoType);
} | [
"public",
"function",
"escapeAndQuote",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"value",
")",
"{",
"$",
"pdoType",
"=",
"\\",
"PDO",
"::",
"PARAM_NULL",
";",
"}",
"else",
"{",
"$",
"pdoType",
"=",
"\\",
"PDO",
"::",
"PARAM_STR",
... | Escapes and quotes provided scalar value.
@param string $value Value to be escaped and quoted.
@return string The escaped and quoted value.
@throws \RuntimeException | [
"Escapes",
"and",
"quotes",
"provided",
"scalar",
"value",
"."
] | 9b39dc76be9f8a33d02aadc168fdb74d786f0ff2 | https://github.com/jmfeurprier/perf-database/blob/9b39dc76be9f8a33d02aadc168fdb74d786f0ff2/lib/perf/Db/Connection.php#L222-L231 |
195,778 | jmfeurprier/perf-database | lib/perf/Db/Connection.php | Connection.getPdo | public function getPdo()
{
if (!$this->pdo) {
$this->connect();
}
$this->pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
$this->pdo->setAttribute(\PDO::ATTR_DEFAULT_FETCH_MODE, \PDO::FETCH_ASSOC);
return $this->pdo;
} | php | public function getPdo()
{
if (!$this->pdo) {
$this->connect();
}
$this->pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
$this->pdo->setAttribute(\PDO::ATTR_DEFAULT_FETCH_MODE, \PDO::FETCH_ASSOC);
return $this->pdo;
} | [
"public",
"function",
"getPdo",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"pdo",
")",
"{",
"$",
"this",
"->",
"connect",
"(",
")",
";",
"}",
"$",
"this",
"->",
"pdo",
"->",
"setAttribute",
"(",
"\\",
"PDO",
"::",
"ATTR_ERRMODE",
",",
"\\"... | Returns the wrapped PDO object.
@return \PDO
@throws \RuntimeException | [
"Returns",
"the",
"wrapped",
"PDO",
"object",
"."
] | 9b39dc76be9f8a33d02aadc168fdb74d786f0ff2 | https://github.com/jmfeurprier/perf-database/blob/9b39dc76be9f8a33d02aadc168fdb74d786f0ff2/lib/perf/Db/Connection.php#L283-L293 |
195,779 | jmfeurprier/perf-database | lib/perf/Db/Connection.php | Connection.connect | private function connect()
{
$dsn = "{$this->credentials->getDriver()}:host={$this->credentials->getHost()}";
try {
$pdo = new \PDO($dsn, $this->credentials->getUsername(), $this->credentials->getPassword());
} catch (\PDOException $e) {
throw new \RuntimeException('... | php | private function connect()
{
$dsn = "{$this->credentials->getDriver()}:host={$this->credentials->getHost()}";
try {
$pdo = new \PDO($dsn, $this->credentials->getUsername(), $this->credentials->getPassword());
} catch (\PDOException $e) {
throw new \RuntimeException('... | [
"private",
"function",
"connect",
"(",
")",
"{",
"$",
"dsn",
"=",
"\"{$this->credentials->getDriver()}:host={$this->credentials->getHost()}\"",
";",
"try",
"{",
"$",
"pdo",
"=",
"new",
"\\",
"PDO",
"(",
"$",
"dsn",
",",
"$",
"this",
"->",
"credentials",
"->",
... | Attempts to connect to database.
@return void
@throws \RuntimeException | [
"Attempts",
"to",
"connect",
"to",
"database",
"."
] | 9b39dc76be9f8a33d02aadc168fdb74d786f0ff2 | https://github.com/jmfeurprier/perf-database/blob/9b39dc76be9f8a33d02aadc168fdb74d786f0ff2/lib/perf/Db/Connection.php#L301-L320 |
195,780 | Vectrex/vxPHP | src/User/SimpleSessionUserProvider.php | SimpleSessionUserProvider.unsetSessionUser | public function unsetSessionUser($sessionKey = NULL) {
$sessionKey = $sessionKey ?: SessionUser::DEFAULT_KEY_NAME;
$user = Session::getSessionDataBag()->get($sessionKey);
if($user) {
if(!$user instanceof SessionUser) {
throw new UserException(sprintf("Session key '%s' doesn't hold a SessionUse... | php | public function unsetSessionUser($sessionKey = NULL) {
$sessionKey = $sessionKey ?: SessionUser::DEFAULT_KEY_NAME;
$user = Session::getSessionDataBag()->get($sessionKey);
if($user) {
if(!$user instanceof SessionUser) {
throw new UserException(sprintf("Session key '%s' doesn't hold a SessionUse... | [
"public",
"function",
"unsetSessionUser",
"(",
"$",
"sessionKey",
"=",
"NULL",
")",
"{",
"$",
"sessionKey",
"=",
"$",
"sessionKey",
"?",
":",
"SessionUser",
"::",
"DEFAULT_KEY_NAME",
";",
"$",
"user",
"=",
"Session",
"::",
"getSessionDataBag",
"(",
")",
"->"... | remove session user from session
returns the removed session user
@param string $sessionKey
@throws UserException
@return \vxPHP\User\SessionUser|mixed | [
"remove",
"session",
"user",
"from",
"session",
"returns",
"the",
"removed",
"session",
"user"
] | 295c21b00e7ef6085efcdf5b64fabb28d499b5a6 | https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/User/SimpleSessionUserProvider.php#L59-L76 |
195,781 | Vectrex/vxPHP | src/User/SimpleSessionUserProvider.php | SimpleSessionUserProvider.getSessionUser | public function getSessionUser($sessionKey = NULL) {
$sessionKey = $sessionKey ?: SessionUser::DEFAULT_KEY_NAME;
$sessionUser = Session::getSessionDataBag()->get($sessionKey);
if($sessionUser instanceof SessionUser) {
return $sessionUser;
}
} | php | public function getSessionUser($sessionKey = NULL) {
$sessionKey = $sessionKey ?: SessionUser::DEFAULT_KEY_NAME;
$sessionUser = Session::getSessionDataBag()->get($sessionKey);
if($sessionUser instanceof SessionUser) {
return $sessionUser;
}
} | [
"public",
"function",
"getSessionUser",
"(",
"$",
"sessionKey",
"=",
"NULL",
")",
"{",
"$",
"sessionKey",
"=",
"$",
"sessionKey",
"?",
":",
"SessionUser",
"::",
"DEFAULT_KEY_NAME",
";",
"$",
"sessionUser",
"=",
"Session",
"::",
"getSessionDataBag",
"(",
")",
... | retrieve a stored session user stored under a session key
returns stored value only, when it is a SessionUser instance
@param string $sessionKey
@return \vxPHP\User\SessionUser | [
"retrieve",
"a",
"stored",
"session",
"user",
"stored",
"under",
"a",
"session",
"key",
"returns",
"stored",
"value",
"only",
"when",
"it",
"is",
"a",
"SessionUser",
"instance"
] | 295c21b00e7ef6085efcdf5b64fabb28d499b5a6 | https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/User/SimpleSessionUserProvider.php#L85-L95 |
195,782 | Becklyn/Gluggi | src/Twig/TwigExtension.php | TwigExtension.elementsOverview | public function elementsOverview (array $list, array $options = [])
{
$options = array_replace(
[
"includeNavigation" => true
],
$options
);
// this is a flag which tells the component that it is rendered in an elements overview
$o... | php | public function elementsOverview (array $list, array $options = [])
{
$options = array_replace(
[
"includeNavigation" => true
],
$options
);
// this is a flag which tells the component that it is rendered in an elements overview
$o... | [
"public",
"function",
"elementsOverview",
"(",
"array",
"$",
"list",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"options",
"=",
"array_replace",
"(",
"[",
"\"includeNavigation\"",
"=>",
"true",
"]",
",",
"$",
"options",
")",
";",
"// thi... | Renders a overview of the given elements
@param string[] $list
@param array $options
@return | [
"Renders",
"a",
"overview",
"of",
"the",
"given",
"elements"
] | 837e7ee8d34f5b16a7f1ef53ca64b1ea8722b786 | https://github.com/Becklyn/Gluggi/blob/837e7ee8d34f5b16a7f1ef53ca64b1ea8722b786/src/Twig/TwigExtension.php#L124-L149 |
195,783 | Subscribo/config | src/Subscribo/Config/Config.php | Config.get | public function get($key, $default = null, $package = null)
{
if ($package) {
return $this->getForPackage($package, $key, $default);
}
return Arr::get($this->mainConfiguration, $key, $default);
} | php | public function get($key, $default = null, $package = null)
{
if ($package) {
return $this->getForPackage($package, $key, $default);
}
return Arr::get($this->mainConfiguration, $key, $default);
} | [
"public",
"function",
"get",
"(",
"$",
"key",
",",
"$",
"default",
"=",
"null",
",",
"$",
"package",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"package",
")",
"{",
"return",
"$",
"this",
"->",
"getForPackage",
"(",
"$",
"package",
",",
"$",
"key",
"... | Return value stored under provided key
@param string $key Array key with dot notation
@param mixed $default What to return, if key is not found
@param string|null $package If provided, return value for given package
@return mixed|null | [
"Return",
"value",
"stored",
"under",
"provided",
"key"
] | eadd7c0059d8302619f4b428f664db36508acb7a | https://github.com/Subscribo/config/blob/eadd7c0059d8302619f4b428f664db36508acb7a/src/Subscribo/Config/Config.php#L105-L112 |
195,784 | Subscribo/config | src/Subscribo/Config/Config.php | Config.getForPackage | public function getForPackage($package, $key, $default = null)
{
if (empty($this->packagesConfiguration[$package])) {
return $default;
}
return Arr::get($this->packagesConfiguration[$package], $key, $default);
} | php | public function getForPackage($package, $key, $default = null)
{
if (empty($this->packagesConfiguration[$package])) {
return $default;
}
return Arr::get($this->packagesConfiguration[$package], $key, $default);
} | [
"public",
"function",
"getForPackage",
"(",
"$",
"package",
",",
"$",
"key",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"packagesConfiguration",
"[",
"$",
"package",
"]",
")",
")",
"{",
"return",
"$",
"def... | Return value stored under provided key for given package
@param string $package Package name
@param string $key Array key with dot notation
@param mixed $default What to return, if key is not found
@return mixed|null | [
"Return",
"value",
"stored",
"under",
"provided",
"key",
"for",
"given",
"package"
] | eadd7c0059d8302619f4b428f664db36508acb7a | https://github.com/Subscribo/config/blob/eadd7c0059d8302619f4b428f664db36508acb7a/src/Subscribo/Config/Config.php#L122-L128 |
195,785 | Subscribo/config | src/Subscribo/Config/Config.php | Config.set | public function set($key, $value, $package = null)
{
if ( ! is_null($package)) {
$this->setForPackage($package, $key, $value);
return $this;
}
$mainConfiguration = $this->mainConfiguration;
Arr::set($mainConfiguration, $key, $value);
return $this;
... | php | public function set($key, $value, $package = null)
{
if ( ! is_null($package)) {
$this->setForPackage($package, $key, $value);
return $this;
}
$mainConfiguration = $this->mainConfiguration;
Arr::set($mainConfiguration, $key, $value);
return $this;
... | [
"public",
"function",
"set",
"(",
"$",
"key",
",",
"$",
"value",
",",
"$",
"package",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"package",
")",
")",
"{",
"$",
"this",
"->",
"setForPackage",
"(",
"$",
"package",
",",
"$",
"key",
... | Store given value under given key
@param string $key Array key with dot notation
@param mixed $value Value to store
@param string|null $package If provided, return value for given package
@return $this | [
"Store",
"given",
"value",
"under",
"given",
"key"
] | eadd7c0059d8302619f4b428f664db36508acb7a | https://github.com/Subscribo/config/blob/eadd7c0059d8302619f4b428f664db36508acb7a/src/Subscribo/Config/Config.php#L138-L147 |
195,786 | Subscribo/config | src/Subscribo/Config/Config.php | Config.setForPackage | public function setForPackage($package, $key, $value)
{
$packageConfiguration = empty($this->packagesConfiguration[$package]) ? array() : $this->packagesConfiguration[$package];
Arr::set($packageConfiguration, $key, $value);
$this->packagesConfiguration[$package] = $packageConfiguration;
... | php | public function setForPackage($package, $key, $value)
{
$packageConfiguration = empty($this->packagesConfiguration[$package]) ? array() : $this->packagesConfiguration[$package];
Arr::set($packageConfiguration, $key, $value);
$this->packagesConfiguration[$package] = $packageConfiguration;
... | [
"public",
"function",
"setForPackage",
"(",
"$",
"package",
",",
"$",
"key",
",",
"$",
"value",
")",
"{",
"$",
"packageConfiguration",
"=",
"empty",
"(",
"$",
"this",
"->",
"packagesConfiguration",
"[",
"$",
"package",
"]",
")",
"?",
"array",
"(",
")",
... | Store given value under given key for given package
@param string $package Package name
@param string $key Array key with dot notation
@param mixed $value Value to store
@return $this | [
"Store",
"given",
"value",
"under",
"given",
"key",
"for",
"given",
"package"
] | eadd7c0059d8302619f4b428f664db36508acb7a | https://github.com/Subscribo/config/blob/eadd7c0059d8302619f4b428f664db36508acb7a/src/Subscribo/Config/Config.php#L157-L163 |
195,787 | Subscribo/config | src/Subscribo/Config/Config.php | Config.findFile | public function findFile($filePath)
{
if (file_exists($filePath)) {
return $filePath;
}
foreach ($this->supportedExtensions as $extension)
{
$extendedFilePath = $filePath.'.'.$extension;
if (file_exists($extendedFilePath)) {
return ... | php | public function findFile($filePath)
{
if (file_exists($filePath)) {
return $filePath;
}
foreach ($this->supportedExtensions as $extension)
{
$extendedFilePath = $filePath.'.'.$extension;
if (file_exists($extendedFilePath)) {
return ... | [
"public",
"function",
"findFile",
"(",
"$",
"filePath",
")",
"{",
"if",
"(",
"file_exists",
"(",
"$",
"filePath",
")",
")",
"{",
"return",
"$",
"filePath",
";",
"}",
"foreach",
"(",
"$",
"this",
"->",
"supportedExtensions",
"as",
"$",
"extension",
")",
... | Tries to find existing file with supported extension
@param $filePath
@return null|string | [
"Tries",
"to",
"find",
"existing",
"file",
"with",
"supported",
"extension"
] | eadd7c0059d8302619f4b428f664db36508acb7a | https://github.com/Subscribo/config/blob/eadd7c0059d8302619f4b428f664db36508acb7a/src/Subscribo/Config/Config.php#L277-L298 |
195,788 | Subscribo/config | src/Subscribo/Config/Config.php | Config.processFile | private function processFile($filePath, $group = null, $baseDir = null)
{
if (is_null($baseDir)) {
$baseDir = $this->baseDirectory;
}
if ( ! is_string($baseDir)) {
$baseDir = '';
}
if ($baseDir) {
$baseDir = rtrim($baseDir, '/').'/';
... | php | private function processFile($filePath, $group = null, $baseDir = null)
{
if (is_null($baseDir)) {
$baseDir = $this->baseDirectory;
}
if ( ! is_string($baseDir)) {
$baseDir = '';
}
if ($baseDir) {
$baseDir = rtrim($baseDir, '/').'/';
... | [
"private",
"function",
"processFile",
"(",
"$",
"filePath",
",",
"$",
"group",
"=",
"null",
",",
"$",
"baseDir",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"baseDir",
")",
")",
"{",
"$",
"baseDir",
"=",
"$",
"this",
"->",
"baseDirectory",... | Processing the file, optionally putting result under group
@param string $filePath
@param string|null|bool $group Whether parsed file content should be under some group.
False - no group (root node)
True - Group same as file base name (without extension)
String - under provided string
Null (default) - based on file ba... | [
"Processing",
"the",
"file",
"optionally",
"putting",
"result",
"under",
"group"
] | eadd7c0059d8302619f4b428f664db36508acb7a | https://github.com/Subscribo/config/blob/eadd7c0059d8302619f4b428f664db36508acb7a/src/Subscribo/Config/Config.php#L353-L385 |
195,789 | Subscribo/config | src/Subscribo/Config/Config.php | Config.extractFileNameBase | private function extractFileNameBase($filePath)
{
$directories = explode('/', $filePath);
$fileName = array_pop($directories);
$fileNameParts = explode('.', $fileName);
if (count($fileNameParts) > 1) {
$extension = array_pop($fileNameParts);
}
$result = im... | php | private function extractFileNameBase($filePath)
{
$directories = explode('/', $filePath);
$fileName = array_pop($directories);
$fileNameParts = explode('.', $fileName);
if (count($fileNameParts) > 1) {
$extension = array_pop($fileNameParts);
}
$result = im... | [
"private",
"function",
"extractFileNameBase",
"(",
"$",
"filePath",
")",
"{",
"$",
"directories",
"=",
"explode",
"(",
"'/'",
",",
"$",
"filePath",
")",
";",
"$",
"fileName",
"=",
"array_pop",
"(",
"$",
"directories",
")",
";",
"$",
"fileNameParts",
"=",
... | Return file name base, without directories and without extension
@param string $filePath
@return string | [
"Return",
"file",
"name",
"base",
"without",
"directories",
"and",
"without",
"extension"
] | eadd7c0059d8302619f4b428f664db36508acb7a | https://github.com/Subscribo/config/blob/eadd7c0059d8302619f4b428f664db36508acb7a/src/Subscribo/Config/Config.php#L394-L404 |
195,790 | Subscribo/config | src/Subscribo/Config/Config.php | Config.assembleEnvironmentFilePath | private function assembleEnvironmentFilePath($filePath, $environment = true)
{
if (true === $environment) {
$environment = $this->environmentInstance->getEnvironment();
}
$directories = explode('/', $filePath);
$fileName = array_pop($directories);
$fileNameWithout... | php | private function assembleEnvironmentFilePath($filePath, $environment = true)
{
if (true === $environment) {
$environment = $this->environmentInstance->getEnvironment();
}
$directories = explode('/', $filePath);
$fileName = array_pop($directories);
$fileNameWithout... | [
"private",
"function",
"assembleEnvironmentFilePath",
"(",
"$",
"filePath",
",",
"$",
"environment",
"=",
"true",
")",
"{",
"if",
"(",
"true",
"===",
"$",
"environment",
")",
"{",
"$",
"environment",
"=",
"$",
"this",
"->",
"environmentInstance",
"->",
"getE... | Assemble path to configuration file with environment taken into account
@param string $filePath Path to configuration file for all environments
@param string|bool $environment Environment name, true for predefined for Config object (usually the current one)
@return string | [
"Assemble",
"path",
"to",
"configuration",
"file",
"with",
"environment",
"taken",
"into",
"account"
] | eadd7c0059d8302619f4b428f664db36508acb7a | https://github.com/Subscribo/config/blob/eadd7c0059d8302619f4b428f664db36508acb7a/src/Subscribo/Config/Config.php#L413-L424 |
195,791 | wb-crowdfusion/crowdfusion | system/core/classes/libraries/images/Thumbnails.php | Thumbnails.getDesiredImageQuality | protected function getDesiredImageQuality($ext, $format)
{
switch ($ext) {
case 'jpeg':
case 'jpg':
$qualityConfig = $this->jpegQuality;
break;
case 'png':
$qualityConfig = $this->pngQuality;
break;
... | php | protected function getDesiredImageQuality($ext, $format)
{
switch ($ext) {
case 'jpeg':
case 'jpg':
$qualityConfig = $this->jpegQuality;
break;
case 'png':
$qualityConfig = $this->pngQuality;
break;
... | [
"protected",
"function",
"getDesiredImageQuality",
"(",
"$",
"ext",
",",
"$",
"format",
")",
"{",
"switch",
"(",
"$",
"ext",
")",
"{",
"case",
"'jpeg'",
":",
"case",
"'jpg'",
":",
"$",
"qualityConfig",
"=",
"$",
"this",
"->",
"jpegQuality",
";",
"break",... | Figure out image quality.
@param string $format
@returns mixed - string/integer quality or null if no config value is set | [
"Figure",
"out",
"image",
"quality",
"."
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/images/Thumbnails.php#L225-L253 |
195,792 | ARCANESOFT/SEO | src/Http/Controllers/Admin/RedirectsController.php | RedirectsController.index | public function index()
{
$this->authorize(RedirectsPolicy::PERMISSION_LIST);
$redirects = Redirect::query()->paginate(50);
$this->setTitle($title = trans('seo::redirects.titles.redirections-list'));
$this->addBreadcrumb($title);
return $this->view('admin.redirects.index',... | php | public function index()
{
$this->authorize(RedirectsPolicy::PERMISSION_LIST);
$redirects = Redirect::query()->paginate(50);
$this->setTitle($title = trans('seo::redirects.titles.redirections-list'));
$this->addBreadcrumb($title);
return $this->view('admin.redirects.index',... | [
"public",
"function",
"index",
"(",
")",
"{",
"$",
"this",
"->",
"authorize",
"(",
"RedirectsPolicy",
"::",
"PERMISSION_LIST",
")",
";",
"$",
"redirects",
"=",
"Redirect",
"::",
"query",
"(",
")",
"->",
"paginate",
"(",
"50",
")",
";",
"$",
"this",
"->... | Get the index page.
@return \Illuminate\View\View | [
"Get",
"the",
"index",
"page",
"."
] | ce6d6135d55e8b2fd43cf7923839b4791b7c7ad2 | https://github.com/ARCANESOFT/SEO/blob/ce6d6135d55e8b2fd43cf7923839b4791b7c7ad2/src/Http/Controllers/Admin/RedirectsController.php#L44-L54 |
195,793 | ARCANESOFT/SEO | src/Http/Controllers/Admin/RedirectsController.php | RedirectsController.create | public function create()
{
$this->authorize(RedirectsPolicy::PERMISSION_CREATE);
$statuses = RedirectStatuses::all();
$this->setTitle($title = trans('seo::redirects.titles.create-redirection'));
$this->addBreadcrumb($title);
return $this->view('admin.redirects.create', com... | php | public function create()
{
$this->authorize(RedirectsPolicy::PERMISSION_CREATE);
$statuses = RedirectStatuses::all();
$this->setTitle($title = trans('seo::redirects.titles.create-redirection'));
$this->addBreadcrumb($title);
return $this->view('admin.redirects.create', com... | [
"public",
"function",
"create",
"(",
")",
"{",
"$",
"this",
"->",
"authorize",
"(",
"RedirectsPolicy",
"::",
"PERMISSION_CREATE",
")",
";",
"$",
"statuses",
"=",
"RedirectStatuses",
"::",
"all",
"(",
")",
";",
"$",
"this",
"->",
"setTitle",
"(",
"$",
"ti... | Get the create form.
@return \Illuminate\View\View | [
"Get",
"the",
"create",
"form",
"."
] | ce6d6135d55e8b2fd43cf7923839b4791b7c7ad2 | https://github.com/ARCANESOFT/SEO/blob/ce6d6135d55e8b2fd43cf7923839b4791b7c7ad2/src/Http/Controllers/Admin/RedirectsController.php#L61-L71 |
195,794 | ARCANESOFT/SEO | src/Http/Controllers/Admin/RedirectsController.php | RedirectsController.store | public function store(CreateRedirectRequest $request)
{
$this->authorize(RedirectsPolicy::PERMISSION_CREATE);
$redirect = Redirect::createRedirect(
$request->getValidatedData()
);
$this->transNotification('created', [], $redirect->toArray());
return redirect()-... | php | public function store(CreateRedirectRequest $request)
{
$this->authorize(RedirectsPolicy::PERMISSION_CREATE);
$redirect = Redirect::createRedirect(
$request->getValidatedData()
);
$this->transNotification('created', [], $redirect->toArray());
return redirect()-... | [
"public",
"function",
"store",
"(",
"CreateRedirectRequest",
"$",
"request",
")",
"{",
"$",
"this",
"->",
"authorize",
"(",
"RedirectsPolicy",
"::",
"PERMISSION_CREATE",
")",
";",
"$",
"redirect",
"=",
"Redirect",
"::",
"createRedirect",
"(",
"$",
"request",
"... | Store the new redirect.
@param \Arcanesoft\Seo\Http\Requests\Admin\Redirects\CreateRedirectRequest $request
@return \Illuminate\Http\RedirectResponse | [
"Store",
"the",
"new",
"redirect",
"."
] | ce6d6135d55e8b2fd43cf7923839b4791b7c7ad2 | https://github.com/ARCANESOFT/SEO/blob/ce6d6135d55e8b2fd43cf7923839b4791b7c7ad2/src/Http/Controllers/Admin/RedirectsController.php#L80-L91 |
195,795 | ARCANESOFT/SEO | src/Http/Controllers/Admin/RedirectsController.php | RedirectsController.show | public function show(Redirect $redirect)
{
$this->authorize(RedirectsPolicy::PERMISSION_SHOW);
$this->setTitle($title = trans('seo::redirects.titles.redirection-details'));
$this->addBreadcrumb($title);
return $this->view('admin.redirects.show', compact('redirect'));
} | php | public function show(Redirect $redirect)
{
$this->authorize(RedirectsPolicy::PERMISSION_SHOW);
$this->setTitle($title = trans('seo::redirects.titles.redirection-details'));
$this->addBreadcrumb($title);
return $this->view('admin.redirects.show', compact('redirect'));
} | [
"public",
"function",
"show",
"(",
"Redirect",
"$",
"redirect",
")",
"{",
"$",
"this",
"->",
"authorize",
"(",
"RedirectsPolicy",
"::",
"PERMISSION_SHOW",
")",
";",
"$",
"this",
"->",
"setTitle",
"(",
"$",
"title",
"=",
"trans",
"(",
"'seo::redirects.titles.... | Show the redirect details page.
@param \Arcanesoft\Seo\Models\Redirect $redirect
@return \Illuminate\View\View | [
"Show",
"the",
"redirect",
"details",
"page",
"."
] | ce6d6135d55e8b2fd43cf7923839b4791b7c7ad2 | https://github.com/ARCANESOFT/SEO/blob/ce6d6135d55e8b2fd43cf7923839b4791b7c7ad2/src/Http/Controllers/Admin/RedirectsController.php#L100-L108 |
195,796 | ARCANESOFT/SEO | src/Http/Controllers/Admin/RedirectsController.php | RedirectsController.edit | public function edit(Redirect $redirect)
{
$this->authorize(RedirectsPolicy::PERMISSION_UPDATE);
$statuses = RedirectStatuses::all();
$this->setTitle($title = trans('seo::redirects.titles.edit-redirection'));
$this->addBreadcrumb($title);
return $this->view('admin.redirect... | php | public function edit(Redirect $redirect)
{
$this->authorize(RedirectsPolicy::PERMISSION_UPDATE);
$statuses = RedirectStatuses::all();
$this->setTitle($title = trans('seo::redirects.titles.edit-redirection'));
$this->addBreadcrumb($title);
return $this->view('admin.redirect... | [
"public",
"function",
"edit",
"(",
"Redirect",
"$",
"redirect",
")",
"{",
"$",
"this",
"->",
"authorize",
"(",
"RedirectsPolicy",
"::",
"PERMISSION_UPDATE",
")",
";",
"$",
"statuses",
"=",
"RedirectStatuses",
"::",
"all",
"(",
")",
";",
"$",
"this",
"->",
... | Get the edit page.
@param \Arcanesoft\Seo\Models\Redirect $redirect
@return \Illuminate\View\View | [
"Get",
"the",
"edit",
"page",
"."
] | ce6d6135d55e8b2fd43cf7923839b4791b7c7ad2 | https://github.com/ARCANESOFT/SEO/blob/ce6d6135d55e8b2fd43cf7923839b4791b7c7ad2/src/Http/Controllers/Admin/RedirectsController.php#L117-L127 |
195,797 | ARCANESOFT/SEO | src/Http/Controllers/Admin/RedirectsController.php | RedirectsController.update | public function update(Redirect $redirect, UpdateRedirectRequest $request)
{
$this->authorize(RedirectsPolicy::PERMISSION_UPDATE);
$redirect->update($request->getValidatedData());
$this->transNotification('updated', [], $redirect->toArray());
return redirect()->route('admin::seo.r... | php | public function update(Redirect $redirect, UpdateRedirectRequest $request)
{
$this->authorize(RedirectsPolicy::PERMISSION_UPDATE);
$redirect->update($request->getValidatedData());
$this->transNotification('updated', [], $redirect->toArray());
return redirect()->route('admin::seo.r... | [
"public",
"function",
"update",
"(",
"Redirect",
"$",
"redirect",
",",
"UpdateRedirectRequest",
"$",
"request",
")",
"{",
"$",
"this",
"->",
"authorize",
"(",
"RedirectsPolicy",
"::",
"PERMISSION_UPDATE",
")",
";",
"$",
"redirect",
"->",
"update",
"(",
"$",
... | Update the redirect.
@param \Arcanesoft\Seo\Models\Redirect $redirect
@param \Arcanesoft\Seo\Http\Requests\Admin\Redirects\UpdateRedirectRequest $request
@return \Illuminate\Http\RedirectResponse | [
"Update",
"the",
"redirect",
"."
] | ce6d6135d55e8b2fd43cf7923839b4791b7c7ad2 | https://github.com/ARCANESOFT/SEO/blob/ce6d6135d55e8b2fd43cf7923839b4791b7c7ad2/src/Http/Controllers/Admin/RedirectsController.php#L137-L146 |
195,798 | ARCANESOFT/SEO | src/Http/Controllers/Admin/RedirectsController.php | RedirectsController.delete | public function delete(Redirect $redirect)
{
$this->authorize(RedirectsPolicy::PERMISSION_DELETE);
$redirect->delete();
return $this->jsonResponseSuccess([
'message' => $this->transNotification('deleted', [], $redirect->toArray())
]);
} | php | public function delete(Redirect $redirect)
{
$this->authorize(RedirectsPolicy::PERMISSION_DELETE);
$redirect->delete();
return $this->jsonResponseSuccess([
'message' => $this->transNotification('deleted', [], $redirect->toArray())
]);
} | [
"public",
"function",
"delete",
"(",
"Redirect",
"$",
"redirect",
")",
"{",
"$",
"this",
"->",
"authorize",
"(",
"RedirectsPolicy",
"::",
"PERMISSION_DELETE",
")",
";",
"$",
"redirect",
"->",
"delete",
"(",
")",
";",
"return",
"$",
"this",
"->",
"jsonRespo... | Delete a redirect record.
@param \Arcanesoft\Seo\Models\Redirect $redirect
@return \Illuminate\Http\JsonResponse | [
"Delete",
"a",
"redirect",
"record",
"."
] | ce6d6135d55e8b2fd43cf7923839b4791b7c7ad2 | https://github.com/ARCANESOFT/SEO/blob/ce6d6135d55e8b2fd43cf7923839b4791b7c7ad2/src/Http/Controllers/Admin/RedirectsController.php#L155-L164 |
195,799 | ARCANESOFT/SEO | src/Http/Controllers/Admin/RedirectsController.php | RedirectsController.transNotification | protected function transNotification($action, array $replace = [], array $context = [])
{
$title = trans("seo::redirects.messages.{$action}.title");
$message = trans("seo::redirects.messages.{$action}.message", $replace);
Log::info($message, $context);
$this->notifySuccess($messag... | php | protected function transNotification($action, array $replace = [], array $context = [])
{
$title = trans("seo::redirects.messages.{$action}.title");
$message = trans("seo::redirects.messages.{$action}.message", $replace);
Log::info($message, $context);
$this->notifySuccess($messag... | [
"protected",
"function",
"transNotification",
"(",
"$",
"action",
",",
"array",
"$",
"replace",
"=",
"[",
"]",
",",
"array",
"$",
"context",
"=",
"[",
"]",
")",
"{",
"$",
"title",
"=",
"trans",
"(",
"\"seo::redirects.messages.{$action}.title\"",
")",
";",
... | Notify with translation.
@todo: Refactor this method to the core package ?
@param string $action
@param array $replace
@param array $context
@return string | [
"Notify",
"with",
"translation",
"."
] | ce6d6135d55e8b2fd43cf7923839b4791b7c7ad2 | https://github.com/ARCANESOFT/SEO/blob/ce6d6135d55e8b2fd43cf7923839b4791b7c7ad2/src/Http/Controllers/Admin/RedirectsController.php#L182-L191 |
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.