repo stringclasses 21
values | path stringlengths 10 105 | func_name stringlengths 6 64 | original_string stringlengths 105 15.6k | language stringclasses 1
value | code stringlengths 105 15.6k | code_tokens listlengths 29 2.15k | docstring stringlengths 11 2.85k | docstring_tokens listlengths 1 290 | sha stringclasses 21
values | url stringlengths 100 194 | partition stringclasses 1
value | summary stringlengths 8 319 | input_ids listlengths 502 502 | token_type_ids listlengths 502 502 | attention_mask listlengths 502 502 | labels listlengths 502 502 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
symfony/symfony | src/Symfony/Component/OptionsResolver/OptionsResolver.php | OptionsResolver.setAllowedValues | public function setAllowedValues($option, $allowedValues)
{
if ($this->locked) {
throw new AccessException('Allowed values cannot be set from a lazy option or normalizer.');
}
if (!isset($this->defined[$option])) {
throw new UndefinedOptionsException(sprintf('The opt... | php | public function setAllowedValues($option, $allowedValues)
{
if ($this->locked) {
throw new AccessException('Allowed values cannot be set from a lazy option or normalizer.');
}
if (!isset($this->defined[$option])) {
throw new UndefinedOptionsException(sprintf('The opt... | [
"public",
"function",
"setAllowedValues",
"(",
"$",
"option",
",",
"$",
"allowedValues",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"locked",
")",
"{",
"throw",
"new",
"AccessException",
"(",
"'Allowed values cannot be set from a lazy option or normalizer.'",
")",
";",... | Sets allowed values for an option.
Instead of passing values, you may also pass a closures with the
following signature:
function ($value) {
// return true or false
}
The closure receives the value as argument and should return true to
accept the value and false to reject the value.
@param string $option The... | [
"Sets",
"allowed",
"values",
"for",
"an",
"option",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/OptionsResolver/OptionsResolver.php#L565-L581 | train | Sets allowed values for an option | [
30522,
2270,
3853,
2275,
8095,
15096,
10175,
15808,
1006,
1002,
5724,
1010,
1002,
3039,
10175,
15808,
1007,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
5299,
1007,
1063,
5466,
2047,
3229,
10288,
24422,
1006,
1005,
3039,
5300,
3685,
2022,
2275... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Db2.php | Zend_Db_Adapter_Db2.lastInsertId | public function lastInsertId($tableName = null, $primaryKey = null, $idType = null)
{
$this->_connect();
if ($this->_isI5) {
return (string) $this->_i5LastInsertId($tableName, $idType);
}
if ($tableName !== null) {
$sequenceName = $tableName;
if ... | php | public function lastInsertId($tableName = null, $primaryKey = null, $idType = null)
{
$this->_connect();
if ($this->_isI5) {
return (string) $this->_i5LastInsertId($tableName, $idType);
}
if ($tableName !== null) {
$sequenceName = $tableName;
if ... | [
"public",
"function",
"lastInsertId",
"(",
"$",
"tableName",
"=",
"null",
",",
"$",
"primaryKey",
"=",
"null",
",",
"$",
"idType",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"_connect",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"_isI5",
")",
"{",... | Gets the last ID generated automatically by an IDENTITY/AUTOINCREMENT column.
As a convention, on RDBMS brands that support sequences
(e.g. Oracle, PostgreSQL, DB2), this method forms the name of a sequence
from the arguments and returns the last id generated by that sequence.
On RDBMS brands that support IDENTITY/AUT... | [
"Gets",
"the",
"last",
"ID",
"generated",
"automatically",
"by",
"an",
"IDENTITY",
"/",
"AUTOINCREMENT",
"column",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Adapter/Db2.php#L551-L571 | train | Return last inserted id | [
30522,
2270,
3853,
2197,
7076,
8743,
3593,
1006,
1002,
2795,
18442,
1027,
19701,
1010,
1002,
3078,
14839,
1027,
19701,
1010,
1002,
8909,
13874,
1027,
19701,
1007,
1063,
1002,
2023,
1011,
1028,
1035,
7532,
1006,
1007,
1025,
2065,
1006,
1002,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/cms/classes/Controller.php | Controller.renderContent | public function renderContent($name, $parameters = [])
{
/**
* @event cms.page.beforeRenderContent
* Provides an oportunity to manipulate the name of the content file being rendered before it renders
*
* Example usage:
*
* Event::listen('cms.page.bef... | php | public function renderContent($name, $parameters = [])
{
/**
* @event cms.page.beforeRenderContent
* Provides an oportunity to manipulate the name of the content file being rendered before it renders
*
* Example usage:
*
* Event::listen('cms.page.bef... | [
"public",
"function",
"renderContent",
"(",
"$",
"name",
",",
"$",
"parameters",
"=",
"[",
"]",
")",
"{",
"/**\n * @event cms.page.beforeRenderContent\n * Provides an oportunity to manipulate the name of the content file being rendered before it renders\n *\n ... | Renders a requested content file.
The framework uses this method internally.
@param string $name The content view to load.
@param array $parameters Parameter variables to pass to the view.
@return string | [
"Renders",
"a",
"requested",
"content",
"file",
".",
"The",
"framework",
"uses",
"this",
"method",
"internally",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/Controller.php#L1130-L1198 | train | Renders content from the content file | [
30522,
2270,
3853,
17552,
8663,
6528,
2102,
1006,
1002,
2171,
1010,
1002,
11709,
1027,
1031,
1033,
1007,
1063,
1013,
1008,
1008,
1008,
1030,
2724,
4642,
2015,
1012,
3931,
1012,
2077,
7389,
4063,
8663,
6528,
2102,
1008,
3640,
2019,
6728,
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/Bridge/Twig/Extension/CodeExtension.php | CodeExtension.getFileLink | public function getFileLink($file, $line)
{
if ($fmt = $this->fileLinkFormat) {
return \is_string($fmt) ? strtr($fmt, ['%f' => $file, '%l' => $line]) : $fmt->format($file, $line);
}
return false;
} | php | public function getFileLink($file, $line)
{
if ($fmt = $this->fileLinkFormat) {
return \is_string($fmt) ? strtr($fmt, ['%f' => $file, '%l' => $line]) : $fmt->format($file, $line);
}
return false;
} | [
"public",
"function",
"getFileLink",
"(",
"$",
"file",
",",
"$",
"line",
")",
"{",
"if",
"(",
"$",
"fmt",
"=",
"$",
"this",
"->",
"fileLinkFormat",
")",
"{",
"return",
"\\",
"is_string",
"(",
"$",
"fmt",
")",
"?",
"strtr",
"(",
"$",
"fmt",
",",
"... | Returns the link for a given file/line pair.
@param string $file An absolute file path
@param int $line The line number
@return string|false A link or false | [
"Returns",
"the",
"link",
"for",
"a",
"given",
"file",
"/",
"line",
"pair",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bridge/Twig/Extension/CodeExtension.php#L205-L212 | train | Get file link | [
30522,
2270,
3853,
2131,
8873,
2571,
13767,
1006,
1002,
5371,
1010,
1002,
2240,
1007,
1063,
2065,
1006,
1002,
4718,
2102,
1027,
1002,
2023,
1011,
1028,
5371,
13767,
14192,
4017,
1007,
1063,
2709,
1032,
2003,
1035,
5164,
1006,
1002,
4718,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/Zend/Db/Statement/Db2.php | Zend_Db_Statement_Db2.rowCount | public function rowCount()
{
if (!$this->_stmt) {
return false;
}
$num = @db2_num_rows($this->_stmt);
if ($num === false) {
return 0;
}
return $num;
} | php | public function rowCount()
{
if (!$this->_stmt) {
return false;
}
$num = @db2_num_rows($this->_stmt);
if ($num === false) {
return 0;
}
return $num;
} | [
"public",
"function",
"rowCount",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_stmt",
")",
"{",
"return",
"false",
";",
"}",
"$",
"num",
"=",
"@",
"db2_num_rows",
"(",
"$",
"this",
"->",
"_stmt",
")",
";",
"if",
"(",
"$",
"num",
"===",
"... | Returns the number of rows affected by the execution of the
last INSERT, DELETE, or UPDATE statement executed by this
statement object.
@return int The number of rows affected. | [
"Returns",
"the",
"number",
"of",
"rows",
"affected",
"by",
"the",
"execution",
"of",
"the",
"last",
"INSERT",
"DELETE",
"or",
"UPDATE",
"statement",
"executed",
"by",
"this",
"statement",
"object",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Statement/Db2.php#L320-L333 | train | Return the number of rows in the result set | [
30522,
2270,
3853,
5216,
3597,
16671,
1006,
1007,
1063,
2065,
1006,
999,
1002,
2023,
1011,
1028,
1035,
2358,
20492,
1007,
1063,
2709,
6270,
1025,
1065,
1002,
16371,
2213,
1027,
1030,
16962,
2475,
1035,
16371,
2213,
1035,
10281,
1006,
1002,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Common/Page/Page.php | Page.filePath | public function filePath($var = null)
{
if ($var !== null) {
// Filename of the page.
$this->name = basename($var);
// Folder of the page.
$this->folder = basename(dirname($var));
// Path to the page.
$this->path = dirname($var, 2);
... | php | public function filePath($var = null)
{
if ($var !== null) {
// Filename of the page.
$this->name = basename($var);
// Folder of the page.
$this->folder = basename(dirname($var));
// Path to the page.
$this->path = dirname($var, 2);
... | [
"public",
"function",
"filePath",
"(",
"$",
"var",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"var",
"!==",
"null",
")",
"{",
"// Filename of the page.",
"$",
"this",
"->",
"name",
"=",
"basename",
"(",
"$",
"var",
")",
";",
"// Folder of the page.",
"$",
... | Gets and sets the path to the .md file for this Page object.
@param string $var the file path
@return string|null the file path | [
"Gets",
"and",
"sets",
"the",
"path",
"to",
"the",
".",
"md",
"file",
"for",
"this",
"Page",
"object",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Page/Page.php#L2091-L2103 | train | Return the path to the page file | [
30522,
2270,
3853,
5371,
15069,
1006,
1002,
13075,
1027,
19701,
1007,
1063,
2065,
1006,
1002,
13075,
999,
1027,
1027,
19701,
1007,
1063,
1013,
1013,
5371,
18442,
1997,
1996,
3931,
1012,
1002,
2023,
1011,
1028,
2171,
1027,
2918,
18442,
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/Taxonomy.php | Taxonomy.addTaxonomy | public function addTaxonomy(PageInterface $page, $page_taxonomy = null)
{
if (!$page_taxonomy) {
$page_taxonomy = $page->taxonomy();
}
if (empty($page_taxonomy) || !$page->published()) {
return;
}
/** @var Config $config */
$config = $this->g... | php | public function addTaxonomy(PageInterface $page, $page_taxonomy = null)
{
if (!$page_taxonomy) {
$page_taxonomy = $page->taxonomy();
}
if (empty($page_taxonomy) || !$page->published()) {
return;
}
/** @var Config $config */
$config = $this->g... | [
"public",
"function",
"addTaxonomy",
"(",
"PageInterface",
"$",
"page",
",",
"$",
"page_taxonomy",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"page_taxonomy",
")",
"{",
"$",
"page_taxonomy",
"=",
"$",
"page",
"->",
"taxonomy",
"(",
")",
";",
"}",
"if"... | Takes an individual page and processes the taxonomies configured in its header. It
then adds those taxonomies to the map
@param PageInterface $page the page to process
@param array $page_taxonomy | [
"Takes",
"an",
"individual",
"page",
"and",
"processes",
"the",
"taxonomies",
"configured",
"in",
"its",
"header",
".",
"It",
"then",
"adds",
"those",
"taxonomies",
"to",
"the",
"map"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Taxonomy.php#L56-L77 | train | Add taxonomy to page | [
30522,
2270,
3853,
5587,
2696,
22500,
16940,
1006,
3931,
18447,
2121,
12172,
1002,
3931,
1010,
1002,
3931,
1035,
25274,
1027,
19701,
1007,
1063,
2065,
1006,
999,
1002,
3931,
1035,
25274,
1007,
1063,
1002,
3931,
1035,
25274,
1027,
1002,
3931... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Database/Eloquent/Relations/Concerns/InteractsWithPivotTable.php | InteractsWithPivotTable.newPivot | public function newPivot(array $attributes = [], $exists = false)
{
$pivot = $this->related->newPivot(
$this->parent, $attributes, $this->table, $exists, $this->using
);
return $pivot->setPivotKeys($this->foreignPivotKey, $this->relatedPivotKey);
} | php | public function newPivot(array $attributes = [], $exists = false)
{
$pivot = $this->related->newPivot(
$this->parent, $attributes, $this->table, $exists, $this->using
);
return $pivot->setPivotKeys($this->foreignPivotKey, $this->relatedPivotKey);
} | [
"public",
"function",
"newPivot",
"(",
"array",
"$",
"attributes",
"=",
"[",
"]",
",",
"$",
"exists",
"=",
"false",
")",
"{",
"$",
"pivot",
"=",
"$",
"this",
"->",
"related",
"->",
"newPivot",
"(",
"$",
"this",
"->",
"parent",
",",
"$",
"attributes",... | Create a new pivot model instance.
@param array $attributes
@param bool $exists
@return \Illuminate\Database\Eloquent\Relations\Pivot | [
"Create",
"a",
"new",
"pivot",
"model",
"instance",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Relations/Concerns/InteractsWithPivotTable.php#L464-L471 | train | Create a new pivot table | [
30522,
2270,
3853,
2047,
8197,
22994,
1006,
9140,
1002,
12332,
1027,
1031,
1033,
1010,
1002,
6526,
1027,
6270,
1007,
1063,
1002,
14255,
22994,
1027,
1002,
2023,
1011,
1028,
3141,
1011,
1028,
2047,
8197,
22994,
1006,
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... |
laravel/framework | src/Illuminate/Queue/Queue.php | Queue.createStringPayload | protected function createStringPayload($job, $queue, $data)
{
return $this->withCreatePayloadHooks($queue, [
'displayName' => is_string($job) ? explode('@', $job)[0] : null,
'job' => $job,
'maxTries' => null,
'delay' => null,
'timeout' => null,
... | php | protected function createStringPayload($job, $queue, $data)
{
return $this->withCreatePayloadHooks($queue, [
'displayName' => is_string($job) ? explode('@', $job)[0] : null,
'job' => $job,
'maxTries' => null,
'delay' => null,
'timeout' => null,
... | [
"protected",
"function",
"createStringPayload",
"(",
"$",
"job",
",",
"$",
"queue",
",",
"$",
"data",
")",
"{",
"return",
"$",
"this",
"->",
"withCreatePayloadHooks",
"(",
"$",
"queue",
",",
"[",
"'displayName'",
"=>",
"is_string",
"(",
"$",
"job",
")",
... | Create a typical, string based queue payload array.
@param string $job
@param string $queue
@param mixed $data
@return array | [
"Create",
"a",
"typical",
"string",
"based",
"queue",
"payload",
"array",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Queue/Queue.php#L200-L210 | train | Create payload for string | [
30522,
5123,
3853,
9005,
18886,
3070,
4502,
8516,
10441,
2094,
1006,
1002,
3105,
1010,
1002,
24240,
1010,
1002,
2951,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
2007,
16748,
3686,
4502,
8516,
10441,
16425,
14659,
2015,
1006,
1002,
24240,
305... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/Plugin/Manager.php | Manager.activatePlugin | public function activatePlugin($pluginName)
{
$plugins = $this->pluginList->getActivatedPlugins();
if (in_array($pluginName, $plugins)) {
// plugin is already activated
return;
}
if (!$this->isPluginInFilesystem($pluginName)) {
throw new \Exceptio... | php | public function activatePlugin($pluginName)
{
$plugins = $this->pluginList->getActivatedPlugins();
if (in_array($pluginName, $plugins)) {
// plugin is already activated
return;
}
if (!$this->isPluginInFilesystem($pluginName)) {
throw new \Exceptio... | [
"public",
"function",
"activatePlugin",
"(",
"$",
"pluginName",
")",
"{",
"$",
"plugins",
"=",
"$",
"this",
"->",
"pluginList",
"->",
"getActivatedPlugins",
"(",
")",
";",
"if",
"(",
"in_array",
"(",
"$",
"pluginName",
",",
"$",
"plugins",
")",
")",
"{",... | Activate the specified plugin and install (if needed)
@param string $pluginName Name of plugin
@throws \Exception | [
"Activate",
"the",
"specified",
"plugin",
"and",
"install",
"(",
"if",
"needed",
")"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Plugin/Manager.php#L635-L671 | train | Activate a plugin | [
30522,
2270,
3853,
20544,
24759,
15916,
2378,
1006,
1002,
13354,
23111,
14074,
1007,
1063,
1002,
13354,
7076,
1027,
1002,
2023,
1011,
1028,
13354,
2378,
9863,
1011,
1028,
2131,
30524,
1065,
2065,
1006,
999,
1002,
2023,
1011,
1028,
2003,
247... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/SettingsProvider.php | SettingsProvider.getMeasurableSettings | public function getMeasurableSettings($pluginName, $idSite, $idType = null)
{
$plugin = $this->getLoadedAndActivated($pluginName);
if ($plugin) {
$component = $plugin->findComponent('MeasurableSettings', 'Piwik\\Settings\\Measurable\\MeasurableSettings');
if ($component) {
... | php | public function getMeasurableSettings($pluginName, $idSite, $idType = null)
{
$plugin = $this->getLoadedAndActivated($pluginName);
if ($plugin) {
$component = $plugin->findComponent('MeasurableSettings', 'Piwik\\Settings\\Measurable\\MeasurableSettings');
if ($component) {
... | [
"public",
"function",
"getMeasurableSettings",
"(",
"$",
"pluginName",
",",
"$",
"idSite",
",",
"$",
"idType",
"=",
"null",
")",
"{",
"$",
"plugin",
"=",
"$",
"this",
"->",
"getLoadedAndActivated",
"(",
"$",
"pluginName",
")",
";",
"if",
"(",
"$",
"plugi... | @api
Get measurable settings for a specific plugin.
@param string $pluginName The name of a plugin.
@param int $idSite The ID of a site. If a site is about to be created pass idSite = 0.
@param string|null $idType If null, idType will be detected automatically if the site already exists. Only
needed to... | [
"@api"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Plugin/SettingsProvider.php#L151-L165 | train | Returns theMeasurableSettings component | [
30522,
2270,
3853,
2131,
4168,
28329,
21678,
8613,
1006,
1002,
13354,
23111,
14074,
1010,
1002,
8909,
28032,
2063,
1010,
1002,
8909,
13874,
1027,
19701,
1007,
1063,
1002,
13354,
2378,
1027,
1002,
2023,
1011,
1028,
2131,
17468,
13832,
6593,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/Archive.php | Archive.getArchiveGroupOfPlugin | private function getArchiveGroupOfPlugin($plugin)
{
$periods = $this->params->getPeriods();
$periodLabel = reset($periods)->getLabel();
if (Rules::shouldProcessReportsAllPlugins($this->params->getIdSites(), $this->params->getSegment(), $periodLabel)) {
return self::ARCHI... | php | private function getArchiveGroupOfPlugin($plugin)
{
$periods = $this->params->getPeriods();
$periodLabel = reset($periods)->getLabel();
if (Rules::shouldProcessReportsAllPlugins($this->params->getIdSites(), $this->params->getSegment(), $periodLabel)) {
return self::ARCHI... | [
"private",
"function",
"getArchiveGroupOfPlugin",
"(",
"$",
"plugin",
")",
"{",
"$",
"periods",
"=",
"$",
"this",
"->",
"params",
"->",
"getPeriods",
"(",
")",
";",
"$",
"periodLabel",
"=",
"reset",
"(",
"$",
"periods",
")",
"->",
"getLabel",
"(",
")",
... | Returns the archiving group identifier given a plugin.
More than one plugin can be called at once when archiving. In such a case
we don't want to launch archiving three times for three plugins if doing
it once is enough, so getArchiveIds makes sure to get the archive group of
all reports.
If the period isn't a range,... | [
"Returns",
"the",
"archiving",
"group",
"identifier",
"given",
"a",
"plugin",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Archive.php#L797-L807 | train | Return archive group of plugin | [
30522,
2797,
3853,
2131,
2906,
5428,
3726,
17058,
11253,
24759,
15916,
2378,
1006,
1002,
13354,
2378,
1007,
1063,
1002,
6993,
1027,
1002,
2023,
1011,
1028,
11498,
5244,
1011,
1028,
2131,
4842,
3695,
5104,
1006,
1007,
1025,
1002,
2558,
20470... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Database/Eloquent/Relations/Relation.php | Relation.noConstraints | public static function noConstraints(Closure $callback)
{
$previous = static::$constraints;
static::$constraints = false;
// When resetting the relation where clause, we want to shift the first element
// off of the bindings, leaving only the constraints that the developers put
... | php | public static function noConstraints(Closure $callback)
{
$previous = static::$constraints;
static::$constraints = false;
// When resetting the relation where clause, we want to shift the first element
// off of the bindings, leaving only the constraints that the developers put
... | [
"public",
"static",
"function",
"noConstraints",
"(",
"Closure",
"$",
"callback",
")",
"{",
"$",
"previous",
"=",
"static",
"::",
"$",
"constraints",
";",
"static",
"::",
"$",
"constraints",
"=",
"false",
";",
"// When resetting the relation where clause, we want to... | Run a callback with constraints disabled on the relation.
@param \Closure $callback
@return mixed | [
"Run",
"a",
"callback",
"with",
"constraints",
"disabled",
"on",
"the",
"relation",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Relations/Relation.php#L80-L94 | train | This function does not reset the constraints. | [
30522,
2270,
10763,
3853,
2053,
8663,
20528,
18447,
2015,
1006,
8503,
1002,
2655,
5963,
1007,
1063,
1002,
3025,
1027,
10763,
1024,
1024,
1002,
14679,
1025,
10763,
1024,
1024,
1002,
14679,
1027,
6270,
1025,
1013,
1013,
2043,
25141,
3436,
199... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/NumberFormatter.php | NumberFormatter.format | public function format($value, $maximumFractionDigits=0, $minimumFractionDigits=0)
{
if (is_string($value)
&& trim($value, '%') != $value
) {
return $this->formatPercent($value, $maximumFractionDigits, $minimumFractionDigits);
}
return $this->formatNumber($va... | php | public function format($value, $maximumFractionDigits=0, $minimumFractionDigits=0)
{
if (is_string($value)
&& trim($value, '%') != $value
) {
return $this->formatPercent($value, $maximumFractionDigits, $minimumFractionDigits);
}
return $this->formatNumber($va... | [
"public",
"function",
"format",
"(",
"$",
"value",
",",
"$",
"maximumFractionDigits",
"=",
"0",
",",
"$",
"minimumFractionDigits",
"=",
"0",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"value",
")",
"&&",
"trim",
"(",
"$",
"value",
",",
"'%'",
")",
"... | Formats a given number or percent value (if $value starts or ends with a %)
@param string|int|float $value
@param int $maximumFractionDigits
@param int $minimumFractionDigits
@return mixed|string | [
"Formats",
"a",
"given",
"number",
"or",
"percent",
"value",
"(",
"if",
"$value",
"starts",
"or",
"ends",
"with",
"a",
"%",
")"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/NumberFormatter.php#L52-L61 | train | Format a value to the maximum and minimum fraction digits of the phrase | [
30522,
2270,
3853,
4289,
1006,
1002,
3643,
1010,
1002,
4555,
27843,
7542,
4305,
23806,
2015,
1027,
1014,
1010,
1002,
6263,
27843,
7542,
4305,
23806,
2015,
1027,
1014,
1007,
1063,
2065,
1006,
2003,
1035,
5164,
1006,
1002,
3643,
1007,
1004,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/Zend/Cache/Backend/Static.php | Zend_Cache_Backend_Static.getOption | public function getOption($name)
{
if ($name == 'tag_cache') {
return $this->getInnerCache();
} else {
if (in_array($name, $this->_options)) {
return $this->_options[$name];
}
if ($name == 'lifetime') {
return parent::ge... | php | public function getOption($name)
{
if ($name == 'tag_cache') {
return $this->getInnerCache();
} else {
if (in_array($name, $this->_options)) {
return $this->_options[$name];
}
if ($name == 'lifetime') {
return parent::ge... | [
"public",
"function",
"getOption",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"$",
"name",
"==",
"'tag_cache'",
")",
"{",
"return",
"$",
"this",
"->",
"getInnerCache",
"(",
")",
";",
"}",
"else",
"{",
"if",
"(",
"in_array",
"(",
"$",
"name",
",",
"$",
... | Retrieve any option via interception of the parent's statically held
options including the local option for a tag cache.
@param string $name
@return mixed | [
"Retrieve",
"any",
"option",
"via",
"interception",
"of",
"the",
"parent",
"s",
"statically",
"held",
"options",
"including",
"the",
"local",
"option",
"for",
"a",
"tag",
"cache",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache/Backend/Static.php#L100-L113 | train | Get an option | [
30522,
2270,
3853,
2131,
7361,
3508,
1006,
1002,
2171,
1007,
1063,
2065,
1006,
1002,
2171,
1027,
1027,
1005,
6415,
1035,
17053,
1005,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
2131,
23111,
2121,
3540,
5403,
1006,
1007,
1025,
1065,
2842,
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/Validation/Concerns/ReplacesAttributes.php | ReplacesAttributes.replaceSame | protected function replaceSame($message, $attribute, $rule, $parameters)
{
return str_replace(':other', $this->getDisplayableAttribute($parameters[0]), $message);
} | php | protected function replaceSame($message, $attribute, $rule, $parameters)
{
return str_replace(':other', $this->getDisplayableAttribute($parameters[0]), $message);
} | [
"protected",
"function",
"replaceSame",
"(",
"$",
"message",
",",
"$",
"attribute",
",",
"$",
"rule",
",",
"$",
"parameters",
")",
"{",
"return",
"str_replace",
"(",
"':other'",
",",
"$",
"this",
"->",
"getDisplayableAttribute",
"(",
"$",
"parameters",
"[",
... | Replace all place-holders for the same rule.
@param string $message
@param string $attribute
@param string $rule
@param array $parameters
@return string | [
"Replace",
"all",
"place",
"-",
"holders",
"for",
"the",
"same",
"rule",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Validation/Concerns/ReplacesAttributes.php#L372-L375 | train | Replace all occurrences of the rule with the same value. | [
30522,
5123,
3853,
20736,
14074,
1006,
1002,
4471,
1010,
1002,
17961,
1010,
1002,
3627,
1010,
1002,
11709,
1007,
1063,
2709,
2358,
2099,
1035,
5672,
1006,
1005,
1024,
2060,
1005,
1010,
1002,
2023,
1011,
1028,
2131,
10521,
13068,
3085,
19321... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Translation/Catalogue/AbstractOperation.php | AbstractOperation.getResult | public function getResult()
{
foreach ($this->getDomains() as $domain) {
if (!isset($this->messages[$domain])) {
$this->processDomain($domain);
}
}
return $this->result;
} | php | public function getResult()
{
foreach ($this->getDomains() as $domain) {
if (!isset($this->messages[$domain])) {
$this->processDomain($domain);
}
}
return $this->result;
} | [
"public",
"function",
"getResult",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getDomains",
"(",
")",
"as",
"$",
"domain",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"messages",
"[",
"$",
"domain",
"]",
")",
")",
"{",
"$",
... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Translation/Catalogue/AbstractOperation.php#L139-L148 | train | Get Result of all Domains | [
30522,
2270,
3853,
2131,
6072,
11314,
1006,
1007,
1063,
18921,
6776,
1006,
1002,
2023,
1011,
1028,
2131,
9527,
28247,
1006,
1007,
2004,
1002,
5884,
1007,
1063,
2065,
1006,
999,
26354,
3388,
1006,
1002,
2023,
1011,
1028,
7696,
1031,
1002,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Finder/Finder.php | Finder.ignoreDotFiles | public function ignoreDotFiles($ignoreDotFiles)
{
if ($ignoreDotFiles) {
$this->ignore |= static::IGNORE_DOT_FILES;
} else {
$this->ignore &= ~static::IGNORE_DOT_FILES;
}
return $this;
} | php | public function ignoreDotFiles($ignoreDotFiles)
{
if ($ignoreDotFiles) {
$this->ignore |= static::IGNORE_DOT_FILES;
} else {
$this->ignore &= ~static::IGNORE_DOT_FILES;
}
return $this;
} | [
"public",
"function",
"ignoreDotFiles",
"(",
"$",
"ignoreDotFiles",
")",
"{",
"if",
"(",
"$",
"ignoreDotFiles",
")",
"{",
"$",
"this",
"->",
"ignore",
"|=",
"static",
"::",
"IGNORE_DOT_FILES",
";",
"}",
"else",
"{",
"$",
"this",
"->",
"ignore",
"&=",
"~"... | Excludes "hidden" directories and files (starting with a dot).
This option is enabled by default.
@param bool $ignoreDotFiles Whether to exclude "hidden" files or not
@return $this
@see ExcludeDirectoryFilterIterator | [
"Excludes",
"hidden",
"directories",
"and",
"files",
"(",
"starting",
"with",
"a",
"dot",
")",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Finder/Finder.php#L345-L354 | train | Set flag to ignore dot files | [
30522,
2270,
3853,
6439,
4140,
8873,
4244,
1006,
1002,
6439,
4140,
8873,
4244,
1007,
1063,
2065,
1006,
1002,
6439,
4140,
8873,
4244,
1007,
1063,
1002,
2023,
1011,
1028,
8568,
1064,
1027,
10763,
1024,
1024,
8568,
1035,
11089,
1035,
6764,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/Zend/Db/Adapter/Abstract.php | Zend_Db_Adapter_Abstract._quoteIdentifierAs | protected function _quoteIdentifierAs($ident, $alias = null, $auto = false, $as = ' AS ')
{
if ($ident instanceof Zend_Db_Expr) {
$quoted = $ident->__toString();
} elseif ($ident instanceof Zend_Db_Select) {
$quoted = '(' . $ident->assemble() . ')';
} else {
... | php | protected function _quoteIdentifierAs($ident, $alias = null, $auto = false, $as = ' AS ')
{
if ($ident instanceof Zend_Db_Expr) {
$quoted = $ident->__toString();
} elseif ($ident instanceof Zend_Db_Select) {
$quoted = '(' . $ident->assemble() . ')';
} else {
... | [
"protected",
"function",
"_quoteIdentifierAs",
"(",
"$",
"ident",
",",
"$",
"alias",
"=",
"null",
",",
"$",
"auto",
"=",
"false",
",",
"$",
"as",
"=",
"' AS '",
")",
"{",
"if",
"(",
"$",
"ident",
"instanceof",
"Zend_Db_Expr",
")",
"{",
"$",
"quoted",
... | Quote an identifier and an optional alias.
@param string|array|Zend_Db_Expr $ident The identifier or expression.
@param string $alias An optional alias.
@param boolean $auto If true, heed the AUTO_QUOTE_IDENTIFIERS config option.
@param string $as The string to add between the identifier/expression and the alias.
@ret... | [
"Quote",
"an",
"identifier",
"and",
"an",
"optional",
"alias",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Adapter/Abstract.php#L1004-L1035 | train | Quote identifier as | [
30522,
5123,
3853,
1035,
14686,
5178,
16778,
8873,
24140,
1006,
1002,
8909,
4765,
1010,
1002,
14593,
1027,
19701,
1010,
1002,
8285,
1027,
6270,
1010,
1002,
2004,
1027,
1005,
2004,
1005,
1007,
1063,
2065,
1006,
1002,
8909,
4765,
6013,
11253,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Constraints/CardSchemeValidator.php | CardSchemeValidator.validate | public function validate($value, Constraint $constraint)
{
if (!$constraint instanceof CardScheme) {
throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\CardScheme');
}
if (null === $value || '' === $value) {
return;
}
if (!is_numeric($val... | php | public function validate($value, Constraint $constraint)
{
if (!$constraint instanceof CardScheme) {
throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\CardScheme');
}
if (null === $value || '' === $value) {
return;
}
if (!is_numeric($val... | [
"public",
"function",
"validate",
"(",
"$",
"value",
",",
"Constraint",
"$",
"constraint",
")",
"{",
"if",
"(",
"!",
"$",
"constraint",
"instanceof",
"CardScheme",
")",
"{",
"throw",
"new",
"UnexpectedTypeException",
"(",
"$",
"constraint",
",",
"__NAMESPACE__... | Validates a creditcard belongs to a specified scheme.
@param mixed $value
@param Constraint $constraint | [
"Validates",
"a",
"creditcard",
"belongs",
"to",
"a",
"specified",
"scheme",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Validator/Constraints/CardSchemeValidator.php#L101-L135 | train | Checks if the value is a valid card scheme | [
30522,
2270,
3853,
9398,
3686,
1006,
1002,
3643,
1010,
27142,
1002,
27142,
1007,
30524,
1035,
1012,
1005,
1032,
5329,
5403,
4168,
1005,
1007,
1025,
1065,
2065,
1006,
19701,
1027,
1027,
1027,
1002,
3643,
1064,
1064,
1005,
1005,
1027,
1027,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/Zend/Cache/Frontend/Capture.php | Zend_Cache_Frontend_Capture._flush | public function _flush($data)
{
$id = array_pop($this->_idStack);
if ($id === null) {
Zend_Cache::throwException('use of _flush() without a start()');
}
if ($this->_extension) {
$this->save(serialize(array($data, $this->_extension)), $id, $this->_tags);
... | php | public function _flush($data)
{
$id = array_pop($this->_idStack);
if ($id === null) {
Zend_Cache::throwException('use of _flush() without a start()');
}
if ($this->_extension) {
$this->save(serialize(array($data, $this->_extension)), $id, $this->_tags);
... | [
"public",
"function",
"_flush",
"(",
"$",
"data",
")",
"{",
"$",
"id",
"=",
"array_pop",
"(",
"$",
"this",
"->",
"_idStack",
")",
";",
"if",
"(",
"$",
"id",
"===",
"null",
")",
"{",
"Zend_Cache",
"::",
"throwException",
"(",
"'use of _flush() without a s... | callback for output buffering
(shouldn't really be called manually)
@param string $data Buffered output
@return string Data to send to browser | [
"callback",
"for",
"output",
"buffering",
"(",
"shouldn",
"t",
"really",
"be",
"called",
"manually",
")"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache/Frontend/Capture.php#L75-L87 | train | Flushes the cache | [
30522,
2270,
3853,
1035,
13862,
1006,
1002,
2951,
1007,
1063,
1002,
8909,
1027,
9140,
1035,
3769,
1006,
1002,
2023,
1011,
1028,
1035,
8909,
9153,
3600,
1007,
1025,
2065,
1006,
1002,
8909,
1027,
1027,
1027,
19701,
1007,
1063,
16729,
30524,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
z-song/laravel-admin | src/Form/Field/HasMany.php | HasMany.buildRelatedForms | protected function buildRelatedForms()
{
if (is_null($this->form)) {
return [];
}
$model = $this->form->model();
$relation = call_user_func([$model, $this->relationName]);
if (!$relation instanceof Relation && !$relation instanceof MorphMany) {
thro... | php | protected function buildRelatedForms()
{
if (is_null($this->form)) {
return [];
}
$model = $this->form->model();
$relation = call_user_func([$model, $this->relationName]);
if (!$relation instanceof Relation && !$relation instanceof MorphMany) {
thro... | [
"protected",
"function",
"buildRelatedForms",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"form",
")",
")",
"{",
"return",
"[",
"]",
";",
"}",
"$",
"model",
"=",
"$",
"this",
"->",
"form",
"->",
"model",
"(",
")",
";",
"$",
"rela... | Build Nested form for related data.
@throws \Exception
@return array | [
"Build",
"Nested",
"form",
"for",
"related",
"data",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Form/Field/HasMany.php#L359-L405 | train | Build related forms | [
30522,
5123,
3853,
3857,
16570,
4383,
22694,
1006,
1007,
1063,
2065,
1006,
2003,
1035,
19701,
1006,
1002,
2023,
1011,
1028,
2433,
1007,
1007,
1063,
2709,
1031,
1033,
1025,
1065,
1002,
2944,
1027,
1002,
2023,
1011,
1028,
2433,
1011,
1028,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
overtrue/wechat | src/Payment/Bill/Client.php | Client.get | public function get(string $date, string $type = 'ALL', array $optional = [])
{
$params = [
'appid' => $this->app['config']->app_id,
'bill_date' => $date,
'bill_type' => $type,
] + $optional;
$response = $this->requestRaw($this->wrap('pay/downloadbill'), ... | php | public function get(string $date, string $type = 'ALL', array $optional = [])
{
$params = [
'appid' => $this->app['config']->app_id,
'bill_date' => $date,
'bill_type' => $type,
] + $optional;
$response = $this->requestRaw($this->wrap('pay/downloadbill'), ... | [
"public",
"function",
"get",
"(",
"string",
"$",
"date",
",",
"string",
"$",
"type",
"=",
"'ALL'",
",",
"array",
"$",
"optional",
"=",
"[",
"]",
")",
"{",
"$",
"params",
"=",
"[",
"'appid'",
"=>",
"$",
"this",
"->",
"app",
"[",
"'config'",
"]",
"... | Download bill history as a table file.
@param string $date
@param string $type
@return \EasyWeChat\Kernel\Http\StreamResponse|\Psr\Http\Message\ResponseInterface|\EasyWeChat\Kernel\Support\Collection|array|object|string
@throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException | [
"Download",
"bill",
"history",
"as",
"a",
"table",
"file",
"."
] | 120c72faaa93c270365bc75c73c362d5fd583209 | https://github.com/overtrue/wechat/blob/120c72faaa93c270365bc75c73c362d5fd583209/src/Payment/Bill/Client.php#L29-L44 | train | Download bill. | [
30522,
2270,
3853,
2131,
1006,
5164,
1002,
3058,
1010,
5164,
1002,
2828,
1027,
1005,
2035,
1005,
1010,
9140,
1002,
11887,
1027,
1031,
1033,
1007,
1063,
1002,
11498,
5244,
1027,
1031,
1005,
10439,
3593,
1005,
1027,
1028,
1002,
2023,
1011,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Foundation/Support/Providers/EventServiceProvider.php | EventServiceProvider.discoverEvents | public function discoverEvents()
{
return collect($this->discoverEventsWithin())
->reject(function ($directory) {
return ! is_dir($directory);
})
->reduce(function ($discovered, $directory) {
return a... | php | public function discoverEvents()
{
return collect($this->discoverEventsWithin())
->reject(function ($directory) {
return ! is_dir($directory);
})
->reduce(function ($discovered, $directory) {
return a... | [
"public",
"function",
"discoverEvents",
"(",
")",
"{",
"return",
"collect",
"(",
"$",
"this",
"->",
"discoverEventsWithin",
"(",
")",
")",
"->",
"reject",
"(",
"function",
"(",
"$",
"directory",
")",
"{",
"return",
"!",
"is_dir",
"(",
"$",
"directory",
"... | Discover the events and listeners for the application.
@return array | [
"Discover",
"the",
"events",
"and",
"listeners",
"for",
"the",
"application",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Foundation/Support/Providers/EventServiceProvider.php#L89-L101 | train | Returns all discover events within the base path | [
30522,
2270,
3853,
7523,
18697,
7666,
1006,
1007,
1063,
2709,
8145,
1006,
1002,
2023,
1011,
1028,
7523,
18697,
7666,
24415,
2378,
1006,
1007,
1007,
1011,
1028,
15454,
1006,
3853,
1006,
1002,
14176,
1007,
1063,
2709,
999,
2003,
1035,
16101,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/HandlerStack.php | HandlerStack.unshift | public function unshift(callable $middleware, $name = null)
{
array_unshift($this->stack, [$middleware, $name]);
$this->cached = null;
} | php | public function unshift(callable $middleware, $name = null)
{
array_unshift($this->stack, [$middleware, $name]);
$this->cached = null;
} | [
"public",
"function",
"unshift",
"(",
"callable",
"$",
"middleware",
",",
"$",
"name",
"=",
"null",
")",
"{",
"array_unshift",
"(",
"$",
"this",
"->",
"stack",
",",
"[",
"$",
"middleware",
",",
"$",
"name",
"]",
")",
";",
"$",
"this",
"->",
"cached",... | Unshift a middleware to the bottom of the stack.
@param callable $middleware Middleware function
@param string $name Name to register for this middleware. | [
"Unshift",
"a",
"middleware",
"to",
"the",
"bottom",
"of",
"the",
"stack",
"."
] | bf595424e4d442a190582e088985dc835a789071 | https://github.com/guzzle/guzzle/blob/bf595424e4d442a190582e088985dc835a789071/src/HandlerStack.php#L127-L131 | train | Prepend a middleware to the beginning of the stack | [
30522,
2270,
3853,
4895,
6182,
6199,
1006,
2655,
3085,
1002,
2690,
8059,
1010,
1002,
2171,
1027,
19701,
1007,
1063,
9140,
1035,
4895,
6182,
6199,
1006,
1002,
2023,
1011,
1028,
9991,
1010,
1031,
1002,
2690,
8059,
1010,
1002,
2171,
1033,
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/Intl/NumberFormatter/NumberFormatter.php | NumberFormatter.getAttribute | public function getAttribute($attr)
{
return isset($this->attributes[$attr]) ? $this->attributes[$attr] : null;
} | php | public function getAttribute($attr)
{
return isset($this->attributes[$attr]) ? $this->attributes[$attr] : null;
} | [
"public",
"function",
"getAttribute",
"(",
"$",
"attr",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"attributes",
"[",
"$",
"attr",
"]",
")",
"?",
"$",
"this",
"->",
"attributes",
"[",
"$",
"attr",
"]",
":",
"null",
";",
"}"
] | Returns an attribute value.
@param int $attr An attribute specifier, one of the numeric attribute constants
@return bool|int The attribute value on success or false on error
@see http://www.php.net/manual/en/numberformatter.getattribute.php | [
"Returns",
"an",
"attribute",
"value",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Intl/NumberFormatter/NumberFormatter.php#L392-L395 | train | Get attribute value | [
30522,
2270,
3853,
2131,
19321,
3089,
8569,
2618,
1006,
1002,
2012,
16344,
1007,
1063,
2709,
26354,
3388,
1006,
1002,
2023,
1011,
1028,
12332,
1031,
1002,
2012,
16344,
1033,
1007,
1029,
1002,
2023,
1011,
1028,
12332,
1031,
1002,
2012,
16344... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/system/classes/CombineAssets.php | CombineAssets.putCache | protected function putCache($cacheKey, array $cacheInfo)
{
$cacheKey = 'combiner.'.$cacheKey;
if (Cache::has($cacheKey)) {
return false;
}
$this->putCacheIndex($cacheKey);
Cache::forever($cacheKey, base64_encode(serialize($cacheInfo)));
return true;
... | php | protected function putCache($cacheKey, array $cacheInfo)
{
$cacheKey = 'combiner.'.$cacheKey;
if (Cache::has($cacheKey)) {
return false;
}
$this->putCacheIndex($cacheKey);
Cache::forever($cacheKey, base64_encode(serialize($cacheInfo)));
return true;
... | [
"protected",
"function",
"putCache",
"(",
"$",
"cacheKey",
",",
"array",
"$",
"cacheInfo",
")",
"{",
"$",
"cacheKey",
"=",
"'combiner.'",
".",
"$",
"cacheKey",
";",
"if",
"(",
"Cache",
"::",
"has",
"(",
"$",
"cacheKey",
")",
")",
"{",
"return",
"false"... | Stores information about a asset collection against
a cache identifier.
@param string $cacheKey Cache identifier.
@param array $cacheInfo List of asset files.
@return bool Successful | [
"Stores",
"information",
"about",
"a",
"asset",
"collection",
"against",
"a",
"cache",
"identifier",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/CombineAssets.php#L762-L773 | train | Put cache info into cache | [
30522,
5123,
3853,
2404,
3540,
5403,
1006,
1002,
17053,
14839,
1010,
9140,
1002,
17053,
2378,
14876,
1007,
1063,
1002,
17053,
14839,
1027,
1005,
11506,
2099,
1012,
1005,
1012,
1002,
17053,
14839,
1025,
2065,
1006,
17053,
1024,
1024,
2038,
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/Validator/Mapping/Loader/YamlFileLoader.php | YamlFileLoader.parseNodes | protected function parseNodes(array $nodes)
{
$values = [];
foreach ($nodes as $name => $childNodes) {
if (is_numeric($name) && \is_array($childNodes) && 1 === \count($childNodes)) {
$options = current($childNodes);
if (\is_array($options)) {
... | php | protected function parseNodes(array $nodes)
{
$values = [];
foreach ($nodes as $name => $childNodes) {
if (is_numeric($name) && \is_array($childNodes) && 1 === \count($childNodes)) {
$options = current($childNodes);
if (\is_array($options)) {
... | [
"protected",
"function",
"parseNodes",
"(",
"array",
"$",
"nodes",
")",
"{",
"$",
"values",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"nodes",
"as",
"$",
"name",
"=>",
"$",
"childNodes",
")",
"{",
"if",
"(",
"is_numeric",
"(",
"$",
"name",
")",
"&&"... | Parses a collection of YAML nodes.
@param array $nodes The YAML nodes
@return array An array of values or Constraint instances | [
"Parses",
"a",
"collection",
"of",
"YAML",
"nodes",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Validator/Mapping/Loader/YamlFileLoader.php#L81-L104 | train | Parse nodes into array of constraints | [
30522,
5123,
3853,
11968,
5054,
19847,
1006,
9140,
1002,
14164,
1007,
1063,
1002,
5300,
1027,
1031,
1033,
1025,
18921,
6776,
1006,
1002,
14164,
2004,
1002,
2171,
1027,
1028,
1002,
2775,
3630,
6155,
1007,
1063,
2065,
1006,
2003,
1035,
16371,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Notification/Manager.php | Manager.getAllNotificationsToDisplay | public static function getAllNotificationsToDisplay()
{
$notifications = static::getAllNotifications();
uasort($notifications, function ($n1, $n2) {
/** @var Notification $n1 */ /** @var Notification $n2 */
if ($n1->getPriority() == $n2->getPriority()) {
retu... | php | public static function getAllNotificationsToDisplay()
{
$notifications = static::getAllNotifications();
uasort($notifications, function ($n1, $n2) {
/** @var Notification $n1 */ /** @var Notification $n2 */
if ($n1->getPriority() == $n2->getPriority()) {
retu... | [
"public",
"static",
"function",
"getAllNotificationsToDisplay",
"(",
")",
"{",
"$",
"notifications",
"=",
"static",
"::",
"getAllNotifications",
"(",
")",
";",
"uasort",
"(",
"$",
"notifications",
",",
"function",
"(",
"$",
"n1",
",",
"$",
"n2",
")",
"{",
... | Determine all notifications that needs to be displayed. They are sorted by priority. Highest priorities first.
@return \ArrayObject | [
"Determine",
"all",
"notifications",
"that",
"needs",
"to",
"be",
"displayed",
".",
"They",
"are",
"sorted",
"by",
"priority",
".",
"Highest",
"priorities",
"first",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Notification/Manager.php#L80-L94 | train | Get all notifications to display | [
30522,
2270,
10763,
3853,
2131,
8095,
17048,
9031,
16033,
10521,
13068,
1006,
1007,
1063,
1002,
26828,
2015,
1027,
10763,
1024,
1024,
2131,
8095,
17048,
9031,
2015,
1006,
1007,
1025,
25423,
21748,
2102,
1006,
1002,
26828,
2015,
1010,
3853,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Routing/UrlGenerator.php | UrlGenerator.route | public function route($name, $parameters = [], $absolute = true)
{
if (! is_null($route = $this->routes->getByName($name))) {
return $this->toRoute($route, $parameters, $absolute);
}
throw new InvalidArgumentException("Route [{$name}] not defined.");
} | php | public function route($name, $parameters = [], $absolute = true)
{
if (! is_null($route = $this->routes->getByName($name))) {
return $this->toRoute($route, $parameters, $absolute);
}
throw new InvalidArgumentException("Route [{$name}] not defined.");
} | [
"public",
"function",
"route",
"(",
"$",
"name",
",",
"$",
"parameters",
"=",
"[",
"]",
",",
"$",
"absolute",
"=",
"true",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"route",
"=",
"$",
"this",
"->",
"routes",
"->",
"getByName",
"(",
"$",
"nam... | Get the URL to a named route.
@param string $name
@param mixed $parameters
@param bool $absolute
@return string
@throws \InvalidArgumentException | [
"Get",
"the",
"URL",
"to",
"a",
"named",
"route",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/UrlGenerator.php#L382-L389 | train | Generate a route by name | [
30522,
2270,
3853,
2799,
1006,
1002,
2171,
1010,
1002,
11709,
1027,
1031,
1033,
1010,
1002,
7619,
1027,
2995,
1007,
1063,
2065,
1006,
999,
2003,
1035,
19701,
1006,
1002,
2799,
1027,
1002,
2023,
1011,
1028,
5847,
1011,
1028,
2131,
3762,
18... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Cellmap.php | Cellmap.get_frame_height | public function get_frame_height(Frame $frame)
{
$key = $frame->get_id();
if (!isset($this->_frames[$key])) {
throw new Exception("Frame not found in cellmap");
}
$rows = $this->_frames[$key]["rows"];
$h = 0;
foreach ($rows as $i) {
if (!isse... | php | public function get_frame_height(Frame $frame)
{
$key = $frame->get_id();
if (!isset($this->_frames[$key])) {
throw new Exception("Frame not found in cellmap");
}
$rows = $this->_frames[$key]["rows"];
$h = 0;
foreach ($rows as $i) {
if (!isse... | [
"public",
"function",
"get_frame_height",
"(",
"Frame",
"$",
"frame",
")",
"{",
"$",
"key",
"=",
"$",
"frame",
"->",
"get_id",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"_frames",
"[",
"$",
"key",
"]",
")",
")",
"{",
"throw"... | @param Frame $frame
@return int
@throws Exception
@throws Exception | [
"@param",
"Frame",
"$frame"
] | 75f13c700009be21a1965dc2c5b68a8708c22ba2 | https://github.com/dompdf/dompdf/blob/75f13c700009be21a1965dc2c5b68a8708c22ba2/src/Cellmap.php#L403-L422 | train | Returns the height of a frame | [
30522,
2270,
3853,
2131,
1035,
4853,
1035,
4578,
1006,
4853,
1002,
4853,
1007,
1063,
1002,
3145,
1027,
1002,
4853,
1011,
1028,
2131,
1035,
8909,
1006,
1007,
1025,
2065,
1006,
999,
26354,
3388,
1006,
1002,
2023,
1011,
1028,
1035,
11048,
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... |
dompdf/dompdf | src/Frame/FrameTree.php | FrameTree.fix_tables | protected function fix_tables()
{
$xp = new DOMXPath($this->_dom);
// Move table caption before the table
// FIXME find a better way to deal with it...
$captions = $xp->query('//table/caption');
foreach ($captions as $caption) {
$table = $caption->parentNode;
... | php | protected function fix_tables()
{
$xp = new DOMXPath($this->_dom);
// Move table caption before the table
// FIXME find a better way to deal with it...
$captions = $xp->query('//table/caption');
foreach ($captions as $caption) {
$table = $caption->parentNode;
... | [
"protected",
"function",
"fix_tables",
"(",
")",
"{",
"$",
"xp",
"=",
"new",
"DOMXPath",
"(",
"$",
"this",
"->",
"_dom",
")",
";",
"// Move table caption before the table",
"// FIXME find a better way to deal with it...",
"$",
"captions",
"=",
"$",
"xp",
"->",
"qu... | Adds missing TBODYs around TR | [
"Adds",
"missing",
"TBODYs",
"around",
"TR"
] | 75f13c700009be21a1965dc2c5b68a8708c22ba2 | https://github.com/dompdf/dompdf/blob/75f13c700009be21a1965dc2c5b68a8708c22ba2/src/Frame/FrameTree.php#L156-L191 | train | Move table caption before the table table | [
30522,
5123,
3853,
8081,
1035,
7251,
1006,
1007,
1063,
1002,
26726,
1027,
2047,
14383,
2595,
15069,
1006,
1002,
2023,
1011,
1028,
1035,
14383,
1007,
1025,
1013,
1013,
2693,
2795,
14408,
3258,
2077,
1996,
2795,
1013,
1013,
8081,
4168,
2424,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/ProxyHeaders.php | ProxyHeaders.getHeaders | private static function getHeaders($recognizedHeaders)
{
$headers = array();
foreach ($recognizedHeaders as $header) {
if (isset($_SERVER[$header])) {
$headers[] = $header;
}
}
return $headers;
} | php | private static function getHeaders($recognizedHeaders)
{
$headers = array();
foreach ($recognizedHeaders as $header) {
if (isset($_SERVER[$header])) {
$headers[] = $header;
}
}
return $headers;
} | [
"private",
"static",
"function",
"getHeaders",
"(",
"$",
"recognizedHeaders",
")",
"{",
"$",
"headers",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"recognizedHeaders",
"as",
"$",
"header",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"_SERVER",
"[",
... | Get headers present in the HTTP request
@param array $recognizedHeaders
@return array HTTP headers | [
"Get",
"headers",
"present",
"in",
"the",
"HTTP",
"request"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/ProxyHeaders.php#L49-L60 | train | Returns the list of HTTP headers that are present in the server array | [
30522,
2797,
10763,
3853,
2131,
4974,
2545,
1006,
1002,
3858,
4974,
2545,
1007,
1063,
1002,
20346,
2015,
1027,
9140,
30524,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Access.php | Access.reloadAccess | public function reloadAccess(Auth $auth = null)
{
$this->resetSites();
if (isset($auth)) {
$this->auth = $auth;
}
if ($this->hasSuperUserAccess()) {
$this->makeSureLoginNameIsSet();
return true;
}
$this->token_auth = null;
... | php | public function reloadAccess(Auth $auth = null)
{
$this->resetSites();
if (isset($auth)) {
$this->auth = $auth;
}
if ($this->hasSuperUserAccess()) {
$this->makeSureLoginNameIsSet();
return true;
}
$this->token_auth = null;
... | [
"public",
"function",
"reloadAccess",
"(",
"Auth",
"$",
"auth",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"resetSites",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"auth",
")",
")",
"{",
"$",
"this",
"->",
"auth",
"=",
"$",
"auth",
";",
"}",
"... | Loads the access levels for the current user.
Calls the authentication method to try to log the user in the system.
If the user credentials are not correct we don't load anything.
If the login/password is correct the user is either the SuperUser or a normal user.
We load the access levels for this user for all the web... | [
"Loads",
"the",
"access",
"levels",
"for",
"the",
"current",
"user",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Access.php#L135-L172 | train | reloadAccess - reloads the access array | [
30522,
2270,
3853,
2128,
11066,
6305,
9623,
2015,
1006,
8740,
2705,
1002,
8740,
2705,
1027,
19701,
1007,
1063,
1002,
2023,
1011,
1028,
25141,
28032,
2229,
1006,
1007,
1025,
2065,
1006,
26354,
3388,
1006,
1002,
8740,
2705,
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... |
php-ai/php-ml | src/Classification/Linear/DecisionStump.php | DecisionStump.calculateErrorRate | protected function calculateErrorRate(array $targets, float $threshold, string $operator, array $values): array
{
$wrong = 0.0;
$prob = [];
$leftLabel = $this->binaryLabels[0];
$rightLabel = $this->binaryLabels[1];
foreach ($values as $index => $value) {
if (Comp... | php | protected function calculateErrorRate(array $targets, float $threshold, string $operator, array $values): array
{
$wrong = 0.0;
$prob = [];
$leftLabel = $this->binaryLabels[0];
$rightLabel = $this->binaryLabels[1];
foreach ($values as $index => $value) {
if (Comp... | [
"protected",
"function",
"calculateErrorRate",
"(",
"array",
"$",
"targets",
",",
"float",
"$",
"threshold",
",",
"string",
"$",
"operator",
",",
"array",
"$",
"values",
")",
":",
"array",
"{",
"$",
"wrong",
"=",
"0.0",
";",
"$",
"prob",
"=",
"[",
"]",... | Calculates the ratio of wrong predictions based on the new threshold
value given as the parameter | [
"Calculates",
"the",
"ratio",
"of",
"wrong",
"predictions",
"based",
"on",
"the",
"new",
"threshold",
"value",
"given",
"as",
"the",
"parameter"
] | f6aa1a59b0525b8fca3d2786d661ab3e70904016 | https://github.com/php-ai/php-ml/blob/f6aa1a59b0525b8fca3d2786d661ab3e70904016/src/Classification/Linear/DecisionStump.php#L246-L284 | train | Calculates the error rate for each leaf | [
30522,
5123,
3853,
18422,
2121,
29165,
11657,
1006,
9140,
1002,
7889,
1010,
14257,
1002,
11207,
1010,
5164,
1002,
6872,
1010,
9140,
1002,
5300,
1007,
1024,
9140,
1063,
1002,
3308,
1027,
1014,
1012,
1014,
1025,
1002,
4013,
2497,
1027,
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... |
laravel/framework | src/Illuminate/Console/Scheduling/CacheEventMutex.php | CacheEventMutex.forget | public function forget(Event $event)
{
$this->cache->store($this->store)->forget($event->mutexName());
} | php | public function forget(Event $event)
{
$this->cache->store($this->store)->forget($event->mutexName());
} | [
"public",
"function",
"forget",
"(",
"Event",
"$",
"event",
")",
"{",
"$",
"this",
"->",
"cache",
"->",
"store",
"(",
"$",
"this",
"->",
"store",
")",
"->",
"forget",
"(",
"$",
"event",
"->",
"mutexName",
"(",
")",
")",
";",
"}"
] | Clear the event mutex for the given event.
@param \Illuminate\Console\Scheduling\Event $event
@return void | [
"Clear",
"the",
"event",
"mutex",
"for",
"the",
"given",
"event",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Console/Scheduling/CacheEventMutex.php#L64-L67 | train | Forget the cache for an event | [
30522,
2270,
3853,
5293,
1006,
2724,
1002,
2724,
1007,
1063,
1002,
2023,
1011,
1028,
17053,
1011,
1028,
3573,
1006,
1002,
2023,
1011,
1028,
3573,
1007,
1011,
1028,
5293,
1006,
1002,
2724,
1011,
1028,
20101,
2595,
18442,
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... |
getgrav/grav | system/src/Grav/Framework/Form/FormFlash.php | FormFlash.clearFiles | public function clearFiles()
{
foreach ($this->files as $field => $files) {
foreach ($files as $name => $upload) {
$this->removeTmpFile($upload['tmp_name'] ?? '');
}
}
$this->files = [];
} | php | public function clearFiles()
{
foreach ($this->files as $field => $files) {
foreach ($files as $name => $upload) {
$this->removeTmpFile($upload['tmp_name'] ?? '');
}
}
$this->files = [];
} | [
"public",
"function",
"clearFiles",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"files",
"as",
"$",
"field",
"=>",
"$",
"files",
")",
"{",
"foreach",
"(",
"$",
"files",
"as",
"$",
"name",
"=>",
"$",
"upload",
")",
"{",
"$",
"this",
"->",
"r... | Clear form flash from all uploaded files. | [
"Clear",
"form",
"flash",
"from",
"all",
"uploaded",
"files",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Framework/Form/FormFlash.php#L323-L332 | train | Clear all temporary files | [
30522,
2270,
3853,
3154,
8873,
4244,
1006,
1007,
1063,
18921,
6776,
1006,
1002,
2023,
1011,
1028,
6764,
2004,
1002,
2492,
1027,
1028,
1002,
6764,
1007,
1063,
18921,
6776,
1006,
1002,
6764,
2004,
1002,
2171,
1027,
1028,
1002,
2039,
11066,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/StreamedResponseListener.php | StreamedResponseListener.onKernelResponse | public function onKernelResponse(FilterResponseEvent $event)
{
if (!$event->isMasterRequest()) {
return;
}
$response = $event->getResponse();
if ($response instanceof StreamedResponse) {
$response->send();
}
} | php | public function onKernelResponse(FilterResponseEvent $event)
{
if (!$event->isMasterRequest()) {
return;
}
$response = $event->getResponse();
if ($response instanceof StreamedResponse) {
$response->send();
}
} | [
"public",
"function",
"onKernelResponse",
"(",
"FilterResponseEvent",
"$",
"event",
")",
"{",
"if",
"(",
"!",
"$",
"event",
"->",
"isMasterRequest",
"(",
")",
")",
"{",
"return",
";",
"}",
"$",
"response",
"=",
"$",
"event",
"->",
"getResponse",
"(",
")"... | Filters the Response. | [
"Filters",
"the",
"Response",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpKernel/EventListener/StreamedResponseListener.php#L32-L43 | train | Called when kernel response is dispatched | [
30522,
2270,
3853,
2006,
5484,
11877,
6072,
26029,
3366,
1006,
11307,
6072,
26029,
19763,
15338,
1002,
2724,
1007,
1063,
2065,
1006,
999,
1002,
2724,
1011,
1028,
2003,
8706,
2890,
15500,
1006,
1007,
1007,
1063,
2709,
1025,
1065,
1002,
3433,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Cache/Simple/AbstractCache.php | AbstractCache.deleteMultiple | public function deleteMultiple($keys)
{
if ($keys instanceof \Traversable) {
$keys = iterator_to_array($keys, false);
} elseif (!\is_array($keys)) {
throw new InvalidArgumentException(sprintf('Cache keys must be array or Traversable, "%s" given', \is_object($keys) ? \get_clas... | php | public function deleteMultiple($keys)
{
if ($keys instanceof \Traversable) {
$keys = iterator_to_array($keys, false);
} elseif (!\is_array($keys)) {
throw new InvalidArgumentException(sprintf('Cache keys must be array or Traversable, "%s" given', \is_object($keys) ? \get_clas... | [
"public",
"function",
"deleteMultiple",
"(",
"$",
"keys",
")",
"{",
"if",
"(",
"$",
"keys",
"instanceof",
"\\",
"Traversable",
")",
"{",
"$",
"keys",
"=",
"iterator_to_array",
"(",
"$",
"keys",
",",
"false",
")",
";",
"}",
"elseif",
"(",
"!",
"\\",
"... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Cache/Simple/AbstractCache.php#L140-L149 | train | Delete multiple cache items | [
30522,
2270,
3853,
3972,
12870,
12274,
7096,
11514,
2571,
1006,
1002,
6309,
1007,
1063,
2065,
1006,
1002,
6309,
6013,
11253,
1032,
29053,
3085,
1007,
1063,
1002,
6309,
1027,
2009,
6906,
4263,
1035,
2000,
1035,
9140,
1006,
1002,
6309,
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/Eloquent/Relations/HasManyThrough.php | HasManyThrough.getResults | public function getResults()
{
return ! is_null($this->farParent->{$this->localKey})
? $this->get()
: $this->related->newCollection();
} | php | public function getResults()
{
return ! is_null($this->farParent->{$this->localKey})
? $this->get()
: $this->related->newCollection();
} | [
"public",
"function",
"getResults",
"(",
")",
"{",
"return",
"!",
"is_null",
"(",
"$",
"this",
"->",
"farParent",
"->",
"{",
"$",
"this",
"->",
"localKey",
"}",
")",
"?",
"$",
"this",
"->",
"get",
"(",
")",
":",
"$",
"this",
"->",
"related",
"->",
... | Get the results of the relationship.
@return mixed | [
"Get",
"the",
"results",
"of",
"the",
"relationship",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Relations/HasManyThrough.php#L344-L349 | train | Get the results of the related objects | [
30522,
2270,
3853,
2131,
6072,
11314,
2015,
1006,
1007,
1063,
2709,
999,
2003,
1035,
19701,
1006,
1002,
2023,
1011,
1028,
2521,
19362,
4765,
1011,
1028,
1063,
1002,
2023,
1011,
1028,
2334,
14839,
1065,
1007,
1029,
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 | plugins/Actions/Columns/EntryPageUrl.php | EntryPageUrl.onExistingVisit | public function onExistingVisit(Request $request, Visitor $visitor, $action)
{
$idAction = $visitor->getVisitorColumn('visit_entry_idaction_url');
if (is_null($idAction) && !empty($action)) {
$idAction = $action->getIdActionUrlForEntryAndExitIds();
if (!empty($idAction)) {
... | php | public function onExistingVisit(Request $request, Visitor $visitor, $action)
{
$idAction = $visitor->getVisitorColumn('visit_entry_idaction_url');
if (is_null($idAction) && !empty($action)) {
$idAction = $action->getIdActionUrlForEntryAndExitIds();
if (!empty($idAction)) {
... | [
"public",
"function",
"onExistingVisit",
"(",
"Request",
"$",
"request",
",",
"Visitor",
"$",
"visitor",
",",
"$",
"action",
")",
"{",
"$",
"idAction",
"=",
"$",
"visitor",
"->",
"getVisitorColumn",
"(",
"'visit_entry_idaction_url'",
")",
";",
"if",
"(",
"is... | /*
@param Request $request
@param Visitor $visitor
@param Action|null $action
@return mixed | [
"/",
"*"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Actions/Columns/EntryPageUrl.php#L66-L78 | train | OnExistingVisit Callback Returns ID Action Url if found | [
30522,
2270,
3853,
2028,
9048,
16643,
3070,
11365,
4183,
1006,
5227,
1002,
5227,
1010,
10367,
1002,
10367,
1010,
1002,
2895,
1007,
1063,
1002,
16096,
7542,
1027,
1002,
10367,
1011,
1028,
2131,
11365,
15660,
25778,
2819,
2078,
1006,
1005,
30... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Mail/Transport/MandrillTransport.php | MandrillTransport.send | public function send(Swift_Mime_SimpleMessage $message, &$failedRecipients = null)
{
$this->beforeSendPerformed($message);
$this->client->request('POST', 'https://mandrillapp.com/api/1.0/messages/send-raw.json', [
'form_params' => [
'key' => $this->key,
'... | php | public function send(Swift_Mime_SimpleMessage $message, &$failedRecipients = null)
{
$this->beforeSendPerformed($message);
$this->client->request('POST', 'https://mandrillapp.com/api/1.0/messages/send-raw.json', [
'form_params' => [
'key' => $this->key,
'... | [
"public",
"function",
"send",
"(",
"Swift_Mime_SimpleMessage",
"$",
"message",
",",
"&",
"$",
"failedRecipients",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"beforeSendPerformed",
"(",
"$",
"message",
")",
";",
"$",
"this",
"->",
"client",
"->",
"request",
... | {@inheritdoc} | [
"{"
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Mail/Transport/MandrillTransport.php#L40-L56 | train | Sends a Swift_Mime_SimpleMessage to the MandrillApp. | [
30522,
2270,
3853,
4604,
1006,
9170,
1035,
2771,
4168,
1035,
3722,
7834,
3736,
3351,
1002,
4471,
1010,
1004,
1002,
3478,
2890,
6895,
14756,
7666,
1027,
19701,
1007,
1063,
1002,
2023,
1011,
1028,
2077,
5054,
18927,
2121,
29021,
1006,
1002,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/Zend/Db/Statement/Pdo.php | Zend_Db_Statement_Pdo.getAttribute | public function getAttribute($key)
{
try {
return $this->_stmt->getAttribute($key);
} catch (PDOException $e) {
// require_once 'Zend/Db/Statement/Exception.php';
throw new Zend_Db_Statement_Exception($e->getMessage(), $e->getCode(), $e);
}
} | php | public function getAttribute($key)
{
try {
return $this->_stmt->getAttribute($key);
} catch (PDOException $e) {
// require_once 'Zend/Db/Statement/Exception.php';
throw new Zend_Db_Statement_Exception($e->getMessage(), $e->getCode(), $e);
}
} | [
"public",
"function",
"getAttribute",
"(",
"$",
"key",
")",
"{",
"try",
"{",
"return",
"$",
"this",
"->",
"_stmt",
"->",
"getAttribute",
"(",
"$",
"key",
")",
";",
"}",
"catch",
"(",
"PDOException",
"$",
"e",
")",
"{",
"// require_once 'Zend/Db/Statement/E... | Retrieve a statement attribute.
@param integer $key Attribute name.
@return mixed Attribute value.
@throws Zend_Db_Statement_Exception | [
"Retrieve",
"a",
"statement",
"attribute",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Statement/Pdo.php#L340-L348 | train | Get attribute value | [
30522,
2270,
3853,
2131,
19321,
3089,
8569,
2618,
1006,
1002,
3145,
1007,
1063,
3046,
1063,
2709,
1002,
2023,
1011,
1028,
1035,
2358,
20492,
1011,
1028,
2131,
19321,
3089,
8569,
2618,
1006,
1002,
3145,
1007,
1025,
1065,
4608,
1006,
22851,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Database/Query/Grammars/PostgresGrammar.php | PostgresGrammar.compileUpdate | public function compileUpdate(Builder $query, $values)
{
$table = $this->wrapTable($query->from);
// Each one of the columns in the update statements needs to be wrapped in the
// keyword identifiers, also a place-holder needs to be created for each of
// the values in the list of b... | php | public function compileUpdate(Builder $query, $values)
{
$table = $this->wrapTable($query->from);
// Each one of the columns in the update statements needs to be wrapped in the
// keyword identifiers, also a place-holder needs to be created for each of
// the values in the list of b... | [
"public",
"function",
"compileUpdate",
"(",
"Builder",
"$",
"query",
",",
"$",
"values",
")",
"{",
"$",
"table",
"=",
"$",
"this",
"->",
"wrapTable",
"(",
"$",
"query",
"->",
"from",
")",
";",
"// Each one of the columns in the update statements needs to be wrappe... | Compile an update statement into SQL.
@param \Illuminate\Database\Query\Builder $query
@param array $values
@return string | [
"Compile",
"an",
"update",
"statement",
"into",
"SQL",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Query/Grammars/PostgresGrammar.php#L222-L236 | train | Compiles an update statement into SQL | [
30522,
2270,
3853,
4012,
22090,
6279,
13701,
1006,
12508,
1002,
23032,
1010,
1002,
5300,
1007,
1063,
1002,
2795,
1027,
1002,
2023,
1011,
1028,
10236,
10880,
1006,
1002,
23032,
1011,
1028,
2013,
1007,
1025,
1013,
1013,
2169,
2028,
1997,
1996... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/DataTable/Filter/BeautifyTimeRangeLabels.php | BeautifyTimeRangeLabels.getUnboundedLabel | public function getUnboundedLabel($oldLabel, $lowerBound)
{
if ($lowerBound < 60) {
return sprintf($this->labelSecondsPlural, $lowerBound);
} else {
// since we're using minutes, we use floor so 1801s+ will be 30m+ and not 31m+
return sprintf($this->labelPlural, "... | php | public function getUnboundedLabel($oldLabel, $lowerBound)
{
if ($lowerBound < 60) {
return sprintf($this->labelSecondsPlural, $lowerBound);
} else {
// since we're using minutes, we use floor so 1801s+ will be 30m+ and not 31m+
return sprintf($this->labelPlural, "... | [
"public",
"function",
"getUnboundedLabel",
"(",
"$",
"oldLabel",
",",
"$",
"lowerBound",
")",
"{",
"if",
"(",
"$",
"lowerBound",
"<",
"60",
")",
"{",
"return",
"sprintf",
"(",
"$",
"this",
"->",
"labelSecondsPlural",
",",
"$",
"lowerBound",
")",
";",
"}"... | Beautifies and returns a range label whose range is unbounded, ie
5+, 10+, etc.
If the lower bound of the range is less than 60 the pretty range label
will be in seconds. Otherwise, it will be in minutes.
@param string $oldLabel The original label value.
@param int $lowerBound The lower bound of the range.
@return st... | [
"Beautifies",
"and",
"returns",
"a",
"range",
"label",
"whose",
"range",
"is",
"unbounded",
"ie",
"5",
"+",
"10",
"+",
"etc",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable/Filter/BeautifyTimeRangeLabels.php#L112-L120 | train | Returns the unbounded label | [
30522,
2270,
3853,
2131,
4609,
15494,
2098,
20470,
2884,
1006,
1002,
2214,
20470,
2884,
1010,
1002,
2896,
15494,
1007,
1063,
2065,
1006,
1002,
2896,
15494,
1026,
3438,
1007,
1063,
2709,
9043,
2546,
1006,
1002,
2023,
1011,
1028,
10873,
8586,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Response.php | Response.getMessageFromException | protected function getMessageFromException($e)
{
// Note: duplicated from FormDatabaseSetup.isAccessDenied
// Avoid leaking the username/db name when access denied
if ($e->getCode() == 1044 || $e->getCode() == 42000) {
return "Error while connecting to the Matomo database - pleas... | php | protected function getMessageFromException($e)
{
// Note: duplicated from FormDatabaseSetup.isAccessDenied
// Avoid leaking the username/db name when access denied
if ($e->getCode() == 1044 || $e->getCode() == 42000) {
return "Error while connecting to the Matomo database - pleas... | [
"protected",
"function",
"getMessageFromException",
"(",
"$",
"e",
")",
"{",
"// Note: duplicated from FormDatabaseSetup.isAccessDenied",
"// Avoid leaking the username/db name when access denied",
"if",
"(",
"$",
"e",
"->",
"getCode",
"(",
")",
"==",
"1044",
"||",
"$",
"... | Gets the error message to output when a tracking request fails.
@param Exception $e
@return string | [
"Gets",
"the",
"error",
"message",
"to",
"output",
"when",
"a",
"tracking",
"request",
"fails",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Tracker/Response.php#L168-L181 | train | Returns the message from an exception | [
30522,
5123,
3853,
2131,
7834,
3736,
3351,
19699,
8462,
2595,
24422,
1006,
1002,
1041,
1007,
1063,
1013,
1013,
3602,
1024,
24473,
2094,
2013,
2433,
2850,
2696,
15058,
13462,
6279,
1012,
18061,
9468,
7971,
4181,
6340,
1013,
1013,
4468,
24325... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Foundation/Exceptions/Handler.php | Handler.invalidJson | protected function invalidJson($request, ValidationException $exception)
{
return response()->json([
'message' => $exception->getMessage(),
'errors' => $exception->errors(),
], $exception->status);
} | php | protected function invalidJson($request, ValidationException $exception)
{
return response()->json([
'message' => $exception->getMessage(),
'errors' => $exception->errors(),
], $exception->status);
} | [
"protected",
"function",
"invalidJson",
"(",
"$",
"request",
",",
"ValidationException",
"$",
"exception",
")",
"{",
"return",
"response",
"(",
")",
"->",
"json",
"(",
"[",
"'message'",
"=>",
"$",
"exception",
"->",
"getMessage",
"(",
")",
",",
"'errors'",
... | Convert a validation exception into a JSON response.
@param \Illuminate\Http\Request $request
@param \Illuminate\Validation\ValidationException $exception
@return \Illuminate\Http\JsonResponse | [
"Convert",
"a",
"validation",
"exception",
"into",
"a",
"JSON",
"response",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Foundation/Exceptions/Handler.php#L263-L269 | train | Return a JSON error response | [
30522,
5123,
3853,
19528,
22578,
2239,
1006,
1002,
5227,
1010,
27354,
10288,
24422,
1002,
6453,
1007,
1063,
2709,
3433,
1006,
1007,
1011,
1028,
1046,
3385,
1006,
1031,
1005,
4471,
1005,
1027,
1028,
1002,
6453,
1011,
1028,
2131,
7834,
3736,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Bridge/Twig/NodeVisitor/Scope.php | Scope.has | public function has($key)
{
if (\array_key_exists($key, $this->data)) {
return true;
}
if (null === $this->parent) {
return false;
}
return $this->parent->has($key);
} | php | public function has($key)
{
if (\array_key_exists($key, $this->data)) {
return true;
}
if (null === $this->parent) {
return false;
}
return $this->parent->has($key);
} | [
"public",
"function",
"has",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"\\",
"array_key_exists",
"(",
"$",
"key",
",",
"$",
"this",
"->",
"data",
")",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"parent",
")",
... | Tests if a data is visible from current scope.
@param string $key
@return bool | [
"Tests",
"if",
"a",
"data",
"is",
"visible",
"from",
"current",
"scope",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bridge/Twig/NodeVisitor/Scope.php#L78-L89 | train | Has the key in the data array? | [
30522,
2270,
3853,
2038,
1006,
1002,
3145,
1007,
1063,
2065,
1006,
1032,
9140,
1035,
3145,
1035,
6526,
1006,
1002,
3145,
1010,
1002,
2023,
1011,
1028,
2951,
1007,
1007,
1063,
2709,
2995,
1025,
1065,
2065,
1006,
19701,
1027,
1027,
1027,
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/Translation/Loader/CsvFileLoader.php | CsvFileLoader.loadResource | protected function loadResource($resource)
{
$messages = [];
try {
$file = new \SplFileObject($resource, 'rb');
} catch (\RuntimeException $e) {
throw new NotFoundResourceException(sprintf('Error opening file "%s".', $resource), 0, $e);
}
$file->setF... | php | protected function loadResource($resource)
{
$messages = [];
try {
$file = new \SplFileObject($resource, 'rb');
} catch (\RuntimeException $e) {
throw new NotFoundResourceException(sprintf('Error opening file "%s".', $resource), 0, $e);
}
$file->setF... | [
"protected",
"function",
"loadResource",
"(",
"$",
"resource",
")",
"{",
"$",
"messages",
"=",
"[",
"]",
";",
"try",
"{",
"$",
"file",
"=",
"new",
"\\",
"SplFileObject",
"(",
"$",
"resource",
",",
"'rb'",
")",
";",
"}",
"catch",
"(",
"\\",
"RuntimeEx... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Translation/Loader/CsvFileLoader.php#L30-L50 | train | Load the messages from a resource | [
30522,
5123,
3853,
7170,
6072,
8162,
3401,
1006,
1002,
7692,
1007,
1063,
1002,
7696,
1027,
1031,
1033,
1025,
3046,
1063,
1002,
5371,
1027,
2047,
1032,
11867,
10270,
9463,
16429,
20614,
1006,
1002,
7692,
1010,
1005,
21144,
1005,
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... |
laravel/framework | src/Illuminate/Redis/Connectors/PhpRedisConnector.php | PhpRedisConnector.connect | public function connect(array $config, array $options)
{
return new PhpRedisConnection($this->createClient(array_merge(
$config, $options, Arr::pull($config, 'options', [])
)));
} | php | public function connect(array $config, array $options)
{
return new PhpRedisConnection($this->createClient(array_merge(
$config, $options, Arr::pull($config, 'options', [])
)));
} | [
"public",
"function",
"connect",
"(",
"array",
"$",
"config",
",",
"array",
"$",
"options",
")",
"{",
"return",
"new",
"PhpRedisConnection",
"(",
"$",
"this",
"->",
"createClient",
"(",
"array_merge",
"(",
"$",
"config",
",",
"$",
"options",
",",
"Arr",
... | Create a new clustered PhpRedis connection.
@param array $config
@param array $options
@return \Illuminate\Redis\Connections\PhpRedisConnection | [
"Create",
"a",
"new",
"clustered",
"PhpRedis",
"connection",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Redis/Connectors/PhpRedisConnector.php#L20-L25 | train | Connect to the Redis server | [
30522,
2270,
3853,
7532,
1006,
9140,
1002,
9530,
8873,
2290,
1010,
9140,
1002,
7047,
1007,
1063,
2709,
2047,
25718,
5596,
2483,
8663,
2638,
7542,
1006,
1002,
2023,
1011,
1028,
3443,
20464,
11638,
1006,
9140,
1035,
13590,
1006,
1002,
9530,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/CssSelector/XPath/Extension/NodeExtension.php | NodeExtension.getNodeTranslators | public function getNodeTranslators()
{
return [
'Selector' => [$this, 'translateSelector'],
'CombinedSelector' => [$this, 'translateCombinedSelector'],
'Negation' => [$this, 'translateNegation'],
'Function' => [$this, 'translateFunction'],
'Pseudo'... | php | public function getNodeTranslators()
{
return [
'Selector' => [$this, 'translateSelector'],
'CombinedSelector' => [$this, 'translateCombinedSelector'],
'Negation' => [$this, 'translateNegation'],
'Function' => [$this, 'translateFunction'],
'Pseudo'... | [
"public",
"function",
"getNodeTranslators",
"(",
")",
"{",
"return",
"[",
"'Selector'",
"=>",
"[",
"$",
"this",
",",
"'translateSelector'",
"]",
",",
"'CombinedSelector'",
"=>",
"[",
"$",
"this",
",",
"'translateCombinedSelector'",
"]",
",",
"'Negation'",
"=>",
... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/CssSelector/XPath/Extension/NodeExtension.php#L65-L78 | train | Get node translators | [
30522,
2270,
3853,
2131,
3630,
3207,
6494,
3619,
20051,
5668,
1006,
1007,
1063,
2709,
1031,
1005,
27000,
1005,
1027,
1028,
1031,
1002,
2023,
1010,
1005,
16315,
12260,
16761,
1005,
1033,
1010,
1005,
4117,
11246,
22471,
2953,
1005,
1027,
1028... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/cms/ServiceProvider.php | ServiceProvider.register | public function register()
{
parent::register('cms');
$this->registerComponents();
$this->registerThemeLogging();
$this->registerCombinerEvents();
/*
* Backend specific
*/
if (App::runningInBackend()) {
$this->registerBackendNavigation(... | php | public function register()
{
parent::register('cms');
$this->registerComponents();
$this->registerThemeLogging();
$this->registerCombinerEvents();
/*
* Backend specific
*/
if (App::runningInBackend()) {
$this->registerBackendNavigation(... | [
"public",
"function",
"register",
"(",
")",
"{",
"parent",
"::",
"register",
"(",
"'cms'",
")",
";",
"$",
"this",
"->",
"registerComponents",
"(",
")",
";",
"$",
"this",
"->",
"registerThemeLogging",
"(",
")",
";",
"$",
"this",
"->",
"registerCombinerEvent... | Register the service provider.
@return void | [
"Register",
"the",
"service",
"provider",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/ServiceProvider.php#L25-L43 | train | Registers the CMS components and components | [
30522,
2270,
3853,
4236,
1006,
1007,
1063,
6687,
1024,
1024,
4236,
1006,
1005,
4642,
2015,
1005,
1007,
1025,
1002,
2023,
1011,
1028,
4236,
9006,
29513,
7666,
1006,
1007,
1025,
1002,
2023,
1011,
1028,
4236,
10760,
10199,
8649,
4726,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/NumberFormatter.php | NumberFormatter.formatNumber | public function formatNumber($value, $maximumFractionDigits=0, $minimumFractionDigits=0)
{
$pattern = $this->getPattern($value, 'Intl_NumberFormatNumber');
return $this->formatNumberWithPattern($pattern, $value, $maximumFractionDigits, $minimumFractionDigits);
} | php | public function formatNumber($value, $maximumFractionDigits=0, $minimumFractionDigits=0)
{
$pattern = $this->getPattern($value, 'Intl_NumberFormatNumber');
return $this->formatNumberWithPattern($pattern, $value, $maximumFractionDigits, $minimumFractionDigits);
} | [
"public",
"function",
"formatNumber",
"(",
"$",
"value",
",",
"$",
"maximumFractionDigits",
"=",
"0",
",",
"$",
"minimumFractionDigits",
"=",
"0",
")",
"{",
"$",
"pattern",
"=",
"$",
"this",
"->",
"getPattern",
"(",
"$",
"value",
",",
"'Intl_NumberFormatNumb... | Formats a given number
@see \Piwik\NumberFormatter::format()
@param string|int|float $value
@param int $maximumFractionDigits
@param int $minimumFractionDigits
@return mixed|string | [
"Formats",
"a",
"given",
"number"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/NumberFormatter.php#L73-L78 | train | Format a number using the Intl NumberFormatNumber class | [
30522,
2270,
3853,
4289,
19172,
5677,
1006,
1002,
3643,
1010,
1002,
4555,
27843,
7542,
4305,
23806,
2015,
1027,
1014,
1010,
1002,
6263,
27843,
7542,
4305,
23806,
2015,
1027,
1014,
1007,
1063,
1002,
5418,
1027,
1002,
2023,
1011,
1028,
2131,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/SitesManager/Model.php | Model.deleteSiteAliasUrls | public function deleteSiteAliasUrls($idsite)
{
$db = $this->getDb();
$db->query("DELETE FROM " . Common::prefixTable("site_url") . " WHERE idsite = ?", $idsite);
} | php | public function deleteSiteAliasUrls($idsite)
{
$db = $this->getDb();
$db->query("DELETE FROM " . Common::prefixTable("site_url") . " WHERE idsite = ?", $idsite);
} | [
"public",
"function",
"deleteSiteAliasUrls",
"(",
"$",
"idsite",
")",
"{",
"$",
"db",
"=",
"$",
"this",
"->",
"getDb",
"(",
")",
";",
"$",
"db",
"->",
"query",
"(",
"\"DELETE FROM \"",
".",
"Common",
"::",
"prefixTable",
"(",
"\"site_url\"",
")",
".",
... | Delete all the alias URLs for the given idSite. | [
"Delete",
"all",
"the",
"alias",
"URLs",
"for",
"the",
"given",
"idSite",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SitesManager/Model.php#L436-L440 | train | Delete all alias URLs for a site | [
30522,
2270,
3853,
3972,
12870,
28032,
15879,
7951,
3126,
4877,
1006,
1002,
8909,
28032,
2063,
1007,
1063,
1002,
16962,
1027,
1002,
2023,
1011,
1028,
2131,
18939,
1006,
1007,
1025,
1002,
16962,
1011,
1028,
23032,
1006,
1000,
3972,
12870,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Common/Iterator.php | Iterator.nth | public function nth($key)
{
$items = array_keys($this->items);
return isset($items[$key]) ? $this->offsetGet($items[$key]) : false;
} | php | public function nth($key)
{
$items = array_keys($this->items);
return isset($items[$key]) ? $this->offsetGet($items[$key]) : false;
} | [
"public",
"function",
"nth",
"(",
"$",
"key",
")",
"{",
"$",
"items",
"=",
"array_keys",
"(",
"$",
"this",
"->",
"items",
")",
";",
"return",
"isset",
"(",
"$",
"items",
"[",
"$",
"key",
"]",
")",
"?",
"$",
"this",
"->",
"offsetGet",
"(",
"$",
... | Return nth item.
@param int $key
@return mixed|bool | [
"Return",
"nth",
"item",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Iterator.php#L90-L95 | train | Get nth item | [
30522,
2270,
3853,
23961,
2232,
1006,
1002,
3145,
1007,
1063,
1002,
5167,
1027,
9140,
1035,
6309,
1006,
1002,
2023,
1011,
1028,
5167,
1007,
1025,
2709,
26354,
3388,
1006,
1002,
5167,
1031,
1002,
3145,
1033,
1007,
1029,
1002,
2023,
1011,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Database/Eloquent/Relations/HasOneOrMany.php | HasOneOrMany.matchOne | public function matchOne(array $models, Collection $results, $relation)
{
return $this->matchOneOrMany($models, $results, $relation, 'one');
} | php | public function matchOne(array $models, Collection $results, $relation)
{
return $this->matchOneOrMany($models, $results, $relation, 'one');
} | [
"public",
"function",
"matchOne",
"(",
"array",
"$",
"models",
",",
"Collection",
"$",
"results",
",",
"$",
"relation",
")",
"{",
"return",
"$",
"this",
"->",
"matchOneOrMany",
"(",
"$",
"models",
",",
"$",
"results",
",",
"$",
"relation",
",",
"'one'",
... | Match the eagerly loaded results to their single parents.
@param array $models
@param \Illuminate\Database\Eloquent\Collection $results
@param string $relation
@return array | [
"Match",
"the",
"eagerly",
"loaded",
"results",
"to",
"their",
"single",
"parents",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Relations/HasOneOrMany.php#L99-L102 | train | Match one or many | [
30522,
2270,
3853,
2674,
5643,
1006,
9140,
1002,
4275,
1010,
3074,
1002,
3463,
1010,
1002,
7189,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
2674,
5643,
2953,
2386,
2100,
1006,
1002,
4275,
1010,
1002,
3463,
1010,
1002,
7189,
1010,
1005,
202... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
overtrue/wechat | src/Payment/Jssdk/Client.php | Client.appConfig | public function appConfig(string $prepayId): array
{
$params = [
'appid' => $this->app['config']->app_id,
'partnerid' => $this->app['config']->mch_id,
'prepayid' => $prepayId,
'noncestr' => uniqid(),
'timestamp' => time(),
'package' => ... | php | public function appConfig(string $prepayId): array
{
$params = [
'appid' => $this->app['config']->app_id,
'partnerid' => $this->app['config']->mch_id,
'prepayid' => $prepayId,
'noncestr' => uniqid(),
'timestamp' => time(),
'package' => ... | [
"public",
"function",
"appConfig",
"(",
"string",
"$",
"prepayId",
")",
":",
"array",
"{",
"$",
"params",
"=",
"[",
"'appid'",
"=>",
"$",
"this",
"->",
"app",
"[",
"'config'",
"]",
"->",
"app_id",
",",
"'partnerid'",
"=>",
"$",
"this",
"->",
"app",
"... | Generate app payment parameters.
@param string $prepayId
@return array | [
"Generate",
"app",
"payment",
"parameters",
"."
] | 120c72faaa93c270365bc75c73c362d5fd583209 | https://github.com/overtrue/wechat/blob/120c72faaa93c270365bc75c73c362d5fd583209/src/Payment/Jssdk/Client.php#L83-L97 | train | Generate the parameters for the app | [
30522,
2270,
3853,
10439,
8663,
8873,
2290,
1006,
5164,
1002,
17463,
4710,
3593,
1007,
1024,
9140,
1063,
1002,
11498,
5244,
1027,
1031,
1005,
10439,
3593,
1005,
1027,
1028,
1002,
2023,
1011,
1028,
10439,
1031,
1005,
9530,
8873,
2290,
1005,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Database/Query/Grammars/Grammar.php | Grammar.compileOrders | protected function compileOrders(Builder $query, $orders)
{
if (! empty($orders)) {
return 'order by '.implode(', ', $this->compileOrdersToArray($query, $orders));
}
return '';
} | php | protected function compileOrders(Builder $query, $orders)
{
if (! empty($orders)) {
return 'order by '.implode(', ', $this->compileOrdersToArray($query, $orders));
}
return '';
} | [
"protected",
"function",
"compileOrders",
"(",
"Builder",
"$",
"query",
",",
"$",
"orders",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"orders",
")",
")",
"{",
"return",
"'order by '",
".",
"implode",
"(",
"', '",
",",
"$",
"this",
"->",
"compileOrde... | Compile the "order by" portions of the query.
@param \Illuminate\Database\Query\Builder $query
@param array $orders
@return string | [
"Compile",
"the",
"order",
"by",
"portions",
"of",
"the",
"query",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Query/Grammars/Grammar.php#L717-L724 | train | Compiles order by clauses into a string | [
30522,
5123,
3853,
4012,
22090,
8551,
2545,
1006,
12508,
1002,
23032,
1010,
1002,
4449,
1007,
1063,
2065,
1006,
999,
4064,
1006,
1002,
4449,
1007,
1007,
1063,
2709,
1005,
2344,
2011,
1005,
1012,
17727,
4135,
3207,
1006,
1005,
1010,
1005,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Redis/RedisManager.php | RedisManager.configure | protected function configure(Connection $connection, $name)
{
$connection->setName($name);
if ($this->events && $this->app->bound('events')) {
$connection->setEventDispatcher($this->app->make('events'));
}
return $connection;
} | php | protected function configure(Connection $connection, $name)
{
$connection->setName($name);
if ($this->events && $this->app->bound('events')) {
$connection->setEventDispatcher($this->app->make('events'));
}
return $connection;
} | [
"protected",
"function",
"configure",
"(",
"Connection",
"$",
"connection",
",",
"$",
"name",
")",
"{",
"$",
"connection",
"->",
"setName",
"(",
"$",
"name",
")",
";",
"if",
"(",
"$",
"this",
"->",
"events",
"&&",
"$",
"this",
"->",
"app",
"->",
"bou... | Configure the given connection to prepare it for commands.
@param \Illuminate\Redis\Connections\Connection $connection
@param string $name
@return \Illuminate\Redis\Connections\Connection | [
"Configure",
"the",
"given",
"connection",
"to",
"prepare",
"it",
"for",
"commands",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Redis/RedisManager.php#L130-L139 | train | Configure the connection | [
30522,
5123,
3853,
9530,
8873,
27390,
2063,
1006,
4434,
1002,
4434,
1010,
1002,
2171,
1007,
1063,
1002,
4434,
1011,
1028,
2275,
18442,
1006,
1002,
2171,
1007,
1025,
2065,
1006,
1002,
2023,
1011,
1028,
2824,
1004,
1004,
1002,
2023,
1011,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Form/Extension/Core/Type/DateType.php | DateType.configureOptions | public function configureOptions(OptionsResolver $resolver)
{
$compound = function (Options $options) {
return 'single_text' !== $options['widget'];
};
$placeholderDefault = function (Options $options) {
return $options['required'] ? null : '';
};
$p... | php | public function configureOptions(OptionsResolver $resolver)
{
$compound = function (Options $options) {
return 'single_text' !== $options['widget'];
};
$placeholderDefault = function (Options $options) {
return $options['required'] ? null : '';
};
$p... | [
"public",
"function",
"configureOptions",
"(",
"OptionsResolver",
"$",
"resolver",
")",
"{",
"$",
"compound",
"=",
"function",
"(",
"Options",
"$",
"options",
")",
"{",
"return",
"'single_text'",
"!==",
"$",
"options",
"[",
"'widget'",
"]",
";",
"}",
";",
... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/Extension/Core/Type/DateType.php#L213-L319 | train | Configures the options for the language level. | [
30522,
2270,
3853,
9530,
8873,
27390,
8780,
16790,
2015,
1006,
7047,
6072,
4747,
6299,
1002,
10663,
2099,
1007,
1063,
1002,
7328,
1027,
3853,
1006,
7047,
1002,
7047,
1007,
1063,
2709,
1005,
2309,
1035,
3793,
1005,
999,
1027,
1027,
1002,
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 | libs/Zend/Mail/Part.php | Zend_Mail_Part.getHeaderField | public function getHeaderField($name, $wantedPart = 0, $firstName = 0) {
return Zend_Mime_Decode::splitHeaderField(current($this->getHeader($name, 'array')), $wantedPart, $firstName);
} | php | public function getHeaderField($name, $wantedPart = 0, $firstName = 0) {
return Zend_Mime_Decode::splitHeaderField(current($this->getHeader($name, 'array')), $wantedPart, $firstName);
} | [
"public",
"function",
"getHeaderField",
"(",
"$",
"name",
",",
"$",
"wantedPart",
"=",
"0",
",",
"$",
"firstName",
"=",
"0",
")",
"{",
"return",
"Zend_Mime_Decode",
"::",
"splitHeaderField",
"(",
"current",
"(",
"$",
"this",
"->",
"getHeader",
"(",
"$",
... | Get a specific field from a header like content type or all fields as array
If the header occurs more than once, only the value from the first header
is returned.
Throws a Zend_Mail_Exception if the requested header does not exist. If
the specific header field does not exist, returns null.
@param string $name ... | [
"Get",
"a",
"specific",
"field",
"from",
"a",
"header",
"like",
"content",
"type",
"or",
"all",
"fields",
"as",
"array"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail/Part.php#L400-L402 | train | Returns a header field as an array of parts | [
30522,
2270,
3853,
2131,
4974,
2121,
3790,
1006,
1002,
2171,
1010,
1002,
2359,
19362,
2102,
1027,
1014,
1010,
1002,
2034,
18442,
1027,
1014,
1007,
1063,
2709,
16729,
2094,
1035,
2771,
4168,
1035,
21933,
3207,
1024,
1024,
3975,
4974,
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... |
symfony/symfony | src/Symfony/Component/DomCrawler/Crawler.php | Crawler.each | public function each(\Closure $closure)
{
$data = [];
foreach ($this->nodes as $i => $node) {
$data[] = $closure($this->createSubCrawler($node), $i);
}
return $data;
} | php | public function each(\Closure $closure)
{
$data = [];
foreach ($this->nodes as $i => $node) {
$data[] = $closure($this->createSubCrawler($node), $i);
}
return $data;
} | [
"public",
"function",
"each",
"(",
"\\",
"Closure",
"$",
"closure",
")",
"{",
"$",
"data",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"nodes",
"as",
"$",
"i",
"=>",
"$",
"node",
")",
"{",
"$",
"data",
"[",
"]",
"=",
"$",
"closure",
... | Calls an anonymous function on each node of the list.
The anonymous function receives the position and the node wrapped
in a Crawler instance as arguments.
Example:
$crawler->filter('h1')->each(function ($node, $i) {
return $node->text();
});
@param \Closure $closure An anonymous function
@return array An array of... | [
"Calls",
"an",
"anonymous",
"function",
"on",
"each",
"node",
"of",
"the",
"list",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/DomCrawler/Crawler.php#L355-L363 | train | Get all nodes and return the result as array | [
30522,
2270,
3853,
2169,
1006,
1032,
8503,
1002,
8503,
1007,
1063,
1002,
2951,
1027,
1031,
1033,
1025,
18921,
6776,
1006,
1002,
2023,
1011,
1028,
14164,
2004,
1002,
1045,
1027,
1028,
1002,
13045,
1007,
1063,
1002,
2951,
1031,
1033,
1027,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Intl/Data/Generator/RegionDataGenerator.php | RegionDataGenerator.generateDataForLocale | protected function generateDataForLocale(BundleReaderInterface $reader, $tempDir, $displayLocale)
{
$localeBundle = $reader->read($tempDir, $displayLocale);
// isset() on \ResourceBundle returns true even if the value is null
if (isset($localeBundle['Countries']) && null !== $localeBundle['... | php | protected function generateDataForLocale(BundleReaderInterface $reader, $tempDir, $displayLocale)
{
$localeBundle = $reader->read($tempDir, $displayLocale);
// isset() on \ResourceBundle returns true even if the value is null
if (isset($localeBundle['Countries']) && null !== $localeBundle['... | [
"protected",
"function",
"generateDataForLocale",
"(",
"BundleReaderInterface",
"$",
"reader",
",",
"$",
"tempDir",
",",
"$",
"displayLocale",
")",
"{",
"$",
"localeBundle",
"=",
"$",
"reader",
"->",
"read",
"(",
"$",
"tempDir",
",",
"$",
"displayLocale",
")",... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Intl/Data/Generator/RegionDataGenerator.php#L92-L107 | train | Generate data for a locale | [
30522,
5123,
3853,
7013,
6790,
29278,
4135,
9289,
2063,
1006,
14012,
16416,
4063,
18447,
2121,
12172,
1002,
8068,
1010,
1002,
8915,
8737,
4305,
2099,
1010,
1002,
4653,
4135,
9289,
2063,
1007,
1063,
1002,
2334,
15878,
8630,
2571,
1027,
1002,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/HttpKernel/EventListener/ValidateRequestListener.php | ValidateRequestListener.onKernelRequest | public function onKernelRequest(GetResponseEvent $event)
{
if (!$event->isMasterRequest()) {
return;
}
$request = $event->getRequest();
if ($request::getTrustedProxies()) {
$request->getClientIps();
}
$request->getHost();
} | php | public function onKernelRequest(GetResponseEvent $event)
{
if (!$event->isMasterRequest()) {
return;
}
$request = $event->getRequest();
if ($request::getTrustedProxies()) {
$request->getClientIps();
}
$request->getHost();
} | [
"public",
"function",
"onKernelRequest",
"(",
"GetResponseEvent",
"$",
"event",
")",
"{",
"if",
"(",
"!",
"$",
"event",
"->",
"isMasterRequest",
"(",
")",
")",
"{",
"return",
";",
"}",
"$",
"request",
"=",
"$",
"event",
"->",
"getRequest",
"(",
")",
";... | Performs the validation. | [
"Performs",
"the",
"validation",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpKernel/EventListener/ValidateRequestListener.php#L30-L42 | train | Called when kernel request is handled by the kernel. | [
30522,
2270,
3853,
2006,
5484,
11877,
2890,
15500,
1006,
2131,
6072,
26029,
19763,
15338,
1002,
2724,
1007,
1063,
2065,
1006,
999,
1002,
2724,
1011,
1028,
2003,
8706,
2890,
15500,
1006,
1007,
1007,
1063,
2709,
1025,
1065,
1002,
5227,
1027,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/Context.php | Context.changeIdSite | public static function changeIdSite($idSite, $callback)
{
// temporarily set the idSite query parameter so archiving will end up using
// the correct site aware caches
$originalGetIdSite = isset($_GET['idSite']) ? $_GET['idSite'] : null;
$originalPostIdSite = isset($_POST['idSite']) ... | php | public static function changeIdSite($idSite, $callback)
{
// temporarily set the idSite query parameter so archiving will end up using
// the correct site aware caches
$originalGetIdSite = isset($_GET['idSite']) ? $_GET['idSite'] : null;
$originalPostIdSite = isset($_POST['idSite']) ... | [
"public",
"static",
"function",
"changeIdSite",
"(",
"$",
"idSite",
",",
"$",
"callback",
")",
"{",
"// temporarily set the idSite query parameter so archiving will end up using",
"// the correct site aware caches",
"$",
"originalGetIdSite",
"=",
"isset",
"(",
"$",
"_GET",
... | Temporarily overwrites the idSite parameter so all code executed by `$callback()`
will use that idSite.
Useful when you need to change the idSite context for a chunk of code. For example,
if we are archiving for more than one site in sequence, we don't want to use
the same caches for both archiving executions.
@param... | [
"Temporarily",
"overwrites",
"the",
"idSite",
"parameter",
"so",
"all",
"code",
"executed",
"by",
"$callback",
"()",
"will",
"use",
"that",
"idSite",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Context.php#L48-L84 | train | Change idSite to the new one | [
30522,
2270,
10763,
3853,
2689,
9821,
4221,
1006,
1002,
8909,
28032,
2063,
1010,
1002,
2655,
5963,
1007,
1063,
1013,
1013,
8184,
2275,
1996,
8909,
28032,
2063,
23032,
16381,
2061,
7905,
14966,
2097,
2203,
2039,
2478,
1013,
1013,
1996,
6149,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/Overlay/Controller.php | Controller.index | public function index()
{
Piwik::checkUserHasViewAccess($this->idSite);
$template = '@Overlay/index';
if (Config::getInstance()->General['overlay_disable_framed_mode']) {
$template = '@Overlay/index_noframe';
}
$view = new View($template);
$this->setGen... | php | public function index()
{
Piwik::checkUserHasViewAccess($this->idSite);
$template = '@Overlay/index';
if (Config::getInstance()->General['overlay_disable_framed_mode']) {
$template = '@Overlay/index_noframe';
}
$view = new View($template);
$this->setGen... | [
"public",
"function",
"index",
"(",
")",
"{",
"Piwik",
"::",
"checkUserHasViewAccess",
"(",
"$",
"this",
"->",
"idSite",
")",
";",
"$",
"template",
"=",
"'@Overlay/index'",
";",
"if",
"(",
"Config",
"::",
"getInstance",
"(",
")",
"->",
"General",
"[",
"'... | The index of the plugin | [
"The",
"index",
"of",
"the",
"plugin"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Overlay/Controller.php#L42-L61 | train | This method renders the index page of the site | [
30522,
2270,
3853,
5950,
1006,
1007,
1063,
14255,
9148,
2243,
1024,
1024,
4638,
20330,
14949,
8584,
6305,
9623,
2015,
1006,
1002,
2023,
1011,
1028,
8909,
28032,
2063,
1007,
1025,
1002,
23561,
1027,
1005,
1030,
2058,
8485,
1013,
5950,
1005,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/Archive.php | Archive.getDoneStringForPlugin | private function getDoneStringForPlugin($plugin, $idSites)
{
return Rules::getDoneStringFlagFor(
$idSites,
$this->params->getSegment(),
$this->getPeriodLabel(),
$plugin
);
} | php | private function getDoneStringForPlugin($plugin, $idSites)
{
return Rules::getDoneStringFlagFor(
$idSites,
$this->params->getSegment(),
$this->getPeriodLabel(),
$plugin
);
} | [
"private",
"function",
"getDoneStringForPlugin",
"(",
"$",
"plugin",
",",
"$",
"idSites",
")",
"{",
"return",
"Rules",
"::",
"getDoneStringFlagFor",
"(",
"$",
"idSites",
",",
"$",
"this",
"->",
"params",
"->",
"getSegment",
"(",
")",
",",
"$",
"this",
"->"... | Returns the done string flag for a plugin using this instance's segment & periods.
@param string $plugin
@return string | [
"Returns",
"the",
"done",
"string",
"flag",
"for",
"a",
"plugin",
"using",
"this",
"instance",
"s",
"segment",
"&",
"periods",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Archive.php#L707-L715 | train | Returns the done string flag for the given plugin | [
30522,
2797,
3853,
2131,
5280,
4355,
4892,
29278,
24759,
15916,
2378,
1006,
1002,
13354,
2378,
1010,
1002,
8909,
28032,
2229,
1007,
1063,
2709,
3513,
1024,
1024,
2131,
5280,
4355,
4892,
10258,
8490,
29278,
30524,
5244,
1011,
1028,
4152,
139... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Security/Core/Role/RoleHierarchy.php | RoleHierarchy.getReachableRoleNames | public function getReachableRoleNames(array $roles): array
{
$reachableRoles = $roles;
foreach ($roles as $role) {
if (!isset($this->map[$role])) {
continue;
}
foreach ($this->map[$role] as $r) {
$reachableRoles[] = $r;
... | php | public function getReachableRoleNames(array $roles): array
{
$reachableRoles = $roles;
foreach ($roles as $role) {
if (!isset($this->map[$role])) {
continue;
}
foreach ($this->map[$role] as $r) {
$reachableRoles[] = $r;
... | [
"public",
"function",
"getReachableRoleNames",
"(",
"array",
"$",
"roles",
")",
":",
"array",
"{",
"$",
"reachableRoles",
"=",
"$",
"roles",
";",
"foreach",
"(",
"$",
"roles",
"as",
"$",
"role",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"-... | @param string[] $roles
@return string[] | [
"@param",
"string",
"[]",
"$roles"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Security/Core/Role/RoleHierarchy.php#L62-L77 | train | Returns the role names that are reachable by the given roles | [
30522,
2270,
3853,
2131,
16416,
7507,
16213,
9890,
18442,
2015,
1006,
9140,
1002,
4395,
1007,
1024,
9140,
1063,
1002,
3362,
3085,
13153,
2229,
1027,
1002,
4395,
1025,
18921,
6776,
1006,
1002,
4395,
2004,
1002,
2535,
1007,
1063,
2065,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/backend/widgets/MediaManager.php | MediaManager.thumbnailExists | protected function thumbnailExists($thumbnailParams, $itemPath, $lastModified)
{
$thumbnailPath = $this->getThumbnailImagePath($thumbnailParams, $itemPath, $lastModified);
$fullPath = temp_path(ltrim($thumbnailPath, '/'));
if (File::exists($fullPath)) {
return $thumbnailPath;
... | php | protected function thumbnailExists($thumbnailParams, $itemPath, $lastModified)
{
$thumbnailPath = $this->getThumbnailImagePath($thumbnailParams, $itemPath, $lastModified);
$fullPath = temp_path(ltrim($thumbnailPath, '/'));
if (File::exists($fullPath)) {
return $thumbnailPath;
... | [
"protected",
"function",
"thumbnailExists",
"(",
"$",
"thumbnailParams",
",",
"$",
"itemPath",
",",
"$",
"lastModified",
")",
"{",
"$",
"thumbnailPath",
"=",
"$",
"this",
"->",
"getThumbnailImagePath",
"(",
"$",
"thumbnailParams",
",",
"$",
"itemPath",
",",
"$... | Check if a thumbnail exists
@param array|null $thumbnailParams
@param string $itemPath
@param int $lastModified
@return bool | [
"Check",
"if",
"a",
"thumbnail",
"exists"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/MediaManager.php#L1217-L1228 | train | Check if thumbnail exists | [
30522,
5123,
3853,
7639,
25464,
10288,
5130,
1006,
1002,
7639,
25464,
28689,
5244,
1010,
1002,
8875,
15069,
1010,
1002,
2197,
5302,
4305,
10451,
1007,
1063,
1002,
7639,
25464,
15069,
1027,
1002,
2023,
1011,
1028,
2131,
2705,
25438,
25464,
9... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
PHPMailer/PHPMailer | src/PHPMailer.php | PHPMailer.validateAddress | public static function validateAddress($address, $patternselect = null)
{
if (null === $patternselect) {
$patternselect = static::$validator;
}
if (is_callable($patternselect)) {
return call_user_func($patternselect, $address);
}
//Reject line breaks i... | php | public static function validateAddress($address, $patternselect = null)
{
if (null === $patternselect) {
$patternselect = static::$validator;
}
if (is_callable($patternselect)) {
return call_user_func($patternselect, $address);
}
//Reject line breaks i... | [
"public",
"static",
"function",
"validateAddress",
"(",
"$",
"address",
",",
"$",
"patternselect",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"patternselect",
")",
"{",
"$",
"patternselect",
"=",
"static",
"::",
"$",
"validator",
";",
"}",
"if... | Check that a string looks like an email address.
Validation patterns supported:
* `auto` Pick best pattern automatically;
* `pcre8` Use the squiloople.com pattern, requires PCRE > 8.0;
* `pcre` Use old PCRE implementation;
* `php` Use PHP built-in FILTER_VALIDATE_EMAIL;
* `html5` Use the pattern given by the HTML5 spec... | [
"Check",
"that",
"a",
"string",
"looks",
"like",
"an",
"email",
"address",
".",
"Validation",
"patterns",
"supported",
":",
"*",
"auto",
"Pick",
"best",
"pattern",
"automatically",
";",
"*",
"pcre8",
"Use",
"the",
"squiloople",
".",
"com",
"pattern",
"requir... | 3d7132341659a8a201adbc3ba11b1e202ee2857c | https://github.com/PHPMailer/PHPMailer/blob/3d7132341659a8a201adbc3ba11b1e202ee2857c/src/PHPMailer.php#L1251-L1309 | train | Validate email address | [
30522,
2270,
10763,
3853,
9398,
3686,
4215,
16200,
4757,
1006,
1002,
4769,
1010,
1002,
7060,
12260,
6593,
1027,
19701,
1007,
1063,
2065,
1006,
19701,
1027,
1027,
1027,
1002,
7060,
12260,
6593,
1007,
1063,
1002,
7060,
12260,
6593,
1027,
1076... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/OutputStyle.php | OutputStyle.writeln | public function writeln($messages, $type = self::OUTPUT_NORMAL)
{
$this->output->writeln($messages, $type);
} | php | public function writeln($messages, $type = self::OUTPUT_NORMAL)
{
$this->output->writeln($messages, $type);
} | [
"public",
"function",
"writeln",
"(",
"$",
"messages",
",",
"$",
"type",
"=",
"self",
"::",
"OUTPUT_NORMAL",
")",
"{",
"$",
"this",
"->",
"output",
"->",
"writeln",
"(",
"$",
"messages",
",",
"$",
"type",
")",
";",
"}"
] | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Style/OutputStyle.php#L62-L65 | train | Write a message to the output | [
30522,
2270,
3853,
4339,
19666,
1006,
1002,
7696,
1010,
1002,
2828,
1027,
2969,
1024,
1024,
6434,
1035,
3671,
1007,
1063,
1002,
2023,
1011,
1028,
6434,
1011,
1028,
4339,
19666,
1006,
1002,
7696,
1010,
1002,
2828,
1007,
1025,
1065,
102,
0,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/backend/widgets/Lists.php | Lists.init | public function init()
{
$this->fillFromConfig([
'columns',
'model',
'recordUrl',
'recordOnClick',
'noRecordsMessage',
'showPageNumbers',
'recordsPerPage',
'showSorting',
'defaultSort',
's... | php | public function init()
{
$this->fillFromConfig([
'columns',
'model',
'recordUrl',
'recordOnClick',
'noRecordsMessage',
'showPageNumbers',
'recordsPerPage',
'showSorting',
'defaultSort',
's... | [
"public",
"function",
"init",
"(",
")",
"{",
"$",
"this",
"->",
"fillFromConfig",
"(",
"[",
"'columns'",
",",
"'model'",
",",
"'recordUrl'",
",",
"'recordOnClick'",
",",
"'noRecordsMessage'",
",",
"'showPageNumbers'",
",",
"'recordsPerPage'",
",",
"'showSorting'",... | Initialize the widget, called by the constructor and free from its parameters. | [
"Initialize",
"the",
"widget",
"called",
"by",
"the",
"constructor",
"and",
"free",
"from",
"its",
"parameters",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/Lists.php#L187-L222 | train | Initializes the list widget | [
30522,
2270,
3853,
1999,
4183,
1006,
1007,
1063,
1002,
2023,
1011,
1028,
6039,
19699,
5358,
8663,
8873,
2290,
1006,
1031,
1005,
7753,
1005,
1010,
1005,
2944,
1005,
1010,
1005,
2501,
3126,
2140,
1005,
1010,
1005,
2501,
2239,
20464,
6799,
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... |
walkor/Workerman | Protocols/Http.php | Http.decode | public static function decode($recv_buffer, TcpConnection $connection)
{
// Init.
$_POST = $_GET = $_COOKIE = $_REQUEST = $_SESSION = $_FILES = array();
$GLOBALS['HTTP_RAW_POST_DATA'] = '';
// Clear cache.
HttpCache::$header = array('Connection' => '... | php | public static function decode($recv_buffer, TcpConnection $connection)
{
// Init.
$_POST = $_GET = $_COOKIE = $_REQUEST = $_SESSION = $_FILES = array();
$GLOBALS['HTTP_RAW_POST_DATA'] = '';
// Clear cache.
HttpCache::$header = array('Connection' => '... | [
"public",
"static",
"function",
"decode",
"(",
"$",
"recv_buffer",
",",
"TcpConnection",
"$",
"connection",
")",
"{",
"// Init.",
"$",
"_POST",
"=",
"$",
"_GET",
"=",
"$",
"_COOKIE",
"=",
"$",
"_REQUEST",
"=",
"$",
"_SESSION",
"=",
"$",
"_FILES",
"=",
... | Parse $_POST、$_GET、$_COOKIE.
@param string $recv_buffer
@param TcpConnection $connection
@return array | [
"Parse",
"$_POST、$_GET、$_COOKIE",
"."
] | 13649907f05014fcfffcfccaef01e63ad3339351 | https://github.com/walkor/Workerman/blob/13649907f05014fcfffcfccaef01e63ad3339351/Protocols/Http.php#L86-L226 | train | Decode HTTP response | [
30522,
2270,
10763,
3853,
21933,
3207,
1006,
1002,
28667,
2615,
1035,
17698,
1010,
22975,
15042,
18256,
7542,
1002,
4434,
1007,
1063,
1013,
1013,
1999,
4183,
1012,
1002,
1035,
2695,
1027,
1002,
1035,
2131,
1027,
1002,
1035,
17387,
1027,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Config/Definition/Builder/ExprBuilder.php | ExprBuilder.end | public function end()
{
if (null === $this->ifPart) {
throw new \RuntimeException('You must specify an if part.');
}
if (null === $this->thenPart) {
throw new \RuntimeException('You must specify a then part.');
}
return $this->node;
} | php | public function end()
{
if (null === $this->ifPart) {
throw new \RuntimeException('You must specify an if part.');
}
if (null === $this->thenPart) {
throw new \RuntimeException('You must specify a then part.');
}
return $this->node;
} | [
"public",
"function",
"end",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"ifPart",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"'You must specify an if part.'",
")",
";",
"}",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"t... | Returns the related node.
@return NodeDefinition|ArrayNodeDefinition|VariableNodeDefinition
@throws \RuntimeException | [
"Returns",
"the",
"related",
"node",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Config/Definition/Builder/ExprBuilder.php#L215-L225 | train | End the current node | [
30522,
2270,
3853,
2203,
1006,
1007,
1063,
2065,
1006,
19701,
1027,
1027,
1027,
1002,
2023,
1011,
1028,
2065,
19362,
2102,
1007,
1063,
5466,
2047,
1032,
2448,
7292,
10288,
24422,
1006,
1005,
2017,
2442,
20648,
2019,
2065,
2112,
1012,
1005,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php | HttpCache.handle | public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
{
// FIXME: catch exceptions and implement a 500 error page here? -> in Varnish, there is a built-in error page mechanism
if (HttpKernelInterface::MASTER_REQUEST === $type) {
$this->trace... | php | public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
{
// FIXME: catch exceptions and implement a 500 error page here? -> in Varnish, there is a built-in error page mechanism
if (HttpKernelInterface::MASTER_REQUEST === $type) {
$this->trace... | [
"public",
"function",
"handle",
"(",
"Request",
"$",
"request",
",",
"$",
"type",
"=",
"HttpKernelInterface",
"::",
"MASTER_REQUEST",
",",
"$",
"catch",
"=",
"true",
")",
"{",
"// FIXME: catch exceptions and implement a 500 error page here? -> in Varnish, there is a built-i... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php#L193-L244 | train | Handle the request | [
30522,
2270,
3853,
5047,
1006,
5227,
1002,
5227,
1010,
1002,
2828,
1027,
8299,
5484,
11877,
18447,
2121,
12172,
1024,
1024,
3040,
1035,
5227,
1010,
1002,
4608,
1027,
2995,
1007,
1063,
1013,
1013,
8081,
4168,
1024,
4608,
11790,
1998,
10408,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Installation/Controller.php | Controller.createConfigFile | private function createConfigFile($dbInfos)
{
$config = Config::getInstance();
// make sure DB sessions are used if the filesystem is NFS
if (count($headers = ProxyHeaders::getProxyClientHeaders()) > 0) {
$config->General['proxy_client_headers'] = $headers;
}
if ... | php | private function createConfigFile($dbInfos)
{
$config = Config::getInstance();
// make sure DB sessions are used if the filesystem is NFS
if (count($headers = ProxyHeaders::getProxyClientHeaders()) > 0) {
$config->General['proxy_client_headers'] = $headers;
}
if ... | [
"private",
"function",
"createConfigFile",
"(",
"$",
"dbInfos",
")",
"{",
"$",
"config",
"=",
"Config",
"::",
"getInstance",
"(",
")",
";",
"// make sure DB sessions are used if the filesystem is NFS",
"if",
"(",
"count",
"(",
"$",
"headers",
"=",
"ProxyHeaders",
... | Write configuration file from session-store | [
"Write",
"configuration",
"file",
"from",
"session",
"-",
"store"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Installation/Controller.php#L550-L586 | train | Create the config file | [
30522,
2797,
3853,
3443,
8663,
8873,
25708,
9463,
1006,
1002,
16962,
2378,
14876,
2015,
1007,
1063,
1002,
9530,
8873,
2290,
1027,
9530,
8873,
2290,
1024,
1024,
2131,
7076,
26897,
1006,
1007,
1025,
1013,
1013,
2191,
2469,
16962,
6521,
2024,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Mysqli.php | Zend_Db_Statement_Mysqli.closeCursor | public function closeCursor()
{
if ($stmt = $this->_stmt) {
$mysqli = $this->_adapter->getConnection();
while ($mysqli->more_results()) {
$mysqli->next_result();
}
$this->_stmt->free_result();
return $this->_stmt->reset();
}... | php | public function closeCursor()
{
if ($stmt = $this->_stmt) {
$mysqli = $this->_adapter->getConnection();
while ($mysqli->more_results()) {
$mysqli->next_result();
}
$this->_stmt->free_result();
return $this->_stmt->reset();
}... | [
"public",
"function",
"closeCursor",
"(",
")",
"{",
"if",
"(",
"$",
"stmt",
"=",
"$",
"this",
"->",
"_stmt",
")",
"{",
"$",
"mysqli",
"=",
"$",
"this",
"->",
"_adapter",
"->",
"getConnection",
"(",
")",
";",
"while",
"(",
"$",
"mysqli",
"->",
"more... | Closes the cursor, allowing the statement to be executed again.
@return bool | [
"Closes",
"the",
"cursor",
"allowing",
"the",
"statement",
"to",
"be",
"executed",
"again",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Statement/Mysqli.php#L117-L128 | train | Close cursor and free all results | [
30522,
2270,
3853,
2485,
10841,
25301,
2099,
1006,
1007,
1063,
2065,
1006,
1002,
2358,
20492,
1027,
1002,
2023,
1011,
1028,
1035,
2358,
20492,
1007,
1063,
1002,
2026,
2015,
4160,
3669,
1027,
1002,
2023,
1011,
1028,
1035,
15581,
2121,
1011,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Common/Getters.php | Getters.offsetExists | public function offsetExists($offset)
{
if ($this->gettersVariable) {
$var = $this->gettersVariable;
return isset($this->{$var}[$offset]);
}
return isset($this->{$offset});
} | php | public function offsetExists($offset)
{
if ($this->gettersVariable) {
$var = $this->gettersVariable;
return isset($this->{$var}[$offset]);
}
return isset($this->{$offset});
} | [
"public",
"function",
"offsetExists",
"(",
"$",
"offset",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"gettersVariable",
")",
"{",
"$",
"var",
"=",
"$",
"this",
"->",
"gettersVariable",
";",
"return",
"isset",
"(",
"$",
"this",
"->",
"{",
"$",
"var",
"}"... | @param mixed $offset
@return bool | [
"@param",
"mixed",
"$offset"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Getters.php#L71-L80 | train | Checks if an offset exists in the array | [
30522,
2270,
3853,
16396,
10288,
5130,
1006,
1002,
16396,
1007,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
2131,
7747,
10755,
19210,
1007,
1063,
1002,
13075,
1027,
1002,
2023,
1011,
1028,
2131,
7747,
10755,
19210,
1025,
2709,
26354,
3388,
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... |
php-ai/php-ml | src/DimensionReduction/KernelPCA.php | KernelPCA.calculateKernelMatrix | protected function calculateKernelMatrix(array $data, int $numRows): array
{
$kernelFunc = $this->getKernel();
$matrix = [];
for ($i = 0; $i < $numRows; ++$i) {
for ($k = 0; $k < $numRows; ++$k) {
if ($i <= $k) {
$matrix[$i][$k] = $kernelFunc(... | php | protected function calculateKernelMatrix(array $data, int $numRows): array
{
$kernelFunc = $this->getKernel();
$matrix = [];
for ($i = 0; $i < $numRows; ++$i) {
for ($k = 0; $k < $numRows; ++$k) {
if ($i <= $k) {
$matrix[$i][$k] = $kernelFunc(... | [
"protected",
"function",
"calculateKernelMatrix",
"(",
"array",
"$",
"data",
",",
"int",
"$",
"numRows",
")",
":",
"array",
"{",
"$",
"kernelFunc",
"=",
"$",
"this",
"->",
"getKernel",
"(",
")",
";",
"$",
"matrix",
"=",
"[",
"]",
";",
"for",
"(",
"$"... | Calculates similarity matrix by use of selected kernel function<br>
An n-by-m matrix is given and an n-by-n matrix is returned | [
"Calculates",
"similarity",
"matrix",
"by",
"use",
"of",
"selected",
"kernel",
"function<br",
">",
"An",
"n",
"-",
"by",
"-",
"m",
"matrix",
"is",
"given",
"and",
"an",
"n",
"-",
"by",
"-",
"n",
"matrix",
"is",
"returned"
] | f6aa1a59b0525b8fca3d2786d661ab3e70904016 | https://github.com/php-ai/php-ml/blob/f6aa1a59b0525b8fca3d2786d661ab3e70904016/src/DimensionReduction/KernelPCA.php#L122-L138 | train | Calculate the kernel matrix | [
30522,
5123,
3853,
18422,
5484,
11877,
18900,
17682,
1006,
9140,
1002,
2951,
1010,
20014,
1002,
16371,
2213,
10524,
2015,
1007,
1024,
9140,
1063,
1002,
16293,
11263,
12273,
1027,
1002,
2023,
1011,
1028,
2131,
5484,
11877,
1006,
1007,
1025,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Database/Query/Grammars/Grammar.php | Grammar.compileHavingBetween | protected function compileHavingBetween($having)
{
$between = $having['not'] ? 'not between' : 'between';
$column = $this->wrap($having['column']);
$min = $this->parameter(head($having['values']));
$max = $this->parameter(last($having['values']));
return $having['boolean'... | php | protected function compileHavingBetween($having)
{
$between = $having['not'] ? 'not between' : 'between';
$column = $this->wrap($having['column']);
$min = $this->parameter(head($having['values']));
$max = $this->parameter(last($having['values']));
return $having['boolean'... | [
"protected",
"function",
"compileHavingBetween",
"(",
"$",
"having",
")",
"{",
"$",
"between",
"=",
"$",
"having",
"[",
"'not'",
"]",
"?",
"'not between'",
":",
"'between'",
";",
"$",
"column",
"=",
"$",
"this",
"->",
"wrap",
"(",
"$",
"having",
"[",
"... | Compile a "between" having clause.
@param array $having
@return string | [
"Compile",
"a",
"between",
"having",
"clause",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Query/Grammars/Grammar.php#L697-L708 | train | Compiles having between clause into a single having clause | [
30522,
5123,
3853,
4012,
22090,
3270,
6455,
20915,
28394,
2078,
1006,
1002,
2383,
1007,
1063,
1002,
2090,
1027,
1002,
2383,
1031,
1005,
2025,
1005,
1033,
1029,
1005,
2025,
2090,
1005,
1024,
1005,
2090,
1005,
1025,
1002,
5930,
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... |
getgrav/grav | system/src/Grav/Common/Page/Page.php | Page.raw | public function raw($var = null)
{
$file = $this->file();
if ($var) {
// First update file object.
if ($file) {
$file->raw($var);
}
// Reset header and content.
$this->modified = time();
$this->id($this->modifi... | php | public function raw($var = null)
{
$file = $this->file();
if ($var) {
// First update file object.
if ($file) {
$file->raw($var);
}
// Reset header and content.
$this->modified = time();
$this->id($this->modifi... | [
"public",
"function",
"raw",
"(",
"$",
"var",
"=",
"null",
")",
"{",
"$",
"file",
"=",
"$",
"this",
"->",
"file",
"(",
")",
";",
"if",
"(",
"$",
"var",
")",
"{",
"// First update file object.",
"if",
"(",
"$",
"file",
")",
"{",
"$",
"file",
"->",... | Gets and Sets the raw data
@param string $var Raw content string
@return string Raw content string | [
"Gets",
"and",
"Sets",
"the",
"raw",
"data"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Page/Page.php#L255-L274 | train | Return raw content of file | [
30522,
2270,
3853,
6315,
1006,
1002,
13075,
1027,
19701,
1007,
1063,
1002,
5371,
1027,
1002,
2023,
1011,
1028,
5371,
1006,
1007,
1025,
2065,
1006,
1002,
13075,
1007,
1063,
1013,
1013,
2034,
10651,
5371,
4874,
1012,
2065,
1006,
1002,
5371,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/Referrers/Social.php | Social.getMainUrl | public function getMainUrl($url)
{
$social = $this->getSocialNetworkFromDomain($url);
foreach ($this->getDefinitions() as $domain => $name) {
if ($name == $social) {
return $domain;
}
}
return $url;
} | php | public function getMainUrl($url)
{
$social = $this->getSocialNetworkFromDomain($url);
foreach ($this->getDefinitions() as $domain => $name) {
if ($name == $social) {
return $domain;
}
}
return $url;
} | [
"public",
"function",
"getMainUrl",
"(",
"$",
"url",
")",
"{",
"$",
"social",
"=",
"$",
"this",
"->",
"getSocialNetworkFromDomain",
"(",
"$",
"url",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"getDefinitions",
"(",
")",
"as",
"$",
"domain",
"=>",
"$"... | Returns the main url of the social network the given url matches
@param string $url
@return string | [
"Returns",
"the",
"main",
"url",
"of",
"the",
"social",
"network",
"the",
"given",
"url",
"matches"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Referrers/Social.php#L147-L158 | train | Get main url | [
30522,
2270,
3853,
2131,
24238,
3126,
2140,
1006,
1002,
24471,
2140,
1007,
1063,
1002,
2591,
1027,
1002,
2023,
1011,
1028,
4152,
10085,
4818,
7159,
6198,
19699,
5358,
9527,
8113,
1006,
1002,
24471,
2140,
1007,
1025,
18921,
6776,
1006,
1002,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/SitesManager/API.php | API.checkAndReturnExcludedIps | private function checkAndReturnExcludedIps($excludedIps)
{
if (empty($excludedIps)) {
return '';
}
$ips = explode(',', $excludedIps);
$ips = array_map('trim', $ips);
$ips = array_filter($ips, 'strlen');
foreach ($ips as $ip) {
if (!$this->isV... | php | private function checkAndReturnExcludedIps($excludedIps)
{
if (empty($excludedIps)) {
return '';
}
$ips = explode(',', $excludedIps);
$ips = array_map('trim', $ips);
$ips = array_filter($ips, 'strlen');
foreach ($ips as $ip) {
if (!$this->isV... | [
"private",
"function",
"checkAndReturnExcludedIps",
"(",
"$",
"excludedIps",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"excludedIps",
")",
")",
"{",
"return",
"''",
";",
"}",
"$",
"ips",
"=",
"explode",
"(",
"','",
",",
"$",
"excludedIps",
")",
";",
"$",... | Checks that the submitted IPs (comma separated list) are valid
Returns the cleaned up IPs
@param string $excludedIps Comma separated list of IP addresses
@throws Exception
@return array of IPs | [
"Checks",
"that",
"the",
"submitted",
"IPs",
"(",
"comma",
"separated",
"list",
")",
"are",
"valid",
"Returns",
"the",
"cleaned",
"up",
"IPs"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SitesManager/API.php#L863-L881 | train | Check and return excluded IPs | [
30522,
2797,
3853,
4638,
5685,
13465,
21737,
2595,
20464,
13936,
11514,
2015,
1006,
1002,
12421,
11514,
2015,
1007,
1063,
2065,
1006,
4064,
1006,
1002,
12421,
11514,
2015,
1007,
1007,
1063,
2709,
1005,
1005,
1025,
1065,
1002,
12997,
2015,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
slimphp/Slim | Slim/Http/Response.php | Response.withJson | public function withJson($data, $status = null, $encodingOptions = 0)
{
$response = $this->withBody(new Body(fopen('php://temp', 'r+')));
$response->body->write($json = json_encode($data, $encodingOptions));
// Ensure that the json encoding passed successfully
if ($json === false) {... | php | public function withJson($data, $status = null, $encodingOptions = 0)
{
$response = $this->withBody(new Body(fopen('php://temp', 'r+')));
$response->body->write($json = json_encode($data, $encodingOptions));
// Ensure that the json encoding passed successfully
if ($json === false) {... | [
"public",
"function",
"withJson",
"(",
"$",
"data",
",",
"$",
"status",
"=",
"null",
",",
"$",
"encodingOptions",
"=",
"0",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"withBody",
"(",
"new",
"Body",
"(",
"fopen",
"(",
"'php://temp'",
",",
"'r... | Json.
Note: This method is not part of the PSR-7 standard.
This method prepares the response object to return an HTTP Json
response to the client.
@param mixed $data The data
@param int $status The HTTP status code.
@param int $encodingOptions Json encoding options
@return static
@throws RuntimeException | [
"Json",
"."
] | ccef5f7d8bcd469d59cbe64f6210d83764f91543 | https://github.com/slimphp/Slim/blob/ccef5f7d8bcd469d59cbe64f6210d83764f91543/Slim/Http/Response.php#L349-L364 | train | Return a response with a JSON body | [
30522,
2270,
3853,
2007,
22578,
2239,
1006,
1002,
2951,
1010,
1002,
3570,
1027,
19701,
1010,
1002,
17181,
7361,
9285,
1027,
1014,
1007,
1063,
1002,
3433,
1027,
1002,
2023,
1011,
1028,
2007,
23684,
1006,
2047,
2303,
1006,
1042,
26915,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Validator/Constraints/FileValidator.php | FileValidator.validate | public function validate($value, Constraint $constraint)
{
if (!$constraint instanceof File) {
throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\File');
}
if (null === $value || '' === $value) {
return;
}
if ($value instanceof UploadedFi... | php | public function validate($value, Constraint $constraint)
{
if (!$constraint instanceof File) {
throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\File');
}
if (null === $value || '' === $value) {
return;
}
if ($value instanceof UploadedFi... | [
"public",
"function",
"validate",
"(",
"$",
"value",
",",
"Constraint",
"$",
"constraint",
")",
"{",
"if",
"(",
"!",
"$",
"constraint",
"instanceof",
"File",
")",
"{",
"throw",
"new",
"UnexpectedTypeException",
"(",
"$",
"constraint",
",",
"__NAMESPACE__",
"... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Validator/Constraints/FileValidator.php#L42-L200 | train | Validates a file | [
30522,
2270,
3853,
9398,
3686,
1006,
1002,
3643,
1010,
27142,
1002,
27142,
1007,
1063,
2065,
1006,
999,
1002,
27142,
6013,
11253,
5371,
1007,
1063,
5466,
2047,
9223,
13874,
10288,
24422,
1006,
1002,
27142,
1010,
1035,
1035,
3415,
15327,
103... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Support/Collection.php | Collection.concat | public function concat($source)
{
$result = new static($this);
foreach ($source as $item) {
$result->push($item);
}
return $result;
} | php | public function concat($source)
{
$result = new static($this);
foreach ($source as $item) {
$result->push($item);
}
return $result;
} | [
"public",
"function",
"concat",
"(",
"$",
"source",
")",
"{",
"$",
"result",
"=",
"new",
"static",
"(",
"$",
"this",
")",
";",
"foreach",
"(",
"$",
"source",
"as",
"$",
"item",
")",
"{",
"$",
"result",
"->",
"push",
"(",
"$",
"item",
")",
";",
... | Push all of the given items onto the collection.
@param iterable $source
@return static | [
"Push",
"all",
"of",
"the",
"given",
"items",
"onto",
"the",
"collection",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Support/Collection.php#L1438-L1447 | train | Concat this array with the array of items from the source array. | [
30522,
2270,
3853,
9530,
11266,
1006,
1002,
3120,
1007,
1063,
1002,
2765,
1027,
2047,
10763,
1006,
1002,
2023,
1007,
1025,
18921,
6776,
1006,
1002,
3120,
2004,
1002,
8875,
1007,
1063,
1002,
2765,
1011,
1028,
5245,
1006,
1002,
8875,
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... |
octobercms/october | modules/system/classes/UpdateManager.php | UpdateManager.setBuildNumberManually | public function setBuildNumberManually()
{
$postData = [];
if (Config::get('cms.edgeUpdates', false)) {
$postData['edge'] = 1;
}
$result = $this->requestServerData('ping', $postData);
$build = (int) array_get($result, 'pong', 420);
$this->setBuild($bui... | php | public function setBuildNumberManually()
{
$postData = [];
if (Config::get('cms.edgeUpdates', false)) {
$postData['edge'] = 1;
}
$result = $this->requestServerData('ping', $postData);
$build = (int) array_get($result, 'pong', 420);
$this->setBuild($bui... | [
"public",
"function",
"setBuildNumberManually",
"(",
")",
"{",
"$",
"postData",
"=",
"[",
"]",
";",
"if",
"(",
"Config",
"::",
"get",
"(",
"'cms.edgeUpdates'",
",",
"false",
")",
")",
"{",
"$",
"postData",
"[",
"'edge'",
"]",
"=",
"1",
";",
"}",
"$",... | Asks the gateway for the lastest build number and stores it.
@return void | [
"Asks",
"the",
"gateway",
"for",
"the",
"lastest",
"build",
"number",
"and",
"stores",
"it",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/UpdateManager.php#L371-L386 | train | This method sets the build number to the current build number. | [
30522,
2270,
3853,
2275,
8569,
4014,
2094,
19172,
23991,
28488,
1006,
1007,
1063,
1002,
2695,
2850,
2696,
1027,
1031,
1033,
1025,
2065,
1006,
9530,
8873,
2290,
1024,
1024,
2131,
1006,
1005,
4642,
2015,
1012,
3341,
6279,
27122,
1005,
1010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/Plugin/Manager.php | Manager.getLoadedPlugin | public function getLoadedPlugin($name)
{
if (!isset($this->loadedPlugins[$name]) || is_null($this->loadedPlugins[$name])) {
throw new \Exception("The plugin '$name' has not been loaded.");
}
return $this->loadedPlugins[$name];
} | php | public function getLoadedPlugin($name)
{
if (!isset($this->loadedPlugins[$name]) || is_null($this->loadedPlugins[$name])) {
throw new \Exception("The plugin '$name' has not been loaded.");
}
return $this->loadedPlugins[$name];
} | [
"public",
"function",
"getLoadedPlugin",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"loadedPlugins",
"[",
"$",
"name",
"]",
")",
"||",
"is_null",
"(",
"$",
"this",
"->",
"loadedPlugins",
"[",
"$",
"name",
"]",
")",
... | Returns a Plugin object by name.
@param string $name The name of the plugin, eg, `'Actions'`.
@throws \Exception If the plugin has not been loaded.
@return Plugin | [
"Returns",
"a",
"Plugin",
"object",
"by",
"name",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Plugin/Manager.php#L995-L1001 | train | Get the loaded plugin | [
30522,
2270,
3853,
2131,
17468,
24759,
15916,
2378,
1006,
1002,
2171,
1007,
1063,
2065,
1006,
999,
26354,
3388,
1006,
1002,
2023,
1011,
1028,
8209,
24759,
15916,
7076,
1031,
1002,
2171,
1033,
1007,
1064,
1064,
2003,
1035,
19701,
1006,
1002,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/Plugin/WidgetsProvider.php | WidgetsProvider.factory | public function factory($module, $action)
{
if (empty($module) || empty($action)) {
return;
}
try {
if (!$this->pluginManager->isPluginActivated($module)) {
return;
}
$plugin = $this->pluginManager->getLoadedPlugin($module);
... | php | public function factory($module, $action)
{
if (empty($module) || empty($action)) {
return;
}
try {
if (!$this->pluginManager->isPluginActivated($module)) {
return;
}
$plugin = $this->pluginManager->getLoadedPlugin($module);
... | [
"public",
"function",
"factory",
"(",
"$",
"module",
",",
"$",
"action",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"module",
")",
"||",
"empty",
"(",
"$",
"action",
")",
")",
"{",
"return",
";",
"}",
"try",
"{",
"if",
"(",
"!",
"$",
"this",
"->",... | Get the widget defined by the given module and action.
@param string $module Aka plugin name, eg 'CoreHome'
@param string $action An action eg 'renderMe'
@return Widget|null
@throws \Exception Throws an exception if the widget is not enabled. | [
"Get",
"the",
"widget",
"defined",
"by",
"the",
"given",
"module",
"and",
"action",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Plugin/WidgetsProvider.php#L96-L123 | train | Factory method for creating widgets for a module and action | [
30522,
2270,
3853,
4713,
1006,
1002,
11336,
1010,
1002,
2895,
1007,
1063,
2065,
1006,
4064,
1006,
1002,
11336,
1007,
1064,
1064,
4064,
1006,
1002,
2895,
1007,
1007,
1063,
2709,
1025,
1065,
3046,
1063,
2065,
1006,
999,
1002,
2023,
1011,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Support/Collection.php | Collection.except | public function except($keys)
{
if ($keys instanceof self) {
$keys = $keys->all();
} elseif (! is_array($keys)) {
$keys = func_get_args();
}
return new static(Arr::except($this->items, $keys));
} | php | public function except($keys)
{
if ($keys instanceof self) {
$keys = $keys->all();
} elseif (! is_array($keys)) {
$keys = func_get_args();
}
return new static(Arr::except($this->items, $keys));
} | [
"public",
"function",
"except",
"(",
"$",
"keys",
")",
"{",
"if",
"(",
"$",
"keys",
"instanceof",
"self",
")",
"{",
"$",
"keys",
"=",
"$",
"keys",
"->",
"all",
"(",
")",
";",
"}",
"elseif",
"(",
"!",
"is_array",
"(",
"$",
"keys",
")",
")",
"{",... | Get all items except for those with the specified keys.
@param \Illuminate\Support\Collection|mixed $keys
@return static | [
"Get",
"all",
"items",
"except",
"for",
"those",
"with",
"the",
"specified",
"keys",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Support/Collection.php#L529-L538 | train | Return a new Collection containing only the items with the given keys. | [
30522,
2270,
3853,
3272,
1006,
1002,
6309,
1007,
1063,
2065,
1006,
1002,
6309,
6013,
11253,
2969,
1007,
1063,
1002,
6309,
1027,
1002,
6309,
1011,
1028,
2035,
1006,
1007,
1025,
1065,
2842,
10128,
1006,
999,
2003,
1035,
9140,
1006,
1002,
63... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Exporter.php | Exporter.resolve | public function resolve($driver)
{
if ($driver instanceof Grid\Exporters\AbstractExporter) {
return $driver->setGrid($this->grid);
}
return $this->getExporter($driver);
} | php | public function resolve($driver)
{
if ($driver instanceof Grid\Exporters\AbstractExporter) {
return $driver->setGrid($this->grid);
}
return $this->getExporter($driver);
} | [
"public",
"function",
"resolve",
"(",
"$",
"driver",
")",
"{",
"if",
"(",
"$",
"driver",
"instanceof",
"Grid",
"\\",
"Exporters",
"\\",
"AbstractExporter",
")",
"{",
"return",
"$",
"driver",
"->",
"setGrid",
"(",
"$",
"this",
"->",
"grid",
")",
";",
"}... | Resolve export driver.
@param string $driver
@return CsvExporter | [
"Resolve",
"export",
"driver",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Grid/Exporter.php#L76-L83 | train | Resolve the exporter | [
30522,
2270,
3853,
10663,
1006,
1002,
4062,
1007,
1063,
2065,
1006,
1002,
4062,
6013,
11253,
8370,
1032,
9167,
2545,
1032,
10061,
10288,
6442,
2121,
1007,
1063,
2709,
1002,
4062,
1011,
1028,
2275,
16523,
3593,
1006,
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... |
z-song/laravel-admin | src/Admin.php | Admin.bootstrap | public function bootstrap()
{
$this->fireBootingCallbacks();
Form::registerBuiltinFields();
Grid::registerColumnDisplayer();
Grid\Filter::registerFilters();
require config('admin.bootstrap', admin_path('bootstrap.php'));
$assets = Form::collectFieldAssets();
... | php | public function bootstrap()
{
$this->fireBootingCallbacks();
Form::registerBuiltinFields();
Grid::registerColumnDisplayer();
Grid\Filter::registerFilters();
require config('admin.bootstrap', admin_path('bootstrap.php'));
$assets = Form::collectFieldAssets();
... | [
"public",
"function",
"bootstrap",
"(",
")",
"{",
"$",
"this",
"->",
"fireBootingCallbacks",
"(",
")",
";",
"Form",
"::",
"registerBuiltinFields",
"(",
")",
";",
"Grid",
"::",
"registerColumnDisplayer",
"(",
")",
";",
"Grid",
"\\",
"Filter",
"::",
"registerF... | Bootstrap the admin application. | [
"Bootstrap",
"the",
"admin",
"application",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Admin.php#L321-L339 | train | Bootstraps the admin | [
30522,
2270,
3853,
6879,
6494,
2361,
1006,
1007,
1063,
1002,
2023,
1011,
1028,
2543,
27927,
2075,
9289,
20850,
8684,
2015,
1006,
1007,
1025,
2433,
1024,
1024,
4236,
8569,
4014,
7629,
15155,
1006,
1007,
1025,
8370,
1024,
1024,
30524,
2361,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Extractor/PhpStringTokenParser.php | PhpStringTokenParser.parseDocString | public static function parseDocString($startToken, $str)
{
// strip last newline (thanks tokenizer for sticking it into the string!)
$str = preg_replace('~(\r\n|\n|\r)$~', '', $str);
// nowdoc string
if (false !== strpos($startToken, '\'')) {
return $str;
}
... | php | public static function parseDocString($startToken, $str)
{
// strip last newline (thanks tokenizer for sticking it into the string!)
$str = preg_replace('~(\r\n|\n|\r)$~', '', $str);
// nowdoc string
if (false !== strpos($startToken, '\'')) {
return $str;
}
... | [
"public",
"static",
"function",
"parseDocString",
"(",
"$",
"startToken",
",",
"$",
"str",
")",
"{",
"// strip last newline (thanks tokenizer for sticking it into the string!)",
"$",
"str",
"=",
"preg_replace",
"(",
"'~(\\r\\n|\\n|\\r)$~'",
",",
"''",
",",
"$",
"str",
... | Parses a constant doc string.
@param string $startToken Doc string start token content (<<<SMTHG)
@param string $str String token content
@return string Parsed string | [
"Parses",
"a",
"constant",
"doc",
"string",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Translation/Extractor/PhpStringTokenParser.php#L130-L141 | train | Parse doc string | [
30522,
2270,
10763,
3853,
11968,
6924,
10085,
3367,
4892,
1006,
1002,
2707,
18715,
2368,
1010,
1002,
2358,
2099,
1007,
1063,
1013,
1013,
6167,
2197,
2047,
4179,
1006,
4283,
19204,
17629,
2005,
13423,
2009,
2046,
1996,
5164,
999,
1007,
1002,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/Db.php | Db.segmentedFetchFirst | public static function segmentedFetchFirst($sql, $first, $last, $step, $params = array())
{
$result = false;
if ($step > 0) {
for ($i = $first; $result === false && $i <= $last; $i += $step) {
$result = self::fetchOne($sql, array_merge($params, array($i, $i + $step)));
... | php | public static function segmentedFetchFirst($sql, $first, $last, $step, $params = array())
{
$result = false;
if ($step > 0) {
for ($i = $first; $result === false && $i <= $last; $i += $step) {
$result = self::fetchOne($sql, array_merge($params, array($i, $i + $step)));
... | [
"public",
"static",
"function",
"segmentedFetchFirst",
"(",
"$",
"sql",
",",
"$",
"first",
",",
"$",
"last",
",",
"$",
"step",
",",
"$",
"params",
"=",
"array",
"(",
")",
")",
"{",
"$",
"result",
"=",
"false",
";",
"if",
"(",
"$",
"step",
">",
"0... | Performs a `SELECT` statement on a table one chunk at a time and returns the first
successfully fetched value.
This function will execute a query on one set of rows in a table. If nothing
is fetched, it will execute the query on the next set of rows and so on until
the query returns a value.
This function will break ... | [
"Performs",
"a",
"SELECT",
"statement",
"on",
"a",
"table",
"one",
"chunk",
"at",
"a",
"time",
"and",
"returns",
"the",
"first",
"successfully",
"fetched",
"value",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Db.php#L513-L528 | train | Performs a SELECT or SHOW statement on the database. | [
30522,
2270,
10763,
3853,
6903,
2098,
7959,
10649,
8873,
12096,
1006,
1002,
29296,
1010,
1002,
2034,
1010,
1002,
2197,
1010,
1002,
3357,
1010,
1002,
11498,
5244,
1027,
9140,
1006,
1007,
1007,
1063,
1002,
2765,
1027,
6270,
1025,
2065,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/backend/widgets/Lists.php | Lists.prepareQuery | public function prepareQuery()
{
$query = $this->model->newQuery();
$primaryTable = $this->model->getTable();
$selects = [$primaryTable.'.*'];
$joins = [];
$withs = [];
/**
* @event backend.list.extendQueryBefore
* Provides an opportunity to modify ... | php | public function prepareQuery()
{
$query = $this->model->newQuery();
$primaryTable = $this->model->getTable();
$selects = [$primaryTable.'.*'];
$joins = [];
$withs = [];
/**
* @event backend.list.extendQueryBefore
* Provides an opportunity to modify ... | [
"public",
"function",
"prepareQuery",
"(",
")",
"{",
"$",
"query",
"=",
"$",
"this",
"->",
"model",
"->",
"newQuery",
"(",
")",
";",
"$",
"primaryTable",
"=",
"$",
"this",
"->",
"model",
"->",
"getTable",
"(",
")",
";",
"$",
"selects",
"=",
"[",
"$... | Applies any filters to the model. | [
"Applies",
"any",
"filters",
"to",
"the",
"model",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/Lists.php#L346-L567 | train | Prepares the query object for the list widget. | [
30522,
2270,
3853,
7374,
4226,
2854,
1006,
1007,
1063,
1002,
23032,
1027,
1002,
2023,
1011,
1028,
2944,
1011,
1028,
2047,
4226,
2854,
1006,
1007,
1025,
1002,
3078,
10880,
1027,
1002,
2023,
1011,
1028,
2944,
1011,
1028,
2131,
10880,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/Zend/Db/Table/Definition.php | Zend_Db_Table_Definition.setOptions | public function setOptions(Array $options)
{
foreach ($options as $optionName => $optionValue) {
$this->setTableConfig($optionName, $optionValue);
}
return $this;
} | php | public function setOptions(Array $options)
{
foreach ($options as $optionName => $optionValue) {
$this->setTableConfig($optionName, $optionValue);
}
return $this;
} | [
"public",
"function",
"setOptions",
"(",
"Array",
"$",
"options",
")",
"{",
"foreach",
"(",
"$",
"options",
"as",
"$",
"optionName",
"=>",
"$",
"optionValue",
")",
"{",
"$",
"this",
"->",
"setTableConfig",
"(",
"$",
"optionName",
",",
"$",
"optionValue",
... | setOptions()
@param array $options
@return Zend_Db_Table_Definition | [
"setOptions",
"()"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Table/Definition.php#L72-L78 | train | Set options for the table | [
30522,
2270,
3853,
2275,
7361,
9285,
1006,
9140,
1002,
7047,
1007,
1063,
18921,
6776,
1006,
1002,
7047,
2004,
1002,
5724,
18442,
1027,
1028,
1002,
5724,
10175,
5657,
1007,
1063,
1002,
2023,
1011,
1028,
2275,
10880,
8663,
8873,
2290,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/system/classes/PluginManager.php | PluginManager.bootAll | public function bootAll($force = false)
{
if ($this->booted && !$force) {
return;
}
foreach ($this->plugins as $plugin) {
$this->bootPlugin($plugin);
}
$this->booted = true;
} | php | public function bootAll($force = false)
{
if ($this->booted && !$force) {
return;
}
foreach ($this->plugins as $plugin) {
$this->bootPlugin($plugin);
}
$this->booted = true;
} | [
"public",
"function",
"bootAll",
"(",
"$",
"force",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"booted",
"&&",
"!",
"$",
"force",
")",
"{",
"return",
";",
"}",
"foreach",
"(",
"$",
"this",
"->",
"plugins",
"as",
"$",
"plugin",
")",
"{"... | Runs the boot() method on all plugins. Can only be called once. | [
"Runs",
"the",
"boot",
"()",
"method",
"on",
"all",
"plugins",
".",
"Can",
"only",
"be",
"called",
"once",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/PluginManager.php#L268-L279 | train | Boot all the plugins | [
30522,
2270,
3853,
9573,
8095,
1006,
1002,
2486,
1027,
6270,
1007,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
9573,
2098,
1004,
1004,
999,
1002,
2486,
1007,
1063,
2709,
1025,
1065,
18921,
6776,
1006,
1002,
2023,
1011,
1028,
13354,
7076,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/Plugin/Tasks.php | Tasks.custom | protected function custom($objectOrClassName, $methodName, $methodParameter, $time, $priority = self::NORMAL_PRIORITY)
{
$this->checkIsValidTask($objectOrClassName, $methodName);
if (is_string($time)) {
$time = Schedule::factory($time);
}
if (!($time instanceof Schedule... | php | protected function custom($objectOrClassName, $methodName, $methodParameter, $time, $priority = self::NORMAL_PRIORITY)
{
$this->checkIsValidTask($objectOrClassName, $methodName);
if (is_string($time)) {
$time = Schedule::factory($time);
}
if (!($time instanceof Schedule... | [
"protected",
"function",
"custom",
"(",
"$",
"objectOrClassName",
",",
"$",
"methodName",
",",
"$",
"methodParameter",
",",
"$",
"time",
",",
"$",
"priority",
"=",
"self",
"::",
"NORMAL_PRIORITY",
")",
"{",
"$",
"this",
"->",
"checkIsValidTask",
"(",
"$",
... | Schedules the given tasks/method to run depending at the given scheduled time. Unlike the convenient methods
such as {@link hourly()} you need to specify the object on which the given method should be called. This can be
either an instance of a class or a class name. For more information about these parameters see {@li... | [
"Schedules",
"the",
"given",
"tasks",
"/",
"method",
"to",
"run",
"depending",
"at",
"the",
"given",
"scheduled",
"time",
".",
"Unlike",
"the",
"convenient",
"methods",
"such",
"as",
"{",
"@link",
"hourly",
"()",
"}",
"you",
"need",
"to",
"specify",
"the",... | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Plugin/Tasks.php#L122-L137 | train | Custom method to add a new task to the queue | [
30522,
5123,
3853,
7661,
1006,
1002,
4874,
2953,
26266,
18442,
1010,
1002,
4118,
18442,
1010,
1002,
4118,
28689,
22828,
1010,
1002,
2051,
1010,
1002,
9470,
1027,
2969,
1024,
1024,
3671,
1035,
9470,
1007,
1063,
1002,
2023,
1011,
1028,
4638,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Debug/ErrorHandler.php | ErrorHandler.register | public static function register(self $handler = null, $replace = true)
{
if (null === self::$reservedMemory) {
self::$reservedMemory = str_repeat('x', 10240);
register_shutdown_function(__CLASS__.'::handleFatalError');
}
if ($handlerIsNew = null === $handler) {
... | php | public static function register(self $handler = null, $replace = true)
{
if (null === self::$reservedMemory) {
self::$reservedMemory = str_repeat('x', 10240);
register_shutdown_function(__CLASS__.'::handleFatalError');
}
if ($handlerIsNew = null === $handler) {
... | [
"public",
"static",
"function",
"register",
"(",
"self",
"$",
"handler",
"=",
"null",
",",
"$",
"replace",
"=",
"true",
")",
"{",
"if",
"(",
"null",
"===",
"self",
"::",
"$",
"reservedMemory",
")",
"{",
"self",
"::",
"$",
"reservedMemory",
"=",
"str_re... | Registers the error handler.
@param self|null $handler The handler to register
@param bool $replace Whether to replace or not any existing handler
@return self The registered error handler | [
"Registers",
"the",
"error",
"handler",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Debug/ErrorHandler.php#L115-L160 | train | Registers the error handler | [
30522,
2270,
10763,
3853,
4236,
1006,
2969,
1002,
28213,
1027,
19701,
1010,
1002,
5672,
1027,
2995,
1007,
1063,
2065,
1006,
19701,
1027,
1027,
1027,
2969,
1024,
1024,
1002,
9235,
4168,
5302,
2854,
1007,
1063,
2969,
1024,
1024,
1002,
9235,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Bridge/Twig/AppVariable.php | AppVariable.getUser | public function getUser()
{
if (null === $tokenStorage = $this->tokenStorage) {
throw new \RuntimeException('The "app.user" variable is not available.');
}
if (!$token = $tokenStorage->getToken()) {
return;
}
$user = $token->getUser();
if (\i... | php | public function getUser()
{
if (null === $tokenStorage = $this->tokenStorage) {
throw new \RuntimeException('The "app.user" variable is not available.');
}
if (!$token = $tokenStorage->getToken()) {
return;
}
$user = $token->getUser();
if (\i... | [
"public",
"function",
"getUser",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"tokenStorage",
"=",
"$",
"this",
"->",
"tokenStorage",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"'The \"app.user\" variable is not available.'",
")",
";",
"}",
"if"... | Returns the current user.
@return mixed
@see TokenInterface::getUser() | [
"Returns",
"the",
"current",
"user",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bridge/Twig/AppVariable.php#L75-L89 | train | Get the user from the token storage | [
30522,
2270,
3853,
2131,
20330,
1006,
1007,
1063,
2065,
1006,
19701,
1027,
1027,
1027,
1002,
19204,
23809,
4270,
1027,
1002,
2023,
1011,
1028,
19204,
23809,
4270,
1007,
1063,
5466,
2047,
1032,
2448,
7292,
10288,
24422,
1006,
1005,
1996,
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.