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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
symfony/symfony | src/Symfony/Component/Serializer/Normalizer/DateIntervalNormalizer.php | DateIntervalNormalizer.normalize | public function normalize($object, $format = null, array $context = [])
{
if (!$object instanceof \DateInterval) {
throw new InvalidArgumentException('The object must be an instance of "\DateInterval".');
}
return $object->format($context[self::FORMAT_KEY] ?? $this->defaultConte... | php | public function normalize($object, $format = null, array $context = [])
{
if (!$object instanceof \DateInterval) {
throw new InvalidArgumentException('The object must be an instance of "\DateInterval".');
}
return $object->format($context[self::FORMAT_KEY] ?? $this->defaultConte... | [
"public",
"function",
"normalize",
"(",
"$",
"object",
",",
"$",
"format",
"=",
"null",
",",
"array",
"$",
"context",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"$",
"object",
"instanceof",
"\\",
"DateInterval",
")",
"{",
"throw",
"new",
"InvalidArgument... | {@inheritdoc}
@throws InvalidArgumentException | [
"{",
"@inheritdoc",
"}"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Serializer/Normalizer/DateIntervalNormalizer.php#L50-L57 | train | Normalize the object to a date interval | [
30522,
2270,
3853,
3671,
4697,
1006,
1002,
4874,
1010,
1002,
4289,
1027,
19701,
1010,
9140,
1002,
6123,
1027,
1031,
1033,
1007,
1063,
2065,
1006,
999,
1002,
4874,
6013,
11253,
1032,
3058,
18447,
2121,
10175,
1007,
1063,
5466,
2047,
19528,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Foundation/Console/StorageLinkCommand.php | StorageLinkCommand.handle | public function handle()
{
if (file_exists(public_path('storage'))) {
return $this->error('The "public/storage" directory already exists.');
}
$this->laravel->make('files')->link(
storage_path('app/public'), public_path('storage')
);
$this->info('The... | php | public function handle()
{
if (file_exists(public_path('storage'))) {
return $this->error('The "public/storage" directory already exists.');
}
$this->laravel->make('files')->link(
storage_path('app/public'), public_path('storage')
);
$this->info('The... | [
"public",
"function",
"handle",
"(",
")",
"{",
"if",
"(",
"file_exists",
"(",
"public_path",
"(",
"'storage'",
")",
")",
")",
"{",
"return",
"$",
"this",
"->",
"error",
"(",
"'The \"public/storage\" directory already exists.'",
")",
";",
"}",
"$",
"this",
"-... | Execute the console command.
@return void | [
"Execute",
"the",
"console",
"command",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Foundation/Console/StorageLinkCommand.php#L28-L39 | train | Link the public directory to the storage directory | [
30522,
2270,
3853,
5047,
1006,
1007,
1063,
2065,
1006,
5371,
1035,
6526,
1006,
2270,
1035,
4130,
1006,
1005,
5527,
1005,
1007,
1007,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
7561,
1006,
1005,
1996,
1000,
2270,
1013,
5527,
1000,
14176,
25... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/DBStats/MySQLMetadataProvider.php | MySQLMetadataProvider.getEstimatedRowsSize | public function getEstimatedRowsSize($row_count, $status)
{
if ($status['Rows'] == 0) {
return 0;
}
$avgRowSize = ($status['Data_length'] + $status['Index_length']) / $status['Rows'];
return $avgRowSize * $row_count;
} | php | public function getEstimatedRowsSize($row_count, $status)
{
if ($status['Rows'] == 0) {
return 0;
}
$avgRowSize = ($status['Data_length'] + $status['Index_length']) / $status['Rows'];
return $avgRowSize * $row_count;
} | [
"public",
"function",
"getEstimatedRowsSize",
"(",
"$",
"row_count",
",",
"$",
"status",
")",
"{",
"if",
"(",
"$",
"status",
"[",
"'Rows'",
"]",
"==",
"0",
")",
"{",
"return",
"0",
";",
"}",
"$",
"avgRowSize",
"=",
"(",
"$",
"status",
"[",
"'Data_len... | Gets the estimated database size a count of rows takes in a table. | [
"Gets",
"the",
"estimated",
"database",
"size",
"a",
"count",
"of",
"rows",
"takes",
"in",
"a",
"table",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/DBStats/MySQLMetadataProvider.php#L237-L244 | train | Returns the estimated rows size | [
30522,
2270,
3853,
2131,
4355,
20592,
10524,
18719,
4371,
1006,
1002,
5216,
1035,
4175,
1010,
1002,
3570,
1007,
1063,
2065,
1006,
1002,
3570,
1031,
1005,
10281,
1005,
1033,
1027,
1027,
1014,
1007,
1063,
2709,
1014,
1025,
1065,
1002,
20704,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/RouteCompiler.php | RouteCompiler.getOptionalParameters | protected function getOptionalParameters()
{
preg_match_all('/\{(\w+?)\?\}/', $this->route->uri(), $matches);
return isset($matches[1]) ? array_fill_keys($matches[1], null) : [];
} | php | protected function getOptionalParameters()
{
preg_match_all('/\{(\w+?)\?\}/', $this->route->uri(), $matches);
return isset($matches[1]) ? array_fill_keys($matches[1], null) : [];
} | [
"protected",
"function",
"getOptionalParameters",
"(",
")",
"{",
"preg_match_all",
"(",
"'/\\{(\\w+?)\\?\\}/'",
",",
"$",
"this",
"->",
"route",
"->",
"uri",
"(",
")",
",",
"$",
"matches",
")",
";",
"return",
"isset",
"(",
"$",
"matches",
"[",
"1",
"]",
... | Get the optional parameters for the route.
@return array | [
"Get",
"the",
"optional",
"parameters",
"for",
"the",
"route",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/RouteCompiler.php#L48-L53 | train | Get optional parameters from the route | [
30522,
5123,
3853,
2131,
7361,
3508,
2389,
28689,
22828,
2015,
1006,
1007,
1063,
3653,
2290,
1035,
2674,
1035,
2035,
1006,
1005,
1013,
1032,
1063,
1006,
1032,
1059,
1009,
1029,
1007,
1032,
1029,
1032,
1065,
1013,
1005,
1010,
1002,
2023,
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/Bus/Queueable.php | Queueable.chain | public function chain($chain)
{
$this->chained = collect($chain)->map(function ($job) {
return serialize($job);
})->all();
return $this;
} | php | public function chain($chain)
{
$this->chained = collect($chain)->map(function ($job) {
return serialize($job);
})->all();
return $this;
} | [
"public",
"function",
"chain",
"(",
"$",
"chain",
")",
"{",
"$",
"this",
"->",
"chained",
"=",
"collect",
"(",
"$",
"chain",
")",
"->",
"map",
"(",
"function",
"(",
"$",
"job",
")",
"{",
"return",
"serialize",
"(",
"$",
"job",
")",
";",
"}",
")",... | Set the jobs that should run if this job is successful.
@param array $chain
@return $this | [
"Set",
"the",
"jobs",
"that",
"should",
"run",
"if",
"this",
"job",
"is",
"successful",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Bus/Queueable.php#L122-L129 | train | Set chained jobs | [
30522,
2270,
3853,
4677,
1006,
1002,
4677,
1007,
1063,
1002,
2023,
1011,
1028,
22075,
1027,
8145,
1006,
1002,
4677,
1007,
1011,
1028,
4949,
1006,
3853,
1006,
1002,
3105,
1007,
1063,
2709,
7642,
4697,
1006,
1002,
3105,
1007,
1025,
1065,
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... |
octobercms/october | modules/backend/behaviors/ImportExportController.php | ImportExportController.prepareExportVars | public function prepareExportVars()
{
$this->vars['exportFormatFormWidget'] = $this->exportFormatFormWidget;
$this->vars['exportOptionsFormWidget'] = $this->exportOptionsFormWidget;
$this->vars['exportColumns'] = $this->getExportColumns();
// Make these variables available to widget... | php | public function prepareExportVars()
{
$this->vars['exportFormatFormWidget'] = $this->exportFormatFormWidget;
$this->vars['exportOptionsFormWidget'] = $this->exportOptionsFormWidget;
$this->vars['exportColumns'] = $this->getExportColumns();
// Make these variables available to widget... | [
"public",
"function",
"prepareExportVars",
"(",
")",
"{",
"$",
"this",
"->",
"vars",
"[",
"'exportFormatFormWidget'",
"]",
"=",
"$",
"this",
"->",
"exportFormatFormWidget",
";",
"$",
"this",
"->",
"vars",
"[",
"'exportOptionsFormWidget'",
"]",
"=",
"$",
"this"... | Prepares the view data.
@return void | [
"Prepares",
"the",
"view",
"data",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/behaviors/ImportExportController.php#L471-L479 | train | Prepare export variables | [
30522,
2270,
3853,
7374,
10288,
6442,
10755,
2015,
1006,
1007,
1063,
1002,
2023,
1011,
1028,
13075,
2015,
1031,
1005,
9167,
14192,
4017,
14192,
9148,
24291,
1005,
1033,
1027,
1002,
2023,
1011,
1028,
9167,
14192,
4017,
14192,
9148,
24291,
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... |
walkor/Workerman | Worker.php | Worker.installSignal | protected static function installSignal()
{
if (static::$_OS !== OS_TYPE_LINUX) {
return;
}
// stop
pcntl_signal(SIGINT, array('\Workerman\Worker', 'signalHandler'), false);
// graceful stop
pcntl_signal(SIGTERM, array('\Workerman\Worker', 'signalHandler')... | php | protected static function installSignal()
{
if (static::$_OS !== OS_TYPE_LINUX) {
return;
}
// stop
pcntl_signal(SIGINT, array('\Workerman\Worker', 'signalHandler'), false);
// graceful stop
pcntl_signal(SIGTERM, array('\Workerman\Worker', 'signalHandler')... | [
"protected",
"static",
"function",
"installSignal",
"(",
")",
"{",
"if",
"(",
"static",
"::",
"$",
"_OS",
"!==",
"OS_TYPE_LINUX",
")",
"{",
"return",
";",
"}",
"// stop",
"pcntl_signal",
"(",
"SIGINT",
",",
"array",
"(",
"'\\Workerman\\Worker'",
",",
"'signa... | Install signal handler.
@return void | [
"Install",
"signal",
"handler",
"."
] | 13649907f05014fcfffcfccaef01e63ad3339351 | https://github.com/walkor/Workerman/blob/13649907f05014fcfffcfccaef01e63ad3339351/Worker.php#L1052-L1071 | train | Installs signal handlers | [
30522,
30524,
1006,
10763,
1024,
1024,
1002,
1035,
9808,
999,
1027,
1027,
9808,
1035,
2828,
1035,
11603,
1007,
1063,
2709,
1025,
1065,
1013,
1013,
2644,
7473,
3372,
2140,
1035,
4742,
1006,
9033,
11528,
2102,
1010,
9140,
1006,
1005,
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... |
laravel/framework | src/Illuminate/Database/Connectors/PostgresConnector.php | PostgresConnector.configureTimezone | protected function configureTimezone($connection, array $config)
{
if (isset($config['timezone'])) {
$timezone = $config['timezone'];
$connection->prepare("set time zone '{$timezone}'")->execute();
}
} | php | protected function configureTimezone($connection, array $config)
{
if (isset($config['timezone'])) {
$timezone = $config['timezone'];
$connection->prepare("set time zone '{$timezone}'")->execute();
}
} | [
"protected",
"function",
"configureTimezone",
"(",
"$",
"connection",
",",
"array",
"$",
"config",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"config",
"[",
"'timezone'",
"]",
")",
")",
"{",
"$",
"timezone",
"=",
"$",
"config",
"[",
"'timezone'",
"]",
";"... | Set the timezone on the connection.
@param \PDO $connection
@param array $config
@return void | [
"Set",
"the",
"timezone",
"on",
"the",
"connection",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Connectors/PostgresConnector.php#L76-L83 | train | Configure timezone if it is set | [
30522,
5123,
3853,
9530,
8873,
27390,
20624,
4168,
15975,
1006,
1002,
4434,
1010,
9140,
1002,
9530,
8873,
2290,
1007,
1063,
2065,
1006,
26354,
3388,
1006,
1002,
9530,
8873,
2290,
1031,
1005,
2051,
15975,
1005,
1033,
1007,
1007,
1063,
1002,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Common/Uri.php | Uri.getContentType | public function getContentType($short = true)
{
if (isset($_SERVER['CONTENT_TYPE'])) {
$content_type = $_SERVER['CONTENT_TYPE'];
if ($short) {
return Utils::substrToString($content_type,';');
}
return $content_type;
}
return nul... | php | public function getContentType($short = true)
{
if (isset($_SERVER['CONTENT_TYPE'])) {
$content_type = $_SERVER['CONTENT_TYPE'];
if ($short) {
return Utils::substrToString($content_type,';');
}
return $content_type;
}
return nul... | [
"public",
"function",
"getContentType",
"(",
"$",
"short",
"=",
"true",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"_SERVER",
"[",
"'CONTENT_TYPE'",
"]",
")",
")",
"{",
"$",
"content_type",
"=",
"$",
"_SERVER",
"[",
"'CONTENT_TYPE'",
"]",
";",
"if",
"(",
... | Get content type from request
@param bool $short
@return null|string | [
"Get",
"content",
"type",
"from",
"request"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Uri.php#L1328-L1338 | train | Get content type | [
30522,
2270,
3853,
2131,
8663,
6528,
15353,
5051,
1006,
1002,
2460,
1027,
2995,
1007,
1063,
2065,
1006,
26354,
3388,
1006,
1002,
1035,
8241,
1031,
1005,
4180,
1035,
2828,
1005,
1033,
1007,
1007,
1063,
1002,
4180,
1035,
2828,
1027,
1002,
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... |
dompdf/dompdf | src/FrameReflower/AbstractFrameReflower.php | AbstractFrameReflower._parse_string | protected function _parse_string($string, $single_trim = false)
{
if ($single_trim) {
$string = preg_replace('/^[\"\']/', "", $string);
$string = preg_replace('/[\"\']$/', "", $string);
} else {
$string = trim($string, "'\"");
}
$string = str_repl... | php | protected function _parse_string($string, $single_trim = false)
{
if ($single_trim) {
$string = preg_replace('/^[\"\']/', "", $string);
$string = preg_replace('/[\"\']$/', "", $string);
} else {
$string = trim($string, "'\"");
}
$string = str_repl... | [
"protected",
"function",
"_parse_string",
"(",
"$",
"string",
",",
"$",
"single_trim",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"single_trim",
")",
"{",
"$",
"string",
"=",
"preg_replace",
"(",
"'/^[\\\"\\']/'",
",",
"\"\"",
",",
"$",
"string",
")",
";",
... | Parses a CSS string containing quotes and escaped hex characters
@param $string string The CSS string to parse
@param $single_trim
@return string | [
"Parses",
"a",
"CSS",
"string",
"containing",
"quotes",
"and",
"escaped",
"hex",
"characters"
] | 75f13c700009be21a1965dc2c5b68a8708c22ba2 | https://github.com/dompdf/dompdf/blob/75f13c700009be21a1965dc2c5b68a8708c22ba2/src/FrameReflower/AbstractFrameReflower.php#L300-L317 | train | Parse string to ascii characters | [
30522,
5123,
3853,
1035,
11968,
3366,
1035,
5164,
1006,
1002,
5164,
1010,
1002,
2309,
1035,
12241,
1027,
6270,
1007,
1063,
2065,
1006,
1002,
2309,
1035,
12241,
1007,
1063,
1002,
5164,
1027,
3653,
2290,
1035,
5672,
1006,
1005,
1013,
1034,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.putCacheIndex | protected function putCacheIndex($cacheKey)
{
$index = [];
if (Cache::has('combiner.index')) {
$index = (array) @unserialize(@base64_decode(Cache::get('combiner.index'))) ?: [];
}
if (in_array($cacheKey, $index)) {
return false;
}
$index[] =... | php | protected function putCacheIndex($cacheKey)
{
$index = [];
if (Cache::has('combiner.index')) {
$index = (array) @unserialize(@base64_decode(Cache::get('combiner.index'))) ?: [];
}
if (in_array($cacheKey, $index)) {
return false;
}
$index[] =... | [
"protected",
"function",
"putCacheIndex",
"(",
"$",
"cacheKey",
")",
"{",
"$",
"index",
"=",
"[",
"]",
";",
"if",
"(",
"Cache",
"::",
"has",
"(",
"'combiner.index'",
")",
")",
"{",
"$",
"index",
"=",
"(",
"array",
")",
"@",
"unserialize",
"(",
"@",
... | Adds a cache identifier to the index store used for
performing a reset of the cache.
@param string $cacheKey Cache identifier
@return bool Returns false if identifier is already in store | [
"Adds",
"a",
"cache",
"identifier",
"to",
"the",
"index",
"store",
"used",
"for",
"performing",
"a",
"reset",
"of",
"the",
"cache",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/CombineAssets.php#L842-L859 | train | Put cache index | [
30522,
5123,
3853,
2404,
3540,
5403,
22254,
10288,
1006,
1002,
17053,
14839,
1007,
1063,
1002,
5950,
1027,
1031,
1033,
1025,
2065,
1006,
17053,
1024,
1024,
2038,
1006,
1005,
11506,
2099,
1012,
5950,
1005,
1007,
1007,
1063,
1002,
5950,
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... |
octobercms/october | modules/system/models/MailSetting.php | MailSetting.initSettingsData | public function initSettingsData()
{
$config = App::make('config');
$this->send_mode = $config->get('mail.driver', static::MODE_MAIL);
$this->sender_name = $config->get('mail.from.name', 'Your Site');
$this->sender_email = $config->get('mail.from.address', 'admin@domain.tld');
... | php | public function initSettingsData()
{
$config = App::make('config');
$this->send_mode = $config->get('mail.driver', static::MODE_MAIL);
$this->sender_name = $config->get('mail.from.name', 'Your Site');
$this->sender_email = $config->get('mail.from.address', 'admin@domain.tld');
... | [
"public",
"function",
"initSettingsData",
"(",
")",
"{",
"$",
"config",
"=",
"App",
"::",
"make",
"(",
"'config'",
")",
";",
"$",
"this",
"->",
"send_mode",
"=",
"$",
"config",
"->",
"get",
"(",
"'mail.driver'",
",",
"static",
"::",
"MODE_MAIL",
")",
"... | Initialize the seed data for this model. This only executes when the
model is first created or reset to default.
@return void | [
"Initialize",
"the",
"seed",
"data",
"for",
"this",
"model",
".",
"This",
"only",
"executes",
"when",
"the",
"model",
"is",
"first",
"created",
"or",
"reset",
"to",
"default",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/models/MailSetting.php#L54-L67 | train | Initialize settings data | [
30522,
2270,
3853,
1999,
12762,
18319,
3070,
16150,
6790,
1006,
1007,
1063,
1002,
9530,
8873,
2290,
1027,
10439,
1024,
1024,
2191,
1006,
1005,
9530,
8873,
2290,
1005,
1007,
1025,
1002,
2023,
1011,
1028,
4604,
1035,
5549,
1027,
1002,
9530,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Protocol/Smtp.php | Zend_Mail_Protocol_Smtp.rcpt | public function rcpt($to)
{
if ($this->_mail !== true) {
/**
* @see Zend_Mail_Protocol_Exception
*/
// require_once 'Zend/Mail/Protocol/Exception.php';
throw new Zend_Mail_Protocol_Exception('No sender reverse path has been supplied');
}
... | php | public function rcpt($to)
{
if ($this->_mail !== true) {
/**
* @see Zend_Mail_Protocol_Exception
*/
// require_once 'Zend/Mail/Protocol/Exception.php';
throw new Zend_Mail_Protocol_Exception('No sender reverse path has been supplied');
}
... | [
"public",
"function",
"rcpt",
"(",
"$",
"to",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_mail",
"!==",
"true",
")",
"{",
"/**\n * @see Zend_Mail_Protocol_Exception\n */",
"// require_once 'Zend/Mail/Protocol/Exception.php';",
"throw",
"new",
"Zend_M... | Issues RCPT command
@param string $to Receiver(s) mailbox
@throws Zend_Mail_Protocol_Exception
@return void | [
"Issues",
"RCPT",
"command"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail/Protocol/Smtp.php#L277-L291 | train | Perform RCPT to a given address | [
30522,
2270,
3853,
22110,
13876,
1006,
1002,
2000,
1007,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
1035,
5653,
999,
1027,
1027,
2995,
1007,
1063,
1013,
1008,
1008,
1008,
1030,
2156,
16729,
2094,
1035,
5653,
1035,
8778,
1035,
6453,
1008,
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/Archive/DataCollection.php | DataCollection.createOrderedIndex | private function createOrderedIndex($metadataNamesToIndexBy)
{
$result = array();
if (!empty($metadataNamesToIndexBy)) {
$metadataName = array_shift($metadataNamesToIndexBy);
if ($metadataName == DataTableFactory::TABLE_METADATA_SITE_INDEX) {
$indexKeyValues... | php | private function createOrderedIndex($metadataNamesToIndexBy)
{
$result = array();
if (!empty($metadataNamesToIndexBy)) {
$metadataName = array_shift($metadataNamesToIndexBy);
if ($metadataName == DataTableFactory::TABLE_METADATA_SITE_INDEX) {
$indexKeyValues... | [
"private",
"function",
"createOrderedIndex",
"(",
"$",
"metadataNamesToIndexBy",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"metadataNamesToIndexBy",
")",
")",
"{",
"$",
"metadataName",
"=",
"array_shift",
"(",
... | Creates an empty index using a list of metadata names. If the 'site' and/or
'period' metadata names are supplied, empty rows are added for every site/period
that was queried for.
Using this function ensures consistent ordering in the indexed result.
@param array $metadataNamesToIndexBy List of metadata names to index... | [
"Creates",
"an",
"empty",
"index",
"using",
"a",
"list",
"of",
"metadata",
"names",
".",
"If",
"the",
"site",
"and",
"/",
"or",
"period",
"metadata",
"names",
"are",
"supplied",
"empty",
"rows",
"are",
"added",
"for",
"every",
"site",
"/",
"period",
"tha... | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Archive/DataCollection.php#L325-L348 | train | Create Ordered Index | [
30522,
2797,
3853,
3443,
8551,
6850,
22254,
10288,
1006,
1002,
27425,
18442,
16033,
22254,
10288,
3762,
1007,
1063,
1002,
2765,
1027,
9140,
1006,
1007,
1025,
2065,
1006,
999,
4064,
1006,
1002,
27425,
18442,
16033,
22254,
10288,
3762,
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/Lock/Store/RedisStore.php | RedisStore.putOffExpiration | public function putOffExpiration(Key $key, $ttl)
{
$script = '
if redis.call("GET", KEYS[1]) == ARGV[1] then
return redis.call("PEXPIRE", KEYS[1], ARGV[2])
else
return 0
end
';
$key->reduceLifetime($ttl);
if (!$this... | php | public function putOffExpiration(Key $key, $ttl)
{
$script = '
if redis.call("GET", KEYS[1]) == ARGV[1] then
return redis.call("PEXPIRE", KEYS[1], ARGV[2])
else
return 0
end
';
$key->reduceLifetime($ttl);
if (!$this... | [
"public",
"function",
"putOffExpiration",
"(",
"Key",
"$",
"key",
",",
"$",
"ttl",
")",
"{",
"$",
"script",
"=",
"'\n if redis.call(\"GET\", KEYS[1]) == ARGV[1] then\n return redis.call(\"PEXPIRE\", KEYS[1], ARGV[2])\n else\n return 0... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Lock/Store/RedisStore.php#L83-L101 | train | Puts off the expiration of a lock | [
30522,
2270,
3853,
2404,
7245,
10288,
16781,
1006,
3145,
1002,
3145,
1010,
1002,
23746,
2140,
1007,
1063,
1002,
5896,
1027,
1005,
2065,
2417,
2483,
1012,
2655,
1006,
1000,
2131,
1000,
1010,
6309,
1031,
1015,
1033,
1007,
1027,
1027,
12098,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Validation/Concerns/ValidatesAttributes.php | ValidatesAttributes.failsBasicDimensionChecks | protected function failsBasicDimensionChecks($parameters, $width, $height)
{
return (isset($parameters['width']) && $parameters['width'] != $width) ||
(isset($parameters['min_width']) && $parameters['min_width'] > $width) ||
(isset($parameters['max_width']) && $parameters['max_... | php | protected function failsBasicDimensionChecks($parameters, $width, $height)
{
return (isset($parameters['width']) && $parameters['width'] != $width) ||
(isset($parameters['min_width']) && $parameters['min_width'] > $width) ||
(isset($parameters['max_width']) && $parameters['max_... | [
"protected",
"function",
"failsBasicDimensionChecks",
"(",
"$",
"parameters",
",",
"$",
"width",
",",
"$",
"height",
")",
"{",
"return",
"(",
"isset",
"(",
"$",
"parameters",
"[",
"'width'",
"]",
")",
"&&",
"$",
"parameters",
"[",
"'width'",
"]",
"!=",
"... | Test if the given width and height fail any conditions.
@param array $parameters
@param int $width
@param int $height
@return bool | [
"Test",
"if",
"the",
"given",
"width",
"and",
"height",
"fail",
"any",
"conditions",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Validation/Concerns/ValidatesAttributes.php#L528-L536 | train | Checks if the parameters array doesn t contain basic dimension constraints | [
30522,
5123,
3853,
11896,
22083,
2594,
22172,
6132,
3258,
5403,
10603,
1006,
1002,
11709,
1010,
1002,
9381,
1010,
1002,
4578,
1007,
1063,
2709,
1006,
26354,
3388,
1006,
1002,
11709,
1031,
1005,
9381,
1005,
1033,
1007,
1004,
1004,
1002,
1170... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
walkor/Workerman | WebServer.php | WebServer.initMimeTypeMap | public function initMimeTypeMap()
{
$mime_file = Http::getMimeTypesFile();
if (!is_file($mime_file)) {
$this->log("$mime_file mime.type file not fond");
return;
}
$items = file($mime_file, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
if (!is_array($... | php | public function initMimeTypeMap()
{
$mime_file = Http::getMimeTypesFile();
if (!is_file($mime_file)) {
$this->log("$mime_file mime.type file not fond");
return;
}
$items = file($mime_file, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
if (!is_array($... | [
"public",
"function",
"initMimeTypeMap",
"(",
")",
"{",
"$",
"mime_file",
"=",
"Http",
"::",
"getMimeTypesFile",
"(",
")",
";",
"if",
"(",
"!",
"is_file",
"(",
"$",
"mime_file",
")",
")",
"{",
"$",
"this",
"->",
"log",
"(",
"\"$mime_file mime.type file not... | Init mime map.
@return void | [
"Init",
"mime",
"map",
"."
] | 13649907f05014fcfffcfccaef01e63ad3339351 | https://github.com/walkor/Workerman/blob/13649907f05014fcfffcfccaef01e63ad3339351/WebServer.php#L121-L143 | train | initMimeTypeMap - init mime types map | [
30522,
2270,
3853,
1999,
4183,
4328,
11368,
18863,
2863,
2361,
1006,
1007,
1063,
1002,
2771,
4168,
1035,
5371,
1027,
8299,
1024,
1024,
2131,
4328,
11368,
18863,
22747,
9463,
1006,
1007,
1025,
2065,
1006,
999,
2003,
1035,
5371,
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... |
z-song/laravel-admin | src/Controllers/AuthController.php | AuthController.redirectPath | protected function redirectPath()
{
if (method_exists($this, 'redirectTo')) {
return $this->redirectTo();
}
return property_exists($this, 'redirectTo') ? $this->redirectTo : config('admin.route.prefix');
} | php | protected function redirectPath()
{
if (method_exists($this, 'redirectTo')) {
return $this->redirectTo();
}
return property_exists($this, 'redirectTo') ? $this->redirectTo : config('admin.route.prefix');
} | [
"protected",
"function",
"redirectPath",
"(",
")",
"{",
"if",
"(",
"method_exists",
"(",
"$",
"this",
",",
"'redirectTo'",
")",
")",
"{",
"return",
"$",
"this",
"->",
"redirectTo",
"(",
")",
";",
"}",
"return",
"property_exists",
"(",
"$",
"this",
",",
... | Get the post login redirect path.
@return string | [
"Get",
"the",
"post",
"login",
"redirect",
"path",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Controllers/AuthController.php#L173-L180 | train | Get redirect path | [
30522,
5123,
3853,
2417,
7442,
6593,
15069,
1006,
1007,
1063,
2065,
1006,
4118,
1035,
6526,
1006,
1002,
2023,
1010,
1005,
2417,
7442,
6593,
3406,
1005,
1007,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
2417,
7442,
6593,
3406,
1006,
1007,
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/Bridge/Twig/Extension/CodeExtension.php | CodeExtension.getFilters | public function getFilters()
{
return [
new TwigFilter('abbr_class', [$this, 'abbrClass'], ['is_safe' => ['html']]),
new TwigFilter('abbr_method', [$this, 'abbrMethod'], ['is_safe' => ['html']]),
new TwigFilter('format_args', [$this, 'formatArgs'], ['is_safe' => ['html']]... | php | public function getFilters()
{
return [
new TwigFilter('abbr_class', [$this, 'abbrClass'], ['is_safe' => ['html']]),
new TwigFilter('abbr_method', [$this, 'abbrMethod'], ['is_safe' => ['html']]),
new TwigFilter('format_args', [$this, 'formatArgs'], ['is_safe' => ['html']]... | [
"public",
"function",
"getFilters",
"(",
")",
"{",
"return",
"[",
"new",
"TwigFilter",
"(",
"'abbr_class'",
",",
"[",
"$",
"this",
",",
"'abbrClass'",
"]",
",",
"[",
"'is_safe'",
"=>",
"[",
"'html'",
"]",
"]",
")",
",",
"new",
"TwigFilter",
"(",
"'abbr... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bridge/Twig/Extension/CodeExtension.php#L44-L58 | train | Get the filters | [
30522,
2270,
3853,
2131,
8873,
21928,
2015,
1006,
1007,
1063,
2709,
1031,
2047,
1056,
16279,
8873,
21928,
1006,
1005,
11113,
19892,
1035,
2465,
1005,
1010,
1031,
1002,
2023,
1010,
1005,
11113,
19892,
26266,
1005,
1033,
1010,
1031,
1005,
200... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/widgets/Filter.php | Filter.getOptionsFromArray | protected function getOptionsFromArray($scope, $searchQuery = null)
{
/*
* Load the data
*/
$options = $scope->options;
if (is_scalar($options)) {
$model = $this->scopeModels[$scope->scopeName];
$methodName = $options;
if (!$model->meth... | php | protected function getOptionsFromArray($scope, $searchQuery = null)
{
/*
* Load the data
*/
$options = $scope->options;
if (is_scalar($options)) {
$model = $this->scopeModels[$scope->scopeName];
$methodName = $options;
if (!$model->meth... | [
"protected",
"function",
"getOptionsFromArray",
"(",
"$",
"scope",
",",
"$",
"searchQuery",
"=",
"null",
")",
"{",
"/*\n * Load the data\n */",
"$",
"options",
"=",
"$",
"scope",
"->",
"options",
";",
"if",
"(",
"is_scalar",
"(",
"$",
"options",
... | Look at the defined set of options for scope items, or the model method.
@return array | [
"Look",
"at",
"the",
"defined",
"set",
"of",
"options",
"for",
"scope",
"items",
"or",
"the",
"model",
"method",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/Filter.php#L417-L451 | train | Load the options from the data array | [
30522,
5123,
3853,
2131,
7361,
9285,
19699,
9626,
11335,
2100,
1006,
1002,
9531,
1010,
1002,
3945,
4226,
2854,
1027,
19701,
1007,
1063,
1013,
1008,
1008,
7170,
1996,
2951,
1008,
1013,
1002,
7047,
1027,
1002,
9531,
1011,
1028,
7047,
1025,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Form/Extension/Core/DataMapper/CheckboxListMapper.php | CheckboxListMapper.mapDataToForms | public function mapDataToForms($choices, $checkboxes)
{
if (null === $choices) {
$choices = [];
}
if (!\is_array($choices)) {
throw new UnexpectedTypeException($choices, 'array');
}
foreach ($checkboxes as $checkbox) {
$value = $checkbox-... | php | public function mapDataToForms($choices, $checkboxes)
{
if (null === $choices) {
$choices = [];
}
if (!\is_array($choices)) {
throw new UnexpectedTypeException($choices, 'array');
}
foreach ($checkboxes as $checkbox) {
$value = $checkbox-... | [
"public",
"function",
"mapDataToForms",
"(",
"$",
"choices",
",",
"$",
"checkboxes",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"choices",
")",
"{",
"$",
"choices",
"=",
"[",
"]",
";",
"}",
"if",
"(",
"!",
"\\",
"is_array",
"(",
"$",
"choices",
")",
... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/Extension/Core/DataMapper/CheckboxListMapper.php#L31-L45 | train | Map data to forms | [
30522,
2270,
3853,
4949,
2850,
29336,
11253,
2953,
5244,
1006,
1002,
9804,
1010,
1002,
4638,
8758,
2229,
1007,
1063,
2065,
1006,
19701,
1027,
1027,
1027,
1002,
9804,
1007,
1063,
1002,
9804,
1027,
1031,
1033,
1025,
1065,
2065,
1006,
999,
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... |
dompdf/dompdf | src/Dompdf.php | Dompdf.getPaperSize | public function getPaperSize($paperSize = null)
{
$size = $paperSize !== null ? $paperSize : $this->paperSize;
if (is_array($size)) {
return $size;
} else if (isset(Adapter\CPDF::$PAPER_SIZES[mb_strtolower($size)])) {
return Adapter\CPDF::$PAPER_SIZES[mb_strtolower($s... | php | public function getPaperSize($paperSize = null)
{
$size = $paperSize !== null ? $paperSize : $this->paperSize;
if (is_array($size)) {
return $size;
} else if (isset(Adapter\CPDF::$PAPER_SIZES[mb_strtolower($size)])) {
return Adapter\CPDF::$PAPER_SIZES[mb_strtolower($s... | [
"public",
"function",
"getPaperSize",
"(",
"$",
"paperSize",
"=",
"null",
")",
"{",
"$",
"size",
"=",
"$",
"paperSize",
"!==",
"null",
"?",
"$",
"paperSize",
":",
"$",
"this",
"->",
"paperSize",
";",
"if",
"(",
"is_array",
"(",
"$",
"size",
")",
")",... | Gets the paper size
@param null|string|array $paperSize
@return int[] A four-element integer array | [
"Gets",
"the",
"paper",
"size"
] | 75f13c700009be21a1965dc2c5b68a8708c22ba2 | https://github.com/dompdf/dompdf/blob/75f13c700009be21a1965dc2c5b68a8708c22ba2/src/Dompdf.php#L1055-L1065 | train | Get Paper Size | [
30522,
2270,
3853,
2131,
23298,
5332,
4371,
1006,
1002,
4981,
4697,
1027,
19701,
1007,
1063,
1002,
2946,
1027,
1002,
4981,
4697,
999,
1027,
1027,
19701,
1029,
1002,
4981,
4697,
1024,
1002,
2023,
1011,
1028,
4981,
4697,
1025,
2065,
1006,
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/Bridge/Monolog/Handler/ConsoleHandler.php | ConsoleHandler.getDefaultFormatter | protected function getDefaultFormatter()
{
if (!class_exists(CliDumper::class)) {
return new LineFormatter();
}
if (!$this->output) {
return new ConsoleFormatter($this->consoleFormaterOptions);
}
return new ConsoleFormatter(array_replace([
... | php | protected function getDefaultFormatter()
{
if (!class_exists(CliDumper::class)) {
return new LineFormatter();
}
if (!$this->output) {
return new ConsoleFormatter($this->consoleFormaterOptions);
}
return new ConsoleFormatter(array_replace([
... | [
"protected",
"function",
"getDefaultFormatter",
"(",
")",
"{",
"if",
"(",
"!",
"class_exists",
"(",
"CliDumper",
"::",
"class",
")",
")",
"{",
"return",
"new",
"LineFormatter",
"(",
")",
";",
"}",
"if",
"(",
"!",
"$",
"this",
"->",
"output",
")",
"{",
... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bridge/Monolog/Handler/ConsoleHandler.php#L155-L168 | train | Get the default formatter | [
30522,
5123,
3853,
2131,
3207,
7011,
11314,
14192,
20097,
1006,
1007,
1063,
2065,
1006,
999,
2465,
1035,
6526,
1006,
18856,
3593,
24237,
2121,
1024,
1024,
2465,
1007,
1007,
1063,
2709,
2047,
2240,
14192,
20097,
1006,
1007,
1025,
1065,
2065,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/Site.php | Site.getFor | protected static function getFor($idsite, $field)
{
if (!isset(self::$infoSites[$idsite])) {
$site = API::getInstance()->getSiteFromId($idsite);
self::setSiteFromArray($idsite, $site);
}
return self::$infoSites[$idsite][$field];
} | php | protected static function getFor($idsite, $field)
{
if (!isset(self::$infoSites[$idsite])) {
$site = API::getInstance()->getSiteFromId($idsite);
self::setSiteFromArray($idsite, $site);
}
return self::$infoSites[$idsite][$field];
} | [
"protected",
"static",
"function",
"getFor",
"(",
"$",
"idsite",
",",
"$",
"field",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"infoSites",
"[",
"$",
"idsite",
"]",
")",
")",
"{",
"$",
"site",
"=",
"API",
"::",
"getInstance",
"(",
... | Utility function. Returns the value of the specified field for the
site with the specified ID.
@param int $idsite The ID of the site whose data is being accessed.
@param string $field The name of the field to get.
@return string | [
"Utility",
"function",
".",
"Returns",
"the",
"value",
"of",
"the",
"specified",
"field",
"for",
"the",
"site",
"with",
"the",
"specified",
"ID",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Site.php#L480-L488 | train | Get a single site by ID and field name | [
30522,
5123,
10763,
3853,
2131,
29278,
1006,
1002,
8909,
28032,
2063,
1010,
1002,
2492,
1007,
1063,
2065,
1006,
999,
26354,
3388,
1006,
2969,
1024,
1024,
1002,
18558,
28032,
2229,
1031,
1002,
8909,
28032,
2063,
1033,
1007,
1007,
1063,
1002,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Common/Page/Page.php | Page.doRelocation | protected function doRelocation()
{
if (!$this->_original) {
return;
}
if (is_dir($this->_original->path())) {
if ($this->_action === 'move') {
Folder::move($this->_original->path(), $this->path());
} elseif ($this->_action === 'copy') {
... | php | protected function doRelocation()
{
if (!$this->_original) {
return;
}
if (is_dir($this->_original->path())) {
if ($this->_action === 'move') {
Folder::move($this->_original->path(), $this->path());
} elseif ($this->_action === 'copy') {
... | [
"protected",
"function",
"doRelocation",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_original",
")",
"{",
"return",
";",
"}",
"if",
"(",
"is_dir",
"(",
"$",
"this",
"->",
"_original",
"->",
"path",
"(",
")",
")",
")",
"{",
"if",
"(",
"$",... | Moves or copies the page in filesystem.
@internal
@throws \Exception | [
"Moves",
"or",
"copies",
"the",
"page",
"in",
"filesystem",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Page/Page.php#L3101-L3122 | train | Relocation. Do the actual move copy and rename. | [
30522,
5123,
3853,
2079,
16570,
23909,
1006,
1007,
1063,
2065,
1006,
999,
1002,
2023,
1011,
1028,
1035,
2434,
1007,
1063,
2709,
1025,
1065,
2065,
1006,
2003,
1035,
16101,
1006,
1002,
2023,
1011,
1028,
1035,
2434,
1011,
1028,
4130,
1006,
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/Redirector.php | Redirector.route | public function route($route, $parameters = [], $status = 302, $headers = [])
{
return $this->to($this->generator->route($route, $parameters), $status, $headers);
} | php | public function route($route, $parameters = [], $status = 302, $headers = [])
{
return $this->to($this->generator->route($route, $parameters), $status, $headers);
} | [
"public",
"function",
"route",
"(",
"$",
"route",
",",
"$",
"parameters",
"=",
"[",
"]",
",",
"$",
"status",
"=",
"302",
",",
"$",
"headers",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"to",
"(",
"$",
"this",
"->",
"generator",
"->",
... | Create a new redirect response to a named route.
@param string $route
@param mixed $parameters
@param int $status
@param array $headers
@return \Illuminate\Http\RedirectResponse | [
"Create",
"a",
"new",
"redirect",
"response",
"to",
"a",
"named",
"route",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/Redirector.php#L174-L177 | train | Redirects to a route | [
30522,
2270,
3853,
2799,
1006,
1002,
2799,
1010,
1002,
11709,
1027,
1031,
1033,
1010,
1002,
3570,
1027,
22060,
1010,
1002,
20346,
2015,
1027,
1031,
1033,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
2000,
1006,
1002,
2023,
1011,
1028,
13103,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Form/Extension/Core/Type/CollectionType.php | CollectionType.buildView | public function buildView(FormView $view, FormInterface $form, array $options)
{
$view->vars = array_replace($view->vars, [
'allow_add' => $options['allow_add'],
'allow_delete' => $options['allow_delete'],
]);
if ($form->getConfig()->hasAttribute('prototype')) {
... | php | public function buildView(FormView $view, FormInterface $form, array $options)
{
$view->vars = array_replace($view->vars, [
'allow_add' => $options['allow_add'],
'allow_delete' => $options['allow_delete'],
]);
if ($form->getConfig()->hasAttribute('prototype')) {
... | [
"public",
"function",
"buildView",
"(",
"FormView",
"$",
"view",
",",
"FormInterface",
"$",
"form",
",",
"array",
"$",
"options",
")",
"{",
"$",
"view",
"->",
"vars",
"=",
"array_replace",
"(",
"$",
"view",
"->",
"vars",
",",
"[",
"'allow_add'",
"=>",
... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/Extension/Core/Type/CollectionType.php#L57-L68 | train | Build the view | [
30522,
2270,
3853,
3857,
8584,
1006,
2433,
8584,
1002,
3193,
1010,
2433,
18447,
2121,
12172,
1002,
2433,
1010,
9140,
1002,
7047,
1007,
1063,
1002,
3193,
1011,
1028,
13075,
2015,
1027,
9140,
1035,
5672,
1006,
1002,
3193,
1011,
1028,
13075,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.php | Grid.handleExportRequest | protected function handleExportRequest($forceExport = false)
{
if (!$scope = request(Exporter::$queryName)) {
return;
}
// clear output buffer.
if (ob_get_length()) {
ob_end_clean();
}
$this->model()->usePaginate(false);
if ($this->b... | php | protected function handleExportRequest($forceExport = false)
{
if (!$scope = request(Exporter::$queryName)) {
return;
}
// clear output buffer.
if (ob_get_length()) {
ob_end_clean();
}
$this->model()->usePaginate(false);
if ($this->b... | [
"protected",
"function",
"handleExportRequest",
"(",
"$",
"forceExport",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"$",
"scope",
"=",
"request",
"(",
"Exporter",
"::",
"$",
"queryName",
")",
")",
"{",
"return",
";",
"}",
"// clear output buffer.",
"if",
"(",... | Handle export request.
@param bool $forceExport | [
"Handle",
"export",
"request",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Grid.php#L225-L247 | train | Handle export request | [
30522,
5123,
3853,
5047,
10288,
6442,
2890,
15500,
1006,
1002,
2486,
10288,
6442,
1027,
30524,
1024,
1024,
1002,
23032,
18442,
1007,
1007,
1063,
2709,
1025,
1065,
1013,
1013,
3154,
6434,
17698,
1012,
2065,
1006,
27885,
1035,
2131,
1035,
309... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Controller/ArgumentResolver/NotTaggedControllerValueResolver.php | NotTaggedControllerValueResolver.resolve | public function resolve(Request $request, ArgumentMetadata $argument)
{
if (\is_array($controller = $request->attributes->get('_controller'))) {
$controller = $controller[0].'::'.$controller[1];
}
if ('\\' === $controller[0]) {
$controller = ltrim($controller, '\\');... | php | public function resolve(Request $request, ArgumentMetadata $argument)
{
if (\is_array($controller = $request->attributes->get('_controller'))) {
$controller = $controller[0].'::'.$controller[1];
}
if ('\\' === $controller[0]) {
$controller = ltrim($controller, '\\');... | [
"public",
"function",
"resolve",
"(",
"Request",
"$",
"request",
",",
"ArgumentMetadata",
"$",
"argument",
")",
"{",
"if",
"(",
"\\",
"is_array",
"(",
"$",
"controller",
"=",
"$",
"request",
"->",
"attributes",
"->",
"get",
"(",
"'_controller'",
")",
")",
... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpKernel/Controller/ArgumentResolver/NotTaggedControllerValueResolver.php#L61-L80 | train | Resolve the controller name | [
30522,
2270,
3853,
10663,
1006,
5227,
1002,
5227,
1010,
6685,
11368,
8447,
2696,
1002,
6685,
1007,
1063,
2065,
1006,
1032,
2003,
1035,
9140,
1006,
1002,
11486,
1027,
1002,
5227,
1011,
1028,
12332,
1011,
1028,
2131,
1006,
1005,
1035,
11486,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/AbstractTrait.php | AbstractTrait.hasItem | public function hasItem($key)
{
$id = $this->getId($key);
if (isset($this->deferred[$key])) {
$this->commit();
}
try {
return $this->doHave($id);
} catch (\Exception $e) {
CacheItem::log($this->logger, 'Failed to check if key "{key}" is c... | php | public function hasItem($key)
{
$id = $this->getId($key);
if (isset($this->deferred[$key])) {
$this->commit();
}
try {
return $this->doHave($id);
} catch (\Exception $e) {
CacheItem::log($this->logger, 'Failed to check if key "{key}" is c... | [
"public",
"function",
"hasItem",
"(",
"$",
"key",
")",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"getId",
"(",
"$",
"key",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"deferred",
"[",
"$",
"key",
"]",
")",
")",
"{",
"$",
"this",
"->",... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Cache/Traits/AbstractTrait.php#L86-L101 | train | Has item? | [
30522,
2270,
3853,
2038,
4221,
2213,
1006,
1002,
3145,
1007,
1063,
1002,
8909,
1027,
1002,
2023,
1011,
1028,
2131,
3593,
1006,
1002,
3145,
1007,
1025,
2065,
1006,
26354,
3388,
1006,
1002,
2023,
1011,
1028,
13366,
28849,
2094,
1031,
1002,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/cms/classes/Theme.php | Theme.getConfigArray | public function getConfigArray($name)
{
$result = array_get($this->getConfig(), $name, []);
if (is_string($result)) {
$fileName = File::symbolizePath($result);
if (File::isLocalPath($fileName)) {
$path = $fileName;
}
else {
... | php | public function getConfigArray($name)
{
$result = array_get($this->getConfig(), $name, []);
if (is_string($result)) {
$fileName = File::symbolizePath($result);
if (File::isLocalPath($fileName)) {
$path = $fileName;
}
else {
... | [
"public",
"function",
"getConfigArray",
"(",
"$",
"name",
")",
"{",
"$",
"result",
"=",
"array_get",
"(",
"$",
"this",
"->",
"getConfig",
"(",
")",
",",
"$",
"name",
",",
"[",
"]",
")",
";",
"if",
"(",
"is_string",
"(",
"$",
"result",
")",
")",
"... | Returns an array value from the theme configuration file by its name.
If the value is a string, it is treated as a YAML file and loaded.
@param string $name Specifies the configuration parameter name.
@return array | [
"Returns",
"an",
"array",
"value",
"from",
"the",
"theme",
"configuration",
"file",
"by",
"its",
"name",
".",
"If",
"the",
"value",
"is",
"a",
"string",
"it",
"is",
"treated",
"as",
"a",
"YAML",
"file",
"and",
"loaded",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/Theme.php#L414-L436 | train | Get the array value of a configuration parameter | [
30522,
2270,
3853,
2131,
8663,
8873,
6843,
9447,
1006,
1002,
2171,
1007,
1063,
1002,
2765,
1027,
9140,
1035,
2131,
1006,
1002,
2023,
1011,
1028,
2131,
8663,
8873,
2290,
1006,
1007,
1010,
1002,
2171,
1010,
1031,
1033,
1007,
1025,
2065,
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/Cache/DoctrineProvider.php | DoctrineProvider.doSave | protected function doSave($id, $data, $lifeTime = 0)
{
$item = $this->pool->getItem(rawurlencode($id));
if (0 < $lifeTime) {
$item->expiresAfter($lifeTime);
}
return $this->pool->save($item->set($data));
} | php | protected function doSave($id, $data, $lifeTime = 0)
{
$item = $this->pool->getItem(rawurlencode($id));
if (0 < $lifeTime) {
$item->expiresAfter($lifeTime);
}
return $this->pool->save($item->set($data));
} | [
"protected",
"function",
"doSave",
"(",
"$",
"id",
",",
"$",
"data",
",",
"$",
"lifeTime",
"=",
"0",
")",
"{",
"$",
"item",
"=",
"$",
"this",
"->",
"pool",
"->",
"getItem",
"(",
"rawurlencode",
"(",
"$",
"id",
")",
")",
";",
"if",
"(",
"0",
"<"... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Cache/DoctrineProvider.php#L70-L79 | train | Save a record to the cache | [
30522,
5123,
3853,
9998,
10696,
1006,
1002,
8909,
1010,
1002,
2951,
1010,
1002,
6480,
1027,
1014,
1007,
1063,
1002,
8875,
1027,
1002,
2023,
1011,
1028,
4770,
1011,
1028,
2131,
4221,
2213,
1006,
6315,
3126,
7770,
16044,
1006,
1002,
8909,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Common/Scheduler/Scheduler.php | Scheduler.getQueuedJobs | public function getQueuedJobs($all = false)
{
$background = [];
$foreground = [];
foreach ($this->jobs as $job) {
if ($all || $job->getEnabled()) {
if ($job->runInBackground()) {
$background[] = $job;
} else {
... | php | public function getQueuedJobs($all = false)
{
$background = [];
$foreground = [];
foreach ($this->jobs as $job) {
if ($all || $job->getEnabled()) {
if ($job->runInBackground()) {
$background[] = $job;
} else {
... | [
"public",
"function",
"getQueuedJobs",
"(",
"$",
"all",
"=",
"false",
")",
"{",
"$",
"background",
"=",
"[",
"]",
";",
"$",
"foreground",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"jobs",
"as",
"$",
"job",
")",
"{",
"if",
"(",
"$",
... | Get the queued jobs as background/foreground
@param bool $all
@return array | [
"Get",
"the",
"queued",
"jobs",
"as",
"background",
"/",
"foreground"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Scheduler/Scheduler.php#L89-L104 | train | Get all queued jobs | [
30522,
2270,
3853,
2131,
4226,
5657,
2094,
5558,
5910,
1006,
1002,
2035,
1027,
6270,
1007,
1063,
1002,
4281,
1027,
1031,
1033,
1025,
1002,
18921,
16365,
1027,
1031,
1033,
1025,
18921,
6776,
1006,
1002,
2023,
1011,
1028,
5841,
2004,
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/Routing/ControllerDispatcher.php | ControllerDispatcher.getMiddleware | public function getMiddleware($controller, $method)
{
if (! method_exists($controller, 'getMiddleware')) {
return [];
}
return collect($controller->getMiddleware())->reject(function ($data) use ($method) {
return static::methodExcludedByOptions($method, $data['option... | php | public function getMiddleware($controller, $method)
{
if (! method_exists($controller, 'getMiddleware')) {
return [];
}
return collect($controller->getMiddleware())->reject(function ($data) use ($method) {
return static::methodExcludedByOptions($method, $data['option... | [
"public",
"function",
"getMiddleware",
"(",
"$",
"controller",
",",
"$",
"method",
")",
"{",
"if",
"(",
"!",
"method_exists",
"(",
"$",
"controller",
",",
"'getMiddleware'",
")",
")",
"{",
"return",
"[",
"]",
";",
"}",
"return",
"collect",
"(",
"$",
"c... | Get the middleware for the controller instance.
@param \Illuminate\Routing\Controller $controller
@param string $method
@return array | [
"Get",
"the",
"middleware",
"for",
"the",
"controller",
"instance",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/ControllerDispatcher.php#L58-L67 | train | Get all middleware from the controller | [
30522,
2270,
3853,
2131,
4328,
20338,
8059,
1006,
1002,
11486,
1010,
1002,
4118,
1007,
1063,
2065,
1006,
999,
4118,
1035,
6526,
1006,
1002,
11486,
1010,
1005,
2131,
4328,
20338,
8059,
1005,
1007,
1007,
1063,
2709,
1031,
1033,
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... |
symfony/symfony | src/Symfony/Component/HttpKernel/HttpCache/ResponseCacheStrategy.php | ResponseCacheStrategy.willMakeFinalResponseUncacheable | private function willMakeFinalResponseUncacheable(Response $response)
{
// RFC2616: A response received with a status code of 200, 203, 300, 301 or 410
// MAY be stored by a cache […] unless a cache-control directive prohibits caching.
if ($response->headers->hasCacheControlDirective('no-cac... | php | private function willMakeFinalResponseUncacheable(Response $response)
{
// RFC2616: A response received with a status code of 200, 203, 300, 301 or 410
// MAY be stored by a cache […] unless a cache-control directive prohibits caching.
if ($response->headers->hasCacheControlDirective('no-cac... | [
"private",
"function",
"willMakeFinalResponseUncacheable",
"(",
"Response",
"$",
"response",
")",
"{",
"// RFC2616: A response received with a status code of 200, 203, 300, 301 or 410",
"// MAY be stored by a cache […] unless a cache-control directive prohibits caching.",
"if",
"(",
"$",
... | RFC2616, Section 13.4.
@see https://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13.4
@return bool | [
"RFC2616",
"Section",
"13",
".",
"4",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpKernel/HttpCache/ResponseCacheStrategy.php#L162-L196 | train | Checks whether the final response is uncacheable | [
30522,
2797,
3853,
2097,
2863,
3489,
16294,
2389,
6072,
26029,
3366,
4609,
3540,
5403,
3085,
1006,
3433,
1002,
3433,
1007,
1063,
1013,
1013,
14645,
23833,
16048,
1024,
1037,
3433,
2363,
2007,
1037,
3570,
3642,
1997,
3263,
1010,
18540,
1010,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/cms/controllers/Index.php | Index.onGetTemplateList | public function onGetTemplateList()
{
$this->validateRequestTheme();
$page = Page::inTheme($this->theme);
return [
'layouts' => $page->getLayoutOptions()
];
} | php | public function onGetTemplateList()
{
$this->validateRequestTheme();
$page = Page::inTheme($this->theme);
return [
'layouts' => $page->getLayoutOptions()
];
} | [
"public",
"function",
"onGetTemplateList",
"(",
")",
"{",
"$",
"this",
"->",
"validateRequestTheme",
"(",
")",
";",
"$",
"page",
"=",
"Page",
"::",
"inTheme",
"(",
"$",
"this",
"->",
"theme",
")",
";",
"return",
"[",
"'layouts'",
"=>",
"$",
"page",
"->... | Returns list of available templates
@return array | [
"Returns",
"list",
"of",
"available",
"templates"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/controllers/Index.php#L354-L362 | train | onGetTemplateList - Returns the layout options | [
30522,
2270,
3853,
2006,
18150,
18532,
15725,
9863,
1006,
1007,
1063,
1002,
2023,
1011,
1028,
9398,
24932,
2063,
15500,
10760,
4168,
1006,
1007,
1025,
1002,
3931,
1027,
3931,
1024,
1024,
20014,
29122,
2063,
1006,
1002,
2023,
1011,
1028,
432... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Twig/TwigExtension.php | TwigExtension.inflectorFilter | public function inflectorFilter($action, $data, $count = null)
{
$action .= 'ize';
$inflector = $this->grav['inflector'];
if (\in_array(
$action,
['titleize', 'camelize', 'underscorize', 'hyphenize', 'humanize', 'ordinalize', 'monthize'],
true
))... | php | public function inflectorFilter($action, $data, $count = null)
{
$action .= 'ize';
$inflector = $this->grav['inflector'];
if (\in_array(
$action,
['titleize', 'camelize', 'underscorize', 'hyphenize', 'humanize', 'ordinalize', 'monthize'],
true
))... | [
"public",
"function",
"inflectorFilter",
"(",
"$",
"action",
",",
"$",
"data",
",",
"$",
"count",
"=",
"null",
")",
"{",
"$",
"action",
".=",
"'ize'",
";",
"$",
"inflector",
"=",
"$",
"this",
"->",
"grav",
"[",
"'inflector'",
"]",
";",
"if",
"(",
"... | Inflector supports following notations:
`{{ 'person'|pluralize }} => people`
`{{ 'shoes'|singularize }} => shoe`
`{{ 'welcome page'|titleize }} => "Welcome Page"`
`{{ 'send_email'|camelize }} => SendEmail`
`{{ 'CamelCased'|underscorize }} => camel_cased`
`{{ 'Something Text'|hyphenize }} => something-text`
`{{ 'someth... | [
"Inflector",
"supports",
"following",
"notations",
":"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Twig/TwigExtension.php#L317-L336 | train | Filter inflection data | [
30522,
2270,
3853,
1999,
21031,
16761,
8873,
21928,
1006,
1002,
2895,
1010,
1002,
2951,
1010,
1002,
4175,
1027,
19701,
1007,
1063,
1002,
2895,
1012,
1027,
1005,
1045,
4371,
1005,
1025,
1002,
1999,
21031,
16761,
1027,
1002,
2023,
1011,
1028,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/cms/classes/CmsCompoundObject.php | CmsCompoundObject.__isset | public function __isset($key)
{
if (parent::__isset($key) === true) {
return true;
}
if (isset($this->viewBag[$key]) === true) {
return true;
}
return isset($this->settings[$key]);
} | php | public function __isset($key)
{
if (parent::__isset($key) === true) {
return true;
}
if (isset($this->viewBag[$key]) === true) {
return true;
}
return isset($this->settings[$key]);
} | [
"public",
"function",
"__isset",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"parent",
"::",
"__isset",
"(",
"$",
"key",
")",
"===",
"true",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"viewBag",
"[",
"$",
"key",
... | Determine if an attribute exists on the object.
@param string $key
@return bool | [
"Determine",
"if",
"an",
"attribute",
"exists",
"on",
"the",
"object",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/CmsCompoundObject.php#L464-L475 | train | Has isset. | [
30522,
2270,
3853,
1035,
1035,
26354,
3388,
1006,
1002,
3145,
1007,
1063,
2065,
1006,
6687,
1024,
1024,
1035,
1035,
26354,
3388,
1006,
1002,
3145,
1007,
1027,
1027,
1027,
2995,
1007,
1063,
2709,
2995,
1025,
1065,
2065,
1006,
26354,
3388,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Storage/Writable/Maildir.php | Zend_Mail_Storage_Writable_Maildir.appendMessage | public function appendMessage($message, $folder = null, $flags = null, $recent = false)
{
if ($this->_quota && $this->checkQuota()) {
/**
* @see Zend_Mail_Storage_Exception
*/
// require_once 'Zend/Mail/Storage/Exception.php';
throw new Zend_Mail... | php | public function appendMessage($message, $folder = null, $flags = null, $recent = false)
{
if ($this->_quota && $this->checkQuota()) {
/**
* @see Zend_Mail_Storage_Exception
*/
// require_once 'Zend/Mail/Storage/Exception.php';
throw new Zend_Mail... | [
"public",
"function",
"appendMessage",
"(",
"$",
"message",
",",
"$",
"folder",
"=",
"null",
",",
"$",
"flags",
"=",
"null",
",",
"$",
"recent",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_quota",
"&&",
"$",
"this",
"->",
"checkQuota",
... | not yet * @param string|Zend_Mail_Message|Zend_Mime_Message $message message as string or instance of message class | [
"not",
"yet",
"*"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail/Storage/Writable/Maildir.php#L542-L605 | train | Append a message to the storage | [
30522,
2270,
3853,
10439,
10497,
7834,
3736,
3351,
1006,
1002,
4471,
1010,
1002,
19622,
1027,
19701,
1010,
1002,
9245,
1027,
19701,
1010,
1002,
3522,
1027,
6270,
1007,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
1035,
20563,
1004,
1004,
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... |
barryvdh/laravel-debugbar | src/DataCollector/RouteCollector.php | RouteCollector.displayRoutes | protected function displayRoutes(array $routes)
{
$this->table->setHeaders($this->headers)->setRows($routes);
$this->table->render($this->getOutput());
} | php | protected function displayRoutes(array $routes)
{
$this->table->setHeaders($this->headers)->setRows($routes);
$this->table->render($this->getOutput());
} | [
"protected",
"function",
"displayRoutes",
"(",
"array",
"$",
"routes",
")",
"{",
"$",
"this",
"->",
"table",
"->",
"setHeaders",
"(",
"$",
"this",
"->",
"headers",
")",
"->",
"setRows",
"(",
"$",
"routes",
")",
";",
"$",
"this",
"->",
"table",
"->",
... | Display the route information on the console.
@param array $routes
@return void | [
"Display",
"the",
"route",
"information",
"on",
"the",
"console",
"."
] | 2d195779ea4f809f69764a795e2ec371dbb76a96 | https://github.com/barryvdh/laravel-debugbar/blob/2d195779ea4f809f69764a795e2ec371dbb76a96/src/DataCollector/RouteCollector.php#L135-L140 | train | Displays the routes in the table | [
30522,
5123,
3853,
4653,
22494,
4570,
1006,
9140,
1002,
5847,
1007,
1063,
1002,
2023,
1011,
1028,
2795,
1011,
1028,
6662,
13775,
2545,
1006,
1002,
2023,
1011,
1028,
20346,
2015,
1007,
1011,
1028,
2275,
10524,
2015,
1006,
1002,
5847,
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/Foundation/Console/PolicyMakeCommand.php | PolicyMakeCommand.replaceModel | protected function replaceModel($stub, $model)
{
$model = str_replace('/', '\\', $model);
$namespaceModel = $this->laravel->getNamespace().$model;
if (Str::startsWith($model, '\\')) {
$stub = str_replace('NamespacedDummyModel', trim($model, '\\'), $stub);
} else {
... | php | protected function replaceModel($stub, $model)
{
$model = str_replace('/', '\\', $model);
$namespaceModel = $this->laravel->getNamespace().$model;
if (Str::startsWith($model, '\\')) {
$stub = str_replace('NamespacedDummyModel', trim($model, '\\'), $stub);
} else {
... | [
"protected",
"function",
"replaceModel",
"(",
"$",
"stub",
",",
"$",
"model",
")",
"{",
"$",
"model",
"=",
"str_replace",
"(",
"'/'",
",",
"'\\\\'",
",",
"$",
"model",
")",
";",
"$",
"namespaceModel",
"=",
"$",
"this",
"->",
"laravel",
"->",
"getNamesp... | Replace the model for the given stub.
@param string $stub
@param string $model
@return string | [
"Replace",
"the",
"model",
"for",
"the",
"given",
"stub",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Foundation/Console/PolicyMakeCommand.php#L77-L108 | train | Replace Model stub | [
30522,
5123,
3853,
5672,
5302,
9247,
1006,
1002,
24646,
2497,
1010,
1002,
2944,
1007,
1063,
1002,
2944,
1027,
2358,
2099,
1035,
5672,
1006,
1005,
1013,
1005,
1010,
1005,
1032,
1032,
1005,
1010,
1002,
2944,
1007,
1025,
1002,
3415,
15327,
5... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/HTML/QuickForm2/Container/Group.php | HTML_QuickForm2_Container_Group.render | public function render(HTML_QuickForm2_Renderer $renderer)
{
$renderer->startGroup($this);
foreach ($this as $element) {
$element->render($renderer);
}
$renderer->finishGroup($this);
return $renderer;
} | php | public function render(HTML_QuickForm2_Renderer $renderer)
{
$renderer->startGroup($this);
foreach ($this as $element) {
$element->render($renderer);
}
$renderer->finishGroup($this);
return $renderer;
} | [
"public",
"function",
"render",
"(",
"HTML_QuickForm2_Renderer",
"$",
"renderer",
")",
"{",
"$",
"renderer",
"->",
"startGroup",
"(",
"$",
"this",
")",
";",
"foreach",
"(",
"$",
"this",
"as",
"$",
"element",
")",
"{",
"$",
"element",
"->",
"render",
"(",... | Renders the group using the given renderer
@param HTML_QuickForm2_Renderer Renderer instance
@return HTML_QuickForm2_Renderer | [
"Renders",
"the",
"group",
"using",
"the",
"given",
"renderer"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Container/Group.php#L308-L316 | train | Renders the group | [
30522,
2270,
3853,
17552,
1006,
16129,
1035,
4248,
14192,
2475,
1035,
17552,
2121,
1002,
17552,
2121,
1007,
1063,
1002,
17552,
2121,
1011,
1028,
2707,
17058,
1006,
1002,
2023,
1007,
1025,
18921,
30524,
1007,
1025,
2709,
1002,
17552,
2121,
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/HttpFoundation/Session/Storage/Handler/PdoSessionHandler.php | PdoSessionHandler.getInsertStatement | private function getInsertStatement($sessionId, $sessionData, $maxlifetime)
{
switch ($this->driver) {
case 'oci':
$data = fopen('php://memory', 'r+');
fwrite($data, $sessionData);
rewind($data);
$sql = "INSERT INTO $this->table ($t... | php | private function getInsertStatement($sessionId, $sessionData, $maxlifetime)
{
switch ($this->driver) {
case 'oci':
$data = fopen('php://memory', 'r+');
fwrite($data, $sessionData);
rewind($data);
$sql = "INSERT INTO $this->table ($t... | [
"private",
"function",
"getInsertStatement",
"(",
"$",
"sessionId",
",",
"$",
"sessionData",
",",
"$",
"maxlifetime",
")",
"{",
"switch",
"(",
"$",
"this",
"->",
"driver",
")",
"{",
"case",
"'oci'",
":",
"$",
"data",
"=",
"fopen",
"(",
"'php://memory'",
... | Returns an insert statement supported by the database for writing session data.
@param string $sessionId Session ID
@param string $sessionData Encoded session data
@param int $maxlifetime session.gc_maxlifetime
@return \PDOStatement The insert statement | [
"Returns",
"an",
"insert",
"statement",
"supported",
"by",
"the",
"database",
"for",
"writing",
"session",
"data",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/PdoSessionHandler.php#L784-L806 | train | Get the insert statement for the session | [
30522,
2797,
3853,
2131,
7076,
8743,
9153,
18532,
4765,
1006,
1002,
5219,
3593,
1010,
1002,
5219,
2850,
2696,
1010,
1002,
4098,
15509,
7292,
1007,
1063,
6942,
1006,
1002,
2023,
1011,
1028,
4062,
1007,
1063,
2553,
1005,
1051,
6895,
1005,
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/Mail/Storage/Pop3.php | Zend_Mail_Storage_Pop3.getNumberByUniqueId | public function getNumberByUniqueId($id)
{
if (!$this->hasUniqueid) {
return $id;
}
$ids = $this->getUniqueId();
foreach ($ids as $k => $v) {
if ($v == $id) {
return $k;
}
}
/**
* @see Zend_Mail_Storage_Ex... | php | public function getNumberByUniqueId($id)
{
if (!$this->hasUniqueid) {
return $id;
}
$ids = $this->getUniqueId();
foreach ($ids as $k => $v) {
if ($v == $id) {
return $k;
}
}
/**
* @see Zend_Mail_Storage_Ex... | [
"public",
"function",
"getNumberByUniqueId",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasUniqueid",
")",
"{",
"return",
"$",
"id",
";",
"}",
"$",
"ids",
"=",
"$",
"this",
"->",
"getUniqueId",
"(",
")",
";",
"foreach",
"(",
"$",... | get a message number from a unique id
I.e. if you have a webmailer that supports deleting messages you should use unique ids
as parameter and use this method to translate it to message number right before calling removeMessage()
@param string $id unique id
@return int message number
@throws Zend_Mail_Storage_Exceptio... | [
"get",
"a",
"message",
"number",
"from",
"a",
"unique",
"id"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail/Storage/Pop3.php#L266-L284 | train | Get number by unique id | [
30522,
2270,
3853,
2131,
19172,
5677,
3762,
19496,
4226,
3593,
1006,
1002,
8909,
1007,
1063,
2065,
1006,
999,
1002,
2023,
1011,
1028,
2038,
19496,
4226,
3593,
1007,
1063,
2709,
1002,
8909,
1025,
1065,
1002,
8909,
2015,
30524,
1002,
8909,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php | ChoiceType.buildForm | public function buildForm(FormBuilderInterface $builder, array $options)
{
$choiceList = $this->createChoiceList($options);
$builder->setAttribute('choice_list', $choiceList);
if ($options['expanded']) {
$builder->setDataMapper($options['multiple'] ? new CheckboxListMapper() : n... | php | public function buildForm(FormBuilderInterface $builder, array $options)
{
$choiceList = $this->createChoiceList($options);
$builder->setAttribute('choice_list', $choiceList);
if ($options['expanded']) {
$builder->setDataMapper($options['multiple'] ? new CheckboxListMapper() : n... | [
"public",
"function",
"buildForm",
"(",
"FormBuilderInterface",
"$",
"builder",
",",
"array",
"$",
"options",
")",
"{",
"$",
"choiceList",
"=",
"$",
"this",
"->",
"createChoiceList",
"(",
"$",
"options",
")",
";",
"$",
"builder",
"->",
"setAttribute",
"(",
... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php#L53-L167 | train | Build the form from the options | [
30522,
2270,
3853,
3857,
14192,
1006,
2433,
8569,
23891,
6657,
3334,
12172,
1002,
12508,
1010,
9140,
1002,
7047,
1007,
1063,
1002,
3601,
9863,
1027,
1002,
2023,
1011,
1028,
3443,
9905,
6610,
9863,
1006,
1002,
7047,
1007,
1025,
1002,
12508,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Common/Uri.php | Uri.port | public function port($raw = false)
{
$port = $this->port;
// If not in raw mode and port is not set, figure it out from scheme.
if (!$raw && $port === null) {
if ($this->scheme === 'http') {
$this->port = 80;
} elseif ($this->scheme === 'https') {
... | php | public function port($raw = false)
{
$port = $this->port;
// If not in raw mode and port is not set, figure it out from scheme.
if (!$raw && $port === null) {
if ($this->scheme === 'http') {
$this->port = 80;
} elseif ($this->scheme === 'https') {
... | [
"public",
"function",
"port",
"(",
"$",
"raw",
"=",
"false",
")",
"{",
"$",
"port",
"=",
"$",
"this",
"->",
"port",
";",
"// If not in raw mode and port is not set, figure it out from scheme.",
"if",
"(",
"!",
"$",
"raw",
"&&",
"$",
"port",
"===",
"null",
")... | Return the port number if it can be figured out
@param bool $raw
@return int|null | [
"Return",
"the",
"port",
"number",
"if",
"it",
"can",
"be",
"figured",
"out"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Uri.php#L424-L437 | train | Get the port | [
30522,
2270,
3853,
3417,
1006,
1002,
6315,
1027,
6270,
1007,
1063,
1002,
3417,
1027,
1002,
2023,
1011,
1028,
3417,
1025,
1013,
1013,
2065,
2025,
1999,
6315,
5549,
1998,
3417,
2003,
2025,
2275,
1010,
3275,
2009,
2041,
2013,
5679,
1012,
206... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Mail/TransportManager.php | TransportManager.createMandrillDriver | protected function createMandrillDriver()
{
$config = $this->app['config']->get('services.mandrill', []);
return new MandrillTransport(
$this->guzzle($config), $config['secret']
);
} | php | protected function createMandrillDriver()
{
$config = $this->app['config']->get('services.mandrill', []);
return new MandrillTransport(
$this->guzzle($config), $config['secret']
);
} | [
"protected",
"function",
"createMandrillDriver",
"(",
")",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"app",
"[",
"'config'",
"]",
"->",
"get",
"(",
"'services.mandrill'",
",",
"[",
"]",
")",
";",
"return",
"new",
"MandrillTransport",
"(",
"$",
"this",
... | Create an instance of the Mandrill Swift Transport driver.
@return \Illuminate\Mail\Transport\MandrillTransport | [
"Create",
"an",
"instance",
"of",
"the",
"Mandrill",
"Swift",
"Transport",
"driver",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Mail/TransportManager.php#L134-L141 | train | Create a MandrillTransport | [
30522,
5123,
3853,
3443,
2386,
13626,
8591,
23663,
2099,
1006,
1007,
1063,
1002,
9530,
8873,
2290,
1027,
1002,
2023,
1011,
1028,
10439,
1031,
1005,
9530,
8873,
2290,
1005,
1033,
1011,
1028,
2131,
1006,
1005,
2578,
1012,
2158,
13626,
8591,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Validation/Concerns/ReplacesAttributes.php | ReplacesAttributes.replaceAfter | protected function replaceAfter($message, $attribute, $rule, $parameters)
{
return $this->replaceBefore($message, $attribute, $rule, $parameters);
} | php | protected function replaceAfter($message, $attribute, $rule, $parameters)
{
return $this->replaceBefore($message, $attribute, $rule, $parameters);
} | [
"protected",
"function",
"replaceAfter",
"(",
"$",
"message",
",",
"$",
"attribute",
",",
"$",
"rule",
",",
"$",
"parameters",
")",
"{",
"return",
"$",
"this",
"->",
"replaceBefore",
"(",
"$",
"message",
",",
"$",
"attribute",
",",
"$",
"rule",
",",
"$... | Replace all place-holders for the after rule.
@param string $message
@param string $attribute
@param string $rule
@param array $parameters
@return string | [
"Replace",
"all",
"place",
"-",
"holders",
"for",
"the",
"after",
"rule",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Validation/Concerns/ReplacesAttributes.php#L418-L421 | train | Replace all place - holders for the after rule | [
30522,
5123,
3853,
5672,
10354,
3334,
30524,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/ProxyHttp.php | ProxyHttp.isPhpOutputCompressed | public static function isPhpOutputCompressed()
{
// Off = ''; On = '1'; otherwise, it's a buffer size
$zlibOutputCompression = ini_get('zlib.output_compression');
// could be ob_gzhandler, ob_deflatehandler, etc
$outputHandler = ini_get('output_handler');
// output handlers... | php | public static function isPhpOutputCompressed()
{
// Off = ''; On = '1'; otherwise, it's a buffer size
$zlibOutputCompression = ini_get('zlib.output_compression');
// could be ob_gzhandler, ob_deflatehandler, etc
$outputHandler = ini_get('output_handler');
// output handlers... | [
"public",
"static",
"function",
"isPhpOutputCompressed",
"(",
")",
"{",
"// Off = ''; On = '1'; otherwise, it's a buffer size",
"$",
"zlibOutputCompression",
"=",
"ini_get",
"(",
"'zlib.output_compression'",
")",
";",
"// could be ob_gzhandler, ob_deflatehandler, etc",
"$",
"outp... | Test if php output is compressed
@return bool True if php output is (or suspected/likely) to be compressed | [
"Test",
"if",
"php",
"output",
"is",
"compressed"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/ProxyHttp.php#L178-L202 | train | Check if the output is compressed | [
30522,
2270,
10763,
3853,
2003,
8458,
6873,
4904,
18780,
9006,
19811,
1006,
1007,
1063,
1013,
1013,
2125,
1027,
1005,
1005,
1025,
2006,
1027,
1005,
1015,
1005,
1025,
4728,
1010,
2009,
1005,
1055,
1037,
17698,
2946,
1002,
1062,
29521,
5833,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/UserCountry/GeoIPAutoUpdater.php | GeoIPAutoUpdater.setUpdaterOptionsFromUrl | public static function setUpdaterOptionsFromUrl()
{
$options = array(
'loc' => Common::getRequestVar('loc_db', false, 'string'),
'isp' => Common::getRequestVar('isp_db', false, 'string'),
'org' => Common::getRequestVar('org_db', false, 'string'),
'per... | php | public static function setUpdaterOptionsFromUrl()
{
$options = array(
'loc' => Common::getRequestVar('loc_db', false, 'string'),
'isp' => Common::getRequestVar('isp_db', false, 'string'),
'org' => Common::getRequestVar('org_db', false, 'string'),
'per... | [
"public",
"static",
"function",
"setUpdaterOptionsFromUrl",
"(",
")",
"{",
"$",
"options",
"=",
"array",
"(",
"'loc'",
"=>",
"Common",
"::",
"getRequestVar",
"(",
"'loc_db'",
",",
"false",
",",
"'string'",
")",
",",
"'isp'",
"=>",
"Common",
"::",
"getRequest... | Sets the options used by this class based on query parameter values.
See setUpdaterOptions for query params used. | [
"Sets",
"the",
"options",
"used",
"by",
"this",
"class",
"based",
"on",
"query",
"parameter",
"values",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UserCountry/GeoIPAutoUpdater.php#L312-L326 | train | Set the updater options from the URL | [
30522,
2270,
10763,
3853,
16437,
13701,
30524,
2003,
2361,
1005,
1027,
1028,
2691,
1024,
1024,
2131,
2890,
15500,
10755,
1006,
1005,
2003,
2361,
1035,
16962,
1005,
1010,
6270,
1010,
1005,
5164,
1005,
1007,
1010,
1005,
8917,
1005,
1027,
1028... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Common/Assets/Traits/AssetUtilsTrait.php | AssetUtilsTrait.moveImports | protected function moveImports($file)
{
$imports = [];
$file = (string)preg_replace_callback(self::CSS_IMPORT_REGEX, function ($matches) use (&$imports) {
$imports[] = $matches[0];
return '';
}, $file);
return implode("\n", $imports) . "\n\n" . $file;
} | php | protected function moveImports($file)
{
$imports = [];
$file = (string)preg_replace_callback(self::CSS_IMPORT_REGEX, function ($matches) use (&$imports) {
$imports[] = $matches[0];
return '';
}, $file);
return implode("\n", $imports) . "\n\n" . $file;
} | [
"protected",
"function",
"moveImports",
"(",
"$",
"file",
")",
"{",
"$",
"imports",
"=",
"[",
"]",
";",
"$",
"file",
"=",
"(",
"string",
")",
"preg_replace_callback",
"(",
"self",
"::",
"CSS_IMPORT_REGEX",
",",
"function",
"(",
"$",
"matches",
")",
"use"... | Moves @import statements to the top of the file per the CSS specification
@param string $file the file containing the combined CSS files
@return string the modified file with any @imports at the top of the file | [
"Moves",
"@import",
"statements",
"to",
"the",
"top",
"of",
"the",
"file",
"per",
"the",
"CSS",
"specification"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Assets/Traits/AssetUtilsTrait.php#L108-L119 | train | Move all CSS imports into the beginning of the file | [
30522,
5123,
3853,
2693,
5714,
25378,
1006,
1002,
5371,
1007,
1063,
1002,
17589,
1027,
1031,
1033,
1025,
1002,
5371,
1027,
1006,
5164,
1007,
3653,
2290,
1035,
5672,
1035,
2655,
5963,
1006,
2969,
1024,
1024,
20116,
2015,
1035,
12324,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Common/Page/Medium/AudioMedium.php | AudioMedium.sourceParsedownElement | protected function sourceParsedownElement(array $attributes, $reset = true)
{
$location = $this->url($reset);
return [
'name' => 'audio',
'text' => '<source src="' . $location . '">Your browser does not support the audio tag.',
'attributes' => $attributes
... | php | protected function sourceParsedownElement(array $attributes, $reset = true)
{
$location = $this->url($reset);
return [
'name' => 'audio',
'text' => '<source src="' . $location . '">Your browser does not support the audio tag.',
'attributes' => $attributes
... | [
"protected",
"function",
"sourceParsedownElement",
"(",
"array",
"$",
"attributes",
",",
"$",
"reset",
"=",
"true",
")",
"{",
"$",
"location",
"=",
"$",
"this",
"->",
"url",
"(",
"$",
"reset",
")",
";",
"return",
"[",
"'name'",
"=>",
"'audio'",
",",
"'... | Parsedown element for source display mode
@param array $attributes
@param bool $reset
@return array | [
"Parsedown",
"element",
"for",
"source",
"display",
"mode"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Page/Medium/AudioMedium.php#L23-L32 | train | Returns array with audio element | [
30522,
5123,
3853,
3120,
19362,
6924,
12384,
12260,
3672,
1006,
9140,
1002,
12332,
1010,
1002,
25141,
1027,
2995,
1007,
1063,
1002,
3295,
1027,
1002,
2023,
1011,
1028,
24471,
2140,
1006,
1002,
25141,
1007,
1025,
2709,
1031,
1005,
2171,
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/Framework/File/Formatter/JsonFormatter.php | JsonFormatter.decode | public function decode($data)
{
$decoded = @json_decode($data, $this->getDecodeAssoc(), $this->getDecodeDepth(), $this->getDecodeOptions());
if (null === $decoded && json_last_error() !== JSON_ERROR_NONE) {
throw new \RuntimeException('Decoding JSON failed: ' . json_last_error_msg());
... | php | public function decode($data)
{
$decoded = @json_decode($data, $this->getDecodeAssoc(), $this->getDecodeDepth(), $this->getDecodeOptions());
if (null === $decoded && json_last_error() !== JSON_ERROR_NONE) {
throw new \RuntimeException('Decoding JSON failed: ' . json_last_error_msg());
... | [
"public",
"function",
"decode",
"(",
"$",
"data",
")",
"{",
"$",
"decoded",
"=",
"@",
"json_decode",
"(",
"$",
"data",
",",
"$",
"this",
"->",
"getDecodeAssoc",
"(",
")",
",",
"$",
"this",
"->",
"getDecodeDepth",
"(",
")",
",",
"$",
"this",
"->",
"... | {@inheritdoc}
@see FileFormatterInterface::decode() | [
"{"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Framework/File/Formatter/JsonFormatter.php#L90-L99 | train | Decode JSON string | [
30522,
2270,
3853,
21933,
3207,
1006,
1002,
2951,
1007,
1063,
1002,
21933,
5732,
1027,
1030,
1046,
3385,
1035,
21933,
3207,
1006,
1002,
2951,
1010,
1002,
2023,
1011,
1028,
2131,
3207,
16044,
12054,
10085,
1006,
1007,
1010,
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/Bundle/FrameworkBundle/Controller/ControllerTrait.php | ControllerTrait.file | protected function file($file, string $fileName = null, string $disposition = ResponseHeaderBag::DISPOSITION_ATTACHMENT): BinaryFileResponse
{
$response = new BinaryFileResponse($file);
$response->setContentDisposition($disposition, null === $fileName ? $response->getFile()->getFilename() : $fileNam... | php | protected function file($file, string $fileName = null, string $disposition = ResponseHeaderBag::DISPOSITION_ATTACHMENT): BinaryFileResponse
{
$response = new BinaryFileResponse($file);
$response->setContentDisposition($disposition, null === $fileName ? $response->getFile()->getFilename() : $fileNam... | [
"protected",
"function",
"file",
"(",
"$",
"file",
",",
"string",
"$",
"fileName",
"=",
"null",
",",
"string",
"$",
"disposition",
"=",
"ResponseHeaderBag",
"::",
"DISPOSITION_ATTACHMENT",
")",
":",
"BinaryFileResponse",
"{",
"$",
"response",
"=",
"new",
"Bina... | Returns a BinaryFileResponse object with original or customized file name and disposition header.
@param \SplFileInfo|string $file File object or path to file to be sent as response
@final | [
"Returns",
"a",
"BinaryFileResponse",
"object",
"with",
"original",
"or",
"customized",
"file",
"name",
"and",
"disposition",
"header",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php#L142-L148 | train | Create a new BinaryFileResponse | [
30522,
5123,
3853,
5371,
1006,
1002,
5371,
1010,
5164,
1002,
5371,
18442,
1027,
19701,
1010,
5164,
1002,
22137,
1027,
3433,
4974,
2121,
16078,
1024,
1024,
22137,
1035,
14449,
1007,
1024,
12441,
8873,
3917,
2229,
26029,
3366,
1063,
1002,
343... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Csrf/Type/FormTypeCsrfExtension.php | FormTypeCsrfExtension.configureOptions | public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
'csrf_protection' => $this->defaultEnabled,
'csrf_field_name' => $this->defaultFieldName,
'csrf_message' => 'The CSRF token is invalid. Please try to resubmit the form.',
'c... | php | public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
'csrf_protection' => $this->defaultEnabled,
'csrf_field_name' => $this->defaultFieldName,
'csrf_message' => 'The CSRF token is invalid. Please try to resubmit the form.',
'c... | [
"public",
"function",
"configureOptions",
"(",
"OptionsResolver",
"$",
"resolver",
")",
"{",
"$",
"resolver",
"->",
"setDefaults",
"(",
"[",
"'csrf_protection'",
"=>",
"$",
"this",
"->",
"defaultEnabled",
",",
"'csrf_field_name'",
"=>",
"$",
"this",
"->",
"defau... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/Extension/Csrf/Type/FormTypeCsrfExtension.php#L105-L114 | train | Configure the options for the Form | [
30522,
2270,
3853,
9530,
8873,
27390,
8780,
16790,
2015,
1006,
7047,
6072,
4747,
6299,
1002,
10663,
2099,
1007,
1063,
1002,
10663,
2099,
1011,
1028,
2275,
3207,
7011,
11314,
2015,
1006,
1031,
1005,
20116,
12881,
1035,
3860,
1005,
1027,
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... |
octobercms/october | modules/system/classes/VersionManager.php | VersionManager.removePlugin | public function removePlugin($plugin, $stopOnVersion = null)
{
$code = is_string($plugin) ? $plugin : $this->pluginManager->getIdentifier($plugin);
if (!$this->hasVersionFile($code)) {
return false;
}
$pluginHistory = $this->getDatabaseHistory($code);
$pluginHis... | php | public function removePlugin($plugin, $stopOnVersion = null)
{
$code = is_string($plugin) ? $plugin : $this->pluginManager->getIdentifier($plugin);
if (!$this->hasVersionFile($code)) {
return false;
}
$pluginHistory = $this->getDatabaseHistory($code);
$pluginHis... | [
"public",
"function",
"removePlugin",
"(",
"$",
"plugin",
",",
"$",
"stopOnVersion",
"=",
"null",
")",
"{",
"$",
"code",
"=",
"is_string",
"(",
"$",
"plugin",
")",
"?",
"$",
"plugin",
":",
"$",
"this",
"->",
"pluginManager",
"->",
"getIdentifier",
"(",
... | Removes and packs down a plugin from the system. Files are left intact.
If the $stopOnVersion parameter is specified, the process stops after
the specified version is rolled back. | [
"Removes",
"and",
"packs",
"down",
"a",
"plugin",
"from",
"the",
"system",
".",
"Files",
"are",
"left",
"intact",
".",
"If",
"the",
"$stopOnVersion",
"parameter",
"is",
"specified",
"the",
"process",
"stops",
"after",
"the",
"specified",
"version",
"is",
"ro... | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/VersionManager.php#L165-L212 | train | Removes a plugin from the database | [
30522,
2270,
3853,
6366,
24759,
15916,
2378,
1006,
1002,
13354,
2378,
1010,
1002,
2644,
2239,
27774,
1027,
19701,
1007,
1063,
1002,
3642,
1027,
2003,
1035,
5164,
1006,
1002,
13354,
2378,
1007,
1029,
1002,
13354,
2378,
1024,
1002,
2023,
1011... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/SitesManager/API.php | API.getCurrencyList | public function getCurrencyList()
{
$currency = Site::getCurrencyList();
$return = array();
foreach (array_keys(Site::getCurrencyList()) as $currencyCode) {
$return[$currencyCode] = Piwik::translate('Intl_Currency_' . $currencyCode) .
' (' . Piwik::translate('Intl_... | php | public function getCurrencyList()
{
$currency = Site::getCurrencyList();
$return = array();
foreach (array_keys(Site::getCurrencyList()) as $currencyCode) {
$return[$currencyCode] = Piwik::translate('Intl_Currency_' . $currencyCode) .
' (' . Piwik::translate('Intl_... | [
"public",
"function",
"getCurrencyList",
"(",
")",
"{",
"$",
"currency",
"=",
"Site",
"::",
"getCurrencyList",
"(",
")",
";",
"$",
"return",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"array_keys",
"(",
"Site",
"::",
"getCurrencyList",
"(",
")",
")",
... | Returns the list of supported currencies
@see getCurrencySymbols()
@return array ( currencyId => currencyName) | [
"Returns",
"the",
"list",
"of",
"supported",
"currencies"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SitesManager/API.php#L1376-L1389 | train | Get currency list | [
30522,
2270,
3853,
2131,
10841,
14343,
9407,
9863,
1006,
1007,
1063,
1002,
9598,
1027,
2609,
1024,
1024,
2131,
10841,
14343,
9407,
9863,
1006,
1007,
1025,
1002,
2709,
1027,
9140,
1006,
1007,
1025,
18921,
6776,
1006,
9140,
1035,
6309,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Broadcasting/BroadcastManager.php | BroadcastManager.createPusherDriver | protected function createPusherDriver(array $config)
{
$pusher = new Pusher(
$config['key'], $config['secret'],
$config['app_id'], $config['options'] ?? []
);
if ($config['log'] ?? false) {
$pusher->setLogger($this->app->make(LoggerInterface::class));
... | php | protected function createPusherDriver(array $config)
{
$pusher = new Pusher(
$config['key'], $config['secret'],
$config['app_id'], $config['options'] ?? []
);
if ($config['log'] ?? false) {
$pusher->setLogger($this->app->make(LoggerInterface::class));
... | [
"protected",
"function",
"createPusherDriver",
"(",
"array",
"$",
"config",
")",
"{",
"$",
"pusher",
"=",
"new",
"Pusher",
"(",
"$",
"config",
"[",
"'key'",
"]",
",",
"$",
"config",
"[",
"'secret'",
"]",
",",
"$",
"config",
"[",
"'app_id'",
"]",
",",
... | Create an instance of the driver.
@param array $config
@return \Illuminate\Contracts\Broadcasting\Broadcaster | [
"Create",
"an",
"instance",
"of",
"the",
"driver",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Broadcasting/BroadcastManager.php#L209-L221 | train | Create Pusher Broadcaster driver | [
30522,
5123,
3853,
3443,
12207,
5886,
23663,
2099,
1006,
9140,
1002,
9530,
8873,
2290,
1007,
1063,
1002,
5245,
2121,
1027,
2047,
5245,
2121,
1006,
1002,
9530,
8873,
2290,
1031,
1005,
3145,
1005,
1033,
1010,
1002,
9530,
8873,
2290,
1031,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Common/Twig/TwigExtension.php | TwigExtension.padFilter | public static function padFilter($input, $pad_length, $pad_string = ' ', $pad_type = STR_PAD_RIGHT)
{
return str_pad($input, (int)$pad_length, $pad_string, $pad_type);
} | php | public static function padFilter($input, $pad_length, $pad_string = ' ', $pad_type = STR_PAD_RIGHT)
{
return str_pad($input, (int)$pad_length, $pad_string, $pad_type);
} | [
"public",
"static",
"function",
"padFilter",
"(",
"$",
"input",
",",
"$",
"pad_length",
",",
"$",
"pad_string",
"=",
"' '",
",",
"$",
"pad_type",
"=",
"STR_PAD_RIGHT",
")",
"{",
"return",
"str_pad",
"(",
"$",
"input",
",",
"(",
"int",
")",
"$",
"pad_le... | Pad a string to a certain length with another string
@param string $input
@param int $pad_length
@param string $pad_string
@param int $pad_type
@return string | [
"Pad",
"a",
"string",
"to",
"a",
"certain",
"length",
"with",
"another",
"string"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Twig/TwigExtension.php#L926-L929 | train | Pads a string to a certain length using the str_pad function | [
30522,
2270,
10763,
3853,
11687,
8873,
21928,
1006,
1002,
7953,
1010,
1002,
11687,
1035,
3091,
1010,
1002,
11687,
1035,
5164,
1027,
1005,
1005,
1010,
1002,
11687,
1035,
2828,
1027,
2358,
2099,
1035,
11687,
1035,
2157,
1007,
1063,
2709,
2358... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/Plugin/Controller.php | Controller.setMinDateView | protected function setMinDateView(Date $minDate, $view)
{
$view->minDateYear = $minDate->toString('Y');
$view->minDateMonth = $minDate->toString('m');
$view->minDateDay = $minDate->toString('d');
} | php | protected function setMinDateView(Date $minDate, $view)
{
$view->minDateYear = $minDate->toString('Y');
$view->minDateMonth = $minDate->toString('m');
$view->minDateDay = $minDate->toString('d');
} | [
"protected",
"function",
"setMinDateView",
"(",
"Date",
"$",
"minDate",
",",
"$",
"view",
")",
"{",
"$",
"view",
"->",
"minDateYear",
"=",
"$",
"minDate",
"->",
"toString",
"(",
"'Y'",
")",
";",
"$",
"view",
"->",
"minDateMonth",
"=",
"$",
"minDate",
"... | Sets the first date available in the period selector's calendar.
@param Date $minDate The min date.
@param View $view The view that contains the period selector.
@api | [
"Sets",
"the",
"first",
"date",
"available",
"in",
"the",
"period",
"selector",
"s",
"calendar",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Plugin/Controller.php#L534-L539 | train | Set Minimum Date View | [
30522,
5123,
3853,
2275,
23356,
3686,
8584,
1006,
3058,
1002,
2568,
3686,
1010,
1002,
3193,
1007,
1063,
1002,
3193,
1011,
1028,
2568,
3686,
29100,
1027,
1002,
2568,
3686,
1011,
1028,
2000,
3367,
4892,
1006,
1005,
1061,
1005,
1007,
1025,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/HttpFoundation/Session/Attribute/NamespacedAttributeBag.php | NamespacedAttributeBag.get | public function get($name, $default = null)
{
// reference mismatch: if fixed, re-introduced in array_key_exists; keep as it is
$attributes = $this->resolveAttributePath($name);
$name = $this->resolveKey($name);
if (null === $attributes) {
return $default;
}
... | php | public function get($name, $default = null)
{
// reference mismatch: if fixed, re-introduced in array_key_exists; keep as it is
$attributes = $this->resolveAttributePath($name);
$name = $this->resolveKey($name);
if (null === $attributes) {
return $default;
}
... | [
"public",
"function",
"get",
"(",
"$",
"name",
",",
"$",
"default",
"=",
"null",
")",
"{",
"// reference mismatch: if fixed, re-introduced in array_key_exists; keep as it is",
"$",
"attributes",
"=",
"$",
"this",
"->",
"resolveAttributePath",
"(",
"$",
"name",
")",
... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpFoundation/Session/Attribute/NamespacedAttributeBag.php#L53-L64 | train | Get an attribute value | [
30522,
2270,
3853,
2131,
1006,
1002,
2171,
1010,
1002,
12398,
1027,
19701,
1007,
1063,
1013,
1013,
4431,
28616,
18900,
2818,
1024,
2065,
4964,
1010,
2128,
1011,
3107,
1999,
9140,
1035,
3145,
1035,
6526,
1025,
2562,
2004,
2009,
2003,
1002,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/Settings/Plugin/SystemSettings.php | SystemSettings.makeSetting | protected function makeSetting($name, $defaultValue, $type, $fieldConfigCallback)
{
$setting = new SystemSetting($name, $defaultValue, $type, $this->pluginName);
$setting->setConfigureCallback($fieldConfigCallback);
$this->addSetting($setting);
return $setting;
} | php | protected function makeSetting($name, $defaultValue, $type, $fieldConfigCallback)
{
$setting = new SystemSetting($name, $defaultValue, $type, $this->pluginName);
$setting->setConfigureCallback($fieldConfigCallback);
$this->addSetting($setting);
return $setting;
} | [
"protected",
"function",
"makeSetting",
"(",
"$",
"name",
",",
"$",
"defaultValue",
",",
"$",
"type",
",",
"$",
"fieldConfigCallback",
")",
"{",
"$",
"setting",
"=",
"new",
"SystemSetting",
"(",
"$",
"name",
",",
"$",
"defaultValue",
",",
"$",
"type",
",... | Creates a new system setting.
Settings will be displayed in the UI depending on the order of `makeSetting` calls. This means you can define
the order of the displayed settings by calling makeSetting first for more important settings.
@param string $name The name of the setting that shall be created
@param mix... | [
"Creates",
"a",
"new",
"system",
"setting",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Settings/Plugin/SystemSettings.php#L57-L63 | train | Create System Setting | [
30522,
5123,
3853,
3084,
18319,
3070,
1006,
1002,
2171,
1010,
1002,
12398,
10175,
5657,
1010,
1002,
2828,
1010,
1002,
2492,
8663,
8873,
18195,
8095,
5963,
1007,
1063,
1002,
4292,
1027,
2047,
3001,
18319,
3070,
1006,
1002,
2171,
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... |
guzzle/guzzle | src/Client.php | Client.applyOptions | private function applyOptions(RequestInterface $request, array &$options)
{
$modify = [
'set_headers' => [],
];
if (isset($options['headers'])) {
$modify['set_headers'] = $options['headers'];
unset($options['headers']);
}
if (isset($optio... | php | private function applyOptions(RequestInterface $request, array &$options)
{
$modify = [
'set_headers' => [],
];
if (isset($options['headers'])) {
$modify['set_headers'] = $options['headers'];
unset($options['headers']);
}
if (isset($optio... | [
"private",
"function",
"applyOptions",
"(",
"RequestInterface",
"$",
"request",
",",
"array",
"&",
"$",
"options",
")",
"{",
"$",
"modify",
"=",
"[",
"'set_headers'",
"=>",
"[",
"]",
",",
"]",
";",
"if",
"(",
"isset",
"(",
"$",
"options",
"[",
"'header... | Applies the array of request options to a request.
@param RequestInterface $request
@param array $options
@return RequestInterface | [
"Applies",
"the",
"array",
"of",
"request",
"options",
"to",
"a",
"request",
"."
] | bf595424e4d442a190582e088985dc835a789071 | https://github.com/guzzle/guzzle/blob/bf595424e4d442a190582e088985dc835a789071/src/Client.php#L291-L412 | train | Apply options to the request | [
30522,
2797,
3853,
6611,
7361,
9285,
1006,
5227,
18447,
2121,
12172,
1002,
5227,
1010,
9140,
1004,
1002,
7047,
1007,
1063,
1002,
19933,
1027,
1031,
1005,
2275,
1035,
20346,
2015,
1005,
1027,
1028,
1031,
1033,
1010,
1033,
1025,
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... |
symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/XmlDescriptor.php | XmlDescriptor.describeContainerService | protected function describeContainerService($service, array $options = [], ContainerBuilder $builder = null)
{
if (!isset($options['id'])) {
throw new \InvalidArgumentException('An "id" option must be provided.');
}
$this->writeDocument($this->getContainerServiceDocument($servic... | php | protected function describeContainerService($service, array $options = [], ContainerBuilder $builder = null)
{
if (!isset($options['id'])) {
throw new \InvalidArgumentException('An "id" option must be provided.');
}
$this->writeDocument($this->getContainerServiceDocument($servic... | [
"protected",
"function",
"describeContainerService",
"(",
"$",
"service",
",",
"array",
"$",
"options",
"=",
"[",
"]",
",",
"ContainerBuilder",
"$",
"builder",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"options",
"[",
"'id'",
"]",
")",
... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/XmlDescriptor.php#L69-L76 | train | Describes a container service | [
30522,
5123,
3853,
6235,
8663,
18249,
2545,
2121,
7903,
2063,
1006,
1002,
2326,
1010,
9140,
1002,
7047,
1027,
1031,
1033,
1010,
11661,
8569,
23891,
2099,
1002,
12508,
1027,
19701,
1007,
1063,
2065,
1006,
999,
26354,
3388,
1006,
1002,
7047,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Support/Collection.php | Collection.forPage | public function forPage($page, $perPage)
{
$offset = max(0, ($page - 1) * $perPage);
return $this->slice($offset, $perPage);
} | php | public function forPage($page, $perPage)
{
$offset = max(0, ($page - 1) * $perPage);
return $this->slice($offset, $perPage);
} | [
"public",
"function",
"forPage",
"(",
"$",
"page",
",",
"$",
"perPage",
")",
"{",
"$",
"offset",
"=",
"max",
"(",
"0",
",",
"(",
"$",
"page",
"-",
"1",
")",
"*",
"$",
"perPage",
")",
";",
"return",
"$",
"this",
"->",
"slice",
"(",
"$",
"offset"... | "Paginate" the collection by slicing it into a smaller collection.
@param int $page
@param int $perPage
@return static | [
"Paginate",
"the",
"collection",
"by",
"slicing",
"it",
"into",
"a",
"smaller",
"collection",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Support/Collection.php#L1354-L1359 | train | Returns the array of terms for a page | [
30522,
2270,
3853,
2005,
13704,
1006,
1002,
3931,
1010,
1002,
2566,
13704,
1007,
1063,
1002,
16396,
1027,
4098,
1006,
1014,
1010,
1006,
1002,
3931,
1011,
1015,
1007,
1008,
1002,
2566,
13704,
1007,
1025,
2709,
1002,
2023,
1011,
1028,
14704,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Authentication.php | Authentication.verify | public static function verify($password, $hash): int
{
// Fail if hash doesn't match
if (!$password || !$hash || !password_verify($password, $hash)) {
return 0;
}
// Otherwise check if hash needs an update.
return password_needs_rehash($hash, PASSWORD_DEFAULT) ? ... | php | public static function verify($password, $hash): int
{
// Fail if hash doesn't match
if (!$password || !$hash || !password_verify($password, $hash)) {
return 0;
}
// Otherwise check if hash needs an update.
return password_needs_rehash($hash, PASSWORD_DEFAULT) ? ... | [
"public",
"static",
"function",
"verify",
"(",
"$",
"password",
",",
"$",
"hash",
")",
":",
"int",
"{",
"// Fail if hash doesn't match",
"if",
"(",
"!",
"$",
"password",
"||",
"!",
"$",
"hash",
"||",
"!",
"password_verify",
"(",
"$",
"password",
",",
"$"... | Verifies that a password matches a hash.
@param string $password Plaintext password.
@param string $hash Hash to verify against.
@return int Returns 0 if the check fails, 1 if password matches, 2 if hash needs to be updated. | [
"Verifies",
"that",
"a",
"password",
"matches",
"a",
"hash",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/User/Authentication.php#L45-L54 | train | Verify if the password matches the hash | [
30522,
2270,
10763,
3853,
20410,
1006,
1002,
20786,
1010,
1002,
23325,
1007,
1024,
20014,
1063,
1013,
1013,
8246,
2065,
23325,
2987,
1005,
1056,
2674,
2065,
1006,
999,
1002,
20786,
1064,
1064,
999,
1002,
23325,
1064,
1064,
999,
20786,
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... |
laravel/framework | src/Illuminate/Database/Query/Grammars/Grammar.php | Grammar.whereSub | protected function whereSub(Builder $query, $where)
{
$select = $this->compileSelect($where['query']);
return $this->wrap($where['column']).' '.$where['operator']." ($select)";
} | php | protected function whereSub(Builder $query, $where)
{
$select = $this->compileSelect($where['query']);
return $this->wrap($where['column']).' '.$where['operator']." ($select)";
} | [
"protected",
"function",
"whereSub",
"(",
"Builder",
"$",
"query",
",",
"$",
"where",
")",
"{",
"$",
"select",
"=",
"$",
"this",
"->",
"compileSelect",
"(",
"$",
"where",
"[",
"'query'",
"]",
")",
";",
"return",
"$",
"this",
"->",
"wrap",
"(",
"$",
... | Compile a where condition with a sub-select.
@param \Illuminate\Database\Query\Builder $query
@param array $where
@return string | [
"Compile",
"a",
"where",
"condition",
"with",
"a",
"sub",
"-",
"select",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Query/Grammars/Grammar.php#L495-L500 | train | Internal method to wrap a where sub clause in a query | [
30522,
5123,
3853,
2073,
6342,
2497,
1006,
12508,
1002,
23032,
1010,
1002,
2073,
1007,
1063,
1002,
7276,
1027,
1002,
2023,
1011,
1028,
4012,
22090,
11246,
22471,
1006,
1002,
2073,
1031,
1005,
23032,
1005,
1033,
1007,
1025,
2709,
1002,
2023,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/system/classes/UpdateManager.php | UpdateManager.uninstall | public function uninstall()
{
/*
* Rollback plugins
*/
$plugins = $this->pluginManager->getPlugins();
foreach ($plugins as $name => $plugin) {
$this->rollbackPlugin($name);
}
/*
* Register module migration files
*/
$pat... | php | public function uninstall()
{
/*
* Rollback plugins
*/
$plugins = $this->pluginManager->getPlugins();
foreach ($plugins as $name => $plugin) {
$this->rollbackPlugin($name);
}
/*
* Register module migration files
*/
$pat... | [
"public",
"function",
"uninstall",
"(",
")",
"{",
"/*\n * Rollback plugins\n */",
"$",
"plugins",
"=",
"$",
"this",
"->",
"pluginManager",
"->",
"getPlugins",
"(",
")",
";",
"foreach",
"(",
"$",
"plugins",
"as",
"$",
"name",
"=>",
"$",
"plugin"... | Roll back all modules and plugins.
@return self | [
"Roll",
"back",
"all",
"modules",
"and",
"plugins",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/UpdateManager.php#L327-L365 | train | Rollback all modules and plugins | [
30522,
2270,
3853,
4895,
7076,
9080,
2140,
1006,
1007,
1063,
1013,
1008,
1008,
4897,
5963,
13354,
7076,
1008,
1013,
1002,
13354,
7076,
1027,
1002,
2023,
1011,
1028,
13354,
2378,
24805,
4590,
1011,
1028,
2131,
24759,
15916,
7076,
1006,
1007,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Queue/Worker.php | Worker.raiseBeforeJobEvent | protected function raiseBeforeJobEvent($connectionName, $job)
{
$this->events->dispatch(new Events\JobProcessing(
$connectionName, $job
));
} | php | protected function raiseBeforeJobEvent($connectionName, $job)
{
$this->events->dispatch(new Events\JobProcessing(
$connectionName, $job
));
} | [
"protected",
"function",
"raiseBeforeJobEvent",
"(",
"$",
"connectionName",
",",
"$",
"job",
")",
"{",
"$",
"this",
"->",
"events",
"->",
"dispatch",
"(",
"new",
"Events",
"\\",
"JobProcessing",
"(",
"$",
"connectionName",
",",
"$",
"job",
")",
")",
";",
... | Raise the before queue job event.
@param string $connectionName
@param \Illuminate\Contracts\Queue\Job $job
@return void | [
"Raise",
"the",
"before",
"queue",
"job",
"event",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Queue/Worker.php#L453-L458 | train | Raise the JobProcessing event for the passed job | [
30522,
5123,
3853,
5333,
4783,
29278,
20518,
20891,
15338,
1006,
1002,
4434,
18442,
1010,
1002,
3105,
1007,
1063,
1002,
2023,
1011,
1028,
2824,
1011,
1028,
18365,
1006,
2047,
2824,
1032,
3105,
21572,
9623,
7741,
1006,
1002,
4434,
18442,
101... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
PHPMailer/PHPMailer | src/SMTP.php | SMTP.setError | protected function setError($message, $detail = '', $smtp_code = '', $smtp_code_ex = '')
{
$this->error = [
'error' => $message,
'detail' => $detail,
'smtp_code' => $smtp_code,
'smtp_code_ex' => $smtp_code_ex,
];
} | php | protected function setError($message, $detail = '', $smtp_code = '', $smtp_code_ex = '')
{
$this->error = [
'error' => $message,
'detail' => $detail,
'smtp_code' => $smtp_code,
'smtp_code_ex' => $smtp_code_ex,
];
} | [
"protected",
"function",
"setError",
"(",
"$",
"message",
",",
"$",
"detail",
"=",
"''",
",",
"$",
"smtp_code",
"=",
"''",
",",
"$",
"smtp_code_ex",
"=",
"''",
")",
"{",
"$",
"this",
"->",
"error",
"=",
"[",
"'error'",
"=>",
"$",
"message",
",",
"'... | Set error messages and codes.
@param string $message The error message
@param string $detail Further detail on the error
@param string $smtp_code An associated SMTP error code
@param string $smtp_code_ex Extended SMTP code | [
"Set",
"error",
"messages",
"and",
"codes",
"."
] | 3d7132341659a8a201adbc3ba11b1e202ee2857c | https://github.com/PHPMailer/PHPMailer/blob/3d7132341659a8a201adbc3ba11b1e202ee2857c/src/SMTP.php#L1214-L1222 | train | Set error message and detail | [
30522,
5123,
3853,
2275,
2121,
29165,
1006,
1002,
4471,
1010,
1002,
6987,
1027,
1005,
1005,
1010,
1002,
15488,
25856,
1035,
3642,
1027,
1005,
1005,
1010,
1002,
15488,
25856,
1035,
3642,
1035,
4654,
1027,
1005,
1005,
1007,
1063,
30524,
15488... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Foundation/Events/DiscoverEvents.php | DiscoverEvents.getListenerEvents | protected static function getListenerEvents($listeners, $basePath)
{
$listenerEvents = [];
foreach ($listeners as $listener) {
$listener = new ReflectionClass(
static::classFromFile($listener, $basePath)
);
foreach ($listener->getMethods(Reflecti... | php | protected static function getListenerEvents($listeners, $basePath)
{
$listenerEvents = [];
foreach ($listeners as $listener) {
$listener = new ReflectionClass(
static::classFromFile($listener, $basePath)
);
foreach ($listener->getMethods(Reflecti... | [
"protected",
"static",
"function",
"getListenerEvents",
"(",
"$",
"listeners",
",",
"$",
"basePath",
")",
"{",
"$",
"listenerEvents",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"listeners",
"as",
"$",
"listener",
")",
"{",
"$",
"listener",
"=",
"new",
"Ref... | Get all of the listeners and their corresponding events.
@param iterable $listeners
@param string $basePath
@return array | [
"Get",
"all",
"of",
"the",
"listeners",
"and",
"their",
"corresponding",
"events",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Foundation/Events/DiscoverEvents.php#L36-L57 | train | Get all events from the listeners | [
30522,
5123,
10763,
3853,
2131,
9863,
24454,
18697,
7666,
1006,
1002,
13810,
1010,
1002,
2918,
15069,
1007,
1063,
1002,
19373,
18697,
7666,
1027,
1031,
1033,
1025,
18921,
6776,
1006,
1002,
13810,
2004,
1002,
19373,
1007,
1063,
1002,
19373,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/Transitions/API.php | API.queryInternalReferrers | protected function queryInternalReferrers($idaction, $actionType, $logAggregator, $limitBeforeGrouping = false)
{
$keyIsOther = 0;
$keyIsPageUrlAction = 1;
$keyIsSiteSearchAction = 2;
$rankingQuery = new RankingQuery($limitBeforeGrouping ? $limitBeforeGrouping : $this->limitBeforeGr... | php | protected function queryInternalReferrers($idaction, $actionType, $logAggregator, $limitBeforeGrouping = false)
{
$keyIsOther = 0;
$keyIsPageUrlAction = 1;
$keyIsSiteSearchAction = 2;
$rankingQuery = new RankingQuery($limitBeforeGrouping ? $limitBeforeGrouping : $this->limitBeforeGr... | [
"protected",
"function",
"queryInternalReferrers",
"(",
"$",
"idaction",
",",
"$",
"actionType",
",",
"$",
"logAggregator",
",",
"$",
"limitBeforeGrouping",
"=",
"false",
")",
"{",
"$",
"keyIsOther",
"=",
"0",
";",
"$",
"keyIsPageUrlAction",
"=",
"1",
";",
"... | Get information about internal referrers (previous pages & loops, i.e. page refreshes)
@param $idaction
@param $actionType
@param LogAggregator $logAggregator
@param $limitBeforeGrouping
@return array(previousPages:DataTable, loops:integer) | [
"Get",
"information",
"about",
"internal",
"referrers",
"(",
"previous",
"pages",
"&",
"loops",
"i",
".",
"e",
".",
"page",
"refreshes",
")"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Transitions/API.php#L375-L467 | train | Query internal referrers | [
30522,
5123,
3853,
23032,
18447,
11795,
2389,
2890,
7512,
14544,
2015,
1006,
1002,
16096,
7542,
1010,
1002,
2895,
13874,
1010,
1002,
8833,
8490,
17603,
20697,
2953,
1010,
1002,
5787,
4783,
29278,
13910,
22107,
2075,
1027,
6270,
1007,
1063,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
z-song/laravel-admin | src/Widgets/Tab.php | Tab.render | public function render()
{
$data = array_merge(
$this->data,
['attributes' => $this->formatAttributes()]
);
return view($this->view, $data)->render();
} | php | public function render()
{
$data = array_merge(
$this->data,
['attributes' => $this->formatAttributes()]
);
return view($this->view, $data)->render();
} | [
"public",
"function",
"render",
"(",
")",
"{",
"$",
"data",
"=",
"array_merge",
"(",
"$",
"this",
"->",
"data",
",",
"[",
"'attributes'",
"=>",
"$",
"this",
"->",
"formatAttributes",
"(",
")",
"]",
")",
";",
"return",
"view",
"(",
"$",
"this",
"->",
... | Render Tab.
@return string | [
"Render",
"Tab",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Widgets/Tab.php#L123-L131 | train | Render the content of the page | [
30522,
2270,
3853,
17552,
1006,
1007,
1063,
1002,
2951,
1027,
9140,
1035,
13590,
1006,
1002,
2023,
1011,
1028,
2951,
1010,
1031,
1005,
12332,
1005,
1027,
1028,
1002,
2023,
1011,
1028,
4289,
19321,
30524,
1006,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Query/Builder.php | Builder.leftJoinSub | public function leftJoinSub($query, $as, $first, $operator = null, $second = null)
{
return $this->joinSub($query, $as, $first, $operator, $second, 'left');
} | php | public function leftJoinSub($query, $as, $first, $operator = null, $second = null)
{
return $this->joinSub($query, $as, $first, $operator, $second, 'left');
} | [
"public",
"function",
"leftJoinSub",
"(",
"$",
"query",
",",
"$",
"as",
",",
"$",
"first",
",",
"$",
"operator",
"=",
"null",
",",
"$",
"second",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"joinSub",
"(",
"$",
"query",
",",
"$",
"as",
",... | Add a subquery left join to the query.
@param \Closure|\Illuminate\Database\Query\Builder|string $query
@param string $as
@param \Closure|string $first
@param string|null $operator
@param string|null $second
@return \Illuminate\Database\Query\Builder|static | [
"Add",
"a",
"subquery",
"left",
"join",
"to",
"the",
"query",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Query/Builder.php#L490-L493 | train | Left Join Subquery | [
30522,
2270,
3853,
2187,
5558,
7076,
12083,
1006,
1002,
23032,
1010,
1002,
2004,
1010,
1002,
2034,
1010,
1002,
6872,
1027,
19701,
1010,
1002,
2117,
1027,
19701,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
9794,
12083,
1006,
1002,
23032,
1010,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Console/Helper/Table.php | Table.setStyleDefinition | public static function setStyleDefinition($name, TableStyle $style)
{
if (!self::$styles) {
self::$styles = self::initStyles();
}
self::$styles[$name] = $style;
} | php | public static function setStyleDefinition($name, TableStyle $style)
{
if (!self::$styles) {
self::$styles = self::initStyles();
}
self::$styles[$name] = $style;
} | [
"public",
"static",
"function",
"setStyleDefinition",
"(",
"$",
"name",
",",
"TableStyle",
"$",
"style",
")",
"{",
"if",
"(",
"!",
"self",
"::",
"$",
"styles",
")",
"{",
"self",
"::",
"$",
"styles",
"=",
"self",
"::",
"initStyles",
"(",
")",
";",
"}"... | Sets a style definition.
@param string $name The style name
@param TableStyle $style A TableStyle instance | [
"Sets",
"a",
"style",
"definition",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Helper/Table.php#L108-L115 | train | Set a table style definition | [
30522,
2270,
10763,
3853,
4520,
27983,
3207,
16294,
22753,
1006,
1002,
2171,
1010,
7251,
27983,
1002,
2806,
1007,
1063,
2065,
1006,
999,
2969,
1024,
1024,
1002,
6782,
1007,
1063,
2969,
1024,
1024,
1002,
6782,
1027,
2969,
1024,
1024,
1999,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeExtensionGuesser.php | MimeTypeExtensionGuesser.guess | public function guess($mimeType)
{
if (isset($this->defaultExtensions[$mimeType])) {
return $this->defaultExtensions[$mimeType];
}
$lcMimeType = strtolower($mimeType);
return isset($this->defaultExtensions[$lcMimeType]) ? $this->defaultExtensions[$lcMimeType] : null;
... | php | public function guess($mimeType)
{
if (isset($this->defaultExtensions[$mimeType])) {
return $this->defaultExtensions[$mimeType];
}
$lcMimeType = strtolower($mimeType);
return isset($this->defaultExtensions[$lcMimeType]) ? $this->defaultExtensions[$lcMimeType] : null;
... | [
"public",
"function",
"guess",
"(",
"$",
"mimeType",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"defaultExtensions",
"[",
"$",
"mimeType",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"defaultExtensions",
"[",
"$",
"mimeType",
"]",
";",
... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeExtensionGuesser.php#L815-L824 | train | Guesses the default extension for the given mime type. | [
30522,
2270,
3853,
3984,
1006,
1002,
2771,
11368,
18863,
1007,
1063,
2065,
1006,
26354,
3388,
1006,
1002,
2023,
1011,
1028,
12398,
10288,
29048,
2015,
1031,
1002,
2771,
11368,
18863,
1033,
1007,
1007,
30524,
1002,
2023,
1011,
1028,
12398,
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... |
z-song/laravel-admin | src/Show.php | Show.overwriteExistingField | protected function overwriteExistingField($name)
{
if ($this->fields->isEmpty()) {
return;
}
$this->fields = $this->fields->filter(
function (Field $field) use ($name) {
return $field->getName() != $name;
}
);
} | php | protected function overwriteExistingField($name)
{
if ($this->fields->isEmpty()) {
return;
}
$this->fields = $this->fields->filter(
function (Field $field) use ($name) {
return $field->getName() != $name;
}
);
} | [
"protected",
"function",
"overwriteExistingField",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"fields",
"->",
"isEmpty",
"(",
")",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"fields",
"=",
"$",
"this",
"->",
"fields",
"->",
"filt... | Overwrite existing field.
@param string $name | [
"Overwrite",
"existing",
"field",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Show.php#L258-L269 | train | Overwrite existing field | [
30522,
5123,
3853,
2058,
26373,
10288,
2923,
2075,
3790,
1006,
1002,
2171,
1007,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
4249,
1011,
1028,
2003,
6633,
13876,
2100,
1006,
1007,
1007,
1063,
2709,
1025,
1065,
1002,
2023,
1011,
1028,
4249,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Console/Migrations/RollbackCommand.php | RollbackCommand.handle | public function handle()
{
if (! $this->confirmToProceed()) {
return;
}
$this->migrator->setConnection($this->option('database'));
$this->migrator->setOutput($this->output)->rollback(
$this->getMigrationPaths(), [
'pretend' => $this->option('... | php | public function handle()
{
if (! $this->confirmToProceed()) {
return;
}
$this->migrator->setConnection($this->option('database'));
$this->migrator->setOutput($this->output)->rollback(
$this->getMigrationPaths(), [
'pretend' => $this->option('... | [
"public",
"function",
"handle",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"confirmToProceed",
"(",
")",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"migrator",
"->",
"setConnection",
"(",
"$",
"this",
"->",
"option",
"(",
"'database'",
"... | Execute the console command.
@return void | [
"Execute",
"the",
"console",
"command",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Console/Migrations/RollbackCommand.php#L52-L66 | train | Handle rollback action | [
30522,
2270,
3853,
5047,
1006,
1007,
1063,
2065,
1006,
999,
1002,
2023,
1011,
1028,
12210,
14399,
3217,
3401,
2098,
1006,
1007,
1007,
1063,
2709,
1025,
1065,
1002,
2023,
1011,
1028,
19117,
16259,
1011,
1028,
2275,
8663,
2638,
7542,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Database/Schema/Blueprint.php | Blueprint.bigInteger | public function bigInteger($column, $autoIncrement = false, $unsigned = false)
{
return $this->addColumn('bigInteger', $column, compact('autoIncrement', 'unsigned'));
} | php | public function bigInteger($column, $autoIncrement = false, $unsigned = false)
{
return $this->addColumn('bigInteger', $column, compact('autoIncrement', 'unsigned'));
} | [
"public",
"function",
"bigInteger",
"(",
"$",
"column",
",",
"$",
"autoIncrement",
"=",
"false",
",",
"$",
"unsigned",
"=",
"false",
")",
"{",
"return",
"$",
"this",
"->",
"addColumn",
"(",
"'bigInteger'",
",",
"$",
"column",
",",
"compact",
"(",
"'autoI... | Create a new big integer (8-byte) column on the table.
@param string $column
@param bool $autoIncrement
@param bool $unsigned
@return \Illuminate\Database\Schema\ColumnDefinition | [
"Create",
"a",
"new",
"big",
"integer",
"(",
"8",
"-",
"byte",
")",
"column",
"on",
"the",
"table",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Schema/Blueprint.php#L717-L720 | train | Add a big integer column to the table | [
30522,
2270,
3853,
2502,
18447,
26320,
1006,
1002,
5930,
1010,
1002,
8285,
2378,
16748,
3672,
1027,
6270,
1010,
1002,
27121,
1027,
6270,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
5587,
25778,
2819,
2078,
1006,
1005,
2502,
18447,
26320,
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... |
laravel/framework | src/Illuminate/Database/Eloquent/SoftDeletingScope.php | SoftDeletingScope.addOnlyTrashed | protected function addOnlyTrashed(Builder $builder)
{
$builder->macro('onlyTrashed', function (Builder $builder) {
$model = $builder->getModel();
$builder->withoutGlobalScope($this)->whereNotNull(
$model->getQualifiedDeletedAtColumn()
);
retu... | php | protected function addOnlyTrashed(Builder $builder)
{
$builder->macro('onlyTrashed', function (Builder $builder) {
$model = $builder->getModel();
$builder->withoutGlobalScope($this)->whereNotNull(
$model->getQualifiedDeletedAtColumn()
);
retu... | [
"protected",
"function",
"addOnlyTrashed",
"(",
"Builder",
"$",
"builder",
")",
"{",
"$",
"builder",
"->",
"macro",
"(",
"'onlyTrashed'",
",",
"function",
"(",
"Builder",
"$",
"builder",
")",
"{",
"$",
"model",
"=",
"$",
"builder",
"->",
"getModel",
"(",
... | Add the only-trashed extension to the builder.
@param \Illuminate\Database\Eloquent\Builder $builder
@return void | [
"Add",
"the",
"only",
"-",
"trashed",
"extension",
"to",
"the",
"builder",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/SoftDeletingScope.php#L119-L130 | train | Adds the only trashed macro to the builder | [
30522,
5123,
3853,
5587,
2239,
2135,
6494,
14740,
1006,
12508,
1002,
12508,
1007,
1063,
1002,
12508,
1011,
1028,
26632,
1006,
1005,
2069,
6494,
14740,
1005,
1010,
3853,
1006,
12508,
1002,
12508,
1007,
1063,
1002,
2944,
1027,
1002,
12508,
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... |
slimphp/Slim | Slim/Http/Response.php | Response.withStatus | public function withStatus($code, $reasonPhrase = '')
{
$code = $this->filterStatus($code);
if (!is_string($reasonPhrase) && !method_exists($reasonPhrase, '__toString')) {
throw new InvalidArgumentException('ReasonPhrase must be a string');
}
$clone = clone $this;
... | php | public function withStatus($code, $reasonPhrase = '')
{
$code = $this->filterStatus($code);
if (!is_string($reasonPhrase) && !method_exists($reasonPhrase, '__toString')) {
throw new InvalidArgumentException('ReasonPhrase must be a string');
}
$clone = clone $this;
... | [
"public",
"function",
"withStatus",
"(",
"$",
"code",
",",
"$",
"reasonPhrase",
"=",
"''",
")",
"{",
"$",
"code",
"=",
"$",
"this",
"->",
"filterStatus",
"(",
"$",
"code",
")",
";",
"if",
"(",
"!",
"is_string",
"(",
"$",
"reasonPhrase",
")",
"&&",
... | Return an instance with the specified status code and, optionally, reason phrase.
If no reason phrase is specified, implementations MAY choose to default
to the RFC 7231 or IANA recommended reason phrase for the response's
status code.
This method MUST be implemented in such a way as to retain the
immutability of the... | [
"Return",
"an",
"instance",
"with",
"the",
"specified",
"status",
"code",
"and",
"optionally",
"reason",
"phrase",
"."
] | ccef5f7d8bcd469d59cbe64f6210d83764f91543 | https://github.com/slimphp/Slim/blob/ccef5f7d8bcd469d59cbe64f6210d83764f91543/Slim/Http/Response.php#L189-L210 | train | Set the status code and phrase | [
30522,
2270,
3853,
2007,
9153,
5809,
1006,
1002,
3642,
1010,
1002,
3114,
8458,
23797,
1027,
1005,
30524,
8458,
23797,
1010,
1005,
1035,
1035,
2000,
3367,
4892,
1005,
1007,
1007,
1063,
5466,
2047,
19528,
2906,
22850,
15781,
2595,
24422,
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/LanguagesManager/API.php | API.getAvailableLanguagesInfo | public function getAvailableLanguagesInfo($excludeNonCorePlugins=true)
{
$data = file_get_contents(PIWIK_INCLUDE_PATH . '/lang/en.json');
$englishTranslation = json_decode($data, true);
$pluginDirectories = Manager::getPluginsDirectories();
// merge with plugin translations if any
... | php | public function getAvailableLanguagesInfo($excludeNonCorePlugins=true)
{
$data = file_get_contents(PIWIK_INCLUDE_PATH . '/lang/en.json');
$englishTranslation = json_decode($data, true);
$pluginDirectories = Manager::getPluginsDirectories();
// merge with plugin translations if any
... | [
"public",
"function",
"getAvailableLanguagesInfo",
"(",
"$",
"excludeNonCorePlugins",
"=",
"true",
")",
"{",
"$",
"data",
"=",
"file_get_contents",
"(",
"PIWIK_INCLUDE_PATH",
".",
"'/lang/en.json'",
")",
";",
"$",
"englishTranslation",
"=",
"json_decode",
"(",
"$",
... | Return information on translations (code, language, % translated, etc)
@param boolean $excludeNonCorePlugins excludes non core plugin from percentage calculation
@return array Array of arrays | [
"Return",
"information",
"on",
"translations",
"(",
"code",
"language",
"%",
"translated",
"etc",
")"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/LanguagesManager/API.php#L103-L183 | train | Get available languages info | [
30522,
2270,
3853,
2131,
12462,
11733,
3468,
25023,
6692,
8449,
2378,
14876,
1006,
1002,
23329,
8540,
17345,
24759,
15916,
7076,
1027,
2995,
1007,
1063,
1002,
2951,
1027,
5371,
1035,
2131,
1035,
8417,
1006,
14255,
9148,
2243,
1035,
2421,
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/Zend/Db/Statement/Pdo.php | Zend_Db_Statement_Pdo.errorCode | public function errorCode()
{
try {
return $this->_stmt->errorCode();
} catch (PDOException $e) {
// require_once 'Zend/Db/Statement/Exception.php';
throw new Zend_Db_Statement_Exception($e->getMessage(), $e->getCode(), $e);
}
} | php | public function errorCode()
{
try {
return $this->_stmt->errorCode();
} catch (PDOException $e) {
// require_once 'Zend/Db/Statement/Exception.php';
throw new Zend_Db_Statement_Exception($e->getMessage(), $e->getCode(), $e);
}
} | [
"public",
"function",
"errorCode",
"(",
")",
"{",
"try",
"{",
"return",
"$",
"this",
"->",
"_stmt",
"->",
"errorCode",
"(",
")",
";",
"}",
"catch",
"(",
"PDOException",
"$",
"e",
")",
"{",
"// require_once 'Zend/Db/Statement/Exception.php';",
"throw",
"new",
... | Retrieves the error code, if any, associated with the last operation on
the statement handle.
@return string error code.
@throws Zend_Db_Statement_Exception | [
"Retrieves",
"the",
"error",
"code",
"if",
"any",
"associated",
"with",
"the",
"last",
"operation",
"on",
"the",
"statement",
"handle",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Statement/Pdo.php#L190-L198 | train | Return the last error code of the statement | [
30522,
2270,
3853,
7561,
16044,
1006,
1007,
1063,
3046,
1063,
2709,
1002,
2023,
1011,
1028,
1035,
2358,
20492,
1011,
1028,
7561,
16044,
1006,
1007,
1025,
1065,
4608,
1006,
22851,
8913,
2595,
24422,
1002,
1041,
1007,
1063,
1013,
1013,
5478,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Csrf/CsrfTokenManager.php | CsrfTokenManager.getToken | public function getToken($tokenId)
{
$namespacedId = $this->getNamespace().$tokenId;
if ($this->storage->hasToken($namespacedId)) {
$value = $this->storage->getToken($namespacedId);
} else {
$value = $this->generator->generateToken();
$this->storage->setT... | php | public function getToken($tokenId)
{
$namespacedId = $this->getNamespace().$tokenId;
if ($this->storage->hasToken($namespacedId)) {
$value = $this->storage->getToken($namespacedId);
} else {
$value = $this->generator->generateToken();
$this->storage->setT... | [
"public",
"function",
"getToken",
"(",
"$",
"tokenId",
")",
"{",
"$",
"namespacedId",
"=",
"$",
"this",
"->",
"getNamespace",
"(",
")",
".",
"$",
"tokenId",
";",
"if",
"(",
"$",
"this",
"->",
"storage",
"->",
"hasToken",
"(",
"$",
"namespacedId",
")",
... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Security/Csrf/CsrfTokenManager.php#L69-L81 | train | Get a token from the cache or generate a new one | [
30522,
2270,
3853,
2131,
18715,
2368,
1006,
1002,
19204,
3593,
1007,
1063,
1002,
3415,
15327,
4305,
2094,
1027,
1002,
2023,
1011,
1028,
2131,
18442,
23058,
1006,
1007,
1012,
1002,
19204,
3593,
1025,
2065,
1006,
1002,
2023,
1011,
1028,
5527,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Foundation/Application.php | Application.flush | public function flush()
{
parent::flush();
$this->buildStack = [];
$this->loadedProviders = [];
$this->bootedCallbacks = [];
$this->bootingCallbacks = [];
$this->deferredServices = [];
$this->reboundCallbacks = [];
$this->serviceProviders = [];
... | php | public function flush()
{
parent::flush();
$this->buildStack = [];
$this->loadedProviders = [];
$this->bootedCallbacks = [];
$this->bootingCallbacks = [];
$this->deferredServices = [];
$this->reboundCallbacks = [];
$this->serviceProviders = [];
... | [
"public",
"function",
"flush",
"(",
")",
"{",
"parent",
"::",
"flush",
"(",
")",
";",
"$",
"this",
"->",
"buildStack",
"=",
"[",
"]",
";",
"$",
"this",
"->",
"loadedProviders",
"=",
"[",
"]",
";",
"$",
"this",
"->",
"bootedCallbacks",
"=",
"[",
"]"... | Flush the container of all bindings and resolved instances.
@return void | [
"Flush",
"the",
"container",
"of",
"all",
"bindings",
"and",
"resolved",
"instances",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Foundation/Application.php#L1168-L1182 | train | Flushes the cache | [
30522,
2270,
3853,
13862,
1006,
1007,
1063,
6687,
1024,
1024,
13862,
1006,
1007,
1025,
1002,
2023,
1011,
1028,
16473,
2696,
3600,
1027,
1031,
1033,
1025,
1002,
2023,
1011,
1028,
8209,
21572,
17258,
2545,
1027,
1031,
1033,
1025,
1002,
2023,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Security/Guard/GuardAuthenticatorHandler.php | GuardAuthenticatorHandler.authenticateUserAndHandleSuccess | public function authenticateUserAndHandleSuccess(UserInterface $user, Request $request, AuthenticatorInterface $authenticator, string $providerKey): ?Response
{
// create an authenticated token for the User
$token = $authenticator->createAuthenticatedToken($user, $providerKey);
// authentica... | php | public function authenticateUserAndHandleSuccess(UserInterface $user, Request $request, AuthenticatorInterface $authenticator, string $providerKey): ?Response
{
// create an authenticated token for the User
$token = $authenticator->createAuthenticatedToken($user, $providerKey);
// authentica... | [
"public",
"function",
"authenticateUserAndHandleSuccess",
"(",
"UserInterface",
"$",
"user",
",",
"Request",
"$",
"request",
",",
"AuthenticatorInterface",
"$",
"authenticator",
",",
"string",
"$",
"providerKey",
")",
":",
"?",
"Response",
"{",
"// create an authentic... | Convenience method for authenticating the user and returning the
Response *if any* for success. | [
"Convenience",
"method",
"for",
"authenticating",
"the",
"user",
"and",
"returning",
"the",
"Response",
"*",
"if",
"any",
"*",
"for",
"success",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Security/Guard/GuardAuthenticatorHandler.php#L88-L97 | train | authenticate the user and return the success metric | [
30522,
2270,
3853,
14469,
3686,
20330,
5685,
11774,
4244,
14194,
9623,
2015,
1006,
5310,
18447,
2121,
12172,
1002,
5310,
1010,
5227,
1002,
5227,
1010,
14469,
8844,
18447,
2121,
12172,
1002,
14469,
8844,
1010,
5164,
1002,
10802,
14839,
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... |
guzzle/guzzle | src/Handler/StreamHandler.php | StreamHandler.createResource | private function createResource(callable $callback)
{
$errors = null;
set_error_handler(function ($_, $msg, $file, $line) use (&$errors) {
$errors[] = [
'message' => $msg,
'file' => $file,
'line' => $line
];
re... | php | private function createResource(callable $callback)
{
$errors = null;
set_error_handler(function ($_, $msg, $file, $line) use (&$errors) {
$errors[] = [
'message' => $msg,
'file' => $file,
'line' => $line
];
re... | [
"private",
"function",
"createResource",
"(",
"callable",
"$",
"callback",
")",
"{",
"$",
"errors",
"=",
"null",
";",
"set_error_handler",
"(",
"function",
"(",
"$",
"_",
",",
"$",
"msg",
",",
"$",
"file",
",",
"$",
"line",
")",
"use",
"(",
"&",
"$",... | Create a resource and check to ensure it was created successfully
@param callable $callback Callable that returns stream resource
@return resource
@throws \RuntimeException on error | [
"Create",
"a",
"resource",
"and",
"check",
"to",
"ensure",
"it",
"was",
"created",
"successfully"
] | bf595424e4d442a190582e088985dc835a789071 | https://github.com/guzzle/guzzle/blob/bf595424e4d442a190582e088985dc835a789071/src/Handler/StreamHandler.php#L230-L256 | train | Create resource from callback | [
30522,
2797,
3853,
3443,
6072,
8162,
3401,
1006,
2655,
3085,
1002,
2655,
5963,
1007,
1063,
1002,
10697,
1027,
19701,
1025,
2275,
1035,
7561,
1035,
28213,
1006,
3853,
1006,
1002,
1035,
1010,
1002,
5796,
2290,
1010,
1002,
5371,
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... |
matomo-org/matomo | core/Db.php | Db.exec | public static function exec($sql)
{
/** @var \Zend_Db_Adapter_Abstract $db */
$db = self::get();
$profiler = $db->getProfiler();
$q = $profiler->queryStart($sql, \Zend_Db_Profiler::INSERT);
try {
self::logSql(__FUNCTION__, $sql);
$return = self::get(... | php | public static function exec($sql)
{
/** @var \Zend_Db_Adapter_Abstract $db */
$db = self::get();
$profiler = $db->getProfiler();
$q = $profiler->queryStart($sql, \Zend_Db_Profiler::INSERT);
try {
self::logSql(__FUNCTION__, $sql);
$return = self::get(... | [
"public",
"static",
"function",
"exec",
"(",
"$",
"sql",
")",
"{",
"/** @var \\Zend_Db_Adapter_Abstract $db */",
"$",
"db",
"=",
"self",
"::",
"get",
"(",
")",
";",
"$",
"profiler",
"=",
"$",
"db",
"->",
"getProfiler",
"(",
")",
";",
"$",
"q",
"=",
"$"... | Executes an unprepared SQL query. Recommended for DDL statements like `CREATE`,
`DROP` and `ALTER`. The return value is DBMS-specific. For MySQLI, it returns the
number of rows affected. For PDO, it returns a
[Zend_Db_Statement](http://framework.zend.com/manual/1.12/en/zend.db.statement.html) object.
@param string $sq... | [
"Executes",
"an",
"unprepared",
"SQL",
"query",
".",
"Recommended",
"for",
"DDL",
"statements",
"like",
"CREATE",
"DROP",
"and",
"ALTER",
".",
"The",
"return",
"value",
"is",
"DBMS",
"-",
"specific",
".",
"For",
"MySQLI",
"it",
"returns",
"the",
"number",
... | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Db.php#L160-L179 | train | Execute a SQL statement and return the result | [
30522,
2270,
10763,
3853,
4654,
8586,
1006,
1002,
29296,
1007,
1063,
1013,
1008,
1008,
1030,
13075,
1032,
30524,
2131,
1006,
1007,
1025,
1002,
6337,
2099,
1027,
1002,
16962,
1011,
1028,
2131,
21572,
8873,
3917,
1006,
1007,
1025,
1002,
1053,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/PluginManager.php | PluginManager.getRegistrationMethodValues | public function getRegistrationMethodValues($methodName)
{
if (isset($this->registrationMethodCache[$methodName])) {
return $this->registrationMethodCache[$methodName];
}
$results = [];
$plugins = $this->getPlugins();
foreach ($plugins as $id => $plugin) {
... | php | public function getRegistrationMethodValues($methodName)
{
if (isset($this->registrationMethodCache[$methodName])) {
return $this->registrationMethodCache[$methodName];
}
$results = [];
$plugins = $this->getPlugins();
foreach ($plugins as $id => $plugin) {
... | [
"public",
"function",
"getRegistrationMethodValues",
"(",
"$",
"methodName",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"registrationMethodCache",
"[",
"$",
"methodName",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"registrationMethodCache",
"[... | Spins over every plugin object and collects the results of a method call.
@param string $methodName
@return array | [
"Spins",
"over",
"every",
"plugin",
"object",
"and",
"collects",
"the",
"results",
"of",
"a",
"method",
"call",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/PluginManager.php#L459-L477 | train | Get Registration Method Values | [
30522,
2270,
3853,
2131,
2890,
24063,
8156,
11368,
6806,
2094,
10175,
15808,
1006,
1002,
4118,
18442,
1007,
1063,
2065,
1006,
26354,
3388,
1006,
1002,
2023,
1011,
1028,
8819,
11368,
6806,
16409,
15395,
1031,
1002,
4118,
18442,
1033,
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... |
laravel/framework | src/Illuminate/Routing/UrlGenerator.php | UrlGenerator.signedRoute | public function signedRoute($name, $parameters = [], $expiration = null, $absolute = true)
{
$parameters = $this->formatParameters($parameters);
if ($expiration) {
$parameters = $parameters + ['expires' => $this->availableAt($expiration)];
}
ksort($parameters);
... | php | public function signedRoute($name, $parameters = [], $expiration = null, $absolute = true)
{
$parameters = $this->formatParameters($parameters);
if ($expiration) {
$parameters = $parameters + ['expires' => $this->availableAt($expiration)];
}
ksort($parameters);
... | [
"public",
"function",
"signedRoute",
"(",
"$",
"name",
",",
"$",
"parameters",
"=",
"[",
"]",
",",
"$",
"expiration",
"=",
"null",
",",
"$",
"absolute",
"=",
"true",
")",
"{",
"$",
"parameters",
"=",
"$",
"this",
"->",
"formatParameters",
"(",
"$",
"... | Create a signed route URL for a named route.
@param string $name
@param array $parameters
@param \DateTimeInterface|\DateInterval|int $expiration
@param bool $absolute
@return string | [
"Create",
"a",
"signed",
"route",
"URL",
"for",
"a",
"named",
"route",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/UrlGenerator.php#L318-L333 | train | Generate a signed route. | [
30522,
2270,
3853,
2772,
22494,
2618,
1006,
1002,
2171,
1010,
1002,
11709,
1027,
1031,
1033,
1010,
1002,
4654,
16781,
1027,
19701,
1010,
1002,
7619,
1027,
2995,
1007,
1063,
1002,
11709,
1027,
1002,
2023,
1011,
1028,
4289,
28689,
22828,
2015... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/cms/twig/Extension.php | Extension.partialFunction | public function partialFunction($name, $parameters = [], $throwException = false)
{
return $this->controller->renderPartial($name, $parameters, $throwException);
} | php | public function partialFunction($name, $parameters = [], $throwException = false)
{
return $this->controller->renderPartial($name, $parameters, $throwException);
} | [
"public",
"function",
"partialFunction",
"(",
"$",
"name",
",",
"$",
"parameters",
"=",
"[",
"]",
",",
"$",
"throwException",
"=",
"false",
")",
"{",
"return",
"$",
"this",
"->",
"controller",
"->",
"renderPartial",
"(",
"$",
"name",
",",
"$",
"parameter... | Renders a partial.
@param string $name Specifies the partial name.
@param array $parameters A optional list of parameters to pass to the partial.
@param bool $throwException Throw an exception if the partial is not found.
@return string Returns the partial contents. | [
"Renders",
"a",
"partial",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/twig/Extension.php#L100-L103 | train | Render partial function | [
30522,
2270,
3853,
7704,
11263,
27989,
1006,
1002,
2171,
1010,
1002,
11709,
1027,
1031,
1033,
1010,
1002,
5466,
10288,
24422,
1027,
6270,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
11486,
1011,
1028,
17552,
19362,
20925,
1006,
1002,
2171,
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/Database/Query/Grammars/SQLiteGrammar.php | SQLiteGrammar.compileJsonLength | protected function compileJsonLength($column, $operator, $value)
{
[$field, $path] = $this->wrapJsonFieldAndPath($column);
return 'json_array_length('.$field.$path.') '.$operator.' '.$value;
} | php | protected function compileJsonLength($column, $operator, $value)
{
[$field, $path] = $this->wrapJsonFieldAndPath($column);
return 'json_array_length('.$field.$path.') '.$operator.' '.$value;
} | [
"protected",
"function",
"compileJsonLength",
"(",
"$",
"column",
",",
"$",
"operator",
",",
"$",
"value",
")",
"{",
"[",
"$",
"field",
",",
"$",
"path",
"]",
"=",
"$",
"this",
"->",
"wrapJsonFieldAndPath",
"(",
"$",
"column",
")",
";",
"return",
"'jso... | Compile a "JSON length" statement into SQL.
@param string $column
@param string $operator
@param string $value
@return string | [
"Compile",
"a",
"JSON",
"length",
"statement",
"into",
"SQL",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Query/Grammars/SQLiteGrammar.php#L158-L163 | train | Compiles JSON length | [
30522,
5123,
3853,
4012,
22090,
22578,
2239,
7770,
13512,
2232,
1006,
1002,
5930,
1010,
1002,
6872,
1010,
1002,
3643,
1007,
1063,
1031,
1002,
2492,
1010,
1002,
4130,
1033,
1027,
1002,
2023,
1011,
1028,
10236,
22578,
2239,
3790,
5685,
15069,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Foundation/Auth/VerifiesEmails.php | VerifiesEmails.show | public function show(Request $request)
{
return $request->user()->hasVerifiedEmail()
? redirect($this->redirectPath())
: view('auth.verify');
} | php | public function show(Request $request)
{
return $request->user()->hasVerifiedEmail()
? redirect($this->redirectPath())
: view('auth.verify');
} | [
"public",
"function",
"show",
"(",
"Request",
"$",
"request",
")",
"{",
"return",
"$",
"request",
"->",
"user",
"(",
")",
"->",
"hasVerifiedEmail",
"(",
")",
"?",
"redirect",
"(",
"$",
"this",
"->",
"redirectPath",
"(",
")",
")",
":",
"view",
"(",
"'... | Show the email verification notice.
@param \Illuminate\Http\Request $request
@return \Illuminate\Http\Response | [
"Show",
"the",
"email",
"verification",
"notice",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Foundation/Auth/VerifiesEmails.php#L19-L24 | train | Show the user verification page | [
30522,
2270,
3853,
2265,
1006,
5227,
1002,
5227,
1007,
1063,
2709,
1002,
5227,
1011,
1028,
5310,
1006,
1007,
1011,
1028,
2038,
6299,
7810,
14545,
4014,
1006,
1007,
1029,
2417,
7442,
6593,
1006,
1002,
2023,
1011,
1028,
2417,
7442,
6593,
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... |
laravel/framework | src/Illuminate/Database/Query/Builder.php | Builder.createSub | protected function createSub($query)
{
// If the given query is a Closure, we will execute it while passing in a new
// query instance to the Closure. This will give the developer a chance to
// format and work with the query before we cast it to a raw SQL string.
if ($query instance... | php | protected function createSub($query)
{
// If the given query is a Closure, we will execute it while passing in a new
// query instance to the Closure. This will give the developer a chance to
// format and work with the query before we cast it to a raw SQL string.
if ($query instance... | [
"protected",
"function",
"createSub",
"(",
"$",
"query",
")",
"{",
"// If the given query is a Closure, we will execute it while passing in a new",
"// query instance to the Closure. This will give the developer a chance to",
"// format and work with the query before we cast it to a raw SQL stri... | Creates a subquery and parse it.
@param \Closure|\Illuminate\Database\Query\Builder|string $query
@return array | [
"Creates",
"a",
"subquery",
"and",
"parse",
"it",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Query/Builder.php#L301-L313 | train | Create a sub query | [
30522,
5123,
3853,
9005,
12083,
1006,
1002,
23032,
1007,
1063,
1013,
1013,
2065,
1996,
2445,
23032,
2003,
1037,
8503,
1010,
2057,
2097,
15389,
2009,
2096,
4458,
1999,
1037,
2047,
1013,
1013,
23032,
6013,
2000,
1996,
8503,
1012,
2023,
2097,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/backend/behaviors/FormController.php | FormController.create | public function create($context = null)
{
try {
$this->context = strlen($context) ? $context : $this->getConfig('create[context]', self::CONTEXT_CREATE);
$this->controller->pageTitle = $this->controller->pageTitle ?: $this->getLang(
"{$this->context}[title]",
... | php | public function create($context = null)
{
try {
$this->context = strlen($context) ? $context : $this->getConfig('create[context]', self::CONTEXT_CREATE);
$this->controller->pageTitle = $this->controller->pageTitle ?: $this->getLang(
"{$this->context}[title]",
... | [
"public",
"function",
"create",
"(",
"$",
"context",
"=",
"null",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"context",
"=",
"strlen",
"(",
"$",
"context",
")",
"?",
"$",
"context",
":",
"$",
"this",
"->",
"getConfig",
"(",
"'create[context]'",
",",
"s... | Controller "create" action used for creating new model records.
@param string $context Form context
@return void | [
"Controller",
"create",
"action",
"used",
"for",
"creating",
"new",
"model",
"records",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/behaviors/FormController.php#L202-L219 | train | Create form for the given context | [
30522,
2270,
3853,
3443,
1006,
1002,
6123,
1027,
19701,
1007,
1063,
3046,
1063,
1002,
2023,
1011,
1028,
6123,
1027,
2358,
20927,
2078,
1006,
1002,
6123,
1007,
1029,
1002,
6123,
1024,
1002,
2023,
1011,
1028,
2131,
8663,
8873,
2290,
1006,
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/Cache/Backend/File.php | Zend_Cache_Backend_File._getMetadatas | protected function _getMetadatas($id)
{
if (isset($this->_metadatasArray[$id])) {
return $this->_metadatasArray[$id];
} else {
$metadatas = $this->_loadMetadatas($id);
if (!$metadatas) {
return false;
}
$this->_setMetadatas(... | php | protected function _getMetadatas($id)
{
if (isset($this->_metadatasArray[$id])) {
return $this->_metadatasArray[$id];
} else {
$metadatas = $this->_loadMetadatas($id);
if (!$metadatas) {
return false;
}
$this->_setMetadatas(... | [
"protected",
"function",
"_getMetadatas",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_metadatasArray",
"[",
"$",
"id",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"_metadatasArray",
"[",
"$",
"id",
"]",
";",
"}",
"e... | Get a metadatas record
@param string $id Cache id
@return array|false Associative array of metadatas | [
"Get",
"a",
"metadatas",
"record"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache/Backend/File.php#L475-L487 | train | Return the Metadatas array if it exists otherwise return false | [
30522,
5123,
3853,
1035,
2131,
11368,
8447,
10230,
1006,
1002,
8909,
1007,
1063,
2065,
1006,
26354,
3388,
1006,
1002,
2023,
1011,
1028,
1035,
27425,
10286,
9447,
1031,
1002,
8909,
1033,
1007,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
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... |
laravel/framework | src/Illuminate/Queue/SerializableClosure.php | SerializableClosure.resolveUseVariables | protected function resolveUseVariables($data)
{
foreach ($data as $key => $value) {
$data[$key] = $this->getRestoredPropertyValue($value);
}
return $data;
} | php | protected function resolveUseVariables($data)
{
foreach ($data as $key => $value) {
$data[$key] = $this->getRestoredPropertyValue($value);
}
return $data;
} | [
"protected",
"function",
"resolveUseVariables",
"(",
"$",
"data",
")",
"{",
"foreach",
"(",
"$",
"data",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"data",
"[",
"$",
"key",
"]",
"=",
"$",
"this",
"->",
"getRestoredPropertyValue",
"(",
"$",
... | Resolve the use variables after unserialization.
@param array $data The Closure's transformed use variables
@return array | [
"Resolve",
"the",
"use",
"variables",
"after",
"unserialization",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Queue/SerializableClosure.php#L32-L39 | train | Resolve use variables | [
30522,
5123,
3853,
10663,
8557,
10755,
19210,
2015,
1006,
1002,
2951,
1007,
1063,
18921,
6776,
1006,
1002,
2951,
2004,
1002,
3145,
1027,
1028,
1002,
3643,
1007,
1063,
1002,
2951,
1031,
1002,
3145,
1033,
1027,
1002,
2023,
1011,
1028,
2131,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Database/Eloquent/Relations/HasManyThrough.php | HasManyThrough.getRelationExistenceQuery | public function getRelationExistenceQuery(Builder $query, Builder $parentQuery, $columns = ['*'])
{
if ($parentQuery->getQuery()->from === $query->getQuery()->from) {
return $this->getRelationExistenceQueryForSelfRelation($query, $parentQuery, $columns);
}
if ($parentQuery->getQ... | php | public function getRelationExistenceQuery(Builder $query, Builder $parentQuery, $columns = ['*'])
{
if ($parentQuery->getQuery()->from === $query->getQuery()->from) {
return $this->getRelationExistenceQueryForSelfRelation($query, $parentQuery, $columns);
}
if ($parentQuery->getQ... | [
"public",
"function",
"getRelationExistenceQuery",
"(",
"Builder",
"$",
"query",
",",
"Builder",
"$",
"parentQuery",
",",
"$",
"columns",
"=",
"[",
"'*'",
"]",
")",
"{",
"if",
"(",
"$",
"parentQuery",
"->",
"getQuery",
"(",
")",
"->",
"from",
"===",
"$",... | Add the constraints for a relationship query.
@param \Illuminate\Database\Eloquent\Builder $query
@param \Illuminate\Database\Eloquent\Builder $parentQuery
@param array|mixed $columns
@return \Illuminate\Database\Eloquent\Builder | [
"Add",
"the",
"constraints",
"for",
"a",
"relationship",
"query",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Relations/HasManyThrough.php#L501-L516 | train | Get the query for the relation existence | [
30522,
2270,
3853,
2131,
16570,
3370,
10288,
27870,
5897,
4226,
2854,
1006,
12508,
1002,
23032,
1010,
12508,
1002,
6687,
4226,
2854,
1010,
1002,
7753,
1027,
1031,
1005,
1008,
1005,
1033,
1007,
1063,
2065,
1006,
1002,
6687,
4226,
2854,
1011,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Database/Query/Builder.php | Builder.whereNotIn | public function whereNotIn($column, $values, $boolean = 'and')
{
return $this->whereIn($column, $values, $boolean, true);
} | php | public function whereNotIn($column, $values, $boolean = 'and')
{
return $this->whereIn($column, $values, $boolean, true);
} | [
"public",
"function",
"whereNotIn",
"(",
"$",
"column",
",",
"$",
"values",
",",
"$",
"boolean",
"=",
"'and'",
")",
"{",
"return",
"$",
"this",
"->",
"whereIn",
"(",
"$",
"column",
",",
"$",
"values",
",",
"$",
"boolean",
",",
"true",
")",
";",
"}"... | Add a "where not in" clause to the query.
@param string $column
@param mixed $values
@param string $boolean
@return \Illuminate\Database\Query\Builder|static | [
"Add",
"a",
"where",
"not",
"in",
"clause",
"to",
"the",
"query",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Query/Builder.php#L895-L898 | train | Devuelve el where not in para el campo | [
30522,
2270,
3853,
2073,
17048,
2378,
1006,
1002,
5930,
1010,
1002,
5300,
1010,
1002,
22017,
20898,
1027,
1005,
1998,
1005,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
16726,
1006,
1002,
5930,
1010,
1002,
5300,
1010,
1002,
22017,
20898,
1010,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Queue/SerializesAndRestoresModelIdentifiers.php | SerializesAndRestoresModelIdentifiers.restoreCollection | protected function restoreCollection($value)
{
if (! $value->class || count($value->id) === 0) {
return new EloquentCollection;
}
return $this->getQueryForModelRestoration(
(new $value->class)->setConnection($value->connection), $value->id
)->useWritePdo()->g... | php | protected function restoreCollection($value)
{
if (! $value->class || count($value->id) === 0) {
return new EloquentCollection;
}
return $this->getQueryForModelRestoration(
(new $value->class)->setConnection($value->connection), $value->id
)->useWritePdo()->g... | [
"protected",
"function",
"restoreCollection",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"$",
"value",
"->",
"class",
"||",
"count",
"(",
"$",
"value",
"->",
"id",
")",
"===",
"0",
")",
"{",
"return",
"new",
"EloquentCollection",
";",
"}",
"return",
... | Restore a queueable collection instance.
@param \Illuminate\Contracts\Database\ModelIdentifier $value
@return \Illuminate\Database\Eloquent\Collection | [
"Restore",
"a",
"queueable",
"collection",
"instance",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Queue/SerializesAndRestoresModelIdentifiers.php#L64-L73 | train | Restores a collection of models | [
30522,
5123,
3853,
9239,
26895,
18491,
1006,
1002,
3643,
1007,
1063,
2065,
1006,
999,
1002,
3643,
1011,
1028,
2465,
1064,
1064,
4175,
1006,
1002,
3643,
1011,
1028,
8909,
1007,
1027,
1027,
1027,
1014,
1007,
1063,
2709,
2047,
3449,
2080,
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.