repo stringclasses 21
values | path stringlengths 10 105 | func_name stringlengths 6 64 | original_string stringlengths 105 15.6k | language stringclasses 1
value | code stringlengths 105 15.6k | code_tokens listlengths 29 2.15k | docstring stringlengths 11 2.85k | docstring_tokens listlengths 1 290 | sha stringclasses 21
values | url stringlengths 100 194 | partition stringclasses 1
value | summary stringlengths 8 319 | input_ids listlengths 502 502 | token_type_ids listlengths 502 502 | attention_mask listlengths 502 502 | labels listlengths 502 502 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
spatie/laravel-permission | src/Traits/HasPermissions.php | HasPermissions.getAllPermissions | public function getAllPermissions(): Collection
{
$permissions = $this->permissions;
if ($this->roles) {
$permissions = $permissions->merge($this->getPermissionsViaRoles());
}
return $permissions->sort()->values();
} | php | public function getAllPermissions(): Collection
{
$permissions = $this->permissions;
if ($this->roles) {
$permissions = $permissions->merge($this->getPermissionsViaRoles());
}
return $permissions->sort()->values();
} | [
"public",
"function",
"getAllPermissions",
"(",
")",
":",
"Collection",
"{",
"$",
"permissions",
"=",
"$",
"this",
"->",
"permissions",
";",
"if",
"(",
"$",
"this",
"->",
"roles",
")",
"{",
"$",
"permissions",
"=",
"$",
"permissions",
"->",
"merge",
"(",... | Return all the permissions the model has, both directly and via roles.
@throws \Exception | [
"Return",
"all",
"the",
"permissions",
"the",
"model",
"has",
"both",
"directly",
"and",
"via",
"roles",
"."
] | 81dbe9d372d70c255b66a2727a235076509f8d45 | https://github.com/spatie/laravel-permission/blob/81dbe9d372d70c255b66a2727a235076509f8d45/src/Traits/HasPermissions.php#L276-L285 | train | Get all permissions | [
30522,
2270,
3853,
2131,
8095,
4842,
25481,
2015,
1006,
1007,
1024,
3074,
1063,
1002,
6656,
2015,
1027,
1002,
2023,
1011,
1028,
6656,
2015,
1025,
2065,
1006,
1002,
2023,
1011,
1028,
4395,
1007,
1063,
1002,
6656,
2015,
1027,
1002,
6656,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Console/Output/ConsoleSectionOutput.php | ConsoleSectionOutput.clear | public function clear(int $lines = null)
{
if (empty($this->content) || !$this->isDecorated()) {
return;
}
if ($lines) {
\array_splice($this->content, -($lines * 2)); // Multiply lines by 2 to cater for each new line added between content
} else {
... | php | public function clear(int $lines = null)
{
if (empty($this->content) || !$this->isDecorated()) {
return;
}
if ($lines) {
\array_splice($this->content, -($lines * 2)); // Multiply lines by 2 to cater for each new line added between content
} else {
... | [
"public",
"function",
"clear",
"(",
"int",
"$",
"lines",
"=",
"null",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"content",
")",
"||",
"!",
"$",
"this",
"->",
"isDecorated",
"(",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"$",
"li... | Clears previous output for this section.
@param int $lines Number of lines to clear. If null, then the entire output of this section is cleared | [
"Clears",
"previous",
"output",
"for",
"this",
"section",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Output/ConsoleSectionOutput.php#L46-L62 | train | Clear the content of the current section | [
30522,
2270,
3853,
3154,
1006,
20014,
1002,
3210,
1027,
19701,
1007,
30524,
2709,
1025,
1065,
2065,
1006,
1002,
3210,
1007,
1063,
1032,
9140,
1035,
11867,
13231,
1006,
1002,
2023,
1011,
1028,
4180,
1010,
1011,
1006,
1002,
3210,
1008,
1016,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.loadEnv | public function loadEnv(string $path, string $varName = 'APP_ENV', string $defaultEnv = 'dev', array $testEnvs = ['test']): void
{
if (file_exists($path) || !file_exists($p = "$path.dist")) {
$this->load($path);
} else {
$this->load($p);
}
if (null === $env =... | php | public function loadEnv(string $path, string $varName = 'APP_ENV', string $defaultEnv = 'dev', array $testEnvs = ['test']): void
{
if (file_exists($path) || !file_exists($p = "$path.dist")) {
$this->load($path);
} else {
$this->load($p);
}
if (null === $env =... | [
"public",
"function",
"loadEnv",
"(",
"string",
"$",
"path",
",",
"string",
"$",
"varName",
"=",
"'APP_ENV'",
",",
"string",
"$",
"defaultEnv",
"=",
"'dev'",
",",
"array",
"$",
"testEnvs",
"=",
"[",
"'test'",
"]",
")",
":",
"void",
"{",
"if",
"(",
"f... | Loads a .env file and the corresponding .env.local, .env.$env and .env.$env.local files if they exist.
.env.local is always ignored in test env because tests should produce the same results for everyone.
.env.dist is loaded when it exists and .env is not found.
@param string $path A file to load
@param string $... | [
"Loads",
"a",
".",
"env",
"file",
"and",
"the",
"corresponding",
".",
"env",
".",
"local",
".",
"env",
".",
"$env",
"and",
".",
"env",
".",
"$env",
".",
"local",
"files",
"if",
"they",
"exist",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Dotenv/Dotenv.php#L82-L110 | train | Load environment variables from path. env. | [
30522,
2270,
3853,
7170,
2368,
2615,
1006,
5164,
1002,
4130,
1010,
5164,
1002,
13075,
18442,
1027,
1005,
10439,
1035,
4372,
2615,
1005,
1010,
5164,
1002,
12398,
2368,
2615,
1027,
1005,
16475,
1005,
1010,
9140,
1002,
3231,
2368,
15088,
1027,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Console/Helper/ProgressIndicator.php | ProgressIndicator.finish | public function finish($message)
{
if (!$this->started) {
throw new LogicException('Progress indicator has not yet been started.');
}
$this->message = $message;
$this->display();
$this->output->writeln('');
$this->started = false;
} | php | public function finish($message)
{
if (!$this->started) {
throw new LogicException('Progress indicator has not yet been started.');
}
$this->message = $message;
$this->display();
$this->output->writeln('');
$this->started = false;
} | [
"public",
"function",
"finish",
"(",
"$",
"message",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"started",
")",
"{",
"throw",
"new",
"LogicException",
"(",
"'Progress indicator has not yet been started.'",
")",
";",
"}",
"$",
"this",
"->",
"message",
"=",
... | Finish the indicator with message.
@param $message | [
"Finish",
"the",
"indicator",
"with",
"message",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Helper/ProgressIndicator.php#L128-L138 | train | Finish the progress indicator | [
30522,
2270,
3853,
3926,
1006,
1002,
4471,
1007,
1063,
2065,
1006,
999,
1002,
2023,
1011,
1028,
2318,
1007,
1063,
5466,
2047,
7961,
10288,
24422,
1006,
1005,
5082,
17245,
2038,
2025,
2664,
2042,
2318,
1012,
1005,
1007,
1025,
1065,
1002,
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/Container/Container.php | Container.instance | public function instance($abstract, $instance)
{
$this->removeAbstractAlias($abstract);
$isBound = $this->bound($abstract);
unset($this->aliases[$abstract]);
// We'll check to determine if this type has been bound before, and if it has
// we will fire the rebound callbacks... | php | public function instance($abstract, $instance)
{
$this->removeAbstractAlias($abstract);
$isBound = $this->bound($abstract);
unset($this->aliases[$abstract]);
// We'll check to determine if this type has been bound before, and if it has
// we will fire the rebound callbacks... | [
"public",
"function",
"instance",
"(",
"$",
"abstract",
",",
"$",
"instance",
")",
"{",
"$",
"this",
"->",
"removeAbstractAlias",
"(",
"$",
"abstract",
")",
";",
"$",
"isBound",
"=",
"$",
"this",
"->",
"bound",
"(",
"$",
"abstract",
")",
";",
"unset",
... | Register an existing instance as shared in the container.
@param string $abstract
@param mixed $instance
@return mixed | [
"Register",
"an",
"existing",
"instance",
"as",
"shared",
"in",
"the",
"container",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Container/Container.php#L393-L411 | train | This method will set the instance of the type | [
30522,
2270,
3853,
6013,
1006,
1002,
10061,
1010,
1002,
6013,
1007,
1063,
1002,
2023,
1011,
1028,
6366,
7875,
20528,
25572,
6632,
2015,
1006,
1002,
10061,
1007,
1025,
1002,
2003,
15494,
1027,
1002,
2023,
1011,
1028,
5391,
1006,
1002,
10061,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
barryvdh/laravel-debugbar | src/DataCollector/QueryCollector.php | QueryCollector.fileIsInExcludedPath | protected function fileIsInExcludedPath($file)
{
$excludedPaths = [
'/vendor/laravel/framework/src/Illuminate/Database',
'/vendor/laravel/framework/src/Illuminate/Events',
'/vendor/barryvdh/laravel-debugbar',
];
$normalizedPath = str_replace('\\', '/', $f... | php | protected function fileIsInExcludedPath($file)
{
$excludedPaths = [
'/vendor/laravel/framework/src/Illuminate/Database',
'/vendor/laravel/framework/src/Illuminate/Events',
'/vendor/barryvdh/laravel-debugbar',
];
$normalizedPath = str_replace('\\', '/', $f... | [
"protected",
"function",
"fileIsInExcludedPath",
"(",
"$",
"file",
")",
"{",
"$",
"excludedPaths",
"=",
"[",
"'/vendor/laravel/framework/src/Illuminate/Database'",
",",
"'/vendor/laravel/framework/src/Illuminate/Events'",
",",
"'/vendor/barryvdh/laravel-debugbar'",
",",
"]",
";... | Check if the given file is to be excluded from analysis
@param string $file
@return bool | [
"Check",
"if",
"the",
"given",
"file",
"is",
"to",
"be",
"excluded",
"from",
"analysis"
] | 2d195779ea4f809f69764a795e2ec371dbb76a96 | https://github.com/barryvdh/laravel-debugbar/blob/2d195779ea4f809f69764a795e2ec371dbb76a96/src/DataCollector/QueryCollector.php#L273-L290 | train | Checks if a file is in the excluded path | [
30522,
5123,
3853,
5371,
17417,
2638,
2595,
20464,
13936,
15069,
1006,
1002,
5371,
1007,
1063,
1002,
12421,
15069,
2015,
1027,
1031,
1005,
1013,
21431,
1013,
13679,
15985,
1013,
7705,
1013,
5034,
2278,
1013,
5665,
12717,
12556,
1013,
7809,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Config/CompiledBase.php | CompiledBase.name | public function name($name = null)
{
if (!$this->name) {
$this->name = $name ?: md5(json_encode(array_keys($this->files)));
}
return $this;
} | php | public function name($name = null)
{
if (!$this->name) {
$this->name = $name ?: md5(json_encode(array_keys($this->files)));
}
return $this;
} | [
"public",
"function",
"name",
"(",
"$",
"name",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"name",
")",
"{",
"$",
"this",
"->",
"name",
"=",
"$",
"name",
"?",
":",
"md5",
"(",
"json_encode",
"(",
"array_keys",
"(",
"$",
"this",
"... | Get filename for the compiled PHP file.
@param string $name
@return $this | [
"Get",
"filename",
"for",
"the",
"compiled",
"PHP",
"file",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Config/CompiledBase.php#L80-L87 | train | Get name of the file | [
30522,
2270,
3853,
2171,
1006,
1002,
2171,
1027,
19701,
1007,
1063,
2065,
1006,
999,
1002,
2023,
1011,
1028,
2171,
1007,
1063,
1002,
2023,
1011,
1028,
2171,
1027,
1002,
2171,
1029,
1024,
9108,
2629,
1006,
1046,
3385,
1035,
4372,
16044,
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/Console/Output/Output.php | Output.writeln | public function writeln($messages, $options = self::OUTPUT_NORMAL)
{
$this->write($messages, true, $options);
} | php | public function writeln($messages, $options = self::OUTPUT_NORMAL)
{
$this->write($messages, true, $options);
} | [
"public",
"function",
"writeln",
"(",
"$",
"messages",
",",
"$",
"options",
"=",
"self",
"::",
"OUTPUT_NORMAL",
")",
"{",
"$",
"this",
"->",
"write",
"(",
"$",
"messages",
",",
"true",
",",
"$",
"options",
")",
";",
"}"
] | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Output/Output.php#L130-L133 | train | Write messages to the log file | [
30522,
2270,
3853,
4339,
19666,
1006,
1002,
7696,
1010,
1002,
7047,
1027,
2969,
1024,
1024,
6434,
1035,
3671,
1007,
1063,
1002,
2023,
1011,
1028,
4339,
1006,
1002,
7696,
1010,
2995,
1010,
1002,
7047,
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... |
symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Templating/Loader/FilesystemLoader.php | FilesystemLoader.isFresh | public function isFresh(TemplateReferenceInterface $template, $time)
{
if (false === $storage = $this->load($template)) {
return false;
}
if (!is_readable((string) $storage)) {
return false;
}
return filemtime((string) $storage) < $time;
} | php | public function isFresh(TemplateReferenceInterface $template, $time)
{
if (false === $storage = $this->load($template)) {
return false;
}
if (!is_readable((string) $storage)) {
return false;
}
return filemtime((string) $storage) < $time;
} | [
"public",
"function",
"isFresh",
"(",
"TemplateReferenceInterface",
"$",
"template",
",",
"$",
"time",
")",
"{",
"if",
"(",
"false",
"===",
"$",
"storage",
"=",
"$",
"this",
"->",
"load",
"(",
"$",
"template",
")",
")",
"{",
"return",
"false",
";",
"}"... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bundle/FrameworkBundle/Templating/Loader/FilesystemLoader.php#L54-L65 | train | Fresh template file | [
30522,
2270,
3853,
2003,
19699,
9953,
1006,
23561,
2890,
25523,
18447,
2121,
12172,
1002,
23561,
1010,
1002,
2051,
1007,
1063,
2065,
1006,
6270,
1027,
1027,
1027,
1002,
5527,
1027,
1002,
2023,
1011,
1028,
7170,
1006,
1002,
23561,
1007,
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/Validator/Constraints/FileValidator.php | FileValidator.factorizeSizes | private function factorizeSizes($size, $limit, $binaryFormat)
{
if ($binaryFormat) {
$coef = self::MIB_BYTES;
$coefFactor = self::KIB_BYTES;
} else {
$coef = self::MB_BYTES;
$coefFactor = self::KB_BYTES;
}
$limitAsString = (string) ($l... | php | private function factorizeSizes($size, $limit, $binaryFormat)
{
if ($binaryFormat) {
$coef = self::MIB_BYTES;
$coefFactor = self::KIB_BYTES;
} else {
$coef = self::MB_BYTES;
$coefFactor = self::KB_BYTES;
}
$limitAsString = (string) ($l... | [
"private",
"function",
"factorizeSizes",
"(",
"$",
"size",
",",
"$",
"limit",
",",
"$",
"binaryFormat",
")",
"{",
"if",
"(",
"$",
"binaryFormat",
")",
"{",
"$",
"coef",
"=",
"self",
"::",
"MIB_BYTES",
";",
"$",
"coefFactor",
"=",
"self",
"::",
"KIB_BYT... | Convert the limit to the smallest possible number
(i.e. try "MB", then "kB", then "bytes"). | [
"Convert",
"the",
"limit",
"to",
"the",
"smallest",
"possible",
"number",
"(",
"i",
".",
"e",
".",
"try",
"MB",
"then",
"kB",
"then",
"bytes",
")",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Validator/Constraints/FileValidator.php#L211-L242 | train | Factorizes the sizes | [
30522,
2797,
3853,
5387,
10057,
10057,
1006,
1002,
2946,
1010,
1002,
5787,
1010,
1002,
12441,
14192,
4017,
1007,
1063,
2065,
1006,
1002,
12441,
14192,
4017,
1007,
1063,
1002,
24873,
2546,
1027,
2969,
1024,
1024,
2771,
2497,
1035,
27507,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/ReportRenderer/Csv.php | Csv.renderReport | public function renderReport($processedReport)
{
$csvRenderer = $this->getRenderer(
$processedReport['reportData'],
$processedReport['metadata']['uniqueId']
);
$reportData = $csvRenderer->render($processedReport);
if (empty($reportData)) {
$report... | php | public function renderReport($processedReport)
{
$csvRenderer = $this->getRenderer(
$processedReport['reportData'],
$processedReport['metadata']['uniqueId']
);
$reportData = $csvRenderer->render($processedReport);
if (empty($reportData)) {
$report... | [
"public",
"function",
"renderReport",
"(",
"$",
"processedReport",
")",
"{",
"$",
"csvRenderer",
"=",
"$",
"this",
"->",
"getRenderer",
"(",
"$",
"processedReport",
"[",
"'reportData'",
"]",
",",
"$",
"processedReport",
"[",
"'metadata'",
"]",
"[",
"'uniqueId'... | Render the provided report.
Multiple calls to this method before calling outputRendering appends each report content.
@param array $processedReport @see API::getProcessedReport() | [
"Render",
"the",
"provided",
"report",
".",
"Multiple",
"calls",
"to",
"this",
"method",
"before",
"calling",
"outputRendering",
"appends",
"each",
"report",
"content",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/ReportRenderer/Csv.php#L110-L134 | train | Render a single report | [
30522,
2270,
3853,
17552,
2890,
6442,
1006,
1002,
13995,
2890,
6442,
1007,
1063,
1002,
20116,
12229,
11563,
2121,
1027,
1002,
2023,
1011,
1028,
2131,
7389,
4063,
2121,
1006,
1002,
13995,
2890,
6442,
1031,
1005,
3189,
2850,
2696,
1005,
1033,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Routing/Route.php | Route.setPath | public function setPath($pattern)
{
if (false !== strpbrk($pattern, '?<')) {
$pattern = preg_replace_callback('#\{(\w++)(<.*?>)?(\?[^\}]*+)?\}#', function ($m) {
if (isset($m[3][0])) {
$this->setDefault($m[1], '?' !== $m[3] ? substr($m[3], 1) : null);
... | php | public function setPath($pattern)
{
if (false !== strpbrk($pattern, '?<')) {
$pattern = preg_replace_callback('#\{(\w++)(<.*?>)?(\?[^\}]*+)?\}#', function ($m) {
if (isset($m[3][0])) {
$this->setDefault($m[1], '?' !== $m[3] ? substr($m[3], 1) : null);
... | [
"public",
"function",
"setPath",
"(",
"$",
"pattern",
")",
"{",
"if",
"(",
"false",
"!==",
"strpbrk",
"(",
"$",
"pattern",
",",
"'?<'",
")",
")",
"{",
"$",
"pattern",
"=",
"preg_replace_callback",
"(",
"'#\\{(\\w++)(<.*?>)?(\\?[^\\}]*+)?\\}#'",
",",
"function"... | Sets the pattern for the path.
This method implements a fluent interface.
@param string $pattern The path pattern
@return $this | [
"Sets",
"the",
"pattern",
"for",
"the",
"path",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Routing/Route.php#L133-L154 | train | Set the path of the route | [
30522,
2270,
3853,
2275,
15069,
1006,
1002,
5418,
1007,
1063,
2065,
1006,
6270,
999,
1027,
1027,
2358,
14536,
19892,
2243,
1006,
1002,
5418,
1010,
1005,
1029,
1026,
1005,
1007,
1007,
1063,
1002,
5418,
1027,
3653,
2290,
1035,
5672,
1035,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php | XmlFileLoader.validateAlias | private function validateAlias(\DOMElement $alias, $file)
{
foreach ($alias->attributes as $name => $node) {
if (!\in_array($name, ['alias', 'id', 'public'])) {
throw new InvalidArgumentException(sprintf('Invalid attribute "%s" defined for alias "%s" in "%s".', $name, $alias->get... | php | private function validateAlias(\DOMElement $alias, $file)
{
foreach ($alias->attributes as $name => $node) {
if (!\in_array($name, ['alias', 'id', 'public'])) {
throw new InvalidArgumentException(sprintf('Invalid attribute "%s" defined for alias "%s" in "%s".', $name, $alias->get... | [
"private",
"function",
"validateAlias",
"(",
"\\",
"DOMElement",
"$",
"alias",
",",
"$",
"file",
")",
"{",
"foreach",
"(",
"$",
"alias",
"->",
"attributes",
"as",
"$",
"name",
"=>",
"$",
"node",
")",
"{",
"if",
"(",
"!",
"\\",
"in_array",
"(",
"$",
... | Validates an alias.
@param \DOMElement $alias
@param string $file | [
"Validates",
"an",
"alias",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php#L687-L703 | train | Validate alias nodes | [
30522,
2797,
3853,
9398,
3686,
22786,
2015,
1006,
1032,
8514,
16930,
4765,
1002,
14593,
1010,
1002,
5371,
1007,
1063,
18921,
6776,
1006,
1002,
14593,
1011,
1028,
12332,
2004,
1002,
2171,
1027,
1028,
1002,
13045,
1007,
1063,
2065,
1006,
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... |
octobercms/october | modules/system/classes/CombineAssets.php | CombineAssets.getFilters | public function getFilters($extension = null)
{
if ($extension === null) {
return $this->filters;
}
elseif (isset($this->filters[$extension])) {
return $this->filters[$extension];
}
else {
return null;
}
} | php | public function getFilters($extension = null)
{
if ($extension === null) {
return $this->filters;
}
elseif (isset($this->filters[$extension])) {
return $this->filters[$extension];
}
else {
return null;
}
} | [
"public",
"function",
"getFilters",
"(",
"$",
"extension",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"extension",
"===",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"filters",
";",
"}",
"elseif",
"(",
"isset",
"(",
"$",
"this",
"->",
"filters",
"[",
... | Returns filters.
@param string $extension Extension name. Eg: css
@return self | [
"Returns",
"filters",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/CombineAssets.php#L607-L618 | train | Get filters by extension | [
30522,
2270,
3853,
2131,
8873,
21928,
2015,
1006,
1002,
5331,
1027,
19701,
1007,
1063,
2065,
1006,
1002,
5331,
1027,
1027,
1027,
19701,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
17736,
1025,
1065,
2842,
10128,
1006,
26354,
3388,
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 | libs/Zend/Mail/Part/File.php | Zend_Mail_Part_File.getContent | public function getContent($stream = null)
{
fseek($this->_fh, $this->_contentPos[0]);
if ($stream !== null) {
return stream_copy_to_stream($this->_fh, $stream, $this->_contentPos[1] - $this->_contentPos[0]);
}
$length = $this->_contentPos[1] - $this->_contentPos[0];
... | php | public function getContent($stream = null)
{
fseek($this->_fh, $this->_contentPos[0]);
if ($stream !== null) {
return stream_copy_to_stream($this->_fh, $stream, $this->_contentPos[1] - $this->_contentPos[0]);
}
$length = $this->_contentPos[1] - $this->_contentPos[0];
... | [
"public",
"function",
"getContent",
"(",
"$",
"stream",
"=",
"null",
")",
"{",
"fseek",
"(",
"$",
"this",
"->",
"_fh",
",",
"$",
"this",
"->",
"_contentPos",
"[",
"0",
"]",
")",
";",
"if",
"(",
"$",
"stream",
"!==",
"null",
")",
"{",
"return",
"s... | Body of part
If part is multipart the raw content of this part with all sub parts is returned
@return string body
@throws Zend_Mail_Exception | [
"Body",
"of",
"part"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail/Part/File.php#L156-L164 | train | Get content of the file | [
30522,
2270,
3853,
2131,
8663,
6528,
2102,
1006,
1002,
5460,
1027,
19701,
1007,
1063,
1042,
19763,
2243,
1006,
1002,
2023,
1011,
1028,
1035,
1042,
2232,
1010,
1002,
2023,
1011,
1028,
1035,
4180,
6873,
2015,
1031,
1014,
1033,
1007,
1025,
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... |
getgrav/grav | system/src/Grav/Common/Page/Page.php | Page.templateFormat | public function templateFormat($var = null)
{
if ($var !== null) {
$this->template_format = $var;
return $this->template_format;
}
if (isset($this->template_format)) {
return $this->template_format;
}
// Set from URL extension set on page... | php | public function templateFormat($var = null)
{
if ($var !== null) {
$this->template_format = $var;
return $this->template_format;
}
if (isset($this->template_format)) {
return $this->template_format;
}
// Set from URL extension set on page... | [
"public",
"function",
"templateFormat",
"(",
"$",
"var",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"var",
"!==",
"null",
")",
"{",
"$",
"this",
"->",
"template_format",
"=",
"$",
"var",
";",
"return",
"$",
"this",
"->",
"template_format",
";",
"}",
"if"... | Allows a page to override the output render format, usually the extension provided
in the URL. (e.g. `html`, `json`, `xml`, etc).
@param null $var
@return null | [
"Allows",
"a",
"page",
"to",
"override",
"the",
"output",
"render",
"format",
"usually",
"the",
"extension",
"provided",
"in",
"the",
"URL",
".",
"(",
"e",
".",
"g",
".",
"html",
"json",
"xml",
"etc",
")",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Page/Page.php#L1373-L1419 | train | Get the template format | [
30522,
2270,
3853,
23561,
14192,
4017,
1006,
1002,
13075,
1027,
19701,
1007,
1063,
2065,
1006,
1002,
13075,
999,
1027,
1027,
19701,
1007,
1063,
1002,
2023,
1011,
1028,
23561,
1035,
4289,
1027,
1002,
13075,
1025,
2709,
1002,
2023,
1011,
1028... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Notifications/Events/BroadcastNotificationCreated.php | BroadcastNotificationCreated.broadcastOn | public function broadcastOn()
{
$channels = $this->notification->broadcastOn();
if (! empty($channels)) {
return $channels;
}
return [new PrivateChannel($this->channelName())];
} | php | public function broadcastOn()
{
$channels = $this->notification->broadcastOn();
if (! empty($channels)) {
return $channels;
}
return [new PrivateChannel($this->channelName())];
} | [
"public",
"function",
"broadcastOn",
"(",
")",
"{",
"$",
"channels",
"=",
"$",
"this",
"->",
"notification",
"->",
"broadcastOn",
"(",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"channels",
")",
")",
"{",
"return",
"$",
"channels",
";",
"}",
"retur... | Get the channels the event should broadcast on.
@return array | [
"Get",
"the",
"channels",
"the",
"event",
"should",
"broadcast",
"on",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Notifications/Events/BroadcastNotificationCreated.php#L55-L64 | train | Get the channels that this notification should broadcast on | [
30522,
2270,
3853,
3743,
2239,
1006,
1007,
1063,
1002,
6833,
1027,
1002,
2023,
1011,
1028,
26828,
1011,
1028,
3743,
2239,
1006,
1007,
1025,
2065,
1006,
999,
4064,
1006,
1002,
6833,
1007,
1007,
1063,
2709,
1002,
6833,
1025,
1065,
2709,
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/Http/Concerns/InteractsWithInput.php | InteractsWithInput.hasFile | public function hasFile($key)
{
if (! is_array($files = $this->file($key))) {
$files = [$files];
}
foreach ($files as $file) {
if ($this->isValidFile($file)) {
return true;
}
}
return false;
} | php | public function hasFile($key)
{
if (! is_array($files = $this->file($key))) {
$files = [$files];
}
foreach ($files as $file) {
if ($this->isValidFile($file)) {
return true;
}
}
return false;
} | [
"public",
"function",
"hasFile",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"files",
"=",
"$",
"this",
"->",
"file",
"(",
"$",
"key",
")",
")",
")",
"{",
"$",
"files",
"=",
"[",
"$",
"files",
"]",
";",
"}",
"foreach",
"(... | Determine if the uploaded data contains a file.
@param string $key
@return bool | [
"Determine",
"if",
"the",
"uploaded",
"data",
"contains",
"a",
"file",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Http/Concerns/InteractsWithInput.php#L340-L353 | train | Checks if a file exists in the directory | [
30522,
2270,
3853,
2038,
8873,
2571,
1006,
1002,
3145,
1007,
1063,
2065,
1006,
999,
2003,
1035,
9140,
1006,
1002,
6764,
1027,
1002,
2023,
1011,
1028,
5371,
1006,
1002,
3145,
1007,
1007,
1007,
1063,
1002,
6764,
1027,
1031,
1002,
6764,
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 | libs/Zend/Db/Table/Abstract.php | Zend_Db_Table_Abstract._setupTableName | protected function _setupTableName()
{
if (! $this->_name) {
$this->_name = get_class($this);
} else if (strpos($this->_name, '.')) {
list($this->_schema, $this->_name) = explode('.', $this->_name);
}
} | php | protected function _setupTableName()
{
if (! $this->_name) {
$this->_name = get_class($this);
} else if (strpos($this->_name, '.')) {
list($this->_schema, $this->_name) = explode('.', $this->_name);
}
} | [
"protected",
"function",
"_setupTableName",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_name",
")",
"{",
"$",
"this",
"->",
"_name",
"=",
"get_class",
"(",
"$",
"this",
")",
";",
"}",
"else",
"if",
"(",
"strpos",
"(",
"$",
"this",
"->",
"... | Initialize table and schema names.
If the table name is not set in the class definition,
use the class name itself as the table name.
A schema name provided with the table name (e.g., "schema.table") overrides
any existing value for $this->_schema.
@return void | [
"Initialize",
"table",
"and",
"schema",
"names",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Table/Abstract.php#L771-L778 | train | Setup table name | [
30522,
5123,
3853,
1035,
16437,
10880,
18442,
1006,
1007,
1063,
2065,
1006,
999,
1002,
2023,
1011,
1028,
1035,
2171,
1007,
1063,
1002,
2023,
1011,
1028,
1035,
2171,
1027,
2131,
1035,
2465,
1006,
1002,
2023,
1007,
1025,
1065,
2842,
2065,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Broadcasting/Broadcasters/PusherBroadcaster.php | PusherBroadcaster.validAuthenticationResponse | public function validAuthenticationResponse($request, $result)
{
if (Str::startsWith($request->channel_name, 'private')) {
return $this->decodePusherResponse(
$request, $this->pusher->socket_auth($request->channel_name, $request->socket_id)
);
}
$chan... | php | public function validAuthenticationResponse($request, $result)
{
if (Str::startsWith($request->channel_name, 'private')) {
return $this->decodePusherResponse(
$request, $this->pusher->socket_auth($request->channel_name, $request->socket_id)
);
}
$chan... | [
"public",
"function",
"validAuthenticationResponse",
"(",
"$",
"request",
",",
"$",
"result",
")",
"{",
"if",
"(",
"Str",
"::",
"startsWith",
"(",
"$",
"request",
"->",
"channel_name",
",",
"'private'",
")",
")",
"{",
"return",
"$",
"this",
"->",
"decodePu... | Return the valid authentication response.
@param \Illuminate\Http\Request $request
@param mixed $result
@return mixed | [
"Return",
"the",
"valid",
"authentication",
"response",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Broadcasting/Broadcasters/PusherBroadcaster.php#L62-L79 | train | validAuthenticationResponse - Callback for pusher presence auth | [
30522,
2270,
3853,
9398,
4887,
10760,
16778,
10719,
6072,
26029,
3366,
1006,
1002,
5227,
1010,
1002,
2765,
1007,
1063,
2065,
1006,
2358,
2099,
1024,
1024,
4627,
24415,
1006,
1002,
5227,
1011,
1028,
3149,
1035,
2171,
1010,
1005,
2797,
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... |
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... |
laravel/framework | src/Illuminate/Console/GeneratorCommand.php | GeneratorCommand.getPath | protected function getPath($name)
{
$name = Str::replaceFirst($this->rootNamespace(), '', $name);
return $this->laravel['path'].'/'.str_replace('\\', '/', $name).'.php';
} | php | protected function getPath($name)
{
$name = Str::replaceFirst($this->rootNamespace(), '', $name);
return $this->laravel['path'].'/'.str_replace('\\', '/', $name).'.php';
} | [
"protected",
"function",
"getPath",
"(",
"$",
"name",
")",
"{",
"$",
"name",
"=",
"Str",
"::",
"replaceFirst",
"(",
"$",
"this",
"->",
"rootNamespace",
"(",
")",
",",
"''",
",",
"$",
"name",
")",
";",
"return",
"$",
"this",
"->",
"laravel",
"[",
"'... | Get the destination class path.
@param string $name
@return string | [
"Get",
"the",
"destination",
"class",
"path",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Console/GeneratorCommand.php#L129-L134 | train | Get path to the root namespace | [
30522,
5123,
3853,
2131,
15069,
1006,
1002,
2171,
1007,
1063,
1002,
2171,
1027,
2358,
2099,
1024,
1024,
5672,
8873,
12096,
1006,
30524,
7117,
18442,
23058,
1006,
1007,
1010,
1005,
1005,
1010,
1002,
2171,
1007,
1025,
2709,
1002,
2023,
1011,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Security/Http/RememberMe/TokenBasedRememberMeServices.php | TokenBasedRememberMeServices.onLoginSuccess | protected function onLoginSuccess(Request $request, Response $response, TokenInterface $token)
{
$user = $token->getUser();
$expires = time() + $this->options['lifetime'];
$value = $this->generateCookieValue(\get_class($user), $user->getUsername(), $expires, $user->getPassword());
$... | php | protected function onLoginSuccess(Request $request, Response $response, TokenInterface $token)
{
$user = $token->getUser();
$expires = time() + $this->options['lifetime'];
$value = $this->generateCookieValue(\get_class($user), $user->getUsername(), $expires, $user->getPassword());
$... | [
"protected",
"function",
"onLoginSuccess",
"(",
"Request",
"$",
"request",
",",
"Response",
"$",
"response",
",",
"TokenInterface",
"$",
"token",
")",
"{",
"$",
"user",
"=",
"$",
"token",
"->",
"getUser",
"(",
")",
";",
"$",
"expires",
"=",
"time",
"(",
... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Security/Http/RememberMe/TokenBasedRememberMeServices.php#L70-L89 | train | On login success | [
30522,
5123,
3853,
2006,
21197,
7076,
14194,
9623,
2015,
1006,
5227,
1002,
5227,
1010,
3433,
1002,
3433,
1010,
19204,
18447,
2121,
12172,
1002,
19204,
1007,
1063,
1002,
5310,
1027,
1002,
19204,
1011,
1028,
2131,
20330,
1006,
1007,
1025,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/DependencyInjection/Dumper/GraphvizDumper.php | GraphvizDumper.findEdges | private function findEdges(string $id, array $arguments, bool $required, string $name, bool $lazy = false): array
{
$edges = [];
foreach ($arguments as $argument) {
if ($argument instanceof Parameter) {
$argument = $this->container->hasParameter($argument) ? $this->contai... | php | private function findEdges(string $id, array $arguments, bool $required, string $name, bool $lazy = false): array
{
$edges = [];
foreach ($arguments as $argument) {
if ($argument instanceof Parameter) {
$argument = $this->container->hasParameter($argument) ? $this->contai... | [
"private",
"function",
"findEdges",
"(",
"string",
"$",
"id",
",",
"array",
"$",
"arguments",
",",
"bool",
"$",
"required",
",",
"string",
"$",
"name",
",",
"bool",
"$",
"lazy",
"=",
"false",
")",
":",
"array",
"{",
"$",
"edges",
"=",
"[",
"]",
";"... | Finds all edges belonging to a specific service id. | [
"Finds",
"all",
"edges",
"belonging",
"to",
"a",
"specific",
"service",
"id",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/DependencyInjection/Dumper/GraphvizDumper.php#L113-L149 | train | Find all nodes that are defined in the container. | [
30522,
2797,
3853,
2424,
24225,
2015,
1006,
5164,
1002,
8909,
1010,
9140,
1002,
9918,
1010,
22017,
2140,
1002,
3223,
1010,
5164,
1002,
2171,
1010,
22017,
2140,
1002,
13971,
1027,
6270,
1007,
1024,
9140,
1063,
1002,
7926,
1027,
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... |
symfony/symfony | src/Symfony/Component/Finder/Finder.php | Finder.ignoreVCSIgnored | public function ignoreVCSIgnored(bool $ignoreVCSIgnored)
{
if ($ignoreVCSIgnored) {
$this->ignore |= static::IGNORE_VCS_IGNORED_FILES;
} else {
$this->ignore &= ~static::IGNORE_VCS_IGNORED_FILES;
}
return $this;
} | php | public function ignoreVCSIgnored(bool $ignoreVCSIgnored)
{
if ($ignoreVCSIgnored) {
$this->ignore |= static::IGNORE_VCS_IGNORED_FILES;
} else {
$this->ignore &= ~static::IGNORE_VCS_IGNORED_FILES;
}
return $this;
} | [
"public",
"function",
"ignoreVCSIgnored",
"(",
"bool",
"$",
"ignoreVCSIgnored",
")",
"{",
"if",
"(",
"$",
"ignoreVCSIgnored",
")",
"{",
"$",
"this",
"->",
"ignore",
"|=",
"static",
"::",
"IGNORE_VCS_IGNORED_FILES",
";",
"}",
"else",
"{",
"$",
"this",
"->",
... | Forces Finder to obey .gitignore and ignore files based on rules listed there.
This option is disabled by default.
@return $this | [
"Forces",
"Finder",
"to",
"obey",
".",
"gitignore",
"and",
"ignore",
"files",
"based",
"on",
"rules",
"listed",
"there",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Finder/Finder.php#L385-L394 | train | ignore VCS and Filelinks | [
30522,
2270,
3853,
8568,
25465,
5332,
26745,
5596,
1006,
22017,
2140,
1002,
8568,
25465,
5332,
26745,
5596,
1007,
1063,
2065,
1006,
1002,
8568,
25465,
5332,
26745,
5596,
1007,
1063,
1002,
2023,
1011,
1028,
8568,
1064,
1027,
10763,
1024,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Database/Migrations/Migrator.php | Migrator.setConnection | public function setConnection($name)
{
if (! is_null($name)) {
$this->resolver->setDefaultConnection($name);
}
$this->repository->setSource($name);
$this->connection = $name;
} | php | public function setConnection($name)
{
if (! is_null($name)) {
$this->resolver->setDefaultConnection($name);
}
$this->repository->setSource($name);
$this->connection = $name;
} | [
"public",
"function",
"setConnection",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"name",
")",
")",
"{",
"$",
"this",
"->",
"resolver",
"->",
"setDefaultConnection",
"(",
"$",
"name",
")",
";",
"}",
"$",
"this",
"->",
"repositor... | Set the default connection name.
@param string $name
@return void | [
"Set",
"the",
"default",
"connection",
"name",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Migrations/Migrator.php#L527-L536 | train | Set the connection name | [
30522,
2270,
3853,
2275,
8663,
2638,
7542,
1006,
1002,
2171,
1007,
1063,
2065,
1006,
999,
2003,
1035,
19701,
1006,
1002,
2171,
1007,
1007,
1063,
1002,
2023,
1011,
1028,
10663,
2099,
1011,
1028,
2275,
3207,
7011,
11314,
8663,
2638,
7542,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
slimphp/Slim | Slim/Http/UploadedFile.php | UploadedFile.createFromEnvironment | public static function createFromEnvironment(Environment $env)
{
if (is_array($env['slim.files']) && $env->has('slim.files')) {
return $env['slim.files'];
} elseif (! empty($_FILES)) {
return static::parseUploadedFiles($_FILES);
}
return [];
} | php | public static function createFromEnvironment(Environment $env)
{
if (is_array($env['slim.files']) && $env->has('slim.files')) {
return $env['slim.files'];
} elseif (! empty($_FILES)) {
return static::parseUploadedFiles($_FILES);
}
return [];
} | [
"public",
"static",
"function",
"createFromEnvironment",
"(",
"Environment",
"$",
"env",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"env",
"[",
"'slim.files'",
"]",
")",
"&&",
"$",
"env",
"->",
"has",
"(",
"'slim.files'",
")",
")",
"{",
"return",
"$",
... | Create a normalized tree of UploadedFile instances from the Environment.
Returns a normalized tree of UploadedFile instances or null if none are provided.
@param Environment $env The environment
@return array|null | [
"Create",
"a",
"normalized",
"tree",
"of",
"UploadedFile",
"instances",
"from",
"the",
"Environment",
"."
] | ccef5f7d8bcd469d59cbe64f6210d83764f91543 | https://github.com/slimphp/Slim/blob/ccef5f7d8bcd469d59cbe64f6210d83764f91543/Slim/Http/UploadedFile.php#L90-L99 | train | Create an array of File objects from the environment | [
30522,
2270,
10763,
3853,
3443,
19699,
8462,
2078,
21663,
2239,
3672,
1006,
4044,
1002,
4372,
2615,
1007,
1063,
2065,
1006,
2003,
1035,
9140,
1006,
1002,
4372,
2615,
1031,
1005,
11754,
1012,
6764,
1005,
1033,
1007,
1004,
1004,
1002,
4372,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/API/RowEvolution.php | RowEvolution.getRowEvolutionMetaData | private function getRowEvolutionMetaData($idSite, $period, $date, $apiModule, $apiAction, $language, $apiParameters)
{
$reportMetadata = API::getInstance()->getMetadata($idSite, $apiModule, $apiAction, $apiParameters, $language,
$period, $date, $hideMetricsDoc = false, $showSubtableReports = tru... | php | private function getRowEvolutionMetaData($idSite, $period, $date, $apiModule, $apiAction, $language, $apiParameters)
{
$reportMetadata = API::getInstance()->getMetadata($idSite, $apiModule, $apiAction, $apiParameters, $language,
$period, $date, $hideMetricsDoc = false, $showSubtableReports = tru... | [
"private",
"function",
"getRowEvolutionMetaData",
"(",
"$",
"idSite",
",",
"$",
"period",
",",
"$",
"date",
",",
"$",
"apiModule",
",",
"$",
"apiAction",
",",
"$",
"language",
",",
"$",
"apiParameters",
")",
"{",
"$",
"reportMetadata",
"=",
"API",
"::",
... | For a given API report, returns a simpler version
of the metadata (will return only the metrics and the dimension name)
@param $idSite
@param $period
@param $date
@param $apiModule
@param $apiAction
@param $language
@param $apiParameters
@throws Exception
@return array | [
"For",
"a",
"given",
"API",
"report",
"returns",
"a",
"simpler",
"version",
"of",
"the",
"metadata",
"(",
"will",
"return",
"only",
"the",
"metrics",
"and",
"the",
"dimension",
"name",
")"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/API/RowEvolution.php#L315-L339 | train | Get row evolution metadata | [
30522,
2797,
3853,
2131,
10524,
6777,
4747,
13700,
11368,
8447,
2696,
1006,
1002,
8909,
28032,
2063,
1010,
1002,
2558,
1010,
30524,
8909,
28032,
2063,
1010,
1002,
17928,
5302,
8566,
2571,
1010,
1002,
17928,
18908,
3258,
1010,
1002,
17928,
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... |
matomo-org/matomo | plugins/Transitions/API.php | API.queryFollowingActions | protected function queryFollowingActions($idaction, $actionType, LogAggregator $logAggregator,
$limitBeforeGrouping = false, $includeLoops = false)
{
$types = array();
if ($actionType != 'title') {
// specific setup for page urls
$ty... | php | protected function queryFollowingActions($idaction, $actionType, LogAggregator $logAggregator,
$limitBeforeGrouping = false, $includeLoops = false)
{
$types = array();
if ($actionType != 'title') {
// specific setup for page urls
$ty... | [
"protected",
"function",
"queryFollowingActions",
"(",
"$",
"idaction",
",",
"$",
"actionType",
",",
"LogAggregator",
"$",
"logAggregator",
",",
"$",
"limitBeforeGrouping",
"=",
"false",
",",
"$",
"includeLoops",
"=",
"false",
")",
"{",
"$",
"types",
"=",
"arr... | Get information about the following actions (following pages, site searches, outlinks, downloads)
@param $idaction
@param $actionType
@param LogAggregator $logAggregator
@param $limitBeforeGrouping
@param $includeLoops
@return array(followingPages:DataTable, outlinks:DataTable, downloads:DataTable) | [
"Get",
"information",
"about",
"the",
"following",
"actions",
"(",
"following",
"pages",
"site",
"searches",
"outlinks",
"downloads",
")"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Transitions/API.php#L217-L290 | train | query following actions | [
30522,
5123,
3853,
23032,
14876,
7174,
9328,
18908,
8496,
1006,
1002,
16096,
7542,
1010,
1002,
2895,
13874,
1010,
8833,
8490,
17603,
20697,
2953,
1002,
8833,
8490,
17603,
20697,
2953,
1010,
1002,
5787,
4783,
29278,
13910,
22107,
2075,
1027,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Form/Extension/DataCollector/FormDataCollector.php | FormDataCollector.collectConfiguration | public function collectConfiguration(FormInterface $form)
{
$hash = spl_object_hash($form);
if (!isset($this->dataByForm[$hash])) {
$this->dataByForm[$hash] = [];
}
$this->dataByForm[$hash] = array_replace(
$this->dataByForm[$hash],
$this->dataEx... | php | public function collectConfiguration(FormInterface $form)
{
$hash = spl_object_hash($form);
if (!isset($this->dataByForm[$hash])) {
$this->dataByForm[$hash] = [];
}
$this->dataByForm[$hash] = array_replace(
$this->dataByForm[$hash],
$this->dataEx... | [
"public",
"function",
"collectConfiguration",
"(",
"FormInterface",
"$",
"form",
")",
"{",
"$",
"hash",
"=",
"spl_object_hash",
"(",
"$",
"form",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"dataByForm",
"[",
"$",
"hash",
"]",
")",
")",
... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/Extension/DataCollector/FormDataCollector.php#L108-L124 | train | Collect all configuration of the form | [
30522,
2270,
3853,
8145,
8663,
8873,
27390,
3370,
1006,
2433,
18447,
2121,
12172,
1002,
2433,
1007,
1063,
1002,
23325,
1027,
11867,
2140,
1035,
4874,
1035,
23325,
1006,
1002,
2433,
1007,
1025,
2065,
1006,
999,
26354,
3388,
1006,
1002,
2023,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Routing/RouteBinding.php | RouteBinding.forModel | public static function forModel($container, $class, $callback = null)
{
return function ($value) use ($container, $class, $callback) {
if (is_null($value)) {
return;
}
// For model binders, we will attempt to retrieve the models using the first
... | php | public static function forModel($container, $class, $callback = null)
{
return function ($value) use ($container, $class, $callback) {
if (is_null($value)) {
return;
}
// For model binders, we will attempt to retrieve the models using the first
... | [
"public",
"static",
"function",
"forModel",
"(",
"$",
"container",
",",
"$",
"class",
",",
"$",
"callback",
"=",
"null",
")",
"{",
"return",
"function",
"(",
"$",
"value",
")",
"use",
"(",
"$",
"container",
",",
"$",
"class",
",",
"$",
"callback",
")... | Create a Route model binding for a model.
@param \Illuminate\Container\Container $container
@param string $class
@param \Closure|null $callback
@return \Closure | [
"Create",
"a",
"Route",
"model",
"binding",
"for",
"a",
"model",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/RouteBinding.php#L56-L81 | train | Returns a closure that will return the model instance for the given class. | [
30522,
2270,
10763,
3853,
2433,
10244,
2140,
1006,
1002,
11661,
1010,
1002,
2465,
1010,
1002,
2655,
5963,
1027,
19701,
1007,
1063,
2709,
3853,
1006,
1002,
3643,
1007,
2224,
1006,
1002,
11661,
1010,
1002,
2465,
1010,
1002,
2655,
5963,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Database/Eloquent/Factory.php | Factory.load | public function load($path)
{
$factory = $this;
if (is_dir($path)) {
foreach (Finder::create()->files()->name('*.php')->in($path) as $file) {
require $file->getRealPath();
}
}
return $factory;
} | php | public function load($path)
{
$factory = $this;
if (is_dir($path)) {
foreach (Finder::create()->files()->name('*.php')->in($path) as $file) {
require $file->getRealPath();
}
}
return $factory;
} | [
"public",
"function",
"load",
"(",
"$",
"path",
")",
"{",
"$",
"factory",
"=",
"$",
"this",
";",
"if",
"(",
"is_dir",
"(",
"$",
"path",
")",
")",
"{",
"foreach",
"(",
"Finder",
"::",
"create",
"(",
")",
"->",
"files",
"(",
")",
"->",
"name",
"(... | Load factories from path.
@param string $path
@return $this | [
"Load",
"factories",
"from",
"path",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Factory.php#L269-L280 | train | Load the class files in the given path | [
30522,
2270,
3853,
7170,
1006,
1002,
4130,
1007,
1063,
1002,
4713,
1027,
1002,
2023,
1025,
2065,
1006,
2003,
1035,
16101,
1006,
1002,
4130,
1007,
30524,
2131,
22852,
15069,
1006,
1007,
1025,
1065,
1065,
2709,
1002,
4713,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/system/controllers/Settings.php | Settings.initWidgets | protected function initWidgets($model)
{
$config = $model->getFieldConfig();
$config->model = $model;
$config->arrayName = class_basename($model);
$config->context = 'update';
$widget = $this->makeWidget('Backend\Widgets\Form', $config);
$widget->bindToController();
... | php | protected function initWidgets($model)
{
$config = $model->getFieldConfig();
$config->model = $model;
$config->arrayName = class_basename($model);
$config->context = 'update';
$widget = $this->makeWidget('Backend\Widgets\Form', $config);
$widget->bindToController();
... | [
"protected",
"function",
"initWidgets",
"(",
"$",
"model",
")",
"{",
"$",
"config",
"=",
"$",
"model",
"->",
"getFieldConfig",
"(",
")",
";",
"$",
"config",
"->",
"model",
"=",
"$",
"model",
";",
"$",
"config",
"->",
"arrayName",
"=",
"class_basename",
... | Prepare the widgets used by this action
Model $model | [
"Prepare",
"the",
"widgets",
"used",
"by",
"this",
"action",
"Model",
"$model"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/controllers/Settings.php#L146-L156 | train | Init Form Widgets | [
30522,
5123,
3853,
1999,
4183,
9148,
28682,
1006,
1002,
2944,
1007,
1063,
1002,
9530,
8873,
2290,
1027,
1002,
2944,
1011,
1028,
2131,
3790,
8663,
8873,
2290,
1006,
1007,
1025,
1002,
9530,
8873,
2290,
1011,
1028,
2944,
1027,
1002,
2944,
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 | libs/HTML/QuickForm2/Rule/Length.php | HTML_QuickForm2_Rule_Length.mergeConfig | public static function mergeConfig($localConfig, $globalConfig)
{
if (!isset($globalConfig)) {
$length = $localConfig;
} elseif (!is_array($globalConfig)) {
$length = $globalConfig;
} else {
$length = self::mergeMinMaxLength(array(), $globalConfig);
... | php | public static function mergeConfig($localConfig, $globalConfig)
{
if (!isset($globalConfig)) {
$length = $localConfig;
} elseif (!is_array($globalConfig)) {
$length = $globalConfig;
} else {
$length = self::mergeMinMaxLength(array(), $globalConfig);
... | [
"public",
"static",
"function",
"mergeConfig",
"(",
"$",
"localConfig",
",",
"$",
"globalConfig",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"globalConfig",
")",
")",
"{",
"$",
"length",
"=",
"$",
"localConfig",
";",
"}",
"elseif",
"(",
"!",
"is_arra... | Merges length limits given on rule creation with those given to registerRule()
"Global" length limits may be passed to
{@link HTML_QuickForm2_Factory::registerRule()} in either of the
following formats
- scalar (exact length)
- array(minlength, maxlength)
- array(['min' => minlength, ]['max' => maxlength])
"Local" le... | [
"Merges",
"length",
"limits",
"given",
"on",
"rule",
"creation",
"with",
"those",
"given",
"to",
"registerRule",
"()"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Rule/Length.php#L171-L188 | train | Merge config array | [
30522,
2270,
10763,
3853,
13590,
8663,
8873,
2290,
1006,
1002,
2334,
8663,
8873,
2290,
1010,
1002,
3795,
8663,
8873,
2290,
1007,
1063,
2065,
1006,
999,
26354,
3388,
1006,
1002,
3795,
8663,
8873,
2290,
1007,
1007,
1063,
1002,
3091,
1027,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Routing/Router.php | Router.group | public function group(array $attributes, $routes)
{
$this->updateGroupStack($attributes);
// Once we have updated the group stack, we'll load the provided routes and
// merge in the group's attributes when the routes are created. After we
// have created the routes, we will pop the ... | php | public function group(array $attributes, $routes)
{
$this->updateGroupStack($attributes);
// Once we have updated the group stack, we'll load the provided routes and
// merge in the group's attributes when the routes are created. After we
// have created the routes, we will pop the ... | [
"public",
"function",
"group",
"(",
"array",
"$",
"attributes",
",",
"$",
"routes",
")",
"{",
"$",
"this",
"->",
"updateGroupStack",
"(",
"$",
"attributes",
")",
";",
"// Once we have updated the group stack, we'll load the provided routes and",
"// merge in the group's a... | Create a route group with shared attributes.
@param array $attributes
@param \Closure|string $routes
@return void | [
"Create",
"a",
"route",
"group",
"with",
"shared",
"attributes",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/Router.php#L366-L376 | train | Group the attributes and routes into the group stack. | [
30522,
2270,
3853,
2177,
1006,
9140,
1002,
12332,
1010,
1002,
5847,
1007,
1063,
1002,
2023,
1011,
1028,
10651,
17058,
9153,
3600,
1006,
1002,
12332,
1007,
1025,
1013,
1013,
2320,
2057,
2031,
7172,
1996,
2177,
9991,
1010,
2057,
1005,
2222,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Lock/Store/PdoStore.php | PdoStore.exists | public function exists(Key $key)
{
$sql = "SELECT 1 FROM $this->table WHERE $this->idCol = :id AND $this->tokenCol = :token AND $this->expirationCol > {$this->getCurrentTimestampStatement()}";
$stmt = $this->getConnection()->prepare($sql);
$stmt->bindValue(':id', $this->getHashedKey($key));... | php | public function exists(Key $key)
{
$sql = "SELECT 1 FROM $this->table WHERE $this->idCol = :id AND $this->tokenCol = :token AND $this->expirationCol > {$this->getCurrentTimestampStatement()}";
$stmt = $this->getConnection()->prepare($sql);
$stmt->bindValue(':id', $this->getHashedKey($key));... | [
"public",
"function",
"exists",
"(",
"Key",
"$",
"key",
")",
"{",
"$",
"sql",
"=",
"\"SELECT 1 FROM $this->table WHERE $this->idCol = :id AND $this->tokenCol = :token AND $this->expirationCol > {$this->getCurrentTimestampStatement()}\"",
";",
"$",
"stmt",
"=",
"$",
"this",
"->"... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Lock/Store/PdoStore.php#L202-L212 | train | Checks if a key exists in the cache | [
30522,
2270,
3853,
6526,
1006,
3145,
1002,
3145,
1007,
1063,
1002,
29296,
1027,
1000,
7276,
1015,
2013,
1002,
2023,
1011,
1028,
2795,
2073,
1002,
2023,
1011,
1028,
8909,
25778,
1027,
1024,
8909,
1998,
1002,
2023,
1011,
1028,
19204,
25778,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/AmqpReceiver.php | AmqpReceiver.reject | public function reject(Envelope $envelope): void
{
$stamp = $this->findAmqpStamp($envelope);
$this->rejectAmqpEnvelope(
$stamp->getAmqpEnvelope(),
$stamp->getQueueName()
);
} | php | public function reject(Envelope $envelope): void
{
$stamp = $this->findAmqpStamp($envelope);
$this->rejectAmqpEnvelope(
$stamp->getAmqpEnvelope(),
$stamp->getQueueName()
);
} | [
"public",
"function",
"reject",
"(",
"Envelope",
"$",
"envelope",
")",
":",
"void",
"{",
"$",
"stamp",
"=",
"$",
"this",
"->",
"findAmqpStamp",
"(",
"$",
"envelope",
")",
";",
"$",
"this",
"->",
"rejectAmqpEnvelope",
"(",
"$",
"stamp",
"->",
"getAmqpEnve... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Messenger/Transport/AmqpExt/AmqpReceiver.php#L98-L106 | train | Reject an AMQP message | [
30522,
2270,
3853,
15454,
1006,
11255,
1002,
11255,
1007,
1024,
11675,
1063,
1002,
11359,
1027,
1002,
2023,
1011,
1028,
2424,
3286,
4160,
4523,
15464,
2361,
1006,
1002,
11255,
1007,
1025,
1002,
2023,
1011,
1028,
15454,
3286,
4160,
11837,
15... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.publishDate | public function publishDate($var = null)
{
if ($var !== null) {
$this->publish_date = Utils::date2timestamp($var, $this->dateformat);
}
return $this->publish_date;
} | php | public function publishDate($var = null)
{
if ($var !== null) {
$this->publish_date = Utils::date2timestamp($var, $this->dateformat);
}
return $this->publish_date;
} | [
"public",
"function",
"publishDate",
"(",
"$",
"var",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"var",
"!==",
"null",
")",
"{",
"$",
"this",
"->",
"publish_date",
"=",
"Utils",
"::",
"date2timestamp",
"(",
"$",
"var",
",",
"$",
"this",
"->",
"dateformat... | Gets and Sets the Page publish date
@param string $var string representation of a date
@return int unix timestamp representation of the date | [
"Gets",
"and",
"Sets",
"the",
"Page",
"publish",
"date"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Page/Page.php#L1585-L1592 | train | Get the publish date | [
30522,
2270,
3853,
10172,
13701,
1006,
1002,
13075,
1027,
19701,
1007,
1063,
2065,
1006,
1002,
13075,
999,
1027,
1027,
19701,
1007,
1063,
1002,
2023,
1011,
1028,
10172,
1035,
3058,
1027,
21183,
12146,
1024,
1024,
3058,
2475,
7292,
9153,
873... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Config/Definition/Builder/NodeDefinition.php | NodeDefinition.setPathSeparator | public function setPathSeparator(string $separator)
{
if ($this instanceof ParentNodeDefinitionInterface) {
if (method_exists($this, 'getChildNodeDefinitions')) {
foreach ($this->getChildNodeDefinitions() as $child) {
$child->setPathSeparator($separator);
... | php | public function setPathSeparator(string $separator)
{
if ($this instanceof ParentNodeDefinitionInterface) {
if (method_exists($this, 'getChildNodeDefinitions')) {
foreach ($this->getChildNodeDefinitions() as $child) {
$child->setPathSeparator($separator);
... | [
"public",
"function",
"setPathSeparator",
"(",
"string",
"$",
"separator",
")",
"{",
"if",
"(",
"$",
"this",
"instanceof",
"ParentNodeDefinitionInterface",
")",
"{",
"if",
"(",
"method_exists",
"(",
"$",
"this",
",",
"'getChildNodeDefinitions'",
")",
")",
"{",
... | Set PathSeparator to use.
@param string $separator
@return $this | [
"Set",
"PathSeparator",
"to",
"use",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Config/Definition/Builder/NodeDefinition.php#L359-L374 | train | Set Path Separator | [
30522,
2270,
3853,
2275,
15069,
3366,
28689,
4263,
1006,
5164,
1002,
19802,
25879,
2953,
1007,
1063,
2065,
1006,
1002,
2023,
6013,
11253,
30524,
1006,
1002,
2023,
1011,
1028,
2131,
19339,
3630,
5732,
12879,
5498,
9285,
1006,
1007,
2004,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/cms/classes/CodeParser.php | CodeParser.source | public function source($page, $layout, $controller)
{
$data = $this->parse();
$className = $data['className'];
if (!class_exists($className)) {
require_once $data['filePath'];
}
if (!class_exists($className) && ($data = $this->handleCorruptCache($data))) {
... | php | public function source($page, $layout, $controller)
{
$data = $this->parse();
$className = $data['className'];
if (!class_exists($className)) {
require_once $data['filePath'];
}
if (!class_exists($className) && ($data = $this->handleCorruptCache($data))) {
... | [
"public",
"function",
"source",
"(",
"$",
"page",
",",
"$",
"layout",
",",
"$",
"controller",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"parse",
"(",
")",
";",
"$",
"className",
"=",
"$",
"data",
"[",
"'className'",
"]",
";",
"if",
"(",
"!",... | Runs the object's PHP file and returns the corresponding object.
@param \Cms\Classes\Page $page Specifies the CMS page.
@param \Cms\Classes\Layout $layout Specifies the CMS layout.
@param \Cms\Classes\Controller $controller Specifies the CMS controller.
@return mixed | [
"Runs",
"the",
"object",
"s",
"PHP",
"file",
"and",
"returns",
"the",
"corresponding",
"object",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/CodeParser.php#L168-L182 | train | Get the source of the page | [
30522,
2270,
3853,
3120,
1006,
1002,
3931,
1010,
1002,
9621,
1010,
1002,
11486,
1007,
1063,
1002,
2951,
1027,
1002,
2023,
1011,
1028,
11968,
3366,
1006,
1007,
1025,
1002,
2465,
18442,
1027,
1002,
2951,
1031,
1005,
2465,
18442,
1005,
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 | core/Development.php | Development.checkMethodExists | public static function checkMethodExists($classOrObject, $method, $prefixMessageIfError)
{
if (!self::isEnabled()) {
return;
}
if (!self::methodExists($classOrObject, $method)) {
self::error($prefixMessageIfError . ' "' . self::formatMethodCall($classOrObject, $metho... | php | public static function checkMethodExists($classOrObject, $method, $prefixMessageIfError)
{
if (!self::isEnabled()) {
return;
}
if (!self::methodExists($classOrObject, $method)) {
self::error($prefixMessageIfError . ' "' . self::formatMethodCall($classOrObject, $metho... | [
"public",
"static",
"function",
"checkMethodExists",
"(",
"$",
"classOrObject",
",",
"$",
"method",
",",
"$",
"prefixMessageIfError",
")",
"{",
"if",
"(",
"!",
"self",
"::",
"isEnabled",
"(",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"self",
"... | Checks whether the given method is actually callable on the given class/object if the development mode is
enabled. En error will be triggered if the method does not exist or is not callable (public) containing a useful
error message for the developer.
@param string|object $classOrObject
@param string $method
@param st... | [
"Checks",
"whether",
"the",
"given",
"method",
"is",
"actually",
"callable",
"on",
"the",
"given",
"class",
"/",
"object",
"if",
"the",
"development",
"mode",
"is",
"enabled",
".",
"En",
"error",
"will",
"be",
"triggered",
"if",
"the",
"method",
"does",
"n... | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Development.php#L111-L120 | train | Check if a method exists in the class | [
30522,
2270,
10763,
3853,
4638,
11368,
6806,
3207,
9048,
12837,
1006,
1002,
2465,
14604,
2497,
20614,
1010,
1002,
4118,
1010,
1002,
17576,
7834,
3736,
3351,
23780,
29165,
1007,
1063,
2065,
1006,
999,
2969,
1024,
1024,
2003,
8189,
23242,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/DataTable.php | DataTable.getColumnsStartingWith | public function getColumnsStartingWith($namePrefix)
{
$columnValues = array();
foreach ($this->getRows() as $row) {
$columns = $row->getColumns();
foreach ($columns as $column => $value) {
if (strpos($column, $namePrefix) === 0) {
$columnVa... | php | public function getColumnsStartingWith($namePrefix)
{
$columnValues = array();
foreach ($this->getRows() as $row) {
$columns = $row->getColumns();
foreach ($columns as $column => $value) {
if (strpos($column, $namePrefix) === 0) {
$columnVa... | [
"public",
"function",
"getColumnsStartingWith",
"(",
"$",
"namePrefix",
")",
"{",
"$",
"columnValues",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"getRows",
"(",
")",
"as",
"$",
"row",
")",
"{",
"$",
"columns",
"=",
"$",
"row",
"... | Returns an array containing all column values of columns whose name starts with `$name`.
@param string $namePrefix The column name prefix.
@return array The array of column values. | [
"Returns",
"an",
"array",
"containing",
"all",
"column",
"values",
"of",
"columns",
"whose",
"name",
"starts",
"with",
"$name",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable.php#L935-L947 | train | Get all columns starting with a given prefix | [
30522,
2270,
3853,
2131,
25778,
2819,
3619,
14117,
3436,
24415,
1006,
1002,
2171,
28139,
8873,
2595,
1007,
1063,
1002,
5930,
10175,
15808,
1027,
9140,
1006,
1007,
1025,
18921,
6776,
1006,
1002,
2023,
1011,
1028,
2131,
10524,
2015,
1006,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Console/Input/Input.php | Input.validate | public function validate()
{
$definition = $this->definition;
$givenArguments = $this->arguments;
$missingArguments = array_filter(array_keys($definition->getArguments()), function ($argument) use ($definition, $givenArguments) {
return !\array_key_exists($argument, $givenArgume... | php | public function validate()
{
$definition = $this->definition;
$givenArguments = $this->arguments;
$missingArguments = array_filter(array_keys($definition->getArguments()), function ($argument) use ($definition, $givenArguments) {
return !\array_key_exists($argument, $givenArgume... | [
"public",
"function",
"validate",
"(",
")",
"{",
"$",
"definition",
"=",
"$",
"this",
"->",
"definition",
";",
"$",
"givenArguments",
"=",
"$",
"this",
"->",
"arguments",
";",
"$",
"missingArguments",
"=",
"array_filter",
"(",
"array_keys",
"(",
"$",
"defi... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Input/Input.php#L66-L78 | train | Validate the arguments and throw an exception if not enough arguments | [
30522,
2270,
3853,
9398,
3686,
1006,
1007,
1063,
1002,
6210,
1027,
1002,
2023,
1011,
1028,
6210,
1025,
1002,
2445,
2906,
22850,
11187,
1027,
1002,
2023,
1011,
1028,
9918,
1025,
1002,
4394,
2906,
22850,
11187,
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... |
matomo-org/matomo | core/DataAccess/ArchiveSelector.php | ArchiveSelector.getNameCondition | private static function getNameCondition(array $plugins, Segment $segment)
{
// the flags used to tell how the archiving process for a specific archive was completed,
// if it was completed
$doneFlags = Rules::getDoneFlags($plugins, $segment);
$allDoneFlags = "'" . implode("','", ... | php | private static function getNameCondition(array $plugins, Segment $segment)
{
// the flags used to tell how the archiving process for a specific archive was completed,
// if it was completed
$doneFlags = Rules::getDoneFlags($plugins, $segment);
$allDoneFlags = "'" . implode("','", ... | [
"private",
"static",
"function",
"getNameCondition",
"(",
"array",
"$",
"plugins",
",",
"Segment",
"$",
"segment",
")",
"{",
"// the flags used to tell how the archiving process for a specific archive was completed,",
"// if it was completed",
"$",
"doneFlags",
"=",
"Rules",
... | Returns the SQL condition used to find successfully completed archives that
this instance is querying for.
@param array $plugins
@param Segment $segment
@return string | [
"Returns",
"the",
"SQL",
"condition",
"used",
"to",
"find",
"successfully",
"completed",
"archives",
"that",
"this",
"instance",
"is",
"querying",
"for",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataAccess/ArchiveSelector.php#L359-L370 | train | Get the SQL condition to find archives that are DONE | [
30522,
2797,
10763,
3853,
2131,
18442,
8663,
20562,
1006,
9140,
1002,
13354,
7076,
1010,
6903,
1002,
6903,
1007,
1063,
1013,
1013,
1996,
9245,
2109,
2000,
2425,
2129,
1996,
7905,
14966,
2832,
2005,
1037,
3563,
8756,
2001,
2949,
1010,
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... |
symfony/symfony | src/Symfony/Component/Form/FormBuilder.php | FormBuilder.resolveChild | private function resolveChild(string $name): FormBuilderInterface
{
list($type, $options) = $this->unresolvedChildren[$name];
unset($this->unresolvedChildren[$name]);
return $this->children[$name] = $this->create($name, $type, $options);
} | php | private function resolveChild(string $name): FormBuilderInterface
{
list($type, $options) = $this->unresolvedChildren[$name];
unset($this->unresolvedChildren[$name]);
return $this->children[$name] = $this->create($name, $type, $options);
} | [
"private",
"function",
"resolveChild",
"(",
"string",
"$",
"name",
")",
":",
"FormBuilderInterface",
"{",
"list",
"(",
"$",
"type",
",",
"$",
"options",
")",
"=",
"$",
"this",
"->",
"unresolvedChildren",
"[",
"$",
"name",
"]",
";",
"unset",
"(",
"$",
"... | Converts an unresolved child into a {@link FormBuilderInterface} instance. | [
"Converts",
"an",
"unresolved",
"child",
"into",
"a",
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/FormBuilder.php#L229-L236 | train | Resolves a child and returns the child form builder | [
30522,
2797,
3853,
10663,
19339,
1006,
5164,
1002,
2171,
1007,
1024,
2433,
8569,
23891,
6657,
3334,
12172,
1063,
2862,
1006,
1002,
2828,
1010,
1002,
7047,
1007,
1027,
1002,
2023,
1011,
1028,
4895,
6072,
16116,
19339,
7389,
1031,
1002,
2171,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.typeEmail | public static function typeEmail($value, array $params, array $field)
{
$values = !\is_array($value) ? explode(',', preg_replace('/\s+/', '', $value)) : $value;
foreach ($values as $val) {
if (!(self::typeText($val, $params, $field) && filter_var($val, FILTER_VALIDATE_EMAIL))) {
... | php | public static function typeEmail($value, array $params, array $field)
{
$values = !\is_array($value) ? explode(',', preg_replace('/\s+/', '', $value)) : $value;
foreach ($values as $val) {
if (!(self::typeText($val, $params, $field) && filter_var($val, FILTER_VALIDATE_EMAIL))) {
... | [
"public",
"static",
"function",
"typeEmail",
"(",
"$",
"value",
",",
"array",
"$",
"params",
",",
"array",
"$",
"field",
")",
"{",
"$",
"values",
"=",
"!",
"\\",
"is_array",
"(",
"$",
"value",
")",
"?",
"explode",
"(",
"','",
",",
"preg_replace",
"("... | HTML5 input: email
@param mixed $value Value to be validated.
@param array $params Validation parameters.
@param array $field Blueprint for the field.
@return bool True if validation succeeded. | [
"HTML5",
"input",
":",
"email"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Data/Validation.php#L412-L423 | train | Type e - mail address | [
30522,
2270,
10763,
3853,
2828,
14545,
4014,
1006,
1002,
3643,
1010,
9140,
1002,
11498,
5244,
1010,
9140,
1002,
2492,
1007,
1063,
1002,
5300,
1027,
999,
1032,
2003,
1035,
9140,
1006,
1002,
3643,
1007,
1029,
15044,
1006,
1005,
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... |
z-song/laravel-admin | src/Grid/Column.php | Column.setGrid | public function setGrid(Grid $grid)
{
$this->grid = $grid;
$this->setModel($grid->model()->eloquent());
} | php | public function setGrid(Grid $grid)
{
$this->grid = $grid;
$this->setModel($grid->model()->eloquent());
} | [
"public",
"function",
"setGrid",
"(",
"Grid",
"$",
"grid",
")",
"{",
"$",
"this",
"->",
"grid",
"=",
"$",
"grid",
";",
"$",
"this",
"->",
"setModel",
"(",
"$",
"grid",
"->",
"model",
"(",
")",
"->",
"eloquent",
"(",
")",
")",
";",
"}"
] | Set grid instance for column.
@param Grid $grid | [
"Set",
"grid",
"instance",
"for",
"column",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Grid/Column.php#L160-L165 | train | Set the grid | [
30522,
2270,
3853,
2275,
16523,
3593,
1006,
8370,
1002,
8370,
1007,
1063,
1002,
2023,
1011,
1028,
8370,
1027,
1002,
8370,
1025,
1002,
2023,
1011,
1028,
2275,
5302,
9247,
1006,
1002,
8370,
1011,
1028,
2944,
1006,
1007,
1011,
1028,
3449,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Security/Http/Firewall/ContextListener.php | ContextListener.onKernelResponse | public function onKernelResponse(FilterResponseEvent $event)
{
if (!$event->isMasterRequest()) {
return;
}
$request = $event->getRequest();
if (!$request->hasSession()) {
return;
}
$this->dispatcher->removeListener(KernelEvents::RESPONSE, [$... | php | public function onKernelResponse(FilterResponseEvent $event)
{
if (!$event->isMasterRequest()) {
return;
}
$request = $event->getRequest();
if (!$request->hasSession()) {
return;
}
$this->dispatcher->removeListener(KernelEvents::RESPONSE, [$... | [
"public",
"function",
"onKernelResponse",
"(",
"FilterResponseEvent",
"$",
"event",
")",
"{",
"if",
"(",
"!",
"$",
"event",
"->",
"isMasterRequest",
"(",
")",
")",
"{",
"return",
";",
"}",
"$",
"request",
"=",
"$",
"event",
"->",
"getRequest",
"(",
")",
... | Writes the security token into the session. | [
"Writes",
"the",
"security",
"token",
"into",
"the",
"session",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Security/Http/Firewall/ContextListener.php#L126-L153 | train | Stores the security token in the session | [
30522,
2270,
3853,
2006,
5484,
11877,
6072,
26029,
3366,
1006,
11307,
6072,
26029,
19763,
15338,
1002,
2724,
1007,
1063,
2065,
1006,
999,
1002,
2724,
1011,
1028,
2003,
8706,
2890,
15500,
1006,
1007,
1007,
1063,
2709,
1025,
1065,
1002,
5227,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Field/HasMany.php | HasMany.getValidator | public function getValidator(array $input)
{
if (!array_key_exists($this->column, $input)) {
return false;
}
$input = Arr::only($input, $this->column);
$form = $this->buildNestedForm($this->column, $this->builder);
$rules = $attributes = [];
/* @var Fi... | php | public function getValidator(array $input)
{
if (!array_key_exists($this->column, $input)) {
return false;
}
$input = Arr::only($input, $this->column);
$form = $this->buildNestedForm($this->column, $this->builder);
$rules = $attributes = [];
/* @var Fi... | [
"public",
"function",
"getValidator",
"(",
"array",
"$",
"input",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"this",
"->",
"column",
",",
"$",
"input",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"input",
"=",
"Arr",
"::",
"only",
... | Get validator for this field.
@param array $input
@return bool|Validator | [
"Get",
"validator",
"for",
"this",
"field",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Form/Field/HasMany.php#L100-L162 | train | Returns the validator for the given input array. | [
30522,
2270,
3853,
2131,
10175,
8524,
4263,
1006,
9140,
1002,
7953,
1007,
1063,
2065,
1006,
999,
9140,
1035,
3145,
1035,
6526,
1006,
1002,
2023,
1011,
1028,
5930,
1010,
1002,
7953,
1007,
1007,
1063,
2709,
6270,
1025,
1065,
1002,
7953,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/system/console/OctoberUpdate.php | OctoberUpdate.handle | public function handle()
{
$this->output->writeln('<info>Updating October...</info>');
$manager = UpdateManager::instance()->setNotesOutput($this->output);
$forceUpdate = $this->option('force');
/*
* Check for disabilities
*/
$disableCore = $disablePlugins ... | php | public function handle()
{
$this->output->writeln('<info>Updating October...</info>');
$manager = UpdateManager::instance()->setNotesOutput($this->output);
$forceUpdate = $this->option('force');
/*
* Check for disabilities
*/
$disableCore = $disablePlugins ... | [
"public",
"function",
"handle",
"(",
")",
"{",
"$",
"this",
"->",
"output",
"->",
"writeln",
"(",
"'<info>Updating October...</info>'",
")",
";",
"$",
"manager",
"=",
"UpdateManager",
"::",
"instance",
"(",
")",
"->",
"setNotesOutput",
"(",
"$",
"this",
"->"... | Execute the console command. | [
"Execute",
"the",
"console",
"command",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/console/OctoberUpdate.php#L34-L103 | train | Handle the update | [
30522,
2270,
3853,
5047,
1006,
1007,
1063,
1002,
2023,
1011,
1028,
6434,
1011,
1028,
4339,
19666,
1006,
1005,
1026,
18558,
1028,
2039,
16616,
2255,
1012,
1012,
1012,
1026,
1013,
18558,
1028,
1005,
1007,
1025,
1002,
3208,
1027,
10651,
24805,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Mapping/Factory/LazyLoadingMetadataFactory.php | LazyLoadingMetadataFactory.hasMetadataFor | public function hasMetadataFor($value)
{
if (!\is_object($value) && !\is_string($value)) {
return false;
}
$class = ltrim(\is_object($value) ? \get_class($value) : $value, '\\');
return class_exists($class) || interface_exists($class, false);
} | php | public function hasMetadataFor($value)
{
if (!\is_object($value) && !\is_string($value)) {
return false;
}
$class = ltrim(\is_object($value) ? \get_class($value) : $value, '\\');
return class_exists($class) || interface_exists($class, false);
} | [
"public",
"function",
"hasMetadataFor",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"\\",
"is_object",
"(",
"$",
"value",
")",
"&&",
"!",
"\\",
"is_string",
"(",
"$",
"value",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"class",
"=",
"ltrim",... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Validator/Mapping/Factory/LazyLoadingMetadataFactory.php#L155-L164 | train | Has Metadata For | [
30522,
2270,
3853,
2038,
11368,
8447,
2696,
29278,
1006,
1002,
3643,
1007,
1063,
2065,
1006,
999,
1032,
2003,
1035,
4874,
1006,
1002,
3643,
1007,
1004,
1004,
999,
1032,
2003,
1035,
5164,
1006,
1002,
3643,
1007,
1007,
1063,
2709,
6270,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Bridge/Doctrine/Form/ChoiceList/IdReader.php | IdReader.getIdValue | public function getIdValue($object)
{
if (!$object) {
return;
}
if (!$this->om->contains($object)) {
throw new RuntimeException(sprintf('Entity of type "%s" passed to the choice field must be managed. Maybe you forget to persist it in the entity manager?', \get_class... | php | public function getIdValue($object)
{
if (!$object) {
return;
}
if (!$this->om->contains($object)) {
throw new RuntimeException(sprintf('Entity of type "%s" passed to the choice field must be managed. Maybe you forget to persist it in the entity manager?', \get_class... | [
"public",
"function",
"getIdValue",
"(",
"$",
"object",
")",
"{",
"if",
"(",
"!",
"$",
"object",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"$",
"this",
"->",
"om",
"->",
"contains",
"(",
"$",
"object",
")",
")",
"{",
"throw",
"new",
"RuntimeE... | Returns the ID value for an object.
This method assumes that the object has a single-column ID.
@param object $object The object
@return mixed The ID value | [
"Returns",
"the",
"ID",
"value",
"for",
"an",
"object",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bridge/Doctrine/Form/ChoiceList/IdReader.php#L91-L110 | train | Returns the id value of the object | [
30522,
2270,
3853,
2131,
3593,
10175,
5657,
1006,
1002,
4874,
1007,
1063,
2065,
1006,
999,
1002,
4874,
1007,
1063,
2709,
1025,
1065,
2065,
1006,
999,
1002,
2023,
1011,
1028,
18168,
1011,
1028,
3397,
1006,
1002,
4874,
1007,
1007,
1063,
546... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Session.php | Zend_Session._processStartupMetadataGlobal | private static function _processStartupMetadataGlobal()
{
// process global metadata
if (isset($_SESSION['__ZF'])) {
// expire globally expired values
foreach ($_SESSION['__ZF'] as $namespace => $namespace_metadata) {
// Expire Namespace by Time (ENT)
... | php | private static function _processStartupMetadataGlobal()
{
// process global metadata
if (isset($_SESSION['__ZF'])) {
// expire globally expired values
foreach ($_SESSION['__ZF'] as $namespace => $namespace_metadata) {
// Expire Namespace by Time (ENT)
... | [
"private",
"static",
"function",
"_processStartupMetadataGlobal",
"(",
")",
"{",
"// process global metadata",
"if",
"(",
"isset",
"(",
"$",
"_SESSION",
"[",
"'__ZF'",
"]",
")",
")",
"{",
"// expire globally expired values",
"foreach",
"(",
"$",
"_SESSION",
"[",
"... | _processGlobalMetadata() - this method initizes the sessions GLOBAL
metadata, mostly global data expiration calculations.
@return void | [
"_processGlobalMetadata",
"()",
"-",
"this",
"method",
"initizes",
"the",
"sessions",
"GLOBAL",
"metadata",
"mostly",
"global",
"data",
"expiration",
"calculations",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Session.php#L513-L581 | train | Process global metadata | [
30522,
2797,
10763,
3853,
1035,
2832,
14117,
8525,
9737,
12928,
2850,
15900,
4135,
10264,
1006,
1007,
1063,
1013,
1013,
2832,
3795,
27425,
2065,
1006,
26354,
3388,
1006,
1002,
1035,
5219,
1031,
1005,
1035,
1035,
1062,
2546,
1005,
1033,
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/Cache/Traits/PhpFilesTrait.php | PhpFilesTrait.doDelete | protected function doDelete(array $ids)
{
foreach ($ids as $id) {
unset($this->values[$id]);
}
return $this->doCommonDelete($ids);
} | php | protected function doDelete(array $ids)
{
foreach ($ids as $id) {
unset($this->values[$id]);
}
return $this->doCommonDelete($ids);
} | [
"protected",
"function",
"doDelete",
"(",
"array",
"$",
"ids",
")",
"{",
"foreach",
"(",
"$",
"ids",
"as",
"$",
"id",
")",
"{",
"unset",
"(",
"$",
"this",
"->",
"values",
"[",
"$",
"id",
"]",
")",
";",
"}",
"return",
"$",
"this",
"->",
"doCommonD... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Cache/Traits/PhpFilesTrait.php#L226-L233 | train | Delete all entries from the cache | [
30522,
5123,
3853,
26489,
12260,
2618,
1006,
9140,
1002,
8909,
2015,
1007,
1063,
18921,
6776,
1006,
1002,
8909,
2015,
2004,
1002,
8909,
1007,
1063,
4895,
13462,
1006,
1002,
2023,
1011,
1028,
5300,
1031,
1002,
8909,
1033,
1007,
1025,
1065,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/Zend/Db/Adapter/Pdo/Ibm.php | Zend_Db_Adapter_Pdo_Ibm.getServerVersion | public function getServerVersion()
{
try {
$stmt = $this->query('SELECT service_level, fixpack_num FROM TABLE (sysproc.env_get_inst_info()) as INSTANCEINFO');
$result = $stmt->fetchAll(Zend_Db::FETCH_NUM);
if (count($result)) {
$matches = null;
... | php | public function getServerVersion()
{
try {
$stmt = $this->query('SELECT service_level, fixpack_num FROM TABLE (sysproc.env_get_inst_info()) as INSTANCEINFO');
$result = $stmt->fetchAll(Zend_Db::FETCH_NUM);
if (count($result)) {
$matches = null;
... | [
"public",
"function",
"getServerVersion",
"(",
")",
"{",
"try",
"{",
"$",
"stmt",
"=",
"$",
"this",
"->",
"query",
"(",
"'SELECT service_level, fixpack_num FROM TABLE (sysproc.env_get_inst_info()) as INSTANCEINFO'",
")",
";",
"$",
"result",
"=",
"$",
"stmt",
"->",
"... | Retrieve server version in PHP style
Pdo_Idm doesn't support getAttribute(PDO::ATTR_SERVER_VERSION)
@return string | [
"Retrieve",
"server",
"version",
"in",
"PHP",
"style",
"Pdo_Idm",
"doesn",
"t",
"support",
"getAttribute",
"(",
"PDO",
"::",
"ATTR_SERVER_VERSION",
")"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Adapter/Pdo/Ibm.php#L342-L359 | train | Get server version | [
30522,
2270,
3853,
4152,
2121,
6299,
27774,
1006,
1007,
1063,
3046,
1063,
1002,
2358,
20492,
1027,
1002,
2023,
1011,
1028,
23032,
1006,
1005,
7276,
2326,
1035,
2504,
1010,
8081,
23947,
1035,
16371,
2213,
2013,
2795,
1006,
25353,
13102,
3217... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Process/Process.php | Process.setIdleTimeout | public function setIdleTimeout($timeout)
{
if (null !== $timeout && $this->outputDisabled) {
throw new LogicException('Idle timeout can not be set while the output is disabled.');
}
$this->idleTimeout = $this->validateTimeout($timeout);
return $this;
} | php | public function setIdleTimeout($timeout)
{
if (null !== $timeout && $this->outputDisabled) {
throw new LogicException('Idle timeout can not be set while the output is disabled.');
}
$this->idleTimeout = $this->validateTimeout($timeout);
return $this;
} | [
"public",
"function",
"setIdleTimeout",
"(",
"$",
"timeout",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"timeout",
"&&",
"$",
"this",
"->",
"outputDisabled",
")",
"{",
"throw",
"new",
"LogicException",
"(",
"'Idle timeout can not be set while the output is disabled.'"... | Sets the process idle timeout (max. time since last output).
To disable the timeout, set this value to null.
@param int|float|null $timeout The timeout in seconds
@return self The current Process instance
@throws LogicException if the output is disabled
@throws InvalidArgumentException if the timeout is n... | [
"Sets",
"the",
"process",
"idle",
"timeout",
"(",
"max",
".",
"time",
"since",
"last",
"output",
")",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Process/Process.php#L1035-L1044 | train | Set the idle timeout | [
30522,
2270,
3853,
2275,
3593,
7485,
14428,
5833,
1006,
1002,
2051,
5833,
1007,
1063,
2065,
1006,
19701,
999,
1027,
1027,
1002,
2051,
5833,
1004,
1004,
1002,
2023,
1011,
1028,
6434,
10521,
3085,
2094,
1007,
1063,
5466,
2047,
7961,
10288,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Http/Resources/Json/JsonResource.php | JsonResource.collection | public static function collection($resource)
{
return tap(new AnonymousResourceCollection($resource, static::class), function ($collection) {
if (property_exists(static::class, 'preserveKeys')) {
$collection->preserveKeys = (new static([]))->preserveKeys === true;
}
... | php | public static function collection($resource)
{
return tap(new AnonymousResourceCollection($resource, static::class), function ($collection) {
if (property_exists(static::class, 'preserveKeys')) {
$collection->preserveKeys = (new static([]))->preserveKeys === true;
}
... | [
"public",
"static",
"function",
"collection",
"(",
"$",
"resource",
")",
"{",
"return",
"tap",
"(",
"new",
"AnonymousResourceCollection",
"(",
"$",
"resource",
",",
"static",
"::",
"class",
")",
",",
"function",
"(",
"$",
"collection",
")",
"{",
"if",
"(",... | Create new anonymous resource collection.
@param mixed $resource
@return \Illuminate\Http\Resources\Json\AnonymousResourceCollection | [
"Create",
"new",
"anonymous",
"resource",
"collection",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Http/Resources/Json/JsonResource.php#L76-L83 | train | Create a collection of resource objects. | [
30522,
2270,
10763,
30524,
11112,
1006,
2047,
10812,
6072,
8162,
3401,
26895,
18491,
1006,
1002,
7692,
1010,
10763,
1024,
1024,
2465,
1007,
1010,
3853,
1006,
1002,
3074,
1007,
1063,
2065,
1006,
3200,
1035,
6526,
1006,
10763,
1024,
1024,
246... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Common/User/Group.php | Group.load | public static function load($groupname)
{
$groups = self::groups();
$content = $groups[$groupname] ?? [];
$content += ['groupname' => $groupname];
$blueprints = new Blueprints();
$blueprint = $blueprints->get('user/group');
return new Group($content, $blueprint);
... | php | public static function load($groupname)
{
$groups = self::groups();
$content = $groups[$groupname] ?? [];
$content += ['groupname' => $groupname];
$blueprints = new Blueprints();
$blueprint = $blueprints->get('user/group');
return new Group($content, $blueprint);
... | [
"public",
"static",
"function",
"load",
"(",
"$",
"groupname",
")",
"{",
"$",
"groups",
"=",
"self",
"::",
"groups",
"(",
")",
";",
"$",
"content",
"=",
"$",
"groups",
"[",
"$",
"groupname",
"]",
"??",
"[",
"]",
";",
"$",
"content",
"+=",
"[",
"'... | Get a group by name
@param string $groupname
@return object | [
"Get",
"a",
"group",
"by",
"name"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/User/Group.php#L66-L77 | train | Load Group by name | [
30522,
2270,
10763,
3853,
7170,
1006,
1002,
2177,
18442,
1007,
1063,
1002,
2967,
1027,
2969,
1024,
1024,
2967,
1006,
1007,
1025,
1002,
4180,
1027,
1002,
2967,
1031,
1002,
2177,
18442,
1033,
1029,
1029,
1031,
1033,
1025,
1002,
4180,
1009,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/system/classes/CombineAssets.php | CombineAssets.init | public function init()
{
/*
* Register preferences
*/
$this->useCache = Config::get('cms.enableAssetCache', false);
$this->useMinify = Config::get('cms.enableAssetMinify', null);
$this->useDeepHashing = Config::get('cms.enableAssetDeepHashing', null);
if ($... | php | public function init()
{
/*
* Register preferences
*/
$this->useCache = Config::get('cms.enableAssetCache', false);
$this->useMinify = Config::get('cms.enableAssetMinify', null);
$this->useDeepHashing = Config::get('cms.enableAssetDeepHashing', null);
if ($... | [
"public",
"function",
"init",
"(",
")",
"{",
"/*\n * Register preferences\n */",
"$",
"this",
"->",
"useCache",
"=",
"Config",
"::",
"get",
"(",
"'cms.enableAssetCache'",
",",
"false",
")",
";",
"$",
"this",
"->",
"useMinify",
"=",
"Config",
"::"... | Constructor | [
"Constructor"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/CombineAssets.php#L109-L163 | train | Initializes the module | [
30522,
2270,
3853,
1999,
4183,
1006,
1007,
1063,
1013,
1008,
1008,
4236,
18394,
1008,
1013,
1002,
2023,
1011,
1028,
2224,
3540,
5403,
1027,
9530,
8873,
2290,
1024,
1024,
2131,
1006,
1005,
4642,
2015,
1012,
9585,
27241,
13535,
15395,
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... |
octobercms/october | modules/backend/traits/CollapsableWidget.php | CollapsableWidget.getCollapseStatuses | protected function getCollapseStatuses()
{
if ($this->collapseGroupStatusCache !== false) {
return $this->collapseGroupStatusCache;
}
$groups = $this->getSession($this->collapseSessionKey, []);
if (!is_array($groups)) {
return $this->collapseGroupStatusCache... | php | protected function getCollapseStatuses()
{
if ($this->collapseGroupStatusCache !== false) {
return $this->collapseGroupStatusCache;
}
$groups = $this->getSession($this->collapseSessionKey, []);
if (!is_array($groups)) {
return $this->collapseGroupStatusCache... | [
"protected",
"function",
"getCollapseStatuses",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"collapseGroupStatusCache",
"!==",
"false",
")",
"{",
"return",
"$",
"this",
"->",
"collapseGroupStatusCache",
";",
"}",
"$",
"groups",
"=",
"$",
"this",
"->",
"getS... | Returns the array of all collapsed states belonging to this widget.
@return array | [
"Returns",
"the",
"array",
"of",
"all",
"collapsed",
"states",
"belonging",
"to",
"this",
"widget",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/traits/CollapsableWidget.php#L40-L53 | train | Get the collapse statuses | [
30522,
5123,
3853,
2131,
26895,
9331,
8583,
29336,
25581,
1006,
1007,
30524,
2023,
1011,
1028,
4152,
7971,
3258,
1006,
1002,
2023,
1011,
1028,
25938,
7971,
3258,
14839,
1010,
1031,
1033,
1007,
1025,
2065,
1006,
999,
2003,
1035,
9140,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/Annotations/API.php | API.save | public function save($idSite, $idNote, $date = null, $note = null, $starred = null)
{
$this->checkSingleIdSite($idSite, $extraMessage = "Note: Cannot modify more than one note at a time.");
$this->checkDateIsValid($date, $canBeNull = true);
// get the annotations for the site
$annot... | php | public function save($idSite, $idNote, $date = null, $note = null, $starred = null)
{
$this->checkSingleIdSite($idSite, $extraMessage = "Note: Cannot modify more than one note at a time.");
$this->checkDateIsValid($date, $canBeNull = true);
// get the annotations for the site
$annot... | [
"public",
"function",
"save",
"(",
"$",
"idSite",
",",
"$",
"idNote",
",",
"$",
"date",
"=",
"null",
",",
"$",
"note",
"=",
"null",
",",
"$",
"starred",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"checkSingleIdSite",
"(",
"$",
"idSite",
",",
"$",
... | Modifies an annotation for a site and returns the modified annotation
and its ID.
If the current user is not allowed to modify an annotation, an exception
will be thrown. A user can modify a note if:
- the user has admin access for the site, OR
- the user has view access, is not the anonymous user and is the user that... | [
"Modifies",
"an",
"annotation",
"for",
"a",
"site",
"and",
"returns",
"the",
"modified",
"annotation",
"and",
"its",
"ID",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Annotations/API.php#L79-L95 | train | Save an annotation | [
30522,
2270,
3853,
3828,
1006,
1002,
8909,
28032,
2063,
1010,
1002,
8909,
22074,
1010,
1002,
3058,
1027,
19701,
1010,
1002,
3602,
1027,
19701,
1010,
1002,
5652,
1027,
19701,
1007,
1063,
1002,
2023,
1011,
1028,
14148,
2075,
23057,
5104,
4221... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Stopwatch/StopwatchEvent.php | StopwatchEvent.stop | public function stop()
{
if (!\count($this->started)) {
throw new \LogicException('stop() called but start() has not been called before.');
}
$this->periods[] = new StopwatchPeriod(array_pop($this->started), $this->getNow(), $this->morePrecision);
return $this;
} | php | public function stop()
{
if (!\count($this->started)) {
throw new \LogicException('stop() called but start() has not been called before.');
}
$this->periods[] = new StopwatchPeriod(array_pop($this->started), $this->getNow(), $this->morePrecision);
return $this;
} | [
"public",
"function",
"stop",
"(",
")",
"{",
"if",
"(",
"!",
"\\",
"count",
"(",
"$",
"this",
"->",
"started",
")",
")",
"{",
"throw",
"new",
"\\",
"LogicException",
"(",
"'stop() called but start() has not been called before.'",
")",
";",
"}",
"$",
"this",
... | Stops the last started event period.
@return $this
@throws \LogicException When stop() is called without a matching call to start() | [
"Stops",
"the",
"last",
"started",
"event",
"period",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Stopwatch/StopwatchEvent.php#L99-L108 | train | Stop the timer | [
30522,
2270,
3853,
2644,
1006,
1007,
1063,
2065,
1006,
999,
1032,
4175,
1006,
1002,
2023,
1011,
1028,
2318,
1007,
1007,
1063,
5466,
2047,
1032,
7961,
10288,
24422,
1006,
1005,
2644,
1006,
1007,
2170,
2021,
2707,
1006,
1007,
2038,
2025,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Dotenv/Dotenv.php | Dotenv.populate | public function populate(array $values, bool $overrideExistingVars = false): void
{
$updateLoadedVars = false;
$loadedVars = array_flip(explode(',', $_SERVER['SYMFONY_DOTENV_VARS'] ?? $_ENV['SYMFONY_DOTENV_VARS'] ?? ''));
foreach ($values as $name => $value) {
$notHttpName = 0 !... | php | public function populate(array $values, bool $overrideExistingVars = false): void
{
$updateLoadedVars = false;
$loadedVars = array_flip(explode(',', $_SERVER['SYMFONY_DOTENV_VARS'] ?? $_ENV['SYMFONY_DOTENV_VARS'] ?? ''));
foreach ($values as $name => $value) {
$notHttpName = 0 !... | [
"public",
"function",
"populate",
"(",
"array",
"$",
"values",
",",
"bool",
"$",
"overrideExistingVars",
"=",
"false",
")",
":",
"void",
"{",
"$",
"updateLoadedVars",
"=",
"false",
";",
"$",
"loadedVars",
"=",
"array_flip",
"(",
"explode",
"(",
"','",
",",... | Sets values as environment variables (via putenv, $_ENV, and $_SERVER).
@param array $values An array of env variables
@param bool $overrideExistingVars true when existing environment variables must be overridden | [
"Sets",
"values",
"as",
"environment",
"variables",
"(",
"via",
"putenv",
"$_ENV",
"and",
"$_SERVER",
")",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Dotenv/Dotenv.php#L132-L167 | train | Populates environment variables with values from array | [
30522,
2270,
3853,
3769,
9869,
1006,
9140,
1002,
5300,
1010,
22017,
2140,
1002,
2058,
15637,
10288,
2923,
2075,
10755,
2015,
1027,
6270,
1007,
1024,
11675,
1063,
1002,
10651,
17468,
10755,
2015,
1027,
6270,
1025,
1002,
8209,
10755,
2015,
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/Form/FormConfigBuilder.php | FormConfigBuilder.setRequired | public function setRequired($required)
{
if ($this->locked) {
throw new BadMethodCallException('FormConfigBuilder methods cannot be accessed anymore once the builder is turned into a FormConfigInterface instance.');
}
$this->required = (bool) $required;
return $this;
... | php | public function setRequired($required)
{
if ($this->locked) {
throw new BadMethodCallException('FormConfigBuilder methods cannot be accessed anymore once the builder is turned into a FormConfigInterface instance.');
}
$this->required = (bool) $required;
return $this;
... | [
"public",
"function",
"setRequired",
"(",
"$",
"required",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"locked",
")",
"{",
"throw",
"new",
"BadMethodCallException",
"(",
"'FormConfigBuilder methods cannot be accessed anymore once the builder is turned into a FormConfigInterface i... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/FormConfigBuilder.php#L554-L563 | train | Set whether the form is required | [
30522,
2270,
3853,
2275,
2890,
15549,
5596,
1006,
1002,
3223,
1007,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
5299,
1007,
1063,
5466,
2047,
2919,
11368,
6806,
16409,
24164,
2595,
24422,
1006,
1005,
2433,
8663,
8873,
18259,
19231,
4063,
4725... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Redis/Connections/PhpRedisConnection.php | PhpRedisConnection.zrangebyscore | public function zrangebyscore($key, $min, $max, $options = [])
{
if (isset($options['limit'])) {
$options['limit'] = [
$options['limit']['offset'],
$options['limit']['count'],
];
}
return $this->command('zRangeByScore', [$key, $min, $m... | php | public function zrangebyscore($key, $min, $max, $options = [])
{
if (isset($options['limit'])) {
$options['limit'] = [
$options['limit']['offset'],
$options['limit']['count'],
];
}
return $this->command('zRangeByScore', [$key, $min, $m... | [
"public",
"function",
"zrangebyscore",
"(",
"$",
"key",
",",
"$",
"min",
",",
"$",
"max",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"options",
"[",
"'limit'",
"]",
")",
")",
"{",
"$",
"options",
"[",
"'limit'",
... | Return elements with score between $min and $max.
@param string $key
@param mixed $min
@param mixed $max
@param array $options
@return int | [
"Return",
"elements",
"with",
"score",
"between",
"$min",
"and",
"$max",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Redis/Connections/PhpRedisConnection.php#L227-L237 | train | Returns array of key score pairs in order of score | [
30522,
2270,
3853,
1062,
24388,
15878,
7274,
17345,
1006,
1002,
3145,
1010,
1002,
8117,
1010,
1002,
4098,
1010,
1002,
7047,
30524,
1005,
1033,
1031,
1005,
4175,
1005,
1033,
1010,
1033,
1025,
1065,
2709,
1002,
2023,
1011,
1028,
3094,
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... |
z-song/laravel-admin | src/Grid/Tools.php | Tools.disableRefreshButton | public function disableRefreshButton(bool $disable = true)
{
$this->tools = $this->tools->map(function (AbstractTool $tool) use ($disable) {
if ($tool instanceof RefreshButton) {
return $tool->disable($disable);
}
return $tool;
});
} | php | public function disableRefreshButton(bool $disable = true)
{
$this->tools = $this->tools->map(function (AbstractTool $tool) use ($disable) {
if ($tool instanceof RefreshButton) {
return $tool->disable($disable);
}
return $tool;
});
} | [
"public",
"function",
"disableRefreshButton",
"(",
"bool",
"$",
"disable",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"tools",
"=",
"$",
"this",
"->",
"tools",
"->",
"map",
"(",
"function",
"(",
"AbstractTool",
"$",
"tool",
")",
"use",
"(",
"$",
"disabl... | Disable refresh button.
@return void | [
"Disable",
"refresh",
"button",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Grid/Tools.php#L102-L111 | train | Disable refresh button | [
30522,
2270,
3853,
4487,
19150,
2890,
19699,
9953,
8569,
15474,
1006,
22017,
2140,
1002,
4487,
19150,
1027,
2995,
1007,
1063,
1002,
2023,
1011,
1028,
5906,
1027,
1002,
2023,
1011,
1028,
5906,
1011,
1028,
4949,
1006,
3853,
1006,
10061,
3406,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/VarDumper/Caster/Caster.php | Caster.filter | public static function filter(array $a, $filter, array $listedProperties = [], &$count = 0)
{
$count = 0;
foreach ($a as $k => $v) {
$type = self::EXCLUDE_STRICT & $filter;
if (null === $v) {
$type |= self::EXCLUDE_NULL & $filter;
$type |= se... | php | public static function filter(array $a, $filter, array $listedProperties = [], &$count = 0)
{
$count = 0;
foreach ($a as $k => $v) {
$type = self::EXCLUDE_STRICT & $filter;
if (null === $v) {
$type |= self::EXCLUDE_NULL & $filter;
$type |= se... | [
"public",
"static",
"function",
"filter",
"(",
"array",
"$",
"a",
",",
"$",
"filter",
",",
"array",
"$",
"listedProperties",
"=",
"[",
"]",
",",
"&",
"$",
"count",
"=",
"0",
")",
"{",
"$",
"count",
"=",
"0",
";",
"foreach",
"(",
"$",
"a",
"as",
... | Filters out the specified properties.
By default, a single match in the $filter bit field filters properties out, following an "or" logic.
When EXCLUDE_STRICT is set, an "and" logic is applied: all bits must match for a property to be removed.
@param array $a The array containing the properties to f... | [
"Filters",
"out",
"the",
"specified",
"properties",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/VarDumper/Caster/Caster.php#L107-L146 | train | Filter the array by exclude | [
30522,
2270,
10763,
3853,
11307,
1006,
9140,
1002,
1037,
1010,
1002,
11307,
1010,
9140,
1002,
3205,
21572,
4842,
7368,
1027,
1031,
1033,
1010,
1004,
1002,
4175,
1027,
1014,
1007,
1063,
1002,
4175,
1027,
1014,
1025,
18921,
6776,
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... |
symfony/symfony | src/Symfony/Component/Cache/Traits/RedisTrait.php | RedisTrait.doDelete | protected function doDelete(array $ids)
{
if (!$ids) {
return true;
}
if ($this->redis instanceof \Predis\Client && $this->redis->getConnection() instanceof ClusterInterface) {
$this->pipeline(function () use ($ids) {
foreach ($ids as $id) {
... | php | protected function doDelete(array $ids)
{
if (!$ids) {
return true;
}
if ($this->redis instanceof \Predis\Client && $this->redis->getConnection() instanceof ClusterInterface) {
$this->pipeline(function () use ($ids) {
foreach ($ids as $id) {
... | [
"protected",
"function",
"doDelete",
"(",
"array",
"$",
"ids",
")",
"{",
"if",
"(",
"!",
"$",
"ids",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"redis",
"instanceof",
"\\",
"Predis",
"\\",
"Client",
"&&",
"$",
"this",
"->",... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Cache/Traits/RedisTrait.php#L366-L383 | train | Do delete. | [
30522,
5123,
3853,
26489,
12260,
2618,
1006,
9140,
1002,
8909,
2015,
1007,
1063,
2065,
1006,
999,
1002,
8909,
2015,
1007,
1063,
2709,
2995,
1025,
1065,
2065,
1006,
1002,
2023,
1011,
1028,
2417,
2483,
6013,
11253,
1032,
3653,
10521,
1032,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Data/Bundle/Reader/BufferedBundleReader.php | BufferedBundleReader.read | public function read($path, $locale)
{
$hash = $path.'//'.$locale;
if (!isset($this->buffer[$hash])) {
$this->buffer[$hash] = $this->reader->read($path, $locale);
}
return $this->buffer[$hash];
} | php | public function read($path, $locale)
{
$hash = $path.'//'.$locale;
if (!isset($this->buffer[$hash])) {
$this->buffer[$hash] = $this->reader->read($path, $locale);
}
return $this->buffer[$hash];
} | [
"public",
"function",
"read",
"(",
"$",
"path",
",",
"$",
"locale",
")",
"{",
"$",
"hash",
"=",
"$",
"path",
".",
"'//'",
".",
"$",
"locale",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"buffer",
"[",
"$",
"hash",
"]",
")",
")",
"{"... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Intl/Data/Bundle/Reader/BufferedBundleReader.php#L41-L50 | train | Read the content of the file and return the content. | [
30522,
2270,
3853,
3191,
1006,
1002,
4130,
1010,
1002,
2334,
2063,
1007,
1063,
1002,
23325,
1027,
1002,
4130,
1012,
1005,
1013,
1013,
1005,
1012,
1002,
2334,
2063,
1025,
2065,
1006,
999,
26354,
3388,
1006,
1002,
2023,
1011,
1028,
17698,
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/Finder/SplFileInfo.php | SplFileInfo.getContents | public function getContents()
{
set_error_handler(function ($type, $msg) use (&$error) { $error = $msg; });
$content = file_get_contents($this->getPathname());
restore_error_handler();
if (false === $content) {
throw new \RuntimeException($error);
}
retur... | php | public function getContents()
{
set_error_handler(function ($type, $msg) use (&$error) { $error = $msg; });
$content = file_get_contents($this->getPathname());
restore_error_handler();
if (false === $content) {
throw new \RuntimeException($error);
}
retur... | [
"public",
"function",
"getContents",
"(",
")",
"{",
"set_error_handler",
"(",
"function",
"(",
"$",
"type",
",",
"$",
"msg",
")",
"use",
"(",
"&",
"$",
"error",
")",
"{",
"$",
"error",
"=",
"$",
"msg",
";",
"}",
")",
";",
"$",
"content",
"=",
"fi... | Returns the contents of the file.
@return string the contents of the file
@throws \RuntimeException | [
"Returns",
"the",
"contents",
"of",
"the",
"file",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Finder/SplFileInfo.php#L74-L84 | train | Get the contents of the file | [
30522,
2270,
3853,
2131,
8663,
6528,
3215,
1006,
1007,
1063,
2275,
1035,
7561,
1035,
28213,
1006,
3853,
1006,
1002,
2828,
1010,
1002,
5796,
2290,
1007,
2224,
1006,
1004,
1002,
7561,
1007,
1063,
1002,
7561,
1027,
1002,
5796,
2290,
1025,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Http/Middleware/FrameGuard.php | FrameGuard.handle | public function handle($request, Closure $next)
{
$response = $next($request);
$response->headers->set('X-Frame-Options', 'SAMEORIGIN', false);
return $response;
} | php | public function handle($request, Closure $next)
{
$response = $next($request);
$response->headers->set('X-Frame-Options', 'SAMEORIGIN', false);
return $response;
} | [
"public",
"function",
"handle",
"(",
"$",
"request",
",",
"Closure",
"$",
"next",
")",
"{",
"$",
"response",
"=",
"$",
"next",
"(",
"$",
"request",
")",
";",
"$",
"response",
"->",
"headers",
"->",
"set",
"(",
"'X-Frame-Options'",
",",
"'SAMEORIGIN'",
... | Handle the given request and get the response.
@param \Illuminate\Http\Request $request
@param \Closure $next
@return \Symfony\Component\HttpFoundation\Response | [
"Handle",
"the",
"given",
"request",
"and",
"get",
"the",
"response",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Http/Middleware/FrameGuard.php#L16-L23 | train | Handle the request and return the response | [
30522,
2270,
3853,
5047,
1006,
1002,
5227,
1010,
8503,
1002,
2279,
1007,
1063,
1002,
3433,
1027,
1002,
2279,
1006,
1002,
5227,
1007,
1025,
1002,
3433,
1011,
1028,
20346,
2015,
1011,
1028,
2275,
1006,
1005,
1060,
1011,
4853,
1011,
7047,
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/ExamplePlugin/API.php | API.getExampleReport | public function getExampleReport($idSite, $period, $date, $segment = false)
{
$table = DataTable::makeFromSimpleArray(array(
array('label' => 'My Label 1', 'nb_visits' => '1'),
array('label' => 'My Label 2', 'nb_visits' => '5'),
));
return $table;
} | php | public function getExampleReport($idSite, $period, $date, $segment = false)
{
$table = DataTable::makeFromSimpleArray(array(
array('label' => 'My Label 1', 'nb_visits' => '1'),
array('label' => 'My Label 2', 'nb_visits' => '5'),
));
return $table;
} | [
"public",
"function",
"getExampleReport",
"(",
"$",
"idSite",
",",
"$",
"period",
",",
"$",
"date",
",",
"$",
"segment",
"=",
"false",
")",
"{",
"$",
"table",
"=",
"DataTable",
"::",
"makeFromSimpleArray",
"(",
"array",
"(",
"array",
"(",
"'label'",
"=>"... | Another example method that returns a data table.
@param int $idSite
@param string $period
@param string $date
@param bool|string $segment
@return DataTable | [
"Another",
"example",
"method",
"that",
"returns",
"a",
"data",
"table",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/ExamplePlugin/API.php#L48-L56 | train | Get example report | [
30522,
2270,
3853,
2131,
10288,
16613,
3917,
13699,
11589,
1006,
1002,
8909,
28032,
2063,
1010,
1002,
2558,
1010,
1002,
3058,
1010,
1002,
6903,
1027,
6270,
1007,
1063,
30524,
1050,
2497,
1035,
7879,
1005,
1027,
1028,
1005,
1015,
1005,
1007,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Templating/DelegatingEngine.php | DelegatingEngine.getEngine | public function getEngine($name)
{
foreach ($this->engines as $engine) {
if ($engine->supports($name)) {
return $engine;
}
}
throw new \RuntimeException(sprintf('No engine is able to work with the template "%s".', $name));
} | php | public function getEngine($name)
{
foreach ($this->engines as $engine) {
if ($engine->supports($name)) {
return $engine;
}
}
throw new \RuntimeException(sprintf('No engine is able to work with the template "%s".', $name));
} | [
"public",
"function",
"getEngine",
"(",
"$",
"name",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"engines",
"as",
"$",
"engine",
")",
"{",
"if",
"(",
"$",
"engine",
"->",
"supports",
"(",
"$",
"name",
")",
")",
"{",
"return",
"$",
"engine",
";",
... | Get an engine able to render the given template.
@param string|TemplateReferenceInterface $name A template name or a TemplateReferenceInterface instance
@return EngineInterface The engine
@throws \RuntimeException if no engine able to work with the template is found | [
"Get",
"an",
"engine",
"able",
"to",
"render",
"the",
"given",
"template",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Templating/DelegatingEngine.php#L93-L102 | train | Returns the engine that supports the given name | [
30522,
2270,
3853,
2131,
13159,
3170,
1006,
1002,
2171,
1007,
1063,
18921,
6776,
1006,
1002,
2023,
1011,
1028,
5209,
2004,
1002,
3194,
1007,
1063,
2065,
1006,
1002,
3194,
1011,
1028,
6753,
1006,
1002,
2171,
1007,
1007,
1063,
2709,
1002,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
php-ai/php-ml | src/Classification/Ensemble/Bagging.php | Bagging.setClassifer | public function setClassifer(string $classifier, array $classifierOptions = [])
{
$this->classifier = $classifier;
$this->classifierOptions = $classifierOptions;
return $this;
} | php | public function setClassifer(string $classifier, array $classifierOptions = [])
{
$this->classifier = $classifier;
$this->classifierOptions = $classifierOptions;
return $this;
} | [
"public",
"function",
"setClassifer",
"(",
"string",
"$",
"classifier",
",",
"array",
"$",
"classifierOptions",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"classifier",
"=",
"$",
"classifier",
";",
"$",
"this",
"->",
"classifierOptions",
"=",
"$",
"classi... | This method is used to set the base classifier. Default value is
DecisionTree::class, but any class that implements the <i>Classifier</i>
can be used. <br>
While giving the parameters of the classifier, the values should be
given in the order they are in the constructor of the classifier and parameter
names are neglect... | [
"This",
"method",
"is",
"used",
"to",
"set",
"the",
"base",
"classifier",
".",
"Default",
"value",
"is",
"DecisionTree",
"::",
"class",
"but",
"any",
"class",
"that",
"implements",
"the",
"<i",
">",
"Classifier<",
"/",
"i",
">",
"can",
"be",
"used",
".",... | f6aa1a59b0525b8fca3d2786d661ab3e70904016 | https://github.com/php-ai/php-ml/blob/f6aa1a59b0525b8fca3d2786d661ab3e70904016/src/Classification/Ensemble/Bagging.php#L94-L100 | train | Set the classifier and classifierOptions | [
30522,
2270,
3853,
2275,
26266,
23780,
1006,
5164,
1002,
2465,
18095,
1010,
9140,
1002,
2465,
18095,
7361,
9285,
1027,
1031,
1033,
1007,
1063,
1002,
2023,
1011,
1028,
2465,
18095,
1027,
1002,
2465,
18095,
1025,
1002,
2023,
1011,
1028,
2465,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Translation/MessageSelector.php | MessageSelector.extract | private function extract($segments, $number)
{
foreach ($segments as $part) {
if (! is_null($line = $this->extractFromString($part, $number))) {
return $line;
}
}
} | php | private function extract($segments, $number)
{
foreach ($segments as $part) {
if (! is_null($line = $this->extractFromString($part, $number))) {
return $line;
}
}
} | [
"private",
"function",
"extract",
"(",
"$",
"segments",
",",
"$",
"number",
")",
"{",
"foreach",
"(",
"$",
"segments",
"as",
"$",
"part",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"line",
"=",
"$",
"this",
"->",
"extractFromString",
"(",
"$",
... | Extract a translation string using inline conditions.
@param array $segments
@param int $number
@return mixed | [
"Extract",
"a",
"translation",
"string",
"using",
"inline",
"conditions",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Translation/MessageSelector.php#L43-L50 | train | Extract a line from the segments | [
30522,
2797,
3853,
14817,
1006,
1002,
9214,
1010,
1002,
2193,
1007,
1063,
18921,
6776,
1006,
1002,
9214,
2004,
1002,
2112,
1007,
1063,
2065,
1006,
999,
2003,
1035,
19701,
1006,
1002,
2240,
1027,
1002,
2023,
1011,
1028,
14817,
19699,
22225,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Auth/Database/Administrator.php | Administrator.getAvatarAttribute | public function getAvatarAttribute($avatar)
{
if (url()->isValidUrl($avatar)) {
return $avatar;
}
$disk = config('admin.upload.disk');
if ($avatar && array_key_exists($disk, config('filesystems.disks'))) {
return Storage::disk(config('admin.upload.disk'))->u... | php | public function getAvatarAttribute($avatar)
{
if (url()->isValidUrl($avatar)) {
return $avatar;
}
$disk = config('admin.upload.disk');
if ($avatar && array_key_exists($disk, config('filesystems.disks'))) {
return Storage::disk(config('admin.upload.disk'))->u... | [
"public",
"function",
"getAvatarAttribute",
"(",
"$",
"avatar",
")",
"{",
"if",
"(",
"url",
"(",
")",
"->",
"isValidUrl",
"(",
"$",
"avatar",
")",
")",
"{",
"return",
"$",
"avatar",
";",
"}",
"$",
"disk",
"=",
"config",
"(",
"'admin.upload.disk'",
")",... | Get avatar attribute.
@param string $avatar
@return string | [
"Get",
"avatar",
"attribute",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Auth/Database/Administrator.php#L46-L61 | train | Get avatar attribute | [
30522,
2270,
3853,
2131,
12462,
27115,
4779,
3089,
8569,
2618,
1006,
1002,
22128,
1007,
1063,
2065,
1006,
24471,
2140,
1006,
1007,
1011,
1028,
2003,
10175,
3593,
3126,
2140,
1006,
1002,
22128,
1007,
1007,
1063,
2709,
1002,
22128,
1025,
1065... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/Settings/Storage/Factory.php | Factory.makeStorage | public function makeStorage(BackendInterface $backend)
{
if (SettingsServer::isTrackerApiRequest()) {
$backend = new Backend\Cache($backend);
}
return new Storage($backend);
} | php | public function makeStorage(BackendInterface $backend)
{
if (SettingsServer::isTrackerApiRequest()) {
$backend = new Backend\Cache($backend);
}
return new Storage($backend);
} | [
"public",
"function",
"makeStorage",
"(",
"BackendInterface",
"$",
"backend",
")",
"{",
"if",
"(",
"SettingsServer",
"::",
"isTrackerApiRequest",
"(",
")",
")",
"{",
"$",
"backend",
"=",
"new",
"Backend",
"\\",
"Cache",
"(",
"$",
"backend",
")",
";",
"}",
... | Makes a new storage object based on a custom backend interface.
@param BackendInterface $backend
@return Storage | [
"Makes",
"a",
"new",
"storage",
"object",
"based",
"on",
"a",
"custom",
"backend",
"interface",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Settings/Storage/Factory.php#L134-L141 | train | Create a Storage | [
30522,
2270,
3853,
3084,
4263,
4270,
1006,
2067,
10497,
18447,
2121,
12172,
1002,
2067,
10497,
1007,
1063,
2065,
1006,
10906,
8043,
6299,
1024,
1024,
21541,
22648,
5484,
9331,
7442,
15500,
1006,
1007,
1007,
1063,
1002,
2067,
10497,
1027,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
slimphp/Slim | Slim/Http/NonBufferedBody.php | NonBufferedBody.write | public function write($string)
{
$buffered = '';
while (0 < ob_get_level()) {
$buffered = ob_get_clean() . $buffered;
}
echo $buffered . $string;
flush();
return strlen($string) + strlen($buffered);
} | php | public function write($string)
{
$buffered = '';
while (0 < ob_get_level()) {
$buffered = ob_get_clean() . $buffered;
}
echo $buffered . $string;
flush();
return strlen($string) + strlen($buffered);
} | [
"public",
"function",
"write",
"(",
"$",
"string",
")",
"{",
"$",
"buffered",
"=",
"''",
";",
"while",
"(",
"0",
"<",
"ob_get_level",
"(",
")",
")",
"{",
"$",
"buffered",
"=",
"ob_get_clean",
"(",
")",
".",
"$",
"buffered",
";",
"}",
"echo",
"$",
... | {@inheritdoc} | [
"{"
] | ccef5f7d8bcd469d59cbe64f6210d83764f91543 | https://github.com/slimphp/Slim/blob/ccef5f7d8bcd469d59cbe64f6210d83764f91543/Slim/Http/NonBufferedBody.php#L98-L110 | train | Write a string to the output buffer | [
30522,
2270,
3853,
4339,
1006,
1002,
5164,
1007,
1063,
1002,
17698,
2098,
1027,
1005,
1005,
1025,
2096,
1006,
1014,
1026,
27885,
1035,
2131,
1035,
2504,
1006,
1007,
1007,
1063,
1002,
17698,
2098,
1027,
27885,
1035,
2131,
1035,
4550,
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/system/ServiceProvider.php | ServiceProvider.registerBackendNavigation | protected function registerBackendNavigation()
{
BackendMenu::registerCallback(function ($manager) {
$manager->registerMenuItems('October.System', [
'system' => [
'label' => 'system::lang.settings.menu_label',
'icon' => 'icon-c... | php | protected function registerBackendNavigation()
{
BackendMenu::registerCallback(function ($manager) {
$manager->registerMenuItems('October.System', [
'system' => [
'label' => 'system::lang.settings.menu_label',
'icon' => 'icon-c... | [
"protected",
"function",
"registerBackendNavigation",
"(",
")",
"{",
"BackendMenu",
"::",
"registerCallback",
"(",
"function",
"(",
"$",
"manager",
")",
"{",
"$",
"manager",
"->",
"registerMenuItems",
"(",
"'October.System'",
",",
"[",
"'system'",
"=>",
"[",
"'l... | /*
Register navigation | [
"/",
"*",
"Register",
"navigation"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/ServiceProvider.php#L341-L376 | train | Register the backend navigation | [
30522,
5123,
3853,
4236,
5963,
10497,
2532,
5737,
12540,
1006,
1007,
1063,
2067,
10497,
3549,
2226,
1024,
1024,
4236,
9289,
20850,
8684,
1006,
3853,
1006,
1002,
3208,
1007,
1063,
1002,
3208,
1011,
1028,
4236,
3549,
14663,
6633,
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/Table/Abstract.php | Zend_Db_Table_Abstract.setDefaultValues | public function setDefaultValues(Array $defaultValues)
{
foreach ($defaultValues as $defaultName => $defaultValue) {
if (array_key_exists($defaultName, $this->_metadata)) {
$this->_defaultValues[$defaultName] = $defaultValue;
}
}
return $this;
} | php | public function setDefaultValues(Array $defaultValues)
{
foreach ($defaultValues as $defaultName => $defaultValue) {
if (array_key_exists($defaultName, $this->_metadata)) {
$this->_defaultValues[$defaultName] = $defaultValue;
}
}
return $this;
} | [
"public",
"function",
"setDefaultValues",
"(",
"Array",
"$",
"defaultValues",
")",
"{",
"foreach",
"(",
"$",
"defaultValues",
"as",
"$",
"defaultName",
"=>",
"$",
"defaultValue",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"defaultName",
",",
"$",
"th... | set the default values for the table class
@param array $defaultValues
@return Zend_Db_Table_Abstract | [
"set",
"the",
"default",
"values",
"for",
"the",
"table",
"class"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Table/Abstract.php#L538-L546 | train | Set Default Values | [
30522,
2270,
3853,
2275,
3207,
7011,
11314,
10175,
15808,
1006,
9140,
1002,
12398,
10175,
15808,
1007,
1063,
18921,
6776,
1006,
1002,
12398,
10175,
15808,
2004,
1002,
12398,
18442,
1027,
1028,
1002,
12398,
10175,
5657,
1007,
1063,
2065,
1006,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Framework/Flex/Storage/FolderStorage.php | FolderStorage.createRows | public function createRows(array $rows): array
{
$list = [];
foreach ($rows as $key => $row) {
// Create new file and save it.
$key = $this->getNewKey();
$path = $this->getPathFromKey($key);
$file = $this->getFile($path);
$list[$key] = $thi... | php | public function createRows(array $rows): array
{
$list = [];
foreach ($rows as $key => $row) {
// Create new file and save it.
$key = $this->getNewKey();
$path = $this->getPathFromKey($key);
$file = $this->getFile($path);
$list[$key] = $thi... | [
"public",
"function",
"createRows",
"(",
"array",
"$",
"rows",
")",
":",
"array",
"{",
"$",
"list",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"rows",
"as",
"$",
"key",
"=>",
"$",
"row",
")",
"{",
"// Create new file and save it.",
"$",
"key",
"=",
"$"... | {@inheritdoc}
@see FlexStorageInterface::createRows() | [
"{"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Framework/Flex/Storage/FolderStorage.php#L81-L93 | train | Create rows and save them | [
30522,
2270,
3853,
3443,
10524,
2015,
1006,
9140,
1002,
10281,
1007,
1024,
9140,
1063,
1002,
2862,
1027,
1031,
1033,
1025,
18921,
6776,
1006,
1002,
10281,
2004,
1002,
3145,
1027,
1028,
1002,
5216,
1007,
1063,
1013,
1013,
3443,
2047,
5371,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Fragment/HIncludeFragmentRenderer.php | HIncludeFragmentRenderer.setTemplating | public function setTemplating($templating)
{
if (null !== $templating && !$templating instanceof EngineInterface && !$templating instanceof Environment) {
throw new \InvalidArgumentException('The hinclude rendering strategy needs an instance of Twig\Environment or Symfony\Component\Templating\En... | php | public function setTemplating($templating)
{
if (null !== $templating && !$templating instanceof EngineInterface && !$templating instanceof Environment) {
throw new \InvalidArgumentException('The hinclude rendering strategy needs an instance of Twig\Environment or Symfony\Component\Templating\En... | [
"public",
"function",
"setTemplating",
"(",
"$",
"templating",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"templating",
"&&",
"!",
"$",
"templating",
"instanceof",
"EngineInterface",
"&&",
"!",
"$",
"templating",
"instanceof",
"Environment",
")",
"{",
"throw",
... | Sets the templating engine to use to render the default content.
@param EngineInterface|Environment|null $templating An EngineInterface or an Environment instance
@throws \InvalidArgumentException | [
"Sets",
"the",
"templating",
"engine",
"to",
"use",
"to",
"render",
"the",
"default",
"content",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpKernel/Fragment/HIncludeFragmentRenderer.php#L56-L67 | train | Set the templating engine | [
30522,
2270,
3853,
2275,
18532,
24759,
5844,
1006,
1002,
8915,
8737,
22248,
1007,
1063,
2065,
1006,
19701,
999,
1027,
1027,
1002,
8915,
8737,
22248,
1004,
1004,
999,
1002,
8915,
8737,
22248,
6013,
11253,
3194,
18447,
2121,
12172,
1004,
1004... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Db/Mysqli.php | Mysqli.rollBack | public function rollBack($xid)
{
if ($this->activeTransaction != $xid || $this->activeTransaction === false) {
return;
}
$this->activeTransaction = false;
if (!$this->connection->rollback()) {
throw new DbException("Rollback failed");
}
$thi... | php | public function rollBack($xid)
{
if ($this->activeTransaction != $xid || $this->activeTransaction === false) {
return;
}
$this->activeTransaction = false;
if (!$this->connection->rollback()) {
throw new DbException("Rollback failed");
}
$thi... | [
"public",
"function",
"rollBack",
"(",
"$",
"xid",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"activeTransaction",
"!=",
"$",
"xid",
"||",
"$",
"this",
"->",
"activeTransaction",
"===",
"false",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"activeTran... | Rollback Transaction
@param $xid
@throws DbException
@internal param TransactionID $string from beginTransaction | [
"Rollback",
"Transaction"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Tracker/Db/Mysqli.php#L374-L387 | train | Rollbacks a transaction | [
30522,
2270,
3853,
4897,
5963,
1006,
1002,
8418,
2094,
1007,
30524,
1011,
1028,
3161,
6494,
3619,
18908,
3258,
1027,
6270,
1025,
2065,
1006,
999,
1002,
2023,
1011,
1028,
4434,
1011,
1028,
4897,
5963,
1006,
1007,
1007,
1063,
5466,
2047,
16... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/HttpKernel/HttpCache/AbstractSurrogate.php | AbstractSurrogate.needsParsing | public function needsParsing(Response $response)
{
if (!$control = $response->headers->get('Surrogate-Control')) {
return false;
}
$pattern = sprintf('#content="[^"]*%s/1.0[^"]*"#', strtoupper($this->getName()));
return (bool) preg_match($pattern, $control);
} | php | public function needsParsing(Response $response)
{
if (!$control = $response->headers->get('Surrogate-Control')) {
return false;
}
$pattern = sprintf('#content="[^"]*%s/1.0[^"]*"#', strtoupper($this->getName()));
return (bool) preg_match($pattern, $control);
} | [
"public",
"function",
"needsParsing",
"(",
"Response",
"$",
"response",
")",
"{",
"if",
"(",
"!",
"$",
"control",
"=",
"$",
"response",
"->",
"headers",
"->",
"get",
"(",
"'Surrogate-Control'",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"pattern",
... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpKernel/HttpCache/AbstractSurrogate.php#L77-L86 | train | Returns true if the response needs to be parsed. | [
30522,
2270,
3853,
3791,
19362,
7741,
1006,
3433,
1002,
3433,
1007,
1063,
2065,
1006,
999,
1002,
2491,
1027,
1002,
3433,
1011,
1028,
20346,
2015,
1011,
1028,
2131,
1006,
1005,
7505,
21799,
1011,
2491,
1005,
1007,
1007,
1063,
2709,
6270,
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 | libs/Zend/Config/Yaml.php | Zend_Config_Yaml._replaceConstants | protected static function _replaceConstants($value)
{
foreach (self::_getConstants() as $constant) {
if (strstr($value, $constant)) {
$value = str_replace($constant, constant($constant), $value);
}
}
return $value;
} | php | protected static function _replaceConstants($value)
{
foreach (self::_getConstants() as $constant) {
if (strstr($value, $constant)) {
$value = str_replace($constant, constant($constant), $value);
}
}
return $value;
} | [
"protected",
"static",
"function",
"_replaceConstants",
"(",
"$",
"value",
")",
"{",
"foreach",
"(",
"self",
"::",
"_getConstants",
"(",
")",
"as",
"$",
"constant",
")",
"{",
"if",
"(",
"strstr",
"(",
"$",
"value",
",",
"$",
"constant",
")",
")",
"{",
... | Replace any constants referenced in a string with their values
@param string $value
@return string | [
"Replace",
"any",
"constants",
"referenced",
"in",
"a",
"string",
"with",
"their",
"values"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Config/Yaml.php#L360-L368 | train | Replace all constants with their values | [
30522,
5123,
10763,
3853,
1035,
5672,
8663,
12693,
3215,
1006,
1002,
3643,
1007,
1063,
18921,
6776,
1006,
2969,
1024,
1024,
1035,
2131,
8663,
12693,
3215,
1006,
1007,
2004,
1002,
5377,
1007,
1063,
2065,
1006,
2358,
12096,
2099,
1006,
1002,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php | HasRelationships.newMorphToMany | protected function newMorphToMany(Builder $query, Model $parent, $name, $table, $foreignPivotKey,
$relatedPivotKey, $parentKey, $relatedKey,
$relationName = null, $inverse = false)
{
return new MorphToMany($query, $parent, $name, $t... | php | protected function newMorphToMany(Builder $query, Model $parent, $name, $table, $foreignPivotKey,
$relatedPivotKey, $parentKey, $relatedKey,
$relationName = null, $inverse = false)
{
return new MorphToMany($query, $parent, $name, $t... | [
"protected",
"function",
"newMorphToMany",
"(",
"Builder",
"$",
"query",
",",
"Model",
"$",
"parent",
",",
"$",
"name",
",",
"$",
"table",
",",
"$",
"foreignPivotKey",
",",
"$",
"relatedPivotKey",
",",
"$",
"parentKey",
",",
"$",
"relatedKey",
",",
"$",
... | Instantiate a new MorphToMany relationship.
@param \Illuminate\Database\Eloquent\Builder $query
@param \Illuminate\Database\Eloquent\Model $parent
@param string $name
@param string $table
@param string $foreignPivotKey
@param string $relatedPivotKey
@param string $parentKey
@param string $relatedKey
@p... | [
"Instantiate",
"a",
"new",
"MorphToMany",
"relationship",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php#L561-L567 | train | Creates a new MorphToMany | [
30522,
5123,
3853,
2047,
5302,
14536,
11039,
20778,
2100,
1006,
12508,
1002,
23032,
1010,
2944,
1002,
6687,
1010,
1002,
2171,
1010,
1002,
2795,
1010,
1002,
3097,
8197,
22994,
14839,
1010,
1002,
3141,
8197,
22994,
14839,
1010,
1002,
6687,
14... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/ScheduledReports/API.php | API.updateReport | public function updateReport($idReport, $idSite, $description, $period, $hour, $reportType, $reportFormat, $reports, $parameters, $idSegment = false, $evolutionPeriodFor = 'prev',
$evolutionPeriodN = null)
{
Piwik::checkUserIsNotAnonymous();
Piwik::checkUserHasViewAc... | php | public function updateReport($idReport, $idSite, $description, $period, $hour, $reportType, $reportFormat, $reports, $parameters, $idSegment = false, $evolutionPeriodFor = 'prev',
$evolutionPeriodN = null)
{
Piwik::checkUserIsNotAnonymous();
Piwik::checkUserHasViewAc... | [
"public",
"function",
"updateReport",
"(",
"$",
"idReport",
",",
"$",
"idSite",
",",
"$",
"description",
",",
"$",
"period",
",",
"$",
"hour",
",",
"$",
"reportType",
",",
"$",
"reportFormat",
",",
"$",
"reports",
",",
"$",
"parameters",
",",
"$",
"idS... | Updates an existing report.
@see addReport() | [
"Updates",
"an",
"existing",
"report",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/ScheduledReports/API.php#L154-L189 | train | Update a report | [
30522,
2270,
3853,
10651,
2890,
6442,
1006,
1002,
8909,
2890,
6442,
1010,
1002,
8909,
28032,
2063,
1010,
1002,
6412,
1010,
1002,
2558,
1010,
1002,
3178,
1010,
1002,
3189,
13874,
1010,
1002,
3189,
14192,
4017,
1010,
1002,
4311,
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... |
z-song/laravel-admin | src/Form/Field/Html.php | Html.render | public function render()
{
if ($this->html instanceof \Closure) {
$this->html = $this->html->call($this->form->model(), $this->form);
}
if ($this->plain) {
return $this->html;
}
$viewClass = $this->getViewElementClasses();
return <<<EOT
<div... | php | public function render()
{
if ($this->html instanceof \Closure) {
$this->html = $this->html->call($this->form->model(), $this->form);
}
if ($this->plain) {
return $this->html;
}
$viewClass = $this->getViewElementClasses();
return <<<EOT
<div... | [
"public",
"function",
"render",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"html",
"instanceof",
"\\",
"Closure",
")",
"{",
"$",
"this",
"->",
"html",
"=",
"$",
"this",
"->",
"html",
"->",
"call",
"(",
"$",
"this",
"->",
"form",
"->",
"model",
... | Render html field.
@return string | [
"Render",
"html",
"field",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Form/Field/Html.php#L55-L75 | train | Render the field | [
30522,
2270,
3853,
17552,
1006,
1007,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
16129,
6013,
11253,
1032,
8503,
1007,
1063,
1002,
2023,
1011,
1028,
16129,
1027,
1002,
2023,
1011,
1028,
16129,
1011,
1028,
2655,
1006,
1002,
2023,
1011,
1028,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Console/Formatter/OutputFormatter.php | OutputFormatter.createStyleFromString | private function createStyleFromString(string $string)
{
if (isset($this->styles[$string])) {
return $this->styles[$string];
}
if (!preg_match_all('/([^=]+)=([^;]+)(;|$)/', $string, $matches, PREG_SET_ORDER)) {
return false;
}
$style = new OutputForm... | php | private function createStyleFromString(string $string)
{
if (isset($this->styles[$string])) {
return $this->styles[$string];
}
if (!preg_match_all('/([^=]+)=([^;]+)(;|$)/', $string, $matches, PREG_SET_ORDER)) {
return false;
}
$style = new OutputForm... | [
"private",
"function",
"createStyleFromString",
"(",
"string",
"$",
"string",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"styles",
"[",
"$",
"string",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"styles",
"[",
"$",
"string",
"]",
";",... | Tries to create new style instance from string.
@return OutputFormatterStyle|false False if string is not format string | [
"Tries",
"to",
"create",
"new",
"style",
"instance",
"from",
"string",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Formatter/OutputFormatter.php#L200-L233 | train | Create OutputFormatterStyle from string | [
30522,
2797,
3853,
9005,
27983,
19699,
22225,
18886,
3070,
1006,
5164,
1002,
5164,
1007,
1063,
2065,
1006,
26354,
3388,
1006,
1002,
2023,
1011,
1028,
6782,
1031,
1002,
5164,
1033,
1007,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
6782,
1031,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/View/Concerns/ManagesEvents.php | ManagesEvents.addEventListener | protected function addEventListener($name, $callback)
{
if (Str::contains($name, '*')) {
$callback = function ($name, array $data) use ($callback) {
return $callback($data[0]);
};
}
$this->events->listen($name, $callback);
} | php | protected function addEventListener($name, $callback)
{
if (Str::contains($name, '*')) {
$callback = function ($name, array $data) use ($callback) {
return $callback($data[0]);
};
}
$this->events->listen($name, $callback);
} | [
"protected",
"function",
"addEventListener",
"(",
"$",
"name",
",",
"$",
"callback",
")",
"{",
"if",
"(",
"Str",
"::",
"contains",
"(",
"$",
"name",
",",
"'*'",
")",
")",
"{",
"$",
"callback",
"=",
"function",
"(",
"$",
"name",
",",
"array",
"$",
"... | Add a listener to the event dispatcher.
@param string $name
@param \Closure $callback
@return void | [
"Add",
"a",
"listener",
"to",
"the",
"event",
"dispatcher",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/View/Concerns/ManagesEvents.php#L160-L169 | train | Add an event listener to the list of event listeners | [
30522,
5123,
3853,
5587,
18697,
3372,
9863,
24454,
1006,
1002,
2171,
1010,
1002,
2655,
5963,
1007,
1063,
2065,
1006,
2358,
2099,
1024,
1024,
3397,
1006,
1002,
2171,
1010,
1005,
1008,
1005,
1007,
1007,
1063,
1002,
2655,
5963,
1027,
3853,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/cms/classes/Asset.php | Asset.save | public function save()
{
$this->validateFileName();
$fullPath = $this->getFilePath();
if (File::isFile($fullPath) && $this->originalFileName !== $this->fileName) {
throw new ApplicationException(Lang::get(
'cms::lang.cms_object.file_already_exists',
... | php | public function save()
{
$this->validateFileName();
$fullPath = $this->getFilePath();
if (File::isFile($fullPath) && $this->originalFileName !== $this->fileName) {
throw new ApplicationException(Lang::get(
'cms::lang.cms_object.file_already_exists',
... | [
"public",
"function",
"save",
"(",
")",
"{",
"$",
"this",
"->",
"validateFileName",
"(",
")",
";",
"$",
"fullPath",
"=",
"$",
"this",
"->",
"getFilePath",
"(",
")",
";",
"if",
"(",
"File",
"::",
"isFile",
"(",
"$",
"fullPath",
")",
"&&",
"$",
"this... | Saves the object to the disk. | [
"Saves",
"the",
"object",
"to",
"the",
"disk",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/Asset.php#L155-L210 | train | Saves the file to the disk | [
30522,
2270,
3853,
3828,
1006,
1007,
1063,
1002,
2023,
1011,
1028,
9398,
3686,
8873,
20844,
4168,
1006,
1007,
1025,
1002,
2440,
15069,
1027,
1002,
2023,
1011,
1028,
2131,
8873,
2571,
15069,
1006,
1007,
1025,
2065,
1006,
5371,
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... |
getgrav/grav | system/src/Grav/Common/Page/Collection.php | Collection.remove | public function remove($key = null)
{
if ($key instanceof PageInterface) {
$key = $key->path();
} elseif (null === $key) {
$key = (string)key($this->items);
}
if (!\is_string($key)) {
throw new \InvalidArgumentException('Invalid argument $key.');
... | php | public function remove($key = null)
{
if ($key instanceof PageInterface) {
$key = $key->path();
} elseif (null === $key) {
$key = (string)key($this->items);
}
if (!\is_string($key)) {
throw new \InvalidArgumentException('Invalid argument $key.');
... | [
"public",
"function",
"remove",
"(",
"$",
"key",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"key",
"instanceof",
"PageInterface",
")",
"{",
"$",
"key",
"=",
"$",
"key",
"->",
"path",
"(",
")",
";",
"}",
"elseif",
"(",
"null",
"===",
"$",
"key",
")",
... | Remove item from the list.
@param PageInterface|string|null $key
@return $this
@throws \InvalidArgumentException | [
"Remove",
"item",
"from",
"the",
"list",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Page/Collection.php#L203-L217 | train | Remove a key from the list | [
30522,
2270,
3853,
6366,
1006,
1002,
3145,
1027,
19701,
1007,
1063,
2065,
1006,
1002,
3145,
6013,
11253,
3931,
18447,
2121,
12172,
1007,
1063,
1002,
3145,
1027,
1002,
3145,
1011,
1028,
4130,
1006,
1007,
1025,
1065,
2842,
10128,
1006,
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... |
laravel/framework | src/Illuminate/Database/Eloquent/Model.php | Model.is | public function is($model)
{
return ! is_null($model) &&
$this->getKey() === $model->getKey() &&
$this->getTable() === $model->getTable() &&
$this->getConnectionName() === $model->getConnectionName();
} | php | public function is($model)
{
return ! is_null($model) &&
$this->getKey() === $model->getKey() &&
$this->getTable() === $model->getTable() &&
$this->getConnectionName() === $model->getConnectionName();
} | [
"public",
"function",
"is",
"(",
"$",
"model",
")",
"{",
"return",
"!",
"is_null",
"(",
"$",
"model",
")",
"&&",
"$",
"this",
"->",
"getKey",
"(",
")",
"===",
"$",
"model",
"->",
"getKey",
"(",
")",
"&&",
"$",
"this",
"->",
"getTable",
"(",
")",
... | Determine if two models have the same ID and belong to the same table.
@param \Illuminate\Database\Eloquent\Model|null $model
@return bool | [
"Determine",
"if",
"two",
"models",
"have",
"the",
"same",
"ID",
"and",
"belong",
"to",
"the",
"same",
"table",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Model.php#L1189-L1195 | train | Is the model the same as the one in the model? | [
30522,
2270,
3853,
2003,
1006,
1002,
2944,
1007,
1063,
2709,
999,
2003,
1035,
19701,
1006,
1002,
2944,
1007,
1004,
1004,
1002,
2023,
1011,
1028,
2131,
14839,
1006,
1007,
1027,
1027,
1027,
1002,
2944,
1011,
1028,
2131,
14839,
1006,
1007,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/CronArchive/SharedSiteIds.php | SharedSiteIds.getNumProcessedWebsites | public function getNumProcessedWebsites()
{
if ($this->done) {
return $this->getNumSites();
}
if (empty($this->currentSiteId)) {
return 0;
}
$index = array_search($this->currentSiteId, $this->siteIds);
if (false === $index) {
ret... | php | public function getNumProcessedWebsites()
{
if ($this->done) {
return $this->getNumSites();
}
if (empty($this->currentSiteId)) {
return 0;
}
$index = array_search($this->currentSiteId, $this->siteIds);
if (false === $index) {
ret... | [
"public",
"function",
"getNumProcessedWebsites",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"done",
")",
"{",
"return",
"$",
"this",
"->",
"getNumSites",
"(",
")",
";",
"}",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"currentSiteId",
")",
")",
"{"... | Get the number of already processed websites (not necessarily all of those where processed by this archiver).
@return int | [
"Get",
"the",
"number",
"of",
"already",
"processed",
"websites",
"(",
"not",
"necessarily",
"all",
"of",
"those",
"where",
"processed",
"by",
"this",
"archiver",
")",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/CronArchive/SharedSiteIds.php#L79-L96 | train | Get Number of processed websites | [
30522,
2270,
3853,
2131,
19172,
21572,
9623,
6924,
8545,
5910,
7616,
1006,
1007,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
2589,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
2131,
19172,
28032,
2229,
1006,
1007,
1025,
1065,
2065,
1006,
4064,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Session/SaveHandler/DbTable.php | Zend_Session_SaveHandler_DbTable.write | public function write($id, $data)
{
$return = false;
$data = array($this->_modifiedColumn => time(),
$this->_dataColumn => (string) $data);
$rows = call_user_func_array(array(&$this, 'find'), $this->_getPrimary($id));
if (count($rows)) {
$data... | php | public function write($id, $data)
{
$return = false;
$data = array($this->_modifiedColumn => time(),
$this->_dataColumn => (string) $data);
$rows = call_user_func_array(array(&$this, 'find'), $this->_getPrimary($id));
if (count($rows)) {
$data... | [
"public",
"function",
"write",
"(",
"$",
"id",
",",
"$",
"data",
")",
"{",
"$",
"return",
"=",
"false",
";",
"$",
"data",
"=",
"array",
"(",
"$",
"this",
"->",
"_modifiedColumn",
"=>",
"time",
"(",
")",
",",
"$",
"this",
"->",
"_dataColumn",
"=>",
... | Write session data
@param string $id
@param string $data
@return boolean | [
"Write",
"session",
"data"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Session/SaveHandler/DbTable.php#L338-L362 | train | Write a record to the database | [
30522,
2270,
3853,
4339,
1006,
1002,
8909,
1010,
1002,
2951,
1007,
1063,
1002,
2709,
1027,
6270,
1025,
1002,
2951,
1027,
9140,
1006,
1002,
2023,
1011,
1028,
1035,
6310,
25778,
2819,
2078,
1027,
1028,
2051,
1006,
1007,
1010,
1002,
2023,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/DataTable.php | DataTable.aggregateRowWithLabel | protected function aggregateRowWithLabel(Row $row, $columnAggregationOps)
{
$labelToLookFor = $row->getColumn('label');
if ($labelToLookFor === false) {
throw new Exception("Label column not found in the table to add in addDataTable()");
}
$rowFound = $this->getRowFromLab... | php | protected function aggregateRowWithLabel(Row $row, $columnAggregationOps)
{
$labelToLookFor = $row->getColumn('label');
if ($labelToLookFor === false) {
throw new Exception("Label column not found in the table to add in addDataTable()");
}
$rowFound = $this->getRowFromLab... | [
"protected",
"function",
"aggregateRowWithLabel",
"(",
"Row",
"$",
"row",
",",
"$",
"columnAggregationOps",
")",
"{",
"$",
"labelToLookFor",
"=",
"$",
"row",
"->",
"getColumn",
"(",
"'label'",
")",
";",
"if",
"(",
"$",
"labelToLookFor",
"===",
"false",
")",
... | Aggregates the $row columns to this table.
$row must have a column "label". The $row will be summed to this table's row with the same label.
@param $row
@params null|array $columnAggregationOps
@throws \Exception | [
"Aggregates",
"the",
"$row",
"columns",
"to",
"this",
"table",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable.php#L1848-L1874 | train | Aggregate the row with the label | [
30522,
5123,
3853,
9572,
10524,
24415,
20470,
2884,
1006,
5216,
1002,
5216,
1010,
1002,
5930,
8490,
17603,
12540,
11923,
1007,
1063,
1002,
3830,
3406,
4135,
6559,
29278,
1027,
1002,
5216,
1011,
1028,
2131,
25778,
2819,
2078,
1006,
1005,
383... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/backend/classes/FormField.php | FormField.getName | public function getName($arrayName = null)
{
if ($arrayName === null) {
$arrayName = $this->arrayName;
}
if ($arrayName) {
return $arrayName.'['.implode('][', HtmlHelper::nameToArray($this->fieldName)).']';
}
return $this->fieldName;
} | php | public function getName($arrayName = null)
{
if ($arrayName === null) {
$arrayName = $this->arrayName;
}
if ($arrayName) {
return $arrayName.'['.implode('][', HtmlHelper::nameToArray($this->fieldName)).']';
}
return $this->fieldName;
} | [
"public",
"function",
"getName",
"(",
"$",
"arrayName",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"arrayName",
"===",
"null",
")",
"{",
"$",
"arrayName",
"=",
"$",
"this",
"->",
"arrayName",
";",
"}",
"if",
"(",
"$",
"arrayName",
")",
"{",
"return",
"... | Returns a value suitable for the field name property.
@param string $arrayName Specify a custom array name
@return string | [
"Returns",
"a",
"value",
"suitable",
"for",
"the",
"field",
"name",
"property",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/FormField.php#L564-L575 | train | Return the name of the field | [
30522,
2270,
3853,
2131,
18442,
1006,
1002,
9140,
18442,
1027,
19701,
1007,
1063,
2065,
1006,
1002,
9140,
18442,
1027,
1027,
1027,
19701,
1007,
1063,
1002,
9140,
18442,
1027,
1002,
2023,
1011,
1028,
9140,
18442,
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... |
symfony/symfony | src/Symfony/Component/Filesystem/Filesystem.php | Filesystem.mkdir | public function mkdir($dirs, $mode = 0777)
{
foreach ($this->toIterable($dirs) as $dir) {
if (is_dir($dir)) {
continue;
}
if (!self::box('mkdir', $dir, $mode, true)) {
if (!is_dir($dir)) {
// The directory was not creat... | php | public function mkdir($dirs, $mode = 0777)
{
foreach ($this->toIterable($dirs) as $dir) {
if (is_dir($dir)) {
continue;
}
if (!self::box('mkdir', $dir, $mode, true)) {
if (!is_dir($dir)) {
// The directory was not creat... | [
"public",
"function",
"mkdir",
"(",
"$",
"dirs",
",",
"$",
"mode",
"=",
"0777",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"toIterable",
"(",
"$",
"dirs",
")",
"as",
"$",
"dir",
")",
"{",
"if",
"(",
"is_dir",
"(",
"$",
"dir",
")",
")",
"{",
... | Creates a directory recursively.
@param string|iterable $dirs The directory path
@param int $mode The directory mode
@throws IOException On any directory creation failure | [
"Creates",
"a",
"directory",
"recursively",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Filesystem/Filesystem.php#L94-L111 | train | Creates directories in the system | [
30522,
2270,
3853,
12395,
4305,
2099,
1006,
1002,
16101,
2015,
1010,
1002,
5549,
1027,
5718,
2581,
2581,
1007,
1063,
18921,
6776,
1006,
1002,
2023,
1011,
1028,
2000,
21646,
3085,
1006,
1002,
16101,
2015,
1007,
2004,
1002,
16101,
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/DependencyInjection/ContainerBuilder.php | ContainerBuilder.getServiceIds | public function getServiceIds()
{
return array_unique(array_merge(array_keys($this->getDefinitions()), array_keys($this->aliasDefinitions), parent::getServiceIds()));
} | php | public function getServiceIds()
{
return array_unique(array_merge(array_keys($this->getDefinitions()), array_keys($this->aliasDefinitions), parent::getServiceIds()));
} | [
"public",
"function",
"getServiceIds",
"(",
")",
"{",
"return",
"array_unique",
"(",
"array_merge",
"(",
"array_keys",
"(",
"$",
"this",
"->",
"getDefinitions",
"(",
")",
")",
",",
"array_keys",
"(",
"$",
"this",
"->",
"aliasDefinitions",
")",
",",
"parent",... | Gets all service ids.
@return array An array of all defined service ids | [
"Gets",
"all",
"service",
"ids",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/DependencyInjection/ContainerBuilder.php#L788-L791 | train | Get all the service IDs that are available in the current context | [
30522,
2270,
3853,
4152,
2121,
7903,
7416,
5104,
1006,
1007,
1063,
2709,
9140,
1035,
4310,
1006,
9140,
1035,
13590,
1006,
9140,
1035,
6309,
1006,
1002,
2023,
1011,
1028,
2131,
3207,
16294,
22753,
2015,
1006,
1007,
1007,
1010,
9140,
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... |
PHPMailer/PHPMailer | src/SMTP.php | SMTP.errorHandler | protected function errorHandler($errno, $errmsg, $errfile = '', $errline = 0)
{
$notice = 'Connection failed.';
$this->setError(
$notice,
$errmsg,
(string) $errno
);
$this->edebug(
"$notice Error #$errno: $errmsg [$errfile line $errline... | php | protected function errorHandler($errno, $errmsg, $errfile = '', $errline = 0)
{
$notice = 'Connection failed.';
$this->setError(
$notice,
$errmsg,
(string) $errno
);
$this->edebug(
"$notice Error #$errno: $errmsg [$errfile line $errline... | [
"protected",
"function",
"errorHandler",
"(",
"$",
"errno",
",",
"$",
"errmsg",
",",
"$",
"errfile",
"=",
"''",
",",
"$",
"errline",
"=",
"0",
")",
"{",
"$",
"notice",
"=",
"'Connection failed.'",
";",
"$",
"this",
"->",
"setError",
"(",
"$",
"notice",... | Reports an error number and string.
@param int $errno The error number returned by PHP
@param string $errmsg The error message returned by PHP
@param string $errfile The file the error occurred in
@param int $errline The line number the error occurred on | [
"Reports",
"an",
"error",
"number",
"and",
"string",
"."
] | 3d7132341659a8a201adbc3ba11b1e202ee2857c | https://github.com/PHPMailer/PHPMailer/blob/3d7132341659a8a201adbc3ba11b1e202ee2857c/src/SMTP.php#L1292-L1304 | train | Set error message and debug | [
30522,
5123,
3853,
7561,
11774,
3917,
1006,
1002,
9413,
19139,
1010,
1002,
9413,
10867,
28745,
1010,
1002,
9413,
12881,
9463,
1027,
1005,
1005,
1010,
1002,
9413,
19403,
2063,
1027,
1014,
1007,
1063,
1002,
5060,
1027,
1005,
4434,
3478,
1012,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.