repo stringclasses 21
values | path stringlengths 10 100 | func_name stringlengths 6 71 | original_string stringlengths 115 97k | language stringclasses 1
value | code stringlengths 115 97k | code_tokens listlengths 27 7.5k | docstring stringlengths 6 1.88k | docstring_tokens listlengths 1 177 | sha stringclasses 21
values | url stringlengths 100 189 | partition stringclasses 1
value | summary stringlengths 9 340 | input_ids listlengths 502 502 | token_type_ids listlengths 502 502 | attention_mask listlengths 502 502 | labels listlengths 502 502 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
laravel/framework | src/Illuminate/Foundation/Bootstrap/LoadEnvironmentVariables.php | LoadEnvironmentVariables.createDotenv | protected function createDotenv($app)
{
return Dotenv::create(
$app->environmentPath(),
$app->environmentFile(),
new DotenvFactory([new EnvConstAdapter, new ServerConstAdapter, new PutenvAdapter])
);
} | php | protected function createDotenv($app)
{
return Dotenv::create(
$app->environmentPath(),
$app->environmentFile(),
new DotenvFactory([new EnvConstAdapter, new ServerConstAdapter, new PutenvAdapter])
);
} | [
"protected",
"function",
"createDotenv",
"(",
"$",
"app",
")",
"{",
"return",
"Dotenv",
"::",
"create",
"(",
"$",
"app",
"->",
"environmentPath",
"(",
")",
",",
"$",
"app",
"->",
"environmentFile",
"(",
")",
",",
"new",
"DotenvFactory",
"(",
"[",
"new",
... | Create a Dotenv instance.
@param \Illuminate\Contracts\Foundation\Application $app
@return \Dotenv\Dotenv | [
"Create",
"a",
"Dotenv",
"instance",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Foundation/Bootstrap/LoadEnvironmentVariables.php#L87-L94 | train | Create a Dotenv instance | [
30522,
5123,
3853,
2580,
12184,
2078,
2615,
1006,
1002,
10439,
1007,
1063,
2709,
11089,
2368,
2615,
1024,
1024,
3443,
1006,
1002,
10439,
1011,
1028,
4044,
15069,
1006,
1007,
1010,
1002,
10439,
1011,
1028,
4044,
8873,
2571,
1006,
1007,
1010,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
overtrue/wechat | src/Payment/Refund/Client.php | Client.byOutTradeNumber | public function byOutTradeNumber(string $number, string $refundNumber, int $totalFee, int $refundFee, array $optional = [])
{
return $this->refund($refundNumber, $totalFee, $refundFee, array_merge($optional, ['out_trade_no' => $number]));
} | php | public function byOutTradeNumber(string $number, string $refundNumber, int $totalFee, int $refundFee, array $optional = [])
{
return $this->refund($refundNumber, $totalFee, $refundFee, array_merge($optional, ['out_trade_no' => $number]));
} | [
"public",
"function",
"byOutTradeNumber",
"(",
"string",
"$",
"number",
",",
"string",
"$",
"refundNumber",
",",
"int",
"$",
"totalFee",
",",
"int",
"$",
"refundFee",
",",
"array",
"$",
"optional",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
... | Refund by out trade number.
@param string $number
@param string $refundNumber
@param int $totalFee
@param int $refundFee
@param array $optional
@return \Psr\Http\Message\ResponseInterface|\EasyWeChat\Kernel\Support\Collection|array|object|string
@throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException | [
"Refund",
"by",
"out",
"trade",
"number",
"."
] | 120c72faaa93c270365bc75c73c362d5fd583209 | https://github.com/overtrue/wechat/blob/120c72faaa93c270365bc75c73c362d5fd583209/src/Payment/Refund/Client.php#L31-L34 | train | By Out Trade Number | [
30522,
2270,
3853,
2011,
5833,
6494,
4181,
29440,
1006,
5164,
1002,
2193,
1010,
5164,
1002,
25416,
8630,
19172,
5677,
1010,
20014,
1002,
2561,
7959,
2063,
1010,
20014,
1002,
25416,
8630,
7959,
2063,
1010,
9140,
1002,
11887,
1027,
1031,
1033... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/Zend/Cache/Backend/Libmemcached.php | Zend_Cache_Backend_Libmemcached.getFillingPercentage | public function getFillingPercentage()
{
$mems = $this->_memcache->getStats();
if ($mems === false) {
return 0;
}
$memSize = null;
$memUsed = null;
foreach ($mems as $key => $mem) {
if ($mem === false) {
$this->_log('can\'t get... | php | public function getFillingPercentage()
{
$mems = $this->_memcache->getStats();
if ($mems === false) {
return 0;
}
$memSize = null;
$memUsed = null;
foreach ($mems as $key => $mem) {
if ($mem === false) {
$this->_log('can\'t get... | [
"public",
"function",
"getFillingPercentage",
"(",
")",
"{",
"$",
"mems",
"=",
"$",
"this",
"->",
"_memcache",
"->",
"getStats",
"(",
")",
";",
"if",
"(",
"$",
"mems",
"===",
"false",
")",
"{",
"return",
"0",
";",
"}",
"$",
"memSize",
"=",
"null",
... | 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/Libmemcached.php#L366-L396 | train | Get filling percentage | [
30522,
2270,
3853,
2131,
8873,
13112,
4842,
13013,
4270,
1006,
1007,
1063,
1002,
2033,
5244,
1027,
1002,
2023,
1011,
1028,
1035,
2033,
12458,
15395,
1011,
1028,
4152,
29336,
2015,
1006,
1007,
1025,
2065,
1006,
1002,
2033,
5244,
1027,
1027,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
barryvdh/laravel-debugbar | src/DataCollector/QueryCollector.php | QueryCollector.findMiddlewareFromFile | protected function findMiddlewareFromFile($file)
{
$filename = pathinfo($file, PATHINFO_FILENAME);
foreach ($this->middleware as $alias => $class) {
if (strpos($class, $filename) !== false) {
return $alias;
}
}
} | php | protected function findMiddlewareFromFile($file)
{
$filename = pathinfo($file, PATHINFO_FILENAME);
foreach ($this->middleware as $alias => $class) {
if (strpos($class, $filename) !== false) {
return $alias;
}
}
} | [
"protected",
"function",
"findMiddlewareFromFile",
"(",
"$",
"file",
")",
"{",
"$",
"filename",
"=",
"pathinfo",
"(",
"$",
"file",
",",
"PATHINFO_FILENAME",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"middleware",
"as",
"$",
"alias",
"=>",
"$",
"class",
... | Find the middleware alias from the file.
@param string $file
@return string|null | [
"Find",
"the",
"middleware",
"alias",
"from",
"the",
"file",
"."
] | 2d195779ea4f809f69764a795e2ec371dbb76a96 | https://github.com/barryvdh/laravel-debugbar/blob/2d195779ea4f809f69764a795e2ec371dbb76a96/src/DataCollector/QueryCollector.php#L298-L307 | train | Find the middleware from the file | [
30522,
5123,
3853,
2424,
4328,
20338,
8059,
19699,
5358,
8873,
2571,
1006,
1002,
5371,
1007,
1063,
1002,
5371,
18442,
1027,
4130,
2378,
14876,
1006,
1002,
5371,
1010,
4130,
2378,
14876,
1035,
5371,
18442,
1007,
1025,
18921,
6776,
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/Bundle/FrameworkBundle/Routing/AnnotatedRouteControllerLoader.php | AnnotatedRouteControllerLoader.configureRoute | protected function configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, $annot)
{
if ('__invoke' === $method->getName()) {
$route->setDefault('_controller', $class->getName());
} else {
$route->setDefault('_controller', $class->getName().'::'.$meth... | php | protected function configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, $annot)
{
if ('__invoke' === $method->getName()) {
$route->setDefault('_controller', $class->getName());
} else {
$route->setDefault('_controller', $class->getName().'::'.$meth... | [
"protected",
"function",
"configureRoute",
"(",
"Route",
"$",
"route",
",",
"\\",
"ReflectionClass",
"$",
"class",
",",
"\\",
"ReflectionMethod",
"$",
"method",
",",
"$",
"annot",
")",
"{",
"if",
"(",
"'__invoke'",
"===",
"$",
"method",
"->",
"getName",
"(... | Configures the _controller default parameter of a given Route instance.
@param mixed $annot The annotation class instance | [
"Configures",
"the",
"_controller",
"default",
"parameter",
"of",
"a",
"given",
"Route",
"instance",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bundle/FrameworkBundle/Routing/AnnotatedRouteControllerLoader.php#L30-L37 | train | Configure route with default values | [
30522,
5123,
3853,
9530,
8873,
27390,
10624,
10421,
1006,
2799,
1002,
2799,
1010,
1032,
9185,
26266,
1002,
2465,
1010,
1032,
9185,
11368,
6806,
2094,
1002,
4118,
1010,
1002,
5754,
4140,
1007,
1063,
2065,
1006,
1005,
1035,
1035,
1999,
6767,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
guzzle/guzzle | src/Handler/CurlFactory.php | CurlFactory.removeHeader | private function removeHeader($name, array &$options)
{
foreach (array_keys($options['_headers']) as $key) {
if (!strcasecmp($key, $name)) {
unset($options['_headers'][$key]);
return;
}
}
} | php | private function removeHeader($name, array &$options)
{
foreach (array_keys($options['_headers']) as $key) {
if (!strcasecmp($key, $name)) {
unset($options['_headers'][$key]);
return;
}
}
} | [
"private",
"function",
"removeHeader",
"(",
"$",
"name",
",",
"array",
"&",
"$",
"options",
")",
"{",
"foreach",
"(",
"array_keys",
"(",
"$",
"options",
"[",
"'_headers'",
"]",
")",
"as",
"$",
"key",
")",
"{",
"if",
"(",
"!",
"strcasecmp",
"(",
"$",
... | Remove a header from the options array.
@param string $name Case-insensitive header to remove
@param array $options Array of options to modify | [
"Remove",
"a",
"header",
"from",
"the",
"options",
"array",
"."
] | bf595424e4d442a190582e088985dc835a789071 | https://github.com/guzzle/guzzle/blob/bf595424e4d442a190582e088985dc835a789071/src/Handler/CurlFactory.php#L328-L336 | train | Remove header from header array | [
30522,
2797,
3853,
6366,
4974,
2121,
1006,
1002,
2171,
1010,
9140,
1004,
1002,
7047,
1007,
1063,
18921,
6776,
1006,
9140,
1035,
6309,
1006,
1002,
7047,
1031,
1005,
1035,
20346,
2015,
1005,
1033,
1007,
2004,
1002,
3145,
1007,
1063,
2065,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/Zend/Cache/Backend.php | Zend_Cache_Backend.setOption | public function setOption($name, $value)
{
if (!is_string($name)) {
Zend_Cache::throwException("Incorrect option name : $name");
}
$name = strtolower($name);
if (array_key_exists($name, $this->_options)) {
$this->_options[$name] = $value;
}
} | php | public function setOption($name, $value)
{
if (!is_string($name)) {
Zend_Cache::throwException("Incorrect option name : $name");
}
$name = strtolower($name);
if (array_key_exists($name, $this->_options)) {
$this->_options[$name] = $value;
}
} | [
"public",
"function",
"setOption",
"(",
"$",
"name",
",",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"name",
")",
")",
"{",
"Zend_Cache",
"::",
"throwException",
"(",
"\"Incorrect option name : $name\"",
")",
";",
"}",
"$",
"name",
"=... | Set an option
@param string $name
@param mixed $value
@throws Zend_Cache_Exception
@return void | [
"Set",
"an",
"option"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache/Backend.php#L103-L112 | train | Set an option value | [
30522,
2270,
3853,
2275,
7361,
3508,
1006,
1002,
2171,
1010,
1002,
3643,
1007,
1063,
2065,
1006,
999,
2003,
1035,
5164,
1006,
1002,
2171,
1007,
1007,
1063,
16729,
2094,
1035,
17053,
1024,
1024,
5466,
10288,
24422,
1006,
1000,
16542,
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... |
getgrav/grav | system/src/Grav/Common/Helpers/LogViewer.php | LogViewer.parseTrace | public static function parseTrace($trace, $rows = 10)
{
$lines = array_filter(preg_split('/#\d*/m', $trace));
return array_slice($lines, 0, $rows);
} | php | public static function parseTrace($trace, $rows = 10)
{
$lines = array_filter(preg_split('/#\d*/m', $trace));
return array_slice($lines, 0, $rows);
} | [
"public",
"static",
"function",
"parseTrace",
"(",
"$",
"trace",
",",
"$",
"rows",
"=",
"10",
")",
"{",
"$",
"lines",
"=",
"array_filter",
"(",
"preg_split",
"(",
"'/#\\d*/m'",
",",
"$",
"trace",
")",
")",
";",
"return",
"array_slice",
"(",
"$",
"lines... | Parse text of trace into an array of lines
@param string $trace
@param int $rows
@return array | [
"Parse",
"text",
"of",
"trace",
"into",
"an",
"array",
"of",
"lines"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Helpers/LogViewer.php#L143-L147 | train | Parse the trace into an array of terms | [
30522,
2270,
10763,
3853,
11968,
13462,
22903,
1006,
1002,
7637,
1010,
1002,
10281,
1027,
2184,
1007,
1063,
1002,
3210,
1027,
9140,
1035,
11307,
1006,
3653,
2290,
1035,
3975,
1006,
1005,
1013,
1001,
1032,
1040,
1008,
1013,
1049,
1005,
1010,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Routing/RoutingServiceProvider.php | RoutingServiceProvider.registerPsrRequest | protected function registerPsrRequest()
{
$this->app->bind(ServerRequestInterface::class, function ($app) {
return (new DiactorosFactory)->createRequest($app->make('request'));
});
} | php | protected function registerPsrRequest()
{
$this->app->bind(ServerRequestInterface::class, function ($app) {
return (new DiactorosFactory)->createRequest($app->make('request'));
});
} | [
"protected",
"function",
"registerPsrRequest",
"(",
")",
"{",
"$",
"this",
"->",
"app",
"->",
"bind",
"(",
"ServerRequestInterface",
"::",
"class",
",",
"function",
"(",
"$",
"app",
")",
"{",
"return",
"(",
"new",
"DiactorosFactory",
")",
"->",
"createReques... | Register a binding for the PSR-7 request implementation.
@return void | [
"Register",
"a",
"binding",
"for",
"the",
"PSR",
"-",
"7",
"request",
"implementation",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/RoutingServiceProvider.php#L125-L130 | train | Register the PSR - 7 request. | [
30522,
5123,
3853,
4236,
4523,
14343,
15500,
1006,
1007,
1063,
1002,
2023,
1011,
1028,
10439,
1011,
1028,
14187,
1006,
8241,
2890,
15500,
18447,
2121,
12172,
1024,
1024,
2465,
1010,
3853,
1006,
1002,
10439,
30524,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.aggregateRowWithLabel | protected function aggregateRowWithLabel(Row $row, $columnAggregationOps)
{
$labelToLookFor = $row->getColumn('label');
if ($labelToLookFor === false) {
throw new Exception("Label column not found in the table to add in addDataTable()");
}
$rowFound = $this->getRowFromLab... | php | protected function aggregateRowWithLabel(Row $row, $columnAggregationOps)
{
$labelToLookFor = $row->getColumn('label');
if ($labelToLookFor === false) {
throw new Exception("Label column not found in the table to add in addDataTable()");
}
$rowFound = $this->getRowFromLab... | [
"protected",
"function",
"aggregateRowWithLabel",
"(",
"Row",
"$",
"row",
",",
"$",
"columnAggregationOps",
")",
"{",
"$",
"labelToLookFor",
"=",
"$",
"row",
"->",
"getColumn",
"(",
"'label'",
")",
";",
"if",
"(",
"$",
"labelToLookFor",
"===",
"false",
")",
... | Aggregates the $row columns to this table.
$row must have a column "label". The $row will be summed to this table's row with the same label.
@param $row
@params null|array $columnAggregationOps
@throws \Exception | [
"Aggregates",
"the",
"$row",
"columns",
"to",
"this",
"table",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable.php#L1848-L1874 | train | Aggregate the row with the label | [
30522,
5123,
3853,
9572,
10524,
24415,
20470,
2884,
1006,
5216,
1002,
5216,
1010,
1002,
5930,
8490,
17603,
12540,
11923,
1007,
1063,
1002,
3830,
3406,
4135,
6559,
29278,
1027,
1002,
5216,
1011,
1028,
2131,
25778,
2819,
2078,
1006,
1005,
383... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Database/Schema/Grammars/SQLiteGrammar.php | SQLiteGrammar.compileRenameIndex | public function compileRenameIndex(Blueprint $blueprint, Fluent $command, Connection $connection)
{
$schemaManager = $connection->getDoctrineSchemaManager();
$indexes = $schemaManager->listTableIndexes($this->getTablePrefix().$blueprint->getTable());
$index = Arr::get($indexes, $command->f... | php | public function compileRenameIndex(Blueprint $blueprint, Fluent $command, Connection $connection)
{
$schemaManager = $connection->getDoctrineSchemaManager();
$indexes = $schemaManager->listTableIndexes($this->getTablePrefix().$blueprint->getTable());
$index = Arr::get($indexes, $command->f... | [
"public",
"function",
"compileRenameIndex",
"(",
"Blueprint",
"$",
"blueprint",
",",
"Fluent",
"$",
"command",
",",
"Connection",
"$",
"connection",
")",
"{",
"$",
"schemaManager",
"=",
"$",
"connection",
"->",
"getDoctrineSchemaManager",
"(",
")",
";",
"$",
"... | Compile a rename index command.
@param \Illuminate\Database\Schema\Blueprint $blueprint
@param \Illuminate\Support\Fluent $command
@param \Illuminate\Database\Connection $connection
@return array | [
"Compile",
"a",
"rename",
"index",
"command",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Schema/Grammars/SQLiteGrammar.php#L342-L365 | train | Compile rename index command. | [
30522,
2270,
3853,
21624,
8189,
26432,
13629,
2595,
1006,
2630,
16550,
1002,
2630,
16550,
1010,
19376,
1002,
3094,
1010,
4434,
1002,
4434,
1007,
1063,
1002,
8040,
28433,
24805,
4590,
1027,
1002,
4434,
1011,
1028,
2131,
3527,
6593,
11467,
22... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Core.php | Zend_Cache_Core.clean | public function clean($mode = 'all', $tags = array())
{
if (!$this->_options['caching']) {
return true;
}
if (!in_array($mode, array(Zend_Cache::CLEANING_MODE_ALL,
Zend_Cache::CLEANING_MODE_OLD,
Zend_Cache::CLE... | php | public function clean($mode = 'all', $tags = array())
{
if (!$this->_options['caching']) {
return true;
}
if (!in_array($mode, array(Zend_Cache::CLEANING_MODE_ALL,
Zend_Cache::CLEANING_MODE_OLD,
Zend_Cache::CLE... | [
"public",
"function",
"clean",
"(",
"$",
"mode",
"=",
"'all'",
",",
"$",
"tags",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_options",
"[",
"'caching'",
"]",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"!",
"in_a... | Clean cache entries
Available modes are :
'all' (default) => remove all cache entries ($tags is not used)
'old' => remove too old cache entries ($tags is not used)
'matchingTag' => remove cache entries matching all given tags
($tags can be an array of strings or a single string)
'notMatchingTag' => remo... | [
"Clean",
"cache",
"entries"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache/Core.php#L450-L465 | train | Clean cache entries | [
30522,
2270,
3853,
4550,
1006,
1002,
5549,
1027,
1005,
2035,
1005,
1010,
1002,
22073,
1027,
9140,
1006,
1007,
1007,
1063,
2065,
1006,
999,
1002,
2023,
1011,
1028,
1035,
7047,
1031,
1005,
6187,
8450,
1005,
1033,
1007,
1063,
2709,
2995,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/Common.php | Common.convertVisitorIdToBin | public static function convertVisitorIdToBin($id)
{
if (strlen($id) !== Tracker::LENGTH_HEX_ID_STRING
|| @bin2hex(self::hex2bin($id)) != $id
) {
throw new Exception("visitorId is expected to be a " . Tracker::LENGTH_HEX_ID_STRING . " hex char string");
}
retu... | php | public static function convertVisitorIdToBin($id)
{
if (strlen($id) !== Tracker::LENGTH_HEX_ID_STRING
|| @bin2hex(self::hex2bin($id)) != $id
) {
throw new Exception("visitorId is expected to be a " . Tracker::LENGTH_HEX_ID_STRING . " hex char string");
}
retu... | [
"public",
"static",
"function",
"convertVisitorIdToBin",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"strlen",
"(",
"$",
"id",
")",
"!==",
"Tracker",
"::",
"LENGTH_HEX_ID_STRING",
"||",
"@",
"bin2hex",
"(",
"self",
"::",
"hex2bin",
"(",
"$",
"id",
")",
")",
"... | This function will convert the input string to the binary representation of the ID
but it will throw an Exception if the specified input ID is not correct
This is used when building segments containing visitorId which could be an invalid string
therefore throwing Unexpected PHP error [pack(): Type H: illegal hex digit... | [
"This",
"function",
"will",
"convert",
"the",
"input",
"string",
"to",
"the",
"binary",
"representation",
"of",
"the",
"ID",
"but",
"it",
"will",
"throw",
"an",
"Exception",
"if",
"the",
"specified",
"input",
"ID",
"is",
"not",
"correct"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Common.php#L687-L696 | train | Convert the visitor id to a binary string | [
30522,
2270,
10763,
3853,
10463,
11365,
15660,
3593,
3406,
8428,
1006,
1002,
8909,
1007,
1063,
2065,
1006,
2358,
20927,
2078,
1006,
1002,
8909,
1007,
999,
1027,
1027,
27080,
1024,
1024,
3091,
1035,
2002,
2595,
1035,
8909,
1035,
5164,
1064,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Database/Schema/Blueprint.php | Blueprint.indexCommand | protected function indexCommand($type, $columns, $index, $algorithm = null)
{
$columns = (array) $columns;
// If no name was specified for this index, we will create one using a basic
// convention of the table name, followed by the columns, followed by an
// index type, such as pri... | php | protected function indexCommand($type, $columns, $index, $algorithm = null)
{
$columns = (array) $columns;
// If no name was specified for this index, we will create one using a basic
// convention of the table name, followed by the columns, followed by an
// index type, such as pri... | [
"protected",
"function",
"indexCommand",
"(",
"$",
"type",
",",
"$",
"columns",
",",
"$",
"index",
",",
"$",
"algorithm",
"=",
"null",
")",
"{",
"$",
"columns",
"=",
"(",
"array",
")",
"$",
"columns",
";",
"// If no name was specified for this index, we will c... | Add a new index command to the blueprint.
@param string $type
@param string|array $columns
@param string $index
@param string|null $algorithm
@return \Illuminate\Support\Fluent | [
"Add",
"a",
"new",
"index",
"command",
"to",
"the",
"blueprint",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Schema/Blueprint.php#L1246-L1258 | train | Adds an index command to the sequence | [
30522,
5123,
3853,
5950,
9006,
2386,
2094,
1006,
1002,
2828,
1010,
1002,
7753,
1010,
1002,
5950,
1010,
1002,
9896,
1027,
19701,
1007,
1063,
1002,
7753,
1027,
1006,
9140,
1007,
1002,
7753,
1025,
1013,
1013,
2065,
2053,
2171,
2001,
9675,
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... |
getgrav/grav | system/src/Grav/Framework/Filesystem/Filesystem.php | Filesystem.pathinfo | public function pathinfo(string $path, int $options = null)
{
[$scheme, $path] = $this->getSchemeAndHierarchy($path);
if ($this->normalize || ($scheme && null === $this->normalize)) {
$path = $this->normalizePathPart($path);
}
return $this->pathinfoInternal($scheme, $pa... | php | public function pathinfo(string $path, int $options = null)
{
[$scheme, $path] = $this->getSchemeAndHierarchy($path);
if ($this->normalize || ($scheme && null === $this->normalize)) {
$path = $this->normalizePathPart($path);
}
return $this->pathinfoInternal($scheme, $pa... | [
"public",
"function",
"pathinfo",
"(",
"string",
"$",
"path",
",",
"int",
"$",
"options",
"=",
"null",
")",
"{",
"[",
"$",
"scheme",
",",
"$",
"path",
"]",
"=",
"$",
"this",
"->",
"getSchemeAndHierarchy",
"(",
"$",
"path",
")",
";",
"if",
"(",
"$",... | {@inheritdoc}
@see FilesystemInterface::pathinfo() | [
"{"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Framework/Filesystem/Filesystem.php#L153-L162 | train | Returns information about the path | [
30522,
2270,
3853,
4130,
2378,
14876,
1006,
5164,
1002,
4130,
1010,
20014,
1002,
7047,
1027,
19701,
1007,
1063,
1031,
1002,
5679,
1010,
1002,
4130,
1033,
1027,
1002,
2023,
1011,
1028,
4152,
5403,
4168,
5685,
4048,
6906,
29389,
1006,
1002,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/backend/widgets/MediaManager.php | MediaManager.getCropEditImageUrlAndSize | protected function getCropEditImageUrlAndSize($path, $cropSessionKey, $params = null)
{
$sessionDirectoryPath = $this->getCropSessionDirPath($cropSessionKey);
$fullSessionDirectoryPath = temp_path($sessionDirectoryPath);
$sessionDirectoryCreated = false;
if (!File::isDirectory($full... | php | protected function getCropEditImageUrlAndSize($path, $cropSessionKey, $params = null)
{
$sessionDirectoryPath = $this->getCropSessionDirPath($cropSessionKey);
$fullSessionDirectoryPath = temp_path($sessionDirectoryPath);
$sessionDirectoryCreated = false;
if (!File::isDirectory($full... | [
"protected",
"function",
"getCropEditImageUrlAndSize",
"(",
"$",
"path",
",",
"$",
"cropSessionKey",
",",
"$",
"params",
"=",
"null",
")",
"{",
"$",
"sessionDirectoryPath",
"=",
"$",
"this",
"->",
"getCropSessionDirPath",
"(",
"$",
"cropSessionKey",
")",
";",
... | Prepares an image for cropping and returns payload containing a URL
@param string $path
@param string $cropSessionKey
@param array $params
@return array | [
"Prepares",
"an",
"image",
"for",
"cropping",
"and",
"returns",
"payload",
"containing",
"a",
"URL"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/MediaManager.php#L1658-L1734 | train | Returns the URL and dimensions of the crop edit image. | [
30522,
5123,
3853,
2131,
26775,
24174,
25090,
26860,
3126,
8653,
4697,
1006,
1002,
4130,
1010,
1002,
8765,
7971,
3258,
14839,
1010,
1002,
11498,
5244,
1027,
19701,
1007,
1063,
1002,
5219,
4305,
2890,
16761,
22571,
8988,
1027,
1002,
2023,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/Period/Range.php | Range.getDateXPeriodsAgo | public static function getDateXPeriodsAgo($subXPeriods, $date = false, $period = false)
{
if ($date === false) {
$date = Common::getRequestVar('date');
}
if ($period === false) {
$period = Common::getRequestVar('period');
}
if (365 == $subXPeriods &&... | php | public static function getDateXPeriodsAgo($subXPeriods, $date = false, $period = false)
{
if ($date === false) {
$date = Common::getRequestVar('date');
}
if ($period === false) {
$period = Common::getRequestVar('period');
}
if (365 == $subXPeriods &&... | [
"public",
"static",
"function",
"getDateXPeriodsAgo",
"(",
"$",
"subXPeriods",
",",
"$",
"date",
"=",
"false",
",",
"$",
"period",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"date",
"===",
"false",
")",
"{",
"$",
"date",
"=",
"Common",
"::",
"getRequestVa... | Returns the date that is X periods before the supplied date.
@param bool|string $date The date to get the last date of.
@param bool|string $period The period to use (either 'day', 'week', 'month', 'year');
@param int $subXPeriods How many periods in the past the date should be, for instance 1 or 7.
If sub peri... | [
"Returns",
"the",
"date",
"that",
"is",
"X",
"periods",
"before",
"the",
"supplied",
"date",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Period/Range.php#L456-L490 | train | Returns the last X periods and period for a given date and time. | [
30522,
2270,
10763,
3853,
2131,
13701,
2595,
4842,
3695,
5104,
23692,
1006,
1002,
4942,
2595,
4842,
3695,
5104,
1010,
1002,
3058,
1027,
6270,
1010,
1002,
2558,
1027,
6270,
1007,
1063,
2065,
1006,
1002,
3058,
1027,
1027,
1027,
6270,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/Plugin/Manager.php | Manager.loadPlugins | public function loadPlugins(array $pluginsToLoad)
{
$this->resetTransientCache();
$this->pluginsToLoad = $this->makePluginsToLoad($pluginsToLoad);
$this->reloadActivatedPlugins();
} | php | public function loadPlugins(array $pluginsToLoad)
{
$this->resetTransientCache();
$this->pluginsToLoad = $this->makePluginsToLoad($pluginsToLoad);
$this->reloadActivatedPlugins();
} | [
"public",
"function",
"loadPlugins",
"(",
"array",
"$",
"pluginsToLoad",
")",
"{",
"$",
"this",
"->",
"resetTransientCache",
"(",
")",
";",
"$",
"this",
"->",
"pluginsToLoad",
"=",
"$",
"this",
"->",
"makePluginsToLoad",
"(",
"$",
"pluginsToLoad",
")",
";",
... | Load AND activates the specified plugins. It will also overwrite all previously loaded plugins, so it acts
as a setter.
@param array $pluginsToLoad Array of plugins to load. | [
"Load",
"AND",
"activates",
"the",
"specified",
"plugins",
".",
"It",
"will",
"also",
"overwrite",
"all",
"previously",
"loaded",
"plugins",
"so",
"it",
"acts",
"as",
"a",
"setter",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Plugin/Manager.php#L859-L864 | train | Load the list of plugins to load | [
30522,
2270,
3853,
7170,
24759,
15916,
7076,
1006,
9140,
1002,
13354,
7076,
3406,
11066,
1007,
1063,
1002,
2023,
1011,
1028,
25141,
6494,
3619,
11638,
3540,
5403,
1006,
1007,
1025,
1002,
2023,
1011,
1028,
13354,
7076,
3406,
11066,
1027,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
z-song/laravel-admin | src/Form/EmbeddedForm.php | EmbeddedForm.prepare | public function prepare($input)
{
foreach ($input as $key => $record) {
$this->setFieldOriginalValue($key);
$input[$key] = $this->prepareValue($key, $record);
}
return $input;
} | php | public function prepare($input)
{
foreach ($input as $key => $record) {
$this->setFieldOriginalValue($key);
$input[$key] = $this->prepareValue($key, $record);
}
return $input;
} | [
"public",
"function",
"prepare",
"(",
"$",
"input",
")",
"{",
"foreach",
"(",
"$",
"input",
"as",
"$",
"key",
"=>",
"$",
"record",
")",
"{",
"$",
"this",
"->",
"setFieldOriginalValue",
"(",
"$",
"key",
")",
";",
"$",
"input",
"[",
"$",
"key",
"]",
... | Prepare for insert or update.
@param array $input
@return mixed | [
"Prepare",
"for",
"insert",
"or",
"update",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Form/EmbeddedForm.php#L145-L153 | train | Prepare input array for saving to DB | [
30522,
2270,
3853,
7374,
1006,
1002,
7953,
1007,
1063,
18921,
6776,
1006,
1002,
7953,
2004,
1002,
3145,
1027,
1028,
1002,
2501,
1007,
1063,
1002,
2023,
1011,
1028,
2275,
3790,
10050,
24965,
10175,
5657,
1006,
1002,
3145,
1007,
1025,
1002,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/DataTable/Map.php | Map.getMetadataIntersectArray | public function getMetadataIntersectArray($name)
{
$data = array();
foreach ($this->getDataTables() as $childTable) {
$childData = $childTable->getMetadata($name);
if (is_array($childData)) {
$data = array_intersect($data, $childData);
}
}
... | php | public function getMetadataIntersectArray($name)
{
$data = array();
foreach ($this->getDataTables() as $childTable) {
$childData = $childTable->getMetadata($name);
if (is_array($childData)) {
$data = array_intersect($data, $childData);
}
}
... | [
"public",
"function",
"getMetadataIntersectArray",
"(",
"$",
"name",
")",
"{",
"$",
"data",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"getDataTables",
"(",
")",
"as",
"$",
"childTable",
")",
"{",
"$",
"childData",
"=",
"$",
"child... | Returns the intersection of children's metadata arrays (what they all have in common).
@param string $name The metadata name.
@return mixed | [
"Returns",
"the",
"intersection",
"of",
"children",
"s",
"metadata",
"arrays",
"(",
"what",
"they",
"all",
"have",
"in",
"common",
")",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable/Map.php#L503-L513 | train | Get metadata intersect array | [
30522,
2270,
3853,
2131,
11368,
8447,
18249,
7747,
22471,
2906,
9447,
1006,
1002,
2171,
1007,
1063,
1002,
2951,
1027,
9140,
1006,
1007,
1025,
18921,
6776,
1006,
1002,
2023,
1011,
1028,
2131,
2850,
29336,
3085,
2015,
1006,
1007,
2004,
1002,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/backend/classes/FormField.php | FormField.isSelected | public function isSelected($value = true)
{
if ($this->value === null) {
return false;
}
return (string) $value === (string) $this->value;
} | php | public function isSelected($value = true)
{
if ($this->value === null) {
return false;
}
return (string) $value === (string) $this->value;
} | [
"public",
"function",
"isSelected",
"(",
"$",
"value",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"value",
"===",
"null",
")",
"{",
"return",
"false",
";",
"}",
"return",
"(",
"string",
")",
"$",
"value",
"===",
"(",
"string",
")",
"$",
... | Determine if the provided value matches this field's value.
@param string $value
@return bool | [
"Determine",
"if",
"the",
"provided",
"value",
"matches",
"this",
"field",
"s",
"value",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/FormField.php#L367-L374 | train | Returns true if the value of the field is the same as the currently selected value. | [
30522,
2270,
3853,
26354,
12260,
10985,
1006,
1002,
3643,
1027,
2995,
1007,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
3643,
1027,
1027,
1027,
19701,
1007,
1063,
2709,
6270,
1025,
1065,
2709,
1006,
5164,
1007,
1002,
3643,
1027,
1027,
1027,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/UserCountry/API.php | API.shouldRegionCodesBeConvertedToIso | private function shouldRegionCodesBeConvertedToIso($archiveDate, $date, $period)
{
$timeOfSwitch = Option::get(GeoIp2::SWITCH_TO_ISO_REGIONS_OPTION_NAME);
if (empty($timeOfSwitch)) {
return false; // if option was not set, all codes are fips codes, so leave them
}
try {... | php | private function shouldRegionCodesBeConvertedToIso($archiveDate, $date, $period)
{
$timeOfSwitch = Option::get(GeoIp2::SWITCH_TO_ISO_REGIONS_OPTION_NAME);
if (empty($timeOfSwitch)) {
return false; // if option was not set, all codes are fips codes, so leave them
}
try {... | [
"private",
"function",
"shouldRegionCodesBeConvertedToIso",
"(",
"$",
"archiveDate",
",",
"$",
"date",
",",
"$",
"period",
")",
"{",
"$",
"timeOfSwitch",
"=",
"Option",
"::",
"get",
"(",
"GeoIp2",
"::",
"SWITCH_TO_ISO_REGIONS_OPTION_NAME",
")",
";",
"if",
"(",
... | if no switch to ISO was done --> no conversion as only FIPS codes are in use and handled correctly
if there has been a switch to ISO, we need to check the date:
- if the start date of the period is after the date we switched to ISO: no conversion needed
- if not we need to convert the codes to ISO, if the code is mappa... | [
"if",
"no",
"switch",
"to",
"ISO",
"was",
"done",
"--",
">",
"no",
"conversion",
"as",
"only",
"FIPS",
"codes",
"are",
"in",
"use",
"and",
"handled",
"correctly",
"if",
"there",
"has",
"been",
"a",
"switch",
"to",
"ISO",
"we",
"need",
"to",
"check",
... | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UserCountry/API.php#L292-L329 | train | Returns true if all region codes should be converted to ISO | [
30522,
2797,
3853,
2323,
23784,
23237,
4783,
8663,
26686,
3406,
19565,
1006,
1002,
9749,
3686,
1010,
1002,
3058,
1010,
1002,
2558,
1007,
1063,
1002,
2051,
11253,
26760,
20189,
1027,
5724,
1024,
1024,
2131,
1006,
20248,
11514,
2475,
1024,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Bridge/Twig/Extension/RoutingExtension.php | RoutingExtension.isUrlGenerationSafe | public function isUrlGenerationSafe(Node $argsNode)
{
// support named arguments
$paramsNode = $argsNode->hasNode('parameters') ? $argsNode->getNode('parameters') : (
$argsNode->hasNode(1) ? $argsNode->getNode(1) : null
);
if (null === $paramsNode || $paramsNode instance... | php | public function isUrlGenerationSafe(Node $argsNode)
{
// support named arguments
$paramsNode = $argsNode->hasNode('parameters') ? $argsNode->getNode('parameters') : (
$argsNode->hasNode(1) ? $argsNode->getNode(1) : null
);
if (null === $paramsNode || $paramsNode instance... | [
"public",
"function",
"isUrlGenerationSafe",
"(",
"Node",
"$",
"argsNode",
")",
"{",
"// support named arguments",
"$",
"paramsNode",
"=",
"$",
"argsNode",
"->",
"hasNode",
"(",
"'parameters'",
")",
"?",
"$",
"argsNode",
"->",
"getNode",
"(",
"'parameters'",
")"... | Determines at compile time whether the generated URL will be safe and thus
saving the unneeded automatic escaping for performance reasons.
The URL generation process percent encodes non-alphanumeric characters. So there is no risk
that malicious/invalid characters are part of the URL. The only character within an URL ... | [
"Determines",
"at",
"compile",
"time",
"whether",
"the",
"generated",
"URL",
"will",
"be",
"safe",
"and",
"thus",
"saving",
"the",
"unneeded",
"automatic",
"escaping",
"for",
"performance",
"reasons",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bridge/Twig/Extension/RoutingExtension.php#L96-L110 | train | Returns an array of url parameters that can be used to generate the url | [
30522,
2270,
3853,
2003,
3126,
28875,
3678,
10708,
10354,
2063,
1006,
13045,
1002,
12098,
5620,
3630,
3207,
1007,
1063,
1013,
1013,
2490,
2315,
9918,
1002,
11498,
5244,
3630,
3207,
1027,
1002,
12098,
5620,
3630,
3207,
1011,
1028,
8440,
1024... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/Development.php | Development.methodExists | public static function methodExists($classOrObject, $method)
{
if (is_string($classOrObject)) {
return class_exists($classOrObject) && method_exists($classOrObject, $method);
}
return method_exists($classOrObject, $method);
} | php | public static function methodExists($classOrObject, $method)
{
if (is_string($classOrObject)) {
return class_exists($classOrObject) && method_exists($classOrObject, $method);
}
return method_exists($classOrObject, $method);
} | [
"public",
"static",
"function",
"methodExists",
"(",
"$",
"classOrObject",
",",
"$",
"method",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"classOrObject",
")",
")",
"{",
"return",
"class_exists",
"(",
"$",
"classOrObject",
")",
"&&",
"method_exists",
"(",
... | Verifies whether a className of object implements the given method. It does not check whether the given method
is actually callable (public).
@param string|object $classOrObject
@param string $method
@return bool true if the method exists, false otherwise. | [
"Verifies",
"whether",
"a",
"className",
"of",
"object",
"implements",
"the",
"given",
"method",
".",
"It",
"does",
"not",
"check",
"whether",
"the",
"given",
"method",
"is",
"actually",
"callable",
"(",
"public",
")",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Development.php#L51-L58 | train | Method exists in the hierarchy of classes | [
30522,
2270,
10763,
3853,
4118,
10288,
5130,
1006,
1002,
2465,
14604,
2497,
20614,
1010,
1002,
4118,
1007,
1063,
2065,
1006,
2003,
1035,
5164,
1006,
1002,
2465,
14604,
2497,
20614,
1007,
1007,
1063,
2709,
2465,
1035,
6526,
1006,
1002,
2465,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/Zend/Cache/Backend/File.php | Zend_Cache_Backend_File._metadatasFile | protected function _metadatasFile($id)
{
$path = $this->_path($id);
$fileName = $this->_idToFileName('internal-metadatas---' . $id);
return $path . $fileName;
} | php | protected function _metadatasFile($id)
{
$path = $this->_path($id);
$fileName = $this->_idToFileName('internal-metadatas---' . $id);
return $path . $fileName;
} | [
"protected",
"function",
"_metadatasFile",
"(",
"$",
"id",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"_path",
"(",
"$",
"id",
")",
";",
"$",
"fileName",
"=",
"$",
"this",
"->",
"_idToFileName",
"(",
"'internal-metadatas---'",
".",
"$",
"id",
")",
... | Make and return a file name (with path) for metadatas
@param string $id Cache id
@return string Metadatas file name (with path) | [
"Make",
"and",
"return",
"a",
"file",
"name",
"(",
"with",
"path",
")",
"for",
"metadatas"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache/Backend/File.php#L578-L583 | train | Get the metadatas file name | [
30522,
5123,
3853,
1035,
27425,
22747,
9463,
1006,
1002,
8909,
1007,
1063,
1002,
4130,
1027,
1002,
2023,
1011,
1028,
1035,
4130,
1006,
1002,
8909,
1007,
1025,
1002,
5371,
18442,
1027,
1002,
2023,
1011,
1028,
1035,
8909,
3406,
8873,
20844,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Redis/Connections/PhpRedisConnection.php | PhpRedisConnection.zadd | public function zadd($key, ...$dictionary)
{
if (is_array(end($dictionary))) {
foreach (array_pop($dictionary) as $member => $score) {
$dictionary[] = $score;
$dictionary[] = $member;
}
}
$key = $this->applyPrefix($key);
retur... | php | public function zadd($key, ...$dictionary)
{
if (is_array(end($dictionary))) {
foreach (array_pop($dictionary) as $member => $score) {
$dictionary[] = $score;
$dictionary[] = $member;
}
}
$key = $this->applyPrefix($key);
retur... | [
"public",
"function",
"zadd",
"(",
"$",
"key",
",",
"...",
"$",
"dictionary",
")",
"{",
"if",
"(",
"is_array",
"(",
"end",
"(",
"$",
"dictionary",
")",
")",
")",
"{",
"foreach",
"(",
"array_pop",
"(",
"$",
"dictionary",
")",
"as",
"$",
"member",
"=... | Add one or more members to a sorted set or update its score if it already exists.
@param string $key
@param dynamic $dictionary
@return int | [
"Add",
"one",
"or",
"more",
"members",
"to",
"a",
"sorted",
"set",
"or",
"update",
"its",
"score",
"if",
"it",
"already",
"exists",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Redis/Connections/PhpRedisConnection.php#L204-L216 | train | Add key + dictionary | [
30522,
2270,
3853,
23564,
14141,
1006,
1002,
3145,
1010,
1012,
1012,
1012,
1002,
9206,
1007,
1063,
2065,
1006,
2003,
1035,
9140,
1006,
2203,
1006,
1002,
9206,
1007,
1007,
1007,
1063,
18921,
6776,
1006,
9140,
1035,
3769,
1006,
1002,
9206,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/thrift | lib/php/lib/Transport/TBufferedTransport.php | TBufferedTransport.write | public function write($buf)
{
$this->wBuf_ .= $buf;
if (TStringFuncFactory::create()->strlen($this->wBuf_) >= $this->wBufSize_) {
$out = $this->wBuf_;
// Note that we clear the internal wBuf_ prior to the underlying write
// to ensure we're in a sane state (i.e. ... | php | public function write($buf)
{
$this->wBuf_ .= $buf;
if (TStringFuncFactory::create()->strlen($this->wBuf_) >= $this->wBufSize_) {
$out = $this->wBuf_;
// Note that we clear the internal wBuf_ prior to the underlying write
// to ensure we're in a sane state (i.e. ... | [
"public",
"function",
"write",
"(",
"$",
"buf",
")",
"{",
"$",
"this",
"->",
"wBuf_",
".=",
"$",
"buf",
";",
"if",
"(",
"TStringFuncFactory",
"::",
"create",
"(",
")",
"->",
"strlen",
"(",
"$",
"this",
"->",
"wBuf_",
")",
">=",
"$",
"this",
"->",
... | @inheritdoc
@param string $buf
@throws TTransportException | [
"@inheritdoc"
] | acdd4226c210336e9e15eb812e5932a645fcd5ce | https://github.com/apache/thrift/blob/acdd4226c210336e9e15eb812e5932a645fcd5ce/lib/php/lib/Transport/TBufferedTransport.php#L174-L186 | train | Write the buffer to the transport | [
30522,
2270,
3853,
4339,
1006,
1002,
20934,
2546,
1007,
1063,
1002,
2023,
1011,
1028,
25610,
16093,
1035,
1012,
1027,
1002,
20934,
2546,
1025,
2065,
1006,
24529,
18886,
3070,
11263,
12273,
21450,
1024,
1024,
3443,
1006,
1007,
1011,
1028,
23... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | Behavioral/TemplateMethod/Journey.php | Journey.takeATrip | final public function takeATrip()
{
$this->thingsToDo[] = $this->buyAFlight();
$this->thingsToDo[] = $this->takePlane();
$this->thingsToDo[] = $this->enjoyVacation();
$buyGift = $this->buyGift();
if ($buyGift !== null) {
$this->thingsToDo[] = $buyGift;
}
... | php | final public function takeATrip()
{
$this->thingsToDo[] = $this->buyAFlight();
$this->thingsToDo[] = $this->takePlane();
$this->thingsToDo[] = $this->enjoyVacation();
$buyGift = $this->buyGift();
if ($buyGift !== null) {
$this->thingsToDo[] = $buyGift;
}
... | [
"final",
"public",
"function",
"takeATrip",
"(",
")",
"{",
"$",
"this",
"->",
"thingsToDo",
"[",
"]",
"=",
"$",
"this",
"->",
"buyAFlight",
"(",
")",
";",
"$",
"this",
"->",
"thingsToDo",
"[",
"]",
"=",
"$",
"this",
"->",
"takePlane",
"(",
")",
";"... | This is the public service provided by this class and its subclasses.
Notice it is final to "freeze" the global behavior of algorithm.
If you want to override this contract, make an interface with only takeATrip()
and subclass it. | [
"This",
"is",
"the",
"public",
"service",
"provided",
"by",
"this",
"class",
"and",
"its",
"subclasses",
".",
"Notice",
"it",
"is",
"final",
"to",
"freeze",
"the",
"global",
"behavior",
"of",
"algorithm",
".",
"If",
"you",
"want",
"to",
"override",
"this",... | 5f5649b57ea94471e20b54eb439c6368dea07886 | https://github.com/domnikl/DesignPatternsPHP/blob/5f5649b57ea94471e20b54eb439c6368dea07886/Behavioral/TemplateMethod/Journey.php#L18-L30 | train | Take AFlight Take Plane | [
30522,
2345,
2270,
3853,
2202,
4017,
29443,
1006,
1007,
1063,
1002,
2023,
1011,
1028,
2477,
3406,
3527,
1031,
1033,
1027,
1002,
2023,
1011,
1028,
4965,
10354,
7138,
1006,
1007,
1025,
1002,
2023,
1011,
1028,
2477,
3406,
3527,
1031,
1033,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/backend/helpers/Backend.php | Backend.redirect | public function redirect($path, $status = 302, $headers = [], $secure = null)
{
return Redirect::to($this->uri() . '/' . $path, $status, $headers, $secure);
} | php | public function redirect($path, $status = 302, $headers = [], $secure = null)
{
return Redirect::to($this->uri() . '/' . $path, $status, $headers, $secure);
} | [
"public",
"function",
"redirect",
"(",
"$",
"path",
",",
"$",
"status",
"=",
"302",
",",
"$",
"headers",
"=",
"[",
"]",
",",
"$",
"secure",
"=",
"null",
")",
"{",
"return",
"Redirect",
"::",
"to",
"(",
"$",
"this",
"->",
"uri",
"(",
")",
".",
"... | Create a new redirect response to a given backend path. | [
"Create",
"a",
"new",
"redirect",
"response",
"to",
"a",
"given",
"backend",
"path",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/helpers/Backend.php#L65-L68 | train | Redirects to the current page | [
30522,
2270,
3853,
2417,
7442,
6593,
1006,
1002,
4130,
1010,
1002,
3570,
1027,
22060,
1010,
1002,
20346,
2015,
1027,
1031,
1033,
1010,
1002,
5851,
1027,
19701,
1007,
1063,
2709,
2417,
7442,
6593,
1024,
1024,
2000,
1006,
1002,
2023,
1011,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
dompdf/dompdf | src/Css/Style.php | Style.set_list_style_image | function set_list_style_image($val)
{
//see __set and __get, on all assignments clear cache, not needed on direct set through __set
$this->_prop_cache["list_style_image"] = null;
$this->_props["list_style_image"] = $this->_image($val);
} | php | function set_list_style_image($val)
{
//see __set and __get, on all assignments clear cache, not needed on direct set through __set
$this->_prop_cache["list_style_image"] = null;
$this->_props["list_style_image"] = $this->_image($val);
} | [
"function",
"set_list_style_image",
"(",
"$",
"val",
")",
"{",
"//see __set and __get, on all assignments clear cache, not needed on direct set through __set",
"$",
"this",
"->",
"_prop_cache",
"[",
"\"list_style_image\"",
"]",
"=",
"null",
";",
"$",
"this",
"->",
"_props",... | Sets the list style image
@link http://www.w3.org/TR/CSS21/generate.html#propdef-list-style-image
@param $val | [
"Sets",
"the",
"list",
"style",
"image"
] | 75f13c700009be21a1965dc2c5b68a8708c22ba2 | https://github.com/dompdf/dompdf/blob/75f13c700009be21a1965dc2c5b68a8708c22ba2/src/Css/Style.php#L2503-L2508 | train | set list style image | [
30522,
3853,
2275,
1035,
2862,
1035,
2806,
1035,
3746,
1006,
1002,
11748,
1007,
1063,
1013,
1013,
2156,
1035,
1035,
2275,
1998,
1035,
1035,
2131,
1010,
2006,
2035,
14799,
3154,
17053,
1010,
2025,
2734,
2006,
3622,
2275,
2083,
1035,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/UsersManager/UsersManager.php | UsersManager.recordAdminUsersInCache | public function recordAdminUsersInCache(&$attributes, $idSite)
{
$model = new Model();
$adminLogins = $model->getUsersLoginWithSiteAccess($idSite, Admin::ID);
$writeLogins = $model->getUsersLoginWithSiteAccess($idSite, Write::ID);
$attributes['tracking_token_auth'] = array();
... | php | public function recordAdminUsersInCache(&$attributes, $idSite)
{
$model = new Model();
$adminLogins = $model->getUsersLoginWithSiteAccess($idSite, Admin::ID);
$writeLogins = $model->getUsersLoginWithSiteAccess($idSite, Write::ID);
$attributes['tracking_token_auth'] = array();
... | [
"public",
"function",
"recordAdminUsersInCache",
"(",
"&",
"$",
"attributes",
",",
"$",
"idSite",
")",
"{",
"$",
"model",
"=",
"new",
"Model",
"(",
")",
";",
"$",
"adminLogins",
"=",
"$",
"model",
"->",
"getUsersLoginWithSiteAccess",
"(",
"$",
"idSite",
",... | Hooks when a website tracker cache is flushed (website/user updated, cache deleted, or empty cache)
Will record in the tracker config file the list of Admin token_auth for this website. This
will be used when the Tracking API is used with setIp(), setForceDateTime(), setVisitorId(), etc.
@param $attributes
@param $idS... | [
"Hooks",
"when",
"a",
"website",
"tracker",
"cache",
"is",
"flushed",
"(",
"website",
"/",
"user",
"updated",
"cache",
"deleted",
"or",
"empty",
"cache",
")",
"Will",
"record",
"in",
"the",
"tracker",
"config",
"file",
"the",
"list",
"of",
"Admin",
"token_... | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UsersManager/UsersManager.php#L74-L95 | train | Records Admin Users in Cache | [
30522,
2270,
3853,
2501,
4215,
10020,
20330,
11493,
3540,
5403,
1006,
1004,
1002,
12332,
1010,
1002,
8909,
28032,
2063,
1007,
1063,
1002,
2944,
1027,
2047,
2944,
1006,
1007,
1025,
1002,
4748,
10020,
21197,
7076,
1027,
1002,
2944,
1011,
1028... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Templating/PhpEngine.php | PhpEngine.setCharset | public function setCharset($charset)
{
if ('UTF8' === $charset = strtoupper($charset)) {
$charset = 'UTF-8'; // iconv on Windows requires "UTF-8" instead of "UTF8"
}
$this->charset = $charset;
foreach ($this->helpers as $helper) {
$helper->setCharset($this->c... | php | public function setCharset($charset)
{
if ('UTF8' === $charset = strtoupper($charset)) {
$charset = 'UTF-8'; // iconv on Windows requires "UTF-8" instead of "UTF8"
}
$this->charset = $charset;
foreach ($this->helpers as $helper) {
$helper->setCharset($this->c... | [
"public",
"function",
"setCharset",
"(",
"$",
"charset",
")",
"{",
"if",
"(",
"'UTF8'",
"===",
"$",
"charset",
"=",
"strtoupper",
"(",
"$",
"charset",
")",
")",
"{",
"$",
"charset",
"=",
"'UTF-8'",
";",
"// iconv on Windows requires \"UTF-8\" instead of \"UTF8\"... | Sets the charset to use.
@param string $charset The charset | [
"Sets",
"the",
"charset",
"to",
"use",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Templating/PhpEngine.php#L330-L340 | train | Set charset of all languages | [
30522,
2270,
3853,
2275,
7507,
22573,
2102,
1006,
1002,
25869,
13462,
1007,
1063,
2065,
1006,
1005,
21183,
2546,
2620,
1005,
1027,
1027,
1027,
1002,
25869,
13462,
1027,
2358,
5339,
7140,
18620,
1006,
1002,
25869,
13462,
1007,
1007,
1063,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Serializer/Encoder/ChainEncoder.php | ChainEncoder.supportsEncoding | public function supportsEncoding($format, array $context = [])
{
try {
$this->getEncoder($format, $context);
} catch (RuntimeException $e) {
return false;
}
return true;
} | php | public function supportsEncoding($format, array $context = [])
{
try {
$this->getEncoder($format, $context);
} catch (RuntimeException $e) {
return false;
}
return true;
} | [
"public",
"function",
"supportsEncoding",
"(",
"$",
"format",
",",
"array",
"$",
"context",
"=",
"[",
"]",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"getEncoder",
"(",
"$",
"format",
",",
"$",
"context",
")",
";",
"}",
"catch",
"(",
"RuntimeException",
... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Serializer/Encoder/ChainEncoder.php#L46-L55 | train | Returns true if the current locale supports the given encoding | [
30522,
2270,
3853,
6753,
2368,
3597,
4667,
1006,
1002,
4289,
1010,
9140,
1002,
6123,
1027,
1031,
1033,
1007,
1063,
3046,
1063,
1002,
2023,
1011,
1028,
2131,
2368,
16044,
2099,
1006,
1002,
4289,
1010,
1002,
6123,
1007,
1025,
1065,
4608,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Cookie/Middleware/EncryptCookies.php | EncryptCookies.decryptCookie | protected function decryptCookie($name, $cookie)
{
return is_array($cookie)
? $this->decryptArray($cookie)
: $this->encrypter->decrypt($cookie, static::serialized($name));
} | php | protected function decryptCookie($name, $cookie)
{
return is_array($cookie)
? $this->decryptArray($cookie)
: $this->encrypter->decrypt($cookie, static::serialized($name));
} | [
"protected",
"function",
"decryptCookie",
"(",
"$",
"name",
",",
"$",
"cookie",
")",
"{",
"return",
"is_array",
"(",
"$",
"cookie",
")",
"?",
"$",
"this",
"->",
"decryptArray",
"(",
"$",
"cookie",
")",
":",
"$",
"this",
"->",
"encrypter",
"->",
"decryp... | Decrypt the given cookie and return the value.
@param string $name
@param string|array $cookie
@return string|array | [
"Decrypt",
"the",
"given",
"cookie",
"and",
"return",
"the",
"value",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Cookie/Middleware/EncryptCookies.php#L99-L104 | train | Decrypt a cookie | [
30522,
5123,
3853,
11703,
2854,
13876,
3597,
23212,
2063,
1006,
1002,
2171,
1010,
1002,
17387,
1007,
1063,
2709,
2003,
1035,
9140,
1006,
1002,
17387,
1007,
1029,
1002,
2023,
1011,
1028,
11703,
2854,
22799,
11335,
2100,
1006,
1002,
17387,
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/View/UIControl.php | UIControl.render | public function render()
{
if ($this->cssIdentifier === null) {
throw new Exception("All UIControls must set a cssIdentifier property");
}
if ($this->jsClass === null) {
throw new Exception("All UIControls must set a jsClass property");
}
return pare... | php | public function render()
{
if ($this->cssIdentifier === null) {
throw new Exception("All UIControls must set a cssIdentifier property");
}
if ($this->jsClass === null) {
throw new Exception("All UIControls must set a jsClass property");
}
return pare... | [
"public",
"function",
"render",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"cssIdentifier",
"===",
"null",
")",
"{",
"throw",
"new",
"Exception",
"(",
"\"All UIControls must set a cssIdentifier property\"",
")",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"jsC... | Renders the control view within a containing <div> that is used by the UIControl JavaScript
class.
@return string | [
"Renders",
"the",
"control",
"view",
"within",
"a",
"containing",
"<div",
">",
"that",
"is",
"used",
"by",
"the",
"UIControl",
"JavaScript",
"class",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/View/UIControl.php#L113-L124 | train | Render the UIControls | [
30522,
2270,
3853,
17552,
1006,
1007,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
20116,
7363,
16778,
8873,
2121,
1027,
1027,
1027,
19701,
1007,
1063,
5466,
2047,
6453,
1006,
1000,
2035,
21318,
8663,
13181,
4877,
2442,
2275,
1037,
20116,
7363... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Adapter/ChainAdapter.php | ChainAdapter.hasItem | public function hasItem($key)
{
foreach ($this->adapters as $adapter) {
if ($adapter->hasItem($key)) {
return true;
}
}
return false;
} | php | public function hasItem($key)
{
foreach ($this->adapters as $adapter) {
if ($adapter->hasItem($key)) {
return true;
}
}
return false;
} | [
"public",
"function",
"hasItem",
"(",
"$",
"key",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"adapters",
"as",
"$",
"adapter",
")",
"{",
"if",
"(",
"$",
"adapter",
"->",
"hasItem",
"(",
"$",
"key",
")",
")",
"{",
"return",
"true",
";",
"}",
"}"... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Cache/Adapter/ChainAdapter.php#L182-L191 | train | Checks if an item exists in the tree | [
30522,
2270,
3853,
2038,
4221,
2213,
1006,
1002,
3145,
1007,
1063,
18921,
6776,
1006,
1002,
2023,
1011,
1028,
15581,
2545,
2004,
1002,
15581,
2121,
1007,
1063,
2065,
1006,
1002,
15581,
2121,
1011,
1028,
2038,
4221,
2213,
1006,
1002,
3145,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Adapter/ProxyAdapter.php | ProxyAdapter.getItems | public function getItems(array $keys = [])
{
if ($this->namespaceLen) {
foreach ($keys as $i => $key) {
$keys[$i] = $this->getId($key);
}
}
return $this->generateItems($this->pool->getItems($keys));
} | php | public function getItems(array $keys = [])
{
if ($this->namespaceLen) {
foreach ($keys as $i => $key) {
$keys[$i] = $this->getId($key);
}
}
return $this->generateItems($this->pool->getItems($keys));
} | [
"public",
"function",
"getItems",
"(",
"array",
"$",
"keys",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"namespaceLen",
")",
"{",
"foreach",
"(",
"$",
"keys",
"as",
"$",
"i",
"=>",
"$",
"key",
")",
"{",
"$",
"keys",
"[",
"$",
"i",
... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Cache/Adapter/ProxyAdapter.php#L129-L138 | train | Get items from pool | [
30522,
2270,
3853,
2131,
4221,
5244,
1006,
9140,
1002,
6309,
1027,
1031,
1033,
1007,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
3415,
15327,
7770,
1007,
1063,
18921,
6776,
1006,
1002,
6309,
2004,
1002,
1045,
1027,
1028,
1002,
3145,
1007,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/OptionsResolver/OptionsResolver.php | OptionsResolver.offsetGet | public function offsetGet($option/*, bool $triggerDeprecation = true*/)
{
if (!$this->locked) {
throw new AccessException('Array access is only supported within closures of lazy options and normalizers.');
}
$triggerDeprecation = 1 === \func_num_args() || \func_get_arg(1);
... | php | public function offsetGet($option/*, bool $triggerDeprecation = true*/)
{
if (!$this->locked) {
throw new AccessException('Array access is only supported within closures of lazy options and normalizers.');
}
$triggerDeprecation = 1 === \func_num_args() || \func_get_arg(1);
... | [
"public",
"function",
"offsetGet",
"(",
"$",
"option",
"/*, bool $triggerDeprecation = true*/",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"locked",
")",
"{",
"throw",
"new",
"AccessException",
"(",
"'Array access is only supported within closures of lazy options and no... | Returns the resolved value of an option.
@param string $option The option name
@param bool $triggerDeprecation Whether to trigger the deprecation or not (true by default)
@return mixed The option value
@throws AccessException If accessing this method outside of
{@link resolve()}
@throws NoSuc... | [
"Returns",
"the",
"resolved",
"value",
"of",
"an",
"option",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/OptionsResolver/OptionsResolver.php#L843-L1037 | train | Get an option value | [
30522,
2270,
3853,
16396,
18150,
1006,
1002,
5724,
1013,
1008,
1010,
22017,
2140,
1002,
9495,
3207,
28139,
10719,
1027,
2995,
1008,
1013,
1007,
1063,
2065,
1006,
999,
1002,
2023,
1011,
1028,
5299,
1007,
1063,
5466,
2047,
3229,
10288,
24422,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.getRowsMetadata | public function getRowsMetadata($name)
{
$metadataValues = array();
foreach ($this->getRows() as $row) {
$metadataValues[] = $row->getMetadata($name);
}
return $metadataValues;
} | php | public function getRowsMetadata($name)
{
$metadataValues = array();
foreach ($this->getRows() as $row) {
$metadataValues[] = $row->getMetadata($name);
}
return $metadataValues;
} | [
"public",
"function",
"getRowsMetadata",
"(",
"$",
"name",
")",
"{",
"$",
"metadataValues",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"getRows",
"(",
")",
"as",
"$",
"row",
")",
"{",
"$",
"metadataValues",
"[",
"]",
"=",
"$",
... | Returns an array containing the requested metadata value of each row.
@param string $name The metadata column to return.
@return array | [
"Returns",
"an",
"array",
"containing",
"the",
"requested",
"metadata",
"value",
"of",
"each",
"row",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable.php#L985-L992 | train | Get all metadata values of all rows | [
30522,
2270,
3853,
2131,
10524,
6491,
12928,
2850,
2696,
1006,
1002,
2171,
1007,
1063,
1002,
27425,
10175,
15808,
1027,
9140,
1006,
1007,
1025,
18921,
6776,
1006,
1002,
2023,
1011,
1028,
2131,
10524,
2015,
1006,
1007,
2004,
1002,
5216,
1007... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Console/Output/ConsoleOutput.php | ConsoleOutput.setFormatter | public function setFormatter(OutputFormatterInterface $formatter)
{
parent::setFormatter($formatter);
$this->stderr->setFormatter($formatter);
} | php | public function setFormatter(OutputFormatterInterface $formatter)
{
parent::setFormatter($formatter);
$this->stderr->setFormatter($formatter);
} | [
"public",
"function",
"setFormatter",
"(",
"OutputFormatterInterface",
"$",
"formatter",
")",
"{",
"parent",
"::",
"setFormatter",
"(",
"$",
"formatter",
")",
";",
"$",
"this",
"->",
"stderr",
"->",
"setFormatter",
"(",
"$",
"formatter",
")",
";",
"}"
] | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Output/ConsoleOutput.php#L72-L76 | train | Set Formatter for all child pages | [
30522,
2270,
3853,
2275,
14192,
20097,
1006,
6434,
14192,
20097,
18447,
30524,
1028,
2275,
14192,
20097,
1006,
1002,
4289,
3334,
1007,
1025,
1065,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Model.php | Model.resolvePerPage | protected function resolvePerPage($paginate)
{
if ($perPage = request($this->perPageName)) {
if (is_array($paginate)) {
$paginate['arguments'][0] = (int) $perPage;
return $paginate['arguments'];
}
$this->perPage = (int) $perPage;
... | php | protected function resolvePerPage($paginate)
{
if ($perPage = request($this->perPageName)) {
if (is_array($paginate)) {
$paginate['arguments'][0] = (int) $perPage;
return $paginate['arguments'];
}
$this->perPage = (int) $perPage;
... | [
"protected",
"function",
"resolvePerPage",
"(",
"$",
"paginate",
")",
"{",
"if",
"(",
"$",
"perPage",
"=",
"request",
"(",
"$",
"this",
"->",
"perPageName",
")",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"paginate",
")",
")",
"{",
"$",
"paginate",
"... | Resolve perPage for pagination.
@param array|null $paginate
@return array | [
"Resolve",
"perPage",
"for",
"pagination",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Grid/Model.php#L469-L490 | train | Resolve perPage name | [
30522,
5123,
3853,
10663,
4842,
13704,
1006,
1002,
6643,
20876,
2618,
1007,
1063,
2065,
1006,
1002,
2566,
13704,
1027,
5227,
1006,
1002,
2023,
1011,
1028,
2566,
13704,
18442,
1007,
1007,
1063,
2065,
1006,
2003,
1035,
9140,
1006,
1002,
6643,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.sortArrayByArray | public static function sortArrayByArray(array $array, array $orderArray)
{
$ordered = array();
foreach ($orderArray as $key) {
if (array_key_exists($key, $array)) {
$ordered[$key] = $array[$key];
unset($array[$key]);
}
}
return ... | php | public static function sortArrayByArray(array $array, array $orderArray)
{
$ordered = array();
foreach ($orderArray as $key) {
if (array_key_exists($key, $array)) {
$ordered[$key] = $array[$key];
unset($array[$key]);
}
}
return ... | [
"public",
"static",
"function",
"sortArrayByArray",
"(",
"array",
"$",
"array",
",",
"array",
"$",
"orderArray",
")",
"{",
"$",
"ordered",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"orderArray",
"as",
"$",
"key",
")",
"{",
"if",
"(",
"array_key... | Sort a multidimensional array by another array of ordered keys
@param array $array
@param array $orderArray
@return array | [
"Sort",
"a",
"multidimensional",
"array",
"by",
"another",
"array",
"of",
"ordered",
"keys"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Utils.php#L1251-L1261 | train | Sort array by array | [
30522,
2270,
10763,
3853,
4066,
2906,
9447,
3762,
2906,
9447,
1006,
9140,
1002,
9140,
1010,
9140,
1002,
2344,
2906,
9447,
1007,
1063,
1002,
3641,
1027,
9140,
1006,
1007,
1025,
18921,
6776,
1006,
1002,
2344,
2906,
9447,
2004,
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... |
z-song/laravel-admin | src/Extension.php | Extension.import | public static function import()
{
$extension = static::getInstance();
if ($menu = $extension->menu()) {
if ($extension->validateMenu($menu)) {
extract($menu);
static::createMenu($title, $path, $icon);
}
}
if ($permission = $ex... | php | public static function import()
{
$extension = static::getInstance();
if ($menu = $extension->menu()) {
if ($extension->validateMenu($menu)) {
extract($menu);
static::createMenu($title, $path, $icon);
}
}
if ($permission = $ex... | [
"public",
"static",
"function",
"import",
"(",
")",
"{",
"$",
"extension",
"=",
"static",
"::",
"getInstance",
"(",
")",
";",
"if",
"(",
"$",
"menu",
"=",
"$",
"extension",
"->",
"menu",
"(",
")",
")",
"{",
"if",
"(",
"$",
"extension",
"->",
"valid... | Import menu item and permission to laravel-admin. | [
"Import",
"menu",
"item",
"and",
"permission",
"to",
"laravel",
"-",
"admin",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Extension.php#L230-L247 | train | Imports menu and permission | [
30522,
2270,
10763,
3853,
12324,
1006,
1007,
1063,
1002,
5331,
1027,
10763,
1024,
1024,
2131,
7076,
26897,
1006,
1007,
1025,
2065,
1006,
1002,
12183,
1027,
1002,
5331,
1011,
1028,
12183,
1006,
1007,
1007,
1063,
2065,
1006,
1002,
5331,
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... |
dompdf/dompdf | src/Css/Style.php | Style.get_transform_origin | function get_transform_origin() {
$values = preg_split("/\s+/", $this->_props['transform_origin']);
if (count($values) === 0) {
$values = preg_split("/\s+/", self::$_defaults["transform_origin"]);
}
$values = array_map(function($value) {
if (in_array($value, arr... | php | function get_transform_origin() {
$values = preg_split("/\s+/", $this->_props['transform_origin']);
if (count($values) === 0) {
$values = preg_split("/\s+/", self::$_defaults["transform_origin"]);
}
$values = array_map(function($value) {
if (in_array($value, arr... | [
"function",
"get_transform_origin",
"(",
")",
"{",
"$",
"values",
"=",
"preg_split",
"(",
"\"/\\s+/\"",
",",
"$",
"this",
"->",
"_props",
"[",
"'transform_origin'",
"]",
")",
";",
"if",
"(",
"count",
"(",
"$",
"values",
")",
"===",
"0",
")",
"{",
"$",
... | Gets the CSS3 transform-origin property
@link http://www.w3.org/TR/css3-2d-transforms/#transform-origin
@return mixed[] | [
"Gets",
"the",
"CSS3",
"transform",
"-",
"origin",
"property"
] | 75f13c700009be21a1965dc2c5b68a8708c22ba2 | https://github.com/dompdf/dompdf/blob/75f13c700009be21a1965dc2c5b68a8708c22ba2/src/Css/Style.php#L2778-L2800 | train | Get the transform origin | [
30522,
3853,
2131,
1035,
10938,
1035,
4761,
1006,
1007,
1063,
1002,
5300,
1027,
3653,
2290,
1035,
3975,
1006,
1000,
1013,
1032,
1055,
1009,
1013,
1000,
1010,
1002,
2023,
1011,
1028,
1035,
24387,
1031,
1005,
10938,
1035,
4761,
1005,
1033,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/backend/ServiceProvider.php | ServiceProvider.registerBackendNavigation | protected function registerBackendNavigation()
{
BackendMenu::registerCallback(function ($manager) {
$manager->registerMenuItems('October.Backend', [
'dashboard' => [
'label' => 'backend::lang.dashboard.menu_label',
'icon' => '... | php | protected function registerBackendNavigation()
{
BackendMenu::registerCallback(function ($manager) {
$manager->registerMenuItems('October.Backend', [
'dashboard' => [
'label' => 'backend::lang.dashboard.menu_label',
'icon' => '... | [
"protected",
"function",
"registerBackendNavigation",
"(",
")",
"{",
"BackendMenu",
"::",
"registerCallback",
"(",
"function",
"(",
"$",
"manager",
")",
"{",
"$",
"manager",
"->",
"registerMenuItems",
"(",
"'October.Backend'",
",",
"[",
"'dashboard'",
"=>",
"[",
... | /*
Register navigation | [
"/",
"*",
"Register",
"navigation"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/ServiceProvider.php#L92-L114 | train | Registers the backend navigation | [
30522,
5123,
3853,
4236,
5963,
10497,
2532,
5737,
12540,
1006,
1007,
1063,
2067,
10497,
3549,
2226,
1024,
1024,
4236,
9289,
20850,
8684,
1006,
3853,
1006,
1002,
3208,
1007,
1063,
1002,
3208,
1011,
1028,
4236,
3549,
14663,
6633,
2015,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
guzzle/guzzle | build/Burgomaster.php | Burgomaster.createPhar | public function createPhar(
$dest,
$stub = null,
$autoloaderFilename = 'autoloader.php'
) {
$this->startSection('phar');
$this->debug("Creating phar file at $dest");
$this->createDirIfNeeded(dirname($dest));
$phar = new \Phar($dest, 0, basename($dest));
... | php | public function createPhar(
$dest,
$stub = null,
$autoloaderFilename = 'autoloader.php'
) {
$this->startSection('phar');
$this->debug("Creating phar file at $dest");
$this->createDirIfNeeded(dirname($dest));
$phar = new \Phar($dest, 0, basename($dest));
... | [
"public",
"function",
"createPhar",
"(",
"$",
"dest",
",",
"$",
"stub",
"=",
"null",
",",
"$",
"autoloaderFilename",
"=",
"'autoloader.php'",
")",
"{",
"$",
"this",
"->",
"startSection",
"(",
"'phar'",
")",
";",
"$",
"this",
"->",
"debug",
"(",
"\"Creati... | Creates a phar that automatically registers an autoloader.
Call this only after your staging directory is built.
@param string $dest Where to save the file. The basename of the file
is also used as the alias name in the phar
(e.g., /path/to/guzzle.phar => guzzle.phar).
@param string|bool|null $stub The path to the ph... | [
"Creates",
"a",
"phar",
"that",
"automatically",
"registers",
"an",
"autoloader",
"."
] | bf595424e4d442a190582e088985dc835a789071 | https://github.com/guzzle/guzzle/blob/bf595424e4d442a190582e088985dc835a789071/build/Burgomaster.php#L338-L358 | train | Creates a phar file from the stage directory | [
30522,
2270,
3853,
3443,
21890,
2099,
1006,
1002,
4078,
2102,
1010,
1002,
24646,
2497,
1027,
19701,
1010,
1002,
8285,
11066,
2121,
8873,
20844,
4168,
1027,
1005,
8285,
11066,
2121,
1012,
25718,
1005,
1007,
1063,
1002,
2023,
1011,
1028,
4627... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Mbox.php | Zend_Mail_Storage_Mbox.getSize | public function getSize($id = 0)
{
if ($id) {
$pos = $this->_positions[$id - 1];
return $pos['end'] - $pos['start'];
}
$result = array();
foreach ($this->_positions as $num => $pos) {
$result[$num + 1] = $pos['end'] - $pos['start'];
}
... | php | public function getSize($id = 0)
{
if ($id) {
$pos = $this->_positions[$id - 1];
return $pos['end'] - $pos['start'];
}
$result = array();
foreach ($this->_positions as $num => $pos) {
$result[$num + 1] = $pos['end'] - $pos['start'];
}
... | [
"public",
"function",
"getSize",
"(",
"$",
"id",
"=",
"0",
")",
"{",
"if",
"(",
"$",
"id",
")",
"{",
"$",
"pos",
"=",
"$",
"this",
"->",
"_positions",
"[",
"$",
"id",
"-",
"1",
"]",
";",
"return",
"$",
"pos",
"[",
"'end'",
"]",
"-",
"$",
"p... | Get a list of messages with number and size
@param int|null $id number of message or null for all messages
@return int|array size of given message of list with all messages as array(num => size) | [
"Get",
"a",
"list",
"of",
"messages",
"with",
"number",
"and",
"size"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail/Storage/Mbox.php#L98-L111 | train | Get Size of Position | [
30522,
2270,
3853,
4152,
4697,
1006,
1002,
8909,
1027,
1014,
1007,
1063,
2065,
1006,
1002,
8909,
1007,
1063,
1002,
13433,
2015,
1027,
1002,
2023,
1011,
1028,
1035,
4460,
1031,
1002,
8909,
1011,
1015,
1033,
1025,
2709,
1002,
13433,
2015,
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/Bundle/TwigBundle/DependencyInjection/Configuration.php | Configuration.getConfigTreeBuilder | public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder('twig');
$rootNode = $treeBuilder->getRootNode();
$rootNode
->children()
->scalarNode('exception_controller')->defaultValue('twig.controller.exception::showAction')->end()
->end()... | php | public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder('twig');
$rootNode = $treeBuilder->getRootNode();
$rootNode
->children()
->scalarNode('exception_controller')->defaultValue('twig.controller.exception::showAction')->end()
->end()... | [
"public",
"function",
"getConfigTreeBuilder",
"(",
")",
"{",
"$",
"treeBuilder",
"=",
"new",
"TreeBuilder",
"(",
"'twig'",
")",
";",
"$",
"rootNode",
"=",
"$",
"treeBuilder",
"->",
"getRootNode",
"(",
")",
";",
"$",
"rootNode",
"->",
"children",
"(",
")",
... | Generates the configuration tree builder.
@return TreeBuilder The tree builder | [
"Generates",
"the",
"configuration",
"tree",
"builder",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bundle/TwigBundle/DependencyInjection/Configuration.php#L30-L47 | train | Get the TreeBuilder for twig | [
30522,
2270,
3853,
2131,
8663,
8873,
13512,
9910,
8569,
23891,
2099,
1006,
1007,
1063,
1002,
3392,
8569,
23891,
2099,
30524,
1011,
1028,
26743,
19139,
3207,
1006,
1005,
6453,
1035,
11486,
1005,
1007,
1011,
1028,
12398,
10175,
5657,
1006,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Common/Debugger.php | Debugger.init | public function init()
{
if ($this->initialized) {
return $this;
}
$this->grav = Grav::instance();
$this->config = $this->grav['config'];
// Enable/disable debugger based on configuration.
$this->enabled = (bool)$this->config->get('system.debugger.enable... | php | public function init()
{
if ($this->initialized) {
return $this;
}
$this->grav = Grav::instance();
$this->config = $this->grav['config'];
// Enable/disable debugger based on configuration.
$this->enabled = (bool)$this->config->get('system.debugger.enable... | [
"public",
"function",
"init",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"initialized",
")",
"{",
"return",
"$",
"this",
";",
"}",
"$",
"this",
"->",
"grav",
"=",
"Grav",
"::",
"instance",
"(",
")",
";",
"$",
"this",
"->",
"config",
"=",
"$",
... | Initialize the debugger
@return $this
@throws \DebugBar\DebugBarException | [
"Initialize",
"the",
"debugger"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Debugger.php#L92-L120 | train | Initialize the class | [
30522,
2270,
3853,
1999,
4183,
1006,
1007,
1063,
30524,
9530,
8873,
2290,
1027,
1002,
2023,
1011,
1028,
24665,
11431,
1031,
1005,
9530,
8873,
2290,
1005,
1033,
1025,
1013,
1013,
9585,
1013,
4487,
19150,
2139,
8569,
13327,
2241,
2006,
9563,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
z-song/laravel-admin | src/Grid/Filter/Layout/Layout.php | Layout.column | public function column($width, \Closure $closure)
{
if ($this->columns->isEmpty()) {
$column = $this->current;
$column->setWidth($width);
} else {
$column = new Column($width);
$this->current = $column;
}
$this->columns->push($column... | php | public function column($width, \Closure $closure)
{
if ($this->columns->isEmpty()) {
$column = $this->current;
$column->setWidth($width);
} else {
$column = new Column($width);
$this->current = $column;
}
$this->columns->push($column... | [
"public",
"function",
"column",
"(",
"$",
"width",
",",
"\\",
"Closure",
"$",
"closure",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"columns",
"->",
"isEmpty",
"(",
")",
")",
"{",
"$",
"column",
"=",
"$",
"this",
"->",
"current",
";",
"$",
"column",
... | Add a new column in layout.
@param int $width
@param \Closure $closure | [
"Add",
"a",
"new",
"column",
"in",
"layout",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Grid/Filter/Layout/Layout.php#L55-L70 | train | Adds a new column to the columns list | [
30522,
2270,
3853,
5930,
1006,
1002,
9381,
1010,
1032,
8503,
1002,
8503,
1007,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
7753,
1011,
1028,
2003,
6633,
13876,
2100,
1006,
1007,
1007,
1063,
1002,
5930,
1027,
1002,
2023,
1011,
1028,
2783,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/GeoIp2/LocationProvider/GeoIp2/ServerModule.php | ServerModule.getSupportedLocationInfo | public function getSupportedLocationInfo()
{
$result = array();
// assume country info is always available. it's an error if it's not.
$result[self::CONTINENT_CODE_KEY] = true;
$result[self::CONTINENT_NAME_KEY] = true;
$result[self::COUNTRY_CODE_KEY] = true;
$result[... | php | public function getSupportedLocationInfo()
{
$result = array();
// assume country info is always available. it's an error if it's not.
$result[self::CONTINENT_CODE_KEY] = true;
$result[self::CONTINENT_NAME_KEY] = true;
$result[self::COUNTRY_CODE_KEY] = true;
$result[... | [
"public",
"function",
"getSupportedLocationInfo",
"(",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"// assume country info is always available. it's an error if it's not.",
"$",
"result",
"[",
"self",
"::",
"CONTINENT_CODE_KEY",
"]",
"=",
"true",
";",
"$",
... | Returns an array describing the types of location information this provider will
return.
There's no way to tell exactly what database the HTTP server is using, so we just
assume country and continent information is available. This can make diagnostics
a bit more difficult, unfortunately.
@return array | [
"Returns",
"an",
"array",
"describing",
"the",
"types",
"of",
"location",
"information",
"this",
"provider",
"will",
"return",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/GeoIp2/LocationProvider/GeoIp2/ServerModule.php#L109-L129 | train | Return all supported location info | [
30522,
2270,
3853,
4152,
6279,
6442,
2098,
4135,
10719,
2378,
14876,
1006,
1007,
1063,
1002,
2765,
1027,
9140,
1006,
1007,
1025,
1013,
1013,
7868,
2406,
18558,
2003,
2467,
2800,
1012,
2009,
1005,
1055,
2019,
7561,
2065,
2009,
1005,
1055,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
slimphp/Slim | Slim/Http/Message.php | Message.withAddedHeader | public function withAddedHeader($name, $value)
{
$clone = clone $this;
$clone->headers->add($name, $value);
if ($this instanceof Response && $this->body instanceof NonBufferedBody) {
header(sprintf('%s: %s', $name, $clone->getHeaderLine($name)));
}
return $clone... | php | public function withAddedHeader($name, $value)
{
$clone = clone $this;
$clone->headers->add($name, $value);
if ($this instanceof Response && $this->body instanceof NonBufferedBody) {
header(sprintf('%s: %s', $name, $clone->getHeaderLine($name)));
}
return $clone... | [
"public",
"function",
"withAddedHeader",
"(",
"$",
"name",
",",
"$",
"value",
")",
"{",
"$",
"clone",
"=",
"clone",
"$",
"this",
";",
"$",
"clone",
"->",
"headers",
"->",
"add",
"(",
"$",
"name",
",",
"$",
"value",
")",
";",
"if",
"(",
"$",
"this... | Return an instance with the specified header appended with the given value.
Existing values for the specified header will be maintained. The new
value(s) will be appended to the existing list. If the header did not
exist previously, it will be added.
This method MUST be implemented in such a way as to retain the
immu... | [
"Return",
"an",
"instance",
"with",
"the",
"specified",
"header",
"appended",
"with",
"the",
"given",
"value",
"."
] | ccef5f7d8bcd469d59cbe64f6210d83764f91543 | https://github.com/slimphp/Slim/blob/ccef5f7d8bcd469d59cbe64f6210d83764f91543/Slim/Http/Message.php#L228-L238 | train | Add a header to the response | [
30522,
2270,
3853,
2007,
4215,
5732,
4974,
2121,
1006,
1002,
2171,
1010,
1002,
3643,
1007,
1063,
1002,
17598,
1027,
17598,
1002,
2023,
1025,
1002,
17598,
1011,
1028,
20346,
2015,
1011,
1028,
5587,
1006,
1002,
2171,
1010,
1002,
3643,
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/Auth/Access/Gate.php | Gate.callAfterCallbacks | protected function callAfterCallbacks($user, $ability, array $arguments, $result)
{
foreach ($this->afterCallbacks as $after) {
if (! $this->canBeCalledWithUser($user, $after)) {
continue;
}
$afterResult = $after($user, $ability, $result, $arguments);
... | php | protected function callAfterCallbacks($user, $ability, array $arguments, $result)
{
foreach ($this->afterCallbacks as $after) {
if (! $this->canBeCalledWithUser($user, $after)) {
continue;
}
$afterResult = $after($user, $ability, $result, $arguments);
... | [
"protected",
"function",
"callAfterCallbacks",
"(",
"$",
"user",
",",
"$",
"ability",
",",
"array",
"$",
"arguments",
",",
"$",
"result",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"afterCallbacks",
"as",
"$",
"after",
")",
"{",
"if",
"(",
"!",
"$",
... | Call all of the after callbacks with check result.
@param \Illuminate\Contracts\Auth\Authenticatable $user
@param string $ability
@param array $arguments
@param bool $result
@return bool|null | [
"Call",
"all",
"of",
"the",
"after",
"callbacks",
"with",
"check",
"result",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Auth/Access/Gate.php#L485-L498 | train | Call all after callbacks | [
30522,
5123,
3853,
2655,
10354,
3334,
9289,
20850,
8684,
2015,
1006,
1002,
5310,
1010,
1002,
3754,
1010,
9140,
1002,
9918,
1010,
1002,
2765,
1007,
1063,
18921,
6776,
1006,
1002,
2023,
1011,
1028,
2044,
9289,
20850,
8684,
2015,
2004,
1002,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Common/User/FlexUser/User.php | User.def | public function def($name, $default = null, $separator = null)
{
$this->defNestedProperty($name, $default, $separator);
return $this;
} | php | public function def($name, $default = null, $separator = null)
{
$this->defNestedProperty($name, $default, $separator);
return $this;
} | [
"public",
"function",
"def",
"(",
"$",
"name",
",",
"$",
"default",
"=",
"null",
",",
"$",
"separator",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"defNestedProperty",
"(",
"$",
"name",
",",
"$",
"default",
",",
"$",
"separator",
")",
";",
"return",
... | Set default value by using dot notation for nested arrays/objects.
@example $data->def('this.is.my.nested.variable', 'default');
@param string $name Dot separated path to the requested value.
@param mixed $default Default value (or null).
@param string $separator Separator, defaults to '.'
@return $this | [
"Set",
"default",
"value",
"by",
"using",
"dot",
"notation",
"for",
"nested",
"arrays",
"/",
"objects",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/User/FlexUser/User.php#L149-L154 | train | def - Gets a nested property of the current class | [
30522,
2270,
3853,
13366,
1006,
1002,
2171,
1010,
1002,
12398,
1027,
19701,
1010,
1002,
19802,
25879,
2953,
1027,
19701,
1007,
1063,
1002,
2023,
1011,
1028,
13366,
5267,
3064,
21572,
4842,
3723,
1006,
1002,
2171,
1010,
1002,
12398,
1010,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/View/Concerns/ManagesComponents.php | ManagesComponents.slot | public function slot($name, $content = null)
{
if (func_num_args() === 2) {
$this->slots[$this->currentComponent()][$name] = $content;
} else {
if (ob_start()) {
$this->slots[$this->currentComponent()][$name] = '';
$this->slotStack[$this->curr... | php | public function slot($name, $content = null)
{
if (func_num_args() === 2) {
$this->slots[$this->currentComponent()][$name] = $content;
} else {
if (ob_start()) {
$this->slots[$this->currentComponent()][$name] = '';
$this->slotStack[$this->curr... | [
"public",
"function",
"slot",
"(",
"$",
"name",
",",
"$",
"content",
"=",
"null",
")",
"{",
"if",
"(",
"func_num_args",
"(",
")",
"===",
"2",
")",
"{",
"$",
"this",
"->",
"slots",
"[",
"$",
"this",
"->",
"currentComponent",
"(",
")",
"]",
"[",
"$... | Start the slot rendering process.
@param string $name
@param string|null $content
@return void | [
"Start",
"the",
"slot",
"rendering",
"process",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/View/Concerns/ManagesComponents.php#L89-L100 | train | This method is used to add a slot to the stack of active slots | [
30522,
2270,
3853,
10453,
1006,
1002,
2171,
1010,
1002,
4180,
1027,
19701,
1007,
1063,
2065,
1006,
4569,
2278,
1035,
16371,
2213,
1035,
12098,
5620,
1006,
1007,
1027,
1027,
1027,
1016,
1007,
1063,
1002,
2023,
1011,
1028,
19832,
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... |
symfony/symfony | src/Symfony/Component/Intl/NumberFormatter/NumberFormatter.php | NumberFormatter.round | private function round($value, $precision)
{
$precision = $this->getUninitializedPrecision($value, $precision);
$roundingModeAttribute = $this->getAttribute(self::ROUNDING_MODE);
if (isset(self::$phpRoundingMap[$roundingModeAttribute])) {
$value = round($value, $precision, self:... | php | private function round($value, $precision)
{
$precision = $this->getUninitializedPrecision($value, $precision);
$roundingModeAttribute = $this->getAttribute(self::ROUNDING_MODE);
if (isset(self::$phpRoundingMap[$roundingModeAttribute])) {
$value = round($value, $precision, self:... | [
"private",
"function",
"round",
"(",
"$",
"value",
",",
"$",
"precision",
")",
"{",
"$",
"precision",
"=",
"$",
"this",
"->",
"getUninitializedPrecision",
"(",
"$",
"value",
",",
"$",
"precision",
")",
";",
"$",
"roundingModeAttribute",
"=",
"$",
"this",
... | Rounds a value.
@param int|float $value The value to round
@param int $precision The number of decimal digits to round to
@return int|float The rounded value | [
"Rounds",
"a",
"value",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Intl/NumberFormatter/NumberFormatter.php#L708-L739 | train | Round value according to the rounding mode | [
30522,
2797,
3853,
2461,
1006,
1002,
3643,
1010,
1002,
11718,
1007,
1063,
30524,
3089,
8569,
2618,
1027,
1002,
2023,
1011,
1028,
2131,
19321,
3089,
8569,
2618,
1006,
2969,
1024,
1024,
26939,
1035,
5549,
1007,
1025,
2065,
1006,
26354,
3388,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
barryvdh/laravel-debugbar | src/Support/Clockwork/Converter.php | Converter.convert | public function convert($data)
{
$meta = $data['__meta'];
// Default output
$output = [
'id' => $meta['id'],
'method' => $meta['method'],
'uri' => $meta['uri'],
'time' => $meta['utime'],
'headers' => [],
'cookies' => []... | php | public function convert($data)
{
$meta = $data['__meta'];
// Default output
$output = [
'id' => $meta['id'],
'method' => $meta['method'],
'uri' => $meta['uri'],
'time' => $meta['utime'],
'headers' => [],
'cookies' => []... | [
"public",
"function",
"convert",
"(",
"$",
"data",
")",
"{",
"$",
"meta",
"=",
"$",
"data",
"[",
"'__meta'",
"]",
";",
"// Default output",
"$",
"output",
"=",
"[",
"'id'",
"=>",
"$",
"meta",
"[",
"'id'",
"]",
",",
"'method'",
"=>",
"$",
"meta",
"[... | Convert the phpdebugbar data to Clockwork format.
@param array $data
@return array | [
"Convert",
"the",
"phpdebugbar",
"data",
"to",
"Clockwork",
"format",
"."
] | 2d195779ea4f809f69764a795e2ec371dbb76a96 | https://github.com/barryvdh/laravel-debugbar/blob/2d195779ea4f809f69764a795e2ec371dbb76a96/src/Support/Clockwork/Converter.php#L11-L136 | train | Convert array from response to response | [
30522,
2270,
3853,
10463,
1006,
1002,
2951,
1007,
1063,
1002,
18804,
1027,
1002,
2951,
1031,
1005,
1035,
1035,
18804,
1005,
1033,
1025,
1013,
1013,
12398,
6434,
1002,
6434,
1027,
1031,
1005,
8909,
1005,
1027,
1028,
1002,
18804,
1031,
1005,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/backend/widgets/Form.php | Form.defineFormFields | protected function defineFormFields()
{
if ($this->fieldsDefined) {
return;
}
/**
* @event backend.form.extendFieldsBefore
* Called before the form fields are defined
*
* Example usage:
*
* Event::listen('backend.form.ext... | php | protected function defineFormFields()
{
if ($this->fieldsDefined) {
return;
}
/**
* @event backend.form.extendFieldsBefore
* Called before the form fields are defined
*
* Example usage:
*
* Event::listen('backend.form.ext... | [
"protected",
"function",
"defineFormFields",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"fieldsDefined",
")",
"{",
"return",
";",
"}",
"/**\n * @event backend.form.extendFieldsBefore\n * Called before the form fields are defined\n *\n * Example usa... | Creates a flat array of form fields from the configuration.
Also slots fields in to their respective tabs.
@return void | [
"Creates",
"a",
"flat",
"array",
"of",
"form",
"fields",
"from",
"the",
"configuration",
".",
"Also",
"slots",
"fields",
"in",
"to",
"their",
"respective",
"tabs",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/Form.php#L461-L646 | train | Define form fields | [
30522,
5123,
3853,
9375,
14192,
15155,
1006,
1007,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
4249,
3207,
23460,
2094,
1007,
1063,
2709,
1025,
1065,
1013,
1008,
1008,
1008,
1030,
2724,
2067,
10497,
1012,
2433,
1012,
7949,
15155,
4783,
29278,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Cache/Simple/ChainCache.php | ChainCache.setMultiple | public function setMultiple($values, $ttl = null)
{
if ($values instanceof \Traversable) {
$valuesIterator = $values;
$values = function () use ($valuesIterator, &$values) {
$generatedValues = [];
foreach ($valuesIterator as $key => $value) {
... | php | public function setMultiple($values, $ttl = null)
{
if ($values instanceof \Traversable) {
$valuesIterator = $values;
$values = function () use ($valuesIterator, &$values) {
$generatedValues = [];
foreach ($valuesIterator as $key => $value) {
... | [
"public",
"function",
"setMultiple",
"(",
"$",
"values",
",",
"$",
"ttl",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"values",
"instanceof",
"\\",
"Traversable",
")",
"{",
"$",
"valuesIterator",
"=",
"$",
"values",
";",
"$",
"values",
"=",
"function",
"(",... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Cache/Simple/ChainCache.php#L204-L228 | train | Set Multiple Values | [
30522,
2270,
3853,
2275,
12274,
7096,
11514,
2571,
1006,
1002,
5300,
1010,
1002,
23746,
2140,
1027,
19701,
1007,
1063,
2065,
1006,
1002,
5300,
6013,
11253,
1032,
29053,
3085,
1007,
1063,
1002,
5300,
21646,
8844,
1027,
1002,
5300,
1025,
1002... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/HttpKernel/HttpCache/AbstractSurrogate.php | AbstractSurrogate.needsParsing | public function needsParsing(Response $response)
{
if (!$control = $response->headers->get('Surrogate-Control')) {
return false;
}
$pattern = sprintf('#content="[^"]*%s/1.0[^"]*"#', strtoupper($this->getName()));
return (bool) preg_match($pattern, $control);
} | php | public function needsParsing(Response $response)
{
if (!$control = $response->headers->get('Surrogate-Control')) {
return false;
}
$pattern = sprintf('#content="[^"]*%s/1.0[^"]*"#', strtoupper($this->getName()));
return (bool) preg_match($pattern, $control);
} | [
"public",
"function",
"needsParsing",
"(",
"Response",
"$",
"response",
")",
"{",
"if",
"(",
"!",
"$",
"control",
"=",
"$",
"response",
"->",
"headers",
"->",
"get",
"(",
"'Surrogate-Control'",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"pattern",
... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpKernel/HttpCache/AbstractSurrogate.php#L77-L86 | train | Returns true if the response needs to be parsed. | [
30522,
2270,
3853,
3791,
19362,
7741,
1006,
3433,
1002,
3433,
1007,
1063,
2065,
1006,
999,
1002,
2491,
1027,
1002,
3433,
1011,
1028,
20346,
2015,
1011,
1028,
2131,
1006,
1005,
7505,
21799,
1011,
2491,
1005,
1007,
1007,
1063,
2709,
6270,
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/Form/Extension/Csrf/Type/FormTypeCsrfExtension.php | FormTypeCsrfExtension.configureOptions | public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
'csrf_protection' => $this->defaultEnabled,
'csrf_field_name' => $this->defaultFieldName,
'csrf_message' => 'The CSRF token is invalid. Please try to resubmit the form.',
'c... | php | public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
'csrf_protection' => $this->defaultEnabled,
'csrf_field_name' => $this->defaultFieldName,
'csrf_message' => 'The CSRF token is invalid. Please try to resubmit the form.',
'c... | [
"public",
"function",
"configureOptions",
"(",
"OptionsResolver",
"$",
"resolver",
")",
"{",
"$",
"resolver",
"->",
"setDefaults",
"(",
"[",
"'csrf_protection'",
"=>",
"$",
"this",
"->",
"defaultEnabled",
",",
"'csrf_field_name'",
"=>",
"$",
"this",
"->",
"defau... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/Extension/Csrf/Type/FormTypeCsrfExtension.php#L105-L114 | train | Configure the options for the Form | [
30522,
2270,
3853,
9530,
8873,
27390,
8780,
16790,
2015,
1006,
7047,
6072,
4747,
6299,
1002,
10663,
2099,
1007,
1063,
1002,
10663,
2099,
1011,
1028,
2275,
3207,
7011,
11314,
2015,
1006,
1031,
1005,
20116,
12881,
1035,
3860,
1005,
1027,
1028... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Config/Definition/Builder/ArrayNodeDefinition.php | ArrayNodeDefinition.useAttributeAsKey | public function useAttributeAsKey($name, $removeKeyItem = true)
{
$this->key = $name;
$this->removeKeyItem = $removeKeyItem;
return $this;
} | php | public function useAttributeAsKey($name, $removeKeyItem = true)
{
$this->key = $name;
$this->removeKeyItem = $removeKeyItem;
return $this;
} | [
"public",
"function",
"useAttributeAsKey",
"(",
"$",
"name",
",",
"$",
"removeKeyItem",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"key",
"=",
"$",
"name",
";",
"$",
"this",
"->",
"removeKeyItem",
"=",
"$",
"removeKeyItem",
";",
"return",
"$",
"this",
"... | Sets the attribute which value is to be used as key.
This is useful when you have an indexed array that should be an
associative array. You can select an item from within the array
to be the key of the particular item. For example, if "id" is the
"key", then:
[
['id' => 'my_name', 'foo' => 'bar'],
];
becomes
[
'my_... | [
"Sets",
"the",
"attribute",
"which",
"value",
"is",
"to",
"be",
"used",
"as",
"key",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Config/Definition/Builder/ArrayNodeDefinition.php#L237-L243 | train | Create a new instance of the class - level namespace | [
30522,
2270,
3853,
2224,
19321,
3089,
8569,
27058,
17140,
2100,
1006,
1002,
2171,
1010,
1002,
6366,
14839,
4221,
2213,
1027,
2995,
1007,
1063,
1002,
2023,
1011,
1028,
3145,
1027,
1002,
2171,
1025,
1002,
2023,
1011,
1028,
6366,
14839,
4221,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
google/flatbuffers | php/Table.php | Table.__string | protected function __string($offset)
{
$offset += $this->bb->getInt($offset);
$len = $this->bb->getInt($offset);
$startPos = $offset + Constants::SIZEOF_INT;
return substr($this->bb->_buffer, $startPos, $len);
} | php | protected function __string($offset)
{
$offset += $this->bb->getInt($offset);
$len = $this->bb->getInt($offset);
$startPos = $offset + Constants::SIZEOF_INT;
return substr($this->bb->_buffer, $startPos, $len);
} | [
"protected",
"function",
"__string",
"(",
"$",
"offset",
")",
"{",
"$",
"offset",
"+=",
"$",
"this",
"->",
"bb",
"->",
"getInt",
"(",
"$",
"offset",
")",
";",
"$",
"len",
"=",
"$",
"this",
"->",
"bb",
"->",
"getInt",
"(",
"$",
"offset",
")",
";",... | fetch utf8 encoded string.
@param $offset
@return string | [
"fetch",
"utf8",
"encoded",
"string",
"."
] | af74f87ccd6ea9bcf9e325427dca7c7faf1d79c1 | https://github.com/google/flatbuffers/blob/af74f87ccd6ea9bcf9e325427dca7c7faf1d79c1/php/Table.php#L72-L78 | train | Read a string from the buffer | [
30522,
5123,
3853,
1035,
1035,
5164,
1006,
1002,
16396,
1007,
1063,
1002,
16396,
1009,
1027,
1002,
2023,
1011,
1028,
22861,
1011,
1028,
2131,
18447,
1006,
1002,
16396,
1007,
1025,
1002,
30524,
1007,
1025,
1002,
2707,
6873,
2015,
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... |
matomo-org/matomo | core/LogDeleter.php | LogDeleter.deleteVisits | public function deleteVisits($visitIds)
{
$numDeletedVisits = 0;
foreach ($this->logTablesProvider->getAllLogTables() as $logTable) {
if ($logTable->getColumnToJoinOnIdVisit()) {
$numVisits = $this->rawLogDao->deleteFromLogTable($logTable->getName(), $visitIds);
... | php | public function deleteVisits($visitIds)
{
$numDeletedVisits = 0;
foreach ($this->logTablesProvider->getAllLogTables() as $logTable) {
if ($logTable->getColumnToJoinOnIdVisit()) {
$numVisits = $this->rawLogDao->deleteFromLogTable($logTable->getName(), $visitIds);
... | [
"public",
"function",
"deleteVisits",
"(",
"$",
"visitIds",
")",
"{",
"$",
"numDeletedVisits",
"=",
"0",
";",
"foreach",
"(",
"$",
"this",
"->",
"logTablesProvider",
"->",
"getAllLogTables",
"(",
")",
"as",
"$",
"logTable",
")",
"{",
"if",
"(",
"$",
"log... | Deletes visits by ID. This method cascades, so conversions, conversion items and visit actions for
the visits are also deleted.
@param int[] $visitIds
@return int The number of deleted visits. | [
"Deletes",
"visits",
"by",
"ID",
".",
"This",
"method",
"cascades",
"so",
"conversions",
"conversion",
"items",
"and",
"visit",
"actions",
"for",
"the",
"visits",
"are",
"also",
"deleted",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/LogDeleter.php#L43-L57 | train | Delete visits from all log tables | [
30522,
2270,
3853,
3972,
12870,
11365,
12762,
1006,
1002,
3942,
9821,
1007,
1063,
1002,
16371,
26876,
12260,
3064,
11365,
12762,
1027,
1014,
1025,
18921,
6776,
1006,
1002,
2023,
1011,
1028,
8833,
10880,
13102,
12298,
18688,
1011,
1028,
2131,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Common/Page/Medium/AudioMedium.php | AudioMedium.loop | public function loop($status = false)
{
if($status) {
$this->attributes['loop'] = true;
} else {
unset($this->attributes['loop']);
}
return $this;
} | php | public function loop($status = false)
{
if($status) {
$this->attributes['loop'] = true;
} else {
unset($this->attributes['loop']);
}
return $this;
} | [
"public",
"function",
"loop",
"(",
"$",
"status",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"status",
")",
"{",
"$",
"this",
"->",
"attributes",
"[",
"'loop'",
"]",
"=",
"true",
";",
"}",
"else",
"{",
"unset",
"(",
"$",
"this",
"->",
"attributes",
... | Allows to set the loop attribute
@param bool $status
@return $this | [
"Allows",
"to",
"set",
"the",
"loop",
"attribute"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Page/Medium/AudioMedium.php#L106-L115 | train | Set loop attribute | [
30522,
2270,
3853,
7077,
1006,
1002,
3570,
1027,
6270,
1007,
1063,
2065,
1006,
1002,
3570,
1007,
1063,
1002,
2023,
1011,
1028,
12332,
1031,
1005,
7077,
1005,
1033,
1027,
2995,
1025,
1065,
2842,
1063,
4895,
13462,
1006,
1002,
2023,
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... |
octobercms/october | modules/system/helpers/DateTime.php | DateTime.momentFormat | public static function momentFormat($format)
{
$replacements = [
'd' => 'DD',
'D' => 'ddd',
'j' => 'D',
'l' => 'dddd',
'N' => 'E',
'S' => 'o',
'w' => 'e',
'z' => 'DDD',
'W' => 'W',
'F' => ... | php | public static function momentFormat($format)
{
$replacements = [
'd' => 'DD',
'D' => 'ddd',
'j' => 'D',
'l' => 'dddd',
'N' => 'E',
'S' => 'o',
'w' => 'e',
'z' => 'DDD',
'W' => 'W',
'F' => ... | [
"public",
"static",
"function",
"momentFormat",
"(",
"$",
"format",
")",
"{",
"$",
"replacements",
"=",
"[",
"'d'",
"=>",
"'DD'",
",",
"'D'",
"=>",
"'ddd'",
",",
"'j'",
"=>",
"'D'",
",",
"'l'",
"=>",
"'dddd'",
",",
"'N'",
"=>",
"'E'",
",",
"'S'",
"... | Converts a PHP date format to "Moment.js" format.
@param string $format
@return string | [
"Converts",
"a",
"PHP",
"date",
"format",
"to",
"Moment",
".",
"js",
"format",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/helpers/DateTime.php#L86-L133 | train | Format moment according to specifed format | [
30522,
2270,
10763,
3853,
2617,
14192,
4017,
1006,
1002,
4289,
1007,
1063,
1002,
23936,
1027,
1031,
1005,
1040,
1005,
1027,
1028,
1005,
20315,
1005,
1010,
1005,
1040,
1005,
1027,
1028,
1005,
20315,
2094,
1005,
1010,
1005,
1046,
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/Framework/Flex/FlexObject.php | FlexObject.getForm | public function getForm(string $name = '', array $form = null)
{
if (!isset($this->_forms[$name])) {
$this->_forms[$name] = $this->createFormObject($name, $form);
}
return $this->_forms[$name];
} | php | public function getForm(string $name = '', array $form = null)
{
if (!isset($this->_forms[$name])) {
$this->_forms[$name] = $this->createFormObject($name, $form);
}
return $this->_forms[$name];
} | [
"public",
"function",
"getForm",
"(",
"string",
"$",
"name",
"=",
"''",
",",
"array",
"$",
"form",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"_forms",
"[",
"$",
"name",
"]",
")",
")",
"{",
"$",
"this",
"->",
"_form... | {@inheritdoc}
@see FlexObjectInterface::getForm() | [
"{"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Framework/Flex/FlexObject.php#L615-L622 | train | Get Form Object | [
30522,
2270,
3853,
2131,
14192,
1006,
5164,
1002,
2171,
1027,
1005,
1005,
1010,
9140,
1002,
2433,
1027,
19701,
1007,
30524,
1002,
2171,
1010,
1002,
2433,
1007,
1025,
1065,
2709,
1002,
2023,
1011,
1028,
1035,
3596,
1031,
1002,
2171,
1033,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Bridge/Monolog/Handler/SwiftMailerHandler.php | SwiftMailerHandler.send | protected function send($content, array $records)
{
parent::send($content, $records);
if ($this->instantFlush) {
$this->flushMemorySpool();
}
} | php | protected function send($content, array $records)
{
parent::send($content, $records);
if ($this->instantFlush) {
$this->flushMemorySpool();
}
} | [
"protected",
"function",
"send",
"(",
"$",
"content",
",",
"array",
"$",
"records",
")",
"{",
"parent",
"::",
"send",
"(",
"$",
"content",
",",
"$",
"records",
")",
";",
"if",
"(",
"$",
"this",
"->",
"instantFlush",
")",
"{",
"$",
"this",
"->",
"fl... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bridge/Monolog/Handler/SwiftMailerHandler.php#L55-L62 | train | Override the send method to flush memory spool if necessary | [
30522,
5123,
3853,
4604,
1006,
1002,
4180,
1010,
9140,
1002,
2636,
1007,
1063,
6687,
1024,
1024,
4604,
1006,
1002,
4180,
1010,
1002,
2636,
1007,
1025,
2065,
1006,
1002,
2023,
1011,
1028,
7107,
10258,
20668,
1007,
1063,
1002,
2023,
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... |
matomo-org/matomo | core/Tracker/Request.php | Request.getPageGenerationTime | public function getPageGenerationTime()
{
$generationTime = $this->getParam('gt_ms');
if ($generationTime > 0
&& $generationTime < self::GENERATION_TIME_MS_MAXIMUM
) {
return (int)$generationTime;
}
return false;
} | php | public function getPageGenerationTime()
{
$generationTime = $this->getParam('gt_ms');
if ($generationTime > 0
&& $generationTime < self::GENERATION_TIME_MS_MAXIMUM
) {
return (int)$generationTime;
}
return false;
} | [
"public",
"function",
"getPageGenerationTime",
"(",
")",
"{",
"$",
"generationTime",
"=",
"$",
"this",
"->",
"getParam",
"(",
"'gt_ms'",
")",
";",
"if",
"(",
"$",
"generationTime",
">",
"0",
"&&",
"$",
"generationTime",
"<",
"self",
"::",
"GENERATION_TIME_MS... | 1 hour | [
"1",
"hour"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Tracker/Request.php#L846-L856 | train | Get Page Generation Time | [
30522,
2270,
3853,
2131,
13704,
6914,
16754,
7292,
1006,
1007,
1063,
1002,
4245,
7292,
1027,
1002,
2023,
1011,
1028,
2131,
28689,
2213,
1006,
1005,
14181,
1035,
5796,
1005,
1007,
1025,
2065,
1006,
1002,
4245,
7292,
1028,
1014,
1004,
1004,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/RankingQuery.php | RankingQuery.generateRankingQuery | public function generateRankingQuery($innerQuery)
{
// +1 to include "Others"
$limit = $this->limit + 1;
$counterExpression = $this->getCounterExpression($limit);
// generate select clauses for label columns
$labelColumnsString = '`' . implode('`, `', array_keys($this->label... | php | public function generateRankingQuery($innerQuery)
{
// +1 to include "Others"
$limit = $this->limit + 1;
$counterExpression = $this->getCounterExpression($limit);
// generate select clauses for label columns
$labelColumnsString = '`' . implode('`, `', array_keys($this->label... | [
"public",
"function",
"generateRankingQuery",
"(",
"$",
"innerQuery",
")",
"{",
"// +1 to include \"Others\"",
"$",
"limit",
"=",
"$",
"this",
"->",
"limit",
"+",
"1",
";",
"$",
"counterExpression",
"=",
"$",
"this",
"->",
"getCounterExpression",
"(",
"$",
"li... | Generate the SQL code that does the magic.
If you want to get the result, use execute() instead. If you want to run the query
yourself, use this method.
@param $innerQuery string The "payload" query that does the actual data aggregation. The ordering
has to be specified in this query. {@link RankingQuery} cannot appl... | [
"Generate",
"the",
"SQL",
"code",
"that",
"does",
"the",
"magic",
".",
"If",
"you",
"want",
"to",
"get",
"the",
"result",
"use",
"execute",
"()",
"instead",
".",
"If",
"you",
"want",
"to",
"run",
"the",
"query",
"yourself",
"use",
"this",
"method",
"."... | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/RankingQuery.php#L279-L345 | train | Generate the ranking query for the query | [
30522,
2270,
3853,
9699,
26763,
2075,
4226,
2854,
1006,
1002,
5110,
4226,
2854,
1007,
1063,
1013,
1013,
1009,
1015,
2000,
2421,
1000,
2500,
1000,
1002,
5787,
1027,
1002,
2023,
1011,
1028,
5787,
1009,
1015,
1025,
1002,
4675,
10288,
20110,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Storage.php | Storage.persistentFake | public static function persistentFake($disk = null)
{
$disk = $disk ?: self::$app['config']->get('filesystems.default');
static::set($disk, $fake = self::createLocalDriver([
'root' => storage_path('framework/testing/disks/'.$disk),
]));
return $fake;
} | php | public static function persistentFake($disk = null)
{
$disk = $disk ?: self::$app['config']->get('filesystems.default');
static::set($disk, $fake = self::createLocalDriver([
'root' => storage_path('framework/testing/disks/'.$disk),
]));
return $fake;
} | [
"public",
"static",
"function",
"persistentFake",
"(",
"$",
"disk",
"=",
"null",
")",
"{",
"$",
"disk",
"=",
"$",
"disk",
"?",
":",
"self",
"::",
"$",
"app",
"[",
"'config'",
"]",
"->",
"get",
"(",
"'filesystems.default'",
")",
";",
"static",
"::",
"... | Replace the given disk with a persistent local testing disk.
@param string|null $disk
@return \Illuminate\Filesystem\Filesystem | [
"Replace",
"the",
"given",
"disk",
"with",
"a",
"persistent",
"local",
"testing",
"disk",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Support/Facades/Storage.php#L40-L49 | train | Create a persistent fake disk | [
30522,
2270,
10763,
3853,
14516,
7011,
3489,
1006,
1002,
9785,
1027,
19701,
1007,
1063,
1002,
9785,
1027,
1002,
9785,
1029,
1024,
2969,
1024,
1024,
1002,
10439,
1031,
1005,
9530,
8873,
2290,
1005,
1033,
1011,
1028,
2131,
1006,
1005,
6764,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Relation.php | Relation.whereInMethod | protected function whereInMethod(Model $model, $key)
{
return $model->getKeyName() === last(explode('.', $key))
&& $model->getIncrementing()
&& in_array($model->getKeyType(), ['int', 'integer'])
? 'whereIntegerInRaw'
: '... | php | protected function whereInMethod(Model $model, $key)
{
return $model->getKeyName() === last(explode('.', $key))
&& $model->getIncrementing()
&& in_array($model->getKeyType(), ['int', 'integer'])
? 'whereIntegerInRaw'
: '... | [
"protected",
"function",
"whereInMethod",
"(",
"Model",
"$",
"model",
",",
"$",
"key",
")",
"{",
"return",
"$",
"model",
"->",
"getKeyName",
"(",
")",
"===",
"last",
"(",
"explode",
"(",
"'.'",
",",
"$",
"key",
")",
")",
"&&",
"$",
"model",
"->",
"... | Get the name of the "where in" method for eager loading.
@param \Illuminate\Database\Eloquent\Model $model
@param string $key
@return string | [
"Get",
"the",
"name",
"of",
"the",
"where",
"in",
"method",
"for",
"eager",
"loading",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Relations/Relation.php#L317-L324 | train | Internal method to check if the key is in the right order | [
30522,
5123,
3853,
16726,
11368,
6806,
2094,
1006,
2944,
1002,
2944,
1010,
1002,
3145,
1007,
1063,
2709,
1002,
2944,
1011,
1028,
2131,
14839,
18442,
1006,
1007,
1027,
1027,
1027,
2197,
1006,
15044,
1006,
1005,
1012,
1005,
1010,
1002,
3145,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Framework/Flex/FlexObject.php | FlexObject.exists | public function exists(): bool
{
$key = $this->getStorageKey();
return $key && $this->getFlexDirectory()->getStorage()->hasKey($key);
} | php | public function exists(): bool
{
$key = $this->getStorageKey();
return $key && $this->getFlexDirectory()->getStorage()->hasKey($key);
} | [
"public",
"function",
"exists",
"(",
")",
":",
"bool",
"{",
"$",
"key",
"=",
"$",
"this",
"->",
"getStorageKey",
"(",
")",
";",
"return",
"$",
"key",
"&&",
"$",
"this",
"->",
"getFlexDirectory",
"(",
")",
"->",
"getStorage",
"(",
")",
"->",
"hasKey",... | {@inheritdoc}
@see FlexObjectInterface::exists() | [
"{"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Framework/Flex/FlexObject.php#L221-L226 | train | Check if the current page exists in the flex directory | [
30522,
2270,
3853,
6526,
1006,
1007,
1024,
22017,
2140,
1063,
1002,
3145,
1027,
1002,
2023,
1011,
1028,
4152,
4263,
4270,
14839,
1006,
1007,
1025,
2709,
1002,
3145,
1004,
1004,
1002,
2023,
1011,
1028,
2131,
21031,
2595,
4305,
2890,
16761,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
z-song/laravel-admin | src/Console/InstallCommand.php | InstallCommand.createAuthController | public function createAuthController()
{
$authController = $this->directory.'/Controllers/AuthController.php';
$contents = $this->getStub('AuthController');
$this->laravel['files']->put(
$authController,
str_replace('DummyNamespace', config('admin.route.namespace'), ... | php | public function createAuthController()
{
$authController = $this->directory.'/Controllers/AuthController.php';
$contents = $this->getStub('AuthController');
$this->laravel['files']->put(
$authController,
str_replace('DummyNamespace', config('admin.route.namespace'), ... | [
"public",
"function",
"createAuthController",
"(",
")",
"{",
"$",
"authController",
"=",
"$",
"this",
"->",
"directory",
".",
"'/Controllers/AuthController.php'",
";",
"$",
"contents",
"=",
"$",
"this",
"->",
"getStub",
"(",
"'AuthController'",
")",
";",
"$",
... | Create AuthController.
@return void | [
"Create",
"AuthController",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Console/InstallCommand.php#L108-L118 | train | Create AuthController file | [
30522,
2270,
3853,
3443,
4887,
2705,
8663,
13181,
10820,
1006,
1007,
1063,
1002,
8740,
2705,
8663,
13181,
10820,
1027,
1002,
2023,
1011,
1028,
14176,
1012,
1005,
1013,
21257,
1013,
8740,
2705,
8663,
13181,
10820,
1012,
25718,
1005,
1025,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Filesystem/FilesystemAdapter.php | FilesystemAdapter.readStream | public function readStream($path)
{
try {
$resource = $this->driver->readStream($path);
return $resource ? $resource : null;
} catch (FileNotFoundException $e) {
throw new ContractFileNotFoundException($e->getMessage(), $e->getCode(), $e);
}
} | php | public function readStream($path)
{
try {
$resource = $this->driver->readStream($path);
return $resource ? $resource : null;
} catch (FileNotFoundException $e) {
throw new ContractFileNotFoundException($e->getMessage(), $e->getCode(), $e);
}
} | [
"public",
"function",
"readStream",
"(",
"$",
"path",
")",
"{",
"try",
"{",
"$",
"resource",
"=",
"$",
"this",
"->",
"driver",
"->",
"readStream",
"(",
"$",
"path",
")",
";",
"return",
"$",
"resource",
"?",
"$",
"resource",
":",
"null",
";",
"}",
"... | {@inheritdoc} | [
"{"
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Filesystem/FilesystemAdapter.php#L415-L424 | train | Reads a stream of file | [
30522,
2270,
3853,
9631,
25379,
1006,
1002,
4130,
1007,
1063,
3046,
1063,
1002,
7692,
1027,
1002,
2023,
1011,
1028,
4062,
1011,
1028,
9631,
25379,
1006,
1002,
4130,
1007,
1025,
2709,
1002,
7692,
1029,
1002,
7692,
1024,
19701,
1025,
1065,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/CoreAdminHome/Tasks.php | Tasks.updateSpammerBlacklist | public function updateSpammerBlacklist()
{
$url = 'https://raw.githubusercontent.com/matomo-org/referrer-spam-blacklist/master/spammers.txt';
$list = Http::sendHttpRequest($url, 30);
$list = preg_split("/\r\n|\n|\r/", $list);
if (count($list) < 10) {
throw new \Exception(... | php | public function updateSpammerBlacklist()
{
$url = 'https://raw.githubusercontent.com/matomo-org/referrer-spam-blacklist/master/spammers.txt';
$list = Http::sendHttpRequest($url, 30);
$list = preg_split("/\r\n|\n|\r/", $list);
if (count($list) < 10) {
throw new \Exception(... | [
"public",
"function",
"updateSpammerBlacklist",
"(",
")",
"{",
"$",
"url",
"=",
"'https://raw.githubusercontent.com/matomo-org/referrer-spam-blacklist/master/spammers.txt'",
";",
"$",
"list",
"=",
"Http",
"::",
"sendHttpRequest",
"(",
"$",
"url",
",",
"30",
")",
";",
... | Update the referrer spam blacklist
@see https://github.com/matomo-org/referrer-spam-blacklist | [
"Update",
"the",
"referrer",
"spam",
"blacklist"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/CoreAdminHome/Tasks.php#L250-L263 | train | Update the referrer spam blacklist | [
30522,
2270,
3853,
14409,
4502,
15810,
28522,
3600,
9863,
1006,
1007,
1063,
1002,
24471,
2140,
1027,
1005,
16770,
1024,
1013,
1013,
6315,
1012,
21025,
2705,
12083,
20330,
8663,
6528,
2102,
1012,
4012,
1013,
13523,
19506,
1011,
8917,
1013,
6... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Auth/Notifications/VerifyEmail.php | VerifyEmail.toMail | public function toMail($notifiable)
{
if (static::$toMailCallback) {
return call_user_func(static::$toMailCallback, $notifiable);
}
return (new MailMessage)
->subject(Lang::getFromJson('Verify Email Address'))
->line(Lang::getFromJson('Please click the bu... | php | public function toMail($notifiable)
{
if (static::$toMailCallback) {
return call_user_func(static::$toMailCallback, $notifiable);
}
return (new MailMessage)
->subject(Lang::getFromJson('Verify Email Address'))
->line(Lang::getFromJson('Please click the bu... | [
"public",
"function",
"toMail",
"(",
"$",
"notifiable",
")",
"{",
"if",
"(",
"static",
"::",
"$",
"toMailCallback",
")",
"{",
"return",
"call_user_func",
"(",
"static",
"::",
"$",
"toMailCallback",
",",
"$",
"notifiable",
")",
";",
"}",
"return",
"(",
"n... | Build the mail representation of the notification.
@param mixed $notifiable
@return \Illuminate\Notifications\Messages\MailMessage | [
"Build",
"the",
"mail",
"representation",
"of",
"the",
"notification",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Auth/Notifications/VerifyEmail.php#L38-L52 | train | To Mail Message | [
30522,
2270,
3853,
3419,
12502,
1006,
1002,
2025,
10128,
19210,
1007,
1063,
2065,
1006,
10763,
1024,
1024,
1002,
3419,
12502,
9289,
20850,
8684,
1007,
1063,
2709,
2655,
1035,
5310,
1035,
4569,
2278,
1006,
10763,
1024,
1024,
1002,
3419,
1250... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/cms/classes/Content.php | Content.parseMarkup | public function parseMarkup()
{
$extension = strtolower(File::extension($this->fileName));
switch ($extension) {
case 'txt':
$result = htmlspecialchars($this->markup);
break;
case 'md':
$result = Markdown::parse($this->markup);... | php | public function parseMarkup()
{
$extension = strtolower(File::extension($this->fileName));
switch ($extension) {
case 'txt':
$result = htmlspecialchars($this->markup);
break;
case 'md':
$result = Markdown::parse($this->markup);... | [
"public",
"function",
"parseMarkup",
"(",
")",
"{",
"$",
"extension",
"=",
"strtolower",
"(",
"File",
"::",
"extension",
"(",
"$",
"this",
"->",
"fileName",
")",
")",
";",
"switch",
"(",
"$",
"extension",
")",
"{",
"case",
"'txt'",
":",
"$",
"result",
... | Parses the content markup according to the file type.
@return string | [
"Parses",
"the",
"content",
"markup",
"according",
"to",
"the",
"file",
"type",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/Content.php#L56-L72 | train | Parse markup for the current file | [
30522,
2270,
3853,
11968,
3366,
10665,
6279,
1006,
1007,
1063,
1002,
5331,
1027,
2358,
5339,
12898,
13777,
1006,
5371,
1024,
1024,
5331,
1006,
1002,
2023,
1011,
1028,
5371,
18442,
1007,
1007,
1025,
6942,
1006,
1002,
5331,
1007,
1063,
2553,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/Archive.php | Archive.cacheArchiveIdsAfterLaunching | private function cacheArchiveIdsAfterLaunching($archiveGroups, $plugins)
{
$this->invalidatedReportsIfNeeded();
$today = Date::today();
foreach ($this->params->getPeriods() as $period) {
$twoDaysBeforePeriod = $period->getDateStart()->subDay(2);
$twoDaysAfterPeriod ... | php | private function cacheArchiveIdsAfterLaunching($archiveGroups, $plugins)
{
$this->invalidatedReportsIfNeeded();
$today = Date::today();
foreach ($this->params->getPeriods() as $period) {
$twoDaysBeforePeriod = $period->getDateStart()->subDay(2);
$twoDaysAfterPeriod ... | [
"private",
"function",
"cacheArchiveIdsAfterLaunching",
"(",
"$",
"archiveGroups",
",",
"$",
"plugins",
")",
"{",
"$",
"this",
"->",
"invalidatedReportsIfNeeded",
"(",
")",
";",
"$",
"today",
"=",
"Date",
"::",
"today",
"(",
")",
";",
"foreach",
"(",
"$",
... | Gets the IDs of the archives we're querying for and stores them in $this->archives.
This function will launch the archiving process for each period/site/plugin if
metrics/reports have not been calculated/archived already.
@param array $archiveGroups @see getArchiveGroupOfReport
@param array $plugins List of plugin nam... | [
"Gets",
"the",
"IDs",
"of",
"the",
"archives",
"we",
"re",
"querying",
"for",
"and",
"stores",
"them",
"in",
"$this",
"-",
">",
"archives",
".",
"This",
"function",
"will",
"launch",
"the",
"archiving",
"process",
"for",
"each",
"period",
"/",
"site",
"/... | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Archive.php#L639-L671 | train | Cache archive ids after launching | [
30522,
2797,
3853,
17053,
2906,
5428,
3726,
9821,
10354,
3334,
17298,
12680,
2075,
1006,
1002,
8756,
17058,
2015,
1010,
1002,
13354,
7076,
1007,
1063,
1002,
2023,
1011,
1028,
19528,
4383,
2890,
25378,
10128,
24045,
5732,
1006,
1007,
1025,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/CronArchive.php | CronArchive.archiveReportsFor | private function archiveReportsFor($idSite, $period, $date, $archiveSegments, Timer $periodTimer, $visitsToday = 0, $visitsLastDays = 0)
{
$url = $this->getVisitsRequestUrl($idSite, $period, $date, $segment = false);
$url = $this->makeRequestUrl($url);
$visitsInLastPeriod = $visitsToday;
... | php | private function archiveReportsFor($idSite, $period, $date, $archiveSegments, Timer $periodTimer, $visitsToday = 0, $visitsLastDays = 0)
{
$url = $this->getVisitsRequestUrl($idSite, $period, $date, $segment = false);
$url = $this->makeRequestUrl($url);
$visitsInLastPeriod = $visitsToday;
... | [
"private",
"function",
"archiveReportsFor",
"(",
"$",
"idSite",
",",
"$",
"period",
",",
"$",
"date",
",",
"$",
"archiveSegments",
",",
"Timer",
"$",
"periodTimer",
",",
"$",
"visitsToday",
"=",
"0",
",",
"$",
"visitsLastDays",
"=",
"0",
")",
"{",
"$",
... | Will trigger API requests for the specified Website $idSite,
for the specified $period, for all segments that are pre-processed for this website.
Requests are triggered using cURL multi handle
@param $idSite int
@param $period string
@param $date string
@param $archiveSegments bool Whether to pre-process all custom se... | [
"Will",
"trigger",
"API",
"requests",
"for",
"the",
"specified",
"Website",
"$idSite",
"for",
"the",
"specified",
"$period",
"for",
"all",
"segments",
"that",
"are",
"pre",
"-",
"processed",
"for",
"this",
"website",
".",
"Requests",
"are",
"triggered",
"using... | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/CronArchive.php#L976-L1050 | train | Archives reports for a given site | [
30522,
2797,
3853,
8756,
2890,
25378,
29278,
1006,
1002,
8909,
28032,
2063,
1010,
1002,
2558,
1010,
1002,
3058,
1010,
1002,
8264,
13910,
8163,
1010,
25309,
1002,
2558,
7292,
2099,
1010,
1002,
7879,
3406,
10259,
1027,
1014,
1010,
1002,
7879,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/GPM.php | GPM.findPackage | public function findPackage($search, $ignore_exception = false)
{
$search = strtolower($search);
$found = $this->getRepositoryTheme($search);
if ($found) {
return $found;
}
$found = $this->getRepositoryPlugin($search);
if ($found) {
return $f... | php | public function findPackage($search, $ignore_exception = false)
{
$search = strtolower($search);
$found = $this->getRepositoryTheme($search);
if ($found) {
return $found;
}
$found = $this->getRepositoryPlugin($search);
if ($found) {
return $f... | [
"public",
"function",
"findPackage",
"(",
"$",
"search",
",",
"$",
"ignore_exception",
"=",
"false",
")",
"{",
"$",
"search",
"=",
"strtolower",
"(",
"$",
"search",
")",
";",
"$",
"found",
"=",
"$",
"this",
"->",
"getRepositoryTheme",
"(",
"$",
"search",... | Searches for a Package in the repository
@param string $search Can be either the slug or the name
@param bool $ignore_exception True if should not fire an exception (for use in Twig)
@return Remote\Package|bool Package if found, FALSE if not | [
"Searches",
"for",
"a",
"Package",
"in",
"the",
"repository"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/GPM/GPM.php#L457-L503 | train | Find a package by slug | [
30522,
2270,
3853,
2424,
23947,
4270,
1006,
1002,
3945,
1010,
1002,
8568,
1035,
6453,
1027,
6270,
1007,
1063,
1002,
3945,
1027,
2358,
5339,
12898,
13777,
1006,
1002,
3945,
1007,
1025,
1002,
2179,
1027,
1002,
2023,
1011,
1028,
2131,
2890,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Database/Schema/Grammars/Grammar.php | Grammar.compileForeign | public function compileForeign(Blueprint $blueprint, Fluent $command)
{
// We need to prepare several of the elements of the foreign key definition
// before we can create the SQL, such as wrapping the tables and convert
// an array of columns to comma-delimited strings for the SQL queries.
... | php | public function compileForeign(Blueprint $blueprint, Fluent $command)
{
// We need to prepare several of the elements of the foreign key definition
// before we can create the SQL, such as wrapping the tables and convert
// an array of columns to comma-delimited strings for the SQL queries.
... | [
"public",
"function",
"compileForeign",
"(",
"Blueprint",
"$",
"blueprint",
",",
"Fluent",
"$",
"command",
")",
"{",
"// We need to prepare several of the elements of the foreign key definition",
"// before we can create the SQL, such as wrapping the tables and convert",
"// an array o... | Compile a foreign key command.
@param \Illuminate\Database\Schema\Blueprint $blueprint
@param \Illuminate\Support\Fluent $command
@return string | [
"Compile",
"a",
"foreign",
"key",
"command",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Schema/Grammars/Grammar.php#L65-L96 | train | Compiles the foreign key definition | [
30522,
2270,
3853,
4012,
22090,
29278,
7416,
16206,
1006,
2630,
16550,
1002,
2630,
16550,
1010,
19376,
1002,
3094,
1007,
1063,
1013,
1013,
2057,
2342,
2000,
7374,
2195,
1997,
1996,
3787,
1997,
1996,
3097,
3145,
6210,
1013,
1013,
2077,
2057,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
dompdf/dompdf | src/Css/AttributeTranslator.php | AttributeTranslator._set_table_cellpadding | static protected function _set_table_cellpadding(\DOMElement $node, $value)
{
$cell_list = self::get_cell_list($node);
foreach ($cell_list as $cell) {
self::append_style($cell, "; padding: {$value}px;");
}
return null;
} | php | static protected function _set_table_cellpadding(\DOMElement $node, $value)
{
$cell_list = self::get_cell_list($node);
foreach ($cell_list as $cell) {
self::append_style($cell, "; padding: {$value}px;");
}
return null;
} | [
"static",
"protected",
"function",
"_set_table_cellpadding",
"(",
"\\",
"DOMElement",
"$",
"node",
",",
"$",
"value",
")",
"{",
"$",
"cell_list",
"=",
"self",
"::",
"get_cell_list",
"(",
"$",
"node",
")",
";",
"foreach",
"(",
"$",
"cell_list",
"as",
"$",
... | @param \DOMElement $node
@param string $value
@return null | [
"@param",
"\\",
"DOMElement",
"$node",
"@param",
"string",
"$value"
] | 75f13c700009be21a1965dc2c5b68a8708c22ba2 | https://github.com/dompdf/dompdf/blob/75f13c700009be21a1965dc2c5b68a8708c22ba2/src/Css/AttributeTranslator.php#L361-L370 | train | Set Table cell padding | [
30522,
10763,
5123,
3853,
1035,
2275,
1035,
2795,
1035,
3526,
15455,
4667,
1006,
1032,
8514,
16930,
4765,
1002,
13045,
1010,
1002,
3643,
1007,
1063,
1002,
3526,
1035,
2862,
1027,
2969,
1024,
1024,
2131,
1035,
3526,
1035,
2862,
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... |
guzzle/guzzle | src/Pool.php | Pool.batch | public static function batch(
ClientInterface $client,
$requests,
array $options = []
) {
$res = [];
self::cmpCallback($options, 'fulfilled', $res);
self::cmpCallback($options, 'rejected', $res);
$pool = new static($client, $requests, $options);
$pool-... | php | public static function batch(
ClientInterface $client,
$requests,
array $options = []
) {
$res = [];
self::cmpCallback($options, 'fulfilled', $res);
self::cmpCallback($options, 'rejected', $res);
$pool = new static($client, $requests, $options);
$pool-... | [
"public",
"static",
"function",
"batch",
"(",
"ClientInterface",
"$",
"client",
",",
"$",
"requests",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"res",
"=",
"[",
"]",
";",
"self",
"::",
"cmpCallback",
"(",
"$",
"options",
",",
"'fulf... | Sends multiple requests concurrently and returns an array of responses
and exceptions that uses the same ordering as the provided requests.
IMPORTANT: This method keeps every request and response in memory, and
as such, is NOT recommended when sending a large number or an
indeterminate number of requests concurrently.... | [
"Sends",
"multiple",
"requests",
"concurrently",
"and",
"returns",
"an",
"array",
"of",
"responses",
"and",
"exceptions",
"that",
"uses",
"the",
"same",
"ordering",
"as",
"the",
"provided",
"requests",
"."
] | bf595424e4d442a190582e088985dc835a789071 | https://github.com/guzzle/guzzle/blob/bf595424e4d442a190582e088985dc835a789071/src/Pool.php#L94-L107 | train | Batch request to cache | [
30522,
2270,
10763,
3853,
14108,
1006,
7396,
18447,
2121,
12172,
1002,
7396,
1010,
1002,
11186,
1010,
9140,
1002,
7047,
1027,
1031,
1033,
1007,
1063,
1002,
24501,
1027,
1031,
1033,
1025,
2969,
1024,
1024,
4642,
15042,
8095,
5963,
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... |
matomo-org/matomo | core/Translation/Transifex/API.php | API.getAvailableLanguageCodes | public function getAvailableLanguageCodes()
{
$cache = Cache::getTransientCache();
$cacheId = 'transifex_languagescodes_' . $this->projectSlug;
$languageCodes = $cache->fetch($cacheId);
if (empty($languageCodes)) {
$apiData = $this->getApiResults('project/' . $this->proj... | php | public function getAvailableLanguageCodes()
{
$cache = Cache::getTransientCache();
$cacheId = 'transifex_languagescodes_' . $this->projectSlug;
$languageCodes = $cache->fetch($cacheId);
if (empty($languageCodes)) {
$apiData = $this->getApiResults('project/' . $this->proj... | [
"public",
"function",
"getAvailableLanguageCodes",
"(",
")",
"{",
"$",
"cache",
"=",
"Cache",
"::",
"getTransientCache",
"(",
")",
";",
"$",
"cacheId",
"=",
"'transifex_languagescodes_'",
".",
"$",
"this",
"->",
"projectSlug",
";",
"$",
"languageCodes",
"=",
"... | Returns all language codes the transifex project is available for
@return array
@throws AuthenticationFailedException
@throws Exception | [
"Returns",
"all",
"language",
"codes",
"the",
"transifex",
"project",
"is",
"available",
"for"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Translation/Transifex/API.php#L74-L88 | train | Get available language codes | [
30522,
2270,
3853,
2131,
12462,
11733,
3468,
25023,
6692,
3351,
23237,
1006,
1007,
1063,
1002,
17053,
1027,
17053,
1024,
1024,
2131,
6494,
3619,
11638,
3540,
5403,
1006,
1007,
1025,
1002,
17053,
3593,
1027,
1005,
9099,
29323,
2595,
1035,
41... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/DataAccess/RawLogDao.php | RawLogDao.createLogIterationQuery | private function createLogIterationQuery($logTable, $idField, $fields, $conditions, $iterationStep)
{
$bind = array();
$sql = "SELECT " . implode(', ', $fields) . " FROM `" . Common::prefixTable($logTable) . "` WHERE $idField > ?";
foreach ($conditions as $condition) {
list($co... | php | private function createLogIterationQuery($logTable, $idField, $fields, $conditions, $iterationStep)
{
$bind = array();
$sql = "SELECT " . implode(', ', $fields) . " FROM `" . Common::prefixTable($logTable) . "` WHERE $idField > ?";
foreach ($conditions as $condition) {
list($co... | [
"private",
"function",
"createLogIterationQuery",
"(",
"$",
"logTable",
",",
"$",
"idField",
",",
"$",
"fields",
",",
"$",
"conditions",
",",
"$",
"iterationStep",
")",
"{",
"$",
"bind",
"=",
"array",
"(",
")",
";",
"$",
"sql",
"=",
"\"SELECT \"",
".",
... | mapping for dimensions => segments, and each dimension should automatically have a segment. | [
"mapping",
"for",
"dimensions",
"=",
">",
"segments",
"and",
"each",
"dimension",
"should",
"automatically",
"have",
"a",
"segment",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataAccess/RawLogDao.php#L249-L272 | train | Creates the SQL query for the log iteration | [
30522,
2797,
3853,
3443,
21197,
21646,
3370,
4226,
2854,
1006,
1002,
8833,
10880,
1010,
1002,
24011,
12891,
1010,
1002,
4249,
1010,
1002,
3785,
1010,
1002,
27758,
13473,
2361,
1007,
1063,
1002,
14187,
1027,
9140,
1006,
1007,
1025,
1002,
292... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Common/Filesystem/RecursiveFolderFilterIterator.php | RecursiveFolderFilterIterator.accept | public function accept()
{
/** @var \SplFileInfo $current */
$current = $this->current();
return $current->isDir() && !in_array($current->getFilename(), $this::$ignore_folders, true);
} | php | public function accept()
{
/** @var \SplFileInfo $current */
$current = $this->current();
return $current->isDir() && !in_array($current->getFilename(), $this::$ignore_folders, true);
} | [
"public",
"function",
"accept",
"(",
")",
"{",
"/** @var \\SplFileInfo $current */",
"$",
"current",
"=",
"$",
"this",
"->",
"current",
"(",
")",
";",
"return",
"$",
"current",
"->",
"isDir",
"(",
")",
"&&",
"!",
"in_array",
"(",
"$",
"current",
"->",
"g... | Check whether the current element of the iterator is acceptable
@return bool true if the current element is acceptable, otherwise false. | [
"Check",
"whether",
"the",
"current",
"element",
"of",
"the",
"iterator",
"is",
"acceptable"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Filesystem/RecursiveFolderFilterIterator.php#L40-L46 | train | Accept the current directory | [
30522,
2270,
3853,
5138,
1006,
1007,
1063,
1013,
1008,
1008,
1030,
13075,
1032,
11867,
10270,
9463,
2378,
14876,
1002,
2783,
1008,
1013,
1002,
2783,
1027,
1002,
2023,
1011,
1028,
2783,
1006,
1007,
1025,
2709,
1002,
2783,
1011,
1028,
2003,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Routing/Router.php | Router.actionReferencesController | protected function actionReferencesController($action)
{
if (! $action instanceof Closure) {
return is_string($action) || (isset($action['uses']) && is_string($action['uses']));
}
return false;
} | php | protected function actionReferencesController($action)
{
if (! $action instanceof Closure) {
return is_string($action) || (isset($action['uses']) && is_string($action['uses']));
}
return false;
} | [
"protected",
"function",
"actionReferencesController",
"(",
"$",
"action",
")",
"{",
"if",
"(",
"!",
"$",
"action",
"instanceof",
"Closure",
")",
"{",
"return",
"is_string",
"(",
"$",
"action",
")",
"||",
"(",
"isset",
"(",
"$",
"action",
"[",
"'uses'",
... | Determine if the action is routing to a controller.
@param array $action
@return bool | [
"Determine",
"if",
"the",
"action",
"is",
"routing",
"to",
"a",
"controller",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/Router.php#L487-L494 | train | Checks if the action references a controller | [
30522,
5123,
3853,
2895,
2890,
25523,
9363,
3372,
26611,
1006,
1002,
2895,
1007,
1063,
2065,
1006,
999,
30524,
2003,
1035,
5164,
1006,
1002,
2895,
1031,
1005,
3594,
1005,
1033,
1007,
1007,
1025,
1065,
2709,
6270,
1025,
1065,
102,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Intl/Intl.php | Intl.getLanguageBundle | public static function getLanguageBundle()
{
@trigger_error(sprintf('The method "%s()" is deprecated since Symfony 4.3, use "%s" or "%s" instead.', __METHOD__, Languages::class, Scripts::class), E_USER_DEPRECATED);
if (null === self::$languageBundle) {
self::$languageBundle = new Langua... | php | public static function getLanguageBundle()
{
@trigger_error(sprintf('The method "%s()" is deprecated since Symfony 4.3, use "%s" or "%s" instead.', __METHOD__, Languages::class, Scripts::class), E_USER_DEPRECATED);
if (null === self::$languageBundle) {
self::$languageBundle = new Langua... | [
"public",
"static",
"function",
"getLanguageBundle",
"(",
")",
"{",
"@",
"trigger_error",
"(",
"sprintf",
"(",
"'The method \"%s()\" is deprecated since Symfony 4.3, use \"%s\" or \"%s\" instead.'",
",",
"__METHOD__",
",",
"Languages",
"::",
"class",
",",
"Scripts",
"::",
... | Returns the bundle containing language information.
@return LanguageBundleInterface The language resource bundle
@deprecated since Symfony 4.3, to be removed in 5.0. Use {@see Languages} or {@see Scripts} instead. | [
"Returns",
"the",
"bundle",
"containing",
"language",
"information",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Intl/Intl.php#L146-L163 | train | Returns the language bundle | [
30522,
2270,
10763,
3853,
2131,
25023,
6692,
3351,
27265,
2571,
1006,
1007,
1063,
1030,
9495,
1035,
7561,
1006,
9043,
2546,
1006,
1005,
1996,
4118,
1000,
1003,
1055,
1006,
1007,
1000,
2003,
2139,
28139,
12921,
2144,
25353,
2213,
14876,
4890... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/ZendPlatform.php | Zend_Cache_Backend_ZendPlatform._clean | private function _clean($dir, $mode)
{
$d = @dir($dir);
if (!$d) {
return false;
}
$result = true;
while (false !== ($file = $d->read())) {
if ($file == '.' || $file == '..') {
continue;
}
$file = $d->path . $fil... | php | private function _clean($dir, $mode)
{
$d = @dir($dir);
if (!$d) {
return false;
}
$result = true;
while (false !== ($file = $d->read())) {
if ($file == '.' || $file == '..') {
continue;
}
$file = $d->path . $fil... | [
"private",
"function",
"_clean",
"(",
"$",
"dir",
",",
"$",
"mode",
")",
"{",
"$",
"d",
"=",
"@",
"dir",
"(",
"$",
"dir",
")",
";",
"if",
"(",
"!",
"$",
"d",
")",
"{",
"return",
"false",
";",
"}",
"$",
"result",
"=",
"true",
";",
"while",
"... | Clean a directory and recursivly go over it's subdirectories
Remove all the cached files that need to be cleaned (according to mode and files mtime)
@param string $dir Path of directory ot clean
@param string $mode The same parameter as in Zend_Cache_Backend_ZendPlatform::clean()
@return boolean True if ok | [
"Clean",
"a",
"directory",
"and",
"recursivly",
"go",
"over",
"it",
"s",
"subdirectories"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache/Backend/ZendPlatform.php#L260-L289 | train | Recursive function to clean directory | [
30522,
2797,
3853,
1035,
4550,
1006,
1002,
16101,
1010,
1002,
5549,
1007,
1063,
1002,
1040,
1027,
1030,
16101,
1006,
1002,
16101,
1007,
1025,
2065,
1006,
999,
1002,
1040,
1007,
1063,
2709,
6270,
1025,
1065,
1002,
2765,
1027,
2995,
1025,
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... |
z-song/laravel-admin | src/Widgets/Widget.php | Widget.formatAttributes | public function formatAttributes()
{
$html = [];
foreach ((array) $this->getAttributes() as $key => $value) {
$element = $this->attributeElement($key, $value);
if (!is_null($element)) {
$html[] = $element;
}
}
return count($html) >... | php | public function formatAttributes()
{
$html = [];
foreach ((array) $this->getAttributes() as $key => $value) {
$element = $this->attributeElement($key, $value);
if (!is_null($element)) {
$html[] = $element;
}
}
return count($html) >... | [
"public",
"function",
"formatAttributes",
"(",
")",
"{",
"$",
"html",
"=",
"[",
"]",
";",
"foreach",
"(",
"(",
"array",
")",
"$",
"this",
"->",
"getAttributes",
"(",
")",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"element",
"=",
"$",
"... | Build an HTML attribute string from an array.
@return string | [
"Build",
"an",
"HTML",
"attribute",
"string",
"from",
"an",
"array",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Widgets/Widget.php#L34-L45 | train | Format attributes to string | [
30522,
2270,
3853,
4289,
19321,
3089,
8569,
4570,
1006,
1007,
1063,
1002,
16129,
1027,
1031,
1033,
1025,
18921,
6776,
1006,
1006,
9140,
1007,
1002,
2023,
1011,
1028,
2131,
19321,
3089,
8569,
4570,
1006,
1007,
2004,
1002,
3145,
1027,
1028,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Workflow/MarkingStore/MethodMarkingStore.php | MethodMarkingStore.getMarking | public function getMarking($subject)
{
$method = 'get'.ucfirst($this->property);
if (!method_exists($subject, $method)) {
throw new LogicException(sprintf('The method "%s::%s()" does not exists.', \get_class($subject), $method));
}
$marking = $subject->{$method}();
... | php | public function getMarking($subject)
{
$method = 'get'.ucfirst($this->property);
if (!method_exists($subject, $method)) {
throw new LogicException(sprintf('The method "%s::%s()" does not exists.', \get_class($subject), $method));
}
$marking = $subject->{$method}();
... | [
"public",
"function",
"getMarking",
"(",
"$",
"subject",
")",
"{",
"$",
"method",
"=",
"'get'",
".",
"ucfirst",
"(",
"$",
"this",
"->",
"property",
")",
";",
"if",
"(",
"!",
"method_exists",
"(",
"$",
"subject",
",",
"$",
"method",
")",
")",
"{",
"... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Workflow/MarkingStore/MethodMarkingStore.php#L49-L68 | train | Get the marking for the subject | [
30522,
2270,
3853,
2131,
10665,
2075,
1006,
1002,
3395,
1007,
1063,
1002,
4118,
1027,
1005,
2131,
1005,
1012,
15384,
8873,
12096,
1006,
1002,
2023,
1011,
1028,
3200,
1007,
1025,
2065,
1006,
999,
4118,
1035,
6526,
1006,
1002,
3395,
1010,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
overtrue/wechat | src/OfficialAccount/User/ServiceProvider.php | ServiceProvider.register | public function register(Container $app)
{
$app['user'] = function ($app) {
return new UserClient($app);
};
$app['user_tag'] = function ($app) {
return new TagClient($app);
};
} | php | public function register(Container $app)
{
$app['user'] = function ($app) {
return new UserClient($app);
};
$app['user_tag'] = function ($app) {
return new TagClient($app);
};
} | [
"public",
"function",
"register",
"(",
"Container",
"$",
"app",
")",
"{",
"$",
"app",
"[",
"'user'",
"]",
"=",
"function",
"(",
"$",
"app",
")",
"{",
"return",
"new",
"UserClient",
"(",
"$",
"app",
")",
";",
"}",
";",
"$",
"app",
"[",
"'user_tag'",... | {@inheritdoc}. | [
"{"
] | 120c72faaa93c270365bc75c73c362d5fd583209 | https://github.com/overtrue/wechat/blob/120c72faaa93c270365bc75c73c362d5fd583209/src/OfficialAccount/User/ServiceProvider.php#L25-L34 | train | Register the user and tag clients | [
30522,
2270,
3853,
4236,
1006,
11661,
1002,
10439,
1007,
1063,
1002,
10439,
1031,
1005,
5310,
1005,
1033,
1027,
3853,
1006,
1002,
10439,
1007,
1063,
2709,
2047,
5310,
20464,
11638,
1006,
1002,
10439,
1007,
1025,
1065,
1025,
1002,
10439,
103... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/CoreAdminHome/API.php | API.runCronArchiving | public function runCronArchiving()
{
Piwik::checkUserHasSuperUserAccess();
// HTTP request: logs needs to be dumped in the HTTP response (on top of existing log destinations)
/** @var \Monolog\Logger $logger */
$logger = StaticContainer::get('Psr\Log\LoggerInterface');
$hand... | php | public function runCronArchiving()
{
Piwik::checkUserHasSuperUserAccess();
// HTTP request: logs needs to be dumped in the HTTP response (on top of existing log destinations)
/** @var \Monolog\Logger $logger */
$logger = StaticContainer::get('Psr\Log\LoggerInterface');
$hand... | [
"public",
"function",
"runCronArchiving",
"(",
")",
"{",
"Piwik",
"::",
"checkUserHasSuperUserAccess",
"(",
")",
";",
"// HTTP request: logs needs to be dumped in the HTTP response (on top of existing log destinations)",
"/** @var \\Monolog\\Logger $logger */",
"$",
"logger",
"=",
... | Initiates cron archiving via web request.
@hideExceptForSuperUser | [
"Initiates",
"cron",
"archiving",
"via",
"web",
"request",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/CoreAdminHome/API.php#L175-L188 | train | Runs the cron archiving process | [
30522,
2270,
3853,
2448,
26775,
7856,
11140,
14966,
1006,
1007,
1063,
14255,
9148,
2243,
1024,
1024,
4638,
20330,
14949,
6342,
4842,
20330,
6305,
9623,
2015,
1006,
1007,
1025,
1013,
1013,
8299,
5227,
1024,
15664,
3791,
2000,
2022,
14019,
19... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Blueprint.php | Blueprint.extra | public function extra(array $data, $prefix = '')
{
$this->initInternals();
return $this->blueprintSchema->extra($data, $prefix);
} | php | public function extra(array $data, $prefix = '')
{
$this->initInternals();
return $this->blueprintSchema->extra($data, $prefix);
} | [
"public",
"function",
"extra",
"(",
"array",
"$",
"data",
",",
"$",
"prefix",
"=",
"''",
")",
"{",
"$",
"this",
"->",
"initInternals",
"(",
")",
";",
"return",
"$",
"this",
"->",
"blueprintSchema",
"->",
"extra",
"(",
"$",
"data",
",",
"$",
"prefix",... | Return data fields that do not exist in blueprints.
@param array $data
@param string $prefix
@return array | [
"Return",
"data",
"fields",
"that",
"do",
"not",
"exist",
"in",
"blueprints",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Data/Blueprint.php#L164-L169 | train | Extra data for the blueprint | [
30522,
2270,
3853,
4469,
1006,
9140,
1002,
2951,
1010,
1002,
17576,
1027,
1005,
1005,
1007,
1063,
1002,
2023,
1011,
1028,
1999,
25090,
10111,
12789,
4877,
1006,
1007,
1025,
2709,
1002,
2023,
1011,
1028,
2630,
16550,
22842,
2863,
1011,
1028,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/backend/models/User.php | User.sendInvitation | public function sendInvitation()
{
$data = [
'name' => $this->full_name,
'login' => $this->login,
'password' => $this->getOriginalHashValue('password'),
'link' => Backend::url('backend'),
];
Mail::send('backend::mail.invite', $data, function (... | php | public function sendInvitation()
{
$data = [
'name' => $this->full_name,
'login' => $this->login,
'password' => $this->getOriginalHashValue('password'),
'link' => Backend::url('backend'),
];
Mail::send('backend::mail.invite', $data, function (... | [
"public",
"function",
"sendInvitation",
"(",
")",
"{",
"$",
"data",
"=",
"[",
"'name'",
"=>",
"$",
"this",
"->",
"full_name",
",",
"'login'",
"=>",
"$",
"this",
"->",
"login",
",",
"'password'",
"=>",
"$",
"this",
"->",
"getOriginalHashValue",
"(",
"'pas... | Sends an invitation to the user using template "backend::mail.invite".
@return void | [
"Sends",
"an",
"invitation",
"to",
"the",
"user",
"using",
"template",
"backend",
"::",
"mail",
".",
"invite",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/models/User.php#L146-L158 | train | Send invite email | [
30522,
2270,
3853,
4604,
2378,
28403,
3508,
1006,
1007,
1063,
1002,
2951,
1027,
1031,
1005,
2171,
1005,
1027,
1028,
1002,
2023,
1011,
1028,
2440,
1035,
2171,
1010,
1005,
8833,
2378,
1005,
1027,
1028,
1002,
2023,
1011,
1028,
8833,
2378,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Common/Twig/Twig.php | Twig.init | public function init()
{
if (null === $this->twig) {
/** @var Config $config */
$config = $this->grav['config'];
/** @var UniformResourceLocator $locator */
$locator = $this->grav['locator'];
/** @var Language $language */
$language = $... | php | public function init()
{
if (null === $this->twig) {
/** @var Config $config */
$config = $this->grav['config'];
/** @var UniformResourceLocator $locator */
$locator = $this->grav['locator'];
/** @var Language $language */
$language = $... | [
"public",
"function",
"init",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"twig",
")",
"{",
"/** @var Config $config */",
"$",
"config",
"=",
"$",
"this",
"->",
"grav",
"[",
"'config'",
"]",
";",
"/** @var UniformResourceLocator $locator */",
... | Twig initialization that sets the twig loader chain, then the environment, then extensions
and also the base set of twig vars | [
"Twig",
"initialization",
"that",
"sets",
"the",
"twig",
"loader",
"chain",
"then",
"the",
"environment",
"then",
"extensions",
"and",
"also",
"the",
"base",
"set",
"of",
"twig",
"vars"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Twig/Twig.php#L77-L219 | train | Initializes the twig environment | [
30522,
2270,
3853,
1999,
4183,
1006,
1007,
1063,
2065,
1006,
19701,
1027,
1027,
1027,
1002,
2023,
1011,
1028,
1056,
16279,
1007,
1063,
1013,
1008,
1008,
1030,
13075,
9530,
8873,
2290,
1002,
9530,
8873,
2290,
1008,
1013,
1002,
9530,
8873,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php | AbstractDoctrineExtension.registerMappingDrivers | protected function registerMappingDrivers($objectManager, ContainerBuilder $container)
{
// configure metadata driver for each bundle based on the type of mapping files found
if ($container->hasDefinition($this->getObjectManagerElementName($objectManager['name'].'_metadata_driver'))) {
$... | php | protected function registerMappingDrivers($objectManager, ContainerBuilder $container)
{
// configure metadata driver for each bundle based on the type of mapping files found
if ($container->hasDefinition($this->getObjectManagerElementName($objectManager['name'].'_metadata_driver'))) {
$... | [
"protected",
"function",
"registerMappingDrivers",
"(",
"$",
"objectManager",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"// configure metadata driver for each bundle based on the type of mapping files found",
"if",
"(",
"$",
"container",
"->",
"hasDefinition",
"(",
... | Register all the collected mapping information with the object manager by registering the appropriate mapping drivers.
@param array $objectManager
@param ContainerBuilder $container A ContainerBuilder instance | [
"Register",
"all",
"the",
"collected",
"mapping",
"information",
"with",
"the",
"object",
"manager",
"by",
"registering",
"the",
"appropriate",
"mapping",
"drivers",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php#L178-L223 | train | Registers mapping drivers for the object managers | [
30522,
5123,
3853,
4236,
2863,
14853,
23663,
2869,
1006,
1002,
4874,
24805,
4590,
1010,
11661,
8569,
23891,
2099,
1002,
11661,
1007,
1063,
1013,
1013,
9530,
8873,
27390,
2063,
27425,
4062,
2005,
2169,
14012,
2241,
2006,
1996,
2828,
1997,
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... |
overtrue/wechat | src/Payment/Transfer/Client.php | Client.toBalance | public function toBalance(array $params)
{
$base = [
'mch_id' => null,
'mchid' => $this->app['config']->mch_id,
'mch_appid' => $this->app['config']->app_id,
];
if (empty($params['spbill_create_ip'])) {
$params['spbill_create_ip'] = get_server_... | php | public function toBalance(array $params)
{
$base = [
'mch_id' => null,
'mchid' => $this->app['config']->mch_id,
'mch_appid' => $this->app['config']->app_id,
];
if (empty($params['spbill_create_ip'])) {
$params['spbill_create_ip'] = get_server_... | [
"public",
"function",
"toBalance",
"(",
"array",
"$",
"params",
")",
"{",
"$",
"base",
"=",
"[",
"'mch_id'",
"=>",
"null",
",",
"'mchid'",
"=>",
"$",
"this",
"->",
"app",
"[",
"'config'",
"]",
"->",
"mch_id",
",",
"'mch_appid'",
"=>",
"$",
"this",
"-... | Send MerchantPay to balance.
@param array $params
@return \Psr\Http\Message\ResponseInterface|\EasyWeChat\Kernel\Support\Collection|array|object|string
@throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException | [
"Send",
"MerchantPay",
"to",
"balance",
"."
] | 120c72faaa93c270365bc75c73c362d5fd583209 | https://github.com/overtrue/wechat/blob/120c72faaa93c270365bc75c73c362d5fd583209/src/Payment/Transfer/Client.php#L55-L68 | train | To Balance Transfers | [
30522,
2270,
3853,
2000,
26657,
1006,
9140,
1002,
11498,
5244,
1007,
1063,
1002,
2918,
1027,
1031,
1005,
11338,
2232,
1035,
8909,
1005,
1027,
1028,
19701,
1010,
1005,
11338,
27511,
1005,
1027,
1028,
1002,
2023,
1011,
1028,
10439,
1031,
1005... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/backend/widgets/Form.php | Form.onRefresh | public function onRefresh()
{
$result = [];
$saveData = $this->getSaveData();
/**
* @event backend.form.beforeRefresh
* Called before the form is refreshed, modify the $dataHolder->data property in place
*
* Example usage:
*
* Event:... | php | public function onRefresh()
{
$result = [];
$saveData = $this->getSaveData();
/**
* @event backend.form.beforeRefresh
* Called before the form is refreshed, modify the $dataHolder->data property in place
*
* Example usage:
*
* Event:... | [
"public",
"function",
"onRefresh",
"(",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"$",
"saveData",
"=",
"$",
"this",
"->",
"getSaveData",
"(",
")",
";",
"/**\n * @event backend.form.beforeRefresh\n * Called before the form is refreshed, modify the $data... | Event handler for refreshing the form.
@return array | [
"Event",
"handler",
"for",
"refreshing",
"the",
"form",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/Form.php#L353-L453 | train | On refresh event | [
30522,
2270,
3853,
2006,
2890,
19699,
9953,
1006,
1007,
1063,
1002,
2765,
1027,
1031,
1033,
1025,
1002,
5552,
6790,
1027,
1002,
2023,
1011,
1028,
4152,
10696,
2850,
2696,
1006,
1007,
1025,
1013,
1008,
1008,
1008,
1030,
2724,
2067,
10497,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.