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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
laravel/framework | src/Illuminate/Database/Eloquent/Relations/MorphTo.php | MorphTo.buildDictionary | protected function buildDictionary(Collection $models)
{
foreach ($models as $model) {
if ($model->{$this->morphType}) {
$this->dictionary[$model->{$this->morphType}][$model->{$this->foreignKey}][] = $model;
}
}
} | php | protected function buildDictionary(Collection $models)
{
foreach ($models as $model) {
if ($model->{$this->morphType}) {
$this->dictionary[$model->{$this->morphType}][$model->{$this->foreignKey}][] = $model;
}
}
} | [
"protected",
"function",
"buildDictionary",
"(",
"Collection",
"$",
"models",
")",
"{",
"foreach",
"(",
"$",
"models",
"as",
"$",
"model",
")",
"{",
"if",
"(",
"$",
"model",
"->",
"{",
"$",
"this",
"->",
"morphType",
"}",
")",
"{",
"$",
"this",
"->",... | Build a dictionary with the models.
@param \Illuminate\Database\Eloquent\Collection $models
@return void | [
"Build",
"a",
"dictionary",
"with",
"the",
"models",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Relations/MorphTo.php#L75-L82 | train | Build the dictionary for the given models | [
30522,
5123,
3853,
3857,
29201,
3258,
5649,
1006,
3074,
1002,
4275,
1007,
1063,
18921,
6776,
30524,
1011,
1028,
9206,
1031,
1002,
2944,
1011,
1028,
1063,
1002,
2023,
1011,
1028,
22822,
8458,
13874,
1065,
1033,
1031,
1002,
2944,
1011,
1028,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Foundation/Console/PackageDiscoverCommand.php | PackageDiscoverCommand.handle | public function handle(PackageManifest $manifest)
{
$manifest->build();
foreach (array_keys($manifest->manifest) as $package) {
$this->line("Discovered Package: <info>{$package}</info>");
}
$this->info('Package manifest generated successfully.');
} | php | public function handle(PackageManifest $manifest)
{
$manifest->build();
foreach (array_keys($manifest->manifest) as $package) {
$this->line("Discovered Package: <info>{$package}</info>");
}
$this->info('Package manifest generated successfully.');
} | [
"public",
"function",
"handle",
"(",
"PackageManifest",
"$",
"manifest",
")",
"{",
"$",
"manifest",
"->",
"build",
"(",
")",
";",
"foreach",
"(",
"array_keys",
"(",
"$",
"manifest",
"->",
"manifest",
")",
"as",
"$",
"package",
")",
"{",
"$",
"this",
"-... | Execute the console command.
@param \Illuminate\Foundation\PackageManifest $manifest
@return void | [
"Execute",
"the",
"console",
"command",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Foundation/Console/PackageDiscoverCommand.php#L30-L39 | train | Handle the package manifest | [
30522,
2270,
3853,
5047,
1006,
7427,
20799,
14081,
1002,
19676,
1007,
1063,
1002,
19676,
1011,
1028,
3857,
1006,
1007,
1025,
18921,
6776,
1006,
9140,
1035,
6309,
1006,
1002,
19676,
1011,
1028,
19676,
1007,
2004,
1002,
7427,
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... |
symfony/symfony | src/Symfony/Component/HttpClient/NativeHttpClient.php | NativeHttpClient.request | public function request(string $method, string $url, array $options = []): ResponseInterface
{
[$url, $options] = self::prepareRequest($method, $url, $options, $this->defaultOptions);
if ($options['bindto'] && file_exists($options['bindto'])) {
throw new TransportException(__CLASS__.' c... | php | public function request(string $method, string $url, array $options = []): ResponseInterface
{
[$url, $options] = self::prepareRequest($method, $url, $options, $this->defaultOptions);
if ($options['bindto'] && file_exists($options['bindto'])) {
throw new TransportException(__CLASS__.' c... | [
"public",
"function",
"request",
"(",
"string",
"$",
"method",
",",
"string",
"$",
"url",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
":",
"ResponseInterface",
"{",
"[",
"$",
"url",
",",
"$",
"options",
"]",
"=",
"self",
"::",
"prepareRequest",
... | @see HttpClientInterface::OPTIONS_DEFAULTS for available options
{@inheritdoc} | [
"@see",
"HttpClientInterface",
"::",
"OPTIONS_DEFAULTS",
"for",
"available",
"options"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpClient/NativeHttpClient.php#L65-L207 | train | Makes a request to the remote server. | [
30522,
2270,
3853,
5227,
1006,
5164,
1002,
4118,
1010,
5164,
1002,
24471,
2140,
1010,
9140,
1002,
7047,
1027,
1031,
1033,
1007,
1024,
3433,
18447,
2121,
12172,
1063,
1031,
1002,
24471,
2140,
1010,
1002,
7047,
1033,
1027,
2969,
1024,
1024,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Foundation/Console/AppNameCommand.php | AppNameCommand.setDatabaseFactoryNamespaces | protected function setDatabaseFactoryNamespaces()
{
$files = Finder::create()
->in(database_path('factories'))
->contains($this->currentRoot)
->name('*.php');
foreach ($files as $file) {
$this->replaceIn... | php | protected function setDatabaseFactoryNamespaces()
{
$files = Finder::create()
->in(database_path('factories'))
->contains($this->currentRoot)
->name('*.php');
foreach ($files as $file) {
$this->replaceIn... | [
"protected",
"function",
"setDatabaseFactoryNamespaces",
"(",
")",
"{",
"$",
"files",
"=",
"Finder",
"::",
"create",
"(",
")",
"->",
"in",
"(",
"database_path",
"(",
"'factories'",
")",
")",
"->",
"contains",
"(",
"$",
"this",
"->",
"currentRoot",
")",
"->... | Set the namespace in database factory files.
@return void | [
"Set",
"the",
"namespace",
"in",
"database",
"factory",
"files",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Foundation/Console/AppNameCommand.php#L224-L237 | train | Set namespaces in database factory namespaces | [
30522,
5123,
3853,
2275,
2850,
2696,
15058,
21450,
18442,
23058,
2015,
1006,
1007,
1063,
1002,
6764,
1027,
2424,
2121,
1024,
1024,
3443,
1006,
1007,
1011,
1028,
1999,
1006,
7809,
1035,
4130,
1006,
1005,
11123,
1005,
1007,
1007,
1011,
1028,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/HttpFoundation/Response.php | Response.setLastModified | public function setLastModified(\DateTimeInterface $date = null)
{
if (null === $date) {
$this->headers->remove('Last-Modified');
return $this;
}
if ($date instanceof \DateTime) {
$date = \DateTimeImmutable::createFromMutable($date);
}
$... | php | public function setLastModified(\DateTimeInterface $date = null)
{
if (null === $date) {
$this->headers->remove('Last-Modified');
return $this;
}
if ($date instanceof \DateTime) {
$date = \DateTimeImmutable::createFromMutable($date);
}
$... | [
"public",
"function",
"setLastModified",
"(",
"\\",
"DateTimeInterface",
"$",
"date",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"date",
")",
"{",
"$",
"this",
"->",
"headers",
"->",
"remove",
"(",
"'Last-Modified'",
")",
";",
"return",
"$",
... | Sets the Last-Modified HTTP header with a DateTime instance.
Passing null as value will remove the header.
@return $this
@final | [
"Sets",
"the",
"Last",
"-",
"Modified",
"HTTP",
"header",
"with",
"a",
"DateTime",
"instance",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpFoundation/Response.php#L876-L892 | train | Set Last - Modified | [
30522,
2270,
3853,
2275,
8523,
21246,
7716,
7810,
1006,
1032,
3058,
7292,
18447,
2121,
12172,
1002,
3058,
1027,
19701,
1007,
1063,
2065,
1006,
19701,
1027,
1027,
1027,
1002,
3058,
1007,
1063,
1002,
2023,
1011,
1028,
20346,
2015,
1011,
1028,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Validator/DataCollector/ValidatorDataCollector.php | ValidatorDataCollector.lateCollect | public function lateCollect()
{
$collected = $this->validator->getCollectedData();
$this->data['calls'] = $this->cloneVar($collected);
$this->data['violations_count'] = array_reduce($collected, function ($previous, $item) {
return $previous + \count($item['violations']);
... | php | public function lateCollect()
{
$collected = $this->validator->getCollectedData();
$this->data['calls'] = $this->cloneVar($collected);
$this->data['violations_count'] = array_reduce($collected, function ($previous, $item) {
return $previous + \count($item['violations']);
... | [
"public",
"function",
"lateCollect",
"(",
")",
"{",
"$",
"collected",
"=",
"$",
"this",
"->",
"validator",
"->",
"getCollectedData",
"(",
")",
";",
"$",
"this",
"->",
"data",
"[",
"'calls'",
"]",
"=",
"$",
"this",
"->",
"cloneVar",
"(",
"$",
"collected... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Validator/DataCollector/ValidatorDataCollector.php#L57-L64 | train | Late collect the calls and violations count | [
30522,
2270,
3853,
2397,
26895,
22471,
1006,
1007,
1063,
1002,
5067,
1027,
1002,
2023,
1011,
1028,
9398,
8844,
1011,
1028,
2131,
26895,
22471,
22367,
6790,
1006,
1007,
1025,
1002,
2023,
1011,
1028,
2951,
1031,
1005,
4455,
1005,
1033,
1027,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Auth/Access/Gate.php | Gate.define | public function define($ability, $callback)
{
if (is_callable($callback)) {
$this->abilities[$ability] = $callback;
} elseif (is_string($callback)) {
$this->stringCallbacks[$ability] = $callback;
$this->abilities[$ability] = $this->buildAbilityCallback($ability, ... | php | public function define($ability, $callback)
{
if (is_callable($callback)) {
$this->abilities[$ability] = $callback;
} elseif (is_string($callback)) {
$this->stringCallbacks[$ability] = $callback;
$this->abilities[$ability] = $this->buildAbilityCallback($ability, ... | [
"public",
"function",
"define",
"(",
"$",
"ability",
",",
"$",
"callback",
")",
"{",
"if",
"(",
"is_callable",
"(",
"$",
"callback",
")",
")",
"{",
"$",
"this",
"->",
"abilities",
"[",
"$",
"ability",
"]",
"=",
"$",
"callback",
";",
"}",
"elseif",
... | Define a new ability.
@param string $ability
@param callable|string $callback
@return $this
@throws \InvalidArgumentException | [
"Define",
"a",
"new",
"ability",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Auth/Access/Gate.php#L127-L140 | train | Define an ability callback | [
30522,
2270,
3853,
9375,
1006,
1002,
3754,
1010,
1002,
2655,
5963,
1007,
1063,
2065,
1006,
2003,
1035,
2655,
3085,
1006,
1002,
2655,
5963,
30524,
1033,
1027,
1002,
2655,
5963,
1025,
1065,
2842,
10128,
1006,
2003,
1035,
5164,
1006,
1002,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/backend/classes/WidgetManager.php | WidgetManager.registerFormWidget | public function registerFormWidget($className, $widgetInfo = null)
{
if (!is_array($widgetInfo)) {
$widgetInfo = ['code' => $widgetInfo];
}
$widgetCode = $widgetInfo['code'] ?? null;
if (!$widgetCode) {
$widgetCode = Str::getClassId($className);
}
... | php | public function registerFormWidget($className, $widgetInfo = null)
{
if (!is_array($widgetInfo)) {
$widgetInfo = ['code' => $widgetInfo];
}
$widgetCode = $widgetInfo['code'] ?? null;
if (!$widgetCode) {
$widgetCode = Str::getClassId($className);
}
... | [
"public",
"function",
"registerFormWidget",
"(",
"$",
"className",
",",
"$",
"widgetInfo",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"widgetInfo",
")",
")",
"{",
"$",
"widgetInfo",
"=",
"[",
"'code'",
"=>",
"$",
"widgetInfo",
"]",
";... | Registers a single form widget.
@param string $className Widget class name.
@param array $widgetInfo Registration information, can contain a `code` key.
@return void | [
"Registers",
"a",
"single",
"form",
"widget",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/WidgetManager.php#L100-L114 | train | Registers a form widget | [
30522,
2270,
3853,
4236,
14192,
9148,
24291,
1006,
1002,
2465,
18442,
1010,
1002,
15536,
24291,
2378,
14876,
1027,
19701,
1007,
1063,
2065,
1006,
999,
2003,
1035,
9140,
1006,
1002,
15536,
24291,
2378,
14876,
1007,
1007,
1063,
1002,
15536,
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/Processor/DebugProcessor.php | DebugProcessor.getLogs | public function getLogs(/* Request $request = null */)
{
if (\func_num_args() < 1 && __CLASS__ !== \get_class($this) && __CLASS__ !== (new \ReflectionMethod($this, __FUNCTION__))->getDeclaringClass()->getName() && !$this instanceof \PHPUnit\Framework\MockObject\MockObject && !$this instanceof \Prophecy\Prop... | php | public function getLogs(/* Request $request = null */)
{
if (\func_num_args() < 1 && __CLASS__ !== \get_class($this) && __CLASS__ !== (new \ReflectionMethod($this, __FUNCTION__))->getDeclaringClass()->getName() && !$this instanceof \PHPUnit\Framework\MockObject\MockObject && !$this instanceof \Prophecy\Prop... | [
"public",
"function",
"getLogs",
"(",
"/* Request $request = null */",
")",
"{",
"if",
"(",
"\\",
"func_num_args",
"(",
")",
"<",
"1",
"&&",
"__CLASS__",
"!==",
"\\",
"get_class",
"(",
"$",
"this",
")",
"&&",
"__CLASS__",
"!==",
"(",
"new",
"\\",
"Reflecti... | {@inheritdoc}
@param Request|null $request | [
"{",
"@inheritdoc",
"}"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bridge/Monolog/Processor/DebugProcessor.php#L64-L79 | train | Returns the log records. | [
30522,
2270,
3853,
2131,
21197,
2015,
1006,
1013,
1008,
5227,
1002,
5227,
1027,
19701,
1008,
1013,
1007,
1063,
2065,
1006,
1032,
4569,
2278,
1035,
16371,
2213,
1035,
12098,
5620,
1006,
1007,
1026,
1015,
1004,
1004,
1035,
1035,
2465,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/Zend/Cache/Backend/Sqlite.php | Zend_Cache_Backend_Sqlite._clean | private function _clean($mode = Zend_Cache::CLEANING_MODE_ALL, $tags = array())
{
switch ($mode) {
case Zend_Cache::CLEANING_MODE_ALL:
$res1 = $this->_query('DELETE FROM cache');
$res2 = $this->_query('DELETE FROM tag');
return $res1 && $res2;
... | php | private function _clean($mode = Zend_Cache::CLEANING_MODE_ALL, $tags = array())
{
switch ($mode) {
case Zend_Cache::CLEANING_MODE_ALL:
$res1 = $this->_query('DELETE FROM cache');
$res2 = $this->_query('DELETE FROM tag');
return $res1 && $res2;
... | [
"private",
"function",
"_clean",
"(",
"$",
"mode",
"=",
"Zend_Cache",
"::",
"CLEANING_MODE_ALL",
",",
"$",
"tags",
"=",
"array",
"(",
")",
")",
"{",
"switch",
"(",
"$",
"mode",
")",
"{",
"case",
"Zend_Cache",
"::",
"CLEANING_MODE_ALL",
":",
"$",
"res1",
... | Clean some cache records
Available modes are :
Zend_Cache::CLEANING_MODE_ALL (default) => remove all cache entries ($tags is not used)
Zend_Cache::CLEANING_MODE_OLD => remove too old cache entries ($tags is not used)
Zend_Cache::CLEANING_MODE_MATCHING_TAG => remove cache entries matching all given ... | [
"Clean",
"some",
"cache",
"records"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache/Backend/Sqlite.php#L614-L656 | train | Remove all cache entries matching given tags | [
30522,
2797,
3853,
1035,
4550,
1006,
1002,
5549,
1027,
16729,
2094,
1035,
17053,
1024,
1024,
9344,
1035,
5549,
1035,
2035,
1010,
1002,
22073,
1027,
9140,
1006,
1007,
1007,
1063,
6942,
1006,
1002,
5549,
1007,
1063,
2553,
16729,
2094,
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... |
octobercms/october | modules/cms/models/ThemeImport.php | ThemeImport.copyDirectory | protected function copyDirectory($directory, $destination)
{
// Preference is to overwrite existing files
if ($this->overwrite) {
return File::copyDirectory($directory, $destination);
}
if (!File::isDirectory($directory)) {
return false;
}
$o... | php | protected function copyDirectory($directory, $destination)
{
// Preference is to overwrite existing files
if ($this->overwrite) {
return File::copyDirectory($directory, $destination);
}
if (!File::isDirectory($directory)) {
return false;
}
$o... | [
"protected",
"function",
"copyDirectory",
"(",
"$",
"directory",
",",
"$",
"destination",
")",
"{",
"// Preference is to overwrite existing files",
"if",
"(",
"$",
"this",
"->",
"overwrite",
")",
"{",
"return",
"File",
"::",
"copyDirectory",
"(",
"$",
"directory",... | Helper for copying directories that supports the ability
to not overwrite existing files. Inherited from File::copyDirectory
@param string $directory
@param string $destination
@return bool | [
"Helper",
"for",
"copying",
"directories",
"that",
"supports",
"the",
"ability",
"to",
"not",
"overwrite",
"existing",
"files",
".",
"Inherited",
"from",
"File",
"::",
"copyDirectory"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/models/ThemeImport.php#L149-L191 | train | Copy directory to destination | [
30522,
5123,
3853,
6100,
4305,
2890,
16761,
2100,
1006,
1002,
14176,
1010,
1002,
7688,
1007,
1063,
1013,
1013,
12157,
2003,
2000,
2058,
26373,
4493,
6764,
2065,
1006,
1002,
2023,
1011,
1028,
2058,
26373,
1007,
1063,
2709,
5371,
1024,
1024,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/UserCountry/Controller.php | Controller.setUpdaterManageVars | private function setUpdaterManageVars($view)
{
$view->isGeoIp2Available = $this->isGeoIp2Enabled();
if ($this->isGeoIp2Enabled()) {
// Get GeoIPLegacy Update information to show them
$urls = GeoIPAutoUpdater::getConfiguredUrls();
$view->geoIPLegacyLocUrl = $urls... | php | private function setUpdaterManageVars($view)
{
$view->isGeoIp2Available = $this->isGeoIp2Enabled();
if ($this->isGeoIp2Enabled()) {
// Get GeoIPLegacy Update information to show them
$urls = GeoIPAutoUpdater::getConfiguredUrls();
$view->geoIPLegacyLocUrl = $urls... | [
"private",
"function",
"setUpdaterManageVars",
"(",
"$",
"view",
")",
"{",
"$",
"view",
"->",
"isGeoIp2Available",
"=",
"$",
"this",
"->",
"isGeoIp2Enabled",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"isGeoIp2Enabled",
"(",
")",
")",
"{",
"// Get GeoIPL... | Sets some variables needed by the _updaterManage.twig template.
@param View $view | [
"Sets",
"some",
"variables",
"needed",
"by",
"the",
"_updaterManage",
".",
"twig",
"template",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UserCountry/Controller.php#L221-L263 | train | Set the variables for the update manager | [
30522,
2797,
3853,
16437,
13701,
14515,
4270,
10755,
2015,
1006,
1002,
3193,
1007,
1063,
1002,
3193,
1011,
1028,
2003,
3351,
10448,
2361,
2475,
12462,
11733,
3468,
1027,
1002,
2023,
1011,
1028,
2003,
3351,
10448,
2361,
2475,
8189,
23242,
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/Broadcasting/BroadcastEvent.php | BroadcastEvent.handle | public function handle(Broadcaster $broadcaster)
{
$name = method_exists($this->event, 'broadcastAs')
? $this->event->broadcastAs() : get_class($this->event);
$broadcaster->broadcast(
Arr::wrap($this->event->broadcastOn()), $name,
$this->getPayloadFromEvent($... | php | public function handle(Broadcaster $broadcaster)
{
$name = method_exists($this->event, 'broadcastAs')
? $this->event->broadcastAs() : get_class($this->event);
$broadcaster->broadcast(
Arr::wrap($this->event->broadcastOn()), $name,
$this->getPayloadFromEvent($... | [
"public",
"function",
"handle",
"(",
"Broadcaster",
"$",
"broadcaster",
")",
"{",
"$",
"name",
"=",
"method_exists",
"(",
"$",
"this",
"->",
"event",
",",
"'broadcastAs'",
")",
"?",
"$",
"this",
"->",
"event",
"->",
"broadcastAs",
"(",
")",
":",
"get_cla... | Handle the queued job.
@param \Illuminate\Contracts\Broadcasting\Broadcaster $broadcaster
@return void | [
"Handle",
"the",
"queued",
"job",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Broadcasting/BroadcastEvent.php#L41-L50 | train | Handle the broadcast | [
30522,
2270,
3853,
5047,
1006,
11995,
1002,
11995,
1007,
1063,
1002,
2171,
1027,
4118,
1035,
6526,
1006,
1002,
2023,
1011,
1028,
2724,
1010,
1005,
3743,
3022,
1005,
1007,
1029,
1002,
2023,
1011,
1028,
2724,
1011,
1028,
3743,
3022,
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/Database/Schema/SqlServerBuilder.php | SqlServerBuilder.dropAllTables | public function dropAllTables()
{
$this->disableForeignKeyConstraints();
$this->connection->statement($this->grammar->compileDropAllTables());
$this->enableForeignKeyConstraints();
} | php | public function dropAllTables()
{
$this->disableForeignKeyConstraints();
$this->connection->statement($this->grammar->compileDropAllTables());
$this->enableForeignKeyConstraints();
} | [
"public",
"function",
"dropAllTables",
"(",
")",
"{",
"$",
"this",
"->",
"disableForeignKeyConstraints",
"(",
")",
";",
"$",
"this",
"->",
"connection",
"->",
"statement",
"(",
"$",
"this",
"->",
"grammar",
"->",
"compileDropAllTables",
"(",
")",
")",
";",
... | Drop all tables from the database.
@return void | [
"Drop",
"all",
"tables",
"from",
"the",
"database",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Schema/SqlServerBuilder.php#L12-L19 | train | Drops all tables in the database. | [
30522,
2270,
3853,
4530,
8095,
10880,
2015,
1006,
1007,
1063,
1002,
2023,
1011,
1028,
4487,
19150,
29278,
7416,
16206,
14839,
8663,
20528,
18447,
2015,
1006,
1007,
1025,
1002,
2023,
1011,
1028,
4434,
1011,
1028,
4861,
1006,
1002,
2023,
1011... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/HttpKernel/Controller/TraceableControllerResolver.php | TraceableControllerResolver.getController | public function getController(Request $request)
{
$e = $this->stopwatch->start('controller.get_callable');
$ret = $this->resolver->getController($request);
$e->stop();
return $ret;
} | php | public function getController(Request $request)
{
$e = $this->stopwatch->start('controller.get_callable');
$ret = $this->resolver->getController($request);
$e->stop();
return $ret;
} | [
"public",
"function",
"getController",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"e",
"=",
"$",
"this",
"->",
"stopwatch",
"->",
"start",
"(",
"'controller.get_callable'",
")",
";",
"$",
"ret",
"=",
"$",
"this",
"->",
"resolver",
"->",
"getController"... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpKernel/Controller/TraceableControllerResolver.php#L34-L43 | train | Get Controller for Request | [
30522,
2270,
3853,
2131,
8663,
13181,
10820,
1006,
5227,
1002,
5227,
1007,
1063,
1002,
1041,
1027,
1002,
2023,
1011,
1028,
2644,
18866,
1011,
1028,
2707,
1006,
1005,
11486,
1012,
2131,
1035,
2655,
3085,
1005,
1007,
1025,
1002,
2128,
2102,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Folder/Maildir.php | Zend_Mail_Storage_Folder_Maildir._buildFolderTree | protected function _buildFolderTree()
{
$this->_rootFolder = new Zend_Mail_Storage_Folder('/', '/', false);
$this->_rootFolder->INBOX = new Zend_Mail_Storage_Folder('INBOX', 'INBOX', true);
$dh = @opendir($this->_rootdir);
if (!$dh) {
/**
* @see Zend_Mail_St... | php | protected function _buildFolderTree()
{
$this->_rootFolder = new Zend_Mail_Storage_Folder('/', '/', false);
$this->_rootFolder->INBOX = new Zend_Mail_Storage_Folder('INBOX', 'INBOX', true);
$dh = @opendir($this->_rootdir);
if (!$dh) {
/**
* @see Zend_Mail_St... | [
"protected",
"function",
"_buildFolderTree",
"(",
")",
"{",
"$",
"this",
"->",
"_rootFolder",
"=",
"new",
"Zend_Mail_Storage_Folder",
"(",
"'/'",
",",
"'/'",
",",
"false",
")",
";",
"$",
"this",
"->",
"_rootFolder",
"->",
"INBOX",
"=",
"new",
"Zend_Mail_Stor... | find all subfolders and mbox files for folder structure
Result is save in Zend_Mail_Storage_Folder instances with the root in $this->_rootFolder.
$parentFolder and $parentGlobalName are only used internally for recursion.
@return null
@throws Zend_Mail_Storage_Exception | [
"find",
"all",
"subfolders",
"and",
"mbox",
"files",
"for",
"folder",
"structure"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail/Storage/Folder/Maildir.php#L116-L178 | train | Build the folder tree | [
30522,
5123,
3853,
1035,
3857,
10371,
8743,
9910,
1006,
1007,
1063,
1002,
2023,
1011,
1028,
1035,
7117,
10371,
2121,
1027,
2047,
16729,
2094,
1035,
5653,
1035,
5527,
1035,
19622,
1006,
1005,
1013,
1005,
1010,
1005,
1013,
1005,
1010,
6270,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php | PostgresGrammar.compileSpatialIndex | public function compileSpatialIndex(Blueprint $blueprint, Fluent $command)
{
$command->algorithm = 'gist';
return $this->compileIndex($blueprint, $command);
} | php | public function compileSpatialIndex(Blueprint $blueprint, Fluent $command)
{
$command->algorithm = 'gist';
return $this->compileIndex($blueprint, $command);
} | [
"public",
"function",
"compileSpatialIndex",
"(",
"Blueprint",
"$",
"blueprint",
",",
"Fluent",
"$",
"command",
")",
"{",
"$",
"command",
"->",
"algorithm",
"=",
"'gist'",
";",
"return",
"$",
"this",
"->",
"compileIndex",
"(",
"$",
"blueprint",
",",
"$",
"... | Compile a spatial index key command.
@param \Illuminate\Database\Schema\Blueprint $blueprint
@param \Illuminate\Support\Fluent $command
@return string | [
"Compile",
"a",
"spatial",
"index",
"key",
"command",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php#L143-L148 | train | Compiles a spatial index | [
30522,
2270,
3853,
4012,
22090,
13102,
10450,
11475,
13629,
2595,
1006,
2630,
16550,
1002,
2630,
16550,
1010,
19376,
1002,
3094,
1007,
1063,
1002,
3094,
1011,
1028,
9896,
1027,
1005,
21025,
3367,
1005,
1025,
2709,
1002,
2023,
1011,
1028,
40... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Auth/Access/Gate.php | Gate.buildAbilityCallback | protected function buildAbilityCallback($ability, $callback)
{
return function () use ($ability, $callback) {
if (Str::contains($callback, '@')) {
[$class, $method] = Str::parseCallback($callback);
} else {
$class = $callback;
}
... | php | protected function buildAbilityCallback($ability, $callback)
{
return function () use ($ability, $callback) {
if (Str::contains($callback, '@')) {
[$class, $method] = Str::parseCallback($callback);
} else {
$class = $callback;
}
... | [
"protected",
"function",
"buildAbilityCallback",
"(",
"$",
"ability",
",",
"$",
"callback",
")",
"{",
"return",
"function",
"(",
")",
"use",
"(",
"$",
"ability",
",",
"$",
"callback",
")",
"{",
"if",
"(",
"Str",
"::",
"contains",
"(",
"$",
"callback",
... | Create the ability callback for a callback string.
@param string $ability
@param string $callback
@return \Closure | [
"Create",
"the",
"ability",
"callback",
"for",
"a",
"callback",
"string",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Auth/Access/Gate.php#L173-L200 | train | Build Ability Callback | [
30522,
5123,
3853,
3857,
8010,
9289,
20850,
8684,
1006,
1002,
3754,
1010,
1002,
2655,
5963,
1007,
1063,
2709,
3853,
1006,
1007,
2224,
1006,
1002,
3754,
1010,
1002,
2655,
5963,
1007,
1063,
2065,
1006,
2358,
2099,
1024,
1024,
3397,
1006,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/PrivacyManager/ReportsPurger.php | ReportsPurger.getPurgeEstimate | public function getPurgeEstimate()
{
$result = array();
// get archive tables that will be purged
list($oldNumericTables, $oldBlobTables) = $this->getArchiveTablesToPurge();
// process blob tables first, since archive status is stored in the numeric archives
if (empty($this... | php | public function getPurgeEstimate()
{
$result = array();
// get archive tables that will be purged
list($oldNumericTables, $oldBlobTables) = $this->getArchiveTablesToPurge();
// process blob tables first, since archive status is stored in the numeric archives
if (empty($this... | [
"public",
"function",
"getPurgeEstimate",
"(",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"// get archive tables that will be purged",
"list",
"(",
"$",
"oldNumericTables",
",",
"$",
"oldBlobTables",
")",
"=",
"$",
"this",
"->",
"getArchiveTablesToPurge... | Returns an array describing what data would be purged if purging were invoked.
This function returns an array that maps table names with the number of rows
that will be deleted. If a table name is mapped with self::DROP_TABLE, the table
will be dropped.
@return array | [
"Returns",
"an",
"array",
"describing",
"what",
"data",
"would",
"be",
"purged",
"if",
"purging",
"were",
"invoked",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/PrivacyManager/ReportsPurger.php#L163-L203 | train | Get Purge Estimate | [
30522,
2270,
3853,
2131,
5311,
18372,
16643,
8585,
1006,
1007,
1063,
1002,
2765,
1027,
9140,
1006,
1007,
1025,
1013,
1013,
2131,
8756,
7251,
2008,
2097,
2022,
24694,
2094,
2862,
1006,
1002,
2214,
19172,
22420,
10880,
2015,
1010,
1002,
2214,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.getFormConfig | public function getFormConfig()
{
$config = $this->getConfigArray('form');
/**
* @event cms.theme.extendFormConfig
* Extend form field configuration supplied by the theme by returning an array.
*
* Note if you are planning on using `assetVar` to inject CSS variab... | php | public function getFormConfig()
{
$config = $this->getConfigArray('form');
/**
* @event cms.theme.extendFormConfig
* Extend form field configuration supplied by the theme by returning an array.
*
* Note if you are planning on using `assetVar` to inject CSS variab... | [
"public",
"function",
"getFormConfig",
"(",
")",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"getConfigArray",
"(",
"'form'",
")",
";",
"/**\n * @event cms.theme.extendFormConfig\n * Extend form field configuration supplied by the theme by returning an array.\n ... | Themes have a dedicated `form` option that provide form fields
for customization, this is an immutable accessor for that and
also an solid anchor point for extension.
@return array | [
"Themes",
"have",
"a",
"dedicated",
"form",
"option",
"that",
"provide",
"form",
"fields",
"for",
"customization",
"this",
"is",
"an",
"immutable",
"accessor",
"for",
"that",
"and",
"also",
"an",
"solid",
"anchor",
"point",
"for",
"extension",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/Theme.php#L367-L394 | train | Returns the form field configuration | [
30522,
2270,
3853,
2131,
14192,
8663,
8873,
2290,
1006,
1007,
1063,
1002,
9530,
8873,
2290,
1027,
1002,
2023,
1011,
1028,
2131,
8663,
8873,
6843,
9447,
1006,
1005,
2433,
1005,
1007,
1025,
1013,
1008,
1008,
1008,
1030,
2724,
4642,
2015,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/DomCrawler/Form.php | Form.setValues | public function setValues(array $values)
{
foreach ($values as $name => $value) {
$this->fields->set($name, $value);
}
return $this;
} | php | public function setValues(array $values)
{
foreach ($values as $name => $value) {
$this->fields->set($name, $value);
}
return $this;
} | [
"public",
"function",
"setValues",
"(",
"array",
"$",
"values",
")",
"{",
"foreach",
"(",
"$",
"values",
"as",
"$",
"name",
"=>",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"fields",
"->",
"set",
"(",
"$",
"name",
",",
"$",
"value",
")",
";",
"}"... | Sets the value of the fields.
@param array $values An array of field values
@return $this | [
"Sets",
"the",
"value",
"of",
"the",
"fields",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/DomCrawler/Form.php#L72-L79 | train | Set values of the fields | [
30522,
2270,
3853,
2275,
10175,
15808,
1006,
9140,
1002,
5300,
1007,
1063,
18921,
6776,
1006,
1002,
5300,
2004,
1002,
2171,
1027,
1028,
1002,
3643,
1007,
1063,
1002,
2023,
1011,
1028,
4249,
1011,
1028,
2275,
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... |
symfony/symfony | src/Symfony/Component/ExpressionLanguage/ExpressionLanguage.php | ExpressionLanguage.register | public function register($name, callable $compiler, callable $evaluator)
{
if (null !== $this->parser) {
throw new \LogicException('Registering functions after calling evaluate(), compile() or parse() is not supported.');
}
$this->functions[$name] = ['compiler' => $compiler, 'ev... | php | public function register($name, callable $compiler, callable $evaluator)
{
if (null !== $this->parser) {
throw new \LogicException('Registering functions after calling evaluate(), compile() or parse() is not supported.');
}
$this->functions[$name] = ['compiler' => $compiler, 'ev... | [
"public",
"function",
"register",
"(",
"$",
"name",
",",
"callable",
"$",
"compiler",
",",
"callable",
"$",
"evaluator",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"parser",
")",
"{",
"throw",
"new",
"\\",
"LogicException",
"(",
"'Registering... | Registers a function.
@param string $name The function name
@param callable $compiler A callable able to compile the function
@param callable $evaluator A callable able to evaluate the function
@throws \LogicException when registering a function after calling evaluate(), compile() or parse()
@see ExpressionF... | [
"Registers",
"a",
"function",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/ExpressionLanguage/ExpressionLanguage.php#L115-L122 | train | Registers a function to the stack | [
30522,
2270,
3853,
4236,
1006,
1002,
2171,
1010,
2655,
3085,
1002,
21624,
1010,
2655,
3085,
1002,
9345,
7630,
8844,
1007,
1063,
2065,
1006,
19701,
999,
1027,
1027,
1002,
2023,
1011,
1028,
11968,
8043,
1007,
1063,
5466,
2047,
1032,
7961,
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/Auth/Access/Gate.php | Gate.getPolicyFor | public function getPolicyFor($class)
{
if (is_object($class)) {
$class = get_class($class);
}
if (! is_string($class)) {
return;
}
if (isset($this->policies[$class])) {
return $this->resolvePolicy($this->policies[$class]);
}
... | php | public function getPolicyFor($class)
{
if (is_object($class)) {
$class = get_class($class);
}
if (! is_string($class)) {
return;
}
if (isset($this->policies[$class])) {
return $this->resolvePolicy($this->policies[$class]);
}
... | [
"public",
"function",
"getPolicyFor",
"(",
"$",
"class",
")",
"{",
"if",
"(",
"is_object",
"(",
"$",
"class",
")",
")",
"{",
"$",
"class",
"=",
"get_class",
"(",
"$",
"class",
")",
";",
"}",
"if",
"(",
"!",
"is_string",
"(",
"$",
"class",
")",
")... | Get a policy instance for a given class.
@param object|string $class
@return mixed | [
"Get",
"a",
"policy",
"instance",
"for",
"a",
"given",
"class",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Auth/Access/Gate.php#L539-L564 | train | Get the policy for a given class. | [
30522,
2270,
3853,
2131,
18155,
2594,
2100,
29278,
1006,
1002,
2465,
1007,
1063,
2065,
1006,
2003,
1035,
4874,
1006,
1002,
2465,
1007,
1007,
1063,
1002,
2465,
1027,
2131,
1035,
2465,
1006,
1002,
2465,
1007,
1025,
1065,
2065,
1006,
999,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/Zend/Db/Adapter/Abstract.php | Zend_Db_Adapter_Abstract.fetchCol | public function fetchCol($sql, $bind = array())
{
$stmt = $this->query($sql, $bind);
$result = $stmt->fetchAll(Zend_Db::FETCH_COLUMN, 0);
return $result;
} | php | public function fetchCol($sql, $bind = array())
{
$stmt = $this->query($sql, $bind);
$result = $stmt->fetchAll(Zend_Db::FETCH_COLUMN, 0);
return $result;
} | [
"public",
"function",
"fetchCol",
"(",
"$",
"sql",
",",
"$",
"bind",
"=",
"array",
"(",
")",
")",
"{",
"$",
"stmt",
"=",
"$",
"this",
"->",
"query",
"(",
"$",
"sql",
",",
"$",
"bind",
")",
";",
"$",
"result",
"=",
"$",
"stmt",
"->",
"fetchAll",... | Fetches the first column of all SQL result rows as an array.
@param string|Zend_Db_Select $sql An SQL SELECT statement.
@param mixed $bind Data to bind into SELECT placeholders.
@return array | [
"Fetches",
"the",
"first",
"column",
"of",
"all",
"SQL",
"result",
"rows",
"as",
"an",
"array",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Adapter/Abstract.php#L791-L796 | train | Fetch column from result of query | [
30522,
2270,
3853,
18584,
25778,
1006,
1002,
29296,
1010,
1002,
14187,
1027,
9140,
1006,
1007,
1007,
1063,
1002,
2358,
20492,
1027,
1002,
2023,
1011,
1028,
23032,
1006,
1002,
29296,
1010,
1002,
14187,
1007,
1025,
1002,
2765,
1027,
1002,
235... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/MiddlewareAwareTrait.php | MiddlewareAwareTrait.seedMiddlewareStack | protected function seedMiddlewareStack(callable $kernel = null)
{
if (!is_null($this->tip)) {
throw new RuntimeException('MiddlewareStack can only be seeded once.');
}
if ($kernel === null) {
$kernel = $this;
}
$this->tip = $kernel;
} | php | protected function seedMiddlewareStack(callable $kernel = null)
{
if (!is_null($this->tip)) {
throw new RuntimeException('MiddlewareStack can only be seeded once.');
}
if ($kernel === null) {
$kernel = $this;
}
$this->tip = $kernel;
} | [
"protected",
"function",
"seedMiddlewareStack",
"(",
"callable",
"$",
"kernel",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"this",
"->",
"tip",
")",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"'MiddlewareStack can only be seeded once.'",... | Seed middleware stack with first callable
@param callable $kernel The last item to run as middleware
@throws RuntimeException if the stack is seeded more than once | [
"Seed",
"middleware",
"stack",
"with",
"first",
"callable"
] | ccef5f7d8bcd469d59cbe64f6210d83764f91543 | https://github.com/slimphp/Slim/blob/ccef5f7d8bcd469d59cbe64f6210d83764f91543/Slim/MiddlewareAwareTrait.php#L90-L99 | train | Seed the middleware stack with the current kernel | [
30522,
5123,
3853,
6534,
30524,
1007,
1007,
1063,
5466,
2047,
2448,
7292,
10288,
24422,
1006,
1005,
2690,
8059,
9153,
3600,
2064,
2069,
2022,
13916,
2320,
1012,
1005,
1007,
1025,
1065,
2065,
1006,
1002,
16293,
1027,
1027,
1027,
19701,
1007,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Database/Eloquent/Relations/HasManyThrough.php | HasManyThrough.get | public function get($columns = ['*'])
{
$builder = $this->prepareQueryBuilder($columns);
$models = $builder->getModels();
// If we actually found models we will also eager load any relationships that
// have been specified as needing to be eager loaded. This will solve the
... | php | public function get($columns = ['*'])
{
$builder = $this->prepareQueryBuilder($columns);
$models = $builder->getModels();
// If we actually found models we will also eager load any relationships that
// have been specified as needing to be eager loaded. This will solve the
... | [
"public",
"function",
"get",
"(",
"$",
"columns",
"=",
"[",
"'*'",
"]",
")",
"{",
"$",
"builder",
"=",
"$",
"this",
"->",
"prepareQueryBuilder",
"(",
"$",
"columns",
")",
";",
"$",
"models",
"=",
"$",
"builder",
"->",
"getModels",
"(",
")",
";",
"/... | Execute the query as a "select" statement.
@param array $columns
@return \Illuminate\Database\Eloquent\Collection | [
"Execute",
"the",
"query",
"as",
"a",
"select",
"statement",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Relations/HasManyThrough.php#L357-L371 | train | Get the models from the database | [
30522,
2270,
3853,
2131,
1006,
1002,
7753,
1027,
1031,
1005,
1008,
1005,
1033,
1007,
1063,
1002,
12508,
1027,
1002,
2023,
1011,
1028,
7374,
4226,
2854,
8569,
23891,
2099,
1006,
1002,
7753,
1007,
1025,
1002,
4275,
1027,
1002,
12508,
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/Referrers/SearchEngine.php | SearchEngine.convertCharset | protected function convertCharset($string, $charsets)
{
if (function_exists('iconv')
&& !empty($charsets)
) {
$charset = $charsets[0];
if (count($charsets) > 1
&& function_exists('mb_detect_encoding')
) {
$charset = mb_d... | php | protected function convertCharset($string, $charsets)
{
if (function_exists('iconv')
&& !empty($charsets)
) {
$charset = $charsets[0];
if (count($charsets) > 1
&& function_exists('mb_detect_encoding')
) {
$charset = mb_d... | [
"protected",
"function",
"convertCharset",
"(",
"$",
"string",
",",
"$",
"charsets",
")",
"{",
"if",
"(",
"function_exists",
"(",
"'iconv'",
")",
"&&",
"!",
"empty",
"(",
"$",
"charsets",
")",
")",
"{",
"$",
"charset",
"=",
"$",
"charsets",
"[",
"0",
... | Tries to convert the given string from one of the given charsets to UTF-8
@param string $string
@param array $charsets
@return string | [
"Tries",
"to",
"convert",
"the",
"given",
"string",
"from",
"one",
"of",
"the",
"given",
"charsets",
"to",
"UTF",
"-",
"8"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Referrers/SearchEngine.php#L397-L419 | train | Convert charset from string to UTF - 8 | [
30522,
5123,
3853,
10463,
7507,
22573,
2102,
1006,
1002,
5164,
1010,
1002,
25869,
13462,
2015,
1007,
1063,
2065,
1006,
3853,
1035,
6526,
1006,
1005,
12696,
2615,
1005,
1007,
1004,
1004,
999,
4064,
1006,
1002,
25869,
13462,
2015,
1007,
1007,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
z-song/laravel-admin | src/Widgets/Tab.php | Tab.add | public function add($title, $content, $active = false)
{
$this->data['tabs'][] = [
'id' => mt_rand(),
'title' => $title,
'content' => $content,
'type' => static::TYPE_CONTENT,
];
if ($active) {
$this->data['active'] = cou... | php | public function add($title, $content, $active = false)
{
$this->data['tabs'][] = [
'id' => mt_rand(),
'title' => $title,
'content' => $content,
'type' => static::TYPE_CONTENT,
];
if ($active) {
$this->data['active'] = cou... | [
"public",
"function",
"add",
"(",
"$",
"title",
",",
"$",
"content",
",",
"$",
"active",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"data",
"[",
"'tabs'",
"]",
"[",
"]",
"=",
"[",
"'id'",
"=>",
"mt_rand",
"(",
")",
",",
"'title'",
"=>",
"$",
"t... | Add a tab and its contents.
@param string $title
@param string|Renderable $content
@param bool $active
@return $this | [
"Add",
"a",
"tab",
"and",
"its",
"contents",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Widgets/Tab.php#L42-L56 | train | Add tab to list | [
30522,
2270,
3853,
5587,
1006,
1002,
2516,
1010,
1002,
4180,
1010,
1002,
3161,
1027,
6270,
1007,
1063,
1002,
2023,
1011,
1028,
2951,
1031,
1005,
21628,
2015,
1005,
1033,
1031,
1033,
1027,
1031,
1005,
8909,
1005,
1027,
1028,
11047,
1035,
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/Database/Query/Grammars/Grammar.php | Grammar.compileWheresToArray | protected function compileWheresToArray($query)
{
return collect($query->wheres)->map(function ($where) use ($query) {
return $where['boolean'].' '.$this->{"where{$where['type']}"}($query, $where);
})->all();
} | php | protected function compileWheresToArray($query)
{
return collect($query->wheres)->map(function ($where) use ($query) {
return $where['boolean'].' '.$this->{"where{$where['type']}"}($query, $where);
})->all();
} | [
"protected",
"function",
"compileWheresToArray",
"(",
"$",
"query",
")",
"{",
"return",
"collect",
"(",
"$",
"query",
"->",
"wheres",
")",
"->",
"map",
"(",
"function",
"(",
"$",
"where",
")",
"use",
"(",
"$",
"query",
")",
"{",
"return",
"$",
"where",... | Get an array of all the where clauses for the query.
@param \Illuminate\Database\Query\Builder $query
@return array | [
"Get",
"an",
"array",
"of",
"all",
"the",
"where",
"clauses",
"for",
"the",
"query",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Query/Grammars/Grammar.php#L203-L208 | train | Compile the where clauses into an array. | [
30522,
5123,
3853,
4012,
22090,
2860,
5886,
4355,
10441,
11335,
2100,
1006,
1002,
23032,
1007,
1063,
2709,
8145,
1006,
1002,
23032,
1011,
1028,
2073,
2015,
1007,
1011,
1028,
4949,
1006,
3853,
1006,
1002,
2073,
1007,
2224,
1006,
1002,
23032,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/Tracker/GoalManager.php | GoalManager.getEcommerceItemsFromRequest | private function getEcommerceItemsFromRequest(Request $request)
{
$items = $request->getParam('ec_items');
if (empty($items)) {
Common::printDebug("There are no Ecommerce items in the request");
// we still record an Ecommerce order without any item in it
return ... | php | private function getEcommerceItemsFromRequest(Request $request)
{
$items = $request->getParam('ec_items');
if (empty($items)) {
Common::printDebug("There are no Ecommerce items in the request");
// we still record an Ecommerce order without any item in it
return ... | [
"private",
"function",
"getEcommerceItemsFromRequest",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"items",
"=",
"$",
"request",
"->",
"getParam",
"(",
"'ec_items'",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"items",
")",
")",
"{",
"Common",
"::",
"prin... | Returns Items read from the request string
@return array|bool | [
"Returns",
"Items",
"read",
"from",
"the",
"request",
"string"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Tracker/GoalManager.php#L354-L373 | train | Returns the Ecommerce items from the request | [
30522,
30524,
5227,
1007,
1063,
1002,
5167,
1027,
1002,
5227,
1011,
1028,
2131,
28689,
2213,
1006,
1005,
14925,
1035,
5167,
1005,
1007,
1025,
2065,
1006,
4064,
1006,
1002,
5167,
1007,
1007,
1063,
2691,
1024,
1024,
6140,
3207,
8569,
2290,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/Zend/Mail/Protocol/Abstract.php | Zend_Mail_Protocol_Abstract._send | protected function _send($request)
{
if (!is_resource($this->_socket)) {
/**
* @see Zend_Mail_Protocol_Exception
*/
// require_once 'Zend/Mail/Protocol/Exception.php';
throw new Zend_Mail_Protocol_Exception('No connection has been established to ... | php | protected function _send($request)
{
if (!is_resource($this->_socket)) {
/**
* @see Zend_Mail_Protocol_Exception
*/
// require_once 'Zend/Mail/Protocol/Exception.php';
throw new Zend_Mail_Protocol_Exception('No connection has been established to ... | [
"protected",
"function",
"_send",
"(",
"$",
"request",
")",
"{",
"if",
"(",
"!",
"is_resource",
"(",
"$",
"this",
"->",
"_socket",
")",
")",
"{",
"/**\n * @see Zend_Mail_Protocol_Exception\n */",
"// require_once 'Zend/Mail/Protocol/Exception.php';",... | Send the given request followed by a LINEEND to the server.
@param string $request
@throws Zend_Mail_Protocol_Exception
@return integer|boolean Number of bytes written to remote host | [
"Send",
"the",
"given",
"request",
"followed",
"by",
"a",
"LINEEND",
"to",
"the",
"server",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail/Protocol/Abstract.php#L312-L338 | train | Send request to server | [
30522,
5123,
3853,
1035,
4604,
1006,
1002,
5227,
1007,
1063,
2065,
1006,
999,
2003,
1035,
7692,
1006,
1002,
2023,
1011,
1028,
1035,
22278,
1007,
1007,
1063,
1013,
1008,
1008,
1008,
1030,
2156,
16729,
2094,
1035,
5653,
1035,
8778,
1035,
64... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/HTML/QuickForm2/Rule/Callback.php | HTML_QuickForm2_Rule_Callback.setConfig | public function setConfig($config)
{
if (!is_array($config) || !isset($config['callback'])) {
$config = array('callback' => $config);
}
if (!is_callable($config['callback'], false, $callbackName)) {
throw new HTML_QuickForm2_InvalidArgumentException(
'... | php | public function setConfig($config)
{
if (!is_array($config) || !isset($config['callback'])) {
$config = array('callback' => $config);
}
if (!is_callable($config['callback'], false, $callbackName)) {
throw new HTML_QuickForm2_InvalidArgumentException(
'... | [
"public",
"function",
"setConfig",
"(",
"$",
"config",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"config",
")",
"||",
"!",
"isset",
"(",
"$",
"config",
"[",
"'callback'",
"]",
")",
")",
"{",
"$",
"config",
"=",
"array",
"(",
"'callback'",
"=>... | Sets the callback to use for validation and its additional arguments
@param callback|array Callback or array ('callback' => validation callback,
'arguments' => additional arguments)
@return HTML_QuickForm2_Rule
@throws HTML_QuickForm2_InvalidArgumentException if callback is missing or invalid | [
"Sets",
"the",
"callback",
"to",
"use",
"for",
"validation",
"and",
"its",
"additional",
"arguments"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Rule/Callback.php#L158-L170 | train | Sets the config for the callback rule | [
30522,
2270,
3853,
2275,
8663,
8873,
2290,
1006,
1002,
9530,
8873,
2290,
1007,
1063,
2065,
1006,
999,
30524,
2290,
1031,
1005,
2655,
5963,
1005,
1033,
1007,
1007,
1063,
1002,
9530,
8873,
2290,
1027,
9140,
1006,
1005,
2655,
5963,
1005,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
z-song/laravel-admin | src/Console/InstallCommand.php | InstallCommand.createRoutesFile | protected function createRoutesFile()
{
$file = $this->directory.'/routes.php';
$contents = $this->getStub('routes');
$this->laravel['files']->put($file, str_replace('DummyNamespace', config('admin.route.namespace'), $contents));
$this->line('<info>Routes file was created:</info> '.... | php | protected function createRoutesFile()
{
$file = $this->directory.'/routes.php';
$contents = $this->getStub('routes');
$this->laravel['files']->put($file, str_replace('DummyNamespace', config('admin.route.namespace'), $contents));
$this->line('<info>Routes file was created:</info> '.... | [
"protected",
"function",
"createRoutesFile",
"(",
")",
"{",
"$",
"file",
"=",
"$",
"this",
"->",
"directory",
".",
"'/routes.php'",
";",
"$",
"contents",
"=",
"$",
"this",
"->",
"getStub",
"(",
"'routes'",
")",
";",
"$",
"this",
"->",
"laravel",
"[",
"... | Create routes file.
@return void | [
"Create",
"routes",
"file",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Console/InstallCommand.php#L156-L163 | train | Create routes file | [
30522,
5123,
3853,
3443,
22494,
4570,
8873,
2571,
1006,
1007,
1063,
1002,
5371,
1027,
1002,
2023,
1011,
1028,
14176,
1012,
1005,
1013,
5847,
1012,
25718,
1005,
1025,
1002,
8417,
1027,
1002,
2023,
1011,
1028,
4152,
28251,
1006,
1005,
5847,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Intl/Data/Bundle/Writer/JsonBundleWriter.php | JsonBundleWriter.write | public function write($path, $locale, $data)
{
if ($data instanceof \Traversable) {
$data = iterator_to_array($data);
}
array_walk_recursive($data, function (&$value) {
if ($value instanceof \Traversable) {
$value = iterator_to_array($value);
... | php | public function write($path, $locale, $data)
{
if ($data instanceof \Traversable) {
$data = iterator_to_array($data);
}
array_walk_recursive($data, function (&$value) {
if ($value instanceof \Traversable) {
$value = iterator_to_array($value);
... | [
"public",
"function",
"write",
"(",
"$",
"path",
",",
"$",
"locale",
",",
"$",
"data",
")",
"{",
"if",
"(",
"$",
"data",
"instanceof",
"\\",
"Traversable",
")",
"{",
"$",
"data",
"=",
"iterator_to_array",
"(",
"$",
"data",
")",
";",
"}",
"array_walk_... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Intl/Data/Bundle/Writer/JsonBundleWriter.php#L26-L41 | train | Write the locale data to the file | [
30522,
2270,
3853,
4339,
1006,
1002,
4130,
1010,
1002,
2334,
2063,
1010,
1002,
2951,
1007,
1063,
2065,
1006,
1002,
2951,
6013,
11253,
1032,
30524,
1002,
2951,
1007,
1025,
1065,
9140,
1035,
3328,
1035,
28667,
9236,
3512,
1006,
1002,
2951,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
overtrue/wechat | src/OfficialAccount/Comment/Client.php | Client.open | public function open(string $msgId, int $index = null)
{
$params = [
'msg_data_id' => $msgId,
'index' => $index,
];
return $this->httpPostJson('cgi-bin/comment/open', $params);
} | php | public function open(string $msgId, int $index = null)
{
$params = [
'msg_data_id' => $msgId,
'index' => $index,
];
return $this->httpPostJson('cgi-bin/comment/open', $params);
} | [
"public",
"function",
"open",
"(",
"string",
"$",
"msgId",
",",
"int",
"$",
"index",
"=",
"null",
")",
"{",
"$",
"params",
"=",
"[",
"'msg_data_id'",
"=>",
"$",
"msgId",
",",
"'index'",
"=>",
"$",
"index",
",",
"]",
";",
"return",
"$",
"this",
"->"... | Open article comment.
@param string $msgId
@param int|null $index
@return \Psr\Http\Message\ResponseInterface|\EasyWeChat\Kernel\Support\Collection|array|object|string | [
"Open",
"article",
"comment",
"."
] | 120c72faaa93c270365bc75c73c362d5fd583209 | https://github.com/overtrue/wechat/blob/120c72faaa93c270365bc75c73c362d5fd583209/src/OfficialAccount/Comment/Client.php#L31-L39 | train | Open a comment | [
30522,
2270,
3853,
2330,
1006,
5164,
1002,
5796,
5856,
2094,
1010,
20014,
1002,
5950,
1027,
19701,
1007,
1063,
1002,
30524,
1013,
2330,
1005,
1010,
1002,
11498,
5244,
1007,
1025,
1065,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/OptionsResolver/OptionsResolver.php | OptionsResolver.setDeprecated | public function setDeprecated(string $option, $deprecationMessage = 'The option "%name%" is deprecated.'): self
{
if ($this->locked) {
throw new AccessException('Options cannot be deprecated from a lazy option or normalizer.');
}
if (!isset($this->defined[$option])) {
... | php | public function setDeprecated(string $option, $deprecationMessage = 'The option "%name%" is deprecated.'): self
{
if ($this->locked) {
throw new AccessException('Options cannot be deprecated from a lazy option or normalizer.');
}
if (!isset($this->defined[$option])) {
... | [
"public",
"function",
"setDeprecated",
"(",
"string",
"$",
"option",
",",
"$",
"deprecationMessage",
"=",
"'The option \"%name%\" is deprecated.'",
")",
":",
"self",
"{",
"if",
"(",
"$",
"this",
"->",
"locked",
")",
"{",
"throw",
"new",
"AccessException",
"(",
... | Deprecates an option, allowed types or values.
Instead of passing the message, you may also pass a closure with the
following signature:
function (Options $options, $value): string {
// ...
}
The closure receives the value as argument and should return a string.
Return an empty string to ignore the option deprecatio... | [
"Deprecates",
"an",
"option",
"allowed",
"types",
"or",
"values",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/OptionsResolver/OptionsResolver.php#L419-L444 | train | Sets a deprecation message for an option. | [
30522,
2270,
3853,
2275,
3207,
28139,
12921,
1006,
5164,
1002,
5724,
1010,
1002,
2139,
28139,
10719,
7834,
3736,
3351,
1027,
1005,
1996,
5724,
1000,
1003,
2171,
1003,
1000,
2003,
2139,
28139,
12921,
1012,
1005,
1007,
1024,
2969,
1063,
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 | plugins/Annotations/AnnotationList.php | AnnotationList.add | public function add($idSite, $date, $note, $starred = 0)
{
$this->checkIdSiteIsLoaded($idSite);
$date = Date::factory($date)->toString('Y-m-d');
$this->annotations[$idSite][] = self::makeAnnotation($date, $note, $starred);
// get the id of the new annotation
end($this->anno... | php | public function add($idSite, $date, $note, $starred = 0)
{
$this->checkIdSiteIsLoaded($idSite);
$date = Date::factory($date)->toString('Y-m-d');
$this->annotations[$idSite][] = self::makeAnnotation($date, $note, $starred);
// get the id of the new annotation
end($this->anno... | [
"public",
"function",
"add",
"(",
"$",
"idSite",
",",
"$",
"date",
",",
"$",
"note",
",",
"$",
"starred",
"=",
"0",
")",
"{",
"$",
"this",
"->",
"checkIdSiteIsLoaded",
"(",
"$",
"idSite",
")",
";",
"$",
"date",
"=",
"Date",
"::",
"factory",
"(",
... | Creates a new annotation for a site. This method does not perist the result.
To save the new annotation in the database, call $this->save.
@param int $idSite The ID of the site to add an annotation to.
@param string $date The date the annotation is in reference to.
@param string $note The text of the new annotation.
@... | [
"Creates",
"a",
"new",
"annotation",
"for",
"a",
"site",
".",
"This",
"method",
"does",
"not",
"perist",
"the",
"result",
".",
"To",
"save",
"the",
"new",
"annotation",
"in",
"the",
"database",
"call",
"$this",
"-",
">",
"save",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Annotations/AnnotationList.php#L85-L97 | train | Add a new annotation to the list of annotations | [
30522,
2270,
3853,
5587,
1006,
1002,
8909,
28032,
2063,
1010,
1002,
3058,
1010,
1002,
3602,
1010,
1002,
5652,
1027,
1014,
1007,
1063,
1002,
2023,
1011,
1028,
4638,
9821,
4221,
2483,
17468,
1006,
1002,
8909,
28032,
2063,
1007,
1025,
1002,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/LanguagesManager/Controller.php | Controller.saveLanguage | public function saveLanguage()
{
$language = Common::getRequestVar('language');
// Prevent CSRF only when piwik is not installed yet (During install user can change language)
if (DbHelper::isInstalled()) {
$this->checkTokenInUrl();
}
LanguagesManager::setLanguag... | php | public function saveLanguage()
{
$language = Common::getRequestVar('language');
// Prevent CSRF only when piwik is not installed yet (During install user can change language)
if (DbHelper::isInstalled()) {
$this->checkTokenInUrl();
}
LanguagesManager::setLanguag... | [
"public",
"function",
"saveLanguage",
"(",
")",
"{",
"$",
"language",
"=",
"Common",
"::",
"getRequestVar",
"(",
"'language'",
")",
";",
"// Prevent CSRF only when piwik is not installed yet (During install user can change language)",
"if",
"(",
"DbHelper",
"::",
"isInstall... | anonymous = in the session
authenticated user = in the session | [
"anonymous",
"=",
"in",
"the",
"session",
"authenticated",
"user",
"=",
"in",
"the",
"session"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/LanguagesManager/Controller.php#L26-L37 | train | Saves the language in the session | [
30522,
2270,
3853,
3828,
25023,
6692,
3351,
1006,
1007,
1063,
1002,
2653,
1027,
2691,
1024,
1024,
2131,
2890,
15500,
10755,
1006,
1005,
2653,
1005,
1007,
1025,
1013,
1013,
4652,
20116,
12881,
2069,
2043,
14255,
9148,
2243,
2003,
2025,
5361,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Validator.php | Validator.addDependentExtensions | public function addDependentExtensions(array $extensions)
{
$this->addExtensions($extensions);
foreach ($extensions as $rule => $extension) {
$this->dependentRules[] = Str::studly($rule);
}
} | php | public function addDependentExtensions(array $extensions)
{
$this->addExtensions($extensions);
foreach ($extensions as $rule => $extension) {
$this->dependentRules[] = Str::studly($rule);
}
} | [
"public",
"function",
"addDependentExtensions",
"(",
"array",
"$",
"extensions",
")",
"{",
"$",
"this",
"->",
"addExtensions",
"(",
"$",
"extensions",
")",
";",
"foreach",
"(",
"$",
"extensions",
"as",
"$",
"rule",
"=>",
"$",
"extension",
")",
"{",
"$",
... | Register an array of custom implicit validator extensions.
@param array $extensions
@return void | [
"Register",
"an",
"array",
"of",
"custom",
"implicit",
"validator",
"extensions",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Validation/Validator.php#L910-L917 | train | Adds dependent extensions to the list of rules that should be included in the tree. | [
30522,
2270,
3853,
5587,
3207,
11837,
16454,
10288,
29048,
2015,
1006,
9140,
1002,
14305,
1007,
1063,
1002,
2023,
1011,
1028,
5587,
10288,
29048,
2015,
1006,
1002,
14305,
1007,
1025,
18921,
6776,
1006,
1002,
14305,
2004,
1002,
3627,
1027,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
guzzle/guzzle | build/Burgomaster.php | Burgomaster.exec | public function exec($command)
{
$this->debug("Executing: $command");
$output = $returnValue = null;
exec($command, $output, $returnValue);
if ($returnValue != 0) {
throw new \RuntimeException('Error executing command: '
. $command . ' : ' . implode("\n",... | php | public function exec($command)
{
$this->debug("Executing: $command");
$output = $returnValue = null;
exec($command, $output, $returnValue);
if ($returnValue != 0) {
throw new \RuntimeException('Error executing command: '
. $command . ' : ' . implode("\n",... | [
"public",
"function",
"exec",
"(",
"$",
"command",
")",
"{",
"$",
"this",
"->",
"debug",
"(",
"\"Executing: $command\"",
")",
";",
"$",
"output",
"=",
"$",
"returnValue",
"=",
"null",
";",
"exec",
"(",
"$",
"command",
",",
"$",
"output",
",",
"$",
"r... | Execute a command and throw an exception if the return code is not 0.
@param string $command Command to execute
@return string Returns the output of the command as a string
@throws \RuntimeException on error. | [
"Execute",
"a",
"command",
"and",
"throw",
"an",
"exception",
"if",
"the",
"return",
"code",
"is",
"not",
"0",
"."
] | bf595424e4d442a190582e088985dc835a789071 | https://github.com/guzzle/guzzle/blob/bf595424e4d442a190582e088985dc835a789071/build/Burgomaster.php#L207-L219 | train | Execute a command and return the output | [
30522,
2270,
3853,
4654,
8586,
1006,
1002,
3094,
1007,
1063,
1002,
2023,
1011,
1028,
2139,
8569,
2290,
1006,
1000,
23448,
1024,
1002,
3094,
30524,
19701,
1025,
4654,
8586,
1006,
1002,
3094,
1010,
1002,
6434,
1010,
1002,
2709,
10175,
5657,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.adjacentSibling | public function adjacentSibling($direction = 1)
{
$parent = $this->parent();
$collection = $parent ? $parent->collection('content', false) : null;
if ($collection instanceof Collection) {
return $collection->adjacentSibling($this->path(), $direction);
}
return fa... | php | public function adjacentSibling($direction = 1)
{
$parent = $this->parent();
$collection = $parent ? $parent->collection('content', false) : null;
if ($collection instanceof Collection) {
return $collection->adjacentSibling($this->path(), $direction);
}
return fa... | [
"public",
"function",
"adjacentSibling",
"(",
"$",
"direction",
"=",
"1",
")",
"{",
"$",
"parent",
"=",
"$",
"this",
"->",
"parent",
"(",
")",
";",
"$",
"collection",
"=",
"$",
"parent",
"?",
"$",
"parent",
"->",
"collection",
"(",
"'content'",
",",
... | Returns the adjacent sibling based on a direction.
@param int $direction either -1 or +1
@return PageInterface|bool the sibling page | [
"Returns",
"the",
"adjacent",
"sibling",
"based",
"on",
"a",
"direction",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Page/Page.php#L2478-L2487 | train | Get the sibling of this node | [
30522,
2270,
3853,
5516,
5332,
9709,
1006,
1002,
3257,
1027,
1015,
1007,
1063,
1002,
6687,
1027,
1002,
2023,
1011,
1028,
6687,
1006,
1007,
1025,
1002,
3074,
1027,
1002,
6687,
1029,
1002,
6687,
1011,
1028,
3074,
1006,
1005,
4180,
1005,
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... |
octobercms/october | modules/backend/widgets/Filter.php | Filter.getScopeNameFrom | public function getScopeNameFrom($scope)
{
if (is_string($scope)) {
$scope = $this->getScope($scope);
}
return $scope->nameFrom;
} | php | public function getScopeNameFrom($scope)
{
if (is_string($scope)) {
$scope = $this->getScope($scope);
}
return $scope->nameFrom;
} | [
"public",
"function",
"getScopeNameFrom",
"(",
"$",
"scope",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"scope",
")",
")",
"{",
"$",
"scope",
"=",
"$",
"this",
"->",
"getScope",
"(",
"$",
"scope",
")",
";",
"}",
"return",
"$",
"scope",
"->",
"name... | Returns the display name column for a scope.
@param string $scope
@return string | [
"Returns",
"the",
"display",
"name",
"column",
"for",
"a",
"scope",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/Filter.php#L906-L913 | train | Get Scope Name From | [
30522,
2270,
3853,
4152,
16186,
18442,
19699,
5358,
1006,
1002,
9531,
1007,
1063,
2065,
1006,
2003,
1035,
5164,
1006,
1002,
9531,
1007,
1007,
1063,
1002,
9531,
1027,
1002,
2023,
1011,
1028,
4152,
16186,
1006,
1002,
9531,
1007,
1025,
1065,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/HTML/QuickForm2/Rule.php | HTML_QuickForm2_Rule.getJavascript | public function getJavascript()
{
$js = "{\n\tcallback: " . $this->getJavascriptCallback() . ",\n" .
"\telementId: '" . $this->owner->getId() . "',\n" .
"\terrorMessage: '" . strtr($this->getMessage(), array(
"\r" => '\r',
"\n" => '\n... | php | public function getJavascript()
{
$js = "{\n\tcallback: " . $this->getJavascriptCallback() . ",\n" .
"\telementId: '" . $this->owner->getId() . "',\n" .
"\terrorMessage: '" . strtr($this->getMessage(), array(
"\r" => '\r',
"\n" => '\n... | [
"public",
"function",
"getJavascript",
"(",
")",
"{",
"$",
"js",
"=",
"\"{\\n\\tcallback: \"",
".",
"$",
"this",
"->",
"getJavascriptCallback",
"(",
")",
".",
"\",\\n\"",
".",
"\"\\telementId: '\"",
".",
"$",
"this",
"->",
"owner",
"->",
"getId",
"(",
")",
... | Returns the client-side representation of the Rule
The Javascript object returned contains the following fields:
- callback: {@see getJavascriptCallback()}
- elementId: element ID to set error for if validation fails
- errorMessage: error message to set if validation fails
- chained: chained rules, array of arrays lik... | [
"Returns",
"the",
"client",
"-",
"side",
"representation",
"of",
"the",
"Rule"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Rule.php#L309-L331 | train | Returns the javascript code for the error | [
30522,
2270,
3853,
2131,
3900,
12044,
23235,
1006,
1007,
1063,
1002,
1046,
2015,
1027,
1000,
1063,
1032,
1050,
1032,
22975,
8095,
5963,
1024,
1000,
1012,
1002,
2023,
1011,
1028,
2131,
3900,
12044,
23235,
9289,
20850,
8684,
1006,
1007,
1012,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Support/Collection.php | Collection.whereNotBetween | public function whereNotBetween($key, $values)
{
return $this->filter(function ($item) use ($key, $values) {
return data_get($item, $key) < reset($values) || data_get($item, $key) > end($values);
});
} | php | public function whereNotBetween($key, $values)
{
return $this->filter(function ($item) use ($key, $values) {
return data_get($item, $key) < reset($values) || data_get($item, $key) > end($values);
});
} | [
"public",
"function",
"whereNotBetween",
"(",
"$",
"key",
",",
"$",
"values",
")",
"{",
"return",
"$",
"this",
"->",
"filter",
"(",
"function",
"(",
"$",
"item",
")",
"use",
"(",
"$",
"key",
",",
"$",
"values",
")",
"{",
"return",
"data_get",
"(",
... | Filter items such that the value of the given key is not between the given values.
@param string $key
@param array $values
@return static | [
"Filter",
"items",
"such",
"that",
"the",
"value",
"of",
"the",
"given",
"key",
"is",
"not",
"between",
"the",
"given",
"values",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Support/Collection.php#L757-L762 | train | Filter items where not between | [
30522,
2270,
3853,
2073,
17048,
20915,
28394,
2078,
1006,
1002,
3145,
1010,
1002,
5300,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
11307,
1006,
3853,
1006,
1002,
8875,
1007,
2224,
1006,
1002,
3145,
1010,
1002,
5300,
1007,
1063,
2709,
2951,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.setFetchMode | public function setFetchMode($mode)
{
$this->_fetchMode = $mode;
try {
return $this->_stmt->setFetchMode($mode);
} catch (PDOException $e) {
// require_once 'Zend/Db/Statement/Exception.php';
throw new Zend_Db_Statement_Exception($e->getMessage(), $e->getC... | php | public function setFetchMode($mode)
{
$this->_fetchMode = $mode;
try {
return $this->_stmt->setFetchMode($mode);
} catch (PDOException $e) {
// require_once 'Zend/Db/Statement/Exception.php';
throw new Zend_Db_Statement_Exception($e->getMessage(), $e->getC... | [
"public",
"function",
"setFetchMode",
"(",
"$",
"mode",
")",
"{",
"$",
"this",
"->",
"_fetchMode",
"=",
"$",
"mode",
";",
"try",
"{",
"return",
"$",
"this",
"->",
"_stmt",
"->",
"setFetchMode",
"(",
"$",
"mode",
")",
";",
"}",
"catch",
"(",
"PDOExcep... | Set the default fetch mode for this statement.
@param int $mode The fetch mode.
@return bool
@throws Zend_Db_Statement_Exception | [
"Set",
"the",
"default",
"fetch",
"mode",
"for",
"this",
"statement",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Statement/Pdo.php#L428-L437 | train | Set the fetch mode for the statement | [
30522,
2270,
3853,
2275,
7959,
10649,
5302,
3207,
1006,
1002,
5549,
1007,
1063,
1002,
2023,
1011,
1028,
1035,
18584,
5302,
3207,
1027,
1002,
5549,
1025,
3046,
1063,
2709,
1002,
2023,
1011,
1028,
1035,
2358,
20492,
1011,
1028,
2275,
7959,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Common/Data/Blueprints.php | Blueprints.types | public function types()
{
if ($this->types === null) {
$this->types = [];
$grav = Grav::instance();
/** @var UniformResourceLocator $locator */
$locator = $grav['locator'];
// Get stream / directory iterator.
if ($locator->isStream($... | php | public function types()
{
if ($this->types === null) {
$this->types = [];
$grav = Grav::instance();
/** @var UniformResourceLocator $locator */
$locator = $grav['locator'];
// Get stream / directory iterator.
if ($locator->isStream($... | [
"public",
"function",
"types",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"types",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"types",
"=",
"[",
"]",
";",
"$",
"grav",
"=",
"Grav",
"::",
"instance",
"(",
")",
";",
"/** @var UniformResourceLocator ... | Get all available blueprint types.
@return array List of type=>name | [
"Get",
"all",
"available",
"blueprint",
"types",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Data/Blueprints.php#L53-L81 | train | Return all types in the search string | [
30522,
2270,
3853,
4127,
1006,
1007,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
4127,
1027,
1027,
1027,
19701,
1007,
1063,
1002,
2023,
1011,
1028,
4127,
1027,
1031,
1033,
1025,
1002,
24665,
11431,
1027,
24665,
11431,
1024,
1024,
6013,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/Tracker/Db/Pdo/Mysql.php | Mysql.connect | public function connect()
{
if (self::$profiling) {
$timer = $this->initProfiler();
}
// Make sure MySQL returns all matched rows on update queries including
// rows that actually didn't have to be updated because the values didn't
// change. This matches common ... | php | public function connect()
{
if (self::$profiling) {
$timer = $this->initProfiler();
}
// Make sure MySQL returns all matched rows on update queries including
// rows that actually didn't have to be updated because the values didn't
// change. This matches common ... | [
"public",
"function",
"connect",
"(",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"profiling",
")",
"{",
"$",
"timer",
"=",
"$",
"this",
"->",
"initProfiler",
"(",
")",
";",
"}",
"// Make sure MySQL returns all matched rows on update queries including",
"// rows that ... | Connects to the DB
@throws Exception if there was an error connecting the DB | [
"Connects",
"to",
"the",
"DB"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Tracker/Db/Pdo/Mysql.php#L97-L132 | train | Connects to the database and sets the default values | [
30522,
2270,
3853,
7532,
1006,
1007,
1063,
2065,
1006,
2969,
1024,
1024,
1002,
11268,
16281,
1007,
1063,
1002,
25309,
1027,
1002,
2023,
1011,
1028,
1999,
4183,
21572,
8873,
3917,
1006,
1007,
1025,
1065,
1013,
1013,
2191,
2469,
2026,
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... |
matomo-org/matomo | core/UpdateCheck.php | UpdateCheck.check | public static function check($force = false, $interval = null)
{
if (!SettingsPiwik::isAutoUpdateEnabled()) {
return;
}
if ($interval === null) {
$interval = self::CHECK_INTERVAL;
}
$lastTimeChecked = Option::get(self::LAST_TIME_CHECKED);
if ... | php | public static function check($force = false, $interval = null)
{
if (!SettingsPiwik::isAutoUpdateEnabled()) {
return;
}
if ($interval === null) {
$interval = self::CHECK_INTERVAL;
}
$lastTimeChecked = Option::get(self::LAST_TIME_CHECKED);
if ... | [
"public",
"static",
"function",
"check",
"(",
"$",
"force",
"=",
"false",
",",
"$",
"interval",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"SettingsPiwik",
"::",
"isAutoUpdateEnabled",
"(",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"$",
"interval",
"... | Check for a newer version
@param bool $force Force check
@param int $interval Interval used for update checks | [
"Check",
"for",
"a",
"newer",
"version"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/UpdateCheck.php#L30-L56 | train | Check the version number of Piwik | [
30522,
2270,
10763,
3853,
4638,
1006,
1002,
2486,
1027,
6270,
1010,
1002,
13483,
1027,
19701,
1007,
1063,
2065,
1006,
999,
10906,
8197,
9148,
2243,
1024,
1024,
18061,
16161,
6279,
13701,
8189,
23242,
1006,
1007,
1007,
1063,
2709,
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... |
octobercms/october | modules/cms/controllers/Index.php | Index.onDelete | public function onDelete()
{
$this->validateRequestTheme();
$type = Request::input('templateType');
$this->loadTemplate($type, trim(Request::input('templatePath')))->delete();
/*
* Extensibility - documented above
*/
$this->fireSystemEvent('cms.template.d... | php | public function onDelete()
{
$this->validateRequestTheme();
$type = Request::input('templateType');
$this->loadTemplate($type, trim(Request::input('templatePath')))->delete();
/*
* Extensibility - documented above
*/
$this->fireSystemEvent('cms.template.d... | [
"public",
"function",
"onDelete",
"(",
")",
"{",
"$",
"this",
"->",
"validateRequestTheme",
"(",
")",
";",
"$",
"type",
"=",
"Request",
"::",
"input",
"(",
"'templateType'",
")",
";",
"$",
"this",
"->",
"loadTemplate",
"(",
"$",
"type",
",",
"trim",
"(... | Deletes a template
@return void | [
"Deletes",
"a",
"template"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/controllers/Index.php#L336-L348 | train | Action for deleting a template | [
30522,
2270,
3853,
2006,
9247,
12870,
1006,
1007,
1063,
1002,
2023,
1011,
1028,
9398,
24932,
2063,
15500,
10760,
4168,
1006,
1007,
1025,
1002,
2828,
1027,
5227,
1024,
1024,
7953,
1006,
1005,
23561,
13874,
1005,
1007,
1025,
1002,
2023,
1011,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Console/Input/ArgvInput.php | ArgvInput.parseLongOption | private function parseLongOption($token)
{
$name = substr($token, 2);
if (false !== $pos = strpos($name, '=')) {
if (0 === \strlen($value = substr($name, $pos + 1))) {
array_unshift($this->parsed, $value);
}
$this->addLongOption(substr($name, 0, $... | php | private function parseLongOption($token)
{
$name = substr($token, 2);
if (false !== $pos = strpos($name, '=')) {
if (0 === \strlen($value = substr($name, $pos + 1))) {
array_unshift($this->parsed, $value);
}
$this->addLongOption(substr($name, 0, $... | [
"private",
"function",
"parseLongOption",
"(",
"$",
"token",
")",
"{",
"$",
"name",
"=",
"substr",
"(",
"$",
"token",
",",
"2",
")",
";",
"if",
"(",
"false",
"!==",
"$",
"pos",
"=",
"strpos",
"(",
"$",
"name",
",",
"'='",
")",
")",
"{",
"if",
"... | Parses a long option.
@param string $token The current token | [
"Parses",
"a",
"long",
"option",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Input/ArgvInput.php#L144-L156 | train | Parse Long Option | [
30522,
2797,
3853,
11968,
11246,
5063,
7361,
3508,
1006,
1002,
19204,
1007,
1063,
1002,
2171,
1027,
4942,
3367,
2099,
1006,
1002,
19204,
1010,
1016,
1007,
1025,
2065,
1006,
6270,
999,
1027,
1027,
1002,
13433,
2015,
1027,
2358,
14536,
2891,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/HTML/QuickForm2/Renderer/Default.php | HTML_QuickForm2_Renderer_Default.setElementTemplateForGroupId | public function setElementTemplateForGroupId($groupId, $elementClass, $template)
{
$this->elementTemplatesForGroupId[$groupId][strtolower($elementClass)] = $template;
return $this;
} | php | public function setElementTemplateForGroupId($groupId, $elementClass, $template)
{
$this->elementTemplatesForGroupId[$groupId][strtolower($elementClass)] = $template;
return $this;
} | [
"public",
"function",
"setElementTemplateForGroupId",
"(",
"$",
"groupId",
",",
"$",
"elementClass",
",",
"$",
"template",
")",
"{",
"$",
"this",
"->",
"elementTemplatesForGroupId",
"[",
"$",
"groupId",
"]",
"[",
"strtolower",
"(",
"$",
"elementClass",
")",
"]... | Sets grouped elements templates using group id
Templates set via {@link setTemplateForClass()} will not be used for
grouped form elements. When searching for a template to use, the renderer
will first consider template set for a specific group id, then the
group templates set by group class.
@param string Group i... | [
"Sets",
"grouped",
"elements",
"templates",
"using",
"group",
"id"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Renderer/Default.php#L246-L250 | train | Set Element Template for Group | [
30522,
2270,
3853,
2275,
12260,
3672,
18532,
15725,
29278,
17058,
3593,
1006,
1002,
2177,
3593,
1010,
1002,
5783,
26266,
1010,
1002,
23561,
1007,
1063,
1002,
2023,
1011,
1028,
5783,
18532,
15725,
22747,
21759,
22107,
3593,
1031,
1002,
2177,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/system/controllers/Updates.php | Updates.listInjectRowClass | public function listInjectRowClass($record, $definition = null)
{
if ($record->disabledByConfig) {
return 'hidden';
}
if ($record->orphaned || $record->is_disabled) {
return 'safe disabled';
}
if ($definition != 'manage') {
return;
... | php | public function listInjectRowClass($record, $definition = null)
{
if ($record->disabledByConfig) {
return 'hidden';
}
if ($record->orphaned || $record->is_disabled) {
return 'safe disabled';
}
if ($definition != 'manage') {
return;
... | [
"public",
"function",
"listInjectRowClass",
"(",
"$",
"record",
",",
"$",
"definition",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"record",
"->",
"disabledByConfig",
")",
"{",
"return",
"'hidden'",
";",
"}",
"if",
"(",
"$",
"record",
"->",
"orphaned",
"||",... | Override for ListController behavior.
Modifies the CSS class for each row in the list to
- hidden - Disabled by configuration
- safe disabled - Orphaned or disabled
- negative - Disabled by system
- frozen - Frozen by the user
- positive - Default CSS class
@see Backend\Behaviors\ListController
@return string | [
"Override",
"for",
"ListController",
"behavior",
".",
"Modifies",
"the",
"CSS",
"class",
"for",
"each",
"row",
"in",
"the",
"list",
"to"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/controllers/Updates.php#L230-L253 | train | List Inject Row Class | [
30522,
2270,
3853,
2862,
2378,
20614,
10524,
26266,
1006,
1002,
2501,
1010,
1002,
6210,
1027,
19701,
1007,
1063,
2065,
1006,
1002,
2501,
1011,
1028,
9776,
3762,
8663,
8873,
2290,
1007,
1063,
2709,
1005,
5023,
1005,
1025,
1065,
2065,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Bundle/WebProfilerBundle/Controller/ExceptionController.php | ExceptionController.showAction | public function showAction($token)
{
if (null === $this->profiler) {
throw new NotFoundHttpException('The profiler must be enabled.');
}
$this->profiler->disable();
$exception = $this->profiler->loadProfile($token)->getCollector('exception')->getException();
$te... | php | public function showAction($token)
{
if (null === $this->profiler) {
throw new NotFoundHttpException('The profiler must be enabled.');
}
$this->profiler->disable();
$exception = $this->profiler->loadProfile($token)->getCollector('exception')->getException();
$te... | [
"public",
"function",
"showAction",
"(",
"$",
"token",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"profiler",
")",
"{",
"throw",
"new",
"NotFoundHttpException",
"(",
"'The profiler must be enabled.'",
")",
";",
"}",
"$",
"this",
"->",
"profiler",... | Renders the exception panel for the given token.
@param string $token The profiler token
@return Response A Response instance
@throws NotFoundHttpException | [
"Renders",
"the",
"exception",
"panel",
"for",
"the",
"given",
"token",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bundle/WebProfilerBundle/Controller/ExceptionController.php#L52-L81 | train | Show the exception of a profile | [
30522,
2270,
3853,
2265,
18908,
3258,
1006,
1002,
19204,
1007,
1063,
2065,
1006,
19701,
1027,
1027,
1027,
1002,
2023,
1011,
1028,
6337,
2099,
1007,
1063,
5466,
2047,
2025,
14876,
8630,
11039,
25856,
10288,
24422,
1006,
1005,
1996,
6337,
209... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.rset | public function rset()
{
$this->_send('RSET');
// MS ESMTP doesn't follow RFC, see [ZF-1377]
$this->_expect(array(250, 220));
$this->_mail = false;
$this->_rcpt = false;
$this->_data = false;
} | php | public function rset()
{
$this->_send('RSET');
// MS ESMTP doesn't follow RFC, see [ZF-1377]
$this->_expect(array(250, 220));
$this->_mail = false;
$this->_rcpt = false;
$this->_data = false;
} | [
"public",
"function",
"rset",
"(",
")",
"{",
"$",
"this",
"->",
"_send",
"(",
"'RSET'",
")",
";",
"// MS ESMTP doesn't follow RFC, see [ZF-1377]",
"$",
"this",
"->",
"_expect",
"(",
"array",
"(",
"250",
",",
"220",
")",
")",
";",
"$",
"this",
"->",
"_mai... | Issues the RSET command and validates answer
Can be used to restore a clean smtp communication state when a transaction has been cancelled or commencing a new transaction.
@return void | [
"Issues",
"the",
"RSET",
"command",
"and",
"validates",
"answer"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail/Protocol/Smtp.php#L336-L345 | train | Sends RSET to the server | [
30522,
2270,
3853,
12667,
3388,
1006,
1007,
1063,
1002,
2023,
1011,
1028,
1035,
4604,
1006,
1005,
12667,
3388,
1005,
1007,
1025,
1013,
1013,
5796,
9686,
20492,
2361,
2987,
1005,
1056,
3582,
14645,
1010,
2156,
1031,
1062,
2546,
1011,
14989,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/BelongsToMany.php | BelongsToMany.find | public function find($id, $columns = ['*'])
{
return is_array($id) ? $this->findMany($id, $columns) : $this->where(
$this->getRelated()->getQualifiedKeyName(), '=', $id
)->first($columns);
} | php | public function find($id, $columns = ['*'])
{
return is_array($id) ? $this->findMany($id, $columns) : $this->where(
$this->getRelated()->getQualifiedKeyName(), '=', $id
)->first($columns);
} | [
"public",
"function",
"find",
"(",
"$",
"id",
",",
"$",
"columns",
"=",
"[",
"'*'",
"]",
")",
"{",
"return",
"is_array",
"(",
"$",
"id",
")",
"?",
"$",
"this",
"->",
"findMany",
"(",
"$",
"id",
",",
"$",
"columns",
")",
":",
"$",
"this",
"->",
... | Find a related model by its primary key.
@param mixed $id
@param array $columns
@return \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Collection|null | [
"Find",
"a",
"related",
"model",
"by",
"its",
"primary",
"key",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php#L505-L510 | train | Find a record in the recordset by ID. | [
30522,
2270,
3853,
2424,
1006,
1002,
8909,
1010,
1002,
7753,
1027,
1031,
1005,
1008,
1005,
1033,
1007,
1063,
2709,
2003,
1035,
9140,
1006,
1002,
8909,
1007,
1029,
1002,
2023,
1011,
1028,
2424,
2386,
2100,
1006,
1002,
8909,
1010,
1002,
775... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Field.php | Field.render | public function render()
{
if ($this->showAs->isNotEmpty()) {
$this->showAs->each(function ($callable) {
$this->value = $callable->call(
$this->parent->getModel(),
$this->value
);
});
}
return vi... | php | public function render()
{
if ($this->showAs->isNotEmpty()) {
$this->showAs->each(function ($callable) {
$this->value = $callable->call(
$this->parent->getModel(),
$this->value
);
});
}
return vi... | [
"public",
"function",
"render",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"showAs",
"->",
"isNotEmpty",
"(",
")",
")",
"{",
"$",
"this",
"->",
"showAs",
"->",
"each",
"(",
"function",
"(",
"$",
"callable",
")",
"{",
"$",
"this",
"->",
"value",
... | Render this field.
@return string | [
"Render",
"this",
"field",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Show/Field.php#L561-L573 | train | Render the field | [
30522,
2270,
3853,
17552,
1006,
1007,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
2265,
3022,
1011,
1028,
3475,
12184,
27718,
2100,
1006,
1007,
1007,
1063,
1002,
2023,
1011,
1028,
2265,
3022,
1011,
1028,
2169,
1006,
3853,
1006,
1002,
2655,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Cache.php | Cache.init | public function init(Grav $grav)
{
/** @var Config $config */
$this->config = $grav['config'];
$this->now = time();
if (null === $this->enabled) {
$this->enabled = (bool)$this->config->get('system.cache.enabled');
}
/** @var Uri $uri */
$uri = $g... | php | public function init(Grav $grav)
{
/** @var Config $config */
$this->config = $grav['config'];
$this->now = time();
if (null === $this->enabled) {
$this->enabled = (bool)$this->config->get('system.cache.enabled');
}
/** @var Uri $uri */
$uri = $g... | [
"public",
"function",
"init",
"(",
"Grav",
"$",
"grav",
")",
"{",
"/** @var Config $config */",
"$",
"this",
"->",
"config",
"=",
"$",
"grav",
"[",
"'config'",
"]",
";",
"$",
"this",
"->",
"now",
"=",
"time",
"(",
")",
";",
"if",
"(",
"null",
"===",
... | Initialization that sets a base key and the driver based on configuration settings
@param Grav $grav
@return void | [
"Initialization",
"that",
"sets",
"a",
"base",
"key",
"and",
"the",
"driver",
"based",
"on",
"configuration",
"settings"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Cache.php#L121-L147 | train | Initialize the cache | [
30522,
2270,
3853,
1999,
4183,
1006,
24665,
11431,
1002,
24665,
11431,
1007,
1063,
1013,
1008,
1008,
1030,
13075,
9530,
8873,
2290,
1002,
9530,
8873,
2290,
1008,
1013,
1002,
2023,
1011,
1028,
9530,
8873,
2290,
1027,
1002,
24665,
11431,
1031... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Command/AboutCommand.php | AboutCommand.execute | protected function execute(InputInterface $input, OutputInterface $output)
{
$io = new SymfonyStyle($input, $output);
/** @var KernelInterface $kernel */
$kernel = $this->getApplication()->getKernel();
$rows = [
['<info>Symfony</>'],
new TableSeparator(),
... | php | protected function execute(InputInterface $input, OutputInterface $output)
{
$io = new SymfonyStyle($input, $output);
/** @var KernelInterface $kernel */
$kernel = $this->getApplication()->getKernel();
$rows = [
['<info>Symfony</>'],
new TableSeparator(),
... | [
"protected",
"function",
"execute",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"io",
"=",
"new",
"SymfonyStyle",
"(",
"$",
"input",
",",
"$",
"output",
")",
";",
"/** @var KernelInterface $kernel */",
"$",
"kerne... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bundle/FrameworkBundle/Command/AboutCommand.php#L57-L102 | train | Execute the command | [
30522,
5123,
3853,
15389,
1006,
7953,
18447,
2121,
12172,
1002,
7953,
1010,
6434,
18447,
2121,
12172,
1002,
6434,
1007,
1063,
1002,
22834,
1027,
2047,
25353,
2213,
14876,
4890,
21756,
2571,
1006,
1002,
7953,
1010,
1002,
6434,
1007,
1025,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/system/traits/ConfigMaker.php | ConfigMaker.getConfigPath | public function getConfigPath($fileName, $configPath = null)
{
if (!isset($this->configPath)) {
$this->configPath = $this->guessConfigPath();
}
if (!$configPath) {
$configPath = $this->configPath;
}
$fileName = File::symbolizePath($fileName);
... | php | public function getConfigPath($fileName, $configPath = null)
{
if (!isset($this->configPath)) {
$this->configPath = $this->guessConfigPath();
}
if (!$configPath) {
$configPath = $this->configPath;
}
$fileName = File::symbolizePath($fileName);
... | [
"public",
"function",
"getConfigPath",
"(",
"$",
"fileName",
",",
"$",
"configPath",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"configPath",
")",
")",
"{",
"$",
"this",
"->",
"configPath",
"=",
"$",
"this",
"->",
"guessC... | Locates a file based on it's definition. If the file starts with
the ~ symbol it will be returned in context of the application base path,
otherwise it will be returned in context of the config path.
@param string $fileName File to load.
@param mixed $configPath Explicitly define a config path.
@return string Full path... | [
"Locates",
"a",
"file",
"based",
"on",
"it",
"s",
"definition",
".",
"If",
"the",
"file",
"starts",
"with",
"the",
"~",
"symbol",
"it",
"will",
"be",
"returned",
"in",
"context",
"of",
"the",
"application",
"base",
"path",
"otherwise",
"it",
"will",
"be"... | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/traits/ConfigMaker.php#L132-L162 | train | Returns the path to a file in the config folder | [
30522,
2270,
3853,
2131,
8663,
8873,
21600,
8988,
1006,
1002,
5371,
18442,
1010,
1002,
9530,
8873,
21600,
8988,
1027,
19701,
1007,
1063,
2065,
1006,
999,
26354,
3388,
1006,
1002,
2023,
1011,
1028,
9530,
8873,
21600,
8988,
1007,
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... |
matomo-org/matomo | core/ArchiveProcessor/Rules.php | Rules.getDoneStringFlagFor | public static function getDoneStringFlagFor(array $idSites, $segment, $periodLabel, $plugin)
{
if (!self::shouldProcessReportsAllPlugins($idSites, $segment, $periodLabel)) {
return self::getDoneFlagArchiveContainsOnePlugin($segment, $plugin);
}
return self::getDoneFlagArchiveCont... | php | public static function getDoneStringFlagFor(array $idSites, $segment, $periodLabel, $plugin)
{
if (!self::shouldProcessReportsAllPlugins($idSites, $segment, $periodLabel)) {
return self::getDoneFlagArchiveContainsOnePlugin($segment, $plugin);
}
return self::getDoneFlagArchiveCont... | [
"public",
"static",
"function",
"getDoneStringFlagFor",
"(",
"array",
"$",
"idSites",
",",
"$",
"segment",
",",
"$",
"periodLabel",
",",
"$",
"plugin",
")",
"{",
"if",
"(",
"!",
"self",
"::",
"shouldProcessReportsAllPlugins",
"(",
"$",
"idSites",
",",
"$",
... | Returns the name of the archive field used to tell the status of an archive, (ie,
whether the archive was created successfully or not).
@param array $idSites
@param Segment $segment
@param string $periodLabel
@param string $plugin
@return string | [
"Returns",
"the",
"name",
"of",
"the",
"archive",
"field",
"used",
"to",
"tell",
"the",
"status",
"of",
"an",
"archive",
"(",
"ie",
"whether",
"the",
"archive",
"was",
"created",
"successfully",
"or",
"not",
")",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/ArchiveProcessor/Rules.php#L50-L56 | train | Get done string flag for a specific site segment and plugin | [
30522,
2270,
10763,
3853,
2131,
5280,
4355,
4892,
10258,
8490,
29278,
1006,
9140,
1002,
8909,
28032,
2229,
1010,
1002,
6903,
1010,
1002,
2558,
20470,
2884,
1010,
1002,
13354,
2378,
1007,
1063,
2065,
1006,
999,
2969,
1024,
1024,
2323,
21572,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php | HttpCache.forward | protected function forward(Request $request, $catch = false, Response $entry = null)
{
if ($this->surrogate) {
$this->surrogate->addSurrogateCapability($request);
}
// always a "master" request (as the real master request can be in cache)
$response = SubRequestHandler::h... | php | protected function forward(Request $request, $catch = false, Response $entry = null)
{
if ($this->surrogate) {
$this->surrogate->addSurrogateCapability($request);
}
// always a "master" request (as the real master request can be in cache)
$response = SubRequestHandler::h... | [
"protected",
"function",
"forward",
"(",
"Request",
"$",
"request",
",",
"$",
"catch",
"=",
"false",
",",
"Response",
"$",
"entry",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"surrogate",
")",
"{",
"$",
"this",
"->",
"surrogate",
"->",
"add... | Forwards the Request to the backend and returns the Response.
All backend requests (cache passes, fetches, cache validations)
run through this method.
@param Request $request A Request instance
@param bool $catch Whether to catch exceptions or not
@param Response $entry A Response instance (the stale entry i... | [
"Forwards",
"the",
"Request",
"to",
"the",
"backend",
"and",
"returns",
"the",
"Response",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php#L471-L513 | train | Forward the request to the next handler | [
30522,
5123,
3853,
2830,
1006,
5227,
1002,
5227,
1010,
1002,
4608,
1027,
6270,
1010,
3433,
1002,
4443,
1027,
19701,
1007,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
7505,
21799,
1007,
1063,
1002,
2023,
1011,
1028,
7505,
21799,
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... |
php-ai/php-ml | src/Tokenization/NGramWordTokenizer.php | NGramWordTokenizer.tokenize | public function tokenize(string $text): array
{
preg_match_all('/\w\w+/u', $text, $words);
$words = $words[0];
$nGrams = [];
for ($j = $this->minGram; $j <= $this->maxGram; $j++) {
$nGrams = array_merge($nGrams, $this->getNgrams($words, $j));
}
return $... | php | public function tokenize(string $text): array
{
preg_match_all('/\w\w+/u', $text, $words);
$words = $words[0];
$nGrams = [];
for ($j = $this->minGram; $j <= $this->maxGram; $j++) {
$nGrams = array_merge($nGrams, $this->getNgrams($words, $j));
}
return $... | [
"public",
"function",
"tokenize",
"(",
"string",
"$",
"text",
")",
":",
"array",
"{",
"preg_match_all",
"(",
"'/\\w\\w+/u'",
",",
"$",
"text",
",",
"$",
"words",
")",
";",
"$",
"words",
"=",
"$",
"words",
"[",
"0",
"]",
";",
"$",
"nGrams",
"=",
"["... | {@inheritdoc} | [
"{"
] | f6aa1a59b0525b8fca3d2786d661ab3e70904016 | https://github.com/php-ai/php-ml/blob/f6aa1a59b0525b8fca3d2786d661ab3e70904016/src/Tokenization/NGramWordTokenizer.php#L34-L46 | train | Tokenize text into an array of ngrams | [
30522,
2270,
3853,
19204,
4697,
1006,
5164,
1002,
3793,
1007,
1024,
9140,
1063,
3653,
2290,
1035,
2674,
1035,
2035,
1006,
1005,
1013,
1032,
1059,
1032,
1059,
1009,
1013,
1057,
1005,
1010,
1002,
3793,
1010,
1002,
2616,
1007,
1025,
1002,
26... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/Contents/Archiver.php | Archiver.insertDayReports | private function insertDayReports()
{
foreach ($this->arrays as $recordName => $dataArray) {
$dataTable = $dataArray->asDataTable();
foreach ($dataTable->getRows() as $row) {
$label = $row->getColumn('label');
if (!empty($this->metadata[$label])) {
... | php | private function insertDayReports()
{
foreach ($this->arrays as $recordName => $dataArray) {
$dataTable = $dataArray->asDataTable();
foreach ($dataTable->getRows() as $row) {
$label = $row->getColumn('label');
if (!empty($this->metadata[$label])) {
... | [
"private",
"function",
"insertDayReports",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"arrays",
"as",
"$",
"recordName",
"=>",
"$",
"dataArray",
")",
"{",
"$",
"dataTable",
"=",
"$",
"dataArray",
"->",
"asDataTable",
"(",
")",
";",
"foreach",
"(",... | Records the daily datatables | [
"Records",
"the",
"daily",
"datatables"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Contents/Archiver.php#L211-L233 | train | Insert day reports | [
30522,
2797,
3853,
19274,
10259,
2890,
25378,
1006,
1007,
1063,
18921,
6776,
1006,
1002,
2023,
1011,
1028,
27448,
2004,
1002,
2501,
18442,
1027,
1028,
1002,
2951,
2906,
9447,
1007,
1063,
1002,
2951,
10880,
1027,
1002,
2951,
2906,
9447,
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... |
getgrav/grav | system/src/Grav/Common/Page/Collection.php | Collection.batch | public function batch($size)
{
$chunks = array_chunk($this->items, $size, true);
$list = [];
foreach ($chunks as $chunk) {
$list[] = new static($chunk, $this->params, $this->pages);
}
return $list;
} | php | public function batch($size)
{
$chunks = array_chunk($this->items, $size, true);
$list = [];
foreach ($chunks as $chunk) {
$list[] = new static($chunk, $this->params, $this->pages);
}
return $list;
} | [
"public",
"function",
"batch",
"(",
"$",
"size",
")",
"{",
"$",
"chunks",
"=",
"array_chunk",
"(",
"$",
"this",
"->",
"items",
",",
"$",
"size",
",",
"true",
")",
";",
"$",
"list",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"chunks",
"as",
"$",
"... | Split collection into array of smaller collections.
@param int $size
@return array|Collection[] | [
"Split",
"collection",
"into",
"array",
"of",
"smaller",
"collections",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Page/Collection.php#L183-L193 | train | Batch the items into a list of taxonomies | [
30522,
2270,
3853,
14108,
1006,
1002,
2946,
1007,
1063,
1002,
24839,
1027,
9140,
1035,
20000,
1006,
1002,
2023,
1011,
1028,
5167,
1010,
1002,
2946,
1010,
2995,
1007,
1025,
1002,
2862,
1027,
1031,
1033,
1025,
18921,
6776,
1006,
1002,
24839,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | build/Burgomaster.php | Burgomaster.deepCopy | public function deepCopy($from, $to)
{
if (!is_file($from)) {
throw new \InvalidArgumentException("File not found: {$from}");
}
$to = str_replace('//', '/', $this->stageDir . '/' . $to);
$dir = dirname($to);
if (!is_dir($dir)) {
if (!mkdir($dir, 0777... | php | public function deepCopy($from, $to)
{
if (!is_file($from)) {
throw new \InvalidArgumentException("File not found: {$from}");
}
$to = str_replace('//', '/', $this->stageDir . '/' . $to);
$dir = dirname($to);
if (!is_dir($dir)) {
if (!mkdir($dir, 0777... | [
"public",
"function",
"deepCopy",
"(",
"$",
"from",
",",
"$",
"to",
")",
"{",
"if",
"(",
"!",
"is_file",
"(",
"$",
"from",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"\"File not found: {$from}\"",
")",
";",
"}",
"$",
"to",
"=... | Copies a file and creates the destination directory if needed.
@param string $from File to copy
@param string $to Destination to copy the file to, relative to the
base staging directory.
@throws \InvalidArgumentException if the file cannot be found
@throws \RuntimeException if the directory cannot be created.
@throw... | [
"Copies",
"a",
"file",
"and",
"creates",
"the",
"destination",
"directory",
"if",
"needed",
"."
] | bf595424e4d442a190582e088985dc835a789071 | https://github.com/guzzle/guzzle/blob/bf595424e4d442a190582e088985dc835a789071/build/Burgomaster.php#L128-L146 | train | Copy file from one stage to another | [
30522,
2270,
3853,
2784,
3597,
7685,
1006,
1002,
2013,
1010,
1002,
2000,
1007,
1063,
2065,
1006,
999,
2003,
1035,
5371,
1006,
1002,
2013,
1007,
1007,
1063,
5466,
2047,
1032,
19528,
2906,
22850,
15781,
2595,
24422,
1006,
1000,
5371,
2025,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Exception/TransformationFailedException.php | TransformationFailedException.setInvalidMessage | public function setInvalidMessage(string $invalidMessage = null, array $invalidMessageParameters = []): void
{
$this->invalidMessage = $invalidMessage;
$this->invalidMessageParameters = $invalidMessageParameters;
} | php | public function setInvalidMessage(string $invalidMessage = null, array $invalidMessageParameters = []): void
{
$this->invalidMessage = $invalidMessage;
$this->invalidMessageParameters = $invalidMessageParameters;
} | [
"public",
"function",
"setInvalidMessage",
"(",
"string",
"$",
"invalidMessage",
"=",
"null",
",",
"array",
"$",
"invalidMessageParameters",
"=",
"[",
"]",
")",
":",
"void",
"{",
"$",
"this",
"->",
"invalidMessage",
"=",
"$",
"invalidMessage",
";",
"$",
"thi... | Sets the message that will be shown to the user.
@param string|null $invalidMessage The message or message key
@param array $invalidMessageParameters Data to be passed into the translator | [
"Sets",
"the",
"message",
"that",
"will",
"be",
"shown",
"to",
"the",
"user",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/Exception/TransformationFailedException.php#L37-L41 | train | Set invalid message | [
30522,
2270,
3853,
2275,
2378,
10175,
3593,
7834,
3736,
3351,
1006,
5164,
1002,
19528,
7834,
3736,
3351,
1027,
19701,
1010,
9140,
1002,
19528,
7834,
3736,
3351,
28689,
22828,
2015,
1027,
1031,
1033,
1007,
1024,
11675,
1063,
1002,
2023,
1011... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Validator/Constraints/EmailValidator.php | EmailValidator.checkHost | private function checkHost(string $host): bool
{
return '' !== $host && ($this->checkMX($host) || (checkdnsrr($host, 'A') || checkdnsrr($host, 'AAAA')));
} | php | private function checkHost(string $host): bool
{
return '' !== $host && ($this->checkMX($host) || (checkdnsrr($host, 'A') || checkdnsrr($host, 'AAAA')));
} | [
"private",
"function",
"checkHost",
"(",
"string",
"$",
"host",
")",
":",
"bool",
"{",
"return",
"''",
"!==",
"$",
"host",
"&&",
"(",
"$",
"this",
"->",
"checkMX",
"(",
"$",
"host",
")",
"||",
"(",
"checkdnsrr",
"(",
"$",
"host",
",",
"'A'",
")",
... | Check if one of MX, A or AAAA DNS RR exists. | [
"Check",
"if",
"one",
"of",
"MX",
"A",
"or",
"AAAA",
"DNS",
"RR",
"exists",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Validator/Constraints/EmailValidator.php#L170-L173 | train | Check if host is a domain name A or AAAA | [
30522,
2797,
3853,
4638,
15006,
2102,
1006,
5164,
1002,
3677,
1007,
1024,
22017,
2140,
1063,
2709,
1005,
1005,
999,
1027,
1027,
1002,
3677,
1004,
1004,
1006,
1002,
2023,
1011,
1028,
4638,
22984,
1006,
1002,
3677,
1007,
1064,
1064,
1006,
4... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/DependencyInjection/Compiler/PriorityTaggedServiceTrait.php | PriorityTaggedServiceTrait.findAndSortTaggedServices | private function findAndSortTaggedServices($tagName, ContainerBuilder $container)
{
$indexAttribute = $defaultIndexMethod = $useFqcnAsFallback = null;
if ($tagName instanceof TaggedIteratorArgument) {
$indexAttribute = $tagName->getIndexAttribute();
$defaultIndexMethod = $ta... | php | private function findAndSortTaggedServices($tagName, ContainerBuilder $container)
{
$indexAttribute = $defaultIndexMethod = $useFqcnAsFallback = null;
if ($tagName instanceof TaggedIteratorArgument) {
$indexAttribute = $tagName->getIndexAttribute();
$defaultIndexMethod = $ta... | [
"private",
"function",
"findAndSortTaggedServices",
"(",
"$",
"tagName",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"indexAttribute",
"=",
"$",
"defaultIndexMethod",
"=",
"$",
"useFqcnAsFallback",
"=",
"null",
";",
"if",
"(",
"$",
"tagName",
"inst... | Finds all services with the given tag name and order them by their priority.
The order of additions must be respected for services having the same priority,
and knowing that the \SplPriorityQueue class does not respect the FIFO method,
we should not use that class.
@see https://bugs.php.net/bug.php?id=53710
@see http... | [
"Finds",
"all",
"services",
"with",
"the",
"given",
"tag",
"name",
"and",
"order",
"them",
"by",
"their",
"priority",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/DependencyInjection/Compiler/PriorityTaggedServiceTrait.php#L42-L112 | train | Searches and sorts tagged services by tag name. | [
30522,
2797,
3853,
2424,
29560,
11589,
15900,
5999,
8043,
7903,
2229,
1006,
1002,
6415,
18442,
1010,
11661,
8569,
23891,
2099,
1002,
11661,
1007,
1063,
1002,
5950,
19321,
3089,
8569,
2618,
1027,
1002,
12398,
22254,
10288,
11368,
6806,
2094,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/View/Compilers/BladeCompiler.php | BladeCompiler.component | public function component($path, $alias = null)
{
$alias = $alias ?: Arr::last(explode('.', $path));
$this->directive($alias, function ($expression) use ($path) {
return $expression
? "<?php \$__env->startComponent('{$path}', {$expression}); ?>"
... | php | public function component($path, $alias = null)
{
$alias = $alias ?: Arr::last(explode('.', $path));
$this->directive($alias, function ($expression) use ($path) {
return $expression
? "<?php \$__env->startComponent('{$path}', {$expression}); ?>"
... | [
"public",
"function",
"component",
"(",
"$",
"path",
",",
"$",
"alias",
"=",
"null",
")",
"{",
"$",
"alias",
"=",
"$",
"alias",
"?",
":",
"Arr",
"::",
"last",
"(",
"explode",
"(",
"'.'",
",",
"$",
"path",
")",
")",
";",
"$",
"this",
"->",
"dire... | Register a component alias directive.
@param string $path
@param string $alias
@return void | [
"Register",
"a",
"component",
"alias",
"directive",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/View/Compilers/BladeCompiler.php#L468-L481 | train | Registers a component directive | [
30522,
2270,
3853,
6922,
1006,
1002,
4130,
1010,
1002,
14593,
1027,
19701,
1007,
1063,
1002,
14593,
1027,
1002,
14593,
1029,
1024,
12098,
2099,
1024,
1024,
2197,
1006,
15044,
1006,
1005,
1012,
1005,
1010,
1002,
4130,
1007,
1007,
1025,
1002,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Auth/Access/Gate.php | Gate.check | public function check($abilities, $arguments = [])
{
return collect($abilities)->every(function ($ability) use ($arguments) {
try {
return (bool) $this->raw($ability, $arguments);
} catch (AuthorizationException $e) {
return false;
}
... | php | public function check($abilities, $arguments = [])
{
return collect($abilities)->every(function ($ability) use ($arguments) {
try {
return (bool) $this->raw($ability, $arguments);
} catch (AuthorizationException $e) {
return false;
}
... | [
"public",
"function",
"check",
"(",
"$",
"abilities",
",",
"$",
"arguments",
"=",
"[",
"]",
")",
"{",
"return",
"collect",
"(",
"$",
"abilities",
")",
"->",
"every",
"(",
"function",
"(",
"$",
"ability",
")",
"use",
"(",
"$",
"arguments",
")",
"{",
... | Determine if all of the given abilities should be granted for the current user.
@param iterable|string $abilities
@param array|mixed $arguments
@return bool | [
"Determine",
"if",
"all",
"of",
"the",
"given",
"abilities",
"should",
"be",
"granted",
"for",
"the",
"current",
"user",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Auth/Access/Gate.php#L273-L282 | train | Checks if the current user has the required permissions. | [
30522,
2270,
3853,
4638,
1006,
1002,
7590,
1010,
1002,
9918,
1027,
1031,
1033,
1007,
1063,
2709,
8145,
1006,
1002,
7590,
1007,
1011,
1028,
2296,
1006,
3853,
1006,
1002,
3754,
1007,
2224,
1006,
1002,
9918,
1007,
1063,
3046,
1063,
2709,
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/PropertyAccess/PropertyPathBuilder.php | PropertyPathBuilder.remove | public function remove($offset, $length = 1)
{
if (!isset($this->elements[$offset])) {
throw new OutOfBoundsException(sprintf('The offset %s is not within the property path', $offset));
}
$this->resize($offset, $length, 0);
} | php | public function remove($offset, $length = 1)
{
if (!isset($this->elements[$offset])) {
throw new OutOfBoundsException(sprintf('The offset %s is not within the property path', $offset));
}
$this->resize($offset, $length, 0);
} | [
"public",
"function",
"remove",
"(",
"$",
"offset",
",",
"$",
"length",
"=",
"1",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"elements",
"[",
"$",
"offset",
"]",
")",
")",
"{",
"throw",
"new",
"OutOfBoundsException",
"(",
"sprintf",
... | Removes elements from the current path.
@param int $offset The offset at which to remove
@param int $length The length of the removed piece
@throws OutOfBoundsException if offset is invalid | [
"Removes",
"elements",
"from",
"the",
"current",
"path",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/PropertyAccess/PropertyPathBuilder.php#L94-L101 | train | Remove an element from the property path | [
30522,
2270,
3853,
6366,
1006,
1002,
16396,
1010,
1002,
3091,
1027,
1015,
1007,
1063,
2065,
1006,
999,
26354,
3388,
1006,
1002,
2023,
1011,
1028,
3787,
1031,
1002,
16396,
1033,
1007,
1007,
1063,
5466,
2047,
2041,
11253,
15494,
3366,
2595,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.setUserAndGroup | public function setUserAndGroup()
{
// Get uid.
$user_info = posix_getpwnam($this->user);
if (!$user_info) {
static::log("Warning: User {$this->user} not exsits");
return;
}
$uid = $user_info['uid'];
// Get gid.
if ($this->group) {
... | php | public function setUserAndGroup()
{
// Get uid.
$user_info = posix_getpwnam($this->user);
if (!$user_info) {
static::log("Warning: User {$this->user} not exsits");
return;
}
$uid = $user_info['uid'];
// Get gid.
if ($this->group) {
... | [
"public",
"function",
"setUserAndGroup",
"(",
")",
"{",
"// Get uid.",
"$",
"user_info",
"=",
"posix_getpwnam",
"(",
"$",
"this",
"->",
"user",
")",
";",
"if",
"(",
"!",
"$",
"user_info",
")",
"{",
"static",
"::",
"log",
"(",
"\"Warning: User {$this->user} n... | Set unix user and group for current process.
@return void | [
"Set",
"unix",
"user",
"and",
"group",
"for",
"current",
"process",
"."
] | 13649907f05014fcfffcfccaef01e63ad3339351 | https://github.com/walkor/Workerman/blob/13649907f05014fcfffcfccaef01e63ad3339351/Worker.php#L1515-L1542 | train | Set uid and group | [
30522,
2270,
3853,
2275,
20330,
5685,
17058,
1006,
1007,
1063,
1013,
1013,
2131,
21318,
2094,
1012,
1002,
5310,
1035,
18558,
1027,
13433,
5332,
2595,
1035,
2131,
28400,
13129,
1006,
1002,
2023,
1011,
1028,
5310,
1007,
1025,
2065,
1006,
999,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/Nonce.php | Nonce.checkNonce | public static function checkNonce($nonceName, $nonce = null)
{
if ($nonce === null) {
$nonce = Common::getRequestVar('nonce', null, 'string');
}
if (!self::verifyNonce($nonceName, $nonce)) {
throw new \Exception(Piwik::translate('General_ExceptionNonceMismatch'));
... | php | public static function checkNonce($nonceName, $nonce = null)
{
if ($nonce === null) {
$nonce = Common::getRequestVar('nonce', null, 'string');
}
if (!self::verifyNonce($nonceName, $nonce)) {
throw new \Exception(Piwik::translate('General_ExceptionNonceMismatch'));
... | [
"public",
"static",
"function",
"checkNonce",
"(",
"$",
"nonceName",
",",
"$",
"nonce",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"nonce",
"===",
"null",
")",
"{",
"$",
"nonce",
"=",
"Common",
"::",
"getRequestVar",
"(",
"'nonce'",
",",
"null",
",",
"'s... | Verifies and discards a nonce.
@param string $nonceName The nonce's unique ID. See {@link getNonce()}.
@param string|null $nonce The nonce from the client. If `null`, the value from the
**nonce** query parameter is used.
@throws \Exception if the nonce is invalid. See {@link verifyNonce()}. | [
"Verifies",
"and",
"discards",
"a",
"nonce",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Nonce.php#L165-L176 | train | Check nonce name | [
30522,
2270,
10763,
3853,
4638,
8540,
3401,
1006,
1002,
2512,
27524,
14074,
1010,
1002,
2512,
3401,
1027,
19701,
1007,
1063,
2065,
1006,
1002,
2512,
3401,
1027,
1027,
1027,
19701,
1007,
1063,
1002,
2512,
3401,
30524,
5466,
2047,
1032,
6453,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/Installation/Controller.php | Controller.databaseSetup | function databaseSetup()
{
$this->checkPiwikIsNotInstalled();
$view = new View(
'@Installation/databaseSetup',
$this->getInstallationSteps(),
__FUNCTION__
);
$view->showNextStep = false;
$form = new FormDatabaseSetup();
if ($for... | php | function databaseSetup()
{
$this->checkPiwikIsNotInstalled();
$view = new View(
'@Installation/databaseSetup',
$this->getInstallationSteps(),
__FUNCTION__
);
$view->showNextStep = false;
$form = new FormDatabaseSetup();
if ($for... | [
"function",
"databaseSetup",
"(",
")",
"{",
"$",
"this",
"->",
"checkPiwikIsNotInstalled",
"(",
")",
";",
"$",
"view",
"=",
"new",
"View",
"(",
"'@Installation/databaseSetup'",
",",
"$",
"this",
"->",
"getInstallationSteps",
"(",
")",
",",
"__FUNCTION__",
")",... | Installation Step 3: Database Set-up
@throws Exception|Zend_Db_Adapter_Exception | [
"Installation",
"Step",
"3",
":",
"Database",
"Set",
"-",
"up"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Installation/Controller.php#L131-L163 | train | This method is called to display the database setup screen. | [
30522,
3853,
17881,
3388,
6279,
1006,
1007,
1063,
1002,
2023,
1011,
1028,
4638,
8197,
9148,
14270,
17048,
7076,
9080,
3709,
1006,
1007,
1025,
1002,
3193,
1027,
2047,
3193,
1006,
1005,
1030,
8272,
1013,
17881,
3388,
6279,
1005,
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... |
symfony/symfony | src/Symfony/Component/Messenger/Transport/AmqpExt/Connection.php | Connection.get | public function get(string $queueName): ?\AMQPEnvelope
{
if ($this->shouldSetup()) {
$this->setup();
}
try {
if (false !== $message = $this->queue($queueName)->get()) {
return $message;
}
} catch (\AMQPQueueException $e) {
... | php | public function get(string $queueName): ?\AMQPEnvelope
{
if ($this->shouldSetup()) {
$this->setup();
}
try {
if (false !== $message = $this->queue($queueName)->get()) {
return $message;
}
} catch (\AMQPQueueException $e) {
... | [
"public",
"function",
"get",
"(",
"string",
"$",
"queueName",
")",
":",
"?",
"\\",
"AMQPEnvelope",
"{",
"if",
"(",
"$",
"this",
"->",
"shouldSetup",
"(",
")",
")",
"{",
"$",
"this",
"->",
"setup",
"(",
")",
";",
"}",
"try",
"{",
"if",
"(",
"false... | Gets a message from the specified queue.
@throws \AMQPException | [
"Gets",
"a",
"message",
"from",
"the",
"specified",
"queue",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Messenger/Transport/AmqpExt/Connection.php#L299-L321 | train | Get a message from the queue | [
30522,
2270,
3853,
2131,
1006,
5164,
1002,
24240,
18442,
1007,
1024,
1029,
1032,
2572,
4160,
11837,
15985,
17635,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
2323,
13462,
6279,
1006,
1007,
1007,
1063,
1002,
2023,
1011,
1028,
16437,
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... |
symfony/symfony | src/Symfony/Component/Lock/Store/RedisStore.php | RedisStore.exists | public function exists(Key $key)
{
return $this->redis->get((string) $key) === $this->getUniqueToken($key);
} | php | public function exists(Key $key)
{
return $this->redis->get((string) $key) === $this->getUniqueToken($key);
} | [
"public",
"function",
"exists",
"(",
"Key",
"$",
"key",
")",
"{",
"return",
"$",
"this",
"->",
"redis",
"->",
"get",
"(",
"(",
"string",
")",
"$",
"key",
")",
"===",
"$",
"this",
"->",
"getUniqueToken",
"(",
"$",
"key",
")",
";",
"}"
] | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Lock/Store/RedisStore.php#L122-L125 | train | Checks if a key exists in the cache | [
30522,
2270,
3853,
6526,
1006,
3145,
1002,
3145,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
2417,
2483,
1011,
1028,
2131,
1006,
1006,
5164,
1007,
1002,
3145,
1007,
1027,
1027,
1027,
1002,
2023,
1011,
1028,
2131,
19496,
12647,
11045,
2078,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Session/Middleware/AuthenticateSession.php | AuthenticateSession.storePasswordHashInSession | protected function storePasswordHashInSession($request)
{
if (! $request->user()) {
return;
}
$request->session()->put([
'password_hash' => $request->user()->getAuthPassword(),
]);
} | php | protected function storePasswordHashInSession($request)
{
if (! $request->user()) {
return;
}
$request->session()->put([
'password_hash' => $request->user()->getAuthPassword(),
]);
} | [
"protected",
"function",
"storePasswordHashInSession",
"(",
"$",
"request",
")",
"{",
"if",
"(",
"!",
"$",
"request",
"->",
"user",
"(",
")",
")",
"{",
"return",
";",
"}",
"$",
"request",
"->",
"session",
"(",
")",
"->",
"put",
"(",
"[",
"'password_has... | Store the user's current password hash in the session.
@param \Illuminate\Http\Request $request
@return void | [
"Store",
"the",
"user",
"s",
"current",
"password",
"hash",
"in",
"the",
"session",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Session/Middleware/AuthenticateSession.php#L69-L78 | train | Stores the password hash in the session | [
30522,
5123,
3853,
3573,
15194,
18351,
14949,
10606,
8583,
10992,
1006,
1002,
5227,
1007,
1063,
2065,
1006,
999,
1002,
5227,
1011,
1028,
5310,
1006,
1007,
1007,
1063,
2709,
1025,
1065,
1002,
5227,
1011,
1028,
5219,
1006,
1007,
1011,
1028,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Cache/RedisLock.php | RedisLock.acquire | public function acquire()
{
$result = $this->redis->setnx($this->name, $this->owner);
if ($result === 1 && $this->seconds > 0) {
$this->redis->expire($this->name, $this->seconds);
}
return $result === 1;
} | php | public function acquire()
{
$result = $this->redis->setnx($this->name, $this->owner);
if ($result === 1 && $this->seconds > 0) {
$this->redis->expire($this->name, $this->seconds);
}
return $result === 1;
} | [
"public",
"function",
"acquire",
"(",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"redis",
"->",
"setnx",
"(",
"$",
"this",
"->",
"name",
",",
"$",
"this",
"->",
"owner",
")",
";",
"if",
"(",
"$",
"result",
"===",
"1",
"&&",
"$",
"this",
"... | Attempt to acquire the lock.
@return bool | [
"Attempt",
"to",
"acquire",
"the",
"lock",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Cache/RedisLock.php#L35-L44 | train | Acquires a new cache entry | [
30522,
2270,
3853,
9878,
1006,
1007,
1063,
1002,
2765,
1027,
1002,
2023,
1011,
1028,
2417,
2483,
1011,
1028,
2275,
26807,
1006,
1002,
2023,
1011,
1028,
2171,
1010,
1002,
2023,
1011,
1028,
3954,
1007,
1025,
2065,
1006,
1002,
2765,
1027,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Console/Scheduling/Event.php | Event.runCommandInBackground | protected function runCommandInBackground(Container $container)
{
$this->callBeforeCallbacks($container);
Process::fromShellCommandline($this->buildCommand(), base_path(), null, null, null)->run();
} | php | protected function runCommandInBackground(Container $container)
{
$this->callBeforeCallbacks($container);
Process::fromShellCommandline($this->buildCommand(), base_path(), null, null, null)->run();
} | [
"protected",
"function",
"runCommandInBackground",
"(",
"Container",
"$",
"container",
")",
"{",
"$",
"this",
"->",
"callBeforeCallbacks",
"(",
"$",
"container",
")",
";",
"Process",
"::",
"fromShellCommandline",
"(",
"$",
"this",
"->",
"buildCommand",
"(",
")",... | Run the command in the background.
@param \Illuminate\Contracts\Container\Container $container
@return void | [
"Run",
"the",
"command",
"in",
"the",
"background",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Console/Scheduling/Event.php#L229-L234 | train | Runs the command in the background. | [
30522,
5123,
3853,
2448,
9006,
2386,
8718,
5963,
16365,
1006,
11661,
1002,
11661,
1007,
1063,
1002,
2023,
1011,
1028,
2655,
4783,
29278,
19281,
3363,
12221,
1006,
1002,
11661,
1007,
1025,
2832,
1024,
1024,
2013,
4095,
5349,
9006,
2386,
1942... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Database/Eloquent/Concerns/HidesAttributes.php | HidesAttributes.addHidden | public function addHidden($attributes = null)
{
$this->hidden = array_merge(
$this->hidden, is_array($attributes) ? $attributes : func_get_args()
);
} | php | public function addHidden($attributes = null)
{
$this->hidden = array_merge(
$this->hidden, is_array($attributes) ? $attributes : func_get_args()
);
} | [
"public",
"function",
"addHidden",
"(",
"$",
"attributes",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"hidden",
"=",
"array_merge",
"(",
"$",
"this",
"->",
"hidden",
",",
"is_array",
"(",
"$",
"attributes",
")",
"?",
"$",
"attributes",
":",
"func_get_args... | Add hidden attributes for the model.
@param array|string|null $attributes
@return void | [
"Add",
"hidden",
"attributes",
"for",
"the",
"model",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Concerns/HidesAttributes.php#L50-L55 | train | Add hidden attributes to the hidden list | [
30522,
2270,
3853,
5587,
27511,
4181,
1006,
1002,
12332,
1027,
19701,
1007,
1063,
1002,
2023,
1011,
1028,
5023,
1027,
9140,
1035,
13590,
1006,
1002,
2023,
1011,
1028,
5023,
1010,
2003,
1035,
9140,
1006,
1002,
12332,
1007,
1029,
1002,
12332,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Console/Scheduling/Event.php | Event.ensureOutputIsBeingCaptured | protected function ensureOutputIsBeingCaptured()
{
if (is_null($this->output) || $this->output == $this->getDefaultOutput()) {
$this->sendOutputTo(storage_path('logs/schedule-'.sha1($this->mutexName()).'.log'));
}
} | php | protected function ensureOutputIsBeingCaptured()
{
if (is_null($this->output) || $this->output == $this->getDefaultOutput()) {
$this->sendOutputTo(storage_path('logs/schedule-'.sha1($this->mutexName()).'.log'));
}
} | [
"protected",
"function",
"ensureOutputIsBeingCaptured",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"output",
")",
"||",
"$",
"this",
"->",
"output",
"==",
"$",
"this",
"->",
"getDefaultOutput",
"(",
")",
")",
"{",
"$",
"this",
"->",
"... | Ensure that the command output is being captured.
@return void | [
"Ensure",
"that",
"the",
"command",
"output",
"is",
"being",
"captured",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Console/Scheduling/Event.php#L442-L447 | train | Ensures that the output is being captured. | [
30522,
5123,
3853,
5676,
5833,
18780,
2483,
19205,
3070,
17695,
11244,
2094,
1006,
1007,
1063,
2065,
1006,
2003,
1035,
19701,
1006,
1002,
2023,
1011,
1028,
6434,
1007,
1064,
1064,
1002,
2023,
1011,
1028,
6434,
1027,
1027,
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... |
laravel/framework | src/Illuminate/Queue/DatabaseQueue.php | DatabaseQueue.isAvailable | protected function isAvailable($query)
{
$query->where(function ($query) {
$query->whereNull('reserved_at')
->where('available_at', '<=', $this->currentTime());
});
} | php | protected function isAvailable($query)
{
$query->where(function ($query) {
$query->whereNull('reserved_at')
->where('available_at', '<=', $this->currentTime());
});
} | [
"protected",
"function",
"isAvailable",
"(",
"$",
"query",
")",
"{",
"$",
"query",
"->",
"where",
"(",
"function",
"(",
"$",
"query",
")",
"{",
"$",
"query",
"->",
"whereNull",
"(",
"'reserved_at'",
")",
"->",
"where",
"(",
"'available_at'",
",",
"'<='",... | Modify the query to check for available jobs.
@param \Illuminate\Database\Query\Builder $query
@return void | [
"Modify",
"the",
"query",
"to",
"check",
"for",
"available",
"jobs",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Queue/DatabaseQueue.php#L232-L238 | train | This method is used to filter the records by availability | [
30522,
5123,
3853,
18061,
3567,
11733,
3468,
1006,
1002,
23032,
1007,
1063,
1002,
23032,
1011,
1028,
2073,
1006,
3853,
1006,
1002,
23032,
1007,
1063,
1002,
23032,
1011,
1028,
2073,
11231,
3363,
1006,
1005,
9235,
1035,
2012,
1005,
1007,
1011... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/DataTable.php | DataTable.getRowFromId | public function getRowFromId($id)
{
if (!isset($this->rows[$id])) {
if ($id == self::ID_SUMMARY_ROW
&& !is_null($this->summaryRow)
) {
return $this->summaryRow;
}
return false;
}
return $this->rows[$id];
} | php | public function getRowFromId($id)
{
if (!isset($this->rows[$id])) {
if ($id == self::ID_SUMMARY_ROW
&& !is_null($this->summaryRow)
) {
return $this->summaryRow;
}
return false;
}
return $this->rows[$id];
} | [
"public",
"function",
"getRowFromId",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"rows",
"[",
"$",
"id",
"]",
")",
")",
"{",
"if",
"(",
"$",
"id",
"==",
"self",
"::",
"ID_SUMMARY_ROW",
"&&",
"!",
"is_null",
"(",
... | Returns a row by ID. The ID is either the index of the row or {@link ID_SUMMARY_ROW}.
@param int $id The row ID.
@return Row|false The Row or false if not found. | [
"Returns",
"a",
"row",
"by",
"ID",
".",
"The",
"ID",
"is",
"either",
"the",
"index",
"of",
"the",
"row",
"or",
"{",
"@link",
"ID_SUMMARY_ROW",
"}",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable.php#L750-L761 | train | Get Row from ID | [
30522,
2270,
3853,
2131,
10524,
19699,
20936,
2094,
1006,
1002,
8909,
1007,
1063,
2065,
1006,
999,
26354,
3388,
1006,
1002,
2023,
1011,
1028,
10281,
1031,
30524,
1024,
8909,
1035,
12654,
1035,
5216,
1004,
1004,
999,
2003,
1035,
19701,
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/Queue/DatabaseQueue.php | DatabaseQueue.buildDatabaseRecord | protected function buildDatabaseRecord($queue, $payload, $availableAt, $attempts = 0)
{
return [
'queue' => $queue,
'attempts' => $attempts,
'reserved_at' => null,
'available_at' => $availableAt,
'created_at' => $this->currentTime(),
'p... | php | protected function buildDatabaseRecord($queue, $payload, $availableAt, $attempts = 0)
{
return [
'queue' => $queue,
'attempts' => $attempts,
'reserved_at' => null,
'available_at' => $availableAt,
'created_at' => $this->currentTime(),
'p... | [
"protected",
"function",
"buildDatabaseRecord",
"(",
"$",
"queue",
",",
"$",
"payload",
",",
"$",
"availableAt",
",",
"$",
"attempts",
"=",
"0",
")",
"{",
"return",
"[",
"'queue'",
"=>",
"$",
"queue",
",",
"'attempts'",
"=>",
"$",
"attempts",
",",
"'rese... | Create an array to insert for the given job.
@param string|null $queue
@param string $payload
@param int $availableAt
@param int $attempts
@return array | [
"Create",
"an",
"array",
"to",
"insert",
"for",
"the",
"given",
"job",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Queue/DatabaseQueue.php#L174-L184 | train | Build the database record array | [
30522,
5123,
3853,
3857,
2850,
2696,
15058,
2890,
27108,
2094,
1006,
1002,
24240,
1010,
1002,
18093,
1010,
1002,
2800,
4017,
1010,
1002,
4740,
1027,
1014,
1007,
1063,
2709,
1031,
1005,
24240,
1005,
1027,
1028,
1002,
24240,
1010,
1005,
4740,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/TokenStorage/SessionTokenStorage.php | SessionTokenStorage.removeToken | public function removeToken($tokenId)
{
if (!$this->session->isStarted()) {
$this->session->start();
}
return $this->session->remove($this->namespace.'/'.$tokenId);
} | php | public function removeToken($tokenId)
{
if (!$this->session->isStarted()) {
$this->session->start();
}
return $this->session->remove($this->namespace.'/'.$tokenId);
} | [
"public",
"function",
"removeToken",
"(",
"$",
"tokenId",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"session",
"->",
"isStarted",
"(",
")",
")",
"{",
"$",
"this",
"->",
"session",
"->",
"start",
"(",
")",
";",
"}",
"return",
"$",
"this",
"->",
... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Security/Csrf/TokenStorage/SessionTokenStorage.php#L87-L94 | train | Remove a token from the session | [
30522,
2270,
3853,
6366,
18715,
2368,
1006,
1002,
19204,
3593,
1007,
1063,
2065,
1006,
999,
1002,
2023,
1011,
1028,
5219,
1011,
1028,
26354,
7559,
3064,
1006,
1007,
1007,
1063,
1002,
2023,
1011,
1028,
5219,
1011,
1028,
2707,
1006,
1007,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/Zend/Session/SaveHandler/DbTable.php | Zend_Session_SaveHandler_DbTable._setupTableName | protected function _setupTableName()
{
if (empty($this->_name) && basename(($this->_name = session_save_path())) != $this->_name) {
/**
* @see Zend_Session_SaveHandler_Exception
*/
// require_once 'Zend/Session/SaveHandler/Exception.php';
throw ... | php | protected function _setupTableName()
{
if (empty($this->_name) && basename(($this->_name = session_save_path())) != $this->_name) {
/**
* @see Zend_Session_SaveHandler_Exception
*/
// require_once 'Zend/Session/SaveHandler/Exception.php';
throw ... | [
"protected",
"function",
"_setupTableName",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"_name",
")",
"&&",
"basename",
"(",
"(",
"$",
"this",
"->",
"_name",
"=",
"session_save_path",
"(",
")",
")",
")",
"!=",
"$",
"this",
"->",
"_name... | Initialize table and schema names
@return void
@throws Zend_Session_SaveHandler_Exception | [
"Initialize",
"table",
"and",
"schema",
"names"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Session/SaveHandler/DbTable.php#L417-L431 | train | Setup table name | [
30522,
5123,
3853,
1035,
16437,
10880,
18442,
1006,
1007,
1063,
2065,
1006,
4064,
1006,
1002,
2023,
1011,
1028,
1035,
2171,
1007,
1004,
1004,
2918,
18442,
1006,
1006,
1002,
2023,
1011,
1028,
1035,
2171,
1027,
5219,
1035,
3828,
1035,
4130,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.resource | public function resource($path = null)
{
if (!empty($path)) {
$this->resourcePath = $path;
return $this;
}
if (!empty($this->resourcePath)) {
return $this->resourcePath;
}
return app('request')->getPathInfo();
} | php | public function resource($path = null)
{
if (!empty($path)) {
$this->resourcePath = $path;
return $this;
}
if (!empty($this->resourcePath)) {
return $this->resourcePath;
}
return app('request')->getPathInfo();
} | [
"public",
"function",
"resource",
"(",
"$",
"path",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"path",
")",
")",
"{",
"$",
"this",
"->",
"resourcePath",
"=",
"$",
"path",
";",
"return",
"$",
"this",
";",
"}",
"if",
"(",
"!",
"emp... | Get current resource uri.
@param string $path
@return string | [
"Get",
"current",
"resource",
"uri",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Grid.php#L788-L801 | train | Get Resource Path | [
30522,
2270,
3853,
7692,
1006,
1002,
4130,
1027,
19701,
1007,
1063,
2065,
1006,
999,
4064,
1006,
1002,
4130,
1007,
1007,
1063,
1002,
2023,
1011,
1028,
7692,
15069,
1027,
1002,
4130,
1025,
2709,
1002,
2023,
1025,
1065,
2065,
1006,
999,
406... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Connection.php | Connection.tryAgainIfCausedByLostConnection | protected function tryAgainIfCausedByLostConnection(QueryException $e, $query, $bindings, Closure $callback)
{
if ($this->causedByLostConnection($e->getPrevious())) {
$this->reconnect();
return $this->runQueryCallback($query, $bindings, $callback);
}
throw $e;
} | php | protected function tryAgainIfCausedByLostConnection(QueryException $e, $query, $bindings, Closure $callback)
{
if ($this->causedByLostConnection($e->getPrevious())) {
$this->reconnect();
return $this->runQueryCallback($query, $bindings, $callback);
}
throw $e;
} | [
"protected",
"function",
"tryAgainIfCausedByLostConnection",
"(",
"QueryException",
"$",
"e",
",",
"$",
"query",
",",
"$",
"bindings",
",",
"Closure",
"$",
"callback",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"causedByLostConnection",
"(",
"$",
"e",
"->",
"ge... | Handle a query exception that occurred during query execution.
@param \Illuminate\Database\QueryException $e
@param string $query
@param array $bindings
@param \Closure $callback
@return mixed
@throws \Illuminate\Database\QueryException | [
"Handle",
"a",
"query",
"exception",
"that",
"occurred",
"during",
"query",
"execution",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Connection.php#L733-L742 | train | Try again if caused by lost connection | [
30522,
5123,
3853,
3046,
16098,
5498,
11329,
20559,
2098,
3762,
10483,
13535,
18256,
7542,
1006,
23032,
10288,
24422,
1002,
1041,
1010,
1002,
23032,
1010,
1002,
8031,
2015,
1010,
8503,
1002,
2655,
5963,
1007,
1063,
2065,
1006,
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... |
matomo-org/matomo | core/Plugin/Visualization.php | Visualization.assignTemplateVar | public function assignTemplateVar($vars, $value = null)
{
if (is_string($vars)) {
$this->templateVars[$vars] = $value;
} elseif (is_array($vars)) {
foreach ($vars as $key => $value) {
$this->templateVars[$key] = $value;
}
}
} | php | public function assignTemplateVar($vars, $value = null)
{
if (is_string($vars)) {
$this->templateVars[$vars] = $value;
} elseif (is_array($vars)) {
foreach ($vars as $key => $value) {
$this->templateVars[$key] = $value;
}
}
} | [
"public",
"function",
"assignTemplateVar",
"(",
"$",
"vars",
",",
"$",
"value",
"=",
"null",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"vars",
")",
")",
"{",
"$",
"this",
"->",
"templateVars",
"[",
"$",
"vars",
"]",
"=",
"$",
"value",
";",
"}",
... | Assigns a template variable making it available in the Twig template specified by
{@link TEMPLATE_FILE}.
@param array|string $vars One or more variable names to set.
@param mixed $value The value to set each variable to.
@api | [
"Assigns",
"a",
"template",
"variable",
"making",
"it",
"available",
"in",
"the",
"Twig",
"template",
"specified",
"by",
"{",
"@link",
"TEMPLATE_FILE",
"}",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Plugin/Visualization.php#L349-L358 | train | Assign a template variable to the current context | [
30522,
2270,
3853,
23911,
18532,
15725,
10755,
1006,
1002,
13075,
2015,
1010,
1002,
3643,
1027,
19701,
1007,
1063,
2065,
1006,
2003,
1035,
5164,
1006,
1002,
13075,
2015,
1007,
1007,
1063,
1002,
2023,
1011,
1028,
23561,
10755,
2015,
1031,
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/Support/Optional.php | Optional.offsetSet | public function offsetSet($key, $value)
{
if (Arr::accessible($this->value)) {
$this->value[$key] = $value;
}
} | php | public function offsetSet($key, $value)
{
if (Arr::accessible($this->value)) {
$this->value[$key] = $value;
}
} | [
"public",
"function",
"offsetSet",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"if",
"(",
"Arr",
"::",
"accessible",
"(",
"$",
"this",
"->",
"value",
")",
")",
"{",
"$",
"this",
"->",
"value",
"[",
"$",
"key",
"]",
"=",
"$",
"value",
";",
"}"... | Set the item at a given offset.
@param mixed $key
@param mixed $value
@return void | [
"Set",
"the",
"item",
"at",
"a",
"given",
"offset",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Support/Optional.php#L93-L98 | train | Set the value of the key | [
30522,
2270,
3853,
16396,
13462,
1006,
1002,
3145,
1010,
1002,
3643,
1007,
1063,
2065,
1006,
12098,
2099,
1024,
1024,
7801,
1006,
1002,
2023,
1011,
1028,
3643,
1007,
1007,
1063,
1002,
2023,
1011,
1028,
3643,
1031,
1002,
3145,
1033,
1027,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Cache/Repository.php | Repository.put | public function put($key, $value, $ttl = null)
{
if (is_array($key)) {
return $this->putMany($key, $value);
}
if ($ttl === null) {
return $this->forever($key, $value);
}
$seconds = $this->getSeconds($ttl);
if ($seconds <= 0) {
re... | php | public function put($key, $value, $ttl = null)
{
if (is_array($key)) {
return $this->putMany($key, $value);
}
if ($ttl === null) {
return $this->forever($key, $value);
}
$seconds = $this->getSeconds($ttl);
if ($seconds <= 0) {
re... | [
"public",
"function",
"put",
"(",
"$",
"key",
",",
"$",
"value",
",",
"$",
"ttl",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"key",
")",
")",
"{",
"return",
"$",
"this",
"->",
"putMany",
"(",
"$",
"key",
",",
"$",
"value",
")",
"... | Store an item in the cache.
@param string $key
@param mixed $value
@param \DateTimeInterface|\DateInterval|int|null $ttl
@return bool | [
"Store",
"an",
"item",
"in",
"the",
"cache",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Cache/Repository.php#L199-L222 | train | Put an item into the cache | [
30522,
2270,
3853,
2404,
1006,
1002,
3145,
1010,
1002,
3643,
1010,
1002,
23746,
2140,
1027,
19701,
1007,
1063,
2065,
1006,
2003,
1035,
9140,
1006,
1002,
3145,
1007,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
2404,
2386,
2100,
1006,
1002,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationPath.php | ViolationPath.mapsForm | public function mapsForm($index)
{
if (!isset($this->mapsForm[$index])) {
throw new OutOfBoundsException(sprintf('The index %s is not within the violation path', $index));
}
return $this->mapsForm[$index];
} | php | public function mapsForm($index)
{
if (!isset($this->mapsForm[$index])) {
throw new OutOfBoundsException(sprintf('The index %s is not within the violation path', $index));
}
return $this->mapsForm[$index];
} | [
"public",
"function",
"mapsForm",
"(",
"$",
"index",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"mapsForm",
"[",
"$",
"index",
"]",
")",
")",
"{",
"throw",
"new",
"OutOfBoundsException",
"(",
"sprintf",
"(",
"'The index %s is not within the... | Returns whether an element maps directly to a form.
Consider the following violation path:
children[address].children[office].data.street
In this example, "address" and "office" map to forms, while
"street does not.
@param int $index The element index
@return bool Whether the element maps to a form
@throws OutOfB... | [
"Returns",
"whether",
"an",
"element",
"maps",
"directly",
"to",
"a",
"form",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationPath.php#L212-L219 | train | Returns the form for the mapping of the violation path | [
30522,
2270,
3853,
7341,
14192,
1006,
1002,
5950,
1007,
1063,
2065,
1006,
999,
26354,
3388,
1006,
1002,
2023,
1011,
1028,
7341,
14192,
1031,
1002,
5950,
1033,
1007,
1007,
1063,
5466,
2047,
2041,
11253,
15494,
3366,
2595,
24422,
1006,
9043,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php | PostgresGrammar.compilePrimary | public function compilePrimary(Blueprint $blueprint, Fluent $command)
{
$columns = $this->columnize($command->columns);
return 'alter table '.$this->wrapTable($blueprint)." add primary key ({$columns})";
} | php | public function compilePrimary(Blueprint $blueprint, Fluent $command)
{
$columns = $this->columnize($command->columns);
return 'alter table '.$this->wrapTable($blueprint)." add primary key ({$columns})";
} | [
"public",
"function",
"compilePrimary",
"(",
"Blueprint",
"$",
"blueprint",
",",
"Fluent",
"$",
"command",
")",
"{",
"$",
"columns",
"=",
"$",
"this",
"->",
"columnize",
"(",
"$",
"command",
"->",
"columns",
")",
";",
"return",
"'alter table '",
".",
"$",
... | Compile a primary key command.
@param \Illuminate\Database\Schema\Blueprint $blueprint
@param \Illuminate\Support\Fluent $command
@return string | [
"Compile",
"a",
"primary",
"key",
"command",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php#L96-L101 | train | Compiles a primary key statement into SQL. | [
30522,
2270,
3853,
4012,
22090,
18098,
9581,
2854,
1006,
2630,
16550,
1002,
2630,
16550,
1010,
19376,
1002,
3094,
1007,
1063,
1002,
7753,
1027,
1002,
2023,
1011,
1028,
5930,
4697,
1006,
1002,
3094,
1011,
1028,
7753,
1007,
1025,
2709,
1005,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/Dashboard/API.php | API.getDefaultDashboard | private function getDefaultDashboard()
{
$defaultLayout = $this->dashboard->getDefaultLayout();
$defaultLayout = $this->dashboard->decodeLayout($defaultLayout);
$defaultDashboard = array('name' => Piwik::translate('Dashboard_Dashboard'), 'layout' => $defaultLayout, 'iddashboard' => 1);
... | php | private function getDefaultDashboard()
{
$defaultLayout = $this->dashboard->getDefaultLayout();
$defaultLayout = $this->dashboard->decodeLayout($defaultLayout);
$defaultDashboard = array('name' => Piwik::translate('Dashboard_Dashboard'), 'layout' => $defaultLayout, 'iddashboard' => 1);
... | [
"private",
"function",
"getDefaultDashboard",
"(",
")",
"{",
"$",
"defaultLayout",
"=",
"$",
"this",
"->",
"dashboard",
"->",
"getDefaultLayout",
"(",
")",
";",
"$",
"defaultLayout",
"=",
"$",
"this",
"->",
"dashboard",
"->",
"decodeLayout",
"(",
"$",
"defau... | Get the default dashboard.
@return \array[] | [
"Get",
"the",
"default",
"dashboard",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Dashboard/API.php#L166-L175 | train | Get default dashboard | [
30522,
2797,
3853,
2131,
3207,
7011,
11314,
8883,
2232,
6277,
1006,
1007,
1063,
1002,
12398,
8485,
5833,
1027,
1002,
2023,
1011,
1028,
24923,
1011,
1028,
2131,
3207,
7011,
11314,
8485,
5833,
1006,
1007,
1025,
1002,
12398,
8485,
5833,
1027,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/HttpFoundation/HeaderUtils.php | HeaderUtils.makeDisposition | public static function makeDisposition(string $disposition, string $filename, string $filenameFallback = ''): string
{
if (!\in_array($disposition, [self::DISPOSITION_ATTACHMENT, self::DISPOSITION_INLINE])) {
throw new \InvalidArgumentException(sprintf('The disposition must be either "%s" or "%s... | php | public static function makeDisposition(string $disposition, string $filename, string $filenameFallback = ''): string
{
if (!\in_array($disposition, [self::DISPOSITION_ATTACHMENT, self::DISPOSITION_INLINE])) {
throw new \InvalidArgumentException(sprintf('The disposition must be either "%s" or "%s... | [
"public",
"static",
"function",
"makeDisposition",
"(",
"string",
"$",
"disposition",
",",
"string",
"$",
"filename",
",",
"string",
"$",
"filenameFallback",
"=",
"''",
")",
":",
"string",
"{",
"if",
"(",
"!",
"\\",
"in_array",
"(",
"$",
"disposition",
","... | Generates a HTTP Content-Disposition field-value.
@param string $disposition One of "inline" or "attachment"
@param string $filename A unicode string
@param string $filenameFallback A string containing only ASCII characters that
is semantically equivalent to $filename. If the filename is already ASCII,
it... | [
"Generates",
"a",
"HTTP",
"Content",
"-",
"Disposition",
"field",
"-",
"value",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpFoundation/HeaderUtils.php#L164-L195 | train | Returns the disposition string | [
30522,
2270,
10763,
3853,
2191,
10521,
26994,
1006,
5164,
1002,
22137,
1010,
5164,
1002,
5371,
18442,
1010,
5164,
1002,
5371,
18442,
13976,
5963,
1027,
1005,
1005,
1007,
1024,
5164,
1063,
2065,
1006,
999,
1032,
1999,
1035,
9140,
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... |
octobercms/october | modules/system/classes/PluginManager.php | PluginManager.isDisabled | public function isDisabled($id)
{
$code = $this->getIdentifier($id);
if (array_key_exists($code, $this->disabledPlugins)) {
return true;
}
return false;
} | php | public function isDisabled($id)
{
$code = $this->getIdentifier($id);
if (array_key_exists($code, $this->disabledPlugins)) {
return true;
}
return false;
} | [
"public",
"function",
"isDisabled",
"(",
"$",
"id",
")",
"{",
"$",
"code",
"=",
"$",
"this",
"->",
"getIdentifier",
"(",
"$",
"id",
")",
";",
"if",
"(",
"array_key_exists",
"(",
"$",
"code",
",",
"$",
"this",
"->",
"disabledPlugins",
")",
")",
"{",
... | Determines if a plugin is disabled by looking at the meta information
or the application configuration.
@return boolean | [
"Determines",
"if",
"a",
"plugin",
"is",
"disabled",
"by",
"looking",
"at",
"the",
"meta",
"information",
"or",
"the",
"application",
"configuration",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/PluginManager.php#L517-L526 | train | Check if a plugin is disabled | [
30522,
2270,
3853,
2003,
10521,
3085,
2094,
1006,
1002,
8909,
1007,
1063,
1002,
3642,
1027,
1002,
2023,
1011,
1028,
2131,
5178,
16778,
8873,
2121,
1006,
1002,
8909,
1007,
1025,
2065,
1006,
9140,
1035,
3145,
1035,
6526,
1006,
1002,
3642,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/MobileMessaging/API.php | API.validatePhoneNumber | public function validatePhoneNumber($phoneNumber, $verificationCode)
{
Piwik::checkUserIsNotAnonymous();
$phoneNumbers = $this->retrievePhoneNumbers();
if (isset($phoneNumbers[$phoneNumber])) {
if ($verificationCode == $phoneNumbers[$phoneNumber]) {
$phoneNumbe... | php | public function validatePhoneNumber($phoneNumber, $verificationCode)
{
Piwik::checkUserIsNotAnonymous();
$phoneNumbers = $this->retrievePhoneNumbers();
if (isset($phoneNumbers[$phoneNumber])) {
if ($verificationCode == $phoneNumbers[$phoneNumber]) {
$phoneNumbe... | [
"public",
"function",
"validatePhoneNumber",
"(",
"$",
"phoneNumber",
",",
"$",
"verificationCode",
")",
"{",
"Piwik",
"::",
"checkUserIsNotAnonymous",
"(",
")",
";",
"$",
"phoneNumbers",
"=",
"$",
"this",
"->",
"retrievePhoneNumbers",
"(",
")",
";",
"if",
"("... | validate phone number
@param string $phoneNumber
@param string $verificationCode
@return bool true if validation code is correct, false otherwise | [
"validate",
"phone",
"number"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/MobileMessaging/API.php#L276-L292 | train | Checks if the phone number is valid and if it is not invalid. | [
30522,
2270,
3853,
9398,
3686,
9864,
19172,
5677,
1006,
1002,
3042,
19172,
5677,
1010,
1002,
22616,
16044,
1007,
1063,
14255,
9148,
2243,
1024,
1024,
4638,
20330,
2483,
17048,
6761,
4890,
27711,
1006,
1007,
1025,
1002,
3042,
19172,
17198,
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/PropertyAccess/PropertyAccessor.php | PropertyAccessor.getPropertyPath | private function getPropertyPath($propertyPath): PropertyPath
{
if ($propertyPath instanceof PropertyPathInterface) {
// Don't call the copy constructor has it is not needed here
return $propertyPath;
}
if (isset($this->propertyPathCache[$propertyPath])) {
... | php | private function getPropertyPath($propertyPath): PropertyPath
{
if ($propertyPath instanceof PropertyPathInterface) {
// Don't call the copy constructor has it is not needed here
return $propertyPath;
}
if (isset($this->propertyPathCache[$propertyPath])) {
... | [
"private",
"function",
"getPropertyPath",
"(",
"$",
"propertyPath",
")",
":",
"PropertyPath",
"{",
"if",
"(",
"$",
"propertyPath",
"instanceof",
"PropertyPathInterface",
")",
"{",
"// Don't call the copy constructor has it is not needed here",
"return",
"$",
"propertyPath",... | Gets a PropertyPath instance and caches it.
@param string|PropertyPath $propertyPath | [
"Gets",
"a",
"PropertyPath",
"instance",
"and",
"caches",
"it",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/PropertyAccess/PropertyAccessor.php#L789-L814 | train | Get PropertyPath instance | [
30522,
2797,
3853,
2131,
21572,
4842,
3723,
15069,
1006,
1002,
3200,
15069,
1007,
1024,
3200,
15069,
1063,
2065,
1006,
1002,
3200,
15069,
6013,
11253,
3200,
15069,
18447,
2121,
12172,
1007,
1063,
1013,
1013,
2123,
1005,
1056,
2655,
1996,
61... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/UserSetting.php | UserSetting.isWritableByCurrentUser | public function isWritableByCurrentUser()
{
if (isset($this->hasWritePermission)) {
return $this->hasWritePermission;
}
// performance improvement, do not detect this in __construct otherwise likely rather "big" query to DB.
$this->hasWritePermission = Piwik::isUserHasSo... | php | public function isWritableByCurrentUser()
{
if (isset($this->hasWritePermission)) {
return $this->hasWritePermission;
}
// performance improvement, do not detect this in __construct otherwise likely rather "big" query to DB.
$this->hasWritePermission = Piwik::isUserHasSo... | [
"public",
"function",
"isWritableByCurrentUser",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"hasWritePermission",
")",
")",
"{",
"return",
"$",
"this",
"->",
"hasWritePermission",
";",
"}",
"// performance improvement, do not detect this in __construct... | Returns `true` if this setting can be displayed for the current user, `false` if otherwise.
@return bool | [
"Returns",
"true",
"if",
"this",
"setting",
"can",
"be",
"displayed",
"for",
"the",
"current",
"user",
"false",
"if",
"otherwise",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Settings/Plugin/UserSetting.php#L61-L71 | train | Returns true if the user has write access to the record | [
30522,
2270,
3853,
2003,
13088,
6590,
3468,
3762,
10841,
14343,
3372,
20330,
1006,
1007,
1063,
2065,
1006,
26354,
3388,
1006,
1002,
2023,
1011,
1028,
2038,
26373,
4842,
25481,
1007,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
2038,
26373,
484... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Media/Traits/MediaTrait.php | MediaTrait.getMedia | public function getMedia()
{
if ($this->media === null) {
$cache = $this->getMediaCache();
// Use cached media if possible.
$cacheKey = md5('media' . $this->getCacheKey());
if (!$media = $cache->get($cacheKey)) {
$media = new Media($this->getM... | php | public function getMedia()
{
if ($this->media === null) {
$cache = $this->getMediaCache();
// Use cached media if possible.
$cacheKey = md5('media' . $this->getCacheKey());
if (!$media = $cache->get($cacheKey)) {
$media = new Media($this->getM... | [
"public",
"function",
"getMedia",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"media",
"===",
"null",
")",
"{",
"$",
"cache",
"=",
"$",
"this",
"->",
"getMediaCache",
"(",
")",
";",
"// Use cached media if possible.",
"$",
"cacheKey",
"=",
"md5",
"(",
... | Gets the associated media collection.
@return MediaCollectionInterface Representation of associated media. | [
"Gets",
"the",
"associated",
"media",
"collection",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Media/Traits/MediaTrait.php#L68-L83 | train | Get media from cache | [
30522,
2270,
3853,
2131,
16969,
1006,
1007,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
2865,
1027,
1027,
1027,
19701,
1007,
1063,
1002,
17053,
1027,
1002,
2023,
1011,
1028,
2131,
16969,
3540,
5403,
1006,
1007,
1025,
1013,
1013,
2224,
17053,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.