repo stringclasses 21
values | path stringlengths 10 100 | func_name stringlengths 6 71 | original_string stringlengths 115 97k | language stringclasses 1
value | code stringlengths 115 97k | code_tokens listlengths 27 7.5k | docstring stringlengths 6 1.88k | docstring_tokens listlengths 1 177 | sha stringclasses 21
values | url stringlengths 100 189 | partition stringclasses 1
value | summary stringlengths 9 340 | input_ids listlengths 502 502 | token_type_ids listlengths 502 502 | attention_mask listlengths 502 502 | labels listlengths 502 502 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
symfony/symfony | src/Symfony/Component/Serializer/Normalizer/CustomNormalizer.php | CustomNormalizer.denormalize | public function denormalize($data, $class, $format = null, array $context = [])
{
$object = $this->extractObjectToPopulate($class, $context) ?: new $class();
$object->denormalize($this->serializer, $data, $format, $context);
return $object;
} | php | public function denormalize($data, $class, $format = null, array $context = [])
{
$object = $this->extractObjectToPopulate($class, $context) ?: new $class();
$object->denormalize($this->serializer, $data, $format, $context);
return $object;
} | [
"public",
"function",
"denormalize",
"(",
"$",
"data",
",",
"$",
"class",
",",
"$",
"format",
"=",
"null",
",",
"array",
"$",
"context",
"=",
"[",
"]",
")",
"{",
"$",
"object",
"=",
"$",
"this",
"->",
"extractObjectToPopulate",
"(",
"$",
"class",
","... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Serializer/Normalizer/CustomNormalizer.php#L36-L42 | train | Denormalizes the given data into a new object | [
30522,
2270,
3853,
7939,
2953,
9067,
4697,
1006,
1002,
2951,
1010,
1002,
2465,
1010,
1002,
4289,
1027,
19701,
1010,
9140,
1002,
6123,
1027,
1031,
1033,
1007,
1063,
1002,
4874,
1027,
1002,
2023,
1011,
1028,
14817,
16429,
20614,
14399,
7361,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Database/Eloquent/Builder.php | Builder.without | public function without($relations)
{
$this->eagerLoad = array_diff_key($this->eagerLoad, array_flip(
is_string($relations) ? func_get_args() : $relations
));
return $this;
} | php | public function without($relations)
{
$this->eagerLoad = array_diff_key($this->eagerLoad, array_flip(
is_string($relations) ? func_get_args() : $relations
));
return $this;
} | [
"public",
"function",
"without",
"(",
"$",
"relations",
")",
"{",
"$",
"this",
"->",
"eagerLoad",
"=",
"array_diff_key",
"(",
"$",
"this",
"->",
"eagerLoad",
",",
"array_flip",
"(",
"is_string",
"(",
"$",
"relations",
")",
"?",
"func_get_args",
"(",
")",
... | Prevent the specified relations from being eager loaded.
@param mixed $relations
@return $this | [
"Prevent",
"the",
"specified",
"relations",
"from",
"being",
"eager",
"loaded",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Builder.php#L1096-L1103 | train | Remove items from eagerLoad | [
30522,
2270,
3853,
2302,
1006,
1002,
4262,
1007,
1063,
1002,
2023,
1011,
1028,
9461,
11066,
1027,
9140,
1035,
4487,
4246,
1035,
3145,
1006,
1002,
2023,
1011,
1028,
9461,
11066,
1010,
9140,
1035,
11238,
1006,
2003,
1035,
5164,
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/helpers/Backend.php | Backend.redirectIntended | public function redirectIntended($path, $status = 302, $headers = [], $secure = null)
{
return Redirect::intended($this->uri() . '/' . $path, $status, $headers, $secure);
} | php | public function redirectIntended($path, $status = 302, $headers = [], $secure = null)
{
return Redirect::intended($this->uri() . '/' . $path, $status, $headers, $secure);
} | [
"public",
"function",
"redirectIntended",
"(",
"$",
"path",
",",
"$",
"status",
"=",
"302",
",",
"$",
"headers",
"=",
"[",
"]",
",",
"$",
"secure",
"=",
"null",
")",
"{",
"return",
"Redirect",
"::",
"intended",
"(",
"$",
"this",
"->",
"uri",
"(",
"... | Create a new redirect response to the previously intended backend location. | [
"Create",
"a",
"new",
"redirect",
"response",
"to",
"the",
"previously",
"intended",
"backend",
"location",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/helpers/Backend.php#L81-L84 | train | Redirect intended to the current request | [
30522,
2270,
3853,
2417,
7442,
6593,
18447,
21945,
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,
3832,
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 | plugins/DevicePlugins/Archiver.php | Archiver.aggregateByPlugin | protected function aggregateByPlugin()
{
$selects = array();
$columns = DevicePlugins::getAllPluginColumns();
foreach ($columns as $column) {
$selects[] = sprintf(
"sum(case log_visit.%s when 1 then 1 else 0 end) as %s",
$column->getColumnName(),
... | php | protected function aggregateByPlugin()
{
$selects = array();
$columns = DevicePlugins::getAllPluginColumns();
foreach ($columns as $column) {
$selects[] = sprintf(
"sum(case log_visit.%s when 1 then 1 else 0 end) as %s",
$column->getColumnName(),
... | [
"protected",
"function",
"aggregateByPlugin",
"(",
")",
"{",
"$",
"selects",
"=",
"array",
"(",
")",
";",
"$",
"columns",
"=",
"DevicePlugins",
"::",
"getAllPluginColumns",
"(",
")",
";",
"foreach",
"(",
"$",
"columns",
"as",
"$",
"column",
")",
"{",
"$"... | Archives reports for all available plugin columns
@see DevicePluginColumn | [
"Archives",
"reports",
"for",
"all",
"available",
"plugin",
"columns"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/DevicePlugins/Archiver.php#L60-L78 | train | Aggregate by plugin | [
30522,
5123,
3853,
9572,
3762,
24759,
15916,
2378,
1006,
1007,
1063,
1002,
27034,
1027,
9140,
1006,
1007,
1025,
1002,
7753,
1027,
5080,
24759,
15916,
7076,
1024,
1024,
2131,
8095,
24759,
15916,
2378,
25778,
2819,
3619,
1006,
1007,
1025,
189... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Collection.php | Collection.contains | public function contains($key, $operator = null, $value = null)
{
if (func_num_args() > 1 || $this->useAsCallable($key)) {
return parent::contains(...func_get_args());
}
if ($key instanceof Model) {
return parent::contains(function ($model) use ($key) {
... | php | public function contains($key, $operator = null, $value = null)
{
if (func_num_args() > 1 || $this->useAsCallable($key)) {
return parent::contains(...func_get_args());
}
if ($key instanceof Model) {
return parent::contains(function ($model) use ($key) {
... | [
"public",
"function",
"contains",
"(",
"$",
"key",
",",
"$",
"operator",
"=",
"null",
",",
"$",
"value",
"=",
"null",
")",
"{",
"if",
"(",
"func_num_args",
"(",
")",
">",
"1",
"||",
"$",
"this",
"->",
"useAsCallable",
"(",
"$",
"key",
")",
")",
"... | Determine if a key exists in the collection.
@param mixed $key
@param mixed $operator
@param mixed $value
@return bool | [
"Determine",
"if",
"a",
"key",
"exists",
"in",
"the",
"collection",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Collection.php#L200-L215 | train | Return true if the collection contains the given key | [
30522,
2270,
3853,
3397,
1006,
1002,
3145,
1010,
1002,
6872,
30524,
1035,
16371,
2213,
1035,
12098,
5620,
1006,
1007,
1028,
1015,
1064,
1064,
1002,
2023,
1011,
1028,
2224,
3022,
9289,
20470,
2571,
1006,
1002,
3145,
1007,
1007,
1063,
2709,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/backend/widgets/MediaManager.php | MediaManager.onCreateFolder | public function onCreateFolder()
{
$this->abortIfReadOnly();
$name = trim(Input::get('name'));
if (!strlen($name)) {
throw new ApplicationException(Lang::get('cms::lang.asset.name_cant_be_empty'));
}
if (!$this->validateFileName($name)) {
throw new A... | php | public function onCreateFolder()
{
$this->abortIfReadOnly();
$name = trim(Input::get('name'));
if (!strlen($name)) {
throw new ApplicationException(Lang::get('cms::lang.asset.name_cant_be_empty'));
}
if (!$this->validateFileName($name)) {
throw new A... | [
"public",
"function",
"onCreateFolder",
"(",
")",
"{",
"$",
"this",
"->",
"abortIfReadOnly",
"(",
")",
";",
"$",
"name",
"=",
"trim",
"(",
"Input",
"::",
"get",
"(",
"'name'",
")",
")",
";",
"if",
"(",
"!",
"strlen",
"(",
"$",
"name",
")",
")",
"... | Create library folder AJAX handler
@return array | [
"Create",
"library",
"folder",
"AJAX",
"handler"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/MediaManager.php#L482-L539 | train | Create a new folder | [
30522,
2270,
3853,
2006,
16748,
3686,
10371,
2121,
1006,
1007,
1063,
1002,
2023,
1011,
1028,
11113,
11589,
10128,
16416,
5280,
2135,
1006,
1007,
1025,
1002,
2171,
1027,
12241,
1006,
7953,
1024,
1024,
2131,
1006,
1005,
2171,
1005,
1007,
1007... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/Zend/Cache/Frontend/Function.php | Zend_Cache_Frontend_Function.call | public function call($callback, array $parameters = array(), $tags = array(), $specificLifetime = false, $priority = 8)
{
if (!is_callable($callback, true, $name)) {
Zend_Cache::throwException('Invalid callback');
}
$cacheBool1 = $this->_specificOptions['cache_by_default'];
... | php | public function call($callback, array $parameters = array(), $tags = array(), $specificLifetime = false, $priority = 8)
{
if (!is_callable($callback, true, $name)) {
Zend_Cache::throwException('Invalid callback');
}
$cacheBool1 = $this->_specificOptions['cache_by_default'];
... | [
"public",
"function",
"call",
"(",
"$",
"callback",
",",
"array",
"$",
"parameters",
"=",
"array",
"(",
")",
",",
"$",
"tags",
"=",
"array",
"(",
")",
",",
"$",
"specificLifetime",
"=",
"false",
",",
"$",
"priority",
"=",
"8",
")",
"{",
"if",
"(",
... | Main method : call the specified function or get the result from cache
@param callback $callback A valid callback
@param array $parameters Function parameters
@param array $tags Cache tags
@param int $specificLifetime If != false, set a specific lifetime for this cache record (... | [
"Main",
"method",
":",
"call",
"the",
"specified",
"function",
"or",
"get",
"the",
"result",
"from",
"cache"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache/Frontend/Function.php#L82-L114 | train | Call a callback | [
30522,
2270,
3853,
2655,
1006,
1002,
2655,
5963,
1010,
9140,
1002,
11709,
1027,
9140,
1006,
1007,
1010,
1002,
22073,
1027,
9140,
1006,
1007,
1010,
1002,
3563,
15509,
7292,
1027,
6270,
1010,
1002,
9470,
1027,
1022,
1007,
1063,
2065,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Notifications/Events/BroadcastNotificationCreated.php | BroadcastNotificationCreated.broadcastType | public function broadcastType()
{
return method_exists($this->notification, 'broadcastType')
? $this->notification->broadcastType()
: get_class($this->notification);
} | php | public function broadcastType()
{
return method_exists($this->notification, 'broadcastType')
? $this->notification->broadcastType()
: get_class($this->notification);
} | [
"public",
"function",
"broadcastType",
"(",
")",
"{",
"return",
"method_exists",
"(",
"$",
"this",
"->",
"notification",
",",
"'broadcastType'",
")",
"?",
"$",
"this",
"->",
"notification",
"->",
"broadcastType",
"(",
")",
":",
"get_class",
"(",
"$",
"this",... | Get the type of the notification being broadcast.
@return string | [
"Get",
"the",
"type",
"of",
"the",
"notification",
"being",
"broadcast",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Notifications/Events/BroadcastNotificationCreated.php#L100-L105 | train | Returns the type of the notification | [
30522,
2270,
3853,
3743,
13874,
1006,
1007,
1063,
2709,
4118,
1035,
6526,
1006,
1002,
2023,
1011,
1028,
26828,
1010,
1005,
3743,
13874,
1005,
1007,
1029,
1002,
2023,
1011,
1028,
26828,
1011,
1028,
3743,
13874,
1006,
1007,
1024,
2131,
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/API/ProcessedReport.php | ProcessedReport.getPrettyValue | public static function getPrettyValue(Formatter $formatter, $idSite, $columnName, $value)
{
if (!is_numeric($value)) {
return $value;
}
// Display time in human readable
if (strpos($columnName, 'time_generation') !== false) {
return $formatter->getPrettyTimeFromSeconds($val... | php | public static function getPrettyValue(Formatter $formatter, $idSite, $columnName, $value)
{
if (!is_numeric($value)) {
return $value;
}
// Display time in human readable
if (strpos($columnName, 'time_generation') !== false) {
return $formatter->getPrettyTimeFromSeconds($val... | [
"public",
"static",
"function",
"getPrettyValue",
"(",
"Formatter",
"$",
"formatter",
",",
"$",
"idSite",
",",
"$",
"columnName",
",",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"is_numeric",
"(",
"$",
"value",
")",
")",
"{",
"return",
"$",
"value",
";",
... | Prettifies a metric value based on the column name.
@param int $idSite The ID of the site the metric is for (used if the column value is an amount of money).
@param string $columnName The metric name.
@param mixed $value The metric value.
@param bool $isHtml If true, replaces all spaces with `' '`.
@return string | [
"Prettifies",
"a",
"metric",
"value",
"based",
"on",
"the",
"column",
"name",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/API/ProcessedReport.php#L827-L855 | train | Returns the value of a column in a human readable format | [
30522,
2270,
10763,
3853,
2131,
28139,
15353,
10175,
5657,
1006,
4289,
3334,
1002,
4289,
3334,
1010,
1002,
8909,
28032,
2063,
1010,
1002,
5930,
18442,
1010,
1002,
3643,
1007,
1063,
2065,
1006,
999,
2003,
1035,
16371,
25531,
1006,
1002,
3643... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Lock/Store/CombinedStore.php | CombinedStore.exists | public function exists(Key $key)
{
$successCount = 0;
$failureCount = 0;
$storesCount = \count($this->stores);
foreach ($this->stores as $store) {
if ($store->exists($key)) {
++$successCount;
} else {
++$failureCount;
... | php | public function exists(Key $key)
{
$successCount = 0;
$failureCount = 0;
$storesCount = \count($this->stores);
foreach ($this->stores as $store) {
if ($store->exists($key)) {
++$successCount;
} else {
++$failureCount;
... | [
"public",
"function",
"exists",
"(",
"Key",
"$",
"key",
")",
"{",
"$",
"successCount",
"=",
"0",
";",
"$",
"failureCount",
"=",
"0",
";",
"$",
"storesCount",
"=",
"\\",
"count",
"(",
"$",
"this",
"->",
"stores",
")",
";",
"foreach",
"(",
"$",
"this... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Lock/Store/CombinedStore.php#L161-L183 | train | Checks if a key exists in all stores | [
30522,
2270,
3853,
6526,
1006,
3145,
1002,
3145,
1007,
1063,
1002,
3112,
3597,
16671,
1027,
1014,
1025,
1002,
4945,
3597,
16671,
1027,
1014,
1025,
1002,
5324,
3597,
16671,
1027,
1032,
4175,
1006,
1002,
2023,
1011,
1028,
5324,
1007,
1025,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/UserCountry/Controller.php | Controller.downloadFreeGeoIP2DB | public function downloadFreeGeoIP2DB()
{
$this->dieIfGeolocationAdminIsDisabled();
Piwik::checkUserHasSuperUserAccess();
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$this->checkTokenInUrl();
Json::sendHeaderJSON();
$outputPath = GeoIp2::getPathForGeoIpData... | php | public function downloadFreeGeoIP2DB()
{
$this->dieIfGeolocationAdminIsDisabled();
Piwik::checkUserHasSuperUserAccess();
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$this->checkTokenInUrl();
Json::sendHeaderJSON();
$outputPath = GeoIp2::getPathForGeoIpData... | [
"public",
"function",
"downloadFreeGeoIP2DB",
"(",
")",
"{",
"$",
"this",
"->",
"dieIfGeolocationAdminIsDisabled",
"(",
")",
";",
"Piwik",
"::",
"checkUserHasSuperUserAccess",
"(",
")",
";",
"if",
"(",
"$",
"_SERVER",
"[",
"\"REQUEST_METHOD\"",
"]",
"==",
"\"POS... | Starts or continues download of GeoLite2-City.mmdb.
To avoid a server/PHP timeout & to show progress of the download to the user, we
use the HTTP Range header to download one chunk of the file at a time. After each
chunk, it is the browser's responsibility to call the method again to continue the download.
Input:
'co... | [
"Starts",
"or",
"continues",
"download",
"of",
"GeoLite2",
"-",
"City",
".",
"mmdb",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UserCountry/Controller.php#L167-L206 | train | Download Free GeoLite2DB | [
30522,
2270,
3853,
8816,
23301,
3351,
10448,
2361,
2475,
18939,
1006,
1007,
1063,
1002,
2023,
1011,
1028,
3280,
10128,
3351,
12898,
10719,
4215,
25300,
16150,
14268,
23242,
1006,
1007,
1025,
14255,
9148,
2243,
1024,
1024,
4638,
20330,
14949,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
walkor/Workerman | Protocols/Http.php | Http.parseUploadFiles | protected static function parseUploadFiles($http_body, $http_post_boundary)
{
$http_body = substr($http_body, 0, strlen($http_body) - (strlen($http_post_boundary) + 4));
$boundary_data_array = explode($http_post_boundary . "\r\n", $http_body);
if ($boundary_data_array[0] === '') {
... | php | protected static function parseUploadFiles($http_body, $http_post_boundary)
{
$http_body = substr($http_body, 0, strlen($http_body) - (strlen($http_post_boundary) + 4));
$boundary_data_array = explode($http_post_boundary . "\r\n", $http_body);
if ($boundary_data_array[0] === '') {
... | [
"protected",
"static",
"function",
"parseUploadFiles",
"(",
"$",
"http_body",
",",
"$",
"http_post_boundary",
")",
"{",
"$",
"http_body",
"=",
"substr",
"(",
"$",
"http_body",
",",
"0",
",",
"strlen",
"(",
"$",
"http_body",
")",
"-",
"(",
"strlen",
"(",
... | Parse $_FILES.
@param string $http_body
@param string $http_post_boundary
@return void | [
"Parse",
"$_FILES",
"."
] | 13649907f05014fcfffcfccaef01e63ad3339351 | https://github.com/walkor/Workerman/blob/13649907f05014fcfffcfccaef01e63ad3339351/Protocols/Http.php#L541-L584 | train | Parse upload files | [
30522,
5123,
10763,
3853,
11968,
3366,
6279,
11066,
8873,
4244,
1006,
1002,
8299,
1035,
2303,
1010,
1002,
8299,
1035,
2695,
1035,
6192,
1007,
1063,
1002,
8299,
1035,
2303,
1027,
4942,
3367,
2099,
1006,
1002,
8299,
1035,
2303,
1010,
1014,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Security/Core/Authentication/Token/Storage/TokenStorage.php | TokenStorage.setToken | public function setToken(TokenInterface $token = null)
{
if (null !== $token && !method_exists($token, 'getRoleNames')) {
@trigger_error(sprintf('Not implementing the getRoleNames() method in %s which implements %s is deprecated since Symfony 4.3.', \get_class($token), TokenInterface::class), E_... | php | public function setToken(TokenInterface $token = null)
{
if (null !== $token && !method_exists($token, 'getRoleNames')) {
@trigger_error(sprintf('Not implementing the getRoleNames() method in %s which implements %s is deprecated since Symfony 4.3.', \get_class($token), TokenInterface::class), E_... | [
"public",
"function",
"setToken",
"(",
"TokenInterface",
"$",
"token",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"token",
"&&",
"!",
"method_exists",
"(",
"$",
"token",
",",
"'getRoleNames'",
")",
")",
"{",
"@",
"trigger_error",
"(",
"sprintf... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Security/Core/Authentication/Token/Storage/TokenStorage.php#L40-L47 | train | Sets the token | [
30522,
2270,
3853,
2275,
18715,
2368,
1006,
19204,
18447,
2121,
12172,
1002,
19204,
1027,
19701,
1007,
1063,
2065,
1006,
19701,
999,
1027,
1027,
1002,
19204,
1004,
1004,
999,
4118,
1035,
6526,
1006,
1002,
19204,
1010,
1005,
2131,
13153,
818... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/ExprBuilder.php | ExprBuilder.thenInvalid | public function thenInvalid($message)
{
$this->thenPart = function ($v) use ($message) { throw new \InvalidArgumentException(sprintf($message, json_encode($v))); };
return $this;
} | php | public function thenInvalid($message)
{
$this->thenPart = function ($v) use ($message) { throw new \InvalidArgumentException(sprintf($message, json_encode($v))); };
return $this;
} | [
"public",
"function",
"thenInvalid",
"(",
"$",
"message",
")",
"{",
"$",
"this",
"->",
"thenPart",
"=",
"function",
"(",
"$",
"v",
")",
"use",
"(",
"$",
"message",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"$",
"m... | Sets a closure marking the value as invalid at processing time.
if you want to add the value of the node in your message just use a %s placeholder.
@param string $message
@return $this
@throws \InvalidArgumentException | [
"Sets",
"a",
"closure",
"marking",
"the",
"value",
"as",
"invalid",
"at",
"processing",
"time",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Config/Definition/Builder/ExprBuilder.php#L187-L192 | train | Set the exception handler to be thrown if the value is not an instance of \ InvalidArgumentException | [
30522,
2270,
3853,
2059,
2378,
10175,
3593,
1006,
1002,
4471,
1007,
1063,
1002,
2023,
1011,
1028,
2059,
19362,
2102,
1027,
3853,
1006,
1002,
1058,
1007,
2224,
1006,
1002,
4471,
1007,
1063,
5466,
2047,
1032,
19528,
2906,
22850,
15781,
2595,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Validation/Concerns/ValidatesAttributes.php | ValidatesAttributes.getDateTime | protected function getDateTime($value)
{
try {
if ($this->isTestingRelativeDateTime($value)) {
return Date::parse($value);
}
return new DateTime($value);
} catch (Exception $e) {
//
}
} | php | protected function getDateTime($value)
{
try {
if ($this->isTestingRelativeDateTime($value)) {
return Date::parse($value);
}
return new DateTime($value);
} catch (Exception $e) {
//
}
} | [
"protected",
"function",
"getDateTime",
"(",
"$",
"value",
")",
"{",
"try",
"{",
"if",
"(",
"$",
"this",
"->",
"isTestingRelativeDateTime",
"(",
"$",
"value",
")",
")",
"{",
"return",
"Date",
"::",
"parse",
"(",
"$",
"value",
")",
";",
"}",
"return",
... | Get a DateTime instance from a string with no format.
@param string $value
@return \DateTime|null | [
"Get",
"a",
"DateTime",
"instance",
"from",
"a",
"string",
"with",
"no",
"format",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Validation/Concerns/ValidatesAttributes.php#L242-L253 | train | Get DateTime from value | [
30522,
5123,
3853,
2131,
13701,
7292,
1006,
1002,
3643,
1007,
1063,
3046,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
21541,
4355,
2075,
16570,
8082,
13701,
7292,
1006,
1002,
3643,
1007,
1007,
1063,
2709,
3058,
1024,
1024,
11968,
3366,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/Zend/Db/Statement/Db2.php | Zend_Db_Statement_Db2.fetch | public function fetch($style = null, $cursor = null, $offset = null)
{
if (!$this->_stmt) {
return false;
}
if ($style === null) {
$style = $this->_fetchMode;
}
switch ($style) {
case Zend_Db::FETCH_NUM :
$row = db2_fetch_... | php | public function fetch($style = null, $cursor = null, $offset = null)
{
if (!$this->_stmt) {
return false;
}
if ($style === null) {
$style = $this->_fetchMode;
}
switch ($style) {
case Zend_Db::FETCH_NUM :
$row = db2_fetch_... | [
"public",
"function",
"fetch",
"(",
"$",
"style",
"=",
"null",
",",
"$",
"cursor",
"=",
"null",
",",
"$",
"offset",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_stmt",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"$",
"style... | Fetches a row from the result set.
@param int $style OPTIONAL Fetch mode for this fetch operation.
@param int $cursor OPTIONAL Absolute, relative, or other.
@param int $offset OPTIONAL Number for absolute or relative cursors.
@return mixed Array, object, or scalar depending on fetch mode.
@throws Zend_Db_Statement_Db... | [
"Fetches",
"a",
"row",
"from",
"the",
"result",
"set",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Statement/Db2.php#L242-L281 | train | Fetch a row from the result set | [
30522,
2270,
3853,
18584,
1006,
1002,
2806,
1027,
19701,
1010,
1002,
12731,
25301,
2099,
1027,
19701,
1010,
1002,
16396,
1027,
19701,
1007,
1063,
2065,
1006,
999,
1002,
2023,
1011,
1028,
1035,
2358,
20492,
1007,
1063,
2709,
6270,
1025,
1065... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/Zend/Mime/Part.php | Zend_Mime_Part.getContent | public function getContent($EOL = Zend_Mime::LINEEND)
{
if ($this->_isStream) {
return stream_get_contents($this->getEncodedStream());
} else {
return Zend_Mime::encode($this->_content, $this->encoding, $EOL);
}
} | php | public function getContent($EOL = Zend_Mime::LINEEND)
{
if ($this->_isStream) {
return stream_get_contents($this->getEncodedStream());
} else {
return Zend_Mime::encode($this->_content, $this->encoding, $EOL);
}
} | [
"public",
"function",
"getContent",
"(",
"$",
"EOL",
"=",
"Zend_Mime",
"::",
"LINEEND",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_isStream",
")",
"{",
"return",
"stream_get_contents",
"(",
"$",
"this",
"->",
"getEncodedStream",
"(",
")",
")",
";",
"}",
... | Get the Content of the current Mime Part in the given encoding.
@return String | [
"Get",
"the",
"Content",
"of",
"the",
"current",
"Mime",
"Part",
"in",
"the",
"given",
"encoding",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mime/Part.php#L141-L148 | train | Get content of the part | [
30522,
2270,
3853,
2131,
8663,
6528,
2102,
1006,
1002,
1041,
4747,
1027,
16729,
2094,
1035,
2771,
4168,
1024,
1024,
2240,
10497,
1007,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
1035,
26354,
25379,
1007,
1063,
2709,
5460,
1035,
2131,
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... |
barryvdh/laravel-debugbar | src/DataCollector/RequestCollector.php | RequestCollector.collect | public function collect()
{
$request = $this->request;
$response = $this->response;
$responseHeaders = $response->headers->all();
$cookies = [];
foreach ($response->headers->getCookies() as $cookie) {
$cookies[] = $this->getCookieHeader(
$cookie->... | php | public function collect()
{
$request = $this->request;
$response = $this->response;
$responseHeaders = $response->headers->all();
$cookies = [];
foreach ($response->headers->getCookies() as $cookie) {
$cookies[] = $this->getCookieHeader(
$cookie->... | [
"public",
"function",
"collect",
"(",
")",
"{",
"$",
"request",
"=",
"$",
"this",
"->",
"request",
";",
"$",
"response",
"=",
"$",
"this",
"->",
"response",
";",
"$",
"responseHeaders",
"=",
"$",
"response",
"->",
"headers",
"->",
"all",
"(",
")",
";... | {@inheritdoc} | [
"{"
] | 2d195779ea4f809f69764a795e2ec371dbb76a96 | https://github.com/barryvdh/laravel-debugbar/blob/2d195779ea4f809f69764a795e2ec371dbb76a96/src/DataCollector/RequestCollector.php#L69-L153 | train | Collect all the information from the response | [
30522,
2270,
3853,
8145,
1006,
1007,
1063,
1002,
5227,
1027,
1002,
2023,
1011,
1028,
5227,
1025,
1002,
3433,
1027,
1002,
2023,
1011,
1028,
3433,
1025,
1002,
3433,
4974,
2545,
1027,
1002,
3433,
1011,
1028,
20346,
2015,
1011,
1028,
2035,
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/Foundation/Console/EventListCommand.php | EventListCommand.filterEvents | protected function filterEvents(array $events)
{
if (! $eventName = $this->option('event')) {
return $events;
}
return collect($events)->filter(function ($listeners, $event) use ($eventName) {
return Str::contains($event, $eventName);
})->toArray();
} | php | protected function filterEvents(array $events)
{
if (! $eventName = $this->option('event')) {
return $events;
}
return collect($events)->filter(function ($listeners, $event) use ($eventName) {
return Str::contains($event, $eventName);
})->toArray();
} | [
"protected",
"function",
"filterEvents",
"(",
"array",
"$",
"events",
")",
"{",
"if",
"(",
"!",
"$",
"eventName",
"=",
"$",
"this",
"->",
"option",
"(",
"'event'",
")",
")",
"{",
"return",
"$",
"events",
";",
"}",
"return",
"collect",
"(",
"$",
"even... | Filter the given events using the provided event name filter.
@param array $events
@return array | [
"Filter",
"the",
"given",
"events",
"using",
"the",
"provided",
"event",
"name",
"filter",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Foundation/Console/EventListCommand.php#L71-L80 | train | Filter events by event name | [
30522,
5123,
3853,
11307,
18697,
7666,
1006,
9140,
1002,
2824,
1007,
1063,
2065,
1006,
999,
1002,
2724,
18442,
1027,
1002,
2023,
1011,
1028,
5724,
1006,
1005,
2724,
1005,
1007,
1007,
1063,
2709,
1002,
2824,
1025,
1065,
2709,
8145,
1006,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Intl/NumberFormatter/NumberFormatter.php | NumberFormatter.convertValueDataType | private function convertValueDataType($value, $type)
{
if (self::TYPE_DOUBLE == $type) {
$value = (float) $value;
} elseif (self::TYPE_INT32 == $type) {
$value = $this->getInt32Value($value);
} elseif (self::TYPE_INT64 == $type) {
$value = $this->getInt64V... | php | private function convertValueDataType($value, $type)
{
if (self::TYPE_DOUBLE == $type) {
$value = (float) $value;
} elseif (self::TYPE_INT32 == $type) {
$value = $this->getInt32Value($value);
} elseif (self::TYPE_INT64 == $type) {
$value = $this->getInt64V... | [
"private",
"function",
"convertValueDataType",
"(",
"$",
"value",
",",
"$",
"type",
")",
"{",
"if",
"(",
"self",
"::",
"TYPE_DOUBLE",
"==",
"$",
"type",
")",
"{",
"$",
"value",
"=",
"(",
"float",
")",
"$",
"value",
";",
"}",
"elseif",
"(",
"self",
... | Returns the numeric value using the $type to convert to the right data type.
@param mixed $value The value to be converted
@param int $type The type to convert. Can be TYPE_DOUBLE (float) or TYPE_INT32 (int)
@return int|float|false The converted value | [
"Returns",
"the",
"numeric",
"value",
"using",
"the",
"$type",
"to",
"convert",
"to",
"the",
"right",
"data",
"type",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Intl/NumberFormatter/NumberFormatter.php#L800-L811 | train | Convert value data type | [
30522,
2797,
3853,
10463,
10175,
5657,
2850,
29336,
18863,
1006,
1002,
3643,
1010,
1002,
2828,
1007,
1063,
2065,
1006,
2969,
1024,
1024,
2828,
1035,
3313,
1027,
1027,
1002,
2828,
1007,
1063,
1002,
3643,
1027,
1006,
14257,
1007,
1002,
3643,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/cms/models/ThemeLog.php | ThemeLog.add | public static function add(HalcyonModel $template, $type = null)
{
if (!App::hasDatabase()) {
return;
}
if (!LogSetting::get('log_theme')) {
return;
}
if (!$type) {
$type = self::TYPE_UPDATE;
}
$isDelete = $type === self:... | php | public static function add(HalcyonModel $template, $type = null)
{
if (!App::hasDatabase()) {
return;
}
if (!LogSetting::get('log_theme')) {
return;
}
if (!$type) {
$type = self::TYPE_UPDATE;
}
$isDelete = $type === self:... | [
"public",
"static",
"function",
"add",
"(",
"HalcyonModel",
"$",
"template",
",",
"$",
"type",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"App",
"::",
"hasDatabase",
"(",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"LogSetting",
"::",
"get",
"("... | Creates a log record
@return self | [
"Creates",
"a",
"log",
"record"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/models/ThemeLog.php#L55-L100 | train | Add new record | [
30522,
2270,
10763,
3853,
5587,
1006,
11085,
5666,
2239,
5302,
9247,
1002,
23561,
1010,
1002,
2828,
1027,
19701,
1007,
1063,
2065,
1006,
999,
10439,
1024,
1024,
2038,
2850,
2696,
15058,
1006,
1007,
1007,
1063,
2709,
1025,
1065,
2065,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/Live/Model.php | Model.queryAdjacentVisitorId | public function queryAdjacentVisitorId($idSite, $visitorId, $visitLastActionTime, $segment, $getNext)
{
if ($getNext) {
$visitLastActionTimeCondition = "sub.visit_last_action_time <= ?";
$orderByDir = "DESC";
} else {
$visitLastActionTimeCondition = "sub.visit_las... | php | public function queryAdjacentVisitorId($idSite, $visitorId, $visitLastActionTime, $segment, $getNext)
{
if ($getNext) {
$visitLastActionTimeCondition = "sub.visit_last_action_time <= ?";
$orderByDir = "DESC";
} else {
$visitLastActionTimeCondition = "sub.visit_las... | [
"public",
"function",
"queryAdjacentVisitorId",
"(",
"$",
"idSite",
",",
"$",
"visitorId",
",",
"$",
"visitLastActionTime",
",",
"$",
"segment",
",",
"$",
"getNext",
")",
"{",
"if",
"(",
"$",
"getNext",
")",
"{",
"$",
"visitLastActionTimeCondition",
"=",
"\"... | Returns the ID of a visitor that is adjacent to another visitor (by time of last action)
in the log_visit table.
@param int $idSite The ID of the site whose visits should be looked at.
@param string $visitorId The ID of the visitor to get an adjacent visitor for.
@param string $visitLastActionTime The last action time... | [
"Returns",
"the",
"ID",
"of",
"a",
"visitor",
"that",
"is",
"adjacent",
"to",
"another",
"visitor",
"(",
"by",
"time",
"of",
"last",
"action",
")",
"in",
"the",
"log_visit",
"table",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Live/Model.php#L205-L239 | train | Query the visit ID for an adjacent visitor | [
30522,
2270,
3853,
23032,
4215,
3900,
13013,
11365,
15660,
3593,
1006,
1002,
8909,
28032,
2063,
1010,
1002,
10367,
3593,
1010,
1002,
3942,
8523,
2696,
7542,
7292,
1010,
1002,
6903,
1010,
1002,
2131,
2638,
18413,
1007,
1063,
2065,
1006,
1002... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/Annotations/API.php | API.getAll | public function getAll($idSite, $date = false, $period = 'day', $lastN = false)
{
Piwik::checkUserHasViewAccess($idSite);
$annotations = new AnnotationList($idSite);
// if date/period are supplied, determine start/end date for search
list($startDate, $endDate) = self::getDateRangeF... | php | public function getAll($idSite, $date = false, $period = 'day', $lastN = false)
{
Piwik::checkUserHasViewAccess($idSite);
$annotations = new AnnotationList($idSite);
// if date/period are supplied, determine start/end date for search
list($startDate, $endDate) = self::getDateRangeF... | [
"public",
"function",
"getAll",
"(",
"$",
"idSite",
",",
"$",
"date",
"=",
"false",
",",
"$",
"period",
"=",
"'day'",
",",
"$",
"lastN",
"=",
"false",
")",
"{",
"Piwik",
"::",
"checkUserHasViewAccess",
"(",
"$",
"idSite",
")",
";",
"$",
"annotations",
... | Returns every annotation for a specific site within a specific date range.
The date range is specified by a date, the period type (day/week/month/year)
and an optional number of N periods in the past to include.
@param string $idSite The site ID to add the annotation to. Can be one ID or
a list of site IDs.
@param boo... | [
"Returns",
"every",
"annotation",
"for",
"a",
"specific",
"site",
"within",
"a",
"specific",
"date",
"range",
".",
"The",
"date",
"range",
"is",
"specified",
"by",
"a",
"date",
"the",
"period",
"type",
"(",
"day",
"/",
"week",
"/",
"month",
"/",
"year",
... | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Annotations/API.php#L185-L195 | train | Get all annotations for a site | [
30522,
2270,
3853,
2131,
8095,
1006,
1002,
8909,
28032,
2063,
1010,
1002,
3058,
1027,
6270,
1010,
1002,
2558,
1027,
1005,
2154,
1005,
1010,
1002,
2197,
2078,
1027,
6270,
1007,
1063,
14255,
9148,
2243,
1024,
1024,
4638,
20330,
14949,
8584,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Queue/CallQueuedClosure.php | CallQueuedClosure.displayName | public function displayName()
{
$reflection = new ReflectionFunction($this->closure->getClosure());
return 'Closure ('.basename($reflection->getFileName()).':'.$reflection->getStartLine().')';
} | php | public function displayName()
{
$reflection = new ReflectionFunction($this->closure->getClosure());
return 'Closure ('.basename($reflection->getFileName()).':'.$reflection->getStartLine().')';
} | [
"public",
"function",
"displayName",
"(",
")",
"{",
"$",
"reflection",
"=",
"new",
"ReflectionFunction",
"(",
"$",
"this",
"->",
"closure",
"->",
"getClosure",
"(",
")",
")",
";",
"return",
"'Closure ('",
".",
"basename",
"(",
"$",
"reflection",
"->",
"get... | Get the display name for the queued job.
@return string | [
"Get",
"the",
"display",
"name",
"for",
"the",
"queued",
"job",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Queue/CallQueuedClosure.php#L56-L61 | train | Get the display name of the closure | [
30522,
2270,
3853,
4653,
18442,
1006,
1007,
1063,
1002,
9185,
1027,
2047,
9185,
11263,
27989,
1006,
1002,
2023,
1011,
1028,
8503,
1011,
1028,
2131,
20464,
2891,
5397,
1006,
1007,
1007,
1025,
2709,
1005,
8503,
1006,
1005,
1012,
2918,
18442,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Mail/Mailable.php | Mailable.hasRecipient | protected function hasRecipient($address, $name = null, $property = 'to')
{
$expected = $this->normalizeRecipient(
$this->addressesToArray($address, $name)[0]
);
$expected = [
'name' => $expected->name ?? null,
'address' => $expected->email,
];
... | php | protected function hasRecipient($address, $name = null, $property = 'to')
{
$expected = $this->normalizeRecipient(
$this->addressesToArray($address, $name)[0]
);
$expected = [
'name' => $expected->name ?? null,
'address' => $expected->email,
];
... | [
"protected",
"function",
"hasRecipient",
"(",
"$",
"address",
",",
"$",
"name",
"=",
"null",
",",
"$",
"property",
"=",
"'to'",
")",
"{",
"$",
"expected",
"=",
"$",
"this",
"->",
"normalizeRecipient",
"(",
"$",
"this",
"->",
"addressesToArray",
"(",
"$",... | Determine if the given recipient is set on the mailable.
@param object|array|string $address
@param string|null $name
@param string $property
@return bool | [
"Determine",
"if",
"the",
"given",
"recipient",
"is",
"set",
"on",
"the",
"mailable",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Mail/Mailable.php#L632-L650 | train | Checks if a recipient has been sent | [
30522,
5123,
3853,
2038,
2890,
6895,
14756,
3372,
1006,
1002,
4769,
1010,
1002,
2171,
1027,
19701,
1010,
1002,
3200,
1027,
1005,
2000,
1005,
1007,
1063,
1002,
3517,
1027,
1002,
2023,
1011,
1028,
3671,
17629,
8586,
11514,
11638,
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/Templating/PhpEngine.php | PhpEngine.get | public function get($name)
{
if (!isset($this->helpers[$name])) {
throw new \InvalidArgumentException(sprintf('The helper "%s" is not defined.', $name));
}
if (\is_string($this->helpers[$name])) {
$this->helpers[$name] = $this->container->get($this->helpers[$name]);
... | php | public function get($name)
{
if (!isset($this->helpers[$name])) {
throw new \InvalidArgumentException(sprintf('The helper "%s" is not defined.', $name));
}
if (\is_string($this->helpers[$name])) {
$this->helpers[$name] = $this->container->get($this->helpers[$name]);
... | [
"public",
"function",
"get",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"helpers",
"[",
"$",
"name",
"]",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'The helper \"%s\" is not d... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bundle/FrameworkBundle/Templating/PhpEngine.php#L47-L59 | train | Get the helper by name | [
30522,
2270,
3853,
2131,
1006,
1002,
2171,
1007,
1063,
2065,
1006,
999,
26354,
3388,
1006,
1002,
2023,
1011,
1028,
2393,
2545,
1031,
1002,
2171,
1033,
1007,
1007,
1063,
5466,
2047,
1032,
19528,
2906,
22850,
15781,
2595,
24422,
1006,
9043,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/backend/widgets/MediaManager.php | MediaManager.getSelectionParams | protected function getSelectionParams()
{
$result = $this->getSession('media_crop_selection_params');
if ($result) {
if (!isset($result['mode'])) {
$result['mode'] = self::SELECTION_MODE_NORMAL;
}
if (!isset($result['width'])) {
$... | php | protected function getSelectionParams()
{
$result = $this->getSession('media_crop_selection_params');
if ($result) {
if (!isset($result['mode'])) {
$result['mode'] = self::SELECTION_MODE_NORMAL;
}
if (!isset($result['width'])) {
$... | [
"protected",
"function",
"getSelectionParams",
"(",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"getSession",
"(",
"'media_crop_selection_params'",
")",
";",
"if",
"(",
"$",
"result",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"result",
"[",
"'mod... | Gets the user selection parameters from the session state
@return array | [
"Gets",
"the",
"user",
"selection",
"parameters",
"from",
"the",
"session",
"state"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/MediaManager.php#L1003-L1028 | train | Return the selection parameters from the session | [
30522,
5123,
3853,
4152,
12260,
7542,
28689,
5244,
1006,
1007,
1063,
1002,
2765,
1027,
1002,
2023,
1011,
1028,
4152,
7971,
3258,
1006,
1005,
2865,
1035,
10416,
1035,
4989,
1035,
11498,
5244,
1005,
1007,
1025,
2065,
1006,
1002,
2765,
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/Mail/Message.php | Message.to | public function to($address, $name = null, $override = false)
{
if ($override) {
$this->swift->setTo($address, $name);
return $this;
}
return $this->addAddresses($address, $name, 'To');
} | php | public function to($address, $name = null, $override = false)
{
if ($override) {
$this->swift->setTo($address, $name);
return $this;
}
return $this->addAddresses($address, $name, 'To');
} | [
"public",
"function",
"to",
"(",
"$",
"address",
",",
"$",
"name",
"=",
"null",
",",
"$",
"override",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"override",
")",
"{",
"$",
"this",
"->",
"swift",
"->",
"setTo",
"(",
"$",
"address",
",",
"$",
"name",
... | Add a recipient to the message.
@param string|array $address
@param string|null $name
@param bool $override
@return $this | [
"Add",
"a",
"recipient",
"to",
"the",
"message",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Mail/Message.php#L90-L99 | train | Set To address | [
30522,
2270,
3853,
2000,
1006,
1002,
4769,
1010,
1002,
2171,
1027,
19701,
1010,
1002,
2058,
15637,
1027,
6270,
1007,
1063,
2065,
1006,
1002,
2058,
15637,
1007,
1063,
1002,
2023,
1011,
1028,
9170,
1011,
1028,
2275,
3406,
1006,
1002,
4769,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Contracts/Translation/TranslatorTrait.php | TranslatorTrait.getPluralizationRule | private function getPluralizationRule(int $number, string $locale): int
{
switch ('pt_BR' !== $locale && \strlen($locale) > 3 ? substr($locale, 0, strrpos($locale, '_')) : $locale) {
case 'af':
case 'bn':
case 'bg':
case 'ca':
case 'da':
... | php | private function getPluralizationRule(int $number, string $locale): int
{
switch ('pt_BR' !== $locale && \strlen($locale) > 3 ? substr($locale, 0, strrpos($locale, '_')) : $locale) {
case 'af':
case 'bn':
case 'bg':
case 'ca':
case 'da':
... | [
"private",
"function",
"getPluralizationRule",
"(",
"int",
"$",
"number",
",",
"string",
"$",
"locale",
")",
":",
"int",
"{",
"switch",
"(",
"'pt_BR'",
"!==",
"$",
"locale",
"&&",
"\\",
"strlen",
"(",
"$",
"locale",
")",
">",
"3",
"?",
"substr",
"(",
... | Returns the plural position to use for the given locale and number.
The plural rules are derived from code of the Zend Framework (2010-09-25),
which is subject to the new BSD license (http://framework.zend.com/license/new-bsd).
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) | [
"Returns",
"the",
"plural",
"position",
"to",
"use",
"for",
"the",
"given",
"locale",
"and",
"number",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Contracts/Translation/TranslatorTrait.php#L137-L254 | train | Returns the pluralization rule for the given number and locale | [
30522,
2797,
3853,
2131,
24759,
11137,
3989,
6820,
2571,
1006,
20014,
1002,
2193,
1010,
5164,
1002,
2334,
2063,
1007,
1024,
20014,
1063,
6942,
1006,
1005,
13866,
1035,
7987,
1005,
999,
1027,
1027,
1002,
2334,
2063,
1004,
1004,
1032,
2358,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Common/Uri.php | Uri.route | public function route($absolute = false, $domain = false)
{
return ($absolute ? $this->rootUrl($domain) : '') . '/' . implode('/', $this->paths);
} | php | public function route($absolute = false, $domain = false)
{
return ($absolute ? $this->rootUrl($domain) : '') . '/' . implode('/', $this->paths);
} | [
"public",
"function",
"route",
"(",
"$",
"absolute",
"=",
"false",
",",
"$",
"domain",
"=",
"false",
")",
"{",
"return",
"(",
"$",
"absolute",
"?",
"$",
"this",
"->",
"rootUrl",
"(",
"$",
"domain",
")",
":",
"''",
")",
".",
"'/'",
".",
"implode",
... | Return route to the current URI. By default route doesn't include base path.
@param bool $absolute True to include full path.
@param bool $domain True to include domain. Works only if first parameter is also true.
@return string | [
"Return",
"route",
"to",
"the",
"current",
"URI",
".",
"By",
"default",
"route",
"doesn",
"t",
"include",
"base",
"path",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Uri.php#L236-L239 | train | Returns the route to the root of the page | [
30522,
2270,
3853,
2799,
1006,
1002,
7619,
1027,
6270,
1010,
1002,
5884,
1027,
6270,
1007,
1063,
2709,
1006,
1002,
7619,
1029,
1002,
2023,
1011,
1028,
7117,
3126,
2140,
1006,
1002,
5884,
1007,
1024,
1005,
1005,
1007,
1012,
1005,
1013,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Auth/Passwords/PasswordBroker.php | PasswordBroker.validatePasswordWithDefaults | protected function validatePasswordWithDefaults(array $credentials)
{
[$password, $confirm] = [
$credentials['password'],
$credentials['password_confirmation'],
];
return $password === $confirm && mb_strlen($password) >= 8;
} | php | protected function validatePasswordWithDefaults(array $credentials)
{
[$password, $confirm] = [
$credentials['password'],
$credentials['password_confirmation'],
];
return $password === $confirm && mb_strlen($password) >= 8;
} | [
"protected",
"function",
"validatePasswordWithDefaults",
"(",
"array",
"$",
"credentials",
")",
"{",
"[",
"$",
"password",
",",
"$",
"confirm",
"]",
"=",
"[",
"$",
"credentials",
"[",
"'password'",
"]",
",",
"$",
"credentials",
"[",
"'password_confirmation'",
... | Determine if the passwords are valid for the request.
@param array $credentials
@return bool | [
"Determine",
"if",
"the",
"passwords",
"are",
"valid",
"for",
"the",
"request",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Auth/Passwords/PasswordBroker.php#L168-L176 | train | Validate password with default values | [
30522,
5123,
3853,
9398,
3686,
15194,
18351,
24415,
3207,
7011,
11314,
2015,
1006,
30524,
1005,
20786,
1005,
1033,
1010,
1002,
22496,
1031,
1005,
20786,
1035,
13964,
1005,
1033,
1010,
1033,
1025,
2709,
1002,
20786,
1027,
1027,
1027,
1002,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/SitesManager/API.php | API.updateSiteCreatedTime | public function updateSiteCreatedTime($idSites, Date $minDate)
{
$idSites = Site::getIdSitesFromIdSitesString($idSites);
Piwik::checkUserHasAdminAccess($idSites);
$minDateSql = $minDate->subDay(1)->getDatetime();
$this->getModel()->updateSiteCreatedTime($idSites, $minDateSql);
... | php | public function updateSiteCreatedTime($idSites, Date $minDate)
{
$idSites = Site::getIdSitesFromIdSitesString($idSites);
Piwik::checkUserHasAdminAccess($idSites);
$minDateSql = $minDate->subDay(1)->getDatetime();
$this->getModel()->updateSiteCreatedTime($idSites, $minDateSql);
... | [
"public",
"function",
"updateSiteCreatedTime",
"(",
"$",
"idSites",
",",
"Date",
"$",
"minDate",
")",
"{",
"$",
"idSites",
"=",
"Site",
"::",
"getIdSitesFromIdSitesString",
"(",
"$",
"idSites",
")",
";",
"Piwik",
"::",
"checkUserHasAdminAccess",
"(",
"$",
"idS... | Updates the field ts_created for the specified websites.
@param $idSites int Id Site to update ts_created
@param $minDate Date to set as creation date. To play it safe it will subtract one more day.
@ignore | [
"Updates",
"the",
"field",
"ts_created",
"for",
"the",
"specified",
"websites",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SitesManager/API.php#L1347-L1355 | train | Update the created time of the sites in the database. | [
30522,
2270,
3853,
14409,
4221,
16748,
4383,
7292,
1006,
1002,
8909,
28032,
2229,
1010,
3058,
1002,
2568,
3686,
1007,
1063,
1002,
8909,
28032,
2229,
1027,
2609,
1024,
1024,
2131,
9821,
7616,
19699,
20936,
5104,
7616,
3367,
4892,
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 | plugins/Live/API.php | API.getCounters | public function getCounters($idSite, $lastMinutes, $segment = false, $showColumns = array(), $hideColumns = array())
{
Piwik::checkUserHasViewAccess($idSite);
$model = new Model();
if (is_string($showColumns)) {
$showColumns = explode(',', $showColumns);
}
if (i... | php | public function getCounters($idSite, $lastMinutes, $segment = false, $showColumns = array(), $hideColumns = array())
{
Piwik::checkUserHasViewAccess($idSite);
$model = new Model();
if (is_string($showColumns)) {
$showColumns = explode(',', $showColumns);
}
if (i... | [
"public",
"function",
"getCounters",
"(",
"$",
"idSite",
",",
"$",
"lastMinutes",
",",
"$",
"segment",
"=",
"false",
",",
"$",
"showColumns",
"=",
"array",
"(",
")",
",",
"$",
"hideColumns",
"=",
"array",
"(",
")",
")",
"{",
"Piwik",
"::",
"checkUserHa... | This will return simple counters, for a given website ID, for visits over the last N minutes
@param int $idSite Id Site
@param int $lastMinutes Number of minutes to look back at
@param bool|string $segment
@param array $showColumns The columns to show / not to request. Eg 'visits', 'actions', ...
@param array $hideCol... | [
"This",
"will",
"return",
"simple",
"counters",
"for",
"a",
"given",
"website",
"ID",
"for",
"visits",
"over",
"the",
"last",
"N",
"minutes"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Live/API.php#L70-L116 | train | Returns the counters for the given site | [
30522,
2270,
3853,
2131,
3597,
16671,
2545,
1006,
1002,
8909,
28032,
2063,
1010,
1002,
2197,
10020,
10421,
2015,
1010,
1002,
6903,
1027,
6270,
1010,
1002,
2265,
25778,
2819,
3619,
1027,
9140,
1006,
1007,
1010,
1002,
5342,
25778,
2819,
3619,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/MockHandler.php | MockHandler.append | public function append()
{
foreach (func_get_args() as $value) {
if ($value instanceof ResponseInterface
|| $value instanceof \Exception
|| $value instanceof PromiseInterface
|| is_callable($value)
) {
$this->queue[] = $... | php | public function append()
{
foreach (func_get_args() as $value) {
if ($value instanceof ResponseInterface
|| $value instanceof \Exception
|| $value instanceof PromiseInterface
|| is_callable($value)
) {
$this->queue[] = $... | [
"public",
"function",
"append",
"(",
")",
"{",
"foreach",
"(",
"func_get_args",
"(",
")",
"as",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"instanceof",
"ResponseInterface",
"||",
"$",
"value",
"instanceof",
"\\",
"Exception",
"||",
"$",
"value",
"... | Adds one or more variadic requests, exceptions, callables, or promises
to the queue. | [
"Adds",
"one",
"or",
"more",
"variadic",
"requests",
"exceptions",
"callables",
"or",
"promises",
"to",
"the",
"queue",
"."
] | bf595424e4d442a190582e088985dc835a789071 | https://github.com/guzzle/guzzle/blob/bf595424e4d442a190582e088985dc835a789071/src/Handler/MockHandler.php#L132-L146 | train | Append to the queue | [
30522,
2270,
3853,
10439,
10497,
1006,
1007,
1063,
18921,
6776,
1006,
4569,
2278,
1035,
2131,
1035,
12098,
5620,
1006,
1007,
2004,
1002,
3643,
1007,
1063,
2065,
1006,
1002,
3643,
6013,
11253,
3433,
18447,
2121,
12172,
1064,
1064,
1002,
3643... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/BrowserKit/Client.php | Client.insulate | public function insulate($insulated = true)
{
if ($insulated && !class_exists('Symfony\\Component\\Process\\Process')) {
throw new \LogicException('Unable to isolate requests as the Symfony Process Component is not installed.');
}
$this->insulated = (bool) $insulated;
} | php | public function insulate($insulated = true)
{
if ($insulated && !class_exists('Symfony\\Component\\Process\\Process')) {
throw new \LogicException('Unable to isolate requests as the Symfony Process Component is not installed.');
}
$this->insulated = (bool) $insulated;
} | [
"public",
"function",
"insulate",
"(",
"$",
"insulated",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"insulated",
"&&",
"!",
"class_exists",
"(",
"'Symfony\\\\Component\\\\Process\\\\Process'",
")",
")",
"{",
"throw",
"new",
"\\",
"LogicException",
"(",
"'Unable to i... | Sets the insulated flag.
@param bool $insulated Whether to insulate the requests or not
@throws \RuntimeException When Symfony Process Component is not installed | [
"Sets",
"the",
"insulated",
"flag",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/BrowserKit/Client.php#L120-L127 | train | Instructs the request handler to isolate requests. | [
30522,
2270,
3853,
16021,
9869,
1006,
1002,
16021,
8898,
1027,
2995,
1007,
1063,
2065,
1006,
1002,
16021,
8898,
1004,
1004,
999,
2465,
1035,
6526,
1006,
1005,
25353,
2213,
14876,
4890,
1032,
1032,
6922,
1032,
1032,
2832,
1032,
1032,
2832,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Form/Extension/Validator/ViolationMapper/MappingRule.php | MappingRule.getTarget | public function getTarget()
{
$childNames = explode('.', $this->targetPath);
$target = $this->origin;
foreach ($childNames as $childName) {
if (!$target->has($childName)) {
throw new ErrorMappingException(sprintf('The child "%s" of "%s" mapped by the rule "%s" in... | php | public function getTarget()
{
$childNames = explode('.', $this->targetPath);
$target = $this->origin;
foreach ($childNames as $childName) {
if (!$target->has($childName)) {
throw new ErrorMappingException(sprintf('The child "%s" of "%s" mapped by the rule "%s" in... | [
"public",
"function",
"getTarget",
"(",
")",
"{",
"$",
"childNames",
"=",
"explode",
"(",
"'.'",
",",
"$",
"this",
"->",
"targetPath",
")",
";",
"$",
"target",
"=",
"$",
"this",
"->",
"origin",
";",
"foreach",
"(",
"$",
"childNames",
"as",
"$",
"chil... | @return FormInterface
@throws ErrorMappingException | [
"@return",
"FormInterface"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/MappingRule.php#L79-L92 | train | Get the target of the mapping | [
30522,
2270,
3853,
2131,
7559,
18150,
1006,
1007,
1063,
1002,
2775,
18442,
2015,
1027,
15044,
1006,
1005,
1012,
1005,
1010,
1002,
2023,
1011,
1028,
4539,
15069,
1007,
1025,
1002,
4539,
1027,
1002,
2023,
1011,
1028,
4761,
1025,
18921,
6776,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.addWhereClausesToRoute | protected function addWhereClausesToRoute($route)
{
$route->where(array_merge(
$this->patterns, $route->getAction()['where'] ?? []
));
return $route;
} | php | protected function addWhereClausesToRoute($route)
{
$route->where(array_merge(
$this->patterns, $route->getAction()['where'] ?? []
));
return $route;
} | [
"protected",
"function",
"addWhereClausesToRoute",
"(",
"$",
"route",
")",
"{",
"$",
"route",
"->",
"where",
"(",
"array_merge",
"(",
"$",
"this",
"->",
"patterns",
",",
"$",
"route",
"->",
"getAction",
"(",
")",
"[",
"'where'",
"]",
"??",
"[",
"]",
")... | Add the necessary where clauses to the route based on its initial registration.
@param \Illuminate\Routing\Route $route
@return \Illuminate\Routing\Route | [
"Add",
"the",
"necessary",
"where",
"clauses",
"to",
"the",
"route",
"based",
"on",
"its",
"initial",
"registration",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/Router.php#L569-L576 | train | Add where clauses to route | [
30522,
5123,
3853,
5587,
2860,
5886,
8586,
28128,
4355,
14604,
10421,
1006,
1002,
2799,
1007,
1063,
1002,
2799,
1011,
1028,
2073,
1006,
9140,
1035,
13590,
1006,
1002,
2023,
1011,
1028,
7060,
1010,
1002,
2799,
1011,
1028,
2131,
18908,
3258,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Lock/Store/MemcachedStore.php | MemcachedStore.putOffExpiration | public function putOffExpiration(Key $key, $ttl)
{
if ($ttl < 1) {
throw new InvalidArgumentException(sprintf('%s() expects a TTL greater or equals to 1 second. Got %s.', __METHOD__, $ttl));
}
// Interface defines a float value but Store required an integer.
$ttl = (int)... | php | public function putOffExpiration(Key $key, $ttl)
{
if ($ttl < 1) {
throw new InvalidArgumentException(sprintf('%s() expects a TTL greater or equals to 1 second. Got %s.', __METHOD__, $ttl));
}
// Interface defines a float value but Store required an integer.
$ttl = (int)... | [
"public",
"function",
"putOffExpiration",
"(",
"Key",
"$",
"key",
",",
"$",
"ttl",
")",
"{",
"if",
"(",
"$",
"ttl",
"<",
"1",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'%s() expects a TTL greater or equals to 1 second. Got %s.'",
... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Lock/Store/MemcachedStore.php#L80-L116 | train | Puts off the expiration of a key | [
30522,
2270,
3853,
2404,
7245,
10288,
16781,
1006,
3145,
1002,
3145,
1010,
1002,
23746,
2140,
1007,
1063,
2065,
1006,
1002,
23746,
2140,
1026,
1015,
1007,
1063,
5466,
2047,
19528,
2906,
22850,
15781,
2595,
24422,
1006,
9043,
2546,
1006,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Queue/RedisQueue.php | RedisQueue.pop | public function pop($queue = null)
{
$this->migrate($prefixed = $this->getQueue($queue));
if (empty($nextJob = $this->retrieveNextJob($prefixed))) {
return;
}
[$job, $reserved] = $nextJob;
if ($reserved) {
return new RedisJob(
$this-... | php | public function pop($queue = null)
{
$this->migrate($prefixed = $this->getQueue($queue));
if (empty($nextJob = $this->retrieveNextJob($prefixed))) {
return;
}
[$job, $reserved] = $nextJob;
if ($reserved) {
return new RedisJob(
$this-... | [
"public",
"function",
"pop",
"(",
"$",
"queue",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"migrate",
"(",
"$",
"prefixed",
"=",
"$",
"this",
"->",
"getQueue",
"(",
"$",
"queue",
")",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"nextJob",
"=",
"$",
... | Pop the next job off of the queue.
@param string $queue
@return \Illuminate\Contracts\Queue\Job|null | [
"Pop",
"the",
"next",
"job",
"off",
"of",
"the",
"queue",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Queue/RedisQueue.php#L165-L181 | train | Pop a job from the queue | [
30522,
2270,
3853,
3769,
1006,
1002,
24240,
1027,
19701,
1007,
1063,
1002,
2023,
1011,
1028,
22806,
1006,
1002,
17576,
2098,
1027,
1002,
2023,
1011,
1028,
2131,
4226,
5657,
1006,
1002,
24240,
1007,
1007,
1025,
2065,
1006,
4064,
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 | libs/Zend/Db/Table/Row/Abstract.php | Zend_Db_Table_Row_Abstract.findDependentRowset | public function findDependentRowset($dependentTable, $ruleKey = null, Zend_Db_Table_Select $select = null)
{
$db = $this->_getTable()->getAdapter();
if (is_string($dependentTable)) {
$dependentTable = $this->_getTableFromString($dependentTable);
}
if (!$dependentTable i... | php | public function findDependentRowset($dependentTable, $ruleKey = null, Zend_Db_Table_Select $select = null)
{
$db = $this->_getTable()->getAdapter();
if (is_string($dependentTable)) {
$dependentTable = $this->_getTableFromString($dependentTable);
}
if (!$dependentTable i... | [
"public",
"function",
"findDependentRowset",
"(",
"$",
"dependentTable",
",",
"$",
"ruleKey",
"=",
"null",
",",
"Zend_Db_Table_Select",
"$",
"select",
"=",
"null",
")",
"{",
"$",
"db",
"=",
"$",
"this",
"->",
"_getTable",
"(",
")",
"->",
"getAdapter",
"(",... | Query a dependent table to retrieve rows matching the current row.
@param string|Zend_Db_Table_Abstract $dependentTable
@param string OPTIONAL $ruleKey
@param Zend_Db_Table_Select OPTIONAL $select
@return Zend_Db_Table_Rowset_Abstract Query result from $dependentTable
@throws Zend_Db... | [
"Query",
"a",
"dependent",
"table",
"to",
"retrieve",
"rows",
"matching",
"the",
"current",
"row",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Table/Row/Abstract.php#L867-L912 | train | find dependent rowset | [
30522,
2270,
3853,
2424,
3207,
11837,
16454,
10524,
13462,
1006,
1002,
7790,
10880,
1010,
1002,
3627,
14839,
1027,
19701,
1010,
16729,
2094,
1035,
16962,
1035,
2795,
1035,
7276,
1002,
7276,
1027,
19701,
1007,
1063,
1002,
16962,
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... |
overtrue/wechat | src/OfficialAccount/ShakeAround/ServiceProvider.php | ServiceProvider.register | public function register(Container $app)
{
$app['shake_around'] = function ($app) {
return new ShakeAround($app);
};
$app['shake_around.device'] = function ($app) {
return new DeviceClient($app);
};
$app['shake_around.page'] = function ($app) {
... | php | public function register(Container $app)
{
$app['shake_around'] = function ($app) {
return new ShakeAround($app);
};
$app['shake_around.device'] = function ($app) {
return new DeviceClient($app);
};
$app['shake_around.page'] = function ($app) {
... | [
"public",
"function",
"register",
"(",
"Container",
"$",
"app",
")",
"{",
"$",
"app",
"[",
"'shake_around'",
"]",
"=",
"function",
"(",
"$",
"app",
")",
"{",
"return",
"new",
"ShakeAround",
"(",
"$",
"app",
")",
";",
"}",
";",
"$",
"app",
"[",
"'sh... | {@inheritdoc}. | [
"{"
] | 120c72faaa93c270365bc75c73c362d5fd583209 | https://github.com/overtrue/wechat/blob/120c72faaa93c270365bc75c73c362d5fd583209/src/OfficialAccount/ShakeAround/ServiceProvider.php#L27-L56 | train | Register the shake around and page clients | [
30522,
2270,
3853,
4236,
1006,
11661,
1002,
10439,
1007,
1063,
1002,
10439,
1031,
1005,
6073,
1035,
2105,
1005,
1033,
1027,
3853,
1006,
1002,
10439,
1007,
1063,
2709,
2047,
6073,
24490,
1006,
1002,
10439,
1007,
1025,
1065,
1025,
1002,
10439... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
dompdf/dompdf | lib/html5lib/Parser.php | HTML5_Parser.parse | static public function parse($text, $builder = null) {
$tokenizer = new HTML5_Tokenizer($text, $builder);
$tokenizer->parse();
return $tokenizer->save();
} | php | static public function parse($text, $builder = null) {
$tokenizer = new HTML5_Tokenizer($text, $builder);
$tokenizer->parse();
return $tokenizer->save();
} | [
"static",
"public",
"function",
"parse",
"(",
"$",
"text",
",",
"$",
"builder",
"=",
"null",
")",
"{",
"$",
"tokenizer",
"=",
"new",
"HTML5_Tokenizer",
"(",
"$",
"text",
",",
"$",
"builder",
")",
";",
"$",
"tokenizer",
"->",
"parse",
"(",
")",
";",
... | Parses a full HTML document.
@param $text | HTML text to parse
@param $builder | Custom builder implementation
@return DOMDocument|DOMNodeList Parsed HTML as DOMDocument | [
"Parses",
"a",
"full",
"HTML",
"document",
"."
] | 75f13c700009be21a1965dc2c5b68a8708c22ba2 | https://github.com/dompdf/dompdf/blob/75f13c700009be21a1965dc2c5b68a8708c22ba2/lib/html5lib/Parser.php#L19-L23 | train | Parse HTML5 string | [
30522,
10763,
2270,
3853,
11968,
3366,
1006,
1002,
3793,
1010,
1002,
12508,
1027,
19701,
1007,
1063,
1002,
19204,
17629,
1027,
2047,
16129,
2629,
1035,
19204,
17629,
1006,
1002,
3793,
1010,
1002,
12508,
1007,
1025,
1002,
19204,
17629,
1011,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/API/ProcessedReport.php | ProcessedReport.sortReports | public function sortReports($a, $b)
{
return $this->reportsProvider->compareCategories($a['category'], $a['subcategory'], $a['order'], $b['category'], $b['subcategory'], $b['order']);
} | php | public function sortReports($a, $b)
{
return $this->reportsProvider->compareCategories($a['category'], $a['subcategory'], $a['order'], $b['category'], $b['subcategory'], $b['order']);
} | [
"public",
"function",
"sortReports",
"(",
"$",
"a",
",",
"$",
"b",
")",
"{",
"return",
"$",
"this",
"->",
"reportsProvider",
"->",
"compareCategories",
"(",
"$",
"a",
"[",
"'category'",
"]",
",",
"$",
"a",
"[",
"'subcategory'",
"]",
",",
"$",
"a",
"[... | API metadata are sorted by category/name,
with a little tweak to replicate the standard Piwik category ordering
@param array $a
@param array $b
@return int | [
"API",
"metadata",
"are",
"sorted",
"by",
"category",
"/",
"name",
"with",
"a",
"little",
"tweak",
"to",
"replicate",
"the",
"standard",
"Piwik",
"category",
"ordering"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/API/ProcessedReport.php#L313-L316 | train | Sort reports by categories and subcategories | [
30522,
2270,
3853,
4066,
2890,
25378,
1006,
1002,
1037,
1010,
1002,
1038,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
4311,
21572,
17258,
2121,
1011,
1028,
12826,
16280,
20255,
3111,
1006,
1002,
1037,
1031,
1005,
4696,
1005,
1033,
1010,
1002,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Routing/Router.php | Router.view | public function view($uri, $view, $data = [])
{
return $this->match(['GET', 'HEAD'], $uri, '\Illuminate\Routing\ViewController')
->defaults('view', $view)
->defaults('data', $data);
} | php | public function view($uri, $view, $data = [])
{
return $this->match(['GET', 'HEAD'], $uri, '\Illuminate\Routing\ViewController')
->defaults('view', $view)
->defaults('data', $data);
} | [
"public",
"function",
"view",
"(",
"$",
"uri",
",",
"$",
"view",
",",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"match",
"(",
"[",
"'GET'",
",",
"'HEAD'",
"]",
",",
"$",
"uri",
",",
"'\\Illuminate\\Routing\\ViewController'",
... | Register a new route that returns a view.
@param string $uri
@param string $view
@param array $data
@return \Illuminate\Routing\Route | [
"Register",
"a",
"new",
"route",
"that",
"returns",
"a",
"view",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/Router.php#L269-L274 | train | View a controller | [
30522,
2270,
3853,
3193,
1006,
1002,
24471,
2072,
1010,
1002,
3193,
1010,
1002,
2951,
1027,
1031,
1033,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
30524,
12717,
12556,
1032,
16972,
1032,
3193,
8663,
13181,
10820,
1005,
1007,
1011,
1028,
1239... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Cache/DynamoDbStore.php | DynamoDbStore.many | public function many(array $keys)
{
$prefixedKeys = array_map(function ($key) {
return $this->prefix.$key;
}, $keys);
$response = $this->dynamo->batchGetItem([
'RequestItems' => [
$this->table => [
'ConsistentRead' => false,
... | php | public function many(array $keys)
{
$prefixedKeys = array_map(function ($key) {
return $this->prefix.$key;
}, $keys);
$response = $this->dynamo->batchGetItem([
'RequestItems' => [
$this->table => [
'ConsistentRead' => false,
... | [
"public",
"function",
"many",
"(",
"array",
"$",
"keys",
")",
"{",
"$",
"prefixedKeys",
"=",
"array_map",
"(",
"function",
"(",
"$",
"key",
")",
"{",
"return",
"$",
"this",
"->",
"prefix",
".",
"$",
"key",
";",
"}",
",",
"$",
"keys",
")",
";",
"$... | Retrieve multiple items from the cache by key.
Items not found in the cache will have a null value.
@param array $keys
@return array | [
"Retrieve",
"multiple",
"items",
"from",
"the",
"cache",
"by",
"key",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Cache/DynamoDbStore.php#L130-L167 | train | Returns an array of all keys in the cache | [
30522,
2270,
3853,
2116,
1006,
9140,
1002,
6309,
1007,
1063,
1002,
17576,
2098,
14839,
2015,
1027,
9140,
1035,
4949,
1006,
3853,
1006,
1002,
3145,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
17576,
1012,
1002,
3145,
1025,
1065,
1010,
1002,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/MultiSites/API.php | API.setPastTotalVisitsMetadata | private function setPastTotalVisitsMetadata($dataTable, $pastTable)
{
if ($pastTable instanceof DataTable) {
$total = 0;
$metric = 'nb_visits';
$rows = $pastTable->getRows();
$rows = $this->filterRowsForTotalsCalculation($rows);
foreach ($rows a... | php | private function setPastTotalVisitsMetadata($dataTable, $pastTable)
{
if ($pastTable instanceof DataTable) {
$total = 0;
$metric = 'nb_visits';
$rows = $pastTable->getRows();
$rows = $this->filterRowsForTotalsCalculation($rows);
foreach ($rows a... | [
"private",
"function",
"setPastTotalVisitsMetadata",
"(",
"$",
"dataTable",
",",
"$",
"pastTable",
")",
"{",
"if",
"(",
"$",
"pastTable",
"instanceof",
"DataTable",
")",
"{",
"$",
"total",
"=",
"0",
";",
"$",
"metric",
"=",
"'nb_visits'",
";",
"$",
"rows",... | Sets the number of total visits in tha pastTable on the dataTable as metadata.
@param DataTable $dataTable
@param DataTable $pastTable | [
"Sets",
"the",
"number",
"of",
"total",
"visits",
"in",
"tha",
"pastTable",
"on",
"the",
"dataTable",
"as",
"metadata",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/MultiSites/API.php#L463-L478 | train | Set total visits metadata | [
30522,
2797,
3853,
2275,
19707,
9284,
9080,
11365,
12762,
11368,
8447,
2696,
1006,
1002,
2951,
10880,
1010,
1002,
2627,
10880,
1007,
1063,
2065,
1006,
1002,
2627,
10880,
6013,
11253,
2951,
10880,
1007,
1063,
1002,
2561,
1027,
1014,
1025,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Serializer/Normalizer/AbstractObjectNormalizer.php | AbstractObjectNormalizer.getCacheKey | private function getCacheKey(?string $format, array $context)
{
foreach ($context[self::EXCLUDE_FROM_CACHE_KEY] ?? $this->defaultContext[self::EXCLUDE_FROM_CACHE_KEY] as $key) {
unset($context[$key]);
}
unset($context[self::EXCLUDE_FROM_CACHE_KEY]);
unset($context['cache_... | php | private function getCacheKey(?string $format, array $context)
{
foreach ($context[self::EXCLUDE_FROM_CACHE_KEY] ?? $this->defaultContext[self::EXCLUDE_FROM_CACHE_KEY] as $key) {
unset($context[$key]);
}
unset($context[self::EXCLUDE_FROM_CACHE_KEY]);
unset($context['cache_... | [
"private",
"function",
"getCacheKey",
"(",
"?",
"string",
"$",
"format",
",",
"array",
"$",
"context",
")",
"{",
"foreach",
"(",
"$",
"context",
"[",
"self",
"::",
"EXCLUDE_FROM_CACHE_KEY",
"]",
"??",
"$",
"this",
"->",
"defaultContext",
"[",
"self",
"::",... | Builds the cache key for the attributes cache.
The key must be different for every option in the context that could change which attributes should be handled.
@return bool|string | [
"Builds",
"the",
"cache",
"key",
"for",
"the",
"attributes",
"cache",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Serializer/Normalizer/AbstractObjectNormalizer.php#L586-L604 | train | Get the cache key | [
30522,
2797,
3853,
2131,
3540,
5403,
14839,
1006,
1029,
5164,
1002,
4289,
1010,
9140,
1002,
6123,
1007,
1063,
18921,
6776,
1006,
1002,
6123,
1031,
2969,
1024,
1024,
23329,
1035,
2013,
1035,
17053,
1035,
3145,
1033,
1029,
1029,
1002,
2023,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/Zend/Mail/Storage/Imap.php | Zend_Mail_Storage_Imap.selectFolder | public function selectFolder($globalName)
{
$this->_currentFolder = $globalName;
if (!$this->_protocol->select($this->_currentFolder)) {
$this->_currentFolder = '';
/**
* @see Zend_Mail_Storage_Exception
*/
// require_once 'Zend/Mail/Stor... | php | public function selectFolder($globalName)
{
$this->_currentFolder = $globalName;
if (!$this->_protocol->select($this->_currentFolder)) {
$this->_currentFolder = '';
/**
* @see Zend_Mail_Storage_Exception
*/
// require_once 'Zend/Mail/Stor... | [
"public",
"function",
"selectFolder",
"(",
"$",
"globalName",
")",
"{",
"$",
"this",
"->",
"_currentFolder",
"=",
"$",
"globalName",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"_protocol",
"->",
"select",
"(",
"$",
"this",
"->",
"_currentFolder",
")",
")",
... | select given folder
folder must be selectable!
@param Zend_Mail_Storage_Folder|string $globalName global name of folder or instance for subfolder
@return null
@throws Zend_Mail_Storage_Exception
@throws Zend_Mail_Protocol_Exception | [
"select",
"given",
"folder"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail/Storage/Imap.php#L458-L469 | train | select a folder | [
30522,
2270,
3853,
7276,
10371,
2121,
1006,
1002,
3795,
18442,
1007,
1063,
1002,
2023,
1011,
1028,
1035,
2783,
10371,
2121,
1027,
1002,
3795,
18442,
1025,
2065,
1006,
999,
1002,
2023,
1011,
1028,
1035,
8778,
1011,
1028,
7276,
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 | plugins/VisitorInterest/API.php | API.getNumberOfVisitsByVisitCount | public function getNumberOfVisitsByVisitCount($idSite, $period, $date, $segment = false)
{
$dataTable = $this->getDataTable(
Archiver::VISITS_COUNT_RECORD_NAME, $idSite, $period, $date, $segment, Metrics::INDEX_NB_VISITS);
$dataTable->queueFilter('AddSegmentByRangeLabel', array('visitCo... | php | public function getNumberOfVisitsByVisitCount($idSite, $period, $date, $segment = false)
{
$dataTable = $this->getDataTable(
Archiver::VISITS_COUNT_RECORD_NAME, $idSite, $period, $date, $segment, Metrics::INDEX_NB_VISITS);
$dataTable->queueFilter('AddSegmentByRangeLabel', array('visitCo... | [
"public",
"function",
"getNumberOfVisitsByVisitCount",
"(",
"$",
"idSite",
",",
"$",
"period",
",",
"$",
"date",
",",
"$",
"segment",
"=",
"false",
")",
"{",
"$",
"dataTable",
"=",
"$",
"this",
"->",
"getDataTable",
"(",
"Archiver",
"::",
"VISITS_COUNT_RECOR... | Returns a DataTable that associates ranges of visit numbers with the count of visits
whose visit number falls within those ranges.
@param int $idSite The site to select data from.
@param string $period The period type.
@param string $date The date type.
@param string|bool $segment The segment.
@return DataTable the ar... | [
"Returns",
"a",
"DataTable",
"that",
"associates",
"ranges",
"of",
"visit",
"numbers",
"with",
"the",
"count",
"of",
"visits",
"whose",
"visit",
"number",
"falls",
"within",
"those",
"ranges",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/VisitorInterest/API.php#L85-L95 | train | Get number of visits by range | [
30522,
2270,
3853,
2131,
19172,
5677,
11253,
11365,
12762,
3762,
11365,
4183,
3597,
16671,
1006,
1002,
8909,
28032,
2063,
1010,
1002,
2558,
1010,
1002,
3058,
1010,
1002,
6903,
1027,
6270,
1007,
1063,
1002,
2951,
10880,
1027,
1002,
2023,
101... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/Zend/Cache/Backend/Sqlite.php | Zend_Cache_Backend_Sqlite._automaticVacuum | private function _automaticVacuum()
{
if ($this->_options['automatic_vacuum_factor'] > 0) {
$rand = rand(1, $this->_options['automatic_vacuum_factor']);
if ($rand == 1) {
$this->_query('VACUUM');
}
}
} | php | private function _automaticVacuum()
{
if ($this->_options['automatic_vacuum_factor'] > 0) {
$rand = rand(1, $this->_options['automatic_vacuum_factor']);
if ($rand == 1) {
$this->_query('VACUUM');
}
}
} | [
"private",
"function",
"_automaticVacuum",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_options",
"[",
"'automatic_vacuum_factor'",
"]",
">",
"0",
")",
"{",
"$",
"rand",
"=",
"rand",
"(",
"1",
",",
"$",
"this",
"->",
"_options",
"[",
"'automatic_vacuum... | Deal with the automatic vacuum process
@return void | [
"Deal",
"with",
"the",
"automatic",
"vacuum",
"process"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache/Backend/Sqlite.php#L527-L535 | train | Automatic Vacuum function | [
30522,
2797,
3853,
1035,
6882,
24887,
2226,
2819,
1006,
1007,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
1035,
7047,
1031,
1005,
6882,
1035,
11641,
1035,
5387,
1005,
1033,
1028,
1014,
1007,
1063,
1002,
14566,
1027,
14566,
1006,
1015,
1010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php | NativeSessionStorage.registerBag | public function registerBag(SessionBagInterface $bag)
{
if ($this->started) {
throw new \LogicException('Cannot register a bag when the session is already started.');
}
$this->bags[$bag->getName()] = $bag;
} | php | public function registerBag(SessionBagInterface $bag)
{
if ($this->started) {
throw new \LogicException('Cannot register a bag when the session is already started.');
}
$this->bags[$bag->getName()] = $bag;
} | [
"public",
"function",
"registerBag",
"(",
"SessionBagInterface",
"$",
"bag",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"started",
")",
"{",
"throw",
"new",
"\\",
"LogicException",
"(",
"'Cannot register a bag when the session is already started.'",
")",
";",
"}",
"$... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php#L292-L299 | train | Registers a bag | [
30522,
2270,
3853,
4236,
16078,
1006,
5219,
16078,
18447,
2121,
12172,
1002,
4524,
1007,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
2318,
1007,
1063,
5466,
2047,
1032,
7961,
10288,
24422,
1006,
1005,
3685,
4236,
1037,
4524,
2043,
1996,
5219,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.onEndCroppingSession | public function onEndCroppingSession()
{
$this->abortIfReadOnly();
$cropSessionKey = Input::get('cropSessionKey');
if (!preg_match('/^[0-9a-z]+$/', $cropSessionKey)) {
throw new ApplicationException('Invalid input data');
}
$this->removeCropEditDir($cropSessionK... | php | public function onEndCroppingSession()
{
$this->abortIfReadOnly();
$cropSessionKey = Input::get('cropSessionKey');
if (!preg_match('/^[0-9a-z]+$/', $cropSessionKey)) {
throw new ApplicationException('Invalid input data');
}
$this->removeCropEditDir($cropSessionK... | [
"public",
"function",
"onEndCroppingSession",
"(",
")",
"{",
"$",
"this",
"->",
"abortIfReadOnly",
"(",
")",
";",
"$",
"cropSessionKey",
"=",
"Input",
"::",
"get",
"(",
"'cropSessionKey'",
")",
";",
"if",
"(",
"!",
"preg_match",
"(",
"'/^[0-9a-z]+$/'",
",",
... | End crop session AJAX handler
@return array | [
"End",
"crop",
"session",
"AJAX",
"handler"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/MediaManager.php#L725-L735 | train | End cropping session | [
30522,
2270,
3853,
2028,
4859,
26775,
7361,
4691,
8583,
10992,
1006,
1007,
1063,
1002,
2023,
1011,
1028,
11113,
11589,
10128,
16416,
5280,
2135,
1006,
1007,
1025,
1002,
8765,
7971,
3258,
14839,
1027,
7953,
1024,
1024,
2131,
1006,
1005,
8765... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.readAll | public function readAll($len)
{
$have = TStringFuncFactory::create()->strlen($this->rBuf_);
if ($have == 0) {
$data = $this->transport_->readAll($len);
} elseif ($have < $len) {
$data = $this->rBuf_;
$this->rBuf_ = '';
$data .= $this->transport... | php | public function readAll($len)
{
$have = TStringFuncFactory::create()->strlen($this->rBuf_);
if ($have == 0) {
$data = $this->transport_->readAll($len);
} elseif ($have < $len) {
$data = $this->rBuf_;
$this->rBuf_ = '';
$data .= $this->transport... | [
"public",
"function",
"readAll",
"(",
"$",
"len",
")",
"{",
"$",
"have",
"=",
"TStringFuncFactory",
"::",
"create",
"(",
")",
"->",
"strlen",
"(",
"$",
"this",
"->",
"rBuf_",
")",
";",
"if",
"(",
"$",
"have",
"==",
"0",
")",
"{",
"$",
"data",
"="... | The reason that we customize readAll here is that the majority of PHP
streams are already internally buffered by PHP. The socket stream, for
example, buffers internally and blocks if you call read with $len greater
than the amount of data available, unlike recv() in C.
Therefore, use the readAll method of the wrapped ... | [
"The",
"reason",
"that",
"we",
"customize",
"readAll",
"here",
"is",
"that",
"the",
"majority",
"of",
"PHP",
"streams",
"are",
"already",
"internally",
"buffered",
"by",
"PHP",
".",
"The",
"socket",
"stream",
"for",
"example",
"buffers",
"internally",
"and",
... | acdd4226c210336e9e15eb812e5932a645fcd5ce | https://github.com/apache/thrift/blob/acdd4226c210336e9e15eb812e5932a645fcd5ce/lib/php/lib/Transport/TBufferedTransport.php#L122-L140 | train | read all data from the socket | [
30522,
2270,
3853,
3191,
8095,
1006,
1002,
18798,
1007,
1063,
1002,
2031,
1027,
24529,
18886,
3070,
11263,
12273,
21450,
1024,
1024,
3443,
1006,
1007,
1011,
1028,
2358,
20927,
2078,
1006,
1002,
2023,
1011,
1028,
21144,
16093,
1035,
1007,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Common/Uri.php | Uri.convertUrlOld | public static function convertUrlOld(PageInterface $page, $markdown_url, $type = 'link', $relative = null)
{
$grav = Grav::instance();
$language = $grav['language'];
// Link processing should prepend language
$language_append = '';
if ($type === 'link' && $language->enabled... | php | public static function convertUrlOld(PageInterface $page, $markdown_url, $type = 'link', $relative = null)
{
$grav = Grav::instance();
$language = $grav['language'];
// Link processing should prepend language
$language_append = '';
if ($type === 'link' && $language->enabled... | [
"public",
"static",
"function",
"convertUrlOld",
"(",
"PageInterface",
"$",
"page",
",",
"$",
"markdown_url",
",",
"$",
"type",
"=",
"'link'",
",",
"$",
"relative",
"=",
"null",
")",
"{",
"$",
"grav",
"=",
"Grav",
"::",
"instance",
"(",
")",
";",
"$",
... | Converts links from absolute '/' or relative (../..) to a Grav friendly format
@param PageInterface $page the current page to use as reference
@param string $markdown_url the URL as it was written in the markdown
@param string $type the type of URL, image | link
@param null $relative if null, w... | [
"Converts",
"links",
"from",
"absolute",
"/",
"or",
"relative",
"(",
"..",
"/",
"..",
")",
"to",
"a",
"Grav",
"friendly",
"format"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Uri.php#L957-L1045 | train | Convert a page from the old version of the convertUrlOld | [
30522,
2270,
10763,
3853,
10463,
3126,
4135,
6392,
1006,
3931,
18447,
2121,
12172,
1002,
3931,
1010,
1002,
2928,
7698,
1035,
24471,
2140,
1010,
1002,
2828,
1027,
1005,
4957,
1005,
1010,
1002,
5816,
1027,
19701,
1007,
1063,
1002,
24665,
1143... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/HttpClient/Chunk/ErrorChunk.php | ErrorChunk.isFirst | public function isFirst(): bool
{
$this->didThrow = true;
throw new TransportException($this->errorMessage, 0, $this->error);
} | php | public function isFirst(): bool
{
$this->didThrow = true;
throw new TransportException($this->errorMessage, 0, $this->error);
} | [
"public",
"function",
"isFirst",
"(",
")",
":",
"bool",
"{",
"$",
"this",
"->",
"didThrow",
"=",
"true",
";",
"throw",
"new",
"TransportException",
"(",
"$",
"this",
"->",
"errorMessage",
",",
"0",
",",
"$",
"this",
"->",
"error",
")",
";",
"}"
] | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpClient/Chunk/ErrorChunk.php#L53-L57 | train | Is this the first time? | [
30522,
2270,
3853,
2003,
8873,
12096,
1006,
1007,
1024,
22017,
2140,
1063,
1002,
2023,
1011,
1028,
2106,
2705,
10524,
1027,
2995,
1025,
5466,
2047,
30524,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Dompdf.php | Dompdf.render | public function render()
{
$this->saveLocale();
$options = $this->options;
$logOutputFile = $options->getLogOutputFile();
if ($logOutputFile) {
if (!file_exists($logOutputFile) && is_writable(dirname($logOutputFile))) {
touch($logOutputFile);
... | php | public function render()
{
$this->saveLocale();
$options = $this->options;
$logOutputFile = $options->getLogOutputFile();
if ($logOutputFile) {
if (!file_exists($logOutputFile) && is_writable(dirname($logOutputFile))) {
touch($logOutputFile);
... | [
"public",
"function",
"render",
"(",
")",
"{",
"$",
"this",
"->",
"saveLocale",
"(",
")",
";",
"$",
"options",
"=",
"$",
"this",
"->",
"options",
";",
"$",
"logOutputFile",
"=",
"$",
"options",
"->",
"getLogOutputFile",
"(",
")",
";",
"if",
"(",
"$",... | Renders the HTML to PDF | [
"Renders",
"the",
"HTML",
"to",
"PDF"
] | 75f13c700009be21a1965dc2c5b68a8708c22ba2 | https://github.com/dompdf/dompdf/blob/75f13c700009be21a1965dc2c5b68a8708c22ba2/src/Dompdf.php#L707-L872 | train | Render the page | [
30522,
2270,
3853,
17552,
1006,
1007,
1063,
1002,
2023,
1011,
1028,
3828,
4135,
9289,
2063,
1006,
1007,
1025,
1002,
7047,
1027,
1002,
2023,
1011,
1028,
7047,
1025,
1002,
8154,
4904,
18780,
8873,
2571,
1027,
1002,
7047,
1011,
1028,
2131,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/Zend/Session/Namespace.php | Zend_Session_Namespace.apply | public function apply($callback)
{
$arg_list = func_get_args();
$arg_list[0] = $_SESSION[$this->_namespace];
return call_user_func_array($callback, $arg_list);
} | php | public function apply($callback)
{
$arg_list = func_get_args();
$arg_list[0] = $_SESSION[$this->_namespace];
return call_user_func_array($callback, $arg_list);
} | [
"public",
"function",
"apply",
"(",
"$",
"callback",
")",
"{",
"$",
"arg_list",
"=",
"func_get_args",
"(",
")",
";",
"$",
"arg_list",
"[",
"0",
"]",
"=",
"$",
"_SESSION",
"[",
"$",
"this",
"->",
"_namespace",
"]",
";",
"return",
"call_user_func_array",
... | apply() - enables applying user-selected function, such as array_merge() to the namespace
Parameters following the $callback argument are passed to the callback function.
Caveat: ignores members expiring now.
Example:
$namespace->apply('array_merge', array('tree' => 'apple', 'fruit' => 'peach'), array('flower' => 'ros... | [
"apply",
"()",
"-",
"enables",
"applying",
"user",
"-",
"selected",
"function",
"such",
"as",
"array_merge",
"()",
"to",
"the",
"namespace",
"Parameters",
"following",
"the",
"$callback",
"argument",
"are",
"passed",
"to",
"the",
"callback",
"function",
".",
"... | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Session/Namespace.php#L342-L347 | train | Apply a callback to the current namespace | [
30522,
2270,
3853,
6611,
1006,
1002,
2655,
5963,
1007,
1063,
1002,
12098,
2290,
1035,
2862,
1027,
4569,
2278,
1035,
2131,
1035,
12098,
5620,
1006,
1007,
1025,
1002,
12098,
2290,
1035,
2862,
1031,
1014,
1033,
1027,
1002,
1035,
5219,
1031,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/cms/models/ThemeData.php | ThemeData.getAssetVariables | public function getAssetVariables()
{
$result = [];
foreach ($this->getFormFields() as $attribute => $field) {
if (!$varName = array_get($field, 'assetVar')) {
continue;
}
$result[$varName] = $this->{$attribute};
}
return $result... | php | public function getAssetVariables()
{
$result = [];
foreach ($this->getFormFields() as $attribute => $field) {
if (!$varName = array_get($field, 'assetVar')) {
continue;
}
$result[$varName] = $this->{$attribute};
}
return $result... | [
"public",
"function",
"getAssetVariables",
"(",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"getFormFields",
"(",
")",
"as",
"$",
"attribute",
"=>",
"$",
"field",
")",
"{",
"if",
"(",
"!",
"$",
"varName",
"=",
"a... | Returns variables that should be passed to the asset combiner.
@return array | [
"Returns",
"variables",
"that",
"should",
"be",
"passed",
"to",
"the",
"asset",
"combiner",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/models/ThemeData.php#L207-L220 | train | Get asset variables | [
30522,
2270,
3853,
2131,
27241,
9189,
10980,
13510,
1006,
1007,
1063,
1002,
2765,
1027,
1031,
1033,
1025,
18921,
6776,
1006,
1002,
2023,
1011,
1028,
2131,
14192,
15155,
1006,
1007,
2004,
1002,
17961,
1027,
1028,
1002,
2492,
1007,
1063,
2065... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Cache/TaggedCache.php | TaggedCache.decrement | public function decrement($key, $value = 1)
{
$this->store->decrement($this->itemKey($key), $value);
} | php | public function decrement($key, $value = 1)
{
$this->store->decrement($this->itemKey($key), $value);
} | [
"public",
"function",
"decrement",
"(",
"$",
"key",
",",
"$",
"value",
"=",
"1",
")",
"{",
"$",
"this",
"->",
"store",
"->",
"decrement",
"(",
"$",
"this",
"->",
"itemKey",
"(",
"$",
"key",
")",
",",
"$",
"value",
")",
";",
"}"
] | Decrement the value of an item in the cache.
@param string $key
@param mixed $value
@return void | [
"Decrement",
"the",
"value",
"of",
"an",
"item",
"in",
"the",
"cache",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Cache/TaggedCache.php#L69-L72 | train | Decrement the value of an integer key in the recordset | [
30522,
2270,
3853,
11703,
30524,
11703,
28578,
4765,
1006,
1002,
2023,
1011,
1028,
8875,
14839,
1006,
1002,
3145,
1007,
1010,
1002,
3643,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
php-ai/php-ml | src/Classification/Ensemble/RandomForest.php | RandomForest.setClassifer | public function setClassifer(string $classifier, array $classifierOptions = [])
{
if ($classifier !== DecisionTree::class) {
throw new InvalidArgumentException('RandomForest can only use DecisionTree as base classifier');
}
parent::setClassifer($classifier, $classifierOptions);
... | php | public function setClassifer(string $classifier, array $classifierOptions = [])
{
if ($classifier !== DecisionTree::class) {
throw new InvalidArgumentException('RandomForest can only use DecisionTree as base classifier');
}
parent::setClassifer($classifier, $classifierOptions);
... | [
"public",
"function",
"setClassifer",
"(",
"string",
"$",
"classifier",
",",
"array",
"$",
"classifierOptions",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"$",
"classifier",
"!==",
"DecisionTree",
"::",
"class",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
... | RandomForest algorithm is usable *only* with DecisionTree
@return $this | [
"RandomForest",
"algorithm",
"is",
"usable",
"*",
"only",
"*",
"with",
"DecisionTree"
] | f6aa1a59b0525b8fca3d2786d661ab3e70904016 | https://github.com/php-ai/php-ml/blob/f6aa1a59b0525b8fca3d2786d661ab3e70904016/src/Classification/Ensemble/RandomForest.php#L70-L79 | train | Set the classifier for RandomForest | [
30522,
2270,
3853,
2275,
26266,
23780,
1006,
5164,
1002,
2465,
18095,
1010,
9140,
1002,
2465,
18095,
7361,
9285,
1027,
1031,
1033,
1007,
1063,
2065,
1006,
1002,
2465,
18095,
999,
1027,
1027,
3247,
13334,
1024,
1024,
2465,
1007,
1063,
5466,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Support/Arr.php | Arr.pluck | public static function pluck($array, $value, $key = null)
{
$results = [];
[$value, $key] = static::explodePluckParameters($value, $key);
foreach ($array as $item) {
$itemValue = data_get($item, $value);
// If the key is "null", we will just append the value to the... | php | public static function pluck($array, $value, $key = null)
{
$results = [];
[$value, $key] = static::explodePluckParameters($value, $key);
foreach ($array as $item) {
$itemValue = data_get($item, $value);
// If the key is "null", we will just append the value to the... | [
"public",
"static",
"function",
"pluck",
"(",
"$",
"array",
",",
"$",
"value",
",",
"$",
"key",
"=",
"null",
")",
"{",
"$",
"results",
"=",
"[",
"]",
";",
"[",
"$",
"value",
",",
"$",
"key",
"]",
"=",
"static",
"::",
"explodePluckParameters",
"(",
... | Pluck an array of values from an array.
@param array $array
@param string|array $value
@param string|array|null $key
@return array | [
"Pluck",
"an",
"array",
"of",
"values",
"from",
"an",
"array",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Support/Arr.php#L376-L402 | train | Plucks the values from the array | [
30522,
2270,
10763,
3853,
20228,
12722,
1006,
1002,
9140,
1010,
1002,
3643,
1010,
1002,
3145,
1027,
19701,
1007,
1063,
1002,
3463,
1027,
1031,
1033,
1025,
1031,
1002,
3643,
1010,
1002,
3145,
1033,
1027,
10763,
1024,
1024,
15044,
24759,
1272... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/DependencyInjection/ContainerBuilder.php | ContainerBuilder.prependExtensionConfig | public function prependExtensionConfig($name, array $config)
{
if (!isset($this->extensionConfigs[$name])) {
$this->extensionConfigs[$name] = [];
}
array_unshift($this->extensionConfigs[$name], $config);
} | php | public function prependExtensionConfig($name, array $config)
{
if (!isset($this->extensionConfigs[$name])) {
$this->extensionConfigs[$name] = [];
}
array_unshift($this->extensionConfigs[$name], $config);
} | [
"public",
"function",
"prependExtensionConfig",
"(",
"$",
"name",
",",
"array",
"$",
"config",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"extensionConfigs",
"[",
"$",
"name",
"]",
")",
")",
"{",
"$",
"this",
"->",
"extensionConfigs",
"... | Prepends a config array to the configs of the given extension.
@param string $name The name of the extension
@param array $config The config to set | [
"Prepends",
"a",
"config",
"array",
"to",
"the",
"configs",
"of",
"the",
"given",
"extension",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/DependencyInjection/ContainerBuilder.php#L713-L720 | train | Prepend extension config | [
30522,
2270,
3853,
17463,
10497,
10288,
29048,
8663,
8873,
2290,
1006,
1002,
2171,
1010,
9140,
1002,
9530,
8873,
2290,
1007,
1063,
2065,
1006,
999,
26354,
3388,
1006,
1002,
2023,
1011,
1028,
5331,
8663,
8873,
5620,
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/Bundle/WebProfilerBundle/Profiler/TemplateManager.php | TemplateManager.getNames | public function getNames(Profile $profile)
{
$templates = [];
foreach ($this->templates as $arguments) {
if (null === $arguments) {
continue;
}
list($name, $template) = $arguments;
if (!$this->profiler->has($name) || !$profile->hasCo... | php | public function getNames(Profile $profile)
{
$templates = [];
foreach ($this->templates as $arguments) {
if (null === $arguments) {
continue;
}
list($name, $template) = $arguments;
if (!$this->profiler->has($name) || !$profile->hasCo... | [
"public",
"function",
"getNames",
"(",
"Profile",
"$",
"profile",
")",
"{",
"$",
"templates",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"templates",
"as",
"$",
"arguments",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"arguments",
")",
"{",
... | Gets template names of templates that are present in the viewed profile.
@return array
@throws \UnexpectedValueException | [
"Gets",
"template",
"names",
"of",
"templates",
"that",
"are",
"present",
"in",
"the",
"viewed",
"profile",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bundle/WebProfilerBundle/Profiler/TemplateManager.php#L70-L97 | train | Get all the profiler templates for a given profile | [
30522,
2270,
3853,
2131,
18442,
2015,
1006,
6337,
1002,
6337,
1007,
1063,
1002,
23561,
2015,
1027,
1031,
1033,
1025,
18921,
6776,
1006,
1002,
2023,
1011,
1028,
23561,
2015,
2004,
1002,
9918,
1007,
1063,
2065,
1006,
19701,
1027,
1027,
1027,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Foundation/Console/EventGenerateCommand.php | EventGenerateCommand.makeListeners | protected function makeListeners($event, $listeners)
{
foreach ($listeners as $listener) {
$listener = preg_replace('/@.+$/', '', $listener);
$this->callSilent('make:listener', array_filter(
['name' => $listener, '--event' => $event]
));
}
} | php | protected function makeListeners($event, $listeners)
{
foreach ($listeners as $listener) {
$listener = preg_replace('/@.+$/', '', $listener);
$this->callSilent('make:listener', array_filter(
['name' => $listener, '--event' => $event]
));
}
} | [
"protected",
"function",
"makeListeners",
"(",
"$",
"event",
",",
"$",
"listeners",
")",
"{",
"foreach",
"(",
"$",
"listeners",
"as",
"$",
"listener",
")",
"{",
"$",
"listener",
"=",
"preg_replace",
"(",
"'/@.+$/'",
",",
"''",
",",
"$",
"listener",
")",
... | Make the listeners for the given event.
@param string $event
@param array $listeners
@return void | [
"Make",
"the",
"listeners",
"for",
"the",
"given",
"event",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Foundation/Console/EventGenerateCommand.php#L68-L77 | train | Make all listeners for the given event | [
30522,
5123,
3853,
2191,
9863,
24454,
2015,
1006,
1002,
2724,
1010,
1002,
13810,
1007,
1063,
18921,
6776,
1006,
1002,
13810,
2004,
1002,
19373,
1007,
1063,
1002,
19373,
1027,
3653,
2290,
1035,
5672,
1006,
1005,
1013,
1030,
1012,
1009,
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/Controller/TemplateController.php | TemplateController.templateAction | public function templateAction(string $template, int $maxAge = null, int $sharedAge = null, bool $private = null): Response
{
if ($this->templating) {
$response = new Response($this->templating->render($template));
} elseif ($this->twig) {
$response = new Response($this->twig... | php | public function templateAction(string $template, int $maxAge = null, int $sharedAge = null, bool $private = null): Response
{
if ($this->templating) {
$response = new Response($this->templating->render($template));
} elseif ($this->twig) {
$response = new Response($this->twig... | [
"public",
"function",
"templateAction",
"(",
"string",
"$",
"template",
",",
"int",
"$",
"maxAge",
"=",
"null",
",",
"int",
"$",
"sharedAge",
"=",
"null",
",",
"bool",
"$",
"private",
"=",
"null",
")",
":",
"Response",
"{",
"if",
"(",
"$",
"this",
"-... | Renders a template.
@param string $template The template name
@param int|null $maxAge Max age for client caching
@param int|null $sharedAge Max age for shared (proxy) caching
@param bool|null $private Whether or not caching should apply for client caches only | [
"Renders",
"a",
"template",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bundle/FrameworkBundle/Controller/TemplateController.php#L44-L69 | train | Renders a template | [
30522,
2270,
3853,
23561,
18908,
3258,
1006,
5164,
1002,
23561,
1010,
20014,
1002,
4098,
4270,
1027,
19701,
1010,
20014,
1002,
4207,
4270,
1027,
19701,
1010,
22017,
2140,
1002,
2797,
1027,
19701,
1007,
1024,
3433,
1063,
2065,
1006,
1002,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Support/ServiceProvider.php | ServiceProvider.loadViewsFrom | protected function loadViewsFrom($path, $namespace)
{
if (is_array($this->app->config['view']['paths'])) {
foreach ($this->app->config['view']['paths'] as $viewPath) {
if (is_dir($appPath = $viewPath.'/vendor/'.$namespace)) {
$this->app['view']->addNamespace($... | php | protected function loadViewsFrom($path, $namespace)
{
if (is_array($this->app->config['view']['paths'])) {
foreach ($this->app->config['view']['paths'] as $viewPath) {
if (is_dir($appPath = $viewPath.'/vendor/'.$namespace)) {
$this->app['view']->addNamespace($... | [
"protected",
"function",
"loadViewsFrom",
"(",
"$",
"path",
",",
"$",
"namespace",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"this",
"->",
"app",
"->",
"config",
"[",
"'view'",
"]",
"[",
"'paths'",
"]",
")",
")",
"{",
"foreach",
"(",
"$",
"this",
... | Register a view file namespace.
@param string|array $path
@param string $namespace
@return void | [
"Register",
"a",
"view",
"file",
"namespace",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Support/ServiceProvider.php#L95-L106 | train | Load views from the given path and namespace | [
30522,
5123,
3853,
7170,
8584,
22747,
21716,
1006,
1002,
4130,
1010,
1002,
3415,
15327,
1007,
1063,
2065,
1006,
2003,
1035,
9140,
1006,
1002,
2023,
1011,
1028,
10439,
1011,
1028,
9530,
8873,
2290,
1031,
1005,
3193,
1005,
1033,
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... |
matomo-org/matomo | core/Tracker/Model.php | Model.getAllItemsCurrentlyInTheCart | public function getAllItemsCurrentlyInTheCart($goal, $defaultIdOrder)
{
$sql = "SELECT idaction_sku, idaction_name, idaction_category, idaction_category2, idaction_category3, idaction_category4, idaction_category5, price, quantity, deleted, idorder as idorder_original_value
FROM " . Common::prefixTable(... | php | public function getAllItemsCurrentlyInTheCart($goal, $defaultIdOrder)
{
$sql = "SELECT idaction_sku, idaction_name, idaction_category, idaction_category2, idaction_category3, idaction_category4, idaction_category5, price, quantity, deleted, idorder as idorder_original_value
FROM " . Common::prefixTable(... | [
"public",
"function",
"getAllItemsCurrentlyInTheCart",
"(",
"$",
"goal",
",",
"$",
"defaultIdOrder",
")",
"{",
"$",
"sql",
"=",
"\"SELECT idaction_sku, idaction_name, idaction_category, idaction_category2, idaction_category3, idaction_category4, idaction_category5, price, quantity, delet... | Loads the Ecommerce items from the request and records them in the DB
@param array $goal
@param int $defaultIdOrder
@throws Exception
@return array | [
"Loads",
"the",
"Ecommerce",
"items",
"from",
"the",
"request",
"and",
"records",
"them",
"in",
"the",
"DB"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Tracker/Model.php#L96-L114 | train | Get all items currently in the cart | [
30522,
2270,
3853,
2131,
8095,
4221,
5244,
10841,
14343,
20630,
18447,
5369,
10010,
2102,
1006,
1002,
3125,
1010,
1002,
12398,
13820,
26764,
1007,
1063,
1002,
29296,
1027,
1000,
7276,
16096,
7542,
1035,
15315,
2226,
1010,
16096,
7542,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/system/classes/CombineAssets.php | CombineAssets.getCache | protected function getCache($cacheKey)
{
$cacheKey = 'combiner.'.$cacheKey;
if (!Cache::has($cacheKey)) {
return false;
}
return @unserialize(@base64_decode(Cache::get($cacheKey)));
} | php | protected function getCache($cacheKey)
{
$cacheKey = 'combiner.'.$cacheKey;
if (!Cache::has($cacheKey)) {
return false;
}
return @unserialize(@base64_decode(Cache::get($cacheKey)));
} | [
"protected",
"function",
"getCache",
"(",
"$",
"cacheKey",
")",
"{",
"$",
"cacheKey",
"=",
"'combiner.'",
".",
"$",
"cacheKey",
";",
"if",
"(",
"!",
"Cache",
"::",
"has",
"(",
"$",
"cacheKey",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"@"... | Look up information about a cache identifier.
@param string $cacheKey Cache identifier
@return array Cache information | [
"Look",
"up",
"information",
"about",
"a",
"cache",
"identifier",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/CombineAssets.php#L780-L789 | train | Get the cached value of a key | [
30522,
5123,
3853,
2131,
3540,
5403,
1006,
1002,
17053,
14839,
1007,
1063,
1002,
17053,
14839,
1027,
1005,
11506,
2099,
1012,
1005,
1012,
1002,
17053,
14839,
1025,
2065,
1006,
999,
17053,
1024,
1024,
2038,
1006,
1002,
17053,
14839,
1007,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
PHPMailer/PHPMailer | src/PHPMailer.php | PHPMailer.filenameToType | public static function filenameToType($filename)
{
// In case the path is a URL, strip any query string before getting extension
$qpos = strpos($filename, '?');
if (false !== $qpos) {
$filename = substr($filename, 0, $qpos);
}
$ext = static::mb_pathinfo($filename,... | php | public static function filenameToType($filename)
{
// In case the path is a URL, strip any query string before getting extension
$qpos = strpos($filename, '?');
if (false !== $qpos) {
$filename = substr($filename, 0, $qpos);
}
$ext = static::mb_pathinfo($filename,... | [
"public",
"static",
"function",
"filenameToType",
"(",
"$",
"filename",
")",
"{",
"// In case the path is a URL, strip any query string before getting extension",
"$",
"qpos",
"=",
"strpos",
"(",
"$",
"filename",
",",
"'?'",
")",
";",
"if",
"(",
"false",
"!==",
"$",... | Map a file name to a MIME type.
Defaults to 'application/octet-stream', i.e.. arbitrary binary data.
@param string $filename A file name or full path, does not need to exist as a file
@return string | [
"Map",
"a",
"file",
"name",
"to",
"a",
"MIME",
"type",
".",
"Defaults",
"to",
"application",
"/",
"octet",
"-",
"stream",
"i",
".",
"e",
"..",
"arbitrary",
"binary",
"data",
"."
] | 3d7132341659a8a201adbc3ba11b1e202ee2857c | https://github.com/PHPMailer/PHPMailer/blob/3d7132341659a8a201adbc3ba11b1e202ee2857c/src/PHPMailer.php#L4029-L4039 | train | Returns the mime types of a file | [
30522,
2270,
10763,
3853,
5371,
18442,
3406,
13874,
1006,
1002,
5371,
18442,
1007,
1063,
1013,
1013,
1999,
2553,
1996,
4130,
2003,
1037,
24471,
2140,
1010,
6167,
2151,
23032,
5164,
2077,
2893,
5331,
1002,
1053,
6873,
2015,
1027,
2358,
14536... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/TSSLSocket.php | TSSLSocket.open | public function open()
{
if ($this->isOpen()) {
throw new TTransportException('Socket already connected', TTransportException::ALREADY_OPEN);
}
if (empty($this->host_)) {
throw new TTransportException('Cannot open null host', TTransportException::NOT_OPEN);
}... | php | public function open()
{
if ($this->isOpen()) {
throw new TTransportException('Socket already connected', TTransportException::ALREADY_OPEN);
}
if (empty($this->host_)) {
throw new TTransportException('Cannot open null host', TTransportException::NOT_OPEN);
}... | [
"public",
"function",
"open",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isOpen",
"(",
")",
")",
"{",
"throw",
"new",
"TTransportException",
"(",
"'Socket already connected'",
",",
"TTransportException",
"::",
"ALREADY_OPEN",
")",
";",
"}",
"if",
"(",
"... | Connects the socket. | [
"Connects",
"the",
"socket",
"."
] | acdd4226c210336e9e15eb812e5932a645fcd5ce | https://github.com/apache/thrift/blob/acdd4226c210336e9e15eb812e5932a645fcd5ce/lib/php/lib/Transport/TSSLSocket.php#L84-L116 | train | Open the socket | [
30522,
2270,
3853,
2330,
1006,
1007,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
11163,
11837,
1006,
1007,
1007,
1063,
5466,
2047,
23746,
5521,
20205,
10288,
24422,
1006,
1005,
22278,
2525,
4198,
1005,
30524,
1005,
3685,
2330,
19701,
3677,
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... |
barryvdh/laravel-debugbar | src/DataCollector/FilesCollector.php | FilesCollector.getCompiledFiles | protected function getCompiledFiles()
{
if ($this->app && class_exists('Illuminate\Foundation\Console\OptimizeCommand')) {
$reflector = new \ReflectionClass('Illuminate\Foundation\Console\OptimizeCommand');
$path = dirname($reflector->getFileName()) . '/Optimize/config.php';
... | php | protected function getCompiledFiles()
{
if ($this->app && class_exists('Illuminate\Foundation\Console\OptimizeCommand')) {
$reflector = new \ReflectionClass('Illuminate\Foundation\Console\OptimizeCommand');
$path = dirname($reflector->getFileName()) . '/Optimize/config.php';
... | [
"protected",
"function",
"getCompiledFiles",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"app",
"&&",
"class_exists",
"(",
"'Illuminate\\Foundation\\Console\\OptimizeCommand'",
")",
")",
"{",
"$",
"reflector",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"'Illuminat... | Get the files that are going to be compiled, so they aren't as important.
@return array | [
"Get",
"the",
"files",
"that",
"are",
"going",
"to",
"be",
"compiled",
"so",
"they",
"aren",
"t",
"as",
"important",
"."
] | 2d195779ea4f809f69764a795e2ec371dbb76a96 | https://github.com/barryvdh/laravel-debugbar/blob/2d195779ea4f809f69764a795e2ec371dbb76a96/src/DataCollector/FilesCollector.php#L82-L95 | train | Get all compiled files | [
30522,
5123,
3853,
2131,
9006,
22090,
20952,
9463,
2015,
1006,
1007,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
10439,
1004,
1004,
2465,
1035,
6526,
1006,
1005,
5665,
12717,
12556,
1032,
3192,
1032,
10122,
1032,
23569,
27605,
4371,
9006,
238... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/ArchiveProcessor.php | ArchiveProcessor.renameColumnsAfterAggregation | public function renameColumnsAfterAggregation(DataTable $table, $columnsToRenameAfterAggregation = null)
{
// Rename columns after aggregation
if (is_null($columnsToRenameAfterAggregation)) {
$columnsToRenameAfterAggregation = self::$columnsToRenameAfterAggregation;
}
if... | php | public function renameColumnsAfterAggregation(DataTable $table, $columnsToRenameAfterAggregation = null)
{
// Rename columns after aggregation
if (is_null($columnsToRenameAfterAggregation)) {
$columnsToRenameAfterAggregation = self::$columnsToRenameAfterAggregation;
}
if... | [
"public",
"function",
"renameColumnsAfterAggregation",
"(",
"DataTable",
"$",
"table",
",",
"$",
"columnsToRenameAfterAggregation",
"=",
"null",
")",
"{",
"// Rename columns after aggregation",
"if",
"(",
"is_null",
"(",
"$",
"columnsToRenameAfterAggregation",
")",
")",
... | Note: public only for use in closure in PHP 5.3. | [
"Note",
":",
"public",
"only",
"for",
"use",
"in",
"closure",
"in",
"PHP",
"5",
".",
"3",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/ArchiveProcessor.php#L540-L561 | train | Rename columns after aggregation | [
30522,
2270,
3853,
14916,
14074,
25778,
2819,
3619,
10354,
14621,
13871,
2890,
12540,
1006,
2951,
10880,
1002,
2795,
1010,
1002,
7753,
19277,
18442,
10354,
14621,
13871,
2890,
12540,
1027,
19701,
1007,
1063,
1013,
1013,
14916,
14074,
7753,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/CoreHome/Tracker/VisitRequestProcessor.php | VisitRequestProcessor.isVisitNew | public function isVisitNew(VisitProperties $visitProperties, Request $request)
{
$isKnown = $request->getMetadata('CoreHome', 'isVisitorKnown');
if (!$isKnown) {
return true;
}
$isLastActionInTheSameVisit = $this->isLastActionInTheSameVisit($visitProperties, $request);
... | php | public function isVisitNew(VisitProperties $visitProperties, Request $request)
{
$isKnown = $request->getMetadata('CoreHome', 'isVisitorKnown');
if (!$isKnown) {
return true;
}
$isLastActionInTheSameVisit = $this->isLastActionInTheSameVisit($visitProperties, $request);
... | [
"public",
"function",
"isVisitNew",
"(",
"VisitProperties",
"$",
"visitProperties",
",",
"Request",
"$",
"request",
")",
"{",
"$",
"isKnown",
"=",
"$",
"request",
"->",
"getMetadata",
"(",
"'CoreHome'",
",",
"'isVisitorKnown'",
")",
";",
"if",
"(",
"!",
"$",... | Determines if the tracker if the current action should be treated as the start of a new visit or
an action in an existing visit.
Note: public only for tests.
@param VisitProperties $visitProperties The current visit/visitor information.
@param Request $request
@return bool | [
"Determines",
"if",
"the",
"tracker",
"if",
"the",
"current",
"action",
"should",
"be",
"treated",
"as",
"the",
"start",
"of",
"a",
"new",
"visit",
"or",
"an",
"action",
"in",
"an",
"existing",
"visit",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/CoreHome/Tracker/VisitRequestProcessor.php#L149-L173 | train | Check if a new visit should be made | [
30522,
2270,
3853,
2003,
11365,
4183,
2638,
2860,
1006,
3942,
21572,
4842,
7368,
1002,
3942,
21572,
4842,
7368,
1010,
5227,
1002,
5227,
1007,
1063,
1002,
2003,
2243,
19779,
2078,
1027,
1002,
5227,
1011,
1028,
2131,
11368,
8447,
2696,
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... |
getgrav/grav | system/src/Grav/Framework/RequestHandler/RequestHandler.php | RequestHandler.addMiddleware | public function addMiddleware(string $name, MiddlewareInterface $middleware): self
{
$this->container[$name] = $middleware;
array_unshift($this->middleware, $name);
return $this;
} | php | public function addMiddleware(string $name, MiddlewareInterface $middleware): self
{
$this->container[$name] = $middleware;
array_unshift($this->middleware, $name);
return $this;
} | [
"public",
"function",
"addMiddleware",
"(",
"string",
"$",
"name",
",",
"MiddlewareInterface",
"$",
"middleware",
")",
":",
"self",
"{",
"$",
"this",
"->",
"container",
"[",
"$",
"name",
"]",
"=",
"$",
"middleware",
";",
"array_unshift",
"(",
"$",
"this",
... | Add Middleware that will be executed as soon as possible.
@param string $name
@param MiddlewareInterface $middleware
@return $this | [
"Add",
"Middleware",
"that",
"will",
"be",
"executed",
"as",
"soon",
"as",
"possible",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Framework/RequestHandler/RequestHandler.php#L59-L65 | train | Add a middleware to the beginning of the stack | [
30522,
2270,
3853,
5587,
4328,
20338,
8059,
1006,
5164,
1002,
2171,
1010,
2690,
8059,
18447,
2121,
12172,
1002,
2690,
8059,
1007,
1024,
2969,
1063,
1002,
2023,
1011,
1028,
11661,
1031,
1002,
2171,
1033,
1027,
1002,
2690,
8059,
1025,
9140,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
z-song/laravel-admin | src/Show.php | Show.fields | public function fields(array $fields = [])
{
if (!Arr::isAssoc($fields)) {
$fields = array_combine($fields, $fields);
}
foreach ($fields as $field => $label) {
$this->field($field, $label);
}
return $this;
} | php | public function fields(array $fields = [])
{
if (!Arr::isAssoc($fields)) {
$fields = array_combine($fields, $fields);
}
foreach ($fields as $field => $label) {
$this->field($field, $label);
}
return $this;
} | [
"public",
"function",
"fields",
"(",
"array",
"$",
"fields",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"Arr",
"::",
"isAssoc",
"(",
"$",
"fields",
")",
")",
"{",
"$",
"fields",
"=",
"array_combine",
"(",
"$",
"fields",
",",
"$",
"fields",
")",
";"... | Add multiple fields.
@param array $fields
@return $this | [
"Add",
"multiple",
"fields",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Show.php#L166-L177 | train | Set the fields to be used in the query | [
30522,
2270,
3853,
4249,
1006,
9140,
1002,
4249,
1027,
1031,
1033,
1007,
1063,
2065,
1006,
999,
12098,
2099,
1024,
1024,
18061,
24137,
2278,
1006,
1002,
4249,
1007,
1007,
1063,
1002,
4249,
1027,
9140,
1035,
11506,
1006,
1002,
4249,
1010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/backend/classes/AuthManager.php | AuthManager.validateUserModel | protected function validateUserModel($user)
{
if ( ! $user instanceof $this->userModel) {
return false;
}
// Perform the deleted_at check manually since the relevant migrations
// might not have been run yet during the update to build 444.
// @see https://github.... | php | protected function validateUserModel($user)
{
if ( ! $user instanceof $this->userModel) {
return false;
}
// Perform the deleted_at check manually since the relevant migrations
// might not have been run yet during the update to build 444.
// @see https://github.... | [
"protected",
"function",
"validateUserModel",
"(",
"$",
"user",
")",
"{",
"if",
"(",
"!",
"$",
"user",
"instanceof",
"$",
"this",
"->",
"userModel",
")",
"{",
"return",
"false",
";",
"}",
"// Perform the deleted_at check manually since the relevant migrations",
"// ... | {@inheritdoc} | [
"{"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/AuthManager.php#L177-L191 | train | Validate user model | [
30522,
5123,
3853,
9398,
3686,
20330,
5302,
9247,
1006,
1002,
5310,
1007,
1063,
2065,
1006,
999,
1002,
5310,
6013,
11253,
1002,
2023,
1011,
1028,
5310,
5302,
9247,
1007,
1063,
2709,
6270,
1025,
1065,
1013,
1013,
4685,
1996,
17159,
1035,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/SettingsPiwik.php | SettingsPiwik.getSalt | public static function getSalt()
{
static $salt = null;
if (is_null($salt)) {
$salt = @Config::getInstance()->General['salt'];
}
return $salt;
} | php | public static function getSalt()
{
static $salt = null;
if (is_null($salt)) {
$salt = @Config::getInstance()->General['salt'];
}
return $salt;
} | [
"public",
"static",
"function",
"getSalt",
"(",
")",
"{",
"static",
"$",
"salt",
"=",
"null",
";",
"if",
"(",
"is_null",
"(",
"$",
"salt",
")",
")",
"{",
"$",
"salt",
"=",
"@",
"Config",
"::",
"getInstance",
"(",
")",
"->",
"General",
"[",
"'salt'"... | Get salt from [General] section. Should ONLY be used as a seed to create hashes
NOTE: Keep this salt secret! Never output anywhere or share it etc.
@return string | [
"Get",
"salt",
"from",
"[",
"General",
"]",
"section",
".",
"Should",
"ONLY",
"be",
"used",
"as",
"a",
"seed",
"to",
"create",
"hashes"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/SettingsPiwik.php#L29-L36 | train | Get the salt | [
30522,
2270,
10763,
3853,
4152,
2389,
2102,
1006,
1007,
1063,
10763,
1002,
5474,
1027,
19701,
1025,
2065,
1006,
2003,
1035,
19701,
1006,
1002,
5474,
1007,
1007,
1063,
1002,
5474,
1027,
1030,
9530,
8873,
2290,
1024,
1024,
2131,
7076,
26897,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/VarDumper/Cloner/Data.php | Data.dumpItem | private function dumpItem($dumper, $cursor, &$refs, $item)
{
$cursor->refIndex = 0;
$cursor->softRefTo = $cursor->softRefHandle = $cursor->softRefCount = 0;
$cursor->hardRefTo = $cursor->hardRefHandle = $cursor->hardRefCount = 0;
$firstSeen = true;
if (!$item instanceof Stub... | php | private function dumpItem($dumper, $cursor, &$refs, $item)
{
$cursor->refIndex = 0;
$cursor->softRefTo = $cursor->softRefHandle = $cursor->softRefCount = 0;
$cursor->hardRefTo = $cursor->hardRefHandle = $cursor->hardRefCount = 0;
$firstSeen = true;
if (!$item instanceof Stub... | [
"private",
"function",
"dumpItem",
"(",
"$",
"dumper",
",",
"$",
"cursor",
",",
"&",
"$",
"refs",
",",
"$",
"item",
")",
"{",
"$",
"cursor",
"->",
"refIndex",
"=",
"0",
";",
"$",
"cursor",
"->",
"softRefTo",
"=",
"$",
"cursor",
"->",
"softRefHandle",... | Depth-first dumping of items.
@param DumperInterface $dumper The dumper being used for dumping
@param Cursor $cursor A cursor used for tracking dumper state position
@param array &$refs A map of all references discovered while dumping
@param mixed $item A Stub object or the original val... | [
"Depth",
"-",
"first",
"dumping",
"of",
"items",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/VarDumper/Cloner/Data.php#L276-L369 | train | Dumps an item | [
30522,
2797,
3853,
15653,
4221,
2213,
1006,
1002,
15653,
2121,
1010,
1002,
12731,
25301,
2099,
1010,
1004,
1002,
25416,
2015,
1010,
1002,
8875,
1007,
1063,
1002,
12731,
25301,
2099,
1011,
1028,
25416,
22254,
10288,
1027,
1014,
1025,
1002,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/backend/behaviors/FormController.php | FormController.prepareVars | protected function prepareVars($model)
{
$this->controller->vars['formModel'] = $model;
$this->controller->vars['formContext'] = $this->formGetContext();
$this->controller->vars['formRecordName'] = Lang::get($this->getConfig('name', 'backend::lang.model.name'));
} | php | protected function prepareVars($model)
{
$this->controller->vars['formModel'] = $model;
$this->controller->vars['formContext'] = $this->formGetContext();
$this->controller->vars['formRecordName'] = Lang::get($this->getConfig('name', 'backend::lang.model.name'));
} | [
"protected",
"function",
"prepareVars",
"(",
"$",
"model",
")",
"{",
"$",
"this",
"->",
"controller",
"->",
"vars",
"[",
"'formModel'",
"]",
"=",
"$",
"model",
";",
"$",
"this",
"->",
"controller",
"->",
"vars",
"[",
"'formContext'",
"]",
"=",
"$",
"th... | Prepares commonly used view data.
@param October\Rain\Database\Model $model | [
"Prepares",
"commonly",
"used",
"view",
"data",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/behaviors/FormController.php#L185-L190 | train | Prepare form model context and record name | [
30522,
5123,
3853,
7374,
10755,
2015,
1006,
1002,
2944,
1007,
1063,
1002,
2023,
1011,
1028,
11486,
1011,
1028,
13075,
2015,
1031,
1005,
2433,
5302,
9247,
1005,
1033,
1027,
1002,
2944,
1025,
1002,
2023,
1011,
1028,
11486,
1011,
1028,
13075,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Database/Query/Builder.php | Builder.whereIntegerInRaw | public function whereIntegerInRaw($column, $values, $boolean = 'and', $not = false)
{
$type = $not ? 'NotInRaw' : 'InRaw';
if ($values instanceof Arrayable) {
$values = $values->toArray();
}
foreach ($values as &$value) {
$value = (int) $value;
}
... | php | public function whereIntegerInRaw($column, $values, $boolean = 'and', $not = false)
{
$type = $not ? 'NotInRaw' : 'InRaw';
if ($values instanceof Arrayable) {
$values = $values->toArray();
}
foreach ($values as &$value) {
$value = (int) $value;
}
... | [
"public",
"function",
"whereIntegerInRaw",
"(",
"$",
"column",
",",
"$",
"values",
",",
"$",
"boolean",
"=",
"'and'",
",",
"$",
"not",
"=",
"false",
")",
"{",
"$",
"type",
"=",
"$",
"not",
"?",
"'NotInRaw'",
":",
"'InRaw'",
";",
"if",
"(",
"$",
"va... | Add a "where in raw" clause for integer values to the query.
@param string $column
@param \Illuminate\Contracts\Support\Arrayable|array $values
@param string $boolean
@param bool $not
@return $this | [
"Add",
"a",
"where",
"in",
"raw",
"clause",
"for",
"integer",
"values",
"to",
"the",
"query",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Query/Builder.php#L966-L981 | train | Add where integer in raw | [
30522,
2270,
3853,
16726,
2618,
4590,
2378,
2527,
2860,
1006,
1002,
5930,
1010,
1002,
5300,
1010,
1002,
22017,
20898,
1027,
1005,
1998,
1005,
1010,
1002,
2025,
1027,
6270,
1007,
1063,
1002,
2828,
1027,
1002,
2025,
1029,
1005,
2025,
2378,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/LanguagesManager/LanguagesManager.php | LanguagesManager.setLanguageForSession | public static function setLanguageForSession($languageCode)
{
if (!API::getInstance()->isLanguageAvailable($languageCode)) {
return false;
}
$cookieName = Config::getInstance()->General['language_cookie_name'];
$cookie = new Cookie($cookieName, 0);
$cookie->set('... | php | public static function setLanguageForSession($languageCode)
{
if (!API::getInstance()->isLanguageAvailable($languageCode)) {
return false;
}
$cookieName = Config::getInstance()->General['language_cookie_name'];
$cookie = new Cookie($cookieName, 0);
$cookie->set('... | [
"public",
"static",
"function",
"setLanguageForSession",
"(",
"$",
"languageCode",
")",
"{",
"if",
"(",
"!",
"API",
"::",
"getInstance",
"(",
")",
"->",
"isLanguageAvailable",
"(",
"$",
"languageCode",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"cook... | Set the language for the session
@param string $languageCode ISO language code
@return bool | [
"Set",
"the",
"language",
"for",
"the",
"session"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/LanguagesManager/LanguagesManager.php#L217-L229 | train | Set language for session | [
30522,
2270,
10763,
3853,
2275,
25023,
6692,
3351,
29278,
8583,
10992,
1006,
1002,
2653,
16044,
1007,
1063,
2065,
1006,
999,
17928,
1024,
1024,
2131,
7076,
26897,
1006,
1007,
1011,
1028,
25340,
3070,
6692,
3351,
12462,
11733,
3468,
1006,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/UserCountry/LocationProvider/GeoIp/Php.php | Php.getLocation | public function getLocation($info)
{
$ip = $this->getIpFromInfo($info);
$isIPv6 = filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6);
$result = array();
$locationGeoIp = $this->getGeoIpInstance($key = 'loc');
if ($locationGeoIp) {
switch ($locationGeoIp->data... | php | public function getLocation($info)
{
$ip = $this->getIpFromInfo($info);
$isIPv6 = filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6);
$result = array();
$locationGeoIp = $this->getGeoIpInstance($key = 'loc');
if ($locationGeoIp) {
switch ($locationGeoIp->data... | [
"public",
"function",
"getLocation",
"(",
"$",
"info",
")",
"{",
"$",
"ip",
"=",
"$",
"this",
"->",
"getIpFromInfo",
"(",
"$",
"info",
")",
";",
"$",
"isIPv6",
"=",
"filter_var",
"(",
"$",
"ip",
",",
"FILTER_VALIDATE_IP",
",",
"FILTER_FLAG_IPV6",
")",
... | Uses a GeoIP database to get a visitor's location based on their IP address.
This function will return different results based on the data used. If a city
database is used, it may return the country code, region code, city name, area
code, latitude, longitude and postal code of the visitor.
Alternatively, if used wit... | [
"Uses",
"a",
"GeoIP",
"database",
"to",
"get",
"a",
"visitor",
"s",
"location",
"based",
"on",
"their",
"IP",
"address",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UserCountry/LocationProvider/GeoIp/Php.php#L95-L188 | train | Returns the location from the info | [
30522,
2270,
3853,
2131,
4135,
10719,
1006,
1002,
18558,
1007,
1063,
1002,
12997,
1027,
1002,
2023,
1011,
1028,
2131,
11514,
19699,
20936,
2078,
14876,
1006,
30524,
2003,
11514,
2615,
2575,
1027,
11307,
1035,
13075,
1006,
1002,
12997,
1010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Form/Extension/DataCollector/FormDataExtractor.php | FormDataExtractor.extractSubmittedData | public function extractSubmittedData(FormInterface $form)
{
$data = [
'submitted_data' => [
'norm' => $form->getNormData(),
],
'errors' => [],
];
if ($form->getViewData() !== $form->getNormData()) {
$data['submitted_data']['vie... | php | public function extractSubmittedData(FormInterface $form)
{
$data = [
'submitted_data' => [
'norm' => $form->getNormData(),
],
'errors' => [],
];
if ($form->getViewData() !== $form->getNormData()) {
$data['submitted_data']['vie... | [
"public",
"function",
"extractSubmittedData",
"(",
"FormInterface",
"$",
"form",
")",
"{",
"$",
"data",
"=",
"[",
"'submitted_data'",
"=>",
"[",
"'norm'",
"=>",
"$",
"form",
"->",
"getNormData",
"(",
")",
",",
"]",
",",
"'errors'",
"=>",
"[",
"]",
",",
... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/Extension/DataCollector/FormDataExtractor.php#L79-L133 | train | Extract submitted data from form | [
30522,
2270,
3853,
27059,
12083,
22930,
3064,
2850,
2696,
1006,
2433,
18447,
2121,
12172,
1002,
2433,
1007,
1063,
1002,
2951,
1027,
1031,
1005,
7864,
1035,
2951,
1005,
1027,
1028,
1031,
1005,
13373,
1005,
1027,
1028,
1002,
2433,
1011,
1028,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/Referrers/Referrers.php | Referrers.setGetAllHtmlPrefix | public function setGetAllHtmlPrefix($referrerType)
{
// get singular label for referrer type
$indexTranslation = '';
switch ($referrerType) {
case Common::REFERRER_TYPE_DIRECT_ENTRY:
$indexTranslation = 'Referrers_DirectEntry';
break;
c... | php | public function setGetAllHtmlPrefix($referrerType)
{
// get singular label for referrer type
$indexTranslation = '';
switch ($referrerType) {
case Common::REFERRER_TYPE_DIRECT_ENTRY:
$indexTranslation = 'Referrers_DirectEntry';
break;
c... | [
"public",
"function",
"setGetAllHtmlPrefix",
"(",
"$",
"referrerType",
")",
"{",
"// get singular label for referrer type",
"$",
"indexTranslation",
"=",
"''",
";",
"switch",
"(",
"$",
"referrerType",
")",
"{",
"case",
"Common",
"::",
"REFERRER_TYPE_DIRECT_ENTRY",
":"... | DataTable filter callback that returns the HTML prefix for a label in the
'getAll' report based on the row's referrer type.
@param int $referrerType The referrer type.
@return string | [
"DataTable",
"filter",
"callback",
"that",
"returns",
"the",
"HTML",
"prefix",
"for",
"a",
"label",
"in",
"the",
"getAll",
"report",
"based",
"on",
"the",
"row",
"s",
"referrer",
"type",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Referrers/Referrers.php#L101-L131 | train | Returns the html for the all columns of the referrer type | [
30522,
2270,
3853,
2275,
18150,
8095,
11039,
19968,
28139,
8873,
2595,
1006,
1002,
6523,
14544,
13874,
1007,
1063,
1013,
1013,
2131,
13048,
3830,
2005,
6523,
14544,
2828,
1002,
5950,
6494,
3619,
13490,
1027,
1005,
1005,
1025,
6942,
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... |
overtrue/wechat | src/OfficialAccount/DataCube/Client.php | Client.memberCardSummaryById | public function memberCardSummaryById(string $from, string $to, string $cardId)
{
$ext = [
'card_id' => $cardId,
];
return $this->query('datacube/getcardmembercarddetail', $from, $to, $ext);
} | php | public function memberCardSummaryById(string $from, string $to, string $cardId)
{
$ext = [
'card_id' => $cardId,
];
return $this->query('datacube/getcardmembercarddetail', $from, $to, $ext);
} | [
"public",
"function",
"memberCardSummaryById",
"(",
"string",
"$",
"from",
",",
"string",
"$",
"to",
",",
"string",
"$",
"cardId",
")",
"{",
"$",
"ext",
"=",
"[",
"'card_id'",
"=>",
"$",
"cardId",
",",
"]",
";",
"return",
"$",
"this",
"->",
"query",
... | 拉取单张会员卡数据接口.
@param string $from
@param string $to
@param string $cardId
@return mixed | [
"拉取单张会员卡数据接口",
"."
] | 120c72faaa93c270365bc75c73c362d5fd583209 | https://github.com/overtrue/wechat/blob/120c72faaa93c270365bc75c73c362d5fd583209/src/OfficialAccount/DataCube/Client.php#L309-L316 | train | Get member card summary by card id | [
30522,
2270,
3853,
2266,
17965,
2819,
7849,
2100,
3762,
3593,
1006,
5164,
1002,
2013,
1010,
5164,
1002,
2000,
1010,
5164,
1002,
4003,
3593,
1007,
1063,
1002,
4654,
2102,
1027,
1031,
1005,
4003,
1035,
8909,
1005,
1027,
1028,
1002,
4003,
35... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/cms/classes/ComponentPartial.php | ComponentPartial.getFilePath | public function getFilePath($fileName = null)
{
if ($fileName === null) {
$fileName = $this->fileName;
}
$component = $this->component;
$path = $component->getPath().'/'.$fileName;
/*
* Check the shared "/partials" directory for the partial
*/
... | php | public function getFilePath($fileName = null)
{
if ($fileName === null) {
$fileName = $this->fileName;
}
$component = $this->component;
$path = $component->getPath().'/'.$fileName;
/*
* Check the shared "/partials" directory for the partial
*/
... | [
"public",
"function",
"getFilePath",
"(",
"$",
"fileName",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"fileName",
"===",
"null",
")",
"{",
"$",
"fileName",
"=",
"$",
"this",
"->",
"fileName",
";",
"}",
"$",
"component",
"=",
"$",
"this",
"->",
"component... | Returns the absolute file path.
@param string $fileName Specifies the file name to return the path to.
@return string | [
"Returns",
"the",
"absolute",
"file",
"path",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/ComponentPartial.php#L240-L261 | train | Get the full path to the partial file | [
30522,
2270,
3853,
2131,
8873,
2571,
15069,
1006,
1002,
5371,
18442,
1027,
19701,
1007,
1063,
2065,
1006,
1002,
5371,
18442,
1027,
1027,
1027,
19701,
1007,
1063,
1002,
5371,
18442,
1027,
1002,
2023,
1011,
1028,
5371,
18442,
1025,
1065,
1002... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Mail/Mailable.php | Mailable.buildViewData | public function buildViewData()
{
$data = $this->viewData;
if (static::$viewDataCallback) {
$data = array_merge($data, call_user_func(static::$viewDataCallback, $this));
}
foreach ((new ReflectionClass($this))->getProperties(ReflectionProperty::IS_PUBLIC) as $property) ... | php | public function buildViewData()
{
$data = $this->viewData;
if (static::$viewDataCallback) {
$data = array_merge($data, call_user_func(static::$viewDataCallback, $this));
}
foreach ((new ReflectionClass($this))->getProperties(ReflectionProperty::IS_PUBLIC) as $property) ... | [
"public",
"function",
"buildViewData",
"(",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"viewData",
";",
"if",
"(",
"static",
"::",
"$",
"viewDataCallback",
")",
"{",
"$",
"data",
"=",
"array_merge",
"(",
"$",
"data",
",",
"call_user_func",
"(",
"st... | Build the view data for the message.
@return array
@throws \ReflectionException | [
"Build",
"the",
"view",
"data",
"for",
"the",
"message",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Mail/Mailable.php#L279-L294 | train | Build the viewData array | [
30522,
2270,
3853,
3857,
8584,
2850,
2696,
1006,
1007,
1063,
1002,
2951,
1027,
1002,
2023,
1011,
1028,
3193,
2850,
2696,
1025,
2065,
1006,
10763,
1024,
1024,
1002,
3193,
2850,
2696,
9289,
20850,
8684,
1007,
1063,
1002,
2951,
1027,
9140,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Common/Data/Validation.php | Validation.typeMonth | public static function typeMonth($value, array $params, array $field)
{
if (!isset($params['format'])) {
$params['format'] = 'Y-m';
}
return self::typeDatetime($value, $params, $field);
} | php | public static function typeMonth($value, array $params, array $field)
{
if (!isset($params['format'])) {
$params['format'] = 'Y-m';
}
return self::typeDatetime($value, $params, $field);
} | [
"public",
"static",
"function",
"typeMonth",
"(",
"$",
"value",
",",
"array",
"$",
"params",
",",
"array",
"$",
"field",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"params",
"[",
"'format'",
"]",
")",
")",
"{",
"$",
"params",
"[",
"'format'",
"]"... | HTML5 input: month
@param mixed $value Value to be validated.
@param array $params Validation parameters.
@param array $field Blueprint for the field.
@return bool True if validation succeeded. | [
"HTML5",
"input",
":",
"month"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Data/Validation.php#L519-L526 | train | Type Month = > datetime | [
30522,
2270,
10763,
3853,
2828,
9629,
2232,
1006,
1002,
3643,
1010,
9140,
1002,
11498,
5244,
1010,
9140,
1002,
2492,
1007,
1063,
2065,
1006,
999,
26354,
3388,
1006,
1002,
11498,
5244,
1031,
1005,
4289,
1005,
1033,
1007,
1007,
1063,
1002,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Messenger/Transport/AmqpExt/AmqpReceiver.php | AmqpReceiver.get | public function get(): iterable
{
foreach ($this->connection->getQueueNames() as $queueName) {
yield from $this->getEnvelope($queueName);
}
} | php | public function get(): iterable
{
foreach ($this->connection->getQueueNames() as $queueName) {
yield from $this->getEnvelope($queueName);
}
} | [
"public",
"function",
"get",
"(",
")",
":",
"iterable",
"{",
"foreach",
"(",
"$",
"this",
"->",
"connection",
"->",
"getQueueNames",
"(",
")",
"as",
"$",
"queueName",
")",
"{",
"yield",
"from",
"$",
"this",
"->",
"getEnvelope",
"(",
"$",
"queueName",
"... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Messenger/Transport/AmqpExt/AmqpReceiver.php#L44-L49 | train | Get all messages in the queue | [
30522,
2270,
3853,
2131,
1006,
1007,
1024,
2009,
6906,
3468,
1063,
18921,
6776,
1006,
1002,
2023,
1011,
1028,
4434,
1011,
1028,
2131,
4226,
24997,
14074,
2015,
1006,
1007,
2004,
1002,
24240,
18442,
1007,
1063,
10750,
2013,
1002,
2023,
1011,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Console/Scheduling/ManagesFrequencies.php | ManagesFrequencies.twiceDaily | public function twiceDaily($first = 1, $second = 13)
{
$hours = $first.','.$second;
return $this->spliceIntoPosition(1, 0)
->spliceIntoPosition(2, $hours);
} | php | public function twiceDaily($first = 1, $second = 13)
{
$hours = $first.','.$second;
return $this->spliceIntoPosition(1, 0)
->spliceIntoPosition(2, $hours);
} | [
"public",
"function",
"twiceDaily",
"(",
"$",
"first",
"=",
"1",
",",
"$",
"second",
"=",
"13",
")",
"{",
"$",
"hours",
"=",
"$",
"first",
".",
"','",
".",
"$",
"second",
";",
"return",
"$",
"this",
"->",
"spliceIntoPosition",
"(",
"1",
",",
"0",
... | Schedule the event to run twice daily.
@param int $first
@param int $second
@return $this | [
"Schedule",
"the",
"event",
"to",
"run",
"twice",
"daily",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Console/Scheduling/ManagesFrequencies.php#L178-L184 | train | This method is used to add the two times the same year. | [
30522,
2270,
3853,
3807,
21351,
2135,
1006,
1002,
2034,
1027,
1015,
1010,
1002,
2117,
1027,
2410,
1007,
1063,
1002,
2847,
1027,
1002,
2034,
1012,
1005,
1010,
1005,
1012,
1002,
2117,
1025,
2709,
1002,
2023,
1011,
1028,
11867,
13231,
18447,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Bundle/WebProfilerBundle/Csp/ContentSecurityPolicyHandler.php | ContentSecurityPolicyHandler.updateResponseHeaders | public function updateResponseHeaders(Request $request, Response $response)
{
if ($this->cspDisabled) {
$this->removeCspHeaders($response);
return [];
}
$nonces = $this->getNonces($request, $response);
$this->cleanHeaders($response);
$this->updateCsp... | php | public function updateResponseHeaders(Request $request, Response $response)
{
if ($this->cspDisabled) {
$this->removeCspHeaders($response);
return [];
}
$nonces = $this->getNonces($request, $response);
$this->cleanHeaders($response);
$this->updateCsp... | [
"public",
"function",
"updateResponseHeaders",
"(",
"Request",
"$",
"request",
",",
"Response",
"$",
"response",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"cspDisabled",
")",
"{",
"$",
"this",
"->",
"removeCspHeaders",
"(",
"$",
"response",
")",
";",
"return... | Cleanup temporary headers and updates Content-Security-Policy headers.
@return array Nonces used by the bundle in Content-Security-Policy header | [
"Cleanup",
"temporary",
"headers",
"and",
"updates",
"Content",
"-",
"Security",
"-",
"Policy",
"headers",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bundle/WebProfilerBundle/Csp/ContentSecurityPolicyHandler.php#L86-L99 | train | Update response headers | [
30522,
2270,
3853,
10651,
6072,
26029,
3366,
4974,
2545,
1006,
5227,
1002,
5227,
1010,
3433,
1002,
3433,
1007,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
20116,
17299,
14268,
23242,
1007,
1063,
1002,
2023,
1011,
1028,
6366,
6169,
8458,
13775... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
dompdf/dompdf | lib/Cpdf.php | Cpdf.setStrokeColor | function setStrokeColor($color, $force = false)
{
$new_color = array($color[0], $color[1], $color[2], isset($color[3]) ? $color[3] : null);
if (!$force && $this->currentStrokeColor == $new_color) {
return;
}
if (isset($new_color[3])) {
$this->currentStrokeCo... | php | function setStrokeColor($color, $force = false)
{
$new_color = array($color[0], $color[1], $color[2], isset($color[3]) ? $color[3] : null);
if (!$force && $this->currentStrokeColor == $new_color) {
return;
}
if (isset($new_color[3])) {
$this->currentStrokeCo... | [
"function",
"setStrokeColor",
"(",
"$",
"color",
",",
"$",
"force",
"=",
"false",
")",
"{",
"$",
"new_color",
"=",
"array",
"(",
"$",
"color",
"[",
"0",
"]",
",",
"$",
"color",
"[",
"1",
"]",
",",
"$",
"color",
"[",
"2",
"]",
",",
"isset",
"(",... | sets the color for stroke operations
@param $color
@param bool $force | [
"sets",
"the",
"color",
"for",
"stroke",
"operations"
] | 75f13c700009be21a1965dc2c5b68a8708c22ba2 | https://github.com/dompdf/dompdf/blob/75f13c700009be21a1965dc2c5b68a8708c22ba2/lib/Cpdf.php#L3102-L3119 | train | Set the stroke color for the current page | [
30522,
3853,
4520,
13181,
3489,
18717,
1006,
1002,
3609,
1010,
1002,
2486,
1027,
6270,
1007,
1063,
1002,
2047,
1035,
3609,
1027,
9140,
1006,
1002,
3609,
1031,
1014,
1033,
1010,
1002,
3609,
1031,
1015,
1033,
1010,
1002,
3609,
1031,
1016,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/Zend/Db/Adapter/Mysqli.php | Zend_Db_Adapter_Mysqli._rollBack | protected function _rollBack()
{
$this->_connect();
$this->_connection->rollback();
$this->_connection->autocommit(true);
} | php | protected function _rollBack()
{
$this->_connect();
$this->_connection->rollback();
$this->_connection->autocommit(true);
} | [
"protected",
"function",
"_rollBack",
"(",
")",
"{",
"$",
"this",
"->",
"_connect",
"(",
")",
";",
"$",
"this",
"->",
"_connection",
"->",
"rollback",
"(",
")",
";",
"$",
"this",
"->",
"_connection",
"->",
"autocommit",
"(",
"true",
")",
";",
"}"
] | Roll-back a transaction.
@return void | [
"Roll",
"-",
"back",
"a",
"transaction",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Adapter/Mysqli.php#L477-L482 | train | rollBack - Rollback all transactions | [
30522,
5123,
3853,
1035,
4897,
5963,
1006,
1007,
1063,
1002,
2023,
1011,
1028,
1035,
7532,
1006,
1007,
1025,
1002,
2023,
1011,
1028,
1035,
4434,
1011,
1028,
4897,
5963,
1006,
1007,
1025,
1002,
2023,
1011,
1028,
1035,
4434,
1011,
1028,
828... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
z-song/laravel-admin | src/Grid.php | Grid.getExportUrl | public function getExportUrl($scope = 1, $args = null)
{
$input = array_merge(Input::all(), Exporter::formatExportQuery($scope, $args));
if ($constraints = $this->model()->getConstraints()) {
$input = array_merge($input, $constraints);
}
return $this->resource().'?'.htt... | php | public function getExportUrl($scope = 1, $args = null)
{
$input = array_merge(Input::all(), Exporter::formatExportQuery($scope, $args));
if ($constraints = $this->model()->getConstraints()) {
$input = array_merge($input, $constraints);
}
return $this->resource().'?'.htt... | [
"public",
"function",
"getExportUrl",
"(",
"$",
"scope",
"=",
"1",
",",
"$",
"args",
"=",
"null",
")",
"{",
"$",
"input",
"=",
"array_merge",
"(",
"Input",
"::",
"all",
"(",
")",
",",
"Exporter",
"::",
"formatExportQuery",
"(",
"$",
"scope",
",",
"$"... | Get the export url.
@param int $scope
@param null $args
@return string | [
"Get",
"the",
"export",
"url",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Grid.php#L651-L660 | train | Get Export URL | [
30522,
2270,
3853,
2131,
10288,
6442,
3126,
2140,
1006,
1002,
9531,
1027,
1015,
1010,
1002,
12098,
5620,
1027,
19701,
1007,
1063,
1002,
7953,
1027,
9140,
1035,
13590,
1006,
7953,
1024,
1024,
2035,
1006,
1007,
1010,
9167,
2121,
1024,
1024,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Common/Twig/TwigExtension.php | TwigExtension.exifFunc | public function exifFunc($image, $raw = false)
{
if (isset($this->grav['exif'])) {
/** @var UniformResourceLocator $locator */
$locator = $this->grav['locator'];
if ($locator->isStream($image)) {
$image = $locator->findResource($image);
}
... | php | public function exifFunc($image, $raw = false)
{
if (isset($this->grav['exif'])) {
/** @var UniformResourceLocator $locator */
$locator = $this->grav['locator'];
if ($locator->isStream($image)) {
$image = $locator->findResource($image);
}
... | [
"public",
"function",
"exifFunc",
"(",
"$",
"image",
",",
"$",
"raw",
"=",
"false",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"grav",
"[",
"'exif'",
"]",
")",
")",
"{",
"/** @var UniformResourceLocator $locator */",
"$",
"locator",
"=",
"$",
... | Get's the Exif data for a file
@param string $image
@param bool $raw
@return mixed | [
"Get",
"s",
"the",
"Exif",
"data",
"for",
"a",
"file"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Twig/TwigExtension.php#L1145-L1172 | train | Return the Exif data of an image | [
30522,
2270,
3853,
4654,
13355,
4609,
2278,
1006,
1002,
3746,
1010,
1002,
6315,
1027,
6270,
1007,
1063,
2065,
1006,
26354,
3388,
1006,
1002,
2023,
1011,
1028,
24665,
11431,
1031,
1005,
4654,
10128,
1005,
1033,
1007,
1007,
1063,
1013,
1008,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Lock/Store/PdoStore.php | PdoStore.save | public function save(Key $key)
{
$key->reduceLifetime($this->initialTtl);
$sql = "INSERT INTO $this->table ($this->idCol, $this->tokenCol, $this->expirationCol) VALUES (:id, :token, {$this->getCurrentTimestampStatement()} + $this->initialTtl)";
$stmt = $this->getConnection()->prepare($sql);... | php | public function save(Key $key)
{
$key->reduceLifetime($this->initialTtl);
$sql = "INSERT INTO $this->table ($this->idCol, $this->tokenCol, $this->expirationCol) VALUES (:id, :token, {$this->getCurrentTimestampStatement()} + $this->initialTtl)";
$stmt = $this->getConnection()->prepare($sql);... | [
"public",
"function",
"save",
"(",
"Key",
"$",
"key",
")",
"{",
"$",
"key",
"->",
"reduceLifetime",
"(",
"$",
"this",
"->",
"initialTtl",
")",
";",
"$",
"sql",
"=",
"\"INSERT INTO $this->table ($this->idCol, $this->tokenCol, $this->expirationCol) VALUES (:id, :token, {$... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Lock/Store/PdoStore.php#L114-L146 | train | Save a lock | [
30522,
2270,
3853,
3828,
1006,
3145,
1002,
3145,
1007,
1063,
1002,
3145,
1011,
1028,
5547,
15509,
7292,
1006,
1002,
2023,
1011,
1028,
3988,
4779,
2140,
1007,
1025,
1002,
29296,
1027,
1000,
19274,
2046,
1002,
2023,
1011,
1028,
2795,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Serializer/Encoder/ChainEncoder.php | ChainEncoder.getEncoder | private function getEncoder(string $format, array $context): EncoderInterface
{
if (isset($this->encoderByFormat[$format])
&& isset($this->encoders[$this->encoderByFormat[$format]])
) {
return $this->encoders[$this->encoderByFormat[$format]];
}
foreach ($this... | php | private function getEncoder(string $format, array $context): EncoderInterface
{
if (isset($this->encoderByFormat[$format])
&& isset($this->encoders[$this->encoderByFormat[$format]])
) {
return $this->encoders[$this->encoderByFormat[$format]];
}
foreach ($this... | [
"private",
"function",
"getEncoder",
"(",
"string",
"$",
"format",
",",
"array",
"$",
"context",
")",
":",
"EncoderInterface",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"encoderByFormat",
"[",
"$",
"format",
"]",
")",
"&&",
"isset",
"(",
"$",
"t... | Gets the encoder supporting the format.
@throws RuntimeException if no encoder is found | [
"Gets",
"the",
"encoder",
"supporting",
"the",
"format",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Serializer/Encoder/ChainEncoder.php#L85-L102 | train | Get encoder for given format and context. | [
30522,
2797,
3853,
2131,
2368,
16044,
2099,
1006,
5164,
1002,
4289,
1010,
9140,
1002,
6123,
1007,
1024,
4372,
16044,
6657,
3334,
12172,
1063,
2065,
1006,
26354,
3388,
1006,
1002,
2023,
1011,
1028,
4372,
16044,
15185,
2100,
14192,
4017,
1031... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Messenger/TraceableMessageBus.php | TraceableMessageBus.dispatch | public function dispatch($message, array $stamps = []): Envelope
{
$envelope = Envelope::wrap($message, $stamps);
$context = [
'stamps' => array_values($envelope->all()),
'message' => $envelope->getMessage(),
'caller' => $this->getCaller(),
'callTime' ... | php | public function dispatch($message, array $stamps = []): Envelope
{
$envelope = Envelope::wrap($message, $stamps);
$context = [
'stamps' => array_values($envelope->all()),
'message' => $envelope->getMessage(),
'caller' => $this->getCaller(),
'callTime' ... | [
"public",
"function",
"dispatch",
"(",
"$",
"message",
",",
"array",
"$",
"stamps",
"=",
"[",
"]",
")",
":",
"Envelope",
"{",
"$",
"envelope",
"=",
"Envelope",
"::",
"wrap",
"(",
"$",
"message",
",",
"$",
"stamps",
")",
";",
"$",
"context",
"=",
"[... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Messenger/TraceableMessageBus.php#L32-L51 | train | Dispatches a message to the registered bus | [
30522,
2270,
3853,
18365,
1006,
1002,
4471,
1010,
9140,
1002,
12133,
1027,
1031,
1033,
1007,
1024,
11255,
1063,
1002,
11255,
1027,
11255,
1024,
1024,
10236,
1006,
1002,
4471,
1010,
1002,
12133,
1007,
1025,
1002,
6123,
1027,
1031,
1005,
1213... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/DatabaseUserProvider.php | DatabaseUserProvider.retrieveById | public function retrieveById($identifier)
{
$user = $this->conn->table($this->table)->find($identifier);
return $this->getGenericUser($user);
} | php | public function retrieveById($identifier)
{
$user = $this->conn->table($this->table)->find($identifier);
return $this->getGenericUser($user);
} | [
"public",
"function",
"retrieveById",
"(",
"$",
"identifier",
")",
"{",
"$",
"user",
"=",
"$",
"this",
"->",
"conn",
"->",
"table",
"(",
"$",
"this",
"->",
"table",
")",
"->",
"find",
"(",
"$",
"identifier",
")",
";",
"return",
"$",
"this",
"->",
"... | Retrieve a user by their unique identifier.
@param mixed $identifier
@return \Illuminate\Contracts\Auth\Authenticatable|null | [
"Retrieve",
"a",
"user",
"by",
"their",
"unique",
"identifier",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Auth/DatabaseUserProvider.php#L56-L61 | train | Retrieve a user by its identifier | [
30522,
2270,
3853,
12850,
3762,
3593,
1006,
1002,
8909,
4765,
18095,
1007,
1063,
1002,
5310,
1027,
1002,
2023,
1011,
1028,
9530,
2078,
1011,
1028,
2795,
1006,
1002,
2023,
1011,
1028,
2795,
1007,
1011,
1028,
2424,
1006,
1002,
8909,
4765,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/cms/classes/CmsObject.php | CmsObject.listInTheme | public static function listInTheme($theme, $skipCache = false)
{
$result = [];
$instance = static::inTheme($theme);
if ($skipCache) {
$result = $instance->get();
} else {
$items = $instance->newQuery()->lists('fileName');
$loadedItems = [];
... | php | public static function listInTheme($theme, $skipCache = false)
{
$result = [];
$instance = static::inTheme($theme);
if ($skipCache) {
$result = $instance->get();
} else {
$items = $instance->newQuery()->lists('fileName');
$loadedItems = [];
... | [
"public",
"static",
"function",
"listInTheme",
"(",
"$",
"theme",
",",
"$",
"skipCache",
"=",
"false",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"$",
"instance",
"=",
"static",
"::",
"inTheme",
"(",
"$",
"theme",
")",
";",
"if",
"(",
"$",
"skipC... | Returns the list of objects in the specified theme.
This method is used internally by the system.
@param \Cms\Classes\Theme $theme Specifies a parent theme.
@param boolean $skipCache Indicates if objects should be reloaded from the disk bypassing the cache.
@return Collection Returns a collection of CMS objects. | [
"Returns",
"the",
"list",
"of",
"objects",
"in",
"the",
"specified",
"theme",
".",
"This",
"method",
"is",
"used",
"internally",
"by",
"the",
"system",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/CmsObject.php#L121-L171 | train | Returns all the CMS objects in a given theme. | [
30522,
2270,
10763,
3853,
2862,
18447,
29122,
2063,
1006,
1002,
4323,
1010,
1002,
13558,
3540,
5403,
1027,
6270,
1007,
1063,
1002,
2765,
1027,
1031,
1033,
1025,
1002,
6013,
1027,
10763,
1024,
1024,
20014,
29122,
2063,
1006,
1002,
4323,
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.