repo stringclasses 21
values | path stringlengths 10 105 | func_name stringlengths 6 64 | original_string stringlengths 105 15.6k | language stringclasses 1
value | code stringlengths 105 15.6k | code_tokens listlengths 29 2.15k | docstring stringlengths 11 2.85k | docstring_tokens listlengths 1 290 | sha stringclasses 21
values | url stringlengths 100 194 | partition stringclasses 1
value | summary stringlengths 8 319 | input_ids listlengths 502 502 | token_type_ids listlengths 502 502 | attention_mask listlengths 502 502 | labels listlengths 502 502 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
getgrav/grav | system/src/Grav/Framework/Object/ObjectCollection.php | ObjectCollection.matching | public function matching(Criteria $criteria)
{
$expr = $criteria->getWhereExpression();
$filtered = $this->getElements();
if ($expr) {
$visitor = new ObjectExpressionVisitor();
$filter = $visitor->dispatch($expr);
$filtered = array_filter($filtered... | php | public function matching(Criteria $criteria)
{
$expr = $criteria->getWhereExpression();
$filtered = $this->getElements();
if ($expr) {
$visitor = new ObjectExpressionVisitor();
$filter = $visitor->dispatch($expr);
$filtered = array_filter($filtered... | [
"public",
"function",
"matching",
"(",
"Criteria",
"$",
"criteria",
")",
"{",
"$",
"expr",
"=",
"$",
"criteria",
"->",
"getWhereExpression",
"(",
")",
";",
"$",
"filtered",
"=",
"$",
"this",
"->",
"getElements",
"(",
")",
";",
"if",
"(",
"$",
"expr",
... | {@inheritDoc} | [
"{"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Framework/Object/ObjectCollection.php#L67-L101 | train | Get the elements matching the criteria | [
30522,
2270,
3853,
9844,
1006,
9181,
1002,
9181,
1007,
1063,
1002,
4654,
18098,
1027,
1002,
9181,
1011,
1028,
2131,
2860,
5886,
4402,
2595,
20110,
3258,
1006,
1007,
1025,
1002,
21839,
1027,
1002,
2023,
1011,
1028,
2131,
12260,
8163,
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/Filesystem/FilesystemManager.php | FilesystemManager.formatS3Config | protected function formatS3Config(array $config)
{
$config += ['version' => 'latest'];
if ($config['key'] && $config['secret']) {
$config['credentials'] = Arr::only($config, ['key', 'secret', 'token']);
}
return $config;
} | php | protected function formatS3Config(array $config)
{
$config += ['version' => 'latest'];
if ($config['key'] && $config['secret']) {
$config['credentials'] = Arr::only($config, ['key', 'secret', 'token']);
}
return $config;
} | [
"protected",
"function",
"formatS3Config",
"(",
"array",
"$",
"config",
")",
"{",
"$",
"config",
"+=",
"[",
"'version'",
"=>",
"'latest'",
"]",
";",
"if",
"(",
"$",
"config",
"[",
"'key'",
"]",
"&&",
"$",
"config",
"[",
"'secret'",
"]",
")",
"{",
"$"... | Format the given S3 configuration with the default options.
@param array $config
@return array | [
"Format",
"the",
"given",
"S3",
"configuration",
"with",
"the",
"default",
"options",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Filesystem/FilesystemManager.php#L218-L227 | train | Formats the S3 config array. | [
30522,
5123,
3853,
11630,
2509,
8663,
8873,
2290,
1006,
9140,
1002,
9530,
8873,
2290,
1007,
1063,
1002,
9530,
8873,
2290,
1009,
1027,
1031,
1005,
2544,
1005,
1027,
1028,
1005,
6745,
1005,
1033,
1025,
2065,
1006,
1002,
9530,
8873,
2290,
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... |
opencart/opencart | upload/catalog/controller/event/activity.php | ControllerEventActivity.addReturn | public function addReturn(&$route, &$args, &$output) {
if ($this->config->get('config_customer_activity') && $output) {
$this->load->model('account/activity');
if ($this->customer->isLogged()) {
$activity_data = array(
'customer_id' => $this->customer->getId(),
'name' => $this->customer->g... | php | public function addReturn(&$route, &$args, &$output) {
if ($this->config->get('config_customer_activity') && $output) {
$this->load->model('account/activity');
if ($this->customer->isLogged()) {
$activity_data = array(
'customer_id' => $this->customer->getId(),
'name' => $this->customer->g... | [
"public",
"function",
"addReturn",
"(",
"&",
"$",
"route",
",",
"&",
"$",
"args",
",",
"&",
"$",
"output",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"config",
"->",
"get",
"(",
"'config_customer_activity'",
")",
"&&",
"$",
"output",
")",
"{",
"$",
"t... | catalog/model/account/return/addReturn/after | [
"catalog",
"/",
"model",
"/",
"account",
"/",
"return",
"/",
"addReturn",
"/",
"after"
] | e7933b56ba05aafb3655c6b490c9733cd18b5c69 | https://github.com/opencart/opencart/blob/e7933b56ba05aafb3655c6b490c9733cd18b5c69/upload/catalog/controller/event/activity.php#L189-L210 | train | Add Return to Account | [
30522,
2270,
3853,
5587,
13465,
14287,
1006,
1004,
1002,
2799,
1010,
1004,
1002,
12098,
5620,
1010,
1004,
1002,
6434,
1007,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
9530,
8873,
2290,
1011,
1028,
2131,
1006,
1005,
9530,
8873,
2290,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/CoreHome/DataTableRowAction/RowEvolution.php | RowEvolution.getSparkline | protected function getSparkline($metric)
{
// sparkline is always echoed, so we need to buffer the output
$view = $this->getRowEvolutionGraph($graphType = 'sparkline', $metrics = array($metric => $metric));
ob_start();
$view->render();
$spark = ob_get_contents();
ob_... | php | protected function getSparkline($metric)
{
// sparkline is always echoed, so we need to buffer the output
$view = $this->getRowEvolutionGraph($graphType = 'sparkline', $metrics = array($metric => $metric));
ob_start();
$view->render();
$spark = ob_get_contents();
ob_... | [
"protected",
"function",
"getSparkline",
"(",
"$",
"metric",
")",
"{",
"// sparkline is always echoed, so we need to buffer the output",
"$",
"view",
"=",
"$",
"this",
"->",
"getRowEvolutionGraph",
"(",
"$",
"graphType",
"=",
"'sparkline'",
",",
"$",
"metrics",
"=",
... | Get the img tag for a sparkline showing a single metric | [
"Get",
"the",
"img",
"tag",
"for",
"a",
"sparkline",
"showing",
"a",
"single",
"metric"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/CoreHome/DataTableRowAction/RowEvolution.php#L302-L318 | train | Returns the sparkline of the metric | [
30522,
5123,
3853,
4152,
14432,
4179,
1006,
1002,
12046,
1007,
1063,
1013,
1013,
12125,
4179,
2003,
2467,
10187,
1010,
2061,
2057,
2342,
2000,
17698,
30524,
1025,
1002,
3193,
1011,
1028,
17552,
1006,
1007,
1025,
1002,
12125,
1027,
27885,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/Zend/Db/Adapter/Abstract.php | Zend_Db_Adapter_Abstract.quoteInto | public function quoteInto($text, $value, $type = null, $count = null)
{
if ($count === null) {
return str_replace('?', $this->quote($value, $type), $text);
} else {
while ($count > 0) {
if (strpos($text, '?') !== false) {
$text = substr_rep... | php | public function quoteInto($text, $value, $type = null, $count = null)
{
if ($count === null) {
return str_replace('?', $this->quote($value, $type), $text);
} else {
while ($count > 0) {
if (strpos($text, '?') !== false) {
$text = substr_rep... | [
"public",
"function",
"quoteInto",
"(",
"$",
"text",
",",
"$",
"value",
",",
"$",
"type",
"=",
"null",
",",
"$",
"count",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"count",
"===",
"null",
")",
"{",
"return",
"str_replace",
"(",
"'?'",
",",
"$",
"thi... | Quotes a value and places into a piece of text at a placeholder.
The placeholder is a question-mark; all placeholders will be replaced
with the quoted value. For example:
<code>
$text = "WHERE date < ?";
$date = "2005-01-02";
$safe = $sql->quoteInto($text, $date);
// $safe = "WHERE date < '2005-01-02'"
</code>
@pa... | [
"Quotes",
"a",
"value",
"and",
"places",
"into",
"a",
"piece",
"of",
"text",
"at",
"a",
"placeholder",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Adapter/Abstract.php#L927-L940 | train | Quote into a string | [
30522,
2270,
3853,
14686,
18447,
2080,
1006,
1002,
3793,
1010,
1002,
3643,
1010,
1002,
2828,
1027,
19701,
1010,
1002,
4175,
1027,
19701,
1007,
1063,
2065,
1006,
1002,
4175,
1027,
1027,
1027,
19701,
1007,
1063,
2709,
2358,
2099,
1035,
5672,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Auth/Access/Gate.php | Gate.methodAllowsGuests | protected function methodAllowsGuests($class, $method)
{
try {
$reflection = new ReflectionClass($class);
$method = $reflection->getMethod($method);
} catch (Exception $e) {
return false;
}
if ($method) {
$parameters = $method->getPar... | php | protected function methodAllowsGuests($class, $method)
{
try {
$reflection = new ReflectionClass($class);
$method = $reflection->getMethod($method);
} catch (Exception $e) {
return false;
}
if ($method) {
$parameters = $method->getPar... | [
"protected",
"function",
"methodAllowsGuests",
"(",
"$",
"class",
",",
"$",
"method",
")",
"{",
"try",
"{",
"$",
"reflection",
"=",
"new",
"ReflectionClass",
"(",
"$",
"class",
")",
";",
"$",
"method",
"=",
"$",
"reflection",
"->",
"getMethod",
"(",
"$",... | Determine if the given class method allows guests.
@param string $class
@param string $method
@return bool | [
"Determine",
"if",
"the",
"given",
"class",
"method",
"allows",
"guests",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Auth/Access/Gate.php#L396-L413 | train | Method allows guests | [
30522,
5123,
3853,
4118,
8095,
15568,
22967,
3215,
1006,
1002,
2465,
1010,
1002,
4118,
1007,
1063,
3046,
1063,
1002,
9185,
1027,
2047,
9185,
26266,
1006,
1002,
2465,
1007,
1025,
1002,
4118,
1027,
1002,
9185,
1011,
1028,
2131,
11368,
6806,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
z-song/laravel-admin | src/Auth/Permission.php | Permission.deny | public static function deny($roles)
{
if (static::isAdministrator()) {
return true;
}
if (Auth::guard('admin')->user()->inRoles($roles)) {
static::error();
}
} | php | public static function deny($roles)
{
if (static::isAdministrator()) {
return true;
}
if (Auth::guard('admin')->user()->inRoles($roles)) {
static::error();
}
} | [
"public",
"static",
"function",
"deny",
"(",
"$",
"roles",
")",
"{",
"if",
"(",
"static",
"::",
"isAdministrator",
"(",
")",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"Auth",
"::",
"guard",
"(",
"'admin'",
")",
"->",
"user",
"(",
")",
"->",
... | Roles denied to access.
@param $roles
@return true | [
"Roles",
"denied",
"to",
"access",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Auth/Permission.php#L72-L81 | train | Check if user is not in roles | [
30522,
2270,
10763,
3853,
9772,
1006,
1002,
4395,
1007,
1063,
2065,
1006,
10763,
1024,
1024,
18061,
22117,
5498,
20528,
4263,
1006,
1007,
1007,
1063,
2709,
2995,
1025,
1065,
2065,
1006,
8740,
2705,
1024,
1024,
3457,
1006,
1005,
4748,
10020,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Config.php | Config.getHostname | public static function getHostname()
{
// Check trusted requires config file which is not ready yet
$host = Url::getHost($checkIfTrusted = false);
// Remove any port number to get actual hostname
$host = Url::getHostSanitized($host);
return $host;
} | php | public static function getHostname()
{
// Check trusted requires config file which is not ready yet
$host = Url::getHost($checkIfTrusted = false);
// Remove any port number to get actual hostname
$host = Url::getHostSanitized($host);
return $host;
} | [
"public",
"static",
"function",
"getHostname",
"(",
")",
"{",
"// Check trusted requires config file which is not ready yet",
"$",
"host",
"=",
"Url",
"::",
"getHost",
"(",
"$",
"checkIfTrusted",
"=",
"false",
")",
";",
"// Remove any port number to get actual hostname",
... | Returns the hostname of the current request (without port number)
@return string | [
"Returns",
"the",
"hostname",
"of",
"the",
"current",
"request",
"(",
"without",
"port",
"number",
")"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Config.php#L222-L231 | train | Get hostname of current domain | [
30522,
2270,
10763,
3853,
2131,
15006,
2102,
18442,
1006,
1007,
1063,
1013,
1013,
4638,
9480,
5942,
9530,
8873,
2290,
5371,
2029,
2003,
2025,
3201,
2664,
1002,
3677,
1027,
24471,
2140,
1024,
1024,
2131,
15006,
2102,
1006,
1002,
4638,
10128,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/system/ServiceProvider.php | ServiceProvider.registerConsole | protected function registerConsole()
{
/*
* Allow plugins to use the scheduler
*/
Event::listen('console.schedule', function ($schedule) {
$plugins = PluginManager::instance()->getPlugins();
foreach ($plugins as $plugin) {
if (method_exists($... | php | protected function registerConsole()
{
/*
* Allow plugins to use the scheduler
*/
Event::listen('console.schedule', function ($schedule) {
$plugins = PluginManager::instance()->getPlugins();
foreach ($plugins as $plugin) {
if (method_exists($... | [
"protected",
"function",
"registerConsole",
"(",
")",
"{",
"/*\n * Allow plugins to use the scheduler\n */",
"Event",
"::",
"listen",
"(",
"'console.schedule'",
",",
"function",
"(",
"$",
"schedule",
")",
"{",
"$",
"plugins",
"=",
"PluginManager",
"::",
... | Register command line specifics | [
"Register",
"command",
"line",
"specifics"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/ServiceProvider.php#L206-L247 | train | Register console commands | [
30522,
5123,
3853,
4236,
8663,
19454,
2063,
1006,
1007,
1063,
1013,
1008,
1008,
3499,
13354,
7076,
2000,
2224,
1996,
6134,
2099,
1008,
1013,
2724,
1024,
1024,
4952,
1006,
1005,
10122,
1012,
6134,
1005,
1010,
3853,
1006,
30524,
1063,
2065,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Routing/RoutingServiceProvider.php | RoutingServiceProvider.registerResponseFactory | protected function registerResponseFactory()
{
$this->app->singleton(ResponseFactoryContract::class, function ($app) {
return new ResponseFactory($app[ViewFactoryContract::class], $app['redirect']);
});
} | php | protected function registerResponseFactory()
{
$this->app->singleton(ResponseFactoryContract::class, function ($app) {
return new ResponseFactory($app[ViewFactoryContract::class], $app['redirect']);
});
} | [
"protected",
"function",
"registerResponseFactory",
"(",
")",
"{",
"$",
"this",
"->",
"app",
"->",
"singleton",
"(",
"ResponseFactoryContract",
"::",
"class",
",",
"function",
"(",
"$",
"app",
")",
"{",
"return",
"new",
"ResponseFactory",
"(",
"$",
"app",
"[... | Register the response factory implementation.
@return void | [
"Register",
"the",
"response",
"factory",
"implementation",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/RoutingServiceProvider.php#L149-L154 | train | Register Response Factory | [
30522,
5123,
3853,
4236,
6072,
26029,
20106,
18908,
10253,
1006,
1007,
1063,
1002,
2023,
1011,
1028,
10439,
1011,
1028,
28159,
1006,
3433,
21450,
8663,
6494,
6593,
1024,
1024,
2465,
1010,
3853,
1006,
1002,
10439,
1007,
1063,
2709,
2047,
343... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Common/GPM/Response.php | Response.get | public static function get($uri = '', $options = [], $callback = null)
{
if (!self::isCurlAvailable() && !self::isFopenAvailable()) {
throw new \RuntimeException('Could not start an HTTP request. `allow_url_open` is disabled and `cURL` is not available');
}
// check if this func... | php | public static function get($uri = '', $options = [], $callback = null)
{
if (!self::isCurlAvailable() && !self::isFopenAvailable()) {
throw new \RuntimeException('Could not start an HTTP request. `allow_url_open` is disabled and `cURL` is not available');
}
// check if this func... | [
"public",
"static",
"function",
"get",
"(",
"$",
"uri",
"=",
"''",
",",
"$",
"options",
"=",
"[",
"]",
",",
"$",
"callback",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"self",
"::",
"isCurlAvailable",
"(",
")",
"&&",
"!",
"self",
"::",
"isFopenAvailabl... | Makes a request to the URL by using the preferred method
@param string $uri URL to call
@param array $options An array of parameters for both `curl` and `fopen`
@param callable $callback Either a function or callback in array notation
@return string The response of the request | [
"Makes",
"a",
"request",
"to",
"the",
"URL",
"by",
"using",
"the",
"preferred",
"method"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/GPM/Response.php#L99-L181 | train | Get an HTTP request | [
30522,
2270,
10763,
3853,
2131,
1006,
1002,
24471,
2072,
1027,
1005,
1005,
1010,
1002,
7047,
1027,
1031,
1033,
1010,
1002,
2655,
5963,
1027,
19701,
1007,
1063,
2065,
1006,
999,
2969,
1024,
1024,
2003,
10841,
12190,
12462,
11733,
3468,
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/Cache/Simple/ArrayCache.php | ArrayCache.get | public function get($key, $default = null)
{
if (!\is_string($key) || !isset($this->expiries[$key])) {
CacheItem::validateKey($key);
}
if (!$isHit = isset($this->expiries[$key]) && ($this->expiries[$key] > microtime(true) || !$this->delete($key))) {
$this->values[$key... | php | public function get($key, $default = null)
{
if (!\is_string($key) || !isset($this->expiries[$key])) {
CacheItem::validateKey($key);
}
if (!$isHit = isset($this->expiries[$key]) && ($this->expiries[$key] > microtime(true) || !$this->delete($key))) {
$this->values[$key... | [
"public",
"function",
"get",
"(",
"$",
"key",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"\\",
"is_string",
"(",
"$",
"key",
")",
"||",
"!",
"isset",
"(",
"$",
"this",
"->",
"expiries",
"[",
"$",
"key",
"]",
")",
")",
"{",
"C... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Cache/Simple/ArrayCache.php#L50-L66 | train | Get value from cache | [
30522,
2270,
3853,
2131,
1006,
1002,
3145,
1010,
1002,
12398,
1027,
19701,
1007,
1063,
2065,
1006,
999,
1032,
2003,
1035,
5164,
1006,
1002,
3145,
1007,
1064,
1064,
999,
26354,
3388,
1006,
1002,
2023,
1011,
1028,
4654,
8197,
5134,
1031,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/Zend/Cache/Backend/Sqlite.php | Zend_Cache_Backend_Sqlite._buildStructure | private function _buildStructure()
{
$this->_query('DROP INDEX tag_id_index');
$this->_query('DROP INDEX tag_name_index');
$this->_query('DROP INDEX cache_id_expire_index');
$this->_query('DROP TABLE version');
$this->_query('DROP TABLE cache');
$this->_query('DROP TA... | php | private function _buildStructure()
{
$this->_query('DROP INDEX tag_id_index');
$this->_query('DROP INDEX tag_name_index');
$this->_query('DROP INDEX cache_id_expire_index');
$this->_query('DROP TABLE version');
$this->_query('DROP TABLE cache');
$this->_query('DROP TA... | [
"private",
"function",
"_buildStructure",
"(",
")",
"{",
"$",
"this",
"->",
"_query",
"(",
"'DROP INDEX tag_id_index'",
")",
";",
"$",
"this",
"->",
"_query",
"(",
"'DROP INDEX tag_name_index'",
")",
";",
"$",
"this",
"->",
"_query",
"(",
"'DROP INDEX cache_id_e... | Build the database structure
@return false | [
"Build",
"the",
"database",
"structure"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache/Backend/Sqlite.php#L559-L574 | train | Builds the structure of the structure | [
30522,
2797,
3853,
1035,
16473,
18300,
5397,
1006,
1007,
1063,
1002,
2023,
1011,
1028,
1035,
23032,
1006,
1005,
4530,
5950,
6415,
1035,
8909,
1035,
5950,
1005,
1007,
1025,
1002,
2023,
1011,
1028,
1035,
23032,
1006,
1005,
4530,
5950,
6415,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Framework/Object/Collection/ObjectExpressionVisitor.php | ObjectExpressionVisitor.getObjectFieldValue | public static function getObjectFieldValue($object, $field)
{
$op = $value = null;
$pos = strpos($field, '(');
if (false !== $pos) {
list ($op, $field) = explode('(', $field, 2);
$field = rtrim($field, ')');
}
if (isset($object[$field])) {
... | php | public static function getObjectFieldValue($object, $field)
{
$op = $value = null;
$pos = strpos($field, '(');
if (false !== $pos) {
list ($op, $field) = explode('(', $field, 2);
$field = rtrim($field, ')');
}
if (isset($object[$field])) {
... | [
"public",
"static",
"function",
"getObjectFieldValue",
"(",
"$",
"object",
",",
"$",
"field",
")",
"{",
"$",
"op",
"=",
"$",
"value",
"=",
"null",
";",
"$",
"pos",
"=",
"strpos",
"(",
"$",
"field",
",",
"'('",
")",
";",
"if",
"(",
"false",
"!==",
... | Accesses the field of a given object.
@param object $object
@param string $field
@return mixed | [
"Accesses",
"the",
"field",
"of",
"a",
"given",
"object",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Framework/Object/Collection/ObjectExpressionVisitor.php#L25-L60 | train | Get the value of a field in an object | [
30522,
2270,
10763,
3853,
2131,
16429,
20614,
3790,
10175,
5657,
1006,
1002,
4874,
1010,
1002,
2492,
1007,
1063,
1002,
6728,
1027,
1002,
3643,
1027,
19701,
1025,
1002,
13433,
2015,
1027,
2358,
14536,
2891,
1006,
1002,
2492,
1010,
1005,
1006... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/Zend/Db/Profiler.php | Zend_Db_Profiler.queryStart | public function queryStart($queryText, $queryType = null)
{
if (!$this->_enabled) {
return null;
}
// make sure we have a query type
if (null === $queryType) {
switch (strtolower(substr(ltrim($queryText), 0, 6))) {
case 'insert':
... | php | public function queryStart($queryText, $queryType = null)
{
if (!$this->_enabled) {
return null;
}
// make sure we have a query type
if (null === $queryType) {
switch (strtolower(substr(ltrim($queryText), 0, 6))) {
case 'insert':
... | [
"public",
"function",
"queryStart",
"(",
"$",
"queryText",
",",
"$",
"queryType",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_enabled",
")",
"{",
"return",
"null",
";",
"}",
"// make sure we have a query type",
"if",
"(",
"null",
"===",
"... | Starts a query. Creates a new query profile object (Zend_Db_Profiler_Query)
and returns the "query profiler handle". Run the query, then call
queryEnd() and pass it this handle to make the query as ended and
record the time. If the profiler is not enabled, this takes no
action and immediately returns null.
@param ... | [
"Starts",
"a",
"query",
".",
"Creates",
"a",
"new",
"query",
"profile",
"object",
"(",
"Zend_Db_Profiler_Query",
")",
"and",
"returns",
"the",
"query",
"profiler",
"handle",
".",
"Run",
"the",
"query",
"then",
"call",
"queryEnd",
"()",
"and",
"pass",
"it",
... | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Profiler.php#L251-L287 | train | Start a new query | [
30522,
2270,
3853,
23032,
14117,
2102,
1006,
1002,
23032,
18209,
1010,
1002,
23032,
13874,
1027,
19701,
1007,
1063,
2065,
1006,
999,
1002,
2023,
1011,
1028,
1035,
9124,
1007,
1063,
2709,
19701,
1025,
1065,
1013,
1013,
2191,
2469,
2057,
2031... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
slimphp/Slim | Slim/Http/Request.php | Request.getParsedBodyParam | public function getParsedBodyParam($key, $default = null)
{
$postParams = $this->getParsedBody();
$result = $default;
if (is_array($postParams) && isset($postParams[$key])) {
$result = $postParams[$key];
} elseif (is_object($postParams) && property_exists($postParams, $ke... | php | public function getParsedBodyParam($key, $default = null)
{
$postParams = $this->getParsedBody();
$result = $default;
if (is_array($postParams) && isset($postParams[$key])) {
$result = $postParams[$key];
} elseif (is_object($postParams) && property_exists($postParams, $ke... | [
"public",
"function",
"getParsedBodyParam",
"(",
"$",
"key",
",",
"$",
"default",
"=",
"null",
")",
"{",
"$",
"postParams",
"=",
"$",
"this",
"->",
"getParsedBody",
"(",
")",
";",
"$",
"result",
"=",
"$",
"default",
";",
"if",
"(",
"is_array",
"(",
"... | Fetch parameter value from request body.
Note: This method is not part of the PSR-7 standard.
@param string $key
@param mixed $default
@return mixed | [
"Fetch",
"parameter",
"value",
"from",
"request",
"body",
"."
] | ccef5f7d8bcd469d59cbe64f6210d83764f91543 | https://github.com/slimphp/Slim/blob/ccef5f7d8bcd469d59cbe64f6210d83764f91543/Slim/Http/Request.php#L1148-L1159 | train | Get Parsed Body Param | [
30522,
2270,
3853,
2131,
19362,
6924,
23684,
28689,
2213,
1006,
1002,
3145,
1010,
1002,
12398,
1027,
19701,
1007,
1063,
1002,
2695,
28689,
5244,
1027,
1002,
2023,
1011,
1028,
2131,
19362,
6924,
23684,
1006,
1007,
1025,
1002,
2765,
1027,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/UserId/Archiver.php | Archiver.aggregateUsers | protected function aggregateUsers()
{
$userIdFieldName = self::USER_ID_FIELD;
$visitorIdFieldName = self::VISITOR_ID_FIELD;
/** @var \Zend_Db_Statement $query */
$query = $this->getLogAggregator()->queryVisitsByDimension(
array(self::USER_ID_FIELD),
"log_visi... | php | protected function aggregateUsers()
{
$userIdFieldName = self::USER_ID_FIELD;
$visitorIdFieldName = self::VISITOR_ID_FIELD;
/** @var \Zend_Db_Statement $query */
$query = $this->getLogAggregator()->queryVisitsByDimension(
array(self::USER_ID_FIELD),
"log_visi... | [
"protected",
"function",
"aggregateUsers",
"(",
")",
"{",
"$",
"userIdFieldName",
"=",
"self",
"::",
"USER_ID_FIELD",
";",
"$",
"visitorIdFieldName",
"=",
"self",
"::",
"VISITOR_ID_FIELD",
";",
"/** @var \\Zend_Db_Statement $query */",
"$",
"query",
"=",
"$",
"this"... | Used to aggregate daily data per user ID | [
"Used",
"to",
"aggregate",
"daily",
"data",
"per",
"user",
"ID"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UserId/Archiver.php#L75-L97 | train | Aggregate visits by dimension | [
30522,
5123,
3853,
9572,
20330,
2015,
1006,
1007,
1063,
1002,
5310,
3593,
3790,
18442,
1027,
2969,
1024,
1024,
5310,
1035,
8909,
1035,
2492,
1025,
1002,
10367,
3593,
3790,
18442,
1027,
2969,
1024,
1024,
10367,
1035,
8909,
1035,
2492,
1025,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Intl/DateFormatter/DateFormat/DayOfWeekTransformer.php | DayOfWeekTransformer.format | public function format(\DateTime $dateTime, int $length): string
{
$dayOfWeek = $dateTime->format('l');
switch ($length) {
case 4:
return $dayOfWeek;
case 5:
return $dayOfWeek[0];
case 6:
return substr($dayOfWeek, 0,... | php | public function format(\DateTime $dateTime, int $length): string
{
$dayOfWeek = $dateTime->format('l');
switch ($length) {
case 4:
return $dayOfWeek;
case 5:
return $dayOfWeek[0];
case 6:
return substr($dayOfWeek, 0,... | [
"public",
"function",
"format",
"(",
"\\",
"DateTime",
"$",
"dateTime",
",",
"int",
"$",
"length",
")",
":",
"string",
"{",
"$",
"dayOfWeek",
"=",
"$",
"dateTime",
"->",
"format",
"(",
"'l'",
")",
";",
"switch",
"(",
"$",
"length",
")",
"{",
"case",
... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Intl/DateFormatter/DateFormat/DayOfWeekTransformer.php#L26-L39 | train | Returns the day of the week | [
30522,
2270,
3853,
4289,
1006,
1032,
3058,
7292,
1002,
3058,
7292,
1010,
20014,
1002,
3091,
1007,
1024,
5164,
1063,
1002,
2154,
11253,
28075,
1027,
1002,
3058,
7292,
1011,
1028,
4289,
1006,
1005,
1048,
1005,
1007,
1025,
6942,
1006,
1002,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
z-song/laravel-admin | src/Grid/Row.php | Row.column | public function column($name, $value = null)
{
if (is_null($value)) {
$column = Arr::get($this->data, $name);
return $this->output($column);
}
if ($value instanceof Closure) {
$value = $value->call($this, $this->column($name));
}
Arr::se... | php | public function column($name, $value = null)
{
if (is_null($value)) {
$column = Arr::get($this->data, $name);
return $this->output($column);
}
if ($value instanceof Closure) {
$value = $value->call($this, $this->column($name));
}
Arr::se... | [
"public",
"function",
"column",
"(",
"$",
"name",
",",
"$",
"value",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"value",
")",
")",
"{",
"$",
"column",
"=",
"Arr",
"::",
"get",
"(",
"$",
"this",
"->",
"data",
",",
"$",
"name",
")",
... | Get or set value of column in this row.
@param string $name
@param mixed $value
@return $this|mixed | [
"Get",
"or",
"set",
"value",
"of",
"column",
"in",
"this",
"row",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Grid/Row.php#L158-L173 | train | Set a column value | [
30522,
2270,
3853,
5930,
1006,
1002,
2171,
1010,
1002,
3643,
1027,
19701,
1007,
1063,
2065,
1006,
2003,
1035,
19701,
1006,
1002,
3643,
1007,
1007,
1063,
1002,
5930,
1027,
12098,
2099,
1024,
1024,
2131,
1006,
1002,
2023,
1011,
1028,
2951,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Finder/Iterator/ExcludeDirectoryFilterIterator.php | ExcludeDirectoryFilterIterator.accept | public function accept()
{
if ($this->isRecursive && isset($this->excludedDirs[$this->getFilename()]) && $this->isDir()) {
return false;
}
if ($this->excludedPattern) {
$path = $this->isDir() ? $this->current()->getRelativePathname() : $this->current()->getRelativePa... | php | public function accept()
{
if ($this->isRecursive && isset($this->excludedDirs[$this->getFilename()]) && $this->isDir()) {
return false;
}
if ($this->excludedPattern) {
$path = $this->isDir() ? $this->current()->getRelativePathname() : $this->current()->getRelativePa... | [
"public",
"function",
"accept",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isRecursive",
"&&",
"isset",
"(",
"$",
"this",
"->",
"excludedDirs",
"[",
"$",
"this",
"->",
"getFilename",
"(",
")",
"]",
")",
"&&",
"$",
"this",
"->",
"isDir",
"(",
")"... | Filters the iterator values.
@return bool True if the value should be kept, false otherwise | [
"Filters",
"the",
"iterator",
"values",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Finder/Iterator/ExcludeDirectoryFilterIterator.php#L55-L69 | train | Accept a file | [
30522,
2270,
3853,
5138,
1006,
1007,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
2003,
2890,
10841,
2869,
3512,
1004,
1004,
26354,
3388,
1006,
1002,
2023,
1011,
1028,
12421,
4305,
2869,
1031,
1002,
2023,
1011,
1028,
2131,
8873,
20844,
4168,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Common/Page/Page.php | Page.untranslatedLanguages | public function untranslatedLanguages($includeUnpublished = false)
{
$filename = substr($this->name, 0, -strlen($this->extension()));
$config = Grav::instance()['config'];
$languages = $config->get('system.languages.supported', []);
$untranslatedLanguages = [];
foreach ($lan... | php | public function untranslatedLanguages($includeUnpublished = false)
{
$filename = substr($this->name, 0, -strlen($this->extension()));
$config = Grav::instance()['config'];
$languages = $config->get('system.languages.supported', []);
$untranslatedLanguages = [];
foreach ($lan... | [
"public",
"function",
"untranslatedLanguages",
"(",
"$",
"includeUnpublished",
"=",
"false",
")",
"{",
"$",
"filename",
"=",
"substr",
"(",
"$",
"this",
"->",
"name",
",",
"0",
",",
"-",
"strlen",
"(",
"$",
"this",
"->",
"extension",
"(",
")",
")",
")"... | Return an array listing untranslated languages available
@param bool $includeUnpublished also list unpublished translations
@return array the page untranslated languages | [
"Return",
"an",
"array",
"listing",
"untranslated",
"languages",
"available"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Page/Page.php#L225-L246 | train | Get the list of languages that are not translated | [
30522,
2270,
3853,
4895,
6494,
3619,
13776,
25023,
6692,
8449,
1006,
1002,
2421,
4609,
14289,
16558,
13295,
1027,
6270,
1007,
1063,
1002,
5371,
18442,
1027,
4942,
3367,
2099,
1006,
1002,
2023,
1011,
1028,
2171,
1010,
1014,
1010,
1011,
2358,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/Referrers/Social.php | Social.getMainUrlFromName | public function getMainUrlFromName($social)
{
foreach ($this->getDefinitions() as $domain => $name) {
if ($name == $social) {
return $domain;
}
}
return null;
} | php | public function getMainUrlFromName($social)
{
foreach ($this->getDefinitions() as $domain => $name) {
if ($name == $social) {
return $domain;
}
}
return null;
} | [
"public",
"function",
"getMainUrlFromName",
"(",
"$",
"social",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getDefinitions",
"(",
")",
"as",
"$",
"domain",
"=>",
"$",
"name",
")",
"{",
"if",
"(",
"$",
"name",
"==",
"$",
"social",
")",
"{",
"return"... | Returns the main url of the given social network
@param string $social
@return string | [
"Returns",
"the",
"main",
"url",
"of",
"the",
"given",
"social",
"network"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Referrers/Social.php#L167-L177 | train | Get main url from social name | [
30522,
2270,
3853,
2131,
24238,
3126,
10270,
21716,
18442,
1006,
1002,
2591,
1007,
1063,
18921,
6776,
1006,
1002,
2023,
1011,
1028,
2131,
3207,
16294,
22753,
2015,
1006,
1007,
2004,
1002,
5884,
1027,
1028,
1002,
2171,
1007,
1063,
2065,
1006... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/Zend/Cache/Backend/File.php | Zend_Cache_Backend_File._remove | protected function _remove($file)
{
if (!is_file($file)) {
return false;
}
if (!@unlink($file)) {
# we can't remove the file (because of locks or any problem)
$this->_log("Zend_Cache_Backend_File::_remove() : we can't remove $file");
return fal... | php | protected function _remove($file)
{
if (!is_file($file)) {
return false;
}
if (!@unlink($file)) {
# we can't remove the file (because of locks or any problem)
$this->_log("Zend_Cache_Backend_File::_remove() : we can't remove $file");
return fal... | [
"protected",
"function",
"_remove",
"(",
"$",
"file",
")",
"{",
"if",
"(",
"!",
"is_file",
"(",
"$",
"file",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"!",
"@",
"unlink",
"(",
"$",
"file",
")",
")",
"{",
"# we can't remove the file (beca... | Remove a file
If we can't remove the file (because of locks or any problem), we will touch
the file to invalidate it
@param string $file Complete file path
@return boolean True if ok | [
"Remove",
"a",
"file"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache/Backend/File.php#L610-L621 | train | Remove a file | [
30522,
5123,
3853,
1035,
6366,
1006,
1002,
5371,
1007,
1063,
2065,
1006,
999,
2003,
1035,
5371,
1006,
1002,
5371,
1007,
1007,
1063,
2709,
6270,
1025,
1065,
2065,
1006,
999,
1030,
4895,
13767,
1006,
1002,
5371,
1007,
1007,
1063,
1001,
2057... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/Concurrency/DistributedList.php | DistributedList.add | public function add($item)
{
$allItems = $this->getAll();
if (is_array($item)) {
$allItems = array_merge($allItems, $item);
} else {
$allItems[] = $item;
}
$this->setAll($allItems);
} | php | public function add($item)
{
$allItems = $this->getAll();
if (is_array($item)) {
$allItems = array_merge($allItems, $item);
} else {
$allItems[] = $item;
}
$this->setAll($allItems);
} | [
"public",
"function",
"add",
"(",
"$",
"item",
")",
"{",
"$",
"allItems",
"=",
"$",
"this",
"->",
"getAll",
"(",
")",
";",
"if",
"(",
"is_array",
"(",
"$",
"item",
")",
")",
"{",
"$",
"allItems",
"=",
"array_merge",
"(",
"$",
"allItems",
",",
"$"... | Adds one or more items to the list in the option table.
@param string|array $item | [
"Adds",
"one",
"or",
"more",
"items",
"to",
"the",
"list",
"in",
"the",
"option",
"table",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Concurrency/DistributedList.php#L95-L105 | train | Add an item to the list of items in the language tree | [
30522,
2270,
3853,
5587,
1006,
1002,
8875,
1007,
1063,
1002,
2035,
4221,
5244,
1027,
1002,
30524,
1002,
2035,
4221,
5244,
1010,
1002,
8875,
1007,
1025,
1065,
2842,
1063,
1002,
2035,
4221,
5244,
1031,
1033,
1027,
1002,
8875,
1025,
1065,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/Db/Adapter/Pdo/Mysql.php | Mysql.getClientVersion | public function getClientVersion()
{
$this->_connect();
try {
$version = $this->_connection->getAttribute(PDO::ATTR_CLIENT_VERSION);
$matches = null;
if (preg_match('/((?:[0-9]{1,2}\.){1,3}[0-9]{1,2})/', $version, $matches)) {
return $matches[1];
... | php | public function getClientVersion()
{
$this->_connect();
try {
$version = $this->_connection->getAttribute(PDO::ATTR_CLIENT_VERSION);
$matches = null;
if (preg_match('/((?:[0-9]{1,2}\.){1,3}[0-9]{1,2})/', $version, $matches)) {
return $matches[1];
... | [
"public",
"function",
"getClientVersion",
"(",
")",
"{",
"$",
"this",
"->",
"_connect",
"(",
")",
";",
"try",
"{",
"$",
"version",
"=",
"$",
"this",
"->",
"_connection",
"->",
"getAttribute",
"(",
"PDO",
"::",
"ATTR_CLIENT_VERSION",
")",
";",
"$",
"match... | Retrieve client version in PHP style
@return string | [
"Retrieve",
"client",
"version",
"in",
"PHP",
"style"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Db/Adapter/Pdo/Mysql.php#L252-L265 | train | Get the client version | [
30522,
2270,
3853,
2131,
20464,
11638,
27774,
1006,
1007,
1063,
1002,
2023,
1011,
1028,
1035,
7532,
1006,
1007,
1025,
3046,
1063,
1002,
2544,
1027,
1002,
2023,
1011,
1028,
1035,
4434,
1011,
1028,
2131,
19321,
3089,
8569,
2618,
1006,
22851,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Intl/DateFormatter/DateFormat/FullTransformer.php | FullTransformer.calculateUnixTimestamp | protected function calculateUnixTimestamp(\DateTime $dateTime, array $options)
{
$options = $this->getDefaultValueForOptions($options);
$year = $options['year'];
$month = $options['month'];
$day = $options['day'];
$hour = $options['hour'];
$hourInstance = $options['h... | php | protected function calculateUnixTimestamp(\DateTime $dateTime, array $options)
{
$options = $this->getDefaultValueForOptions($options);
$year = $options['year'];
$month = $options['month'];
$day = $options['day'];
$hour = $options['hour'];
$hourInstance = $options['h... | [
"protected",
"function",
"calculateUnixTimestamp",
"(",
"\\",
"DateTime",
"$",
"dateTime",
",",
"array",
"$",
"options",
")",
"{",
"$",
"options",
"=",
"$",
"this",
"->",
"getDefaultValueForOptions",
"(",
"$",
"options",
")",
";",
"$",
"year",
"=",
"$",
"o... | Calculates the Unix timestamp based on the matched values by the reverse matching regular
expression of parse().
@param \DateTime $dateTime The DateTime object to be used to calculate the timestamp
@param array $options An array with the matched values to be used to calculate the timestamp
@return bool|int The c... | [
"Calculates",
"the",
"Unix",
"timestamp",
"based",
"on",
"the",
"matched",
"values",
"by",
"the",
"reverse",
"matching",
"regular",
"expression",
"of",
"parse",
"()",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Intl/DateFormatter/DateFormat/FullTransformer.php#L283-L325 | train | Calculates the unix timestamp | [
30522,
5123,
3853,
18422,
19496,
18413,
14428,
9153,
8737,
1006,
1032,
3058,
7292,
1002,
3058,
7292,
1010,
9140,
1002,
7047,
1007,
1063,
1002,
7047,
1027,
1002,
2023,
1011,
1028,
2131,
3207,
7011,
11314,
10175,
5657,
29278,
7361,
9285,
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/Routing/Route.php | Route.middleware | public function middleware($middleware = null)
{
if (is_null($middleware)) {
return (array) ($this->action['middleware'] ?? []);
}
if (is_string($middleware)) {
$middleware = func_get_args();
}
$this->action['middleware'] = array_merge(
(... | php | public function middleware($middleware = null)
{
if (is_null($middleware)) {
return (array) ($this->action['middleware'] ?? []);
}
if (is_string($middleware)) {
$middleware = func_get_args();
}
$this->action['middleware'] = array_merge(
(... | [
"public",
"function",
"middleware",
"(",
"$",
"middleware",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"middleware",
")",
")",
"{",
"return",
"(",
"array",
")",
"(",
"$",
"this",
"->",
"action",
"[",
"'middleware'",
"]",
"??",
"[",
"]",
... | Get or set the middlewares attached to the route.
@param array|string|null $middleware
@return $this|array | [
"Get",
"or",
"set",
"the",
"middlewares",
"attached",
"to",
"the",
"route",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/Route.php#L804-L819 | train | Add middleware to the action array | [
30522,
2270,
3853,
2690,
8059,
1006,
1002,
2690,
8059,
1027,
19701,
1007,
1063,
2065,
1006,
2003,
1035,
19701,
1006,
1002,
2690,
8059,
1007,
1007,
1063,
2709,
1006,
9140,
1007,
1006,
1002,
2023,
1011,
1028,
2895,
1031,
1005,
2690,
8059,
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... |
php-ai/php-ml | src/Classification/Ensemble/RandomForest.php | RandomForest.setFeatureSubsetRatio | public function setFeatureSubsetRatio($ratio): self
{
if (!is_string($ratio) && !is_float($ratio)) {
throw new InvalidArgumentException('Feature subset ratio must be a string or a float');
}
if (is_float($ratio) && ($ratio < 0.1 || $ratio > 1.0)) {
throw new InvalidA... | php | public function setFeatureSubsetRatio($ratio): self
{
if (!is_string($ratio) && !is_float($ratio)) {
throw new InvalidArgumentException('Feature subset ratio must be a string or a float');
}
if (is_float($ratio) && ($ratio < 0.1 || $ratio > 1.0)) {
throw new InvalidA... | [
"public",
"function",
"setFeatureSubsetRatio",
"(",
"$",
"ratio",
")",
":",
"self",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"ratio",
")",
"&&",
"!",
"is_float",
"(",
"$",
"ratio",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"'Feat... | This method is used to determine how many of the original columns (features)
will be used to construct subsets to train base classifiers.<br>
Allowed values: 'sqrt', 'log' or any float number between 0.1 and 1.0 <br>
Default value for the ratio is 'log' which results in log(numFeatures, 2) + 1
features to be taken in... | [
"This",
"method",
"is",
"used",
"to",
"determine",
"how",
"many",
"of",
"the",
"original",
"columns",
"(",
"features",
")",
"will",
"be",
"used",
"to",
"construct",
"subsets",
"to",
"train",
"base",
"classifiers",
".",
"<br",
">"
] | f6aa1a59b0525b8fca3d2786d661ab3e70904016 | https://github.com/php-ai/php-ml/blob/f6aa1a59b0525b8fca3d2786d661ab3e70904016/src/Classification/Ensemble/RandomForest.php#L46-L63 | train | Set Feature Subset Ratio | [
30522,
2270,
3853,
2275,
7959,
4017,
14900,
12083,
13462,
8609,
3695,
1006,
1002,
6463,
1007,
1024,
2969,
1063,
2065,
1006,
999,
2003,
1035,
5164,
1006,
1002,
6463,
1007,
1004,
1004,
999,
2003,
1035,
14257,
1006,
1002,
6463,
1007,
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... |
dompdf/dompdf | src/FrameReflower/Block.php | Block._calculate_restricted_height | protected function _calculate_restricted_height()
{
$frame = $this->_frame;
$style = $frame->get_style();
$content_height = $this->_calculate_content_height();
$cb = $frame->get_containing_block();
$height = $style->length_in_pt($style->height, $cb["h"]);
$top = $st... | php | protected function _calculate_restricted_height()
{
$frame = $this->_frame;
$style = $frame->get_style();
$content_height = $this->_calculate_content_height();
$cb = $frame->get_containing_block();
$height = $style->length_in_pt($style->height, $cb["h"]);
$top = $st... | [
"protected",
"function",
"_calculate_restricted_height",
"(",
")",
"{",
"$",
"frame",
"=",
"$",
"this",
"->",
"_frame",
";",
"$",
"style",
"=",
"$",
"frame",
"->",
"get_style",
"(",
")",
";",
"$",
"content_height",
"=",
"$",
"this",
"->",
"_calculate_conte... | Determine the frame's restricted height
@return array | [
"Determine",
"the",
"frame",
"s",
"restricted",
"height"
] | 75f13c700009be21a1965dc2c5b68a8708c22ba2 | https://github.com/dompdf/dompdf/blob/75f13c700009be21a1965dc2c5b68a8708c22ba2/src/FrameReflower/Block.php#L253-L423 | train | Calculates the restricted height of the frame. | [
30522,
5123,
3853,
1035,
18422,
1035,
7775,
1035,
4578,
1006,
1007,
1063,
1002,
4853,
1027,
1002,
2023,
1011,
1028,
1035,
4853,
1025,
1002,
2806,
1027,
1002,
4853,
1011,
1028,
2131,
1035,
2806,
1006,
1007,
1025,
1002,
4180,
1035,
4578,
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/Plugin/Manager.php | Manager.isPluginActivated | public function isPluginActivated($name)
{
return in_array($name, $this->pluginsToLoad)
|| ($this->doLoadAlwaysActivatedPlugins && $this->isPluginAlwaysActivated($name));
} | php | public function isPluginActivated($name)
{
return in_array($name, $this->pluginsToLoad)
|| ($this->doLoadAlwaysActivatedPlugins && $this->isPluginAlwaysActivated($name));
} | [
"public",
"function",
"isPluginActivated",
"(",
"$",
"name",
")",
"{",
"return",
"in_array",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"pluginsToLoad",
")",
"||",
"(",
"$",
"this",
"->",
"doLoadAlwaysActivatedPlugins",
"&&",
"$",
"this",
"->",
"isPluginAlway... | Returns `true` if a plugin has been activated.
@param string $name Name of plugin, eg, `'Actions'`.
@return bool
@api | [
"Returns",
"true",
"if",
"a",
"plugin",
"has",
"been",
"activated",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Plugin/Manager.php#L270-L274 | train | Checks if a plugin is activated in the current context | [
30522,
2270,
3853,
2003,
24759,
15916,
3981,
6593,
21967,
1006,
1002,
2171,
1007,
1063,
2709,
1999,
1035,
9140,
1006,
1002,
2171,
1010,
1002,
2023,
1011,
1028,
13354,
7076,
3406,
11066,
1007,
1064,
1064,
1006,
1002,
2023,
1011,
1028,
2079,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.convertSpecialGoalIds | protected static function convertSpecialGoalIds($idGoal)
{
if ($idGoal == Piwik::LABEL_ID_GOAL_IS_ECOMMERCE_ORDER) {
return GoalManager::IDGOAL_ORDER;
} else if ($idGoal == Piwik::LABEL_ID_GOAL_IS_ECOMMERCE_CART) {
return GoalManager::IDGOAL_CART;
} else {
... | php | protected static function convertSpecialGoalIds($idGoal)
{
if ($idGoal == Piwik::LABEL_ID_GOAL_IS_ECOMMERCE_ORDER) {
return GoalManager::IDGOAL_ORDER;
} else if ($idGoal == Piwik::LABEL_ID_GOAL_IS_ECOMMERCE_CART) {
return GoalManager::IDGOAL_CART;
} else {
... | [
"protected",
"static",
"function",
"convertSpecialGoalIds",
"(",
"$",
"idGoal",
")",
"{",
"if",
"(",
"$",
"idGoal",
"==",
"Piwik",
"::",
"LABEL_ID_GOAL_IS_ECOMMERCE_ORDER",
")",
"{",
"return",
"GoalManager",
"::",
"IDGOAL_ORDER",
";",
"}",
"else",
"if",
"(",
"... | Helper function that checks for special string goal IDs and converts them to
their integer equivalents.
Checks for the following values:
Piwik::LABEL_ID_GOAL_IS_ECOMMERCE_ORDER
Piwik::LABEL_ID_GOAL_IS_ECOMMERCE_CART
@param string|int $idGoal The goal id as an integer or a special string.
@return int The numeric goal ... | [
"Helper",
"function",
"that",
"checks",
"for",
"special",
"string",
"goal",
"IDs",
"and",
"converts",
"them",
"to",
"their",
"integer",
"equivalents",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Goals/API.php#L403-L412 | train | Convert special goal IDs to their equivalent equivalent | [
30522,
5123,
10763,
3853,
19884,
5051,
13247,
3995,
11475,
5104,
1006,
1002,
8909,
3995,
2389,
1007,
1063,
2065,
1006,
1002,
8909,
3995,
2389,
1027,
1027,
14255,
9148,
2243,
1024,
1024,
3830,
1035,
8909,
1035,
3125,
1035,
2003,
1035,
17338,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/Zend/Db/Profiler/Firebug.php | Zend_Db_Profiler_Firebug.updateMessageLabel | protected function updateMessageLabel()
{
if (!$this->_message) {
return;
}
$this->_message->setLabel(str_replace(array('%label%',
'%totalCount%',
'%totalDuration%'),
... | php | protected function updateMessageLabel()
{
if (!$this->_message) {
return;
}
$this->_message->setLabel(str_replace(array('%label%',
'%totalCount%',
'%totalDuration%'),
... | [
"protected",
"function",
"updateMessageLabel",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_message",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"_message",
"->",
"setLabel",
"(",
"str_replace",
"(",
"array",
"(",
"'%label%'",
",",
"'%totalC... | Update the label of the message holding the profile info.
@return void | [
"Update",
"the",
"label",
"of",
"the",
"message",
"holding",
"the",
"profile",
"info",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Profiler/Firebug.php#L148-L160 | train | Update message label | [
30522,
5123,
3853,
10651,
7834,
3736,
12439,
16336,
2140,
1006,
1007,
1063,
2065,
1006,
999,
1002,
2023,
1011,
1028,
1035,
4471,
1007,
1063,
2709,
1025,
1065,
1002,
2023,
1011,
1028,
1035,
4471,
1011,
1028,
2275,
20470,
2884,
1006,
2358,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Database/Migrations/Migrator.php | Migrator.reset | public function reset($paths = [], $pretend = false)
{
$this->notes = [];
// Next, we will reverse the migration list so we can run them back in the
// correct order for resetting this database. This will allow us to get
// the database back into its "empty" state ready for the migr... | php | public function reset($paths = [], $pretend = false)
{
$this->notes = [];
// Next, we will reverse the migration list so we can run them back in the
// correct order for resetting this database. This will allow us to get
// the database back into its "empty" state ready for the migr... | [
"public",
"function",
"reset",
"(",
"$",
"paths",
"=",
"[",
"]",
",",
"$",
"pretend",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"notes",
"=",
"[",
"]",
";",
"// Next, we will reverse the migration list so we can run them back in the",
"// correct order for resettin... | Rolls all of the currently applied migrations back.
@param array|string $paths
@param bool $pretend
@return array | [
"Rolls",
"all",
"of",
"the",
"currently",
"applied",
"migrations",
"back",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Migrations/Migrator.php#L295-L311 | train | Reset all migrations in the database | [
30522,
2270,
3853,
25141,
1006,
1002,
10425,
1027,
1031,
1033,
1010,
1002,
9811,
1027,
6270,
1007,
1063,
1002,
2023,
1011,
1028,
3964,
1027,
1031,
1033,
1025,
1013,
1013,
2279,
1010,
2057,
2097,
7901,
1996,
9230,
2862,
2061,
2057,
2064,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/system/classes/UpdateManager.php | UpdateManager.downloadPlugin | public function downloadPlugin($name, $hash, $installation = false)
{
$fileCode = $name . $hash;
$this->requestServerFile('plugin/get', $fileCode, $hash, [
'name' => $name,
'installation' => $installation ? 1 : 0
]);
} | php | public function downloadPlugin($name, $hash, $installation = false)
{
$fileCode = $name . $hash;
$this->requestServerFile('plugin/get', $fileCode, $hash, [
'name' => $name,
'installation' => $installation ? 1 : 0
]);
} | [
"public",
"function",
"downloadPlugin",
"(",
"$",
"name",
",",
"$",
"hash",
",",
"$",
"installation",
"=",
"false",
")",
"{",
"$",
"fileCode",
"=",
"$",
"name",
".",
"$",
"hash",
";",
"$",
"this",
"->",
"requestServerFile",
"(",
"'plugin/get'",
",",
"$... | Downloads a plugin from the update server.
@param string $name Plugin name.
@param string $hash Expected file hash.
@param boolean $installation Indicates whether this is a plugin installation request.
@return self | [
"Downloads",
"a",
"plugin",
"from",
"the",
"update",
"server",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/UpdateManager.php#L569-L576 | train | Download a plugin from the server | [
30522,
2270,
3853,
8816,
24759,
15916,
2378,
1006,
1002,
2171,
1010,
1002,
23325,
1010,
1002,
8272,
1027,
6270,
1007,
1063,
1002,
5371,
16044,
1027,
1002,
2171,
1012,
1002,
23325,
1025,
1002,
2023,
1011,
1028,
11186,
2121,
6299,
8873,
2571,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/Zend/Session/SaveHandler/DbTable.php | Zend_Session_SaveHandler_DbTable.destroy | public function destroy($id)
{
$return = false;
if ($this->delete($this->_getPrimary($id, self::PRIMARY_TYPE_WHERECLAUSE))) {
$return = true;
}
return $return;
} | php | public function destroy($id)
{
$return = false;
if ($this->delete($this->_getPrimary($id, self::PRIMARY_TYPE_WHERECLAUSE))) {
$return = true;
}
return $return;
} | [
"public",
"function",
"destroy",
"(",
"$",
"id",
")",
"{",
"$",
"return",
"=",
"false",
";",
"if",
"(",
"$",
"this",
"->",
"delete",
"(",
"$",
"this",
"->",
"_getPrimary",
"(",
"$",
"id",
",",
"self",
"::",
"PRIMARY_TYPE_WHERECLAUSE",
")",
")",
")",
... | Destroy session
@param string $id
@return boolean | [
"Destroy",
"session"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Session/SaveHandler/DbTable.php#L370-L379 | train | Destroy a record | [
30522,
2270,
3853,
6033,
1006,
1002,
8909,
1007,
1063,
1002,
2709,
1027,
6270,
1025,
2065,
1006,
1002,
2023,
1011,
1028,
3972,
12870,
1006,
1002,
2023,
1011,
1028,
1035,
2131,
18098,
9581,
2854,
1006,
1002,
8909,
1010,
2969,
1024,
1024,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToRfc3339Transformer.php | DateTimeToRfc3339Transformer.reverseTransform | public function reverseTransform($rfc3339)
{
if (!\is_string($rfc3339)) {
throw new TransformationFailedException('Expected a string.');
}
if ('' === $rfc3339) {
return;
}
if (!preg_match('/^(\d{4})-(\d{2})-(\d{2})T\d{2}:\d{2}(?::\d{2})?(?:\.\d+)?(?:... | php | public function reverseTransform($rfc3339)
{
if (!\is_string($rfc3339)) {
throw new TransformationFailedException('Expected a string.');
}
if ('' === $rfc3339) {
return;
}
if (!preg_match('/^(\d{4})-(\d{2})-(\d{2})T\d{2}:\d{2}(?::\d{2})?(?:\.\d+)?(?:... | [
"public",
"function",
"reverseTransform",
"(",
"$",
"rfc3339",
")",
"{",
"if",
"(",
"!",
"\\",
"is_string",
"(",
"$",
"rfc3339",
")",
")",
"{",
"throw",
"new",
"TransformationFailedException",
"(",
"'Expected a string.'",
")",
";",
"}",
"if",
"(",
"''",
"=... | Transforms a formatted string following RFC 3339 into a normalized date.
@param string $rfc3339 Formatted string
@return \DateTime Normalized date
@throws TransformationFailedException If the given value is not a string,
if the value could not be transformed | [
"Transforms",
"a",
"formatted",
"string",
"following",
"RFC",
"3339",
"into",
"a",
"normalized",
"date",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToRfc3339Transformer.php#L61-L90 | train | Transforms a date string into a \ DateTime object | [
30522,
2270,
3853,
7901,
6494,
3619,
14192,
1006,
1002,
14645,
22394,
23499,
1007,
1063,
2065,
1006,
999,
1032,
2003,
1035,
5164,
1006,
1002,
14645,
22394,
23499,
1007,
1007,
1063,
5466,
2047,
8651,
7011,
18450,
10288,
24422,
1006,
1005,
35... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Profiler/FileProfilerStorage.php | FileProfilerStorage.read | public function read($token)
{
if (!$token || !file_exists($file = $this->getFilename($token))) {
return;
}
return $this->createProfileFromData($token, unserialize(file_get_contents($file)));
} | php | public function read($token)
{
if (!$token || !file_exists($file = $this->getFilename($token))) {
return;
}
return $this->createProfileFromData($token, unserialize(file_get_contents($file)));
} | [
"public",
"function",
"read",
"(",
"$",
"token",
")",
"{",
"if",
"(",
"!",
"$",
"token",
"||",
"!",
"file_exists",
"(",
"$",
"file",
"=",
"$",
"this",
"->",
"getFilename",
"(",
"$",
"token",
")",
")",
")",
"{",
"return",
";",
"}",
"return",
"$",
... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpKernel/Profiler/FileProfilerStorage.php#L116-L123 | train | Read a profile from the file | [
30522,
2270,
3853,
3191,
1006,
1002,
19204,
1007,
1063,
2065,
1006,
999,
1002,
19204,
1064,
1064,
999,
5371,
1035,
6526,
1006,
1002,
5371,
1027,
1002,
2023,
1011,
1028,
2131,
8873,
20844,
4168,
1006,
1002,
19204,
1007,
1007,
1007,
1063,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Common/Assets/Pipeline.php | Pipeline.renderJs | public function renderJs($assets, $group, $attributes = [])
{
// temporary list of assets to pipeline
$inline_group = false;
if (array_key_exists('loading', $attributes) && $attributes['loading'] === 'inline') {
$inline_group = true;
unset($attributes['loading']);
... | php | public function renderJs($assets, $group, $attributes = [])
{
// temporary list of assets to pipeline
$inline_group = false;
if (array_key_exists('loading', $attributes) && $attributes['loading'] === 'inline') {
$inline_group = true;
unset($attributes['loading']);
... | [
"public",
"function",
"renderJs",
"(",
"$",
"assets",
",",
"$",
"group",
",",
"$",
"attributes",
"=",
"[",
"]",
")",
"{",
"// temporary list of assets to pipeline",
"$",
"inline_group",
"=",
"false",
";",
"if",
"(",
"array_key_exists",
"(",
"'loading'",
",",
... | Minify and concatenate JS files.
@param array $assets
@param string $group
@param array $attributes
@return bool|string URL or generated content if available, else false | [
"Minify",
"and",
"concatenate",
"JS",
"files",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Assets/Pipeline.php#L158-L211 | train | Render JS assets | [
30522,
2270,
3853,
17552,
22578,
1006,
1002,
7045,
1010,
1002,
2177,
1010,
1002,
12332,
1027,
1031,
1033,
1007,
1063,
1013,
1013,
5741,
2862,
1997,
7045,
2000,
13117,
1002,
23881,
1035,
2177,
1027,
6270,
1025,
2065,
1006,
30524,
1005,
1010,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/cms/controllers/Index.php | Index.loadTemplate | protected function loadTemplate($type, $path)
{
$class = $this->resolveTypeClassName($type);
if (!($template = call_user_func([$class, 'load'], $this->theme, $path))) {
throw new ApplicationException(trans('cms::lang.template.not_found'));
}
/**
* @event cms.te... | php | protected function loadTemplate($type, $path)
{
$class = $this->resolveTypeClassName($type);
if (!($template = call_user_func([$class, 'load'], $this->theme, $path))) {
throw new ApplicationException(trans('cms::lang.template.not_found'));
}
/**
* @event cms.te... | [
"protected",
"function",
"loadTemplate",
"(",
"$",
"type",
",",
"$",
"path",
")",
"{",
"$",
"class",
"=",
"$",
"this",
"->",
"resolveTypeClassName",
"(",
"$",
"type",
")",
";",
"if",
"(",
"!",
"(",
"$",
"template",
"=",
"call_user_func",
"(",
"[",
"$... | Returns an existing template of a given type
@param string $type
@param string $path
@return mixed | [
"Returns",
"an",
"existing",
"template",
"of",
"a",
"given",
"type"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/controllers/Index.php#L443-L471 | train | Loads a template from the given type and path | [
30522,
5123,
3853,
7170,
18532,
15725,
1006,
1002,
2828,
1010,
1002,
4130,
1007,
1063,
1002,
2465,
1027,
1002,
2023,
1011,
1028,
10663,
13874,
26266,
18442,
1006,
1002,
2828,
1007,
1025,
2065,
1006,
999,
1006,
1002,
23561,
1027,
2655,
1035,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
slimphp/Slim | Slim/Handlers/Error.php | Error.renderXmlErrorMessage | protected function renderXmlErrorMessage(Exception $exception)
{
$xml = "<error>\n <message>Slim Application Error</message>\n";
if ($this->displayErrorDetails) {
do {
$xml .= " <exception>\n";
$xml .= " <type>" . get_class($exception) . "</type>\n";
... | php | protected function renderXmlErrorMessage(Exception $exception)
{
$xml = "<error>\n <message>Slim Application Error</message>\n";
if ($this->displayErrorDetails) {
do {
$xml .= " <exception>\n";
$xml .= " <type>" . get_class($exception) . "</type>\n";
... | [
"protected",
"function",
"renderXmlErrorMessage",
"(",
"Exception",
"$",
"exception",
")",
"{",
"$",
"xml",
"=",
"\"<error>\\n <message>Slim Application Error</message>\\n\"",
";",
"if",
"(",
"$",
"this",
"->",
"displayErrorDetails",
")",
"{",
"do",
"{",
"$",
"xml"... | Render XML error
@param Exception $exception
@return string | [
"Render",
"XML",
"error"
] | ccef5f7d8bcd469d59cbe64f6210d83764f91543 | https://github.com/slimphp/Slim/blob/ccef5f7d8bcd469d59cbe64f6210d83764f91543/Slim/Handlers/Error.php#L190-L208 | train | Render XML error message | [
30522,
5123,
3853,
17552,
2595,
18602,
29165,
7834,
3736,
3351,
1006,
6453,
1002,
6453,
1007,
1063,
1002,
20950,
1027,
1000,
1026,
7561,
1028,
1032,
1050,
1026,
4471,
1028,
11754,
4646,
7561,
1026,
1013,
4471,
1028,
1032,
1050,
1000,
1025,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Command/RouterDebugCommand.php | RouterDebugCommand.execute | protected function execute(InputInterface $input, OutputInterface $output)
{
$io = new SymfonyStyle($input, $output);
$name = $input->getArgument('name');
$helper = new DescriptorHelper($this->fileLinkFormatter);
$routes = $this->router->getRouteCollection();
if ($name) {
... | php | protected function execute(InputInterface $input, OutputInterface $output)
{
$io = new SymfonyStyle($input, $output);
$name = $input->getArgument('name');
$helper = new DescriptorHelper($this->fileLinkFormatter);
$routes = $this->router->getRouteCollection();
if ($name) {
... | [
"protected",
"function",
"execute",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"io",
"=",
"new",
"SymfonyStyle",
"(",
"$",
"input",
",",
"$",
"output",
")",
";",
"$",
"name",
"=",
"$",
"input",
"->",
"get... | {@inheritdoc}
@throws InvalidArgumentException When route does not exist | [
"{",
"@inheritdoc",
"}"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bundle/FrameworkBundle/Command/RouterDebugCommand.php#L76-L108 | train | Describes the page | [
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... |
getgrav/grav | system/src/Grav/Common/Twig/TwigExtension.php | TwigExtension.jsonDecodeFilter | public function jsonDecodeFilter($str, $assoc = false, $depth = 512, $options = 0)
{
return json_decode(html_entity_decode($str), $assoc, $depth, $options);
} | php | public function jsonDecodeFilter($str, $assoc = false, $depth = 512, $options = 0)
{
return json_decode(html_entity_decode($str), $assoc, $depth, $options);
} | [
"public",
"function",
"jsonDecodeFilter",
"(",
"$",
"str",
",",
"$",
"assoc",
"=",
"false",
",",
"$",
"depth",
"=",
"512",
",",
"$",
"options",
"=",
"0",
")",
"{",
"return",
"json_decode",
"(",
"html_entity_decode",
"(",
"$",
"str",
")",
",",
"$",
"a... | Decodes string from JSON.
@param string $str
@param bool $assoc
@param int $depth
@param int $options
@return array | [
"Decodes",
"string",
"from",
"JSON",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Twig/TwigExtension.php#L1054-L1057 | train | JSON decode Filter | [
30522,
2270,
3853,
1046,
3385,
3207,
16044,
8873,
21928,
1006,
1002,
2358,
2099,
1010,
1002,
4632,
10085,
1027,
6270,
1010,
1002,
5995,
1027,
24406,
1010,
1002,
7047,
1027,
1014,
1007,
1063,
2709,
1046,
3385,
1035,
21933,
3207,
1006,
16129,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Columns/Dimension.php | Dimension.configureMetrics | public function configureMetrics(MetricsList $metricsList, DimensionMetricFactory $dimensionMetricFactory)
{
if ($this->getMetricId() && $this->dbTableName && $this->columnName && $this->getNamePlural()) {
if (in_array($this->getType(), array(self::TYPE_DATETIME, self::TYPE_DATE, self::TYPE_TIME... | php | public function configureMetrics(MetricsList $metricsList, DimensionMetricFactory $dimensionMetricFactory)
{
if ($this->getMetricId() && $this->dbTableName && $this->columnName && $this->getNamePlural()) {
if (in_array($this->getType(), array(self::TYPE_DATETIME, self::TYPE_DATE, self::TYPE_TIME... | [
"public",
"function",
"configureMetrics",
"(",
"MetricsList",
"$",
"metricsList",
",",
"DimensionMetricFactory",
"$",
"dimensionMetricFactory",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getMetricId",
"(",
")",
"&&",
"$",
"this",
"->",
"dbTableName",
"&&",
"$",
... | Configures metrics for this dimension.
For certain dimension types, some metrics will be added automatically.
@param MetricsList $metricsList
@param DimensionMetricFactory $dimensionMetricFactory | [
"Configures",
"metrics",
"for",
"this",
"dimension",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Columns/Dimension.php#L492-L512 | train | This method will add the metrics to the list of metrics that are stored in the database | [
30522,
2270,
3853,
9530,
8873,
27390,
21382,
29392,
1006,
12046,
14540,
2923,
1002,
12046,
14540,
2923,
1010,
9812,
12589,
21450,
1002,
9812,
12589,
21450,
1007,
1063,
2065,
30524,
10880,
18442,
1004,
1004,
1002,
2023,
1011,
1028,
5930,
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... |
symfony/symfony | src/Symfony/Component/Validator/Context/ExecutionContext.php | ExecutionContext.addViolation | public function addViolation($message, array $parameters = [])
{
$this->violations->add(new ConstraintViolation(
$this->translator->trans($message, $parameters, $this->translationDomain),
$message,
$parameters,
$this->root,
$this->propertyPath,
... | php | public function addViolation($message, array $parameters = [])
{
$this->violations->add(new ConstraintViolation(
$this->translator->trans($message, $parameters, $this->translationDomain),
$message,
$parameters,
$this->root,
$this->propertyPath,
... | [
"public",
"function",
"addViolation",
"(",
"$",
"message",
",",
"array",
"$",
"parameters",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"violations",
"->",
"add",
"(",
"new",
"ConstraintViolation",
"(",
"$",
"this",
"->",
"translator",
"->",
"trans",
"("... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Validator/Context/ExecutionContext.php#L186-L199 | train | Adds a constraint violation to the list of violations | [
30522,
2270,
3853,
5587,
25500,
13490,
1006,
1002,
4471,
1010,
9140,
1002,
11709,
1027,
1031,
1033,
1007,
1063,
1002,
2023,
1011,
1028,
13302,
1011,
1028,
5587,
1006,
2047,
27142,
25500,
13490,
1006,
1002,
2023,
1011,
1028,
11403,
1011,
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... |
overtrue/wechat | src/OfficialAccount/Broadcasting/Client.php | Client.sendCard | public function sendCard(string $cardId, $reception = null, array $attributes = [])
{
return $this->sendMessage(new Card($cardId), $reception, $attributes);
} | php | public function sendCard(string $cardId, $reception = null, array $attributes = [])
{
return $this->sendMessage(new Card($cardId), $reception, $attributes);
} | [
"public",
"function",
"sendCard",
"(",
"string",
"$",
"cardId",
",",
"$",
"reception",
"=",
"null",
",",
"array",
"$",
"attributes",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"sendMessage",
"(",
"new",
"Card",
"(",
"$",
"cardId",
")",
","... | Send a card message.
@param string $cardId
@param mixed $reception
@param array $attributes
@return \Psr\Http\Message\ResponseInterface|\EasyWeChat\Kernel\Support\Collection|array|object|string
@throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException
@throws \EasyWeChat\Kernel\Exceptions\RuntimeException | [
"Send",
"a",
"card",
"message",
"."
] | 120c72faaa93c270365bc75c73c362d5fd583209 | https://github.com/overtrue/wechat/blob/120c72faaa93c270365bc75c73c362d5fd583209/src/OfficialAccount/Broadcasting/Client.php#L214-L217 | train | Send a card message | [
30522,
2270,
3853,
4604,
11522,
1006,
5164,
1002,
4003,
3593,
1010,
1002,
7684,
1027,
19701,
1010,
9140,
1002,
12332,
1027,
1031,
1033,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
4604,
7834,
3736,
3351,
1006,
2047,
4003,
1006,
1002,
4003,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Common/User/FlexUser/User.php | User.toYaml | public function toYaml($inline = 5, $indent = 2)
{
$yaml = new YamlFormatter(['inline' => $inline, 'indent' => $indent]);
return $yaml->encode($this->toArray());
} | php | public function toYaml($inline = 5, $indent = 2)
{
$yaml = new YamlFormatter(['inline' => $inline, 'indent' => $indent]);
return $yaml->encode($this->toArray());
} | [
"public",
"function",
"toYaml",
"(",
"$",
"inline",
"=",
"5",
",",
"$",
"indent",
"=",
"2",
")",
"{",
"$",
"yaml",
"=",
"new",
"YamlFormatter",
"(",
"[",
"'inline'",
"=>",
"$",
"inline",
",",
"'indent'",
"=>",
"$",
"indent",
"]",
")",
";",
"return"... | Convert object into YAML string.
@param int $inline The level where you switch to inline YAML.
@param int $indent The amount of spaces to use for indentation of nested nodes.
@return string A YAML string representing the object. | [
"Convert",
"object",
"into",
"YAML",
"string",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/User/FlexUser/User.php#L218-L223 | train | Returns the current array as YAML. | [
30522,
2270,
3853,
9121,
3286,
2140,
1006,
1002,
23881,
1027,
1019,
1010,
1002,
27427,
4765,
1027,
1016,
1007,
1063,
1002,
8038,
19968,
1027,
2047,
8038,
19968,
14192,
20097,
1006,
1031,
1005,
23881,
1005,
1027,
1028,
1002,
23881,
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... |
octobercms/october | modules/cms/classes/ComponentPartial.php | ComponentPartial.validateFileName | protected function validateFileName($fileName)
{
if (!FileHelper::validatePath($fileName, $this->maxNesting)) {
throw new ApplicationException(Lang::get('cms::lang.cms_object.invalid_file', [
'name' => $fileName
]));
}
if (!strlen(File::extension($fil... | php | protected function validateFileName($fileName)
{
if (!FileHelper::validatePath($fileName, $this->maxNesting)) {
throw new ApplicationException(Lang::get('cms::lang.cms_object.invalid_file', [
'name' => $fileName
]));
}
if (!strlen(File::extension($fil... | [
"protected",
"function",
"validateFileName",
"(",
"$",
"fileName",
")",
"{",
"if",
"(",
"!",
"FileHelper",
"::",
"validatePath",
"(",
"$",
"fileName",
",",
"$",
"this",
"->",
"maxNesting",
")",
")",
"{",
"throw",
"new",
"ApplicationException",
"(",
"Lang",
... | Checks the supplied file name for validity.
@param string $fileName
@return string | [
"Checks",
"the",
"supplied",
"file",
"name",
"for",
"validity",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/ComponentPartial.php#L161-L174 | train | Validate a file name | [
30522,
5123,
3853,
9398,
3686,
8873,
20844,
4168,
1006,
1002,
5371,
18442,
1007,
1063,
2065,
1006,
999,
5371,
16001,
4842,
1024,
1024,
9398,
3686,
15069,
1006,
1002,
5371,
18442,
1010,
1002,
2023,
1011,
1028,
4098,
5267,
3436,
1007,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Common/User/Traits/UserTrait.php | UserTrait.getAvatarUrl | public function getAvatarUrl(): string
{
// Try to locate avatar image.
$avatar = $this->getAvatarImage();
if ($avatar) {
return $avatar->url();
}
// Try if avatar is a sting (URL).
$avatar = $this->get('avatar');
if (\is_string($avatar)) {
... | php | public function getAvatarUrl(): string
{
// Try to locate avatar image.
$avatar = $this->getAvatarImage();
if ($avatar) {
return $avatar->url();
}
// Try if avatar is a sting (URL).
$avatar = $this->get('avatar');
if (\is_string($avatar)) {
... | [
"public",
"function",
"getAvatarUrl",
"(",
")",
":",
"string",
"{",
"// Try to locate avatar image.",
"$",
"avatar",
"=",
"$",
"this",
"->",
"getAvatarImage",
"(",
")",
";",
"if",
"(",
"$",
"avatar",
")",
"{",
"return",
"$",
"avatar",
"->",
"url",
"(",
"... | Return the User's avatar URL
@return string | [
"Return",
"the",
"User",
"s",
"avatar",
"URL"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/User/Traits/UserTrait.php#L135-L165 | train | Return the avatar URL of the user | [
30522,
2270,
3853,
2131,
12462,
7559,
3126,
2140,
1006,
1007,
1024,
5164,
1063,
1013,
1013,
3046,
2000,
12453,
22128,
3746,
1012,
1002,
22128,
1027,
1002,
2023,
1011,
1028,
2131,
12462,
7559,
9581,
3351,
1006,
1007,
1025,
2065,
1006,
1002,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Cache/Traits/FilesystemCommonTrait.php | FilesystemCommonTrait.doClear | protected function doClear($namespace)
{
$ok = true;
foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($this->directory, \FilesystemIterator::SKIP_DOTS)) as $file) {
$ok = ($file->isDir() || $this->doUnlink($file) || !file_exists($file)) && $ok;
}
... | php | protected function doClear($namespace)
{
$ok = true;
foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($this->directory, \FilesystemIterator::SKIP_DOTS)) as $file) {
$ok = ($file->isDir() || $this->doUnlink($file) || !file_exists($file)) && $ok;
}
... | [
"protected",
"function",
"doClear",
"(",
"$",
"namespace",
")",
"{",
"$",
"ok",
"=",
"true",
";",
"foreach",
"(",
"new",
"\\",
"RecursiveIteratorIterator",
"(",
"new",
"\\",
"RecursiveDirectoryIterator",
"(",
"$",
"this",
"->",
"directory",
",",
"\\",
"Files... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Cache/Traits/FilesystemCommonTrait.php#L54-L63 | train | Clear all cache files in the directory | [
30522,
5123,
3853,
9986,
19738,
2099,
1006,
1002,
3415,
15327,
1007,
1063,
1002,
7929,
1027,
2995,
1025,
18921,
6776,
1006,
2047,
1032,
28667,
9236,
3512,
21646,
8844,
21646,
8844,
1006,
2047,
1032,
28667,
9236,
3512,
4305,
2890,
16761,
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... |
symfony/symfony | src/Symfony/Component/Console/Output/BufferedOutput.php | BufferedOutput.doWrite | protected function doWrite($message, $newline)
{
$this->buffer .= $message;
if ($newline) {
$this->buffer .= PHP_EOL;
}
} | php | protected function doWrite($message, $newline)
{
$this->buffer .= $message;
if ($newline) {
$this->buffer .= PHP_EOL;
}
} | [
"protected",
"function",
"doWrite",
"(",
"$",
"message",
",",
"$",
"newline",
")",
"{",
"$",
"this",
"->",
"buffer",
".=",
"$",
"message",
";",
"if",
"(",
"$",
"newline",
")",
"{",
"$",
"this",
"->",
"buffer",
".=",
"PHP_EOL",
";",
"}",
"}"
] | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Output/BufferedOutput.php#L37-L44 | train | Write a message to the buffer | [
30522,
5123,
3853,
23268,
17625,
1006,
1002,
4471,
1010,
1002,
2047,
4179,
1007,
1063,
1002,
2023,
1011,
1028,
17698,
1012,
1027,
1002,
4471,
1025,
2065,
1006,
1002,
2047,
4179,
1007,
1063,
1002,
2023,
1011,
1028,
17698,
1012,
1027,
25718,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Sqlsrv.php | Zend_Db_Adapter_Sqlsrv._quote | protected function _quote($value)
{
if (is_int($value)) {
return $value;
} elseif (is_float($value)) {
return sprintf('%F', $value);
}
return "'" . str_replace("'", "''", $value) . "'";
} | php | protected function _quote($value)
{
if (is_int($value)) {
return $value;
} elseif (is_float($value)) {
return sprintf('%F', $value);
}
return "'" . str_replace("'", "''", $value) . "'";
} | [
"protected",
"function",
"_quote",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"is_int",
"(",
"$",
"value",
")",
")",
"{",
"return",
"$",
"value",
";",
"}",
"elseif",
"(",
"is_float",
"(",
"$",
"value",
")",
")",
"{",
"return",
"sprintf",
"(",
"'%F'",
... | Quote a raw string.
@param string $value Raw string
@return string Quoted string | [
"Quote",
"a",
"raw",
"string",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Adapter/Sqlsrv.php#L309-L318 | 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,
1007,
1063,
2709,
1002,
3643,
1025,
1065,
2842,
10128,
1006,
2003,
1035,
14257,
1006,
1002,
3643,
1007,
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... |
getgrav/grav | system/src/Grav/Common/Twig/TokenParser/TwigTokenParserSwitch.php | TwigTokenParserSwitch.parse | public function parse(Token $token)
{
$lineno = $token->getLine();
$stream = $this->parser->getStream();
$name = $this->parser->getExpressionParser()->parseExpression();
$stream->expect(Token::BLOCK_END_TYPE);
// There can be some whitespace between the {% switch %} and fir... | php | public function parse(Token $token)
{
$lineno = $token->getLine();
$stream = $this->parser->getStream();
$name = $this->parser->getExpressionParser()->parseExpression();
$stream->expect(Token::BLOCK_END_TYPE);
// There can be some whitespace between the {% switch %} and fir... | [
"public",
"function",
"parse",
"(",
"Token",
"$",
"token",
")",
"{",
"$",
"lineno",
"=",
"$",
"token",
"->",
"getLine",
"(",
")",
";",
"$",
"stream",
"=",
"$",
"this",
"->",
"parser",
"->",
"getStream",
"(",
")",
";",
"$",
"name",
"=",
"$",
"this... | {@inheritdoc} | [
"{"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Twig/TokenParser/TwigTokenParserSwitch.php#L36-L99 | train | Parses the template | [
30522,
2270,
3853,
11968,
3366,
1006,
19204,
1002,
19204,
1007,
1063,
1002,
17517,
2080,
1027,
1002,
19204,
1011,
1028,
2131,
4179,
1006,
1007,
1025,
1002,
5460,
1027,
1002,
2023,
1011,
1028,
11968,
8043,
1011,
1028,
4152,
25379,
1006,
1007... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/DataTable/Renderer/Html.php | Html.renderTable | protected function renderTable($table)
{
if (is_array($table)) {
// convert array to DataTable
$table = DataTable::makeFromSimpleArray($table);
}
if ($table instanceof DataTable\Map) {
foreach ($table->getDataTables() as $date => $subtable) {
... | php | protected function renderTable($table)
{
if (is_array($table)) {
// convert array to DataTable
$table = DataTable::makeFromSimpleArray($table);
}
if ($table instanceof DataTable\Map) {
foreach ($table->getDataTables() as $date => $subtable) {
... | [
"protected",
"function",
"renderTable",
"(",
"$",
"table",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"table",
")",
")",
"{",
"// convert array to DataTable",
"$",
"table",
"=",
"DataTable",
"::",
"makeFromSimpleArray",
"(",
"$",
"table",
")",
";",
"}",
"i... | Computes the output for the given data table
@param DataTable $table
@return string | [
"Computes",
"the",
"output",
"for",
"the",
"given",
"data",
"table"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable/Renderer/Html.php#L57-L81 | train | Render the table | [
30522,
5123,
3853,
17552,
10880,
1006,
1002,
2795,
1007,
1063,
2065,
1006,
2003,
1035,
9140,
1006,
1002,
2795,
1007,
1007,
1063,
1013,
1013,
10463,
9140,
2000,
2951,
10880,
1002,
2795,
1027,
2951,
10880,
1024,
1024,
2191,
19699,
22225,
5714... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.evalTimesinceTypeValue | protected function evalTimesinceTypeValue($record, $column, $value)
{
if ($value === null) {
return null;
}
$dateTime = $this->validateDateTimeValue($value, $column);
$value = DateTimeHelper::timeSince($dateTime);
$options = [
'defaultValue' => $val... | php | protected function evalTimesinceTypeValue($record, $column, $value)
{
if ($value === null) {
return null;
}
$dateTime = $this->validateDateTimeValue($value, $column);
$value = DateTimeHelper::timeSince($dateTime);
$options = [
'defaultValue' => $val... | [
"protected",
"function",
"evalTimesinceTypeValue",
"(",
"$",
"record",
",",
"$",
"column",
",",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"===",
"null",
")",
"{",
"return",
"null",
";",
"}",
"$",
"dateTime",
"=",
"$",
"this",
"->",
"validateDate... | Process as diff for humans (1 min ago) | [
"Process",
"as",
"diff",
"for",
"humans",
"(",
"1",
"min",
"ago",
")"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/Lists.php#L1303-L1323 | train | Evaluate the timesince type value | [
30522,
5123,
3853,
9345,
7096,
14428,
11493,
3401,
13874,
10175,
5657,
1006,
1002,
2501,
1010,
1002,
5930,
1010,
1002,
3643,
1007,
1063,
2065,
1006,
1002,
3643,
1027,
1027,
1027,
19701,
1007,
1063,
2709,
19701,
1025,
1065,
1002,
3058,
7292,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/Db/Schema/Mysql.php | Mysql.dropDatabase | public function dropDatabase($dbName = null)
{
$dbName = $dbName ?: $this->getDbName();
$dbName = str_replace('`', '', $dbName);
Db::exec("DROP DATABASE IF EXISTS `" . $dbName . "`");
} | php | public function dropDatabase($dbName = null)
{
$dbName = $dbName ?: $this->getDbName();
$dbName = str_replace('`', '', $dbName);
Db::exec("DROP DATABASE IF EXISTS `" . $dbName . "`");
} | [
"public",
"function",
"dropDatabase",
"(",
"$",
"dbName",
"=",
"null",
")",
"{",
"$",
"dbName",
"=",
"$",
"dbName",
"?",
":",
"$",
"this",
"->",
"getDbName",
"(",
")",
";",
"$",
"dbName",
"=",
"str_replace",
"(",
"'`'",
",",
"''",
",",
"$",
"dbName... | Drop database | [
"Drop",
"database"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Db/Schema/Mysql.php#L465-L470 | train | Drop database if exists | [
30522,
2270,
3853,
4530,
2850,
2696,
15058,
1006,
1002,
16962,
18442,
1027,
19701,
1007,
1063,
1002,
16962,
18442,
1027,
1002,
16962,
18442,
1029,
1024,
1002,
2023,
1011,
1028,
2131,
18939,
18442,
1006,
1007,
1025,
1002,
16962,
18442,
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 | core/DataAccess/LogQueryBuilder/JoinGenerator.php | JoinGenerator.generateNonVisitJoins | protected function generateNonVisitJoins($tableName, $tableNameToJoin, $index)
{
$logTable = $this->tables->getLogTable($tableName);
$logTableToJoin = $this->tables->getLogTable($tableNameToJoin);
$nonVisitJoin = sprintf("%s.%s = %s.%s", $logTableToJoin->getName(), $logTableToJoin->getColum... | php | protected function generateNonVisitJoins($tableName, $tableNameToJoin, $index)
{
$logTable = $this->tables->getLogTable($tableName);
$logTableToJoin = $this->tables->getLogTable($tableNameToJoin);
$nonVisitJoin = sprintf("%s.%s = %s.%s", $logTableToJoin->getName(), $logTableToJoin->getColum... | [
"protected",
"function",
"generateNonVisitJoins",
"(",
"$",
"tableName",
",",
"$",
"tableNameToJoin",
",",
"$",
"index",
")",
"{",
"$",
"logTable",
"=",
"$",
"this",
"->",
"tables",
"->",
"getLogTable",
"(",
"$",
"tableName",
")",
";",
"$",
"logTableToJoin",... | This code is a bit tricky. We have to execute this right at the beginning before actually iterating over all the
tables and generating the join string as we may have to delete a table from the tables. If we did not delete
this table upfront, we would have maybe already added a joinString for that table, even though it ... | [
"This",
"code",
"is",
"a",
"bit",
"tricky",
".",
"We",
"have",
"to",
"execute",
"this",
"right",
"at",
"the",
"beginning",
"before",
"actually",
"iterating",
"over",
"all",
"the",
"tables",
"and",
"generating",
"the",
"join",
"string",
"as",
"we",
"may",
... | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataAccess/LogQueryBuilder/JoinGenerator.php#L285-L315 | train | Generate non visit joins | [
30522,
5123,
3853,
9699,
8540,
11365,
4183,
5558,
7076,
1006,
1002,
2795,
18442,
1010,
1002,
2795,
18442,
3406,
5558,
2378,
1010,
1002,
5950,
1007,
1063,
1002,
8833,
10880,
1027,
1002,
2023,
1011,
1028,
7251,
1011,
1028,
2131,
21197,
10880,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/Plugin/Visualization.php | Visualization.postDataTableLoadedFromAPI | private function postDataTableLoadedFromAPI()
{
$columns = $this->dataTable->getColumns();
$hasNbVisits = in_array('nb_visits', $columns);
$hasNbUniqVisitors = in_array('nb_uniq_visitors', $columns);
// default columns_to_display to label, nb_uniq_visitors/nb_visits if those c... | php | private function postDataTableLoadedFromAPI()
{
$columns = $this->dataTable->getColumns();
$hasNbVisits = in_array('nb_visits', $columns);
$hasNbUniqVisitors = in_array('nb_uniq_visitors', $columns);
// default columns_to_display to label, nb_uniq_visitors/nb_visits if those c... | [
"private",
"function",
"postDataTableLoadedFromAPI",
"(",
")",
"{",
"$",
"columns",
"=",
"$",
"this",
"->",
"dataTable",
"->",
"getColumns",
"(",
")",
";",
"$",
"hasNbVisits",
"=",
"in_array",
"(",
"'nb_visits'",
",",
"$",
"columns",
")",
";",
"$",
"hasNbU... | Hook called after the dataTable has been loaded from the API
Can be used to add, delete or modify the data freshly loaded
@return bool | [
"Hook",
"called",
"after",
"the",
"dataTable",
"has",
"been",
"loaded",
"from",
"the",
"API",
"Can",
"be",
"used",
"to",
"add",
"delete",
"or",
"modify",
"the",
"data",
"freshly",
"loaded"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Plugin/Visualization.php#L378-L413 | train | postDataTableLoadedFromAPI - Enforces that the data table has been loaded from the API | [
30522,
2797,
3853,
2695,
2850,
29336,
3085,
17468,
19699,
9626,
8197,
1006,
1007,
1063,
1002,
7753,
1027,
1002,
2023,
1011,
1028,
2951,
10880,
1011,
1028,
2131,
25778,
2819,
3619,
1006,
1007,
1025,
1002,
8440,
2497,
11365,
12762,
1027,
1999... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/CronArchive/FixedSiteIds.php | FixedSiteIds.getNumProcessedWebsites | public function getNumProcessedWebsites()
{
$numProcessed = $this->index + 1;
if ($numProcessed > $this->getNumSites()) {
return $this->getNumSites();
}
return $numProcessed;
} | php | public function getNumProcessedWebsites()
{
$numProcessed = $this->index + 1;
if ($numProcessed > $this->getNumSites()) {
return $this->getNumSites();
}
return $numProcessed;
} | [
"public",
"function",
"getNumProcessedWebsites",
"(",
")",
"{",
"$",
"numProcessed",
"=",
"$",
"this",
"->",
"index",
"+",
"1",
";",
"if",
"(",
"$",
"numProcessed",
">",
"$",
"this",
"->",
"getNumSites",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",... | Get the number of already processed websites. All websites were processed by the current archiver.
@return int | [
"Get",
"the",
"number",
"of",
"already",
"processed",
"websites",
".",
"All",
"websites",
"were",
"processed",
"by",
"the",
"current",
"archiver",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/CronArchive/FixedSiteIds.php#L44-L53 | train | Get Number of processed websites | [
30522,
2270,
3853,
2131,
19172,
21572,
9623,
6924,
8545,
5910,
7616,
1006,
1007,
1063,
1002,
16371,
8737,
3217,
9623,
6924,
1027,
1002,
2023,
1011,
1028,
5950,
1009,
1015,
1025,
2065,
1006,
1002,
16371,
8737,
3217,
9623,
6924,
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... |
laravel/framework | src/Illuminate/Routing/Middleware/ThrottleRequests.php | ThrottleRequests.calculateRemainingAttempts | protected function calculateRemainingAttempts($key, $maxAttempts, $retryAfter = null)
{
if (is_null($retryAfter)) {
return $this->limiter->retriesLeft($key, $maxAttempts);
}
return 0;
} | php | protected function calculateRemainingAttempts($key, $maxAttempts, $retryAfter = null)
{
if (is_null($retryAfter)) {
return $this->limiter->retriesLeft($key, $maxAttempts);
}
return 0;
} | [
"protected",
"function",
"calculateRemainingAttempts",
"(",
"$",
"key",
",",
"$",
"maxAttempts",
",",
"$",
"retryAfter",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"retryAfter",
")",
")",
"{",
"return",
"$",
"this",
"->",
"limiter",
"->",
"re... | Calculate the number of remaining attempts.
@param string $key
@param int $maxAttempts
@param int|null $retryAfter
@return int | [
"Calculate",
"the",
"number",
"of",
"remaining",
"attempts",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/Middleware/ThrottleRequests.php#L189-L196 | train | Calculate the number of remaining attempts for a key | [
30522,
5123,
3853,
18422,
28578,
8113,
28234,
4674,
27718,
2015,
1006,
1002,
3145,
1010,
1002,
4098,
19321,
6633,
22798,
1010,
1002,
2128,
11129,
10354,
3334,
1027,
19701,
1007,
1063,
2065,
1006,
2003,
1035,
19701,
1006,
1002,
2128,
11129,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Common/GPM/Installer.php | Installer.sophisticatedInstall | public static function sophisticatedInstall($source_path, $install_path, $ignores = [], $keep_source = false)
{
foreach (new \DirectoryIterator($source_path) as $file) {
if ($file->isLink() || $file->isDot() || \in_array($file->getFilename(), $ignores, true)) {
continue;
... | php | public static function sophisticatedInstall($source_path, $install_path, $ignores = [], $keep_source = false)
{
foreach (new \DirectoryIterator($source_path) as $file) {
if ($file->isLink() || $file->isDot() || \in_array($file->getFilename(), $ignores, true)) {
continue;
... | [
"public",
"static",
"function",
"sophisticatedInstall",
"(",
"$",
"source_path",
",",
"$",
"install_path",
",",
"$",
"ignores",
"=",
"[",
"]",
",",
"$",
"keep_source",
"=",
"false",
")",
"{",
"foreach",
"(",
"new",
"\\",
"DirectoryIterator",
"(",
"$",
"sou... | @param string $source_path
@param string $install_path
@param array $ignores
@param bool $keep_source
@return bool | [
"@param",
"string",
"$source_path",
"@param",
"string",
"$install_path",
"@param",
"array",
"$ignores",
"@param",
"bool",
"$keep_source"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/GPM/Installer.php#L297-L327 | train | Installs a sophisticated version of the application | [
30522,
2270,
10763,
3853,
12138,
7076,
9080,
2140,
1006,
1002,
3120,
1035,
4130,
1010,
1002,
16500,
1035,
4130,
1010,
1002,
26663,
1027,
1031,
1033,
1010,
1002,
2562,
1035,
3120,
1027,
6270,
1007,
1063,
18921,
6776,
1006,
2047,
1032,
14176,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/backend/behaviors/ReorderController.php | ReorderController.prepareVars | protected function prepareVars()
{
$this->vars['reorderRecords'] = $this->getRecords();
$this->vars['reorderModel'] = $this->model;
$this->vars['reorderSortMode'] = $this->sortMode;
$this->vars['reorderShowTree'] = $this->showTree;
$this->vars['reorderToolbarWidget'] = $this-... | php | protected function prepareVars()
{
$this->vars['reorderRecords'] = $this->getRecords();
$this->vars['reorderModel'] = $this->model;
$this->vars['reorderSortMode'] = $this->sortMode;
$this->vars['reorderShowTree'] = $this->showTree;
$this->vars['reorderToolbarWidget'] = $this-... | [
"protected",
"function",
"prepareVars",
"(",
")",
"{",
"$",
"this",
"->",
"vars",
"[",
"'reorderRecords'",
"]",
"=",
"$",
"this",
"->",
"getRecords",
"(",
")",
";",
"$",
"this",
"->",
"vars",
"[",
"'reorderModel'",
"]",
"=",
"$",
"this",
"->",
"model",... | Prepares common form data | [
"Prepares",
"common",
"form",
"data"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/behaviors/ReorderController.php#L165-L172 | train | Prepare the order variables for the page | [
30522,
5123,
3853,
7374,
10755,
2015,
1006,
1007,
1063,
1002,
2023,
1011,
1028,
13075,
2015,
1031,
1005,
2128,
8551,
28849,
27108,
5104,
1005,
1033,
1027,
1002,
2023,
1011,
1028,
2131,
2890,
27108,
5104,
1006,
1007,
1025,
1002,
2023,
1011,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Routing/Router.php | Router.apiResources | public function apiResources(array $resources, array $options = [])
{
foreach ($resources as $name => $controller) {
$this->apiResource($name, $controller, $options);
}
} | php | public function apiResources(array $resources, array $options = [])
{
foreach ($resources as $name => $controller) {
$this->apiResource($name, $controller, $options);
}
} | [
"public",
"function",
"apiResources",
"(",
"array",
"$",
"resources",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"foreach",
"(",
"$",
"resources",
"as",
"$",
"name",
"=>",
"$",
"controller",
")",
"{",
"$",
"this",
"->",
"apiResource",
"(",
... | Register an array of API resource controllers.
@param array $resources
@param array $options
@return void | [
"Register",
"an",
"array",
"of",
"API",
"resource",
"controllers",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/Router.php#L331-L336 | train | Add a list of resources to the api | [
30522,
2270,
3853,
17928,
6072,
8162,
9623,
1006,
9140,
1002,
4219,
1010,
9140,
1002,
7047,
1027,
1031,
1033,
1007,
1063,
18921,
6776,
1006,
1002,
4219,
2004,
1002,
2171,
1027,
1028,
1002,
11486,
1007,
1063,
1002,
2023,
1011,
1028,
17928,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Command/Command.php | Command.getSynopsis | public function getSynopsis($short = false)
{
$key = $short ? 'short' : 'long';
if (!isset($this->synopsis[$key])) {
$this->synopsis[$key] = trim(sprintf('%s %s', $this->name, $this->definition->getSynopsis($short)));
}
return $this->synopsis[$key];
} | php | public function getSynopsis($short = false)
{
$key = $short ? 'short' : 'long';
if (!isset($this->synopsis[$key])) {
$this->synopsis[$key] = trim(sprintf('%s %s', $this->name, $this->definition->getSynopsis($short)));
}
return $this->synopsis[$key];
} | [
"public",
"function",
"getSynopsis",
"(",
"$",
"short",
"=",
"false",
")",
"{",
"$",
"key",
"=",
"$",
"short",
"?",
"'short'",
":",
"'long'",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"synopsis",
"[",
"$",
"key",
"]",
")",
")",
"{",
... | Returns the synopsis for the command.
@param bool $short Whether to show the short version of the synopsis (with options folded) or not
@return string The synopsis | [
"Returns",
"the",
"synopsis",
"for",
"the",
"command",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Command/Command.php#L583-L592 | train | Returns the synopsis of the rule | [
30522,
2270,
3853,
4152,
6038,
22599,
1006,
1002,
2460,
1027,
6270,
1007,
1063,
1002,
3145,
1027,
1002,
2460,
1029,
1005,
2460,
1005,
1024,
1005,
2146,
1005,
1025,
2065,
1006,
999,
26354,
3388,
1006,
1002,
2023,
1011,
1028,
19962,
22599,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Workflow/EventListener/GuardListener.php | GuardListener.getVariables | private function getVariables(GuardEvent $event): array
{
$token = $this->tokenStorage->getToken();
if (null === $token) {
throw new InvalidTokenConfigurationException(sprintf('There are no tokens available for workflow %s.', $event->getWorkflowName()));
}
if (method_ex... | php | private function getVariables(GuardEvent $event): array
{
$token = $this->tokenStorage->getToken();
if (null === $token) {
throw new InvalidTokenConfigurationException(sprintf('There are no tokens available for workflow %s.', $event->getWorkflowName()));
}
if (method_ex... | [
"private",
"function",
"getVariables",
"(",
"GuardEvent",
"$",
"event",
")",
":",
"array",
"{",
"$",
"token",
"=",
"$",
"this",
"->",
"tokenStorage",
"->",
"getToken",
"(",
")",
";",
"if",
"(",
"null",
"===",
"$",
"token",
")",
"{",
"throw",
"new",
"... | code should be sync with Symfony\Component\Security\Core\Authorization\Voter\ExpressionVoter | [
"code",
"should",
"be",
"sync",
"with",
"Symfony",
"\\",
"Component",
"\\",
"Security",
"\\",
"Core",
"\\",
"Authorization",
"\\",
"Voter",
"\\",
"ExpressionVoter"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Workflow/EventListener/GuardListener.php#L81-L122 | train | Returns the variables that should be used to create the workflow. | [
30522,
2797,
3853,
2131,
10755,
19210,
2015,
1006,
3457,
18697,
3372,
1002,
2724,
1007,
1024,
9140,
1063,
1002,
19204,
1027,
1002,
2023,
1011,
1028,
19204,
23809,
4270,
1011,
1028,
2131,
18715,
2368,
1006,
1007,
1025,
2065,
1006,
19701,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/DataAccess/LogAggregator.php | LogAggregator.getSelectsFromRangedColumn | public static function getSelectsFromRangedColumn($column, $ranges, $table, $selectColumnPrefix, $restrictToReturningVisitors = false)
{
$selects = array();
$extraCondition = '';
if ($restrictToReturningVisitors) {
// extra condition for the SQL SELECT that makes sure only retur... | php | public static function getSelectsFromRangedColumn($column, $ranges, $table, $selectColumnPrefix, $restrictToReturningVisitors = false)
{
$selects = array();
$extraCondition = '';
if ($restrictToReturningVisitors) {
// extra condition for the SQL SELECT that makes sure only retur... | [
"public",
"static",
"function",
"getSelectsFromRangedColumn",
"(",
"$",
"column",
",",
"$",
"ranges",
",",
"$",
"table",
",",
"$",
"selectColumnPrefix",
",",
"$",
"restrictToReturningVisitors",
"=",
"false",
")",
"{",
"$",
"selects",
"=",
"array",
"(",
")",
... | Creates and returns an array of SQL `SELECT` expressions that will each count how
many rows have a column whose value is within a certain range.
**Note:** The result of this function is meant for use in the `$additionalSelects` parameter
in one of the query... methods (for example {@link queryVisitsByDimension()}).
*... | [
"Creates",
"and",
"returns",
"an",
"array",
"of",
"SQL",
"SELECT",
"expressions",
"that",
"will",
"each",
"count",
"how",
"many",
"rows",
"have",
"a",
"column",
"whose",
"value",
"is",
"within",
"a",
"certain",
"range",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataAccess/LogAggregator.php#L894-L926 | train | Returns the SELECTs for a given column range | [
30522,
2270,
10763,
3853,
4152,
12260,
16649,
19699,
5358,
24388,
2098,
25778,
2819,
2078,
1006,
1002,
5930,
1010,
1002,
8483,
1010,
1002,
2795,
1010,
1002,
7276,
25778,
2819,
16275,
2890,
8873,
2595,
1010,
1002,
21573,
19277,
22299,
2075,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
dompdf/dompdf | src/Adapter/PDFLib.php | PDFLib._place_objects | protected function _place_objects()
{
foreach ($this->_objs as $obj => $props) {
$start = $props["start_page"];
$where = $props["where"];
// Place the object on this page if required
if ($this->_page_number >= $start &&
(($this->_page_number ... | php | protected function _place_objects()
{
foreach ($this->_objs as $obj => $props) {
$start = $props["start_page"];
$where = $props["where"];
// Place the object on this page if required
if ($this->_page_number >= $start &&
(($this->_page_number ... | [
"protected",
"function",
"_place_objects",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"_objs",
"as",
"$",
"obj",
"=>",
"$",
"props",
")",
"{",
"$",
"start",
"=",
"$",
"props",
"[",
"\"start_page\"",
"]",
";",
"$",
"where",
"=",
"$",
"props",
... | Add all active objects to the current page | [
"Add",
"all",
"active",
"objects",
"to",
"the",
"current",
"page"
] | 75f13c700009be21a1965dc2c5b68a8708c22ba2 | https://github.com/dompdf/dompdf/blob/75f13c700009be21a1965dc2c5b68a8708c22ba2/src/Adapter/PDFLib.php#L437-L454 | train | place the objects on the page if required | [
30522,
5123,
3853,
1035,
2173,
1035,
5200,
1006,
1007,
1063,
18921,
6776,
1006,
1002,
2023,
1011,
1028,
1035,
27885,
22578,
2004,
1002,
27885,
3501,
1027,
1028,
1002,
24387,
1007,
30524,
24387,
1031,
1000,
2707,
1035,
3931,
1000,
1033,
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... |
getgrav/grav | system/src/Grav/Common/Filesystem/Folder.php | Folder.lastModifiedFolder | public static function lastModifiedFolder($path)
{
$last_modified = 0;
/** @var UniformResourceLocator $locator */
$locator = Grav::instance()['locator'];
$flags = \RecursiveDirectoryIterator::SKIP_DOTS;
if ($locator->isStream($path)) {
$directory = $locator->get... | php | public static function lastModifiedFolder($path)
{
$last_modified = 0;
/** @var UniformResourceLocator $locator */
$locator = Grav::instance()['locator'];
$flags = \RecursiveDirectoryIterator::SKIP_DOTS;
if ($locator->isStream($path)) {
$directory = $locator->get... | [
"public",
"static",
"function",
"lastModifiedFolder",
"(",
"$",
"path",
")",
"{",
"$",
"last_modified",
"=",
"0",
";",
"/** @var UniformResourceLocator $locator */",
"$",
"locator",
"=",
"Grav",
"::",
"instance",
"(",
")",
"[",
"'locator'",
"]",
";",
"$",
"fla... | Recursively find the last modified time under given path.
@param string $path
@return int | [
"Recursively",
"find",
"the",
"last",
"modified",
"time",
"under",
"given",
"path",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Filesystem/Folder.php#L23-L47 | train | Get the last modified time of a folder | [
30522,
2270,
10763,
3853,
2197,
5302,
4305,
10451,
10371,
2121,
1006,
1002,
4130,
1007,
1063,
1002,
2197,
1035,
6310,
1027,
1014,
1025,
1013,
1008,
1008,
1030,
13075,
6375,
6072,
8162,
29109,
24755,
4263,
1002,
8840,
11266,
2953,
1008,
1013... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Broadcasting/Broadcasters/LogBroadcaster.php | LogBroadcaster.broadcast | public function broadcast(array $channels, $event, array $payload = [])
{
$channels = implode(', ', $this->formatChannels($channels));
$payload = json_encode($payload, JSON_PRETTY_PRINT);
$this->logger->info('Broadcasting ['.$event.'] on channels ['.$channels.'] with payload:'.PHP_EOL.$pay... | php | public function broadcast(array $channels, $event, array $payload = [])
{
$channels = implode(', ', $this->formatChannels($channels));
$payload = json_encode($payload, JSON_PRETTY_PRINT);
$this->logger->info('Broadcasting ['.$event.'] on channels ['.$channels.'] with payload:'.PHP_EOL.$pay... | [
"public",
"function",
"broadcast",
"(",
"array",
"$",
"channels",
",",
"$",
"event",
",",
"array",
"$",
"payload",
"=",
"[",
"]",
")",
"{",
"$",
"channels",
"=",
"implode",
"(",
"', '",
",",
"$",
"this",
"->",
"formatChannels",
"(",
"$",
"channels",
... | {@inheritdoc} | [
"{"
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Broadcasting/Broadcasters/LogBroadcaster.php#L46-L53 | train | Broadcast an event to all channels | [
30522,
2270,
3853,
3743,
1006,
9140,
1002,
6833,
1010,
1002,
2724,
1010,
9140,
1002,
18093,
1027,
1031,
1033,
1007,
1063,
1002,
6833,
1027,
17727,
4135,
3207,
1006,
1005,
1010,
1005,
1010,
1002,
2023,
1011,
1028,
4289,
26058,
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... |
symfony/symfony | src/Symfony/Component/Validator/Mapping/ClassMetadata.php | ClassMetadata.getReflectionClass | public function getReflectionClass()
{
if (!$this->reflClass) {
$this->reflClass = new \ReflectionClass($this->getClassName());
}
return $this->reflClass;
} | php | public function getReflectionClass()
{
if (!$this->reflClass) {
$this->reflClass = new \ReflectionClass($this->getClassName());
}
return $this->reflClass;
} | [
"public",
"function",
"getReflectionClass",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"reflClass",
")",
"{",
"$",
"this",
"->",
"reflClass",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"$",
"this",
"->",
"getClassName",
"(",
")",
")",
";",
"}",
... | Returns a ReflectionClass instance for this class.
@return \ReflectionClass | [
"Returns",
"a",
"ReflectionClass",
"instance",
"for",
"this",
"class",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Validator/Mapping/ClassMetadata.php#L445-L452 | train | Get reflection class | [
30522,
2270,
3853,
2131,
2890,
21031,
7542,
26266,
1006,
1007,
1063,
2065,
1006,
999,
1002,
2023,
1011,
1028,
25416,
15472,
27102,
1007,
1063,
1002,
2023,
1011,
1028,
25416,
15472,
27102,
1027,
2047,
1032,
9185,
26266,
1006,
1002,
2023,
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... |
getgrav/grav | system/src/Grav/Common/Scheduler/Scheduler.php | Scheduler.run | public function run(\DateTime $runTime = null)
{
$this->loadSavedJobs();
list($background, $foreground) = $this->getQueuedJobs(false);
$alljobs = array_merge($background, $foreground);
if (null === $runTime) {
$runTime = new \DateTime('now');
}
// Star ... | php | public function run(\DateTime $runTime = null)
{
$this->loadSavedJobs();
list($background, $foreground) = $this->getQueuedJobs(false);
$alljobs = array_merge($background, $foreground);
if (null === $runTime) {
$runTime = new \DateTime('now');
}
// Star ... | [
"public",
"function",
"run",
"(",
"\\",
"DateTime",
"$",
"runTime",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"loadSavedJobs",
"(",
")",
";",
"list",
"(",
"$",
"background",
",",
"$",
"foreground",
")",
"=",
"$",
"this",
"->",
"getQueuedJobs",
"(",
"... | Run the scheduler.
@param \DateTime|null $runTime Optional, run at specific moment | [
"Run",
"the",
"scheduler",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Scheduler/Scheduler.php#L155-L181 | train | Runs all jobs due to run | [
30522,
2270,
3853,
2448,
1006,
1032,
3058,
7292,
1002,
2448,
7292,
1027,
19701,
1007,
1063,
1002,
2023,
1011,
1028,
15665,
10696,
2094,
5558,
5910,
1006,
1007,
1025,
2862,
1006,
1002,
4281,
1010,
1002,
18921,
16365,
1007,
1027,
1002,
2023,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Mime/Encoder/Base64Encoder.php | Base64Encoder.encodeString | public function encodeString(string $string, ?string $charset = 'utf-8', int $firstLineOffset = 0, int $maxLineLength = 0): string
{
if (0 >= $maxLineLength || 76 < $maxLineLength) {
$maxLineLength = 76;
}
$encodedString = base64_encode($string);
$firstLine = '';
... | php | public function encodeString(string $string, ?string $charset = 'utf-8', int $firstLineOffset = 0, int $maxLineLength = 0): string
{
if (0 >= $maxLineLength || 76 < $maxLineLength) {
$maxLineLength = 76;
}
$encodedString = base64_encode($string);
$firstLine = '';
... | [
"public",
"function",
"encodeString",
"(",
"string",
"$",
"string",
",",
"?",
"string",
"$",
"charset",
"=",
"'utf-8'",
",",
"int",
"$",
"firstLineOffset",
"=",
"0",
",",
"int",
"$",
"maxLineLength",
"=",
"0",
")",
":",
"string",
"{",
"if",
"(",
"0",
... | Takes an unencoded string and produces a Base64 encoded string from it.
Base64 encoded strings have a maximum line length of 76 characters.
If the first line needs to be shorter, indicate the difference with
$firstLineOffset. | [
"Takes",
"an",
"unencoded",
"string",
"and",
"produces",
"a",
"Base64",
"encoded",
"string",
"from",
"it",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Mime/Encoder/Base64Encoder.php#L28-L42 | train | Encodes a string to a string of charset UTF - 8 | [
30522,
2270,
3853,
4372,
23237,
18886,
3070,
1006,
5164,
1002,
5164,
1010,
1029,
5164,
1002,
25869,
13462,
1027,
1005,
21183,
2546,
1011,
1022,
1005,
1010,
20014,
1002,
2034,
30524,
4179,
7770,
13512,
2232,
1027,
1014,
1007,
1024,
5164,
106... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/DelegatingEngine.php | DelegatingEngine.renderResponse | public function renderResponse($view, array $parameters = [], Response $response = null)
{
$engine = $this->getEngine($view);
if ($engine instanceof EngineInterface) {
return $engine->renderResponse($view, $parameters, $response);
}
if (null === $response) {
... | php | public function renderResponse($view, array $parameters = [], Response $response = null)
{
$engine = $this->getEngine($view);
if ($engine instanceof EngineInterface) {
return $engine->renderResponse($view, $parameters, $response);
}
if (null === $response) {
... | [
"public",
"function",
"renderResponse",
"(",
"$",
"view",
",",
"array",
"$",
"parameters",
"=",
"[",
"]",
",",
"Response",
"$",
"response",
"=",
"null",
")",
"{",
"$",
"engine",
"=",
"$",
"this",
"->",
"getEngine",
"(",
"$",
"view",
")",
";",
"if",
... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bundle/FrameworkBundle/Templating/DelegatingEngine.php#L50-L65 | train | Render Response. | [
30522,
2270,
3853,
17552,
6072,
26029,
3366,
1006,
1002,
3193,
1010,
9140,
1002,
11709,
1027,
1031,
1033,
1010,
3433,
1002,
3433,
1027,
19701,
1007,
1063,
1002,
3194,
1027,
1002,
2023,
1011,
1028,
2131,
13159,
3170,
1006,
1002,
3193,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Events/Dispatcher.php | Dispatcher.hasListeners | public function hasListeners($eventName)
{
return isset($this->listeners[$eventName]) || isset($this->wildcards[$eventName]);
} | php | public function hasListeners($eventName)
{
return isset($this->listeners[$eventName]) || isset($this->wildcards[$eventName]);
} | [
"public",
"function",
"hasListeners",
"(",
"$",
"eventName",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"listeners",
"[",
"$",
"eventName",
"]",
")",
"||",
"isset",
"(",
"$",
"this",
"->",
"wildcards",
"[",
"$",
"eventName",
"]",
")",
";",
... | Determine if a given event has listeners.
@param string $eventName
@return bool | [
"Determine",
"if",
"a",
"given",
"event",
"has",
"listeners",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Events/Dispatcher.php#L102-L105 | train | Checks if an event has listeners or wildcards | [
30522,
2270,
3853,
2038,
9863,
24454,
2015,
1006,
1002,
2724,
18442,
1007,
1063,
2709,
26354,
3388,
1006,
1002,
2023,
1011,
1028,
13810,
1031,
1002,
2724,
18442,
1033,
1007,
1064,
1064,
26354,
3388,
1006,
1002,
2023,
1011,
1028,
3748,
17965... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Overlay/API.php | API.getFollowingPages | public function getFollowingPages($url, $idSite, $period, $date, $segment = false)
{
$url = PageUrl::excludeQueryParametersFromUrl($url, $idSite);
// we don't unsanitize $url here. it will be done in the Transitions plugin.
$resultDataTable = new DataTable;
try {
$limit... | php | public function getFollowingPages($url, $idSite, $period, $date, $segment = false)
{
$url = PageUrl::excludeQueryParametersFromUrl($url, $idSite);
// we don't unsanitize $url here. it will be done in the Transitions plugin.
$resultDataTable = new DataTable;
try {
$limit... | [
"public",
"function",
"getFollowingPages",
"(",
"$",
"url",
",",
"$",
"idSite",
",",
"$",
"period",
",",
"$",
"date",
",",
"$",
"segment",
"=",
"false",
")",
"{",
"$",
"url",
"=",
"PageUrl",
"::",
"excludeQueryParametersFromUrl",
"(",
"$",
"url",
",",
... | Get following pages of a url.
This is done on the logs - not the archives!
Note: if you use this method via the regular API, the number of results will be limited.
Make sure, you set filter_limit=-1 in the request. | [
"Get",
"following",
"pages",
"of",
"a",
"url",
".",
"This",
"is",
"done",
"on",
"the",
"logs",
"-",
"not",
"the",
"archives!"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Overlay/API.php#L65-L93 | train | Get following pages | [
30522,
2270,
3853,
2131,
14876,
7174,
9328,
13704,
2015,
1006,
1002,
24471,
2140,
1010,
1002,
8909,
28032,
2063,
1010,
1002,
2558,
1010,
1002,
3058,
1010,
1002,
6903,
1027,
6270,
1007,
1063,
1002,
24471,
2140,
1027,
3931,
3126,
2140,
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... |
symfony/symfony | src/Symfony/Component/Intl/ResourceBundle.php | ResourceBundle.readEntry | final protected static function readEntry(array $indices, string $locale = null, bool $fallback = true)
{
if (null === self::$entryReader) {
self::$entryReader = new BundleEntryReader(new BufferedBundleReader(
new JsonBundleReader(),
Intl::BUFFER_SIZE
... | php | final protected static function readEntry(array $indices, string $locale = null, bool $fallback = true)
{
if (null === self::$entryReader) {
self::$entryReader = new BundleEntryReader(new BufferedBundleReader(
new JsonBundleReader(),
Intl::BUFFER_SIZE
... | [
"final",
"protected",
"static",
"function",
"readEntry",
"(",
"array",
"$",
"indices",
",",
"string",
"$",
"locale",
"=",
"null",
",",
"bool",
"$",
"fallback",
"=",
"true",
")",
"{",
"if",
"(",
"null",
"===",
"self",
"::",
"$",
"entryReader",
")",
"{",... | Reads an entry from a resource bundle.
@see BundleEntryReaderInterface::readEntry()
@param string[] $indices The indices to read from the bundle
@param string $locale The locale to read
@param bool $fallback Whether to merge the value with the value from
the fallback locale (e.g. "en" for "en_GB").
Only appl... | [
"Reads",
"an",
"entry",
"from",
"a",
"resource",
"bundle",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Intl/ResourceBundle.php#L46-L59 | train | Reads the entry from the bundle | [
30522,
2345,
5123,
10763,
3853,
3191,
4765,
2854,
1006,
9140,
1002,
29299,
1010,
5164,
1002,
2334,
2063,
1027,
19701,
1010,
22017,
2140,
1002,
2991,
5963,
1027,
2995,
1007,
1063,
2065,
1006,
19701,
1027,
1027,
1027,
2969,
1024,
1024,
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/NumberFormatter.php | NumberFormatter.formatPercent | public function formatPercent($value, $maximumFractionDigits=0, $minimumFractionDigits=0)
{
$newValue = trim($value, " \0\x0B%");
if (!is_numeric($newValue)) {
return $value;
}
$pattern = $this->getPattern($value, 'Intl_NumberFormatPercent');
return $this->forma... | php | public function formatPercent($value, $maximumFractionDigits=0, $minimumFractionDigits=0)
{
$newValue = trim($value, " \0\x0B%");
if (!is_numeric($newValue)) {
return $value;
}
$pattern = $this->getPattern($value, 'Intl_NumberFormatPercent');
return $this->forma... | [
"public",
"function",
"formatPercent",
"(",
"$",
"value",
",",
"$",
"maximumFractionDigits",
"=",
"0",
",",
"$",
"minimumFractionDigits",
"=",
"0",
")",
"{",
"$",
"newValue",
"=",
"trim",
"(",
"$",
"value",
",",
"\" \\0\\x0B%\"",
")",
";",
"if",
"(",
"!"... | Formats given number as percent value
@param string|int|float $value
@param int $maximumFractionDigits
@param int $minimumFractionDigits
@return mixed|string | [
"Formats",
"given",
"number",
"as",
"percent",
"value"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/NumberFormatter.php#L87-L97 | train | Format a value with a percentage format | [
30522,
2270,
3853,
4289,
4842,
13013,
1006,
1002,
3643,
1010,
1002,
4555,
27843,
7542,
4305,
23806,
2015,
1027,
1014,
1010,
1002,
6263,
27843,
7542,
4305,
23806,
2015,
1027,
1014,
1007,
1063,
1002,
2047,
10175,
5657,
1027,
12241,
1006,
1002... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/system/classes/MediaLibrary.php | MediaLibrary.put | public function put($path, $contents)
{
$path = self::validatePath($path);
$fullPath = $this->getMediaPath($path);
return $this->getStorageDisk()->put($fullPath, $contents);
} | php | public function put($path, $contents)
{
$path = self::validatePath($path);
$fullPath = $this->getMediaPath($path);
return $this->getStorageDisk()->put($fullPath, $contents);
} | [
"public",
"function",
"put",
"(",
"$",
"path",
",",
"$",
"contents",
")",
"{",
"$",
"path",
"=",
"self",
"::",
"validatePath",
"(",
"$",
"path",
")",
";",
"$",
"fullPath",
"=",
"$",
"this",
"->",
"getMediaPath",
"(",
"$",
"path",
")",
";",
"return"... | Puts a file to the library.
@param string $path Specifies the file path relative the the Library root.
@param string $contents Specifies the file contents.
@return boolean | [
"Puts",
"a",
"file",
"to",
"the",
"library",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/MediaLibrary.php#L322-L327 | train | Put content to the file | [
30522,
2270,
3853,
2404,
1006,
1002,
4130,
1010,
1002,
8417,
1007,
1063,
1002,
4130,
1027,
2969,
1024,
1024,
9398,
3686,
15069,
1006,
1002,
4130,
1007,
1025,
1002,
2440,
15069,
1027,
1002,
2023,
1011,
1028,
2131,
16969,
15069,
1006,
1002,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/DomCrawler/Crawler.php | Crawler.addXmlContent | public function addXmlContent($content, $charset = 'UTF-8', $options = LIBXML_NONET)
{
// remove the default namespace if it's the only namespace to make XPath expressions simpler
if (!preg_match('/xmlns:/', $content)) {
$content = str_replace('xmlns', 'ns', $content);
}
... | php | public function addXmlContent($content, $charset = 'UTF-8', $options = LIBXML_NONET)
{
// remove the default namespace if it's the only namespace to make XPath expressions simpler
if (!preg_match('/xmlns:/', $content)) {
$content = str_replace('xmlns', 'ns', $content);
}
... | [
"public",
"function",
"addXmlContent",
"(",
"$",
"content",
",",
"$",
"charset",
"=",
"'UTF-8'",
",",
"$",
"options",
"=",
"LIBXML_NONET",
")",
"{",
"// remove the default namespace if it's the only namespace to make XPath expressions simpler",
"if",
"(",
"!",
"preg_match... | Adds an XML content to the list of nodes.
The libxml errors are disabled when the content is parsed.
If you want to get parsing errors, be sure to enable
internal errors via libxml_use_internal_errors(true)
and then, get the errors via libxml_get_errors(). Be
sure to clear errors with libxml_clear_errors() afterward.... | [
"Adds",
"an",
"XML",
"content",
"to",
"the",
"list",
"of",
"nodes",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/DomCrawler/Crawler.php#L233-L256 | train | Adds a XML content to the list of nodes | [
30522,
2270,
3853,
5587,
2595,
19968,
8663,
6528,
2102,
1006,
1002,
4180,
1010,
1002,
25869,
13462,
1027,
1005,
21183,
2546,
1011,
1022,
1005,
1010,
1002,
7047,
1027,
5622,
2497,
2595,
19968,
1035,
3904,
2102,
1007,
1063,
1013,
1013,
6366,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/VendorPublishCommand.php | VendorPublishCommand.moveManagedFiles | protected function moveManagedFiles($manager)
{
foreach ($manager->listContents('from://', true) as $file) {
if ($file['type'] === 'file' && (! $manager->has('to://'.$file['path']) || $this->option('force'))) {
$manager->put('to://'.$file['path'], $manager->read('from://'.$file['... | php | protected function moveManagedFiles($manager)
{
foreach ($manager->listContents('from://', true) as $file) {
if ($file['type'] === 'file' && (! $manager->has('to://'.$file['path']) || $this->option('force'))) {
$manager->put('to://'.$file['path'], $manager->read('from://'.$file['... | [
"protected",
"function",
"moveManagedFiles",
"(",
"$",
"manager",
")",
"{",
"foreach",
"(",
"$",
"manager",
"->",
"listContents",
"(",
"'from://'",
",",
"true",
")",
"as",
"$",
"file",
")",
"{",
"if",
"(",
"$",
"file",
"[",
"'type'",
"]",
"===",
"'file... | Move all the files in the given MountManager.
@param \League\Flysystem\MountManager $manager
@return void | [
"Move",
"all",
"the",
"files",
"in",
"the",
"given",
"MountManager",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Foundation/Console/VendorPublishCommand.php#L237-L244 | train | Move all files from the manager to the new location | [
30522,
5123,
3853,
2693,
24805,
5999,
8873,
4244,
1006,
1002,
3208,
1007,
1063,
18921,
6776,
1006,
1002,
3208,
1011,
1028,
2862,
8663,
6528,
3215,
1006,
1005,
2013,
1024,
1013,
1013,
1005,
1010,
2995,
1007,
2004,
1002,
5371,
1007,
1063,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Common/Grav.php | Grav.measureTime | public function measureTime(string $timerId, string $timerTitle, callable $callback)
{
$debugger = $this['debugger'];
$debugger->startTimer($timerId, $timerTitle);
$result = $callback();
$debugger->stopTimer($timerId);
return $result;
} | php | public function measureTime(string $timerId, string $timerTitle, callable $callback)
{
$debugger = $this['debugger'];
$debugger->startTimer($timerId, $timerTitle);
$result = $callback();
$debugger->stopTimer($timerId);
return $result;
} | [
"public",
"function",
"measureTime",
"(",
"string",
"$",
"timerId",
",",
"string",
"$",
"timerTitle",
",",
"callable",
"$",
"callback",
")",
"{",
"$",
"debugger",
"=",
"$",
"this",
"[",
"'debugger'",
"]",
";",
"$",
"debugger",
"->",
"startTimer",
"(",
"$... | Measure how long it takes to do an action.
@param string $timerId
@param string $timerTitle
@param callable $callback
@return mixed Returns value returned by the callable. | [
"Measure",
"how",
"long",
"it",
"takes",
"to",
"do",
"an",
"action",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Grav.php#L445-L453 | train | Measure time of a timer | [
30522,
2270,
3853,
5468,
7292,
1006,
5164,
1002,
25309,
3593,
1010,
5164,
1002,
25309,
3775,
9286,
1010,
2655,
3085,
1002,
2655,
5963,
1007,
1063,
1002,
2139,
8569,
13327,
1027,
1002,
2023,
1031,
1005,
2139,
8569,
13327,
1005,
1033,
1025,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Bundle/WebServerBundle/Command/ServerStatusCommand.php | ServerStatusCommand.execute | protected function execute(InputInterface $input, OutputInterface $output)
{
$io = new SymfonyStyle($input, $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output);
$server = new WebServer($this->pidFileDirectory);
if ($filter = $input->getOption('filter')) {
... | php | protected function execute(InputInterface $input, OutputInterface $output)
{
$io = new SymfonyStyle($input, $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output);
$server = new WebServer($this->pidFileDirectory);
if ($filter = $input->getOption('filter')) {
... | [
"protected",
"function",
"execute",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"io",
"=",
"new",
"SymfonyStyle",
"(",
"$",
"input",
",",
"$",
"output",
"instanceof",
"ConsoleOutputInterface",
"?",
"$",
"output",
... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bundle/WebServerBundle/Command/ServerStatusCommand.php#L73-L101 | train | Execute the command | [
30522,
5123,
3853,
15389,
1006,
7953,
18447,
2121,
12172,
1002,
7953,
1010,
6434,
18447,
2121,
12172,
1002,
6434,
1007,
1063,
1002,
22834,
1027,
2047,
25353,
2213,
14876,
4890,
21756,
2571,
1006,
1002,
7953,
1010,
1002,
6434,
6013,
11253,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
dompdf/dompdf | src/Frame/Factory.php | Factory.decorate_root | static function decorate_root(Frame $root, Dompdf $dompdf)
{
$frame = new PageFrameDecorator($root, $dompdf);
$frame->set_reflower(new PageFrameReflower($frame));
$root->set_decorator($frame);
return $frame;
} | php | static function decorate_root(Frame $root, Dompdf $dompdf)
{
$frame = new PageFrameDecorator($root, $dompdf);
$frame->set_reflower(new PageFrameReflower($frame));
$root->set_decorator($frame);
return $frame;
} | [
"static",
"function",
"decorate_root",
"(",
"Frame",
"$",
"root",
",",
"Dompdf",
"$",
"dompdf",
")",
"{",
"$",
"frame",
"=",
"new",
"PageFrameDecorator",
"(",
"$",
"root",
",",
"$",
"dompdf",
")",
";",
"$",
"frame",
"->",
"set_reflower",
"(",
"new",
"P... | Decorate the root Frame
@param $root Frame The frame to decorate
@param $dompdf Dompdf The dompdf instance
@return PageFrameDecorator | [
"Decorate",
"the",
"root",
"Frame"
] | 75f13c700009be21a1965dc2c5b68a8708c22ba2 | https://github.com/dompdf/dompdf/blob/75f13c700009be21a1965dc2c5b68a8708c22ba2/src/Frame/Factory.php#L49-L56 | train | Decorates the root frame with the reflower frame | [
30522,
10763,
3853,
29460,
1035,
7117,
1006,
4853,
1002,
7117,
1010,
14383,
17299,
2546,
1002,
14383,
17299,
2546,
1007,
1063,
1002,
4853,
1027,
2047,
3931,
15643,
3207,
27108,
8844,
1006,
1002,
7117,
1010,
1002,
14383,
17299,
2546,
1007,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/SitesManager/API.php | API.getSitesIdWithAtLeastViewAccess | public function getSitesIdWithAtLeastViewAccess($_restrictSitesToLogin = false)
{
/** @var Scheduler $scheduler */
$scheduler = StaticContainer::getContainer()->get('Piwik\Scheduler\Scheduler');
if (Piwik::hasUserSuperUserAccess() && !$scheduler->isRunningTask()) {
return Access... | php | public function getSitesIdWithAtLeastViewAccess($_restrictSitesToLogin = false)
{
/** @var Scheduler $scheduler */
$scheduler = StaticContainer::getContainer()->get('Piwik\Scheduler\Scheduler');
if (Piwik::hasUserSuperUserAccess() && !$scheduler->isRunningTask()) {
return Access... | [
"public",
"function",
"getSitesIdWithAtLeastViewAccess",
"(",
"$",
"_restrictSitesToLogin",
"=",
"false",
")",
"{",
"/** @var Scheduler $scheduler */",
"$",
"scheduler",
"=",
"StaticContainer",
"::",
"getContainer",
"(",
")",
"->",
"get",
"(",
"'Piwik\\Scheduler\\Schedule... | Returns the list of websites ID with the 'view' or 'admin' access for the current user.
For the superUser it returns all the websites in the database.
@param bool $_restrictSitesToLogin
@return array list of websites ID | [
"Returns",
"the",
"list",
"of",
"websites",
"ID",
"with",
"the",
"view",
"or",
"admin",
"access",
"for",
"the",
"current",
"user",
".",
"For",
"the",
"superUser",
"it",
"returns",
"all",
"the",
"websites",
"in",
"the",
"database",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SitesManager/API.php#L437-L469 | train | Return list of sites with viewable access for all the sites in the system. | [
30522,
2270,
3853,
4152,
7616,
3593,
24415,
4017,
19738,
3367,
8584,
6305,
9623,
2015,
1006,
1002,
1035,
21573,
28032,
4355,
12898,
11528,
1027,
6270,
1007,
1063,
1013,
1008,
1008,
1030,
13075,
6134,
2099,
1002,
6134,
2099,
1008,
1013,
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/Scheduler/Job.php | Job.isDue | public function isDue(\DateTime $date = null)
{
// The execution time is being defaulted if not defined
if (!$this->executionTime) {
$this->at('* * * * *');
}
$date = $date ?? $this->creationTime;
return $this->executionTime->isDue($date);
} | php | public function isDue(\DateTime $date = null)
{
// The execution time is being defaulted if not defined
if (!$this->executionTime) {
$this->at('* * * * *');
}
$date = $date ?? $this->creationTime;
return $this->executionTime->isDue($date);
} | [
"public",
"function",
"isDue",
"(",
"\\",
"DateTime",
"$",
"date",
"=",
"null",
")",
"{",
"// The execution time is being defaulted if not defined",
"if",
"(",
"!",
"$",
"this",
"->",
"executionTime",
")",
"{",
"$",
"this",
"->",
"at",
"(",
"'* * * * *'",
")",... | Check if the Job is due to run.
It accepts as input a DateTime used to check if
the job is due. Defaults to job creation time.
It also default the execution time if not previously defined.
@param \DateTime $date
@return bool | [
"Check",
"if",
"the",
"Job",
"is",
"due",
"to",
"run",
".",
"It",
"accepts",
"as",
"input",
"a",
"DateTime",
"used",
"to",
"check",
"if",
"the",
"job",
"is",
"due",
".",
"Defaults",
"to",
"job",
"creation",
"time",
".",
"It",
"also",
"default",
"the"... | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Scheduler/Job.php#L151-L161 | train | Is the execution time due? | [
30522,
2270,
3853,
2003,
20041,
1006,
1032,
3058,
7292,
1002,
3058,
1027,
19701,
1007,
1063,
1013,
1013,
1996,
7781,
2051,
2003,
2108,
17265,
2065,
2025,
4225,
2065,
1006,
999,
1002,
2023,
1011,
1028,
7781,
7292,
1007,
1063,
1002,
2023,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/HTML/QuickForm2/Node.php | HTML_QuickForm2_Node.generateId | protected static function generateId($elementName)
{
$stop = !self::getOption('id_force_append_index');
$tokens = strlen($elementName)
? explode('[', str_replace(']', '', $elementName))
: ($stop? array('qfauto', ''): array('qfauto'));
$co... | php | protected static function generateId($elementName)
{
$stop = !self::getOption('id_force_append_index');
$tokens = strlen($elementName)
? explode('[', str_replace(']', '', $elementName))
: ($stop? array('qfauto', ''): array('qfauto'));
$co... | [
"protected",
"static",
"function",
"generateId",
"(",
"$",
"elementName",
")",
"{",
"$",
"stop",
"=",
"!",
"self",
"::",
"getOption",
"(",
"'id_force_append_index'",
")",
";",
"$",
"tokens",
"=",
"strlen",
"(",
"$",
"elementName",
")",
"?",
"explode",
"(",... | Generates an id for the element
Called when an element is created without explicitly given id
@param string Element name
@return string The generated element id | [
"Generates",
"an",
"id",
"for",
"the",
"element"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Node.php#L206-L245 | train | Generate ID from element name | [
30522,
5123,
10763,
3853,
9699,
3593,
1006,
1002,
5783,
18442,
1007,
1063,
1002,
2644,
1027,
999,
2969,
1024,
1024,
2131,
7361,
3508,
1006,
1005,
8909,
1035,
2486,
1035,
10439,
10497,
1035,
5950,
1005,
1007,
1025,
1002,
19204,
2015,
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/DBStats/API.php | API.getDatabaseUsageSummary | public function getDatabaseUsageSummary()
{
Piwik::checkUserHasSuperUserAccess();
$emptyRow = array('data_size' => 0, 'index_size' => 0, 'row_count' => 0);
$rows = array(
'tracker_data' => $emptyRow,
'metric_data' => $emptyRow,
'report_data' => $emptyRo... | php | public function getDatabaseUsageSummary()
{
Piwik::checkUserHasSuperUserAccess();
$emptyRow = array('data_size' => 0, 'index_size' => 0, 'row_count' => 0);
$rows = array(
'tracker_data' => $emptyRow,
'metric_data' => $emptyRow,
'report_data' => $emptyRo... | [
"public",
"function",
"getDatabaseUsageSummary",
"(",
")",
"{",
"Piwik",
"::",
"checkUserHasSuperUserAccess",
"(",
")",
";",
"$",
"emptyRow",
"=",
"array",
"(",
"'data_size'",
"=>",
"0",
",",
"'index_size'",
"=>",
"0",
",",
"'row_count'",
"=>",
"0",
")",
";"... | Returns a datatable summarizing how data is distributed among Matomo tables.
This function will group tracker tables, numeric archive tables, blob archive tables
and other tables together so only four rows are shown.
@return DataTable A datatable with three columns: 'data_size', 'index_size', 'row_count'. | [
"Returns",
"a",
"datatable",
"summarizing",
"how",
"data",
"is",
"distributed",
"among",
"Matomo",
"tables",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/DBStats/API.php#L76-L105 | train | Returns a summary of the database usage of all tables | [
30522,
2270,
3853,
2131,
2850,
30524,
14255,
9148,
2243,
1024,
1024,
4638,
20330,
14949,
6342,
4842,
20330,
6305,
9623,
2015,
1006,
1007,
1025,
1002,
4064,
10524,
1027,
9140,
1006,
1005,
2951,
1035,
2946,
1005,
1027,
1028,
1014,
1010,
1005,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
overtrue/wechat | src/OfficialAccount/User/TagClient.php | TagClient.usersOfTag | public function usersOfTag(int $tagId, string $nextOpenId = '')
{
$params = [
'tagid' => $tagId,
'next_openid' => $nextOpenId,
];
return $this->httpPostJson('cgi-bin/user/tag/get', $params);
} | php | public function usersOfTag(int $tagId, string $nextOpenId = '')
{
$params = [
'tagid' => $tagId,
'next_openid' => $nextOpenId,
];
return $this->httpPostJson('cgi-bin/user/tag/get', $params);
} | [
"public",
"function",
"usersOfTag",
"(",
"int",
"$",
"tagId",
",",
"string",
"$",
"nextOpenId",
"=",
"''",
")",
"{",
"$",
"params",
"=",
"[",
"'tagid'",
"=>",
"$",
"tagId",
",",
"'next_openid'",
"=>",
"$",
"nextOpenId",
",",
"]",
";",
"return",
"$",
... | Get users from a tag.
@param int $tagId
@param string $nextOpenId
@return \Psr\Http\Message\ResponseInterface|\EasyWeChat\Kernel\Support\Collection|array|object|string
@throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException | [
"Get",
"users",
"from",
"a",
"tag",
"."
] | 120c72faaa93c270365bc75c73c362d5fd583209 | https://github.com/overtrue/wechat/blob/120c72faaa93c270365bc75c73c362d5fd583209/src/OfficialAccount/User/TagClient.php#L119-L127 | train | Get users of a tag | [
30522,
2270,
3853,
5198,
15794,
8490,
1006,
20014,
1002,
6415,
3593,
1010,
5164,
1002,
2279,
26915,
3593,
1027,
1005,
1005,
1007,
1063,
1002,
11498,
5244,
1027,
1031,
1005,
6415,
3593,
1005,
1027,
1028,
1002,
6415,
3593,
1010,
1005,
2279,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/UsersManager/API.php | API.setUserPreference | public function setUserPreference($userLogin, $preferenceName, $preferenceValue)
{
Piwik::checkUserHasSuperUserAccessOrIsTheUser($userLogin);
Option::set($this->getPreferenceId($userLogin, $preferenceName), $preferenceValue);
} | php | public function setUserPreference($userLogin, $preferenceName, $preferenceValue)
{
Piwik::checkUserHasSuperUserAccessOrIsTheUser($userLogin);
Option::set($this->getPreferenceId($userLogin, $preferenceName), $preferenceValue);
} | [
"public",
"function",
"setUserPreference",
"(",
"$",
"userLogin",
",",
"$",
"preferenceName",
",",
"$",
"preferenceValue",
")",
"{",
"Piwik",
"::",
"checkUserHasSuperUserAccessOrIsTheUser",
"(",
"$",
"userLogin",
")",
";",
"Option",
"::",
"set",
"(",
"$",
"this"... | Sets a user preference
@param string $userLogin
@param string $preferenceName
@param string $preferenceValue
@return void | [
"Sets",
"a",
"user",
"preference"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UsersManager/API.php#L187-L191 | train | Set user preference | [
30522,
2270,
3853,
2275,
20330,
28139,
25523,
1006,
1002,
5310,
21197,
2378,
1010,
1002,
12157,
18442,
1010,
1002,
12157,
10175,
5657,
1007,
1063,
14255,
9148,
2243,
1024,
1024,
4638,
20330,
14949,
6342,
4842,
20330,
6305,
9623,
21748,
2923,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | Events/Select.php | Select.add | public function add($fd, $flag, $func, $args = array())
{
switch ($flag) {
case self::EV_READ:
case self::EV_WRITE:
$count = $flag === self::EV_READ ? count($this->_readFds) : count($this->_writeFds);
if ($count >= 1024) {
echo "War... | php | public function add($fd, $flag, $func, $args = array())
{
switch ($flag) {
case self::EV_READ:
case self::EV_WRITE:
$count = $flag === self::EV_READ ? count($this->_readFds) : count($this->_writeFds);
if ($count >= 1024) {
echo "War... | [
"public",
"function",
"add",
"(",
"$",
"fd",
",",
"$",
"flag",
",",
"$",
"func",
",",
"$",
"args",
"=",
"array",
"(",
")",
")",
"{",
"switch",
"(",
"$",
"flag",
")",
"{",
"case",
"self",
"::",
"EV_READ",
":",
"case",
"self",
"::",
"EV_WRITE",
"... | {@inheritdoc} | [
"{"
] | 13649907f05014fcfffcfccaef01e63ad3339351 | https://github.com/walkor/Workerman/blob/13649907f05014fcfffcfccaef01e63ad3339351/Events/Select.php#L113-L160 | train | Adds an event to the event queue | [
30522,
2270,
3853,
5587,
1006,
1002,
1042,
2094,
1010,
1002,
5210,
1010,
1002,
4569,
2278,
1010,
1002,
12098,
5620,
1027,
9140,
1006,
1007,
1007,
1063,
6942,
1006,
1002,
5210,
1007,
1063,
2553,
2969,
1024,
1024,
23408,
1035,
3191,
1024,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/HttpKernel/HttpCache/Esi.php | Esi.renderIncludeTag | public function renderIncludeTag($uri, $alt = null, $ignoreErrors = true, $comment = '')
{
$html = sprintf('<esi:include src="%s"%s%s />',
$uri,
$ignoreErrors ? ' onerror="continue"' : '',
$alt ? sprintf(' alt="%s"', $alt) : ''
);
if (!empty($comment)) {
... | php | public function renderIncludeTag($uri, $alt = null, $ignoreErrors = true, $comment = '')
{
$html = sprintf('<esi:include src="%s"%s%s />',
$uri,
$ignoreErrors ? ' onerror="continue"' : '',
$alt ? sprintf(' alt="%s"', $alt) : ''
);
if (!empty($comment)) {
... | [
"public",
"function",
"renderIncludeTag",
"(",
"$",
"uri",
",",
"$",
"alt",
"=",
"null",
",",
"$",
"ignoreErrors",
"=",
"true",
",",
"$",
"comment",
"=",
"''",
")",
"{",
"$",
"html",
"=",
"sprintf",
"(",
"'<esi:include src=\"%s\"%s%s />'",
",",
"$",
"uri... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpKernel/HttpCache/Esi.php#L48-L61 | train | Render include tag | [
30522,
2270,
3853,
17552,
2378,
20464,
12672,
15900,
1006,
1002,
24471,
2072,
1010,
1002,
12456,
1027,
19701,
1010,
1002,
8568,
2121,
29165,
2015,
1027,
2995,
1010,
1002,
7615,
1027,
1005,
1005,
1007,
1063,
1002,
16129,
1027,
9043,
2546,
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/GeoIp2/LocationProvider/GeoIp2/ServerModule.php | ServerModule.isSameOrAnonymizedIp | public static function isSameOrAnonymizedIp($ip, $currentIp)
{
$ip = array_reverse(explode('.', $ip));
$currentIp = array_reverse(explode('.', $currentIp));
if (count($ip) != count($currentIp)) {
return false;
}
foreach ($ip as $i => $byte) {
if ($by... | php | public static function isSameOrAnonymizedIp($ip, $currentIp)
{
$ip = array_reverse(explode('.', $ip));
$currentIp = array_reverse(explode('.', $currentIp));
if (count($ip) != count($currentIp)) {
return false;
}
foreach ($ip as $i => $byte) {
if ($by... | [
"public",
"static",
"function",
"isSameOrAnonymizedIp",
"(",
"$",
"ip",
",",
"$",
"currentIp",
")",
"{",
"$",
"ip",
"=",
"array_reverse",
"(",
"explode",
"(",
"'.'",
",",
"$",
"ip",
")",
")",
";",
"$",
"currentIp",
"=",
"array_reverse",
"(",
"explode",
... | Checks if two IP addresses are the same or if the first is the anonymized
version of the other.
@param string $ip
@param string $currentIp This IP should not be anonymized.
@return bool | [
"Checks",
"if",
"two",
"IP",
"addresses",
"are",
"the",
"same",
"or",
"if",
"the",
"first",
"is",
"the",
"anonymized",
"version",
"of",
"the",
"other",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/GeoIp2/LocationProvider/GeoIp2/ServerModule.php#L271-L294 | train | Check if the current ip is the same or anonymized ip | [
30522,
2270,
10763,
3853,
26354,
14074,
18842,
16585,
4328,
5422,
11514,
1006,
1002,
12997,
1010,
1002,
2783,
11514,
1007,
1063,
1002,
12997,
1027,
9140,
1035,
7901,
1006,
15044,
1006,
1005,
1012,
1005,
1010,
1002,
12997,
1007,
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/Table/Row/Abstract.php | Zend_Db_Table_Row_Abstract._getTableFromString | protected function _getTableFromString($tableName)
{
if ($this->_table instanceof Zend_Db_Table_Abstract) {
$tableDefinition = $this->_table->getDefinition();
if ($tableDefinition !== null && $tableDefinition->hasTableConfig($tableName)) {
return new Zend_Db_Table($... | php | protected function _getTableFromString($tableName)
{
if ($this->_table instanceof Zend_Db_Table_Abstract) {
$tableDefinition = $this->_table->getDefinition();
if ($tableDefinition !== null && $tableDefinition->hasTableConfig($tableName)) {
return new Zend_Db_Table($... | [
"protected",
"function",
"_getTableFromString",
"(",
"$",
"tableName",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_table",
"instanceof",
"Zend_Db_Table_Abstract",
")",
"{",
"$",
"tableDefinition",
"=",
"$",
"this",
"->",
"_table",
"->",
"getDefinition",
"(",
")"... | _getTableFromString
@param string $tableName
@return Zend_Db_Table_Abstract | [
"_getTableFromString"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Table/Row/Abstract.php#L1168-L1201 | train | Create a Zend_Db_Table object from a string | [
30522,
5123,
3853,
1035,
2131,
10880,
19699,
22225,
18886,
3070,
1006,
1002,
2795,
18442,
1007,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
1035,
2795,
6013,
11253,
16729,
2094,
1035,
16962,
1035,
2795,
1035,
10061,
1007,
1063,
1002,
2795,
32... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Form/Extension/Core/DataTransformer/MoneyToLocalizedStringTransformer.php | MoneyToLocalizedStringTransformer.transform | public function transform($value)
{
if (null !== $value && 1 !== $this->divisor) {
if (!is_numeric($value)) {
throw new TransformationFailedException('Expected a numeric.');
}
$value /= $this->divisor;
}
return parent::transform($value);
... | php | public function transform($value)
{
if (null !== $value && 1 !== $this->divisor) {
if (!is_numeric($value)) {
throw new TransformationFailedException('Expected a numeric.');
}
$value /= $this->divisor;
}
return parent::transform($value);
... | [
"public",
"function",
"transform",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"value",
"&&",
"1",
"!==",
"$",
"this",
"->",
"divisor",
")",
"{",
"if",
"(",
"!",
"is_numeric",
"(",
"$",
"value",
")",
")",
"{",
"throw",
"new",
"Tra... | Transforms a normalized format into a localized money string.
@param int|float $value Normalized number
@return string Localized money string
@throws TransformationFailedException if the given value is not numeric or
if the value can not be transformed | [
"Transforms",
"a",
"normalized",
"format",
"into",
"a",
"localized",
"money",
"string",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/Extension/Core/DataTransformer/MoneyToLocalizedStringTransformer.php#L55-L65 | train | Transform a number to a string | [
30522,
2270,
3853,
10938,
1006,
1002,
3643,
1007,
1063,
2065,
1006,
19701,
999,
1027,
1027,
1002,
3643,
1004,
1004,
1015,
999,
1027,
1027,
1002,
2023,
1011,
1028,
4487,
11365,
2953,
1007,
1063,
2065,
1006,
999,
2003,
1035,
16371,
25531,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/View/RenderTokenParser.php | RenderTokenParser.parse | public function parse(Twig_Token $token)
{
$parser = $this->parser;
$stream = $parser->getStream();
$view = $parser->getExpressionParser()->parseExpression();
$variablesOverride = new Twig_Node_Expression_Array(array(), $token->getLine());
if ($stream->test(Twig_Token::NAME... | php | public function parse(Twig_Token $token)
{
$parser = $this->parser;
$stream = $parser->getStream();
$view = $parser->getExpressionParser()->parseExpression();
$variablesOverride = new Twig_Node_Expression_Array(array(), $token->getLine());
if ($stream->test(Twig_Token::NAME... | [
"public",
"function",
"parse",
"(",
"Twig_Token",
"$",
"token",
")",
"{",
"$",
"parser",
"=",
"$",
"this",
"->",
"parser",
";",
"$",
"stream",
"=",
"$",
"parser",
"->",
"getStream",
"(",
")",
";",
"$",
"view",
"=",
"$",
"parser",
"->",
"getExpression... | Parses the Twig stream and creates a Twig_Node_Include instance that includes
the View's template.
@return Twig_Node_Include | [
"Parses",
"the",
"Twig",
"stream",
"and",
"creates",
"a",
"Twig_Node_Include",
"instance",
"that",
"includes",
"the",
"View",
"s",
"template",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/View/RenderTokenParser.php#L34-L71 | train | Parse the view template | [
30522,
2270,
3853,
11968,
3366,
1006,
1056,
16279,
1035,
19204,
1002,
19204,
1007,
1063,
1002,
11968,
8043,
1027,
1002,
2023,
1011,
1028,
11968,
8043,
1025,
1002,
5460,
1027,
1002,
11968,
8043,
1011,
1028,
4152,
25379,
1006,
1007,
1025,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Validation/ValidationRuleParser.php | ValidationRuleParser.explodeRules | protected function explodeRules($rules)
{
foreach ($rules as $key => $rule) {
if (Str::contains($key, '*')) {
$rules = $this->explodeWildcardRules($rules, $key, [$rule]);
unset($rules[$key]);
} else {
$rules[$key] = $this->explodeExpli... | php | protected function explodeRules($rules)
{
foreach ($rules as $key => $rule) {
if (Str::contains($key, '*')) {
$rules = $this->explodeWildcardRules($rules, $key, [$rule]);
unset($rules[$key]);
} else {
$rules[$key] = $this->explodeExpli... | [
"protected",
"function",
"explodeRules",
"(",
"$",
"rules",
")",
"{",
"foreach",
"(",
"$",
"rules",
"as",
"$",
"key",
"=>",
"$",
"rule",
")",
"{",
"if",
"(",
"Str",
"::",
"contains",
"(",
"$",
"key",
",",
"'*'",
")",
")",
"{",
"$",
"rules",
"=",
... | Explode the rules into an array of explicit rules.
@param array $rules
@return array | [
"Explode",
"the",
"rules",
"into",
"an",
"array",
"of",
"explicit",
"rules",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Validation/ValidationRuleParser.php#L63-L76 | train | Explodes the rules array into an array of implicit and wildcard rules | [
30522,
5123,
3853,
15044,
6820,
4244,
1006,
1002,
3513,
1007,
1063,
18921,
6776,
1006,
1002,
3513,
2004,
1002,
3145,
1027,
1028,
1002,
3627,
1007,
1063,
2065,
1006,
2358,
2099,
1024,
1024,
3397,
1006,
1002,
3145,
1010,
1005,
1008,
1005,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Filesystem/FilesystemAdapter.php | FilesystemAdapter.put | public function put($path, $contents, $options = [])
{
$options = is_string($options)
? ['visibility' => $options]
: (array) $options;
// If the given contents is actually a file or uploaded file instance than we will
// automatically store the file... | php | public function put($path, $contents, $options = [])
{
$options = is_string($options)
? ['visibility' => $options]
: (array) $options;
// If the given contents is actually a file or uploaded file instance than we will
// automatically store the file... | [
"public",
"function",
"put",
"(",
"$",
"path",
",",
"$",
"contents",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"options",
"=",
"is_string",
"(",
"$",
"options",
")",
"?",
"[",
"'visibility'",
"=>",
"$",
"options",
"]",
":",
"(",
"array",
... | Write the contents of a file.
@param string $path
@param string|resource $contents
@param mixed $options
@return bool | [
"Write",
"the",
"contents",
"of",
"a",
"file",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Filesystem/FilesystemAdapter.php#L179-L196 | train | Put the given file or stream to the given path | [
30522,
2270,
3853,
2404,
1006,
1002,
4130,
1010,
1002,
8417,
1010,
1002,
7047,
1027,
1031,
1033,
1007,
1063,
1002,
7047,
1027,
2003,
1035,
5164,
1006,
1002,
7047,
1007,
1029,
1031,
1005,
16476,
1005,
1027,
1028,
1002,
7047,
1033,
1024,
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/Validate/Ip.php | Zend_Validate_Ip._validateIPv6 | protected function _validateIPv6($value) {
if (strlen($value) < 3) {
return $value == '::';
}
if (strpos($value, '.')) {
$lastcolon = strrpos($value, ':');
if (!($lastcolon && $this->_validateIPv4(substr($value, $lastcolon + 1)))) {
return fal... | php | protected function _validateIPv6($value) {
if (strlen($value) < 3) {
return $value == '::';
}
if (strpos($value, '.')) {
$lastcolon = strrpos($value, ':');
if (!($lastcolon && $this->_validateIPv4(substr($value, $lastcolon + 1)))) {
return fal... | [
"protected",
"function",
"_validateIPv6",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"strlen",
"(",
"$",
"value",
")",
"<",
"3",
")",
"{",
"return",
"$",
"value",
"==",
"'::'",
";",
"}",
"if",
"(",
"strpos",
"(",
"$",
"value",
",",
"'.'",
")",
")",
... | Validates an IPv6 address
@param string $value Value to check against
@return boolean True when $value is a valid ipv6 address
False otherwise | [
"Validates",
"an",
"IPv6",
"address"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Validate/Ip.php#L161-L190 | train | Validate IPv6 address | [
30522,
5123,
3853,
1035,
9398,
3686,
11514,
2615,
2575,
1006,
1002,
3643,
1007,
1063,
2065,
1006,
2358,
20927,
2078,
1006,
1002,
3643,
1007,
1026,
1017,
1007,
1063,
2709,
1002,
3643,
1027,
1027,
1005,
1024,
1024,
1005,
1025,
1065,
2065,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Templating/Helper/SlotsHelper.php | SlotsHelper.output | public function output($name, $default = false)
{
if (!isset($this->slots[$name])) {
if (false !== $default) {
echo $default;
return true;
}
return false;
}
echo $this->slots[$name];
return true;
} | php | public function output($name, $default = false)
{
if (!isset($this->slots[$name])) {
if (false !== $default) {
echo $default;
return true;
}
return false;
}
echo $this->slots[$name];
return true;
} | [
"public",
"function",
"output",
"(",
"$",
"name",
",",
"$",
"default",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"slots",
"[",
"$",
"name",
"]",
")",
")",
"{",
"if",
"(",
"false",
"!==",
"$",
"default",
")",
"{",
... | Outputs a slot.
@param string $name The slot name
@param bool|string $default The default slot content
@return bool true if the slot is defined or if a default content has been provided, false otherwise | [
"Outputs",
"a",
"slot",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Templating/Helper/SlotsHelper.php#L107-L122 | train | Outputs the content of a slot | [
30522,
2270,
3853,
6434,
1006,
1002,
2171,
1010,
1002,
12398,
1027,
6270,
1007,
1063,
2065,
1006,
999,
26354,
3388,
1006,
1002,
2023,
1011,
1028,
19832,
1031,
1002,
2171,
1033,
1007,
1007,
1063,
2065,
1006,
6270,
999,
1027,
1027,
1002,
12... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/PropertyAccess/PropertyAccessorBuilder.php | PropertyAccessorBuilder.getPropertyAccessor | public function getPropertyAccessor()
{
return new PropertyAccessor($this->magicCall, $this->throwExceptionOnInvalidIndex, $this->cacheItemPool, $this->throwExceptionOnInvalidPropertyPath);
} | php | public function getPropertyAccessor()
{
return new PropertyAccessor($this->magicCall, $this->throwExceptionOnInvalidIndex, $this->cacheItemPool, $this->throwExceptionOnInvalidPropertyPath);
} | [
"public",
"function",
"getPropertyAccessor",
"(",
")",
"{",
"return",
"new",
"PropertyAccessor",
"(",
"$",
"this",
"->",
"magicCall",
",",
"$",
"this",
"->",
"throwExceptionOnInvalidIndex",
",",
"$",
"this",
"->",
"cacheItemPool",
",",
"$",
"this",
"->",
"thro... | Builds and returns a new PropertyAccessor object.
@return PropertyAccessorInterface The built PropertyAccessor | [
"Builds",
"and",
"returns",
"a",
"new",
"PropertyAccessor",
"object",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/PropertyAccess/PropertyAccessorBuilder.php#L167-L170 | train | Get the property accessor for the current page | [
30522,
2270,
3853,
2131,
21572,
4842,
21426,
9468,
7971,
2953,
1006,
1007,
1063,
2709,
2047,
3200,
6305,
9623,
21748,
1006,
1002,
2023,
1011,
1028,
3894,
9289,
2140,
1010,
1002,
2023,
1011,
1028,
5466,
10288,
24422,
10698,
2078,
10175,
2817... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/QueriesRelationships.php | QueriesRelationships.doesntHave | public function doesntHave($relation, $boolean = 'and', Closure $callback = null)
{
return $this->has($relation, '<', 1, $boolean, $callback);
} | php | public function doesntHave($relation, $boolean = 'and', Closure $callback = null)
{
return $this->has($relation, '<', 1, $boolean, $callback);
} | [
"public",
"function",
"doesntHave",
"(",
"$",
"relation",
",",
"$",
"boolean",
"=",
"'and'",
",",
"Closure",
"$",
"callback",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"has",
"(",
"$",
"relation",
",",
"'<'",
",",
"1",
",",
"$",
"boolean",
... | Add a relationship count / exists condition to the query.
@param string $relation
@param string $boolean
@param \Closure|null $callback
@return \Illuminate\Database\Eloquent\Builder|static | [
"Add",
"a",
"relationship",
"count",
"/",
"exists",
"condition",
"to",
"the",
"query",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Concerns/QueriesRelationships.php#L117-L120 | train | Has not exists | [
30522,
2270,
3853,
2987,
8322,
3726,
1006,
1002,
7189,
1010,
1002,
22017,
20898,
1027,
1005,
1998,
1005,
1010,
8503,
1002,
2655,
5963,
1027,
19701,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
2038,
1006,
1002,
7189,
1010,
1005,
1026,
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.