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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
walkor/Workerman | Connection/UdpConnection.php | UdpConnection.close | public function close($data = null, $raw = false)
{
if ($data !== null) {
$this->send($data, $raw);
}
return true;
} | php | public function close($data = null, $raw = false)
{
if ($data !== null) {
$this->send($data, $raw);
}
return true;
} | [
"public",
"function",
"close",
"(",
"$",
"data",
"=",
"null",
",",
"$",
"raw",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"data",
"!==",
"null",
")",
"{",
"$",
"this",
"->",
"send",
"(",
"$",
"data",
",",
"$",
"raw",
")",
";",
"}",
"return",
"tr... | Close connection.
@param mixed $data
@param bool $raw
@return bool | [
"Close",
"connection",
"."
] | 13649907f05014fcfffcfccaef01e63ad3339351 | https://github.com/walkor/Workerman/blob/13649907f05014fcfffcfccaef01e63ad3339351/Connection/UdpConnection.php#L184-L190 | train | Close the current session | [
30522,
2270,
3853,
2485,
1006,
1002,
2951,
1027,
19701,
1010,
1002,
6315,
1027,
6270,
1007,
1063,
2065,
1006,
1002,
2951,
999,
1027,
1027,
19701,
1007,
1063,
1002,
2023,
1011,
1028,
4604,
1006,
1002,
2951,
1010,
1002,
6315,
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... |
matomo-org/matomo | plugins/Diagnostics/Diagnostic/RequiredPhpSetting.php | RequiredPhpSetting.setErrorResult | public function setErrorResult($errorResult)
{
if ($errorResult !== DiagnosticResult::STATUS_WARNING && $errorResult !== DiagnosticResult::STATUS_ERROR) {
throw new \InvalidArgumentException('Error result must be either DiagnosticResult::STATUS_WARNING or DiagnosticResult::STATUS_ERROR.');
... | php | public function setErrorResult($errorResult)
{
if ($errorResult !== DiagnosticResult::STATUS_WARNING && $errorResult !== DiagnosticResult::STATUS_ERROR) {
throw new \InvalidArgumentException('Error result must be either DiagnosticResult::STATUS_WARNING or DiagnosticResult::STATUS_ERROR.');
... | [
"public",
"function",
"setErrorResult",
"(",
"$",
"errorResult",
")",
"{",
"if",
"(",
"$",
"errorResult",
"!==",
"DiagnosticResult",
"::",
"STATUS_WARNING",
"&&",
"$",
"errorResult",
"!==",
"DiagnosticResult",
"::",
"STATUS_ERROR",
")",
"{",
"throw",
"new",
"\\"... | @param $errorResult
@return $this | [
"@param",
"$errorResult"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Diagnostics/Diagnostic/RequiredPhpSetting.php#L54-L63 | train | Set error result | [
30522,
2270,
3853,
2275,
2121,
29165,
6072,
11314,
1006,
1002,
7561,
6072,
11314,
1007,
1063,
2065,
1006,
1002,
7561,
6072,
11314,
999,
1027,
1027,
16474,
6072,
11314,
1024,
1024,
3570,
1035,
5432,
1004,
1004,
1002,
7561,
6072,
11314,
999,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Math/Set.php | Set.intersection | public static function intersection(self $a, self $b): self
{
return new self(array_intersect($a->toArray(), $b->toArray()));
} | php | public static function intersection(self $a, self $b): self
{
return new self(array_intersect($a->toArray(), $b->toArray()));
} | [
"public",
"static",
"function",
"intersection",
"(",
"self",
"$",
"a",
",",
"self",
"$",
"b",
")",
":",
"self",
"{",
"return",
"new",
"self",
"(",
"array_intersect",
"(",
"$",
"a",
"->",
"toArray",
"(",
")",
",",
"$",
"b",
"->",
"toArray",
"(",
")"... | Creates the intersection of A and B. | [
"Creates",
"the",
"intersection",
"of",
"A",
"and",
"B",
"."
] | f6aa1a59b0525b8fca3d2786d661ab3e70904016 | https://github.com/php-ai/php-ml/blob/f6aa1a59b0525b8fca3d2786d661ab3e70904016/src/Math/Set.php#L36-L39 | train | Returns a new set containing the intersection of two sets of objects. | [
30522,
2270,
10763,
3853,
6840,
1006,
2969,
1002,
1037,
1010,
2969,
1002,
1038,
1007,
1024,
2969,
1063,
2709,
2047,
2969,
1006,
9140,
1035,
29261,
1006,
1002,
1037,
1011,
1028,
2000,
2906,
9447,
1006,
1007,
1010,
1002,
1038,
1011,
1028,
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... |
laravel/framework | src/Illuminate/Support/Collection.php | Collection.duplicateComparator | protected function duplicateComparator($strict)
{
if ($strict) {
return function ($a, $b) {
return $a === $b;
};
}
return function ($a, $b) {
return $a == $b;
};
} | php | protected function duplicateComparator($strict)
{
if ($strict) {
return function ($a, $b) {
return $a === $b;
};
}
return function ($a, $b) {
return $a == $b;
};
} | [
"protected",
"function",
"duplicateComparator",
"(",
"$",
"strict",
")",
"{",
"if",
"(",
"$",
"strict",
")",
"{",
"return",
"function",
"(",
"$",
"a",
",",
"$",
"b",
")",
"{",
"return",
"$",
"a",
"===",
"$",
"b",
";",
"}",
";",
"}",
"return",
"fu... | Get the comparison function to detect duplicates.
@param bool $strict
@return \Closure | [
"Get",
"the",
"comparison",
"function",
"to",
"detect",
"duplicates",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Support/Collection.php#L453-L464 | train | duplicateComparator - Returns a function that will compare two arrays | [
30522,
5123,
3853,
24473,
9006,
28689,
4263,
1006,
1002,
9384,
1007,
1063,
2065,
1006,
1002,
9384,
1007,
1063,
2709,
3853,
1006,
1002,
1037,
1010,
1002,
1038,
1007,
1063,
2709,
1002,
1037,
1027,
1027,
1027,
1002,
1038,
1025,
1065,
1025,
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/Widget/WidgetsList.php | WidgetsList.isDefined | public function isDefined($module, $action)
{
foreach ($this->widgets as $widget) {
if ($widget->getModule() === $module && $widget->getAction() === $action) {
return true;
}
}
return false;
} | php | public function isDefined($module, $action)
{
foreach ($this->widgets as $widget) {
if ($widget->getModule() === $module && $widget->getAction() === $action) {
return true;
}
}
return false;
} | [
"public",
"function",
"isDefined",
"(",
"$",
"module",
",",
"$",
"action",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"widgets",
"as",
"$",
"widget",
")",
"{",
"if",
"(",
"$",
"widget",
"->",
"getModule",
"(",
")",
"===",
"$",
"module",
"&&",
"$"... | Returns `true` if a widget exists in the widget list, `false` if otherwise.
@param string $module The controller name of the widget.
@param string $action The controller action of the widget.
@return bool | [
"Returns",
"true",
"if",
"a",
"widget",
"exists",
"in",
"the",
"widget",
"list",
"false",
"if",
"otherwise",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Widget/WidgetsList.php#L158-L167 | train | Checks if the widget is defined for the given module and action | [
30522,
2270,
3853,
2003,
3207,
23460,
2094,
1006,
1002,
11336,
1010,
1002,
2895,
1007,
1063,
18921,
6776,
1006,
1002,
2023,
1011,
1028,
15536,
28682,
2004,
1002,
15536,
24291,
1007,
1063,
2065,
1006,
1002,
15536,
24291,
1011,
1028,
2131,
53... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/FormBuilder.php | FormBuilder.add | public function add($child, $type = null, array $options = [])
{
if ($this->locked) {
throw new BadMethodCallException('FormBuilder methods cannot be accessed anymore once the builder is turned into a FormConfigInterface instance.');
}
if ($child instanceof FormBuilderInterface)... | php | public function add($child, $type = null, array $options = [])
{
if ($this->locked) {
throw new BadMethodCallException('FormBuilder methods cannot be accessed anymore once the builder is turned into a FormConfigInterface instance.');
}
if ($child instanceof FormBuilderInterface)... | [
"public",
"function",
"add",
"(",
"$",
"child",
",",
"$",
"type",
"=",
"null",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"locked",
")",
"{",
"throw",
"new",
"BadMethodCallException",
"(",
"'FormBuilder methods... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/FormBuilder.php#L50-L78 | train | Add a child to the children array | [
30522,
2270,
3853,
5587,
1006,
1002,
2775,
1010,
1002,
2828,
1027,
19701,
1010,
9140,
1002,
7047,
1027,
1031,
1033,
1007,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
5299,
1007,
1063,
5466,
2047,
2919,
11368,
6806,
16409,
24164,
2595,
24422,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Descriptor/JsonDescriptor.php | JsonDescriptor.describeInputDefinition | protected function describeInputDefinition(InputDefinition $definition, array $options = [])
{
$this->writeData($this->getInputDefinitionData($definition), $options);
} | php | protected function describeInputDefinition(InputDefinition $definition, array $options = [])
{
$this->writeData($this->getInputDefinitionData($definition), $options);
} | [
"protected",
"function",
"describeInputDefinition",
"(",
"InputDefinition",
"$",
"definition",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"writeData",
"(",
"$",
"this",
"->",
"getInputDefinitionData",
"(",
"$",
"definition",
")",... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Descriptor/JsonDescriptor.php#L48-L51 | train | Describes an input definition | [
30522,
5123,
3853,
6235,
2378,
18780,
3207,
16294,
22753,
1006,
7953,
3207,
16294,
22753,
1002,
6210,
1010,
9140,
1002,
7047,
1027,
1031,
1033,
1007,
1063,
1002,
2023,
1011,
1028,
4339,
2850,
2696,
1006,
1002,
2023,
1011,
1028,
2131,
2378,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/controllers/Index.php | Index.index_onOpenTemplate | public function index_onOpenTemplate()
{
$this->validateRequestTheme();
$type = Request::input('type');
$template = $this->loadTemplate($type, Request::input('path'));
$widget = $this->makeTemplateFormWidget($type, $template);
$this->vars['templatePath'] = Request::input('p... | php | public function index_onOpenTemplate()
{
$this->validateRequestTheme();
$type = Request::input('type');
$template = $this->loadTemplate($type, Request::input('path'));
$widget = $this->makeTemplateFormWidget($type, $template);
$this->vars['templatePath'] = Request::input('p... | [
"public",
"function",
"index_onOpenTemplate",
"(",
")",
"{",
"$",
"this",
"->",
"validateRequestTheme",
"(",
")",
";",
"$",
"type",
"=",
"Request",
"::",
"input",
"(",
"'type'",
")",
";",
"$",
"template",
"=",
"$",
"this",
"->",
"loadTemplate",
"(",
"$",... | Opens an existing template from the index page
@return array | [
"Opens",
"an",
"existing",
"template",
"from",
"the",
"index",
"page"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/controllers/Index.php#L127-L152 | train | index_onOpenTemplate - Returns array with template data | [
30522,
2270,
3853,
5950,
1035,
21058,
11837,
18532,
15725,
1006,
1007,
1063,
1002,
2023,
1011,
1028,
9398,
24932,
2063,
15500,
10760,
4168,
1006,
1007,
1025,
1002,
2828,
1027,
5227,
1024,
1024,
7953,
1006,
1005,
2828,
1005,
1007,
1025,
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... |
octobercms/october | modules/backend/models/ImportModel.php | ImportModel.import | public function import($matches, $options = [])
{
$sessionKey = array_get($options, 'sessionKey');
$path = $this->getImportFilePath($sessionKey);
$data = $this->processImportData($path, $matches, $options);
return $this->importData($data, $sessionKey);
} | php | public function import($matches, $options = [])
{
$sessionKey = array_get($options, 'sessionKey');
$path = $this->getImportFilePath($sessionKey);
$data = $this->processImportData($path, $matches, $options);
return $this->importData($data, $sessionKey);
} | [
"public",
"function",
"import",
"(",
"$",
"matches",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"sessionKey",
"=",
"array_get",
"(",
"$",
"options",
",",
"'sessionKey'",
")",
";",
"$",
"path",
"=",
"$",
"this",
"->",
"getImportFilePath",
"(",
... | Import data based on column names matching header indexes in the CSV.
The $matches array should be in the format of:
[
0 => [db_name1, db_name2],
1 => [db_name3],
...
]
The key (0, 1) is the column index in the CSV and the value
is another array of target database column names. | [
"Import",
"data",
"based",
"on",
"column",
"names",
"matching",
"header",
"indexes",
"in",
"the",
"CSV",
".",
"The",
"$matches",
"array",
"should",
"be",
"in",
"the",
"format",
"of",
":"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/models/ImportModel.php#L69-L75 | train | Import the content of the matches into the grammar | [
30522,
2270,
3853,
12324,
1006,
1002,
3503,
1010,
1002,
7047,
1027,
1031,
1033,
1007,
1063,
1002,
5219,
14839,
1027,
9140,
1035,
2131,
1006,
1002,
7047,
1010,
1005,
5219,
14839,
1005,
1007,
1025,
1002,
4130,
1027,
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 | libs/HTML/QuickForm2/Container.php | HTML_QuickForm2_Container.addElement | public function addElement($elementOrType, $name = null, $attributes = null,
array $data = array())
{
if ($elementOrType instanceof HTML_QuickForm2_Node) {
return $this->appendChild($elementOrType);
} else {
return $this->appendChild(HTML_QuickF... | php | public function addElement($elementOrType, $name = null, $attributes = null,
array $data = array())
{
if ($elementOrType instanceof HTML_QuickForm2_Node) {
return $this->appendChild($elementOrType);
} else {
return $this->appendChild(HTML_QuickF... | [
"public",
"function",
"addElement",
"(",
"$",
"elementOrType",
",",
"$",
"name",
"=",
"null",
",",
"$",
"attributes",
"=",
"null",
",",
"array",
"$",
"data",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"$",
"elementOrType",
"instanceof",
"HTML_QuickForm... | Appends an element to the container (possibly creating it first)
If the first parameter is an instance of HTML_QuickForm2_Node then all
other parameters are ignored and the method just calls {@link appendChild()}.
In the other case the element is first created via
{@link HTML_QuickForm2_Factory::createElement()} and t... | [
"Appends",
"an",
"element",
"to",
"the",
"container",
"(",
"possibly",
"creating",
"it",
"first",
")"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Container.php#L218-L228 | train | Adds an element to the form | [
30522,
2270,
3853,
5587,
12260,
3672,
1006,
1002,
5783,
11589,
18863,
1010,
1002,
2171,
1027,
19701,
1010,
1002,
12332,
1027,
19701,
1010,
9140,
1002,
2951,
1027,
9140,
1006,
1007,
1007,
1063,
2065,
1006,
1002,
5783,
11589,
18863,
6013,
112... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Concurrency/DistributedList.php | DistributedList.remove | public function remove($items)
{
if (!is_array($items)) {
$items = array($items);
}
$allItems = $this->getAll();
foreach ($items as $item) {
$existingIndex = array_search($item, $allItems);
if ($existingIndex === false) {
return;
... | php | public function remove($items)
{
if (!is_array($items)) {
$items = array($items);
}
$allItems = $this->getAll();
foreach ($items as $item) {
$existingIndex = array_search($item, $allItems);
if ($existingIndex === false) {
return;
... | [
"public",
"function",
"remove",
"(",
"$",
"items",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"items",
")",
")",
"{",
"$",
"items",
"=",
"array",
"(",
"$",
"items",
")",
";",
"}",
"$",
"allItems",
"=",
"$",
"this",
"->",
"getAll",
"(",
")"... | Removes one or more items by value from the list in the option table.
Does not preserve array keys.
@param string|array $items | [
"Removes",
"one",
"or",
"more",
"items",
"by",
"value",
"from",
"the",
"list",
"in",
"the",
"option",
"table",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Concurrency/DistributedList.php#L114-L132 | train | Remove one or more items from the list | [
30522,
2270,
3853,
6366,
1006,
1002,
5167,
1007,
1063,
2065,
1006,
999,
2003,
1035,
9140,
1006,
1002,
5167,
1007,
1007,
1063,
1002,
5167,
1027,
9140,
1006,
1002,
5167,
1007,
1025,
1065,
1002,
2035,
4221,
5244,
1027,
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... |
getgrav/grav | system/src/Grav/Common/Markdown/ParsedownGravTrait.php | ParsedownGravTrait.isBlockCompletable | protected function isBlockCompletable($Type)
{
$completable = \in_array($Type, $this->completable_blocks) || method_exists($this, 'block' . $Type . 'Complete');
return $completable;
} | php | protected function isBlockCompletable($Type)
{
$completable = \in_array($Type, $this->completable_blocks) || method_exists($this, 'block' . $Type . 'Complete');
return $completable;
} | [
"protected",
"function",
"isBlockCompletable",
"(",
"$",
"Type",
")",
"{",
"$",
"completable",
"=",
"\\",
"in_array",
"(",
"$",
"Type",
",",
"$",
"this",
"->",
"completable_blocks",
")",
"||",
"method_exists",
"(",
"$",
"this",
",",
"'block'",
".",
"$",
... | Overrides the default behavior to allow for plugin-provided blocks to be completable
@param string $Type
@return bool | [
"Overrides",
"the",
"default",
"behavior",
"to",
"allow",
"for",
"plugin",
"-",
"provided",
"blocks",
"to",
"be",
"completable"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Markdown/ParsedownGravTrait.php#L129-L134 | train | Check if a block type can be completed | [
30522,
5123,
3853,
2003,
23467,
9006,
10814,
10880,
1006,
1002,
2828,
1007,
1063,
1002,
4012,
10814,
10880,
1027,
1032,
1999,
1035,
9140,
1006,
1002,
2828,
1010,
1002,
2023,
1011,
1028,
4012,
10814,
10880,
1035,
5991,
1007,
1064,
1064,
4118... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/AbstractRendererEngine.php | AbstractRendererEngine.setTheme | public function setTheme(FormView $view, $themes, $useDefaultThemes = true)
{
$cacheKey = $view->vars[self::CACHE_KEY_VAR];
// Do not cast, as casting turns objects into arrays of properties
$this->themes[$cacheKey] = \is_array($themes) ? $themes : [$themes];
$this->useDefaultThemes... | php | public function setTheme(FormView $view, $themes, $useDefaultThemes = true)
{
$cacheKey = $view->vars[self::CACHE_KEY_VAR];
// Do not cast, as casting turns objects into arrays of properties
$this->themes[$cacheKey] = \is_array($themes) ? $themes : [$themes];
$this->useDefaultThemes... | [
"public",
"function",
"setTheme",
"(",
"FormView",
"$",
"view",
",",
"$",
"themes",
",",
"$",
"useDefaultThemes",
"=",
"true",
")",
"{",
"$",
"cacheKey",
"=",
"$",
"view",
"->",
"vars",
"[",
"self",
"::",
"CACHE_KEY_VAR",
"]",
";",
"// Do not cast, as cast... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/AbstractRendererEngine.php#L47-L59 | train | Sets the theme of the form view | [
30522,
2270,
3853,
2275,
10760,
4168,
1006,
2433,
8584,
1002,
3193,
1010,
1002,
6991,
1010,
1002,
2109,
12879,
23505,
10760,
7834,
1027,
2995,
1007,
1063,
1002,
17053,
14839,
1027,
1002,
3193,
1011,
1028,
13075,
2015,
1031,
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... |
matomo-org/matomo | plugins/Login/PasswordResetter.php | PasswordResetter.getPasswordToResetTo | private function getPasswordToResetTo($login)
{
$optionName = self::getPasswordResetInfoOptionName($login);
$optionValue = Option::get($optionName);
$optionValue = json_decode($optionValue, $isAssoc = true);
return $optionValue;
} | php | private function getPasswordToResetTo($login)
{
$optionName = self::getPasswordResetInfoOptionName($login);
$optionValue = Option::get($optionName);
$optionValue = json_decode($optionValue, $isAssoc = true);
return $optionValue;
} | [
"private",
"function",
"getPasswordToResetTo",
"(",
"$",
"login",
")",
"{",
"$",
"optionName",
"=",
"self",
"::",
"getPasswordResetInfoOptionName",
"(",
"$",
"login",
")",
";",
"$",
"optionValue",
"=",
"Option",
"::",
"get",
"(",
"$",
"optionName",
")",
";",... | Gets password hash stored in password reset info.
@param string $login The user login to check for.
@return string|false The hashed password or false if no reset info exists. | [
"Gets",
"password",
"hash",
"stored",
"in",
"password",
"reset",
"info",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Login/PasswordResetter.php#L479-L485 | train | Get password to reset to | [
30522,
2797,
3853,
2131,
15194,
18351,
19277,
21678,
2080,
1006,
1002,
8833,
2378,
1007,
1063,
1002,
5724,
18442,
1027,
2969,
1024,
1024,
2131,
15194,
18351,
6072,
20624,
2078,
14876,
7361,
3508,
18442,
1006,
1002,
8833,
2378,
1007,
1025,
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/FileIntegrity.php | FileIntegrity.isFileFromPluginNotInManifest | protected static function isFileFromPluginNotInManifest($file, $pluginsInManifest)
{
if (strpos($file, 'plugins/') !== 0) {
return false;
}
if (substr_count($file, '/') < 2) {
// must be a file plugins/abc.xyz and not a plugin directory
return false;
... | php | protected static function isFileFromPluginNotInManifest($file, $pluginsInManifest)
{
if (strpos($file, 'plugins/') !== 0) {
return false;
}
if (substr_count($file, '/') < 2) {
// must be a file plugins/abc.xyz and not a plugin directory
return false;
... | [
"protected",
"static",
"function",
"isFileFromPluginNotInManifest",
"(",
"$",
"file",
",",
"$",
"pluginsInManifest",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"file",
",",
"'plugins/'",
")",
"!==",
"0",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"s... | If a plugin folder is not tracked in the manifest then we don't try to report any files in this folder
Could be a third party plugin or any plugin from the Marketplace
@param $file
@param $pluginsInManifest
@return bool | [
"If",
"a",
"plugin",
"folder",
"is",
"not",
"tracked",
"in",
"the",
"manifest",
"then",
"we",
"don",
"t",
"try",
"to",
"report",
"any",
"files",
"in",
"this",
"folder",
"Could",
"be",
"a",
"third",
"party",
"plugin",
"or",
"any",
"plugin",
"from",
"the... | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/FileIntegrity.php#L285-L302 | train | Check if a file is from a plugin not in the manifest | [
30522,
5123,
10763,
3853,
2003,
8873,
2571,
19699,
25377,
7630,
11528,
17048,
2378,
20799,
14081,
1006,
1002,
5371,
1010,
1002,
13354,
7076,
2378,
20799,
14081,
1007,
1063,
2065,
1006,
2358,
14536,
2891,
1006,
1002,
5371,
1010,
1005,
13354,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Displayers/Actions.php | Actions.display | public function display($callback = null)
{
if ($callback instanceof \Closure) {
$callback->call($this, $this);
}
$actions = $this->prepends;
foreach ($this->actions as $action) {
$method = 'render'.ucfirst($action);
array_push($actions, $this->{... | php | public function display($callback = null)
{
if ($callback instanceof \Closure) {
$callback->call($this, $this);
}
$actions = $this->prepends;
foreach ($this->actions as $action) {
$method = 'render'.ucfirst($action);
array_push($actions, $this->{... | [
"public",
"function",
"display",
"(",
"$",
"callback",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"callback",
"instanceof",
"\\",
"Closure",
")",
"{",
"$",
"callback",
"->",
"call",
"(",
"$",
"this",
",",
"$",
"this",
")",
";",
"}",
"$",
"actions",
"="... | {@inheritdoc} | [
"{"
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Grid/Displayers/Actions.php#L144-L160 | train | Display the page | [
30522,
2270,
3853,
4653,
1006,
1002,
2655,
5963,
1027,
19701,
1007,
1063,
2065,
1006,
1002,
2655,
5963,
6013,
11253,
1032,
8503,
1007,
1063,
1002,
2655,
5963,
1011,
1028,
2655,
1006,
1002,
2023,
1010,
1002,
2023,
1007,
1025,
1065,
1002,
4... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Auth/SendsPasswordResetEmails.php | SendsPasswordResetEmails.sendResetLinkFailedResponse | protected function sendResetLinkFailedResponse(Request $request, $response)
{
return back()
->withInput($request->only('email'))
->withErrors(['email' => trans($response)]);
} | php | protected function sendResetLinkFailedResponse(Request $request, $response)
{
return back()
->withInput($request->only('email'))
->withErrors(['email' => trans($response)]);
} | [
"protected",
"function",
"sendResetLinkFailedResponse",
"(",
"Request",
"$",
"request",
",",
"$",
"response",
")",
"{",
"return",
"back",
"(",
")",
"->",
"withInput",
"(",
"$",
"request",
"->",
"only",
"(",
"'email'",
")",
")",
"->",
"withErrors",
"(",
"["... | Get the response for a failed password reset link.
@param \Illuminate\Http\Request $request
@param string $response
@return \Illuminate\Http\RedirectResponse|\Illuminate\Http\JsonResponse | [
"Get",
"the",
"response",
"for",
"a",
"failed",
"password",
"reset",
"link",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Foundation/Auth/SendsPasswordResetEmails.php#L83-L88 | train | Send the failed reset link response | [
30522,
5123,
3853,
4604,
6072,
3388,
13767,
7011,
18450,
6072,
26029,
3366,
1006,
5227,
1002,
5227,
1010,
1002,
3433,
1007,
1063,
2709,
2067,
1006,
1007,
1011,
1028,
2306,
18780,
1006,
1002,
5227,
1011,
1028,
2069,
1006,
1005,
10373,
30524,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/CoreConsole/Commands/ClearCaches.php | ClearCaches.execute | protected function execute(InputInterface $input, OutputInterface $output)
{
// Note: the logic for this command must be refactored in this helper function below.
Filesystem::deleteAllCacheOnUpdate();
$this->writeSuccessMessage($output, array('Caches cleared'));
} | php | protected function execute(InputInterface $input, OutputInterface $output)
{
// Note: the logic for this command must be refactored in this helper function below.
Filesystem::deleteAllCacheOnUpdate();
$this->writeSuccessMessage($output, array('Caches cleared'));
} | [
"protected",
"function",
"execute",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"// Note: the logic for this command must be refactored in this helper function below.",
"Filesystem",
"::",
"deleteAllCacheOnUpdate",
"(",
")",
";",
"$",... | Execute command like: ./console core:clear-caches | [
"Execute",
"command",
"like",
":",
".",
"/",
"console",
"core",
":",
"clear",
"-",
"caches"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/CoreConsole/Commands/ClearCaches.php#L31-L37 | train | Delete all caches | [
30522,
5123,
3853,
15389,
1006,
7953,
18447,
2121,
12172,
1002,
7953,
1010,
6434,
18447,
2121,
12172,
1002,
6434,
1007,
1063,
1013,
1013,
3602,
1024,
1996,
7961,
2005,
2023,
3094,
2442,
2022,
25416,
18908,
30524,
2121,
3853,
2917,
1012,
676... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/ThemeManager.php | ThemeManager.setInstalled | public function setInstalled($code, $dirName = null)
{
if (!$dirName) {
$dirName = strtolower(str_replace('.', '-', $code));
}
$history = Parameter::get('system::theme.history', []);
$history[$code] = $dirName;
Parameter::set('system::theme.history', $history);
... | php | public function setInstalled($code, $dirName = null)
{
if (!$dirName) {
$dirName = strtolower(str_replace('.', '-', $code));
}
$history = Parameter::get('system::theme.history', []);
$history[$code] = $dirName;
Parameter::set('system::theme.history', $history);
... | [
"public",
"function",
"setInstalled",
"(",
"$",
"code",
",",
"$",
"dirName",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"dirName",
")",
"{",
"$",
"dirName",
"=",
"strtolower",
"(",
"str_replace",
"(",
"'.'",
",",
"'-'",
",",
"$",
"code",
")",
")",... | Flags a theme as being installed, so it is not downloaded twice.
@param string $code Theme code
@param string|null $dirName | [
"Flags",
"a",
"theme",
"as",
"being",
"installed",
"so",
"it",
"is",
"not",
"downloaded",
"twice",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/ThemeManager.php#L46-L55 | train | Set installed theme | [
30522,
2270,
3853,
2275,
7076,
9080,
3709,
1006,
1002,
3642,
1010,
1002,
16101,
18442,
1027,
19701,
1007,
1063,
2065,
1006,
999,
1002,
16101,
18442,
1007,
1063,
1002,
16101,
18442,
1027,
2358,
5339,
12898,
13777,
1006,
2358,
2099,
1035,
567... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Intl/DateFormatter/DateFormat/FullTransformer.php | FullTransformer.normalizeArray | protected function normalizeArray(array $data)
{
$ret = [];
foreach ($data as $key => $value) {
if (!\is_string($key)) {
continue;
}
$ret[$key[0]] = [
'value' => $value,
'pattern' => $key,
];
}
... | php | protected function normalizeArray(array $data)
{
$ret = [];
foreach ($data as $key => $value) {
if (!\is_string($key)) {
continue;
}
$ret[$key[0]] = [
'value' => $value,
'pattern' => $key,
];
}
... | [
"protected",
"function",
"normalizeArray",
"(",
"array",
"$",
"data",
")",
"{",
"$",
"ret",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"data",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"\\",
"is_string",
"(",
"$",
"key",
")",
... | Normalize a preg_replace match array, removing the numeric keys and returning an associative array
with the value and pattern values for the matched Transformer.
@return array | [
"Normalize",
"a",
"preg_replace",
"match",
"array",
"removing",
"the",
"numeric",
"keys",
"and",
"returning",
"an",
"associative",
"array",
"with",
"the",
"value",
"and",
"pattern",
"values",
"for",
"the",
"matched",
"Transformer",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Intl/DateFormatter/DateFormat/FullTransformer.php#L256-L272 | train | Normalize array to array | [
30522,
5123,
3853,
3671,
4697,
2906,
9447,
1006,
9140,
1002,
2951,
1007,
1063,
1002,
2128,
2102,
1027,
1031,
1033,
1025,
18921,
6776,
1006,
1002,
2951,
2004,
1002,
3145,
1027,
1028,
1002,
3643,
1007,
1063,
2065,
1006,
999,
1032,
2003,
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... |
laravel/framework | src/Illuminate/Database/Schema/PostgresBuilder.php | PostgresBuilder.getColumnListing | public function getColumnListing($table)
{
[$schema, $table] = $this->parseSchemaAndTable($table);
$table = $this->connection->getTablePrefix().$table;
$results = $this->connection->select(
$this->grammar->compileColumnListing(), [$schema, $table]
);
return $th... | php | public function getColumnListing($table)
{
[$schema, $table] = $this->parseSchemaAndTable($table);
$table = $this->connection->getTablePrefix().$table;
$results = $this->connection->select(
$this->grammar->compileColumnListing(), [$schema, $table]
);
return $th... | [
"public",
"function",
"getColumnListing",
"(",
"$",
"table",
")",
"{",
"[",
"$",
"schema",
",",
"$",
"table",
"]",
"=",
"$",
"this",
"->",
"parseSchemaAndTable",
"(",
"$",
"table",
")",
";",
"$",
"table",
"=",
"$",
"this",
"->",
"connection",
"->",
"... | Get the column listing for a given table.
@param string $table
@return array | [
"Get",
"the",
"column",
"listing",
"for",
"a",
"given",
"table",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Schema/PostgresBuilder.php#L108-L119 | train | Returns a column listing of a table. | [
30522,
2270,
3853,
2131,
25778,
2819,
20554,
2923,
2075,
1006,
1002,
2795,
1007,
1063,
1031,
1002,
8040,
28433,
1010,
1002,
2795,
1033,
1027,
1002,
2023,
1011,
1028,
11968,
8583,
5403,
2863,
5685,
10880,
1006,
1002,
2795,
1007,
1025,
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... |
overtrue/wechat | src/OfficialAccount/Broadcasting/Client.php | Client.previewVideo | public function previewVideo(string $mediaId, $reception, $method = self::PREVIEW_BY_OPENID)
{
return $this->previewMessage(new Media($mediaId, 'mpvideo'), $reception, $method);
} | php | public function previewVideo(string $mediaId, $reception, $method = self::PREVIEW_BY_OPENID)
{
return $this->previewMessage(new Media($mediaId, 'mpvideo'), $reception, $method);
} | [
"public",
"function",
"previewVideo",
"(",
"string",
"$",
"mediaId",
",",
"$",
"reception",
",",
"$",
"method",
"=",
"self",
"::",
"PREVIEW_BY_OPENID",
")",
"{",
"return",
"$",
"this",
"->",
"previewMessage",
"(",
"new",
"Media",
"(",
"$",
"mediaId",
",",
... | Preview a video message.
@param mixed $mediaId message
@param string $reception
@param string $method
@return \Psr\Http\Message\ResponseInterface|\EasyWeChat\Kernel\Support\Collection|array|object|string
@throws \EasyWeChat\Kernel\Exceptions\RuntimeException
@throws \EasyWeChat\Kernel\Exceptions\InvalidConfigExce... | [
"Preview",
"a",
"video",
"message",
"."
] | 120c72faaa93c270365bc75c73c362d5fd583209 | https://github.com/overtrue/wechat/blob/120c72faaa93c270365bc75c73c362d5fd583209/src/OfficialAccount/Broadcasting/Client.php#L299-L302 | train | Preview a video message | [
30522,
2270,
3853,
19236,
17258,
8780,
1006,
5164,
1002,
2865,
3593,
1010,
1002,
7684,
1010,
1002,
4118,
1027,
2969,
1024,
1024,
19236,
1035,
2011,
1035,
2330,
3593,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
19236,
7834,
3736,
3351,
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/Common/Page/Page.php | Page.slug | public function slug($var = null)
{
if ($var !== null && $var !== '') {
$this->slug = $var;
}
if (empty($this->slug)) {
$this->slug = $this->adjustRouteCase(preg_replace(PAGE_ORDER_PREFIX_REGEX, '', $this->folder)) ?: null;
}
return $this->slug;
... | php | public function slug($var = null)
{
if ($var !== null && $var !== '') {
$this->slug = $var;
}
if (empty($this->slug)) {
$this->slug = $this->adjustRouteCase(preg_replace(PAGE_ORDER_PREFIX_REGEX, '', $this->folder)) ?: null;
}
return $this->slug;
... | [
"public",
"function",
"slug",
"(",
"$",
"var",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"var",
"!==",
"null",
"&&",
"$",
"var",
"!==",
"''",
")",
"{",
"$",
"this",
"->",
"slug",
"=",
"$",
"var",
";",
"}",
"if",
"(",
"empty",
"(",
"$",
"this",
... | Gets and Sets the slug for the Page. The slug is used in the URL routing. If not set it uses
the parent folder from the path
@param string $var the slug, e.g. 'my-blog'
@return string the slug | [
"Gets",
"and",
"Sets",
"the",
"slug",
"for",
"the",
"Page",
".",
"The",
"slug",
"is",
"used",
"in",
"the",
"URL",
"routing",
".",
"If",
"not",
"set",
"it",
"uses",
"the",
"parent",
"folder",
"from",
"the",
"path"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Page/Page.php#L1761-L1772 | train | Get the slug of the page | [
30522,
2270,
3853,
23667,
1006,
1002,
13075,
1027,
19701,
1007,
1063,
2065,
1006,
1002,
13075,
999,
1027,
1027,
19701,
1004,
1004,
1002,
13075,
999,
1027,
1027,
1005,
1005,
1007,
1063,
1002,
2023,
1011,
1028,
23667,
1027,
1002,
13075,
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... |
matomo-org/matomo | core/Archive/Chunk.php | Chunk.isRecordNameAChunk | public function isRecordNameAChunk($recordName)
{
$posAppendix = $this->getEndPosOfChunkAppendix($recordName);
if (false === $posAppendix) {
return false;
}
// will contain "0_99" of "chunk_0_99"
$blobId = substr($recordName, $posAppendix);
return $this... | php | public function isRecordNameAChunk($recordName)
{
$posAppendix = $this->getEndPosOfChunkAppendix($recordName);
if (false === $posAppendix) {
return false;
}
// will contain "0_99" of "chunk_0_99"
$blobId = substr($recordName, $posAppendix);
return $this... | [
"public",
"function",
"isRecordNameAChunk",
"(",
"$",
"recordName",
")",
"{",
"$",
"posAppendix",
"=",
"$",
"this",
"->",
"getEndPosOfChunkAppendix",
"(",
"$",
"recordName",
")",
";",
"if",
"(",
"false",
"===",
"$",
"posAppendix",
")",
"{",
"return",
"false"... | Detects whether a recordName like 'Actions_ActionUrls_chunk_0_99' or 'Actions_ActionUrls' belongs to a
chunk or not.
To be a valid recordName that belongs to a chunk it must end with '_chunk_NUMERIC_NUMERIC'.
@param string $recordName
@return bool | [
"Detects",
"whether",
"a",
"recordName",
"like",
"Actions_ActionUrls_chunk_0_99",
"or",
"Actions_ActionUrls",
"belongs",
"to",
"a",
"chunk",
"or",
"not",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Archive/Chunk.php#L77-L89 | train | Is Record Name a chunk? | [
30522,
2270,
3853,
2003,
2890,
27108,
28911,
4168,
6776,
16814,
1006,
1002,
2501,
18442,
1007,
1063,
1002,
13433,
3736,
21512,
16089,
2595,
1027,
1002,
2023,
1011,
1028,
2131,
10497,
6873,
6499,
11329,
17157,
2912,
30524,
4135,
17062,
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... |
dompdf/dompdf | src/Css/Style.php | Style.set_border_spacing | function set_border_spacing($val)
{
$arr = explode(" ", $val);
if (count($arr) == 1) {
$arr[1] = $arr[0];
}
//see __set and __get, on all assignments clear cache, not needed on direct set through __set
$this->_prop_cache["border_spacing"] = null;
$this->... | php | function set_border_spacing($val)
{
$arr = explode(" ", $val);
if (count($arr) == 1) {
$arr[1] = $arr[0];
}
//see __set and __get, on all assignments clear cache, not needed on direct set through __set
$this->_prop_cache["border_spacing"] = null;
$this->... | [
"function",
"set_border_spacing",
"(",
"$",
"val",
")",
"{",
"$",
"arr",
"=",
"explode",
"(",
"\" \"",
",",
"$",
"val",
")",
";",
"if",
"(",
"count",
"(",
"$",
"arr",
")",
"==",
"1",
")",
"{",
"$",
"arr",
"[",
"1",
"]",
"=",
"$",
"arr",
"[",
... | Sets the border spacing
@link http://www.w3.org/TR/CSS21/box.html#border-properties
@param float $val | [
"Sets",
"the",
"border",
"spacing"
] | 75f13c700009be21a1965dc2c5b68a8708c22ba2 | https://github.com/dompdf/dompdf/blob/75f13c700009be21a1965dc2c5b68a8708c22ba2/src/Css/Style.php#L2484-L2495 | train | set border spacing | [
30522,
3853,
2275,
1035,
3675,
1035,
12403,
6129,
1006,
1002,
11748,
1007,
1063,
1002,
12098,
2099,
1027,
15044,
1006,
1000,
1000,
1010,
1002,
11748,
1007,
1025,
2065,
1006,
4175,
1006,
1002,
12098,
2099,
1007,
1027,
1027,
1015,
1007,
1063,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/HttpFoundation/Request.php | Request.getMethod | public function getMethod()
{
if (null !== $this->method) {
return $this->method;
}
$this->method = strtoupper($this->server->get('REQUEST_METHOD', 'GET'));
if ('POST' !== $this->method) {
return $this->method;
}
$method = $this->headers->ge... | php | public function getMethod()
{
if (null !== $this->method) {
return $this->method;
}
$this->method = strtoupper($this->server->get('REQUEST_METHOD', 'GET'));
if ('POST' !== $this->method) {
return $this->method;
}
$method = $this->headers->ge... | [
"public",
"function",
"getMethod",
"(",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"method",
")",
"{",
"return",
"$",
"this",
"->",
"method",
";",
"}",
"$",
"this",
"->",
"method",
"=",
"strtoupper",
"(",
"$",
"this",
"->",
"server",
"-... | Gets the request "intended" method.
If the X-HTTP-Method-Override header is set, and if the method is a POST,
then it is used to determine the "real" intended HTTP method.
The _method request parameter can also be used to determine the HTTP method,
but only if enableHttpMethodParameterOverride() has been called.
The... | [
"Gets",
"the",
"request",
"intended",
"method",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpFoundation/Request.php#L1215-L1248 | train | Get HTTP method | [
30522,
2270,
3853,
2131,
11368,
6806,
2094,
1006,
1007,
1063,
2065,
1006,
19701,
999,
1027,
1027,
1002,
2023,
1011,
1028,
4118,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
4118,
1025,
1065,
1002,
2023,
1011,
1028,
4118,
1027,
2358,
5339,
71... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Form/Tools.php | Tools.disableView | public function disableView(bool $disable = true)
{
if ($disable) {
array_delete($this->tools, 'view');
} elseif (!in_array('view', $this->tools)) {
array_push($this->tools, 'view');
}
return $this;
} | php | public function disableView(bool $disable = true)
{
if ($disable) {
array_delete($this->tools, 'view');
} elseif (!in_array('view', $this->tools)) {
array_push($this->tools, 'view');
}
return $this;
} | [
"public",
"function",
"disableView",
"(",
"bool",
"$",
"disable",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"disable",
")",
"{",
"array_delete",
"(",
"$",
"this",
"->",
"tools",
",",
"'view'",
")",
";",
"}",
"elseif",
"(",
"!",
"in_array",
"(",
"'view'"... | Disable `edit` tool.
@return $this | [
"Disable",
"edit",
"tool",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Form/Tools.php#L115-L124 | train | Disable view tools | [
30522,
2270,
3853,
4487,
19150,
8584,
1006,
22017,
2140,
1002,
4487,
19150,
1027,
2995,
1007,
1063,
2065,
1006,
1002,
4487,
19150,
1007,
1063,
9140,
1035,
3972,
12870,
1006,
1002,
2023,
1011,
1028,
5906,
1010,
1005,
3193,
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... |
laravel/framework | src/Illuminate/Foundation/Console/MailMakeCommand.php | MailMakeCommand.handle | public function handle()
{
if (parent::handle() === false && ! $this->option('force')) {
return;
}
if ($this->option('markdown')) {
$this->writeMarkdownTemplate();
}
} | php | public function handle()
{
if (parent::handle() === false && ! $this->option('force')) {
return;
}
if ($this->option('markdown')) {
$this->writeMarkdownTemplate();
}
} | [
"public",
"function",
"handle",
"(",
")",
"{",
"if",
"(",
"parent",
"::",
"handle",
"(",
")",
"===",
"false",
"&&",
"!",
"$",
"this",
"->",
"option",
"(",
"'force'",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"option",
"(",
... | Execute the console command.
@return void | [
"Execute",
"the",
"console",
"command",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Foundation/Console/MailMakeCommand.php#L36-L45 | train | Handle the page | [
30522,
2270,
3853,
5047,
1006,
1007,
1063,
2065,
1006,
6687,
1024,
1024,
5047,
1006,
1007,
1027,
1027,
1027,
6270,
1004,
1004,
999,
1002,
2023,
1011,
1028,
5724,
1006,
1005,
2486,
1005,
1007,
1007,
1063,
2709,
1025,
1065,
2065,
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... |
matomo-org/matomo | core/SettingsPiwik.php | SettingsPiwik.getKnownSegmentsToArchiveForSite | public static function getKnownSegmentsToArchiveForSite($idSite)
{
$cacheId = 'KnownSegmentsToArchiveForSite' . $idSite;
$cache = PiwikCache::getTransientCache();
if ($cache->contains($cacheId)) {
return $cache->fetch($cacheId);
}
$segments = array();
/... | php | public static function getKnownSegmentsToArchiveForSite($idSite)
{
$cacheId = 'KnownSegmentsToArchiveForSite' . $idSite;
$cache = PiwikCache::getTransientCache();
if ($cache->contains($cacheId)) {
return $cache->fetch($cacheId);
}
$segments = array();
/... | [
"public",
"static",
"function",
"getKnownSegmentsToArchiveForSite",
"(",
"$",
"idSite",
")",
"{",
"$",
"cacheId",
"=",
"'KnownSegmentsToArchiveForSite'",
".",
"$",
"idSite",
";",
"$",
"cache",
"=",
"PiwikCache",
"::",
"getTransientCache",
"(",
")",
";",
"if",
"(... | Returns the list of stored segments to pre-process for an individual site when executing
cron archiving.
@param int $idSite The ID of the site to get stored segments for.
@return string[] The list of stored segments that apply to the requested site. | [
"Returns",
"the",
"list",
"of",
"stored",
"segments",
"to",
"pre",
"-",
"process",
"for",
"an",
"individual",
"site",
"when",
"executing",
"cron",
"archiving",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/SettingsPiwik.php#L116-L158 | train | Returns the list of all segments that should be pre - processed for a specific site. | [
30522,
2270,
10763,
3853,
2131,
2243,
19779,
12325,
21693,
11187,
3406,
2906,
5428,
3726,
29278,
28032,
2063,
1006,
1002,
8909,
28032,
2063,
1007,
1063,
1002,
17053,
3593,
1027,
1005,
2124,
3366,
21693,
11187,
3406,
2906,
5428,
3726,
29278,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Adaline.php | Adaline.runTraining | protected function runTraining(array $samples, array $targets): void
{
// The cost function is the sum of squares
$callback = function ($weights, $sample, $target) {
$this->weights = $weights;
$output = $this->output($sample);
$gradient = $output - $target;
... | php | protected function runTraining(array $samples, array $targets): void
{
// The cost function is the sum of squares
$callback = function ($weights, $sample, $target) {
$this->weights = $weights;
$output = $this->output($sample);
$gradient = $output - $target;
... | [
"protected",
"function",
"runTraining",
"(",
"array",
"$",
"samples",
",",
"array",
"$",
"targets",
")",
":",
"void",
"{",
"// The cost function is the sum of squares",
"$",
"callback",
"=",
"function",
"(",
"$",
"weights",
",",
"$",
"sample",
",",
"$",
"targe... | Adapts the weights with respect to given samples and targets
by use of gradient descent learning rule | [
"Adapts",
"the",
"weights",
"with",
"respect",
"to",
"given",
"samples",
"and",
"targets",
"by",
"use",
"of",
"gradient",
"descent",
"learning",
"rule"
] | f6aa1a59b0525b8fca3d2786d661ab3e70904016 | https://github.com/php-ai/php-ml/blob/f6aa1a59b0525b8fca3d2786d661ab3e70904016/src/Classification/Linear/Adaline.php#L58-L74 | train | Runs the gradient descent | [
30522,
5123,
3853,
2448,
23654,
2075,
1006,
9140,
1002,
8168,
1010,
9140,
1002,
7889,
1007,
1024,
11675,
1063,
1013,
1013,
1996,
3465,
3853,
2003,
1996,
7680,
1997,
14320,
1002,
2655,
5963,
1027,
3853,
1006,
1002,
15871,
1010,
1002,
7099,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Validate/File/IsImage.php | Zend_Validate_File_IsImage._throw | protected function _throw($file, $errorType)
{
$this->_value = $file['name'];
switch($errorType) {
case Zend_Validate_File_MimeType::FALSE_TYPE :
$errorType = self::FALSE_TYPE;
break;
case Zend_Validate_File_MimeType::NOT_DETECTED :
... | php | protected function _throw($file, $errorType)
{
$this->_value = $file['name'];
switch($errorType) {
case Zend_Validate_File_MimeType::FALSE_TYPE :
$errorType = self::FALSE_TYPE;
break;
case Zend_Validate_File_MimeType::NOT_DETECTED :
... | [
"protected",
"function",
"_throw",
"(",
"$",
"file",
",",
"$",
"errorType",
")",
"{",
"$",
"this",
"->",
"_value",
"=",
"$",
"file",
"[",
"'name'",
"]",
";",
"switch",
"(",
"$",
"errorType",
")",
"{",
"case",
"Zend_Validate_File_MimeType",
"::",
"FALSE_T... | Throws an error of the given type
Duplicates parent method due to OOP Problem with late static binding in PHP 5.2
@param string $file
@param string $errorType
@return false | [
"Throws",
"an",
"error",
"of",
"the",
"given",
"type",
"Duplicates",
"parent",
"method",
"due",
"to",
"OOP",
"Problem",
"with",
"late",
"static",
"binding",
"in",
"PHP",
"5",
".",
"2"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Validate/File/IsImage.php#L155-L172 | train | Throw an error for a file | [
30522,
5123,
3853,
1035,
5466,
1006,
1002,
5371,
1010,
1002,
7561,
13874,
1007,
1063,
1002,
2023,
1011,
1028,
1035,
3643,
1027,
1002,
5371,
1031,
1005,
2171,
1005,
1033,
1025,
6942,
1006,
1002,
7561,
13874,
1007,
1063,
2553,
16729,
2094,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Doctrine/ContainerAwareEventManager.php | ContainerAwareEventManager.removeEventListener | public function removeEventListener($events, $listener)
{
if (\is_string($listener)) {
$hash = '_service_'.$listener;
} else {
// Picks the hash code related to that listener
$hash = spl_object_hash($listener);
}
foreach ((array) $events as $event... | php | public function removeEventListener($events, $listener)
{
if (\is_string($listener)) {
$hash = '_service_'.$listener;
} else {
// Picks the hash code related to that listener
$hash = spl_object_hash($listener);
}
foreach ((array) $events as $event... | [
"public",
"function",
"removeEventListener",
"(",
"$",
"events",
",",
"$",
"listener",
")",
"{",
"if",
"(",
"\\",
"is_string",
"(",
"$",
"listener",
")",
")",
"{",
"$",
"hash",
"=",
"'_service_'",
".",
"$",
"listener",
";",
"}",
"else",
"{",
"// Picks ... | Removes an event listener from the specified events.
@param string|array $events
@param object|string $listener | [
"Removes",
"an",
"event",
"listener",
"from",
"the",
"specified",
"events",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bridge/Doctrine/ContainerAwareEventManager.php#L125-L140 | train | Removes an event listener | [
30522,
2270,
3853,
6366,
18697,
3372,
9863,
24454,
1006,
1002,
2824,
1010,
1002,
19373,
1007,
1063,
2065,
1006,
1032,
2003,
1035,
5164,
1006,
1002,
19373,
1007,
1007,
1063,
1002,
23325,
1027,
1005,
1035,
2326,
1035,
1005,
1012,
1002,
19373,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.php | Db.dropTables | public static function dropTables($tables)
{
if (!is_array($tables)) {
$tables = array($tables);
}
return self::query("DROP TABLE `" . implode('`,`', $tables) . "`");
} | php | public static function dropTables($tables)
{
if (!is_array($tables)) {
$tables = array($tables);
}
return self::query("DROP TABLE `" . implode('`,`', $tables) . "`");
} | [
"public",
"static",
"function",
"dropTables",
"(",
"$",
"tables",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"tables",
")",
")",
"{",
"$",
"tables",
"=",
"array",
"(",
"$",
"tables",
")",
";",
"}",
"return",
"self",
"::",
"query",
"(",
"\"DROP... | Drops the supplied table or tables.
@param string|array $tables The name of the table to drop or an array of table names to drop.
Table names must be prefixed (see {@link Piwik\Common::prefixTable()}).
@return \Zend_Db_Statement | [
"Drops",
"the",
"supplied",
"table",
"or",
"tables",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Db.php#L397-L404 | train | Drops all tables in the current language | [
30522,
2270,
10763,
3853,
4530,
10880,
2015,
1006,
1002,
7251,
1007,
1063,
2065,
1006,
999,
2003,
1035,
9140,
1006,
1002,
7251,
1007,
1007,
1063,
1002,
30524,
1002,
7251,
1007,
1012,
1000,
1036,
1000,
1007,
1025,
1065,
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,
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/AsPivot.php | AsPivot.fromAttributes | public static function fromAttributes(Model $parent, $attributes, $table, $exists = false)
{
$instance = new static;
$instance->timestamps = $instance->hasTimestampAttributes($attributes);
// The pivot model is a "dynamic" model since we will set the tables dynamically
// for the i... | php | public static function fromAttributes(Model $parent, $attributes, $table, $exists = false)
{
$instance = new static;
$instance->timestamps = $instance->hasTimestampAttributes($attributes);
// The pivot model is a "dynamic" model since we will set the tables dynamically
// for the i... | [
"public",
"static",
"function",
"fromAttributes",
"(",
"Model",
"$",
"parent",
",",
"$",
"attributes",
",",
"$",
"table",
",",
"$",
"exists",
"=",
"false",
")",
"{",
"$",
"instance",
"=",
"new",
"static",
";",
"$",
"instance",
"->",
"timestamps",
"=",
... | Create a new pivot model instance.
@param \Illuminate\Database\Eloquent\Model $parent
@param array $attributes
@param string $table
@param bool $exists
@return static | [
"Create",
"a",
"new",
"pivot",
"model",
"instance",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Relations/Concerns/AsPivot.php#L41-L63 | train | Create a new instance of the class based on the attributes | [
30522,
2270,
10763,
3853,
2013,
19321,
3089,
8569,
4570,
1006,
2944,
1002,
6687,
1010,
1002,
12332,
1010,
1002,
2795,
1010,
1002,
6526,
1027,
6270,
1007,
1063,
1002,
6013,
1027,
2047,
10763,
1025,
1002,
6013,
1011,
1028,
2335,
15464,
4523,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
apache/thrift | lib/php/lib/Transport/TFramedTransport.php | TFramedTransport.readFrame | private function readFrame()
{
$buf = $this->transport_->readAll(4);
$val = unpack('N', $buf);
$sz = $val[1];
$this->rBuf_ = $this->transport_->readAll($sz);
} | php | private function readFrame()
{
$buf = $this->transport_->readAll(4);
$val = unpack('N', $buf);
$sz = $val[1];
$this->rBuf_ = $this->transport_->readAll($sz);
} | [
"private",
"function",
"readFrame",
"(",
")",
"{",
"$",
"buf",
"=",
"$",
"this",
"->",
"transport_",
"->",
"readAll",
"(",
"4",
")",
";",
"$",
"val",
"=",
"unpack",
"(",
"'N'",
",",
"$",
"buf",
")",
";",
"$",
"sz",
"=",
"$",
"val",
"[",
"1",
... | Reads a chunk of data into the internal read buffer. | [
"Reads",
"a",
"chunk",
"of",
"data",
"into",
"the",
"internal",
"read",
"buffer",
"."
] | acdd4226c210336e9e15eb812e5932a645fcd5ce | https://github.com/apache/thrift/blob/acdd4226c210336e9e15eb812e5932a645fcd5ce/lib/php/lib/Transport/TFramedTransport.php#L145-L152 | train | Read the next frame from the transport stream. | [
30522,
2797,
3853,
3191,
15643,
1006,
1007,
1063,
1002,
20934,
2546,
1027,
1002,
2023,
1011,
1028,
3665,
1035,
1011,
1028,
3191,
8095,
1006,
1018,
1007,
1025,
1002,
11748,
1027,
4895,
23947,
1006,
1005,
1050,
1005,
1010,
1002,
20934,
2546,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/RouteGroup.php | RouteGroup.formatPrefix | protected static function formatPrefix($new, $old)
{
$old = $old['prefix'] ?? null;
return isset($new['prefix']) ? trim($old, '/').'/'.trim($new['prefix'], '/') : $old;
} | php | protected static function formatPrefix($new, $old)
{
$old = $old['prefix'] ?? null;
return isset($new['prefix']) ? trim($old, '/').'/'.trim($new['prefix'], '/') : $old;
} | [
"protected",
"static",
"function",
"formatPrefix",
"(",
"$",
"new",
",",
"$",
"old",
")",
"{",
"$",
"old",
"=",
"$",
"old",
"[",
"'prefix'",
"]",
"??",
"null",
";",
"return",
"isset",
"(",
"$",
"new",
"[",
"'prefix'",
"]",
")",
"?",
"trim",
"(",
... | Format the prefix for the new group attributes.
@param array $new
@param array $old
@return string|null | [
"Format",
"the",
"prefix",
"for",
"the",
"new",
"group",
"attributes",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/RouteGroup.php#L58-L63 | train | Format the prefix of the new page | [
30522,
5123,
10763,
3853,
4289,
28139,
8873,
2595,
1006,
1002,
2047,
1010,
1002,
2214,
1007,
1063,
1002,
2214,
1027,
1002,
2214,
1031,
1005,
17576,
1005,
1033,
1029,
1029,
19701,
1025,
2709,
26354,
3388,
1006,
1002,
2047,
1031,
1005,
17576,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.getUpdatableThemes | public function getUpdatableThemes()
{
$items = [];
$repository = $this->repository['themes'];
// local cache to speed things up
if (isset($this->cache[__METHOD__])) {
return $this->cache[__METHOD__];
}
foreach ($this->installed['themes'] as $slug => $pl... | php | public function getUpdatableThemes()
{
$items = [];
$repository = $this->repository['themes'];
// local cache to speed things up
if (isset($this->cache[__METHOD__])) {
return $this->cache[__METHOD__];
}
foreach ($this->installed['themes'] as $slug => $pl... | [
"public",
"function",
"getUpdatableThemes",
"(",
")",
"{",
"$",
"items",
"=",
"[",
"]",
";",
"$",
"repository",
"=",
"$",
"this",
"->",
"repository",
"[",
"'themes'",
"]",
";",
"// local cache to speed things up",
"if",
"(",
"isset",
"(",
"$",
"this",
"->"... | Returns an array of Themes that can be updated.
The Themes are extended with the `available` property that relies to the remote version
@return array Array of updatable Themes | [
"Returns",
"an",
"array",
"of",
"Themes",
"that",
"can",
"be",
"updated",
".",
"The",
"Themes",
"are",
"extended",
"with",
"the",
"available",
"property",
"that",
"relies",
"to",
"the",
"remote",
"version"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/GPM/GPM.php#L312-L341 | train | Return list of themes that are updatable | [
30522,
2270,
3853,
2131,
6279,
2850,
10880,
10760,
7834,
1006,
1007,
1063,
1002,
5167,
1027,
1031,
1033,
1025,
1002,
22409,
1027,
1002,
2023,
1011,
1028,
22409,
1031,
1005,
6991,
1005,
1033,
1025,
1013,
1013,
2334,
17053,
2000,
3177,
2477,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Tracker/Model.php | Model.isSiteEmpty | public function isSiteEmpty($siteId)
{
$sql = sprintf('SELECT idsite FROM %s WHERE idsite = ? limit 1', Common::prefixTable('log_visit'));
$result = \Piwik\Db::fetchOne($sql, array($siteId));
return $result == null;
} | php | public function isSiteEmpty($siteId)
{
$sql = sprintf('SELECT idsite FROM %s WHERE idsite = ? limit 1', Common::prefixTable('log_visit'));
$result = \Piwik\Db::fetchOne($sql, array($siteId));
return $result == null;
} | [
"public",
"function",
"isSiteEmpty",
"(",
"$",
"siteId",
")",
"{",
"$",
"sql",
"=",
"sprintf",
"(",
"'SELECT idsite FROM %s WHERE idsite = ? limit 1'",
",",
"Common",
"::",
"prefixTable",
"(",
"'log_visit'",
")",
")",
";",
"$",
"result",
"=",
"\\",
"Piwik",
"\... | Returns true if the site doesn't have raw data.
@param int $siteId
@return bool | [
"Returns",
"true",
"if",
"the",
"site",
"doesn",
"t",
"have",
"raw",
"data",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Tracker/Model.php#L421-L428 | train | Returns true if the site is empty. | [
30522,
2270,
3853,
26354,
4221,
6633,
13876,
2100,
1006,
1002,
2609,
3593,
1007,
1063,
1002,
29296,
1027,
9043,
2546,
1006,
1005,
7276,
8909,
28032,
2063,
2013,
1003,
1055,
2073,
8909,
28032,
2063,
1027,
1029,
5787,
1015,
1005,
1010,
2691,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Renderer/Php.php | Php.flatRender | public function flatRender($dataTable = null)
{
if (is_null($dataTable)) {
$dataTable = $this->table;
}
if (is_array($dataTable)) {
$flatArray = $dataTable;
if (self::shouldWrapArrayBeforeRendering($flatArray)) {
$flatArray = array($flatAr... | php | public function flatRender($dataTable = null)
{
if (is_null($dataTable)) {
$dataTable = $this->table;
}
if (is_array($dataTable)) {
$flatArray = $dataTable;
if (self::shouldWrapArrayBeforeRendering($flatArray)) {
$flatArray = array($flatAr... | [
"public",
"function",
"flatRender",
"(",
"$",
"dataTable",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"dataTable",
")",
")",
"{",
"$",
"dataTable",
"=",
"$",
"this",
"->",
"table",
";",
"}",
"if",
"(",
"is_array",
"(",
"$",
"dataTable",
... | Produces a flat php array from the DataTable, putting "columns" and "metadata" on the same level.
For example, when a originalRender() would be
array( 'columns' => array( 'col1_name' => value1, 'col2_name' => value2 ),
'metadata' => array( 'metadata1_name' => value_metadata) )
a flatRender() is
array( 'col1_name' =>... | [
"Produces",
"a",
"flat",
"php",
"array",
"from",
"the",
"DataTable",
"putting",
"columns",
"and",
"metadata",
"on",
"the",
"same",
"level",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable/Renderer/Php.php#L103-L141 | train | Figure out the flat array of the DataTable | [
30522,
2270,
3853,
4257,
7389,
4063,
1006,
1002,
2951,
10880,
1027,
19701,
1007,
1063,
2065,
1006,
2003,
1035,
19701,
1006,
1002,
2951,
10880,
1007,
1007,
1063,
1002,
2951,
10880,
1027,
1002,
2023,
1011,
1028,
2795,
1025,
1065,
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/File/AbstractFile.php | AbstractFile.rename | public function rename(string $path): bool
{
if ($this->exists() && !@rename($this->filepath, $path)) {
return false;
}
$this->setFilepath($path);
return true;
} | php | public function rename(string $path): bool
{
if ($this->exists() && !@rename($this->filepath, $path)) {
return false;
}
$this->setFilepath($path);
return true;
} | [
"public",
"function",
"rename",
"(",
"string",
"$",
"path",
")",
":",
"bool",
"{",
"if",
"(",
"$",
"this",
"->",
"exists",
"(",
")",
"&&",
"!",
"@",
"rename",
"(",
"$",
"this",
"->",
"filepath",
",",
"$",
"path",
")",
")",
"{",
"return",
"false",... | {@inheritdoc}
@see FileInterface::rename() | [
"{"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Framework/File/AbstractFile.php#L307-L316 | train | Renames the file | [
30522,
2270,
3853,
14916,
14074,
1006,
5164,
1002,
4130,
1007,
1024,
22017,
2140,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
6526,
1006,
30524,
1025,
2709,
2995,
1025,
1065,
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,
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 | Worker.php | Worker.writeConnectionsStatisticsToStatusFile | protected static function writeConnectionsStatisticsToStatusFile()
{
// For master process.
if (static::$_masterPid === posix_getpid()) {
file_put_contents(static::$_statisticsFile, "--------------------------------------------------------------------- WORKERMAN CONNECTION STATUS -------... | php | protected static function writeConnectionsStatisticsToStatusFile()
{
// For master process.
if (static::$_masterPid === posix_getpid()) {
file_put_contents(static::$_statisticsFile, "--------------------------------------------------------------------- WORKERMAN CONNECTION STATUS -------... | [
"protected",
"static",
"function",
"writeConnectionsStatisticsToStatusFile",
"(",
")",
"{",
"// For master process.",
"if",
"(",
"static",
"::",
"$",
"_masterPid",
"===",
"posix_getpid",
"(",
")",
")",
"{",
"file_put_contents",
"(",
"static",
"::",
"$",
"_statistics... | Write statistics data to disk.
@return void | [
"Write",
"statistics",
"data",
"to",
"disk",
"."
] | 13649907f05014fcfffcfccaef01e63ad3339351 | https://github.com/walkor/Workerman/blob/13649907f05014fcfffcfccaef01e63ad3339351/Worker.php#L1930-L2001 | train | Writes the statistics to the status file | [
30522,
5123,
10763,
3853,
4339,
8663,
2638,
22014,
9153,
16774,
6558,
13122,
29336,
2271,
8873,
2571,
1006,
1007,
1063,
1013,
1013,
2005,
3040,
2832,
1012,
2065,
1006,
10763,
1024,
1024,
1002,
1035,
3040,
23267,
1027,
1027,
1027,
13433,
533... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/OfficialAccount/Semantic/Client.php | Client.query | public function query(string $keyword, string $categories, array $optional = [])
{
$params = [
'query' => $keyword,
'category' => $categories,
'appid' => $this->app['config']['app_id'],
];
return $this->httpPostJson('semantic/semproxy/search', array_merge... | php | public function query(string $keyword, string $categories, array $optional = [])
{
$params = [
'query' => $keyword,
'category' => $categories,
'appid' => $this->app['config']['app_id'],
];
return $this->httpPostJson('semantic/semproxy/search', array_merge... | [
"public",
"function",
"query",
"(",
"string",
"$",
"keyword",
",",
"string",
"$",
"categories",
",",
"array",
"$",
"optional",
"=",
"[",
"]",
")",
"{",
"$",
"params",
"=",
"[",
"'query'",
"=>",
"$",
"keyword",
",",
"'category'",
"=>",
"$",
"categories"... | Get the semantic content of giving string.
@param string $keyword
@param string $categories
@param array $optional
@return \Psr\Http\Message\ResponseInterface|\EasyWeChat\Kernel\Support\Collection|array|object|string | [
"Get",
"the",
"semantic",
"content",
"of",
"giving",
"string",
"."
] | 120c72faaa93c270365bc75c73c362d5fd583209 | https://github.com/overtrue/wechat/blob/120c72faaa93c270365bc75c73c362d5fd583209/src/OfficialAccount/Semantic/Client.php#L32-L41 | train | Search for words in the semantic proxy. | [
30522,
2270,
3853,
23032,
1006,
5164,
1002,
3145,
18351,
1010,
5164,
1002,
7236,
1010,
9140,
1002,
11887,
1027,
1031,
1033,
1007,
1063,
1002,
11498,
5244,
1027,
1031,
1005,
23032,
1005,
1027,
1028,
1002,
3145,
18351,
1010,
1005,
4696,
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... |
matomo-org/matomo | libs/Zend/Cache/Backend/Xcache.php | Zend_Cache_Backend_Xcache.save | public function save($data, $id, $tags = array(), $specificLifetime = false)
{
$lifetime = $this->getLifetime($specificLifetime);
$result = xcache_set($id, array($data, time()), $lifetime);
if (count($tags) > 0) {
$this->_log(self::TAGS_UNSUPPORTED_BY_SAVE_OF_XCACHE_BACKEND);
... | php | public function save($data, $id, $tags = array(), $specificLifetime = false)
{
$lifetime = $this->getLifetime($specificLifetime);
$result = xcache_set($id, array($data, time()), $lifetime);
if (count($tags) > 0) {
$this->_log(self::TAGS_UNSUPPORTED_BY_SAVE_OF_XCACHE_BACKEND);
... | [
"public",
"function",
"save",
"(",
"$",
"data",
",",
"$",
"id",
",",
"$",
"tags",
"=",
"array",
"(",
")",
",",
"$",
"specificLifetime",
"=",
"false",
")",
"{",
"$",
"lifetime",
"=",
"$",
"this",
"->",
"getLifetime",
"(",
"$",
"specificLifetime",
")",... | Save some string datas into a cache record
Note : $data is always "string" (serialization is done by the
core not by the backend)
@param string $data datas to cache
@param string $id cache id
@param array $tags array of strings, the cache record will be tagged by each string entry
@param int $specificLifetime if != f... | [
"Save",
"some",
"string",
"datas",
"into",
"a",
"cache",
"record"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache/Backend/Xcache.php#L131-L139 | train | Save data into XCache | [
30522,
2270,
3853,
30524,
1027,
6270,
1007,
1063,
1002,
6480,
1027,
1002,
2023,
1011,
1028,
2131,
15509,
7292,
1006,
1002,
3563,
15509,
7292,
1007,
1025,
1002,
2765,
1027,
1060,
3540,
5403,
1035,
2275,
1006,
1002,
8909,
1010,
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... |
octobercms/october | modules/backend/classes/NavigationManager.php | NavigationManager.getActiveMainMenuItem | public function getActiveMainMenuItem()
{
foreach ($this->listMainMenuItems() as $item) {
if ($this->isMainMenuItemActive($item)) {
return $item;
}
}
return null;
} | php | public function getActiveMainMenuItem()
{
foreach ($this->listMainMenuItems() as $item) {
if ($this->isMainMenuItemActive($item)) {
return $item;
}
}
return null;
} | [
"public",
"function",
"getActiveMainMenuItem",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"listMainMenuItems",
"(",
")",
"as",
"$",
"item",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isMainMenuItemActive",
"(",
"$",
"item",
")",
")",
"{",
"return",
... | Returns the currently active main menu item
@param mixed $item Returns the item object or null. | [
"Returns",
"the",
"currently",
"active",
"main",
"menu",
"item"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/NavigationManager.php#L419-L428 | train | Returns the active main menu item | [
30522,
2270,
3853,
2131,
19620,
24238,
3549,
14663,
6633,
1006,
1007,
1063,
18921,
6776,
1006,
1002,
2023,
1011,
1028,
2862,
24238,
3549,
14663,
6633,
2015,
1006,
1007,
2004,
1002,
8875,
1007,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
2003,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
apache/thrift | lib/php/lib/Protocol/TProtocolDecorator.php | TProtocolDecorator.writeMessageBegin | public function writeMessageBegin($name, $type, $seqid)
{
return $this->concreteProtocol_->writeMessageBegin($name, $type, $seqid);
} | php | public function writeMessageBegin($name, $type, $seqid)
{
return $this->concreteProtocol_->writeMessageBegin($name, $type, $seqid);
} | [
"public",
"function",
"writeMessageBegin",
"(",
"$",
"name",
",",
"$",
"type",
",",
"$",
"seqid",
")",
"{",
"return",
"$",
"this",
"->",
"concreteProtocol_",
"->",
"writeMessageBegin",
"(",
"$",
"name",
",",
"$",
"type",
",",
"$",
"seqid",
")",
";",
"}... | Writes the message header.
@param string $name Function name
@param int $type message type TMessageType::CALL or TMessageType::REPLY
@param int $seqid The sequence id of this message | [
"Writes",
"the",
"message",
"header",
"."
] | acdd4226c210336e9e15eb812e5932a645fcd5ce | https://github.com/apache/thrift/blob/acdd4226c210336e9e15eb812e5932a645fcd5ce/lib/php/lib/Protocol/TProtocolDecorator.php#L64-L67 | train | Write message begin | [
30522,
2270,
3853,
4339,
7834,
3736,
3351,
4783,
11528,
1006,
1002,
2171,
1010,
1002,
2828,
1010,
1002,
7367,
14702,
2094,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
5509,
21572,
3406,
25778,
1035,
1011,
1028,
4339,
7834,
3736,
3351,
4783,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/FormTabs.php | FormTabs.evalConfig | protected function evalConfig($config)
{
if (array_key_exists('defaultTab', $config)) {
$this->defaultTab = $config['defaultTab'];
}
if (array_key_exists('icons', $config)) {
$this->icons = $config['icons'];
}
if (array_key_exists('st... | php | protected function evalConfig($config)
{
if (array_key_exists('defaultTab', $config)) {
$this->defaultTab = $config['defaultTab'];
}
if (array_key_exists('icons', $config)) {
$this->icons = $config['icons'];
}
if (array_key_exists('st... | [
"protected",
"function",
"evalConfig",
"(",
"$",
"config",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"'defaultTab'",
",",
"$",
"config",
")",
")",
"{",
"$",
"this",
"->",
"defaultTab",
"=",
"$",
"config",
"[",
"'defaultTab'",
"]",
";",
"}",
"if",
"... | Process options and apply them to this object.
@param array $config
@return array | [
"Process",
"options",
"and",
"apply",
"them",
"to",
"this",
"object",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/FormTabs.php#L84-L109 | train | Evaluate the config array | [
30522,
5123,
3853,
9345,
22499,
2078,
8873,
2290,
1006,
30524,
1002,
9530,
8873,
2290,
1031,
1005,
12398,
2696,
2497,
1005,
1033,
1025,
1065,
2065,
1006,
9140,
1035,
3145,
1035,
6526,
1006,
1005,
18407,
1005,
1010,
1002,
9530,
8873,
2290,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/LocaleType.php | LocaleType.loadValuesForChoices | public function loadValuesForChoices(array $choices, $value = null)
{
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1, use the "choice_loader" option instead.', __METHOD__), E_USER_DEPRECATED);
// Optimize
$choices = array_filter($choices);
if (empty($choic... | php | public function loadValuesForChoices(array $choices, $value = null)
{
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1, use the "choice_loader" option instead.', __METHOD__), E_USER_DEPRECATED);
// Optimize
$choices = array_filter($choices);
if (empty($choic... | [
"public",
"function",
"loadValuesForChoices",
"(",
"array",
"$",
"choices",
",",
"$",
"value",
"=",
"null",
")",
"{",
"@",
"trigger_error",
"(",
"sprintf",
"(",
"'The \"%s()\" method is deprecated since Symfony 4.1, use the \"choice_loader\" option instead.'",
",",
"__METHO... | {@inheritdoc}
@deprecated since Symfony 4.1 | [
"{",
"@inheritdoc",
"}"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/Extension/Core/Type/LocaleType.php#L112-L128 | train | Loads the values for the choices. | [
30522,
2270,
3853,
7170,
10175,
15808,
29278,
9905,
23522,
1006,
9140,
1002,
9804,
1010,
1002,
3643,
1027,
19701,
1007,
1063,
1030,
9495,
1035,
7561,
1006,
9043,
2546,
1006,
1005,
1996,
1000,
1003,
1055,
1006,
1007,
1000,
4118,
2003,
2139,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Model.php | Model.fresh | public function fresh($with = [])
{
if (! $this->exists) {
return;
}
return static::newQueryWithoutScopes()
->with(is_string($with) ? func_get_args() : $with)
->where($this->getKeyName(), $this->getKey())
->... | php | public function fresh($with = [])
{
if (! $this->exists) {
return;
}
return static::newQueryWithoutScopes()
->with(is_string($with) ? func_get_args() : $with)
->where($this->getKeyName(), $this->getKey())
->... | [
"public",
"function",
"fresh",
"(",
"$",
"with",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"exists",
")",
"{",
"return",
";",
"}",
"return",
"static",
"::",
"newQueryWithoutScopes",
"(",
")",
"->",
"with",
"(",
"is_string",
"(",
"... | Reload a fresh model instance from the database.
@param array|string $with
@return static|null | [
"Reload",
"a",
"fresh",
"model",
"instance",
"from",
"the",
"database",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Model.php#L1122-L1132 | train | Get fresh instance of the model | [
30522,
2270,
3853,
4840,
1006,
1002,
2007,
1027,
1031,
1033,
1007,
1063,
2065,
1006,
999,
1002,
2023,
1011,
1028,
6526,
1007,
1063,
2709,
1025,
1065,
2709,
10763,
1024,
1024,
2047,
4226,
2854,
24415,
12166,
16186,
2015,
1006,
1007,
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... |
laravel/framework | src/Illuminate/Database/Schema/Builder.php | Builder.hasTable | public function hasTable($table)
{
$table = $this->connection->getTablePrefix().$table;
return count($this->connection->selectFromWriteConnection(
$this->grammar->compileTableExists(), [$table]
)) > 0;
} | php | public function hasTable($table)
{
$table = $this->connection->getTablePrefix().$table;
return count($this->connection->selectFromWriteConnection(
$this->grammar->compileTableExists(), [$table]
)) > 0;
} | [
"public",
"function",
"hasTable",
"(",
"$",
"table",
")",
"{",
"$",
"table",
"=",
"$",
"this",
"->",
"connection",
"->",
"getTablePrefix",
"(",
")",
".",
"$",
"table",
";",
"return",
"count",
"(",
"$",
"this",
"->",
"connection",
"->",
"selectFromWriteCo... | Determine if the given table exists.
@param string $table
@return bool | [
"Determine",
"if",
"the",
"given",
"table",
"exists",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Schema/Builder.php#L70-L77 | train | Checks if a table exists in the current connection | [
30522,
2270,
3853,
2038,
10880,
1006,
1002,
2795,
1007,
1063,
1002,
2795,
1027,
1002,
2023,
1011,
1028,
4434,
1011,
1028,
2131,
10880,
28139,
8873,
2595,
1006,
1007,
1012,
1002,
2795,
1025,
2709,
4175,
1006,
1002,
2023,
1011,
1028,
4434,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Workflow/DefinitionBuilder.php | DefinitionBuilder.clear | public function clear()
{
$this->places = [];
$this->transitions = [];
$this->initialPlace = null;
$this->metadataStore = null;
return $this;
} | php | public function clear()
{
$this->places = [];
$this->transitions = [];
$this->initialPlace = null;
$this->metadataStore = null;
return $this;
} | [
"public",
"function",
"clear",
"(",
")",
"{",
"$",
"this",
"->",
"places",
"=",
"[",
"]",
";",
"$",
"this",
"->",
"transitions",
"=",
"[",
"]",
";",
"$",
"this",
"->",
"initialPlace",
"=",
"null",
";",
"$",
"this",
"->",
"metadataStore",
"=",
"null... | Clear all data in the builder.
@return $this | [
"Clear",
"all",
"data",
"in",
"the",
"builder",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Workflow/DefinitionBuilder.php#L53-L61 | train | Clear all the places transitions initialPlace and metadataStore | [
30522,
2270,
3853,
3154,
1006,
1007,
1063,
1002,
2023,
1011,
1028,
3182,
1027,
1031,
1033,
1025,
1002,
2023,
1011,
1028,
30524,
2023,
1011,
1028,
27425,
23809,
2063,
1027,
19701,
1025,
2709,
1002,
2023,
1025,
1065,
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,
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/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php | DoctrineChoiceLoader.loadChoiceList | public function loadChoiceList($value = null)
{
if ($this->choiceList) {
return $this->choiceList;
}
$objects = $this->objectLoader
? $this->objectLoader->getEntities()
: $this->manager->getRepository($this->class)->findAll();
return $this->choic... | php | public function loadChoiceList($value = null)
{
if ($this->choiceList) {
return $this->choiceList;
}
$objects = $this->objectLoader
? $this->objectLoader->getEntities()
: $this->manager->getRepository($this->class)->findAll();
return $this->choic... | [
"public",
"function",
"loadChoiceList",
"(",
"$",
"value",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"choiceList",
")",
"{",
"return",
"$",
"this",
"->",
"choiceList",
";",
"}",
"$",
"objects",
"=",
"$",
"this",
"->",
"objectLoader",
"?",
... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php#L78-L89 | train | Load Choice List | [
30522,
2270,
3853,
7170,
9905,
6610,
9863,
1006,
1002,
3643,
1027,
19701,
1007,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
3601,
9863,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
3601,
9863,
1025,
1065,
1002,
5200,
1027,
1002,
2023,
1011,
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... |
symfony/symfony | src/Symfony/Component/HttpKernel/HttpKernel.php | HttpKernel.filterResponse | private function filterResponse(Response $response, Request $request, int $type)
{
$event = new ResponseEvent($this, $request, $type, $response);
$this->dispatcher->dispatch($event, KernelEvents::RESPONSE);
$this->finishRequest($request, $type);
return $event->getResponse();
} | php | private function filterResponse(Response $response, Request $request, int $type)
{
$event = new ResponseEvent($this, $request, $type, $response);
$this->dispatcher->dispatch($event, KernelEvents::RESPONSE);
$this->finishRequest($request, $type);
return $event->getResponse();
} | [
"private",
"function",
"filterResponse",
"(",
"Response",
"$",
"response",
",",
"Request",
"$",
"request",
",",
"int",
"$",
"type",
")",
"{",
"$",
"event",
"=",
"new",
"ResponseEvent",
"(",
"$",
"this",
",",
"$",
"request",
",",
"$",
"type",
",",
"$",
... | Filters a response object.
@param Response $response A Response instance
@param Request $request An error message in case the response is not a Response object
@param int $type The type of the request (one of HttpKernelInterface::MASTER_REQUEST or HttpKernelInterface::SUB_REQUEST)
@return Response The filt... | [
"Filters",
"a",
"response",
"object",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpKernel/HttpKernel.php#L186-L195 | train | Filter the response to the correct type | [
30522,
2797,
3853,
11307,
6072,
26029,
3366,
1006,
3433,
1002,
3433,
1010,
5227,
1002,
5227,
1010,
20014,
1002,
2828,
1007,
1063,
1002,
2724,
1027,
2047,
3433,
18697,
3372,
1006,
1002,
2023,
1010,
1002,
5227,
1010,
1002,
2828,
1010,
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/Database/Schema/Blueprint.php | Blueprint.unique | public function unique($columns, $name = null, $algorithm = null)
{
return $this->indexCommand('unique', $columns, $name, $algorithm);
} | php | public function unique($columns, $name = null, $algorithm = null)
{
return $this->indexCommand('unique', $columns, $name, $algorithm);
} | [
"public",
"function",
"unique",
"(",
"$",
"columns",
",",
"$",
"name",
"=",
"null",
",",
"$",
"algorithm",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"indexCommand",
"(",
"'unique'",
",",
"$",
"columns",
",",
"$",
"name",
",",
"$",
"algorith... | Specify a unique index for the table.
@param string|array $columns
@param string $name
@param string|null $algorithm
@return \Illuminate\Support\Fluent | [
"Specify",
"a",
"unique",
"index",
"for",
"the",
"table",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Schema/Blueprint.php#L488-L491 | train | Unique index of columns | [
30522,
2270,
3853,
4310,
1006,
1002,
7753,
1010,
1002,
2171,
1027,
19701,
1010,
1002,
9896,
1027,
19701,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
5950,
9006,
2386,
2094,
1006,
1005,
4310,
1005,
1010,
1002,
7753,
1010,
1002,
2171,
1010,
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/UsersManager/API.php | API.userEmailExists | public function userEmailExists($userEmail)
{
Piwik::checkUserIsNotAnonymous();
Piwik::checkUserHasSomeViewAccess();
return $this->model->userEmailExists($userEmail);
} | php | public function userEmailExists($userEmail)
{
Piwik::checkUserIsNotAnonymous();
Piwik::checkUserHasSomeViewAccess();
return $this->model->userEmailExists($userEmail);
} | [
"public",
"function",
"userEmailExists",
"(",
"$",
"userEmail",
")",
"{",
"Piwik",
"::",
"checkUserIsNotAnonymous",
"(",
")",
";",
"Piwik",
"::",
"checkUserHasSomeViewAccess",
"(",
")",
";",
"return",
"$",
"this",
"->",
"model",
"->",
"userEmailExists",
"(",
"... | Returns true if user with given email (userEmail) is known in the database, or the Super User
@param string $userEmail
@return bool true if the user is known | [
"Returns",
"true",
"if",
"user",
"with",
"given",
"email",
"(",
"userEmail",
")",
"is",
"known",
"in",
"the",
"database",
"or",
"the",
"Super",
"User"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UsersManager/API.php#L997-L1003 | train | Checks if a user email exists in the database | [
30522,
2270,
3853,
5310,
14545,
9463,
9048,
12837,
1006,
1002,
5310,
14545,
4014,
1007,
1063,
14255,
9148,
2243,
1024,
1024,
4638,
20330,
2483,
17048,
6761,
4890,
30524,
12837,
1006,
1002,
5310,
14545,
4014,
1007,
1025,
1065,
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,
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/Filter/MetadataCallbackAddMetadata.php | MetadataCallbackAddMetadata.filter | public function filter($table)
{
if ($this->applyToSummaryRow) {
$rows = $table->getRows();
} else {
$rows = $table->getRowsWithoutSummaryRow();
}
foreach ($rows as $key => $row) {
$params = array();
foreach ($this->metadataToRead as $... | php | public function filter($table)
{
if ($this->applyToSummaryRow) {
$rows = $table->getRows();
} else {
$rows = $table->getRowsWithoutSummaryRow();
}
foreach ($rows as $key => $row) {
$params = array();
foreach ($this->metadataToRead as $... | [
"public",
"function",
"filter",
"(",
"$",
"table",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"applyToSummaryRow",
")",
"{",
"$",
"rows",
"=",
"$",
"table",
"->",
"getRows",
"(",
")",
";",
"}",
"else",
"{",
"$",
"rows",
"=",
"$",
"table",
"->",
"get... | See {@link MetadataCallbackAddMetadata}.
@param DataTable $table | [
"See",
"{",
"@link",
"MetadataCallbackAddMetadata",
"}",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable/Filter/MetadataCallbackAddMetadata.php#L63-L82 | train | Filter the table | [
30522,
2270,
3853,
11307,
1006,
1002,
2795,
1007,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
6611,
13122,
2819,
7849,
12541,
5004,
1007,
1063,
1002,
10281,
1027,
1002,
2795,
1011,
1028,
2131,
10524,
2015,
1006,
1007,
1025,
1065,
2842,
1063,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Data/Validation.php | Validation.validate | public static function validate($value, array $field)
{
if (!isset($field['type'])) {
$field['type'] = 'text';
}
$type = $validate['type'] ?? $field['type'];
$validate = (array)($field['validate'] ?? null);
$required = $validate['required'] ?? false;
// I... | php | public static function validate($value, array $field)
{
if (!isset($field['type'])) {
$field['type'] = 'text';
}
$type = $validate['type'] ?? $field['type'];
$validate = (array)($field['validate'] ?? null);
$required = $validate['required'] ?? false;
// I... | [
"public",
"static",
"function",
"validate",
"(",
"$",
"value",
",",
"array",
"$",
"field",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"field",
"[",
"'type'",
"]",
")",
")",
"{",
"$",
"field",
"[",
"'type'",
"]",
"=",
"'text'",
";",
"}",
"$",
... | Validate value against a blueprint field definition.
@param mixed $value
@param array $field
@return array | [
"Validate",
"value",
"against",
"a",
"blueprint",
"field",
"definition",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Data/Validation.php#L25-L78 | train | Validate a value with the type and optional validation rules. | [
30522,
2270,
10763,
3853,
9398,
3686,
1006,
1002,
3643,
1010,
9140,
1002,
2492,
1007,
1063,
2065,
1006,
999,
26354,
3388,
1006,
1002,
2492,
1031,
1005,
2828,
1005,
1033,
1007,
1007,
1063,
1002,
2492,
1031,
1005,
2828,
1005,
1033,
1027,
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... |
symfony/symfony | src/Symfony/Component/Messenger/Transport/AmqpExt/AmqpTransport.php | AmqpTransport.reject | public function reject(Envelope $envelope): void
{
($this->receiver ?? $this->getReceiver())->reject($envelope);
} | php | public function reject(Envelope $envelope): void
{
($this->receiver ?? $this->getReceiver())->reject($envelope);
} | [
"public",
"function",
"reject",
"(",
"Envelope",
"$",
"envelope",
")",
":",
"void",
"{",
"(",
"$",
"this",
"->",
"receiver",
"??",
"$",
"this",
"->",
"getReceiver",
"(",
")",
")",
"->",
"reject",
"(",
"$",
"envelope",
")",
";",
"}"
] | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Messenger/Transport/AmqpExt/AmqpTransport.php#L58-L61 | train | Rejects an envelope | [
30522,
2270,
3853,
15454,
1006,
11255,
1002,
11255,
1007,
1024,
11675,
1063,
1006,
1002,
2023,
1011,
1028,
8393,
1029,
1029,
1002,
2023,
1011,
1028,
2131,
2890,
3401,
16402,
1006,
1007,
1007,
1011,
1028,
15454,
1006,
1002,
11255,
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... |
apache/thrift | lib/php/lib/Transport/TSocket.php | TSocket.write | public function write($buf)
{
$null = null;
$write = array($this->handle_);
// keep writing until all the data has been written
while (TStringFuncFactory::create()->strlen($buf) > 0) {
// wait for stream to become available for writing
$writable = @stream_sel... | php | public function write($buf)
{
$null = null;
$write = array($this->handle_);
// keep writing until all the data has been written
while (TStringFuncFactory::create()->strlen($buf) > 0) {
// wait for stream to become available for writing
$writable = @stream_sel... | [
"public",
"function",
"write",
"(",
"$",
"buf",
")",
"{",
"$",
"null",
"=",
"null",
";",
"$",
"write",
"=",
"array",
"(",
"$",
"this",
"->",
"handle_",
")",
";",
"// keep writing until all the data has been written",
"while",
"(",
"TStringFuncFactory",
"::",
... | Write to the socket.
@param string $buf The data to write | [
"Write",
"to",
"the",
"socket",
"."
] | acdd4226c210336e9e15eb812e5932a645fcd5ce | https://github.com/apache/thrift/blob/acdd4226c210336e9e15eb812e5932a645fcd5ce/lib/php/lib/Transport/TSocket.php#L313-L351 | train | Write to the socket | [
30522,
2270,
3853,
4339,
1006,
1002,
20934,
2546,
1007,
1063,
1002,
19701,
1027,
19701,
1025,
1002,
4339,
1027,
9140,
1006,
1002,
2023,
1011,
1028,
5047,
1035,
1007,
1025,
1013,
1013,
2562,
3015,
2127,
2035,
1996,
2951,
2038,
2042,
2517,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Templating/PhpEngine.php | PhpEngine.addHelpers | public function addHelpers(array $helpers)
{
foreach ($helpers as $alias => $helper) {
$this->set($helper, \is_int($alias) ? null : $alias);
}
} | php | public function addHelpers(array $helpers)
{
foreach ($helpers as $alias => $helper) {
$this->set($helper, \is_int($alias) ? null : $alias);
}
} | [
"public",
"function",
"addHelpers",
"(",
"array",
"$",
"helpers",
")",
"{",
"foreach",
"(",
"$",
"helpers",
"as",
"$",
"alias",
"=>",
"$",
"helper",
")",
"{",
"$",
"this",
"->",
"set",
"(",
"$",
"helper",
",",
"\\",
"is_int",
"(",
"$",
"alias",
")"... | Adds some helpers.
@param HelperInterface[] $helpers An array of helper | [
"Adds",
"some",
"helpers",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Templating/PhpEngine.php#L224-L229 | train | Adds the helpers to the current context | [
30522,
2270,
3853,
5587,
16001,
7347,
1006,
9140,
1002,
2393,
2545,
1007,
1063,
18921,
6776,
1006,
1002,
2393,
2545,
2004,
1002,
14593,
1027,
1028,
1002,
2393,
2121,
1007,
1063,
1002,
2023,
1011,
1028,
2275,
1006,
1002,
2393,
2121,
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... |
matomo-org/matomo | plugins/SitesManager/SitesManager.php | SitesManager.getTrackerExcludedIps | private function getTrackerExcludedIps($website)
{
$excludedIps = $website['excluded_ips'];
$globalExcludedIps = API::getInstance()->getExcludedIpsGlobal();
$excludedIps .= ',' . $globalExcludedIps;
$ipRanges = array();
foreach (explode(',', $excludedIps) as $ip) {
... | php | private function getTrackerExcludedIps($website)
{
$excludedIps = $website['excluded_ips'];
$globalExcludedIps = API::getInstance()->getExcludedIpsGlobal();
$excludedIps .= ',' . $globalExcludedIps;
$ipRanges = array();
foreach (explode(',', $excludedIps) as $ip) {
... | [
"private",
"function",
"getTrackerExcludedIps",
"(",
"$",
"website",
")",
"{",
"$",
"excludedIps",
"=",
"$",
"website",
"[",
"'excluded_ips'",
"]",
";",
"$",
"globalExcludedIps",
"=",
"API",
"::",
"getInstance",
"(",
")",
"->",
"getExcludedIpsGlobal",
"(",
")"... | Returns the array of excluded IPs to save in the config file
@param array $website
@return array | [
"Returns",
"the",
"array",
"of",
"excluded",
"IPs",
"to",
"save",
"in",
"the",
"config",
"file"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SitesManager/SitesManager.php#L233-L248 | train | Get excluded IPs from website | [
30522,
2797,
3853,
2131,
6494,
9102,
10288,
20464,
13936,
11514,
2015,
1006,
1002,
4037,
1007,
1063,
1002,
12421,
11514,
2015,
1027,
1002,
4037,
1031,
1005,
12421,
1035,
12997,
2015,
1005,
1033,
1025,
1002,
3795,
10288,
20464,
13936,
11514,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/OfficialAccount/ShakeAround/DeviceClient.php | DeviceClient.list | public function list(int $lastId, int $count)
{
$params = [
'type' => 2,
'last_seen' => $lastId,
'count' => $count,
];
return $this->search($params);
} | php | public function list(int $lastId, int $count)
{
$params = [
'type' => 2,
'last_seen' => $lastId,
'count' => $count,
];
return $this->search($params);
} | [
"public",
"function",
"list",
"(",
"int",
"$",
"lastId",
",",
"int",
"$",
"count",
")",
"{",
"$",
"params",
"=",
"[",
"'type'",
"=>",
"2",
",",
"'last_seen'",
"=>",
"$",
"lastId",
",",
"'count'",
"=>",
"$",
"count",
",",
"]",
";",
"return",
"$",
... | Pagination to get batch of devices.
@param int $lastId
@param int $count
@return \Psr\Http\Message\ResponseInterface|\EasyWeChat\Kernel\Support\Collection|array|object|string | [
"Pagination",
"to",
"get",
"batch",
"of",
"devices",
"."
] | 120c72faaa93c270365bc75c73c362d5fd583209 | https://github.com/overtrue/wechat/blob/120c72faaa93c270365bc75c73c362d5fd583209/src/OfficialAccount/ShakeAround/DeviceClient.php#L132-L141 | train | List all terms | [
30522,
2270,
3853,
2862,
1006,
20014,
1002,
2197,
3593,
1010,
20014,
1002,
4175,
1007,
1063,
1002,
11498,
5244,
1027,
1031,
1005,
2828,
1005,
1027,
1028,
1016,
1010,
1005,
2197,
1035,
2464,
1005,
1027,
1028,
1002,
2197,
3593,
1010,
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/Translation/MessageCatalogue.php | MessageCatalogue.all | public function all($domain = null)
{
if (null !== $domain) {
return ($this->messages[$domain.self::INTL_DOMAIN_SUFFIX] ?? []) + ($this->messages[$domain] ?? []);
}
$allMessages = [];
$suffixLength = \strlen(self::INTL_DOMAIN_SUFFIX);
foreach ($this->messages as... | php | public function all($domain = null)
{
if (null !== $domain) {
return ($this->messages[$domain.self::INTL_DOMAIN_SUFFIX] ?? []) + ($this->messages[$domain] ?? []);
}
$allMessages = [];
$suffixLength = \strlen(self::INTL_DOMAIN_SUFFIX);
foreach ($this->messages as... | [
"public",
"function",
"all",
"(",
"$",
"domain",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"domain",
")",
"{",
"return",
"(",
"$",
"this",
"->",
"messages",
"[",
"$",
"domain",
".",
"self",
"::",
"INTL_DOMAIN_SUFFIX",
"]",
"??",
"[",
"]... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Translation/MessageCatalogue.php#L68-L87 | train | Get all messages from all domains | [
30522,
2270,
3853,
2035,
1006,
1002,
5884,
1027,
19701,
1007,
1063,
2065,
1006,
19701,
999,
1027,
1027,
1002,
5884,
1007,
1063,
2709,
1006,
1002,
2023,
1011,
1028,
7696,
1031,
1002,
5884,
1012,
2969,
1024,
1024,
20014,
2140,
1035,
5884,
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/Cache/Simple/ChainCache.php | ChainCache.clear | public function clear()
{
$cleared = true;
$i = $this->cacheCount;
while ($i--) {
$cleared = $this->caches[$i]->clear() && $cleared;
}
return $cleared;
} | php | public function clear()
{
$cleared = true;
$i = $this->cacheCount;
while ($i--) {
$cleared = $this->caches[$i]->clear() && $cleared;
}
return $cleared;
} | [
"public",
"function",
"clear",
"(",
")",
"{",
"$",
"cleared",
"=",
"true",
";",
"$",
"i",
"=",
"$",
"this",
"->",
"cacheCount",
";",
"while",
"(",
"$",
"i",
"--",
")",
"{",
"$",
"cleared",
"=",
"$",
"this",
"->",
"caches",
"[",
"$",
"i",
"]",
... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Cache/Simple/ChainCache.php#L141-L151 | train | Clear all cache entries | [
30522,
2270,
3853,
3154,
1006,
1007,
1063,
1002,
5985,
1027,
2995,
1025,
1002,
1045,
1027,
1002,
2023,
1011,
1028,
17053,
3597,
16671,
1025,
2096,
1006,
1002,
1045,
1011,
1011,
1007,
1063,
1002,
5985,
1027,
1002,
2023,
1011,
1028,
17053,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.deleteReportData | public function deleteReportData()
{
$settings = self::getPurgeDataSettings();
// Make sure, data deletion is enabled
if ($settings['delete_reports_enable'] == 0) {
return false;
}
// make sure purging should run at this time (unless this is a forced purge)
... | php | public function deleteReportData()
{
$settings = self::getPurgeDataSettings();
// Make sure, data deletion is enabled
if ($settings['delete_reports_enable'] == 0) {
return false;
}
// make sure purging should run at this time (unless this is a forced purge)
... | [
"public",
"function",
"deleteReportData",
"(",
")",
"{",
"$",
"settings",
"=",
"self",
"::",
"getPurgeDataSettings",
"(",
")",
";",
"// Make sure, data deletion is enabled",
"if",
"(",
"$",
"settings",
"[",
"'delete_reports_enable'",
"]",
"==",
"0",
")",
"{",
"r... | Deletes old archived data (reports & metrics).
Archive tables are not optimized after, as that is handled by a separate scheduled task
in CoreAdminHome. This is a scheduled task and will only execute every N days. The number
of days is determined by the delete_logs_schedule_lowest_interval config option.
If delete_re... | [
"Deletes",
"old",
"archived",
"data",
"(",
"reports",
"&",
"metrics",
")",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/PrivacyManager/PrivacyManager.php#L342-L361 | train | Delete report data | [
30522,
2270,
3853,
3972,
15141,
13699,
11589,
2850,
2696,
1006,
1007,
1063,
1002,
10906,
1027,
2969,
1024,
1024,
2131,
5311,
5999,
6790,
21678,
8613,
1006,
1007,
1025,
1013,
1013,
2191,
2469,
1010,
2951,
3972,
20624,
2239,
2003,
9124,
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... |
laravel/framework | src/Illuminate/Database/Schema/Grammars/MySqlGrammar.php | MySqlGrammar.modifyAfter | protected function modifyAfter(Blueprint $blueprint, Fluent $column)
{
if (! is_null($column->after)) {
return ' after '.$this->wrap($column->after);
}
} | php | protected function modifyAfter(Blueprint $blueprint, Fluent $column)
{
if (! is_null($column->after)) {
return ' after '.$this->wrap($column->after);
}
} | [
"protected",
"function",
"modifyAfter",
"(",
"Blueprint",
"$",
"blueprint",
",",
"Fluent",
"$",
"column",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"column",
"->",
"after",
")",
")",
"{",
"return",
"' after '",
".",
"$",
"this",
"->",
"wrap",
"(",... | Get the SQL for an "after" column modifier.
@param \Illuminate\Database\Schema\Blueprint $blueprint
@param \Illuminate\Support\Fluent $column
@return string|null | [
"Get",
"the",
"SQL",
"for",
"an",
"after",
"column",
"modifier",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Schema/Grammars/MySqlGrammar.php#L996-L1001 | train | Protected modifyAfter method | [
30522,
5123,
3853,
19933,
10354,
3334,
1006,
2630,
16550,
1002,
2630,
16550,
1010,
19376,
1002,
5930,
1007,
1063,
2065,
1006,
999,
2003,
1035,
19701,
1006,
1002,
5930,
1011,
1028,
2044,
1007,
1007,
1063,
2709,
1005,
2044,
1005,
1012,
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/Support/Traits/CapsuleManagerTrait.php | CapsuleManagerTrait.setupContainer | protected function setupContainer(Container $container)
{
$this->container = $container;
if (! $this->container->bound('config')) {
$this->container->instance('config', new Fluent);
}
} | php | protected function setupContainer(Container $container)
{
$this->container = $container;
if (! $this->container->bound('config')) {
$this->container->instance('config', new Fluent);
}
} | [
"protected",
"function",
"setupContainer",
"(",
"Container",
"$",
"container",
")",
"{",
"$",
"this",
"->",
"container",
"=",
"$",
"container",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"container",
"->",
"bound",
"(",
"'config'",
")",
")",
"{",
"$",
"th... | Setup the IoC container instance.
@param \Illuminate\Contracts\Container\Container $container
@return void | [
"Setup",
"the",
"IoC",
"container",
"instance",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Support/Traits/CapsuleManagerTrait.php#L30-L37 | train | Setup the container | [
30522,
5123,
3853,
16437,
8663,
18249,
2121,
1006,
11661,
1002,
11661,
1007,
1063,
1002,
2023,
1011,
1028,
11661,
1027,
1002,
11661,
1025,
2065,
1006,
999,
1002,
2023,
1011,
1028,
30524,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.joinCross | public function joinCross($name, $cols = self::SQL_WILDCARD, $schema = null)
{
return $this->_join(self::CROSS_JOIN, $name, null, $cols, $schema);
} | php | public function joinCross($name, $cols = self::SQL_WILDCARD, $schema = null)
{
return $this->_join(self::CROSS_JOIN, $name, null, $cols, $schema);
} | [
"public",
"function",
"joinCross",
"(",
"$",
"name",
",",
"$",
"cols",
"=",
"self",
"::",
"SQL_WILDCARD",
",",
"$",
"schema",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"_join",
"(",
"self",
"::",
"CROSS_JOIN",
",",
"$",
"name",
",",
"null",... | Add a CROSS JOIN table and colums to the query.
A cross join is a cartesian product; there is no join condition.
The $name and $cols parameters follow the same logic
as described in the from() method.
@param array|string|Zend_Db_Expr $name The table name.
@param array|string $cols The columns to select from the joi... | [
"Add",
"a",
"CROSS",
"JOIN",
"table",
"and",
"colums",
"to",
"the",
"query",
".",
"A",
"cross",
"join",
"is",
"a",
"cartesian",
"product",
";",
"there",
"is",
"no",
"join",
"condition",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Select.php#L416-L419 | train | Join cross table | [
30522,
2270,
3853,
3693,
16458,
1006,
1002,
2171,
1010,
1002,
8902,
2015,
1027,
2969,
1024,
1024,
29296,
1035,
3748,
11522,
1010,
1002,
8040,
28433,
1027,
19701,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
1035,
3693,
1006,
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... |
laravel/framework | src/Illuminate/Cache/Repository.php | Repository.rememberForever | public function rememberForever($key, Closure $callback)
{
$value = $this->get($key);
// If the item exists in the cache we will just return this immediately
// and if not we will execute the given Closure and cache the result
// of that forever so it is available for all subsequent... | php | public function rememberForever($key, Closure $callback)
{
$value = $this->get($key);
// If the item exists in the cache we will just return this immediately
// and if not we will execute the given Closure and cache the result
// of that forever so it is available for all subsequent... | [
"public",
"function",
"rememberForever",
"(",
"$",
"key",
",",
"Closure",
"$",
"callback",
")",
"{",
"$",
"value",
"=",
"$",
"this",
"->",
"get",
"(",
"$",
"key",
")",
";",
"// If the item exists in the cache we will just return this immediately",
"// and if not we ... | Get an item from the cache, or execute the given Closure and store the result forever.
@param string $key
@param \Closure $callback
@return mixed | [
"Get",
"an",
"item",
"from",
"the",
"cache",
"or",
"execute",
"the",
"given",
"Closure",
"and",
"store",
"the",
"result",
"forever",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Cache/Repository.php#L411-L425 | train | Remember the value of the given key in the cache for a given Closure and return it. | [
30522,
2270,
3853,
30524,
1013,
2065,
1996,
8875,
6526,
1999,
1996,
17053,
2057,
2097,
2074,
2709,
2023,
3202,
1013,
1013,
1998,
2065,
2025,
2057,
2097,
15389,
1996,
2445,
8503,
1998,
17053,
1996,
2765,
1013,
1013,
1997,
2008,
5091,
2061,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/FormFactory.php | FormFactory.createNamedBuilder | public function createNamedBuilder($name, $type = 'Symfony\Component\Form\Extension\Core\Type\FormType', $data = null, array $options = [])
{
if (null !== $data && !\array_key_exists('data', $options)) {
$options['data'] = $data;
}
if (!\is_string($type)) {
throw new... | php | public function createNamedBuilder($name, $type = 'Symfony\Component\Form\Extension\Core\Type\FormType', $data = null, array $options = [])
{
if (null !== $data && !\array_key_exists('data', $options)) {
$options['data'] = $data;
}
if (!\is_string($type)) {
throw new... | [
"public",
"function",
"createNamedBuilder",
"(",
"$",
"name",
",",
"$",
"type",
"=",
"'Symfony\\Component\\Form\\Extension\\Core\\Type\\FormType'",
",",
"$",
"data",
"=",
"null",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"null",
"!==",
... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/FormFactory.php#L64-L83 | train | Creates a form builder for the given name and type | [
30522,
2270,
3853,
3443,
18442,
18939,
19231,
4063,
1006,
1002,
2171,
1010,
1002,
2828,
1027,
1005,
25353,
2213,
14876,
4890,
1032,
6922,
1032,
2433,
1032,
5331,
1032,
4563,
1032,
2828,
1032,
2433,
13874,
1005,
1010,
1002,
2951,
1027,
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/Translation/Loader/QtFileLoader.php | QtFileLoader.load | public function load($resource, $locale, $domain = 'messages')
{
if (!stream_is_local($resource)) {
throw new InvalidResourceException(sprintf('This is not a local file "%s".', $resource));
}
if (!file_exists($resource)) {
throw new NotFoundResourceException(sprintf(... | php | public function load($resource, $locale, $domain = 'messages')
{
if (!stream_is_local($resource)) {
throw new InvalidResourceException(sprintf('This is not a local file "%s".', $resource));
}
if (!file_exists($resource)) {
throw new NotFoundResourceException(sprintf(... | [
"public",
"function",
"load",
"(",
"$",
"resource",
",",
"$",
"locale",
",",
"$",
"domain",
"=",
"'messages'",
")",
"{",
"if",
"(",
"!",
"stream_is_local",
"(",
"$",
"resource",
")",
")",
"{",
"throw",
"new",
"InvalidResourceException",
"(",
"sprintf",
"... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Translation/Loader/QtFileLoader.php#L30-L76 | train | Load a message catalogue from a local file | [
30522,
2270,
3853,
7170,
1006,
1002,
7692,
1010,
1002,
2334,
2063,
1010,
1002,
5884,
1027,
1005,
7696,
1005,
1007,
1063,
2065,
1006,
999,
5460,
1035,
2003,
1035,
2334,
1006,
1002,
7692,
1007,
1007,
1063,
5466,
2047,
19528,
6072,
8162,
340... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Builder.php | Builder.firstOrCreate | public function firstOrCreate(array $attributes, array $values = [])
{
if (! is_null($instance = $this->where($attributes)->first())) {
return $instance;
}
return tap($this->newModelInstance($attributes + $values), function ($instance) {
$instance->save();
})... | php | public function firstOrCreate(array $attributes, array $values = [])
{
if (! is_null($instance = $this->where($attributes)->first())) {
return $instance;
}
return tap($this->newModelInstance($attributes + $values), function ($instance) {
$instance->save();
})... | [
"public",
"function",
"firstOrCreate",
"(",
"array",
"$",
"attributes",
",",
"array",
"$",
"values",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"instance",
"=",
"$",
"this",
"->",
"where",
"(",
"$",
"attributes",
")",
"->",
"first"... | Get the first record matching the attributes or create it.
@param array $attributes
@param array $values
@return \Illuminate\Database\Eloquent\Model|static | [
"Get",
"the",
"first",
"record",
"matching",
"the",
"attributes",
"or",
"create",
"it",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Builder.php#L413-L422 | train | Get first or create new record | [
30522,
2270,
3853,
2034,
2953,
16748,
3686,
1006,
9140,
1002,
12332,
1010,
9140,
1002,
5300,
1027,
1031,
1033,
1007,
1063,
2065,
1006,
999,
2003,
1035,
19701,
1006,
1002,
6013,
1027,
1002,
2023,
1011,
1028,
2073,
1006,
1002,
12332,
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... |
symfony/symfony | src/Symfony/Component/ExpressionLanguage/ExpressionLanguage.php | ExpressionLanguage.evaluate | public function evaluate($expression, $values = [])
{
return $this->parse($expression, array_keys($values))->getNodes()->evaluate($this->functions, $values);
} | php | public function evaluate($expression, $values = [])
{
return $this->parse($expression, array_keys($values))->getNodes()->evaluate($this->functions, $values);
} | [
"public",
"function",
"evaluate",
"(",
"$",
"expression",
",",
"$",
"values",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"parse",
"(",
"$",
"expression",
",",
"array_keys",
"(",
"$",
"values",
")",
")",
"->",
"getNodes",
"(",
")",
"->",
... | Evaluate an expression.
@param Expression|string $expression The expression to compile
@param array $values An array of values
@return mixed The result of the evaluation of the expression | [
"Evaluate",
"an",
"expression",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/ExpressionLanguage/ExpressionLanguage.php#L65-L68 | train | Evaluate an expression and return the result | [
30522,
2270,
3853,
16157,
1006,
1002,
3670,
1010,
1002,
5300,
1027,
1031,
1033,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
11968,
3366,
1006,
1002,
3670,
1010,
9140,
1035,
6309,
1006,
1002,
5300,
1007,
1007,
1011,
1028,
2131,
3630,
6155,
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/Installation/ServerFilesGenerator.php | ServerFilesGenerator.createWebRootFiles | public static function createWebRootFiles()
{
$filesToCreate = array(
'/robots.txt',
'/favicon.ico',
);
foreach ($filesToCreate as $file) {
$path = PIWIK_DOCUMENT_ROOT . $file;
if(!file_exists($path)) {
@file_put_contents($path,... | php | public static function createWebRootFiles()
{
$filesToCreate = array(
'/robots.txt',
'/favicon.ico',
);
foreach ($filesToCreate as $file) {
$path = PIWIK_DOCUMENT_ROOT . $file;
if(!file_exists($path)) {
@file_put_contents($path,... | [
"public",
"static",
"function",
"createWebRootFiles",
"(",
")",
"{",
"$",
"filesToCreate",
"=",
"array",
"(",
"'/robots.txt'",
",",
"'/favicon.ico'",
",",
")",
";",
"foreach",
"(",
"$",
"filesToCreate",
"as",
"$",
"file",
")",
"{",
"$",
"path",
"=",
"PIWIK... | Generate default robots.txt, favicon.ico, etc to suppress
404 (Not Found) errors in the web server logs, if Piwik
is installed in the web root (or top level of subdomain).
@see misc/crossdomain.xml | [
"Generate",
"default",
"robots",
".",
"txt",
"favicon",
".",
"ico",
"etc",
"to",
"suppress",
"404",
"(",
"Not",
"Found",
")",
"errors",
"in",
"the",
"web",
"server",
"logs",
"if",
"Piwik",
"is",
"installed",
"in",
"the",
"web",
"root",
"(",
"or",
"top"... | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Installation/ServerFilesGenerator.php#L196-L208 | train | Create web root files | [
30522,
2270,
10763,
3853,
3443,
8545,
12618,
4140,
8873,
4244,
1006,
1007,
1063,
1002,
6764,
3406,
16748,
3686,
1027,
9140,
1006,
1005,
1013,
13507,
1012,
19067,
2102,
1005,
1010,
1005,
1013,
6904,
7903,
2239,
1012,
24582,
2080,
1005,
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... |
matomo-org/matomo | libs/Zend/Cache/Frontend/Output.php | Zend_Cache_Frontend_Output.end | public function end($tags = array(), $specificLifetime = false, $forcedDatas = null, $echoData = true, $priority = 8)
{
if ($forcedDatas === null) {
$data = ob_get_clean();
} else {
$data =& $forcedDatas;
}
$id = array_pop($this->_idStack);
if ($id ===... | php | public function end($tags = array(), $specificLifetime = false, $forcedDatas = null, $echoData = true, $priority = 8)
{
if ($forcedDatas === null) {
$data = ob_get_clean();
} else {
$data =& $forcedDatas;
}
$id = array_pop($this->_idStack);
if ($id ===... | [
"public",
"function",
"end",
"(",
"$",
"tags",
"=",
"array",
"(",
")",
",",
"$",
"specificLifetime",
"=",
"false",
",",
"$",
"forcedDatas",
"=",
"null",
",",
"$",
"echoData",
"=",
"true",
",",
"$",
"priority",
"=",
"8",
")",
"{",
"if",
"(",
"$",
... | Stop the cache
@param array $tags Tags array
@param int $specificLifetime If != false, set a specific lifetime for this cache record (null => infinite lifetime)
@param string $forcedDatas If not null, force written datas with this
@param boolean $echoData If set to true, datas are s... | [
"Stop",
"the",
"cache"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache/Frontend/Output.php#L88-L103 | train | End cache entry | [
30522,
2270,
3853,
2203,
1006,
1002,
22073,
1027,
9140,
1006,
1007,
1010,
1002,
3563,
15509,
7292,
1027,
6270,
1010,
1002,
3140,
2850,
10230,
1027,
19701,
1010,
1002,
9052,
2850,
2696,
1027,
2995,
1010,
1002,
9470,
1027,
1022,
1007,
1063,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.exists | public static function exists($dirName)
{
$theme = static::load($dirName);
$path = $theme->getPath();
return File::isDirectory($path);
} | php | public static function exists($dirName)
{
$theme = static::load($dirName);
$path = $theme->getPath();
return File::isDirectory($path);
} | [
"public",
"static",
"function",
"exists",
"(",
"$",
"dirName",
")",
"{",
"$",
"theme",
"=",
"static",
"::",
"load",
"(",
"$",
"dirName",
")",
";",
"$",
"path",
"=",
"$",
"theme",
"->",
"getPath",
"(",
")",
";",
"return",
"File",
"::",
"isDirectory",
... | Determines if a theme with given directory name exists
@param string $dirName The theme directory
@return bool | [
"Determines",
"if",
"a",
"theme",
"with",
"given",
"directory",
"name",
"exists"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/Theme.php#L112-L118 | train | Checks if a directory exists in the theme. | [
30522,
2270,
10763,
3853,
6526,
1006,
1002,
16101,
18442,
1007,
1063,
1002,
4323,
1027,
10763,
1024,
1024,
7170,
1006,
1002,
16101,
18442,
1007,
1025,
1002,
4130,
1027,
1002,
4323,
1011,
1028,
2131,
15069,
1006,
1007,
1025,
2709,
5371,
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... |
matomo-org/matomo | core/DataTable.php | DataTable.getLastRow | public function getLastRow()
{
if (!is_null($this->summaryRow)) {
return $this->summaryRow;
}
if (count($this->rows) == 0) {
return false;
}
return end($this->rows);
} | php | public function getLastRow()
{
if (!is_null($this->summaryRow)) {
return $this->summaryRow;
}
if (count($this->rows) == 0) {
return false;
}
return end($this->rows);
} | [
"public",
"function",
"getLastRow",
"(",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"this",
"->",
"summaryRow",
")",
")",
"{",
"return",
"$",
"this",
"->",
"summaryRow",
";",
"}",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"rows",
")",
"==",
... | Returns the last row of the DataTable. If there is a summary row, it
will always be considered the last row.
@return Row|false The last row or `false` if it cannot be found. | [
"Returns",
"the",
"last",
"row",
"of",
"the",
"DataTable",
".",
"If",
"there",
"is",
"a",
"summary",
"row",
"it",
"will",
"always",
"be",
"considered",
"the",
"last",
"row",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable.php#L1030-L1041 | train | Return last row | [
30522,
2270,
3853,
2131,
8523,
13181,
2860,
1006,
1007,
1063,
2065,
1006,
999,
2003,
1035,
19701,
1006,
1002,
2023,
1011,
1028,
12654,
10524,
1007,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
12654,
30524,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Application.php | Application.get | public function get($name)
{
$this->init();
if (!$this->has($name)) {
throw new CommandNotFoundException(sprintf('The command "%s" does not exist.', $name));
}
$command = $this->commands[$name];
if ($this->wantHelps) {
$this->wantHelps = false;
... | php | public function get($name)
{
$this->init();
if (!$this->has($name)) {
throw new CommandNotFoundException(sprintf('The command "%s" does not exist.', $name));
}
$command = $this->commands[$name];
if ($this->wantHelps) {
$this->wantHelps = false;
... | [
"public",
"function",
"get",
"(",
"$",
"name",
")",
"{",
"$",
"this",
"->",
"init",
"(",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"has",
"(",
"$",
"name",
")",
")",
"{",
"throw",
"new",
"CommandNotFoundException",
"(",
"sprintf",
"(",
"'The com... | Returns a registered command by name or alias.
@param string $name The command name or alias
@return Command A Command object
@throws CommandNotFoundException When given command name does not exist | [
"Returns",
"a",
"registered",
"command",
"by",
"name",
"or",
"alias",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Application.php#L504-L524 | train | Get the command by name | [
30522,
2270,
3853,
2131,
1006,
1002,
2171,
1007,
1063,
1002,
2023,
1011,
1028,
1999,
4183,
1006,
1007,
1025,
2065,
1006,
999,
1002,
2023,
1011,
1028,
2038,
1006,
1002,
2171,
1007,
1007,
1063,
5466,
2047,
3094,
17048,
14876,
8630,
10288,
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... |
overtrue/wechat | src/Kernel/Log/LogManager.php | LogManager.createStackDriver | protected function createStackDriver(array $config)
{
$handlers = [];
foreach ($config['channels'] ?? [] as $channel) {
$handlers = \array_merge($handlers, $this->channel($channel)->getHandlers());
}
return new Monolog($this->parseChannel($config), $handlers);
} | php | protected function createStackDriver(array $config)
{
$handlers = [];
foreach ($config['channels'] ?? [] as $channel) {
$handlers = \array_merge($handlers, $this->channel($channel)->getHandlers());
}
return new Monolog($this->parseChannel($config), $handlers);
} | [
"protected",
"function",
"createStackDriver",
"(",
"array",
"$",
"config",
")",
"{",
"$",
"handlers",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"config",
"[",
"'channels'",
"]",
"??",
"[",
"]",
"as",
"$",
"channel",
")",
"{",
"$",
"handlers",
"=",
"\\... | Create an aggregate log driver instance.
@param array $config
@return \Monolog\Logger | [
"Create",
"an",
"aggregate",
"log",
"driver",
"instance",
"."
] | 120c72faaa93c270365bc75c73c362d5fd583209 | https://github.com/overtrue/wechat/blob/120c72faaa93c270365bc75c73c362d5fd583209/src/Kernel/Log/LogManager.php#L197-L206 | train | Create a stack driver | [
30522,
5123,
3853,
9005,
2696,
3600,
23663,
2099,
1006,
9140,
1002,
9530,
8873,
2290,
1007,
1063,
1002,
28213,
2015,
1027,
1031,
1033,
1025,
18921,
6776,
1006,
1002,
9530,
8873,
2290,
1031,
1005,
6833,
1005,
1033,
1029,
1029,
1031,
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... |
matomo-org/matomo | plugins/SegmentEditor/API.php | API.getAll | public function getAll($idSite = false)
{
if (!empty($idSite)) {
Piwik::checkUserHasViewAccess($idSite);
} else {
Piwik::checkUserHasSomeViewAccess();
}
$userLogin = Piwik::getCurrentUserLogin();
$model = $this->getModel();
if(Piwik::hasUserS... | php | public function getAll($idSite = false)
{
if (!empty($idSite)) {
Piwik::checkUserHasViewAccess($idSite);
} else {
Piwik::checkUserHasSomeViewAccess();
}
$userLogin = Piwik::getCurrentUserLogin();
$model = $this->getModel();
if(Piwik::hasUserS... | [
"public",
"function",
"getAll",
"(",
"$",
"idSite",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"idSite",
")",
")",
"{",
"Piwik",
"::",
"checkUserHasViewAccess",
"(",
"$",
"idSite",
")",
";",
"}",
"else",
"{",
"Piwik",
"::",
"checkUser... | Returns all stored segments.
@param bool|int $idSite Whether to return stored segments for a specific idSite, or all of them. If supplied, must be a valid site ID.
@return array | [
"Returns",
"all",
"stored",
"segments",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SegmentEditor/API.php#L343-L367 | train | Get all segments for a given site | [
30522,
2270,
3853,
2131,
8095,
1006,
1002,
8909,
28032,
2063,
1027,
6270,
1007,
1063,
2065,
1006,
999,
4064,
1006,
1002,
8909,
28032,
2063,
1007,
1007,
1063,
14255,
9148,
2243,
1024,
1024,
4638,
20330,
14949,
8584,
6305,
9623,
2015,
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 | libs/Zend/Db/Profiler.php | Zend_Db_Profiler.getTotalElapsedSecs | public function getTotalElapsedSecs($queryType = null)
{
$elapsedSecs = 0;
foreach ($this->_queryProfiles as $key => $qp) {
if (null === $queryType) {
$condition = true;
} else {
$condition = ($qp->getQueryType() & $queryType);
}
... | php | public function getTotalElapsedSecs($queryType = null)
{
$elapsedSecs = 0;
foreach ($this->_queryProfiles as $key => $qp) {
if (null === $queryType) {
$condition = true;
} else {
$condition = ($qp->getQueryType() & $queryType);
}
... | [
"public",
"function",
"getTotalElapsedSecs",
"(",
"$",
"queryType",
"=",
"null",
")",
"{",
"$",
"elapsedSecs",
"=",
"0",
";",
"foreach",
"(",
"$",
"this",
"->",
"_queryProfiles",
"as",
"$",
"key",
"=>",
"$",
"qp",
")",
"{",
"if",
"(",
"null",
"===",
... | Get the total elapsed time (in seconds) of all of the profiled queries.
Only queries that have ended will be counted. If $queryType is set to
one or more of the Zend_Db_Profiler::* constants, the elapsed time will be calculated
only for queries of the given type(s).
@param integer $queryType OPTIONAL
@return float | [
"Get",
"the",
"total",
"elapsed",
"time",
"(",
"in",
"seconds",
")",
"of",
"all",
"of",
"the",
"profiled",
"queries",
".",
"Only",
"queries",
"that",
"have",
"ended",
"will",
"be",
"counted",
".",
"If",
"$queryType",
"is",
"set",
"to",
"one",
"or",
"mo... | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Profiler.php#L412-L426 | train | Returns the total elapsed seconds of all query profiles | [
30522,
2270,
3853,
2131,
3406,
22059,
2721,
29251,
5104,
8586,
2015,
1006,
1002,
23032,
13874,
1027,
19701,
1007,
1063,
1002,
3449,
9331,
6924,
3366,
6169,
1027,
1014,
1025,
18921,
6776,
1006,
1002,
2023,
1011,
1028,
1035,
23032,
21572,
887... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Themes.php | Themes.loadConfiguration | protected function loadConfiguration($name, Config $config)
{
$themeConfig = CompiledYamlFile::instance("themes://{$name}/{$name}" . YAML_EXT)->content();
$config->joinDefaults("themes.{$name}", $themeConfig);
} | php | protected function loadConfiguration($name, Config $config)
{
$themeConfig = CompiledYamlFile::instance("themes://{$name}/{$name}" . YAML_EXT)->content();
$config->joinDefaults("themes.{$name}", $themeConfig);
} | [
"protected",
"function",
"loadConfiguration",
"(",
"$",
"name",
",",
"Config",
"$",
"config",
")",
"{",
"$",
"themeConfig",
"=",
"CompiledYamlFile",
"::",
"instance",
"(",
"\"themes://{$name}/{$name}\"",
".",
"YAML_EXT",
")",
"->",
"content",
"(",
")",
";",
"$... | Load theme configuration.
@param string $name Theme name
@param Config $config Configuration class | [
"Load",
"theme",
"configuration",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Themes.php#L276-L280 | train | Load theme configuration | [
30522,
5123,
3853,
7170,
8663,
8873,
27390,
3370,
1006,
1002,
2171,
1010,
9530,
8873,
2290,
1002,
9530,
8873,
2290,
1007,
1063,
1002,
4323,
8663,
8873,
2290,
1027,
9227,
14852,
10270,
9463,
1024,
1024,
6013,
1006,
1000,
6991,
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... |
matomo-org/matomo | libs/Zend/Mail.php | Zend_Mail.setReplyToFromDefault | public function setReplyToFromDefault() {
$replyTo = self::getDefaultReplyTo();
if($replyTo === null) {
// require_once 'Zend/Mail/Exception.php';
throw new Zend_Mail_Exception(
'No default Reply-To Address set to use');
}
$this->setReplyTo($reply... | php | public function setReplyToFromDefault() {
$replyTo = self::getDefaultReplyTo();
if($replyTo === null) {
// require_once 'Zend/Mail/Exception.php';
throw new Zend_Mail_Exception(
'No default Reply-To Address set to use');
}
$this->setReplyTo($reply... | [
"public",
"function",
"setReplyToFromDefault",
"(",
")",
"{",
"$",
"replyTo",
"=",
"self",
"::",
"getDefaultReplyTo",
"(",
")",
";",
"if",
"(",
"$",
"replyTo",
"===",
"null",
")",
"{",
"// require_once 'Zend/Mail/Exception.php';",
"throw",
"new",
"Zend_Mail_Except... | Sets ReplyTo-name and -email based on the defaults
@return Zend_Mail Provides fluent interface | [
"Sets",
"ReplyTo",
"-",
"name",
"and",
"-",
"email",
"based",
"on",
"the",
"defaults"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail.php#L850-L861 | train | Set Reply - To Address From Default | [
30522,
2270,
3853,
2275,
2890,
22086,
3406,
19699,
5358,
3207,
7011,
11314,
1006,
1007,
1063,
1002,
7514,
3406,
1027,
2969,
1024,
1024,
2131,
3207,
7011,
11314,
2890,
22086,
3406,
1006,
1007,
1025,
2065,
1006,
1002,
7514,
3406,
1027,
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... |
laravel/framework | src/Illuminate/Routing/SortedMiddleware.php | SortedMiddleware.sortMiddleware | protected function sortMiddleware($priorityMap, $middlewares)
{
$lastIndex = 0;
foreach ($middlewares as $index => $middleware) {
if (! is_string($middleware)) {
continue;
}
$stripped = head(explode(':', $middleware));
if (in_array($... | php | protected function sortMiddleware($priorityMap, $middlewares)
{
$lastIndex = 0;
foreach ($middlewares as $index => $middleware) {
if (! is_string($middleware)) {
continue;
}
$stripped = head(explode(':', $middleware));
if (in_array($... | [
"protected",
"function",
"sortMiddleware",
"(",
"$",
"priorityMap",
",",
"$",
"middlewares",
")",
"{",
"$",
"lastIndex",
"=",
"0",
";",
"foreach",
"(",
"$",
"middlewares",
"as",
"$",
"index",
"=>",
"$",
"middleware",
")",
"{",
"if",
"(",
"!",
"is_string"... | Sort the middlewares by the given priority map.
Each call to this method makes one discrete middleware movement if necessary.
@param array $priorityMap
@param array $middlewares
@return array | [
"Sort",
"the",
"middlewares",
"by",
"the",
"given",
"priority",
"map",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/SortedMiddleware.php#L34-L66 | train | Sort the middlewares in the priority map | [
30522,
5123,
3853,
4066,
4328,
20338,
8059,
1006,
1002,
9470,
2863,
2361,
1010,
1002,
2690,
8059,
2015,
1007,
1063,
1002,
2197,
22254,
10288,
1027,
1014,
1025,
18921,
6776,
1006,
1002,
2690,
8059,
2015,
2004,
1002,
5950,
1027,
1028,
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... |
matomo-org/matomo | libs/Zend/Cache/Backend/Sqlite.php | Zend_Cache_Backend_Sqlite.getIdsMatchingTags | public function getIdsMatchingTags($tags = array())
{
$first = true;
$ids = array();
foreach ($tags as $tag) {
$res = $this->_query("SELECT DISTINCT(id) AS id FROM tag WHERE name='$tag'");
if (!$res) {
return array();
}
$rows = ... | php | public function getIdsMatchingTags($tags = array())
{
$first = true;
$ids = array();
foreach ($tags as $tag) {
$res = $this->_query("SELECT DISTINCT(id) AS id FROM tag WHERE name='$tag'");
if (!$res) {
return array();
}
$rows = ... | [
"public",
"function",
"getIdsMatchingTags",
"(",
"$",
"tags",
"=",
"array",
"(",
")",
")",
"{",
"$",
"first",
"=",
"true",
";",
"$",
"ids",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"tags",
"as",
"$",
"tag",
")",
"{",
"$",
"res",
"=",
"... | Return an array of stored cache ids which match given tags
In case of multiple tags, a logical AND is made between tags
@param array $tags array of tags
@return array array of matching cache ids (string) | [
"Return",
"an",
"array",
"of",
"stored",
"cache",
"ids",
"which",
"match",
"given",
"tags"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache/Backend/Sqlite.php#L266-L292 | train | Returns all the ids matching the given tags | [
30522,
2270,
3853,
2131,
9821,
18900,
8450,
15900,
2015,
1006,
1002,
22073,
1027,
9140,
1006,
1007,
1007,
1063,
1002,
2034,
1027,
2995,
1025,
1002,
8909,
2015,
1027,
9140,
1006,
1007,
1025,
18921,
6776,
1006,
1002,
22073,
2004,
1002,
6415,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/SitesManager.php | SitesManager.shouldKeepURLFragmentsFor | private static function shouldKeepURLFragmentsFor($site)
{
if ($site['keep_url_fragment'] == self::KEEP_URL_FRAGMENT_YES) {
return true;
} else if ($site['keep_url_fragment'] == self::KEEP_URL_FRAGMENT_NO) {
return false;
}
return API::getInstance()->getKeepU... | php | private static function shouldKeepURLFragmentsFor($site)
{
if ($site['keep_url_fragment'] == self::KEEP_URL_FRAGMENT_YES) {
return true;
} else if ($site['keep_url_fragment'] == self::KEEP_URL_FRAGMENT_NO) {
return false;
}
return API::getInstance()->getKeepU... | [
"private",
"static",
"function",
"shouldKeepURLFragmentsFor",
"(",
"$",
"site",
")",
"{",
"if",
"(",
"$",
"site",
"[",
"'keep_url_fragment'",
"]",
"==",
"self",
"::",
"KEEP_URL_FRAGMENT_YES",
")",
"{",
"return",
"true",
";",
"}",
"else",
"if",
"(",
"$",
"s... | Returns whether we should keep URL fragments for a specific site.
@param array $site DB data for the site.
@return bool | [
"Returns",
"whether",
"we",
"should",
"keep",
"URL",
"fragments",
"for",
"a",
"specific",
"site",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SitesManager/SitesManager.php#L198-L207 | train | Returns true if the keep_url_fragment setting is TRUE | [
30522,
2797,
10763,
3853,
2323,
20553,
5311,
10270,
29181,
8163,
29278,
1006,
1002,
2609,
1007,
1063,
2065,
1006,
1002,
2609,
1031,
1005,
2562,
1035,
24471,
2140,
1035,
15778,
1005,
1033,
1027,
1027,
2969,
1024,
1024,
2562,
1035,
24471,
214... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Validator/ConstraintValidator.php | ConstraintValidator.formatValue | protected function formatValue($value, $format = 0)
{
$isDateTime = $value instanceof \DateTimeInterface;
if (($format & self::PRETTY_DATE) && $isDateTime) {
if (class_exists('IntlDateFormatter')) {
$locale = \Locale::getDefault();
$formatter = new \IntlD... | php | protected function formatValue($value, $format = 0)
{
$isDateTime = $value instanceof \DateTimeInterface;
if (($format & self::PRETTY_DATE) && $isDateTime) {
if (class_exists('IntlDateFormatter')) {
$locale = \Locale::getDefault();
$formatter = new \IntlD... | [
"protected",
"function",
"formatValue",
"(",
"$",
"value",
",",
"$",
"format",
"=",
"0",
")",
"{",
"$",
"isDateTime",
"=",
"$",
"value",
"instanceof",
"\\",
"DateTimeInterface",
";",
"if",
"(",
"(",
"$",
"format",
"&",
"self",
"::",
"PRETTY_DATE",
")",
... | Returns a string representation of the value.
This method returns the equivalent PHP tokens for most scalar types
(i.e. "false" for false, "1" for 1 etc.). Strings are always wrapped
in double quotes ("). Objects, arrays and resources are formatted as
"object", "array" and "resource". If the $format bitmask contains
t... | [
"Returns",
"a",
"string",
"representation",
"of",
"the",
"value",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Validator/ConstraintValidator.php#L86-L143 | train | Formats the value according to the format parameter | [
30522,
5123,
3853,
4289,
10175,
5657,
1006,
1002,
3643,
1010,
1002,
4289,
1027,
1014,
1007,
1063,
1002,
2003,
13701,
7292,
1027,
1002,
3643,
6013,
11253,
1032,
3058,
7292,
18447,
2121,
12172,
1025,
2065,
1006,
1006,
1002,
4289,
1004,
2969,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.urlHash | public function urlHash($hash = null, $withHash = true)
{
if ($hash) {
$this->set('urlHash', ltrim($hash, '#'));
}
$hash = $this->get('urlHash', '');
return $withHash && !empty($hash) ? '#' . $hash : $hash;
} | php | public function urlHash($hash = null, $withHash = true)
{
if ($hash) {
$this->set('urlHash', ltrim($hash, '#'));
}
$hash = $this->get('urlHash', '');
return $withHash && !empty($hash) ? '#' . $hash : $hash;
} | [
"public",
"function",
"urlHash",
"(",
"$",
"hash",
"=",
"null",
",",
"$",
"withHash",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"hash",
")",
"{",
"$",
"this",
"->",
"set",
"(",
"'urlHash'",
",",
"ltrim",
"(",
"$",
"hash",
",",
"'#'",
")",
")",
";"... | Get/set hash for the file's url
@param string $hash
@param bool $withHash
@return string | [
"Get",
"/",
"set",
"hash",
"for",
"the",
"file",
"s",
"url"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Page/Medium/Medium.php#L334-L343 | train | Get or set the urlHash | [
30522,
2270,
3853,
24471,
2140,
14949,
2232,
1006,
1002,
23325,
1027,
19701,
1010,
1002,
2007,
14949,
2232,
1027,
30524,
2140,
14949,
2232,
1005,
1010,
8318,
20026,
1006,
1002,
23325,
1010,
1005,
1001,
1005,
1007,
1007,
1025,
1065,
1002,
23... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Adapter/Oracle.php | Zend_Db_Adapter_Oracle._commit | protected function _commit()
{
if (!oci_commit($this->_connection)) {
/**
* @see Zend_Db_Adapter_Oracle_Exception
*/
// require_once 'Zend/Db/Adapter/Oracle/Exception.php';
throw new Zend_Db_Adapter_Oracle_Exception(oci_error($this->_connection))... | php | protected function _commit()
{
if (!oci_commit($this->_connection)) {
/**
* @see Zend_Db_Adapter_Oracle_Exception
*/
// require_once 'Zend/Db/Adapter/Oracle/Exception.php';
throw new Zend_Db_Adapter_Oracle_Exception(oci_error($this->_connection))... | [
"protected",
"function",
"_commit",
"(",
")",
"{",
"if",
"(",
"!",
"oci_commit",
"(",
"$",
"this",
"->",
"_connection",
")",
")",
"{",
"/**\n * @see Zend_Db_Adapter_Oracle_Exception\n */",
"// require_once 'Zend/Db/Adapter/Oracle/Exception.php';",
"thr... | Commit a transaction and return to autocommit mode.
@return void
@throws Zend_Db_Adapter_Oracle_Exception | [
"Commit",
"a",
"transaction",
"and",
"return",
"to",
"autocommit",
"mode",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Adapter/Oracle.php#L465-L475 | train | Commit the connection to the Oracle server | [
30522,
5123,
3853,
1035,
10797,
1006,
1007,
1063,
2065,
1006,
999,
1051,
6895,
1035,
10797,
1006,
1002,
2023,
1011,
1028,
1035,
4434,
1007,
1007,
1063,
1013,
1008,
1008,
1008,
1030,
2156,
16729,
2094,
1035,
16962,
1035,
15581,
2121,
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... |
matomo-org/matomo | plugins/Login/SessionInitializer.php | SessionInitializer.processFailedSession | protected function processFailedSession($rememberMe)
{
$cookie = $this->getAuthCookie($rememberMe);
$cookie->delete();
throw new Exception(Piwik::translate('Login_LoginPasswordNotCorrect'));
} | php | protected function processFailedSession($rememberMe)
{
$cookie = $this->getAuthCookie($rememberMe);
$cookie->delete();
throw new Exception(Piwik::translate('Login_LoginPasswordNotCorrect'));
} | [
"protected",
"function",
"processFailedSession",
"(",
"$",
"rememberMe",
")",
"{",
"$",
"cookie",
"=",
"$",
"this",
"->",
"getAuthCookie",
"(",
"$",
"rememberMe",
")",
";",
"$",
"cookie",
"->",
"delete",
"(",
")",
";",
"throw",
"new",
"Exception",
"(",
"... | Executed when the session could not authenticate.
@param bool $rememberMe Whether the authenticated session should be remembered after
the browser is closed or not.
@throws Exception always. | [
"Executed",
"when",
"the",
"session",
"could",
"not",
"authenticate",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Login/SessionInitializer.php#L167-L173 | train | Throws an exception if the login failed. | [
30522,
5123,
3853,
2832,
7011,
18450,
8583,
10992,
1006,
1002,
3342,
4168,
1007,
1063,
1002,
17387,
1027,
1002,
2023,
1011,
1028,
2131,
4887,
2705,
3597,
23212,
2063,
1006,
1002,
3342,
4168,
1007,
1025,
1002,
17387,
1011,
1028,
3972,
12870,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Dotenv/Dotenv.php | Dotenv.overload | public function overload(string $path, string ...$extraPaths): void
{
$this->doLoad(true, \func_get_args());
} | php | public function overload(string $path, string ...$extraPaths): void
{
$this->doLoad(true, \func_get_args());
} | [
"public",
"function",
"overload",
"(",
"string",
"$",
"path",
",",
"string",
"...",
"$",
"extraPaths",
")",
":",
"void",
"{",
"$",
"this",
"->",
"doLoad",
"(",
"true",
",",
"\\",
"func_get_args",
"(",
")",
")",
";",
"}"
] | Loads one or several .env files and enables override existing vars.
@param string $path A file to load
@param ...string $extraPaths A list of additional files to load
@throws FormatException when a file has a syntax error
@throws PathException when a file does not exist or is not readable | [
"Loads",
"one",
"or",
"several",
".",
"env",
"files",
"and",
"enables",
"override",
"existing",
"vars",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Dotenv/Dotenv.php#L121-L124 | train | Overload the content of the current page. | [
30522,
2270,
3853,
2058,
11066,
1006,
5164,
1002,
4130,
1010,
5164,
1012,
1012,
1012,
1002,
4469,
15069,
2015,
1007,
1024,
11675,
1063,
1002,
2023,
1011,
1028,
2079,
11066,
1006,
2995,
1010,
1032,
4569,
2278,
1035,
2131,
1035,
12098,
5620,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/BasicService/QrCode/Client.php | Client.forever | public function forever($sceneValue)
{
if (is_int($sceneValue) && $sceneValue > 0 && $sceneValue < self::SCENE_MAX_VALUE) {
$type = self::SCENE_QR_FOREVER;
$sceneKey = 'scene_id';
} else {
$type = self::SCENE_QR_FOREVER_STR;
$sceneKey = 'scene_str';
... | php | public function forever($sceneValue)
{
if (is_int($sceneValue) && $sceneValue > 0 && $sceneValue < self::SCENE_MAX_VALUE) {
$type = self::SCENE_QR_FOREVER;
$sceneKey = 'scene_id';
} else {
$type = self::SCENE_QR_FOREVER_STR;
$sceneKey = 'scene_str';
... | [
"public",
"function",
"forever",
"(",
"$",
"sceneValue",
")",
"{",
"if",
"(",
"is_int",
"(",
"$",
"sceneValue",
")",
"&&",
"$",
"sceneValue",
">",
"0",
"&&",
"$",
"sceneValue",
"<",
"self",
"::",
"SCENE_MAX_VALUE",
")",
"{",
"$",
"type",
"=",
"self",
... | Create forever QR code.
@param string|int $sceneValue
@return \Psr\Http\Message\ResponseInterface|\EasyWeChat\Kernel\Support\Collection|array|object|string | [
"Create",
"forever",
"QR",
"code",
"."
] | 120c72faaa93c270365bc75c73c362d5fd583209 | https://github.com/overtrue/wechat/blob/120c72faaa93c270365bc75c73c362d5fd583209/src/BasicService/QrCode/Client.php#L43-L55 | train | Create forever QrCode | [
30522,
2270,
3853,
5091,
1006,
1002,
3496,
10175,
5657,
1007,
1063,
2065,
1006,
2003,
1035,
20014,
1006,
1002,
3496,
10175,
5657,
1007,
1004,
1004,
1002,
3496,
10175,
5657,
1028,
1014,
1004,
1004,
1002,
3496,
10175,
5657,
1026,
2969,
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... |
getgrav/grav | system/src/Grav/Console/Gpm/IndexCommand.php | IndexCommand.filter | public function filter($data)
{
// filtering and sorting
if ($this->options['plugins-only']) {
unset($data['themes']);
}
if ($this->options['themes-only']) {
unset($data['plugins']);
}
$filter = [
$this->options['filter'],
... | php | public function filter($data)
{
// filtering and sorting
if ($this->options['plugins-only']) {
unset($data['themes']);
}
if ($this->options['themes-only']) {
unset($data['plugins']);
}
$filter = [
$this->options['filter'],
... | [
"public",
"function",
"filter",
"(",
"$",
"data",
")",
"{",
"// filtering and sorting",
"if",
"(",
"$",
"this",
"->",
"options",
"[",
"'plugins-only'",
"]",
")",
"{",
"unset",
"(",
"$",
"data",
"[",
"'themes'",
"]",
")",
";",
"}",
"if",
"(",
"$",
"th... | @param array $data
@return mixed | [
"@param",
"array",
"$data"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Console/Gpm/IndexCommand.php#L195-L244 | train | Filter the array by the given options | [
30522,
2270,
3853,
11307,
1006,
1002,
2951,
1007,
1063,
1013,
1013,
22910,
1998,
22210,
2065,
1006,
1002,
2023,
1011,
1028,
7047,
1031,
1005,
13354,
7076,
1011,
2069,
1005,
1033,
1007,
1063,
4895,
13462,
1006,
1002,
2951,
1031,
1005,
6991,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/ImageMedium.php | ImageMedium.link | public function link($reset = true, array $attributes = [])
{
$attributes['href'] = $this->url(false);
$srcset = $this->srcset(false);
if ($srcset) {
$attributes['data-srcset'] = $srcset;
}
return parent::link($reset, $attributes);
} | php | public function link($reset = true, array $attributes = [])
{
$attributes['href'] = $this->url(false);
$srcset = $this->srcset(false);
if ($srcset) {
$attributes['data-srcset'] = $srcset;
}
return parent::link($reset, $attributes);
} | [
"public",
"function",
"link",
"(",
"$",
"reset",
"=",
"true",
",",
"array",
"$",
"attributes",
"=",
"[",
"]",
")",
"{",
"$",
"attributes",
"[",
"'href'",
"]",
"=",
"$",
"this",
"->",
"url",
"(",
"false",
")",
";",
"$",
"srcset",
"=",
"$",
"this",... | Turn the current Medium into a Link
@param bool $reset
@param array $attributes
@return Link | [
"Turn",
"the",
"current",
"Medium",
"into",
"a",
"Link"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Page/Medium/ImageMedium.php#L385-L394 | train | Link to the page | [
30522,
2270,
3853,
4957,
1006,
1002,
25141,
1027,
2995,
1010,
9140,
1002,
12332,
1027,
1031,
1033,
1007,
1063,
1002,
12332,
1031,
1005,
17850,
12879,
1005,
1033,
1027,
1002,
2023,
1011,
1028,
24471,
2140,
1006,
6270,
1007,
1025,
1002,
5034,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/SitesManager.php | SitesManager.filterBlankFromCommaSepList | private static function filterBlankFromCommaSepList($parameters)
{
$parameters = explode(',', $parameters);
$parameters = array_filter($parameters, 'strlen');
$parameters = array_unique($parameters);
return $parameters;
} | php | private static function filterBlankFromCommaSepList($parameters)
{
$parameters = explode(',', $parameters);
$parameters = array_filter($parameters, 'strlen');
$parameters = array_unique($parameters);
return $parameters;
} | [
"private",
"static",
"function",
"filterBlankFromCommaSepList",
"(",
"$",
"parameters",
")",
"{",
"$",
"parameters",
"=",
"explode",
"(",
"','",
",",
"$",
"parameters",
")",
";",
"$",
"parameters",
"=",
"array_filter",
"(",
"$",
"parameters",
",",
"'strlen'",
... | Trims each element of a comma-separated list of strings, removes empty elements and
returns the result (as an array).
@param string $parameters The unfiltered list.
@return array The filtered list of strings as an array. | [
"Trims",
"each",
"element",
"of",
"a",
"comma",
"-",
"separated",
"list",
"of",
"strings",
"removes",
"empty",
"elements",
"and",
"returns",
"the",
"result",
"(",
"as",
"an",
"array",
")",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SitesManager/SitesManager.php#L288-L294 | train | Filter the parameters by blanks from comma separated list. | [
30522,
2797,
10763,
3853,
11307,
28522,
8950,
19699,
5358,
9006,
9335,
13699,
9863,
1006,
1002,
11709,
1007,
1063,
1002,
11709,
1027,
15044,
1006,
1005,
1010,
1005,
1010,
1002,
11709,
1007,
1025,
1002,
11709,
1027,
9140,
1035,
11307,
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/Cache/MemcachedStore.php | MemcachedStore.putMany | public function putMany(array $values, $seconds)
{
$prefixedValues = [];
foreach ($values as $key => $value) {
$prefixedValues[$this->prefix.$key] = $value;
}
return $this->memcached->setMulti(
$prefixedValues, $this->calculateExpiration($seconds)
);... | php | public function putMany(array $values, $seconds)
{
$prefixedValues = [];
foreach ($values as $key => $value) {
$prefixedValues[$this->prefix.$key] = $value;
}
return $this->memcached->setMulti(
$prefixedValues, $this->calculateExpiration($seconds)
);... | [
"public",
"function",
"putMany",
"(",
"array",
"$",
"values",
",",
"$",
"seconds",
")",
"{",
"$",
"prefixedValues",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"values",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"prefixedValues",
"[",
"$",
... | 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/MemcachedStore.php#L117-L128 | train | Put many values in cache | [
30522,
2270,
3853,
2404,
2386,
2100,
1006,
9140,
1002,
5300,
1010,
1002,
3823,
1007,
1063,
1002,
17576,
2098,
10175,
15808,
1027,
1031,
1033,
1025,
18921,
6776,
1006,
1002,
5300,
2004,
1002,
3145,
1027,
1028,
1002,
3643,
1007,
1063,
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... |
matomo-org/matomo | libs/Zend/Db/Select.php | Zend_Db_Select.from | public function from($name, $cols = '*', $schema = null)
{
return $this->_join(self::FROM, $name, null, $cols, $schema);
} | php | public function from($name, $cols = '*', $schema = null)
{
return $this->_join(self::FROM, $name, null, $cols, $schema);
} | [
"public",
"function",
"from",
"(",
"$",
"name",
",",
"$",
"cols",
"=",
"'*'",
",",
"$",
"schema",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"_join",
"(",
"self",
"::",
"FROM",
",",
"$",
"name",
",",
"null",
",",
"$",
"cols",
",",
"$",... | Adds a FROM table and optional columns to the query.
The first parameter $name can be a simple string, in which case the
correlation name is generated automatically. If you want to specify
the correlation name, the first parameter must be an associative
array in which the key is the correlation name, and the value is... | [
"Adds",
"a",
"FROM",
"table",
"and",
"optional",
"columns",
"to",
"the",
"query",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Select.php#L228-L231 | train | Create a JOIN statement | [
30522,
2270,
3853,
2013,
1006,
1002,
2171,
1010,
1002,
8902,
2015,
1027,
1005,
1008,
1005,
1010,
1002,
8040,
28433,
1027,
19701,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
1035,
3693,
1006,
2969,
1024,
1024,
2013,
1010,
1002,
2171,
1010,
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/Uri.php | Uri.convertUrl | public static function convertUrl(PageInterface $page, $url, $type = 'link', $absolute = false, $route_only = false)
{
$grav = Grav::instance();
$uri = $grav['uri'];
// Link processing should prepend language
$language = $grav['language'];
$language_append = '';
if ... | php | public static function convertUrl(PageInterface $page, $url, $type = 'link', $absolute = false, $route_only = false)
{
$grav = Grav::instance();
$uri = $grav['uri'];
// Link processing should prepend language
$language = $grav['language'];
$language_append = '';
if ... | [
"public",
"static",
"function",
"convertUrl",
"(",
"PageInterface",
"$",
"page",
",",
"$",
"url",
",",
"$",
"type",
"=",
"'link'",
",",
"$",
"absolute",
"=",
"false",
",",
"$",
"route_only",
"=",
"false",
")",
"{",
"$",
"grav",
"=",
"Grav",
"::",
"in... | Converts links from absolute '/' or relative (../..) to a Grav friendly format
@param PageInterface $page the current page to use as reference
@param string|array $url the URL as it was written in the markdown
@param string $type the type of URL, image | link
@param bool $absolute if null, will use system default, if ... | [
"Converts",
"links",
"from",
"absolute",
"/",
"or",
"relative",
"(",
"..",
"/",
"..",
")",
"to",
"a",
"Grav",
"friendly",
"format"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Uri.php#L745-L891 | train | Convert a URL to a page | [
30522,
2270,
10763,
3853,
10463,
3126,
2140,
1006,
3931,
18447,
2121,
12172,
1002,
3931,
1010,
1002,
24471,
2140,
1010,
1002,
2828,
1027,
1005,
4957,
1005,
1010,
1002,
7619,
1027,
6270,
1010,
1002,
2799,
1035,
2069,
1027,
6270,
1007,
1063,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/traits/FormModelSaver.php | FormModelSaver.prepareModelsToSave | protected function prepareModelsToSave($model, $saveData)
{
$this->modelsToSave = [];
$this->setModelAttributes($model, $saveData);
$this->modelsToSave = array_reverse($this->modelsToSave);
return $this->modelsToSave;
} | php | protected function prepareModelsToSave($model, $saveData)
{
$this->modelsToSave = [];
$this->setModelAttributes($model, $saveData);
$this->modelsToSave = array_reverse($this->modelsToSave);
return $this->modelsToSave;
} | [
"protected",
"function",
"prepareModelsToSave",
"(",
"$",
"model",
",",
"$",
"saveData",
")",
"{",
"$",
"this",
"->",
"modelsToSave",
"=",
"[",
"]",
";",
"$",
"this",
"->",
"setModelAttributes",
"(",
"$",
"model",
",",
"$",
"saveData",
")",
";",
"$",
"... | Takes a model and fills it with data from a multidimensional array.
If an attribute is found to be a relationship, that relationship
is also filled.
$modelsToSave = $this->prepareModelsToSave($model, [...]);
foreach ($modelsToSave as $modelToSave) {
$modelToSave->save();
}
@param \October\Rain\Database\Model $model ... | [
"Takes",
"a",
"model",
"and",
"fills",
"it",
"with",
"data",
"from",
"a",
"multidimensional",
"array",
".",
"If",
"an",
"attribute",
"is",
"found",
"to",
"be",
"a",
"relationship",
"that",
"relationship",
"is",
"also",
"filled",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/traits/FormModelSaver.php#L37-L43 | train | Prepare the models to save | [
30522,
5123,
3853,
7374,
5302,
9247,
16033,
3736,
3726,
1006,
1002,
2944,
1010,
1002,
5552,
6790,
1007,
1063,
1002,
2023,
1011,
1028,
4275,
13122,
10696,
1027,
1031,
1033,
1025,
1002,
2023,
1011,
1028,
2275,
5302,
9247,
19321,
3089,
8569,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Firewall/ExceptionListener.php | ExceptionListener.onKernelException | public function onKernelException(GetResponseForExceptionEvent $event)
{
$exception = $event->getException();
do {
if ($exception instanceof AuthenticationException) {
return $this->handleAuthenticationException($event, $exception);
} elseif ($exception instan... | php | public function onKernelException(GetResponseForExceptionEvent $event)
{
$exception = $event->getException();
do {
if ($exception instanceof AuthenticationException) {
return $this->handleAuthenticationException($event, $exception);
} elseif ($exception instan... | [
"public",
"function",
"onKernelException",
"(",
"GetResponseForExceptionEvent",
"$",
"event",
")",
"{",
"$",
"exception",
"=",
"$",
"event",
"->",
"getException",
"(",
")",
";",
"do",
"{",
"if",
"(",
"$",
"exception",
"instanceof",
"AuthenticationException",
")"... | Handles security related exceptions. | [
"Handles",
"security",
"related",
"exceptions",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Security/Http/Firewall/ExceptionListener.php#L90-L102 | train | This method is called when an exception occurs in the kernel. | [
30522,
2270,
3853,
2006,
5484,
11877,
10288,
24422,
1006,
2131,
6072,
26029,
20106,
5686,
2595,
24422,
18697,
3372,
1002,
2724,
1007,
1063,
1002,
6453,
1027,
1002,
2724,
1011,
1028,
2131,
10288,
24422,
1006,
1007,
1025,
2079,
1063,
2065,
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... |
overtrue/wechat | src/OfficialAccount/POI/Client.php | Client.update | public function update(int $poiId, array $baseInfo)
{
$params = [
'business' => [
'base_info' => array_merge($baseInfo, ['poi_id' => $poiId]),
],
];
return $this->httpPostJson('cgi-bin/poi/updatepoi', $params);
} | php | public function update(int $poiId, array $baseInfo)
{
$params = [
'business' => [
'base_info' => array_merge($baseInfo, ['poi_id' => $poiId]),
],
];
return $this->httpPostJson('cgi-bin/poi/updatepoi', $params);
} | [
"public",
"function",
"update",
"(",
"int",
"$",
"poiId",
",",
"array",
"$",
"baseInfo",
")",
"{",
"$",
"params",
"=",
"[",
"'business'",
"=>",
"[",
"'base_info'",
"=>",
"array_merge",
"(",
"$",
"baseInfo",
",",
"[",
"'poi_id'",
"=>",
"$",
"poiId",
"]"... | Update a POI.
@param int $poiId
@param array $baseInfo
@return \Psr\Http\Message\ResponseInterface|\EasyWeChat\Kernel\Support\Collection|array|object|string | [
"Update",
"a",
"POI",
"."
] | 120c72faaa93c270365bc75c73c362d5fd583209 | https://github.com/overtrue/wechat/blob/120c72faaa93c270365bc75c73c362d5fd583209/src/OfficialAccount/POI/Client.php#L99-L108 | train | Update a POI | [
30522,
2270,
3853,
10651,
1006,
20014,
1002,
13433,
6137,
2094,
1010,
9140,
1002,
2918,
2378,
14876,
1007,
1063,
1002,
11498,
5244,
1027,
1031,
1005,
2449,
1005,
1027,
1028,
1031,
1005,
2918,
1035,
18558,
1005,
1027,
1028,
9140,
1035,
13590... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.