repo stringclasses 21
values | path stringlengths 10 100 | func_name stringlengths 6 71 | original_string stringlengths 115 97k | language stringclasses 1
value | code stringlengths 115 97k | code_tokens listlengths 27 7.5k | docstring stringlengths 6 1.88k | docstring_tokens listlengths 1 177 | sha stringclasses 21
values | url stringlengths 100 189 | partition stringclasses 1
value | summary stringlengths 9 340 | input_ids listlengths 502 502 | token_type_ids listlengths 502 502 | attention_mask listlengths 502 502 | labels listlengths 502 502 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
symfony/symfony | src/Symfony/Component/Messenger/Transport/AmqpExt/Connection.php | Connection.createDelayQueue | private function createDelayQueue(int $delay, ?string $routingKey)
{
$queue = $this->amqpFactory->createQueue($this->channel());
$queue->setName(str_replace('%delay%', $delay, $this->connectionOptions['delay']['queue_name_pattern']));
$queue->setArguments([
'x-message-ttl' => $de... | php | private function createDelayQueue(int $delay, ?string $routingKey)
{
$queue = $this->amqpFactory->createQueue($this->channel());
$queue->setName(str_replace('%delay%', $delay, $this->connectionOptions['delay']['queue_name_pattern']));
$queue->setArguments([
'x-message-ttl' => $de... | [
"private",
"function",
"createDelayQueue",
"(",
"int",
"$",
"delay",
",",
"?",
"string",
"$",
"routingKey",
")",
"{",
"$",
"queue",
"=",
"$",
"this",
"->",
"amqpFactory",
"->",
"createQueue",
"(",
"$",
"this",
"->",
"channel",
"(",
")",
")",
";",
"$",
... | Creates a delay queue that will delay for a certain amount of time.
This works by setting message TTL for the delay and pointing
the dead letter exchange to the original exchange. The result
is that after the TTL, the message is sent to the dead-letter-exchange,
which is the original exchange, resulting on it being pu... | [
"Creates",
"a",
"delay",
"queue",
"that",
"will",
"delay",
"for",
"a",
"certain",
"amount",
"of",
"time",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Messenger/Transport/AmqpExt/Connection.php#L271-L287 | train | Create delay queue | [
30522,
2797,
3853,
2580,
10581,
2100,
4226,
5657,
1006,
20014,
1002,
8536,
1010,
1029,
5164,
1002,
16972,
14839,
1007,
1063,
1002,
24240,
1027,
1002,
2023,
1011,
1028,
2572,
4160,
14376,
18908,
10253,
1011,
1028,
3443,
4226,
5657,
1006,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
z-song/laravel-admin | src/Grid/Filter/Group.php | Group.like | public function like($label = '', $operator = 'like')
{
$label = $label ?: $operator;
$condition = [$this->column, $operator, "%{$this->value}%"];
return $this->joinGroup($label, $condition);
} | php | public function like($label = '', $operator = 'like')
{
$label = $label ?: $operator;
$condition = [$this->column, $operator, "%{$this->value}%"];
return $this->joinGroup($label, $condition);
} | [
"public",
"function",
"like",
"(",
"$",
"label",
"=",
"''",
",",
"$",
"operator",
"=",
"'like'",
")",
"{",
"$",
"label",
"=",
"$",
"label",
"?",
":",
"$",
"operator",
";",
"$",
"condition",
"=",
"[",
"$",
"this",
"->",
"column",
",",
"$",
"operat... | Specify a where like query.
@param string $label
@param string $operator
@return Group | [
"Specify",
"a",
"where",
"like",
"query",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Grid/Filter/Group.php#L195-L202 | train | Returns a query part that requires a LIKE operator. | [
30522,
2270,
3853,
2066,
1006,
1002,
3830,
1027,
1005,
1005,
1010,
1002,
6872,
1027,
1005,
2066,
1005,
1007,
1063,
1002,
3830,
1027,
1002,
3830,
1029,
1024,
1002,
6872,
1025,
1002,
4650,
1027,
1031,
1002,
2023,
1011,
1028,
5930,
1010,
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... |
php-ai/php-ml | src/Association/Apriori.php | Apriori.getRules | public function getRules(): array
{
if (count($this->large) === 0) {
$this->large = $this->apriori();
}
if (count($this->rules) > 0) {
return $this->rules;
}
$this->rules = [];
$this->generateAllRules();
return $this->rules;
} | php | public function getRules(): array
{
if (count($this->large) === 0) {
$this->large = $this->apriori();
}
if (count($this->rules) > 0) {
return $this->rules;
}
$this->rules = [];
$this->generateAllRules();
return $this->rules;
} | [
"public",
"function",
"getRules",
"(",
")",
":",
"array",
"{",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"large",
")",
"===",
"0",
")",
"{",
"$",
"this",
"->",
"large",
"=",
"$",
"this",
"->",
"apriori",
"(",
")",
";",
"}",
"if",
"(",
"count"... | Get all association rules which are generated for every k-length frequent item set.
@return mixed[][] | [
"Get",
"all",
"association",
"rules",
"which",
"are",
"generated",
"for",
"every",
"k",
"-",
"length",
"frequent",
"item",
"set",
"."
] | f6aa1a59b0525b8fca3d2786d661ab3e70904016 | https://github.com/php-ai/php-ml/blob/f6aa1a59b0525b8fca3d2786d661ab3e70904016/src/Association/Apriori.php#L65-L80 | train | Get rules from all languages | [
30522,
2270,
3853,
2131,
6820,
4244,
1006,
1007,
1024,
9140,
1063,
2065,
1006,
4175,
1006,
1002,
2023,
1011,
1028,
2312,
1007,
1027,
1027,
1027,
1014,
1007,
1063,
1002,
2023,
1011,
1028,
2312,
1027,
1002,
2023,
1011,
1028,
19804,
25346,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/Zend/Db/Table/Abstract.php | Zend_Db_Table_Abstract.update | public function update(array $data, $where)
{
$tableSpec = ($this->_schema ? $this->_schema . '.' : '') . $this->_name;
return $this->_db->update($tableSpec, $data, $where);
} | php | public function update(array $data, $where)
{
$tableSpec = ($this->_schema ? $this->_schema . '.' : '') . $this->_name;
return $this->_db->update($tableSpec, $data, $where);
} | [
"public",
"function",
"update",
"(",
"array",
"$",
"data",
",",
"$",
"where",
")",
"{",
"$",
"tableSpec",
"=",
"(",
"$",
"this",
"->",
"_schema",
"?",
"$",
"this",
"->",
"_schema",
".",
"'.'",
":",
"''",
")",
".",
"$",
"this",
"->",
"_name",
";",... | Updates existing rows.
@param array $data Column-value pairs.
@param array|string $where An SQL WHERE clause, or an array of SQL WHERE clauses.
@return int The number of rows updated. | [
"Updates",
"existing",
"rows",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Table/Abstract.php#L1129-L1133 | train | Update the record in the database | [
30522,
2270,
3853,
10651,
1006,
9140,
1002,
2951,
1010,
1002,
2073,
1007,
1063,
1002,
7251,
5051,
2278,
1027,
1006,
1002,
2023,
1011,
1028,
1035,
8040,
28433,
1029,
1002,
2023,
1011,
1028,
1035,
8040,
28433,
1012,
1005,
1012,
1005,
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/Database/Eloquent/Concerns/HasRelationships.php | HasRelationships.newMorphTo | protected function newMorphTo(Builder $query, Model $parent, $foreignKey, $ownerKey, $type, $relation)
{
return new MorphTo($query, $parent, $foreignKey, $ownerKey, $type, $relation);
} | php | protected function newMorphTo(Builder $query, Model $parent, $foreignKey, $ownerKey, $type, $relation)
{
return new MorphTo($query, $parent, $foreignKey, $ownerKey, $type, $relation);
} | [
"protected",
"function",
"newMorphTo",
"(",
"Builder",
"$",
"query",
",",
"Model",
"$",
"parent",
",",
"$",
"foreignKey",
",",
"$",
"ownerKey",
",",
"$",
"type",
",",
"$",
"relation",
")",
"{",
"return",
"new",
"MorphTo",
"(",
"$",
"query",
",",
"$",
... | Instantiate a new MorphTo relationship.
@param \Illuminate\Database\Eloquent\Builder $query
@param \Illuminate\Database\Eloquent\Model $parent
@param string $foreignKey
@param string $ownerKey
@param string $type
@param string $relation
@return \Illuminate\Database\Eloquent\Relations\MorphTo | [
"Instantiate",
"a",
"new",
"MorphTo",
"relationship",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php#L289-L292 | train | Create a new MorphTo | [
30522,
5123,
3853,
2047,
5302,
14536,
11039,
2080,
1006,
12508,
1002,
23032,
1010,
2944,
1002,
6687,
1010,
1002,
3097,
14839,
1010,
1002,
3954,
14839,
1010,
1002,
2828,
1010,
1002,
7189,
1007,
1063,
2709,
2047,
22822,
8458,
3406,
1006,
1002... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Foundation/Console/ClearCompiledCommand.php | ClearCompiledCommand.handle | public function handle()
{
if (file_exists($servicesPath = $this->laravel->getCachedServicesPath())) {
@unlink($servicesPath);
}
if (file_exists($packagesPath = $this->laravel->getCachedPackagesPath())) {
@unlink($packagesPath);
}
$this->info('Compil... | php | public function handle()
{
if (file_exists($servicesPath = $this->laravel->getCachedServicesPath())) {
@unlink($servicesPath);
}
if (file_exists($packagesPath = $this->laravel->getCachedPackagesPath())) {
@unlink($packagesPath);
}
$this->info('Compil... | [
"public",
"function",
"handle",
"(",
")",
"{",
"if",
"(",
"file_exists",
"(",
"$",
"servicesPath",
"=",
"$",
"this",
"->",
"laravel",
"->",
"getCachedServicesPath",
"(",
")",
")",
")",
"{",
"@",
"unlink",
"(",
"$",
"servicesPath",
")",
";",
"}",
"if",
... | Execute the console command.
@return void | [
"Execute",
"the",
"console",
"command",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Foundation/Console/ClearCompiledCommand.php#L28-L39 | train | Remove compiled services and packages files | [
30522,
2270,
3853,
5047,
1006,
1007,
1063,
2065,
1006,
5371,
1035,
6526,
1006,
1002,
2578,
15069,
1027,
1002,
2023,
1011,
1028,
13679,
15985,
1011,
1028,
2131,
3540,
7690,
8043,
7903,
2229,
15069,
1006,
1007,
1007,
1007,
1063,
1030,
4895,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Console/TableCommand.php | TableCommand.replaceMigration | protected function replaceMigration($path, $table, $tableClassName)
{
$stub = str_replace(
['{{table}}', '{{tableClassName}}'],
[$table, $tableClassName],
$this->files->get(__DIR__.'/stubs/jobs.stub')
);
$this->files->put($path, $stub);
} | php | protected function replaceMigration($path, $table, $tableClassName)
{
$stub = str_replace(
['{{table}}', '{{tableClassName}}'],
[$table, $tableClassName],
$this->files->get(__DIR__.'/stubs/jobs.stub')
);
$this->files->put($path, $stub);
} | [
"protected",
"function",
"replaceMigration",
"(",
"$",
"path",
",",
"$",
"table",
",",
"$",
"tableClassName",
")",
"{",
"$",
"stub",
"=",
"str_replace",
"(",
"[",
"'{{table}}'",
",",
"'{{tableClassName}}'",
"]",
",",
"[",
"$",
"table",
",",
"$",
"tableClas... | Replace the generated migration with the job table stub.
@param string $path
@param string $table
@param string $tableClassName
@return void | [
"Replace",
"the",
"generated",
"migration",
"with",
"the",
"job",
"table",
"stub",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Queue/Console/TableCommand.php#L92-L101 | train | Replace the migration stub with the actual table and class name | [
30522,
5123,
3853,
5672,
4328,
29397,
1006,
1002,
4130,
1010,
1002,
2795,
1010,
1002,
2795,
26266,
18442,
1007,
1063,
1002,
24646,
2497,
1027,
2358,
2099,
1035,
5672,
1006,
1031,
1005,
1063,
1063,
2795,
1065,
1065,
1005,
1010,
1005,
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/DataTable/Manager.php | Manager.deleteAll | public function deleteAll($deleteWhenIdTableGreaterThan = 0)
{
foreach ($this as $id => $table) {
if ($id > $deleteWhenIdTableGreaterThan) {
$this->deleteTable($id);
}
}
if ($deleteWhenIdTableGreaterThan == 0) {
$this->exchangeArray(array(... | php | public function deleteAll($deleteWhenIdTableGreaterThan = 0)
{
foreach ($this as $id => $table) {
if ($id > $deleteWhenIdTableGreaterThan) {
$this->deleteTable($id);
}
}
if ($deleteWhenIdTableGreaterThan == 0) {
$this->exchangeArray(array(... | [
"public",
"function",
"deleteAll",
"(",
"$",
"deleteWhenIdTableGreaterThan",
"=",
"0",
")",
"{",
"foreach",
"(",
"$",
"this",
"as",
"$",
"id",
"=>",
"$",
"table",
")",
"{",
"if",
"(",
"$",
"id",
">",
"$",
"deleteWhenIdTableGreaterThan",
")",
"{",
"$",
... | Delete all the registered DataTables from the manager | [
"Delete",
"all",
"the",
"registered",
"DataTables",
"from",
"the",
"manager"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable/Manager.php#L84-L96 | train | Delete all tables from the database | [
30522,
2270,
3853,
3972,
12870,
8095,
1006,
1002,
3972,
12870,
2860,
10222,
3593,
10880,
17603,
24932,
21604,
1027,
1014,
1007,
1063,
18921,
6776,
1006,
1002,
2023,
2004,
1002,
8909,
1027,
1028,
1002,
2795,
1007,
1063,
2065,
1006,
1002,
890... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Session/SaveHandler/DbTable.php | DbTable.destroy | public function destroy($id)
{
$sql = 'DELETE FROM ' . $this->config['name'] . ' WHERE ' . $this->config['primary'] . ' = ?';
$this->query($sql, array($id));
return true;
} | php | public function destroy($id)
{
$sql = 'DELETE FROM ' . $this->config['name'] . ' WHERE ' . $this->config['primary'] . ' = ?';
$this->query($sql, array($id));
return true;
} | [
"public",
"function",
"destroy",
"(",
"$",
"id",
")",
"{",
"$",
"sql",
"=",
"'DELETE FROM '",
".",
"$",
"this",
"->",
"config",
"[",
"'name'",
"]",
".",
"' WHERE '",
".",
"$",
"this",
"->",
"config",
"[",
"'primary'",
"]",
".",
"' = ?'",
";",
"$",
... | Destroy Session - remove data from resource for
given session id
@param string $id
@return boolean | [
"Destroy",
"Session",
"-",
"remove",
"data",
"from",
"resource",
"for",
"given",
"session",
"id"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Session/SaveHandler/DbTable.php#L157-L164 | train | Destroy a record | [
30522,
2270,
3853,
6033,
1006,
1002,
8909,
1007,
1063,
1002,
29296,
1027,
1005,
3972,
12870,
2013,
1005,
1012,
1002,
2023,
1011,
1028,
9530,
8873,
2290,
1031,
1005,
2171,
1005,
1033,
1012,
1005,
2073,
1005,
1012,
1002,
2023,
1011,
1028,
9... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/Installation/FormDatabaseSetup.php | FormDatabaseSetup.createDatabaseObject | public function createDatabaseObject()
{
$dbname = trim($this->getSubmitValue('dbname'));
if (empty($dbname)) // disallow database object creation w/ no selected database
{
throw new Exception("No database name");
}
$adapter = $this->getSubmitValue('adapter');
... | php | public function createDatabaseObject()
{
$dbname = trim($this->getSubmitValue('dbname'));
if (empty($dbname)) // disallow database object creation w/ no selected database
{
throw new Exception("No database name");
}
$adapter = $this->getSubmitValue('adapter');
... | [
"public",
"function",
"createDatabaseObject",
"(",
")",
"{",
"$",
"dbname",
"=",
"trim",
"(",
"$",
"this",
"->",
"getSubmitValue",
"(",
"'dbname'",
")",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"dbname",
")",
")",
"// disallow database object creation w/ no sel... | Creates database object based on form data.
@throws Exception|Zend_Db_Adapter_Exception
@return array The database connection info. Can be passed into Piwik::createDatabaseObject. | [
"Creates",
"database",
"object",
"based",
"on",
"form",
"data",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Installation/FormDatabaseSetup.php#L111-L167 | train | Create database object | [
30522,
2270,
3853,
2580,
6790,
15058,
16429,
20614,
1006,
1007,
1063,
1002,
16962,
18442,
1027,
12241,
1006,
1002,
2023,
1011,
1028,
4152,
12083,
22930,
10175,
5657,
1006,
1005,
16962,
18442,
1005,
1007,
1007,
1025,
2065,
1006,
4064,
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/Component/Console/Input/InputArgument.php | InputArgument.setDefault | public function setDefault($default = null)
{
if (self::REQUIRED === $this->mode && null !== $default) {
throw new LogicException('Cannot set a default value except for InputArgument::OPTIONAL mode.');
}
if ($this->isArray()) {
if (null === $default) {
... | php | public function setDefault($default = null)
{
if (self::REQUIRED === $this->mode && null !== $default) {
throw new LogicException('Cannot set a default value except for InputArgument::OPTIONAL mode.');
}
if ($this->isArray()) {
if (null === $default) {
... | [
"public",
"function",
"setDefault",
"(",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"self",
"::",
"REQUIRED",
"===",
"$",
"this",
"->",
"mode",
"&&",
"null",
"!==",
"$",
"default",
")",
"{",
"throw",
"new",
"LogicException",
"(",
"'Cannot set a de... | Sets the default value.
@param string|string[]|null $default The default value
@throws LogicException When incorrect default value is given | [
"Sets",
"the",
"default",
"value",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Input/InputArgument.php#L93-L108 | train | Set default value | [
30522,
2270,
3853,
2275,
3207,
7011,
11314,
1006,
1002,
12398,
1027,
19701,
1007,
1063,
2065,
1006,
2969,
1024,
1024,
3223,
1027,
1027,
1027,
1002,
2023,
1011,
1028,
5549,
1004,
1004,
19701,
999,
1027,
1027,
1002,
12398,
1007,
1063,
5466,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/SettingsPiwik.php | SettingsPiwik.isUniqueVisitorsEnabled | public static function isUniqueVisitorsEnabled($periodLabel)
{
$generalSettings = Config::getInstance()->General;
$settingName = "enable_processing_unique_visitors_$periodLabel";
$result = !empty($generalSettings[$settingName]) && $generalSettings[$settingName] == 1;
// check enabl... | php | public static function isUniqueVisitorsEnabled($periodLabel)
{
$generalSettings = Config::getInstance()->General;
$settingName = "enable_processing_unique_visitors_$periodLabel";
$result = !empty($generalSettings[$settingName]) && $generalSettings[$settingName] == 1;
// check enabl... | [
"public",
"static",
"function",
"isUniqueVisitorsEnabled",
"(",
"$",
"periodLabel",
")",
"{",
"$",
"generalSettings",
"=",
"Config",
"::",
"getInstance",
"(",
")",
"->",
"General",
";",
"$",
"settingName",
"=",
"\"enable_processing_unique_visitors_$periodLabel\"",
";"... | Returns true if unique visitors should be processed for the given period type.
Unique visitor processing is controlled by the `[General] enable_processing_unique_visitors_...`
INI config options. By default, unique visitors are processed only for day/week/month periods.
@param string $periodLabel `"day"`, `"week"`, `... | [
"Returns",
"true",
"if",
"unique",
"visitors",
"should",
"be",
"processed",
"for",
"the",
"given",
"period",
"type",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/SettingsPiwik.php#L332-L347 | train | Return TRUE if unique visitors are enabled for the specified period | [
30522,
2270,
10763,
3853,
2003,
19496,
4226,
11365,
27287,
8189,
23242,
1006,
1002,
2558,
20470,
2884,
1007,
1063,
1002,
11593,
18319,
3070,
2015,
1027,
9530,
8873,
2290,
1024,
1024,
2131,
7076,
26897,
1006,
1007,
1011,
1028,
2236,
1025,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/Tracker/Action.php | Action.record | public function record(Visitor $visitor, $idReferrerActionUrl, $idReferrerActionName)
{
$this->loadIdsFromLogActionTable();
$visitAction = array(
'idvisit' => $visitor->getVisitorColumn('idvisit'),
'idsite' => $this->request->getIdSite(),
'id... | php | public function record(Visitor $visitor, $idReferrerActionUrl, $idReferrerActionName)
{
$this->loadIdsFromLogActionTable();
$visitAction = array(
'idvisit' => $visitor->getVisitorColumn('idvisit'),
'idsite' => $this->request->getIdSite(),
'id... | [
"public",
"function",
"record",
"(",
"Visitor",
"$",
"visitor",
",",
"$",
"idReferrerActionUrl",
",",
"$",
"idReferrerActionName",
")",
"{",
"$",
"this",
"->",
"loadIdsFromLogActionTable",
"(",
")",
";",
"$",
"visitAction",
"=",
"array",
"(",
"'idvisit'",
"=>"... | Records in the DB the association between the visit and this action.
@param int $idReferrerActionUrl is the ID of the last action done by the current visit.
@param $idReferrerActionName
@param Visitor $visitor | [
"Records",
"in",
"the",
"DB",
"the",
"association",
"between",
"the",
"visit",
"and",
"this",
"action",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Tracker/Action.php#L358-L410 | train | Records the action data for the visitor | [
30522,
2270,
3853,
2501,
1006,
10367,
1002,
10367,
1010,
1002,
8909,
2890,
7512,
24068,
7542,
3126,
2140,
1010,
1002,
8909,
2890,
7512,
24068,
7542,
18442,
1007,
1063,
1002,
2023,
1011,
1028,
7170,
9821,
19699,
5358,
21197,
18908,
3258,
108... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/DateFactory.php | DateFactory.use | public static function use($handler)
{
if (is_callable($handler) && is_object($handler)) {
return static::useCallable($handler);
} elseif (is_string($handler)) {
return static::useClass($handler);
} elseif ($handler instanceof Factory) {
return static::use... | php | public static function use($handler)
{
if (is_callable($handler) && is_object($handler)) {
return static::useCallable($handler);
} elseif (is_string($handler)) {
return static::useClass($handler);
} elseif ($handler instanceof Factory) {
return static::use... | [
"public",
"static",
"function",
"use",
"(",
"$",
"handler",
")",
"{",
"if",
"(",
"is_callable",
"(",
"$",
"handler",
")",
"&&",
"is_object",
"(",
"$",
"handler",
")",
")",
"{",
"return",
"static",
"::",
"useCallable",
"(",
"$",
"handler",
")",
";",
"... | Use the given handler when generating dates (class name, callable, or factory).
@param mixed $handler
@throws \InvalidArgumentException | [
"Use",
"the",
"given",
"handler",
"when",
"generating",
"dates",
"(",
"class",
"name",
"callable",
"or",
"factory",
")",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Support/DateFactory.php#L121-L132 | train | Use the date creation handler | [
30522,
2270,
10763,
3853,
2224,
1006,
1002,
28213,
1007,
1063,
2065,
1006,
2003,
1035,
2655,
3085,
1006,
1002,
28213,
1007,
1004,
1004,
2003,
1035,
4874,
1006,
1002,
28213,
1007,
1007,
1063,
2709,
10763,
1024,
1024,
30524,
1007,
1063,
2709,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/CacheWarmer/TemplatePathsCacheWarmer.php | TemplatePathsCacheWarmer.warmUp | public function warmUp($cacheDir)
{
$filesystem = new Filesystem();
$templates = [];
foreach ($this->finder->findAllTemplates() as $template) {
$templates[$template->getLogicalName()] = rtrim($filesystem->makePathRelative($this->locator->locate($template), $cacheDir), '/');
... | php | public function warmUp($cacheDir)
{
$filesystem = new Filesystem();
$templates = [];
foreach ($this->finder->findAllTemplates() as $template) {
$templates[$template->getLogicalName()] = rtrim($filesystem->makePathRelative($this->locator->locate($template), $cacheDir), '/');
... | [
"public",
"function",
"warmUp",
"(",
"$",
"cacheDir",
")",
"{",
"$",
"filesystem",
"=",
"new",
"Filesystem",
"(",
")",
";",
"$",
"templates",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"finder",
"->",
"findAllTemplates",
"(",
")",
"as",
"... | Warms up the cache.
@param string $cacheDir The cache directory | [
"Warms",
"up",
"the",
"cache",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/TemplatePathsCacheWarmer.php#L43-L55 | train | Warms up the templates. php file | [
30522,
2270,
3853,
4010,
6279,
1006,
30524,
1027,
2047,
6764,
27268,
6633,
1006,
1007,
1025,
1002,
23561,
2015,
1027,
1031,
1033,
1025,
18921,
6776,
1006,
1002,
2023,
1011,
1028,
2424,
2121,
1011,
1028,
2424,
8095,
18532,
15725,
2015,
1006,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
z-song/laravel-admin | src/Form/Field/Select.php | Select.loadRemoteOptions | protected function loadRemoteOptions($url, $parameters = [], $options = [])
{
$ajaxOptions = [
'url' => $url.'?'.http_build_query($parameters),
];
$configs = array_merge([
'allowClear' => true,
'placeholder' => [
'id' ... | php | protected function loadRemoteOptions($url, $parameters = [], $options = [])
{
$ajaxOptions = [
'url' => $url.'?'.http_build_query($parameters),
];
$configs = array_merge([
'allowClear' => true,
'placeholder' => [
'id' ... | [
"protected",
"function",
"loadRemoteOptions",
"(",
"$",
"url",
",",
"$",
"parameters",
"=",
"[",
"]",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"ajaxOptions",
"=",
"[",
"'url'",
"=>",
"$",
"url",
".",
"'?'",
".",
"http_build_query",
"(",
"$"... | Load options from remote.
@param string $url
@param array $parameters
@param array $options
@return $this | [
"Load",
"options",
"from",
"remote",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Form/Field/Select.php#L242-L282 | train | Load remote options | [
30522,
5123,
3853,
7170,
28578,
12184,
7361,
9285,
1006,
1002,
24471,
2140,
1010,
1002,
11709,
1027,
1031,
1033,
1010,
1002,
7047,
1027,
1031,
1033,
1007,
1063,
1002,
18176,
7361,
9285,
1027,
1031,
1005,
24471,
2140,
1005,
1027,
1028,
1002,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/Zend/Db/Adapter/Mysqli.php | Zend_Db_Adapter_Mysqli._quote | protected function _quote($value)
{
if (is_int($value) || is_float($value)) {
return $value;
}
$this->_connect();
return "'" . $this->_connection->real_escape_string($value) . "'";
} | php | protected function _quote($value)
{
if (is_int($value) || is_float($value)) {
return $value;
}
$this->_connect();
return "'" . $this->_connection->real_escape_string($value) . "'";
} | [
"protected",
"function",
"_quote",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"is_int",
"(",
"$",
"value",
")",
"||",
"is_float",
"(",
"$",
"value",
")",
")",
"{",
"return",
"$",
"value",
";",
"}",
"$",
"this",
"->",
"_connect",
"(",
")",
";",
"retu... | Quote a raw string.
@param mixed $value Raw string
@return string Quoted string | [
"Quote",
"a",
"raw",
"string",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Adapter/Mysqli.php#L104-L111 | train | Quote value for use in SQL | [
30522,
5123,
3853,
1035,
14686,
1006,
1002,
3643,
1007,
1063,
2065,
1006,
2003,
1035,
20014,
1006,
1002,
3643,
1007,
1064,
1064,
2003,
1035,
14257,
1006,
1002,
3643,
1007,
1007,
1063,
2709,
1002,
3643,
1025,
1065,
1002,
2023,
1011,
1028,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
walkor/Workerman | Worker.php | Worker.resumeAccept | public function resumeAccept()
{
// Register a listener to be notified when server socket is ready to read.
if (static::$globalEvent && true === $this->_pauseAccept && $this->_mainSocket) {
if ($this->transport !== 'udp') {
static::$globalEvent->add($this->_mainSocket, Ev... | php | public function resumeAccept()
{
// Register a listener to be notified when server socket is ready to read.
if (static::$globalEvent && true === $this->_pauseAccept && $this->_mainSocket) {
if ($this->transport !== 'udp') {
static::$globalEvent->add($this->_mainSocket, Ev... | [
"public",
"function",
"resumeAccept",
"(",
")",
"{",
"// Register a listener to be notified when server socket is ready to read.",
"if",
"(",
"static",
"::",
"$",
"globalEvent",
"&&",
"true",
"===",
"$",
"this",
"->",
"_pauseAccept",
"&&",
"$",
"this",
"->",
"_mainSoc... | Resume accept new connections.
@return void | [
"Resume",
"accept",
"new",
"connections",
"."
] | 13649907f05014fcfffcfccaef01e63ad3339351 | https://github.com/walkor/Workerman/blob/13649907f05014fcfffcfccaef01e63ad3339351/Worker.php#L2280-L2291 | train | Resumes the accept process | [
30522,
2270,
3853,
13746,
6305,
3401,
13876,
30524,
2023,
1011,
1028,
1035,
8724,
6305,
3401,
13876,
1004,
1004,
1002,
2023,
1011,
1028,
1035,
2364,
6499,
19869,
2102,
1007,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
3665,
999,
1027,
1027,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/DependencyInjection/Compiler/ValidateEnvPlaceholdersPass.php | ValidateEnvPlaceholdersPass.process | public function process(ContainerBuilder $container)
{
$this->extensionConfig = [];
if (!class_exists(BaseNode::class) || !$extensions = $container->getExtensions()) {
return;
}
$resolvingBag = $container->getParameterBag();
if (!$resolvingBag instanceof EnvPlac... | php | public function process(ContainerBuilder $container)
{
$this->extensionConfig = [];
if (!class_exists(BaseNode::class) || !$extensions = $container->getExtensions()) {
return;
}
$resolvingBag = $container->getParameterBag();
if (!$resolvingBag instanceof EnvPlac... | [
"public",
"function",
"process",
"(",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"this",
"->",
"extensionConfig",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"class_exists",
"(",
"BaseNode",
"::",
"class",
")",
"||",
"!",
"$",
"extensions",
"=",
"$",
... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/DependencyInjection/Compiler/ValidateEnvPlaceholdersPass.php#L36-L93 | train | Process the container builder | [
30522,
2270,
3853,
2832,
1006,
11661,
8569,
23891,
2099,
1002,
11661,
1007,
1063,
1002,
2023,
1011,
1028,
5331,
8663,
8873,
2290,
1027,
1031,
1033,
1025,
2065,
1006,
999,
2465,
1035,
6526,
1006,
2918,
3630,
3207,
1024,
1024,
2465,
1007,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Database/Eloquent/Concerns/HasEvents.php | HasEvents.registerObserver | protected function registerObserver($class)
{
$className = $this->resolveObserverClassName($class);
// When registering a model observer, we will spin through the possible events
// and determine if this observer has that method. If it does, we will hook
// it into the model's event... | php | protected function registerObserver($class)
{
$className = $this->resolveObserverClassName($class);
// When registering a model observer, we will spin through the possible events
// and determine if this observer has that method. If it does, we will hook
// it into the model's event... | [
"protected",
"function",
"registerObserver",
"(",
"$",
"class",
")",
"{",
"$",
"className",
"=",
"$",
"this",
"->",
"resolveObserverClassName",
"(",
"$",
"class",
")",
";",
"// When registering a model observer, we will spin through the possible events",
"// and determine i... | Register a single observer with the model.
@param object|string $class
@return void
@throws \RuntimeException | [
"Register",
"a",
"single",
"observer",
"with",
"the",
"model",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Concerns/HasEvents.php#L54-L66 | train | Registers an observer for the given class | [
30522,
5123,
3853,
4236,
16429,
8043,
6299,
1006,
1002,
2465,
1007,
1063,
1002,
2465,
18442,
1027,
1002,
2023,
1011,
1028,
10663,
16429,
8043,
6299,
26266,
18442,
1006,
1002,
2465,
1007,
1025,
1013,
1013,
2043,
25719,
1037,
2944,
9718,
1010... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Database/Query/Grammars/SqlServerGrammar.php | SqlServerGrammar.whereDate | protected function whereDate(Builder $query, $where)
{
$value = $this->parameter($where['value']);
return 'cast('.$this->wrap($where['column']).' as date) '.$where['operator'].' '.$value;
} | php | protected function whereDate(Builder $query, $where)
{
$value = $this->parameter($where['value']);
return 'cast('.$this->wrap($where['column']).' as date) '.$where['operator'].' '.$value;
} | [
"protected",
"function",
"whereDate",
"(",
"Builder",
"$",
"query",
",",
"$",
"where",
")",
"{",
"$",
"value",
"=",
"$",
"this",
"->",
"parameter",
"(",
"$",
"where",
"[",
"'value'",
"]",
")",
";",
"return",
"'cast('",
".",
"$",
"this",
"->",
"wrap",... | Compile a "where date" clause.
@param \Illuminate\Database\Query\Builder $query
@param array $where
@return string | [
"Compile",
"a",
"where",
"date",
"clause",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Query/Grammars/SqlServerGrammar.php#L99-L104 | train | Protected where date | [
30522,
5123,
3853,
2073,
13701,
1006,
12508,
1002,
23032,
1010,
1002,
2073,
1007,
1063,
1002,
3643,
1027,
1002,
2023,
1011,
1028,
16381,
1006,
1002,
2073,
1031,
1005,
3643,
1005,
1033,
1007,
1025,
2709,
1005,
3459,
1006,
1005,
1012,
1002,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/CronArchive/SharedSiteIds.php | SharedSiteIds.getNextSiteId | public function getNextSiteId()
{
if ($this->done) {
// we make sure we don't check again whether there are more sites to be archived as the list of
// sharedSiteIds may have been reset by now.
return null;
}
$self = $this;
$this->currentSiteId =... | php | public function getNextSiteId()
{
if ($this->done) {
// we make sure we don't check again whether there are more sites to be archived as the list of
// sharedSiteIds may have been reset by now.
return null;
}
$self = $this;
$this->currentSiteId =... | [
"public",
"function",
"getNextSiteId",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"done",
")",
"{",
"// we make sure we don't check again whether there are more sites to be archived as the list of",
"// sharedSiteIds may have been reset by now.",
"return",
"null",
";",
"}",
... | Get the next site id that needs to be processed or null if all site ids where processed.
@return int|null | [
"Get",
"the",
"next",
"site",
"id",
"that",
"needs",
"to",
"be",
"processed",
"or",
"null",
"if",
"all",
"site",
"ids",
"where",
"processed",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/CronArchive/SharedSiteIds.php#L157-L196 | train | Returns the next site id to be archived | [
30522,
2270,
3853,
2131,
2638,
18413,
28032,
7416,
2094,
1006,
1007,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
2589,
1007,
1063,
1013,
1013,
2057,
2191,
2469,
2057,
2123,
1005,
1056,
4638,
2153,
3251,
2045,
2024,
2062,
4573,
2000,
2022,
9... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/DevicePlugins/Archiver.php | Archiver.aggregateMultipleReports | public function aggregateMultipleReports()
{
$dataTableRecords = array(
self::PLUGIN_RECORD_NAME,
);
$columnsAggregationOperation = null;
$this->getProcessor()->aggregateDataTableRecords(
$dataTableRecords,
$this->maximumRows,
$maximumR... | php | public function aggregateMultipleReports()
{
$dataTableRecords = array(
self::PLUGIN_RECORD_NAME,
);
$columnsAggregationOperation = null;
$this->getProcessor()->aggregateDataTableRecords(
$dataTableRecords,
$this->maximumRows,
$maximumR... | [
"public",
"function",
"aggregateMultipleReports",
"(",
")",
"{",
"$",
"dataTableRecords",
"=",
"array",
"(",
"self",
"::",
"PLUGIN_RECORD_NAME",
",",
")",
";",
"$",
"columnsAggregationOperation",
"=",
"null",
";",
"$",
"this",
"->",
"getProcessor",
"(",
")",
"... | Period archiving: simply sums up daily archives | [
"Period",
"archiving",
":",
"simply",
"sums",
"up",
"daily",
"archives"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/DevicePlugins/Archiver.php#L39-L54 | train | Aggregate multiple reports | [
30522,
2270,
3853,
9572,
12274,
7096,
11514,
3917,
13699,
11589,
2015,
1006,
1007,
1063,
1002,
2951,
10880,
2890,
27108,
5104,
1027,
30524,
9572,
2850,
29336,
3085,
2890,
27108,
5104,
1006,
1002,
2951,
10880,
2890,
27108,
5104,
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... |
walkor/Workerman | Connection/AsyncUdpConnection.php | AsyncUdpConnection.close | public function close($data = null, $raw = false)
{
if ($data !== null) {
$this->send($data, $raw);
}
Worker::$globalEvent->del($this->_socket, EventInterface::EV_READ);
fclose($this->_socket);
$this->connected = false;
// Try to emit onClose callback.
... | php | public function close($data = null, $raw = false)
{
if ($data !== null) {
$this->send($data, $raw);
}
Worker::$globalEvent->del($this->_socket, EventInterface::EV_READ);
fclose($this->_socket);
$this->connected = false;
// Try to emit onClose callback.
... | [
"public",
"function",
"close",
"(",
"$",
"data",
"=",
"null",
",",
"$",
"raw",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"data",
"!==",
"null",
")",
"{",
"$",
"this",
"->",
"send",
"(",
"$",
"data",
",",
"$",
"raw",
")",
";",
"}",
"Worker",
"::... | Close connection.
@param mixed $data
@param bool $raw
@return bool | [
"Close",
"connection",
"."
] | 13649907f05014fcfffcfccaef01e63ad3339351 | https://github.com/walkor/Workerman/blob/13649907f05014fcfffcfccaef01e63ad3339351/Connection/AsyncUdpConnection.php#L142-L164 | train | Close the connection | [
30522,
2270,
3853,
2485,
1006,
1002,
2951,
1027,
19701,
1010,
1002,
6315,
1027,
6270,
1007,
1063,
2065,
1006,
1002,
2951,
999,
1027,
1027,
19701,
1007,
1063,
1002,
2023,
1011,
1028,
4604,
1006,
1002,
2951,
1010,
1002,
6315,
1007,
1025,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/Zend/Session/Abstract.php | Zend_Session_Abstract._namespaceGetAll | protected static function _namespaceGetAll($namespace)
{
$currentData = (isset($_SESSION[$namespace]) && is_array($_SESSION[$namespace])) ?
$_SESSION[$namespace] : array();
$expiringData = (isset(self::$_expiringData[$namespace]) && is_array(self::$_expiringData[$namespace])) ?
... | php | protected static function _namespaceGetAll($namespace)
{
$currentData = (isset($_SESSION[$namespace]) && is_array($_SESSION[$namespace])) ?
$_SESSION[$namespace] : array();
$expiringData = (isset(self::$_expiringData[$namespace]) && is_array(self::$_expiringData[$namespace])) ?
... | [
"protected",
"static",
"function",
"_namespaceGetAll",
"(",
"$",
"namespace",
")",
"{",
"$",
"currentData",
"=",
"(",
"isset",
"(",
"$",
"_SESSION",
"[",
"$",
"namespace",
"]",
")",
"&&",
"is_array",
"(",
"$",
"_SESSION",
"[",
"$",
"namespace",
"]",
")",... | namespaceGetAll() - Get an array containing $namespace, including expiring data.
@param string $namespace
@param string $name
@return mixed | [
"namespaceGetAll",
"()",
"-",
"Get",
"an",
"array",
"containing",
"$namespace",
"including",
"expiring",
"data",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Session/Abstract.php#L177-L184 | train | Get all session data for a namespace | [
30522,
5123,
10763,
3853,
1035,
3415,
15327,
18150,
8095,
1006,
1002,
3415,
15327,
1007,
1063,
1002,
2783,
2850,
2696,
1027,
1006,
26354,
3388,
1006,
1002,
1035,
5219,
1031,
1002,
3415,
15327,
1033,
1007,
1004,
1004,
2003,
1035,
9140,
1006,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Redis/Connections/PhpRedisConnection.php | PhpRedisConnection.transaction | public function transaction(callable $callback = null)
{
$transaction = $this->client()->multi();
return is_null($callback)
? $transaction
: tap($transaction, $callback)->exec();
} | php | public function transaction(callable $callback = null)
{
$transaction = $this->client()->multi();
return is_null($callback)
? $transaction
: tap($transaction, $callback)->exec();
} | [
"public",
"function",
"transaction",
"(",
"callable",
"$",
"callback",
"=",
"null",
")",
"{",
"$",
"transaction",
"=",
"$",
"this",
"->",
"client",
"(",
")",
"->",
"multi",
"(",
")",
";",
"return",
"is_null",
"(",
"$",
"callback",
")",
"?",
"$",
"tra... | Execute commands in a transaction.
@param callable|null $callback
@return \Redis|array | [
"Execute",
"commands",
"in",
"a",
"transaction",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Redis/Connections/PhpRedisConnection.php#L313-L320 | train | Execute a multi - transaction. | [
30522,
2270,
3853,
12598,
1006,
2655,
3085,
1002,
2655,
5963,
1027,
19701,
1007,
1063,
1002,
12598,
1027,
1002,
2023,
1011,
1028,
7396,
1006,
1007,
1011,
1028,
4800,
1006,
1007,
1025,
2709,
2003,
1035,
19701,
1006,
1002,
2655,
5963,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/PrivacyManager/PrivacyManager.php | PrivacyManager.hasReportBeenPurged | public static function hasReportBeenPurged($dataTable)
{
$strPeriod = Common::getRequestVar('period', false);
$strDate = Common::getRequestVar('date', false);
if (false !== $strPeriod
&& false !== $strDate
&& (is_null($dataTable)
|| (!empty($dataTab... | php | public static function hasReportBeenPurged($dataTable)
{
$strPeriod = Common::getRequestVar('period', false);
$strDate = Common::getRequestVar('date', false);
if (false !== $strPeriod
&& false !== $strDate
&& (is_null($dataTable)
|| (!empty($dataTab... | [
"public",
"static",
"function",
"hasReportBeenPurged",
"(",
"$",
"dataTable",
")",
"{",
"$",
"strPeriod",
"=",
"Common",
"::",
"getRequestVar",
"(",
"'period'",
",",
"false",
")",
";",
"$",
"strDate",
"=",
"Common",
"::",
"getRequestVar",
"(",
"'date'",
",",... | Returns true if it is likely that the data for this report has been purged and if the
user should be told about that.
In order for this function to return true, the following must also be true:
- The data table for this report must either be empty or not have been fetched.
- The period of this report is not a multiple... | [
"Returns",
"true",
"if",
"it",
"is",
"likely",
"that",
"the",
"data",
"for",
"this",
"report",
"has",
"been",
"purged",
"and",
"if",
"the",
"user",
"should",
"be",
"told",
"about",
"that",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/PrivacyManager/PrivacyManager.php#L103-L128 | train | Returns true if the report has been purged | [
30522,
2270,
10763,
3853,
2038,
2890,
6442,
11306,
16275,
12514,
2098,
1006,
1002,
2951,
10880,
1007,
1063,
1002,
2358,
14536,
11124,
7716,
1027,
2691,
1024,
1024,
2131,
2890,
15500,
10755,
1006,
1005,
2558,
1005,
1010,
6270,
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... |
symfony/symfony | src/Symfony/Component/Routing/RouteCollection.php | RouteCollection.addResource | public function addResource(ResourceInterface $resource)
{
$key = (string) $resource;
if (!isset($this->resources[$key])) {
$this->resources[$key] = $resource;
}
} | php | public function addResource(ResourceInterface $resource)
{
$key = (string) $resource;
if (!isset($this->resources[$key])) {
$this->resources[$key] = $resource;
}
} | [
"public",
"function",
"addResource",
"(",
"ResourceInterface",
"$",
"resource",
")",
"{",
"$",
"key",
"=",
"(",
"string",
")",
"$",
"resource",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"resources",
"[",
"$",
"key",
"]",
")",
")",
"{",
... | Adds a resource for this collection. If the resource already exists
it is not added. | [
"Adds",
"a",
"resource",
"for",
"this",
"collection",
".",
"If",
"the",
"resource",
"already",
"exists",
"it",
"is",
"not",
"added",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Routing/RouteCollection.php#L289-L296 | train | Add a resource to the list of resources | [
30522,
2270,
3853,
5587,
6072,
8162,
3401,
1006,
7692,
18447,
2121,
12172,
1002,
7692,
1007,
1063,
1002,
3145,
1027,
1006,
5164,
1007,
1002,
7692,
1025,
2065,
1006,
999,
26354,
3388,
1006,
1002,
2023,
1011,
1028,
4219,
1031,
1002,
3145,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/system/classes/CombineAssets.php | CombineAssets.getDeepHashFromAssets | protected function getDeepHashFromAssets($assets)
{
$key = '';
$assetFiles = array_map(function ($file) {
return file_exists($file) ? $file : File::symbolizePath($file, null) ?: $this->localPath . $file;
}, $assets);
foreach ($assetFiles as $file) {
$filters... | php | protected function getDeepHashFromAssets($assets)
{
$key = '';
$assetFiles = array_map(function ($file) {
return file_exists($file) ? $file : File::symbolizePath($file, null) ?: $this->localPath . $file;
}, $assets);
foreach ($assetFiles as $file) {
$filters... | [
"protected",
"function",
"getDeepHashFromAssets",
"(",
"$",
"assets",
")",
"{",
"$",
"key",
"=",
"''",
";",
"$",
"assetFiles",
"=",
"array_map",
"(",
"function",
"(",
"$",
"file",
")",
"{",
"return",
"file_exists",
"(",
"$",
"file",
")",
"?",
"$",
"fil... | Returns a deep hash on filters that support it.
@param array $assets List of asset files.
@return void | [
"Returns",
"a",
"deep",
"hash",
"on",
"filters",
"that",
"support",
"it",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/CombineAssets.php#L469-L488 | train | Get deep hash from assets | [
30522,
5123,
3853,
2131,
26095,
30524,
5371,
1007,
1063,
2709,
5371,
1035,
6526,
1006,
1002,
5371,
1007,
1029,
1002,
5371,
1024,
5371,
1024,
1024,
6454,
4697,
15069,
1006,
1002,
5371,
1010,
19701,
1007,
1029,
1024,
1002,
2023,
1011,
1028,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
z-song/laravel-admin | src/Extension.php | Extension.createPermission | protected static function createPermission($name, $slug, $path)
{
$permissionModel = config('admin.database.permissions_model');
$permissionModel::create([
'name' => $name,
'slug' => $slug,
'http_path' => '/'.trim($path, '/'),
]);
} | php | protected static function createPermission($name, $slug, $path)
{
$permissionModel = config('admin.database.permissions_model');
$permissionModel::create([
'name' => $name,
'slug' => $slug,
'http_path' => '/'.trim($path, '/'),
]);
} | [
"protected",
"static",
"function",
"createPermission",
"(",
"$",
"name",
",",
"$",
"slug",
",",
"$",
"path",
")",
"{",
"$",
"permissionModel",
"=",
"config",
"(",
"'admin.database.permissions_model'",
")",
";",
"$",
"permissionModel",
"::",
"create",
"(",
"[",... | Create a permission for this extension.
@param $name
@param $slug
@param $path | [
"Create",
"a",
"permission",
"for",
"this",
"extension",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Extension.php#L325-L334 | train | Create permission in the permission model | [
30522,
5123,
10763,
3853,
3443,
4842,
25481,
1006,
1002,
2171,
1010,
1002,
23667,
1010,
1002,
4130,
1007,
1063,
1002,
6656,
5302,
9247,
1027,
9530,
8873,
2290,
1006,
1005,
4748,
10020,
1012,
7809,
1012,
6656,
2015,
1035,
2944,
1005,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/backend/widgets/MediaManager.php | MediaManager.resizeImage | protected function resizeImage($fullThumbnailPath, $thumbnailParams, $tempFilePath)
{
$thumbnailDir = dirname($fullThumbnailPath);
if (
!File::isDirectory($thumbnailDir)
&& File::makeDirectory($thumbnailDir, 0777, true) === false
) {
throw new SystemExcept... | php | protected function resizeImage($fullThumbnailPath, $thumbnailParams, $tempFilePath)
{
$thumbnailDir = dirname($fullThumbnailPath);
if (
!File::isDirectory($thumbnailDir)
&& File::makeDirectory($thumbnailDir, 0777, true) === false
) {
throw new SystemExcept... | [
"protected",
"function",
"resizeImage",
"(",
"$",
"fullThumbnailPath",
",",
"$",
"thumbnailParams",
",",
"$",
"tempFilePath",
")",
"{",
"$",
"thumbnailDir",
"=",
"dirname",
"(",
"$",
"fullThumbnailPath",
")",
";",
"if",
"(",
"!",
"File",
"::",
"isDirectory",
... | Resize an image
@param string $fullThumbnailPath
@param array $thumbnailParams
@param string $tempFilePath
@return void | [
"Resize",
"an",
"image"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/MediaManager.php#L1376-L1400 | train | Resize image to target dimensions | [
30522,
5123,
3853,
24501,
4697,
9581,
3351,
1006,
1002,
2440,
2705,
25438,
25464,
15069,
1010,
1002,
7639,
25464,
28689,
5244,
1010,
1002,
8915,
8737,
8873,
2571,
15069,
1007,
1063,
1002,
7639,
25464,
4305,
2099,
1027,
16101,
18442,
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... |
symfony/symfony | src/Symfony/Component/EventDispatcher/EventDispatcher.php | EventDispatcher.dispatch | public function dispatch($event/*, string $eventName = null*/)
{
$eventName = 1 < \func_num_args() ? \func_get_arg(1) : null;
if (\is_object($event)) {
$eventName = $eventName ?? \get_class($event);
} else {
@trigger_error(sprintf('Calling the "%s::dispatch()" method... | php | public function dispatch($event/*, string $eventName = null*/)
{
$eventName = 1 < \func_num_args() ? \func_get_arg(1) : null;
if (\is_object($event)) {
$eventName = $eventName ?? \get_class($event);
} else {
@trigger_error(sprintf('Calling the "%s::dispatch()" method... | [
"public",
"function",
"dispatch",
"(",
"$",
"event",
"/*, string $eventName = null*/",
")",
"{",
"$",
"eventName",
"=",
"1",
"<",
"\\",
"func_num_args",
"(",
")",
"?",
"\\",
"func_get_arg",
"(",
"1",
")",
":",
"null",
";",
"if",
"(",
"\\",
"is_object",
"... | {@inheritdoc}
@param string|null $eventName | [
"{",
"@inheritdoc",
"}"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/EventDispatcher/EventDispatcher.php#L51-L79 | train | Dispatches an event to all listeners | [
30522,
2270,
3853,
18365,
1006,
1002,
2724,
1013,
1008,
1010,
5164,
1002,
2724,
18442,
1027,
19701,
1008,
1013,
1007,
1063,
1002,
2724,
18442,
1027,
1015,
1026,
1032,
4569,
2278,
1035,
16371,
2213,
1035,
12098,
5620,
1006,
1007,
1029,
1032,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Templating/Helper/FormHelper.php | FormHelper.setTheme | public function setTheme(FormView $view, $themes, $useDefaultThemes = true)
{
$this->renderer->setTheme($view, $themes, $useDefaultThemes);
} | php | public function setTheme(FormView $view, $themes, $useDefaultThemes = true)
{
$this->renderer->setTheme($view, $themes, $useDefaultThemes);
} | [
"public",
"function",
"setTheme",
"(",
"FormView",
"$",
"view",
",",
"$",
"themes",
",",
"$",
"useDefaultThemes",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"renderer",
"->",
"setTheme",
"(",
"$",
"view",
",",
"$",
"themes",
",",
"$",
"useDefaultThemes",
... | Sets a theme for a given view.
The theme format is "<Bundle>:<Controller>".
@param FormView $view A FormView instance
@param string|array $themes A theme or an array of theme
@param bool $useDefaultThemes If true, will use default themes defined in the renderer | [
"Sets",
"a",
"theme",
"for",
"a",
"given",
"view",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/FormHelper.php#L54-L57 | train | Set the theme of the form | [
30522,
2270,
3853,
2275,
10760,
4168,
1006,
2433,
8584,
1002,
3193,
1010,
1002,
6991,
1010,
1002,
2109,
12879,
23505,
10760,
7834,
1027,
2995,
1007,
1063,
1002,
2023,
1011,
1028,
17552,
2121,
1011,
1028,
2275,
10760,
4168,
1006,
1002,
3193,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/thrift | lib/php/lib/Protocol/TMultiplexedProtocol.php | TMultiplexedProtocol.writeMessageBegin | public function writeMessageBegin($name, $type, $seqid)
{
if ($type == TMessageType::CALL || $type == TMessageType::ONEWAY) {
$nameWithService = $this->serviceName_ . self::SEPARATOR . $name;
parent::writeMessageBegin($nameWithService, $type, $seqid);
} else {
par... | php | public function writeMessageBegin($name, $type, $seqid)
{
if ($type == TMessageType::CALL || $type == TMessageType::ONEWAY) {
$nameWithService = $this->serviceName_ . self::SEPARATOR . $name;
parent::writeMessageBegin($nameWithService, $type, $seqid);
} else {
par... | [
"public",
"function",
"writeMessageBegin",
"(",
"$",
"name",
",",
"$",
"type",
",",
"$",
"seqid",
")",
"{",
"if",
"(",
"$",
"type",
"==",
"TMessageType",
"::",
"CALL",
"||",
"$",
"type",
"==",
"TMessageType",
"::",
"ONEWAY",
")",
"{",
"$",
"nameWithSer... | Writes the message header.
Prepends the service name to the function name, separated by <code>TMultiplexedProtocol::SEPARATOR</code>.
@param string $name Function name.
@param int $type Message type.
@param int $seqid The sequence id of this message. | [
"Writes",
"the",
"message",
"header",
".",
"Prepends",
"the",
"service",
"name",
"to",
"the",
"function",
"name",
"separated",
"by",
"<code",
">",
"TMultiplexedProtocol",
"::",
"SEPARATOR<",
"/",
"code",
">",
"."
] | acdd4226c210336e9e15eb812e5932a645fcd5ce | https://github.com/apache/thrift/blob/acdd4226c210336e9e15eb812e5932a645fcd5ce/lib/php/lib/Protocol/TMultiplexedProtocol.php#L76-L84 | train | WriteMessageBegin implements the interface method. | [
30522,
2270,
3853,
4339,
7834,
3736,
3351,
4783,
11528,
1006,
1002,
2171,
1010,
1002,
2828,
1010,
1002,
7367,
14702,
2094,
1007,
1063,
2065,
1006,
1002,
2828,
1027,
1027,
1056,
7834,
3736,
18150,
18863,
1024,
1024,
2655,
1064,
1064,
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/CombineAssets.php | CombineAssets.registerBundle | public function registerBundle($files, $destination = null, $extension = null)
{
if (!is_array($files)) {
$files = [$files];
}
$firstFile = array_values($files)[0];
if ($extension === null) {
$extension = File::extension($firstFile);
}
$exte... | php | public function registerBundle($files, $destination = null, $extension = null)
{
if (!is_array($files)) {
$files = [$files];
}
$firstFile = array_values($files)[0];
if ($extension === null) {
$extension = File::extension($firstFile);
}
$exte... | [
"public",
"function",
"registerBundle",
"(",
"$",
"files",
",",
"$",
"destination",
"=",
"null",
",",
"$",
"extension",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"files",
")",
")",
"{",
"$",
"files",
"=",
"[",
"$",
"files",
"]",
... | Registers bundle.
@param string|array $files Files to be registered to bundle
@param string $destination Destination file will be compiled to.
@param string $extension Extension name. Eg: css
@return self | [
"Registers",
"bundle",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/CombineAssets.php#L631-L668 | train | Registers a bundle | [
30522,
2270,
3853,
4236,
27265,
2571,
1006,
1002,
6764,
1010,
1002,
7688,
1027,
19701,
1010,
1002,
5331,
1027,
19701,
1007,
1063,
2065,
1006,
999,
2003,
1035,
9140,
1006,
1002,
6764,
1007,
1007,
1063,
1002,
6764,
1027,
1031,
1002,
6764,
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/Mailer/Transport/AbstractTransport.php | AbstractTransport.setMaxPerSecond | public function setMaxPerSecond(float $rate): self
{
if (0 >= $rate) {
$rate = 0;
}
$this->rate = $rate;
$this->lastSent = 0;
return $this;
} | php | public function setMaxPerSecond(float $rate): self
{
if (0 >= $rate) {
$rate = 0;
}
$this->rate = $rate;
$this->lastSent = 0;
return $this;
} | [
"public",
"function",
"setMaxPerSecond",
"(",
"float",
"$",
"rate",
")",
":",
"self",
"{",
"if",
"(",
"0",
">=",
"$",
"rate",
")",
"{",
"$",
"rate",
"=",
"0",
";",
"}",
"$",
"this",
"->",
"rate",
"=",
"$",
"rate",
";",
"$",
"this",
"->",
"lastS... | Sets the maximum number of messages to send per second (0 to disable). | [
"Sets",
"the",
"maximum",
"number",
"of",
"messages",
"to",
"send",
"per",
"second",
"(",
"0",
"to",
"disable",
")",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Mailer/Transport/AbstractTransport.php#L46-L56 | train | Set the maximum number of seconds per second | [
30522,
2270,
3853,
2275,
17848,
7347,
8586,
15422,
1006,
14257,
1002,
3446,
1007,
1024,
2969,
1063,
2065,
1006,
1014,
1028,
1027,
1002,
3446,
1007,
1063,
1002,
3446,
1027,
1014,
1025,
1065,
1002,
2023,
1011,
1028,
3446,
1027,
1002,
3446,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Console/Helper/DebugFormatterHelper.php | DebugFormatterHelper.stop | public function stop($id, $message, $successful, $prefix = 'RES')
{
$trailingEOL = isset($this->started[$id]['out']) || isset($this->started[$id]['err']) ? "\n" : '';
if ($successful) {
return sprintf("%s%s<bg=green;fg=white> %s </> <fg=green>%s</>\n", $trailingEOL, $this->getBorder($id... | php | public function stop($id, $message, $successful, $prefix = 'RES')
{
$trailingEOL = isset($this->started[$id]['out']) || isset($this->started[$id]['err']) ? "\n" : '';
if ($successful) {
return sprintf("%s%s<bg=green;fg=white> %s </> <fg=green>%s</>\n", $trailingEOL, $this->getBorder($id... | [
"public",
"function",
"stop",
"(",
"$",
"id",
",",
"$",
"message",
",",
"$",
"successful",
",",
"$",
"prefix",
"=",
"'RES'",
")",
"{",
"$",
"trailingEOL",
"=",
"isset",
"(",
"$",
"this",
"->",
"started",
"[",
"$",
"id",
"]",
"[",
"'out'",
"]",
")... | Stops a formatting session.
@param string $id The id of the formatting session
@param string $message The message to display
@param bool $successful Whether to consider the result as success
@param string $prefix The prefix for the end output
@return string | [
"Stops",
"a",
"formatting",
"session",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Helper/DebugFormatterHelper.php#L95-L108 | train | Stops the process | [
30522,
2270,
3853,
2644,
1006,
1002,
8909,
1010,
1002,
4471,
1010,
1002,
3144,
1010,
1002,
17576,
1027,
1005,
24501,
1005,
1007,
1063,
1002,
12542,
8780,
2140,
1027,
26354,
3388,
1006,
1002,
2023,
1011,
1028,
2318,
1031,
1002,
8909,
1033,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
z-song/laravel-admin | src/Traits/HasAssets.php | HasAssets.js | public static function js($js = null)
{
if (!is_null($js)) {
return self::$js = array_merge(self::$js, (array) $js);
}
if (!$js = static::getMinifiedJs()) {
$js = array_merge(static::baseJs(), static::$js);
}
$js = array_filter(array_unique($js));
... | php | public static function js($js = null)
{
if (!is_null($js)) {
return self::$js = array_merge(self::$js, (array) $js);
}
if (!$js = static::getMinifiedJs()) {
$js = array_merge(static::baseJs(), static::$js);
}
$js = array_filter(array_unique($js));
... | [
"public",
"static",
"function",
"js",
"(",
"$",
"js",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"js",
")",
")",
"{",
"return",
"self",
"::",
"$",
"js",
"=",
"array_merge",
"(",
"self",
"::",
"$",
"js",
",",
"(",
"array",
")",
... | Add js or get all js.
@param null $js
@return array|\Illuminate\Contracts\View\Factory|\Illuminate\View\View | [
"Add",
"js",
"or",
"get",
"all",
"js",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Traits/HasAssets.php#L129-L142 | train | Get js array | [
30522,
2270,
10763,
3853,
1046,
2015,
1006,
1002,
1046,
2015,
1027,
19701,
1007,
1063,
2065,
1006,
999,
2003,
1035,
19701,
1006,
1002,
1046,
2015,
1007,
1007,
1063,
2709,
2969,
1024,
1024,
1002,
1046,
2015,
1027,
9140,
1035,
13590,
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... |
overtrue/wechat | src/Payment/Kernel/BaseClient.php | BaseClient.safeRequest | protected function safeRequest($endpoint, array $params, $method = 'post', array $options = [])
{
$options = array_merge([
'cert' => $this->app['config']->get('cert_path'),
'ssl_key' => $this->app['config']->get('key_path'),
], $options);
return $this->request($endpo... | php | protected function safeRequest($endpoint, array $params, $method = 'post', array $options = [])
{
$options = array_merge([
'cert' => $this->app['config']->get('cert_path'),
'ssl_key' => $this->app['config']->get('key_path'),
], $options);
return $this->request($endpo... | [
"protected",
"function",
"safeRequest",
"(",
"$",
"endpoint",
",",
"array",
"$",
"params",
",",
"$",
"method",
"=",
"'post'",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"options",
"=",
"array_merge",
"(",
"[",
"'cert'",
"=>",
"$",
"t... | Request with SSL.
@param string $endpoint
@param array $params
@param string $method
@param array $options
@return \Psr\Http\Message\ResponseInterface|\EasyWeChat\Kernel\Support\Collection|array|object|string
@throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException
@throws \EasyWeChat\Kernel\Exceptions\Invalid... | [
"Request",
"with",
"SSL",
"."
] | 120c72faaa93c270365bc75c73c362d5fd583209 | https://github.com/overtrue/wechat/blob/120c72faaa93c270365bc75c73c362d5fd583209/src/Payment/Kernel/BaseClient.php#L146-L154 | train | Safe request to use SSL | [
30522,
5123,
3853,
13726,
2063,
15500,
1006,
1002,
2203,
8400,
1010,
9140,
1002,
11498,
5244,
1010,
1002,
4118,
1027,
1005,
2695,
1005,
1010,
9140,
1002,
7047,
1027,
1031,
1033,
1007,
1063,
1002,
7047,
1027,
9140,
1035,
13590,
1006,
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... |
octobercms/october | modules/backend/widgets/Lists.php | Lists.makeListColumn | protected function makeListColumn($name, $config)
{
if (is_string($config)) {
$label = $config;
}
elseif (isset($config['label'])) {
$label = $config['label'];
}
else {
$label = studly_case($name);
}
/*
* Auto conf... | php | protected function makeListColumn($name, $config)
{
if (is_string($config)) {
$label = $config;
}
elseif (isset($config['label'])) {
$label = $config['label'];
}
else {
$label = studly_case($name);
}
/*
* Auto conf... | [
"protected",
"function",
"makeListColumn",
"(",
"$",
"name",
",",
"$",
"config",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"config",
")",
")",
"{",
"$",
"label",
"=",
"$",
"config",
";",
"}",
"elseif",
"(",
"isset",
"(",
"$",
"config",
"[",
"'lab... | Creates a list column object from it's name and configuration. | [
"Creates",
"a",
"list",
"column",
"object",
"from",
"it",
"s",
"name",
"and",
"configuration",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/Lists.php#L864-L907 | train | Create ListColumn object | [
30522,
5123,
3853,
2191,
9863,
25778,
2819,
2078,
1006,
1002,
2171,
1010,
1002,
9530,
8873,
2290,
1007,
1063,
2065,
1006,
2003,
1035,
5164,
1006,
1002,
9530,
8873,
2290,
1007,
1007,
1063,
1002,
3830,
1027,
1002,
9530,
8873,
2290,
1025,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Validation/Validator.php | Validator.addRules | public function addRules($rules)
{
// The primary purpose of this parser is to expand any "*" rules to the all
// of the explicit rules needed for the given data. For example the rule
// names.* would get expanded to names.0, names.1, etc. for this data.
$response = (new ValidationRu... | php | public function addRules($rules)
{
// The primary purpose of this parser is to expand any "*" rules to the all
// of the explicit rules needed for the given data. For example the rule
// names.* would get expanded to names.0, names.1, etc. for this data.
$response = (new ValidationRu... | [
"public",
"function",
"addRules",
"(",
"$",
"rules",
")",
"{",
"// The primary purpose of this parser is to expand any \"*\" rules to the all",
"// of the explicit rules needed for the given data. For example the rule",
"// names.* would get expanded to names.0, names.1, etc. for this data.",
... | Parse the given rules and merge them into current rules.
@param array $rules
@return void | [
"Parse",
"the",
"given",
"rules",
"and",
"merge",
"them",
"into",
"current",
"rules",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Validation/Validator.php#L834-L849 | train | Add rules to the all explicit rules needed for this data | [
30522,
2270,
3853,
5587,
6820,
4244,
1006,
1002,
3513,
1007,
1063,
1013,
1013,
1996,
3078,
3800,
1997,
2023,
11968,
8043,
2003,
2000,
7818,
2151,
1000,
1008,
1000,
3513,
2000,
1996,
2035,
1013,
1013,
1997,
1996,
13216,
3513,
2734,
2005,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
overtrue/wechat | src/OfficialAccount/Card/Client.php | Client.setPayCell | public function setPayCell($cardId, $isOpen = true)
{
$params = [
'card_id' => $cardId,
'is_open' => $isOpen,
];
return $this->httpPostJson('card/paycell/set', $params);
} | php | public function setPayCell($cardId, $isOpen = true)
{
$params = [
'card_id' => $cardId,
'is_open' => $isOpen,
];
return $this->httpPostJson('card/paycell/set', $params);
} | [
"public",
"function",
"setPayCell",
"(",
"$",
"cardId",
",",
"$",
"isOpen",
"=",
"true",
")",
"{",
"$",
"params",
"=",
"[",
"'card_id'",
"=>",
"$",
"cardId",
",",
"'is_open'",
"=>",
"$",
"isOpen",
",",
"]",
";",
"return",
"$",
"this",
"->",
"httpPost... | 设置微信买单接口.
设置买单的 card_id 必须已经配置了门店,否则会报错.
@param string $cardId
@param bool $isOpen
@return mixed | [
"设置微信买单接口",
".",
"设置买单的",
"card_id",
"必须已经配置了门店,否则会报错",
"."
] | 120c72faaa93c270365bc75c73c362d5fd583209 | https://github.com/overtrue/wechat/blob/120c72faaa93c270365bc75c73c362d5fd583209/src/OfficialAccount/Card/Client.php#L304-L312 | train | Set Paycell for card | [
30522,
2270,
3853,
2275,
4502,
29297,
3363,
1006,
1002,
4003,
3593,
1010,
1002,
11163,
11837,
1027,
2995,
1007,
1063,
1002,
11498,
5244,
1027,
1031,
1005,
4003,
1035,
8909,
1005,
1027,
1028,
1002,
4003,
3593,
1010,
1005,
2003,
1035,
2330,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/RedisStore.php | RedisStore.decrement | public function decrement($key, $value = 1)
{
return $this->connection()->decrby($this->prefix.$key, $value);
} | php | public function decrement($key, $value = 1)
{
return $this->connection()->decrby($this->prefix.$key, $value);
} | [
"public",
"function",
"decrement",
"(",
"$",
"key",
",",
"$",
"value",
"=",
"1",
")",
"{",
"return",
"$",
"this",
"->",
"connection",
"(",
")",
"->",
"decrby",
"(",
"$",
"this",
"->",
"prefix",
".",
"$",
"key",
",",
"$",
"value",
")",
";",
"}"
] | Decrement the value of an item in the cache.
@param string $key
@param mixed $value
@return int | [
"Decrement",
"the",
"value",
"of",
"an",
"item",
"in",
"the",
"cache",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Cache/RedisStore.php#L157-L160 | train | Decrement value of key | [
30522,
2270,
3853,
11703,
28578,
4765,
1006,
1002,
3145,
1010,
1002,
3643,
1027,
1015,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
4434,
1006,
1007,
1011,
1028,
11703,
15185,
2100,
1006,
1002,
2023,
1011,
1028,
17576,
1012,
1002,
3145,
1010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/HttpKernel/Controller/ArgumentResolver/TraceableValueResolver.php | TraceableValueResolver.resolve | public function resolve(Request $request, ArgumentMetadata $argument): iterable
{
$method = \get_class($this->inner).'::'.__FUNCTION__;
$this->stopwatch->start($method, 'controller.argument_value_resolver');
yield from $this->inner->resolve($request, $argument);
$this->stopwatch->s... | php | public function resolve(Request $request, ArgumentMetadata $argument): iterable
{
$method = \get_class($this->inner).'::'.__FUNCTION__;
$this->stopwatch->start($method, 'controller.argument_value_resolver');
yield from $this->inner->resolve($request, $argument);
$this->stopwatch->s... | [
"public",
"function",
"resolve",
"(",
"Request",
"$",
"request",
",",
"ArgumentMetadata",
"$",
"argument",
")",
":",
"iterable",
"{",
"$",
"method",
"=",
"\\",
"get_class",
"(",
"$",
"this",
"->",
"inner",
")",
".",
"'::'",
".",
"__FUNCTION__",
";",
"$",... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpKernel/Controller/ArgumentResolver/TraceableValueResolver.php#L53-L61 | train | Resolves the request and argument metadata to a value. | [
30522,
2270,
3853,
10663,
1006,
5227,
1002,
5227,
1010,
6685,
11368,
8447,
2696,
1002,
6685,
1007,
1024,
2009,
6906,
3468,
1063,
1002,
4118,
1027,
1032,
2131,
1035,
2465,
1006,
1002,
2023,
1011,
1028,
5110,
1007,
1012,
1005,
1024,
1024,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/cms/helpers/Cms.php | Cms.url | public function url($path = null)
{
$routeAction = 'Cms\Classes\CmsController@run';
if (self::$actionExists === null) {
self::$actionExists = Route::getRoutes()->getByAction($routeAction) !== null;
}
if (substr($path, 0, 1) == '/') {
$path = substr($path, 1)... | php | public function url($path = null)
{
$routeAction = 'Cms\Classes\CmsController@run';
if (self::$actionExists === null) {
self::$actionExists = Route::getRoutes()->getByAction($routeAction) !== null;
}
if (substr($path, 0, 1) == '/') {
$path = substr($path, 1)... | [
"public",
"function",
"url",
"(",
"$",
"path",
"=",
"null",
")",
"{",
"$",
"routeAction",
"=",
"'Cms\\Classes\\CmsController@run'",
";",
"if",
"(",
"self",
"::",
"$",
"actionExists",
"===",
"null",
")",
"{",
"self",
"::",
"$",
"actionExists",
"=",
"Route",... | Returns a URL in context of the Frontend | [
"Returns",
"a",
"URL",
"in",
"context",
"of",
"the",
"Frontend"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/helpers/Cms.php#L20-L37 | train | Returns the url to the requested path | [
30522,
2270,
3853,
24471,
2140,
1006,
1002,
4130,
1027,
19701,
1007,
1063,
1002,
2799,
18908,
3258,
1027,
1005,
4642,
2015,
1032,
4280,
1032,
4642,
9363,
3372,
26611,
1030,
2448,
1005,
1025,
2065,
1006,
2969,
1024,
1024,
1002,
2895,
10288,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/backend/formwidgets/Repeater.php | Repeater.makeItemFormWidget | protected function makeItemFormWidget($index = 0, $groupCode = null)
{
$configDefinition = $this->useGroups
? $this->getGroupFormFieldConfig($groupCode)
: $this->form;
$config = $this->makeConfig($configDefinition);
$config->model = $this->model;
$config->dat... | php | protected function makeItemFormWidget($index = 0, $groupCode = null)
{
$configDefinition = $this->useGroups
? $this->getGroupFormFieldConfig($groupCode)
: $this->form;
$config = $this->makeConfig($configDefinition);
$config->model = $this->model;
$config->dat... | [
"protected",
"function",
"makeItemFormWidget",
"(",
"$",
"index",
"=",
"0",
",",
"$",
"groupCode",
"=",
"null",
")",
"{",
"$",
"configDefinition",
"=",
"$",
"this",
"->",
"useGroups",
"?",
"$",
"this",
"->",
"getGroupFormFieldConfig",
"(",
"$",
"groupCode",
... | Creates a form widget based on a field index and optional group code.
@param int $index
@param string $index
@return \Backend\Widgets\Form | [
"Creates",
"a",
"form",
"widget",
"based",
"on",
"a",
"field",
"index",
"and",
"optional",
"group",
"code",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/formwidgets/Repeater.php#L259-L280 | train | Make item form widget | [
30522,
5123,
3853,
2191,
4221,
2213,
14192,
9148,
24291,
1006,
1002,
5950,
1027,
1014,
1010,
1002,
2177,
16044,
1027,
19701,
1007,
1063,
1002,
9530,
8873,
2290,
3207,
16294,
22753,
1027,
1002,
2023,
1011,
1028,
2224,
17058,
2015,
1029,
1002... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Common/Page/Collection.php | Collection.ofType | public function ofType($type)
{
$items = [];
foreach ($this->items as $path => $slug) {
$page = $this->pages->get($path);
if ($page !== null && $page->template() === $type) {
$items[$path] = $slug;
}
}
$this->items = $items;
... | php | public function ofType($type)
{
$items = [];
foreach ($this->items as $path => $slug) {
$page = $this->pages->get($path);
if ($page !== null && $page->template() === $type) {
$items[$path] = $slug;
}
}
$this->items = $items;
... | [
"public",
"function",
"ofType",
"(",
"$",
"type",
")",
"{",
"$",
"items",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"items",
"as",
"$",
"path",
"=>",
"$",
"slug",
")",
"{",
"$",
"page",
"=",
"$",
"this",
"->",
"pages",
"->",
"get",... | Creates new collection with only pages of the specified type
@param string $type
@return Collection The collection | [
"Creates",
"new",
"collection",
"with",
"only",
"pages",
"of",
"the",
"specified",
"type"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Page/Collection.php#L523-L537 | train | Set the pages of a certain type | [
30522,
2270,
3853,
1997,
13874,
1006,
1002,
2828,
1007,
1063,
1002,
5167,
1027,
1031,
1033,
1025,
18921,
6776,
1006,
1002,
2023,
1011,
1028,
5167,
2004,
1002,
4130,
1027,
1028,
1002,
23667,
1007,
1063,
1002,
3931,
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... |
matomo-org/matomo | libs/Zend/Db/Adapter/Db2.php | Zend_Db_Adapter_Db2.prepare | public function prepare($sql)
{
$this->_connect();
$stmtClass = $this->_defaultStmtClass;
if (!class_exists($stmtClass)) {
// require_once 'Zend/Loader.php';
Zend_Loader::loadClass($stmtClass);
}
$stmt = new $stmtClass($this, $sql);
$stmt->setF... | php | public function prepare($sql)
{
$this->_connect();
$stmtClass = $this->_defaultStmtClass;
if (!class_exists($stmtClass)) {
// require_once 'Zend/Loader.php';
Zend_Loader::loadClass($stmtClass);
}
$stmt = new $stmtClass($this, $sql);
$stmt->setF... | [
"public",
"function",
"prepare",
"(",
"$",
"sql",
")",
"{",
"$",
"this",
"->",
"_connect",
"(",
")",
";",
"$",
"stmtClass",
"=",
"$",
"this",
"->",
"_defaultStmtClass",
";",
"if",
"(",
"!",
"class_exists",
"(",
"$",
"stmtClass",
")",
")",
"{",
"// re... | Returns an SQL statement for preparation.
@param string $sql The SQL statement with placeholders.
@return Zend_Db_Statement_Db2 | [
"Returns",
"an",
"SQL",
"statement",
"for",
"preparation",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Adapter/Db2.php#L230-L241 | train | Prepare statement for execution | [
30522,
2270,
3853,
7374,
1006,
1002,
29296,
1007,
1063,
1002,
2023,
1011,
1028,
1035,
7532,
1006,
1007,
1025,
1002,
2358,
20492,
26266,
1027,
1002,
2023,
1011,
1028,
1035,
12398,
3367,
20492,
26266,
1025,
2065,
1006,
999,
2465,
1035,
6526,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/API/Proxy.php | Proxy.checkMethodExists | private function checkMethodExists($className, $methodName)
{
if (!$this->isMethodAvailable($className, $methodName)) {
throw new Exception(Piwik::translate('General_ExceptionMethodNotFound', array($methodName, $className)));
}
} | php | private function checkMethodExists($className, $methodName)
{
if (!$this->isMethodAvailable($className, $methodName)) {
throw new Exception(Piwik::translate('General_ExceptionMethodNotFound', array($methodName, $className)));
}
} | [
"private",
"function",
"checkMethodExists",
"(",
"$",
"className",
",",
"$",
"methodName",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isMethodAvailable",
"(",
"$",
"className",
",",
"$",
"methodName",
")",
")",
"{",
"throw",
"new",
"Exception",
"(",
"... | Checks that the method exists in the class
@param string $className The class name
@param string $methodName The method name
@throws Exception If the method is not found | [
"Checks",
"that",
"the",
"method",
"exists",
"in",
"the",
"class"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/API/Proxy.php#L490-L495 | train | Check if a method exists in the class. | [
30522,
2797,
3853,
4638,
11368,
6806,
3207,
9048,
12837,
1006,
1002,
2465,
18442,
1010,
1002,
4118,
18442,
1007,
1063,
2065,
1006,
999,
1002,
2023,
1011,
1028,
2003,
11368,
6806,
29045,
12502,
3085,
1006,
1002,
2465,
18442,
1010,
1002,
4118... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Http/Resources/ConditionallyLoadsAttributes.php | ConditionallyLoadsAttributes.whenLoaded | protected function whenLoaded($relationship, $value = null, $default = null)
{
if (func_num_args() < 3) {
$default = new MissingValue;
}
if (! $this->resource->relationLoaded($relationship)) {
return value($default);
}
if (func_num_args() === 1) {
... | php | protected function whenLoaded($relationship, $value = null, $default = null)
{
if (func_num_args() < 3) {
$default = new MissingValue;
}
if (! $this->resource->relationLoaded($relationship)) {
return value($default);
}
if (func_num_args() === 1) {
... | [
"protected",
"function",
"whenLoaded",
"(",
"$",
"relationship",
",",
"$",
"value",
"=",
"null",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"func_num_args",
"(",
")",
"<",
"3",
")",
"{",
"$",
"default",
"=",
"new",
"MissingValue",
";",
"}... | Retrieve a relationship if it has been loaded.
@param string $relationship
@param mixed $value
@param mixed $default
@return \Illuminate\Http\Resources\MissingValue|mixed | [
"Retrieve",
"a",
"relationship",
"if",
"it",
"has",
"been",
"loaded",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Http/Resources/ConditionallyLoadsAttributes.php#L155-L174 | train | When loaded returns the value of the relationship | [
30522,
5123,
3853,
2043,
17468,
1006,
1002,
3276,
1010,
1002,
3643,
1027,
19701,
1010,
1002,
12398,
1027,
19701,
1007,
1063,
2065,
1006,
4569,
2278,
1035,
16371,
2213,
1035,
12098,
5620,
1006,
1007,
1026,
1017,
1007,
1063,
1002,
12398,
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/Foundation/Bootstrap/LoadConfiguration.php | LoadConfiguration.bootstrap | public function bootstrap(Application $app)
{
$items = [];
// First we will see if we have a cache configuration file. If we do, we'll load
// the configuration items from that file so that it is very quick. Otherwise
// we will need to spin through every configuration file and load... | php | public function bootstrap(Application $app)
{
$items = [];
// First we will see if we have a cache configuration file. If we do, we'll load
// the configuration items from that file so that it is very quick. Otherwise
// we will need to spin through every configuration file and load... | [
"public",
"function",
"bootstrap",
"(",
"Application",
"$",
"app",
")",
"{",
"$",
"items",
"=",
"[",
"]",
";",
"// First we will see if we have a cache configuration file. If we do, we'll load",
"// the configuration items from that file so that it is very quick. Otherwise",
"// we... | Bootstrap the given application.
@param \Illuminate\Contracts\Foundation\Application $app
@return void | [
"Bootstrap",
"the",
"given",
"application",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php#L20-L52 | train | Bootstraps the application. | [
30522,
2270,
3853,
6879,
6494,
2361,
1006,
4646,
1002,
10439,
1007,
1063,
1002,
5167,
1027,
1031,
1033,
1025,
1013,
1013,
2034,
2057,
2097,
2156,
2065,
2057,
2031,
1037,
17053,
9563,
5371,
1012,
2065,
2057,
2079,
1010,
2057,
1005,
2222,
7... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Bundle/TwigBundle/CacheWarmer/TemplateCacheWarmer.php | TemplateCacheWarmer.warmUp | public function warmUp($cacheDir)
{
if (null === $this->twig) {
$this->twig = $this->container->get('twig');
}
foreach ($this->iterator as $template) {
try {
$this->twig->loadTemplate($template);
} catch (Error $e) {
// pro... | php | public function warmUp($cacheDir)
{
if (null === $this->twig) {
$this->twig = $this->container->get('twig');
}
foreach ($this->iterator as $template) {
try {
$this->twig->loadTemplate($template);
} catch (Error $e) {
// pro... | [
"public",
"function",
"warmUp",
"(",
"$",
"cacheDir",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"twig",
")",
"{",
"$",
"this",
"->",
"twig",
"=",
"$",
"this",
"->",
"container",
"->",
"get",
"(",
"'twig'",
")",
";",
"}",
"foreach",
"... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bundle/TwigBundle/CacheWarmer/TemplateCacheWarmer.php#L41-L55 | train | Warms up the twig template iterator | [
30522,
2270,
3853,
4010,
6279,
1006,
1002,
17053,
4305,
2099,
1007,
1063,
2065,
1006,
19701,
1027,
1027,
1027,
1002,
2023,
1011,
1028,
1056,
16279,
1007,
1063,
1002,
2023,
1011,
1028,
1056,
16279,
1027,
1002,
2023,
1011,
1028,
11661,
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/DependencyInjection/Definition.php | Definition.setDecoratedService | public function setDecoratedService($id, $renamedId = null, $priority = 0)
{
if ($renamedId && $id === $renamedId) {
throw new InvalidArgumentException(sprintf('The decorated service inner name for "%s" must be different than the service name itself.', $id));
}
$this->changes['d... | php | public function setDecoratedService($id, $renamedId = null, $priority = 0)
{
if ($renamedId && $id === $renamedId) {
throw new InvalidArgumentException(sprintf('The decorated service inner name for "%s" must be different than the service name itself.', $id));
}
$this->changes['d... | [
"public",
"function",
"setDecoratedService",
"(",
"$",
"id",
",",
"$",
"renamedId",
"=",
"null",
",",
"$",
"priority",
"=",
"0",
")",
"{",
"if",
"(",
"$",
"renamedId",
"&&",
"$",
"id",
"===",
"$",
"renamedId",
")",
"{",
"throw",
"new",
"InvalidArgument... | Sets the service that this service is decorating.
@param string|null $id The decorated service id, use null to remove decoration
@param string|null $renamedId The new decorated service id
@param int $priority The priority of decoration
@return $this
@throws InvalidArgumentException in case the decora... | [
"Sets",
"the",
"service",
"that",
"this",
"service",
"is",
"decorating",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/DependencyInjection/Definition.php#L138-L153 | train | Set the decorated service name | [
30522,
2270,
3853,
2275,
3207,
27108,
4383,
8043,
7903,
2063,
1006,
1002,
8909,
1010,
1002,
4096,
3593,
1027,
19701,
1010,
1002,
9470,
1027,
1014,
1007,
1063,
2065,
1006,
1002,
4096,
3593,
1004,
1004,
1002,
8909,
1027,
1027,
1027,
1002,
4... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Form/Extension/DataCollector/FormDataCollector.php | FormDataCollector.buildFinalFormTree | public function buildFinalFormTree(FormInterface $form, FormView $view)
{
$this->data['forms'][$form->getName()] = &$this->recursiveBuildFinalFormTree($form, $view, $this->data['forms_by_hash']);
} | php | public function buildFinalFormTree(FormInterface $form, FormView $view)
{
$this->data['forms'][$form->getName()] = &$this->recursiveBuildFinalFormTree($form, $view, $this->data['forms_by_hash']);
} | [
"public",
"function",
"buildFinalFormTree",
"(",
"FormInterface",
"$",
"form",
",",
"FormView",
"$",
"view",
")",
"{",
"$",
"this",
"->",
"data",
"[",
"'forms'",
"]",
"[",
"$",
"form",
"->",
"getName",
"(",
")",
"]",
"=",
"&",
"$",
"this",
"->",
"rec... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/Extension/DataCollector/FormDataCollector.php#L213-L216 | train | Recursive build final form tree | [
30522,
2270,
3853,
3857,
16294,
2389,
14192,
13334,
1006,
2433,
18447,
2121,
12172,
1002,
2433,
1010,
2433,
8584,
1002,
3193,
1007,
1063,
1002,
2023,
1011,
1028,
2951,
1031,
1005,
3596,
1005,
1033,
1031,
1002,
2433,
1011,
1028,
2131,
18442,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
dompdf/dompdf | lib/html5lib/InputStream.php | HTML5_InputStream.getColumnOffset | public function getColumnOffset() {
// strrpos is weird, and the offset needs to be negative for what we
// want (i.e., the last \n before $this->char). This needs to not have
// one (to make it point to the next character, the one we want the
// position of) added to it because strrpos'... | php | public function getColumnOffset() {
// strrpos is weird, and the offset needs to be negative for what we
// want (i.e., the last \n before $this->char). This needs to not have
// one (to make it point to the next character, the one we want the
// position of) added to it because strrpos'... | [
"public",
"function",
"getColumnOffset",
"(",
")",
"{",
"// strrpos is weird, and the offset needs to be negative for what we",
"// want (i.e., the last \\n before $this->char). This needs to not have",
"// one (to make it point to the next character, the one we want the",
"// position of) added t... | Returns the current column of the current line that the tokenizer is at.
@return int | [
"Returns",
"the",
"current",
"column",
"of",
"the",
"current",
"line",
"that",
"the",
"tokenizer",
"is",
"at",
"."
] | 75f13c700009be21a1965dc2c5b68a8708c22ba2 | https://github.com/dompdf/dompdf/blob/75f13c700009be21a1965dc2c5b68a8708c22ba2/lib/html5lib/InputStream.php#L185-L215 | train | Get the column offset for the current character | [
30522,
2270,
3853,
2131,
25778,
2819,
3630,
21807,
3388,
1006,
1007,
1063,
1013,
1013,
2358,
12171,
6873,
2015,
2003,
6881,
1010,
1998,
1996,
16396,
3791,
2000,
2022,
4997,
2005,
2054,
2057,
1013,
1013,
2215,
1006,
1045,
1012,
1041,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/CronArchive.php | CronArchive.run | public function run()
{
$timer = new Timer;
$this->logSection("START");
$this->logger->info("Starting Matomo reports archiving...");
$numWebsitesScheduled = $this->websites->getNumSites();
$numWebsitesArchived = 0;
$cliMulti = $this->makeCliMulti();
if ($th... | php | public function run()
{
$timer = new Timer;
$this->logSection("START");
$this->logger->info("Starting Matomo reports archiving...");
$numWebsitesScheduled = $this->websites->getNumSites();
$numWebsitesArchived = 0;
$cliMulti = $this->makeCliMulti();
if ($th... | [
"public",
"function",
"run",
"(",
")",
"{",
"$",
"timer",
"=",
"new",
"Timer",
";",
"$",
"this",
"->",
"logSection",
"(",
"\"START\"",
")",
";",
"$",
"this",
"->",
"logger",
"->",
"info",
"(",
"\"Starting Matomo reports archiving...\"",
")",
";",
"$",
"n... | Main function, runs archiving on all websites with new activity | [
"Main",
"function",
"runs",
"archiving",
"on",
"all",
"websites",
"with",
"new",
"activity"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/CronArchive.php#L377-L543 | train | Archives all reports in the website. | [
30522,
2270,
3853,
2448,
1006,
1007,
1063,
1002,
25309,
1027,
2047,
25309,
1025,
1002,
2023,
1011,
1028,
15664,
18491,
1006,
1000,
2707,
1000,
1007,
1025,
1002,
2023,
1011,
1028,
8833,
4590,
1011,
1028,
18558,
1006,
1000,
3225,
13523,
19506... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Common/Page/Medium/AudioMedium.php | AudioMedium.muted | public function muted($status = false)
{
if($status) {
$this->attributes['muted'] = true;
} else {
unset($this->attributes['muted']);
}
return $this;
} | php | public function muted($status = false)
{
if($status) {
$this->attributes['muted'] = true;
} else {
unset($this->attributes['muted']);
}
return $this;
} | [
"public",
"function",
"muted",
"(",
"$",
"status",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"status",
")",
"{",
"$",
"this",
"->",
"attributes",
"[",
"'muted'",
"]",
"=",
"true",
";",
"}",
"else",
"{",
"unset",
"(",
"$",
"this",
"->",
"attributes",
... | Allows to set the muted attribute
@param bool $status
@return $this | [
"Allows",
"to",
"set",
"the",
"muted",
"attribute"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Page/Medium/AudioMedium.php#L89-L98 | train | Set muted attribute | [
30522,
2270,
3853,
22124,
1006,
1002,
3570,
1027,
6270,
1007,
1063,
2065,
1006,
1002,
3570,
1007,
1063,
1002,
2023,
1011,
1028,
12332,
1031,
1005,
22124,
1005,
1033,
1027,
2995,
1025,
1065,
2842,
1063,
4895,
13462,
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... |
php-ai/php-ml | src/DimensionReduction/KernelPCA.php | KernelPCA.transform | public function transform(array $sample): array
{
if (!$this->fit) {
throw new InvalidOperationException('KernelPCA has not been fitted with respect to original dataset, please run KernelPCA::fit() first');
}
if (is_array($sample[0])) {
throw new InvalidArgumentExcep... | php | public function transform(array $sample): array
{
if (!$this->fit) {
throw new InvalidOperationException('KernelPCA has not been fitted with respect to original dataset, please run KernelPCA::fit() first');
}
if (is_array($sample[0])) {
throw new InvalidArgumentExcep... | [
"public",
"function",
"transform",
"(",
"array",
"$",
"sample",
")",
":",
"array",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"fit",
")",
"{",
"throw",
"new",
"InvalidOperationException",
"(",
"'KernelPCA has not been fitted with respect to original dataset, please run K... | Transforms the given sample to a lower dimensional vector by using
the variables obtained during the last run of <code>fit</code>.
@throws InvalidArgumentException
@throws InvalidOperationException | [
"Transforms",
"the",
"given",
"sample",
"to",
"a",
"lower",
"dimensional",
"vector",
"by",
"using",
"the",
"variables",
"obtained",
"during",
"the",
"last",
"run",
"of",
"<code",
">",
"fit<",
"/",
"code",
">",
"."
] | f6aa1a59b0525b8fca3d2786d661ab3e70904016 | https://github.com/php-ai/php-ml/blob/f6aa1a59b0525b8fca3d2786d661ab3e70904016/src/DimensionReduction/KernelPCA.php#L103-L116 | train | KernelPCA transform - computes the distance matrix for the given sample | [
30522,
2270,
3853,
10938,
1006,
9140,
1002,
7099,
1007,
1024,
9140,
1063,
2065,
1006,
999,
1002,
2023,
1011,
1028,
4906,
1007,
1063,
5466,
2047,
19528,
25918,
3370,
10288,
24422,
1006,
1005,
16293,
15042,
2050,
2038,
2025,
2042,
7130,
2007,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Pagination/AbstractPaginator.php | AbstractPaginator.appends | public function appends($key, $value = null)
{
if (is_null($key)) {
return $this;
}
if (is_array($key)) {
return $this->appendArray($key);
}
return $this->addQuery($key, $value);
} | php | public function appends($key, $value = null)
{
if (is_null($key)) {
return $this;
}
if (is_array($key)) {
return $this->appendArray($key);
}
return $this->addQuery($key, $value);
} | [
"public",
"function",
"appends",
"(",
"$",
"key",
",",
"$",
"value",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"key",
")",
")",
"{",
"return",
"$",
"this",
";",
"}",
"if",
"(",
"is_array",
"(",
"$",
"key",
")",
")",
"{",
"return",
... | Add a set of query string values to the paginator.
@param array|string|null $key
@param string|null $value
@return $this | [
"Add",
"a",
"set",
"of",
"query",
"string",
"values",
"to",
"the",
"paginator",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Pagination/AbstractPaginator.php#L205-L216 | train | Append a value to the query string | [
30522,
2270,
3853,
10439,
10497,
2015,
1006,
1002,
3145,
1010,
1002,
3643,
1027,
19701,
1007,
1063,
2065,
1006,
2003,
1035,
19701,
1006,
1002,
3145,
1007,
1007,
1063,
2709,
1002,
2023,
1025,
1065,
2065,
1006,
2003,
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... |
symfony/symfony | src/Symfony/Bridge/Twig/TokenParser/TransDefaultDomainTokenParser.php | TransDefaultDomainTokenParser.parse | public function parse(Token $token)
{
$expr = $this->parser->getExpressionParser()->parseExpression();
$this->parser->getStream()->expect(Token::BLOCK_END_TYPE);
return new TransDefaultDomainNode($expr, $token->getLine(), $this->getTag());
} | php | public function parse(Token $token)
{
$expr = $this->parser->getExpressionParser()->parseExpression();
$this->parser->getStream()->expect(Token::BLOCK_END_TYPE);
return new TransDefaultDomainNode($expr, $token->getLine(), $this->getTag());
} | [
"public",
"function",
"parse",
"(",
"Token",
"$",
"token",
")",
"{",
"$",
"expr",
"=",
"$",
"this",
"->",
"parser",
"->",
"getExpressionParser",
"(",
")",
"->",
"parseExpression",
"(",
")",
";",
"$",
"this",
"->",
"parser",
"->",
"getStream",
"(",
")",... | Parses a token and returns a node.
@return Node | [
"Parses",
"a",
"token",
"and",
"returns",
"a",
"node",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bridge/Twig/TokenParser/TransDefaultDomainTokenParser.php#L31-L38 | train | Parse a TransDefaultDomainNode | [
30522,
2270,
3853,
11968,
3366,
1006,
19204,
1002,
19204,
1007,
1063,
1002,
4654,
18098,
1027,
1002,
2023,
1011,
1028,
11968,
8043,
1011,
1028,
2131,
10288,
20110,
3258,
19362,
8043,
1006,
1007,
1011,
1028,
11968,
19763,
2595,
20110,
3258,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Serializer/Normalizer/AbstractObjectNormalizer.php | AbstractObjectNormalizer.validateAndDenormalize | private function validateAndDenormalize(string $currentClass, string $attribute, $data, ?string $format, array $context)
{
if (null === $types = $this->getTypes($currentClass, $attribute)) {
return $data;
}
$expectedTypes = [];
foreach ($types as $type) {
if ... | php | private function validateAndDenormalize(string $currentClass, string $attribute, $data, ?string $format, array $context)
{
if (null === $types = $this->getTypes($currentClass, $attribute)) {
return $data;
}
$expectedTypes = [];
foreach ($types as $type) {
if ... | [
"private",
"function",
"validateAndDenormalize",
"(",
"string",
"$",
"currentClass",
",",
"string",
"$",
"attribute",
",",
"$",
"data",
",",
"?",
"string",
"$",
"format",
",",
"array",
"$",
"context",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"types",
"="... | Validates the submitted data and denormalizes it.
@param mixed $data
@return mixed
@throws NotNormalizableValueException
@throws LogicException | [
"Validates",
"the",
"submitted",
"data",
"and",
"denormalizes",
"it",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Serializer/Normalizer/AbstractObjectNormalizer.php#L390-L453 | train | Validate and denormalize data | [
30522,
2797,
3853,
9398,
3686,
5685,
4181,
2953,
9067,
4697,
1006,
5164,
1002,
2783,
26266,
1010,
5164,
1002,
17961,
1010,
1002,
2951,
1010,
1029,
5164,
1002,
4289,
1010,
9140,
1002,
6123,
1007,
1063,
2065,
1006,
19701,
1027,
1027,
1027,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/Goals/API.php | API.getItems | protected function getItems($recordName, $idSite, $period, $date, $abandonedCarts, $segment)
{
Piwik::checkUserHasViewAccess($idSite);
$recordNameFinal = $recordName;
if ($abandonedCarts) {
$recordNameFinal = Archiver::getItemRecordNameAbandonedCart($recordName);
}
... | php | protected function getItems($recordName, $idSite, $period, $date, $abandonedCarts, $segment)
{
Piwik::checkUserHasViewAccess($idSite);
$recordNameFinal = $recordName;
if ($abandonedCarts) {
$recordNameFinal = Archiver::getItemRecordNameAbandonedCart($recordName);
}
... | [
"protected",
"function",
"getItems",
"(",
"$",
"recordName",
",",
"$",
"idSite",
",",
"$",
"period",
",",
"$",
"date",
",",
"$",
"abandonedCarts",
",",
"$",
"segment",
")",
"{",
"Piwik",
"::",
"checkUserHasViewAccess",
"(",
"$",
"idSite",
")",
";",
"$",
... | Returns a datatable of Items SKU/name or categories and their metrics
If $abandonedCarts set to 1, will return items abandoned in carts. If set to 0, will return items ordered | [
"Returns",
"a",
"datatable",
"of",
"Items",
"SKU",
"/",
"name",
"or",
"categories",
"and",
"their",
"metrics",
"If",
"$abandonedCarts",
"set",
"to",
"1",
"will",
"return",
"items",
"abandoned",
"in",
"carts",
".",
"If",
"set",
"to",
"0",
"will",
"return",
... | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Goals/API.php#L306-L335 | train | Get Items table | [
30522,
5123,
3853,
2131,
4221,
5244,
1006,
1002,
2501,
18442,
1010,
1002,
8909,
28032,
2063,
1010,
1002,
2558,
1010,
1002,
3058,
1010,
1002,
4704,
10010,
3215,
1010,
1002,
6903,
1007,
1063,
14255,
9148,
2243,
1024,
1024,
4638,
20330,
14949,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php | HasRelationships.newHasOne | protected function newHasOne(Builder $query, Model $parent, $foreignKey, $localKey)
{
return new HasOne($query, $parent, $foreignKey, $localKey);
} | php | protected function newHasOne(Builder $query, Model $parent, $foreignKey, $localKey)
{
return new HasOne($query, $parent, $foreignKey, $localKey);
} | [
"protected",
"function",
"newHasOne",
"(",
"Builder",
"$",
"query",
",",
"Model",
"$",
"parent",
",",
"$",
"foreignKey",
",",
"$",
"localKey",
")",
"{",
"return",
"new",
"HasOne",
"(",
"$",
"query",
",",
"$",
"parent",
",",
"$",
"foreignKey",
",",
"$",... | Instantiate a new HasOne relationship.
@param \Illuminate\Database\Eloquent\Builder $query
@param \Illuminate\Database\Eloquent\Model $parent
@param string $foreignKey
@param string $localKey
@return \Illuminate\Database\Eloquent\Relations\HasOne | [
"Instantiate",
"a",
"new",
"HasOne",
"relationship",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php#L75-L78 | train | Creates a new HasOne | [
30522,
5123,
3853,
2047,
14949,
5643,
1006,
12508,
1002,
23032,
1010,
2944,
1002,
6687,
1010,
1002,
3097,
14839,
1010,
1002,
2334,
14839,
1007,
1063,
2709,
2047,
30524,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Http/UploadedFile.php | UploadedFile.storePubliclyAs | public function storePubliclyAs($path, $name, $options = [])
{
$options = $this->parseOptions($options);
$options['visibility'] = 'public';
return $this->storeAs($path, $name, $options);
} | php | public function storePubliclyAs($path, $name, $options = [])
{
$options = $this->parseOptions($options);
$options['visibility'] = 'public';
return $this->storeAs($path, $name, $options);
} | [
"public",
"function",
"storePubliclyAs",
"(",
"$",
"path",
",",
"$",
"name",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"options",
"=",
"$",
"this",
"->",
"parseOptions",
"(",
"$",
"options",
")",
";",
"$",
"options",
"[",
"'visibility'",
"]"... | Store the uploaded file on a filesystem disk with public visibility.
@param string $path
@param string $name
@param array|string $options
@return string|false | [
"Store",
"the",
"uploaded",
"file",
"on",
"a",
"filesystem",
"disk",
"with",
"public",
"visibility",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Http/UploadedFile.php#L62-L69 | train | Stores the current page to the specified path and name in the public visibility of the current page. | [
30522,
2270,
3853,
3573,
14289,
16558,
2594,
2135,
3022,
1006,
1002,
4130,
1010,
1002,
2171,
1010,
1002,
7047,
1027,
1031,
1033,
1007,
1063,
1002,
7047,
1027,
1002,
2023,
1011,
1028,
11968,
3366,
7361,
9285,
1006,
1002,
7047,
1007,
1025,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/Zend/Db/Adapter/Pdo/Ibm.php | Zend_Db_Adapter_Pdo_Ibm._connect | public function _connect()
{
if ($this->_connection) {
return;
}
parent::_connect();
$this->getConnection()->setAttribute(Zend_Db::ATTR_STRINGIFY_FETCHES, true);
try {
if ($this->_serverType === null) {
$server = substr($this->getConn... | php | public function _connect()
{
if ($this->_connection) {
return;
}
parent::_connect();
$this->getConnection()->setAttribute(Zend_Db::ATTR_STRINGIFY_FETCHES, true);
try {
if ($this->_serverType === null) {
$server = substr($this->getConn... | [
"public",
"function",
"_connect",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_connection",
")",
"{",
"return",
";",
"}",
"parent",
"::",
"_connect",
"(",
")",
";",
"$",
"this",
"->",
"getConnection",
"(",
")",
"->",
"setAttribute",
"(",
"Zend_Db",
... | Creates a PDO object and connects to the database.
The IBM data server is set.
Current options are DB2 or IDS
@todo also differentiate between z/OS and i/5
@return void
@throws Zend_Db_Adapter_Exception | [
"Creates",
"a",
"PDO",
"object",
"and",
"connects",
"to",
"the",
"database",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Adapter/Pdo/Ibm.php#L96-L142 | train | Connect to the database | [
30522,
2270,
3853,
1035,
7532,
1006,
1007,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
1035,
4434,
1007,
1063,
2709,
1025,
1065,
6687,
1024,
1024,
1035,
7532,
1006,
1007,
1025,
1002,
2023,
1011,
1028,
2131,
8663,
2638,
7542,
1006,
1007,
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... |
matomo-org/matomo | libs/HTML/QuickForm2/Controller/SessionContainer.php | HTML_QuickForm2_Controller_SessionContainer.storeOpaque | public function storeOpaque($name, $value)
{
if (!array_key_exists('opaque', $this->data)) {
$this->data['opaque'] = array();
}
$this->data['opaque'][$name] = $value;
} | php | public function storeOpaque($name, $value)
{
if (!array_key_exists('opaque', $this->data)) {
$this->data['opaque'] = array();
}
$this->data['opaque'][$name] = $value;
} | [
"public",
"function",
"storeOpaque",
"(",
"$",
"name",
",",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"'opaque'",
",",
"$",
"this",
"->",
"data",
")",
")",
"{",
"$",
"this",
"->",
"data",
"[",
"'opaque'",
"]",
"=",
"array",
"... | Stores some user-supplied parameter alongside controller data
It is sometimes useful to pass some additional user data between pages
of the form, thus this method. It will be removed with all the other
data by {@link HTML_QuickForm2_Controller::destroySessionContainer()}
@param string Parameter name
@param str... | [
"Stores",
"some",
"user",
"-",
"supplied",
"parameter",
"alongside",
"controller",
"data"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Controller/SessionContainer.php#L175-L181 | train | Stores a value in the opaque array | [
30522,
2270,
3853,
3573,
29477,
4226,
1006,
1002,
2171,
1010,
1002,
3643,
1007,
1063,
2065,
1006,
999,
9140,
1035,
3145,
1035,
6526,
1006,
1005,
28670,
1005,
1010,
1002,
2023,
1011,
1028,
2951,
1007,
1007,
1063,
1002,
2023,
1011,
1028,
29... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/cms/classes/Asset.php | Asset.getFilePath | public function getFilePath($fileName = null)
{
if ($fileName === null) {
$fileName = $this->fileName;
}
return $this->theme->getPath().'/'.$this->dirName.'/'.$fileName;
} | php | public function getFilePath($fileName = null)
{
if ($fileName === null) {
$fileName = $this->fileName;
}
return $this->theme->getPath().'/'.$this->dirName.'/'.$fileName;
} | [
"public",
"function",
"getFilePath",
"(",
"$",
"fileName",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"fileName",
"===",
"null",
")",
"{",
"$",
"fileName",
"=",
"$",
"this",
"->",
"fileName",
";",
"}",
"return",
"$",
"this",
"->",
"theme",
"->",
"getPath... | Returns the absolute file path.
@param string $fileName Specifies the file name to return the path to.
@return string | [
"Returns",
"the",
"absolute",
"file",
"path",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/Asset.php#L282-L289 | train | Get file path | [
30522,
2270,
3853,
2131,
8873,
2571,
15069,
1006,
1002,
5371,
18442,
1027,
19701,
1007,
1063,
2065,
1006,
1002,
5371,
18442,
1027,
1027,
1027,
19701,
1007,
1063,
1002,
5371,
18442,
1027,
1002,
2023,
1011,
1028,
5371,
18442,
1025,
1065,
2709... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Serializer/Mapping/Loader/XmlFileLoader.php | XmlFileLoader.getMappedClasses | public function getMappedClasses()
{
if (null === $this->classes) {
$this->classes = $this->getClassesFromXml();
}
return array_keys($this->classes);
} | php | public function getMappedClasses()
{
if (null === $this->classes) {
$this->classes = $this->getClassesFromXml();
}
return array_keys($this->classes);
} | [
"public",
"function",
"getMappedClasses",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"classes",
")",
"{",
"$",
"this",
"->",
"classes",
"=",
"$",
"this",
"->",
"getClassesFromXml",
"(",
")",
";",
"}",
"return",
"array_keys",
"(",
"$",
... | Return the names of the classes mapped in this file.
@return string[] The classes names | [
"Return",
"the",
"names",
"of",
"the",
"classes",
"mapped",
"in",
"this",
"file",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Serializer/Mapping/Loader/XmlFileLoader.php#L99-L106 | train | Get all classes mapped in the tree | [
30522,
2270,
3853,
2131,
2863,
11469,
26266,
2229,
1006,
1007,
1063,
2065,
1006,
19701,
1027,
1027,
1027,
1002,
2023,
1011,
1028,
4280,
1007,
1063,
1002,
2023,
1011,
1028,
4280,
1027,
1002,
2023,
1011,
1028,
2131,
26266,
2229,
19699,
5358,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/ViewDataTable/Factory.php | Factory.getReport | private static function getReport($apiAction)
{
if (strpos($apiAction, '.') === false) {
return;
}
list($module, $action) = explode('.', $apiAction);
$report = ReportsProvider::factory($module, $action);
return $report;
} | php | private static function getReport($apiAction)
{
if (strpos($apiAction, '.') === false) {
return;
}
list($module, $action) = explode('.', $apiAction);
$report = ReportsProvider::factory($module, $action);
return $report;
} | [
"private",
"static",
"function",
"getReport",
"(",
"$",
"apiAction",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"apiAction",
",",
"'.'",
")",
"===",
"false",
")",
"{",
"return",
";",
"}",
"list",
"(",
"$",
"module",
",",
"$",
"action",
")",
"=",
"exp... | Return the report object for the given apiAction
@param $apiAction
@return null|Report | [
"Return",
"the",
"report",
"object",
"for",
"the",
"given",
"apiAction"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/ViewDataTable/Factory.php#L175-L184 | train | Get the report | [
30522,
2797,
10763,
3853,
2131,
2890,
6442,
1006,
1002,
17928,
18908,
3258,
1007,
1063,
2065,
1006,
2358,
14536,
2891,
1006,
1002,
17928,
18908,
3258,
1010,
1005,
1012,
1005,
1007,
1027,
1027,
1027,
6270,
1007,
1063,
2709,
1025,
1065,
2862,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/Zend/Validate.php | Zend_Validate.isValid | public function isValid($value)
{
$this->_messages = array();
$this->_errors = array();
$result = true;
foreach ($this->_validators as $element) {
$validator = $element['instance'];
if ($validator->isValid($value)) {
continue;
}
... | php | public function isValid($value)
{
$this->_messages = array();
$this->_errors = array();
$result = true;
foreach ($this->_validators as $element) {
$validator = $element['instance'];
if ($validator->isValid($value)) {
continue;
}
... | [
"public",
"function",
"isValid",
"(",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"_messages",
"=",
"array",
"(",
")",
";",
"$",
"this",
"->",
"_errors",
"=",
"array",
"(",
")",
";",
"$",
"result",
"=",
"true",
";",
"foreach",
"(",
"$",
"this",
"-... | Returns true if and only if $value passes all validations in the chain
Validators are run in the order in which they were added to the chain (FIFO).
@param mixed $value
@return boolean | [
"Returns",
"true",
"if",
"and",
"only",
"if",
"$value",
"passes",
"all",
"validations",
"in",
"the",
"chain"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Validate.php#L91-L110 | train | Returns true if the value is valid for all validators | [
30522,
2270,
30524,
6776,
1006,
1002,
2023,
1011,
1028,
1035,
9398,
18926,
2004,
1002,
5783,
1007,
1063,
1002,
9398,
8844,
1027,
1002,
5783,
1031,
1005,
6013,
1005,
1033,
1025,
2065,
1006,
1002,
9398,
8844,
1011,
1028,
2003,
10175,
3593,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/ModelNotFoundException.php | ModelNotFoundException.setModel | public function setModel($model, $ids = [])
{
$this->model = $model;
$this->ids = Arr::wrap($ids);
$this->message = "No query results for model [{$model}]";
if (count($this->ids) > 0) {
$this->message .= ' '.implode(', ', $this->ids);
} else {
$this-... | php | public function setModel($model, $ids = [])
{
$this->model = $model;
$this->ids = Arr::wrap($ids);
$this->message = "No query results for model [{$model}]";
if (count($this->ids) > 0) {
$this->message .= ' '.implode(', ', $this->ids);
} else {
$this-... | [
"public",
"function",
"setModel",
"(",
"$",
"model",
",",
"$",
"ids",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"model",
"=",
"$",
"model",
";",
"$",
"this",
"->",
"ids",
"=",
"Arr",
"::",
"wrap",
"(",
"$",
"ids",
")",
";",
"$",
"this",
"->... | Set the affected Eloquent model and instance ids.
@param string $model
@param int|array $ids
@return $this | [
"Set",
"the",
"affected",
"Eloquent",
"model",
"and",
"instance",
"ids",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/ModelNotFoundException.php#L31-L45 | train | Set Model and ids | [
30522,
2270,
3853,
2275,
5302,
9247,
1006,
1002,
2944,
1010,
1002,
8909,
2015,
1027,
1031,
1033,
1007,
1063,
1002,
2023,
1011,
1028,
2944,
1027,
1002,
2944,
1025,
1002,
2023,
1011,
1028,
8909,
2015,
1027,
12098,
2099,
1024,
1024,
10236,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Console/Gpm/InstallCommand.php | InstallCommand.getGitRegexMatches | private function getGitRegexMatches($package)
{
if (isset($package->repository)) {
$repository = $package->repository;
} else {
return false;
}
preg_match(GIT_REGEX, $repository, $matches);
return $matches;
} | php | private function getGitRegexMatches($package)
{
if (isset($package->repository)) {
$repository = $package->repository;
} else {
return false;
}
preg_match(GIT_REGEX, $repository, $matches);
return $matches;
} | [
"private",
"function",
"getGitRegexMatches",
"(",
"$",
"package",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"package",
"->",
"repository",
")",
")",
"{",
"$",
"repository",
"=",
"$",
"package",
"->",
"repository",
";",
"}",
"else",
"{",
"return",
"false",
... | @param Package $package
@return array|bool | [
"@param",
"Package",
"$package"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Console/Gpm/InstallCommand.php#L420-L431 | train | Get the GIT_REGEX_MATCHES array | [
30522,
2797,
3853,
2131,
23806,
2890,
3351,
2595,
18900,
8376,
1006,
1002,
7427,
1007,
1063,
2065,
1006,
26354,
3388,
1006,
1002,
7427,
1011,
1028,
22409,
1007,
1007,
1063,
1002,
22409,
1027,
1002,
7427,
1011,
1028,
22409,
1025,
1065,
2842,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Validation/Concerns/ReplacesAttributes.php | ReplacesAttributes.replaceNotIn | protected function replaceNotIn($message, $attribute, $rule, $parameters)
{
return $this->replaceIn($message, $attribute, $rule, $parameters);
} | php | protected function replaceNotIn($message, $attribute, $rule, $parameters)
{
return $this->replaceIn($message, $attribute, $rule, $parameters);
} | [
"protected",
"function",
"replaceNotIn",
"(",
"$",
"message",
",",
"$",
"attribute",
",",
"$",
"rule",
",",
"$",
"parameters",
")",
"{",
"return",
"$",
"this",
"->",
"replaceIn",
"(",
"$",
"message",
",",
"$",
"attribute",
",",
"$",
"rule",
",",
"$",
... | Replace all place-holders for the not_in rule.
@param string $message
@param string $attribute
@param string $rule
@param array $parameters
@return string | [
"Replace",
"all",
"place",
"-",
"holders",
"for",
"the",
"not_in",
"rule",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Validation/Concerns/ReplacesAttributes.php#L134-L137 | train | Replace all occurrences of a NOT IN rule in a phrase | [
30522,
5123,
3853,
5672,
17048,
2378,
1006,
1002,
4471,
1010,
1002,
17961,
1010,
1002,
3627,
1010,
1002,
11709,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
5672,
2378,
1006,
1002,
4471,
1010,
1002,
17961,
1010,
1002,
3627,
1010,
1002,
11709,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/View/OneClickDone.php | OneClickDone.render | public function render()
{
// set response headers
@Common::stripHeader('Pragma');
@Common::stripHeader('Expires');
@Common::sendHeader('Content-Type: text/html; charset=UTF-8');
@Common::sendHeader('Cache-Control: must-revalidate');
@Common::sendHeader('X-Frame-Optio... | php | public function render()
{
// set response headers
@Common::stripHeader('Pragma');
@Common::stripHeader('Expires');
@Common::sendHeader('Content-Type: text/html; charset=UTF-8');
@Common::sendHeader('Cache-Control: must-revalidate');
@Common::sendHeader('X-Frame-Optio... | [
"public",
"function",
"render",
"(",
")",
"{",
"// set response headers",
"@",
"Common",
"::",
"stripHeader",
"(",
"'Pragma'",
")",
";",
"@",
"Common",
"::",
"stripHeader",
"(",
"'Expires'",
")",
";",
"@",
"Common",
"::",
"sendHeader",
"(",
"'Content-Type: tex... | Outputs the data.
@return string html | [
"Outputs",
"the",
"data",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/View/OneClickDone.php#L59-L98 | train | Render the response | [
30522,
2270,
3853,
17552,
1006,
1007,
1063,
1013,
1013,
2275,
3433,
20346,
2015,
1030,
2691,
1024,
1024,
6167,
4974,
2121,
1006,
1005,
10975,
8490,
2863,
1005,
1007,
1025,
1030,
2691,
1024,
1024,
6167,
4974,
2121,
1006,
1005,
4654,
20781,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.compileDelete | public function compileDelete(Builder $query)
{
$wheres = is_array($query->wheres) ? $this->compileWheres($query) : '';
return trim("delete from {$this->wrapTable($query->from)} $wheres");
} | php | public function compileDelete(Builder $query)
{
$wheres = is_array($query->wheres) ? $this->compileWheres($query) : '';
return trim("delete from {$this->wrapTable($query->from)} $wheres");
} | [
"public",
"function",
"compileDelete",
"(",
"Builder",
"$",
"query",
")",
"{",
"$",
"wheres",
"=",
"is_array",
"(",
"$",
"query",
"->",
"wheres",
")",
"?",
"$",
"this",
"->",
"compileWheres",
"(",
"$",
"query",
")",
":",
"''",
";",
"return",
"trim",
... | Compile a delete statement into SQL.
@param \Illuminate\Database\Query\Builder $query
@return string | [
"Compile",
"a",
"delete",
"statement",
"into",
"SQL",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Query/Grammars/Grammar.php#L958-L963 | train | Compiles a delete query into a string | [
30522,
2270,
3853,
9227,
12260,
2618,
1006,
12508,
1002,
23032,
1007,
1063,
1002,
2073,
2015,
1027,
2003,
1035,
9140,
1006,
1002,
23032,
1011,
1028,
2073,
2015,
1007,
1029,
1002,
2023,
1011,
1028,
4012,
22090,
2860,
5886,
2229,
1006,
1002,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php | HasRelationships.hasOneThrough | public function hasOneThrough($related, $through, $firstKey = null, $secondKey = null, $localKey = null, $secondLocalKey = null)
{
$through = new $through;
$firstKey = $firstKey ?: $this->getForeignKey();
$secondKey = $secondKey ?: $through->getForeignKey();
return $this->newHasOn... | php | public function hasOneThrough($related, $through, $firstKey = null, $secondKey = null, $localKey = null, $secondLocalKey = null)
{
$through = new $through;
$firstKey = $firstKey ?: $this->getForeignKey();
$secondKey = $secondKey ?: $through->getForeignKey();
return $this->newHasOn... | [
"public",
"function",
"hasOneThrough",
"(",
"$",
"related",
",",
"$",
"through",
",",
"$",
"firstKey",
"=",
"null",
",",
"$",
"secondKey",
"=",
"null",
",",
"$",
"localKey",
"=",
"null",
",",
"$",
"secondLocalKey",
"=",
"null",
")",
"{",
"$",
"through"... | Define a has-one-through relationship.
@param string $related
@param string $through
@param string|null $firstKey
@param string|null $secondKey
@param string|null $localKey
@param string|null $secondLocalKey
@return \Illuminate\Database\Eloquent\Relations\HasOneThrough | [
"Define",
"a",
"has",
"-",
"one",
"-",
"through",
"relationship",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php#L91-L104 | train | Return a has - one - through relationship | [
30522,
2270,
3853,
2038,
5643,
2705,
22494,
5603,
1006,
1002,
3141,
1010,
1002,
2083,
1010,
1002,
2034,
14839,
1027,
19701,
1010,
1002,
2117,
14839,
1027,
19701,
1010,
1002,
2334,
14839,
1027,
19701,
1010,
1002,
2117,
4135,
9289,
14839,
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... |
walkor/Workerman | Protocols/Frame.php | Frame.input | public static function input($buffer, TcpConnection $connection)
{
if (strlen($buffer) < 4) {
return 0;
}
$unpack_data = unpack('Ntotal_length', $buffer);
return $unpack_data['total_length'];
} | php | public static function input($buffer, TcpConnection $connection)
{
if (strlen($buffer) < 4) {
return 0;
}
$unpack_data = unpack('Ntotal_length', $buffer);
return $unpack_data['total_length'];
} | [
"public",
"static",
"function",
"input",
"(",
"$",
"buffer",
",",
"TcpConnection",
"$",
"connection",
")",
"{",
"if",
"(",
"strlen",
"(",
"$",
"buffer",
")",
"<",
"4",
")",
"{",
"return",
"0",
";",
"}",
"$",
"unpack_data",
"=",
"unpack",
"(",
"'Ntota... | Check the integrity of the package.
@param string $buffer
@param TcpConnection $connection
@return int | [
"Check",
"the",
"integrity",
"of",
"the",
"package",
"."
] | 13649907f05014fcfffcfccaef01e63ad3339351 | https://github.com/walkor/Workerman/blob/13649907f05014fcfffcfccaef01e63ad3339351/Protocols/Frame.php#L30-L37 | train | This function is used to determine the number of bytes the server should accept. | [
30522,
2270,
10763,
3853,
7953,
1006,
1002,
17698,
1010,
22975,
15042,
18256,
7542,
1002,
4434,
1007,
1063,
2065,
1006,
2358,
20927,
2078,
1006,
1002,
17698,
1007,
1026,
1018,
1007,
1063,
2709,
1014,
1025,
1065,
1002,
4895,
23947,
1035,
295... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Translation/ArrayLoader.php | ArrayLoader.addMessages | public function addMessages($locale, $group, array $messages, $namespace = null)
{
$namespace = $namespace ?: '*';
$this->messages[$namespace][$locale][$group] = $messages;
return $this;
} | php | public function addMessages($locale, $group, array $messages, $namespace = null)
{
$namespace = $namespace ?: '*';
$this->messages[$namespace][$locale][$group] = $messages;
return $this;
} | [
"public",
"function",
"addMessages",
"(",
"$",
"locale",
",",
"$",
"group",
",",
"array",
"$",
"messages",
",",
"$",
"namespace",
"=",
"null",
")",
"{",
"$",
"namespace",
"=",
"$",
"namespace",
"?",
":",
"'*'",
";",
"$",
"this",
"->",
"messages",
"["... | Add messages to the loader.
@param string $locale
@param string $group
@param array $messages
@param string|null $namespace
@return $this | [
"Add",
"messages",
"to",
"the",
"loader",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Translation/ArrayLoader.php#L63-L70 | train | Add messages to the namespace | [
30522,
2270,
3853,
5587,
7834,
3736,
8449,
1006,
1002,
2334,
2063,
1010,
1002,
2177,
1010,
9140,
1002,
7696,
1010,
1002,
3415,
15327,
1027,
19701,
1007,
1063,
1002,
3415,
15327,
1027,
1002,
3415,
15327,
1029,
1024,
1005,
1008,
1005,
1025,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Queue/Console/ListenCommand.php | ListenCommand.gatherOptions | protected function gatherOptions()
{
return new ListenerOptions(
$this->option('env'), $this->option('delay'),
$this->option('memory'), $this->option('timeout'),
$this->option('sleep'), $this->option('tries'),
$this->option('force')
);
} | php | protected function gatherOptions()
{
return new ListenerOptions(
$this->option('env'), $this->option('delay'),
$this->option('memory'), $this->option('timeout'),
$this->option('sleep'), $this->option('tries'),
$this->option('force')
);
} | [
"protected",
"function",
"gatherOptions",
"(",
")",
"{",
"return",
"new",
"ListenerOptions",
"(",
"$",
"this",
"->",
"option",
"(",
"'env'",
")",
",",
"$",
"this",
"->",
"option",
"(",
"'delay'",
")",
",",
"$",
"this",
"->",
"option",
"(",
"'memory'",
... | Get the listener options for the command.
@return \Illuminate\Queue\ListenerOptions | [
"Get",
"the",
"listener",
"options",
"for",
"the",
"command",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Queue/Console/ListenCommand.php#L92-L100 | train | Gathers options for listener | [
30522,
5123,
3853,
8587,
7361,
9285,
1006,
1007,
1063,
2709,
2047,
19373,
7361,
9285,
1006,
1002,
2023,
1011,
1028,
5724,
1006,
1005,
4372,
2615,
1005,
1007,
1010,
1002,
2023,
1011,
1028,
5724,
1006,
1005,
8536,
1005,
1007,
1010,
1002,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Command/CacheWarmupCommand.php | CacheWarmupCommand.execute | protected function execute(InputInterface $input, OutputInterface $output)
{
$io = new SymfonyStyle($input, $output);
$kernel = $this->getApplication()->getKernel();
$io->comment(sprintf('Warming up the cache for the <info>%s</info> environment with debug <info>%s</info>', $kernel->getEnvir... | php | protected function execute(InputInterface $input, OutputInterface $output)
{
$io = new SymfonyStyle($input, $output);
$kernel = $this->getApplication()->getKernel();
$io->comment(sprintf('Warming up the cache for the <info>%s</info> environment with debug <info>%s</info>', $kernel->getEnvir... | [
"protected",
"function",
"execute",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"io",
"=",
"new",
"SymfonyStyle",
"(",
"$",
"input",
",",
"$",
"output",
")",
";",
"$",
"kernel",
"=",
"$",
"this",
"->",
"ge... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bundle/FrameworkBundle/Command/CacheWarmupCommand.php#L69-L83 | train | Warms up the cache for the current environment | [
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... |
dompdf/dompdf | lib/Cpdf.php | Cpdf.o_encryption | protected function o_encryption($id, $action, $options = '')
{
switch ($action) {
case 'new':
// make the new object
$this->objects[$id] = array('t' => 'encryption', 'info' => $options);
$this->arc4_objnum = $id;
break;
... | php | protected function o_encryption($id, $action, $options = '')
{
switch ($action) {
case 'new':
// make the new object
$this->objects[$id] = array('t' => 'encryption', 'info' => $options);
$this->arc4_objnum = $id;
break;
... | [
"protected",
"function",
"o_encryption",
"(",
"$",
"id",
",",
"$",
"action",
",",
"$",
"options",
"=",
"''",
")",
"{",
"switch",
"(",
"$",
"action",
")",
"{",
"case",
"'new'",
":",
"// make the new object",
"$",
"this",
"->",
"objects",
"[",
"$",
"id",... | encryption object.
@param $id
@param $action
@param string $options
@return string|null | [
"encryption",
"object",
"."
] | 75f13c700009be21a1965dc2c5b68a8708c22ba2 | https://github.com/dompdf/dompdf/blob/75f13c700009be21a1965dc2c5b68a8708c22ba2/lib/Cpdf.php#L2023-L2102 | train | This function is used to set the encryption method of the arc4 object | [
30522,
5123,
3853,
1051,
1035,
21999,
1006,
1002,
8909,
1010,
1002,
2895,
1010,
1002,
7047,
1027,
1005,
1005,
1007,
1063,
6942,
1006,
1002,
2895,
1007,
1063,
2553,
1005,
2047,
1005,
1024,
1013,
1013,
2191,
1996,
2047,
4874,
1002,
2023,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Common/Page/Medium/ImageMedium.php | ImageMedium.format | public function format($format)
{
if (!$this->image) {
$this->image();
}
$this->format = $format;
return $this;
} | php | public function format($format)
{
if (!$this->image) {
$this->image();
}
$this->format = $format;
return $this;
} | [
"public",
"function",
"format",
"(",
"$",
"format",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"image",
")",
"{",
"$",
"this",
"->",
"image",
"(",
")",
";",
"}",
"$",
"this",
"->",
"format",
"=",
"$",
"format",
";",
"return",
"$",
"this",
";"... | Sets image output format.
@param string $format
@return $this | [
"Sets",
"image",
"output",
"format",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Page/Medium/ImageMedium.php#L444-L453 | train | Set the format of the image | [
30522,
2270,
3853,
4289,
1006,
1002,
4289,
1007,
1063,
2065,
1006,
999,
1002,
2023,
1011,
1028,
3746,
1007,
1063,
1002,
2023,
1011,
1028,
3746,
1006,
1007,
1025,
1065,
1002,
2023,
1011,
1028,
4289,
1027,
1002,
4289,
1025,
2709,
1002,
2023... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
dompdf/dompdf | lib/Cpdf.php | Cpdf.setGraphicsState | function setGraphicsState($parameters)
{
// Create a new graphics state object if necessary
if (($gstate = array_search($parameters, $this->gstates)) === false) {
$this->numObj++;
$this->o_extGState($this->numObj, 'new', $parameters);
$gstate = $this->numStates;
... | php | function setGraphicsState($parameters)
{
// Create a new graphics state object if necessary
if (($gstate = array_search($parameters, $this->gstates)) === false) {
$this->numObj++;
$this->o_extGState($this->numObj, 'new', $parameters);
$gstate = $this->numStates;
... | [
"function",
"setGraphicsState",
"(",
"$",
"parameters",
")",
"{",
"// Create a new graphics state object if necessary",
"if",
"(",
"(",
"$",
"gstate",
"=",
"array_search",
"(",
"$",
"parameters",
",",
"$",
"this",
"->",
"gstates",
")",
")",
"===",
"false",
")",
... | Set the graphics state for compositions
@param $parameters | [
"Set",
"the",
"graphics",
"state",
"for",
"compositions"
] | 75f13c700009be21a1965dc2c5b68a8708c22ba2 | https://github.com/dompdf/dompdf/blob/75f13c700009be21a1965dc2c5b68a8708c22ba2/lib/Cpdf.php#L3126-L3136 | train | Set the graphics state | [
30522,
3853,
2275,
14773,
4757,
12259,
1006,
1002,
11709,
1007,
1063,
1013,
1013,
3443,
1037,
2047,
8389,
2110,
4874,
2065,
4072,
2065,
1006,
1006,
1002,
28177,
12259,
1027,
9140,
1035,
3945,
1006,
1002,
11709,
1010,
1002,
2023,
1011,
1028,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Mail/Mailable.php | Mailable.setAddress | protected function setAddress($address, $name = null, $property = 'to')
{
foreach ($this->addressesToArray($address, $name) as $recipient) {
$recipient = $this->normalizeRecipient($recipient);
$this->{$property}[] = [
'name' => $recipient->name ?? null,
... | php | protected function setAddress($address, $name = null, $property = 'to')
{
foreach ($this->addressesToArray($address, $name) as $recipient) {
$recipient = $this->normalizeRecipient($recipient);
$this->{$property}[] = [
'name' => $recipient->name ?? null,
... | [
"protected",
"function",
"setAddress",
"(",
"$",
"address",
",",
"$",
"name",
"=",
"null",
",",
"$",
"property",
"=",
"'to'",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"addressesToArray",
"(",
"$",
"address",
",",
"$",
"name",
")",
"as",
"$",
"rec... | Set the recipients of the message.
All recipients are stored internally as [['name' => ?, 'address' => ?]]
@param object|array|string $address
@param string|null $name
@param string $property
@return $this | [
"Set",
"the",
"recipients",
"of",
"the",
"message",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Mail/Mailable.php#L577-L589 | train | Set To Address | [
30522,
5123,
3853,
2275,
4215,
16200,
4757,
1006,
1002,
4769,
1010,
1002,
2171,
1027,
19701,
1010,
1002,
3200,
1027,
1005,
2000,
1005,
1007,
1063,
18921,
6776,
1006,
1002,
2023,
1011,
1028,
11596,
3406,
2906,
30524,
1007,
1025,
1002,
2023,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
slimphp/Slim | Slim/App.php | App.process | public function process(ServerRequestInterface $request, ResponseInterface $response)
{
// Ensure basePath is set
$router = $this->container->get('router');
if (is_callable([$request->getUri(), 'getBasePath']) && is_callable([$router, 'setBasePath'])) {
$router->setBasePath($requ... | php | public function process(ServerRequestInterface $request, ResponseInterface $response)
{
// Ensure basePath is set
$router = $this->container->get('router');
if (is_callable([$request->getUri(), 'getBasePath']) && is_callable([$router, 'setBasePath'])) {
$router->setBasePath($requ... | [
"public",
"function",
"process",
"(",
"ServerRequestInterface",
"$",
"request",
",",
"ResponseInterface",
"$",
"response",
")",
"{",
"// Ensure basePath is set",
"$",
"router",
"=",
"$",
"this",
"->",
"container",
"->",
"get",
"(",
"'router'",
")",
";",
"if",
... | Process a request
This method traverses the application middleware stack and then returns the
resultant Response object.
@param ServerRequestInterface $request
@param ResponseInterface $response
@return ResponseInterface
@throws Exception
@throws Throwable | [
"Process",
"a",
"request"
] | ccef5f7d8bcd469d59cbe64f6210d83764f91543 | https://github.com/slimphp/Slim/blob/ccef5f7d8bcd469d59cbe64f6210d83764f91543/Slim/App.php#L376-L400 | train | Process the request and return the response | [
30522,
2270,
3853,
2832,
1006,
8241,
2890,
15500,
18447,
2121,
12172,
1002,
5227,
1010,
3433,
18447,
2121,
12172,
1002,
3433,
1007,
1063,
1013,
1013,
5676,
2918,
15069,
2003,
2275,
1002,
2799,
2099,
1027,
1002,
2023,
1011,
1028,
11661,
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/Cache/Lock.php | Lock.get | public function get($callback = null)
{
$result = $this->acquire();
if ($result && is_callable($callback)) {
try {
return $callback();
} finally {
$this->release();
}
}
return $result;
} | php | public function get($callback = null)
{
$result = $this->acquire();
if ($result && is_callable($callback)) {
try {
return $callback();
} finally {
$this->release();
}
}
return $result;
} | [
"public",
"function",
"get",
"(",
"$",
"callback",
"=",
"null",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"acquire",
"(",
")",
";",
"if",
"(",
"$",
"result",
"&&",
"is_callable",
"(",
"$",
"callback",
")",
")",
"{",
"try",
"{",
"return",
"... | Attempt to acquire the lock.
@param callable|null $callback
@return mixed | [
"Attempt",
"to",
"acquire",
"the",
"lock",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Cache/Lock.php#L81-L94 | train | Returns the result of the callback | [
30522,
2270,
3853,
2131,
1006,
1002,
2655,
5963,
1027,
19701,
1007,
1063,
1002,
2765,
1027,
1002,
2023,
1011,
1028,
9878,
1006,
1007,
1025,
2065,
1006,
1002,
2765,
1004,
1004,
2003,
1035,
2655,
3085,
1006,
1002,
2655,
5963,
1007,
1007,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/API/ProcessedReport.php | ProcessedReport.hideShowMetrics | private function hideShowMetrics($columns, $emptyColumns = array())
{
if (!is_array($columns)) {
return $columns;
}
// remove columns if hideColumns query parameters exist
$columnsToRemove = $this->getColumnsToRemove();
// remove columns if showColumns query par... | php | private function hideShowMetrics($columns, $emptyColumns = array())
{
if (!is_array($columns)) {
return $columns;
}
// remove columns if hideColumns query parameters exist
$columnsToRemove = $this->getColumnsToRemove();
// remove columns if showColumns query par... | [
"private",
"function",
"hideShowMetrics",
"(",
"$",
"columns",
",",
"$",
"emptyColumns",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"columns",
")",
")",
"{",
"return",
"$",
"columns",
";",
"}",
"// remove columns if hideColumns... | Removes column names from an array based on the values in the hideColumns,
showColumns query parameters. This is a hack that provides the ColumnDelete
filter functionality in processed reports.
@param array $columns List of metrics shown in a processed report.
@param array $emptyColumns Empty columns from the data tab... | [
"Removes",
"column",
"names",
"from",
"an",
"array",
"based",
"on",
"the",
"values",
"in",
"the",
"hideColumns",
"showColumns",
"query",
"parameters",
".",
"This",
"is",
"a",
"hack",
"that",
"provides",
"the",
"ColumnDelete",
"filter",
"functionality",
"in",
"... | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/API/ProcessedReport.php#L541-L554 | train | Hide show metrics by query parameters | [
30522,
2797,
3853,
17382,
14406,
12589,
2015,
1006,
1002,
7753,
1010,
1002,
4064,
25778,
2819,
3619,
1027,
9140,
1006,
1007,
1007,
1063,
2065,
1006,
999,
2003,
1035,
9140,
1006,
1002,
7753,
1007,
1007,
1063,
2709,
1002,
7753,
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/system/controllers/Updates.php | Updates.processImportantUpdates | protected function processImportantUpdates($result)
{
$hasImportantUpdates = false;
/*
* Core
*/
if (isset($result['core'])) {
$coreImportant = false;
foreach (array_get($result, 'core.updates', []) as $build => $description) {
if (... | php | protected function processImportantUpdates($result)
{
$hasImportantUpdates = false;
/*
* Core
*/
if (isset($result['core'])) {
$coreImportant = false;
foreach (array_get($result, 'core.updates', []) as $build => $description) {
if (... | [
"protected",
"function",
"processImportantUpdates",
"(",
"$",
"result",
")",
"{",
"$",
"hasImportantUpdates",
"=",
"false",
";",
"/*\n * Core\n */",
"if",
"(",
"isset",
"(",
"$",
"result",
"[",
"'core'",
"]",
")",
")",
"{",
"$",
"coreImportant",
... | Loops the update list and checks for actionable updates.
@param array $result
@return array | [
"Loops",
"the",
"update",
"list",
"and",
"checks",
"for",
"actionable",
"updates",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/controllers/Updates.php#L351-L394 | train | Process Important Updates | [
30522,
5123,
3853,
2832,
5714,
6442,
4630,
6279,
27122,
1006,
1002,
2765,
1007,
1063,
1002,
2038,
5714,
6442,
4630,
6279,
27122,
1027,
6270,
1025,
1013,
1008,
1008,
4563,
1008,
1013,
2065,
1006,
26354,
3388,
1006,
1002,
2765,
1031,
1005,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/PropertyInfo/Extractor/PhpDocExtractor.php | PhpDocExtractor.getShortDescription | public function getShortDescription($class, $property, array $context = [])
{
/** @var $docBlock DocBlock */
list($docBlock) = $this->getDocBlock($class, $property);
if (!$docBlock) {
return;
}
$shortDescription = $docBlock->getSummary();
if (!empty($sho... | php | public function getShortDescription($class, $property, array $context = [])
{
/** @var $docBlock DocBlock */
list($docBlock) = $this->getDocBlock($class, $property);
if (!$docBlock) {
return;
}
$shortDescription = $docBlock->getSummary();
if (!empty($sho... | [
"public",
"function",
"getShortDescription",
"(",
"$",
"class",
",",
"$",
"property",
",",
"array",
"$",
"context",
"=",
"[",
"]",
")",
"{",
"/** @var $docBlock DocBlock */",
"list",
"(",
"$",
"docBlock",
")",
"=",
"$",
"this",
"->",
"getDocBlock",
"(",
"$... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/PropertyInfo/Extractor/PhpDocExtractor.php#L71-L92 | train | Returns short description of class property | [
30522,
2270,
3853,
4152,
27794,
6155,
23235,
3258,
1006,
1002,
2465,
1010,
1002,
3200,
1010,
9140,
1002,
6123,
1027,
1031,
1033,
1007,
1063,
1013,
1008,
1008,
1030,
13075,
1002,
9986,
23467,
9986,
23467,
1008,
1013,
2862,
1006,
1002,
9986,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Exporters/CsvExporter.php | CsvExporter.export | public function export()
{
$filename = $this->getTable().'.csv';
$headers = [
'Content-Encoding' => 'UTF-8',
'Content-Type' => 'text/csv;charset=UTF-8',
'Content-Disposition' => "attachment; filename=\"$filename\"",
];
response()->strea... | php | public function export()
{
$filename = $this->getTable().'.csv';
$headers = [
'Content-Encoding' => 'UTF-8',
'Content-Type' => 'text/csv;charset=UTF-8',
'Content-Disposition' => "attachment; filename=\"$filename\"",
];
response()->strea... | [
"public",
"function",
"export",
"(",
")",
"{",
"$",
"filename",
"=",
"$",
"this",
"->",
"getTable",
"(",
")",
".",
"'.csv'",
";",
"$",
"headers",
"=",
"[",
"'Content-Encoding'",
"=>",
"'UTF-8'",
",",
"'Content-Type'",
"=>",
"'text/csv;charset=UTF-8'",
",",
... | {@inheritdoc} | [
"{"
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Grid/Exporters/CsvExporter.php#L15-L48 | train | Export the table to CSV | [
30522,
2270,
3853,
9167,
1006,
1007,
1063,
1002,
5371,
18442,
1027,
1002,
2023,
1011,
1028,
2131,
10880,
1006,
1007,
1012,
1005,
1012,
20116,
2615,
1005,
1025,
1002,
20346,
2015,
1027,
1031,
1005,
4180,
1011,
17181,
1005,
1027,
1028,
1005,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/backend/widgets/Form.php | Form.processAutoSpan | protected function processAutoSpan($fields)
{
$prevSpan = null;
foreach ($fields as $field) {
if (strtolower($field->span) === 'auto') {
if ($prevSpan === 'left') {
$field->span = 'right';
}
else {
$... | php | protected function processAutoSpan($fields)
{
$prevSpan = null;
foreach ($fields as $field) {
if (strtolower($field->span) === 'auto') {
if ($prevSpan === 'left') {
$field->span = 'right';
}
else {
$... | [
"protected",
"function",
"processAutoSpan",
"(",
"$",
"fields",
")",
"{",
"$",
"prevSpan",
"=",
"null",
";",
"foreach",
"(",
"$",
"fields",
"as",
"$",
"field",
")",
"{",
"if",
"(",
"strtolower",
"(",
"$",
"field",
"->",
"span",
")",
"===",
"'auto'",
... | Converts fields with a span set to 'auto' as either
'left' or 'right' depending on the previous field.
@return void | [
"Converts",
"fields",
"with",
"a",
"span",
"set",
"to",
"auto",
"as",
"either",
"left",
"or",
"right",
"depending",
"on",
"the",
"previous",
"field",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/Form.php#L654-L670 | train | Process auto span | [
30522,
5123,
3853,
2832,
4887,
13122,
9739,
1006,
1002,
4249,
1007,
1063,
1002,
3653,
15088,
9739,
1027,
19701,
1025,
18921,
6776,
1006,
1002,
4249,
2004,
1002,
2492,
1007,
1063,
2065,
1006,
2358,
5339,
12898,
13777,
1006,
1002,
2492,
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... |
spatie/laravel-permission | src/Models/Role.php | Role.findOrCreate | public static function findOrCreate(string $name, $guardName = null): RoleContract
{
$guardName = $guardName ?? Guard::getDefaultName(static::class);
$role = static::where('name', $name)->where('guard_name', $guardName)->first();
if (! $role) {
return static::query()->create(['... | php | public static function findOrCreate(string $name, $guardName = null): RoleContract
{
$guardName = $guardName ?? Guard::getDefaultName(static::class);
$role = static::where('name', $name)->where('guard_name', $guardName)->first();
if (! $role) {
return static::query()->create(['... | [
"public",
"static",
"function",
"findOrCreate",
"(",
"string",
"$",
"name",
",",
"$",
"guardName",
"=",
"null",
")",
":",
"RoleContract",
"{",
"$",
"guardName",
"=",
"$",
"guardName",
"??",
"Guard",
"::",
"getDefaultName",
"(",
"static",
"::",
"class",
")"... | Find or create role by its name (and optionally guardName).
@param string $name
@param string|null $guardName
@return \Spatie\Permission\Contracts\Role | [
"Find",
"or",
"create",
"role",
"by",
"its",
"name",
"(",
"and",
"optionally",
"guardName",
")",
"."
] | 81dbe9d372d70c255b66a2727a235076509f8d45 | https://github.com/spatie/laravel-permission/blob/81dbe9d372d70c255b66a2727a235076509f8d45/src/Models/Role.php#L118-L129 | train | Find or create role | [
30522,
2270,
10763,
3853,
2424,
2953,
16748,
3686,
1006,
5164,
1002,
2171,
1010,
1002,
3457,
18442,
1027,
19701,
1007,
1024,
2535,
8663,
6494,
6593,
1063,
1002,
3457,
18442,
1027,
1002,
3457,
18442,
1029,
1029,
3457,
1024,
1024,
2131,
3207,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/EventEmitter.php | EventEmitter.fireSystemEvent | public function fireSystemEvent($event, $params = [], $halt = true)
{
$result = [];
$shortEvent = substr($event, strpos($event, '.') + 1);
$longArgs = array_merge([$this], $params);
/*
* Local event first
*/
if ($response = $this->fireEvent($shortEvent, $... | php | public function fireSystemEvent($event, $params = [], $halt = true)
{
$result = [];
$shortEvent = substr($event, strpos($event, '.') + 1);
$longArgs = array_merge([$this], $params);
/*
* Local event first
*/
if ($response = $this->fireEvent($shortEvent, $... | [
"public",
"function",
"fireSystemEvent",
"(",
"$",
"event",
",",
"$",
"params",
"=",
"[",
"]",
",",
"$",
"halt",
"=",
"true",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"$",
"shortEvent",
"=",
"substr",
"(",
"$",
"event",
",",
"strpos",
"(",
"$... | Fires a combination of local and global events. The first segment is removed
from the event name locally and the local object is passed as the first
argument to the event globally. Halting is also enabled by default.
For example:
$this->fireSystemEvent('backend.list.myEvent', ['my value']);
Is equivalent to:
$this-... | [
"Fires",
"a",
"combination",
"of",
"local",
"and",
"global",
"events",
".",
"The",
"first",
"segment",
"is",
"removed",
"from",
"the",
"event",
"name",
"locally",
"and",
"the",
"local",
"object",
"is",
"passed",
"as",
"the",
"first",
"argument",
"to",
"the... | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/traits/EventEmitter.php#L36-L67 | train | Fires system event | [
30522,
2270,
3853,
8769,
27268,
21382,
15338,
1006,
1002,
2724,
1010,
1002,
11498,
5244,
1027,
1031,
1033,
1010,
1002,
9190,
1027,
2995,
1007,
1063,
1002,
2765,
1027,
1031,
1033,
1025,
1002,
2460,
18697,
3372,
1027,
4942,
3367,
2099,
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/Component/Intl/Data/Bundle/Writer/TextBundleWriter.php | TextBundleWriter.writeTable | private function writeTable($file, $value, $indentation, $fallback = true)
{
if (!\is_array($value) && !$value instanceof \Traversable) {
throw new UnexpectedTypeException($value, 'array or \Traversable');
}
if (!$fallback) {
fwrite($file, ':table(nofallback)');
... | php | private function writeTable($file, $value, $indentation, $fallback = true)
{
if (!\is_array($value) && !$value instanceof \Traversable) {
throw new UnexpectedTypeException($value, 'array or \Traversable');
}
if (!$fallback) {
fwrite($file, ':table(nofallback)');
... | [
"private",
"function",
"writeTable",
"(",
"$",
"file",
",",
"$",
"value",
",",
"$",
"indentation",
",",
"$",
"fallback",
"=",
"true",
")",
"{",
"if",
"(",
"!",
"\\",
"is_array",
"(",
"$",
"value",
")",
"&&",
"!",
"$",
"value",
"instanceof",
"\\",
"... | Writes a "table" node.
@param resource $file The file handle to write to
@param iterable $value The value of the node
@param int $indentation The number of levels to indent
@param bool $fallback Whether the table should be merged
with the fallback locale
@throws UnexpectedTypeException when $... | [
"Writes",
"a",
"table",
"node",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Intl/Data/Bundle/Writer/TextBundleWriter.php#L207-L235 | train | Write a table | [
30522,
2797,
3853,
4339,
10880,
1006,
1002,
5371,
1010,
1002,
3643,
1010,
1002,
27427,
19304,
1010,
1002,
2991,
5963,
1027,
2995,
1007,
1063,
2065,
1006,
999,
1032,
2003,
1035,
9140,
1006,
1002,
3643,
1007,
1004,
1004,
999,
1002,
3643,
60... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php | NativeSessionStorage.setOptions | public function setOptions(array $options)
{
if (headers_sent() || \PHP_SESSION_ACTIVE === session_status()) {
return;
}
$validOptions = array_flip([
'cache_expire', 'cache_limiter', 'cookie_domain', 'cookie_httponly',
'cookie_lifetime', 'cookie_path', 'c... | php | public function setOptions(array $options)
{
if (headers_sent() || \PHP_SESSION_ACTIVE === session_status()) {
return;
}
$validOptions = array_flip([
'cache_expire', 'cache_limiter', 'cookie_domain', 'cookie_httponly',
'cookie_lifetime', 'cookie_path', 'c... | [
"public",
"function",
"setOptions",
"(",
"array",
"$",
"options",
")",
"{",
"if",
"(",
"headers_sent",
"(",
")",
"||",
"\\",
"PHP_SESSION_ACTIVE",
"===",
"session_status",
"(",
")",
")",
"{",
"return",
";",
"}",
"$",
"validOptions",
"=",
"array_flip",
"(",... | Sets session.* ini variables.
For convenience we omit 'session.' from the beginning of the keys.
Explicitly ignores other ini keys.
@param array $options Session ini directives [key => value]
@see http://php.net/session.configuration | [
"Sets",
"session",
".",
"*",
"ini",
"variables",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php#L356-L385 | train | Set the session options | [
30522,
2270,
3853,
2275,
7361,
9285,
1006,
9140,
1002,
7047,
1007,
1063,
2065,
1006,
20346,
2015,
1035,
2741,
1006,
1007,
1064,
1064,
1032,
25718,
1035,
5219,
1035,
3161,
1027,
1027,
1027,
5219,
1035,
3570,
1006,
1007,
1007,
1063,
2709,
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... |
barryvdh/laravel-debugbar | src/Storage/FilesystemStorage.php | FilesystemStorage.save | public function save($id, $data)
{
if (!$this->files->isDirectory($this->dirname)) {
if ($this->files->makeDirectory($this->dirname, 0777, true)) {
$this->files->put($this->dirname . '.gitignore', "*\n!.gitignore\n");
} else {
throw new \Exception("Can... | php | public function save($id, $data)
{
if (!$this->files->isDirectory($this->dirname)) {
if ($this->files->makeDirectory($this->dirname, 0777, true)) {
$this->files->put($this->dirname . '.gitignore', "*\n!.gitignore\n");
} else {
throw new \Exception("Can... | [
"public",
"function",
"save",
"(",
"$",
"id",
",",
"$",
"data",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"files",
"->",
"isDirectory",
"(",
"$",
"this",
"->",
"dirname",
")",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"files",
"->",
"makeDirecto... | {@inheritDoc} | [
"{"
] | 2d195779ea4f809f69764a795e2ec371dbb76a96 | https://github.com/barryvdh/laravel-debugbar/blob/2d195779ea4f809f69764a795e2ec371dbb76a96/src/Storage/FilesystemStorage.php#L32-L52 | train | Save the data to the cache | [
30522,
2270,
3853,
3828,
1006,
1002,
8909,
1010,
1002,
2951,
1007,
1063,
2065,
1006,
999,
1002,
2023,
1011,
1028,
6764,
1011,
1028,
2003,
4305,
2890,
16761,
2100,
1006,
1002,
2023,
1011,
1028,
16101,
18442,
1007,
1007,
1063,
2065,
1006,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/Zend/Db/Statement/Pdo.php | Zend_Db_Statement_Pdo.bindColumn | public function bindColumn($column, &$param, $type = null)
{
try {
if ($type === null) {
return $this->_stmt->bindColumn($column, $param);
} else {
return $this->_stmt->bindColumn($column, $param, $type);
}
} catch (PDOException $e)... | php | public function bindColumn($column, &$param, $type = null)
{
try {
if ($type === null) {
return $this->_stmt->bindColumn($column, $param);
} else {
return $this->_stmt->bindColumn($column, $param, $type);
}
} catch (PDOException $e)... | [
"public",
"function",
"bindColumn",
"(",
"$",
"column",
",",
"&",
"$",
"param",
",",
"$",
"type",
"=",
"null",
")",
"{",
"try",
"{",
"if",
"(",
"$",
"type",
"===",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"_stmt",
"->",
"bindColumn",
"(",
"... | Bind a column of the statement result set to a PHP variable.
@param string $column Name the column in the result set, either by
position or by name.
@param mixed $param Reference to the PHP variable containing the value.
@param mixed $type OPTIONAL
@return bool
@throws Zend_Db_Statement_Exception | [
"Bind",
"a",
"column",
"of",
"the",
"statement",
"result",
"set",
"to",
"a",
"PHP",
"variable",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Statement/Pdo.php#L75-L87 | train | Binds a column to a variable | [
30522,
2270,
3853,
14187,
25778,
2819,
2078,
1006,
1002,
5930,
1010,
1004,
1002,
11498,
2213,
1010,
1002,
2828,
1027,
19701,
1007,
1063,
3046,
1063,
2065,
1006,
1002,
2828,
1027,
1027,
1027,
19701,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Cache/Repository.php | Repository.getSeconds | protected function getSeconds($ttl)
{
$duration = $this->parseDateInterval($ttl);
if ($duration instanceof DateTimeInterface) {
$duration = Carbon::now()->diffInRealSeconds($duration, false);
}
return (int) $duration > 0 ? $duration : 0;
} | php | protected function getSeconds($ttl)
{
$duration = $this->parseDateInterval($ttl);
if ($duration instanceof DateTimeInterface) {
$duration = Carbon::now()->diffInRealSeconds($duration, false);
}
return (int) $duration > 0 ? $duration : 0;
} | [
"protected",
"function",
"getSeconds",
"(",
"$",
"ttl",
")",
"{",
"$",
"duration",
"=",
"$",
"this",
"->",
"parseDateInterval",
"(",
"$",
"ttl",
")",
";",
"if",
"(",
"$",
"duration",
"instanceof",
"DateTimeInterface",
")",
"{",
"$",
"duration",
"=",
"Car... | Calculate the number of seconds for the given TTL.
@param \DateTimeInterface|\DateInterval|int $ttl
@return int | [
"Calculate",
"the",
"number",
"of",
"seconds",
"for",
"the",
"given",
"TTL",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Cache/Repository.php#L616-L625 | train | Get seconds from ttl | [
30522,
5123,
3853,
4152,
8586,
15422,
2015,
1006,
1002,
23746,
2140,
1007,
1063,
1002,
9367,
1027,
1002,
2023,
1011,
1028,
11968,
6924,
3686,
18447,
2121,
10175,
1006,
1002,
23746,
2140,
1007,
1025,
2065,
1006,
1002,
9367,
6013,
11253,
3058... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Segment/SegmentExpression.php | SegmentExpression.parseTree | protected function parseTree()
{
$string = $this->string;
if (empty($string)) {
return array();
}
$tree = array();
$i = 0;
$length = strlen($string);
$isBackslash = false;
$operand = '';
while ($i <= $length) {
$char = $... | php | protected function parseTree()
{
$string = $this->string;
if (empty($string)) {
return array();
}
$tree = array();
$i = 0;
$length = strlen($string);
$isBackslash = false;
$operand = '';
while ($i <= $length) {
$char = $... | [
"protected",
"function",
"parseTree",
"(",
")",
"{",
"$",
"string",
"=",
"$",
"this",
"->",
"string",
";",
"if",
"(",
"empty",
"(",
"$",
"string",
")",
")",
"{",
"return",
"array",
"(",
")",
";",
"}",
"$",
"tree",
"=",
"array",
"(",
")",
";",
"... | Given a filter string,
will parse it into an array where each row contains the boolean operator applied to it,
and the operand
@return array | [
"Given",
"a",
"filter",
"string",
"will",
"parse",
"it",
"into",
"an",
"array",
"where",
"each",
"row",
"contains",
"the",
"boolean",
"operator",
"applied",
"to",
"it",
"and",
"the",
"operand"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Segment/SegmentExpression.php#L390-L433 | train | Parse tree of terms | [
30522,
5123,
3853,
11968,
13462,
9910,
1006,
1007,
1063,
1002,
5164,
1027,
1002,
2023,
1011,
1028,
5164,
1025,
2065,
1006,
4064,
1006,
1002,
5164,
1007,
1007,
1063,
2709,
9140,
1006,
1007,
1025,
1065,
1002,
3392,
1027,
9140,
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... |
getgrav/grav | system/src/Grav/Common/Grav.php | Grav.process | public function process()
{
if (isset($this->initialized['process'])) {
return;
}
// Initialize Grav if needed.
$this->setup();
$this->initialized['process'] = true;
$container = new Container(
[
'configurationProcessor' => f... | php | public function process()
{
if (isset($this->initialized['process'])) {
return;
}
// Initialize Grav if needed.
$this->setup();
$this->initialized['process'] = true;
$container = new Container(
[
'configurationProcessor' => f... | [
"public",
"function",
"process",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"initialized",
"[",
"'process'",
"]",
")",
")",
"{",
"return",
";",
"}",
"// Initialize Grav if needed.",
"$",
"this",
"->",
"setup",
"(",
")",
";",
"$",
"this"... | Process a request | [
"Process",
"a",
"request"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Grav.php#L176-L257 | train | Processes the request and returns the response. | [
30522,
2270,
3853,
2832,
1006,
1007,
1063,
2065,
1006,
26354,
3388,
1006,
1002,
2023,
1011,
1028,
3988,
3550,
1031,
1005,
2832,
1005,
1033,
1007,
1007,
1063,
2709,
1025,
1065,
1013,
1013,
3988,
4697,
24665,
11431,
2065,
2734,
1012,
1002,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.