repo stringclasses 21
values | path stringlengths 10 100 | func_name stringlengths 6 71 | original_string stringlengths 115 97k | language stringclasses 1
value | code stringlengths 115 97k | code_tokens listlengths 27 7.5k | docstring stringlengths 6 1.88k | docstring_tokens listlengths 1 177 | sha stringclasses 21
values | url stringlengths 100 189 | partition stringclasses 1
value | summary stringlengths 9 340 | input_ids listlengths 502 502 | token_type_ids listlengths 502 502 | attention_mask listlengths 502 502 | labels listlengths 502 502 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
symfony/symfony | src/Symfony/Component/HttpFoundation/Session/Storage/Handler/AbstractSessionHandler.php | AbstractSessionHandler.write | public function write($sessionId, $data)
{
if (null === $this->igbinaryEmptyData) {
// see https://github.com/igbinary/igbinary/issues/146
$this->igbinaryEmptyData = \function_exists('igbinary_serialize') ? igbinary_serialize([]) : '';
}
if ('' === $data || $this->igb... | php | public function write($sessionId, $data)
{
if (null === $this->igbinaryEmptyData) {
// see https://github.com/igbinary/igbinary/issues/146
$this->igbinaryEmptyData = \function_exists('igbinary_serialize') ? igbinary_serialize([]) : '';
}
if ('' === $data || $this->igb... | [
"public",
"function",
"write",
"(",
"$",
"sessionId",
",",
"$",
"data",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"igbinaryEmptyData",
")",
"{",
"// see https://github.com/igbinary/igbinary/issues/146",
"$",
"this",
"->",
"igbinaryEmptyData",
"=",
"... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/AbstractSessionHandler.php#L103-L115 | train | Write session data | [
30522,
2270,
3853,
4339,
1006,
1002,
5219,
3593,
1010,
1002,
2951,
1007,
1063,
2065,
1006,
19701,
1027,
1027,
1027,
1002,
2023,
1011,
1028,
1045,
18259,
3981,
2854,
6633,
13876,
25688,
6790,
1007,
1063,
1013,
1013,
2156,
16770,
1024,
1013,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
z-song/laravel-admin | src/Show.php | Show.addField | protected function addField($name, $label = '')
{
$field = new Field($name, $label);
$field->setParent($this);
$this->overwriteExistingField($name);
return tap($field, function ($field) {
$this->fields->push($field);
});
} | php | protected function addField($name, $label = '')
{
$field = new Field($name, $label);
$field->setParent($this);
$this->overwriteExistingField($name);
return tap($field, function ($field) {
$this->fields->push($field);
});
} | [
"protected",
"function",
"addField",
"(",
"$",
"name",
",",
"$",
"label",
"=",
"''",
")",
"{",
"$",
"field",
"=",
"new",
"Field",
"(",
"$",
"name",
",",
"$",
"label",
")",
";",
"$",
"field",
"->",
"setParent",
"(",
"$",
"this",
")",
";",
"$",
"... | Add a model field to show.
@param string $name
@param string $label
@return Field | [
"Add",
"a",
"model",
"field",
"to",
"show",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Show.php#L218-L229 | train | Add a field to the fields list. | [
30522,
5123,
3853,
5587,
3790,
1006,
1002,
2171,
1010,
1002,
3830,
1027,
1005,
1005,
1007,
1063,
1002,
2492,
1027,
2047,
2492,
1006,
1002,
2171,
1010,
1002,
3830,
1007,
1025,
1002,
2492,
1011,
1028,
2275,
19362,
4765,
1006,
1002,
2023,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/Menu/MenuAbstract.php | MenuAbstract.rename | public function rename($mainMenuOriginal, $subMenuOriginal, $mainMenuRenamed, $subMenuRenamed)
{
$this->renames[] = array($mainMenuOriginal, $subMenuOriginal,
$mainMenuRenamed, $subMenuRenamed);
} | php | public function rename($mainMenuOriginal, $subMenuOriginal, $mainMenuRenamed, $subMenuRenamed)
{
$this->renames[] = array($mainMenuOriginal, $subMenuOriginal,
$mainMenuRenamed, $subMenuRenamed);
} | [
"public",
"function",
"rename",
"(",
"$",
"mainMenuOriginal",
",",
"$",
"subMenuOriginal",
",",
"$",
"mainMenuRenamed",
",",
"$",
"subMenuRenamed",
")",
"{",
"$",
"this",
"->",
"renames",
"[",
"]",
"=",
"array",
"(",
"$",
"mainMenuOriginal",
",",
"$",
"sub... | Renames a single menu entry.
@param $mainMenuOriginal
@param $subMenuOriginal
@param $mainMenuRenamed
@param $subMenuRenamed
@api | [
"Renames",
"a",
"single",
"menu",
"entry",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Menu/MenuAbstract.php#L206-L210 | train | Renames the main menu and the sub menu | [
30522,
2270,
3853,
14916,
14074,
1006,
1002,
2364,
3549,
19098,
3089,
24965,
1010,
1002,
4942,
3549,
19098,
3089,
24965,
1010,
1002,
2364,
3549,
5397,
18442,
2094,
1010,
1002,
4942,
3549,
5397,
18442,
2094,
1007,
1063,
1002,
2023,
1011,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
dompdf/dompdf | src/Adapter/GD.php | GD.circle | public function circle($x, $y, $r, $color, $width = null, $style = null, $fill = false)
{
// Scale by the AA factor and DPI
$x = $this->_upscale($x);
$y = $this->_upscale($y);
$r = $this->_upscale($r);
$c = $this->_allocate_color($color);
// Convert the style array ... | php | public function circle($x, $y, $r, $color, $width = null, $style = null, $fill = false)
{
// Scale by the AA factor and DPI
$x = $this->_upscale($x);
$y = $this->_upscale($y);
$r = $this->_upscale($r);
$c = $this->_allocate_color($color);
// Convert the style array ... | [
"public",
"function",
"circle",
"(",
"$",
"x",
",",
"$",
"y",
",",
"$",
"r",
",",
"$",
"color",
",",
"$",
"width",
"=",
"null",
",",
"$",
"style",
"=",
"null",
",",
"$",
"fill",
"=",
"false",
")",
"{",
"// Scale by the AA factor and DPI",
"$",
"x",... | Draws a circle at $x,$y with radius $r
See {@link Style::munge_color()} for the format of the color array.
See {@link Cpdf::setLineStyle()} for a description of the $style
parameter (aka dash)
@param float $x
@param float $y
@param float $r
@param array $color
@param float $width
@param array $style
@param bool $fill... | [
"Draws",
"a",
"circle",
"at",
"$x",
"$y",
"with",
"radius",
"$r"
] | 75f13c700009be21a1965dc2c5b68a8708c22ba2 | https://github.com/dompdf/dompdf/blob/75f13c700009be21a1965dc2c5b68a8708c22ba2/src/Adapter/GD.php#L671-L703 | train | Central method to create a circle | [
30522,
2270,
3853,
4418,
1006,
1002,
1060,
1010,
1002,
1061,
1010,
1002,
1054,
1010,
1002,
3609,
1010,
1002,
9381,
1027,
19701,
1010,
1002,
2806,
1027,
19701,
1010,
1002,
6039,
1027,
6270,
1007,
1063,
1013,
1013,
4094,
2011,
1996,
9779,
5... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/cms/twig/DebugExtension.php | DebugExtension.objectToArray | protected function objectToArray($object)
{
$class = get_class($object);
$info = new \ReflectionClass($object);
$this->commentMap[$class] = [];
$methods = [];
foreach ($info->getMethods() as $method) {
if (!$method->isPublic()) {
continue; // Onl... | php | protected function objectToArray($object)
{
$class = get_class($object);
$info = new \ReflectionClass($object);
$this->commentMap[$class] = [];
$methods = [];
foreach ($info->getMethods() as $method) {
if (!$method->isPublic()) {
continue; // Onl... | [
"protected",
"function",
"objectToArray",
"(",
"$",
"object",
")",
"{",
"$",
"class",
"=",
"get_class",
"(",
"$",
"object",
")",
";",
"$",
"info",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"$",
"object",
")",
";",
"$",
"this",
"->",
"commentMap",
"[",
... | Returns a map of an object as an array, containing methods and properties.
@param mixed $object
@return array | [
"Returns",
"a",
"map",
"of",
"an",
"object",
"as",
"an",
"array",
"containing",
"methods",
"and",
"properties",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/twig/DebugExtension.php#L453-L503 | train | Convert object to array | [
30522,
5123,
3853,
4874,
3406,
2906,
9447,
1006,
1002,
4874,
1007,
1063,
1002,
2465,
1027,
2131,
1035,
2465,
1006,
1002,
4874,
1007,
1025,
1002,
18558,
1027,
2047,
1032,
9185,
26266,
1006,
1002,
4874,
1007,
1025,
1002,
2023,
1011,
1028,
7... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Http/Resources/Json/PaginatedResourceResponse.php | PaginatedResourceResponse.paginationLinks | protected function paginationLinks($paginated)
{
return [
'first' => $paginated['first_page_url'] ?? null,
'last' => $paginated['last_page_url'] ?? null,
'prev' => $paginated['prev_page_url'] ?? null,
'next' => $paginated['next_page_url'] ?? null,
];
... | php | protected function paginationLinks($paginated)
{
return [
'first' => $paginated['first_page_url'] ?? null,
'last' => $paginated['last_page_url'] ?? null,
'prev' => $paginated['prev_page_url'] ?? null,
'next' => $paginated['next_page_url'] ?? null,
];
... | [
"protected",
"function",
"paginationLinks",
"(",
"$",
"paginated",
")",
"{",
"return",
"[",
"'first'",
"=>",
"$",
"paginated",
"[",
"'first_page_url'",
"]",
"??",
"null",
",",
"'last'",
"=>",
"$",
"paginated",
"[",
"'last_page_url'",
"]",
"??",
"null",
",",
... | Get the pagination links for the response.
@param array $paginated
@return array | [
"Get",
"the",
"pagination",
"links",
"for",
"the",
"response",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Http/Resources/Json/PaginatedResourceResponse.php#L56-L64 | train | Return an array of pagination links | [
30522,
5123,
3853,
6643,
20876,
3508,
13767,
2015,
1006,
1002,
6643,
20876,
3064,
1007,
1063,
2709,
1031,
1005,
2034,
1005,
1027,
1028,
1002,
6643,
20876,
3064,
1031,
1005,
2034,
1035,
3931,
1035,
24471,
2140,
1005,
1033,
1029,
1029,
19701,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Form/Extension/Validator/ValidatorTypeGuesser.php | ValidatorTypeGuesser.guessMaxLength | public function guessMaxLength($class, $property)
{
return $this->guess($class, $property, function (Constraint $constraint) {
return $this->guessMaxLengthForConstraint($constraint);
});
} | php | public function guessMaxLength($class, $property)
{
return $this->guess($class, $property, function (Constraint $constraint) {
return $this->guessMaxLengthForConstraint($constraint);
});
} | [
"public",
"function",
"guessMaxLength",
"(",
"$",
"class",
",",
"$",
"property",
")",
"{",
"return",
"$",
"this",
"->",
"guess",
"(",
"$",
"class",
",",
"$",
"property",
",",
"function",
"(",
"Constraint",
"$",
"constraint",
")",
"{",
"return",
"$",
"t... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/Extension/Validator/ValidatorTypeGuesser.php#L56-L61 | train | Guesses the maximum length of a property for a given class and property. | [
30522,
2270,
3853,
3984,
17848,
7770,
13512,
2232,
1006,
1002,
2465,
1010,
1002,
3200,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
3984,
1006,
1002,
2465,
1010,
1002,
3200,
1010,
3853,
1006,
27142,
1002,
27142,
1007,
1063,
2709,
1002,
2023,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/system/ServiceProvider.php | ServiceProvider.registerBackendSettings | protected function registerBackendSettings()
{
Event::listen('system.settings.extendItems', function ($manager) {
\System\Models\LogSetting::filterSettingItems($manager);
});
SettingsManager::instance()->registerCallback(function ($manager) {
$manager->registerSettin... | php | protected function registerBackendSettings()
{
Event::listen('system.settings.extendItems', function ($manager) {
\System\Models\LogSetting::filterSettingItems($manager);
});
SettingsManager::instance()->registerCallback(function ($manager) {
$manager->registerSettin... | [
"protected",
"function",
"registerBackendSettings",
"(",
")",
"{",
"Event",
"::",
"listen",
"(",
"'system.settings.extendItems'",
",",
"function",
"(",
"$",
"manager",
")",
"{",
"\\",
"System",
"\\",
"Models",
"\\",
"LogSetting",
"::",
"filterSettingItems",
"(",
... | /*
Register settings | [
"/",
"*",
"Register",
"settings"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/ServiceProvider.php#L421-L505 | train | Registers the backend settings | [
30522,
5123,
3853,
4236,
5963,
10497,
21678,
8613,
1006,
1007,
1063,
2724,
1024,
1024,
4952,
1006,
1005,
2291,
1012,
10906,
1012,
7949,
4221,
5244,
1005,
1010,
3853,
1006,
1002,
3208,
1007,
1063,
1032,
2291,
1032,
4275,
1032,
15664,
18319,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
z-song/laravel-admin | src/Grid/Filter/Presenter/Select.php | Select.ajax | public function ajax($resourceUrl, $idField = 'id', $textField = 'text')
{
$configs = array_merge([
'allowClear' => true,
'placeholder' => trans('admin.choose'),
'minimumInputLength' => 1,
], $this->config);
$configs = json_encode($configs)... | php | public function ajax($resourceUrl, $idField = 'id', $textField = 'text')
{
$configs = array_merge([
'allowClear' => true,
'placeholder' => trans('admin.choose'),
'minimumInputLength' => 1,
], $this->config);
$configs = json_encode($configs)... | [
"public",
"function",
"ajax",
"(",
"$",
"resourceUrl",
",",
"$",
"idField",
"=",
"'id'",
",",
"$",
"textField",
"=",
"'text'",
")",
"{",
"$",
"configs",
"=",
"array_merge",
"(",
"[",
"'allowClear'",
"=>",
"true",
",",
"'placeholder'",
"=>",
"trans",
"(",... | Load options from ajax.
@param string $resourceUrl
@param $idField
@param $textField | [
"Load",
"options",
"from",
"ajax",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Grid/Filter/Presenter/Select.php#L193-L240 | train | Ajax select2 ajax | [
30522,
2270,
3853,
18176,
1006,
1002,
7692,
3126,
2140,
1010,
1002,
24011,
12891,
1027,
1005,
8909,
1005,
1010,
1002,
3793,
3790,
1027,
1005,
3793,
1005,
1007,
1063,
1002,
9530,
8873,
5620,
1027,
9140,
1035,
13590,
1006,
1031,
1005,
3499,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Serializer/Normalizer/PropertyNormalizer.php | PropertyNormalizer.getReflectionProperty | private function getReflectionProperty($classOrObject, string $attribute): \ReflectionProperty
{
$reflectionClass = new \ReflectionClass($classOrObject);
while (true) {
try {
return $reflectionClass->getProperty($attribute);
} catch (\ReflectionException $e) {... | php | private function getReflectionProperty($classOrObject, string $attribute): \ReflectionProperty
{
$reflectionClass = new \ReflectionClass($classOrObject);
while (true) {
try {
return $reflectionClass->getProperty($attribute);
} catch (\ReflectionException $e) {... | [
"private",
"function",
"getReflectionProperty",
"(",
"$",
"classOrObject",
",",
"string",
"$",
"attribute",
")",
":",
"\\",
"ReflectionProperty",
"{",
"$",
"reflectionClass",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"$",
"classOrObject",
")",
";",
"while",
"(",... | @param string|object $classOrObject
@throws \ReflectionException | [
"@param",
"string|object",
"$classOrObject"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Serializer/Normalizer/PropertyNormalizer.php#L165-L177 | train | Get reflection property | [
30522,
2797,
3853,
2131,
2890,
21031,
7542,
21572,
4842,
3723,
1006,
1002,
2465,
14604,
2497,
20614,
1010,
5164,
1002,
17961,
1007,
1024,
1032,
9185,
21572,
4842,
3723,
1063,
1002,
9185,
26266,
1027,
2047,
1032,
9185,
26266,
1006,
1002,
246... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/cms/classes/Theme.php | Theme.setActiveTheme | public static function setActiveTheme($code)
{
self::resetCache();
Parameter::set(self::ACTIVE_KEY, $code);
/**
* @event cms.theme.setActiveTheme
* Fires when the active theme has been changed.
*
* If a value is returned from this halting event, it will ... | php | public static function setActiveTheme($code)
{
self::resetCache();
Parameter::set(self::ACTIVE_KEY, $code);
/**
* @event cms.theme.setActiveTheme
* Fires when the active theme has been changed.
*
* If a value is returned from this halting event, it will ... | [
"public",
"static",
"function",
"setActiveTheme",
"(",
"$",
"code",
")",
"{",
"self",
"::",
"resetCache",
"(",
")",
";",
"Parameter",
"::",
"set",
"(",
"self",
"::",
"ACTIVE_KEY",
",",
"$",
"code",
")",
";",
"/**\n * @event cms.theme.setActiveTheme\n ... | Sets the active theme.
The active theme code is stored in the database and overrides the configuration cms.activeTheme parameter.
@param string $code Specifies the active theme code. | [
"Sets",
"the",
"active",
"theme",
".",
"The",
"active",
"theme",
"code",
"is",
"stored",
"in",
"the",
"database",
"and",
"overrides",
"the",
"configuration",
"cms",
".",
"activeTheme",
"parameter",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/Theme.php#L222-L241 | train | Sets the active theme code | [
30522,
2270,
10763,
3853,
2275,
19620,
10760,
4168,
1006,
1002,
3642,
1007,
1063,
2969,
1024,
1024,
25141,
3540,
5403,
1006,
1007,
1025,
16381,
1024,
1024,
2275,
1006,
2969,
1024,
1024,
3161,
1035,
3145,
1010,
1002,
3642,
1007,
1025,
1013,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/HTML/QuickForm2/Rule/Regex.php | HTML_QuickForm2_Rule_Regex.validateOwner | protected function validateOwner()
{
$value = $this->owner->getValue();
if ($this->owner instanceof HTML_QuickForm2_Element_InputFile) {
if (!isset($value['error']) || UPLOAD_ERR_NO_FILE == $value['error']) {
return true;
}
$value = $value['name'];... | php | protected function validateOwner()
{
$value = $this->owner->getValue();
if ($this->owner instanceof HTML_QuickForm2_Element_InputFile) {
if (!isset($value['error']) || UPLOAD_ERR_NO_FILE == $value['error']) {
return true;
}
$value = $value['name'];... | [
"protected",
"function",
"validateOwner",
"(",
")",
"{",
"$",
"value",
"=",
"$",
"this",
"->",
"owner",
"->",
"getValue",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"owner",
"instanceof",
"HTML_QuickForm2_Element_InputFile",
")",
"{",
"if",
"(",
"!",
"... | Validates the owner element
@return bool whether element's value matches given regular expression | [
"Validates",
"the",
"owner",
"element"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Rule/Regex.php#L79-L91 | train | Validate owner value | [
30522,
5123,
3853,
9398,
3686,
12384,
2121,
1006,
1007,
1063,
1002,
3643,
1027,
1002,
2023,
1011,
1028,
3954,
1011,
1028,
2131,
10175,
5657,
1006,
1007,
1025,
2065,
1006,
1002,
2023,
1011,
1028,
3954,
6013,
11253,
16129,
1035,
4248,
14192,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
z-song/laravel-admin | src/Controllers/AuthController.php | AuthController.getLogout | public function getLogout(Request $request)
{
$this->guard()->logout();
$request->session()->invalidate();
return redirect(config('admin.route.prefix'));
} | php | public function getLogout(Request $request)
{
$this->guard()->logout();
$request->session()->invalidate();
return redirect(config('admin.route.prefix'));
} | [
"public",
"function",
"getLogout",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"this",
"->",
"guard",
"(",
")",
"->",
"logout",
"(",
")",
";",
"$",
"request",
"->",
"session",
"(",
")",
"->",
"invalidate",
"(",
")",
";",
"return",
"redirect",
"(",... | User logout.
@return Redirect | [
"User",
"logout",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Controllers/AuthController.php#L79-L86 | train | Logout and invalidate session | [
30522,
2270,
3853,
2131,
21197,
5833,
1006,
5227,
1002,
5227,
1007,
1063,
1002,
2023,
1011,
1028,
3457,
1006,
1007,
1011,
1028,
8154,
4904,
1006,
1007,
1025,
1002,
5227,
1011,
1028,
5219,
1006,
1007,
1011,
1028,
19528,
3686,
1006,
1007,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/Login/PasswordResetter.php | PasswordResetter.generateSecureHash | protected function generateSecureHash($hashIdentifier, $data)
{
// mitigate rainbow table attack
$halfDataLen = strlen($data) / 2;
$stringToHash = $hashIdentifier
. substr($data, 0, $halfDataLen)
. $this->getSalt()
. substr($... | php | protected function generateSecureHash($hashIdentifier, $data)
{
// mitigate rainbow table attack
$halfDataLen = strlen($data) / 2;
$stringToHash = $hashIdentifier
. substr($data, 0, $halfDataLen)
. $this->getSalt()
. substr($... | [
"protected",
"function",
"generateSecureHash",
"(",
"$",
"hashIdentifier",
",",
"$",
"data",
")",
"{",
"// mitigate rainbow table attack",
"$",
"halfDataLen",
"=",
"strlen",
"(",
"$",
"data",
")",
"/",
"2",
";",
"$",
"stringToHash",
"=",
"$",
"hashIdentifier",
... | Generates a hash using a hash "identifier" and some data to hash. The hash identifier is
a string that differentiates the hash in some way.
We can't get the identifier back from a hash but we can tell if a hash is the hash for
a specific identifier by computing a hash for the identifier and comparing with the
first ha... | [
"Generates",
"a",
"hash",
"using",
"a",
"hash",
"identifier",
"and",
"some",
"data",
"to",
"hash",
".",
"The",
"hash",
"identifier",
"is",
"a",
"string",
"that",
"differentiates",
"the",
"hash",
"in",
"some",
"way",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Login/PasswordResetter.php#L305-L317 | train | Generate a secure hash for the given hash identifier and data | [
30522,
5123,
3853,
19421,
29150,
14949,
2232,
1006,
1002,
23325,
5178,
16778,
8873,
2121,
1010,
1002,
2951,
1007,
1063,
1013,
1013,
10210,
28731,
10098,
2795,
2886,
1002,
2431,
2850,
22059,
2078,
1027,
2358,
20927,
2078,
1006,
1002,
2951,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
slimphp/Slim | Slim/Handlers/AbstractError.php | AbstractError.writeToErrorLog | protected function writeToErrorLog($throwable)
{
if ($this->displayErrorDetails) {
return;
}
$message = 'Slim Application Error:' . PHP_EOL;
$message .= $this->renderThrowableAsText($throwable);
while ($throwable = $throwable->getPrevious()) {
$messag... | php | protected function writeToErrorLog($throwable)
{
if ($this->displayErrorDetails) {
return;
}
$message = 'Slim Application Error:' . PHP_EOL;
$message .= $this->renderThrowableAsText($throwable);
while ($throwable = $throwable->getPrevious()) {
$messag... | [
"protected",
"function",
"writeToErrorLog",
"(",
"$",
"throwable",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"displayErrorDetails",
")",
"{",
"return",
";",
"}",
"$",
"message",
"=",
"'Slim Application Error:'",
".",
"PHP_EOL",
";",
"$",
"message",
".=",
"$",
... | Write to the error log if displayErrorDetails is false
@param Exception|Throwable $throwable
@return void | [
"Write",
"to",
"the",
"error",
"log",
"if",
"displayErrorDetails",
"is",
"false"
] | ccef5f7d8bcd469d59cbe64f6210d83764f91543 | https://github.com/slimphp/Slim/blob/ccef5f7d8bcd469d59cbe64f6210d83764f91543/Slim/Handlers/AbstractError.php#L35-L51 | train | Write the throwable to the error log | [
30522,
5123,
3853,
4339,
3406,
2121,
29165,
21197,
1006,
1002,
5466,
3085,
1007,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
4653,
2121,
29165,
3207,
22081,
1007,
1063,
2709,
1025,
1065,
1002,
4471,
1027,
1005,
11754,
4646,
7561,
1024,
1005,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Serializer/Encoder/XmlEncoder.php | XmlEncoder.parseXmlAttributes | private function parseXmlAttributes(\DOMNode $node, array $context = []): array
{
if (!$node->hasAttributes()) {
return [];
}
$data = [];
$typeCastAttributes = (bool) ($context[self::TYPE_CASE_ATTRIBUTES] ?? $this->defaultContext[self::TYPE_CASE_ATTRIBUTES]);
fo... | php | private function parseXmlAttributes(\DOMNode $node, array $context = []): array
{
if (!$node->hasAttributes()) {
return [];
}
$data = [];
$typeCastAttributes = (bool) ($context[self::TYPE_CASE_ATTRIBUTES] ?? $this->defaultContext[self::TYPE_CASE_ATTRIBUTES]);
fo... | [
"private",
"function",
"parseXmlAttributes",
"(",
"\\",
"DOMNode",
"$",
"node",
",",
"array",
"$",
"context",
"=",
"[",
"]",
")",
":",
"array",
"{",
"if",
"(",
"!",
"$",
"node",
"->",
"hasAttributes",
"(",
")",
")",
"{",
"return",
"[",
"]",
";",
"}... | Parse the input DOMNode attributes into an array. | [
"Parse",
"the",
"input",
"DOMNode",
"attributes",
"into",
"an",
"array",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Serializer/Encoder/XmlEncoder.php#L332-L358 | train | Parse xml attributes | [
30522,
2797,
3853,
11968,
3366,
2595,
19968,
19321,
3089,
8569,
4570,
1006,
1032,
14383,
3630,
3207,
1002,
13045,
1010,
9140,
1002,
6123,
1027,
1031,
1033,
1007,
1024,
9140,
1063,
2065,
1006,
999,
1002,
13045,
1011,
1028,
2038,
19321,
3089,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/Zend/Db/Select.php | Zend_Db_Select.group | public function group($spec)
{
if (!is_array($spec)) {
$spec = array($spec);
}
foreach ($spec as $val) {
if (preg_match('/\(.*\)/', (string) $val)) {
$val = new Zend_Db_Expr($val);
}
$this->_parts[self::GROUP][] = $val;
... | php | public function group($spec)
{
if (!is_array($spec)) {
$spec = array($spec);
}
foreach ($spec as $val) {
if (preg_match('/\(.*\)/', (string) $val)) {
$val = new Zend_Db_Expr($val);
}
$this->_parts[self::GROUP][] = $val;
... | [
"public",
"function",
"group",
"(",
"$",
"spec",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"spec",
")",
")",
"{",
"$",
"spec",
"=",
"array",
"(",
"$",
"spec",
")",
";",
"}",
"foreach",
"(",
"$",
"spec",
"as",
"$",
"val",
")",
"{",
"if",... | Adds grouping to the query.
@param array|string $spec The column(s) to group by.
@return Zend_Db_Select This Zend_Db_Select object. | [
"Adds",
"grouping",
"to",
"the",
"query",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Select.php#L505-L519 | train | Add a group to the query | [
30522,
2270,
3853,
2177,
1006,
1002,
28699,
1007,
1063,
2065,
1006,
999,
2003,
1035,
9140,
1006,
1002,
28699,
1007,
1007,
1063,
1002,
28699,
1027,
9140,
1006,
1002,
28699,
1007,
1025,
1065,
18921,
6776,
1006,
1002,
28699,
2004,
1002,
11748,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/Diagnostics/Diagnostic/RequiredPhpSetting.php | RequiredPhpSetting.check | public function check()
{
$currentValue = (int) ini_get($this->setting);
$return = false;
foreach($this->requiredValues as $key => $requiredValue){
$this->requiredValues[$key]['isValid'] = version_compare($currentValue, $requiredValue['requiredValue'], $requiredValue['op... | php | public function check()
{
$currentValue = (int) ini_get($this->setting);
$return = false;
foreach($this->requiredValues as $key => $requiredValue){
$this->requiredValues[$key]['isValid'] = version_compare($currentValue, $requiredValue['requiredValue'], $requiredValue['op... | [
"public",
"function",
"check",
"(",
")",
"{",
"$",
"currentValue",
"=",
"(",
"int",
")",
"ini_get",
"(",
"$",
"this",
"->",
"setting",
")",
";",
"$",
"return",
"=",
"false",
";",
"foreach",
"(",
"$",
"this",
"->",
"requiredValues",
"as",
"$",
"key",
... | Checks required values against php.ini value.
@return bool | [
"Checks",
"required",
"values",
"against",
"php",
".",
"ini",
"value",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Diagnostics/Diagnostic/RequiredPhpSetting.php#L78-L92 | train | Check if required values are valid | [
30522,
2270,
3853,
4638,
1006,
1007,
1063,
1002,
2783,
10175,
5657,
1027,
1006,
20014,
1007,
1999,
2072,
1035,
2131,
1006,
1002,
2023,
1011,
1028,
4292,
1007,
1025,
1002,
2709,
1027,
6270,
1025,
18921,
6776,
1006,
1002,
2023,
1011,
1028,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php | HasAttributes.attributesToArray | public function attributesToArray()
{
// If an attribute is a date, we will cast it to a string after converting it
// to a DateTime / Carbon instance. This is so we will get some consistent
// formatting while accessing attributes vs. arraying / JSONing a model.
$attributes = $this-... | php | public function attributesToArray()
{
// If an attribute is a date, we will cast it to a string after converting it
// to a DateTime / Carbon instance. This is so we will get some consistent
// formatting while accessing attributes vs. arraying / JSONing a model.
$attributes = $this-... | [
"public",
"function",
"attributesToArray",
"(",
")",
"{",
"// If an attribute is a date, we will cast it to a string after converting it",
"// to a DateTime / Carbon instance. This is so we will get some consistent",
"// formatting while accessing attributes vs. arraying / JSONing a model.",
"$",
... | Convert the model's attributes to an array.
@return array | [
"Convert",
"the",
"model",
"s",
"attributes",
"to",
"an",
"array",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php#L87-L115 | train | Returns the attributes array | [
30522,
2270,
3853,
12332,
3406,
2906,
9447,
1006,
1007,
1063,
1013,
1013,
2065,
2019,
17961,
2003,
1037,
3058,
1010,
2057,
2097,
3459,
2009,
2000,
1037,
5164,
2044,
16401,
2009,
1013,
1013,
2000,
1037,
3058,
7292,
1013,
6351,
6013,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/Plugin/Report.php | Report.getMetricsRequiredForReport | public function getMetricsRequiredForReport($allMetrics = null, $restrictToColumns = null)
{
if (empty($allMetrics)) {
$allMetrics = $this->metrics;
}
if (empty($restrictToColumns)) {
$restrictToColumns = array_merge($allMetrics, array_keys($this->getProcessedMetrics... | php | public function getMetricsRequiredForReport($allMetrics = null, $restrictToColumns = null)
{
if (empty($allMetrics)) {
$allMetrics = $this->metrics;
}
if (empty($restrictToColumns)) {
$restrictToColumns = array_merge($allMetrics, array_keys($this->getProcessedMetrics... | [
"public",
"function",
"getMetricsRequiredForReport",
"(",
"$",
"allMetrics",
"=",
"null",
",",
"$",
"restrictToColumns",
"=",
"null",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"allMetrics",
")",
")",
"{",
"$",
"allMetrics",
"=",
"$",
"this",
"->",
"metrics",... | Returns the list of metrics required at minimum for a report factoring in the columns requested by
the report requester.
This will return all the metrics requested (or all the metrics in the report if nothing is requested)
**plus** the metrics required to calculate the requested processed metrics.
This method should ... | [
"Returns",
"the",
"list",
"of",
"metrics",
"required",
"at",
"minimum",
"for",
"a",
"report",
"factoring",
"in",
"the",
"columns",
"requested",
"by",
"the",
"report",
"requester",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Plugin/Report.php#L401-L424 | train | Returns the list of metrics required for a report | [
30522,
2270,
3853,
2131,
12589,
21338,
2063,
15549,
5596,
29278,
2890,
6442,
1006,
1002,
2035,
12589,
2015,
1027,
19701,
1010,
1002,
21573,
3406,
25778,
2819,
3619,
1027,
19701,
1007,
1063,
2065,
1006,
4064,
1006,
1002,
2035,
12589,
2015,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/DependencyInjection/Compiler/RemovePrivateAliasesPass.php | RemovePrivateAliasesPass.process | public function process(ContainerBuilder $container)
{
foreach ($container->getAliases() as $id => $alias) {
if ($alias->isPublic()) {
continue;
}
$container->removeAlias($id);
$container->log($this, sprintf('Removed service "%s"; reason: priv... | php | public function process(ContainerBuilder $container)
{
foreach ($container->getAliases() as $id => $alias) {
if ($alias->isPublic()) {
continue;
}
$container->removeAlias($id);
$container->log($this, sprintf('Removed service "%s"; reason: priv... | [
"public",
"function",
"process",
"(",
"ContainerBuilder",
"$",
"container",
")",
"{",
"foreach",
"(",
"$",
"container",
"->",
"getAliases",
"(",
")",
"as",
"$",
"id",
"=>",
"$",
"alias",
")",
"{",
"if",
"(",
"$",
"alias",
"->",
"isPublic",
"(",
")",
... | Removes private aliases from the ContainerBuilder. | [
"Removes",
"private",
"aliases",
"from",
"the",
"ContainerBuilder",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/DependencyInjection/Compiler/RemovePrivateAliasesPass.php#L28-L38 | train | Remove private aliases | [
30522,
2270,
3853,
2832,
1006,
11661,
8569,
23891,
2099,
1002,
11661,
1007,
1063,
18921,
6776,
1006,
1002,
11661,
1011,
1028,
2131,
22786,
8583,
1006,
1007,
2004,
1002,
8909,
1027,
1028,
1002,
14593,
1007,
1063,
2065,
1006,
1002,
14593,
101... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Console/Input/ArgvInput.php | ArgvInput.parseArgument | private function parseArgument($token)
{
$c = \count($this->arguments);
// if input is expecting another argument, add it
if ($this->definition->hasArgument($c)) {
$arg = $this->definition->getArgument($c);
$this->arguments[$arg->getName()] = $arg->isArray() ? [$toke... | php | private function parseArgument($token)
{
$c = \count($this->arguments);
// if input is expecting another argument, add it
if ($this->definition->hasArgument($c)) {
$arg = $this->definition->getArgument($c);
$this->arguments[$arg->getName()] = $arg->isArray() ? [$toke... | [
"private",
"function",
"parseArgument",
"(",
"$",
"token",
")",
"{",
"$",
"c",
"=",
"\\",
"count",
"(",
"$",
"this",
"->",
"arguments",
")",
";",
"// if input is expecting another argument, add it",
"if",
"(",
"$",
"this",
"->",
"definition",
"->",
"hasArgumen... | Parses an argument.
@param string $token The current token
@throws RuntimeException When too many arguments are given | [
"Parses",
"an",
"argument",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Input/ArgvInput.php#L165-L188 | train | Parse argument and add it to arguments array | [
30522,
2797,
3853,
11968,
17310,
10623,
27417,
2102,
1006,
1002,
19204,
1007,
1063,
1002,
1039,
1027,
1032,
4175,
1006,
1002,
2023,
1011,
1028,
9918,
1007,
1025,
1013,
1013,
2065,
7953,
2003,
8074,
2178,
6685,
1010,
5587,
2009,
2065,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Framework/Flex/Storage/FolderStorage.php | FolderStorage.getStoragePath | public function getStoragePath(string $key = null): string
{
if (null === $key) {
$path = $this->dataFolder;
} else {
$path = sprintf($this->dataPattern, $this->dataFolder, $key, substr($key, 0, 2));
}
return $path;
} | php | public function getStoragePath(string $key = null): string
{
if (null === $key) {
$path = $this->dataFolder;
} else {
$path = sprintf($this->dataPattern, $this->dataFolder, $key, substr($key, 0, 2));
}
return $path;
} | [
"public",
"function",
"getStoragePath",
"(",
"string",
"$",
"key",
"=",
"null",
")",
":",
"string",
"{",
"if",
"(",
"null",
"===",
"$",
"key",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"dataFolder",
";",
"}",
"else",
"{",
"$",
"path",
"=",
"... | {@inheritdoc}
@see FlexStorageInterface::getStoragePath() | [
"{"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Framework/Flex/Storage/FolderStorage.php#L214-L223 | train | Get the path to the data file | [
30522,
2270,
3853,
4152,
4263,
4270,
15069,
1006,
5164,
1002,
3145,
1027,
19701,
1007,
1024,
5164,
1063,
2065,
1006,
19701,
1027,
1027,
1027,
1002,
3145,
1007,
1063,
1002,
4130,
1027,
1002,
2023,
1011,
1028,
2951,
10371,
2121,
1025,
1065,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/Db/Schema/Mysql.php | Mysql.getTablesInstalled | public function getTablesInstalled($forceReload = true)
{
if (is_null($this->tablesInstalled)
|| $forceReload === true
) {
$db = $this->getDb();
$prefixTables = $this->getTablePrefixEscaped();
$allTables = $this->getAllExistingTables($prefixTables);
... | php | public function getTablesInstalled($forceReload = true)
{
if (is_null($this->tablesInstalled)
|| $forceReload === true
) {
$db = $this->getDb();
$prefixTables = $this->getTablePrefixEscaped();
$allTables = $this->getAllExistingTables($prefixTables);
... | [
"public",
"function",
"getTablesInstalled",
"(",
"$",
"forceReload",
"=",
"true",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"tablesInstalled",
")",
"||",
"$",
"forceReload",
"===",
"true",
")",
"{",
"$",
"db",
"=",
"$",
"this",
"->",
"get... | Get list of tables installed
@param bool $forceReload Invalidate cache
@return array installed Tables | [
"Get",
"list",
"of",
"tables",
"installed"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Db/Schema/Mysql.php#L382-L408 | train | Get all tables to be installed | [
30522,
2270,
3853,
2131,
10880,
11493,
9153,
11001,
1006,
1002,
2486,
16570,
10441,
2094,
1027,
2995,
1007,
1063,
2065,
1006,
2003,
1035,
19701,
1006,
1002,
2023,
1011,
1028,
7251,
7076,
9080,
3709,
1007,
1064,
1064,
1002,
2486,
16570,
1044... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Translation/DataCollector/TranslationDataCollector.php | TranslationDataCollector.lateCollect | public function lateCollect()
{
$messages = $this->sanitizeCollectedMessages($this->translator->getCollectedMessages());
$this->data = $this->computeCount($messages);
$this->data['messages'] = $messages;
$this->data['locale'] = $this->translator->getLocale();
$this->data['f... | php | public function lateCollect()
{
$messages = $this->sanitizeCollectedMessages($this->translator->getCollectedMessages());
$this->data = $this->computeCount($messages);
$this->data['messages'] = $messages;
$this->data['locale'] = $this->translator->getLocale();
$this->data['f... | [
"public",
"function",
"lateCollect",
"(",
")",
"{",
"$",
"messages",
"=",
"$",
"this",
"->",
"sanitizeCollectedMessages",
"(",
"$",
"this",
"->",
"translator",
"->",
"getCollectedMessages",
"(",
")",
")",
";",
"$",
"this",
"->",
"data",
"=",
"$",
"this",
... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Translation/DataCollector/TranslationDataCollector.php#L35-L46 | train | Late collect the messages and locale | [
30522,
2270,
3853,
2397,
26895,
22471,
1006,
1007,
1063,
1002,
7696,
1027,
1002,
2023,
1011,
1028,
2624,
25090,
4371,
26895,
22471,
2098,
7834,
3736,
8449,
1006,
1002,
2023,
1011,
1028,
11403,
1011,
1028,
2131,
26895,
22471,
2098,
7834,
373... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Config/ResourceCheckerConfigCacheFactory.php | ResourceCheckerConfigCacheFactory.cache | public function cache($file, $callback)
{
if (!\is_callable($callback)) {
throw new \InvalidArgumentException(sprintf('Invalid type for callback argument. Expected callable, but got "%s".', \gettype($callback)));
}
$cache = new ResourceCheckerConfigCache($file, $this->resourceCh... | php | public function cache($file, $callback)
{
if (!\is_callable($callback)) {
throw new \InvalidArgumentException(sprintf('Invalid type for callback argument. Expected callable, but got "%s".', \gettype($callback)));
}
$cache = new ResourceCheckerConfigCache($file, $this->resourceCh... | [
"public",
"function",
"cache",
"(",
"$",
"file",
",",
"$",
"callback",
")",
"{",
"if",
"(",
"!",
"\\",
"is_callable",
"(",
"$",
"callback",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'Invalid type for callback argu... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Config/ResourceCheckerConfigCacheFactory.php#L35-L47 | train | Cache a config file with resource checkers | [
30522,
2270,
3853,
17053,
1006,
1002,
5371,
1010,
1002,
2655,
5963,
1007,
1063,
2065,
1006,
999,
1032,
2003,
1035,
2655,
3085,
1006,
1002,
2655,
5963,
1007,
1007,
1063,
5466,
2047,
1032,
19528,
2906,
22850,
15781,
2595,
24422,
1006,
9043,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
dompdf/dompdf | src/Adapter/CPDF.php | CPDF.stream | public function stream($filename = "document.pdf", $options = array())
{
if (headers_sent()) {
die("Unable to stream pdf: headers already sent");
}
if (!isset($options["compress"])) $options["compress"] = true;
if (!isset($options["Attachment"])) $options["Attachment"] =... | php | public function stream($filename = "document.pdf", $options = array())
{
if (headers_sent()) {
die("Unable to stream pdf: headers already sent");
}
if (!isset($options["compress"])) $options["compress"] = true;
if (!isset($options["Attachment"])) $options["Attachment"] =... | [
"public",
"function",
"stream",
"(",
"$",
"filename",
"=",
"\"document.pdf\"",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"headers_sent",
"(",
")",
")",
"{",
"die",
"(",
"\"Unable to stream pdf: headers already sent\"",
")",
";",
"}",
... | Streams the PDF to the client.
@param string $filename The filename to present to the client.
@param array $options Associative array: 'compress' => 1 or 0 (default 1); 'Attachment' => 1 or 0 (default 1). | [
"Streams",
"the",
"PDF",
"to",
"the",
"client",
"."
] | 75f13c700009be21a1965dc2c5b68a8708c22ba2 | https://github.com/dompdf/dompdf/blob/75f13c700009be21a1965dc2c5b68a8708c22ba2/src/Adapter/CPDF.php#L1132-L1156 | train | Streams the pdf to the browser | [
30522,
2270,
3853,
5460,
1006,
1002,
5371,
18442,
1027,
1000,
6254,
1012,
11135,
1000,
1010,
1002,
7047,
1027,
9140,
1006,
1007,
30524,
20346,
2015,
1035,
2741,
1006,
1007,
1007,
1063,
3280,
1006,
1000,
4039,
2000,
5460,
11135,
1024,
20346,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/backend/classes/FormField.php | FormField.comment | public function comment($text, $position = 'below', $isHtml = null)
{
$this->comment = $text;
$this->commentPosition = $position;
if ($isHtml !== null) {
$this->commentHtml = $isHtml;
}
return $this;
} | php | public function comment($text, $position = 'below', $isHtml = null)
{
$this->comment = $text;
$this->commentPosition = $position;
if ($isHtml !== null) {
$this->commentHtml = $isHtml;
}
return $this;
} | [
"public",
"function",
"comment",
"(",
"$",
"text",
",",
"$",
"position",
"=",
"'below'",
",",
"$",
"isHtml",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"comment",
"=",
"$",
"text",
";",
"$",
"this",
"->",
"commentPosition",
"=",
"$",
"position",
";",
... | Adds a text comment above or below the field.
@param string $text Specifies a comment text.
@param string $position Specifies a comment position.
@param bool $isHtml Set to true if you use HTML formatting in the comment
Supported values are 'below' and 'above' | [
"Adds",
"a",
"text",
"comment",
"above",
"or",
"below",
"the",
"field",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/FormField.php#L350-L360 | train | Set Comment Text Position and HTML | [
30522,
2270,
3853,
7615,
1006,
1002,
3793,
1010,
1002,
2597,
1027,
1005,
2917,
1005,
1010,
1002,
2003,
11039,
19968,
1027,
19701,
1007,
1063,
1002,
2023,
1011,
1028,
7615,
1027,
1002,
3793,
1025,
1002,
2023,
1011,
1028,
7615,
26994,
1027,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/HttpClient/Response/CurlResponse.php | CurlResponse.parseHeaderLine | private static function parseHeaderLine($ch, string $data, array &$info, array &$headers, ?array $options, CurlClientState $multi, int $id, ?string &$location, ?callable $resolveRedirect, ?LoggerInterface $logger): int
{
if (!\in_array($waitFor = @curl_getinfo($ch, CURLINFO_PRIVATE), ['headers', 'destruct']... | php | private static function parseHeaderLine($ch, string $data, array &$info, array &$headers, ?array $options, CurlClientState $multi, int $id, ?string &$location, ?callable $resolveRedirect, ?LoggerInterface $logger): int
{
if (!\in_array($waitFor = @curl_getinfo($ch, CURLINFO_PRIVATE), ['headers', 'destruct']... | [
"private",
"static",
"function",
"parseHeaderLine",
"(",
"$",
"ch",
",",
"string",
"$",
"data",
",",
"array",
"&",
"$",
"info",
",",
"array",
"&",
"$",
"headers",
",",
"?",
"array",
"$",
"options",
",",
"CurlClientState",
"$",
"multi",
",",
"int",
"$",... | Parses header lines as curl yields them to us. | [
"Parses",
"header",
"lines",
"as",
"curl",
"yields",
"them",
"to",
"us",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpClient/Response/CurlResponse.php#L266-L328 | train | Parse header line | [
30522,
2797,
10763,
3853,
11968,
3366,
4974,
2121,
4179,
1006,
1002,
10381,
1010,
5164,
1002,
2951,
1010,
9140,
1004,
1002,
18558,
1010,
9140,
1004,
1002,
20346,
2015,
1010,
1029,
9140,
1002,
7047,
1010,
15390,
20464,
11638,
9153,
2618,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/cms/classes/Router.php | Router.findByUrl | public function findByUrl($url)
{
$this->url = $url;
$url = RouterHelper::normalizeUrl($url);
/**
* @event cms.router.beforeRoute
* Fires before the CMS Router handles a route
*
* Example usage:
*
* Event::listen('cms.router.beforeRo... | php | public function findByUrl($url)
{
$this->url = $url;
$url = RouterHelper::normalizeUrl($url);
/**
* @event cms.router.beforeRoute
* Fires before the CMS Router handles a route
*
* Example usage:
*
* Event::listen('cms.router.beforeRo... | [
"public",
"function",
"findByUrl",
"(",
"$",
"url",
")",
"{",
"$",
"this",
"->",
"url",
"=",
"$",
"url",
";",
"$",
"url",
"=",
"RouterHelper",
"::",
"normalizeUrl",
"(",
"$",
"url",
")",
";",
"/**\n * @event cms.router.beforeRoute\n * Fires befor... | Finds a page by its URL. Returns the page object and sets the $parameters property.
@param string $url The requested URL string.
@return \Cms\Classes\Page Returns \Cms\Classes\Page object or null if the page cannot be found. | [
"Finds",
"a",
"page",
"by",
"its",
"URL",
".",
"Returns",
"the",
"page",
"object",
"and",
"sets",
"the",
"$parameters",
"property",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/Router.php#L77-L161 | train | Find a page by URL | [
30522,
2270,
3853,
2424,
3762,
3126,
2140,
1006,
1002,
24471,
2140,
1007,
1063,
1002,
2023,
1011,
1028,
24471,
2140,
1027,
1002,
24471,
2140,
1025,
1002,
24471,
2140,
1027,
2799,
25032,
2884,
4842,
1024,
1024,
3671,
4697,
3126,
2140,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Auth/SessionGuard.php | SessionGuard.recaller | protected function recaller()
{
if (is_null($this->request)) {
return;
}
if ($recaller = $this->request->cookies->get($this->getRecallerName())) {
return new Recaller($recaller);
}
} | php | protected function recaller()
{
if (is_null($this->request)) {
return;
}
if ($recaller = $this->request->cookies->get($this->getRecallerName())) {
return new Recaller($recaller);
}
} | [
"protected",
"function",
"recaller",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"request",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"$",
"recaller",
"=",
"$",
"this",
"->",
"request",
"->",
"cookies",
"->",
"get",
"(",
"$",
... | Get the decrypted recaller cookie for the request.
@return \Illuminate\Auth\Recaller|null | [
"Get",
"the",
"decrypted",
"recaller",
"cookie",
"for",
"the",
"request",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Auth/SessionGuard.php#L180-L189 | train | Get the recaller object | [
30522,
5123,
3853,
9131,
2121,
1006,
1007,
1063,
2065,
1006,
2003,
1035,
19701,
1006,
1002,
2023,
1011,
1028,
5227,
1007,
1007,
1063,
2709,
1025,
1065,
2065,
1006,
1002,
9131,
2121,
1027,
1002,
2023,
1011,
1028,
5227,
1011,
1028,
16324,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/DataTable.php | DataTable.makeFromIndexedArray | public static function makeFromIndexedArray($array, $subtablePerLabel = null)
{
$table = new DataTable();
foreach ($array as $label => $row) {
$cleanRow = array();
// Support the case of an $array of single values
if (!is_array($row)) {
$row = arr... | php | public static function makeFromIndexedArray($array, $subtablePerLabel = null)
{
$table = new DataTable();
foreach ($array as $label => $row) {
$cleanRow = array();
// Support the case of an $array of single values
if (!is_array($row)) {
$row = arr... | [
"public",
"static",
"function",
"makeFromIndexedArray",
"(",
"$",
"array",
",",
"$",
"subtablePerLabel",
"=",
"null",
")",
"{",
"$",
"table",
"=",
"new",
"DataTable",
"(",
")",
";",
"foreach",
"(",
"$",
"array",
"as",
"$",
"label",
"=>",
"$",
"row",
")... | Rewrites the input `$array`
array (
LABEL => array(col1 => X, col2 => Y),
LABEL2 => array(col1 => X, col2 => Y),
)
to a DataTable with rows that look like:
array (
array( Row::COLUMNS => array('label' => LABEL, col1 => X, col2 => Y)),
array( Row::COLUMNS => array('label' => LABEL2, col1 => X, col2 => Y)),
)
Will al... | [
"Rewrites",
"the",
"input",
"$array"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable.php#L1560-L1579 | train | Makes a DataTable from an indexed array | [
30522,
2270,
10763,
3853,
2191,
19699,
20936,
13629,
19068,
2906,
9447,
1006,
1002,
9140,
1010,
1002,
4942,
10880,
4842,
20470,
2884,
1027,
19701,
1007,
1063,
1002,
2795,
1027,
2047,
2951,
10880,
1006,
1007,
1025,
18921,
6776,
1006,
1002,
9... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Bundle/WebProfilerBundle/EventListener/WebDebugToolbarListener.php | WebDebugToolbarListener.injectToolbar | protected function injectToolbar(Response $response, Request $request, array $nonces)
{
$content = $response->getContent();
$pos = strripos($content, '</body>');
if (false !== $pos) {
$toolbar = "\n".str_replace("\n", '', $this->twig->render(
'@WebProfiler/Profil... | php | protected function injectToolbar(Response $response, Request $request, array $nonces)
{
$content = $response->getContent();
$pos = strripos($content, '</body>');
if (false !== $pos) {
$toolbar = "\n".str_replace("\n", '', $this->twig->render(
'@WebProfiler/Profil... | [
"protected",
"function",
"injectToolbar",
"(",
"Response",
"$",
"response",
",",
"Request",
"$",
"request",
",",
"array",
"$",
"nonces",
")",
"{",
"$",
"content",
"=",
"$",
"response",
"->",
"getContent",
"(",
")",
";",
"$",
"pos",
"=",
"strripos",
"(",
... | Injects the web debug toolbar into the given Response. | [
"Injects",
"the",
"web",
"debug",
"toolbar",
"into",
"the",
"given",
"Response",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bundle/WebProfilerBundle/EventListener/WebDebugToolbarListener.php#L118-L137 | train | Injects the toolbar into the response | [
30522,
5123,
3853,
1999,
20614,
3406,
4747,
8237,
1006,
3433,
1002,
3433,
1010,
5227,
1002,
5227,
1010,
9140,
1002,
2512,
9623,
1007,
1063,
1002,
4180,
1027,
1002,
3433,
1011,
1028,
2131,
8663,
6528,
2102,
1006,
1007,
1025,
1002,
13433,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Bundle/SecurityBundle/EventListener/VoteListener.php | VoteListener.onVoterVote | public function onVoterVote(VoteEvent $event)
{
$this->traceableAccessDecisionManager->addVoterVote($event->getVoter(), $event->getAttributes(), $event->getVote());
} | php | public function onVoterVote(VoteEvent $event)
{
$this->traceableAccessDecisionManager->addVoterVote($event->getVoter(), $event->getAttributes(), $event->getVote());
} | [
"public",
"function",
"onVoterVote",
"(",
"VoteEvent",
"$",
"event",
")",
"{",
"$",
"this",
"->",
"traceableAccessDecisionManager",
"->",
"addVoterVote",
"(",
"$",
"event",
"->",
"getVoter",
"(",
")",
",",
"$",
"event",
"->",
"getAttributes",
"(",
")",
",",
... | Event dispatched by a voter during access manager decision.
@param VoteEvent $event event with voter data | [
"Event",
"dispatched",
"by",
"a",
"voter",
"during",
"access",
"manager",
"decision",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bundle/SecurityBundle/EventListener/VoteListener.php#L39-L42 | train | Add a vote to the traceableAccess decision manager | [
30522,
2270,
3853,
2006,
22994,
2121,
22994,
2063,
1006,
3789,
18697,
3372,
1002,
2724,
1007,
1063,
1002,
2023,
1011,
1028,
7637,
3085,
6305,
9623,
16150,
8586,
19969,
24805,
4590,
1011,
1028,
5587,
22994,
2121,
22994,
2063,
1006,
1002,
272... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Translation/Translator.php | Translator.sortReplacements | protected function sortReplacements(array $replace)
{
return (new Collection($replace))->sortBy(function ($value, $key) {
return mb_strlen($key) * -1;
})->all();
} | php | protected function sortReplacements(array $replace)
{
return (new Collection($replace))->sortBy(function ($value, $key) {
return mb_strlen($key) * -1;
})->all();
} | [
"protected",
"function",
"sortReplacements",
"(",
"array",
"$",
"replace",
")",
"{",
"return",
"(",
"new",
"Collection",
"(",
"$",
"replace",
")",
")",
"->",
"sortBy",
"(",
"function",
"(",
"$",
"value",
",",
"$",
"key",
")",
"{",
"return",
"mb_strlen",
... | Sort the replacements array.
@param array $replace
@return array | [
"Sort",
"the",
"replacements",
"array",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Translation/Translator.php#L283-L288 | train | Sort replacement array by length | [
30522,
5123,
3853,
4066,
2890,
24759,
10732,
8163,
1006,
9140,
1002,
5672,
1007,
1063,
2709,
1006,
2047,
3074,
1006,
1002,
5672,
1007,
1007,
1011,
1028,
4066,
3762,
1006,
3853,
1006,
1002,
3643,
1010,
1002,
3145,
1007,
1063,
2709,
16914,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
dompdf/dompdf | src/FrameReflower/Block.php | Block.calculate_auto_width | public function calculate_auto_width()
{
$width = 0;
foreach ($this->_frame->get_line_boxes() as $line) {
$line_width = 0;
foreach ($line->get_frames() as $frame) {
if ($frame->get_original_style()->width == 'auto') {
$line_width += $fram... | php | public function calculate_auto_width()
{
$width = 0;
foreach ($this->_frame->get_line_boxes() as $line) {
$line_width = 0;
foreach ($line->get_frames() as $frame) {
if ($frame->get_original_style()->width == 'auto') {
$line_width += $fram... | [
"public",
"function",
"calculate_auto_width",
"(",
")",
"{",
"$",
"width",
"=",
"0",
";",
"foreach",
"(",
"$",
"this",
"->",
"_frame",
"->",
"get_line_boxes",
"(",
")",
"as",
"$",
"line",
")",
"{",
"$",
"line_width",
"=",
"0",
";",
"foreach",
"(",
"$... | Determine current frame width based on contents
@return float | [
"Determine",
"current",
"frame",
"width",
"based",
"on",
"contents"
] | 75f13c700009be21a1965dc2c5b68a8708c22ba2 | https://github.com/dompdf/dompdf/blob/75f13c700009be21a1965dc2c5b68a8708c22ba2/src/FrameReflower/Block.php#L926-L947 | train | Calculates the auto width of the frame | [
30522,
2270,
3853,
18422,
1035,
8285,
1035,
9381,
1006,
30524,
9381,
1027,
1014,
1025,
18921,
6776,
1006,
1002,
2240,
1011,
1028,
2131,
1035,
11048,
1006,
1007,
2004,
1002,
4853,
1007,
1063,
2065,
1006,
1002,
4853,
1011,
1028,
2131,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Common/Assets/Traits/LegacyAssetsTrait.php | LegacyAssetsTrait.addDeferJs | public function addDeferJs($asset, $priority = 10, $pipeline = true, $group = 'head')
{
user_error(__CLASS__ . '::' . __FUNCTION__ . '() is deprecated since Grav 1.6, use dynamic method with [\'loading\' => \'defer\']', E_USER_DEPRECATED);
return $this->addJs($asset, $priority, $pipeline, 'defer', ... | php | public function addDeferJs($asset, $priority = 10, $pipeline = true, $group = 'head')
{
user_error(__CLASS__ . '::' . __FUNCTION__ . '() is deprecated since Grav 1.6, use dynamic method with [\'loading\' => \'defer\']', E_USER_DEPRECATED);
return $this->addJs($asset, $priority, $pipeline, 'defer', ... | [
"public",
"function",
"addDeferJs",
"(",
"$",
"asset",
",",
"$",
"priority",
"=",
"10",
",",
"$",
"pipeline",
"=",
"true",
",",
"$",
"group",
"=",
"'head'",
")",
"{",
"user_error",
"(",
"__CLASS__",
".",
"'::'",
".",
"__FUNCTION__",
".",
"'() is deprecat... | Convenience wrapper for deferred loading of JavaScript
@param string|array $asset
@param int $priority
@param bool $pipeline
@param string $group name of the group
@return \Grav\Common\Assets
@deprecated Please use dynamic method with ['loading' => 'defer']. | [
"Convenience",
"wrapper",
"for",
"deferred",
"loading",
"of",
"JavaScript"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Assets/Traits/LegacyAssetsTrait.php#L118-L123 | train | Adds a JavaScript file to the page with deferred loading | [
30522,
2270,
3853,
5587,
3207,
7512,
22578,
1006,
1002,
11412,
1010,
1002,
9470,
1027,
2184,
1010,
1002,
13117,
1027,
2995,
1010,
1002,
2177,
1027,
1005,
2132,
1005,
1007,
1063,
5310,
1035,
7561,
1006,
1035,
1035,
2465,
1035,
1035,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/Zend/Registry.php | Zend_Registry.get | public static function get($index)
{
$instance = self::getInstance();
if (!$instance->offsetExists($index)) {
// require_once 'Zend/Exception.php';
// debug_print_backtrace();
throw new Zend_Exception("No entry is registered for key '$index'" );
}
... | php | public static function get($index)
{
$instance = self::getInstance();
if (!$instance->offsetExists($index)) {
// require_once 'Zend/Exception.php';
// debug_print_backtrace();
throw new Zend_Exception("No entry is registered for key '$index'" );
}
... | [
"public",
"static",
"function",
"get",
"(",
"$",
"index",
")",
"{",
"$",
"instance",
"=",
"self",
"::",
"getInstance",
"(",
")",
";",
"if",
"(",
"!",
"$",
"instance",
"->",
"offsetExists",
"(",
"$",
"index",
")",
")",
"{",
"// require_once 'Zend/Exceptio... | getter method, basically same as offsetGet().
This method can be called from an object of type Zend_Registry, or it
can be called statically. In the latter case, it uses the default
static instance stored in the class.
@param string $index - get the value associated with $index
@return mixed
@throws Zend_Exception i... | [
"getter",
"method",
"basically",
"same",
"as",
"offsetGet",
"()",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Registry.php#L141-L152 | train | Get an entry from the registry | [
30522,
2270,
10763,
3853,
2131,
1006,
1002,
5950,
1007,
1063,
1002,
6013,
1027,
2969,
1024,
1024,
2131,
7076,
26897,
1006,
1007,
1025,
2065,
1006,
999,
1002,
6013,
1011,
1028,
16396,
10288,
5130,
1006,
1002,
5950,
1007,
1007,
1063,
1013,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/MobileMessaging/Controller.php | Controller.index | public function index()
{
Piwik::checkUserIsNotAnonymous();
$view = new View('@MobileMessaging/index');
$this->setManageVariables($view);
return $view->render();
} | php | public function index()
{
Piwik::checkUserIsNotAnonymous();
$view = new View('@MobileMessaging/index');
$this->setManageVariables($view);
return $view->render();
} | [
"public",
"function",
"index",
"(",
")",
"{",
"Piwik",
"::",
"checkUserIsNotAnonymous",
"(",
")",
";",
"$",
"view",
"=",
"new",
"View",
"(",
"'@MobileMessaging/index'",
")",
";",
"$",
"this",
"->",
"setManageVariables",
"(",
"$",
"view",
")",
";",
"return"... | Mobile Messaging Settings tab :
- set delegated management
- provide & validate SMS API credential
- add & activate phone numbers
- check remaining credits | [
"Mobile",
"Messaging",
"Settings",
"tab",
":",
"-",
"set",
"delegated",
"management",
"-",
"provide",
"&",
"validate",
"SMS",
"API",
"credential",
"-",
"add",
"&",
"activate",
"phone",
"numbers",
"-",
"check",
"remaining",
"credits"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/MobileMessaging/Controller.php#L51-L59 | train | Returns the HTML code of the MobileMessaging index page. | [
30522,
2270,
3853,
5950,
1006,
1007,
1063,
14255,
9148,
2243,
1024,
1024,
4638,
20330,
2483,
17048,
6761,
4890,
27711,
1006,
1007,
1025,
1002,
3193,
1027,
2047,
3193,
1006,
1005,
1030,
4684,
7834,
3736,
4726,
1013,
5950,
1005,
1007,
1025,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
PHPMailer/PHPMailer | src/PHPMailer.php | PHPMailer.createBody | public function createBody()
{
$body = '';
//Create unique IDs and preset boundaries
$this->uniqueid = $this->generateId();
$this->boundary[1] = 'b1_' . $this->uniqueid;
$this->boundary[2] = 'b2_' . $this->uniqueid;
$this->boundary[3] = 'b3_' . $this->uniqueid;
... | php | public function createBody()
{
$body = '';
//Create unique IDs and preset boundaries
$this->uniqueid = $this->generateId();
$this->boundary[1] = 'b1_' . $this->uniqueid;
$this->boundary[2] = 'b2_' . $this->uniqueid;
$this->boundary[3] = 'b3_' . $this->uniqueid;
... | [
"public",
"function",
"createBody",
"(",
")",
"{",
"$",
"body",
"=",
"''",
";",
"//Create unique IDs and preset boundaries",
"$",
"this",
"->",
"uniqueid",
"=",
"$",
"this",
"->",
"generateId",
"(",
")",
";",
"$",
"this",
"->",
"boundary",
"[",
"1",
"]",
... | Assemble the message body.
Returns an empty string on failure.
@throws Exception
@return string The assembled message body | [
"Assemble",
"the",
"message",
"body",
".",
"Returns",
"an",
"empty",
"string",
"on",
"failure",
"."
] | 3d7132341659a8a201adbc3ba11b1e202ee2857c | https://github.com/PHPMailer/PHPMailer/blob/3d7132341659a8a201adbc3ba11b1e202ee2857c/src/PHPMailer.php#L2509-L2720 | train | Create the body part of the message | [
30522,
2270,
3853,
3443,
23684,
1006,
1007,
1063,
1002,
2303,
1027,
1005,
1005,
1025,
1013,
1013,
3443,
4310,
8909,
2015,
1998,
3653,
13462,
7372,
1002,
2023,
1011,
1028,
4310,
3593,
1027,
1002,
2023,
1011,
1028,
9699,
3593,
1006,
1007,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
overtrue/wechat | src/Kernel/Log/LogManager.php | LogManager.resolve | protected function resolve($name)
{
$config = $this->app['config']->get(\sprintf('log.channels.%s', $name));
if (is_null($config)) {
throw new \InvalidArgumentException(\sprintf('Log [%s] is not defined.', $name));
}
if (isset($this->customCreators[$config['driver']])) ... | php | protected function resolve($name)
{
$config = $this->app['config']->get(\sprintf('log.channels.%s', $name));
if (is_null($config)) {
throw new \InvalidArgumentException(\sprintf('Log [%s] is not defined.', $name));
}
if (isset($this->customCreators[$config['driver']])) ... | [
"protected",
"function",
"resolve",
"(",
"$",
"name",
")",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"app",
"[",
"'config'",
"]",
"->",
"get",
"(",
"\\",
"sprintf",
"(",
"'log.channels.%s'",
",",
"$",
"name",
")",
")",
";",
"if",
"(",
"is_null",
... | Resolve the given log instance by name.
@param string $name
@return \Psr\Log\LoggerInterface
@throws \InvalidArgumentException | [
"Resolve",
"the",
"given",
"log",
"instance",
"by",
"name",
"."
] | 120c72faaa93c270365bc75c73c362d5fd583209 | https://github.com/overtrue/wechat/blob/120c72faaa93c270365bc75c73c362d5fd583209/src/Kernel/Log/LogManager.php#L145-L164 | train | Resolves the log channel | [
30522,
5123,
3853,
10663,
1006,
1002,
2171,
1007,
1063,
1002,
9530,
8873,
2290,
1027,
1002,
2023,
1011,
1028,
10439,
1031,
1005,
9530,
8873,
2290,
1005,
1033,
1011,
1028,
2131,
1006,
1032,
9043,
2546,
1006,
1005,
8833,
1012,
6833,
1012,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/backend/formwidgets/RecordFinder.php | RecordFinder.prepareVars | public function prepareVars()
{
$this->relationModel = $this->getLoadValue();
if ($this->formField->disabled) {
$this->previewMode = true;
}
$this->vars['value'] = $this->getKeyValue();
$this->vars['field'] = $this->formField;
$this->vars['nameValue'] = ... | php | public function prepareVars()
{
$this->relationModel = $this->getLoadValue();
if ($this->formField->disabled) {
$this->previewMode = true;
}
$this->vars['value'] = $this->getKeyValue();
$this->vars['field'] = $this->formField;
$this->vars['nameValue'] = ... | [
"public",
"function",
"prepareVars",
"(",
")",
"{",
"$",
"this",
"->",
"relationModel",
"=",
"$",
"this",
"->",
"getLoadValue",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"formField",
"->",
"disabled",
")",
"{",
"$",
"this",
"->",
"previewMode",
"=",... | Prepares the list data | [
"Prepares",
"the",
"list",
"data"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/formwidgets/RecordFinder.php#L208-L224 | train | Prepares the form field variables | [
30522,
2270,
3853,
7374,
10755,
2015,
1006,
1007,
1063,
1002,
2023,
1011,
1028,
7189,
5302,
9247,
1027,
1002,
2023,
1011,
1028,
2131,
11066,
10175,
5657,
1006,
1007,
1025,
2065,
1006,
1002,
2023,
1011,
1028,
2433,
3790,
1011,
1028,
9776,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/TwoFactorAuth/Controller.php | Controller.setupTwoFactorAuth | public function setupTwoFactorAuth($standalone = false)
{
$this->validator->checkCanUseTwoFa();
if ($standalone) {
$view = new View('@TwoFactorAuth/setupTwoFactorAuthStandalone');
$this->setBasicVariablesView($view);
$view->submitAction = 'onLoginSetupTwoFactorAu... | php | public function setupTwoFactorAuth($standalone = false)
{
$this->validator->checkCanUseTwoFa();
if ($standalone) {
$view = new View('@TwoFactorAuth/setupTwoFactorAuthStandalone');
$this->setBasicVariablesView($view);
$view->submitAction = 'onLoginSetupTwoFactorAu... | [
"public",
"function",
"setupTwoFactorAuth",
"(",
"$",
"standalone",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"validator",
"->",
"checkCanUseTwoFa",
"(",
")",
";",
"if",
"(",
"$",
"standalone",
")",
"{",
"$",
"view",
"=",
"new",
"View",
"(",
"'@TwoFacto... | Action to setup two factor authentication
@return string
@throws \Exception | [
"Action",
"to",
"setup",
"two",
"factor",
"authentication"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/TwoFactorAuth/Controller.php#L165-L254 | train | Setup TwoFactorAuth. | [
30522,
2270,
3853,
16437,
2102,
12155,
7011,
16761,
4887,
2705,
1006,
1002,
26609,
1027,
6270,
1007,
1063,
1002,
2023,
1011,
1028,
9398,
8844,
1011,
1028,
4638,
9336,
8557,
2102,
12155,
7011,
1006,
1007,
1025,
2065,
1006,
1002,
26609,
1007,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/Menu/MenuAdmin.php | MenuAdmin.getMenu | public function getMenu()
{
if (!$this->menu) {
foreach ($this->getAllMenus() as $menu) {
$menu->configureAdminMenu($this);
}
}
return parent::getMenu();
} | php | public function getMenu()
{
if (!$this->menu) {
foreach ($this->getAllMenus() as $menu) {
$menu->configureAdminMenu($this);
}
}
return parent::getMenu();
} | [
"public",
"function",
"getMenu",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"menu",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getAllMenus",
"(",
")",
"as",
"$",
"menu",
")",
"{",
"$",
"menu",
"->",
"configureAdminMenu",
"(",
"$",
"this",... | Triggers the Menu.MenuAdmin.addItems hook and returns the admin menu.
@return Array | [
"Triggers",
"the",
"Menu",
".",
"MenuAdmin",
".",
"addItems",
"hook",
"and",
"returns",
"the",
"admin",
"menu",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Menu/MenuAdmin.php#L114-L124 | train | Get Admin Menu | [
30522,
2270,
3853,
2131,
3549,
2226,
1006,
1007,
1063,
2065,
1006,
999,
1002,
2023,
1011,
1028,
12183,
1007,
1063,
18921,
6776,
1006,
1002,
2023,
1011,
1028,
2131,
8095,
3549,
2271,
1006,
1007,
2004,
1002,
12183,
1007,
1063,
1002,
12183,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Container/Container.php | Container.build | public function build($concrete)
{
// If the concrete type is actually a Closure, we will just execute it and
// hand back the results of the functions, which allows functions to be
// used as resolvers for more fine-tuned resolution of these objects.
if ($concrete instanceof Closure... | php | public function build($concrete)
{
// If the concrete type is actually a Closure, we will just execute it and
// hand back the results of the functions, which allows functions to be
// used as resolvers for more fine-tuned resolution of these objects.
if ($concrete instanceof Closure... | [
"public",
"function",
"build",
"(",
"$",
"concrete",
")",
"{",
"// If the concrete type is actually a Closure, we will just execute it and",
"// hand back the results of the functions, which allows functions to be",
"// used as resolvers for more fine-tuned resolution of these objects.",
"if",... | Instantiate a concrete instance of the given type.
@param string $concrete
@return mixed
@throws \Illuminate\Contracts\Container\BindingResolutionException | [
"Instantiate",
"a",
"concrete",
"instance",
"of",
"the",
"given",
"type",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Container/Container.php#L781-L824 | train | Builds the object of the given type. | [
30522,
2270,
3853,
3857,
1006,
1002,
5509,
1007,
1063,
1013,
1013,
2065,
1996,
5509,
2828,
2003,
2941,
1037,
8503,
1010,
2057,
2097,
2074,
15389,
2009,
1998,
1013,
1013,
2192,
2067,
1996,
3463,
1997,
1996,
4972,
1010,
2029,
4473,
4972,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/backend/behaviors/ListController.php | ListController.listGetConfig | public function listGetConfig($definition = null)
{
if (!$definition) {
$definition = $this->primaryDefinition;
}
if (!$config = array_get($this->listConfig, $definition)) {
$config = $this->listConfig[$definition] = $this->makeConfig($this->listDefinitions[$definiti... | php | public function listGetConfig($definition = null)
{
if (!$definition) {
$definition = $this->primaryDefinition;
}
if (!$config = array_get($this->listConfig, $definition)) {
$config = $this->listConfig[$definition] = $this->makeConfig($this->listDefinitions[$definiti... | [
"public",
"function",
"listGetConfig",
"(",
"$",
"definition",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"definition",
")",
"{",
"$",
"definition",
"=",
"$",
"this",
"->",
"primaryDefinition",
";",
"}",
"if",
"(",
"!",
"$",
"config",
"=",
"array_get"... | Returns the configuration used by this behavior.
@return \Backend\Classes\WidgetBase | [
"Returns",
"the",
"configuration",
"used",
"by",
"this",
"behavior",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/behaviors/ListController.php#L434-L445 | train | Get config from list definition | [
30522,
2270,
3853,
2862,
18150,
8663,
8873,
2290,
1006,
1002,
6210,
1027,
19701,
1007,
1063,
2065,
1006,
999,
1002,
6210,
1007,
1063,
1002,
6210,
1027,
1002,
2023,
1011,
1028,
3078,
3207,
16294,
22753,
1025,
1065,
2065,
1006,
999,
1002,
9... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/PrivacyManager/PrivacyManager.php | PrivacyManager.shouldPurgeData | private function shouldPurgeData($settings, $lastRanOption, $setting)
{
// Log deletion may not run until it is once rescheduled (initial run). This is the
// only way to guarantee the calculated next scheduled deletion time.
$initialDelete = Option::get(self::OPTION_LAST_DELETE_PIWIK_LOGS_I... | php | private function shouldPurgeData($settings, $lastRanOption, $setting)
{
// Log deletion may not run until it is once rescheduled (initial run). This is the
// only way to guarantee the calculated next scheduled deletion time.
$initialDelete = Option::get(self::OPTION_LAST_DELETE_PIWIK_LOGS_I... | [
"private",
"function",
"shouldPurgeData",
"(",
"$",
"settings",
",",
"$",
"lastRanOption",
",",
"$",
"setting",
")",
"{",
"// Log deletion may not run until it is once rescheduled (initial run). This is the",
"// only way to guarantee the calculated next scheduled deletion time.",
"$... | Returns true if one of the purge data tasks should run now, false if it shouldn't. | [
"Returns",
"true",
"if",
"one",
"of",
"the",
"purge",
"data",
"tasks",
"should",
"run",
"now",
"false",
"if",
"it",
"shouldn",
"t",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/PrivacyManager/PrivacyManager.php#L565-L589 | train | Check if data should be purged | [
30522,
2797,
3853,
2323,
5311,
5999,
6790,
1006,
1002,
10906,
1010,
1002,
2197,
20770,
16790,
1010,
1002,
4292,
1007,
1063,
1013,
1013,
8833,
3972,
20624,
2239,
2089,
2025,
2448,
2127,
2009,
2003,
2320,
24501,
7690,
18696,
1006,
3988,
2448,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Foundation/Console/AppNameCommand.php | AppNameCommand.handle | public function handle()
{
$this->currentRoot = trim($this->laravel->getNamespace(), '\\');
$this->setAppDirectoryNamespace();
$this->setBootstrapNamespaces();
$this->setConfigNamespaces();
$this->setComposerNamespace();
$this->setDatabaseFactoryNamespaces();
... | php | public function handle()
{
$this->currentRoot = trim($this->laravel->getNamespace(), '\\');
$this->setAppDirectoryNamespace();
$this->setBootstrapNamespaces();
$this->setConfigNamespaces();
$this->setComposerNamespace();
$this->setDatabaseFactoryNamespaces();
... | [
"public",
"function",
"handle",
"(",
")",
"{",
"$",
"this",
"->",
"currentRoot",
"=",
"trim",
"(",
"$",
"this",
"->",
"laravel",
"->",
"getNamespace",
"(",
")",
",",
"'\\\\'",
")",
";",
"$",
"this",
"->",
"setAppDirectoryNamespace",
"(",
")",
";",
"$",... | Execute the console command.
@return void | [
"Execute",
"the",
"console",
"command",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Foundation/Console/AppNameCommand.php#L68-L83 | train | Set the application namespace | [
30522,
2270,
3853,
5047,
1006,
1007,
1063,
1002,
2023,
1011,
1028,
2783,
3217,
4140,
1027,
12241,
1006,
1002,
2023,
1011,
1028,
13679,
15985,
1011,
1028,
2131,
18442,
23058,
1006,
1007,
1010,
1005,
1032,
1032,
1005,
1007,
1025,
1002,
2023,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/Metrics/Formatter.php | Formatter.getPrettyTimeFromSeconds | public function getPrettyTimeFromSeconds($numberOfSeconds, $displayTimeAsSentence = false, $round = false)
{
$numberOfSeconds = $round ? (int)$numberOfSeconds : (float)$numberOfSeconds;
$isNegative = false;
if ($numberOfSeconds < 0) {
$numberOfSeconds = -1 * $numberOfSeconds;
... | php | public function getPrettyTimeFromSeconds($numberOfSeconds, $displayTimeAsSentence = false, $round = false)
{
$numberOfSeconds = $round ? (int)$numberOfSeconds : (float)$numberOfSeconds;
$isNegative = false;
if ($numberOfSeconds < 0) {
$numberOfSeconds = -1 * $numberOfSeconds;
... | [
"public",
"function",
"getPrettyTimeFromSeconds",
"(",
"$",
"numberOfSeconds",
",",
"$",
"displayTimeAsSentence",
"=",
"false",
",",
"$",
"round",
"=",
"false",
")",
"{",
"$",
"numberOfSeconds",
"=",
"$",
"round",
"?",
"(",
"int",
")",
"$",
"numberOfSeconds",
... | Returns a prettified time value (in seconds).
@param int $numberOfSeconds The number of seconds.
@param bool $displayTimeAsSentence If set to true, will output `"5min 17s"`, if false `"00:05:17"`.
@param bool $round Whether to round to the nearest second or not.
@return string
@api | [
"Returns",
"a",
"prettified",
"time",
"value",
"(",
"in",
"seconds",
")",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Metrics/Formatter.php#L63-L126 | train | Returns a human readable time string from seconds | [
30522,
2270,
3853,
2131,
28139,
15353,
7292,
19699,
22225,
8586,
15422,
30524,
1063,
1002,
2193,
11253,
3366,
8663,
5104,
1027,
1002,
2461,
1029,
1006,
20014,
1007,
1002,
2193,
11253,
3366,
8663,
5104,
1024,
1006,
14257,
1007,
1002,
2193,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/Plugin/Manager.php | Manager.findComponents | public function findComponents($componentName, $expectedSubclass)
{
$plugins = $this->getPluginsLoadedAndActivated();
$components = array();
foreach ($plugins as $plugin) {
$component = $plugin->findComponent($componentName, $expectedSubclass);
if (!empty($compon... | php | public function findComponents($componentName, $expectedSubclass)
{
$plugins = $this->getPluginsLoadedAndActivated();
$components = array();
foreach ($plugins as $plugin) {
$component = $plugin->findComponent($componentName, $expectedSubclass);
if (!empty($compon... | [
"public",
"function",
"findComponents",
"(",
"$",
"componentName",
",",
"$",
"expectedSubclass",
")",
"{",
"$",
"plugins",
"=",
"$",
"this",
"->",
"getPluginsLoadedAndActivated",
"(",
")",
";",
"$",
"components",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
... | Tries to find the given components such as a Menu or Tasks implemented by plugins.
This method won't cache the found components. If you need to find the same component multiple times you might
want to cache the result to save a tiny bit of time.
@param string $componentName The name of the component you want to lo... | [
"Tries",
"to",
"find",
"the",
"given",
"components",
"such",
"as",
"a",
"Menu",
"or",
"Tasks",
"implemented",
"by",
"plugins",
".",
"This",
"method",
"won",
"t",
"cache",
"the",
"found",
"components",
".",
"If",
"you",
"need",
"to",
"find",
"the",
"same"... | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Plugin/Manager.php#L520-L534 | train | Find all components that match the given component name and expected subclass | [
30522,
2270,
3853,
2424,
9006,
29513,
7666,
1006,
1002,
6922,
18442,
1010,
1002,
3517,
6342,
9818,
27102,
1007,
1063,
1002,
13354,
7076,
1027,
1002,
2023,
1011,
1028,
2131,
24759,
15916,
7076,
17468,
13832,
6593,
21967,
1006,
1007,
1025,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Console/Gpm/InstallCommand.php | InstallCommand.processGpm | private function processGpm($package, $is_update = false)
{
$version = isset($package->available) ? $package->available : $package->version;
$license = Licenses::get($package->slug);
$this->output->writeln("Preparing to install <cyan>{$package->name}</cyan> [v{$version}]");
$this->... | php | private function processGpm($package, $is_update = false)
{
$version = isset($package->available) ? $package->available : $package->version;
$license = Licenses::get($package->slug);
$this->output->writeln("Preparing to install <cyan>{$package->name}</cyan> [v{$version}]");
$this->... | [
"private",
"function",
"processGpm",
"(",
"$",
"package",
",",
"$",
"is_update",
"=",
"false",
")",
"{",
"$",
"version",
"=",
"isset",
"(",
"$",
"package",
"->",
"available",
")",
"?",
"$",
"package",
"->",
"available",
":",
"$",
"package",
"->",
"vers... | @param Package $package
@param bool $is_update
@return bool | [
"@param",
"Package",
"$package",
"@param",
"bool",
"$is_update"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Console/Gpm/InstallCommand.php#L512-L550 | train | Process GPM package | [
30522,
2797,
3853,
2832,
21600,
2213,
1006,
1002,
7427,
1010,
1002,
2003,
1035,
10651,
1027,
6270,
1007,
1063,
1002,
2544,
1027,
26354,
3388,
1006,
1002,
7427,
1011,
1028,
2800,
1007,
1029,
1002,
7427,
1011,
1028,
2800,
1024,
1002,
7427,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/HTML/QuickForm2/Factory.php | HTML_QuickForm2_Factory.createElement | public static function createElement($type, $name = null, $attributes = null,
array $data = array())
{
$type = strtolower($type);
if (!isset(self::$elementTypes[$type])) {
throw new HTML_QuickForm2_InvalidArgumentException("Element type '$type' is... | php | public static function createElement($type, $name = null, $attributes = null,
array $data = array())
{
$type = strtolower($type);
if (!isset(self::$elementTypes[$type])) {
throw new HTML_QuickForm2_InvalidArgumentException("Element type '$type' is... | [
"public",
"static",
"function",
"createElement",
"(",
"$",
"type",
",",
"$",
"name",
"=",
"null",
",",
"$",
"attributes",
"=",
"null",
",",
"array",
"$",
"data",
"=",
"array",
"(",
")",
")",
"{",
"$",
"type",
"=",
"strtolower",
"(",
"$",
"type",
")... | Creates a new element object of the given type
@param string Type name (treated case-insensitively)
@param mixed Element name (passed to element's constructor)
@param mixed Element attributes (passed to element's constructor)
@param array Element-specific data (passed to element's constructor)
@retu... | [
"Creates",
"a",
"new",
"element",
"object",
"of",
"the",
"given",
"type"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Factory.php#L161-L173 | train | Creates an element of the given type | [
30522,
2270,
10763,
3853,
3443,
12260,
3672,
1006,
1002,
2828,
1010,
1002,
2171,
1027,
19701,
1010,
1002,
12332,
1027,
19701,
1010,
9140,
1002,
2951,
1027,
9140,
1006,
1007,
1007,
1063,
1002,
2828,
1027,
2358,
5339,
12898,
13777,
1006,
1002... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Cache/CacheManager.php | CacheManager.createDynamodbDriver | protected function createDynamodbDriver(array $config)
{
$dynamoConfig = [
'region' => $config['region'],
'version' => 'latest',
];
if ($config['key'] && $config['secret']) {
$dynamoConfig['credentials'] = Arr::only(
$config, ['key', 'secr... | php | protected function createDynamodbDriver(array $config)
{
$dynamoConfig = [
'region' => $config['region'],
'version' => 'latest',
];
if ($config['key'] && $config['secret']) {
$dynamoConfig['credentials'] = Arr::only(
$config, ['key', 'secr... | [
"protected",
"function",
"createDynamodbDriver",
"(",
"array",
"$",
"config",
")",
"{",
"$",
"dynamoConfig",
"=",
"[",
"'region'",
"=>",
"$",
"config",
"[",
"'region'",
"]",
",",
"'version'",
"=>",
"'latest'",
",",
"]",
";",
"if",
"(",
"$",
"config",
"["... | Create an instance of the DynamoDB cache driver.
@param array $config
@return \Illuminate\Cache\Repository | [
"Create",
"an",
"instance",
"of",
"the",
"DynamoDB",
"cache",
"driver",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Cache/CacheManager.php#L227-L250 | train | Create a Dynamodb driver | [
30522,
5123,
3853,
2580,
18279,
5302,
18939,
23663,
2099,
1006,
9140,
1002,
9530,
8873,
2290,
1007,
1063,
1002,
17205,
8663,
8873,
2290,
1027,
1031,
1005,
2555,
1005,
1027,
1028,
1002,
9530,
8873,
2290,
1031,
1005,
2555,
1005,
1033,
1010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Database/Eloquent/Relations/MorphToMany.php | MorphToMany.baseAttachRecord | protected function baseAttachRecord($id, $timed)
{
return Arr::add(
parent::baseAttachRecord($id, $timed), $this->morphType, $this->morphClass
);
} | php | protected function baseAttachRecord($id, $timed)
{
return Arr::add(
parent::baseAttachRecord($id, $timed), $this->morphType, $this->morphClass
);
} | [
"protected",
"function",
"baseAttachRecord",
"(",
"$",
"id",
",",
"$",
"timed",
")",
"{",
"return",
"Arr",
"::",
"add",
"(",
"parent",
"::",
"baseAttachRecord",
"(",
"$",
"id",
",",
"$",
"timed",
")",
",",
"$",
"this",
"->",
"morphType",
",",
"$",
"t... | Create a new pivot attachment record.
@param int $id
@param bool $timed
@return array | [
"Create",
"a",
"new",
"pivot",
"attachment",
"record",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Relations/MorphToMany.php#L96-L101 | train | Base attach record | [
30522,
5123,
3853,
2918,
19321,
6776,
2890,
27108,
2094,
1006,
1002,
8909,
1010,
1002,
22313,
1007,
1063,
2709,
12098,
2099,
1024,
1024,
5587,
1006,
6687,
1024,
1024,
2918,
19321,
6776,
2890,
27108,
2094,
1006,
1002,
8909,
1010,
1002,
22313... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/SitesManager/API.php | API.getSitesWithAtLeastViewAccess | public function getSitesWithAtLeastViewAccess($limit = false, $_restrictSitesToLogin = false)
{
$sitesId = $this->getSitesIdWithAtLeastViewAccess($_restrictSitesToLogin);
return $this->getSitesFromIds($sitesId, $limit);
} | php | public function getSitesWithAtLeastViewAccess($limit = false, $_restrictSitesToLogin = false)
{
$sitesId = $this->getSitesIdWithAtLeastViewAccess($_restrictSitesToLogin);
return $this->getSitesFromIds($sitesId, $limit);
} | [
"public",
"function",
"getSitesWithAtLeastViewAccess",
"(",
"$",
"limit",
"=",
"false",
",",
"$",
"_restrictSitesToLogin",
"=",
"false",
")",
"{",
"$",
"sitesId",
"=",
"$",
"this",
"->",
"getSitesIdWithAtLeastViewAccess",
"(",
"$",
"_restrictSitesToLogin",
")",
";... | Returns the list of websites with the 'view' or 'admin' access for the current user.
For the superUser it returns all the websites in the database.
@param bool|int $limit Specify max number of sites to return
@param bool $_restrictSitesToLogin Hack necessary when running scheduled tasks, where "Super User" is forced, ... | [
"Returns",
"the",
"list",
"of",
"websites",
"with",
"the",
"view",
"or",
"admin",
"access",
"for",
"the",
"current",
"user",
".",
"For",
"the",
"superUser",
"it",
"returns",
"all",
"the",
"websites",
"in",
"the",
"database",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SitesManager/API.php#L390-L394 | train | Get all the sites with view access for the current user. | [
30522,
2270,
3853,
4152,
7616,
24415,
4017,
19738,
3367,
8584,
6305,
9623,
2015,
1006,
1002,
5787,
1027,
6270,
1010,
1002,
1035,
21573,
28032,
4355,
12898,
11528,
1027,
6270,
1007,
1063,
1002,
4573,
3593,
1027,
1002,
2023,
1011,
1028,
4152,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/SegmentEditor/Services/StoredSegmentService.php | StoredSegmentService.getAllSegmentsAndIgnoreVisibility | public function getAllSegmentsAndIgnoreVisibility()
{
$cacheKey = 'SegmentEditor.getAllSegmentsAndIgnoreVisibility';
if (!$this->transientCache->contains($cacheKey)) {
$result = $this->model->getAllSegmentsAndIgnoreVisibility();
$this->transientCache->save($cacheKey, $result... | php | public function getAllSegmentsAndIgnoreVisibility()
{
$cacheKey = 'SegmentEditor.getAllSegmentsAndIgnoreVisibility';
if (!$this->transientCache->contains($cacheKey)) {
$result = $this->model->getAllSegmentsAndIgnoreVisibility();
$this->transientCache->save($cacheKey, $result... | [
"public",
"function",
"getAllSegmentsAndIgnoreVisibility",
"(",
")",
"{",
"$",
"cacheKey",
"=",
"'SegmentEditor.getAllSegmentsAndIgnoreVisibility'",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"transientCache",
"->",
"contains",
"(",
"$",
"cacheKey",
")",
")",
"{",
"$... | Returns all stored segments that haven't been deleted.
@return array | [
"Returns",
"all",
"stored",
"segments",
"that",
"haven",
"t",
"been",
"deleted",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SegmentEditor/Services/StoredSegmentService.php#L41-L50 | train | Get All Segments And Ignore Visibility | [
30522,
2270,
3853,
2131,
8095,
3366,
21693,
11187,
5685,
23773,
5686,
11365,
13464,
1006,
1007,
1063,
1002,
17053,
14839,
1027,
1005,
6903,
2098,
15660,
1012,
2131,
8095,
3366,
21693,
11187,
5685,
23773,
5686,
11365,
13464,
1005,
1025,
2065,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/API/Request.php | Request.getRawSegmentFromRequest | public static function getRawSegmentFromRequest()
{
// we need the URL encoded segment parameter, we fetch it from _SERVER['QUERY_STRING'] instead of default URL decoded _GET
$segmentRaw = false;
$segment = Common::getRequestVar('segment', '', 'string');
if (!empty($segment)) {
... | php | public static function getRawSegmentFromRequest()
{
// we need the URL encoded segment parameter, we fetch it from _SERVER['QUERY_STRING'] instead of default URL decoded _GET
$segmentRaw = false;
$segment = Common::getRequestVar('segment', '', 'string');
if (!empty($segment)) {
... | [
"public",
"static",
"function",
"getRawSegmentFromRequest",
"(",
")",
"{",
"// we need the URL encoded segment parameter, we fetch it from _SERVER['QUERY_STRING'] instead of default URL decoded _GET",
"$",
"segmentRaw",
"=",
"false",
";",
"$",
"segment",
"=",
"Common",
"::",
"get... | Returns the segment query parameter from the original request, without modifications.
@return array|bool | [
"Returns",
"the",
"segment",
"query",
"parameter",
"from",
"the",
"original",
"request",
"without",
"modifications",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/API/Request.php#L591-L603 | train | Returns the raw segment parameter from the request | [
30522,
2270,
10763,
3853,
2131,
2527,
9333,
13910,
3672,
19699,
5358,
2890,
15500,
1006,
1007,
1063,
1013,
1013,
2057,
2342,
1996,
24471,
2140,
12359,
6903,
16381,
1010,
2057,
18584,
2009,
2013,
1035,
8241,
1031,
1005,
23032,
1035,
5164,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Common/Page/Page.php | Page.cachePageContent | public function cachePageContent()
{
$cache = Grav::instance()['cache'];
$cache_id = md5('page' . $this->id());
$cache->save($cache_id, ['content' => $this->content, 'content_meta' => $this->content_meta]);
} | php | public function cachePageContent()
{
$cache = Grav::instance()['cache'];
$cache_id = md5('page' . $this->id());
$cache->save($cache_id, ['content' => $this->content, 'content_meta' => $this->content_meta]);
} | [
"public",
"function",
"cachePageContent",
"(",
")",
"{",
"$",
"cache",
"=",
"Grav",
"::",
"instance",
"(",
")",
"[",
"'cache'",
"]",
";",
"$",
"cache_id",
"=",
"md5",
"(",
"'page'",
".",
"$",
"this",
"->",
"id",
"(",
")",
")",
";",
"$",
"cache",
... | Fires the onPageContentProcessed event, and caches the page content using a unique ID for the page | [
"Fires",
"the",
"onPageContentProcessed",
"event",
"and",
"caches",
"the",
"page",
"content",
"using",
"a",
"unique",
"ID",
"for",
"the",
"page"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Page/Page.php#L857-L862 | train | Cache page content | [
30522,
2270,
3853,
17053,
13704,
8663,
6528,
2102,
1006,
1007,
1063,
1002,
17053,
1027,
24665,
11431,
1024,
1024,
6013,
1006,
1007,
1031,
1005,
17053,
1005,
1033,
1025,
1002,
17053,
1035,
8909,
1027,
9108,
2629,
1006,
1005,
3931,
1005,
1012... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Security/Http/ParameterBagUtils.php | ParameterBagUtils.getRequestParameterValue | public static function getRequestParameterValue(Request $request, $path)
{
if (false === $pos = strpos($path, '[')) {
return $request->get($path);
}
$root = substr($path, 0, $pos);
if (null === $value = $request->get($root)) {
return;
}
if (... | php | public static function getRequestParameterValue(Request $request, $path)
{
if (false === $pos = strpos($path, '[')) {
return $request->get($path);
}
$root = substr($path, 0, $pos);
if (null === $value = $request->get($root)) {
return;
}
if (... | [
"public",
"static",
"function",
"getRequestParameterValue",
"(",
"Request",
"$",
"request",
",",
"$",
"path",
")",
"{",
"if",
"(",
"false",
"===",
"$",
"pos",
"=",
"strpos",
"(",
"$",
"path",
",",
"'['",
")",
")",
"{",
"return",
"$",
"request",
"->",
... | Returns a request "parameter" value.
Paths like foo[bar] will be evaluated to find deeper items in nested data structures.
@param Request $request The request
@param string $path The key
@return mixed
@throws InvalidArgumentException when the given path is malformed | [
"Returns",
"a",
"request",
"parameter",
"value",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Security/Http/ParameterBagUtils.php#L74-L95 | train | Get request parameter value | [
30522,
2270,
10763,
3853,
2131,
2890,
15500,
28689,
22828,
10175,
5657,
1006,
5227,
1002,
5227,
1010,
1002,
4130,
1007,
1063,
2065,
1006,
6270,
1027,
1027,
1027,
1002,
13433,
2015,
1027,
2358,
14536,
2891,
1006,
1002,
4130,
1010,
1005,
1031... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/Goals/Goals.php | Goals.getReportMetadataEnd | public function getReportMetadataEnd(&$reports, $info)
{
// Processed in AddColumnsProcessedMetricsGoal
// These metrics will also be available for some reports, for each goal
// Example: Conversion rate for Goal 2 for the keyword 'piwik'
$goalProcessedMetrics = array(
'r... | php | public function getReportMetadataEnd(&$reports, $info)
{
// Processed in AddColumnsProcessedMetricsGoal
// These metrics will also be available for some reports, for each goal
// Example: Conversion rate for Goal 2 for the keyword 'piwik'
$goalProcessedMetrics = array(
'r... | [
"public",
"function",
"getReportMetadataEnd",
"(",
"&",
"$",
"reports",
",",
"$",
"info",
")",
"{",
"// Processed in AddColumnsProcessedMetricsGoal",
"// These metrics will also be available for some reports, for each goal",
"// Example: Conversion rate for Goal 2 for the keyword 'piwik'... | Returns the Metadata for the Goals plugin API.
The API returns general Goal metrics: conv, conv rate and revenue globally
and for each goal.
Also, this will update metadata of all other reports that have Goal segmentation | [
"Returns",
"the",
"Metadata",
"for",
"the",
"Goals",
"plugin",
"API",
".",
"The",
"API",
"returns",
"general",
"Goal",
"metrics",
":",
"conv",
"conv",
"rate",
"and",
"revenue",
"globally",
"and",
"for",
"each",
"goal",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Goals/Goals.php#L244-L274 | train | This method is called when the report metadata end is called. | [
30522,
2270,
3853,
2131,
2890,
6442,
11368,
8447,
2696,
10497,
1006,
1004,
1002,
4311,
1010,
1002,
18558,
1007,
1063,
1013,
1013,
13995,
1999,
5587,
25778,
2819,
3619,
21572,
9623,
6924,
12589,
28745,
10441,
2140,
1013,
1013,
2122,
12046,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Form/NativeRequestHandler.php | NativeRequestHandler.handleRequest | public function handleRequest(FormInterface $form, $request = null)
{
if (null !== $request) {
throw new UnexpectedTypeException($request, 'null');
}
$name = $form->getName();
$method = $form->getConfig()->getMethod();
if ($method !== self::getRequestMethod()) {... | php | public function handleRequest(FormInterface $form, $request = null)
{
if (null !== $request) {
throw new UnexpectedTypeException($request, 'null');
}
$name = $form->getName();
$method = $form->getConfig()->getMethod();
if ($method !== self::getRequestMethod()) {... | [
"public",
"function",
"handleRequest",
"(",
"FormInterface",
"$",
"form",
",",
"$",
"request",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"request",
")",
"{",
"throw",
"new",
"UnexpectedTypeException",
"(",
"$",
"request",
",",
"'null'",
")",
... | {@inheritdoc}
@throws Exception\UnexpectedTypeException If the $request is not null | [
"{",
"@inheritdoc",
"}"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/NativeRequestHandler.php#L47-L125 | train | This method is called by the FormValidator to handle the request. | [
30522,
2270,
3853,
28213,
2063,
15500,
1006,
2433,
18447,
2121,
12172,
1002,
2433,
1010,
1002,
5227,
1027,
19701,
1007,
1063,
2065,
1006,
19701,
999,
1027,
1027,
1002,
5227,
1007,
1063,
5466,
2047,
9223,
13874,
10288,
24422,
1006,
1002,
522... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php | XmlFileLoader.getServiceDefaults | private function getServiceDefaults(\DOMDocument $xml, $file)
{
$xpath = new \DOMXPath($xml);
$xpath->registerNamespace('container', self::NS);
if (null === $defaultsNode = $xpath->query('//container:services/container:defaults')->item(0)) {
return [];
}
$bindin... | php | private function getServiceDefaults(\DOMDocument $xml, $file)
{
$xpath = new \DOMXPath($xml);
$xpath->registerNamespace('container', self::NS);
if (null === $defaultsNode = $xpath->query('//container:services/container:defaults')->item(0)) {
return [];
}
$bindin... | [
"private",
"function",
"getServiceDefaults",
"(",
"\\",
"DOMDocument",
"$",
"xml",
",",
"$",
"file",
")",
"{",
"$",
"xpath",
"=",
"new",
"\\",
"DOMXPath",
"(",
"$",
"xml",
")",
";",
"$",
"xpath",
"->",
"registerNamespace",
"(",
"'container'",
",",
"self"... | Get service defaults.
@return array | [
"Get",
"service",
"defaults",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php#L170-L206 | train | Get service defaults | [
30522,
2797,
3853,
4152,
2121,
7903,
14728,
7011,
11314,
2015,
1006,
1032,
14383,
3527,
24894,
4765,
1002,
20950,
1010,
1002,
5371,
1007,
1063,
1002,
26726,
8988,
1027,
2047,
1032,
14383,
2595,
15069,
1006,
1002,
20950,
1007,
1025,
1002,
26... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Cache/DynamoDbStore.php | DynamoDbStore.putMany | public function putMany(array $values, $seconds)
{
$expiration = $this->toTimestamp($seconds);
$this->dynamo->batchWriteItem([
'RequestItems' => [
$this->table => collect($values)->map(function ($value, $key) use ($expiration) {
return [
... | php | public function putMany(array $values, $seconds)
{
$expiration = $this->toTimestamp($seconds);
$this->dynamo->batchWriteItem([
'RequestItems' => [
$this->table => collect($values)->map(function ($value, $key) use ($expiration) {
return [
... | [
"public",
"function",
"putMany",
"(",
"array",
"$",
"values",
",",
"$",
"seconds",
")",
"{",
"$",
"expiration",
"=",
"$",
"this",
"->",
"toTimestamp",
"(",
"$",
"seconds",
")",
";",
"$",
"this",
"->",
"dynamo",
"->",
"batchWriteItem",
"(",
"[",
"'Reque... | Store multiple items in the cache for a given number of $seconds.
@param array $values
@param int $seconds
@return bool | [
"Store",
"multiple",
"items",
"in",
"the",
"cache",
"for",
"a",
"given",
"number",
"of",
"$seconds",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Cache/DynamoDbStore.php#L219-L246 | train | Put many items into the cache | [
30522,
2270,
3853,
2404,
2386,
2100,
1006,
9140,
1002,
5300,
1010,
1002,
3823,
1007,
1063,
1002,
4654,
16781,
1027,
1002,
2023,
1011,
1028,
2000,
7292,
9153,
8737,
1006,
1002,
3823,
1007,
1025,
1002,
2023,
1011,
1028,
17205,
1011,
1028,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Routing/Route.php | Route.setOption | public function setOption($name, $value)
{
$this->options[$name] = $value;
$this->compiled = null;
return $this;
} | php | public function setOption($name, $value)
{
$this->options[$name] = $value;
$this->compiled = null;
return $this;
} | [
"public",
"function",
"setOption",
"(",
"$",
"name",
",",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"options",
"[",
"$",
"name",
"]",
"=",
"$",
"value",
";",
"$",
"this",
"->",
"compiled",
"=",
"null",
";",
"return",
"$",
"this",
";",
"}"
] | Sets an option value.
This method implements a fluent interface.
@param string $name An option name
@param mixed $value The option value
@return $this | [
"Sets",
"an",
"option",
"value",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Routing/Route.php#L310-L316 | train | Set an option value | [
30522,
2270,
3853,
2275,
7361,
3508,
1006,
1002,
2171,
1010,
1002,
3643,
1007,
1063,
1002,
2023,
1011,
1028,
7047,
1031,
1002,
2171,
1033,
1027,
1002,
3643,
1025,
1002,
2023,
1011,
1028,
9227,
1027,
19701,
1025,
2709,
1002,
2023,
1025,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/View/Compilers/BladeCompiler.php | BladeCompiler.callCustomDirective | protected function callCustomDirective($name, $value)
{
if (Str::startsWith($value, '(') && Str::endsWith($value, ')')) {
$value = Str::substr($value, 1, -1);
}
return call_user_func($this->customDirectives[$name], trim($value));
} | php | protected function callCustomDirective($name, $value)
{
if (Str::startsWith($value, '(') && Str::endsWith($value, ')')) {
$value = Str::substr($value, 1, -1);
}
return call_user_func($this->customDirectives[$name], trim($value));
} | [
"protected",
"function",
"callCustomDirective",
"(",
"$",
"name",
",",
"$",
"value",
")",
"{",
"if",
"(",
"Str",
"::",
"startsWith",
"(",
"$",
"value",
",",
"'('",
")",
"&&",
"Str",
"::",
"endsWith",
"(",
"$",
"value",
",",
"')'",
")",
")",
"{",
"$... | Call the given directive with the given value.
@param string $name
@param string|null $value
@return string | [
"Call",
"the",
"given",
"directive",
"with",
"the",
"given",
"value",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/View/Compilers/BladeCompiler.php#L376-L383 | train | Call the custom directive | [
30522,
5123,
3853,
2655,
7874,
20389,
4305,
2890,
15277,
1006,
1002,
2171,
1010,
1002,
3643,
1007,
1063,
2065,
1006,
2358,
2099,
1024,
1024,
4627,
24415,
1006,
1002,
3643,
1010,
1005,
1006,
1005,
1007,
1004,
1004,
2358,
2099,
1024,
1024,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Console/Style/SymfonyStyle.php | SymfonyStyle.choice | public function choice($question, array $choices, $default = null)
{
if (null !== $default) {
$values = array_flip($choices);
$default = $values[$default];
}
return $this->askQuestion(new ChoiceQuestion($question, $choices, $default));
} | php | public function choice($question, array $choices, $default = null)
{
if (null !== $default) {
$values = array_flip($choices);
$default = $values[$default];
}
return $this->askQuestion(new ChoiceQuestion($question, $choices, $default));
} | [
"public",
"function",
"choice",
"(",
"$",
"question",
",",
"array",
"$",
"choices",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"default",
")",
"{",
"$",
"values",
"=",
"array_flip",
"(",
"$",
"choices",
")",
";",
"$"... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Style/SymfonyStyle.php#L228-L236 | train | Ask the user for a choice | [
30522,
2270,
3853,
3601,
1006,
1002,
3160,
1010,
9140,
1002,
9804,
1010,
1002,
12398,
1027,
19701,
1007,
1063,
2065,
1006,
19701,
999,
1027,
1027,
1002,
12398,
1007,
1063,
1002,
5300,
1027,
9140,
1035,
11238,
1006,
1002,
9804,
1007,
1025,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Templating/Loader/FilesystemLoader.php | FilesystemLoader.load | public function load(TemplateReferenceInterface $template)
{
try {
$file = $this->locator->locate($template);
} catch (\InvalidArgumentException $e) {
return false;
}
return new FileStorage($file);
} | php | public function load(TemplateReferenceInterface $template)
{
try {
$file = $this->locator->locate($template);
} catch (\InvalidArgumentException $e) {
return false;
}
return new FileStorage($file);
} | [
"public",
"function",
"load",
"(",
"TemplateReferenceInterface",
"$",
"template",
")",
"{",
"try",
"{",
"$",
"file",
"=",
"$",
"this",
"->",
"locator",
"->",
"locate",
"(",
"$",
"template",
")",
";",
"}",
"catch",
"(",
"\\",
"InvalidArgumentException",
"$"... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bundle/FrameworkBundle/Templating/Loader/FilesystemLoader.php#L40-L49 | train | Load a template file | [
30522,
2270,
3853,
7170,
1006,
23561,
2890,
25523,
18447,
2121,
12172,
1002,
23561,
1007,
1063,
3046,
1063,
1002,
5371,
1027,
1002,
2023,
1011,
1028,
8840,
11266,
2953,
1011,
1028,
12453,
1006,
1002,
23561,
1007,
1025,
1065,
4608,
1006,
103... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Common/Assets/Traits/AssetUtilsTrait.php | AssetUtilsTrait.renderQueryString | protected function renderQueryString($asset = null)
{
$querystring = '';
$asset = $asset ?? $this->asset;
if (!empty($this->query)) {
if (Utils::contains($asset, '?')) {
$querystring .= '&' . $this->query;
} else {
$querystring .= '?... | php | protected function renderQueryString($asset = null)
{
$querystring = '';
$asset = $asset ?? $this->asset;
if (!empty($this->query)) {
if (Utils::contains($asset, '?')) {
$querystring .= '&' . $this->query;
} else {
$querystring .= '?... | [
"protected",
"function",
"renderQueryString",
"(",
"$",
"asset",
"=",
"null",
")",
"{",
"$",
"querystring",
"=",
"''",
";",
"$",
"asset",
"=",
"$",
"asset",
"??",
"$",
"this",
"->",
"asset",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"qu... | Render Querystring
@param string $asset
@return string | [
"Render",
"Querystring"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Assets/Traits/AssetUtilsTrait.php#L158-L181 | train | Render Query String | [
30522,
5123,
3853,
17552,
4226,
24769,
18886,
3070,
1006,
1002,
11412,
1027,
19701,
1007,
1063,
1002,
23032,
3367,
4892,
1027,
1005,
1005,
1025,
1002,
11412,
1027,
1002,
11412,
1029,
1029,
1002,
2023,
1011,
1028,
11412,
1025,
2065,
1006,
99... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Foundation/Application.php | Application.booted | public function booted($callback)
{
$this->bootedCallbacks[] = $callback;
if ($this->isBooted()) {
$this->fireAppCallbacks([$callback]);
}
} | php | public function booted($callback)
{
$this->bootedCallbacks[] = $callback;
if ($this->isBooted()) {
$this->fireAppCallbacks([$callback]);
}
} | [
"public",
"function",
"booted",
"(",
"$",
"callback",
")",
"{",
"$",
"this",
"->",
"bootedCallbacks",
"[",
"]",
"=",
"$",
"callback",
";",
"if",
"(",
"$",
"this",
"->",
"isBooted",
"(",
")",
")",
"{",
"$",
"this",
"->",
"fireAppCallbacks",
"(",
"[",
... | Register a new "booted" listener.
@param callable $callback
@return void | [
"Register",
"a",
"new",
"booted",
"listener",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Foundation/Application.php#L838-L845 | train | Booted callback function | [
30522,
2270,
3853,
9573,
2098,
1006,
1002,
2655,
5963,
1007,
1063,
1002,
2023,
1011,
1028,
9573,
2098,
9289,
20850,
8684,
2015,
1031,
1033,
1027,
1002,
2655,
5963,
1025,
2065,
1006,
1002,
2023,
1011,
1028,
2003,
27927,
2098,
1006,
1007,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Serializer/Serializer.php | Serializer.normalize | public function normalize($data, $format = null, array $context = [])
{
// If a normalizer supports the given data, use it
if ($normalizer = $this->getNormalizer($data, $format, $context)) {
return $normalizer->normalize($data, $format, $context);
}
if (null === $data ||... | php | public function normalize($data, $format = null, array $context = [])
{
// If a normalizer supports the given data, use it
if ($normalizer = $this->getNormalizer($data, $format, $context)) {
return $normalizer->normalize($data, $format, $context);
}
if (null === $data ||... | [
"public",
"function",
"normalize",
"(",
"$",
"data",
",",
"$",
"format",
"=",
"null",
",",
"array",
"$",
"context",
"=",
"[",
"]",
")",
"{",
"// If a normalizer supports the given data, use it",
"if",
"(",
"$",
"normalizer",
"=",
"$",
"this",
"->",
"getNorma... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Serializer/Serializer.php#L148-L177 | train | Normalize the given data | [
30522,
2270,
3853,
3671,
4697,
1006,
1002,
2951,
1010,
1002,
4289,
1027,
19701,
1010,
9140,
1002,
6123,
1027,
1031,
1033,
1007,
1063,
1013,
1013,
2065,
1037,
3671,
17629,
6753,
1996,
2445,
2951,
1010,
2224,
2009,
2065,
1006,
1002,
3671,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Common/Page/Medium/Medium.php | Medium.url | public function url($reset = true)
{
$output = preg_replace('|^' . preg_quote(GRAV_ROOT, '|') . '|', '', $this->get('filepath'));
$locator = Grav::instance()['locator'];
if ($locator->isStream($output)) {
$output = $locator->findResource($output, false);
}
if ($... | php | public function url($reset = true)
{
$output = preg_replace('|^' . preg_quote(GRAV_ROOT, '|') . '|', '', $this->get('filepath'));
$locator = Grav::instance()['locator'];
if ($locator->isStream($output)) {
$output = $locator->findResource($output, false);
}
if ($... | [
"public",
"function",
"url",
"(",
"$",
"reset",
"=",
"true",
")",
"{",
"$",
"output",
"=",
"preg_replace",
"(",
"'|^'",
".",
"preg_quote",
"(",
"GRAV_ROOT",
",",
"'|'",
")",
".",
"'|'",
",",
"''",
",",
"$",
"this",
"->",
"get",
"(",
"'filepath'",
"... | Return URL to file.
@param bool $reset
@return string | [
"Return",
"URL",
"to",
"file",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Page/Medium/Medium.php#L265-L279 | train | Return the URL of the file | [
30522,
2270,
3853,
24471,
2140,
1006,
1002,
25141,
1027,
2995,
1007,
1063,
1002,
6434,
1027,
3653,
2290,
1035,
5672,
1006,
1005,
1064,
1034,
1005,
1012,
3653,
2290,
1035,
14686,
1006,
24665,
11431,
1035,
7117,
1010,
1005,
1064,
1005,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/HTML/QuickForm2/Renderer.php | HTML_QuickForm2_Renderer.getOption | public function getOption($name = null)
{
if (null === $name) {
return $this->options;
} elseif (!array_key_exists($name, $this->options)) {
throw new HTML_QuickForm2_NotFoundException(
"Unknown option '{$name}'"
);
}
return $this->... | php | public function getOption($name = null)
{
if (null === $name) {
return $this->options;
} elseif (!array_key_exists($name, $this->options)) {
throw new HTML_QuickForm2_NotFoundException(
"Unknown option '{$name}'"
);
}
return $this->... | [
"public",
"function",
"getOption",
"(",
"$",
"name",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"name",
")",
"{",
"return",
"$",
"this",
"->",
"options",
";",
"}",
"elseif",
"(",
"!",
"array_key_exists",
"(",
"$",
"name",
",",
"$",
"this... | Returns the value(s) of the renderer option(s)
@param string parameter name
@return mixed value of $name parameter, array of all configuration
parameters if $name is not given
@throws HTML_QuickForm2_NotFoundException in case of unknown option | [
"Returns",
"the",
"value",
"(",
"s",
")",
"of",
"the",
"renderer",
"option",
"(",
"s",
")"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Renderer.php#L268-L278 | train | Get option value | [
30522,
2270,
3853,
2131,
7361,
3508,
1006,
1002,
2171,
1027,
19701,
1007,
1063,
2065,
1006,
19701,
1027,
1027,
1027,
1002,
2171,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
7047,
1025,
1065,
2842,
10128,
1006,
999,
9140,
1035,
3145,
1035,
6... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Database/Eloquent/Relations/Concerns/InteractsWithPivotTable.php | InteractsWithPivotTable.baseAttachRecord | protected function baseAttachRecord($id, $timed)
{
$record[$this->relatedPivotKey] = $id;
$record[$this->foreignPivotKey] = $this->parent->{$this->parentKey};
// If the record needs to have creation and update timestamps, we will make
// them by calling the parent model's "freshTim... | php | protected function baseAttachRecord($id, $timed)
{
$record[$this->relatedPivotKey] = $id;
$record[$this->foreignPivotKey] = $this->parent->{$this->parentKey};
// If the record needs to have creation and update timestamps, we will make
// them by calling the parent model's "freshTim... | [
"protected",
"function",
"baseAttachRecord",
"(",
"$",
"id",
",",
"$",
"timed",
")",
"{",
"$",
"record",
"[",
"$",
"this",
"->",
"relatedPivotKey",
"]",
"=",
"$",
"id",
";",
"$",
"record",
"[",
"$",
"this",
"->",
"foreignPivotKey",
"]",
"=",
"$",
"th... | Create a new pivot attachment record.
@param int $id
@param bool $timed
@return array | [
"Create",
"a",
"new",
"pivot",
"attachment",
"record",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Relations/Concerns/InteractsWithPivotTable.php#L338-L356 | train | baseAttachRecord - base implementation of baseAttachRecord | [
30522,
5123,
3853,
2918,
19321,
6776,
2890,
27108,
2094,
1006,
1002,
8909,
1010,
1002,
22313,
1007,
1063,
1002,
2501,
1031,
1002,
2023,
1011,
1028,
3141,
8197,
22994,
14839,
1033,
1027,
1002,
8909,
1025,
1002,
2501,
1031,
1002,
2023,
1011,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/Period/Month.php | Month.processOptimalSubperiods | protected function processOptimalSubperiods($startDate, $endDate)
{
while ($startDate->isEarlier($endDate)
|| $startDate == $endDate
) {
$week = new Week($startDate);
$startOfWeek = $week->getDateStart();
$endOfWeek = $week->getDateEnd();
... | php | protected function processOptimalSubperiods($startDate, $endDate)
{
while ($startDate->isEarlier($endDate)
|| $startDate == $endDate
) {
$week = new Week($startDate);
$startOfWeek = $week->getDateStart();
$endOfWeek = $week->getDateEnd();
... | [
"protected",
"function",
"processOptimalSubperiods",
"(",
"$",
"startDate",
",",
"$",
"endDate",
")",
"{",
"while",
"(",
"$",
"startDate",
"->",
"isEarlier",
"(",
"$",
"endDate",
")",
"||",
"$",
"startDate",
"==",
"$",
"endDate",
")",
"{",
"$",
"week",
"... | Determine which kind of period is best to use.
See Range.test.php
@param Date $startDate
@param Date $endDate | [
"Determine",
"which",
"kind",
"of",
"period",
"is",
"best",
"to",
"use",
".",
"See",
"Range",
".",
"test",
".",
"php"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Period/Month.php#L83-L102 | train | Process Optimal Subperiods | [
30522,
5123,
3853,
2832,
7361,
3775,
9067,
6342,
2497,
4842,
3695,
5104,
1006,
1002,
2707,
13701,
1010,
1002,
2203,
13701,
1007,
1063,
2096,
1006,
1002,
2707,
13701,
1011,
1028,
2003,
14644,
14355,
1006,
1002,
2203,
13701,
1007,
1064,
1064,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Common/GPM/GPM.php | GPM.getInstallable | public function getInstallable($list_type_installed = ['plugins' => true, 'themes' => true])
{
$items = ['total' => 0];
foreach ($list_type_installed as $type => $type_installed) {
if ($type_installed === false) {
continue;
}
$methodInstallableType... | php | public function getInstallable($list_type_installed = ['plugins' => true, 'themes' => true])
{
$items = ['total' => 0];
foreach ($list_type_installed as $type => $type_installed) {
if ($type_installed === false) {
continue;
}
$methodInstallableType... | [
"public",
"function",
"getInstallable",
"(",
"$",
"list_type_installed",
"=",
"[",
"'plugins'",
"=>",
"true",
",",
"'themes'",
"=>",
"true",
"]",
")",
"{",
"$",
"items",
"=",
"[",
"'total'",
"=>",
"0",
"]",
";",
"foreach",
"(",
"$",
"list_type_installed",
... | Returns the Locally installable packages
@param array $list_type_installed
@return array The installed packages | [
"Returns",
"the",
"Locally",
"installable",
"packages"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/GPM/GPM.php#L83-L96 | train | Get Installable Types | [
30522,
2270,
3853,
2131,
7076,
9080,
20470,
2571,
1006,
1002,
2862,
1035,
2828,
1035,
5361,
1027,
1031,
1005,
13354,
7076,
1005,
1027,
1028,
2995,
1010,
1005,
6991,
1005,
1027,
1028,
2995,
1033,
1007,
1063,
1002,
5167,
1027,
1031,
1005,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
walkor/Workerman | Protocols/Ws.php | Ws.sendHandshake | public static function sendHandshake($connection)
{
if (!empty($connection->handshakeStep)) {
return;
}
// Get Host.
$port = $connection->getRemotePort();
$host = $port === 80 ? $connection->getRemoteHost() : $connection->getRemoteHost() . ':' . $port;
// ... | php | public static function sendHandshake($connection)
{
if (!empty($connection->handshakeStep)) {
return;
}
// Get Host.
$port = $connection->getRemotePort();
$host = $port === 80 ? $connection->getRemoteHost() : $connection->getRemoteHost() . ':' . $port;
// ... | [
"public",
"static",
"function",
"sendHandshake",
"(",
"$",
"connection",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"connection",
"->",
"handshakeStep",
")",
")",
"{",
"return",
";",
"}",
"// Get Host.",
"$",
"port",
"=",
"$",
"connection",
"->",
"getR... | Send websocket handshake.
@param \Workerman\Connection\TcpConnection $connection
@return void | [
"Send",
"websocket",
"handshake",
"."
] | 13649907f05014fcfffcfccaef01e63ad3339351 | https://github.com/walkor/Workerman/blob/13649907f05014fcfffcfccaef01e63ad3339351/Protocols/Ws.php#L359-L395 | train | Send WebSocket handshake | [
30522,
2270,
10763,
3853,
4604,
11774,
7377,
3489,
1006,
1002,
4434,
1007,
1063,
2065,
1006,
999,
4064,
1006,
1002,
4434,
1011,
1028,
2398,
20459,
4355,
13699,
1007,
1007,
1063,
2709,
1025,
1065,
1013,
1013,
2131,
3677,
1012,
1002,
3417,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
z-song/laravel-admin | src/Grid/Filter.php | Filter.urlWithoutFilters | public function urlWithoutFilters()
{
/** @var Collection $columns */
$columns = collect($this->filters)->map->getColumn()->flatten();
$pageKey = 'page';
if ($gridName = $this->model->getGrid()->getName()) {
$pageKey = "{$gridName}_{$pageKey}";
}
$colum... | php | public function urlWithoutFilters()
{
/** @var Collection $columns */
$columns = collect($this->filters)->map->getColumn()->flatten();
$pageKey = 'page';
if ($gridName = $this->model->getGrid()->getName()) {
$pageKey = "{$gridName}_{$pageKey}";
}
$colum... | [
"public",
"function",
"urlWithoutFilters",
"(",
")",
"{",
"/** @var Collection $columns */",
"$",
"columns",
"=",
"collect",
"(",
"$",
"this",
"->",
"filters",
")",
"->",
"map",
"->",
"getColumn",
"(",
")",
"->",
"flatten",
"(",
")",
";",
"$",
"pageKey",
"... | Get url without filter queryString.
@return string | [
"Get",
"url",
"without",
"filter",
"queryString",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Grid/Filter.php#L545-L567 | train | Return the full URL without the filters | [
30522,
2270,
3853,
24471,
2140,
24415,
5833,
8873,
21928,
2015,
1006,
1007,
1063,
1013,
1008,
1008,
1030,
13075,
3074,
1002,
7753,
1008,
1013,
1002,
7753,
1027,
8145,
1006,
1002,
2023,
1011,
1028,
17736,
1007,
1011,
1028,
4949,
1011,
1028,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Finder/Iterator/PathFilterIterator.php | PathFilterIterator.accept | public function accept()
{
$filename = $this->current()->getRelativePathname();
if ('\\' === \DIRECTORY_SEPARATOR) {
$filename = str_replace('\\', '/', $filename);
}
return $this->isAccepted($filename);
} | php | public function accept()
{
$filename = $this->current()->getRelativePathname();
if ('\\' === \DIRECTORY_SEPARATOR) {
$filename = str_replace('\\', '/', $filename);
}
return $this->isAccepted($filename);
} | [
"public",
"function",
"accept",
"(",
")",
"{",
"$",
"filename",
"=",
"$",
"this",
"->",
"current",
"(",
")",
"->",
"getRelativePathname",
"(",
")",
";",
"if",
"(",
"'\\\\'",
"===",
"\\",
"DIRECTORY_SEPARATOR",
")",
"{",
"$",
"filename",
"=",
"str_replace... | Filters the iterator values.
@return bool true if the value should be kept, false otherwise | [
"Filters",
"the",
"iterator",
"values",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Finder/Iterator/PathFilterIterator.php#L27-L36 | train | Accept the current page | [
30522,
2270,
3853,
5138,
1006,
1007,
1063,
1002,
5371,
18442,
1027,
1002,
2023,
1011,
1028,
2783,
1006,
1007,
1011,
1028,
2131,
16570,
8082,
15069,
18442,
1006,
1007,
1025,
2065,
1006,
1005,
1032,
1032,
1005,
1027,
1027,
1027,
1032,
14176,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Console/Helper/ProgressIndicator.php | ProgressIndicator.advance | public function advance()
{
if (!$this->started) {
throw new LogicException('Progress indicator has not yet been started.');
}
if (!$this->output->isDecorated()) {
return;
}
$currentTime = $this->getCurrentTimeInMilliseconds();
if ($currentT... | php | public function advance()
{
if (!$this->started) {
throw new LogicException('Progress indicator has not yet been started.');
}
if (!$this->output->isDecorated()) {
return;
}
$currentTime = $this->getCurrentTimeInMilliseconds();
if ($currentT... | [
"public",
"function",
"advance",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"started",
")",
"{",
"throw",
"new",
"LogicException",
"(",
"'Progress indicator has not yet been started.'",
")",
";",
"}",
"if",
"(",
"!",
"$",
"this",
"->",
"output",
"->... | Advances the indicator. | [
"Advances",
"the",
"indicator",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Helper/ProgressIndicator.php#L101-L121 | train | Advance the indicator | [
30522,
2270,
3853,
5083,
1006,
1007,
1063,
2065,
1006,
999,
1002,
2023,
1011,
1028,
2318,
1007,
1063,
5466,
2047,
7961,
10288,
24422,
1006,
1005,
5082,
17245,
2038,
2025,
2664,
2042,
2318,
1012,
1005,
1007,
1025,
1065,
2065,
30524,
2065,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/backend/behaviors/RelationController.php | RelationController.initRelation | public function initRelation($model, $field = null)
{
if ($field == null) {
$field = post(self::PARAM_FIELD);
}
$this->config = $this->originalConfig;
$this->model = $model;
$this->field = $field;
if ($field == null) {
return;
}
... | php | public function initRelation($model, $field = null)
{
if ($field == null) {
$field = post(self::PARAM_FIELD);
}
$this->config = $this->originalConfig;
$this->model = $model;
$this->field = $field;
if ($field == null) {
return;
}
... | [
"public",
"function",
"initRelation",
"(",
"$",
"model",
",",
"$",
"field",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"field",
"==",
"null",
")",
"{",
"$",
"field",
"=",
"post",
"(",
"self",
"::",
"PARAM_FIELD",
")",
";",
"}",
"$",
"this",
"->",
"co... | Prepare the widgets used by this behavior
@param Model $model
@param string $field
@return void | [
"Prepare",
"the",
"widgets",
"used",
"by",
"this",
"behavior"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/behaviors/RelationController.php#L291-L385 | train | Initializes the related model and field | [
30522,
2270,
3853,
1999,
4183,
16570,
3370,
1006,
1002,
2944,
1010,
1002,
2492,
1027,
19701,
1007,
1063,
2065,
1006,
1002,
2492,
1027,
1027,
19701,
1007,
1063,
1002,
2492,
1027,
2695,
1006,
2969,
1024,
1024,
11498,
2213,
1035,
2492,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Redis/Connections/PhpRedisConnection.php | PhpRedisConnection.blpop | public function blpop(...$arguments)
{
$result = $this->command('blpop', $arguments);
return empty($result) ? null : $result;
} | php | public function blpop(...$arguments)
{
$result = $this->command('blpop', $arguments);
return empty($result) ? null : $result;
} | [
"public",
"function",
"blpop",
"(",
"...",
"$",
"arguments",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"command",
"(",
"'blpop'",
",",
"$",
"arguments",
")",
";",
"return",
"empty",
"(",
"$",
"result",
")",
"?",
"null",
":",
"$",
"result",
"... | Removes and returns the first element of the list stored at key.
@param dynamic $arguments
@return array|null | [
"Removes",
"and",
"returns",
"the",
"first",
"element",
"of",
"the",
"list",
"stored",
"at",
"key",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Redis/Connections/PhpRedisConnection.php#L165-L170 | train | Returns the next set of entries from the list | [
30522,
2270,
3853,
1038,
14277,
7361,
1006,
1012,
1012,
1012,
1002,
9918,
1007,
1063,
1002,
2765,
1027,
1002,
2023,
1011,
1028,
3094,
1006,
1005,
1038,
14277,
7361,
1005,
1010,
1002,
9918,
1007,
1025,
2709,
4064,
1006,
1002,
2765,
1007,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler/Deprecation.php | Deprecation.isLegacy | public function isLegacy($utilPrefix)
{
$test = $utilPrefix.'Test';
$class = $this->originatingClass();
$method = $this->originatingMethod();
return 0 === strpos($method, 'testLegacy')
|| 0 === strpos($method, 'provideLegacy')
|| 0 === strpos($method, 'getLeg... | php | public function isLegacy($utilPrefix)
{
$test = $utilPrefix.'Test';
$class = $this->originatingClass();
$method = $this->originatingMethod();
return 0 === strpos($method, 'testLegacy')
|| 0 === strpos($method, 'provideLegacy')
|| 0 === strpos($method, 'getLeg... | [
"public",
"function",
"isLegacy",
"(",
"$",
"utilPrefix",
")",
"{",
"$",
"test",
"=",
"$",
"utilPrefix",
".",
"'Test'",
";",
"$",
"class",
"=",
"$",
"this",
"->",
"originatingClass",
"(",
")",
";",
"$",
"method",
"=",
"$",
"this",
"->",
"originatingMet... | @param string $utilPrefix
@return bool | [
"@param",
"string",
"$utilPrefix"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler/Deprecation.php#L146-L157 | train | return true if the class implements the legacy method | [
30522,
2270,
3853,
8842,
3654,
5666,
1006,
1002,
21183,
4014,
28139,
8873,
2595,
1007,
1063,
1002,
3231,
1027,
1002,
21183,
4014,
28139,
8873,
2595,
1012,
1005,
3231,
1005,
1025,
1002,
2465,
30524,
1027,
1027,
1027,
2358,
14536,
2891,
1006,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Validation/ValidationRuleParser.php | ValidationRuleParser.explode | public function explode($rules)
{
$this->implicitAttributes = [];
$rules = $this->explodeRules($rules);
return (object) [
'rules' => $rules,
'implicitAttributes' => $this->implicitAttributes,
];
} | php | public function explode($rules)
{
$this->implicitAttributes = [];
$rules = $this->explodeRules($rules);
return (object) [
'rules' => $rules,
'implicitAttributes' => $this->implicitAttributes,
];
} | [
"public",
"function",
"explode",
"(",
"$",
"rules",
")",
"{",
"$",
"this",
"->",
"implicitAttributes",
"=",
"[",
"]",
";",
"$",
"rules",
"=",
"$",
"this",
"->",
"explodeRules",
"(",
"$",
"rules",
")",
";",
"return",
"(",
"object",
")",
"[",
"'rules'"... | Parse the human-friendly rules into a full rules array for the validator.
@param array $rules
@return \stdClass | [
"Parse",
"the",
"human",
"-",
"friendly",
"rules",
"into",
"a",
"full",
"rules",
"array",
"for",
"the",
"validator",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Validation/ValidationRuleParser.php#L45-L55 | train | Explode the rules into an array | [
30522,
2270,
3853,
15044,
1006,
1002,
3513,
1007,
1063,
1002,
2023,
1011,
1028,
24655,
19321,
3089,
8569,
4570,
1027,
1031,
1033,
1025,
1002,
3513,
1027,
1002,
2023,
1011,
1028,
15044,
6820,
4244,
1006,
1002,
3513,
1007,
1025,
2709,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
php-ai/php-ml | src/Classification/Linear/LogisticRegression.php | LogisticRegression.runConjugateGradient | protected function runConjugateGradient(array $samples, array $targets, Closure $gradientFunc): void
{
if ($this->optimizer === null) {
$this->optimizer = (new ConjugateGradient($this->featureCount))
->setMaxIterations($this->maxIterations);
}
$this->weights = $t... | php | protected function runConjugateGradient(array $samples, array $targets, Closure $gradientFunc): void
{
if ($this->optimizer === null) {
$this->optimizer = (new ConjugateGradient($this->featureCount))
->setMaxIterations($this->maxIterations);
}
$this->weights = $t... | [
"protected",
"function",
"runConjugateGradient",
"(",
"array",
"$",
"samples",
",",
"array",
"$",
"targets",
",",
"Closure",
"$",
"gradientFunc",
")",
":",
"void",
"{",
"if",
"(",
"$",
"this",
"->",
"optimizer",
"===",
"null",
")",
"{",
"$",
"this",
"->"... | Executes Conjugate Gradient method to optimize the weights of the LogReg model | [
"Executes",
"Conjugate",
"Gradient",
"method",
"to",
"optimize",
"the",
"weights",
"of",
"the",
"LogReg",
"model"
] | f6aa1a59b0525b8fca3d2786d661ab3e70904016 | https://github.com/php-ai/php-ml/blob/f6aa1a59b0525b8fca3d2786d661ab3e70904016/src/Classification/Linear/LogisticRegression.php#L156-L165 | train | Runs Conjugate Gradient | [
30522,
5123,
3853,
2448,
8663,
9103,
5867,
16307,
11638,
1006,
9140,
1002,
8168,
1010,
9140,
1002,
7889,
1010,
8503,
1002,
17978,
11263,
12273,
1007,
1024,
11675,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
23569,
27605,
6290,
1027,
1027,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/HTML/QuickForm2/Renderer/Default.php | HTML_QuickForm2_Renderer_Default.reset | public function reset()
{
$this->html = array(array());
$this->hiddenHtml = '';
$this->errors = array();
$this->hasRequired = false;
$this->groupId = array();
return $this;
} | php | public function reset()
{
$this->html = array(array());
$this->hiddenHtml = '';
$this->errors = array();
$this->hasRequired = false;
$this->groupId = array();
return $this;
} | [
"public",
"function",
"reset",
"(",
")",
"{",
"$",
"this",
"->",
"html",
"=",
"array",
"(",
"array",
"(",
")",
")",
";",
"$",
"this",
"->",
"hiddenHtml",
"=",
"''",
";",
"$",
"this",
"->",
"errors",
"=",
"array",
"(",
")",
";",
"$",
"this",
"->... | Resets the accumulated data
This method is called automatically by startForm() method, but should
be called manually before calling other rendering methods separately.
@return HTML_QuickForm2_Renderer_Default | [
"Resets",
"the",
"accumulated",
"data"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Renderer/Default.php#L260-L269 | train | Reset the current object | [
30522,
2270,
3853,
25141,
1006,
1007,
1063,
1002,
2023,
1011,
1028,
16129,
1027,
9140,
1006,
9140,
1006,
1007,
1007,
1025,
1002,
2023,
1011,
1028,
5023,
11039,
19968,
1027,
1005,
1005,
1025,
1002,
2023,
1011,
1028,
10697,
1027,
9140,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/API/Proxy.php | Proxy.call | public function call($className, $methodName, $parametersRequest)
{
// Temporarily sets the Request array to this API call context
return Context::executeWithQueryParameters($parametersRequest, function () use ($className, $methodName, $parametersRequest) {
$returnedValue = null;
... | php | public function call($className, $methodName, $parametersRequest)
{
// Temporarily sets the Request array to this API call context
return Context::executeWithQueryParameters($parametersRequest, function () use ($className, $methodName, $parametersRequest) {
$returnedValue = null;
... | [
"public",
"function",
"call",
"(",
"$",
"className",
",",
"$",
"methodName",
",",
"$",
"parametersRequest",
")",
"{",
"// Temporarily sets the Request array to this API call context",
"return",
"Context",
"::",
"executeWithQueryParameters",
"(",
"$",
"parametersRequest",
... | Will execute $className->$methodName($parametersValues)
If any error is detected (wrong number of parameters, method not found, class not found, etc.)
it will throw an exception
It also logs the API calls, with the parameters values, the returned value, the performance, etc.
You can enable logging in config/global.ini... | [
"Will",
"execute",
"$className",
"-",
">",
"$methodName",
"(",
"$parametersValues",
")",
"If",
"any",
"error",
"is",
"detected",
"(",
"wrong",
"number",
"of",
"parameters",
"method",
"not",
"found",
"class",
"not",
"found",
"etc",
".",
")",
"it",
"will",
"... | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/API/Proxy.php#L144-L329 | train | Calls the specified class method with the given parameters request | [
30522,
2270,
3853,
2655,
1006,
1002,
2465,
18442,
1010,
1002,
4118,
18442,
1010,
1002,
11709,
2890,
15500,
1007,
1063,
1013,
1013,
8184,
4520,
1996,
5227,
9140,
2000,
2023,
17928,
2655,
6123,
2709,
6123,
1024,
1024,
15389,
24415,
4226,
2854... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Cache/Traits/MemcachedTrait.php | MemcachedTrait.createConnection | public static function createConnection($servers, array $options = [])
{
if (\is_string($servers)) {
$servers = [$servers];
} elseif (!\is_array($servers)) {
throw new InvalidArgumentException(sprintf('MemcachedAdapter::createClient() expects array or string as first argument... | php | public static function createConnection($servers, array $options = [])
{
if (\is_string($servers)) {
$servers = [$servers];
} elseif (!\is_array($servers)) {
throw new InvalidArgumentException(sprintf('MemcachedAdapter::createClient() expects array or string as first argument... | [
"public",
"static",
"function",
"createConnection",
"(",
"$",
"servers",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"\\",
"is_string",
"(",
"$",
"servers",
")",
")",
"{",
"$",
"servers",
"=",
"[",
"$",
"servers",
"]",
";",
"}... | Creates a Memcached instance.
By default, the binary protocol, no block, and libketama compatible options are enabled.
Examples for servers:
- 'memcached://user:pass@localhost?weight=33'
- [['localhost', 11211, 33]]
@param array[]|string|string[] $servers An array of servers, a DSN, or an array of DSNs
@param array ... | [
"Creates",
"a",
"Memcached",
"instance",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Cache/Traits/MemcachedTrait.php#L80-L222 | train | Creates a Memcached client using the memcached server and options | [
30522,
2270,
10763,
3853,
3443,
8663,
2638,
7542,
1006,
1002,
14903,
1010,
9140,
1002,
7047,
1027,
1031,
1033,
1007,
1063,
2065,
1006,
1032,
2003,
1035,
5164,
1006,
1002,
14903,
1007,
1007,
1063,
1002,
14903,
1027,
1031,
1002,
14903,
1033,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php | HttpCache.validate | protected function validate(Request $request, Response $entry, $catch = false)
{
$subRequest = clone $request;
// send no head requests because we want content
if ('HEAD' === $request->getMethod()) {
$subRequest->setMethod('GET');
}
// add our cached last-modifi... | php | protected function validate(Request $request, Response $entry, $catch = false)
{
$subRequest = clone $request;
// send no head requests because we want content
if ('HEAD' === $request->getMethod()) {
$subRequest->setMethod('GET');
}
// add our cached last-modifi... | [
"protected",
"function",
"validate",
"(",
"Request",
"$",
"request",
",",
"Response",
"$",
"entry",
",",
"$",
"catch",
"=",
"false",
")",
"{",
"$",
"subRequest",
"=",
"clone",
"$",
"request",
";",
"// send no head requests because we want content",
"if",
"(",
... | Validates that a cache entry is fresh.
The original request is used as a template for a conditional
GET request with the backend.
@param Request $request A Request instance
@param Response $entry A Response instance to validate
@param bool $catch Whether to process exceptions
@return Response A Response ins... | [
"Validates",
"that",
"a",
"cache",
"entry",
"is",
"fresh",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php#L375-L426 | train | Validate the response and return the response | [
30522,
5123,
3853,
9398,
3686,
1006,
5227,
1002,
5227,
1010,
3433,
1002,
4443,
1010,
1002,
4608,
1027,
6270,
1007,
1063,
1002,
4942,
2890,
15500,
1027,
17598,
1002,
5227,
1025,
1013,
1013,
4604,
2053,
2132,
11186,
2138,
2057,
2215,
4180,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/Live/API.php | API.getFirstVisitForVisitorId | public function getFirstVisitForVisitorId($idSite, $visitorId)
{
Piwik::checkUserHasSomeViewAccess();
if (empty($visitorId)) {
return new DataTable();
}
$model = new Model();
$data = $model->queryLogVisits($idSite, false, false, false, 0, 1, $visitorId, false, '... | php | public function getFirstVisitForVisitorId($idSite, $visitorId)
{
Piwik::checkUserHasSomeViewAccess();
if (empty($visitorId)) {
return new DataTable();
}
$model = new Model();
$data = $model->queryLogVisits($idSite, false, false, false, 0, 1, $visitorId, false, '... | [
"public",
"function",
"getFirstVisitForVisitorId",
"(",
"$",
"idSite",
",",
"$",
"visitorId",
")",
"{",
"Piwik",
"::",
"checkUserHasSomeViewAccess",
"(",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"visitorId",
")",
")",
"{",
"return",
"new",
"DataTable",
"(",
... | Returns the very first visit for the given visitorId
@internal
@param $idSite
@param $visitorId
@return DataTable | [
"Returns",
"the",
"very",
"first",
"visit",
"for",
"the",
"given",
"visitorId"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Live/API.php#L314-L328 | train | Get the first visit for a given visitorId | [
30522,
2270,
3853,
2131,
8873,
12096,
11365,
4183,
29278,
11365,
15660,
3593,
1006,
1002,
8909,
28032,
2063,
1010,
1002,
10367,
3593,
1007,
1063,
14255,
9148,
2243,
1024,
1024,
4638,
20330,
14949,
14045,
8584,
6305,
9623,
2015,
1006,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/HTML/QuickForm2/Renderer/Proxy.php | HTML_QuickForm2_Renderer_Proxy.addPlugin | protected function addPlugin($index, HTML_QuickForm2_Renderer_Plugin $plugin)
{
$methods = array();
$reflection = new ReflectionObject($plugin);
foreach ($reflection->getMethods(ReflectionMethod::IS_PUBLIC) as $method) {
$lower = strtolower($method->getName());
if ... | php | protected function addPlugin($index, HTML_QuickForm2_Renderer_Plugin $plugin)
{
$methods = array();
$reflection = new ReflectionObject($plugin);
foreach ($reflection->getMethods(ReflectionMethod::IS_PUBLIC) as $method) {
$lower = strtolower($method->getName());
if ... | [
"protected",
"function",
"addPlugin",
"(",
"$",
"index",
",",
"HTML_QuickForm2_Renderer_Plugin",
"$",
"plugin",
")",
"{",
"$",
"methods",
"=",
"array",
"(",
")",
";",
"$",
"reflection",
"=",
"new",
"ReflectionObject",
"(",
"$",
"plugin",
")",
";",
"foreach",... | Adds a plugin for the current renderer instance
Plugin's methods are imported and can be later called as this object's own
@param HTML_QuickForm2_Renderer_Plugin a plugin instance
@throws HTML_QuickForm2_InvalidArgumentException if a plugin has already
imported name | [
"Adds",
"a",
"plugin",
"for",
"the",
"current",
"renderer",
"instance"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Renderer/Proxy.php#L162-L187 | train | Adds a plugin to the list of available methods | [
30522,
5123,
3853,
5587,
24759,
15916,
2378,
1006,
1002,
5950,
1010,
16129,
1035,
4248,
14192,
2475,
1035,
17552,
2121,
1035,
13354,
2378,
1002,
13354,
2378,
1007,
1063,
1002,
4725,
1027,
9140,
1006,
1007,
1025,
1002,
9185,
1027,
2047,
9185... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/SettingsPiwik.php | SettingsPiwik.getKnownSegmentsToArchive | public static function getKnownSegmentsToArchive()
{
$cacheId = 'KnownSegmentsToArchive';
$cache = PiwikCache::getTransientCache();
if ($cache->contains($cacheId)) {
return $cache->fetch($cacheId);
}
$segments = Config::getInstance()->Segments;
$segment... | php | public static function getKnownSegmentsToArchive()
{
$cacheId = 'KnownSegmentsToArchive';
$cache = PiwikCache::getTransientCache();
if ($cache->contains($cacheId)) {
return $cache->fetch($cacheId);
}
$segments = Config::getInstance()->Segments;
$segment... | [
"public",
"static",
"function",
"getKnownSegmentsToArchive",
"(",
")",
"{",
"$",
"cacheId",
"=",
"'KnownSegmentsToArchive'",
";",
"$",
"cache",
"=",
"PiwikCache",
"::",
"getTransientCache",
"(",
")",
";",
"if",
"(",
"$",
"cache",
"->",
"contains",
"(",
"$",
... | Returns every stored segment to pre-process for each site during cron archiving.
@return array The list of stored segments that apply to all sites. | [
"Returns",
"every",
"stored",
"segment",
"to",
"pre",
"-",
"process",
"for",
"each",
"site",
"during",
"cron",
"archiving",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/SettingsPiwik.php#L63-L107 | train | Returns the list of all known segments to archive | [
30522,
2270,
10763,
3853,
2131,
2243,
19779,
12325,
21693,
11187,
3406,
2906,
5428,
3726,
1006,
1007,
1063,
1002,
17053,
3593,
1027,
1005,
2124,
3366,
21693,
11187,
3406,
2906,
5428,
3726,
1005,
1025,
1002,
17053,
1027,
14255,
9148,
2243,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Http/Middleware/SetCacheHeaders.php | SetCacheHeaders.handle | public function handle($request, Closure $next, $options = [])
{
$response = $next($request);
if (! $request->isMethodCacheable() || ! $response->getContent()) {
return $response;
}
if (is_string($options)) {
$options = $this->parseOptions($options);
... | php | public function handle($request, Closure $next, $options = [])
{
$response = $next($request);
if (! $request->isMethodCacheable() || ! $response->getContent()) {
return $response;
}
if (is_string($options)) {
$options = $this->parseOptions($options);
... | [
"public",
"function",
"handle",
"(",
"$",
"request",
",",
"Closure",
"$",
"next",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"response",
"=",
"$",
"next",
"(",
"$",
"request",
")",
";",
"if",
"(",
"!",
"$",
"request",
"->",
"isMethodCacheab... | Add cache related HTTP headers.
@param \Illuminate\Http\Request $request
@param \Closure $next
@param string|array $options
@return \Symfony\Component\HttpFoundation\Response
@throws \InvalidArgumentException | [
"Add",
"cache",
"related",
"HTTP",
"headers",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Http/Middleware/SetCacheHeaders.php#L19-L39 | train | Handle the request and return the response | [
30522,
2270,
3853,
5047,
1006,
1002,
5227,
1010,
8503,
1002,
2279,
1010,
1002,
7047,
1027,
1031,
1033,
1007,
1063,
1002,
3433,
1027,
1002,
2279,
1006,
1002,
5227,
1007,
1025,
2065,
1006,
999,
1002,
5227,
1011,
1028,
2003,
11368,
6806,
164... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/DependencyInjection/ContainerBuilder.php | ContainerBuilder.shareService | private function shareService(Definition $definition, $service, $id, array &$inlineServices)
{
$inlineServices[null !== $id ? $id : spl_object_hash($definition)] = $service;
if (null !== $id && $definition->isShared()) {
$this->services[$id] = $service;
unset($this->loading[... | php | private function shareService(Definition $definition, $service, $id, array &$inlineServices)
{
$inlineServices[null !== $id ? $id : spl_object_hash($definition)] = $service;
if (null !== $id && $definition->isShared()) {
$this->services[$id] = $service;
unset($this->loading[... | [
"private",
"function",
"shareService",
"(",
"Definition",
"$",
"definition",
",",
"$",
"service",
",",
"$",
"id",
",",
"array",
"&",
"$",
"inlineServices",
")",
"{",
"$",
"inlineServices",
"[",
"null",
"!==",
"$",
"id",
"?",
"$",
"id",
":",
"spl_object_h... | Shares a given service in the container.
@param Definition $definition
@param object $service
@param string|null $id | [
"Shares",
"a",
"given",
"service",
"in",
"the",
"container",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/DependencyInjection/ContainerBuilder.php#L1644-L1652 | train | Share a service with the inline service list | [
30522,
2797,
3853,
6661,
2121,
7903,
2063,
1006,
6210,
1002,
6210,
1010,
1002,
2326,
1010,
1002,
8909,
1010,
9140,
1004,
1002,
23881,
8043,
7903,
2229,
1007,
1063,
1002,
23881,
8043,
7903,
2229,
1031,
19701,
999,
1027,
1027,
1002,
8909,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Routing/ResponseFactory.php | ResponseFactory.streamDownload | public function streamDownload($callback, $name = null, array $headers = [], $disposition = 'attachment')
{
$response = new StreamedResponse($callback, 200, $headers);
if (! is_null($name)) {
$response->headers->set('Content-Disposition', $response->headers->makeDisposition(
... | php | public function streamDownload($callback, $name = null, array $headers = [], $disposition = 'attachment')
{
$response = new StreamedResponse($callback, 200, $headers);
if (! is_null($name)) {
$response->headers->set('Content-Disposition', $response->headers->makeDisposition(
... | [
"public",
"function",
"streamDownload",
"(",
"$",
"callback",
",",
"$",
"name",
"=",
"null",
",",
"array",
"$",
"headers",
"=",
"[",
"]",
",",
"$",
"disposition",
"=",
"'attachment'",
")",
"{",
"$",
"response",
"=",
"new",
"StreamedResponse",
"(",
"$",
... | Create a new streamed response instance as a file download.
@param \Closure $callback
@param string|null $name
@param array $headers
@param string|null $disposition
@return \Symfony\Component\HttpFoundation\StreamedResponse | [
"Create",
"a",
"new",
"streamed",
"response",
"instance",
"as",
"a",
"file",
"download",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/ResponseFactory.php#L135-L148 | train | Streamed download. | [
30522,
2270,
3853,
5460,
7698,
11066,
1006,
1002,
2655,
5963,
1010,
1002,
2171,
1027,
19701,
1010,
9140,
1002,
20346,
2015,
1027,
1031,
1033,
1010,
1002,
22137,
1027,
1005,
14449,
1005,
1007,
1063,
1002,
3433,
1027,
2047,
18498,
6072,
26029... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Broadcasting/Broadcasters/Broadcaster.php | Broadcaster.resolveImplicitBindingIfPossible | protected function resolveImplicitBindingIfPossible($key, $value, $callbackParameters)
{
foreach ($callbackParameters as $parameter) {
if (! $this->isImplicitlyBindable($key, $parameter)) {
continue;
}
$instance = $parameter->getClass()->newInstance();
... | php | protected function resolveImplicitBindingIfPossible($key, $value, $callbackParameters)
{
foreach ($callbackParameters as $parameter) {
if (! $this->isImplicitlyBindable($key, $parameter)) {
continue;
}
$instance = $parameter->getClass()->newInstance();
... | [
"protected",
"function",
"resolveImplicitBindingIfPossible",
"(",
"$",
"key",
",",
"$",
"value",
",",
"$",
"callbackParameters",
")",
"{",
"foreach",
"(",
"$",
"callbackParameters",
"as",
"$",
"parameter",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isImpl... | Resolve an implicit parameter binding if applicable.
@param string $key
@param mixed $value
@param array $callbackParameters
@return mixed
@throws \Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException | [
"Resolve",
"an",
"implicit",
"parameter",
"binding",
"if",
"applicable",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Broadcasting/Broadcasters/Broadcaster.php#L200-L217 | train | Resolve implicit binding if possible | [
30522,
5123,
3853,
10663,
5714,
24759,
28775,
2102,
8428,
4667,
10128,
6873,
18719,
3468,
1006,
1002,
3145,
1010,
1002,
3643,
1010,
1002,
2655,
5963,
28689,
22828,
2015,
1007,
1063,
18921,
6776,
1006,
1002,
2655,
5963,
28689,
22828,
2015,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
PHPMailer/PHPMailer | src/PHPMailer.php | PHPMailer.addCustomHeader | public function addCustomHeader($name, $value = null)
{
if (null === $value) {
// Value passed in as name:value
$this->CustomHeader[] = explode(':', $name, 2);
} else {
$this->CustomHeader[] = [$name, $value];
}
} | php | public function addCustomHeader($name, $value = null)
{
if (null === $value) {
// Value passed in as name:value
$this->CustomHeader[] = explode(':', $name, 2);
} else {
$this->CustomHeader[] = [$name, $value];
}
} | [
"public",
"function",
"addCustomHeader",
"(",
"$",
"name",
",",
"$",
"value",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"value",
")",
"{",
"// Value passed in as name:value",
"$",
"this",
"->",
"CustomHeader",
"[",
"]",
"=",
"explode",
"(",
"... | Add a custom header.
$name value can be overloaded to contain
both header name and value (name:value).
@param string $name Custom header name
@param string|null $value Header value | [
"Add",
"a",
"custom",
"header",
".",
"$name",
"value",
"can",
"be",
"overloaded",
"to",
"contain",
"both",
"header",
"name",
"and",
"value",
"(",
"name",
":",
"value",
")",
"."
] | 3d7132341659a8a201adbc3ba11b1e202ee2857c | https://github.com/PHPMailer/PHPMailer/blob/3d7132341659a8a201adbc3ba11b1e202ee2857c/src/PHPMailer.php#L3733-L3741 | train | Add custom header | [
30522,
2270,
3853,
5587,
7874,
20389,
4974,
2121,
1006,
1002,
2171,
1010,
1002,
3643,
1027,
19701,
1007,
1063,
2065,
1006,
19701,
1027,
1027,
1027,
1002,
3643,
1007,
1063,
1013,
1013,
3643,
2979,
1999,
2004,
2171,
1024,
3643,
1002,
2023,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php | ChoiceType.finishView | public function finishView(FormView $view, FormInterface $form, array $options)
{
if ($options['expanded']) {
// Radio buttons should have the same name as the parent
$childName = $view->vars['full_name'];
// Checkboxes should append "[]" to allow multiple selection
... | php | public function finishView(FormView $view, FormInterface $form, array $options)
{
if ($options['expanded']) {
// Radio buttons should have the same name as the parent
$childName = $view->vars['full_name'];
// Checkboxes should append "[]" to allow multiple selection
... | [
"public",
"function",
"finishView",
"(",
"FormView",
"$",
"view",
",",
"FormInterface",
"$",
"form",
",",
"array",
"$",
"options",
")",
"{",
"if",
"(",
"$",
"options",
"[",
"'expanded'",
"]",
")",
"{",
"// Radio buttons should have the same name as the parent",
... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php#L230-L245 | train | Finishes the form view. | [
30522,
2270,
3853,
3926,
8584,
1006,
2433,
8584,
1002,
3193,
1010,
2433,
18447,
2121,
12172,
1002,
2433,
1010,
9140,
1002,
7047,
1007,
1063,
2065,
1006,
1002,
7047,
1031,
1005,
4423,
1005,
1033,
1007,
1063,
1013,
1013,
2557,
11287,
2323,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/Zend/Cache/Backend/Sqlite.php | Zend_Cache_Backend_Sqlite.getIdsNotMatchingTags | public function getIdsNotMatchingTags($tags = array())
{
$res = $this->_query("SELECT id FROM cache");
$rows = @sqlite_fetch_all($res, SQLITE_ASSOC);
$result = array();
foreach ($rows as $row) {
$id = $row['id'];
$matching = false;
foreach ($tags a... | php | public function getIdsNotMatchingTags($tags = array())
{
$res = $this->_query("SELECT id FROM cache");
$rows = @sqlite_fetch_all($res, SQLITE_ASSOC);
$result = array();
foreach ($rows as $row) {
$id = $row['id'];
$matching = false;
foreach ($tags a... | [
"public",
"function",
"getIdsNotMatchingTags",
"(",
"$",
"tags",
"=",
"array",
"(",
")",
")",
"{",
"$",
"res",
"=",
"$",
"this",
"->",
"_query",
"(",
"\"SELECT id FROM cache\"",
")",
";",
"$",
"rows",
"=",
"@",
"sqlite_fetch_all",
"(",
"$",
"res",
",",
... | Return an array of stored cache ids which don't match given tags
In case of multiple tags, a logical OR is made between tags
@param array $tags array of tags
@return array array of not matching cache ids (string) | [
"Return",
"an",
"array",
"of",
"stored",
"cache",
"ids",
"which",
"don",
"t",
"match",
"given",
"tags"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache/Backend/Sqlite.php#L302-L325 | train | Returns all the ids not matching the given tags | [
30522,
2270,
3853,
2131,
9821,
17048,
18900,
8450,
15900,
2015,
1006,
1002,
22073,
1027,
9140,
1006,
1007,
1007,
1063,
1002,
24501,
1027,
1002,
2023,
1011,
1028,
1035,
23032,
1006,
1000,
7276,
8909,
2013,
17053,
1000,
1007,
1025,
1002,
1028... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/DependencyInjection/Compiler/AutowirePass.php | AutowirePass.process | public function process(ContainerBuilder $container)
{
try {
parent::process($container);
} finally {
$this->types = null;
$this->ambiguousServiceTypes = null;
$this->decoratedClass = null;
$this->decoratedId = null;
$this->meth... | php | public function process(ContainerBuilder $container)
{
try {
parent::process($container);
} finally {
$this->types = null;
$this->ambiguousServiceTypes = null;
$this->decoratedClass = null;
$this->decoratedId = null;
$this->meth... | [
"public",
"function",
"process",
"(",
"ContainerBuilder",
"$",
"container",
")",
"{",
"try",
"{",
"parent",
"::",
"process",
"(",
"$",
"container",
")",
";",
"}",
"finally",
"{",
"$",
"this",
"->",
"types",
"=",
"null",
";",
"$",
"this",
"->",
"ambiguo... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/DependencyInjection/Compiler/AutowirePass.php#L49-L63 | train | Process the container builder | [
30522,
2270,
3853,
2832,
1006,
11661,
8569,
23891,
2099,
1002,
11661,
1007,
1063,
3046,
1063,
6687,
1024,
1024,
2832,
1006,
1002,
11661,
1007,
1025,
1065,
2633,
1063,
1002,
2023,
1011,
1028,
4127,
1027,
19701,
1025,
1002,
2023,
1011,
1028,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/Installation/ServerFilesGenerator.php | ServerFilesGenerator.createHtAccessFiles | public static function createHtAccessFiles()
{
$denyAll = self::getDenyAllHtaccessContent();
$allow = self::getAllowHtaccessContent();
$allowAny =
"# Allow any file in this directory\n" .
"<Files \"*\">\n" .
"\t" . $allow . "\n" .
"</Files>\n"... | php | public static function createHtAccessFiles()
{
$denyAll = self::getDenyAllHtaccessContent();
$allow = self::getAllowHtaccessContent();
$allowAny =
"# Allow any file in this directory\n" .
"<Files \"*\">\n" .
"\t" . $allow . "\n" .
"</Files>\n"... | [
"public",
"static",
"function",
"createHtAccessFiles",
"(",
")",
"{",
"$",
"denyAll",
"=",
"self",
"::",
"getDenyAllHtaccessContent",
"(",
")",
";",
"$",
"allow",
"=",
"self",
"::",
"getAllowHtaccessContent",
"(",
")",
";",
"$",
"allowAny",
"=",
"\"# Allow any... | Generate Apache .htaccess files to restrict access
.htaccess files are created on all webservers even Nginx, as sometimes Nginx knows how to handle .htaccess files | [
"Generate",
"Apache",
".",
"htaccess",
"files",
"to",
"restrict",
"access",
".",
"htaccess",
"files",
"are",
"created",
"on",
"all",
"webservers",
"even",
"Nginx",
"as",
"sometimes",
"Nginx",
"knows",
"how",
"to",
"handle",
".",
"htaccess",
"files"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Installation/ServerFilesGenerator.php#L31-L83 | train | Create all apache files | [
30522,
2270,
10763,
3853,
3443,
22893,
9468,
7971,
8873,
4244,
1006,
1007,
1063,
1002,
9772,
8095,
1027,
2969,
1024,
1024,
2131,
4181,
21095,
2140,
22893,
9468,
7971,
8663,
6528,
2102,
1006,
1007,
1025,
1002,
3499,
1027,
2969,
1024,
1024,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.