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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
getgrav/grav | system/src/Grav/Framework/Form/FormFlash.php | FormFlash.addFile | public function addFile(string $filename, string $field, array $crop = null): bool
{
if (!file_exists($filename)) {
throw new \RuntimeException("File not found: {$filename}");
}
// Prepare upload data for later save
$data = [
'name' => basename($filename),
... | php | public function addFile(string $filename, string $field, array $crop = null): bool
{
if (!file_exists($filename)) {
throw new \RuntimeException("File not found: {$filename}");
}
// Prepare upload data for later save
$data = [
'name' => basename($filename),
... | [
"public",
"function",
"addFile",
"(",
"string",
"$",
"filename",
",",
"string",
"$",
"field",
",",
"array",
"$",
"crop",
"=",
"null",
")",
":",
"bool",
"{",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"filename",
")",
")",
"{",
"throw",
"new",
"\\",
"... | Add existing file to the form flash.
@param string $filename
@param string $field
@param array $crop
@return bool | [
"Add",
"existing",
"file",
"to",
"the",
"form",
"flash",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Framework/Form/FormFlash.php#L266-L282 | train | Add a file to the form | [
30522,
2270,
3853,
5587,
8873,
2571,
1006,
5164,
1002,
5371,
18442,
1010,
5164,
1002,
2492,
1010,
9140,
1002,
10416,
1027,
19701,
1007,
1024,
22017,
2140,
1063,
2065,
1006,
999,
5371,
1035,
6526,
1006,
1002,
5371,
18442,
1007,
1007,
1063,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/HTML/QuickForm2/Controller.php | HTML_QuickForm2_Controller.addPage | public function addPage(HTML_QuickForm2_Controller_Page $page)
{
$pageId = $page->getForm()->getId();
if (!empty($this->pages[$pageId])) {
throw new HTML_QuickForm2_InvalidArgumentException(
"Duplicate page ID '{$pageId}'"
);
}
$page->setContro... | php | public function addPage(HTML_QuickForm2_Controller_Page $page)
{
$pageId = $page->getForm()->getId();
if (!empty($this->pages[$pageId])) {
throw new HTML_QuickForm2_InvalidArgumentException(
"Duplicate page ID '{$pageId}'"
);
}
$page->setContro... | [
"public",
"function",
"addPage",
"(",
"HTML_QuickForm2_Controller_Page",
"$",
"page",
")",
"{",
"$",
"pageId",
"=",
"$",
"page",
"->",
"getForm",
"(",
")",
"->",
"getId",
"(",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"pages",
"[",
"... | Adds a new page to the form
@param HTML_QuickForm2_Controller_Page | [
"Adds",
"a",
"new",
"page",
"to",
"the",
"form"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Controller.php#L317-L327 | train | Adds a page to the page list | [
30522,
2270,
3853,
5587,
13704,
1006,
16129,
1035,
4248,
14192,
2475,
1035,
11486,
1035,
3931,
1002,
3931,
1007,
1063,
1002,
3931,
3593,
1027,
1002,
3931,
1011,
1028,
2131,
14192,
1006,
1007,
1011,
1028,
2131,
3593,
1006,
1007,
1025,
2065,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Auth/SessionGuard.php | SessionGuard.logout | public function logout()
{
$user = $this->user();
// If we have an event dispatcher instance, we can fire off the logout event
// so any further processing can be done. This allows the developer to be
// listening for anytime a user signs out of this application manually.
$t... | php | public function logout()
{
$user = $this->user();
// If we have an event dispatcher instance, we can fire off the logout event
// so any further processing can be done. This allows the developer to be
// listening for anytime a user signs out of this application manually.
$t... | [
"public",
"function",
"logout",
"(",
")",
"{",
"$",
"user",
"=",
"$",
"this",
"->",
"user",
"(",
")",
";",
"// If we have an event dispatcher instance, we can fire off the logout event",
"// so any further processing can be done. This allows the developer to be",
"// listening fo... | Log the user out of the application.
@return void | [
"Log",
"the",
"user",
"out",
"of",
"the",
"application",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Auth/SessionGuard.php#L481-L504 | train | Logout the user | [
30522,
2270,
3853,
8154,
4904,
1006,
1007,
1063,
1002,
5310,
1027,
1002,
2023,
1011,
1028,
5310,
1006,
1007,
1025,
1013,
1013,
2065,
2057,
2031,
2019,
2724,
18365,
2121,
6013,
1010,
2057,
2064,
2543,
2125,
1996,
8154,
4904,
2724,
1013,
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/DomCrawler/Field/FormField.php | FormField.getLabel | public function getLabel()
{
$xpath = new \DOMXPath($this->node->ownerDocument);
if ($this->node->hasAttribute('id')) {
$labels = $xpath->query(sprintf('descendant::label[@for="%s"]', $this->node->getAttribute('id')));
if ($labels->length > 0) {
return $label... | php | public function getLabel()
{
$xpath = new \DOMXPath($this->node->ownerDocument);
if ($this->node->hasAttribute('id')) {
$labels = $xpath->query(sprintf('descendant::label[@for="%s"]', $this->node->getAttribute('id')));
if ($labels->length > 0) {
return $label... | [
"public",
"function",
"getLabel",
"(",
")",
"{",
"$",
"xpath",
"=",
"new",
"\\",
"DOMXPath",
"(",
"$",
"this",
"->",
"node",
"->",
"ownerDocument",
")",
";",
"if",
"(",
"$",
"this",
"->",
"node",
"->",
"hasAttribute",
"(",
"'id'",
")",
")",
"{",
"$... | Returns the label tag associated to the field or null if none.
@return \DOMElement|null | [
"Returns",
"the",
"label",
"tag",
"associated",
"to",
"the",
"field",
"or",
"null",
"if",
"none",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/DomCrawler/Field/FormField.php#L63-L78 | train | Get label of node | [
30522,
2270,
3853,
2131,
20470,
2884,
1006,
1007,
1063,
1002,
26726,
8988,
1027,
2047,
1032,
14383,
2595,
15069,
1006,
1002,
2023,
1011,
1028,
13045,
1011,
1028,
3954,
3527,
24894,
4765,
1007,
1025,
2065,
1006,
1002,
2023,
1011,
1028,
13045... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
z-song/laravel-admin | src/Extension.php | Extension.config | public static function config($key = null, $default = null)
{
$name = array_search(get_called_class(), Admin::$extensions);
if (is_null($key)) {
$key = sprintf('admin.extensions.%s', strtolower($name));
} else {
$key = sprintf('admin.extensions.%s.%s', strtolower($na... | php | public static function config($key = null, $default = null)
{
$name = array_search(get_called_class(), Admin::$extensions);
if (is_null($key)) {
$key = sprintf('admin.extensions.%s', strtolower($name));
} else {
$key = sprintf('admin.extensions.%s.%s', strtolower($na... | [
"public",
"static",
"function",
"config",
"(",
"$",
"key",
"=",
"null",
",",
"$",
"default",
"=",
"null",
")",
"{",
"$",
"name",
"=",
"array_search",
"(",
"get_called_class",
"(",
")",
",",
"Admin",
"::",
"$",
"extensions",
")",
";",
"if",
"(",
"is_n... | Get config set in config/admin.php.
@param string $key
@param null $default
@return \Illuminate\Config\Repository|mixed | [
"Get",
"config",
"set",
"in",
"config",
"/",
"admin",
".",
"php",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Extension.php#L214-L225 | train | Get the config value of the current extension | [
30522,
2270,
10763,
3853,
9530,
8873,
2290,
1006,
1002,
3145,
1027,
19701,
1010,
1002,
12398,
1027,
19701,
1007,
1063,
1002,
2171,
1027,
9140,
1035,
3945,
1006,
2131,
1035,
2170,
1035,
2465,
1006,
1007,
1010,
4748,
10020,
1024,
1024,
1002,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Database/Query/Grammars/SqlServerGrammar.php | SqlServerGrammar.compileRowConstraint | protected function compileRowConstraint($query)
{
$start = $query->offset + 1;
if ($query->limit > 0) {
$finish = $query->offset + $query->limit;
return "between {$start} and {$finish}";
}
return ">= {$start}";
} | php | protected function compileRowConstraint($query)
{
$start = $query->offset + 1;
if ($query->limit > 0) {
$finish = $query->offset + $query->limit;
return "between {$start} and {$finish}";
}
return ">= {$start}";
} | [
"protected",
"function",
"compileRowConstraint",
"(",
"$",
"query",
")",
"{",
"$",
"start",
"=",
"$",
"query",
"->",
"offset",
"+",
"1",
";",
"if",
"(",
"$",
"query",
"->",
"limit",
">",
"0",
")",
"{",
"$",
"finish",
"=",
"$",
"query",
"->",
"offse... | Compile the limit / offset row constraint for a query.
@param \Illuminate\Database\Query\Builder $query
@return string | [
"Compile",
"the",
"limit",
"/",
"offset",
"row",
"constraint",
"for",
"a",
"query",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Query/Grammars/SqlServerGrammar.php#L222-L233 | train | Compiles a row constraint for SQL | [
30522,
5123,
3853,
21624,
5004,
8663,
20528,
18447,
1006,
1002,
23032,
1007,
1063,
1002,
2707,
1027,
1002,
23032,
1011,
1028,
16396,
1009,
1015,
1025,
2065,
1006,
1002,
23032,
1011,
1028,
5787,
1028,
1014,
1007,
1063,
1002,
3926,
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... |
laravel/framework | src/Illuminate/Notifications/ChannelManager.php | ChannelManager.sendNow | public function sendNow($notifiables, $notification, array $channels = null)
{
return (new NotificationSender(
$this, $this->app->make(Bus::class), $this->app->make(Dispatcher::class), $this->locale)
)->sendNow($notifiables, $notification, $channels);
} | php | public function sendNow($notifiables, $notification, array $channels = null)
{
return (new NotificationSender(
$this, $this->app->make(Bus::class), $this->app->make(Dispatcher::class), $this->locale)
)->sendNow($notifiables, $notification, $channels);
} | [
"public",
"function",
"sendNow",
"(",
"$",
"notifiables",
",",
"$",
"notification",
",",
"array",
"$",
"channels",
"=",
"null",
")",
"{",
"return",
"(",
"new",
"NotificationSender",
"(",
"$",
"this",
",",
"$",
"this",
"->",
"app",
"->",
"make",
"(",
"B... | Send the given notification immediately.
@param \Illuminate\Support\Collection|array|mixed $notifiables
@param mixed $notification
@param array|null $channels
@return void | [
"Send",
"the",
"given",
"notification",
"immediately",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Notifications/ChannelManager.php#L50-L55 | train | Send a notification to all notifiables in the current locale. | [
30522,
2270,
3853,
4604,
19779,
1006,
1002,
2025,
10128,
19210,
2015,
1010,
1002,
26828,
1010,
9140,
1002,
6833,
1027,
19701,
1007,
1063,
2709,
1006,
2047,
26828,
5054,
4063,
1006,
1002,
2023,
1010,
1002,
2023,
1011,
1028,
10439,
1011,
1028... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Bundle/WebProfilerBundle/Csp/ContentSecurityPolicyHandler.php | ContentSecurityPolicyHandler.parseDirectives | private function parseDirectives($header)
{
$directives = [];
foreach (explode(';', $header) as $directive) {
$parts = explode(' ', trim($directive));
if (\count($parts) < 1) {
continue;
}
$name = array_shift($parts);
$dire... | php | private function parseDirectives($header)
{
$directives = [];
foreach (explode(';', $header) as $directive) {
$parts = explode(' ', trim($directive));
if (\count($parts) < 1) {
continue;
}
$name = array_shift($parts);
$dire... | [
"private",
"function",
"parseDirectives",
"(",
"$",
"header",
")",
"{",
"$",
"directives",
"=",
"[",
"]",
";",
"foreach",
"(",
"explode",
"(",
"';'",
",",
"$",
"header",
")",
"as",
"$",
"directive",
")",
"{",
"$",
"parts",
"=",
"explode",
"(",
"' '",... | Converts a Content-Security-Policy header value into a directive set array.
@param string $header The header value
@return array The directive set | [
"Converts",
"a",
"Content",
"-",
"Security",
"-",
"Policy",
"header",
"value",
"into",
"a",
"directive",
"set",
"array",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bundle/WebProfilerBundle/Csp/ContentSecurityPolicyHandler.php#L193-L207 | train | Parse the header directives | [
30522,
2797,
3853,
11968,
6924,
7442,
15277,
2015,
1006,
1002,
20346,
1007,
1063,
1002,
16449,
2015,
1027,
1031,
1033,
1025,
18921,
6776,
1006,
15044,
1006,
1005,
1025,
1005,
1010,
1002,
20346,
1007,
2004,
1002,
16449,
1007,
1063,
1002,
303... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Capsule/Manager.php | Manager.bulk | public static function bulk($jobs, $data = '', $queue = null, $connection = null)
{
return static::$instance->connection($connection)->bulk($jobs, $data, $queue);
} | php | public static function bulk($jobs, $data = '', $queue = null, $connection = null)
{
return static::$instance->connection($connection)->bulk($jobs, $data, $queue);
} | [
"public",
"static",
"function",
"bulk",
"(",
"$",
"jobs",
",",
"$",
"data",
"=",
"''",
",",
"$",
"queue",
"=",
"null",
",",
"$",
"connection",
"=",
"null",
")",
"{",
"return",
"static",
"::",
"$",
"instance",
"->",
"connection",
"(",
"$",
"connection... | Push a new an array of jobs onto the queue.
@param array $jobs
@param mixed $data
@param string $queue
@param string $connection
@return mixed | [
"Push",
"a",
"new",
"an",
"array",
"of",
"jobs",
"onto",
"the",
"queue",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Queue/Capsule/Manager.php#L111-L114 | train | bulk - bulk - create a new instance of the class | [
30522,
2270,
10763,
3853,
9625,
1006,
1002,
5841,
1010,
1002,
2951,
1027,
1005,
1005,
1010,
1002,
24240,
1027,
19701,
1010,
1002,
4434,
1027,
19701,
1007,
1063,
2709,
10763,
1024,
1024,
1002,
6013,
1011,
1028,
4434,
1006,
1002,
4434,
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/Routing/ResponseFactory.php | ResponseFactory.json | public function json($data = [], $status = 200, array $headers = [], $options = 0)
{
return new JsonResponse($data, $status, $headers, $options);
} | php | public function json($data = [], $status = 200, array $headers = [], $options = 0)
{
return new JsonResponse($data, $status, $headers, $options);
} | [
"public",
"function",
"json",
"(",
"$",
"data",
"=",
"[",
"]",
",",
"$",
"status",
"=",
"200",
",",
"array",
"$",
"headers",
"=",
"[",
"]",
",",
"$",
"options",
"=",
"0",
")",
"{",
"return",
"new",
"JsonResponse",
"(",
"$",
"data",
",",
"$",
"s... | Create a new JSON response instance.
@param mixed $data
@param int $status
@param array $headers
@param int $options
@return \Illuminate\Http\JsonResponse | [
"Create",
"a",
"new",
"JSON",
"response",
"instance",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/ResponseFactory.php#L93-L96 | train | Create JsonResponse object | [
30522,
2270,
3853,
1046,
3385,
1006,
1002,
2951,
1027,
1031,
1033,
1010,
1002,
3570,
1027,
3263,
1010,
9140,
1002,
20346,
2015,
1027,
1031,
1033,
1010,
1002,
7047,
1027,
1014,
1007,
1063,
2709,
2047,
1046,
3385,
6072,
26029,
3366,
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... |
getgrav/grav | system/src/Grav/Common/Page/Page.php | Page.active | public function active()
{
$uri_path = rtrim(urldecode(Grav::instance()['uri']->path()), '/') ?: '/';
$routes = Grav::instance()['pages']->routes();
return isset($routes[$uri_path]) && $routes[$uri_path] === $this->path();
} | php | public function active()
{
$uri_path = rtrim(urldecode(Grav::instance()['uri']->path()), '/') ?: '/';
$routes = Grav::instance()['pages']->routes();
return isset($routes[$uri_path]) && $routes[$uri_path] === $this->path();
} | [
"public",
"function",
"active",
"(",
")",
"{",
"$",
"uri_path",
"=",
"rtrim",
"(",
"urldecode",
"(",
"Grav",
"::",
"instance",
"(",
")",
"[",
"'uri'",
"]",
"->",
"path",
"(",
")",
")",
",",
"'/'",
")",
"?",
":",
"'/'",
";",
"$",
"routes",
"=",
... | Returns whether or not this page is the currently active page requested via the URL.
@return bool True if it is active | [
"Returns",
"whether",
"or",
"not",
"this",
"page",
"is",
"the",
"currently",
"active",
"page",
"requested",
"via",
"the",
"URL",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Page/Page.php#L2510-L2516 | train | Returns true if the page is active | [
30522,
2270,
3853,
3161,
1006,
1007,
1063,
1002,
24471,
2072,
1035,
4130,
1027,
19387,
20026,
1006,
24471,
17920,
16044,
1006,
24665,
11431,
1024,
1024,
6013,
1006,
1007,
1031,
1005,
24471,
2072,
1005,
1033,
1011,
1028,
4130,
1006,
1007,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/PrivacyManager/PrivacyManager.php | PrivacyManager.installationFormSubmit | public function installationFormSubmit(FormDefaultSettings $form)
{
$doNotTrack = (bool) $form->getSubmitValue('do_not_track');
$dntChecker = new DoNotTrackHeaderChecker();
if ($doNotTrack) {
$dntChecker->activate();
} else {
$dntChecker->deactivate();
... | php | public function installationFormSubmit(FormDefaultSettings $form)
{
$doNotTrack = (bool) $form->getSubmitValue('do_not_track');
$dntChecker = new DoNotTrackHeaderChecker();
if ($doNotTrack) {
$dntChecker->activate();
} else {
$dntChecker->deactivate();
... | [
"public",
"function",
"installationFormSubmit",
"(",
"FormDefaultSettings",
"$",
"form",
")",
"{",
"$",
"doNotTrack",
"=",
"(",
"bool",
")",
"$",
"form",
"->",
"getSubmitValue",
"(",
"'do_not_track'",
")",
";",
"$",
"dntChecker",
"=",
"new",
"DoNotTrackHeaderChe... | Process the submit on the Installation "default settings" form.
@param FormDefaultSettings $form | [
"Process",
"the",
"submit",
"on",
"the",
"Installation",
"default",
"settings",
"form",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/PrivacyManager/PrivacyManager.php#L260-L276 | train | This method is called when the installation form is submitted. | [
30522,
2270,
3853,
8272,
22694,
12083,
22930,
1006,
2433,
3207,
7011,
11314,
21678,
8613,
1002,
2433,
1007,
1063,
1002,
2123,
14517,
22648,
2243,
1027,
1006,
22017,
2140,
1007,
1002,
2433,
1011,
1028,
4152,
12083,
22930,
10175,
5657,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Intl/NumberFormatter/NumberFormatter.php | NumberFormatter.getInt32Value | private function getInt32Value($value)
{
if ($value > self::$int32Max || $value < -self::$int32Max - 1) {
return false;
}
return (int) $value;
} | php | private function getInt32Value($value)
{
if ($value > self::$int32Max || $value < -self::$int32Max - 1) {
return false;
}
return (int) $value;
} | [
"private",
"function",
"getInt32Value",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
">",
"self",
"::",
"$",
"int32Max",
"||",
"$",
"value",
"<",
"-",
"self",
"::",
"$",
"int32Max",
"-",
"1",
")",
"{",
"return",
"false",
";",
"}",
"return"... | Convert the value data type to int or returns false if the value is out of the integer value range.
@param mixed $value The value to be converted
@return int|false The converted value | [
"Convert",
"the",
"value",
"data",
"type",
"to",
"int",
"or",
"returns",
"false",
"if",
"the",
"value",
"is",
"out",
"of",
"the",
"integer",
"value",
"range",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Intl/NumberFormatter/NumberFormatter.php#L820-L827 | train | Get the value of the int32 field | [
30522,
2797,
3853,
2131,
18447,
16703,
10175,
5657,
1006,
1002,
3643,
1007,
1063,
2065,
1006,
1002,
3643,
1028,
2969,
1024,
1024,
1002,
20014,
16703,
17848,
1064,
1064,
1002,
3643,
1026,
1011,
2969,
1024,
1024,
1002,
20014,
16703,
17848,
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/Framework/File/Formatter/YamlFormatter.php | YamlFormatter.decode | public function decode($data): array
{
// Try native PECL YAML PHP extension first if available.
if (\function_exists('yaml_parse') && $this->useNativeDecoder()) {
// Safely decode YAML.
$saved = @ini_get('yaml.decode_php');
@ini_set('yaml.decode_php', '0');
... | php | public function decode($data): array
{
// Try native PECL YAML PHP extension first if available.
if (\function_exists('yaml_parse') && $this->useNativeDecoder()) {
// Safely decode YAML.
$saved = @ini_get('yaml.decode_php');
@ini_set('yaml.decode_php', '0');
... | [
"public",
"function",
"decode",
"(",
"$",
"data",
")",
":",
"array",
"{",
"// Try native PECL YAML PHP extension first if available.",
"if",
"(",
"\\",
"function_exists",
"(",
"'yaml_parse'",
")",
"&&",
"$",
"this",
"->",
"useNativeDecoder",
"(",
")",
")",
"{",
... | {@inheritdoc}
@see FileFormatterInterface::decode() | [
"{"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Framework/File/Formatter/YamlFormatter.php#L89-L113 | train | Decodes YAML into array | [
30522,
2270,
3853,
21933,
3207,
1006,
1002,
2951,
1007,
1024,
9140,
1063,
1013,
1013,
3046,
3128,
21877,
20464,
8038,
19968,
25718,
5331,
2034,
2065,
2800,
1012,
2065,
1006,
1032,
3853,
1035,
6526,
1006,
1005,
8038,
19968,
1035,
11968,
3366... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Cookie.php | Cookie.fromString | public static function fromString($cookie, $url = null)
{
$parts = explode(';', $cookie);
if (false === strpos($parts[0], '=')) {
throw new \InvalidArgumentException(sprintf('The cookie string "%s" is not valid.', $parts[0]));
}
list($name, $value) = explode('=', array_... | php | public static function fromString($cookie, $url = null)
{
$parts = explode(';', $cookie);
if (false === strpos($parts[0], '=')) {
throw new \InvalidArgumentException(sprintf('The cookie string "%s" is not valid.', $parts[0]));
}
list($name, $value) = explode('=', array_... | [
"public",
"static",
"function",
"fromString",
"(",
"$",
"cookie",
",",
"$",
"url",
"=",
"null",
")",
"{",
"$",
"parts",
"=",
"explode",
"(",
"';'",
",",
"$",
"cookie",
")",
";",
"if",
"(",
"false",
"===",
"strpos",
"(",
"$",
"parts",
"[",
"0",
"]... | Creates a Cookie instance from a Set-Cookie header value.
@param string $cookie A Set-Cookie header value
@param string|null $url The base URL
@return static
@throws \InvalidArgumentException | [
"Creates",
"a",
"Cookie",
"instance",
"from",
"a",
"Set",
"-",
"Cookie",
"header",
"value",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/BrowserKit/Cookie.php#L129-L200 | train | Creates a new instance from a cookie string. | [
30522,
2270,
10763,
3853,
2013,
3367,
4892,
1006,
1002,
17387,
1010,
1002,
24471,
2140,
1027,
19701,
1007,
1063,
1002,
3033,
1027,
15044,
1006,
1005,
1025,
1005,
1010,
1002,
17387,
1007,
1025,
2065,
1006,
6270,
1027,
1027,
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... |
slimphp/Slim | Slim/Http/Response.php | Response.withRedirect | public function withRedirect($url, $status = null)
{
$responseWithRedirect = $this->withHeader('Location', (string)$url);
if (is_null($status) && $this->getStatusCode() === StatusCode::HTTP_OK) {
$status = StatusCode::HTTP_FOUND;
}
if (!is_null($status)) {
r... | php | public function withRedirect($url, $status = null)
{
$responseWithRedirect = $this->withHeader('Location', (string)$url);
if (is_null($status) && $this->getStatusCode() === StatusCode::HTTP_OK) {
$status = StatusCode::HTTP_FOUND;
}
if (!is_null($status)) {
r... | [
"public",
"function",
"withRedirect",
"(",
"$",
"url",
",",
"$",
"status",
"=",
"null",
")",
"{",
"$",
"responseWithRedirect",
"=",
"$",
"this",
"->",
"withHeader",
"(",
"'Location'",
",",
"(",
"string",
")",
"$",
"url",
")",
";",
"if",
"(",
"is_null",... | Redirect.
Note: This method is not part of the PSR-7 standard.
This method prepares the response object to return an HTTP Redirect
response to the client.
@param string|UriInterface $url The redirect destination.
@param int|null $status The redirect HTTP status code.
@return static | [
"Redirect",
"."
] | ccef5f7d8bcd469d59cbe64f6210d83764f91543 | https://github.com/slimphp/Slim/blob/ccef5f7d8bcd469d59cbe64f6210d83764f91543/Slim/Http/Response.php#L318-L331 | train | Return a response with a redirect header | [
30522,
2270,
3853,
2007,
5596,
7442,
6593,
1006,
1002,
24471,
2140,
1010,
1002,
3570,
1027,
19701,
1007,
1063,
1002,
3433,
24415,
5596,
7442,
6593,
1027,
1002,
2023,
1011,
1028,
2007,
4974,
2121,
1006,
1005,
3295,
1005,
1010,
1006,
5164,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.wasLastActionNotToday | private function wasLastActionNotToday(VisitProperties $visitProperties, Request $request)
{
$lastActionTime = $visitProperties->getProperty('visit_last_action_time');
if (empty($lastActionTime)) {
return false;
}
$idSite = $request->getIdSite();
$timezone = $th... | php | private function wasLastActionNotToday(VisitProperties $visitProperties, Request $request)
{
$lastActionTime = $visitProperties->getProperty('visit_last_action_time');
if (empty($lastActionTime)) {
return false;
}
$idSite = $request->getIdSite();
$timezone = $th... | [
"private",
"function",
"wasLastActionNotToday",
"(",
"VisitProperties",
"$",
"visitProperties",
",",
"Request",
"$",
"request",
")",
"{",
"$",
"lastActionTime",
"=",
"$",
"visitProperties",
"->",
"getProperty",
"(",
"'visit_last_action_time'",
")",
";",
"if",
"(",
... | Returns true if the last action was not today.
@param VisitProperties $visitor
@return bool | [
"Returns",
"true",
"if",
"the",
"last",
"action",
"was",
"not",
"today",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/CoreHome/Tracker/VisitRequestProcessor.php#L193-L213 | train | Returns true if the last action was not today. | [
30522,
2797,
3853,
2001,
8523,
2696,
7542,
17048,
3406,
10259,
1006,
3942,
21572,
4842,
7368,
1002,
3942,
21572,
4842,
7368,
1010,
5227,
1002,
5227,
1007,
1063,
1002,
2197,
18908,
3258,
7292,
1027,
1002,
3942,
21572,
4842,
7368,
1011,
1028,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Console/Application.php | Application.has | public function has($name)
{
$this->init();
return isset($this->commands[$name]) || ($this->commandLoader && $this->commandLoader->has($name) && $this->add($this->commandLoader->get($name)));
} | php | public function has($name)
{
$this->init();
return isset($this->commands[$name]) || ($this->commandLoader && $this->commandLoader->has($name) && $this->add($this->commandLoader->get($name)));
} | [
"public",
"function",
"has",
"(",
"$",
"name",
")",
"{",
"$",
"this",
"->",
"init",
"(",
")",
";",
"return",
"isset",
"(",
"$",
"this",
"->",
"commands",
"[",
"$",
"name",
"]",
")",
"||",
"(",
"$",
"this",
"->",
"commandLoader",
"&&",
"$",
"this"... | Returns true if the command exists, false otherwise.
@param string $name The command name or alias
@return bool true if the command exists, false otherwise | [
"Returns",
"true",
"if",
"the",
"command",
"exists",
"false",
"otherwise",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Application.php#L533-L538 | train | Has Command? - > Exists? - > Exists? - > Exists? | [
30522,
2270,
3853,
2038,
1006,
1002,
2171,
1007,
1063,
1002,
2023,
1011,
1028,
1999,
4183,
1006,
1007,
1025,
2709,
26354,
3388,
1006,
1002,
2023,
1011,
1028,
10954,
1031,
1002,
2171,
1033,
1007,
1064,
1064,
1006,
1002,
2023,
1011,
1028,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/HttpFoundation/Session/Storage/Handler/PdoSessionHandler.php | PdoSessionHandler.read | public function read($sessionId)
{
try {
return parent::read($sessionId);
} catch (\PDOException $e) {
$this->rollback();
throw $e;
}
} | php | public function read($sessionId)
{
try {
return parent::read($sessionId);
} catch (\PDOException $e) {
$this->rollback();
throw $e;
}
} | [
"public",
"function",
"read",
"(",
"$",
"sessionId",
")",
"{",
"try",
"{",
"return",
"parent",
"::",
"read",
"(",
"$",
"sessionId",
")",
";",
"}",
"catch",
"(",
"\\",
"PDOException",
"$",
"e",
")",
"{",
"$",
"this",
"->",
"rollback",
"(",
")",
";",... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/PdoSessionHandler.php#L277-L286 | train | read session data | [
30522,
2270,
3853,
3191,
1006,
1002,
5219,
3593,
1007,
1063,
3046,
1063,
2709,
6687,
1024,
1024,
3191,
1006,
1002,
5219,
3593,
1007,
1025,
1065,
4608,
1006,
1032,
22851,
8913,
2595,
24422,
1002,
1041,
1007,
1063,
1002,
2023,
1011,
1028,
4... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
overtrue/wechat | src/Kernel/BaseClient.php | BaseClient.httpPostJson | public function httpPostJson(string $url, array $data = [], array $query = [])
{
return $this->request($url, 'POST', ['query' => $query, 'json' => $data]);
} | php | public function httpPostJson(string $url, array $data = [], array $query = [])
{
return $this->request($url, 'POST', ['query' => $query, 'json' => $data]);
} | [
"public",
"function",
"httpPostJson",
"(",
"string",
"$",
"url",
",",
"array",
"$",
"data",
"=",
"[",
"]",
",",
"array",
"$",
"query",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"request",
"(",
"$",
"url",
",",
"'POST'",
",",
"[",
"'qu... | JSON request.
@param string $url
@param string|array $data
@param array $query
@return \Psr\Http\Message\ResponseInterface|\EasyWeChat\Kernel\Support\Collection|array|object|string
@throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException | [
"JSON",
"request",
"."
] | 120c72faaa93c270365bc75c73c362d5fd583209 | https://github.com/overtrue/wechat/blob/120c72faaa93c270365bc75c73c362d5fd583209/src/Kernel/BaseClient.php#L99-L102 | train | POST JSON - POST | [
30522,
2270,
3853,
8299,
19894,
22578,
2239,
1006,
5164,
1002,
24471,
2140,
1010,
9140,
1002,
2951,
1027,
1031,
1033,
1010,
9140,
1002,
23032,
1027,
1031,
1033,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
5227,
1006,
1002,
24471,
2140,
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/PropertyInfo/Extractor/ReflectionExtractor.php | ReflectionExtractor.getAccessorMethod | private function getAccessorMethod(string $class, string $property): ?array
{
$ucProperty = ucfirst($property);
foreach ($this->accessorPrefixes as $prefix) {
try {
$reflectionMethod = new \ReflectionMethod($class, $prefix.$ucProperty);
if ($reflectionMet... | php | private function getAccessorMethod(string $class, string $property): ?array
{
$ucProperty = ucfirst($property);
foreach ($this->accessorPrefixes as $prefix) {
try {
$reflectionMethod = new \ReflectionMethod($class, $prefix.$ucProperty);
if ($reflectionMet... | [
"private",
"function",
"getAccessorMethod",
"(",
"string",
"$",
"class",
",",
"string",
"$",
"property",
")",
":",
"?",
"array",
"{",
"$",
"ucProperty",
"=",
"ucfirst",
"(",
"$",
"property",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"accessorPrefixes",
... | Gets the accessor method.
Returns an array with a the instance of \ReflectionMethod as first key
and the prefix of the method as second or null if not found. | [
"Gets",
"the",
"accessor",
"method",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/PropertyInfo/Extractor/ReflectionExtractor.php#L375-L395 | train | Returns the reflection method that is used by the class. | [
30522,
2797,
3853,
2131,
6305,
9623,
21748,
11368,
6806,
2094,
1006,
5164,
1002,
2465,
1010,
5164,
1002,
3200,
1007,
1024,
1029,
9140,
1063,
1002,
15384,
21572,
4842,
3723,
1027,
15384,
8873,
12096,
1006,
1002,
3200,
1007,
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... |
z-song/laravel-admin | src/Form.php | Form.redirectAfterSaving | protected function redirectAfterSaving($resourcesPath, $key)
{
if (request('after-save') == 1) {
// continue editing
$url = rtrim($resourcesPath, '/')."/{$key}/edit";
} elseif (request('after-save') == 2) {
// continue creating
$url = rtrim($resourcesP... | php | protected function redirectAfterSaving($resourcesPath, $key)
{
if (request('after-save') == 1) {
// continue editing
$url = rtrim($resourcesPath, '/')."/{$key}/edit";
} elseif (request('after-save') == 2) {
// continue creating
$url = rtrim($resourcesP... | [
"protected",
"function",
"redirectAfterSaving",
"(",
"$",
"resourcesPath",
",",
"$",
"key",
")",
"{",
"if",
"(",
"request",
"(",
"'after-save'",
")",
"==",
"1",
")",
"{",
"// continue editing",
"$",
"url",
"=",
"rtrim",
"(",
"$",
"resourcesPath",
",",
"'/'... | Get RedirectResponse after data saving.
@param string $resourcesPath
@param string $key
@return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector | [
"Get",
"RedirectResponse",
"after",
"data",
"saving",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Form.php#L598-L616 | train | Redirect after saving | [
30522,
5123,
30524,
6199,
2545,
18891,
3070,
1006,
1002,
4219,
15069,
1010,
1002,
3145,
1007,
1063,
2065,
1006,
5227,
1006,
1005,
2044,
1011,
3828,
1005,
1007,
1027,
1027,
1015,
1007,
1063,
1013,
1013,
3613,
9260,
1002,
24471,
2140,
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... |
dompdf/dompdf | src/Image/Cache.php | Cache.clear | static function clear()
{
if (empty(self::$_cache) || self::$_dompdf->getOptions()->getDebugKeepTemp()) {
return;
}
foreach (self::$_cache as $file) {
if (self::$_dompdf->getOptions()->getDebugPng()) {
print "[clear unlink $file]";
}
... | php | static function clear()
{
if (empty(self::$_cache) || self::$_dompdf->getOptions()->getDebugKeepTemp()) {
return;
}
foreach (self::$_cache as $file) {
if (self::$_dompdf->getOptions()->getDebugPng()) {
print "[clear unlink $file]";
}
... | [
"static",
"function",
"clear",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"self",
"::",
"$",
"_cache",
")",
"||",
"self",
"::",
"$",
"_dompdf",
"->",
"getOptions",
"(",
")",
"->",
"getDebugKeepTemp",
"(",
")",
")",
"{",
"return",
";",
"}",
"foreach",
... | Unlink all cached images (i.e. temporary images either downloaded
or converted) | [
"Unlink",
"all",
"cached",
"images",
"(",
"i",
".",
"e",
".",
"temporary",
"images",
"either",
"downloaded",
"or",
"converted",
")"
] | 75f13c700009be21a1965dc2c5b68a8708c22ba2 | https://github.com/dompdf/dompdf/blob/75f13c700009be21a1965dc2c5b68a8708c22ba2/src/Image/Cache.php#L155-L169 | train | Clear the cache | [
30522,
10763,
3853,
3154,
1006,
1007,
1063,
2065,
1006,
4064,
1006,
2969,
1024,
1024,
1002,
1035,
17053,
1007,
1064,
1064,
2969,
1024,
1024,
1002,
1035,
14383,
17299,
2546,
1011,
1028,
2131,
7361,
9285,
1006,
1007,
1011,
1028,
2131,
3207,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
z-song/laravel-admin | src/Grid/Filter/Presenter/Select.php | Select.buildOptions | protected function buildOptions() : array
{
if (is_string($this->options)) {
$this->loadRemoteOptions($this->options);
}
if ($this->options instanceof \Closure) {
$this->options = $this->options->call($this->filter, $this->filter->getValue());
}
if (... | php | protected function buildOptions() : array
{
if (is_string($this->options)) {
$this->loadRemoteOptions($this->options);
}
if ($this->options instanceof \Closure) {
$this->options = $this->options->call($this->filter, $this->filter->getValue());
}
if (... | [
"protected",
"function",
"buildOptions",
"(",
")",
":",
"array",
"{",
"if",
"(",
"is_string",
"(",
"$",
"this",
"->",
"options",
")",
")",
"{",
"$",
"this",
"->",
"loadRemoteOptions",
"(",
"$",
"this",
"->",
"options",
")",
";",
"}",
"if",
"(",
"$",
... | Build options.
@return array | [
"Build",
"options",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Grid/Filter/Presenter/Select.php#L61-L100 | train | Build options array | [
30522,
5123,
3853,
3857,
7361,
9285,
1006,
1007,
1024,
9140,
1063,
2065,
1006,
2003,
1035,
5164,
1006,
1002,
2023,
1011,
1028,
7047,
1007,
1007,
1063,
1002,
2023,
1011,
1028,
7170,
28578,
12184,
7361,
9285,
1006,
1002,
2023,
1011,
1028,
7... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/Tracker/PageUrl.php | PageUrl.processUrlFragment | public static function processUrlFragment($urlFragment, $idSite = false)
{
// if we should discard the url fragment for this site, return an empty string as
// the processed url fragment
if ($idSite !== false
&& PageUrl::shouldRemoveURLFragmentFor($idSite)
) {
... | php | public static function processUrlFragment($urlFragment, $idSite = false)
{
// if we should discard the url fragment for this site, return an empty string as
// the processed url fragment
if ($idSite !== false
&& PageUrl::shouldRemoveURLFragmentFor($idSite)
) {
... | [
"public",
"static",
"function",
"processUrlFragment",
"(",
"$",
"urlFragment",
",",
"$",
"idSite",
"=",
"false",
")",
"{",
"// if we should discard the url fragment for this site, return an empty string as",
"// the processed url fragment",
"if",
"(",
"$",
"idSite",
"!==",
... | Cleans and/or removes the URL fragment of a URL.
@param $urlFragment string The URL fragment to process.
@param $idSite int|bool If not false, this function will check if URL fragments
should be removed for the site w/ this ID and if so,
the returned processed fragment will be empty.
@return string Th... | [
"Cleans",
"and",
"/",
"or",
"removes",
"the",
"URL",
"fragment",
"of",
"a",
"URL",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Tracker/PageUrl.php#L143-L158 | train | Process url fragment | [
30522,
2270,
10763,
3853,
2832,
3126,
10270,
29181,
3672,
1006,
1002,
24471,
10270,
29181,
3672,
1010,
1002,
8909,
28032,
2063,
1027,
6270,
1007,
1063,
1013,
1013,
2065,
2057,
2323,
5860,
4232,
1996,
24471,
2140,
15778,
2005,
2023,
2609,
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/HttpKernel/Controller/ArgumentResolver/RequestAttributeValueResolver.php | RequestAttributeValueResolver.resolve | public function resolve(Request $request, ArgumentMetadata $argument)
{
yield $request->attributes->get($argument->getName());
} | php | public function resolve(Request $request, ArgumentMetadata $argument)
{
yield $request->attributes->get($argument->getName());
} | [
"public",
"function",
"resolve",
"(",
"Request",
"$",
"request",
",",
"ArgumentMetadata",
"$",
"argument",
")",
"{",
"yield",
"$",
"request",
"->",
"attributes",
"->",
"get",
"(",
"$",
"argument",
"->",
"getName",
"(",
")",
")",
";",
"}"
] | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpKernel/Controller/ArgumentResolver/RequestAttributeValueResolver.php#L36-L39 | train | Resolves the request attributes to the corresponding value. | [
30522,
2270,
3853,
10663,
1006,
5227,
1002,
5227,
1010,
6685,
11368,
8447,
2696,
1002,
6685,
1007,
1063,
10750,
1002,
5227,
1011,
1028,
12332,
1011,
1028,
2131,
1006,
1002,
6685,
1011,
1028,
2131,
18442,
1006,
1007,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Maildir.php | Zend_Mail_Storage_Maildir.getUniqueId | public function getUniqueId($id = null)
{
if ($id) {
return $this->_getFileData($id, 'uniq');
}
$ids = array();
foreach ($this->_files as $num => $file) {
$ids[$num + 1] = $file['uniq'];
}
return $ids;
} | php | public function getUniqueId($id = null)
{
if ($id) {
return $this->_getFileData($id, 'uniq');
}
$ids = array();
foreach ($this->_files as $num => $file) {
$ids[$num + 1] = $file['uniq'];
}
return $ids;
} | [
"public",
"function",
"getUniqueId",
"(",
"$",
"id",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"id",
")",
"{",
"return",
"$",
"this",
"->",
"_getFileData",
"(",
"$",
"id",
",",
"'uniq'",
")",
";",
"}",
"$",
"ids",
"=",
"array",
"(",
")",
";",
"for... | get unique id for one or all messages
if storage does not support unique ids it's the same as the message number
@param int|null $id message number
@return array|string message number for given message or all messages as array
@throws Zend_Mail_Storage_Exception | [
"get",
"unique",
"id",
"for",
"one",
"or",
"all",
"messages"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail/Storage/Maildir.php#L438-L449 | train | Get Unique ID of all files | [
30522,
2270,
3853,
2131,
19496,
4226,
3593,
1006,
1002,
8909,
1027,
19701,
1007,
1063,
2065,
1006,
1002,
8909,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
1035,
2131,
8873,
3709,
6790,
1006,
1002,
8909,
1010,
1005,
4895,
18515,
1005,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/SitesManager/Model.php | Model.getSitesFromTimezones | public function getSitesFromTimezones($timezones)
{
$query = 'SELECT idsite FROM ' . $this->table . '
WHERE timezone IN (' . Common::getSqlStringFieldsArray($timezones) . ')
ORDER BY idsite ASC';
$db = $this->getDb();
$sites = $db->fetchAll($query, $timezo... | php | public function getSitesFromTimezones($timezones)
{
$query = 'SELECT idsite FROM ' . $this->table . '
WHERE timezone IN (' . Common::getSqlStringFieldsArray($timezones) . ')
ORDER BY idsite ASC';
$db = $this->getDb();
$sites = $db->fetchAll($query, $timezo... | [
"public",
"function",
"getSitesFromTimezones",
"(",
"$",
"timezones",
")",
"{",
"$",
"query",
"=",
"'SELECT idsite FROM '",
".",
"$",
"this",
"->",
"table",
".",
"'\n WHERE timezone IN ('",
".",
"Common",
"::",
"getSqlStringFieldsArray",
"(",
"$",
"... | Returns all websites with a timezone matching one the specified timezones
@param array $timezones
@return array
@ignore | [
"Returns",
"all",
"websites",
"with",
"a",
"timezone",
"matching",
"one",
"the",
"specified",
"timezones"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SitesManager/Model.php#L174-L183 | train | Get all the sites from a list of timezones | [
30522,
2270,
3853,
4152,
7616,
19699,
5358,
7292,
15975,
2015,
1006,
1002,
2051,
15975,
2015,
1007,
1063,
1002,
23032,
1027,
1005,
7276,
8909,
28032,
2063,
2013,
1005,
1012,
1002,
2023,
1011,
1028,
2795,
1012,
1005,
2073,
2051,
15975,
1999,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/API/DocumentationGenerator.php | DocumentationGenerator.getApiDocumentationAsStringForDeveloperReference | public function getApiDocumentationAsStringForDeveloperReference($outputExampleUrls = true, $prefixUrls = '')
{
list($toc, $str) = $this->generateDocumentation($outputExampleUrls, $prefixUrls, $displayTitlesAsAngularDirective = false);
return "<h2 id='topApiRef' name='topApiRef'>Quick access to API... | php | public function getApiDocumentationAsStringForDeveloperReference($outputExampleUrls = true, $prefixUrls = '')
{
list($toc, $str) = $this->generateDocumentation($outputExampleUrls, $prefixUrls, $displayTitlesAsAngularDirective = false);
return "<h2 id='topApiRef' name='topApiRef'>Quick access to API... | [
"public",
"function",
"getApiDocumentationAsStringForDeveloperReference",
"(",
"$",
"outputExampleUrls",
"=",
"true",
",",
"$",
"prefixUrls",
"=",
"''",
")",
"{",
"list",
"(",
"$",
"toc",
",",
"$",
"str",
")",
"=",
"$",
"this",
"->",
"generateDocumentation",
"... | Used on developer.piwik.org
@param bool|true $outputExampleUrls
@param string $prefixUrls
@return string | [
"Used",
"on",
"developer",
".",
"piwik",
".",
"org"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/API/DocumentationGenerator.php#L67-L74 | train | Returns the documentation for API references for developer reference | [
30522,
2270,
3853,
2131,
9331,
13820,
24894,
19304,
12054,
18886,
3070,
3877,
18697,
4135,
4842,
2890,
25523,
1006,
1002,
6434,
10288,
16613,
2571,
3126,
4877,
1027,
2995,
1010,
1002,
17576,
3126,
4877,
1027,
1005,
1005,
1007,
1063,
2862,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Bundle/WebProfilerBundle/Controller/RouterController.php | RouterController.panelAction | public function panelAction($token)
{
if (null === $this->profiler) {
throw new NotFoundHttpException('The profiler must be enabled.');
}
$this->profiler->disable();
if (null === $this->matcher || null === $this->routes) {
return new Response('The Router is ... | php | public function panelAction($token)
{
if (null === $this->profiler) {
throw new NotFoundHttpException('The profiler must be enabled.');
}
$this->profiler->disable();
if (null === $this->matcher || null === $this->routes) {
return new Response('The Router is ... | [
"public",
"function",
"panelAction",
"(",
"$",
"token",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"profiler",
")",
"{",
"throw",
"new",
"NotFoundHttpException",
"(",
"'The profiler must be enabled.'",
")",
";",
"}",
"$",
"this",
"->",
"profiler"... | Renders the profiler panel for the given token.
@param string $token The profiler token
@return Response A Response instance
@throws NotFoundHttpException | [
"Renders",
"the",
"profiler",
"panel",
"for",
"the",
"given",
"token",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bundle/WebProfilerBundle/Controller/RouterController.php#L54-L76 | train | Renders the router panel | [
30522,
2270,
3853,
5997,
18908,
3258,
1006,
1002,
19204,
1007,
1063,
2065,
1006,
19701,
1027,
1027,
1027,
1002,
2023,
1011,
1028,
6337,
2099,
1007,
1063,
5466,
2047,
2025,
14876,
8630,
11039,
25856,
10288,
24422,
1006,
1005,
1996,
6337,
209... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Middleware/Permission.php | Permission.checkRoutePermission | public function checkRoutePermission(Request $request)
{
if (!$middleware = collect($request->route()->middleware())->first(function ($middleware) {
return Str::startsWith($middleware, $this->middlewarePrefix);
})) {
return false;
}
$args = explode(',', str_r... | php | public function checkRoutePermission(Request $request)
{
if (!$middleware = collect($request->route()->middleware())->first(function ($middleware) {
return Str::startsWith($middleware, $this->middlewarePrefix);
})) {
return false;
}
$args = explode(',', str_r... | [
"public",
"function",
"checkRoutePermission",
"(",
"Request",
"$",
"request",
")",
"{",
"if",
"(",
"!",
"$",
"middleware",
"=",
"collect",
"(",
"$",
"request",
"->",
"route",
"(",
")",
"->",
"middleware",
"(",
")",
")",
"->",
"first",
"(",
"function",
... | If the route of current request contains a middleware prefixed with 'admin.permission:',
then it has a manually set permission middleware, we need to handle it first.
@param Request $request
@return bool | [
"If",
"the",
"route",
"of",
"current",
"request",
"contains",
"a",
"middleware",
"prefixed",
"with",
"admin",
".",
"permission",
":",
"then",
"it",
"has",
"a",
"manually",
"set",
"permission",
"middleware",
"we",
"need",
"to",
"handle",
"it",
"first",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Middleware/Permission.php#L53-L72 | train | Check if the route has permission | [
30522,
2270,
3853,
4638,
22494,
2618,
4842,
25481,
1006,
5227,
1002,
5227,
1007,
1063,
2065,
1006,
999,
1002,
2690,
8059,
1027,
8145,
1006,
1002,
5227,
1011,
1028,
2799,
1006,
1007,
1011,
1028,
2690,
8059,
1006,
1007,
1007,
1011,
1028,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Form/FormRenderer.php | FormRenderer.setTheme | public function setTheme(FormView $view, $themes, $useDefaultThemes = true)
{
$this->engine->setTheme($view, $themes, $useDefaultThemes);
} | php | public function setTheme(FormView $view, $themes, $useDefaultThemes = true)
{
$this->engine->setTheme($view, $themes, $useDefaultThemes);
} | [
"public",
"function",
"setTheme",
"(",
"FormView",
"$",
"view",
",",
"$",
"themes",
",",
"$",
"useDefaultThemes",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"engine",
"->",
"setTheme",
"(",
"$",
"view",
",",
"$",
"themes",
",",
"$",
"useDefaultThemes",
... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/FormRenderer.php#L51-L54 | train | Set the theme of the form | [
30522,
2270,
3853,
2275,
10760,
4168,
1006,
2433,
8584,
1002,
3193,
1010,
1002,
6991,
1010,
1002,
2109,
12879,
23505,
10760,
7834,
1027,
2995,
1007,
1063,
1002,
2023,
1011,
1028,
3194,
1011,
1028,
2275,
10760,
4168,
1006,
1002,
3193,
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... |
dompdf/dompdf | lib/html5lib/Tokenizer.php | HTML5_Tokenizer.parse | public function parse() {
// Current state
$state = 'data';
// This is used to avoid having to have look-behind in the data state.
$lastFourChars = '';
/**
* Escape flag as specified by the HTML5 specification: "used to
* control the behavior of the tokeniser. I... | php | public function parse() {
// Current state
$state = 'data';
// This is used to avoid having to have look-behind in the data state.
$lastFourChars = '';
/**
* Escape flag as specified by the HTML5 specification: "used to
* control the behavior of the tokeniser. I... | [
"public",
"function",
"parse",
"(",
")",
"{",
"// Current state",
"$",
"state",
"=",
"'data'",
";",
"// This is used to avoid having to have look-behind in the data state.",
"$",
"lastFourChars",
"=",
"''",
";",
"/**\n * Escape flag as specified by the HTML5 specification... | Performs the actual parsing of the document. | [
"Performs",
"the",
"actual",
"parsing",
"of",
"the",
"document",
"."
] | 75f13c700009be21a1965dc2c5b68a8708c22ba2 | https://github.com/dompdf/dompdf/blob/75f13c700009be21a1965dc2c5b68a8708c22ba2/lib/html5lib/Tokenizer.php#L121-L2113 | train | Parse the input stream and return the tokens | [
30522,
2270,
3853,
11968,
3366,
1006,
1007,
1063,
1013,
1013,
2783,
2110,
1002,
2110,
1027,
1005,
2951,
1005,
1025,
1013,
1013,
2023,
2003,
2109,
2000,
4468,
2383,
2000,
2031,
2298,
1011,
2369,
1999,
1996,
2951,
2110,
1012,
1002,
2197,
14... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/DependencyInjection/Compiler/ResolveBindingsPass.php | ResolveBindingsPass.process | public function process(ContainerBuilder $container)
{
$this->usedBindings = $container->getRemovedBindingIds();
try {
parent::process($container);
foreach ($this->unusedBindings as list($key, $serviceId, $bindingType, $file)) {
$argumentType = $argumentName... | php | public function process(ContainerBuilder $container)
{
$this->usedBindings = $container->getRemovedBindingIds();
try {
parent::process($container);
foreach ($this->unusedBindings as list($key, $serviceId, $bindingType, $file)) {
$argumentType = $argumentName... | [
"public",
"function",
"process",
"(",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"this",
"->",
"usedBindings",
"=",
"$",
"container",
"->",
"getRemovedBindingIds",
"(",
")",
";",
"try",
"{",
"parent",
"::",
"process",
"(",
"$",
"container",
")",
... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/DependencyInjection/Compiler/ResolveBindingsPass.php#L35-L88 | train | Process the ContainerBuilder and add the bindings to the list of used bindings | [
30522,
2270,
3853,
2832,
1006,
11661,
8569,
23891,
2099,
1002,
11661,
1007,
1063,
1002,
2023,
1011,
1028,
2109,
8428,
4667,
2015,
1027,
1002,
11661,
1011,
1028,
2131,
28578,
21818,
18939,
22254,
2075,
9821,
1006,
1007,
1025,
3046,
1063,
668... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Constraints/FormValidator.php | FormValidator.validate | public function validate($form, Constraint $formConstraint)
{
if (!$formConstraint instanceof Form) {
throw new UnexpectedTypeException($formConstraint, __NAMESPACE__.'\Form');
}
if (!$form instanceof FormInterface) {
return;
}
/* @var FormInterface ... | php | public function validate($form, Constraint $formConstraint)
{
if (!$formConstraint instanceof Form) {
throw new UnexpectedTypeException($formConstraint, __NAMESPACE__.'\Form');
}
if (!$form instanceof FormInterface) {
return;
}
/* @var FormInterface ... | [
"public",
"function",
"validate",
"(",
"$",
"form",
",",
"Constraint",
"$",
"formConstraint",
")",
"{",
"if",
"(",
"!",
"$",
"formConstraint",
"instanceof",
"Form",
")",
"{",
"throw",
"new",
"UnexpectedTypeException",
"(",
"$",
"formConstraint",
",",
"__NAMESP... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/Extension/Validator/Constraints/FormValidator.php#L29-L146 | train | Validate the form data against the constraints defined in the form constraint | [
30522,
2270,
3853,
9398,
3686,
1006,
1002,
2433,
1010,
27142,
1002,
2433,
8663,
20528,
18447,
1007,
1063,
2065,
1006,
999,
1002,
2433,
8663,
20528,
18447,
6013,
11253,
2433,
1007,
1063,
5466,
2047,
9223,
13874,
10288,
24422,
1006,
1002,
243... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Bridge/ProxyManager/LazyProxy/PhpDumper/LazyLoadingValueHolderGenerator.php | LazyLoadingValueHolderGenerator.generate | public function generate(\ReflectionClass $originalClass, ClassGenerator $classGenerator)
{
parent::generate($originalClass, $classGenerator);
foreach ($classGenerator->getMethods() as $method) {
$body = preg_replace(
'/(\$this->initializer[0-9a-f]++) && \1->__invoke\(\$... | php | public function generate(\ReflectionClass $originalClass, ClassGenerator $classGenerator)
{
parent::generate($originalClass, $classGenerator);
foreach ($classGenerator->getMethods() as $method) {
$body = preg_replace(
'/(\$this->initializer[0-9a-f]++) && \1->__invoke\(\$... | [
"public",
"function",
"generate",
"(",
"\\",
"ReflectionClass",
"$",
"originalClass",
",",
"ClassGenerator",
"$",
"classGenerator",
")",
"{",
"parent",
"::",
"generate",
"(",
"$",
"originalClass",
",",
"$",
"classGenerator",
")",
";",
"foreach",
"(",
"$",
"cla... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bridge/ProxyManager/LazyProxy/PhpDumper/LazyLoadingValueHolderGenerator.php#L33-L102 | train | Generates the code for the class | [
30522,
2270,
3853,
9699,
1006,
1032,
9185,
26266,
1002,
2434,
26266,
1010,
2465,
6914,
6906,
4263,
1002,
2465,
6914,
6906,
4263,
1007,
1063,
6687,
1024,
1024,
9699,
1006,
1002,
2434,
26266,
1010,
1002,
2465,
6914,
6906,
4263,
1007,
1025,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/Zend/Db/Adapter/Pdo/Ibm/Ids.php | Zend_Db_Adapter_Pdo_Ibm_Ids.describeTable | public function describeTable($tableName, $schemaName = null)
{
// this is still a work in progress
$sql= "SELECT DISTINCT t.owner, t.tabname, c.colname, c.colno, c.coltype,
d.default, c.collength, t.tabid
FROM syscolumns c
JOIN systables t ON c.tabid = ... | php | public function describeTable($tableName, $schemaName = null)
{
// this is still a work in progress
$sql= "SELECT DISTINCT t.owner, t.tabname, c.colname, c.colno, c.coltype,
d.default, c.collength, t.tabid
FROM syscolumns c
JOIN systables t ON c.tabid = ... | [
"public",
"function",
"describeTable",
"(",
"$",
"tableName",
",",
"$",
"schemaName",
"=",
"null",
")",
"{",
"// this is still a work in progress",
"$",
"sql",
"=",
"\"SELECT DISTINCT t.owner, t.tabname, c.colname, c.colno, c.coltype,\n d.default, c.collength, t.tabid... | IDS catalog lookup for describe table
@param string $tableName
@param string $schemaName OPTIONAL
@return array | [
"IDS",
"catalog",
"lookup",
"for",
"describe",
"table"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Adapter/Pdo/Ibm/Ids.php#L78-L152 | train | Describes a table | [
30522,
2270,
3853,
6235,
10880,
1006,
1002,
2795,
18442,
1010,
1002,
8040,
28433,
18442,
1027,
19701,
1007,
1063,
1013,
1013,
2023,
2003,
2145,
1037,
2147,
1999,
5082,
1002,
29296,
1027,
1000,
7276,
5664,
1056,
1012,
3954,
1010,
1056,
1012,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/PropertyAccess/PropertyAccessor.php | PropertyAccessor.writeProperty | private function writeProperty($zval, $property, $value)
{
if (!\is_object($zval[self::VALUE])) {
throw new NoSuchPropertyException(sprintf('Cannot write property "%s" to an array. Maybe you should write the property path as "[%1$s]" instead?', $property));
}
$object = $zval[sel... | php | private function writeProperty($zval, $property, $value)
{
if (!\is_object($zval[self::VALUE])) {
throw new NoSuchPropertyException(sprintf('Cannot write property "%s" to an array. Maybe you should write the property path as "[%1$s]" instead?', $property));
}
$object = $zval[sel... | [
"private",
"function",
"writeProperty",
"(",
"$",
"zval",
",",
"$",
"property",
",",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"\\",
"is_object",
"(",
"$",
"zval",
"[",
"self",
"::",
"VALUE",
"]",
")",
")",
"{",
"throw",
"new",
"NoSuchPropertyException",... | Sets the value of a property in the given object.
@param array $zval The array containing the object to write to
@param string $property The property to write
@param mixed $value The value to write
@throws NoSuchPropertyException if the property does not exist or is not public | [
"Sets",
"the",
"value",
"of",
"a",
"property",
"in",
"the",
"given",
"object",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/PropertyAccess/PropertyAccessor.php#L540-L570 | train | Write a property to an object | [
30522,
2797,
3853,
4339,
21572,
4842,
3723,
1006,
1002,
1062,
10175,
1010,
1002,
3200,
1010,
1002,
3643,
1007,
1063,
2065,
1006,
999,
1032,
2003,
1035,
4874,
1006,
1002,
1062,
10175,
1031,
2969,
1024,
1024,
3643,
1033,
1007,
1007,
1063,
5... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.findRoute | protected function findRoute($request)
{
$this->current = $route = $this->routes->match($request);
$this->container->instance(Route::class, $route);
return $route;
} | php | protected function findRoute($request)
{
$this->current = $route = $this->routes->match($request);
$this->container->instance(Route::class, $route);
return $route;
} | [
"protected",
"function",
"findRoute",
"(",
"$",
"request",
")",
"{",
"$",
"this",
"->",
"current",
"=",
"$",
"route",
"=",
"$",
"this",
"->",
"routes",
"->",
"match",
"(",
"$",
"request",
")",
";",
"$",
"this",
"->",
"container",
"->",
"instance",
"(... | Find the route matching a given request.
@param \Illuminate\Http\Request $request
@return \Illuminate\Routing\Route | [
"Find",
"the",
"route",
"matching",
"a",
"given",
"request",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/Router.php#L632-L639 | train | Find route by request | [
30522,
5123,
3853,
2424,
22494,
2618,
1006,
1002,
5227,
1007,
1063,
1002,
2023,
1011,
1028,
2783,
1027,
1002,
2799,
1027,
1002,
2023,
1011,
1028,
5847,
1011,
1028,
2674,
1006,
1002,
5227,
1007,
1025,
1002,
2023,
1011,
1028,
11661,
1011,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/backend/widgets/Form.php | Form.removeField | public function removeField($name)
{
if (!isset($this->allFields[$name])) {
return false;
}
/*
* Remove from tabs
*/
$this->allTabs->primary->removeField($name);
$this->allTabs->secondary->removeField($name);
$this->allTabs->outside->rem... | php | public function removeField($name)
{
if (!isset($this->allFields[$name])) {
return false;
}
/*
* Remove from tabs
*/
$this->allTabs->primary->removeField($name);
$this->allTabs->secondary->removeField($name);
$this->allTabs->outside->rem... | [
"public",
"function",
"removeField",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"allFields",
"[",
"$",
"name",
"]",
")",
")",
"{",
"return",
"false",
";",
"}",
"/*\n * Remove from tabs\n */",
"$",
"this",
... | Programatically remove a field.
@param string $name
@return bool | [
"Programatically",
"remove",
"a",
"field",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/Form.php#L738-L757 | train | Remove a field from the main collection | [
30522,
2270,
3853,
6366,
3790,
1006,
1002,
2171,
1007,
1063,
2065,
1006,
999,
26354,
3388,
1006,
1002,
2023,
1011,
1028,
2035,
15155,
1031,
1002,
2171,
1033,
1007,
1007,
1063,
2709,
6270,
1025,
1065,
1013,
1008,
1008,
6366,
2013,
21628,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/Zend/Db/Statement/Sqlsrv.php | Zend_Db_Statement_Sqlsrv.errorInfo | public function errorInfo()
{
if (!$this->_stmt) {
return false;
}
$error = sqlsrv_errors();
if (!$error) {
return false;
}
return array(
$error[0]['code'],
$error[0]['message'],
);
} | php | public function errorInfo()
{
if (!$this->_stmt) {
return false;
}
$error = sqlsrv_errors();
if (!$error) {
return false;
}
return array(
$error[0]['code'],
$error[0]['message'],
);
} | [
"public",
"function",
"errorInfo",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_stmt",
")",
"{",
"return",
"false",
";",
"}",
"$",
"error",
"=",
"sqlsrv_errors",
"(",
")",
";",
"if",
"(",
"!",
"$",
"error",
")",
"{",
"return",
"false",
";"... | Retrieves an array of error information, if any, associated with the
last operation on the statement handle.
@return array | [
"Retrieves",
"an",
"array",
"of",
"error",
"information",
"if",
"any",
"associated",
"with",
"the",
"last",
"operation",
"on",
"the",
"statement",
"handle",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Statement/Sqlsrv.php#L152-L167 | train | Returns the error codes and message from the last sqlsrv_errors call | [
30522,
2270,
3853,
7561,
2378,
14876,
1006,
1007,
1063,
2065,
1006,
999,
1002,
2023,
1011,
1028,
1035,
2358,
20492,
1007,
1063,
2709,
6270,
1025,
1065,
1002,
7561,
1027,
29296,
21338,
2615,
1035,
10697,
1006,
1007,
1025,
2065,
1006,
999,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Database/Query/Grammars/Grammar.php | Grammar.compileJoins | protected function compileJoins(Builder $query, $joins)
{
return collect($joins)->map(function ($join) use ($query) {
$table = $this->wrapTable($join->table);
$nestedJoins = is_null($join->joins) ? '' : ' '.$this->compileJoins($query, $join->joins);
$tableAndNestedJoins... | php | protected function compileJoins(Builder $query, $joins)
{
return collect($joins)->map(function ($join) use ($query) {
$table = $this->wrapTable($join->table);
$nestedJoins = is_null($join->joins) ? '' : ' '.$this->compileJoins($query, $join->joins);
$tableAndNestedJoins... | [
"protected",
"function",
"compileJoins",
"(",
"Builder",
"$",
"query",
",",
"$",
"joins",
")",
"{",
"return",
"collect",
"(",
"$",
"joins",
")",
"->",
"map",
"(",
"function",
"(",
"$",
"join",
")",
"use",
"(",
"$",
"query",
")",
"{",
"$",
"table",
... | Compile the "join" portions of the query.
@param \Illuminate\Database\Query\Builder $query
@param array $joins
@return string | [
"Compile",
"the",
"join",
"portions",
"of",
"the",
"query",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Query/Grammars/Grammar.php#L159-L170 | train | Compiles joins into a string | [
30522,
5123,
3853,
4012,
22090,
5558,
7076,
1006,
12508,
1002,
23032,
1010,
1002,
9794,
1007,
1063,
2709,
8145,
1006,
1002,
9794,
1007,
1011,
1028,
4949,
1006,
3853,
1006,
1002,
3693,
1007,
2224,
1006,
1002,
23032,
1007,
1063,
1002,
2795,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Form/Extension/Core/Type/DateTimeType.php | DateTimeType.buildView | public function buildView(FormView $view, FormInterface $form, array $options)
{
$view->vars['widget'] = $options['widget'];
// Change the input to a HTML5 datetime input if
// * the widget is set to "single_text"
// * the format matches the one expected by HTML5
// * the... | php | public function buildView(FormView $view, FormInterface $form, array $options)
{
$view->vars['widget'] = $options['widget'];
// Change the input to a HTML5 datetime input if
// * the widget is set to "single_text"
// * the format matches the one expected by HTML5
// * the... | [
"public",
"function",
"buildView",
"(",
"FormView",
"$",
"view",
",",
"FormInterface",
"$",
"form",
",",
"array",
"$",
"options",
")",
"{",
"$",
"view",
"->",
"vars",
"[",
"'widget'",
"]",
"=",
"$",
"options",
"[",
"'widget'",
"]",
";",
"// Change the in... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/Extension/Core/Type/DateTimeType.php#L199-L210 | train | This method is used to set the variables needed by the view. | [
30522,
2270,
3853,
3857,
8584,
1006,
2433,
8584,
1002,
3193,
1010,
2433,
18447,
2121,
12172,
1002,
2433,
1010,
9140,
1002,
7047,
1007,
1063,
1002,
3193,
1011,
1028,
13075,
2015,
1031,
1005,
15536,
24291,
1005,
1033,
1027,
1002,
7047,
1031,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/Tracker.php | Tracker.disconnectCachedDbConnection | public static function disconnectCachedDbConnection()
{
// code redundancy w/ above is on purpose; above disconnectDatabase depends on method that can potentially be overridden
if (!is_null(self::$db)) {
self::$db->disconnect();
self::$db = null;
}
} | php | public static function disconnectCachedDbConnection()
{
// code redundancy w/ above is on purpose; above disconnectDatabase depends on method that can potentially be overridden
if (!is_null(self::$db)) {
self::$db->disconnect();
self::$db = null;
}
} | [
"public",
"static",
"function",
"disconnectCachedDbConnection",
"(",
")",
"{",
"// code redundancy w/ above is on purpose; above disconnectDatabase depends on method that can potentially be overridden",
"if",
"(",
"!",
"is_null",
"(",
"self",
"::",
"$",
"db",
")",
")",
"{",
"... | for tests | [
"for",
"tests"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Tracker.php#L228-L235 | train | Disconnects the cached database connection | [
30522,
2270,
10763,
3853,
12532,
10087,
6593,
3540,
7690,
18939,
8663,
2638,
7542,
1006,
1007,
1063,
1013,
1013,
3642,
2417,
18426,
9407,
1059,
1013,
2682,
2003,
2006,
3800,
1025,
2682,
12532,
10087,
6593,
2850,
2696,
15058,
9041,
2006,
411... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
z-song/laravel-admin | src/Form/EmbeddedForm.php | EmbeddedForm.formatField | protected function formatField(Field $field)
{
$jsonKey = $field->column();
$elementName = $elementClass = $errorKey = [];
if (is_array($jsonKey)) {
foreach ($jsonKey as $index => $name) {
$elementName[$index] = "{$this->column}[$name]";
$errorKe... | php | protected function formatField(Field $field)
{
$jsonKey = $field->column();
$elementName = $elementClass = $errorKey = [];
if (is_array($jsonKey)) {
foreach ($jsonKey as $index => $name) {
$elementName[$index] = "{$this->column}[$name]";
$errorKe... | [
"protected",
"function",
"formatField",
"(",
"Field",
"$",
"field",
")",
"{",
"$",
"jsonKey",
"=",
"$",
"field",
"->",
"column",
"(",
")",
";",
"$",
"elementName",
"=",
"$",
"elementClass",
"=",
"$",
"errorKey",
"=",
"[",
"]",
";",
"if",
"(",
"is_arr... | Format form, set `element name` `error key` and `element class`.
@param Field $field
@return Field | [
"Format",
"form",
"set",
"element",
"name",
"error",
"key",
"and",
"element",
"class",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Form/EmbeddedForm.php#L217-L240 | train | Format field to array | [
30522,
5123,
3853,
4289,
3790,
1006,
2492,
1002,
2492,
1007,
1063,
1002,
1046,
3385,
14839,
1027,
1002,
2492,
1011,
1028,
5930,
1006,
1007,
1025,
1002,
5783,
18442,
1027,
1002,
5783,
30524,
1007,
1007,
1063,
18921,
6776,
1006,
1002,
1046,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Translation/TranslationServiceProvider.php | TranslationServiceProvider.register | public function register()
{
$this->registerLoader();
$this->app->singleton('translator', function ($app) {
$loader = $app['translation.loader'];
// When registering the translator component, we'll need to set the default
// locale as well as the fallback locale... | php | public function register()
{
$this->registerLoader();
$this->app->singleton('translator', function ($app) {
$loader = $app['translation.loader'];
// When registering the translator component, we'll need to set the default
// locale as well as the fallback locale... | [
"public",
"function",
"register",
"(",
")",
"{",
"$",
"this",
"->",
"registerLoader",
"(",
")",
";",
"$",
"this",
"->",
"app",
"->",
"singleton",
"(",
"'translator'",
",",
"function",
"(",
"$",
"app",
")",
"{",
"$",
"loader",
"=",
"$",
"app",
"[",
... | Register the service provider.
@return void | [
"Register",
"the",
"service",
"provider",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Translation/TranslationServiceProvider.php#L15-L33 | train | Registers the translator component | [
30522,
2270,
3853,
4236,
1006,
1007,
1063,
1002,
2023,
1011,
1028,
4236,
11066,
2121,
1006,
1007,
1025,
1002,
2023,
1011,
1028,
10439,
1011,
1028,
28159,
1006,
1005,
11403,
1005,
1010,
3853,
1006,
1002,
10439,
1007,
1063,
1002,
7170,
2121,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.query | public function query($id = null, $raw = false)
{
if ($id !== null) {
return $this->queries[$id] ?? null;
}
if ($raw) {
return $this->queries;
}
if (!$this->queries) {
return '';
}
return http_build_query($this->queries);... | php | public function query($id = null, $raw = false)
{
if ($id !== null) {
return $this->queries[$id] ?? null;
}
if ($raw) {
return $this->queries;
}
if (!$this->queries) {
return '';
}
return http_build_query($this->queries);... | [
"public",
"function",
"query",
"(",
"$",
"id",
"=",
"null",
",",
"$",
"raw",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"id",
"!==",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"queries",
"[",
"$",
"id",
"]",
"??",
"null",
";",
"}",
"if",
"("... | Return full query string or a single query attribute.
@param string $id Optional attribute. Get a single query attribute if set
@param bool $raw If true and $id is not set, return the full query array. Otherwise return the query string
@return string|array Returns an array if $id = null and $raw = true | [
"Return",
"full",
"query",
"string",
"or",
"a",
"single",
"query",
"attribute",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Uri.php#L249-L264 | train | Get Query String | [
30522,
2270,
3853,
23032,
1006,
1002,
8909,
1027,
19701,
1010,
1002,
6315,
1027,
6270,
1007,
1063,
2065,
1006,
1002,
8909,
999,
1027,
1027,
19701,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
10861,
5134,
1031,
1002,
8909,
1033,
1029,
1029,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/API.php | API.getReportMetadata | public function getReportMetadata($idSites = '', $period = false, $date = false, $hideMetricsDoc = false,
$showSubtableReports = false, $idSite = false)
{
if (empty($idSite) && !empty($idSites)) {
if (is_array($idSites)) {
$idSite = array_shi... | php | public function getReportMetadata($idSites = '', $period = false, $date = false, $hideMetricsDoc = false,
$showSubtableReports = false, $idSite = false)
{
if (empty($idSite) && !empty($idSites)) {
if (is_array($idSites)) {
$idSite = array_shi... | [
"public",
"function",
"getReportMetadata",
"(",
"$",
"idSites",
"=",
"''",
",",
"$",
"period",
"=",
"false",
",",
"$",
"date",
"=",
"false",
",",
"$",
"hideMetricsDoc",
"=",
"false",
",",
"$",
"showSubtableReports",
"=",
"false",
",",
"$",
"idSite",
"=",... | Triggers a hook to ask plugins for available Reports.
Returns metadata information about each report (category, name, dimension, metrics, etc.)
@param string $idSites THIS PARAMETER IS DEPRECATED AND WILL BE REMOVED IN PIWIK 4
@param bool|string $period
@param bool|Date $date
@param bool $hideMetricsDoc
@param bool $s... | [
"Triggers",
"a",
"hook",
"to",
"ask",
"plugins",
"for",
"available",
"Reports",
".",
"Returns",
"metadata",
"information",
"about",
"each",
"report",
"(",
"category",
"name",
"dimension",
"metrics",
"etc",
".",
")"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/API/API.php#L322-L339 | train | Returns the metadata of the specified report. | [
30522,
2270,
3853,
2131,
2890,
6442,
11368,
8447,
2696,
1006,
1002,
8909,
28032,
2229,
1027,
1005,
1005,
1010,
1002,
2558,
1027,
6270,
1010,
1002,
3058,
1027,
6270,
1010,
1002,
5342,
12589,
16150,
10085,
1027,
6270,
1010,
1002,
3065,
12083,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Form/Extension/Core/Type/MoneyType.php | MoneyType.buildForm | public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->addViewTransformer(new MoneyToLocalizedStringTransformer(
$options['scale'],
$options['grouping'],
$options['rounding_mode'],
$options['divisor']
... | php | public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->addViewTransformer(new MoneyToLocalizedStringTransformer(
$options['scale'],
$options['grouping'],
$options['rounding_mode'],
$options['divisor']
... | [
"public",
"function",
"buildForm",
"(",
"FormBuilderInterface",
"$",
"builder",
",",
"array",
"$",
"options",
")",
"{",
"$",
"builder",
"->",
"addViewTransformer",
"(",
"new",
"MoneyToLocalizedStringTransformer",
"(",
"$",
"options",
"[",
"'scale'",
"]",
",",
"$... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/Extension/Core/Type/MoneyType.php#L29-L39 | train | Adds the view transformers to the form builder | [
30522,
2270,
3853,
3857,
14192,
1006,
2433,
8569,
23891,
6657,
3334,
12172,
1002,
12508,
1010,
9140,
1002,
7047,
1007,
1063,
1002,
12508,
1011,
1028,
5587,
8584,
6494,
3619,
14192,
2121,
1006,
2047,
2769,
3406,
4135,
9289,
3550,
3367,
4892,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Cookie/FileCookieJar.php | FileCookieJar.load | public function load($filename)
{
$json = file_get_contents($filename);
if (false === $json) {
throw new \RuntimeException("Unable to load file {$filename}");
} elseif ($json === '') {
return;
}
$data = \GuzzleHttp\json_decode($json, true);
if... | php | public function load($filename)
{
$json = file_get_contents($filename);
if (false === $json) {
throw new \RuntimeException("Unable to load file {$filename}");
} elseif ($json === '') {
return;
}
$data = \GuzzleHttp\json_decode($json, true);
if... | [
"public",
"function",
"load",
"(",
"$",
"filename",
")",
"{",
"$",
"json",
"=",
"file_get_contents",
"(",
"$",
"filename",
")",
";",
"if",
"(",
"false",
"===",
"$",
"json",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"\"Unable to load file {$f... | Load cookies from a JSON formatted file.
Old cookies are kept unless overwritten by newly loaded ones.
@param string $filename Cookie file to load.
@throws \RuntimeException if the file cannot be loaded. | [
"Load",
"cookies",
"from",
"a",
"JSON",
"formatted",
"file",
"."
] | bf595424e4d442a190582e088985dc835a789071 | https://github.com/guzzle/guzzle/blob/bf595424e4d442a190582e088985dc835a789071/src/Cookie/FileCookieJar.php#L72-L89 | train | Load the cookies from a JSON file | [
30522,
2270,
3853,
7170,
1006,
1002,
5371,
18442,
1007,
1063,
1002,
1046,
3385,
1027,
5371,
1035,
2131,
1035,
8417,
1006,
1002,
5371,
18442,
1007,
1025,
2065,
1006,
6270,
1027,
1027,
1027,
1002,
1046,
3385,
1007,
1063,
5466,
2047,
1032,
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/Archive/Chunk.php | Chunk.moveArchiveBlobsIntoChunks | public function moveArchiveBlobsIntoChunks($recordName, $blobs)
{
$chunks = array();
foreach ($blobs as $tableId => $blob) {
$name = $this->getRecordNameForTableId($recordName, $tableId);
if (!array_key_exists($name, $chunks)) {
$chunks[$name] = array();
... | php | public function moveArchiveBlobsIntoChunks($recordName, $blobs)
{
$chunks = array();
foreach ($blobs as $tableId => $blob) {
$name = $this->getRecordNameForTableId($recordName, $tableId);
if (!array_key_exists($name, $chunks)) {
$chunks[$name] = array();
... | [
"public",
"function",
"moveArchiveBlobsIntoChunks",
"(",
"$",
"recordName",
",",
"$",
"blobs",
")",
"{",
"$",
"chunks",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"blobs",
"as",
"$",
"tableId",
"=>",
"$",
"blob",
")",
"{",
"$",
"name",
"=",
"$... | Moves the given blobs into chunks and assigns a proper record name containing the chunk number.
@param string $recordName The original archive record name, eg 'Actions_ActionsUrl'
@param array $blobs An array containg a mapping of tableIds to blobs. Eg array(0 => 'blob', 1 => 'subtableBlob', ...)
@return array ... | [
"Moves",
"the",
"given",
"blobs",
"into",
"chunks",
"and",
"assigns",
"a",
"proper",
"record",
"name",
"containing",
"the",
"chunk",
"number",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Archive/Chunk.php#L51-L66 | train | Move archive blobs into chunks array | [
30522,
2270,
3853,
2693,
2906,
5428,
3726,
16558,
16429,
11493,
3406,
20760,
8950,
2015,
1006,
1002,
2501,
18442,
1010,
1002,
1038,
4135,
5910,
1007,
1063,
1002,
24839,
1027,
9140,
1006,
1007,
1025,
18921,
6776,
1006,
1002,
1038,
4135,
5910... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
z-song/laravel-admin | src/Form.php | Form.resource | public function resource($slice = -2)
{
$segments = explode('/', trim(app('request')->getUri(), '/'));
if ($slice != 0) {
$segments = array_slice($segments, 0, $slice);
}
return implode('/', $segments);
} | php | public function resource($slice = -2)
{
$segments = explode('/', trim(app('request')->getUri(), '/'));
if ($slice != 0) {
$segments = array_slice($segments, 0, $slice);
}
return implode('/', $segments);
} | [
"public",
"function",
"resource",
"(",
"$",
"slice",
"=",
"-",
"2",
")",
"{",
"$",
"segments",
"=",
"explode",
"(",
"'/'",
",",
"trim",
"(",
"app",
"(",
"'request'",
")",
"->",
"getUri",
"(",
")",
",",
"'/'",
")",
")",
";",
"if",
"(",
"$",
"sli... | Get current resource route url.
@param int $slice
@return string | [
"Get",
"current",
"resource",
"route",
"url",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Form.php#L1345-L1354 | train | Get the resource path | [
30522,
2270,
3853,
7692,
1006,
1002,
14704,
1027,
1011,
1016,
1007,
1063,
1002,
9214,
1027,
15044,
1006,
1005,
1013,
1005,
1010,
12241,
1006,
10439,
1006,
1005,
5227,
1005,
1007,
1011,
1028,
2131,
9496,
1006,
1007,
1010,
1005,
1013,
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 | plugins/UsersManager/API.php | API.createTokenAuth | public function createTokenAuth($userLogin)
{
return md5($userLogin . microtime(true) . Common::generateUniqId() . SettingsPiwik::getSalt());
} | php | public function createTokenAuth($userLogin)
{
return md5($userLogin . microtime(true) . Common::generateUniqId() . SettingsPiwik::getSalt());
} | [
"public",
"function",
"createTokenAuth",
"(",
"$",
"userLogin",
")",
"{",
"return",
"md5",
"(",
"$",
"userLogin",
".",
"microtime",
"(",
"true",
")",
".",
"Common",
"::",
"generateUniqId",
"(",
")",
".",
"SettingsPiwik",
"::",
"getSalt",
"(",
")",
")",
"... | Generates a new random authentication token.
@param string $userLogin Login
@return string | [
"Generates",
"a",
"new",
"random",
"authentication",
"token",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UsersManager/API.php#L1319-L1322 | train | Generate a unique token for the user | [
30522,
2270,
3853,
3443,
18715,
8189,
14317,
1006,
1002,
5310,
21197,
2378,
1007,
1063,
2709,
9108,
2629,
1006,
1002,
5310,
21197,
2378,
1012,
12702,
7292,
1006,
2995,
1007,
1012,
2691,
1024,
1024,
9699,
19496,
14702,
2094,
1006,
1007,
1012... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
z-song/laravel-admin | src/Tree.php | Tree.variables | public function variables()
{
return [
'id' => $this->elementId,
'tools' => $this->tools->render(),
'items' => $this->getItems(),
'useCreate' => $this->useCreate,
'useSave' => $this->useSave,
'useRefresh' => $this-... | php | public function variables()
{
return [
'id' => $this->elementId,
'tools' => $this->tools->render(),
'items' => $this->getItems(),
'useCreate' => $this->useCreate,
'useSave' => $this->useSave,
'useRefresh' => $this-... | [
"public",
"function",
"variables",
"(",
")",
"{",
"return",
"[",
"'id'",
"=>",
"$",
"this",
"->",
"elementId",
",",
"'tools'",
"=>",
"$",
"this",
"->",
"tools",
"->",
"render",
"(",
")",
",",
"'items'",
"=>",
"$",
"this",
"->",
"getItems",
"(",
")",
... | Variables in tree template.
@return array | [
"Variables",
"in",
"tree",
"template",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Tree.php#L333-L343 | train | Return array of variables | [
30522,
2270,
3853,
10857,
1006,
1007,
1063,
2709,
1031,
1005,
8909,
1005,
1027,
1028,
1002,
2023,
1011,
1028,
5783,
3593,
1010,
1005,
5906,
1005,
1027,
1028,
1002,
2023,
1011,
1028,
5906,
1011,
1028,
17552,
1006,
1007,
1010,
1005,
5167,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/Tracker/GoalManager.php | GoalManager.getRevenue | protected function getRevenue($revenue)
{
if (round($revenue) != $revenue) {
$revenue = round($revenue, self::REVENUE_PRECISION);
}
$revenue = Common::forceDotAsSeparatorForDecimalPoint($revenue);
return $revenue;
} | php | protected function getRevenue($revenue)
{
if (round($revenue) != $revenue) {
$revenue = round($revenue, self::REVENUE_PRECISION);
}
$revenue = Common::forceDotAsSeparatorForDecimalPoint($revenue);
return $revenue;
} | [
"protected",
"function",
"getRevenue",
"(",
"$",
"revenue",
")",
"{",
"if",
"(",
"round",
"(",
"$",
"revenue",
")",
"!=",
"$",
"revenue",
")",
"{",
"$",
"revenue",
"=",
"round",
"(",
"$",
"revenue",
",",
"self",
"::",
"REVENUE_PRECISION",
")",
";",
"... | Returns rounded decimal revenue, or if revenue is integer, then returns as is.
@param int|float $revenue
@return int|float | [
"Returns",
"rounded",
"decimal",
"revenue",
"or",
"if",
"revenue",
"is",
"integer",
"then",
"returns",
"as",
"is",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Tracker/GoalManager.php#L270-L279 | train | Returns the revenue value | [
30522,
5123,
3853,
2131,
2890,
8159,
5657,
1006,
1002,
6599,
1007,
1063,
2065,
1006,
2461,
1006,
1002,
6599,
1007,
999,
1027,
1002,
6599,
1007,
1063,
1002,
6599,
1027,
2461,
1006,
1002,
6599,
1010,
2969,
1024,
1024,
6599,
1035,
11718,
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... |
getgrav/grav | system/src/Grav/Console/ConsoleTrait.php | ConsoleTrait.clearCache | public function clearCache($all = [])
{
if ($all) {
$all = ['--all' => true];
}
$command = new ClearCacheCommand();
$input = new ArrayInput($all);
return $command->run($input, $this->output);
} | php | public function clearCache($all = [])
{
if ($all) {
$all = ['--all' => true];
}
$command = new ClearCacheCommand();
$input = new ArrayInput($all);
return $command->run($input, $this->output);
} | [
"public",
"function",
"clearCache",
"(",
"$",
"all",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"$",
"all",
")",
"{",
"$",
"all",
"=",
"[",
"'--all'",
"=>",
"true",
"]",
";",
"}",
"$",
"command",
"=",
"new",
"ClearCacheCommand",
"(",
")",
";",
"$",
"i... | @param array $all
@return int
@throws \Exception | [
"@param",
"array",
"$all"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Console/ConsoleTrait.php#L104-L113 | train | Clear cache of all languages | [
30522,
2270,
3853,
3154,
3540,
5403,
1006,
1002,
2035,
1027,
1031,
1033,
1007,
1063,
2065,
1006,
1002,
2035,
1007,
1063,
1002,
2035,
1027,
1031,
1005,
1011,
1011,
2035,
1005,
1027,
1028,
2995,
1033,
1025,
1065,
1002,
3094,
1027,
2047,
315... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/system/traits/ViewMaker.php | ViewMaker.makeViewContent | public function makeViewContent($contents, $layout = null)
{
if ($this->suppressLayout || $this->layout == '') {
return $contents;
}
// Append any undefined block content to the body block
Block::set('undefinedBlock', $contents);
Block::append('body', Block::get(... | php | public function makeViewContent($contents, $layout = null)
{
if ($this->suppressLayout || $this->layout == '') {
return $contents;
}
// Append any undefined block content to the body block
Block::set('undefinedBlock', $contents);
Block::append('body', Block::get(... | [
"public",
"function",
"makeViewContent",
"(",
"$",
"contents",
",",
"$",
"layout",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"suppressLayout",
"||",
"$",
"this",
"->",
"layout",
"==",
"''",
")",
"{",
"return",
"$",
"contents",
";",
"}",
"/... | Renders supplied contents inside a layout.
@param string $contents The inner contents as a string.
@param string $layout Specifies the layout name.
@return string | [
"Renders",
"supplied",
"contents",
"inside",
"a",
"layout",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/traits/ViewMaker.php#L119-L129 | train | Make view content | [
30522,
2270,
3853,
2191,
8584,
8663,
6528,
2102,
1006,
1002,
8417,
1010,
1002,
9621,
1027,
19701,
1007,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
16081,
8485,
5833,
1064,
1064,
1002,
2023,
1011,
1028,
9621,
1027,
1027,
1005,
1005,
1007,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Queue/Queue.php | Queue.bulk | public function bulk($jobs, $data = '', $queue = null)
{
foreach ((array) $jobs as $job) {
$this->push($job, $data, $queue);
}
} | php | public function bulk($jobs, $data = '', $queue = null)
{
foreach ((array) $jobs as $job) {
$this->push($job, $data, $queue);
}
} | [
"public",
"function",
"bulk",
"(",
"$",
"jobs",
",",
"$",
"data",
"=",
"''",
",",
"$",
"queue",
"=",
"null",
")",
"{",
"foreach",
"(",
"(",
"array",
")",
"$",
"jobs",
"as",
"$",
"job",
")",
"{",
"$",
"this",
"->",
"push",
"(",
"$",
"job",
","... | Push an array of jobs onto the queue.
@param array $jobs
@param mixed $data
@param string $queue
@return void | [
"Push",
"an",
"array",
"of",
"jobs",
"onto",
"the",
"queue",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Queue/Queue.php#L69-L74 | train | Pushes multiple jobs to the queue | [
30522,
2270,
3853,
9625,
1006,
1002,
5841,
1010,
1002,
2951,
1027,
1005,
1005,
1010,
1002,
24240,
1027,
19701,
1007,
1063,
18921,
6776,
1006,
1006,
9140,
1007,
1002,
5841,
2004,
1002,
3105,
1007,
1063,
1002,
2023,
1011,
1028,
5245,
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/Support/InteractsWithTime.php | InteractsWithTime.availableAt | protected function availableAt($delay = 0)
{
$delay = $this->parseDateInterval($delay);
return $delay instanceof DateTimeInterface
? $delay->getTimestamp()
: Carbon::now()->addRealSeconds($delay)->getTimestamp();
} | php | protected function availableAt($delay = 0)
{
$delay = $this->parseDateInterval($delay);
return $delay instanceof DateTimeInterface
? $delay->getTimestamp()
: Carbon::now()->addRealSeconds($delay)->getTimestamp();
} | [
"protected",
"function",
"availableAt",
"(",
"$",
"delay",
"=",
"0",
")",
"{",
"$",
"delay",
"=",
"$",
"this",
"->",
"parseDateInterval",
"(",
"$",
"delay",
")",
";",
"return",
"$",
"delay",
"instanceof",
"DateTimeInterface",
"?",
"$",
"delay",
"->",
"ge... | Get the "available at" UNIX timestamp.
@param \DateTimeInterface|\DateInterval|int $delay
@return int | [
"Get",
"the",
"available",
"at",
"UNIX",
"timestamp",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Support/InteractsWithTime.php#L31-L38 | train | Get the timestamp of the available at | [
30522,
5123,
3853,
2800,
4017,
1006,
1002,
8536,
1027,
1014,
1007,
1063,
1002,
8536,
1027,
1002,
2023,
1011,
1028,
11968,
6924,
3686,
18447,
2121,
10175,
1006,
1002,
8536,
1007,
1025,
2709,
1002,
8536,
6013,
11253,
3058,
7292,
18447,
2121,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Controller.php | Controller.initCustomObjects | protected function initCustomObjects()
{
$this->layoutObj = null;
if (!$this->layout->isFallBack()) {
CmsException::mask($this->layout, 300);
$parser = new CodeParser($this->layout);
$this->layoutObj = $parser->source($this->page, $this->layout, $this);
... | php | protected function initCustomObjects()
{
$this->layoutObj = null;
if (!$this->layout->isFallBack()) {
CmsException::mask($this->layout, 300);
$parser = new CodeParser($this->layout);
$this->layoutObj = $parser->source($this->page, $this->layout, $this);
... | [
"protected",
"function",
"initCustomObjects",
"(",
")",
"{",
"$",
"this",
"->",
"layoutObj",
"=",
"null",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"layout",
"->",
"isFallBack",
"(",
")",
")",
"{",
"CmsException",
"::",
"mask",
"(",
"$",
"this",
"->",
... | Initializes the custom layout and page objects.
@return void | [
"Initializes",
"the",
"custom",
"layout",
"and",
"page",
"objects",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/Controller.php#L622-L637 | train | Initialize custom objects | [
30522,
5123,
3853,
1999,
4183,
7874,
20389,
16429,
20614,
2015,
1006,
1007,
1063,
1002,
2023,
1011,
1028,
9621,
16429,
3501,
1027,
19701,
1025,
2065,
1006,
999,
1002,
2023,
1011,
1028,
9621,
1011,
1028,
2003,
13976,
5963,
1006,
1007,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Auth/Passwords/PasswordBroker.php | PasswordBroker.validateNewPassword | public function validateNewPassword(array $credentials)
{
if (isset($this->passwordValidator)) {
[$password, $confirm] = [
$credentials['password'],
$credentials['password_confirmation'],
];
return call_user_func(
$this->pa... | php | public function validateNewPassword(array $credentials)
{
if (isset($this->passwordValidator)) {
[$password, $confirm] = [
$credentials['password'],
$credentials['password_confirmation'],
];
return call_user_func(
$this->pa... | [
"public",
"function",
"validateNewPassword",
"(",
"array",
"$",
"credentials",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"passwordValidator",
")",
")",
"{",
"[",
"$",
"password",
",",
"$",
"confirm",
"]",
"=",
"[",
"$",
"credentials",
"[",
... | Determine if the passwords match for the request.
@param array $credentials
@return bool | [
"Determine",
"if",
"the",
"passwords",
"match",
"for",
"the",
"request",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Auth/Passwords/PasswordBroker.php#L146-L160 | train | Validate new password | [
30522,
2270,
3853,
9398,
3686,
2638,
2860,
15194,
18351,
1006,
9140,
1002,
22496,
1007,
1063,
2065,
1006,
26354,
3388,
1006,
1002,
2023,
1011,
1028,
20786,
10175,
8524,
4263,
1007,
1007,
1063,
1031,
1002,
20786,
1010,
1002,
12210,
1033,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/HttpKernel/Profiler/FileProfilerStorage.php | FileProfilerStorage.readLineFromFile | protected function readLineFromFile($file)
{
$line = '';
$position = ftell($file);
if (0 === $position) {
return;
}
while (true) {
$chunkSize = min($position, 1024);
$position -= $chunkSize;
fseek($file, $position);
... | php | protected function readLineFromFile($file)
{
$line = '';
$position = ftell($file);
if (0 === $position) {
return;
}
while (true) {
$chunkSize = min($position, 1024);
$position -= $chunkSize;
fseek($file, $position);
... | [
"protected",
"function",
"readLineFromFile",
"(",
"$",
"file",
")",
"{",
"$",
"line",
"=",
"''",
";",
"$",
"position",
"=",
"ftell",
"(",
"$",
"file",
")",
";",
"if",
"(",
"0",
"===",
"$",
"position",
")",
"{",
"return",
";",
"}",
"while",
"(",
"... | Reads a line in the file, backward.
This function automatically skips the empty lines and do not include the line return in result value.
@param resource $file The file resource, with the pointer placed at the end of the line to read
@return mixed A string representing the line or null if beginning of file is reache... | [
"Reads",
"a",
"line",
"in",
"the",
"file",
"backward",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpKernel/Profiler/FileProfilerStorage.php#L224-L260 | train | Read a line from a file | [
30522,
5123,
3853,
3191,
4179,
19699,
5358,
8873,
2571,
1006,
1002,
5371,
1007,
1063,
1002,
2240,
1027,
1005,
1005,
1025,
1002,
2597,
1027,
3027,
5349,
1006,
1002,
5371,
1007,
1025,
2065,
1006,
1014,
1027,
1027,
1027,
1002,
2597,
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... |
octobercms/october | modules/cms/classes/Theme.php | Theme.getPreviewImageUrl | public function getPreviewImageUrl()
{
$previewPath = $this->getConfigValue('previewImage', 'assets/images/theme-preview.png');
if (File::exists($this->getPath().'/'.$previewPath)) {
return Url::asset('themes/'.$this->getDirName().'/'.$previewPath);
}
return Url::asset(... | php | public function getPreviewImageUrl()
{
$previewPath = $this->getConfigValue('previewImage', 'assets/images/theme-preview.png');
if (File::exists($this->getPath().'/'.$previewPath)) {
return Url::asset('themes/'.$this->getDirName().'/'.$previewPath);
}
return Url::asset(... | [
"public",
"function",
"getPreviewImageUrl",
"(",
")",
"{",
"$",
"previewPath",
"=",
"$",
"this",
"->",
"getConfigValue",
"(",
"'previewImage'",
",",
"'assets/images/theme-preview.png'",
")",
";",
"if",
"(",
"File",
"::",
"exists",
"(",
"$",
"this",
"->",
"getP... | Returns the theme preview image URL.
If the image file doesn't exist returns the placeholder image URL.
@return string Returns the image URL. | [
"Returns",
"the",
"theme",
"preview",
"image",
"URL",
".",
"If",
"the",
"image",
"file",
"doesn",
"t",
"exist",
"returns",
"the",
"placeholder",
"image",
"URL",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/Theme.php#L465-L474 | train | Returns the preview image URL | [
30522,
2270,
3853,
2131,
28139,
8584,
9581,
3351,
3126,
2140,
1006,
1007,
1063,
1002,
19236,
15069,
1027,
1002,
2023,
1011,
1028,
2131,
8663,
8873,
2290,
10175,
5657,
1006,
1005,
19236,
9581,
3351,
1005,
1010,
1005,
7045,
1013,
4871,
1013,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Routing/Matcher/UrlMatcher.php | UrlMatcher.match | public function match($pathinfo)
{
$this->allow = $this->allowSchemes = [];
if ($ret = $this->matchCollection(rawurldecode($pathinfo) ?: '/', $this->routes)) {
return $ret;
}
if ('/' === $pathinfo && !$this->allow) {
throw new NoConfigurationException();
... | php | public function match($pathinfo)
{
$this->allow = $this->allowSchemes = [];
if ($ret = $this->matchCollection(rawurldecode($pathinfo) ?: '/', $this->routes)) {
return $ret;
}
if ('/' === $pathinfo && !$this->allow) {
throw new NoConfigurationException();
... | [
"public",
"function",
"match",
"(",
"$",
"pathinfo",
")",
"{",
"$",
"this",
"->",
"allow",
"=",
"$",
"this",
"->",
"allowSchemes",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"ret",
"=",
"$",
"this",
"->",
"matchCollection",
"(",
"rawurldecode",
"(",
"$",
... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Routing/Matcher/UrlMatcher.php#L84-L99 | train | Match a pathinfo to the routes | [
30522,
2270,
3853,
2674,
1006,
1002,
4130,
2378,
14876,
1007,
1063,
1002,
2023,
1011,
1028,
3499,
1027,
1002,
2023,
1011,
1028,
4473,
5403,
7834,
1027,
1031,
1033,
1025,
2065,
1006,
1002,
2128,
2102,
1027,
1002,
2023,
1011,
1028,
2674,
26... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Cache/Psr16Cache.php | Psr16Cache.has | public function has($key)
{
try {
return $this->pool->hasItem($key);
} catch (SimpleCacheException $e) {
throw $e;
} catch (Psr6CacheException $e) {
throw new InvalidArgumentException($e->getMessage(), $e->getCode(), $e);
}
} | php | public function has($key)
{
try {
return $this->pool->hasItem($key);
} catch (SimpleCacheException $e) {
throw $e;
} catch (Psr6CacheException $e) {
throw new InvalidArgumentException($e->getMessage(), $e->getCode(), $e);
}
} | [
"public",
"function",
"has",
"(",
"$",
"key",
")",
"{",
"try",
"{",
"return",
"$",
"this",
"->",
"pool",
"->",
"hasItem",
"(",
"$",
"key",
")",
";",
"}",
"catch",
"(",
"SimpleCacheException",
"$",
"e",
")",
"{",
"throw",
"$",
"e",
";",
"}",
"catc... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Cache/Psr16Cache.php#L253-L262 | train | Has item in cache | [
30522,
2270,
3853,
2038,
1006,
1002,
3145,
1007,
1063,
3046,
1063,
2709,
1002,
2023,
1011,
1028,
4770,
1011,
1028,
2038,
4221,
2213,
1006,
1002,
3145,
1007,
1025,
1065,
4608,
1006,
3722,
3540,
25923,
2595,
24422,
1002,
1041,
1007,
1063,
5... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Collection/AbstractIndexCollection.php | AbstractIndexCollection.containsKey | public function containsKey($key)
{
return isset($this->entries[$key]) || array_key_exists($key, $this->entries);
} | php | public function containsKey($key)
{
return isset($this->entries[$key]) || array_key_exists($key, $this->entries);
} | [
"public",
"function",
"containsKey",
"(",
"$",
"key",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"entries",
"[",
"$",
"key",
"]",
")",
"||",
"array_key_exists",
"(",
"$",
"key",
",",
"$",
"this",
"->",
"entries",
")",
";",
"}"
] | {@inheritDoc} | [
"{"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Framework/Collection/AbstractIndexCollection.php#L171-L174 | train | Has Entry? Return true if key exists in the entries array false if not | [
30522,
2270,
3853,
3397,
14839,
1006,
1002,
3145,
1007,
1063,
2709,
26354,
3388,
1006,
1002,
2023,
1011,
1028,
10445,
1031,
1002,
3145,
1033,
1007,
1064,
1064,
9140,
1035,
3145,
1035,
6526,
1006,
1002,
3145,
1010,
1002,
2023,
1011,
1028,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/Tracker/GoalManager.php | GoalManager.insertEcommerceItems | protected function insertEcommerceItems($goal, $itemsToInsert)
{
if (empty($itemsToInsert)) {
return;
}
Common::printDebug("Ecommerce items that are added to the cart/order");
Common::printDebug($itemsToInsert);
$items = array();
foreach ($itemsToInsert... | php | protected function insertEcommerceItems($goal, $itemsToInsert)
{
if (empty($itemsToInsert)) {
return;
}
Common::printDebug("Ecommerce items that are added to the cart/order");
Common::printDebug($itemsToInsert);
$items = array();
foreach ($itemsToInsert... | [
"protected",
"function",
"insertEcommerceItems",
"(",
"$",
"goal",
",",
"$",
"itemsToInsert",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"itemsToInsert",
")",
")",
"{",
"return",
";",
"}",
"Common",
"::",
"printDebug",
"(",
"\"Ecommerce items that are added to the ... | Inserts in the cart in the DB the new items
that were not previously in the cart
@param array $goal
@param array $itemsToInsert
@return void | [
"Inserts",
"in",
"the",
"cart",
"in",
"the",
"DB",
"the",
"new",
"items",
"that",
"were",
"not",
"previously",
"in",
"the",
"cart"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Tracker/GoalManager.php#L600-L616 | train | Inserts Ecommerce items into cart | [
30522,
5123,
3853,
19274,
8586,
5358,
5017,
3401,
4221,
5244,
1006,
1002,
3125,
1010,
1002,
5167,
3406,
7076,
8743,
1007,
1063,
2065,
1006,
4064,
1006,
1002,
5167,
3406,
7076,
8743,
1007,
1007,
1063,
2709,
1025,
1065,
2691,
1024,
1024,
61... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/LanguagesManager/API.php | API.set12HourClockForUser | public function set12HourClockForUser($login, $use12HourClock)
{
if ($login == 'anonymous') {
return false;
}
Piwik::checkUserHasSuperUserAccessOrIsTheUser($login);
$lang = $this->getModel()->set12HourClock($login, $use12HourClock);
return $lang;
} | php | public function set12HourClockForUser($login, $use12HourClock)
{
if ($login == 'anonymous') {
return false;
}
Piwik::checkUserHasSuperUserAccessOrIsTheUser($login);
$lang = $this->getModel()->set12HourClock($login, $use12HourClock);
return $lang;
} | [
"public",
"function",
"set12HourClockForUser",
"(",
"$",
"login",
",",
"$",
"use12HourClock",
")",
"{",
"if",
"(",
"$",
"login",
"==",
"'anonymous'",
")",
"{",
"return",
"false",
";",
"}",
"Piwik",
"::",
"checkUserHasSuperUserAccessOrIsTheUser",
"(",
"$",
"log... | Returns whether the user uses 12 hour clock
@param string $login
@param bool $use12HourClock
@return string | [
"Returns",
"whether",
"the",
"user",
"uses",
"12",
"hour",
"clock"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/LanguagesManager/API.php#L338-L349 | train | Set 12h clock for a specific user | [
30522,
2270,
3853,
2275,
12521,
6806,
3126,
20464,
7432,
29278,
20330,
1006,
1002,
8833,
2378,
1010,
1002,
2224,
12521,
6806,
3126,
20464,
7432,
1007,
1063,
2065,
30524,
1002,
8833,
2378,
1007,
1025,
1002,
11374,
1027,
1002,
2023,
1011,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Queue/Console/RetryCommand.php | RetryCommand.retryJob | protected function retryJob($job)
{
$this->laravel['queue']->connection($job->connection)->pushRaw(
$this->resetAttempts($job->payload), $job->queue
);
} | php | protected function retryJob($job)
{
$this->laravel['queue']->connection($job->connection)->pushRaw(
$this->resetAttempts($job->payload), $job->queue
);
} | [
"protected",
"function",
"retryJob",
"(",
"$",
"job",
")",
"{",
"$",
"this",
"->",
"laravel",
"[",
"'queue'",
"]",
"->",
"connection",
"(",
"$",
"job",
"->",
"connection",
")",
"->",
"pushRaw",
"(",
"$",
"this",
"->",
"resetAttempts",
"(",
"$",
"job",
... | Retry the queue job.
@param \stdClass $job
@return void | [
"Retry",
"the",
"queue",
"job",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Queue/Console/RetryCommand.php#L68-L73 | train | Retry the job in the queue. | [
30522,
5123,
3853,
2128,
11129,
5558,
2497,
1006,
1002,
3105,
1007,
1063,
1002,
2023,
1011,
1028,
13679,
15985,
1031,
1005,
24240,
1005,
1033,
1011,
1028,
4434,
1006,
1002,
3105,
1011,
1028,
4434,
1007,
1011,
1028,
5245,
2527,
2860,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/backend/classes/NavigationManager.php | NavigationManager.addMainMenuItem | public function addMainMenuItem($owner, $code, array $definition)
{
$itemKey = $this->makeItemKey($owner, $code);
if (isset($this->items[$itemKey])) {
$definition = array_merge((array) $this->items[$itemKey], $definition);
}
$item = (object) array_merge(self::$mainItemD... | php | public function addMainMenuItem($owner, $code, array $definition)
{
$itemKey = $this->makeItemKey($owner, $code);
if (isset($this->items[$itemKey])) {
$definition = array_merge((array) $this->items[$itemKey], $definition);
}
$item = (object) array_merge(self::$mainItemD... | [
"public",
"function",
"addMainMenuItem",
"(",
"$",
"owner",
",",
"$",
"code",
",",
"array",
"$",
"definition",
")",
"{",
"$",
"itemKey",
"=",
"$",
"this",
"->",
"makeItemKey",
"(",
"$",
"owner",
",",
"$",
"code",
")",
";",
"if",
"(",
"isset",
"(",
... | Dynamically add a single main menu item
@param string $owner
@param string $code
@param array $definitions | [
"Dynamically",
"add",
"a",
"single",
"main",
"menu",
"item"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/NavigationManager.php#L212-L230 | train | Add main menu item | [
30522,
2270,
3853,
5587,
24238,
3549,
14663,
6633,
1006,
1002,
3954,
1010,
1002,
3642,
1010,
9140,
1002,
6210,
1007,
1063,
1002,
8875,
14839,
1027,
1002,
2023,
1011,
1028,
2191,
4221,
2213,
14839,
1006,
1002,
3954,
1010,
1002,
3642,
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... |
opencart/opencart | upload/admin/controller/mail/gdpr.php | ControllerMailGdpr.index | public function index(&$route, &$args, &$output) {
$this->load->model('customer/gdpr');
$gdpr_info = $this->model_customer_gdpr->getGdpr($args[0]);
if ($gdpr_info) {
// Choose which mail to send
// Export plus complete
if ($gdpr_info['action'] == 'export' && $args[1] == 3) {
$this->export($gdpr_in... | php | public function index(&$route, &$args, &$output) {
$this->load->model('customer/gdpr');
$gdpr_info = $this->model_customer_gdpr->getGdpr($args[0]);
if ($gdpr_info) {
// Choose which mail to send
// Export plus complete
if ($gdpr_info['action'] == 'export' && $args[1] == 3) {
$this->export($gdpr_in... | [
"public",
"function",
"index",
"(",
"&",
"$",
"route",
",",
"&",
"$",
"args",
",",
"&",
"$",
"output",
")",
"{",
"$",
"this",
"->",
"load",
"->",
"model",
"(",
"'customer/gdpr'",
")",
";",
"$",
"gdpr_info",
"=",
"$",
"this",
"->",
"model_customer_gdp... | admin/model/customer/gdpr/editStatus | [
"admin",
"/",
"model",
"/",
"customer",
"/",
"gdpr",
"/",
"editStatus"
] | e7933b56ba05aafb3655c6b490c9733cd18b5c69 | https://github.com/opencart/opencart/blob/e7933b56ba05aafb3655c6b490c9733cd18b5c69/upload/admin/controller/mail/gdpr.php#L4-L32 | train | Index action callback | [
30522,
2270,
3853,
5950,
1006,
1004,
1002,
2799,
1010,
1004,
1002,
12098,
5620,
1010,
1004,
1002,
6434,
1007,
1063,
1002,
2023,
1011,
1028,
7170,
1011,
1028,
2944,
1006,
1005,
8013,
1013,
14230,
2099,
1005,
1007,
1025,
1002,
14230,
2099,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/View/Compilers/BladeCompiler.php | BladeCompiler.restoreRawContent | protected function restoreRawContent($result)
{
$result = preg_replace_callback('/'.$this->getRawPlaceholder('(\d+)').'/', function ($matches) {
return $this->rawBlocks[$matches[1]];
}, $result);
$this->rawBlocks = [];
return $result;
} | php | protected function restoreRawContent($result)
{
$result = preg_replace_callback('/'.$this->getRawPlaceholder('(\d+)').'/', function ($matches) {
return $this->rawBlocks[$matches[1]];
}, $result);
$this->rawBlocks = [];
return $result;
} | [
"protected",
"function",
"restoreRawContent",
"(",
"$",
"result",
")",
"{",
"$",
"result",
"=",
"preg_replace_callback",
"(",
"'/'",
".",
"$",
"this",
"->",
"getRawPlaceholder",
"(",
"'(\\d+)'",
")",
".",
"'/'",
",",
"function",
"(",
"$",
"matches",
")",
"... | Replace the raw placeholders with the original code stored in the raw blocks.
@param string $result
@return string | [
"Replace",
"the",
"raw",
"placeholders",
"with",
"the",
"original",
"code",
"stored",
"in",
"the",
"raw",
"blocks",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/View/Compilers/BladeCompiler.php#L267-L276 | train | Restore raw content from the original code | [
30522,
5123,
3853,
9239,
2527,
16526,
28040,
3372,
1006,
1002,
2765,
1007,
1063,
1002,
2765,
1027,
3653,
2290,
1035,
5672,
1035,
2655,
5963,
1006,
1005,
1013,
1005,
1012,
1002,
2023,
1011,
1028,
2131,
2527,
2860,
24759,
10732,
14528,
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/Common/Page/Medium/VideoMedium.php | VideoMedium.playsinline | public function playsinline($status = false)
{
if($status) {
$this->attributes['playsinline'] = true;
} else {
unset($this->attributes['playsinline']);
}
return $this;
} | php | public function playsinline($status = false)
{
if($status) {
$this->attributes['playsinline'] = true;
} else {
unset($this->attributes['playsinline']);
}
return $this;
} | [
"public",
"function",
"playsinline",
"(",
"$",
"status",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"status",
")",
"{",
"$",
"this",
"->",
"attributes",
"[",
"'playsinline'",
"]",
"=",
"true",
";",
"}",
"else",
"{",
"unset",
"(",
"$",
"this",
"->",
"a... | Allows to set the playsinline attribute
@param bool $status
@return $this | [
"Allows",
"to",
"set",
"the",
"playsinline",
"attribute"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Page/Medium/VideoMedium.php#L121-L130 | train | Set playsinline attribute | [
30522,
2270,
3853,
3248,
2378,
4179,
1006,
1002,
3570,
1027,
6270,
1007,
1063,
2065,
1006,
1002,
3570,
1007,
1063,
1002,
2023,
1011,
1028,
12332,
1031,
1005,
3248,
2378,
4179,
1005,
1033,
1027,
2995,
1025,
1065,
2842,
1063,
4895,
13462,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Templating/TemplateReference.php | TemplateReference.getPath | public function getPath()
{
$controller = str_replace('\\', '/', $this->get('controller'));
$path = (empty($controller) ? '' : $controller.'/').$this->get('name').'.'.$this->get('format').'.'.$this->get('engine');
return empty($this->parameters['bundle']) ? 'views/'.$path : '@'.$this->get(... | php | public function getPath()
{
$controller = str_replace('\\', '/', $this->get('controller'));
$path = (empty($controller) ? '' : $controller.'/').$this->get('name').'.'.$this->get('format').'.'.$this->get('engine');
return empty($this->parameters['bundle']) ? 'views/'.$path : '@'.$this->get(... | [
"public",
"function",
"getPath",
"(",
")",
"{",
"$",
"controller",
"=",
"str_replace",
"(",
"'\\\\'",
",",
"'/'",
",",
"$",
"this",
"->",
"get",
"(",
"'controller'",
")",
")",
";",
"$",
"path",
"=",
"(",
"empty",
"(",
"$",
"controller",
")",
"?",
"... | Returns the path to the template
- as a path when the template is not part of a bundle
- as a resource when the template is part of a bundle.
@return string A path to the template or a resource | [
"Returns",
"the",
"path",
"to",
"the",
"template",
"-",
"as",
"a",
"path",
"when",
"the",
"template",
"is",
"not",
"part",
"of",
"a",
"bundle",
"-",
"as",
"a",
"resource",
"when",
"the",
"template",
"is",
"part",
"of",
"a",
"bundle",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bundle/FrameworkBundle/Templating/TemplateReference.php#L45-L52 | train | Get path of the view | [
30522,
2270,
3853,
2131,
15069,
1006,
1007,
1063,
1002,
11486,
1027,
2358,
2099,
1035,
5672,
1006,
1005,
1032,
1032,
1005,
1010,
1005,
1013,
1005,
1010,
1002,
2023,
1011,
1028,
2131,
1006,
1005,
11486,
1005,
1007,
1007,
1025,
1002,
4130,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Console/Style/SymfonyStyle.php | SymfonyStyle.block | public function block($messages, $type = null, $style = null, $prefix = ' ', $padding = false, $escape = true)
{
$messages = \is_array($messages) ? array_values($messages) : [$messages];
$this->autoPrependBlock();
$this->writeln($this->createBlock($messages, $type, $style, $prefix, $padding... | php | public function block($messages, $type = null, $style = null, $prefix = ' ', $padding = false, $escape = true)
{
$messages = \is_array($messages) ? array_values($messages) : [$messages];
$this->autoPrependBlock();
$this->writeln($this->createBlock($messages, $type, $style, $prefix, $padding... | [
"public",
"function",
"block",
"(",
"$",
"messages",
",",
"$",
"type",
"=",
"null",
",",
"$",
"style",
"=",
"null",
",",
"$",
"prefix",
"=",
"' '",
",",
"$",
"padding",
"=",
"false",
",",
"$",
"escape",
"=",
"true",
")",
"{",
"$",
"messages",
"="... | Formats a message as a block of text.
@param string|array $messages The message to write in the block
@param string|null $type The block type (added in [] on first line)
@param string|null $style The style to apply to the whole block
@param string $prefix The prefix for the block
@param bool $... | [
"Formats",
"a",
"message",
"as",
"a",
"block",
"of",
"text",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Style/SymfonyStyle.php#L64-L71 | train | Write a block of code to the screen | [
30522,
2270,
3853,
3796,
1006,
1002,
7696,
1010,
1002,
2828,
1027,
19701,
1010,
1002,
2806,
1027,
19701,
1010,
1002,
17576,
1027,
1005,
1005,
1010,
1002,
11687,
4667,
1027,
6270,
1010,
1002,
4019,
1027,
2995,
1007,
1063,
1002,
7696,
1027,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Common/Assets/Pipeline.php | Pipeline.cssRewrite | protected function cssRewrite($file, $dir, $local)
{
// Strip any sourcemap comments
$file = preg_replace(self::CSS_SOURCEMAP_REGEX, '', $file);
// Find any css url() elements, grab the URLs and calculate an absolute path
// Then replace the old url with the new one
$file = ... | php | protected function cssRewrite($file, $dir, $local)
{
// Strip any sourcemap comments
$file = preg_replace(self::CSS_SOURCEMAP_REGEX, '', $file);
// Find any css url() elements, grab the URLs and calculate an absolute path
// Then replace the old url with the new one
$file = ... | [
"protected",
"function",
"cssRewrite",
"(",
"$",
"file",
",",
"$",
"dir",
",",
"$",
"local",
")",
"{",
"// Strip any sourcemap comments",
"$",
"file",
"=",
"preg_replace",
"(",
"self",
"::",
"CSS_SOURCEMAP_REGEX",
",",
"''",
",",
"$",
"file",
")",
";",
"//... | Finds relative CSS urls() and rewrites the URL with an absolute one
@param string $file the css source file
@param string $dir , $local relative path to the css file
@param bool $local is this a local or remote asset
@return mixed | [
"Finds",
"relative",
"CSS",
"urls",
"()",
"and",
"rewrites",
"the",
"URL",
"with",
"an",
"absolute",
"one"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Assets/Pipeline.php#L223-L253 | train | Rewrite CSS file | [
30522,
5123,
3853,
20116,
21338,
7974,
17625,
1006,
1002,
5371,
1010,
1002,
16101,
1010,
1002,
2334,
1007,
1063,
1013,
1013,
6167,
2151,
3120,
2863,
2361,
7928,
1002,
5371,
1027,
3653,
2290,
1035,
5672,
1006,
2969,
1024,
1024,
20116,
2015,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/HttpKernel/EventListener/DebugHandlersListener.php | DebugHandlersListener.configure | public function configure(Event $event = null)
{
if (!$event instanceof KernelEvent ? !$this->firstCall : !$event->isMasterRequest()) {
return;
}
$this->firstCall = $this->hasTerminatedWithException = false;
$handler = set_exception_handler('var_dump');
$handler ... | php | public function configure(Event $event = null)
{
if (!$event instanceof KernelEvent ? !$this->firstCall : !$event->isMasterRequest()) {
return;
}
$this->firstCall = $this->hasTerminatedWithException = false;
$handler = set_exception_handler('var_dump');
$handler ... | [
"public",
"function",
"configure",
"(",
"Event",
"$",
"event",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"event",
"instanceof",
"KernelEvent",
"?",
"!",
"$",
"this",
"->",
"firstCall",
":",
"!",
"$",
"event",
"->",
"isMasterRequest",
"(",
")",
")",
... | Configures the error handler. | [
"Configures",
"the",
"error",
"handler",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpKernel/EventListener/DebugHandlersListener.php#L66-L145 | train | Configure the exception handler | [
30522,
2270,
3853,
9530,
8873,
27390,
2063,
1006,
2724,
1002,
2724,
1027,
19701,
1007,
1063,
2065,
1006,
999,
1002,
2724,
6013,
11253,
16293,
18697,
3372,
1029,
999,
1002,
2023,
1011,
1028,
2034,
9289,
2140,
1024,
999,
1002,
2724,
1011,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Templating/PhpEngine.php | PhpEngine.getEscaper | public function getEscaper($context)
{
if (!isset($this->escapers[$context])) {
throw new \InvalidArgumentException(sprintf('No registered escaper for context "%s".', $context));
}
return $this->escapers[$context];
} | php | public function getEscaper($context)
{
if (!isset($this->escapers[$context])) {
throw new \InvalidArgumentException(sprintf('No registered escaper for context "%s".', $context));
}
return $this->escapers[$context];
} | [
"public",
"function",
"getEscaper",
"(",
"$",
"context",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"escapers",
"[",
"$",
"context",
"]",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'No registere... | Gets an escaper for a given context.
@param string $context The context name
@return callable A PHP callable
@throws \InvalidArgumentException | [
"Gets",
"an",
"escaper",
"for",
"a",
"given",
"context",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Templating/PhpEngine.php#L373-L380 | train | Returns the escaper for the given context | [
30522,
2270,
3853,
2131,
2229,
19464,
2099,
1006,
1002,
6123,
1007,
1063,
2065,
1006,
999,
26354,
3388,
1006,
1002,
2023,
1011,
1028,
4019,
2869,
1031,
1002,
6123,
1033,
1007,
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... |
symfony/symfony | src/Symfony/Component/HttpClient/Response/CurlResponse.php | CurlResponse.close | private function close(): void
{
unset($this->multi->openHandles[$this->id], $this->multi->handlesActivity[$this->id]);
curl_multi_remove_handle($this->multi->handle, $this->handle);
curl_setopt_array($this->handle, [
CURLOPT_PRIVATE => '',
CURLOPT_NOPROGRESS => true,... | php | private function close(): void
{
unset($this->multi->openHandles[$this->id], $this->multi->handlesActivity[$this->id]);
curl_multi_remove_handle($this->multi->handle, $this->handle);
curl_setopt_array($this->handle, [
CURLOPT_PRIVATE => '',
CURLOPT_NOPROGRESS => true,... | [
"private",
"function",
"close",
"(",
")",
":",
"void",
"{",
"unset",
"(",
"$",
"this",
"->",
"multi",
"->",
"openHandles",
"[",
"$",
"this",
"->",
"id",
"]",
",",
"$",
"this",
"->",
"multi",
"->",
"handlesActivity",
"[",
"$",
"this",
"->",
"id",
"]... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpClient/Response/CurlResponse.php#L200-L213 | train | Close the multi handle | [
30522,
2797,
3853,
2485,
1006,
1007,
1024,
11675,
1063,
4895,
13462,
1006,
1002,
30524,
16024,
18908,
7730,
1031,
1002,
2023,
1011,
1028,
8909,
1033,
1007,
1025,
15390,
1035,
4800,
1035,
6366,
1035,
5047,
1006,
1002,
2023,
1011,
1028,
4800,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/ChoiceList/Factory/DefaultChoiceListFactory.php | DefaultChoiceListFactory.createView | public function createView(ChoiceListInterface $list, $preferredChoices = null, $label = null, $index = null, $groupBy = null, $attr = null)
{
$preferredViews = [];
$preferredViewsOrder = [];
$otherViews = [];
$choices = $list->getChoices();
$keys = $list->getOriginalKeys();
... | php | public function createView(ChoiceListInterface $list, $preferredChoices = null, $label = null, $index = null, $groupBy = null, $attr = null)
{
$preferredViews = [];
$preferredViewsOrder = [];
$otherViews = [];
$choices = $list->getChoices();
$keys = $list->getOriginalKeys();
... | [
"public",
"function",
"createView",
"(",
"ChoiceListInterface",
"$",
"list",
",",
"$",
"preferredChoices",
"=",
"null",
",",
"$",
"label",
"=",
"null",
",",
"$",
"index",
"=",
"null",
",",
"$",
"groupBy",
"=",
"null",
",",
"$",
"attr",
"=",
"null",
")"... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/ChoiceList/Factory/DefaultChoiceListFactory.php#L48-L127 | train | Creates a view from the choice list | [
30522,
2270,
3853,
3443,
8584,
1006,
3601,
9863,
18447,
2121,
12172,
1002,
2862,
1010,
1002,
6871,
9905,
23522,
1027,
19701,
1010,
1002,
3830,
1027,
19701,
1010,
1002,
5950,
1027,
19701,
1010,
1002,
2177,
3762,
1027,
19701,
1010,
1002,
2012... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Filesystem/Filesystem.php | Filesystem.link | public function link($target, $link)
{
if (! windows_os()) {
return symlink($target, $link);
}
$mode = $this->isDirectory($target) ? 'J' : 'H';
exec("mklink /{$mode} \"{$link}\" \"{$target}\"");
} | php | public function link($target, $link)
{
if (! windows_os()) {
return symlink($target, $link);
}
$mode = $this->isDirectory($target) ? 'J' : 'H';
exec("mklink /{$mode} \"{$link}\" \"{$target}\"");
} | [
"public",
"function",
"link",
"(",
"$",
"target",
",",
"$",
"link",
")",
"{",
"if",
"(",
"!",
"windows_os",
"(",
")",
")",
"{",
"return",
"symlink",
"(",
"$",
"target",
",",
"$",
"link",
")",
";",
"}",
"$",
"mode",
"=",
"$",
"this",
"->",
"isDi... | Create a hard link to the target file or directory.
@param string $target
@param string $link
@return void | [
"Create",
"a",
"hard",
"link",
"to",
"the",
"target",
"file",
"or",
"directory",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Filesystem/Filesystem.php#L249-L258 | train | Link to a file or directory | [
30522,
2270,
3853,
4957,
1006,
1002,
4539,
1010,
1002,
4957,
1007,
1063,
2065,
1006,
999,
3645,
1035,
9808,
1006,
1007,
1007,
1063,
2709,
25353,
19968,
19839,
1006,
1002,
4539,
1010,
1002,
4957,
1007,
1025,
1065,
1002,
5549,
1027,
1002,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/CoreVisualizations/Visualizations/JqplotGraph/Evolution.php | Evolution.getDateRangeAndLastN | public static function getDateRangeAndLastN($period, $endDate, $defaultLastN = null)
{
if ($defaultLastN === null) {
$defaultLastN = self::getDefaultLastN($period);
}
$lastNParamName = self::getLastNParamName($period);
$lastN = Common::getRequestVar($lastNParamName, $def... | php | public static function getDateRangeAndLastN($period, $endDate, $defaultLastN = null)
{
if ($defaultLastN === null) {
$defaultLastN = self::getDefaultLastN($period);
}
$lastNParamName = self::getLastNParamName($period);
$lastN = Common::getRequestVar($lastNParamName, $def... | [
"public",
"static",
"function",
"getDateRangeAndLastN",
"(",
"$",
"period",
",",
"$",
"endDate",
",",
"$",
"defaultLastN",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"defaultLastN",
"===",
"null",
")",
"{",
"$",
"defaultLastN",
"=",
"self",
"::",
"getDefaultLa... | Returns the entire date range and lastN value for the current request, based on
a period type and end date.
@param string $period The period type, 'day', 'week', 'month' or 'year'
@param string $endDate The end date.
@param int|null $defaultLastN The default lastN to use. If null, the result of
getDefaultLastN is used... | [
"Returns",
"the",
"entire",
"date",
"range",
"and",
"lastN",
"value",
"for",
"the",
"current",
"request",
"based",
"on",
"a",
"period",
"type",
"and",
"end",
"date",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/CoreVisualizations/Visualizations/JqplotGraph/Evolution.php#L119-L133 | train | Returns the date range and lastN for the passed period and end date. | [
30522,
2270,
10763,
3853,
2131,
13701,
24388,
11219,
19422,
14083,
2078,
1006,
1002,
2558,
1010,
1002,
2203,
13701,
1010,
1002,
12398,
8523,
2102,
2078,
1027,
19701,
1007,
1063,
2065,
1006,
1002,
12398,
8523,
2102,
2078,
1027,
1027,
1027,
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/Profiler/Firebug.php | Zend_Db_Profiler_Firebug.setEnabled | public function setEnabled($enable)
{
parent::setEnabled($enable);
if ($this->getEnabled()) {
if (!$this->_message) {
$this->_message = new Zend_Wildfire_Plugin_FirePhp_TableMessage($this->_label);
$this->_message->setBuffered(true);
$thi... | php | public function setEnabled($enable)
{
parent::setEnabled($enable);
if ($this->getEnabled()) {
if (!$this->_message) {
$this->_message = new Zend_Wildfire_Plugin_FirePhp_TableMessage($this->_label);
$this->_message->setBuffered(true);
$thi... | [
"public",
"function",
"setEnabled",
"(",
"$",
"enable",
")",
"{",
"parent",
"::",
"setEnabled",
"(",
"$",
"enable",
")",
";",
"if",
"(",
"$",
"this",
"->",
"getEnabled",
"(",
")",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_message",
")",
"{",
... | Enable or disable the profiler. If $enable is false, the profiler
is disabled and will not log any queries sent to it.
@param boolean $enable
@return Zend_Db_Profiler Provides a fluent interface | [
"Enable",
"or",
"disable",
"the",
"profiler",
".",
"If",
"$enable",
"is",
"false",
"the",
"profiler",
"is",
"disabled",
"and",
"will",
"not",
"log",
"any",
"queries",
"sent",
"to",
"it",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Profiler/Firebug.php#L88-L113 | train | Set whether or not this table is enabled | [
30522,
2270,
3853,
2275,
8189,
23242,
1006,
1002,
9585,
1007,
1063,
6687,
1024,
1024,
2275,
8189,
23242,
1006,
1002,
9585,
1007,
1025,
2065,
1006,
1002,
2023,
1011,
1028,
2131,
8189,
23242,
1006,
1007,
1007,
1063,
2065,
1006,
999,
1002,
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/Plugin/Menu.php | Menu.urlForDefaultUserParams | public function urlForDefaultUserParams($websiteId = false, $defaultPeriod = false, $defaultDate = false)
{
$userPreferences = new UserPreferences();
if (empty($websiteId)) {
$websiteId = $userPreferences->getDefaultWebsiteId();
}
if (empty($websiteId)) {
thro... | php | public function urlForDefaultUserParams($websiteId = false, $defaultPeriod = false, $defaultDate = false)
{
$userPreferences = new UserPreferences();
if (empty($websiteId)) {
$websiteId = $userPreferences->getDefaultWebsiteId();
}
if (empty($websiteId)) {
thro... | [
"public",
"function",
"urlForDefaultUserParams",
"(",
"$",
"websiteId",
"=",
"false",
",",
"$",
"defaultPeriod",
"=",
"false",
",",
"$",
"defaultDate",
"=",
"false",
")",
"{",
"$",
"userPreferences",
"=",
"new",
"UserPreferences",
"(",
")",
";",
"if",
"(",
... | Returns the &idSite=X&period=Y&date=Z query string fragment,
fetched from current logged-in user's preferences.
@param bool $websiteId
@param bool $defaultPeriod
@param bool $defaultDate
@return string eg '&idSite=1&period=week&date=today'
@throws \Exception in case a website was not specified and a default website id... | [
"Returns",
"the",
"&idSite",
"=",
"X&period",
"=",
"Y&date",
"=",
"Z",
"query",
"string",
"fragment",
"fetched",
"from",
"current",
"logged",
"-",
"in",
"user",
"s",
"preferences",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Plugin/Menu.php#L188-L208 | train | Return an array of default parameters for the user | [
30522,
2270,
3853,
24471,
23211,
12879,
23505,
20330,
28689,
5244,
1006,
1002,
4037,
3593,
1027,
6270,
1010,
1002,
12398,
4842,
3695,
2094,
1027,
6270,
1010,
1002,
12398,
13701,
1027,
6270,
1007,
1063,
1002,
5310,
28139,
25523,
2015,
1027,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/HTML/QuickForm2/Rule/MimeType.php | HTML_QuickForm2_Rule_MimeType.setOwner | public function setOwner(HTML_QuickForm2_Node $owner)
{
if (!$owner instanceof HTML_QuickForm2_Element_InputFile) {
throw new HTML_QuickForm2_InvalidArgumentException(
'MimeType Rule can only validate file upload fields, '.
get_class($owner) . ' given'
... | php | public function setOwner(HTML_QuickForm2_Node $owner)
{
if (!$owner instanceof HTML_QuickForm2_Element_InputFile) {
throw new HTML_QuickForm2_InvalidArgumentException(
'MimeType Rule can only validate file upload fields, '.
get_class($owner) . ' given'
... | [
"public",
"function",
"setOwner",
"(",
"HTML_QuickForm2_Node",
"$",
"owner",
")",
"{",
"if",
"(",
"!",
"$",
"owner",
"instanceof",
"HTML_QuickForm2_Element_InputFile",
")",
"{",
"throw",
"new",
"HTML_QuickForm2_InvalidArgumentException",
"(",
"'MimeType Rule can only vali... | Sets the element that will be validated by this rule
@param HTML_QuickForm2_Element_InputFile File upload field to validate
@throws HTML_QuickForm2_InvalidArgumentException if trying to use
this Rule on something that isn't a file upload field | [
"Sets",
"the",
"element",
"that",
"will",
"be",
"validated",
"by",
"this",
"rule"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Rule/MimeType.php#L111-L120 | train | Sets the owner of the file upload rule | [
30522,
2270,
3853,
2275,
12384,
2121,
1006,
16129,
1035,
4248,
14192,
2475,
1035,
13045,
1002,
3954,
1007,
1063,
2065,
1006,
999,
1002,
3954,
6013,
11253,
16129,
1035,
4248,
14192,
2475,
1035,
5783,
1035,
7953,
8873,
2571,
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... |
octobercms/october | modules/backend/behaviors/RelationController.php | RelationController.onRelationManageCreate | public function onRelationManageCreate()
{
$this->forceManageMode = 'form';
$this->beforeAjax();
$saveData = $this->manageWidget->getSaveData();
$sessionKey = $this->deferredBinding ? $this->relationGetSessionKey(true) : null;
if ($this->viewMode == 'multi') {
$n... | php | public function onRelationManageCreate()
{
$this->forceManageMode = 'form';
$this->beforeAjax();
$saveData = $this->manageWidget->getSaveData();
$sessionKey = $this->deferredBinding ? $this->relationGetSessionKey(true) : null;
if ($this->viewMode == 'multi') {
$n... | [
"public",
"function",
"onRelationManageCreate",
"(",
")",
"{",
"$",
"this",
"->",
"forceManageMode",
"=",
"'form'",
";",
"$",
"this",
"->",
"beforeAjax",
"(",
")",
";",
"$",
"saveData",
"=",
"$",
"this",
"->",
"manageWidget",
"->",
"getSaveData",
"(",
")",... | Create a new related model | [
"Create",
"a",
"new",
"related",
"model"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/behaviors/RelationController.php#L998-L1053 | train | On relation create | [
30522,
2270,
3853,
2006,
16570,
3370,
24805,
3351,
16748,
3686,
1006,
1007,
1063,
1002,
2023,
1011,
1028,
2486,
24805,
3351,
5302,
3207,
1027,
1005,
2433,
1005,
1025,
1002,
2023,
1011,
1028,
2077,
22734,
2595,
1006,
1007,
1025,
1002,
5552,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Actions/API.php | API.getExitPageUrls | public function getExitPageUrls($idSite, $period, $date, $segment = false, $expanded = false, $idSubtable = false, $flat = false)
{
Piwik::checkUserHasViewAccess($idSite);
$dataTable = $this->getPageUrls($idSite, $period, $date, $segment, $expanded, $idSubtable, false, $flat);
$this->filter... | php | public function getExitPageUrls($idSite, $period, $date, $segment = false, $expanded = false, $idSubtable = false, $flat = false)
{
Piwik::checkUserHasViewAccess($idSite);
$dataTable = $this->getPageUrls($idSite, $period, $date, $segment, $expanded, $idSubtable, false, $flat);
$this->filter... | [
"public",
"function",
"getExitPageUrls",
"(",
"$",
"idSite",
",",
"$",
"period",
",",
"$",
"date",
",",
"$",
"segment",
"=",
"false",
",",
"$",
"expanded",
"=",
"false",
",",
"$",
"idSubtable",
"=",
"false",
",",
"$",
"flat",
"=",
"false",
")",
"{",
... | Returns a DataTable with analytics information for every unique exit page URL, for
the specified site, period & segment. | [
"Returns",
"a",
"DataTable",
"with",
"analytics",
"information",
"for",
"every",
"unique",
"exit",
"page",
"URL",
"for",
"the",
"specified",
"site",
"period",
"&",
"segment",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Actions/API.php#L183-L190 | train | Returns an array of site period date segment expanded and flat array of exit page urls. | [
30522,
2270,
3853,
2131,
10288,
4183,
13704,
3126,
4877,
1006,
1002,
8909,
28032,
2063,
1010,
1002,
2558,
1010,
1002,
3058,
1010,
1002,
6903,
1027,
6270,
1010,
1002,
4423,
1027,
6270,
1010,
1002,
8909,
6342,
19279,
3085,
1027,
6270,
1010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Database/Schema/Grammars/ChangeColumn.php | ChangeColumn.getChangedDiff | protected static function getChangedDiff($grammar, Blueprint $blueprint, SchemaManager $schema)
{
$current = $schema->listTableDetails($grammar->getTablePrefix().$blueprint->getTable());
return (new Comparator)->diffTable(
$current, static::getTableWithColumnChanges($blueprint, $current... | php | protected static function getChangedDiff($grammar, Blueprint $blueprint, SchemaManager $schema)
{
$current = $schema->listTableDetails($grammar->getTablePrefix().$blueprint->getTable());
return (new Comparator)->diffTable(
$current, static::getTableWithColumnChanges($blueprint, $current... | [
"protected",
"static",
"function",
"getChangedDiff",
"(",
"$",
"grammar",
",",
"Blueprint",
"$",
"blueprint",
",",
"SchemaManager",
"$",
"schema",
")",
"{",
"$",
"current",
"=",
"$",
"schema",
"->",
"listTableDetails",
"(",
"$",
"grammar",
"->",
"getTablePrefi... | Get the Doctrine table difference for the given changes.
@param \Illuminate\Database\Schema\Grammars\Grammar $grammar
@param \Illuminate\Database\Schema\Blueprint $blueprint
@param \Doctrine\DBAL\Schema\AbstractSchemaManager $schema
@return \Doctrine\DBAL\Schema\TableDiff|bool | [
"Get",
"the",
"Doctrine",
"table",
"difference",
"for",
"the",
"given",
"changes",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Schema/Grammars/ChangeColumn.php#L55-L62 | train | Get changed diff | [
30522,
5123,
10763,
3853,
2131,
22305,
22367,
13355,
1006,
1002,
8035,
1010,
2630,
16550,
1002,
2630,
16550,
1010,
8040,
28433,
24805,
4590,
1002,
8040,
28433,
1007,
1063,
1002,
2783,
1027,
1002,
8040,
28433,
1011,
1028,
2862,
10880,
3207,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/HTML/QuickForm2/Renderer/Default.php | HTML_QuickForm2_Renderer_Default.findTemplate | public function findTemplate(HTML_QuickForm2_Node $element, $default = '{element}')
{
if (!empty($this->templatesForId[$element->getId()])) {
return $this->templatesForId[$element->getId()];
}
$class = strtolower(get_class($element));
$groupId = end($this-... | php | public function findTemplate(HTML_QuickForm2_Node $element, $default = '{element}')
{
if (!empty($this->templatesForId[$element->getId()])) {
return $this->templatesForId[$element->getId()];
}
$class = strtolower(get_class($element));
$groupId = end($this-... | [
"public",
"function",
"findTemplate",
"(",
"HTML_QuickForm2_Node",
"$",
"element",
",",
"$",
"default",
"=",
"'{element}'",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"templatesForId",
"[",
"$",
"element",
"->",
"getId",
"(",
")",
"]",
")... | Finds a proper template for the element
Templates are scanned in a predefined order. First, if a template was
set for a specific element by id, it is returned, no matter if the
element belongs to a group. If the element does not belong to a group,
we try to match a template using the element class.
But, if the element... | [
"Finds",
"a",
"proper",
"template",
"for",
"the",
"element"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Renderer/Default.php#L472-L510 | train | Find the template for the element | [
30522,
2270,
3853,
2424,
18532,
15725,
1006,
16129,
1035,
4248,
14192,
2475,
1035,
13045,
1002,
5783,
1010,
1002,
12398,
1027,
1005,
1063,
5783,
1065,
1005,
1007,
1063,
2065,
1006,
30524,
1028,
2131,
3593,
1006,
1007,
1033,
1007,
1007,
1063... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Http/Resources/Json/JsonResource.php | JsonResource.toArray | public function toArray($request)
{
if (is_null($this->resource)) {
return [];
}
return is_array($this->resource)
? $this->resource
: $this->resource->toArray();
} | php | public function toArray($request)
{
if (is_null($this->resource)) {
return [];
}
return is_array($this->resource)
? $this->resource
: $this->resource->toArray();
} | [
"public",
"function",
"toArray",
"(",
"$",
"request",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"resource",
")",
")",
"{",
"return",
"[",
"]",
";",
"}",
"return",
"is_array",
"(",
"$",
"this",
"->",
"resource",
")",
"?",
"$",
"this",
... | Transform the resource into an array.
@param \Illuminate\Http\Request $request
@return array | [
"Transform",
"the",
"resource",
"into",
"an",
"array",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Http/Resources/Json/JsonResource.php#L112-L121 | train | Return array of resource | [
30522,
2270,
3853,
2000,
2906,
9447,
1006,
1002,
5227,
1007,
1063,
2065,
1006,
2003,
1035,
19701,
1006,
1002,
2023,
1011,
1028,
7692,
1007,
1007,
1063,
2709,
1031,
1033,
1025,
1065,
2709,
2003,
1035,
9140,
1006,
1002,
2023,
1011,
1028,
76... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraph.php | ServiceReferenceGraph.connect | public function connect(?string $sourceId, $sourceValue, ?string $destId, $destValue = null, $reference = null, bool $lazy = false, bool $weak = false, bool $byConstructor = false)
{
if (null === $sourceId || null === $destId) {
return;
}
$sourceNode = $this->createNode($sourceI... | php | public function connect(?string $sourceId, $sourceValue, ?string $destId, $destValue = null, $reference = null, bool $lazy = false, bool $weak = false, bool $byConstructor = false)
{
if (null === $sourceId || null === $destId) {
return;
}
$sourceNode = $this->createNode($sourceI... | [
"public",
"function",
"connect",
"(",
"?",
"string",
"$",
"sourceId",
",",
"$",
"sourceValue",
",",
"?",
"string",
"$",
"destId",
",",
"$",
"destValue",
"=",
"null",
",",
"$",
"reference",
"=",
"null",
",",
"bool",
"$",
"lazy",
"=",
"false",
",",
"bo... | Connects 2 nodes together in the Graph. | [
"Connects",
"2",
"nodes",
"together",
"in",
"the",
"Graph",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraph.php#L76-L88 | train | Connects two nodes | [
30522,
2270,
3853,
7532,
1006,
1029,
5164,
1002,
3120,
3593,
1010,
1002,
3120,
10175,
5657,
1010,
1029,
5164,
1002,
4078,
3775,
2094,
1010,
1002,
4078,
9189,
2389,
5657,
1027,
19701,
1010,
1002,
4431,
1027,
19701,
1010,
22017,
2140,
1002,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/system/classes/MarkupManager.php | MarkupManager.makeTwigFilters | public function makeTwigFilters($filters = [])
{
if (!is_array($filters)) {
$filters = [];
}
foreach ($this->listFilters() as $name => $callable) {
/*
* Handle a wildcard function
*/
if (strpos($name, '*') !== false && $this->is... | php | public function makeTwigFilters($filters = [])
{
if (!is_array($filters)) {
$filters = [];
}
foreach ($this->listFilters() as $name => $callable) {
/*
* Handle a wildcard function
*/
if (strpos($name, '*') !== false && $this->is... | [
"public",
"function",
"makeTwigFilters",
"(",
"$",
"filters",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"filters",
")",
")",
"{",
"$",
"filters",
"=",
"[",
"]",
";",
"}",
"foreach",
"(",
"$",
"this",
"->",
"listFilters",
"(",
... | Makes a set of Twig filters for use in a twig extension.
@param array $filters Current collection
@return array | [
"Makes",
"a",
"set",
"of",
"Twig",
"filters",
"for",
"use",
"in",
"a",
"twig",
"extension",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/MarkupManager.php#L257-L284 | train | Makes Twig filters | [
30522,
2270,
3853,
2191,
2102,
16279,
8873,
21928,
2015,
1006,
1002,
17736,
1027,
1031,
1033,
1007,
1063,
2065,
1006,
999,
2003,
1035,
9140,
1006,
1002,
17736,
1007,
1007,
1063,
1002,
17736,
1027,
1031,
1033,
1025,
1065,
18921,
6776,
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/Database/Eloquent/Collection.php | Collection.getQueueableConnection | public function getQueueableConnection()
{
if ($this->isEmpty()) {
return;
}
$connection = $this->first()->getConnectionName();
$this->each(function ($model) use ($connection) {
if ($model->getConnectionName() !== $connection) {
throw new Log... | php | public function getQueueableConnection()
{
if ($this->isEmpty()) {
return;
}
$connection = $this->first()->getConnectionName();
$this->each(function ($model) use ($connection) {
if ($model->getConnectionName() !== $connection) {
throw new Log... | [
"public",
"function",
"getQueueableConnection",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isEmpty",
"(",
")",
")",
"{",
"return",
";",
"}",
"$",
"connection",
"=",
"$",
"this",
"->",
"first",
"(",
")",
"->",
"getConnectionName",
"(",
")",
";",
"$... | Get the connection of the entities being queued.
@return string|null
@throws \LogicException | [
"Get",
"the",
"connection",
"of",
"the",
"entities",
"being",
"queued",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Collection.php#L566-L581 | train | Get the queueable connection for the collection | [
30522,
2270,
3853,
2131,
4226,
5657,
3085,
8663,
2638,
7542,
1006,
1007,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
2003,
6633,
13876,
2100,
1006,
1007,
1007,
1063,
2709,
1025,
1065,
1002,
4434,
1027,
1002,
2023,
1011,
1028,
2034,
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... |
octobercms/october | modules/backend/formwidgets/FileUpload.php | FileUpload.decorateFileAttributes | protected function decorateFileAttributes($file)
{
/*
* File is protected, create a secure public path
*/
if (!$file->isPublic()) {
$path = $thumb = FilesController::getDownloadUrl($file);
if ($this->imageWidth || $this->imageHeight) {
$thum... | php | protected function decorateFileAttributes($file)
{
/*
* File is protected, create a secure public path
*/
if (!$file->isPublic()) {
$path = $thumb = FilesController::getDownloadUrl($file);
if ($this->imageWidth || $this->imageHeight) {
$thum... | [
"protected",
"function",
"decorateFileAttributes",
"(",
"$",
"file",
")",
"{",
"/*\n * File is protected, create a secure public path\n */",
"if",
"(",
"!",
"$",
"file",
"->",
"isPublic",
"(",
")",
")",
"{",
"$",
"path",
"=",
"$",
"thumb",
"=",
"Fi... | Adds the bespoke attributes used internally by this widget.
- thumbUrl
- pathUrl
@return System\Models\File | [
"Adds",
"the",
"bespoke",
"attributes",
"used",
"internally",
"by",
"this",
"widget",
".",
"-",
"thumbUrl",
"-",
"pathUrl"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/formwidgets/FileUpload.php#L441-L468 | train | Decorate file attributes | [
30522,
5123,
3853,
29460,
8873,
19738,
4779,
3089,
8569,
4570,
1006,
1002,
5371,
1007,
1063,
1013,
1008,
1008,
5371,
2003,
5123,
1010,
3443,
1037,
5851,
2270,
4130,
1008,
1013,
2065,
1006,
999,
1002,
5371,
1011,
1028,
2003,
14289,
16558,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/MiniProgram/OpenData/Client.php | Client.removeUserStorage | public function removeUserStorage(string $openid, string $sessionKey, array $key)
{
$data = ['key' => $key];
$query = [
'openid' => $openid,
'sig_method' => 'hmac_sha256',
'signature' => hash_hmac('sha256', json_encode($data), $sessionKey),
];
ret... | php | public function removeUserStorage(string $openid, string $sessionKey, array $key)
{
$data = ['key' => $key];
$query = [
'openid' => $openid,
'sig_method' => 'hmac_sha256',
'signature' => hash_hmac('sha256', json_encode($data), $sessionKey),
];
ret... | [
"public",
"function",
"removeUserStorage",
"(",
"string",
"$",
"openid",
",",
"string",
"$",
"sessionKey",
",",
"array",
"$",
"key",
")",
"{",
"$",
"data",
"=",
"[",
"'key'",
"=>",
"$",
"key",
"]",
";",
"$",
"query",
"=",
"[",
"'openid'",
"=>",
"$",
... | removeUserStorage.
@param string $openid
@param string $sessionKey
@param array $key
@return array|\EasyWeChat\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string
@throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException | [
"removeUserStorage",
"."
] | 120c72faaa93c270365bc75c73c362d5fd583209 | https://github.com/overtrue/wechat/blob/120c72faaa93c270365bc75c73c362d5fd583209/src/MiniProgram/OpenData/Client.php#L39-L49 | train | Remove user storage | [
30522,
2270,
3853,
6366,
20330,
23809,
4270,
1006,
5164,
1002,
2330,
3593,
1010,
5164,
1002,
5219,
14839,
1010,
9140,
1002,
3145,
1007,
1063,
1002,
2951,
1027,
1031,
1005,
3145,
1005,
1027,
1028,
1002,
3145,
1033,
1025,
1002,
23032,
1027,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/Descriptor.php | Descriptor.describe | public function describe(OutputInterface $output, $object, array $options = [])
{
$this->output = $output;
switch (true) {
case $object instanceof RouteCollection:
$this->describeRouteCollection($object, $options);
break;
case $object instance... | php | public function describe(OutputInterface $output, $object, array $options = [])
{
$this->output = $output;
switch (true) {
case $object instanceof RouteCollection:
$this->describeRouteCollection($object, $options);
break;
case $object instance... | [
"public",
"function",
"describe",
"(",
"OutputInterface",
"$",
"output",
",",
"$",
"object",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"output",
"=",
"$",
"output",
";",
"switch",
"(",
"true",
")",
"{",
"case",
"$",
... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/Descriptor.php#L41-L85 | train | Describes an object. | [
30522,
2270,
3853,
6235,
1006,
6434,
18447,
2121,
12172,
1002,
6434,
1010,
1002,
4874,
1010,
9140,
1002,
7047,
1027,
1031,
1033,
1007,
1063,
1002,
2023,
1011,
1028,
6434,
1027,
1002,
6434,
1025,
6942,
1006,
2995,
1007,
1063,
2553,
1002,
4... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Translation/Loader/CsvFileLoader.php | CsvFileLoader.setCsvControl | public function setCsvControl($delimiter = ';', $enclosure = '"', $escape = '\\')
{
$this->delimiter = $delimiter;
$this->enclosure = $enclosure;
$this->escape = $escape;
} | php | public function setCsvControl($delimiter = ';', $enclosure = '"', $escape = '\\')
{
$this->delimiter = $delimiter;
$this->enclosure = $enclosure;
$this->escape = $escape;
} | [
"public",
"function",
"setCsvControl",
"(",
"$",
"delimiter",
"=",
"';'",
",",
"$",
"enclosure",
"=",
"'\"'",
",",
"$",
"escape",
"=",
"'\\\\'",
")",
"{",
"$",
"this",
"->",
"delimiter",
"=",
"$",
"delimiter",
";",
"$",
"this",
"->",
"enclosure",
"=",
... | Sets the delimiter, enclosure, and escape character for CSV.
@param string $delimiter Delimiter character
@param string $enclosure Enclosure character
@param string $escape Escape character | [
"Sets",
"the",
"delimiter",
"enclosure",
"and",
"escape",
"character",
"for",
"CSV",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Translation/Loader/CsvFileLoader.php#L59-L64 | train | Set CSV control | [
30522,
2270,
3853,
2275,
6169,
25465,
12162,
13153,
1006,
1002,
3972,
27605,
3334,
1027,
1005,
1025,
1005,
1010,
1002,
17539,
1027,
1005,
1000,
1005,
1010,
1002,
4019,
1027,
1005,
1032,
1032,
1005,
1007,
1063,
1002,
2023,
1011,
1028,
3972,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Validator/Mapping/Loader/LoaderChain.php | LoaderChain.loadClassMetadata | public function loadClassMetadata(ClassMetadata $metadata)
{
$success = false;
foreach ($this->loaders as $loader) {
$success = $loader->loadClassMetadata($metadata) || $success;
}
return $success;
} | php | public function loadClassMetadata(ClassMetadata $metadata)
{
$success = false;
foreach ($this->loaders as $loader) {
$success = $loader->loadClassMetadata($metadata) || $success;
}
return $success;
} | [
"public",
"function",
"loadClassMetadata",
"(",
"ClassMetadata",
"$",
"metadata",
")",
"{",
"$",
"success",
"=",
"false",
";",
"foreach",
"(",
"$",
"this",
"->",
"loaders",
"as",
"$",
"loader",
")",
"{",
"$",
"success",
"=",
"$",
"loader",
"->",
"loadCla... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Validator/Mapping/Loader/LoaderChain.php#L49-L58 | train | Loads the class metadata for the passed class. | [
30522,
2270,
3853,
7170,
26266,
11368,
8447,
2696,
1006,
2465,
11368,
8447,
2696,
1002,
27425,
1007,
1063,
1002,
3112,
1027,
6270,
1025,
18921,
6776,
1006,
1002,
2023,
1011,
1028,
7170,
2545,
2004,
1002,
7170,
2121,
1007,
1063,
1002,
3112,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/GeoIp2/LocationProvider/GeoIp2.php | GeoIp2.getIpFromInfo | protected function getIpFromInfo($info)
{
$ip = \Piwik\Network\IP::fromStringIP($info['ip']);
return $ip->toString();
} | php | protected function getIpFromInfo($info)
{
$ip = \Piwik\Network\IP::fromStringIP($info['ip']);
return $ip->toString();
} | [
"protected",
"function",
"getIpFromInfo",
"(",
"$",
"info",
")",
"{",
"$",
"ip",
"=",
"\\",
"Piwik",
"\\",
"Network",
"\\",
"IP",
"::",
"fromStringIP",
"(",
"$",
"info",
"[",
"'ip'",
"]",
")",
";",
"return",
"$",
"ip",
"->",
"toString",
"(",
")",
"... | Returns an IP address from an array that was passed into getLocation. This
will return an IPv4 address or IPv6 address.
@param array $info Must have 'ip' key.
@return string|null | [
"Returns",
"an",
"IP",
"address",
"from",
"an",
"array",
"that",
"was",
"passed",
"into",
"getLocation",
".",
"This",
"will",
"return",
"an",
"IPv4",
"address",
"or",
"IPv6",
"address",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/GeoIp2/LocationProvider/GeoIp2.php#L259-L264 | train | Get the IP address from the info array | [
30522,
5123,
3853,
2131,
11514,
19699,
20936,
2078,
14876,
1006,
1002,
18558,
1007,
1063,
1002,
12997,
1027,
1032,
14255,
9148,
2243,
1032,
2897,
1032,
12997,
1024,
1024,
2013,
3367,
4892,
11514,
1006,
1002,
18558,
1031,
1005,
12997,
1005,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToStringTransformer.php | DateTimeToStringTransformer.transform | public function transform($dateTime)
{
if (null === $dateTime) {
return '';
}
if (!$dateTime instanceof \DateTimeInterface) {
throw new TransformationFailedException('Expected a \DateTimeInterface.');
}
if (!$dateTime instanceof \DateTimeImmutable) {... | php | public function transform($dateTime)
{
if (null === $dateTime) {
return '';
}
if (!$dateTime instanceof \DateTimeInterface) {
throw new TransformationFailedException('Expected a \DateTimeInterface.');
}
if (!$dateTime instanceof \DateTimeImmutable) {... | [
"public",
"function",
"transform",
"(",
"$",
"dateTime",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"dateTime",
")",
"{",
"return",
"''",
";",
"}",
"if",
"(",
"!",
"$",
"dateTime",
"instanceof",
"\\",
"DateTimeInterface",
")",
"{",
"throw",
"new",
"Trans... | Transforms a DateTime object into a date string with the configured format
and timezone.
@param \DateTimeInterface $dateTime A DateTimeInterface object
@return string A value as produced by PHP's date() function
@throws TransformationFailedException If the given value is not a \DateTimeInterface | [
"Transforms",
"a",
"DateTime",
"object",
"into",
"a",
"date",
"string",
"with",
"the",
"configured",
"format",
"and",
"timezone",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToStringTransformer.php#L80-L97 | train | Transform a \ DateTimeImmutable object into a string | [
30522,
2270,
3853,
10938,
1006,
1002,
3058,
7292,
1007,
1063,
2065,
1006,
19701,
1027,
1027,
1027,
1002,
3058,
7292,
1007,
1063,
2709,
1005,
1005,
1025,
1065,
2065,
1006,
999,
1002,
3058,
7292,
6013,
11253,
1032,
3058,
7292,
18447,
2121,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.