repo stringclasses 21
values | path stringlengths 10 105 | func_name stringlengths 6 64 | original_string stringlengths 105 15.6k | language stringclasses 1
value | code stringlengths 105 15.6k | code_tokens listlengths 29 2.15k | docstring stringlengths 11 2.85k | docstring_tokens listlengths 1 290 | sha stringclasses 21
values | url stringlengths 100 194 | partition stringclasses 1
value | summary stringlengths 8 319 | input_ids listlengths 502 502 | token_type_ids listlengths 502 502 | attention_mask listlengths 502 502 | labels listlengths 502 502 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
laravel/framework | src/Illuminate/Support/Collection.php | Collection.pluck | public function pluck($value, $key = null)
{
return new static(Arr::pluck($this->items, $value, $key));
} | php | public function pluck($value, $key = null)
{
return new static(Arr::pluck($this->items, $value, $key));
} | [
"public",
"function",
"pluck",
"(",
"$",
"value",
",",
"$",
"key",
"=",
"null",
")",
"{",
"return",
"new",
"static",
"(",
"Arr",
"::",
"pluck",
"(",
"$",
"this",
"->",
"items",
",",
"$",
"value",
",",
"$",
"key",
")",
")",
";",
"}"
] | Get the values of a given key.
@param string|array $value
@param string|null $key
@return static | [
"Get",
"the",
"values",
"of",
"a",
"given",
"key",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Support/Collection.php#L1105-L1108 | train | Pluck value from the items | [
30522,
2270,
3853,
20228,
12722,
1006,
1002,
3643,
1010,
1002,
3145,
1027,
19701,
1007,
1063,
2709,
2047,
10763,
1006,
12098,
2099,
1024,
1024,
20228,
12722,
1006,
1002,
2023,
1011,
1028,
5167,
1010,
1002,
3643,
1010,
1002,
3145,
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... |
laravel/framework | src/Illuminate/Database/Query/Grammars/SqlServerGrammar.php | SqlServerGrammar.parseUpdateTable | protected function parseUpdateTable($table)
{
$table = $alias = $this->wrapTable($table);
if (stripos($table, '] as [') !== false) {
$alias = '['.explode('] as [', $table)[1];
}
return [$table, $alias];
} | php | protected function parseUpdateTable($table)
{
$table = $alias = $this->wrapTable($table);
if (stripos($table, '] as [') !== false) {
$alias = '['.explode('] as [', $table)[1];
}
return [$table, $alias];
} | [
"protected",
"function",
"parseUpdateTable",
"(",
"$",
"table",
")",
"{",
"$",
"table",
"=",
"$",
"alias",
"=",
"$",
"this",
"->",
"wrapTable",
"(",
"$",
"table",
")",
";",
"if",
"(",
"stripos",
"(",
"$",
"table",
",",
"'] as ['",
")",
"!==",
"false"... | Get the table and alias for the given table.
@param string $table
@return array | [
"Get",
"the",
"table",
"and",
"alias",
"for",
"the",
"given",
"table",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Query/Grammars/SqlServerGrammar.php#L388-L397 | train | Parse the update table into an array | [
30522,
5123,
3853,
11968,
3366,
6279,
13701,
10880,
1006,
1002,
2795,
1007,
1063,
1002,
2795,
1027,
1002,
14593,
1027,
1002,
2023,
1011,
1028,
10236,
10880,
1006,
1002,
2795,
1007,
1025,
2065,
1006,
6167,
2891,
1006,
1002,
2795,
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... |
matomo-org/matomo | core/Common.php | Common.isPhpCliMode | public static function isPhpCliMode()
{
if (is_bool(self::$isCliMode)) {
return self::$isCliMode;
}
if(PHP_SAPI == 'cli'){
return true;
}
if(self::isPhpCgiType() && (!isset($_SERVER['REMOTE_ADDR']) || empty($_SERVER['REMOTE_ADDR']))){
... | php | public static function isPhpCliMode()
{
if (is_bool(self::$isCliMode)) {
return self::$isCliMode;
}
if(PHP_SAPI == 'cli'){
return true;
}
if(self::isPhpCgiType() && (!isset($_SERVER['REMOTE_ADDR']) || empty($_SERVER['REMOTE_ADDR']))){
... | [
"public",
"static",
"function",
"isPhpCliMode",
"(",
")",
"{",
"if",
"(",
"is_bool",
"(",
"self",
"::",
"$",
"isCliMode",
")",
")",
"{",
"return",
"self",
"::",
"$",
"isCliMode",
";",
"}",
"if",
"(",
"PHP_SAPI",
"==",
"'cli'",
")",
"{",
"return",
"tr... | Returns true if PHP was invoked from command-line interface (shell)
@since added in 0.4.4
@return bool true if PHP invoked as a CGI or from CLI | [
"Returns",
"true",
"if",
"PHP",
"was",
"invoked",
"from",
"command",
"-",
"line",
"interface",
"(",
"shell",
")"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Common.php#L128-L143 | train | Return true if PHP is in CLI mode | [
30522,
2270,
10763,
3853,
2003,
8458,
15042,
17960,
10244,
1006,
1007,
1063,
2065,
1006,
2003,
1035,
22017,
2140,
1006,
2969,
1024,
1024,
1002,
2003,
20464,
16339,
3207,
1007,
1007,
1063,
2709,
2969,
1024,
1024,
1002,
2003,
20464,
16339,
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... |
laravel/framework | src/Illuminate/Validation/Validator.php | Validator.attributesThatHaveMessages | protected function attributesThatHaveMessages()
{
return collect($this->messages()->toArray())->map(function ($message, $key) {
return explode('.', $key)[0];
})->unique()->flip()->all();
} | php | protected function attributesThatHaveMessages()
{
return collect($this->messages()->toArray())->map(function ($message, $key) {
return explode('.', $key)[0];
})->unique()->flip()->all();
} | [
"protected",
"function",
"attributesThatHaveMessages",
"(",
")",
"{",
"return",
"collect",
"(",
"$",
"this",
"->",
"messages",
"(",
")",
"->",
"toArray",
"(",
")",
")",
"->",
"map",
"(",
"function",
"(",
"$",
"message",
",",
"$",
"key",
")",
"{",
"retu... | Generate an array of all attributes that have messages.
@return array | [
"Generate",
"an",
"array",
"of",
"all",
"attributes",
"that",
"have",
"messages",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Validation/Validator.php#L668-L673 | train | Returns all attributes that have messages | [
30522,
5123,
3853,
12332,
8322,
8322,
3726,
7834,
3736,
8449,
1006,
1007,
1063,
2709,
8145,
1006,
1002,
2023,
1011,
1028,
7696,
1006,
1007,
1011,
1028,
2000,
2906,
9447,
1006,
1007,
1007,
1011,
1028,
4949,
1006,
3853,
1006,
1002,
4471,
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/Utils.php | Utils.date2timestamp | public static function date2timestamp($date, $format = null)
{
$config = Grav::instance()['config'];
$dateformat = $format ?: $config->get('system.pages.dateformat.default');
// try to use DateTime and default format
if ($dateformat) {
$datetime = \DateTime::createFromFo... | php | public static function date2timestamp($date, $format = null)
{
$config = Grav::instance()['config'];
$dateformat = $format ?: $config->get('system.pages.dateformat.default');
// try to use DateTime and default format
if ($dateformat) {
$datetime = \DateTime::createFromFo... | [
"public",
"static",
"function",
"date2timestamp",
"(",
"$",
"date",
",",
"$",
"format",
"=",
"null",
")",
"{",
"$",
"config",
"=",
"Grav",
"::",
"instance",
"(",
")",
"[",
"'config'",
"]",
";",
"$",
"dateformat",
"=",
"$",
"format",
"?",
":",
"$",
... | Get the timestamp of a date
@param string $date a String expressed in the system.pages.dateformat.default format, with fallback to a
strtotime argument
@param string $format a date format to use if possible
@return int the timestamp | [
"Get",
"the",
"timestamp",
"of",
"a",
"date"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Utils.php#L1004-L1022 | train | Convert a date to timestamp | [
30522,
2270,
10763,
3853,
3058,
2475,
7292,
9153,
8737,
1006,
1002,
3058,
1010,
1002,
4289,
1027,
19701,
1007,
1063,
1002,
9530,
8873,
2290,
1027,
24665,
11431,
1024,
1024,
6013,
1006,
1007,
1031,
1005,
9530,
8873,
2290,
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/Component/Mime/Header/DateHeader.php | DateHeader.setDateTime | public function setDateTime(\DateTimeInterface $dateTime)
{
if ($dateTime instanceof \DateTime) {
$immutable = new \DateTimeImmutable('@'.$dateTime->getTimestamp());
$dateTime = $immutable->setTimezone($dateTime->getTimezone());
}
$this->dateTime = $dateTime;
} | php | public function setDateTime(\DateTimeInterface $dateTime)
{
if ($dateTime instanceof \DateTime) {
$immutable = new \DateTimeImmutable('@'.$dateTime->getTimestamp());
$dateTime = $immutable->setTimezone($dateTime->getTimezone());
}
$this->dateTime = $dateTime;
} | [
"public",
"function",
"setDateTime",
"(",
"\\",
"DateTimeInterface",
"$",
"dateTime",
")",
"{",
"if",
"(",
"$",
"dateTime",
"instanceof",
"\\",
"DateTime",
")",
"{",
"$",
"immutable",
"=",
"new",
"\\",
"DateTimeImmutable",
"(",
"'@'",
".",
"$",
"dateTime",
... | Set the date-time of the Date in this Header.
If a DateTime instance is provided, it is converted to DateTimeImmutable. | [
"Set",
"the",
"date",
"-",
"time",
"of",
"the",
"Date",
"in",
"this",
"Header",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Mime/Header/DateHeader.php#L58-L65 | train | Set \ DateTime \ DateTimeImmutable instance | [
30522,
2270,
3853,
2275,
13701,
7292,
1006,
1032,
3058,
7292,
18447,
2121,
12172,
1002,
3058,
7292,
1007,
1063,
2065,
1006,
1002,
3058,
7292,
6013,
11253,
1032,
3058,
7292,
1007,
1063,
1002,
10047,
28120,
3085,
1027,
2047,
1032,
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 | libs/Zend/Mail/Transport/Abstract.php | Zend_Mail_Transport_Abstract.send | public function send(Zend_Mail $mail)
{
$this->_isMultipart = false;
$this->_mail = $mail;
$this->_parts = $mail->getParts();
$mime = $mail->getMime();
// Build body content
$this->_buildBody();
// Determine number of parts and bou... | php | public function send(Zend_Mail $mail)
{
$this->_isMultipart = false;
$this->_mail = $mail;
$this->_parts = $mail->getParts();
$mime = $mail->getMime();
// Build body content
$this->_buildBody();
// Determine number of parts and bou... | [
"public",
"function",
"send",
"(",
"Zend_Mail",
"$",
"mail",
")",
"{",
"$",
"this",
"->",
"_isMultipart",
"=",
"false",
";",
"$",
"this",
"->",
"_mail",
"=",
"$",
"mail",
";",
"$",
"this",
"->",
"_parts",
"=",
"$",
"mail",
"->",
"getParts",
"(",
")... | Send a mail using this transport
@param Zend_Mail $mail
@access public
@return void
@throws Zend_Mail_Transport_Exception if mail is empty | [
"Send",
"a",
"mail",
"using",
"this",
"transport"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail/Transport/Abstract.php#L305-L349 | train | Send a Zend_Mail object to the transport | [
30522,
2270,
3853,
4604,
1006,
16729,
2094,
1035,
5653,
1002,
5653,
1007,
1063,
1002,
2023,
1011,
1028,
1035,
2003,
12274,
7096,
11514,
8445,
1027,
6270,
1025,
1002,
2023,
1011,
1028,
1035,
5653,
1027,
1002,
5653,
1025,
1002,
2023,
1011,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Form/Extension/Core/DataTransformer/NumberToLocalizedStringTransformer.php | NumberToLocalizedStringTransformer.round | private function round($number)
{
if (null !== $this->scale && null !== $this->roundingMode) {
// shift number to maintain the correct scale during rounding
$roundingCoef = pow(10, $this->scale);
// string representation to avoid rounding errors, similar to bcmul()
... | php | private function round($number)
{
if (null !== $this->scale && null !== $this->roundingMode) {
// shift number to maintain the correct scale during rounding
$roundingCoef = pow(10, $this->scale);
// string representation to avoid rounding errors, similar to bcmul()
... | [
"private",
"function",
"round",
"(",
"$",
"number",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"scale",
"&&",
"null",
"!==",
"$",
"this",
"->",
"roundingMode",
")",
"{",
"// shift number to maintain the correct scale during rounding",
"$",
"roundingC... | Rounds a number according to the configured scale and rounding mode.
@param int|float $number A number
@return int|float The rounded number | [
"Rounds",
"a",
"number",
"according",
"to",
"the",
"configured",
"scale",
"and",
"rounding",
"mode",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/Extension/Core/DataTransformer/NumberToLocalizedStringTransformer.php#L250-L286 | train | Rounds the number according to the scale and rounding mode | [
30522,
2797,
3853,
2461,
1006,
1002,
2193,
1007,
1063,
2065,
1006,
19701,
999,
1027,
1027,
1002,
2023,
1011,
1028,
4094,
1004,
1004,
19701,
999,
1027,
1027,
1002,
2023,
1011,
1028,
26939,
5302,
3207,
1007,
1063,
1013,
1013,
5670,
2193,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/backend/classes/Controller.php | Controller.execPageAction | protected function execPageAction($actionName, $parameters)
{
$result = null;
if (!$this->actionExists($actionName)) {
if (Config::get('app.debug', false)) {
throw new SystemException(sprintf(
"Action %s is not found in the controller %s",
... | php | protected function execPageAction($actionName, $parameters)
{
$result = null;
if (!$this->actionExists($actionName)) {
if (Config::get('app.debug', false)) {
throw new SystemException(sprintf(
"Action %s is not found in the controller %s",
... | [
"protected",
"function",
"execPageAction",
"(",
"$",
"actionName",
",",
"$",
"parameters",
")",
"{",
"$",
"result",
"=",
"null",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"actionExists",
"(",
"$",
"actionName",
")",
")",
"{",
"if",
"(",
"Config",
"::",
... | This method is used internally.
Invokes the controller action and loads the corresponding view.
@param string $actionName Specifies a action name to execute.
@param array $parameters A list of the action parameters. | [
"This",
"method",
"is",
"used",
"internally",
".",
"Invokes",
"the",
"controller",
"action",
"and",
"loads",
"the",
"corresponding",
"view",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/Controller.php#L337-L372 | train | Execute the action | [
30522,
5123,
3853,
4654,
8586,
13704,
18908,
3258,
1006,
1002,
2895,
18442,
1010,
1002,
11709,
1007,
1063,
1002,
2765,
1027,
19701,
1025,
2065,
1006,
999,
1002,
2023,
1011,
1028,
2895,
10288,
5130,
1006,
1002,
2895,
18442,
1007,
1007,
1063,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/ArchiveProcessor/PluginsArchiver.php | PluginsArchiver.callAggregateAllPlugins | public function callAggregateAllPlugins($visits, $visitsConverted, $forceArchivingWithoutVisits = false)
{
Log::debug("PluginsArchiver::%s: Initializing archiving process for all plugins [visits = %s, visits converted = %s]",
__FUNCTION__, $visits, $visitsConverted);
/** @var Logger $pe... | php | public function callAggregateAllPlugins($visits, $visitsConverted, $forceArchivingWithoutVisits = false)
{
Log::debug("PluginsArchiver::%s: Initializing archiving process for all plugins [visits = %s, visits converted = %s]",
__FUNCTION__, $visits, $visitsConverted);
/** @var Logger $pe... | [
"public",
"function",
"callAggregateAllPlugins",
"(",
"$",
"visits",
",",
"$",
"visitsConverted",
",",
"$",
"forceArchivingWithoutVisits",
"=",
"false",
")",
"{",
"Log",
"::",
"debug",
"(",
"\"PluginsArchiver::%s: Initializing archiving process for all plugins [visits = %s, v... | Instantiates the Archiver class in each plugin that defines it,
and triggers Aggregation processing on these plugins. | [
"Instantiates",
"the",
"Archiver",
"class",
"in",
"each",
"plugin",
"that",
"defines",
"it",
"and",
"triggers",
"Aggregation",
"processing",
"on",
"these",
"plugins",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/ArchiveProcessor/PluginsArchiver.php#L121-L187 | train | Calls all plugins and aggregate all reports | [
30522,
2270,
3853,
2655,
8490,
17603,
5867,
8095,
24759,
15916,
7076,
1006,
1002,
7879,
1010,
1002,
7879,
8663,
26686,
1010,
1002,
2486,
2906,
5428,
6455,
24415,
5833,
11365,
12762,
1027,
6270,
1007,
1063,
8833,
1024,
1024,
2139,
8569,
2290... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/BrowserKit/CookieJar.php | CookieJar.updateFromSetCookie | public function updateFromSetCookie(array $setCookies, $uri = null)
{
$cookies = [];
foreach ($setCookies as $cookie) {
foreach (explode(',', $cookie) as $i => $part) {
if (0 === $i || preg_match('/^(?P<token>\s*[0-9A-Za-z!#\$%\&\'\*\+\-\.^_`\|~]+)=/', $part)) {
... | php | public function updateFromSetCookie(array $setCookies, $uri = null)
{
$cookies = [];
foreach ($setCookies as $cookie) {
foreach (explode(',', $cookie) as $i => $part) {
if (0 === $i || preg_match('/^(?P<token>\s*[0-9A-Za-z!#\$%\&\'\*\+\-\.^_`\|~]+)=/', $part)) {
... | [
"public",
"function",
"updateFromSetCookie",
"(",
"array",
"$",
"setCookies",
",",
"$",
"uri",
"=",
"null",
")",
"{",
"$",
"cookies",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"setCookies",
"as",
"$",
"cookie",
")",
"{",
"foreach",
"(",
"explode",
"(",
... | Updates the cookie jar from a response Set-Cookie headers.
@param array $setCookies Set-Cookie headers from an HTTP response
@param string $uri The base URL | [
"Updates",
"the",
"cookie",
"jar",
"from",
"a",
"response",
"Set",
"-",
"Cookie",
"headers",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/BrowserKit/CookieJar.php#L117-L138 | train | Update the cookies from the cookies set in the request | [
30522,
2270,
3853,
10651,
19699,
22225,
3388,
3597,
23212,
2063,
1006,
9140,
1002,
2275,
3597,
23212,
2229,
1010,
1002,
24471,
2072,
1027,
19701,
1007,
1063,
1002,
16324,
1027,
1031,
1033,
1025,
18921,
6776,
1006,
1002,
2275,
3597,
23212,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/backend/widgets/Lists.php | Lists.getRecordOnClick | public function getRecordOnClick($record)
{
if (!isset($this->recordOnClick)) {
return null;
}
$recordOnClick = RouterHelper::replaceParameters($record, $this->recordOnClick);
return Html::attributes(['onclick' => $recordOnClick]);
} | php | public function getRecordOnClick($record)
{
if (!isset($this->recordOnClick)) {
return null;
}
$recordOnClick = RouterHelper::replaceParameters($record, $this->recordOnClick);
return Html::attributes(['onclick' => $recordOnClick]);
} | [
"public",
"function",
"getRecordOnClick",
"(",
"$",
"record",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"recordOnClick",
")",
")",
"{",
"return",
"null",
";",
"}",
"$",
"recordOnClick",
"=",
"RouterHelper",
"::",
"replaceParameters",
"(",
... | Returns the onclick event for a list row.
@param Model $record
@return string | [
"Returns",
"the",
"onclick",
"event",
"for",
"a",
"list",
"row",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/Lists.php#L676-L684 | train | Returns HTML element for record click | [
30522,
2270,
3853,
2131,
2890,
27108,
5280,
20464,
6799,
1006,
1002,
2501,
1007,
1063,
2065,
1006,
999,
26354,
3388,
1006,
1002,
2023,
1011,
1028,
2501,
2239,
20464,
6799,
1007,
1007,
1063,
2709,
19701,
1025,
1065,
1002,
2501,
2239,
20464,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/Plugin/Controller.php | Controller.setPeriodVariablesView | public static function setPeriodVariablesView($view)
{
if (isset($view->period)) {
return;
}
$periodValidator = new PeriodValidator();
$currentPeriod = Common::getRequestVar('period');
$view->displayUniqueVisitors = SettingsPiwik::isUniqueVisitorsEnabled($curren... | php | public static function setPeriodVariablesView($view)
{
if (isset($view->period)) {
return;
}
$periodValidator = new PeriodValidator();
$currentPeriod = Common::getRequestVar('period');
$view->displayUniqueVisitors = SettingsPiwik::isUniqueVisitorsEnabled($curren... | [
"public",
"static",
"function",
"setPeriodVariablesView",
"(",
"$",
"view",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"view",
"->",
"period",
")",
")",
"{",
"return",
";",
"}",
"$",
"periodValidator",
"=",
"new",
"PeriodValidator",
"(",
")",
";",
"$",
"c... | Sets general period variables on a view, including:
- **displayUniqueVisitors** - Whether unique visitors should be displayed for the current
period.
- **period** - The value of the **period** query parameter.
- **otherPeriods** - `array('day', 'week', 'month', 'year', 'range')`
- **periodsNames** - List of available ... | [
"Sets",
"general",
"period",
"variables",
"on",
"a",
"view",
"including",
":"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Plugin/Controller.php#L851-L874 | train | This method sets the period variables view. | [
30522,
2270,
10763,
3853,
2275,
4842,
3695,
2094,
10755,
19210,
2015,
8584,
1006,
1002,
3193,
1007,
1063,
2065,
1006,
26354,
3388,
1006,
1002,
3193,
1011,
1028,
2558,
1007,
1007,
1063,
2709,
1025,
1065,
1002,
2558,
10175,
8524,
4263,
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... |
php-ai/php-ml | src/DimensionReduction/KernelPCA.php | KernelPCA.fit | public function fit(array $data): array
{
$numRows = count($data);
$this->data = $data;
if ($this->gamma === null) {
$this->gamma = 1.0 / $numRows;
}
$matrix = $this->calculateKernelMatrix($this->data, $numRows);
$matrix = $this->centerMatrix($matrix, $n... | php | public function fit(array $data): array
{
$numRows = count($data);
$this->data = $data;
if ($this->gamma === null) {
$this->gamma = 1.0 / $numRows;
}
$matrix = $this->calculateKernelMatrix($this->data, $numRows);
$matrix = $this->centerMatrix($matrix, $n... | [
"public",
"function",
"fit",
"(",
"array",
"$",
"data",
")",
":",
"array",
"{",
"$",
"numRows",
"=",
"count",
"(",
"$",
"data",
")",
";",
"$",
"this",
"->",
"data",
"=",
"$",
"data",
";",
"if",
"(",
"$",
"this",
"->",
"gamma",
"===",
"null",
")... | Takes a data and returns a lower dimensional version
of this data while preserving $totalVariance or $numFeatures. <br>
$data is an n-by-m matrix and returned array is
n-by-k matrix where k <= m | [
"Takes",
"a",
"data",
"and",
"returns",
"a",
"lower",
"dimensional",
"version",
"of",
"this",
"data",
"while",
"preserving",
"$totalVariance",
"or",
"$numFeatures",
".",
"<br",
">",
"$data",
"is",
"an",
"n",
"-",
"by",
"-",
"m",
"matrix",
"and",
"returned"... | f6aa1a59b0525b8fca3d2786d661ab3e70904016 | https://github.com/php-ai/php-ml/blob/f6aa1a59b0525b8fca3d2786d661ab3e70904016/src/DimensionReduction/KernelPCA.php#L77-L94 | train | Fits the algorithm to the given array | [
30522,
2270,
3853,
4906,
1006,
9140,
1002,
2951,
1007,
1024,
9140,
1063,
1002,
16371,
2213,
10524,
2015,
1027,
4175,
1006,
1002,
2951,
1007,
1025,
1002,
2023,
1011,
1028,
2951,
1027,
1002,
2951,
1025,
2065,
1006,
1002,
2023,
1011,
1028,
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/Intl/Data/Generator/ScriptDataGenerator.php | ScriptDataGenerator.generateDataForMeta | protected function generateDataForMeta(BundleReaderInterface $reader, $tempDir)
{
$rootBundle = $reader->read($tempDir, 'root');
$this->scriptCodes = array_unique($this->scriptCodes);
sort($this->scriptCodes);
return [
'Version' => $rootBundle['Version'],
'... | php | protected function generateDataForMeta(BundleReaderInterface $reader, $tempDir)
{
$rootBundle = $reader->read($tempDir, 'root');
$this->scriptCodes = array_unique($this->scriptCodes);
sort($this->scriptCodes);
return [
'Version' => $rootBundle['Version'],
'... | [
"protected",
"function",
"generateDataForMeta",
"(",
"BundleReaderInterface",
"$",
"reader",
",",
"$",
"tempDir",
")",
"{",
"$",
"rootBundle",
"=",
"$",
"reader",
"->",
"read",
"(",
"$",
"tempDir",
",",
"'root'",
")",
";",
"$",
"this",
"->",
"scriptCodes",
... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Intl/Data/Generator/ScriptDataGenerator.php#L88-L100 | train | Generate data for Meta | [
30522,
5123,
3853,
7013,
6790,
14192,
12928,
1006,
14012,
16416,
4063,
18447,
2121,
12172,
1002,
8068,
1010,
1002,
8915,
8737,
4305,
2099,
1007,
1063,
1002,
7117,
27265,
2571,
1027,
1002,
8068,
1011,
1028,
3191,
1006,
1002,
8915,
8737,
4305... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/backend/formwidgets/FileUpload.php | FileUpload.getAcceptedFileTypes | public function getAcceptedFileTypes($includeDot = false)
{
$types = $this->fileTypes;
if ($types === false) {
$isImage = starts_with($this->getDisplayMode(), 'image');
$types = implode(',', FileDefinitions::get($isImage ? 'imageExtensions' : 'defaultExtensions'));
}... | php | public function getAcceptedFileTypes($includeDot = false)
{
$types = $this->fileTypes;
if ($types === false) {
$isImage = starts_with($this->getDisplayMode(), 'image');
$types = implode(',', FileDefinitions::get($isImage ? 'imageExtensions' : 'defaultExtensions'));
}... | [
"public",
"function",
"getAcceptedFileTypes",
"(",
"$",
"includeDot",
"=",
"false",
")",
"{",
"$",
"types",
"=",
"$",
"this",
"->",
"fileTypes",
";",
"if",
"(",
"$",
"types",
"===",
"false",
")",
"{",
"$",
"isImage",
"=",
"starts_with",
"(",
"$",
"this... | Returns the specified accepted file types, or the default
based on the mode. Image mode will return:
- jpg,jpeg,bmp,png,gif,svg
@return string | [
"Returns",
"the",
"specified",
"accepted",
"file",
"types",
"or",
"the",
"default",
"based",
"on",
"the",
"mode",
".",
"Image",
"mode",
"will",
"return",
":",
"-",
"jpg",
"jpeg",
"bmp",
"png",
"gif",
"svg"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/formwidgets/FileUpload.php#L240-L272 | train | Returns the list of file types accepted by the user. | [
30522,
2270,
3853,
2131,
6305,
3401,
13876,
2098,
8873,
7485,
18863,
2015,
1006,
1002,
2443,
4140,
1027,
6270,
1007,
1063,
1002,
4127,
1027,
1002,
2023,
1011,
1028,
5371,
13874,
2015,
1025,
2065,
1006,
1002,
4127,
1027,
1027,
1027,
6270,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Foundation/Application.php | Application.bindPathsInContainer | protected function bindPathsInContainer()
{
$this->instance('path', $this->path());
$this->instance('path.base', $this->basePath());
$this->instance('path.lang', $this->langPath());
$this->instance('path.config', $this->configPath());
$this->instance('path.public', $this->pub... | php | protected function bindPathsInContainer()
{
$this->instance('path', $this->path());
$this->instance('path.base', $this->basePath());
$this->instance('path.lang', $this->langPath());
$this->instance('path.config', $this->configPath());
$this->instance('path.public', $this->pub... | [
"protected",
"function",
"bindPathsInContainer",
"(",
")",
"{",
"$",
"this",
"->",
"instance",
"(",
"'path'",
",",
"$",
"this",
"->",
"path",
"(",
")",
")",
";",
"$",
"this",
"->",
"instance",
"(",
"'path.base'",
",",
"$",
"this",
"->",
"basePath",
"("... | Bind all of the application paths in the container.
@return void | [
"Bind",
"all",
"of",
"the",
"application",
"paths",
"in",
"the",
"container",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Foundation/Application.php#L283-L294 | train | Binds paths in container | [
30522,
5123,
3853,
14187,
15069,
11493,
8663,
18249,
2121,
1006,
1007,
30524,
2023,
1011,
1028,
6013,
1006,
1005,
4130,
1012,
11374,
1005,
1010,
1002,
2023,
1011,
1028,
11374,
15069,
1006,
1007,
1007,
1025,
1002,
2023,
1011,
1028,
6013,
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 | libs/HTML/Common2.php | HTML_Common2.prepareAttributes | protected static function prepareAttributes($attributes)
{
$prepared = array();
if (is_string($attributes)) {
return self::parseAttributes($attributes);
} elseif (is_array($attributes)) {
foreach ($attributes as $key => $value) {
if (is_int($key)) {
... | php | protected static function prepareAttributes($attributes)
{
$prepared = array();
if (is_string($attributes)) {
return self::parseAttributes($attributes);
} elseif (is_array($attributes)) {
foreach ($attributes as $key => $value) {
if (is_int($key)) {
... | [
"protected",
"static",
"function",
"prepareAttributes",
"(",
"$",
"attributes",
")",
"{",
"$",
"prepared",
"=",
"array",
"(",
")",
";",
"if",
"(",
"is_string",
"(",
"$",
"attributes",
")",
")",
"{",
"return",
"self",
"::",
"parseAttributes",
"(",
"$",
"a... | Creates a valid attribute array from either a string or an array
@param mixed Array of attributes or HTML attribute string
@return array An associative aray of attributes | [
"Creates",
"a",
"valid",
"attribute",
"array",
"from",
"either",
"a",
"string",
"or",
"an",
"array"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/Common2.php#L177-L194 | train | Prepares the attributes for the page | [
30522,
5123,
10763,
3853,
7374,
19321,
3089,
8569,
4570,
1006,
1002,
12332,
1007,
1063,
1002,
4810,
1027,
9140,
1006,
1007,
1025,
2065,
1006,
2003,
1035,
5164,
1006,
1002,
12332,
1007,
1007,
1063,
2709,
2969,
1024,
1024,
11968,
17310,
4779,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
z-song/laravel-admin | src/Grid/Tools/Paginator.php | Paginator.paginationRanger | protected function paginationRanger()
{
$parameters = [
'first' => $this->paginator->firstItem(),
'last' => $this->paginator->lastItem(),
'total' => $this->paginator->total(),
];
$parameters = collect($parameters)->flatMap(function ($parameter, $key) {
... | php | protected function paginationRanger()
{
$parameters = [
'first' => $this->paginator->firstItem(),
'last' => $this->paginator->lastItem(),
'total' => $this->paginator->total(),
];
$parameters = collect($parameters)->flatMap(function ($parameter, $key) {
... | [
"protected",
"function",
"paginationRanger",
"(",
")",
"{",
"$",
"parameters",
"=",
"[",
"'first'",
"=>",
"$",
"this",
"->",
"paginator",
"->",
"firstItem",
"(",
")",
",",
"'last'",
"=>",
"$",
"this",
"->",
"paginator",
"->",
"lastItem",
"(",
")",
",",
... | Get range infomation of paginator.
@return string|\Symfony\Component\Translation\TranslatorInterface | [
"Get",
"range",
"infomation",
"of",
"paginator",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Grid/Tools/Paginator.php#L67-L80 | train | Return pagination range | [
30522,
5123,
3853,
6643,
20876,
3508,
24388,
2121,
1006,
1007,
1063,
1002,
11709,
1027,
1031,
1005,
2034,
1005,
1027,
1028,
1002,
2023,
1011,
1028,
6643,
20876,
4263,
1011,
1028,
2034,
4221,
2213,
1006,
1007,
1010,
1005,
2197,
1005,
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... |
getgrav/grav | system/src/Grav/Common/GPM/Licenses.php | Licenses.validate | public static function validate($license = null)
{
if (!is_string($license)) {
return false;
}
return preg_match('#' . self::$regex. '#', $license);
} | php | public static function validate($license = null)
{
if (!is_string($license)) {
return false;
}
return preg_match('#' . self::$regex. '#', $license);
} | [
"public",
"static",
"function",
"validate",
"(",
"$",
"license",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"license",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"preg_match",
"(",
"'#'",
".",
"self",
"::",
"$",
"regex",... | Validates the License format
@param string $license
@return bool | [
"Validates",
"the",
"License",
"format"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/GPM/Licenses.php#L96-L103 | train | Validate License String | [
30522,
2270,
10763,
3853,
9398,
3686,
1006,
1002,
6105,
1027,
19701,
1007,
1063,
2065,
1006,
999,
2003,
1035,
5164,
1006,
1002,
6105,
1007,
1007,
1063,
2709,
6270,
1025,
1065,
2709,
3653,
2290,
1035,
2674,
1006,
1005,
1001,
1005,
1012,
29... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Routing/Router.php | Router.getRouteCollection | public function getRouteCollection()
{
if (null === $this->collection) {
$this->collection = $this->loader->load($this->resource, $this->options['resource_type']);
}
return $this->collection;
} | php | public function getRouteCollection()
{
if (null === $this->collection) {
$this->collection = $this->loader->load($this->resource, $this->options['resource_type']);
}
return $this->collection;
} | [
"public",
"function",
"getRouteCollection",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"collection",
")",
"{",
"$",
"this",
"->",
"collection",
"=",
"$",
"this",
"->",
"loader",
"->",
"load",
"(",
"$",
"this",
"->",
"resource",
",",
... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Routing/Router.php#L209-L216 | train | Get RouteCollection - Get RouteCollection | [
30522,
2270,
3853,
2131,
22494,
26557,
14511,
18491,
1006,
1007,
1063,
2065,
1006,
19701,
1027,
1027,
1027,
1002,
2023,
1011,
1028,
3074,
1007,
1063,
1002,
2023,
1011,
1028,
3074,
1027,
1002,
2023,
1011,
1028,
7170,
2121,
1011,
1028,
7170,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Metric.php | Metric.getMetricValues | public static function getMetricValues(DataTable $table, $columnName, $mappingNameToId = null)
{
if (empty($mappingIdToName)) {
$mappingNameToId = Metrics::getMappingFromNameToId();
}
$columnName = self::getActualMetricColumn($table, $columnName, $mappingNameToId);
retur... | php | public static function getMetricValues(DataTable $table, $columnName, $mappingNameToId = null)
{
if (empty($mappingIdToName)) {
$mappingNameToId = Metrics::getMappingFromNameToId();
}
$columnName = self::getActualMetricColumn($table, $columnName, $mappingNameToId);
retur... | [
"public",
"static",
"function",
"getMetricValues",
"(",
"DataTable",
"$",
"table",
",",
"$",
"columnName",
",",
"$",
"mappingNameToId",
"=",
"null",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"mappingIdToName",
")",
")",
"{",
"$",
"mappingNameToId",
"=",
"Met... | Helper method that will determine the actual column name for a metric in a
{@link Piwik\DataTable} and return every column value for this name.
@param DataTable $table
@param string $columnName
@param int[]|null $mappingNameToId A custom mapping of metric names to special index values. By
default {@link Metrics::getMa... | [
"Helper",
"method",
"that",
"will",
"determine",
"the",
"actual",
"column",
"name",
"for",
"a",
"metric",
"in",
"a",
"{",
"@link",
"Piwik",
"\\",
"DataTable",
"}",
"and",
"return",
"every",
"column",
"value",
"for",
"this",
"name",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Plugin/Metric.php#L166-L174 | train | Returns the values of the specified column in the given table. | [
30522,
2270,
10763,
3853,
2131,
12589,
10175,
15808,
1006,
2951,
10880,
1002,
2795,
1010,
1002,
5930,
18442,
1010,
1002,
12375,
18442,
3406,
3593,
1027,
19701,
1007,
1063,
2065,
1006,
4064,
1006,
1002,
12375,
3593,
2669,
14074,
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... |
matomo-org/matomo | plugins/SitesManager/Model.php | Model.getAllSites | public function getAllSites()
{
$db = $this->getDb();
$sites = $db->fetchAll("SELECT * FROM " . $this->table . " ORDER BY idsite ASC");
return $sites;
} | php | public function getAllSites()
{
$db = $this->getDb();
$sites = $db->fetchAll("SELECT * FROM " . $this->table . " ORDER BY idsite ASC");
return $sites;
} | [
"public",
"function",
"getAllSites",
"(",
")",
"{",
"$",
"db",
"=",
"$",
"this",
"->",
"getDb",
"(",
")",
";",
"$",
"sites",
"=",
"$",
"db",
"->",
"fetchAll",
"(",
"\"SELECT * FROM \"",
".",
"$",
"this",
"->",
"table",
".",
"\" ORDER BY idsite ASC\"",
... | Returns all websites
@return array The list of websites, indexed by idsite | [
"Returns",
"all",
"websites"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SitesManager/Model.php#L75-L81 | train | Get all the sites | [
30522,
2270,
3853,
2131,
8095,
28032,
2229,
1006,
1007,
1063,
1002,
16962,
1027,
1002,
2023,
1011,
1028,
2131,
18939,
1006,
1007,
1025,
1002,
4573,
1027,
1002,
16962,
1011,
1028,
18584,
8095,
1006,
1000,
7276,
1008,
2013,
1000,
1012,
1002,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
barryvdh/laravel-debugbar | src/ServiceProvider.php | ServiceProvider.register | public function register()
{
$configPath = __DIR__ . '/../config/debugbar.php';
$this->mergeConfigFrom($configPath, 'debugbar');
$this->app->alias(
DataFormatter::class,
DataFormatterInterface::class
);
$this->app->singleton(LaravelDebugbar::class, f... | php | public function register()
{
$configPath = __DIR__ . '/../config/debugbar.php';
$this->mergeConfigFrom($configPath, 'debugbar');
$this->app->alias(
DataFormatter::class,
DataFormatterInterface::class
);
$this->app->singleton(LaravelDebugbar::class, f... | [
"public",
"function",
"register",
"(",
")",
"{",
"$",
"configPath",
"=",
"__DIR__",
".",
"'/../config/debugbar.php'",
";",
"$",
"this",
"->",
"mergeConfigFrom",
"(",
"$",
"configPath",
",",
"'debugbar'",
")",
";",
"$",
"this",
"->",
"app",
"->",
"alias",
"... | Register the service provider.
@return void | [
"Register",
"the",
"service",
"provider",
"."
] | 2d195779ea4f809f69764a795e2ec371dbb76a96 | https://github.com/barryvdh/laravel-debugbar/blob/2d195779ea4f809f69764a795e2ec371dbb76a96/src/ServiceProvider.php#L25-L57 | train | Registers the debugbar services. | [
30522,
2270,
3853,
4236,
1006,
1007,
1063,
1002,
9530,
8873,
21600,
8988,
1027,
1035,
1035,
16101,
1035,
1035,
1012,
1005,
1013,
1012,
1012,
1013,
9530,
8873,
2290,
1013,
2139,
8569,
18259,
2906,
1012,
25718,
1005,
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... |
matomo-org/matomo | libs/Zend/Cache/Backend/Apc.php | Zend_Cache_Backend_Apc.getFillingPercentage | public function getFillingPercentage()
{
$mem = apc_sma_info(true);
$memSize = $mem['num_seg'] * $mem['seg_size'];
$memAvailable= $mem['avail_mem'];
$memUsed = $memSize - $memAvailable;
if ($memSize == 0) {
Zend_Cache::throwException('can\'t get apc memory size... | php | public function getFillingPercentage()
{
$mem = apc_sma_info(true);
$memSize = $mem['num_seg'] * $mem['seg_size'];
$memAvailable= $mem['avail_mem'];
$memUsed = $memSize - $memAvailable;
if ($memSize == 0) {
Zend_Cache::throwException('can\'t get apc memory size... | [
"public",
"function",
"getFillingPercentage",
"(",
")",
"{",
"$",
"mem",
"=",
"apc_sma_info",
"(",
"true",
")",
";",
"$",
"memSize",
"=",
"$",
"mem",
"[",
"'num_seg'",
"]",
"*",
"$",
"mem",
"[",
"'seg_size'",
"]",
";",
"$",
"memAvailable",
"=",
"$",
... | Return the filling percentage of the backend storage
@throws Zend_Cache_Exception
@return int integer between 0 and 100 | [
"Return",
"the",
"filling",
"percentage",
"of",
"the",
"backend",
"storage"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache/Backend/Apc.php#L184-L197 | train | Get the percentage of space used for the current APC s memory usage | [
30522,
2270,
3853,
2131,
8873,
13112,
4842,
13013,
4270,
1006,
1007,
1063,
1002,
2033,
2213,
1027,
9706,
2278,
1035,
15488,
2050,
1035,
18558,
1006,
2995,
1007,
1025,
1002,
2033,
5244,
4697,
1027,
1002,
2033,
2213,
1031,
1005,
16371,
2213,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/HttpFoundation/Response.php | Response.getTtl | public function getTtl(): ?int
{
$maxAge = $this->getMaxAge();
return null !== $maxAge ? $maxAge - $this->getAge() : null;
} | php | public function getTtl(): ?int
{
$maxAge = $this->getMaxAge();
return null !== $maxAge ? $maxAge - $this->getAge() : null;
} | [
"public",
"function",
"getTtl",
"(",
")",
":",
"?",
"int",
"{",
"$",
"maxAge",
"=",
"$",
"this",
"->",
"getMaxAge",
"(",
")",
";",
"return",
"null",
"!==",
"$",
"maxAge",
"?",
"$",
"maxAge",
"-",
"$",
"this",
"->",
"getAge",
"(",
")",
":",
"null"... | Returns the response's time-to-live in seconds.
It returns null when no freshness information is present in the response.
When the responses TTL is <= 0, the response may not be served from cache without first
revalidating with the origin.
@final | [
"Returns",
"the",
"response",
"s",
"time",
"-",
"to",
"-",
"live",
"in",
"seconds",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpFoundation/Response.php#L816-L821 | train | Get the ttl of the current session | [
30522,
2270,
3853,
2131,
4779,
2140,
1006,
1007,
1024,
1029,
20014,
1063,
1002,
4098,
4270,
1027,
1002,
2023,
1011,
1028,
2131,
17848,
4270,
1006,
1007,
1025,
2709,
19701,
999,
1027,
1027,
1002,
4098,
4270,
1029,
1002,
4098,
4270,
1011,
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/HttpKernel/Controller/ArgumentResolver/DefaultValueResolver.php | DefaultValueResolver.supports | public function supports(Request $request, ArgumentMetadata $argument)
{
return $argument->hasDefaultValue() || (null !== $argument->getType() && $argument->isNullable() && !$argument->isVariadic());
} | php | public function supports(Request $request, ArgumentMetadata $argument)
{
return $argument->hasDefaultValue() || (null !== $argument->getType() && $argument->isNullable() && !$argument->isVariadic());
} | [
"public",
"function",
"supports",
"(",
"Request",
"$",
"request",
",",
"ArgumentMetadata",
"$",
"argument",
")",
"{",
"return",
"$",
"argument",
"->",
"hasDefaultValue",
"(",
")",
"||",
"(",
"null",
"!==",
"$",
"argument",
"->",
"getType",
"(",
")",
"&&",
... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpKernel/Controller/ArgumentResolver/DefaultValueResolver.php#L28-L31 | train | Returns true if the argument supports the request | [
30522,
2270,
3853,
6753,
1006,
5227,
1002,
5227,
1010,
6685,
11368,
8447,
2696,
1002,
6685,
1007,
1063,
2709,
1002,
6685,
1011,
1028,
2038,
3207,
7011,
11314,
10175,
5657,
1006,
1007,
1064,
1064,
1006,
19701,
999,
1027,
1027,
1002,
6685,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/LanguagesManager/API.php | API.getTranslationsForLanguage | public function getTranslationsForLanguage($languageCode)
{
if (!$this->isLanguageAvailable($languageCode)) {
return false;
}
$data = file_get_contents(PIWIK_INCLUDE_PATH . "/lang/$languageCode.json");
$translations = json_decode($data, true);
$languageInfo = arra... | php | public function getTranslationsForLanguage($languageCode)
{
if (!$this->isLanguageAvailable($languageCode)) {
return false;
}
$data = file_get_contents(PIWIK_INCLUDE_PATH . "/lang/$languageCode.json");
$translations = json_decode($data, true);
$languageInfo = arra... | [
"public",
"function",
"getTranslationsForLanguage",
"(",
"$",
"languageCode",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isLanguageAvailable",
"(",
"$",
"languageCode",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"data",
"=",
"file_get_contents",
"("... | Returns translation strings by language
@param string $languageCode ISO language code
@return array|false Array of arrays, each containing 'label' (translation index) and 'value' (translated string); false if language unavailable | [
"Returns",
"translation",
"strings",
"by",
"language"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/LanguagesManager/API.php#L202-L230 | train | Get translations for language | [
30522,
2270,
3853,
2131,
6494,
3619,
13490,
22747,
2953,
25023,
6692,
3351,
1006,
1002,
2653,
16044,
1007,
1063,
2065,
1006,
999,
1002,
2023,
1011,
1028,
25340,
3070,
6692,
3351,
12462,
11733,
3468,
1006,
1002,
2653,
16044,
1007,
1007,
1063... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
overtrue/wechat | src/Kernel/Traits/HasAttributes.php | HasAttributes.with | public function with($attribute, $value)
{
$this->snakeable && $attribute = Str::snake($attribute);
$this->setAttribute($attribute, $value);
return $this;
} | php | public function with($attribute, $value)
{
$this->snakeable && $attribute = Str::snake($attribute);
$this->setAttribute($attribute, $value);
return $this;
} | [
"public",
"function",
"with",
"(",
"$",
"attribute",
",",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"snakeable",
"&&",
"$",
"attribute",
"=",
"Str",
"::",
"snake",
"(",
"$",
"attribute",
")",
";",
"$",
"this",
"->",
"setAttribute",
"(",
"$",
"attrib... | Set attribute.
@param string $attribute
@param mixed $value
@return $this | [
"Set",
"attribute",
"."
] | 120c72faaa93c270365bc75c73c362d5fd583209 | https://github.com/overtrue/wechat/blob/120c72faaa93c270365bc75c73c362d5fd583209/src/Kernel/Traits/HasAttributes.php#L101-L108 | train | Set attribute value | [
30522,
2270,
3853,
2007,
1006,
1002,
17961,
1010,
1002,
3643,
1007,
1063,
1002,
2023,
1011,
1028,
7488,
3085,
1004,
1004,
1002,
17961,
1027,
2358,
2099,
1024,
1024,
7488,
1006,
1002,
17961,
1007,
1025,
1002,
2023,
1011,
1028,
2275,
19321,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.php | GeoIp2.convertRegionCodeToIso | public static function convertRegionCodeToIso($countryCode, $fipsRegionCode, $returnOriginalIfNotFound = false)
{
static $mapping;
if(empty($mapping)) {
$mapping = include __DIR__ . '/../data/regionMapping.php';
}
$countryCode = strtoupper($countryCode);
if (empty... | php | public static function convertRegionCodeToIso($countryCode, $fipsRegionCode, $returnOriginalIfNotFound = false)
{
static $mapping;
if(empty($mapping)) {
$mapping = include __DIR__ . '/../data/regionMapping.php';
}
$countryCode = strtoupper($countryCode);
if (empty... | [
"public",
"static",
"function",
"convertRegionCodeToIso",
"(",
"$",
"countryCode",
",",
"$",
"fipsRegionCode",
",",
"$",
"returnOriginalIfNotFound",
"=",
"false",
")",
"{",
"static",
"$",
"mapping",
";",
"if",
"(",
"empty",
"(",
"$",
"mapping",
")",
")",
"{"... | Converts an old FIPS region code to ISO
@param string $countryCode
@param string $fipsRegionCode
@param bool $returnOriginalIfNotFound return given region code if no mapping was found
@return array | [
"Converts",
"an",
"old",
"FIPS",
"region",
"code",
"to",
"ISO"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/GeoIp2/LocationProvider/GeoIp2.php#L228-L250 | train | Converts a region code to an ISO code | [
30522,
2270,
10763,
3853,
10463,
23784,
16044,
3406,
19565,
1006,
1002,
2406,
16044,
1010,
1002,
10882,
4523,
23784,
16044,
1010,
1002,
2709,
10050,
24965,
10128,
17048,
14876,
8630,
1027,
6270,
1007,
1063,
10763,
1002,
12375,
1025,
2065,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/system/classes/VersionManager.php | VersionManager.applyDatabaseScript | protected function applyDatabaseScript($code, $version, $script)
{
/*
* Execute the database PHP script
*/
$updateFile = $this->pluginManager->getPluginPath($code) . '/updates/' . $script;
if (!File::isFile($updateFile)) {
$this->note('- <error>v' . $version . ... | php | protected function applyDatabaseScript($code, $version, $script)
{
/*
* Execute the database PHP script
*/
$updateFile = $this->pluginManager->getPluginPath($code) . '/updates/' . $script;
if (!File::isFile($updateFile)) {
$this->note('- <error>v' . $version . ... | [
"protected",
"function",
"applyDatabaseScript",
"(",
"$",
"code",
",",
"$",
"version",
",",
"$",
"script",
")",
"{",
"/*\n * Execute the database PHP script\n */",
"$",
"updateFile",
"=",
"$",
"this",
"->",
"pluginManager",
"->",
"getPluginPath",
"(",
... | Registers a database update script in the history table. | [
"Registers",
"a",
"database",
"update",
"script",
"in",
"the",
"history",
"table",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/VersionManager.php#L387-L407 | train | Apply the database script | [
30522,
5123,
3853,
6611,
2850,
2696,
15058,
22483,
1006,
1002,
3642,
1010,
1002,
2544,
1010,
1002,
5896,
1007,
1063,
1013,
1008,
1008,
15389,
1996,
7809,
25718,
5896,
1008,
1013,
1002,
10651,
8873,
2571,
1027,
1002,
2023,
1011,
1028,
13354,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Notifications/Channels/MailChannel.php | MailChannel.buildMessage | protected function buildMessage($mailMessage, $notifiable, $notification, $message)
{
$this->addressMessage($mailMessage, $notifiable, $notification, $message);
$mailMessage->subject($message->subject ?: Str::title(
Str::snake(class_basename($notification), ' ')
));
$th... | php | protected function buildMessage($mailMessage, $notifiable, $notification, $message)
{
$this->addressMessage($mailMessage, $notifiable, $notification, $message);
$mailMessage->subject($message->subject ?: Str::title(
Str::snake(class_basename($notification), ' ')
));
$th... | [
"protected",
"function",
"buildMessage",
"(",
"$",
"mailMessage",
",",
"$",
"notifiable",
",",
"$",
"notification",
",",
"$",
"message",
")",
"{",
"$",
"this",
"->",
"addressMessage",
"(",
"$",
"mailMessage",
",",
"$",
"notifiable",
",",
"$",
"notification",... | Build the mail message.
@param \Illuminate\Mail\Message $mailMessage
@param mixed $notifiable
@param \Illuminate\Notifications\Notification $notification
@param \Illuminate\Notifications\Messages\MailMessage $message
@return void | [
"Build",
"the",
"mail",
"message",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Notifications/Channels/MailChannel.php#L127-L140 | train | Build the message | [
30522,
5123,
3853,
3857,
7834,
3736,
3351,
1006,
1002,
5653,
7834,
3736,
3351,
1010,
1002,
2025,
30524,
1006,
1002,
4471,
1011,
1028,
3395,
1029,
1024,
2358,
2099,
1024,
1024,
2516,
1006,
2358,
2099,
1024,
1024,
7488,
1006,
2465,
1035,
29... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Cache/FileStore.php | FileStore.put | public function put($key, $value, $seconds)
{
$this->ensureCacheDirectoryExists($path = $this->path($key));
$result = $this->files->put(
$path, $this->expiration($seconds).serialize($value), true
);
return $result !== false && $result > 0;
} | php | public function put($key, $value, $seconds)
{
$this->ensureCacheDirectoryExists($path = $this->path($key));
$result = $this->files->put(
$path, $this->expiration($seconds).serialize($value), true
);
return $result !== false && $result > 0;
} | [
"public",
"function",
"put",
"(",
"$",
"key",
",",
"$",
"value",
",",
"$",
"seconds",
")",
"{",
"$",
"this",
"->",
"ensureCacheDirectoryExists",
"(",
"$",
"path",
"=",
"$",
"this",
"->",
"path",
"(",
"$",
"key",
")",
")",
";",
"$",
"result",
"=",
... | Store an item in the cache for a given number of seconds.
@param string $key
@param mixed $value
@param int $seconds
@return bool | [
"Store",
"an",
"item",
"in",
"the",
"cache",
"for",
"a",
"given",
"number",
"of",
"seconds",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Cache/FileStore.php#L60-L69 | train | Put a value into cache. | [
30522,
2270,
3853,
2404,
1006,
1002,
3145,
1010,
1002,
3643,
1010,
1002,
3823,
1007,
1063,
1002,
2023,
1011,
1028,
5676,
3540,
7690,
7442,
16761,
6672,
9048,
12837,
1006,
1002,
4130,
1027,
1002,
2023,
1011,
1028,
4130,
1006,
1002,
3145,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
domnikl/DesignPatternsPHP | Structural/Registry/Registry.php | Registry.set | public static function set(string $key, $value)
{
if (!in_array($key, self::$allowedKeys)) {
throw new \InvalidArgumentException('Invalid key given');
}
self::$storedValues[$key] = $value;
} | php | public static function set(string $key, $value)
{
if (!in_array($key, self::$allowedKeys)) {
throw new \InvalidArgumentException('Invalid key given');
}
self::$storedValues[$key] = $value;
} | [
"public",
"static",
"function",
"set",
"(",
"string",
"$",
"key",
",",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"key",
",",
"self",
"::",
"$",
"allowedKeys",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"... | @param string $key
@param mixed $value
@return void | [
"@param",
"string",
"$key",
"@param",
"mixed",
"$value"
] | 5f5649b57ea94471e20b54eb439c6368dea07886 | https://github.com/domnikl/DesignPatternsPHP/blob/5f5649b57ea94471e20b54eb439c6368dea07886/Structural/Registry/Registry.php#L30-L37 | train | Set a value to the store | [
30522,
2270,
10763,
3853,
2275,
1006,
5164,
1002,
3145,
1010,
1002,
3643,
1007,
1063,
2065,
1006,
999,
1999,
1035,
9140,
1006,
1002,
3145,
1010,
2969,
1024,
1024,
1002,
3039,
14839,
2015,
1007,
1007,
1063,
5466,
2047,
1032,
19528,
2906,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/backend/formwidgets/ColorPicker.php | ColorPicker.getAvailableColors | protected function getAvailableColors()
{
$availableColors = $this->availableColors;
if (is_array($availableColors)) {
return $availableColors;
}
elseif (is_string($availableColors) && !empty($availableColors)) {
if ($this->model->methodExists($availableColors... | php | protected function getAvailableColors()
{
$availableColors = $this->availableColors;
if (is_array($availableColors)) {
return $availableColors;
}
elseif (is_string($availableColors) && !empty($availableColors)) {
if ($this->model->methodExists($availableColors... | [
"protected",
"function",
"getAvailableColors",
"(",
")",
"{",
"$",
"availableColors",
"=",
"$",
"this",
"->",
"availableColors",
";",
"if",
"(",
"is_array",
"(",
"$",
"availableColors",
")",
")",
"{",
"return",
"$",
"availableColors",
";",
"}",
"elseif",
"("... | Gets the appropriate list of colors.
@return array | [
"Gets",
"the",
"appropriate",
"list",
"of",
"colors",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/formwidgets/ColorPicker.php#L94-L115 | train | Get available colors | [
30522,
5123,
3853,
2131,
12462,
11733,
30524,
10128,
1006,
2003,
1035,
5164,
1006,
1002,
2800,
18717,
2015,
1007,
1004,
1004,
999,
4064,
1006,
1002,
2800,
18717,
2015,
1007,
1007,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
2944,
1011,
1028,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/Zend/Cache/Frontend/Page.php | Zend_Cache_Frontend_Page._setContentTypeMemorization | protected function _setContentTypeMemorization($value)
{
$found = null;
foreach ($this->_specificOptions['memorize_headers'] as $key => $value) {
if (strtolower($value) == 'content-type') {
$found = $key;
}
}
if ($value) {
if (!$fou... | php | protected function _setContentTypeMemorization($value)
{
$found = null;
foreach ($this->_specificOptions['memorize_headers'] as $key => $value) {
if (strtolower($value) == 'content-type') {
$found = $key;
}
}
if ($value) {
if (!$fou... | [
"protected",
"function",
"_setContentTypeMemorization",
"(",
"$",
"value",
")",
"{",
"$",
"found",
"=",
"null",
";",
"foreach",
"(",
"$",
"this",
"->",
"_specificOptions",
"[",
"'memorize_headers'",
"]",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if"... | Set the deprecated contentTypeMemorization option
@param boolean $value value
@return void
@deprecated | [
"Set",
"the",
"deprecated",
"contentTypeMemorization",
"option"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache/Frontend/Page.php#L186-L203 | train | Set Content - Type Memorization | [
30522,
5123,
3853,
1035,
2275,
8663,
6528,
15353,
5051,
4168,
24610,
9276,
1006,
1002,
3643,
1007,
1063,
1002,
2179,
1027,
19701,
1025,
18921,
6776,
1006,
1002,
2023,
1011,
1028,
1035,
3563,
7361,
9285,
1031,
1005,
24443,
25709,
1035,
20346... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Filechecks.php | Filechecks.getMakeWritableCommand | private static function getMakeWritableCommand($realpath)
{
$realpath = Common::sanitizeInputValue($realpath);
if (SettingsServer::isWindows()) {
return "<code>cacls $realpath /t /g " . Common::sanitizeInputValue(self::getUser()) . ":f</code><br />\n";
}
return "<code>chm... | php | private static function getMakeWritableCommand($realpath)
{
$realpath = Common::sanitizeInputValue($realpath);
if (SettingsServer::isWindows()) {
return "<code>cacls $realpath /t /g " . Common::sanitizeInputValue(self::getUser()) . ":f</code><br />\n";
}
return "<code>chm... | [
"private",
"static",
"function",
"getMakeWritableCommand",
"(",
"$",
"realpath",
")",
"{",
"$",
"realpath",
"=",
"Common",
"::",
"sanitizeInputValue",
"(",
"$",
"realpath",
")",
";",
"if",
"(",
"SettingsServer",
"::",
"isWindows",
"(",
")",
")",
"{",
"return... | Returns the help text displayed to suggest which command to run to give writable access to a file or directory
@param string $realpath
@return string | [
"Returns",
"the",
"help",
"text",
"displayed",
"to",
"suggest",
"which",
"command",
"to",
"run",
"to",
"give",
"writable",
"access",
"to",
"a",
"file",
"or",
"directory"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Filechecks.php#L180-L187 | train | Returns the command to make the file writable | [
30522,
2797,
10763,
3853,
2131,
2863,
3489,
13088,
6590,
3468,
9006,
2386,
2094,
1006,
1002,
2613,
15069,
1007,
1063,
1002,
2613,
15069,
1027,
2691,
1024,
1024,
2624,
25090,
4371,
2378,
18780,
10175,
5657,
1006,
1002,
2613,
15069,
1007,
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 | plugins/UserCountry/LocationProvider/GeoIp/ServerBased.php | ServerBased.getLocation | public function getLocation($info)
{
$ip = $this->getIpFromInfo($info);
// geoip modules that are built into servers can't use a forced IP. in this case we try
// to fallback to another version.
$myIP = IP::getIpFromHeader();
if (!self::isSameOrAnonymizedIp($ip, $myIP)
... | php | public function getLocation($info)
{
$ip = $this->getIpFromInfo($info);
// geoip modules that are built into servers can't use a forced IP. in this case we try
// to fallback to another version.
$myIP = IP::getIpFromHeader();
if (!self::isSameOrAnonymizedIp($ip, $myIP)
... | [
"public",
"function",
"getLocation",
"(",
"$",
"info",
")",
"{",
"$",
"ip",
"=",
"$",
"this",
"->",
"getIpFromInfo",
"(",
"$",
"info",
")",
";",
"// geoip modules that are built into servers can't use a forced IP. in this case we try",
"// to fallback to another version.",
... | Uses a GeoIP database to get a visitor's location based on their IP address.
This function will return different results based on the data used and based
on how the GeoIP module is configured.
If a region database is used, it may return the country code, region code,
city name, area code, latitude, longitude and post... | [
"Uses",
"a",
"GeoIP",
"database",
"to",
"get",
"a",
"visitor",
"s",
"location",
"based",
"on",
"their",
"IP",
"address",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UserCountry/LocationProvider/GeoIp/ServerBased.php#L67-L113 | train | Returns the location of the IP address | [
30522,
2270,
3853,
2131,
4135,
10719,
1006,
1002,
18558,
1007,
1063,
1002,
12997,
1027,
1002,
2023,
1011,
1028,
2131,
11514,
19699,
20936,
2078,
14876,
1006,
1002,
18558,
1007,
1025,
1013,
1013,
20248,
11514,
14184,
2008,
2024,
2328,
2046,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Console/Gpm/SelfupgradeCommand.php | SelfupgradeCommand.download | private function download($package)
{
$tmp_dir = Grav::instance()['locator']->findResource('tmp://', true, true);
$this->tmp = $tmp_dir . '/Grav-' . uniqid('', false);
$output = Response::get($package['download'], [], [$this, 'progress']);
Folder::create($this->tmp);
$this-... | php | private function download($package)
{
$tmp_dir = Grav::instance()['locator']->findResource('tmp://', true, true);
$this->tmp = $tmp_dir . '/Grav-' . uniqid('', false);
$output = Response::get($package['download'], [], [$this, 'progress']);
Folder::create($this->tmp);
$this-... | [
"private",
"function",
"download",
"(",
"$",
"package",
")",
"{",
"$",
"tmp_dir",
"=",
"Grav",
"::",
"instance",
"(",
")",
"[",
"'locator'",
"]",
"->",
"findResource",
"(",
"'tmp://'",
",",
"true",
",",
"true",
")",
";",
"$",
"this",
"->",
"tmp",
"="... | @param Package $package
@return string | [
"@param",
"Package",
"$package"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Console/Gpm/SelfupgradeCommand.php#L184-L199 | train | Download the upgrade file | [
30522,
2797,
3853,
8816,
1006,
1002,
7427,
1007,
1063,
1002,
1056,
8737,
1035,
16101,
1027,
24665,
11431,
1024,
1024,
6013,
1006,
1007,
1031,
1005,
8840,
11266,
2953,
1005,
1033,
1011,
1028,
2424,
6072,
8162,
3401,
1006,
1005,
1056,
8737,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Builder.php | Builder.findMany | public function findMany($ids, $columns = ['*'])
{
if (empty($ids)) {
return $this->model->newCollection();
}
return $this->whereKey($ids)->get($columns);
} | php | public function findMany($ids, $columns = ['*'])
{
if (empty($ids)) {
return $this->model->newCollection();
}
return $this->whereKey($ids)->get($columns);
} | [
"public",
"function",
"findMany",
"(",
"$",
"ids",
",",
"$",
"columns",
"=",
"[",
"'*'",
"]",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"ids",
")",
")",
"{",
"return",
"$",
"this",
"->",
"model",
"->",
"newCollection",
"(",
")",
";",
"}",
"return",... | Find multiple models by their primary keys.
@param \Illuminate\Contracts\Support\Arrayable|array $ids
@param array $columns
@return \Illuminate\Database\Eloquent\Collection | [
"Find",
"multiple",
"models",
"by",
"their",
"primary",
"keys",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Builder.php#L339-L346 | train | Find many records by id | [
30522,
2270,
3853,
2424,
2386,
2100,
1006,
1002,
8909,
2015,
1010,
1002,
7753,
1027,
1031,
1005,
1008,
1005,
1033,
1007,
1063,
2065,
1006,
4064,
1006,
1002,
8909,
2015,
1007,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
2944,
1011,
1028,
204... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Metrics.php | Metrics.isLowerValueBetter | public static function isLowerValueBetter($column)
{
$lowerIsBetterPatterns = array(
'bounce', 'exit'
);
foreach ($lowerIsBetterPatterns as $pattern) {
if (strpos($column, $pattern) !== false) {
return true;
}
}
return fal... | php | public static function isLowerValueBetter($column)
{
$lowerIsBetterPatterns = array(
'bounce', 'exit'
);
foreach ($lowerIsBetterPatterns as $pattern) {
if (strpos($column, $pattern) !== false) {
return true;
}
}
return fal... | [
"public",
"static",
"function",
"isLowerValueBetter",
"(",
"$",
"column",
")",
"{",
"$",
"lowerIsBetterPatterns",
"=",
"array",
"(",
"'bounce'",
",",
"'exit'",
")",
";",
"foreach",
"(",
"$",
"lowerIsBetterPatterns",
"as",
"$",
"pattern",
")",
"{",
"if",
"(",... | Is a lower value for a given column better?
@param $column
@return bool
@ignore | [
"Is",
"a",
"lower",
"value",
"for",
"a",
"given",
"column",
"better?",
"@param",
"$column",
"@return",
"bool"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Metrics.php#L214-L227 | train | Returns true if the column is in the lower case value of bounce or exit | [
30522,
2270,
10763,
3853,
2003,
27663,
26585,
5657,
20915,
3334,
1006,
1002,
5930,
1007,
1063,
1002,
2896,
2483,
20915,
3334,
4502,
12079,
3619,
1027,
9140,
1006,
1005,
17523,
1005,
1010,
1005,
6164,
1005,
1007,
1025,
18921,
6776,
1006,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Database/Console/Factories/FactoryMakeCommand.php | FactoryMakeCommand.buildClass | protected function buildClass($name)
{
$namespaceModel = $this->option('model')
? $this->qualifyClass($this->option('model'))
: trim($this->rootNamespace(), '\\').'\\Model';
$model = class_basename($namespaceModel);
return str_replace(
... | php | protected function buildClass($name)
{
$namespaceModel = $this->option('model')
? $this->qualifyClass($this->option('model'))
: trim($this->rootNamespace(), '\\').'\\Model';
$model = class_basename($namespaceModel);
return str_replace(
... | [
"protected",
"function",
"buildClass",
"(",
"$",
"name",
")",
"{",
"$",
"namespaceModel",
"=",
"$",
"this",
"->",
"option",
"(",
"'model'",
")",
"?",
"$",
"this",
"->",
"qualifyClass",
"(",
"$",
"this",
"->",
"option",
"(",
"'model'",
")",
")",
":",
... | Build the class with the given name.
@param string $name
@return string | [
"Build",
"the",
"class",
"with",
"the",
"given",
"name",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Console/Factories/FactoryMakeCommand.php#L47-L66 | train | Build the class. | [
30522,
5123,
3853,
3857,
26266,
1006,
1002,
2171,
1007,
1063,
1002,
3415,
15327,
5302,
9247,
1027,
1002,
2023,
1011,
1028,
5724,
1006,
1005,
2944,
1005,
1007,
1029,
1002,
2023,
1011,
1028,
7515,
26266,
1006,
1002,
2023,
1011,
1028,
5724,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Support/Facades/Facade.php | Facade.spy | public static function spy()
{
if (! static::isMock()) {
$class = static::getMockableClass();
return tap($class ? Mockery::spy($class) : Mockery::spy(), function ($spy) {
static::swap($spy);
});
}
} | php | public static function spy()
{
if (! static::isMock()) {
$class = static::getMockableClass();
return tap($class ? Mockery::spy($class) : Mockery::spy(), function ($spy) {
static::swap($spy);
});
}
} | [
"public",
"static",
"function",
"spy",
"(",
")",
"{",
"if",
"(",
"!",
"static",
"::",
"isMock",
"(",
")",
")",
"{",
"$",
"class",
"=",
"static",
"::",
"getMockableClass",
"(",
")",
";",
"return",
"tap",
"(",
"$",
"class",
"?",
"Mockery",
"::",
"spy... | Convert the facade into a Mockery spy.
@return \Mockery\MockInterface | [
"Convert",
"the",
"facade",
"into",
"a",
"Mockery",
"spy",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Support/Facades/Facade.php#L44-L53 | train | Spy the class. | [
30522,
2270,
10763,
3853,
8645,
1006,
1007,
1063,
2065,
1006,
999,
10763,
1024,
1024,
2003,
5302,
3600,
1006,
1007,
1007,
1063,
1002,
2465,
1027,
10763,
1024,
1024,
2131,
5302,
3600,
3085,
26266,
1006,
1007,
1025,
2709,
11112,
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/Serializer/NameConverter/MetadataAwareNameConverter.php | MetadataAwareNameConverter.denormalize | public function denormalize($propertyName, string $class = null, string $format = null, array $context = [])
{
if (null === $class) {
return $this->denormalizeFallback($propertyName, $class, $format, $context);
}
if (!isset(self::$denormalizeCache[$class][$propertyName])) {
... | php | public function denormalize($propertyName, string $class = null, string $format = null, array $context = [])
{
if (null === $class) {
return $this->denormalizeFallback($propertyName, $class, $format, $context);
}
if (!isset(self::$denormalizeCache[$class][$propertyName])) {
... | [
"public",
"function",
"denormalize",
"(",
"$",
"propertyName",
",",
"string",
"$",
"class",
"=",
"null",
",",
"string",
"$",
"format",
"=",
"null",
",",
"array",
"$",
"context",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"class",
")",
... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Serializer/NameConverter/MetadataAwareNameConverter.php#L59-L70 | train | Denormalizes a property | [
30522,
2270,
3853,
7939,
2953,
9067,
4697,
1006,
1002,
3200,
18442,
1010,
5164,
1002,
2465,
1027,
19701,
1010,
5164,
1002,
4289,
1027,
19701,
1010,
9140,
1002,
6123,
1027,
1031,
1033,
1007,
1063,
2065,
1006,
19701,
1027,
1027,
1027,
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/DependencyInjection/CachePoolPass.php | CachePoolPass.process | public function process(ContainerBuilder $container)
{
if ($container->hasParameter('cache.prefix.seed')) {
$seed = '.'.$container->getParameterBag()->resolveValue($container->getParameter('cache.prefix.seed'));
} else {
$seed = '_'.$container->getParameter('kernel.project_di... | php | public function process(ContainerBuilder $container)
{
if ($container->hasParameter('cache.prefix.seed')) {
$seed = '.'.$container->getParameterBag()->resolveValue($container->getParameter('cache.prefix.seed'));
} else {
$seed = '_'.$container->getParameter('kernel.project_di... | [
"public",
"function",
"process",
"(",
"ContainerBuilder",
"$",
"container",
")",
"{",
"if",
"(",
"$",
"container",
"->",
"hasParameter",
"(",
"'cache.prefix.seed'",
")",
")",
"{",
"$",
"seed",
"=",
"'.'",
".",
"$",
"container",
"->",
"getParameterBag",
"(",
... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Cache/DependencyInjection/CachePoolPass.php#L48-L149 | train | Process the cache pool tags | [
30522,
2270,
3853,
2832,
1006,
11661,
8569,
23891,
2099,
1002,
11661,
1007,
1063,
2065,
1006,
1002,
11661,
1011,
1028,
2038,
28689,
22828,
1006,
1005,
17053,
1012,
17576,
1012,
6534,
1005,
1007,
1007,
1063,
1002,
6534,
1027,
1005,
1012,
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 | libs/Zend/Mail/Storage/Imap.php | Zend_Mail_Storage_Imap.countMessages | public function countMessages($flags = null)
{
if (!$this->_currentFolder) {
/**
* @see Zend_Mail_Storage_Exception
*/
// require_once 'Zend/Mail/Storage/Exception.php';
throw new Zend_Mail_Storage_Exception('No selected folder to count');
... | php | public function countMessages($flags = null)
{
if (!$this->_currentFolder) {
/**
* @see Zend_Mail_Storage_Exception
*/
// require_once 'Zend/Mail/Storage/Exception.php';
throw new Zend_Mail_Storage_Exception('No selected folder to count');
... | [
"public",
"function",
"countMessages",
"(",
"$",
"flags",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_currentFolder",
")",
"{",
"/**\n * @see Zend_Mail_Storage_Exception\n */",
"// require_once 'Zend/Mail/Storage/Exception.php';",
"th... | Count messages all messages in current box
@return int number of messages
@throws Zend_Mail_Storage_Exception
@throws Zend_Mail_Protocol_Exception | [
"Count",
"messages",
"all",
"messages",
"in",
"current",
"box"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail/Storage/Imap.php#L113-L137 | train | Count messages in the current folder | [
30522,
2270,
3853,
4175,
7834,
3736,
8449,
1006,
1002,
9245,
1027,
19701,
1007,
1063,
2065,
1006,
999,
1002,
2023,
1011,
1028,
1035,
2783,
10371,
2121,
1007,
1063,
1013,
1008,
1008,
1008,
1030,
2156,
16729,
2094,
1035,
5653,
1035,
5527,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Database/Eloquent/Model.php | Model.newQueryForRestoration | public function newQueryForRestoration($ids)
{
return is_array($ids)
? $this->newQueryWithoutScopes()->whereIn($this->getQualifiedKeyName(), $ids)
: $this->newQueryWithoutScopes()->whereKey($ids);
} | php | public function newQueryForRestoration($ids)
{
return is_array($ids)
? $this->newQueryWithoutScopes()->whereIn($this->getQualifiedKeyName(), $ids)
: $this->newQueryWithoutScopes()->whereKey($ids);
} | [
"public",
"function",
"newQueryForRestoration",
"(",
"$",
"ids",
")",
"{",
"return",
"is_array",
"(",
"$",
"ids",
")",
"?",
"$",
"this",
"->",
"newQueryWithoutScopes",
"(",
")",
"->",
"whereIn",
"(",
"$",
"this",
"->",
"getQualifiedKeyName",
"(",
")",
",",... | Get a new query to restore one or more models by their queueable IDs.
@param array|int $ids
@return \Illuminate\Database\Eloquent\Builder | [
"Get",
"a",
"new",
"query",
"to",
"restore",
"one",
"or",
"more",
"models",
"by",
"their",
"queueable",
"IDs",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Model.php#L1022-L1027 | train | Returns a new query for restoration of records | [
30522,
2270,
3853,
2047,
4226,
2854,
29278,
28533,
21223,
1006,
1002,
8909,
2015,
1007,
1063,
2709,
2003,
1035,
9140,
1006,
1002,
8909,
2015,
1007,
1029,
1002,
2023,
1011,
1028,
2047,
4226,
2854,
24415,
12166,
16186,
2015,
1006,
1007,
1011,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/UrlHelper.php | UrlHelper.getPathAndQueryFromUrl | public static function getPathAndQueryFromUrl($url)
{
$parsedUrl = parse_url($url);
$result = '';
if (isset($parsedUrl['path'])) {
if (substr($parsedUrl['path'], 0, 1) == '/') {
$parsedUrl['path'] = substr($parsedUrl['path'], 1);
}
$result ... | php | public static function getPathAndQueryFromUrl($url)
{
$parsedUrl = parse_url($url);
$result = '';
if (isset($parsedUrl['path'])) {
if (substr($parsedUrl['path'], 0, 1) == '/') {
$parsedUrl['path'] = substr($parsedUrl['path'], 1);
}
$result ... | [
"public",
"static",
"function",
"getPathAndQueryFromUrl",
"(",
"$",
"url",
")",
"{",
"$",
"parsedUrl",
"=",
"parse_url",
"(",
"$",
"url",
")",
";",
"$",
"result",
"=",
"''",
";",
"if",
"(",
"isset",
"(",
"$",
"parsedUrl",
"[",
"'path'",
"]",
")",
")"... | Returns the path and query string of a URL.
@param string $url The URL.
@return string eg, `/test/index.php?module=CoreHome` if `$url` is `http://piwik.org/test/index.php?module=CoreHome`.
@api | [
"Returns",
"the",
"path",
"and",
"query",
"string",
"of",
"a",
"URL",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/UrlHelper.php#L295-L309 | train | Returns the path and query from a URL | [
30522,
2270,
10763,
3853,
2131,
15069,
5685,
4226,
2854,
19699,
5358,
3126,
2140,
1006,
1002,
24471,
2140,
1007,
1063,
1002,
11968,
6924,
3126,
2140,
1027,
11968,
3366,
1035,
24471,
2140,
1006,
1002,
24471,
2140,
1007,
1025,
1002,
2765,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Console/Scheduling/ScheduleRunCommand.php | ScheduleRunCommand.runSingleServerEvent | protected function runSingleServerEvent($event)
{
if ($this->schedule->serverShouldRun($event, $this->startedAt)) {
$this->runEvent($event);
} else {
$this->line('<info>Skipping command (has already run on another server):</info> '.$event->getSummaryForDisplay());
}
... | php | protected function runSingleServerEvent($event)
{
if ($this->schedule->serverShouldRun($event, $this->startedAt)) {
$this->runEvent($event);
} else {
$this->line('<info>Skipping command (has already run on another server):</info> '.$event->getSummaryForDisplay());
}
... | [
"protected",
"function",
"runSingleServerEvent",
"(",
"$",
"event",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"schedule",
"->",
"serverShouldRun",
"(",
"$",
"event",
",",
"$",
"this",
"->",
"startedAt",
")",
")",
"{",
"$",
"this",
"->",
"runEvent",
"(",
... | Run the given single server event.
@param \Illuminate\Console\Scheduling\Event $event
@return void | [
"Run",
"the",
"given",
"single",
"server",
"event",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Console/Scheduling/ScheduleRunCommand.php#L92-L99 | train | Runs single server event | [
30522,
5123,
3853,
3216,
2075,
24527,
2099,
28943,
15338,
1006,
1002,
2724,
30524,
15338,
1006,
1002,
2724,
1007,
1025,
1065,
2842,
1063,
1002,
2023,
1011,
1028,
2240,
1006,
1005,
1026,
18558,
1028,
25978,
3094,
1006,
2038,
2525,
2448,
2006... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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._text_align | protected function _text_align()
{
$style = $this->_frame->get_style();
$w = $this->_frame->get_containing_block("w");
$width = (float)$style->length_in_pt($style->width, $w);
switch ($style->text_align) {
default:
case "left":
foreach ($this-... | php | protected function _text_align()
{
$style = $this->_frame->get_style();
$w = $this->_frame->get_containing_block("w");
$width = (float)$style->length_in_pt($style->width, $w);
switch ($style->text_align) {
default:
case "left":
foreach ($this-... | [
"protected",
"function",
"_text_align",
"(",
")",
"{",
"$",
"style",
"=",
"$",
"this",
"->",
"_frame",
"->",
"get_style",
"(",
")",
";",
"$",
"w",
"=",
"$",
"this",
"->",
"_frame",
"->",
"get_containing_block",
"(",
"\"w\"",
")",
";",
"$",
"width",
"... | Adjust the justification of each of our lines.
http://www.w3.org/TR/CSS21/text.html#propdef-text-align | [
"Adjust",
"the",
"justification",
"of",
"each",
"of",
"our",
"lines",
".",
"http",
":",
"//",
"www",
".",
"w3",
".",
"org",
"/",
"TR",
"/",
"CSS21",
"/",
"text",
".",
"html#propdef",
"-",
"text",
"-",
"align"
] | 75f13c700009be21a1965dc2c5b68a8708c22ba2 | https://github.com/dompdf/dompdf/blob/75f13c700009be21a1965dc2c5b68a8708c22ba2/src/FrameReflower/Block.php#L429-L550 | train | Calculates the text alignment of the frame | [
30522,
5123,
3853,
1035,
3793,
30524,
1028,
1035,
4853,
1011,
1028,
2131,
1035,
2806,
1006,
1007,
1025,
1002,
1059,
1027,
1002,
2023,
1011,
1028,
1035,
4853,
1011,
1028,
2131,
1035,
4820,
1035,
3796,
1006,
1000,
1059,
1000,
1007,
1025,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/Menu/MenuAdmin.php | MenuAdmin.addDiagnosticItem | public function addDiagnosticItem($menuName, $url, $order = 50, $tooltip = false)
{
$this->addItem('CoreAdminHome_MenuDiagnostic', $menuName, $url, $order, $tooltip);
} | php | public function addDiagnosticItem($menuName, $url, $order = 50, $tooltip = false)
{
$this->addItem('CoreAdminHome_MenuDiagnostic', $menuName, $url, $order, $tooltip);
} | [
"public",
"function",
"addDiagnosticItem",
"(",
"$",
"menuName",
",",
"$",
"url",
",",
"$",
"order",
"=",
"50",
",",
"$",
"tooltip",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"addItem",
"(",
"'CoreAdminHome_MenuDiagnostic'",
",",
"$",
"menuName",
",",
"... | See {@link add()}. Adds a new menu item to the diagnostic section of the admin menu.
@param string $menuName
@param array $url
@param int $order
@param bool|string $tooltip
@api
@since 2.5.0 | [
"See",
"{"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Menu/MenuAdmin.php#L62-L65 | train | Add a menu item with diagnostic information to the menu | [
30522,
2270,
3853,
5587,
9032,
26745,
10074,
4221,
2213,
1006,
1002,
12183,
18442,
1010,
1002,
24471,
2140,
1010,
1002,
2344,
1027,
2753,
1010,
1002,
6994,
25101,
1027,
6270,
1007,
1063,
1002,
2023,
1011,
1028,
5587,
4221,
2213,
1006,
1005,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Database/Eloquent/Relations/HasOneOrMany.php | HasOneOrMany.addConstraints | public function addConstraints()
{
if (static::$constraints) {
$this->query->where($this->foreignKey, '=', $this->getParentKey());
$this->query->whereNotNull($this->foreignKey);
}
} | php | public function addConstraints()
{
if (static::$constraints) {
$this->query->where($this->foreignKey, '=', $this->getParentKey());
$this->query->whereNotNull($this->foreignKey);
}
} | [
"public",
"function",
"addConstraints",
"(",
")",
"{",
"if",
"(",
"static",
"::",
"$",
"constraints",
")",
"{",
"$",
"this",
"->",
"query",
"->",
"where",
"(",
"$",
"this",
"->",
"foreignKey",
",",
"'='",
",",
"$",
"this",
"->",
"getParentKey",
"(",
... | Set the base constraints on the relation query.
@return void | [
"Set",
"the",
"base",
"constraints",
"on",
"the",
"relation",
"query",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Relations/HasOneOrMany.php#L67-L74 | train | Add constraints to the query | [
30522,
2270,
3853,
5587,
8663,
20528,
18447,
2015,
1006,
1007,
1063,
2065,
1006,
10763,
1024,
1024,
1002,
14679,
1007,
1063,
1002,
2023,
1011,
1028,
23032,
1011,
1028,
2073,
1006,
1002,
2023,
1011,
1028,
3097,
14839,
1010,
1005,
1027,
1005,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Database/Eloquent/Model.php | Model.bootIfNotBooted | protected function bootIfNotBooted()
{
if (! isset(static::$booted[static::class])) {
static::$booted[static::class] = true;
$this->fireModelEvent('booting', false);
static::boot();
$this->fireModelEvent('booted', false);
}
} | php | protected function bootIfNotBooted()
{
if (! isset(static::$booted[static::class])) {
static::$booted[static::class] = true;
$this->fireModelEvent('booting', false);
static::boot();
$this->fireModelEvent('booted', false);
}
} | [
"protected",
"function",
"bootIfNotBooted",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"static",
"::",
"$",
"booted",
"[",
"static",
"::",
"class",
"]",
")",
")",
"{",
"static",
"::",
"$",
"booted",
"[",
"static",
"::",
"class",
"]",
"=",
"true",
... | Check if the model needs to be booted and if so, do it.
@return void | [
"Check",
"if",
"the",
"model",
"needs",
"to",
"be",
"booted",
"and",
"if",
"so",
"do",
"it",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Model.php#L179-L190 | train | Boots the class if it hasn t been booted yet. | [
30522,
5123,
3853,
9573,
10128,
17048,
27927,
2098,
1006,
1007,
1063,
2065,
1006,
999,
26354,
3388,
1006,
10763,
1024,
1024,
1002,
9573,
2098,
1031,
10763,
1024,
1024,
2465,
1033,
1007,
1007,
1063,
10763,
1024,
1024,
1002,
9573,
2098,
1031,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/HTML/Common2.php | HTML_Common2.setAttributes | public function setAttributes($attributes)
{
$attributes = self::prepareAttributes($attributes);
$watched = array();
foreach ($this->watchedAttributes as $watchedKey) {
if (isset($attributes[$watchedKey])) {
$this->setAttribute($watchedKey, $attributes[$watched... | php | public function setAttributes($attributes)
{
$attributes = self::prepareAttributes($attributes);
$watched = array();
foreach ($this->watchedAttributes as $watchedKey) {
if (isset($attributes[$watchedKey])) {
$this->setAttribute($watchedKey, $attributes[$watched... | [
"public",
"function",
"setAttributes",
"(",
"$",
"attributes",
")",
"{",
"$",
"attributes",
"=",
"self",
"::",
"prepareAttributes",
"(",
"$",
"attributes",
")",
";",
"$",
"watched",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"watched... | Sets the attributes
@param mixed Array of attribute 'name' => 'value' pairs or HTML attribute string
@return HTML_Common2 | [
"Sets",
"the",
"attributes"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/Common2.php#L274-L291 | train | Set attributes of the grammar | [
30522,
2270,
3853,
2275,
30524,
14839,
1007,
1063,
2065,
1006,
26354,
3388,
1006,
1002,
12332,
1031,
1002,
3427,
14839,
1033,
1007,
1007,
1063,
1002,
2023,
1011,
1028,
2275,
19321,
3089,
8569,
2618,
1006,
1002,
3427,
14839,
1010,
1002,
1233... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationMapper.php | ViolationMapper.mapViolation | public function mapViolation(ConstraintViolation $violation, FormInterface $form, $allowNonSynchronized = false)
{
$this->allowNonSynchronized = $allowNonSynchronized;
// The scope is the currently found most specific form that
// an error should be mapped to. After setting the scope, the
... | php | public function mapViolation(ConstraintViolation $violation, FormInterface $form, $allowNonSynchronized = false)
{
$this->allowNonSynchronized = $allowNonSynchronized;
// The scope is the currently found most specific form that
// an error should be mapped to. After setting the scope, the
... | [
"public",
"function",
"mapViolation",
"(",
"ConstraintViolation",
"$",
"violation",
",",
"FormInterface",
"$",
"form",
",",
"$",
"allowNonSynchronized",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"allowNonSynchronized",
"=",
"$",
"allowNonSynchronized",
";",
"// T... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationMapper.php#L35-L135 | train | Map a constraint violation to the most specific form that the user has found. | [
30522,
2270,
3853,
4949,
25500,
13490,
1006,
27142,
25500,
13490,
1002,
11371,
1010,
2433,
18447,
2121,
12172,
1002,
2433,
1010,
1002,
3499,
8540,
6508,
12680,
4948,
3550,
1027,
6270,
1007,
1063,
1002,
2023,
1011,
1028,
3499,
8540,
6508,
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/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php | TextDescriptor.describeContainerServices | protected function describeContainerServices(ContainerBuilder $builder, array $options = [])
{
$showHidden = isset($options['show_hidden']) && $options['show_hidden'];
$showTag = isset($options['tag']) ? $options['tag'] : null;
if ($showHidden) {
$title = 'Symfony Container Hidd... | php | protected function describeContainerServices(ContainerBuilder $builder, array $options = [])
{
$showHidden = isset($options['show_hidden']) && $options['show_hidden'];
$showTag = isset($options['tag']) ? $options['tag'] : null;
if ($showHidden) {
$title = 'Symfony Container Hidd... | [
"protected",
"function",
"describeContainerServices",
"(",
"ContainerBuilder",
"$",
"builder",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"showHidden",
"=",
"isset",
"(",
"$",
"options",
"[",
"'show_hidden'",
"]",
")",
"&&",
"$",
"options",
... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php#L176-L261 | train | Describes the container services | [
30522,
5123,
3853,
6235,
8663,
18249,
2545,
2121,
7903,
2229,
1006,
11661,
8569,
23891,
2099,
1002,
12508,
1010,
9140,
1002,
7047,
1027,
1031,
1033,
1007,
1063,
1002,
2265,
27511,
4181,
1027,
26354,
3388,
1006,
1002,
7047,
1031,
1005,
2265,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php | ExceptionController.templateExists | protected function templateExists($template)
{
$template = (string) $template;
$loader = $this->twig->getLoader();
if ($loader instanceof ExistsLoaderInterface || method_exists($loader, 'exists')) {
return $loader->exists($template);
}
try {
$loader-... | php | protected function templateExists($template)
{
$template = (string) $template;
$loader = $this->twig->getLoader();
if ($loader instanceof ExistsLoaderInterface || method_exists($loader, 'exists')) {
return $loader->exists($template);
}
try {
$loader-... | [
"protected",
"function",
"templateExists",
"(",
"$",
"template",
")",
"{",
"$",
"template",
"=",
"(",
"string",
")",
"$",
"template",
";",
"$",
"loader",
"=",
"$",
"this",
"->",
"twig",
"->",
"getLoader",
"(",
")",
";",
"if",
"(",
"$",
"loader",
"ins... | to be removed when the minimum required version of Twig is >= 3.0 | [
"to",
"be",
"removed",
"when",
"the",
"minimum",
"required",
"version",
"of",
"Twig",
"is",
">",
"=",
"3",
".",
"0"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php#L126-L143 | train | Checks if a template exists in the current context | [
30522,
5123,
3853,
23561,
10288,
5130,
1006,
1002,
23561,
1007,
1063,
1002,
23561,
1027,
1006,
5164,
1007,
1002,
23561,
1025,
1002,
7170,
2121,
1027,
1002,
2023,
1011,
1028,
1056,
16279,
1011,
1028,
2131,
11066,
2121,
1006,
1007,
1025,
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... |
z-song/laravel-admin | src/Form/Field.php | Field.fill | public function fill($data)
{
// Field value is already setted.
// if (!is_null($this->value)) {
// return;
// }
$this->data = $data;
if (is_array($this->column)) {
foreach ($this->column as $key => $column) {
$this->value[$key] = Arr::g... | php | public function fill($data)
{
// Field value is already setted.
// if (!is_null($this->value)) {
// return;
// }
$this->data = $data;
if (is_array($this->column)) {
foreach ($this->column as $key => $column) {
$this->value[$key] = Arr::g... | [
"public",
"function",
"fill",
"(",
"$",
"data",
")",
"{",
"// Field value is already setted.",
"// if (!is_null($this->value)) {",
"// return;",
"// }",
"$",
"this",
"->",
"data",
"=",
"$",
"data",
";",
"if",
"(",
"is_array",
"(",
"$",
"this... | Fill data to the field.
@param array $data
@return void | [
"Fill",
"data",
"to",
"the",
"field",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Form/Field.php#L341-L362 | train | Fill the field value from the given array | [
30522,
2270,
3853,
6039,
1006,
1002,
2951,
1007,
1063,
1013,
1013,
2492,
3643,
2003,
2525,
2275,
3064,
1012,
1013,
1013,
2065,
1006,
999,
2003,
1035,
19701,
1006,
1002,
2023,
1011,
1028,
3643,
1007,
1007,
1063,
1013,
1013,
2709,
1025,
101... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/DataTable.php | DataTable.renameColumn | public function renameColumn($oldName, $newName)
{
foreach ($this->rows as $row) {
$row->renameColumn($oldName, $newName);
$subTable = $row->getSubtable();
if ($subTable) {
$subTable->renameColumn($oldName, $newName);
}
}
if (!... | php | public function renameColumn($oldName, $newName)
{
foreach ($this->rows as $row) {
$row->renameColumn($oldName, $newName);
$subTable = $row->getSubtable();
if ($subTable) {
$subTable->renameColumn($oldName, $newName);
}
}
if (!... | [
"public",
"function",
"renameColumn",
"(",
"$",
"oldName",
",",
"$",
"newName",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"rows",
"as",
"$",
"row",
")",
"{",
"$",
"row",
"->",
"renameColumn",
"(",
"$",
"oldName",
",",
"$",
"newName",
")",
";",
"... | Rename a column in every row. This change is applied recursively to all subtables.
@param string $oldName Old column name.
@param string $newName New column name. | [
"Rename",
"a",
"column",
"in",
"every",
"row",
".",
"This",
"change",
"is",
"applied",
"recursively",
"to",
"all",
"subtables",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable.php#L1086-L1102 | train | Renames a column in all rows summary and totals rows | [
30522,
2270,
3853,
14916,
14074,
25778,
2819,
2078,
1006,
1002,
2214,
18442,
1010,
1002,
2047,
18442,
1007,
1063,
18921,
6776,
1006,
1002,
2023,
1011,
1028,
10281,
2004,
1002,
5216,
1007,
1063,
1002,
5216,
1011,
1028,
14916,
14074,
25778,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Common/Page/Medium/Medium.php | Medium.thumbnail | public function thumbnail($type = 'auto')
{
if ($type !== 'auto' && !\in_array($type, $this->thumbnailTypes, true)) {
return $this;
}
if ($this->thumbnailType !== $type) {
$this->_thumbnail = null;
}
$this->thumbnailType = $type;
return $thi... | php | public function thumbnail($type = 'auto')
{
if ($type !== 'auto' && !\in_array($type, $this->thumbnailTypes, true)) {
return $this;
}
if ($this->thumbnailType !== $type) {
$this->_thumbnail = null;
}
$this->thumbnailType = $type;
return $thi... | [
"public",
"function",
"thumbnail",
"(",
"$",
"type",
"=",
"'auto'",
")",
"{",
"if",
"(",
"$",
"type",
"!==",
"'auto'",
"&&",
"!",
"\\",
"in_array",
"(",
"$",
"type",
",",
"$",
"this",
"->",
"thumbnailTypes",
",",
"true",
")",
")",
"{",
"return",
"$... | Switch thumbnail.
@param string $type
@return $this | [
"Switch",
"thumbnail",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Page/Medium/Medium.php#L518-L531 | train | Set thumbnail type | [
30522,
2270,
3853,
7639,
25464,
1006,
1002,
2828,
1027,
1005,
8285,
1005,
1007,
1063,
2065,
1006,
1002,
2828,
999,
1027,
1027,
1005,
8285,
1005,
1004,
1004,
999,
1032,
1999,
1035,
9140,
1006,
1002,
2828,
1010,
1002,
2023,
1011,
1028,
7639... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/Tracker/Model.php | Model.isSiteEmpty | public function isSiteEmpty($siteId)
{
$sql = sprintf('SELECT idsite FROM %s WHERE idsite = ? limit 1', Common::prefixTable('log_visit'));
$result = \Piwik\Db::fetchOne($sql, array($siteId));
return $result == null;
} | php | public function isSiteEmpty($siteId)
{
$sql = sprintf('SELECT idsite FROM %s WHERE idsite = ? limit 1', Common::prefixTable('log_visit'));
$result = \Piwik\Db::fetchOne($sql, array($siteId));
return $result == null;
} | [
"public",
"function",
"isSiteEmpty",
"(",
"$",
"siteId",
")",
"{",
"$",
"sql",
"=",
"sprintf",
"(",
"'SELECT idsite FROM %s WHERE idsite = ? limit 1'",
",",
"Common",
"::",
"prefixTable",
"(",
"'log_visit'",
")",
")",
";",
"$",
"result",
"=",
"\\",
"Piwik",
"\... | Returns true if the site doesn't have raw data.
@param int $siteId
@return bool | [
"Returns",
"true",
"if",
"the",
"site",
"doesn",
"t",
"have",
"raw",
"data",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Tracker/Model.php#L421-L428 | train | Returns true if the site is empty. | [
30522,
2270,
3853,
26354,
4221,
6633,
13876,
2100,
1006,
1002,
2609,
3593,
1007,
1063,
1002,
29296,
1027,
9043,
2546,
1006,
1005,
7276,
8909,
28032,
2063,
2013,
1003,
1055,
2073,
8909,
28032,
2063,
1027,
1029,
5787,
1015,
1005,
1010,
2691,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.evalRelationTypeValue | protected function evalRelationTypeValue($record, $column, $value)
{
traceLog(sprintf('Warning: List column type "relation" for class "%s" is not valid.', get_class($record)));
return $this->evalTextTypeValue($record, $column, $value);
} | php | protected function evalRelationTypeValue($record, $column, $value)
{
traceLog(sprintf('Warning: List column type "relation" for class "%s" is not valid.', get_class($record)));
return $this->evalTextTypeValue($record, $column, $value);
} | [
"protected",
"function",
"evalRelationTypeValue",
"(",
"$",
"record",
",",
"$",
"column",
",",
"$",
"value",
")",
"{",
"traceLog",
"(",
"sprintf",
"(",
"'Warning: List column type \"relation\" for class \"%s\" is not valid.'",
",",
"get_class",
"(",
"$",
"record",
")"... | Common mistake, relation is not a valid list column.
@deprecated Remove if year >= 2018 | [
"Common",
"mistake",
"relation",
"is",
"not",
"a",
"valid",
"list",
"column",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/Lists.php#L1172-L1176 | train | Evaluate the relation type value | [
30522,
5123,
3853,
9345,
20974,
10581,
3508,
13874,
10175,
5657,
1006,
1002,
2501,
1010,
1002,
5930,
1010,
1002,
3643,
1007,
1063,
7637,
21197,
1006,
9043,
2546,
1006,
1005,
5432,
1024,
2862,
5930,
2828,
1000,
7189,
1000,
2005,
2465,
1000,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/MetadataLoader.php | MetadataLoader.load | public function load()
{
$defaults = $this->getDefaultPluginInformation();
$plugin = $this->loadPluginInfoJson();
// use translated plugin description if available
if ($defaults['description'] != Piwik::translate($defaults['description'])) {
unset($plugin['description'... | php | public function load()
{
$defaults = $this->getDefaultPluginInformation();
$plugin = $this->loadPluginInfoJson();
// use translated plugin description if available
if ($defaults['description'] != Piwik::translate($defaults['description'])) {
unset($plugin['description'... | [
"public",
"function",
"load",
"(",
")",
"{",
"$",
"defaults",
"=",
"$",
"this",
"->",
"getDefaultPluginInformation",
"(",
")",
";",
"$",
"plugin",
"=",
"$",
"this",
"->",
"loadPluginInfoJson",
"(",
")",
";",
"// use translated plugin description if available",
"... | Loads plugin metadata. @see Plugin::getInformation.
@return array | [
"Loads",
"plugin",
"metadata",
".",
"@see",
"Plugin",
"::",
"getInformation",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Plugin/MetadataLoader.php#L51-L71 | train | Load plugin information from the plugin info. json | [
30522,
2270,
3853,
7170,
1006,
1007,
1063,
1002,
12398,
2015,
1027,
1002,
2023,
1011,
1028,
2131,
3207,
7011,
11314,
24759,
15916,
5498,
2078,
14192,
3370,
1006,
1007,
1025,
1002,
13354,
2378,
1027,
1002,
2023,
1011,
1028,
7170,
24759,
1591... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Admin.php | Admin.registerAuthRoutes | public function registerAuthRoutes()
{
$attributes = [
'prefix' => config('admin.route.prefix'),
'middleware' => config('admin.route.middleware'),
];
app('router')->group($attributes, function ($router) {
/* @var \Illuminate\Routing\Router $router */... | php | public function registerAuthRoutes()
{
$attributes = [
'prefix' => config('admin.route.prefix'),
'middleware' => config('admin.route.middleware'),
];
app('router')->group($attributes, function ($router) {
/* @var \Illuminate\Routing\Router $router */... | [
"public",
"function",
"registerAuthRoutes",
"(",
")",
"{",
"$",
"attributes",
"=",
"[",
"'prefix'",
"=>",
"config",
"(",
"'admin.route.prefix'",
")",
",",
"'middleware'",
"=>",
"config",
"(",
"'admin.route.middleware'",
")",
",",
"]",
";",
"app",
"(",
"'router... | Register the auth routes.
@return void | [
"Register",
"the",
"auth",
"routes",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Admin.php#L258-L287 | train | Register Admin routes | [
30522,
2270,
3853,
4236,
4887,
2705,
22494,
4570,
1006,
1007,
1063,
1002,
12332,
1027,
1031,
1005,
17576,
1005,
1027,
1028,
9530,
8873,
2290,
1006,
1005,
4748,
10020,
1012,
2799,
1012,
17576,
1005,
1007,
1010,
1005,
2690,
8059,
1005,
1027,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/DependencyInjection/ChildDefinition.php | ChildDefinition.replaceArgument | public function replaceArgument($index, $value)
{
if (\is_int($index)) {
$this->arguments['index_'.$index] = $value;
} elseif (0 === strpos($index, '$')) {
$this->arguments[$index] = $value;
} else {
throw new InvalidArgumentException('The argument must be... | php | public function replaceArgument($index, $value)
{
if (\is_int($index)) {
$this->arguments['index_'.$index] = $value;
} elseif (0 === strpos($index, '$')) {
$this->arguments[$index] = $value;
} else {
throw new InvalidArgumentException('The argument must be... | [
"public",
"function",
"replaceArgument",
"(",
"$",
"index",
",",
"$",
"value",
")",
"{",
"if",
"(",
"\\",
"is_int",
"(",
"$",
"index",
")",
")",
"{",
"$",
"this",
"->",
"arguments",
"[",
"'index_'",
".",
"$",
"index",
"]",
"=",
"$",
"value",
";",
... | You should always use this method when overwriting existing arguments
of the parent definition.
If you directly call setArguments() keep in mind that you must follow
certain conventions when you want to overwrite the arguments of the
parent definition, otherwise your arguments will only be appended.
@param int|string... | [
"You",
"should",
"always",
"use",
"this",
"method",
"when",
"overwriting",
"existing",
"arguments",
"of",
"the",
"parent",
"definition",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/DependencyInjection/ChildDefinition.php#L96-L107 | train | Set an argument value | [
30522,
2270,
3853,
5672,
2906,
22850,
4765,
1006,
1002,
5950,
1010,
1002,
3643,
1007,
1063,
2065,
1006,
1032,
2003,
1035,
20014,
1006,
1002,
5950,
1007,
1007,
1063,
1002,
2023,
1011,
1028,
9918,
1031,
1005,
30524,
1033,
1027,
1002,
3643,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/DependencyInjection/LazyLoadingFragmentHandler.php | LazyLoadingFragmentHandler.render | public function render($uri, $renderer = 'inline', array $options = [])
{
if (!isset($this->initialized[$renderer]) && $this->container->has($renderer)) {
$this->addRenderer($this->container->get($renderer));
$this->initialized[$renderer] = true;
}
return parent::ren... | php | public function render($uri, $renderer = 'inline', array $options = [])
{
if (!isset($this->initialized[$renderer]) && $this->container->has($renderer)) {
$this->addRenderer($this->container->get($renderer));
$this->initialized[$renderer] = true;
}
return parent::ren... | [
"public",
"function",
"render",
"(",
"$",
"uri",
",",
"$",
"renderer",
"=",
"'inline'",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"initialized",
"[",
"$",
"renderer",
"]",
")",
"&&",
"... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpKernel/DependencyInjection/LazyLoadingFragmentHandler.php#L38-L46 | train | Render a page with a specific renderer | [
30522,
2270,
3853,
17552,
1006,
1002,
24471,
2072,
1010,
1002,
17552,
2121,
1027,
1005,
23881,
1005,
1010,
9140,
1002,
7047,
1027,
1031,
1033,
1007,
1063,
2065,
1006,
999,
26354,
3388,
1006,
1002,
2023,
1011,
1028,
3988,
3550,
1031,
1002,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
z-song/laravel-admin | src/Show/Tools.php | Tools.getEditPath | protected function getEditPath()
{
$key = $this->panel->getParent()->getModel()->getKey();
return $this->getListPath().'/'.$key.'/edit';
} | php | protected function getEditPath()
{
$key = $this->panel->getParent()->getModel()->getKey();
return $this->getListPath().'/'.$key.'/edit';
} | [
"protected",
"function",
"getEditPath",
"(",
")",
"{",
"$",
"key",
"=",
"$",
"this",
"->",
"panel",
"->",
"getParent",
"(",
")",
"->",
"getModel",
"(",
")",
"->",
"getKey",
"(",
")",
";",
"return",
"$",
"this",
"->",
"getListPath",
"(",
")",
".",
"... | Get request path for edit.
@return string | [
"Get",
"request",
"path",
"for",
"edit",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Show/Tools.php#L163-L168 | train | Get edit path | [
30522,
5123,
3853,
2131,
2098,
4183,
15069,
1006,
1007,
1063,
1002,
3145,
1027,
1002,
2023,
1011,
1028,
5997,
1011,
1028,
2131,
19362,
4765,
1006,
1007,
1011,
1028,
2131,
5302,
9247,
1006,
1007,
1011,
1028,
2131,
14839,
1006,
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... |
symfony/symfony | src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php | ChoiceType.buildView | public function buildView(FormView $view, FormInterface $form, array $options)
{
$choiceTranslationDomain = $options['choice_translation_domain'];
if ($view->parent && null === $choiceTranslationDomain) {
$choiceTranslationDomain = $view->vars['translation_domain'];
}
/*... | php | public function buildView(FormView $view, FormInterface $form, array $options)
{
$choiceTranslationDomain = $options['choice_translation_domain'];
if ($view->parent && null === $choiceTranslationDomain) {
$choiceTranslationDomain = $view->vars['translation_domain'];
}
/*... | [
"public",
"function",
"buildView",
"(",
"FormView",
"$",
"view",
",",
"FormInterface",
"$",
"form",
",",
"array",
"$",
"options",
")",
"{",
"$",
"choiceTranslationDomain",
"=",
"$",
"options",
"[",
"'choice_translation_domain'",
"]",
";",
"if",
"(",
"$",
"vi... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php#L172-L225 | train | Build the view | [
30522,
2270,
3853,
3857,
8584,
1006,
2433,
8584,
1002,
3193,
1010,
2433,
18447,
2121,
12172,
1002,
2433,
1010,
9140,
1002,
7047,
1007,
1063,
1002,
3601,
6494,
3619,
13490,
9527,
8113,
1027,
1002,
7047,
1031,
1005,
3601,
1035,
5449,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/backend/models/AccessLog.php | AccessLog.getRecent | public static function getRecent($user)
{
$records = static::where('user_id', $user->id)
->orderBy('created_at', 'desc')
->limit(2)
->get()
;
if (!count($records)) {
return null;
}
$first = $records->first();
return !... | php | public static function getRecent($user)
{
$records = static::where('user_id', $user->id)
->orderBy('created_at', 'desc')
->limit(2)
->get()
;
if (!count($records)) {
return null;
}
$first = $records->first();
return !... | [
"public",
"static",
"function",
"getRecent",
"(",
"$",
"user",
")",
"{",
"$",
"records",
"=",
"static",
"::",
"where",
"(",
"'user_id'",
",",
"$",
"user",
"->",
"id",
")",
"->",
"orderBy",
"(",
"'created_at'",
",",
"'desc'",
")",
"->",
"limit",
"(",
... | Returns a recent entry, latest entry is not considered recent
if the creation day is the same as today.
@return self | [
"Returns",
"a",
"recent",
"entry",
"latest",
"entry",
"is",
"not",
"considered",
"recent",
"if",
"the",
"creation",
"day",
"is",
"the",
"same",
"as",
"today",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/models/AccessLog.php#L46-L61 | train | Get recent entry | [
30522,
2270,
10763,
3853,
2131,
2890,
13013,
1006,
1002,
5310,
1007,
1063,
1002,
2636,
1027,
10763,
1024,
1024,
2073,
1006,
1005,
5310,
1035,
8909,
1005,
1010,
1002,
5310,
1011,
1028,
8909,
1007,
1011,
1028,
2344,
3762,
1006,
1005,
2580,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.delete | public function delete()
{
/**
* A read-only row cannot be deleted.
*/
if ($this->_readOnly === true) {
// require_once 'Zend/Db/Table/Row/Exception.php';
throw new Zend_Db_Table_Row_Exception('This row has been marked read-only');
}
$where ... | php | public function delete()
{
/**
* A read-only row cannot be deleted.
*/
if ($this->_readOnly === true) {
// require_once 'Zend/Db/Table/Row/Exception.php';
throw new Zend_Db_Table_Row_Exception('This row has been marked read-only');
}
$where ... | [
"public",
"function",
"delete",
"(",
")",
"{",
"/**\n * A read-only row cannot be deleted.\n */",
"if",
"(",
"$",
"this",
"->",
"_readOnly",
"===",
"true",
")",
"{",
"// require_once 'Zend/Db/Table/Row/Exception.php';",
"throw",
"new",
"Zend_Db_Table_Row_Excep... | Deletes existing rows.
@return int The number of rows deleted. | [
"Deletes",
"existing",
"rows",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Table/Row/Abstract.php#L595-L643 | train | Delete the row | [
30522,
2270,
3853,
3972,
12870,
1006,
1007,
1063,
1013,
1008,
1008,
1008,
1037,
3191,
1011,
2069,
5216,
3685,
2022,
17159,
1012,
1008,
1013,
2065,
1006,
1002,
2023,
1011,
1028,
1035,
3191,
2239,
2135,
1027,
1027,
1027,
2995,
1007,
1063,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Common/Page/Medium/MediumFactory.php | MediumFactory.fromArray | public static function fromArray(array $items = [], Blueprint $blueprint = null)
{
$type = $items['type'] ?? null;
switch ($type) {
case 'image':
return new ImageMedium($items, $blueprint);
case 'thumbnail':
return new ThumbnailImageMedium($it... | php | public static function fromArray(array $items = [], Blueprint $blueprint = null)
{
$type = $items['type'] ?? null;
switch ($type) {
case 'image':
return new ImageMedium($items, $blueprint);
case 'thumbnail':
return new ThumbnailImageMedium($it... | [
"public",
"static",
"function",
"fromArray",
"(",
"array",
"$",
"items",
"=",
"[",
"]",
",",
"Blueprint",
"$",
"blueprint",
"=",
"null",
")",
"{",
"$",
"type",
"=",
"$",
"items",
"[",
"'type'",
"]",
"??",
"null",
";",
"switch",
"(",
"$",
"type",
")... | Create Medium from array of parameters
@param array $items
@param Blueprint|null $blueprint
@return Medium | [
"Create",
"Medium",
"from",
"array",
"of",
"parameters"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Page/Medium/MediumFactory.php#L128-L147 | train | Create Medium from array | [
30522,
2270,
10763,
3853,
2013,
2906,
9447,
1006,
9140,
1002,
5167,
1027,
1031,
1033,
1010,
2630,
16550,
1002,
2630,
16550,
1027,
19701,
1007,
1063,
1002,
2828,
1027,
1002,
5167,
1031,
1005,
2828,
1005,
1033,
1029,
1029,
19701,
1025,
6942,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Libevent.php | Libevent.add | public function add($fd, $flag, $func, $args = array())
{
switch ($flag) {
case self::EV_SIGNAL:
$fd_key = (int)$fd;
$real_flag = EV_SIGNAL | EV_PERSIST;
$this->_eventSignal[$fd_key] = event_new();
... | php | public function add($fd, $flag, $func, $args = array())
{
switch ($flag) {
case self::EV_SIGNAL:
$fd_key = (int)$fd;
$real_flag = EV_SIGNAL | EV_PERSIST;
$this->_eventSignal[$fd_key] = event_new();
... | [
"public",
"function",
"add",
"(",
"$",
"fd",
",",
"$",
"flag",
",",
"$",
"func",
",",
"$",
"args",
"=",
"array",
"(",
")",
")",
"{",
"switch",
"(",
"$",
"flag",
")",
"{",
"case",
"self",
"::",
"EV_SIGNAL",
":",
"$",
"fd_key",
"=",
"(",
"int",
... | {@inheritdoc} | [
"{"
] | 13649907f05014fcfffcfccaef01e63ad3339351 | https://github.com/walkor/Workerman/blob/13649907f05014fcfffcfccaef01e63ad3339351/Events/Libevent.php#L63-L122 | train | Adds an event to the system | [
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,
4742,
1024,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/API/DocumentationGenerator.php | DocumentationGenerator.checkDocumentation | public function checkDocumentation($moduleToCheck)
{
if (strpos($moduleToCheck, '@hide') == true) {
$moduleToCheck = str_replace(strtok(strstr($moduleToCheck, '@hide'), "\n"), "", $moduleToCheck);
}
return $moduleToCheck;
} | php | public function checkDocumentation($moduleToCheck)
{
if (strpos($moduleToCheck, '@hide') == true) {
$moduleToCheck = str_replace(strtok(strstr($moduleToCheck, '@hide'), "\n"), "", $moduleToCheck);
}
return $moduleToCheck;
} | [
"public",
"function",
"checkDocumentation",
"(",
"$",
"moduleToCheck",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"moduleToCheck",
",",
"'@hide'",
")",
"==",
"true",
")",
"{",
"$",
"moduleToCheck",
"=",
"str_replace",
"(",
"strtok",
"(",
"strstr",
"(",
"$",
... | Check if documentation contains @hide annotation and deletes it
@param $moduleToCheck
@return mixed | [
"Check",
"if",
"documentation",
"contains",
"@hide",
"annotation",
"and",
"deletes",
"it"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/API/DocumentationGenerator.php#L188-L194 | train | Check module documentation | [
30522,
2270,
3853,
4638,
3527,
24894,
19304,
1006,
1002,
11336,
3406,
5403,
3600,
1007,
1063,
2065,
1006,
2358,
14536,
2891,
1006,
1002,
11336,
3406,
5403,
3600,
1010,
1005,
1030,
5342,
1005,
1007,
1027,
1027,
2995,
1007,
1063,
1002,
11336,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/Zend/Config.php | Zend_Config._loadFileErrorHandler | protected function _loadFileErrorHandler($errno, $errstr, $errfile, $errline)
{
if ($this->_loadFileErrorStr === null) {
$this->_loadFileErrorStr = $errstr;
} else {
$this->_loadFileErrorStr .= (PHP_EOL . $errstr);
}
} | php | protected function _loadFileErrorHandler($errno, $errstr, $errfile, $errline)
{
if ($this->_loadFileErrorStr === null) {
$this->_loadFileErrorStr = $errstr;
} else {
$this->_loadFileErrorStr .= (PHP_EOL . $errstr);
}
} | [
"protected",
"function",
"_loadFileErrorHandler",
"(",
"$",
"errno",
",",
"$",
"errstr",
",",
"$",
"errfile",
",",
"$",
"errline",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_loadFileErrorStr",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"_loadFileErrorStr",... | Handle any errors from simplexml_load_file or parse_ini_file
@param integer $errno
@param string $errstr
@param string $errfile
@param integer $errline | [
"Handle",
"any",
"errors",
"from",
"simplexml_load_file",
"or",
"parse_ini_file"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Config.php#L447-L454 | train | Load file error handler | [
30522,
5123,
3853,
1035,
7170,
8873,
10559,
18933,
25032,
5685,
3917,
1006,
1002,
9413,
19139,
1010,
1002,
9413,
12096,
2099,
1010,
1002,
9413,
12881,
9463,
1010,
1002,
9413,
19403,
2063,
1007,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
1035... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/system/ServiceProvider.php | ServiceProvider.registerLogging | protected function registerLogging()
{
Event::listen(\Illuminate\Log\Events\MessageLogged::class, function ($event) {
if (EventLog::useLogging()) {
EventLog::add($event->message, $event->level);
}
});
} | php | protected function registerLogging()
{
Event::listen(\Illuminate\Log\Events\MessageLogged::class, function ($event) {
if (EventLog::useLogging()) {
EventLog::add($event->message, $event->level);
}
});
} | [
"protected",
"function",
"registerLogging",
"(",
")",
"{",
"Event",
"::",
"listen",
"(",
"\\",
"Illuminate",
"\\",
"Log",
"\\",
"Events",
"\\",
"MessageLogged",
"::",
"class",
",",
"function",
"(",
"$",
"event",
")",
"{",
"if",
"(",
"EventLog",
"::",
"us... | /*
Write all log events to the database | [
"/",
"*",
"Write",
"all",
"log",
"events",
"to",
"the",
"database"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/ServiceProvider.php#L263-L270 | train | Register logging to the event logger | [
30522,
5123,
3853,
4236,
21197,
4726,
1006,
1007,
1063,
2724,
1024,
1024,
4952,
1006,
1032,
5665,
12717,
12556,
1032,
8833,
1032,
2824,
1032,
4471,
21197,
5999,
1024,
1024,
2465,
1010,
3853,
1006,
1002,
2724,
1007,
1063,
2065,
1006,
2724,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/models/ImportModel.php | ImportModel.processImportRow | protected function processImportRow($rowData, $matches)
{
$newRow = [];
foreach ($matches as $columnIndex => $dbNames) {
$value = array_get($rowData, $columnIndex);
foreach ((array) $dbNames as $dbName) {
$newRow[$dbName] = $value;
}
}
... | php | protected function processImportRow($rowData, $matches)
{
$newRow = [];
foreach ($matches as $columnIndex => $dbNames) {
$value = array_get($rowData, $columnIndex);
foreach ((array) $dbNames as $dbName) {
$newRow[$dbName] = $value;
}
}
... | [
"protected",
"function",
"processImportRow",
"(",
"$",
"rowData",
",",
"$",
"matches",
")",
"{",
"$",
"newRow",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"matches",
"as",
"$",
"columnIndex",
"=>",
"$",
"dbNames",
")",
"{",
"$",
"value",
"=",
"array_get"... | Converts a single row of CSV data to the column map.
@return array | [
"Converts",
"a",
"single",
"row",
"of",
"CSV",
"data",
"to",
"the",
"column",
"map",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/models/ImportModel.php#L157-L169 | train | Process import row | [
30522,
5123,
3853,
2832,
5714,
6442,
10524,
1006,
1002,
5216,
2850,
2696,
1010,
1002,
3503,
1007,
1063,
1002,
2047,
10524,
1027,
1031,
1033,
1025,
18921,
6776,
1006,
1002,
3503,
2004,
1002,
5930,
22254,
10288,
1027,
1028,
1002,
16962,
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/Form/Form.php | Form.get | public function get($name)
{
if (isset($this->children[$name])) {
return $this->children[$name];
}
throw new OutOfBoundsException(sprintf('Child "%s" does not exist.', $name));
} | php | public function get($name)
{
if (isset($this->children[$name])) {
return $this->children[$name];
}
throw new OutOfBoundsException(sprintf('Child "%s" does not exist.', $name));
} | [
"public",
"function",
"get",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"children",
"[",
"$",
"name",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"children",
"[",
"$",
"name",
"]",
";",
"}",
"throw",
"new",
"Ou... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/Form.php#L932-L939 | train | Get a child by name | [
30522,
2270,
3853,
2131,
1006,
1002,
2171,
1007,
1063,
2065,
1006,
30524,
2171,
1033,
1025,
1065,
5466,
2047,
2041,
11253,
15494,
3366,
2595,
24422,
1006,
9043,
2546,
1006,
1005,
2775,
1000,
1003,
1055,
1000,
2515,
2025,
4839,
1012,
1005,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/Zend/Db/Table/Abstract.php | Zend_Db_Table_Abstract.delete | public function delete($where)
{
$tableSpec = ($this->_schema ? $this->_schema . '.' : '') . $this->_name;
return $this->_db->delete($tableSpec, $where);
} | php | public function delete($where)
{
$tableSpec = ($this->_schema ? $this->_schema . '.' : '') . $this->_name;
return $this->_db->delete($tableSpec, $where);
} | [
"public",
"function",
"delete",
"(",
"$",
"where",
")",
"{",
"$",
"tableSpec",
"=",
"(",
"$",
"this",
"->",
"_schema",
"?",
"$",
"this",
"->",
"_schema",
".",
"'.'",
":",
"''",
")",
".",
"$",
"this",
"->",
"_name",
";",
"return",
"$",
"this",
"->... | Deletes existing rows.
@param array|string $where SQL WHERE clause(s).
@return int The number of rows deleted. | [
"Deletes",
"existing",
"rows",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Table/Abstract.php#L1181-L1185 | train | Delete all records from the table | [
30522,
2270,
3853,
3972,
12870,
1006,
1002,
2073,
1007,
1063,
1002,
7251,
5051,
2278,
1027,
1006,
1002,
2023,
1011,
1028,
1035,
8040,
28433,
1029,
1002,
2023,
1011,
1028,
1035,
8040,
28433,
1012,
1005,
1012,
1005,
1024,
1005,
1005,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
z-song/laravel-admin | src/Grid/Tools/BatchActions.php | BatchActions.add | public function add($title, BatchAction $action = null)
{
$id = $this->actions->count();
if (func_num_args() == 1) {
$action = $title;
$action->setId($id);
} elseif (func_num_args() == 2) {
$action->setId($id);
$action->setTitle($title);
... | php | public function add($title, BatchAction $action = null)
{
$id = $this->actions->count();
if (func_num_args() == 1) {
$action = $title;
$action->setId($id);
} elseif (func_num_args() == 2) {
$action->setId($id);
$action->setTitle($title);
... | [
"public",
"function",
"add",
"(",
"$",
"title",
",",
"BatchAction",
"$",
"action",
"=",
"null",
")",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"actions",
"->",
"count",
"(",
")",
";",
"if",
"(",
"func_num_args",
"(",
")",
"==",
"1",
")",
"{",
"$",
... | Add a batch action.
@param $title
@param BatchAction|null $action
@return $this | [
"Add",
"a",
"batch",
"action",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Grid/Tools/BatchActions.php#L79-L94 | train | Add Batch Action | [
30522,
2270,
3853,
5587,
1006,
1002,
2516,
1010,
14108,
18908,
3258,
1002,
2895,
1027,
19701,
1007,
1063,
1002,
8909,
1027,
1002,
2023,
1011,
1028,
4506,
1011,
1028,
4175,
1006,
1007,
1025,
2065,
1006,
4569,
2278,
1035,
16371,
2213,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Foundation/Application.php | Application.registerBaseServiceProviders | protected function registerBaseServiceProviders()
{
$this->register(new EventServiceProvider($this));
$this->register(new LogServiceProvider($this));
$this->register(new RoutingServiceProvider($this));
} | php | protected function registerBaseServiceProviders()
{
$this->register(new EventServiceProvider($this));
$this->register(new LogServiceProvider($this));
$this->register(new RoutingServiceProvider($this));
} | [
"protected",
"function",
"registerBaseServiceProviders",
"(",
")",
"{",
"$",
"this",
"->",
"register",
"(",
"new",
"EventServiceProvider",
"(",
"$",
"this",
")",
")",
";",
"$",
"this",
"->",
"register",
"(",
"new",
"LogServiceProvider",
"(",
"$",
"this",
")"... | Register all of the base service providers.
@return void | [
"Register",
"all",
"of",
"the",
"base",
"service",
"providers",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Foundation/Application.php#L190-L195 | train | Register base service providers | [
30522,
5123,
3853,
4236,
15058,
8043,
7903,
13699,
12298,
18688,
2015,
1006,
1007,
1063,
1002,
2023,
1011,
1028,
4236,
1006,
2047,
2824,
2121,
7903,
13699,
12298,
18688,
1006,
1002,
2023,
1007,
1007,
1025,
1002,
2023,
1011,
1028,
4236,
1006... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/system/classes/MediaLibrary.php | MediaLibrary.sortItemList | protected function sortItemList(&$itemList, $sortSettings)
{
$files = [];
$folders = [];
// Convert string $sortBy to array
if (is_string($sortSettings)) {
$sortSettings = [
'by' => $sortSettings,
'direction' => self::SORT_DIRECTION_ASC,
... | php | protected function sortItemList(&$itemList, $sortSettings)
{
$files = [];
$folders = [];
// Convert string $sortBy to array
if (is_string($sortSettings)) {
$sortSettings = [
'by' => $sortSettings,
'direction' => self::SORT_DIRECTION_ASC,
... | [
"protected",
"function",
"sortItemList",
"(",
"&",
"$",
"itemList",
",",
"$",
"sortSettings",
")",
"{",
"$",
"files",
"=",
"[",
"]",
";",
"$",
"folders",
"=",
"[",
"]",
";",
"// Convert string $sortBy to array",
"if",
"(",
"is_string",
"(",
"$",
"sortSetti... | Sorts the item list by title, size or last modified date.
@param array $itemList Specifies the item list to sort.
@param mixed $sortSettings Determines the sorting preference.
Supported values are 'title', 'size', 'lastModified' (see SORT_BY_XXX class constants) or an associative array with a 'by' key and a 'direction'... | [
"Sorts",
"the",
"item",
"list",
"by",
"title",
"size",
"or",
"last",
"modified",
"date",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/MediaLibrary.php#L685-L728 | train | Sort item list by file size or title | [
30522,
5123,
3853,
4066,
4221,
19968,
2923,
1006,
1004,
1002,
8875,
9863,
1010,
1002,
11901,
18319,
3070,
2015,
1007,
1063,
1002,
6764,
1027,
1031,
1033,
1025,
1002,
19622,
2015,
1027,
1031,
1033,
1025,
1013,
1013,
10463,
5164,
1002,
4066,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Loader/CacheLoader.php | CacheLoader.load | public function load(TemplateReferenceInterface $template)
{
$key = hash('sha256', $template->getLogicalName());
$dir = $this->dir.\DIRECTORY_SEPARATOR.substr($key, 0, 2);
$file = substr($key, 2).'.tpl';
$path = $dir.\DIRECTORY_SEPARATOR.$file;
if (is_file($path)) {
... | php | public function load(TemplateReferenceInterface $template)
{
$key = hash('sha256', $template->getLogicalName());
$dir = $this->dir.\DIRECTORY_SEPARATOR.substr($key, 0, 2);
$file = substr($key, 2).'.tpl';
$path = $dir.\DIRECTORY_SEPARATOR.$file;
if (is_file($path)) {
... | [
"public",
"function",
"load",
"(",
"TemplateReferenceInterface",
"$",
"template",
")",
"{",
"$",
"key",
"=",
"hash",
"(",
"'sha256'",
",",
"$",
"template",
"->",
"getLogicalName",
"(",
")",
")",
";",
"$",
"dir",
"=",
"$",
"this",
"->",
"dir",
".",
"\\"... | Loads a template.
@return Storage|bool false if the template cannot be loaded, a Storage instance otherwise | [
"Loads",
"a",
"template",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Templating/Loader/CacheLoader.php#L47-L79 | train | Load a template from cache | [
30522,
2270,
3853,
7170,
1006,
23561,
2890,
25523,
18447,
2121,
12172,
1002,
23561,
1007,
1063,
1002,
3145,
1027,
23325,
1006,
1005,
21146,
17788,
2575,
1005,
1010,
1002,
23561,
1011,
1028,
2131,
9966,
18442,
1006,
1007,
1007,
1025,
1002,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/DataTable/Renderer/Csv.php | Csv.render | public function render()
{
$str = $this->renderTable($this->table);
if (empty($str)) {
return self::NO_DATA_AVAILABLE;
}
$this->renderHeader();
$str = $this->convertToUnicode($str);
return $str;
} | php | public function render()
{
$str = $this->renderTable($this->table);
if (empty($str)) {
return self::NO_DATA_AVAILABLE;
}
$this->renderHeader();
$str = $this->convertToUnicode($str);
return $str;
} | [
"public",
"function",
"render",
"(",
")",
"{",
"$",
"str",
"=",
"$",
"this",
"->",
"renderTable",
"(",
"$",
"this",
"->",
"table",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"str",
")",
")",
"{",
"return",
"self",
"::",
"NO_DATA_AVAILABLE",
";",
"}",
... | Computes the dataTable output and returns the string/binary
@return string | [
"Computes",
"the",
"dataTable",
"output",
"and",
"returns",
"the",
"string",
"/",
"binary"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable/Renderer/Csv.php#L79-L90 | train | Render the table and return the string | [
30522,
2270,
3853,
17552,
1006,
1007,
1063,
1002,
2358,
2099,
1027,
1002,
2023,
1011,
1028,
17552,
10880,
1006,
1002,
2023,
1011,
1028,
2795,
1007,
1025,
2065,
1006,
4064,
1006,
1002,
2358,
2099,
1007,
1007,
1063,
2709,
2969,
1024,
1024,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Routing/RouteCollection.php | RouteCollection.addCollection | public function addCollection(self $collection)
{
// we need to remove all routes with the same names first because just replacing them
// would not place the new route at the end of the merged array
foreach ($collection->all() as $name => $route) {
unset($this->routes[$name]);
... | php | public function addCollection(self $collection)
{
// we need to remove all routes with the same names first because just replacing them
// would not place the new route at the end of the merged array
foreach ($collection->all() as $name => $route) {
unset($this->routes[$name]);
... | [
"public",
"function",
"addCollection",
"(",
"self",
"$",
"collection",
")",
"{",
"// we need to remove all routes with the same names first because just replacing them",
"// would not place the new route at the end of the merged array",
"foreach",
"(",
"$",
"collection",
"->",
"all",... | Adds a route collection at the end of the current set by appending all
routes of the added collection. | [
"Adds",
"a",
"route",
"collection",
"at",
"the",
"end",
"of",
"the",
"current",
"set",
"by",
"appending",
"all",
"routes",
"of",
"the",
"added",
"collection",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Routing/RouteCollection.php#L120-L132 | train | Add a route collection | [
30522,
2270,
3853,
5587,
26895,
18491,
1006,
2969,
1002,
3074,
1007,
1063,
1013,
1013,
2057,
2342,
2000,
6366,
2035,
5847,
2007,
1996,
2168,
3415,
2034,
2138,
2074,
6419,
2068,
1013,
1013,
2052,
2025,
2173,
1996,
2047,
2799,
2012,
1996,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/Columns/Dimension.php | Dimension.formatValue | public function formatValue($value, $idSite, Formatter $formatter)
{
switch ($this->type) {
case Dimension::TYPE_BOOL:
if (empty($value)) {
return Piwik::translate('General_No');
}
return Piwik::translate('General_Yes');
... | php | public function formatValue($value, $idSite, Formatter $formatter)
{
switch ($this->type) {
case Dimension::TYPE_BOOL:
if (empty($value)) {
return Piwik::translate('General_No');
}
return Piwik::translate('General_Yes');
... | [
"public",
"function",
"formatValue",
"(",
"$",
"value",
",",
"$",
"idSite",
",",
"Formatter",
"$",
"formatter",
")",
"{",
"switch",
"(",
"$",
"this",
"->",
"type",
")",
"{",
"case",
"Dimension",
"::",
"TYPE_BOOL",
":",
"if",
"(",
"empty",
"(",
"$",
"... | Formats the dimension value. By default, the dimension is formatted based on the set dimension type.
@param mixed $value
@param int $idSite
@param Formatter $formatter
@return mixed
@api since Piwik 3.2.0 | [
"Formats",
"the",
"dimension",
"value",
".",
"By",
"default",
"the",
"dimension",
"is",
"formatted",
"based",
"on",
"the",
"set",
"dimension",
"type",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Columns/Dimension.php#L427-L459 | train | Format Dimension Value | [
30522,
2270,
3853,
4289,
10175,
5657,
1006,
1002,
3643,
1010,
1002,
8909,
28032,
2063,
1010,
4289,
3334,
1002,
4289,
3334,
1007,
1063,
6942,
1006,
1002,
2023,
1011,
1028,
2828,
1007,
1063,
2553,
9812,
1024,
1024,
2828,
1035,
22017,
2140,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/ValidatorBuilder.php | ValidatorBuilder.setMetadataCache | public function setMetadataCache(CacheInterface $cache)
{
if (null !== $this->metadataFactory) {
throw new ValidatorException('You cannot set a custom metadata cache after setting a custom metadata factory. Configure your metadata factory instead.');
}
$this->metadataCache = $ca... | php | public function setMetadataCache(CacheInterface $cache)
{
if (null !== $this->metadataFactory) {
throw new ValidatorException('You cannot set a custom metadata cache after setting a custom metadata factory. Configure your metadata factory instead.');
}
$this->metadataCache = $ca... | [
"public",
"function",
"setMetadataCache",
"(",
"CacheInterface",
"$",
"cache",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"metadataFactory",
")",
"{",
"throw",
"new",
"ValidatorException",
"(",
"'You cannot set a custom metadata cache after setting a custom ... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Validator/ValidatorBuilder.php#L235-L244 | train | Set the custom metadata cache | [
30522,
2270,
3853,
2275,
11368,
8447,
2696,
3540,
5403,
1006,
17053,
18447,
2121,
12172,
1002,
17053,
1007,
1063,
2065,
1006,
19701,
999,
1027,
1027,
1002,
2023,
1011,
1028,
27425,
21450,
1007,
1063,
5466,
2047,
9398,
8844,
10288,
24422,
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/Pdo/Abstract.php | Zend_Db_Adapter_Pdo_Abstract.setFetchMode | public function setFetchMode($mode)
{
//check for PDO extension
if (!extension_loaded('pdo')) {
/**
* @see Zend_Db_Adapter_Exception
*/
// require_once 'Zend/Db/Adapter/Exception.php';
throw new Zend_Db_Adapter_Exception('The PDO extensio... | php | public function setFetchMode($mode)
{
//check for PDO extension
if (!extension_loaded('pdo')) {
/**
* @see Zend_Db_Adapter_Exception
*/
// require_once 'Zend/Db/Adapter/Exception.php';
throw new Zend_Db_Adapter_Exception('The PDO extensio... | [
"public",
"function",
"setFetchMode",
"(",
"$",
"mode",
")",
"{",
"//check for PDO extension",
"if",
"(",
"!",
"extension_loaded",
"(",
"'pdo'",
")",
")",
"{",
"/**\n * @see Zend_Db_Adapter_Exception\n */",
"// require_once 'Zend/Db/Adapter/Exception.php... | Set the PDO fetch mode.
@todo Support FETCH_CLASS and FETCH_INTO.
@param int $mode A PDO fetch mode.
@return void
@throws Zend_Db_Adapter_Exception | [
"Set",
"the",
"PDO",
"fetch",
"mode",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Adapter/Pdo/Abstract.php#L334-L361 | train | Set the fetch mode | [
30522,
2270,
3853,
2275,
7959,
10649,
5302,
3207,
1006,
1002,
5549,
1007,
1063,
1013,
1013,
4638,
2005,
22851,
2080,
5331,
2065,
1006,
999,
5331,
1035,
8209,
1006,
1005,
22851,
2080,
1005,
1007,
1007,
1063,
1013,
1008,
1008,
1008,
1030,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/DataTable/Map.php | Map.copyRowsAndSetLabel | private function copyRowsAndSetLabel($toTable, $fromTable, $label)
{
foreach ($fromTable->getRows() as $fromRow) {
$oldColumns = $fromRow->getColumns();
unset($oldColumns['label']);
$columns = array_merge(array('label' => $label), $oldColumns);
$row = new Row... | php | private function copyRowsAndSetLabel($toTable, $fromTable, $label)
{
foreach ($fromTable->getRows() as $fromRow) {
$oldColumns = $fromRow->getColumns();
unset($oldColumns['label']);
$columns = array_merge(array('label' => $label), $oldColumns);
$row = new Row... | [
"private",
"function",
"copyRowsAndSetLabel",
"(",
"$",
"toTable",
",",
"$",
"fromTable",
",",
"$",
"label",
")",
"{",
"foreach",
"(",
"$",
"fromTable",
"->",
"getRows",
"(",
")",
"as",
"$",
"fromRow",
")",
"{",
"$",
"oldColumns",
"=",
"$",
"fromRow",
... | Utility function used by mergeChildren. Copies the rows from one table,
sets their 'label' columns to a value and adds them to another table.
@param DataTable $toTable The table to copy rows to.
@param DataTable $fromTable The table to copy rows from.
@param string $label The value to set the 'label' column of every c... | [
"Utility",
"function",
"used",
"by",
"mergeChildren",
".",
"Copies",
"the",
"rows",
"from",
"one",
"table",
"sets",
"their",
"label",
"columns",
"to",
"a",
"value",
"and",
"adds",
"them",
"to",
"another",
"table",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable/Map.php#L435-L449 | train | Copy rows and set label to table | [
30522,
2797,
3853,
6100,
10524,
8791,
5104,
3388,
20470,
2884,
1006,
1002,
2000,
10880,
1010,
1002,
2013,
10880,
1010,
1002,
3830,
1007,
1063,
18921,
6776,
1006,
1002,
2013,
10880,
1011,
1028,
2131,
10524,
2015,
1006,
1007,
2004,
1002,
2013... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/HTML/QuickForm2/Renderer/Array.php | HTML_QuickForm2_Renderer_Array.pushContainer | public function pushContainer(array $container)
{
if (!empty($container['required'])) {
$this->hasRequired = true;
}
if (empty($this->containers)) {
$this->array += $container;
$this->containers = array(&$this->array['elements']);
} else {
... | php | public function pushContainer(array $container)
{
if (!empty($container['required'])) {
$this->hasRequired = true;
}
if (empty($this->containers)) {
$this->array += $container;
$this->containers = array(&$this->array['elements']);
} else {
... | [
"public",
"function",
"pushContainer",
"(",
"array",
"$",
"container",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"container",
"[",
"'required'",
"]",
")",
")",
"{",
"$",
"this",
"->",
"hasRequired",
"=",
"true",
";",
"}",
"if",
"(",
"empty",
"(",
... | Stores an array representing a Container in the form array
@param array | [
"Stores",
"an",
"array",
"representing",
"a",
"Container",
"in",
"the",
"form",
"array"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Renderer/Array.php#L264-L278 | train | Pushes an array to the end of the array | [
30522,
2270,
3853,
5245,
8663,
18249,
2121,
1006,
9140,
1002,
11661,
1007,
1063,
2065,
1006,
999,
4064,
1006,
1002,
11661,
1031,
1005,
3223,
1005,
1033,
1007,
1007,
1063,
1002,
2023,
1011,
1028,
2038,
2890,
15549,
5596,
1027,
2995,
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... |
octobercms/october | modules/system/console/ThemeInstall.php | ThemeInstall.handle | public function handle()
{
$themeName = $this->argument('name');
$argDirName = $this->argument('dirName');
if ($argDirName && $themeName == $argDirName) {
$argDirName = null;
}
if ($argDirName) {
if (!preg_match('/^[a-z0-9\_\-]+$/i', $argDirName)) {
... | php | public function handle()
{
$themeName = $this->argument('name');
$argDirName = $this->argument('dirName');
if ($argDirName && $themeName == $argDirName) {
$argDirName = null;
}
if ($argDirName) {
if (!preg_match('/^[a-z0-9\_\-]+$/i', $argDirName)) {
... | [
"public",
"function",
"handle",
"(",
")",
"{",
"$",
"themeName",
"=",
"$",
"this",
"->",
"argument",
"(",
"'name'",
")",
";",
"$",
"argDirName",
"=",
"$",
"this",
"->",
"argument",
"(",
"'dirName'",
")",
";",
"if",
"(",
"$",
"argDirName",
"&&",
"$",
... | Execute the console command.
@return void | [
"Execute",
"the",
"console",
"command",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/console/ThemeInstall.php#L37-L113 | train | Handle theme request | [
30522,
2270,
3853,
5047,
1006,
1007,
1063,
1002,
4323,
18442,
1027,
1002,
2023,
1011,
1028,
6685,
1006,
1005,
2171,
1005,
1007,
1025,
1002,
12098,
2290,
4305,
12789,
4168,
1027,
1002,
2023,
1011,
1028,
6685,
1006,
1005,
16101,
18442,
1005,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/backend/controllers/Files.php | Files.get | public function get($code = null)
{
try {
return $this->findFileObject($code)->output('inline', true);
}
catch (Exception $ex) {}
return Response::make(View::make('backend::404'), 404);
} | php | public function get($code = null)
{
try {
return $this->findFileObject($code)->output('inline', true);
}
catch (Exception $ex) {}
return Response::make(View::make('backend::404'), 404);
} | [
"public",
"function",
"get",
"(",
"$",
"code",
"=",
"null",
")",
"{",
"try",
"{",
"return",
"$",
"this",
"->",
"findFileObject",
"(",
"$",
"code",
")",
"->",
"output",
"(",
"'inline'",
",",
"true",
")",
";",
"}",
"catch",
"(",
"Exception",
"$",
"ex... | Output file, or fall back on the 404 page | [
"Output",
"file",
"or",
"fall",
"back",
"on",
"the",
"404",
"page"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/controllers/Files.php#L26-L34 | train | Get the content of a code | [
30522,
2270,
3853,
2131,
1006,
1002,
3642,
1027,
19701,
1007,
1063,
3046,
1063,
2709,
1002,
2023,
1011,
1028,
2424,
8873,
2571,
16429,
20614,
1006,
1002,
3642,
1007,
1011,
1028,
6434,
1006,
1005,
23881,
1005,
1010,
2995,
1007,
1025,
1065,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
overtrue/wechat | src/OfficialAccount/Broadcasting/Client.php | Client.previewCard | public function previewCard(string $cardId, $reception, $method = self::PREVIEW_BY_OPENID)
{
return $this->previewMessage(new Card($cardId), $reception, $method);
} | php | public function previewCard(string $cardId, $reception, $method = self::PREVIEW_BY_OPENID)
{
return $this->previewMessage(new Card($cardId), $reception, $method);
} | [
"public",
"function",
"previewCard",
"(",
"string",
"$",
"cardId",
",",
"$",
"reception",
",",
"$",
"method",
"=",
"self",
"::",
"PREVIEW_BY_OPENID",
")",
"{",
"return",
"$",
"this",
"->",
"previewMessage",
"(",
"new",
"Card",
"(",
"$",
"cardId",
")",
",... | Preview a card message.
@param mixed $cardId message
@param string $reception
@param string $method
@return \Psr\Http\Message\ResponseInterface|\EasyWeChat\Kernel\Support\Collection|array|object|string
@throws \EasyWeChat\Kernel\Exceptions\RuntimeException
@throws \EasyWeChat\Kernel\Exceptions\InvalidConfigExcep... | [
"Preview",
"a",
"card",
"message",
"."
] | 120c72faaa93c270365bc75c73c362d5fd583209 | https://github.com/overtrue/wechat/blob/120c72faaa93c270365bc75c73c362d5fd583209/src/OfficialAccount/Broadcasting/Client.php#L316-L319 | train | Preview a card | [
30522,
2270,
3853,
19236,
11522,
1006,
5164,
1002,
4003,
3593,
1010,
1002,
7684,
1010,
1002,
4118,
1027,
2969,
1024,
1024,
19236,
1035,
2011,
1035,
2330,
3593,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
19236,
7834,
3736,
3351,
1006,
2047,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Common/Data/Data.php | Data.joinDefaults | public function joinDefaults($name, $value, $separator = '.')
{
if (\is_object($value)) {
$value = (array) $value;
}
$old = $this->get($name, null, $separator);
if ($old !== null) {
$value = $this->blueprints()->mergeData($value, $old, $name, $separator);
... | php | public function joinDefaults($name, $value, $separator = '.')
{
if (\is_object($value)) {
$value = (array) $value;
}
$old = $this->get($name, null, $separator);
if ($old !== null) {
$value = $this->blueprints()->mergeData($value, $old, $name, $separator);
... | [
"public",
"function",
"joinDefaults",
"(",
"$",
"name",
",",
"$",
"value",
",",
"$",
"separator",
"=",
"'.'",
")",
"{",
"if",
"(",
"\\",
"is_object",
"(",
"$",
"value",
")",
")",
"{",
"$",
"value",
"=",
"(",
"array",
")",
"$",
"value",
";",
"}",
... | Set default values by using blueprints.
@param string $name Dot separated path to the requested value.
@param mixed $value Value to be joined.
@param string $separator Separator, defaults to '.'
@return $this | [
"Set",
"default",
"values",
"by",
"using",
"blueprints",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Data/Data.php#L111-L125 | train | Join default values with a separator | [
30522,
2270,
3853,
3693,
3207,
7011,
11314,
2015,
1006,
1002,
2171,
1010,
1002,
3643,
1010,
1002,
19802,
25879,
2953,
1027,
1005,
1012,
1005,
1007,
1063,
2065,
1006,
1032,
2003,
1035,
4874,
1006,
1002,
3643,
1007,
1007,
1063,
1002,
3643,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Renderer.php | Renderer.render | public function render(Frame $frame)
{
global $_dompdf_debug;
$this->_check_callbacks("begin_frame", $frame);
if ($_dompdf_debug) {
echo $frame;
flush();
}
$style = $frame->get_style();
if (in_array($style->visibility, array("hidden", "coll... | php | public function render(Frame $frame)
{
global $_dompdf_debug;
$this->_check_callbacks("begin_frame", $frame);
if ($_dompdf_debug) {
echo $frame;
flush();
}
$style = $frame->get_style();
if (in_array($style->visibility, array("hidden", "coll... | [
"public",
"function",
"render",
"(",
"Frame",
"$",
"frame",
")",
"{",
"global",
"$",
"_dompdf_debug",
";",
"$",
"this",
"->",
"_check_callbacks",
"(",
"\"begin_frame\"",
",",
"$",
"frame",
")",
";",
"if",
"(",
"$",
"_dompdf_debug",
")",
"{",
"echo",
"$",... | Render frames recursively
@param Frame $frame the frame to render | [
"Render",
"frames",
"recursively"
] | 75f13c700009be21a1965dc2c5b68a8708c22ba2 | https://github.com/dompdf/dompdf/blob/75f13c700009be21a1965dc2c5b68a8708c22ba2/src/Renderer.php#L55-L209 | train | Renders the frame | [
30522,
2270,
3853,
17552,
1006,
4853,
1002,
4853,
1007,
1063,
3795,
1002,
1035,
14383,
17299,
2546,
1035,
2139,
8569,
2290,
1025,
1002,
2023,
1011,
1028,
1035,
4638,
1035,
2655,
12221,
1006,
1000,
4088,
1035,
4853,
1000,
1010,
1002,
4853,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/backend/classes/WidgetBase.php | WidgetBase.bindToController | public function bindToController()
{
if ($this->controller->widget === null) {
$this->controller->widget = new stdClass;
}
$this->controller->widget->{$this->alias} = $this;
} | php | public function bindToController()
{
if ($this->controller->widget === null) {
$this->controller->widget = new stdClass;
}
$this->controller->widget->{$this->alias} = $this;
} | [
"public",
"function",
"bindToController",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"controller",
"->",
"widget",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"controller",
"->",
"widget",
"=",
"new",
"stdClass",
";",
"}",
"$",
"this",
"->",
"control... | Binds a widget to the controller for safe use.
@return void | [
"Binds",
"a",
"widget",
"to",
"the",
"controller",
"for",
"safe",
"use",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/WidgetBase.php#L113-L120 | train | Binds the widget to the controller | [
30522,
2270,
3853,
14187,
3406,
8663,
13181,
10820,
1006,
1007,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
11486,
1011,
1028,
15536,
24291,
1027,
1027,
1027,
19701,
1007,
1063,
1002,
2023,
1011,
1028,
11486,
1011,
1028,
15536,
24291,
1027,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/LanguagesManager/API.php | API.uses12HourClockForUser | public function uses12HourClockForUser($login)
{
if ($login == 'anonymous') {
return false;
}
Piwik::checkUserHasSuperUserAccessOrIsTheUser($login);
$lang = $this->getModel()->uses12HourClock($login);
return $lang;
} | php | public function uses12HourClockForUser($login)
{
if ($login == 'anonymous') {
return false;
}
Piwik::checkUserHasSuperUserAccessOrIsTheUser($login);
$lang = $this->getModel()->uses12HourClock($login);
return $lang;
} | [
"public",
"function",
"uses12HourClockForUser",
"(",
"$",
"login",
")",
"{",
"if",
"(",
"$",
"login",
"==",
"'anonymous'",
")",
"{",
"return",
"false",
";",
"}",
"Piwik",
"::",
"checkUserHasSuperUserAccessOrIsTheUser",
"(",
"$",
"login",
")",
";",
"$",
"lang... | Returns whether the user uses 12 hour clock
@param string $login
@return string | [
"Returns",
"whether",
"the",
"user",
"uses",
"12",
"hour",
"clock"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/LanguagesManager/API.php#L318-L329 | train | Returns true if the user uses 12h time clock for the current language | [
30522,
2270,
3853,
3594,
12521,
6806,
3126,
20464,
7432,
29278,
20330,
1006,
1002,
8833,
2378,
1007,
1063,
2065,
1006,
1002,
8833,
2378,
1027,
1027,
1005,
10812,
1005,
1007,
1063,
2709,
6270,
1025,
1065,
14255,
9148,
2243,
1024,
1024,
4638,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
PHPMailer/PHPMailer | src/PHPMailer.php | PHPMailer.smtpClose | public function smtpClose()
{
if (null !== $this->smtp) {
if ($this->smtp->connected()) {
$this->smtp->quit();
$this->smtp->close();
}
}
} | php | public function smtpClose()
{
if (null !== $this->smtp) {
if ($this->smtp->connected()) {
$this->smtp->quit();
$this->smtp->close();
}
}
} | [
"public",
"function",
"smtpClose",
"(",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"smtp",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"smtp",
"->",
"connected",
"(",
")",
")",
"{",
"$",
"this",
"->",
"smtp",
"->",
"quit",
"(",
")",
";"... | Close the active SMTP session if one exists. | [
"Close",
"the",
"active",
"SMTP",
"session",
"if",
"one",
"exists",
"."
] | 3d7132341659a8a201adbc3ba11b1e202ee2857c | https://github.com/PHPMailer/PHPMailer/blob/3d7132341659a8a201adbc3ba11b1e202ee2857c/src/PHPMailer.php#L2009-L2017 | train | Close SMTP connection | [
30522,
2270,
3853,
15488,
25856,
20464,
9232,
1006,
1007,
1063,
2065,
1006,
19701,
999,
1027,
1027,
1002,
2023,
1011,
1028,
15488,
25856,
1007,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
15488,
25856,
1011,
1028,
4198,
1006,
1007,
1007,
1063... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Database/Eloquent/Concerns/HidesAttributes.php | HidesAttributes.makeHidden | public function makeHidden($attributes)
{
$attributes = (array) $attributes;
$this->visible = array_diff($this->visible, $attributes);
$this->hidden = array_unique(array_merge($this->hidden, $attributes));
return $this;
} | php | public function makeHidden($attributes)
{
$attributes = (array) $attributes;
$this->visible = array_diff($this->visible, $attributes);
$this->hidden = array_unique(array_merge($this->hidden, $attributes));
return $this;
} | [
"public",
"function",
"makeHidden",
"(",
"$",
"attributes",
")",
"{",
"$",
"attributes",
"=",
"(",
"array",
")",
"$",
"attributes",
";",
"$",
"this",
"->",
"visible",
"=",
"array_diff",
"(",
"$",
"this",
"->",
"visible",
",",
"$",
"attributes",
")",
";... | Make the given, typically visible, attributes hidden.
@param array|string $attributes
@return $this | [
"Make",
"the",
"given",
"typically",
"visible",
"attributes",
"hidden",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Concerns/HidesAttributes.php#L116-L125 | train | Make the attributes hidden | [
30522,
2270,
3853,
2191,
27511,
4181,
1006,
1002,
12332,
1007,
1063,
1002,
12332,
1027,
1006,
9140,
1007,
1002,
12332,
1025,
1002,
2023,
1011,
1028,
5710,
1027,
9140,
1035,
4487,
4246,
1006,
1002,
2023,
1011,
1028,
5710,
1010,
1002,
12332,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/VarDumper/Dumper/HtmlDumper.php | HtmlDumper.setStyles | public function setStyles(array $styles)
{
$this->headerIsDumped = false;
$this->styles = $styles + $this->styles;
} | php | public function setStyles(array $styles)
{
$this->headerIsDumped = false;
$this->styles = $styles + $this->styles;
} | [
"public",
"function",
"setStyles",
"(",
"array",
"$",
"styles",
")",
"{",
"$",
"this",
"->",
"headerIsDumped",
"=",
"false",
";",
"$",
"this",
"->",
"styles",
"=",
"$",
"styles",
"+",
"$",
"this",
"->",
"styles",
";",
"}"
] | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/VarDumper/Dumper/HtmlDumper.php#L91-L95 | train | Set the styles of the page | [
30522,
2270,
3853,
4520,
27983,
2015,
1006,
9140,
1002,
6782,
1007,
1063,
1002,
2023,
1011,
1028,
20346,
2483,
8566,
8737,
2098,
1027,
6270,
1025,
1002,
2023,
1011,
1028,
6782,
1027,
1002,
6782,
1009,
1002,
2023,
1011,
1028,
6782,
1025,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Routing/UrlGenerator.php | UrlGenerator.routeUrl | protected function routeUrl()
{
if (! $this->routeGenerator) {
$this->routeGenerator = new RouteUrlGenerator($this, $this->request);
}
return $this->routeGenerator;
} | php | protected function routeUrl()
{
if (! $this->routeGenerator) {
$this->routeGenerator = new RouteUrlGenerator($this, $this->request);
}
return $this->routeGenerator;
} | [
"protected",
"function",
"routeUrl",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"routeGenerator",
")",
"{",
"$",
"this",
"->",
"routeGenerator",
"=",
"new",
"RouteUrlGenerator",
"(",
"$",
"this",
",",
"$",
"this",
"->",
"request",
")",
";",
"}",... | Get the Route URL generator instance.
@return \Illuminate\Routing\RouteUrlGenerator | [
"Get",
"the",
"Route",
"URL",
"generator",
"instance",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/UrlGenerator.php#L548-L555 | train | Get Route Url Generator | [
30522,
5123,
3853,
2799,
3126,
2140,
1006,
1007,
1063,
2065,
1006,
999,
1002,
2023,
1011,
1028,
2799,
6914,
6906,
4263,
1007,
1063,
1002,
2023,
1011,
1028,
2799,
6914,
6906,
4263,
1027,
2047,
2799,
3126,
28875,
3678,
8844,
1006,
1002,
202... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.