repo stringclasses 21
values | path stringlengths 10 100 | func_name stringlengths 6 71 | original_string stringlengths 115 97k | language stringclasses 1
value | code stringlengths 115 97k | code_tokens listlengths 27 7.5k | docstring stringlengths 6 1.88k | docstring_tokens listlengths 1 177 | sha stringclasses 21
values | url stringlengths 100 189 | partition stringclasses 1
value | summary stringlengths 9 340 | input_ids listlengths 502 502 | token_type_ids listlengths 502 502 | attention_mask listlengths 502 502 | labels listlengths 502 502 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
matomo-org/matomo | core/ReportRenderer.php | ReportRenderer.getOutputPath | protected static function getOutputPath($filename)
{
$outputFilename = StaticContainer::get('path.tmp') . '/assets/' . $filename;
@chmod($outputFilename, 0600);
if(file_exists($outputFilename)){
@unlink($outputFilename);
}
return $outputFilename;
} | php | protected static function getOutputPath($filename)
{
$outputFilename = StaticContainer::get('path.tmp') . '/assets/' . $filename;
@chmod($outputFilename, 0600);
if(file_exists($outputFilename)){
@unlink($outputFilename);
}
return $outputFilename;
} | [
"protected",
"static",
"function",
"getOutputPath",
"(",
"$",
"filename",
")",
"{",
"$",
"outputFilename",
"=",
"StaticContainer",
"::",
"get",
"(",
"'path.tmp'",
")",
".",
"'/assets/'",
".",
"$",
"filename",
";",
"@",
"chmod",
"(",
"$",
"outputFilename",
",... | Return $filename with temp directory and delete file
@static
@param $filename
@return string path of file in temp directory | [
"Return",
"$filename",
"with",
"temp",
"directory",
"and",
"delete",
"file"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/ReportRenderer.php#L168-L179 | train | Get output path | [
30522,
5123,
10763,
3853,
2131,
5833,
18780,
15069,
1006,
1002,
5371,
18442,
1007,
1063,
1002,
6434,
8873,
20844,
4168,
1027,
10763,
8663,
18249,
2121,
1024,
1024,
2131,
1006,
1005,
4130,
1012,
1056,
8737,
1005,
1007,
1012,
1005,
1013,
7045... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Serializer/Mapping/Loader/XmlFileLoader.php | XmlFileLoader.loadClassMetadata | public function loadClassMetadata(ClassMetadataInterface $classMetadata)
{
if (null === $this->classes) {
$this->classes = $this->getClassesFromXml();
}
if (!$this->classes) {
return false;
}
$attributesMetadata = $classMetadata->getAttributesMetadat... | php | public function loadClassMetadata(ClassMetadataInterface $classMetadata)
{
if (null === $this->classes) {
$this->classes = $this->getClassesFromXml();
}
if (!$this->classes) {
return false;
}
$attributesMetadata = $classMetadata->getAttributesMetadat... | [
"public",
"function",
"loadClassMetadata",
"(",
"ClassMetadataInterface",
"$",
"classMetadata",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"classes",
")",
"{",
"$",
"this",
"->",
"classes",
"=",
"$",
"this",
"->",
"getClassesFromXml",
"(",
")",
... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Serializer/Mapping/Loader/XmlFileLoader.php#L37-L92 | train | Load Class Metadata | [
30522,
2270,
3853,
7170,
26266,
11368,
8447,
2696,
1006,
2465,
11368,
8447,
18249,
3334,
12172,
1002,
2465,
11368,
8447,
2696,
1007,
1063,
2065,
1006,
19701,
1027,
1027,
1027,
1002,
2023,
1011,
1028,
4280,
1007,
1063,
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/Routing/Router.php | Router.prependMiddlewareToGroup | public function prependMiddlewareToGroup($group, $middleware)
{
if (isset($this->middlewareGroups[$group]) && ! in_array($middleware, $this->middlewareGroups[$group])) {
array_unshift($this->middlewareGroups[$group], $middleware);
}
return $this;
} | php | public function prependMiddlewareToGroup($group, $middleware)
{
if (isset($this->middlewareGroups[$group]) && ! in_array($middleware, $this->middlewareGroups[$group])) {
array_unshift($this->middlewareGroups[$group], $middleware);
}
return $this;
} | [
"public",
"function",
"prependMiddlewareToGroup",
"(",
"$",
"group",
",",
"$",
"middleware",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"middlewareGroups",
"[",
"$",
"group",
"]",
")",
"&&",
"!",
"in_array",
"(",
"$",
"middleware",
",",
"$",
... | Add a middleware to the beginning of a middleware group.
If the middleware is already in the group, it will not be added again.
@param string $group
@param string $middleware
@return $this | [
"Add",
"a",
"middleware",
"to",
"the",
"beginning",
"of",
"a",
"middleware",
"group",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/Router.php#L884-L891 | train | Prepends a middleware to a group | [
30522,
2270,
3853,
17463,
10497,
4328,
20338,
8059,
3406,
17058,
1006,
1002,
2177,
1010,
1002,
2690,
8059,
1007,
1063,
2065,
1006,
26354,
3388,
1006,
1002,
2023,
1011,
1028,
2690,
8059,
17058,
2015,
1031,
1002,
2177,
1033,
1007,
1004,
1004,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/Zend/Db/Statement/Pdo/Ibm.php | Zend_Db_Statement_Pdo_Ibm._bindParam | public function _bindParam($parameter, &$variable, $type = null, $length = null, $options = null)
{
try {
if (($type === null) && ($length === null) && ($options === null)) {
return $this->_stmt->bindParam($parameter, $variable);
} else {
return $this-... | php | public function _bindParam($parameter, &$variable, $type = null, $length = null, $options = null)
{
try {
if (($type === null) && ($length === null) && ($options === null)) {
return $this->_stmt->bindParam($parameter, $variable);
} else {
return $this-... | [
"public",
"function",
"_bindParam",
"(",
"$",
"parameter",
",",
"&",
"$",
"variable",
",",
"$",
"type",
"=",
"null",
",",
"$",
"length",
"=",
"null",
",",
"$",
"options",
"=",
"null",
")",
"{",
"try",
"{",
"if",
"(",
"(",
"$",
"type",
"===",
"nul... | Binds a parameter to the specified variable name.
@param mixed $parameter Name the parameter, either integer or string.
@param mixed $variable Reference to PHP variable containing the value.
@param mixed $type OPTIONAL Datatype of SQL parameter.
@param mixed $length OPTIONAL Length of SQL parameter.
@param mi... | [
"Binds",
"a",
"parameter",
"to",
"the",
"specified",
"variable",
"name",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Statement/Pdo/Ibm.php#L80-L92 | train | Bind a parameter to a variable | [
30522,
2270,
3853,
1035,
14187,
28689,
2213,
1006,
1002,
16381,
1010,
1004,
1002,
8023,
1010,
1002,
2828,
1027,
19701,
1010,
1002,
3091,
1027,
19701,
1010,
1002,
7047,
1027,
19701,
1007,
1063,
3046,
1063,
2065,
1006,
1006,
1002,
2828,
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/Console/Application.php | Application.configureIO | protected function configureIO(InputInterface $input, OutputInterface $output)
{
if (true === $input->hasParameterOption(['--ansi'], true)) {
$output->setDecorated(true);
} elseif (true === $input->hasParameterOption(['--no-ansi'], true)) {
$output->setDecorated(false);
... | php | protected function configureIO(InputInterface $input, OutputInterface $output)
{
if (true === $input->hasParameterOption(['--ansi'], true)) {
$output->setDecorated(true);
} elseif (true === $input->hasParameterOption(['--no-ansi'], true)) {
$output->setDecorated(false);
... | [
"protected",
"function",
"configureIO",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"if",
"(",
"true",
"===",
"$",
"input",
"->",
"hasParameterOption",
"(",
"[",
"'--ansi'",
"]",
",",
"true",
")",
")",
"{",
"$",
... | Configures the input and output instances based on the user arguments and options. | [
"Configures",
"the",
"input",
"and",
"output",
"instances",
"based",
"on",
"the",
"user",
"arguments",
"and",
"options",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Application.php#L840-L893 | train | Configure the IO | [
30522,
5123,
3853,
9530,
8873,
27390,
7416,
2080,
1006,
7953,
18447,
2121,
12172,
1002,
7953,
1010,
6434,
18447,
2121,
12172,
1002,
6434,
1007,
1063,
2065,
1006,
2995,
1027,
1027,
1027,
1002,
7953,
1011,
1028,
2038,
28689,
22828,
7361,
3508... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
overtrue/wechat | src/MiniProgram/UniformMessage/Client.php | Client.formatWeappMessage | protected function formatWeappMessage(array $data = [])
{
$params = $this->baseFormat($data, $this->weappMessage);
$params['data'] = $this->formatData($params['data'] ?? []);
return $params;
} | php | protected function formatWeappMessage(array $data = [])
{
$params = $this->baseFormat($data, $this->weappMessage);
$params['data'] = $this->formatData($params['data'] ?? []);
return $params;
} | [
"protected",
"function",
"formatWeappMessage",
"(",
"array",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"$",
"params",
"=",
"$",
"this",
"->",
"baseFormat",
"(",
"$",
"data",
",",
"$",
"this",
"->",
"weappMessage",
")",
";",
"$",
"params",
"[",
"'data'",
... | @param array $data
@return array | [
"@param",
"array",
"$data"
] | 120c72faaa93c270365bc75c73c362d5fd583209 | https://github.com/overtrue/wechat/blob/120c72faaa93c270365bc75c73c362d5fd583209/src/MiniProgram/UniformMessage/Client.php#L94-L101 | train | Format the message for the weapp message | [
30522,
5123,
3853,
4289,
8545,
29098,
7834,
3736,
3351,
1006,
9140,
1002,
2951,
1027,
1031,
1033,
1007,
1063,
1002,
11498,
5244,
1027,
1002,
2023,
1011,
1028,
2918,
14192,
4017,
1006,
1002,
2951,
1010,
1002,
2023,
1011,
1028,
2057,
29098,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Oracle.php | Zend_Db_Adapter_Oracle.getServerVersion | public function getServerVersion()
{
$this->_connect();
$version = oci_server_version($this->_connection);
if ($version !== false) {
$matches = null;
if (preg_match('/((?:[0-9]{1,2}\.){1,3}[0-9]{1,2})/', $version, $matches)) {
return $matches[1];
... | php | public function getServerVersion()
{
$this->_connect();
$version = oci_server_version($this->_connection);
if ($version !== false) {
$matches = null;
if (preg_match('/((?:[0-9]{1,2}\.){1,3}[0-9]{1,2})/', $version, $matches)) {
return $matches[1];
... | [
"public",
"function",
"getServerVersion",
"(",
")",
"{",
"$",
"this",
"->",
"_connect",
"(",
")",
";",
"$",
"version",
"=",
"oci_server_version",
"(",
"$",
"this",
"->",
"_connection",
")",
";",
"if",
"(",
"$",
"version",
"!==",
"false",
")",
"{",
"$",... | Retrieve server version in PHP style
@return string | [
"Retrieve",
"server",
"version",
"in",
"PHP",
"style"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Adapter/Oracle.php#L628-L642 | train | Get the server version | [
30522,
2270,
3853,
4152,
2121,
6299,
27774,
1006,
1007,
1063,
1002,
2023,
1011,
1028,
1035,
7532,
1006,
1007,
1025,
1002,
2544,
1027,
1051,
6895,
1035,
8241,
1035,
2544,
1006,
1002,
2023,
1011,
1028,
1035,
4434,
1007,
1025,
2065,
1006,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Serializer/Encoder/XmlEncoder.php | XmlEncoder.setRootNodeName | public function setRootNodeName($name)
{
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.2, use the context instead.', __METHOD__), E_USER_DEPRECATED);
$this->defaultContext[self::ROOT_NODE_NAME] = $name;
} | php | public function setRootNodeName($name)
{
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.2, use the context instead.', __METHOD__), E_USER_DEPRECATED);
$this->defaultContext[self::ROOT_NODE_NAME] = $name;
} | [
"public",
"function",
"setRootNodeName",
"(",
"$",
"name",
")",
"{",
"@",
"trigger_error",
"(",
"sprintf",
"(",
"'The \"%s()\" method is deprecated since Symfony 4.2, use the context instead.'",
",",
"__METHOD__",
")",
",",
"E_USER_DEPRECATED",
")",
";",
"$",
"this",
"-... | Sets the root node name.
@deprecated since Symfony 4.2
@param string $name Root node name | [
"Sets",
"the",
"root",
"node",
"name",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Serializer/Encoder/XmlEncoder.php#L213-L218 | train | Sets the root node name of the node | [
30522,
2270,
3853,
2275,
3217,
4140,
3630,
4181,
14074,
1006,
1002,
2171,
1007,
1063,
1030,
9495,
1035,
7561,
1006,
9043,
2546,
1006,
1005,
1996,
1000,
1003,
1055,
1006,
1007,
1000,
4118,
2003,
2139,
28139,
12921,
2144,
25353,
2213,
14876,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Queue/Console/ListFailedCommand.php | ListFailedCommand.handle | public function handle()
{
if (count($jobs = $this->getFailedJobs()) === 0) {
return $this->info('No failed jobs!');
}
$this->displayFailedJobs($jobs);
} | php | public function handle()
{
if (count($jobs = $this->getFailedJobs()) === 0) {
return $this->info('No failed jobs!');
}
$this->displayFailedJobs($jobs);
} | [
"public",
"function",
"handle",
"(",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"jobs",
"=",
"$",
"this",
"->",
"getFailedJobs",
"(",
")",
")",
"===",
"0",
")",
"{",
"return",
"$",
"this",
"->",
"info",
"(",
"'No failed jobs!'",
")",
";",
"}",
"$",
... | Execute the console command.
@return void | [
"Execute",
"the",
"console",
"command",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Queue/Console/ListFailedCommand.php#L36-L43 | train | Handle failed jobs | [
30522,
2270,
3853,
5047,
1006,
1007,
1063,
2065,
1006,
4175,
1006,
1002,
5841,
1027,
1002,
2023,
1011,
1028,
2131,
7011,
18450,
5558,
5910,
1006,
1007,
1007,
1027,
1027,
1027,
1014,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
18558,
1006,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/HttpFoundation/Request.php | Request.getEncodings | public function getEncodings()
{
if (null !== $this->encodings) {
return $this->encodings;
}
return $this->encodings = array_keys(AcceptHeader::fromString($this->headers->get('Accept-Encoding'))->all());
} | php | public function getEncodings()
{
if (null !== $this->encodings) {
return $this->encodings;
}
return $this->encodings = array_keys(AcceptHeader::fromString($this->headers->get('Accept-Encoding'))->all());
} | [
"public",
"function",
"getEncodings",
"(",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"encodings",
")",
"{",
"return",
"$",
"this",
"->",
"encodings",
";",
"}",
"return",
"$",
"this",
"->",
"encodings",
"=",
"array_keys",
"(",
"AcceptHeader",... | Gets a list of encodings acceptable by the client browser.
@return array List of encodings in preferable order | [
"Gets",
"a",
"list",
"of",
"encodings",
"acceptable",
"by",
"the",
"client",
"browser",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpFoundation/Request.php#L1659-L1666 | train | Get all languages that are supported by the client | [
30522,
2270,
3853,
2131,
2368,
3597,
4667,
2015,
1006,
1007,
1063,
2065,
1006,
19701,
999,
1027,
1027,
1002,
2023,
1011,
1028,
17181,
2015,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
17181,
2015,
1025,
1065,
2709,
1002,
2023,
1011,
1028,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/API/DataTableManipulator/ReportTotalsCalculator.php | ReportTotalsCalculator.manipulateDataTable | protected function manipulateDataTable($dataTable)
{
if (!empty($this->report) && !$this->report->getDimension() && !$this->isAllMetricsReport()) {
// we currently do not calculate the total value for reports having no dimension
return $dataTable;
}
if (1 != Common::... | php | protected function manipulateDataTable($dataTable)
{
if (!empty($this->report) && !$this->report->getDimension() && !$this->isAllMetricsReport()) {
// we currently do not calculate the total value for reports having no dimension
return $dataTable;
}
if (1 != Common::... | [
"protected",
"function",
"manipulateDataTable",
"(",
"$",
"dataTable",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"report",
")",
"&&",
"!",
"$",
"this",
"->",
"report",
"->",
"getDimension",
"(",
")",
"&&",
"!",
"$",
"this",
"->",
"is... | Adds ratio metrics if possible.
@param DataTable $dataTable
@return DataTable | [
"Adds",
"ratio",
"metrics",
"if",
"possible",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/API/DataTableManipulator/ReportTotalsCalculator.php#L76-L158 | train | Manually manipulate the data table with totals row and columns | [
30522,
5123,
3853,
20063,
6790,
10880,
1006,
1002,
2951,
10880,
1007,
1063,
2065,
1006,
999,
4064,
1006,
1002,
2023,
1011,
1028,
3189,
1007,
1004,
1004,
999,
1002,
2023,
1011,
1028,
3189,
1011,
1028,
2131,
22172,
6132,
3258,
1006,
1007,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/system/classes/UpdateManager.php | UpdateManager.note | protected function note($message)
{
if ($this->notesOutput !== null) {
$this->notesOutput->writeln($message);
}
else {
$this->notes[] = $message;
}
return $this;
} | php | protected function note($message)
{
if ($this->notesOutput !== null) {
$this->notesOutput->writeln($message);
}
else {
$this->notes[] = $message;
}
return $this;
} | [
"protected",
"function",
"note",
"(",
"$",
"message",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"notesOutput",
"!==",
"null",
")",
"{",
"$",
"this",
"->",
"notesOutput",
"->",
"writeln",
"(",
"$",
"message",
")",
";",
"}",
"else",
"{",
"$",
"this",
"... | Raise a note event for the migrator.
@param string $message
@return self | [
"Raise",
"a",
"note",
"event",
"for",
"the",
"migrator",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/UpdateManager.php#L760-L770 | train | Write a note to the output | [
30522,
5123,
3853,
3602,
1006,
1002,
4471,
1007,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
3964,
5833,
18780,
999,
1027,
1027,
19701,
1007,
1063,
1002,
2023,
1011,
1028,
3964,
5833,
18780,
1011,
1028,
4339,
19666,
1006,
1002,
4471,
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/backend/classes/FormField.php | FormField.getAttributes | public function getAttributes($position = 'field', $htmlBuild = true)
{
$result = array_get($this->attributes, $position, []);
$result = $this->filterAttributes($result, $position);
return $htmlBuild ? Html::attributes($result) : $result;
} | php | public function getAttributes($position = 'field', $htmlBuild = true)
{
$result = array_get($this->attributes, $position, []);
$result = $this->filterAttributes($result, $position);
return $htmlBuild ? Html::attributes($result) : $result;
} | [
"public",
"function",
"getAttributes",
"(",
"$",
"position",
"=",
"'field'",
",",
"$",
"htmlBuild",
"=",
"true",
")",
"{",
"$",
"result",
"=",
"array_get",
"(",
"$",
"this",
"->",
"attributes",
",",
"$",
"position",
",",
"[",
"]",
")",
";",
"$",
"res... | Returns the attributes for this field at a given position.
@param string $position
@return array | [
"Returns",
"the",
"attributes",
"for",
"this",
"field",
"at",
"a",
"given",
"position",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/FormField.php#L423-L429 | train | Get attributes of field | [
30522,
2270,
3853,
2131,
19321,
3089,
8569,
4570,
1006,
1002,
2597,
1027,
1005,
2492,
1005,
1010,
1002,
16129,
8569,
4014,
2094,
1027,
2995,
1007,
1063,
1002,
2765,
1027,
9140,
1035,
2131,
1006,
1002,
2023,
1011,
1028,
12332,
1010,
1002,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcher.php | TraceableEventDispatcher.afterDispatch | protected function afterDispatch(string $eventName, $event)
{
$this->postDispatch($eventName, $event instanceof Event ? $event : new LegacyEventProxy($event));
} | php | protected function afterDispatch(string $eventName, $event)
{
$this->postDispatch($eventName, $event instanceof Event ? $event : new LegacyEventProxy($event));
} | [
"protected",
"function",
"afterDispatch",
"(",
"string",
"$",
"eventName",
",",
"$",
"event",
")",
"{",
"$",
"this",
"->",
"postDispatch",
"(",
"$",
"eventName",
",",
"$",
"event",
"instanceof",
"Event",
"?",
"$",
"event",
":",
"new",
"LegacyEventProxy",
"... | Called after dispatching the event.
@param object $event | [
"Called",
"after",
"dispatching",
"the",
"event",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcher.php#L307-L310 | train | Post dispatch for legacy events | [
30522,
5123,
3853,
30524,
18442,
1010,
1002,
2724,
6013,
11253,
2724,
1029,
1002,
2724,
1024,
2047,
8027,
18697,
3372,
21572,
18037,
1006,
1002,
2724,
1007,
1007,
1025,
1065,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/VarDumper/Dumper/HtmlDumper.php | HtmlDumper.getDumpHeader | protected function getDumpHeader()
{
$this->headerIsDumped = null !== $this->outputStream ? $this->outputStream : $this->lineDumper;
if (null !== $this->dumpHeader) {
return $this->dumpHeader;
}
$line = str_replace('{$options}', json_encode($this->displayOptions, JSON_F... | php | protected function getDumpHeader()
{
$this->headerIsDumped = null !== $this->outputStream ? $this->outputStream : $this->lineDumper;
if (null !== $this->dumpHeader) {
return $this->dumpHeader;
}
$line = str_replace('{$options}', json_encode($this->displayOptions, JSON_F... | [
"protected",
"function",
"getDumpHeader",
"(",
")",
"{",
"$",
"this",
"->",
"headerIsDumped",
"=",
"null",
"!==",
"$",
"this",
"->",
"outputStream",
"?",
"$",
"this",
"->",
"outputStream",
":",
"$",
"this",
"->",
"lineDumper",
";",
"if",
"(",
"null",
"!=... | Dumps the HTML header. | [
"Dumps",
"the",
"HTML",
"header",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/VarDumper/Dumper/HtmlDumper.php#L154-L784 | train | Get dump header | [
30522,
5123,
3853,
2131,
8566,
8737,
4974,
2121,
1006,
1007,
1063,
1002,
2023,
1011,
1028,
20346,
2483,
8566,
8737,
2098,
1027,
19701,
999,
1027,
1027,
1002,
2023,
1011,
1028,
27852,
25379,
1029,
1002,
2023,
1011,
1028,
27852,
25379,
1024,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/Scheduler/Schedule/Schedule.php | Schedule.adjustHour | protected function adjustHour($rescheduledTime)
{
if ($this->hour !== null) {
// Reset the number of minutes and set the scheduled hour to the one specified with setHour()
$rescheduledTime = mktime($this->hour,
0,
date('s', $rescheduledTime),
... | php | protected function adjustHour($rescheduledTime)
{
if ($this->hour !== null) {
// Reset the number of minutes and set the scheduled hour to the one specified with setHour()
$rescheduledTime = mktime($this->hour,
0,
date('s', $rescheduledTime),
... | [
"protected",
"function",
"adjustHour",
"(",
"$",
"rescheduledTime",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hour",
"!==",
"null",
")",
"{",
"// Reset the number of minutes and set the scheduled hour to the one specified with setHour()",
"$",
"rescheduledTime",
"=",
"mkti... | Computes the delta in seconds needed to adjust the rescheduled time to the required hour.
@param int $rescheduledTime The rescheduled time to be adjusted
@return int adjusted rescheduled time | [
"Computes",
"the",
"delta",
"in",
"seconds",
"needed",
"to",
"adjust",
"the",
"rescheduled",
"time",
"to",
"the",
"required",
"hour",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Scheduler/Schedule/Schedule.php#L163-L176 | train | Adjusts the scheduled time to the specified hour | [
30522,
5123,
3853,
14171,
6806,
3126,
1006,
1002,
24501,
7690,
18696,
7292,
1007,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
3178,
999,
1027,
1027,
19701,
1007,
1063,
1013,
1013,
25141,
1996,
2193,
1997,
2781,
1998,
2275,
1996,
5115,
3178,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/Tracker/PageUrl.php | PageUrl.reencodeParameters | public static function reencodeParameters(&$queryParameters, $encoding = false)
{
if (function_exists('mb_check_encoding')) {
// if query params are encoded w/ non-utf8 characters (due to browser bug or whatever),
// encode to UTF-8.
if (strtolower($encoding) != 'utf-8'
... | php | public static function reencodeParameters(&$queryParameters, $encoding = false)
{
if (function_exists('mb_check_encoding')) {
// if query params are encoded w/ non-utf8 characters (due to browser bug or whatever),
// encode to UTF-8.
if (strtolower($encoding) != 'utf-8'
... | [
"public",
"static",
"function",
"reencodeParameters",
"(",
"&",
"$",
"queryParameters",
",",
"$",
"encoding",
"=",
"false",
")",
"{",
"if",
"(",
"function_exists",
"(",
"'mb_check_encoding'",
")",
")",
"{",
"// if query params are encoded w/ non-utf8 characters (due to ... | Checks if query parameters are of a non-UTF-8 encoding and converts the values
from the specified encoding to UTF-8.
This method is used to workaround browser/webapp bugs (see #3450). When
browsers fail to encode query parameters in UTF-8, the tracker will send the
charset of the page viewed and we can sometimes work a... | [
"Checks",
"if",
"query",
"parameters",
"are",
"of",
"a",
"non",
"-",
"UTF",
"-",
"8",
"encoding",
"and",
"converts",
"the",
"values",
"from",
"the",
"specified",
"encoding",
"to",
"UTF",
"-",
"8",
".",
"This",
"method",
"is",
"used",
"to",
"workaround",
... | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Tracker/PageUrl.php#L275-L292 | train | Reencoding query parameters to UTF - 8 | [
30522,
2270,
10763,
3853,
2128,
2368,
16044,
28689,
22828,
2015,
1006,
1004,
1002,
23032,
28689,
22828,
2015,
1010,
1002,
17181,
1027,
6270,
1007,
1063,
2065,
1006,
3853,
1035,
6526,
1006,
1005,
16914,
1035,
4638,
1035,
17181,
1005,
1007,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Cache/Traits/AbstractTrait.php | AbstractTrait.enableVersioning | public function enableVersioning($enable = true)
{
$wasEnabled = $this->versioningIsEnabled;
$this->versioningIsEnabled = (bool) $enable;
$this->namespaceVersion = '';
$this->ids = [];
return $wasEnabled;
} | php | public function enableVersioning($enable = true)
{
$wasEnabled = $this->versioningIsEnabled;
$this->versioningIsEnabled = (bool) $enable;
$this->namespaceVersion = '';
$this->ids = [];
return $wasEnabled;
} | [
"public",
"function",
"enableVersioning",
"(",
"$",
"enable",
"=",
"true",
")",
"{",
"$",
"wasEnabled",
"=",
"$",
"this",
"->",
"versioningIsEnabled",
";",
"$",
"this",
"->",
"versioningIsEnabled",
"=",
"(",
"bool",
")",
"$",
"enable",
";",
"$",
"this",
... | Enables/disables versioning of items.
When versioning is enabled, clearing the cache is atomic and doesn't require listing existing keys to proceed,
but old keys may need garbage collection and extra round-trips to the back-end are required.
Calling this method also clears the memoized namespace version and thus forc... | [
"Enables",
"/",
"disables",
"versioning",
"of",
"items",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Cache/Traits/AbstractTrait.php#L188-L196 | train | Enable versioning of the namespace | [
30522,
2270,
3853,
9585,
27774,
2075,
1006,
1002,
9585,
1027,
2995,
1007,
1063,
1002,
2001,
8189,
23242,
1027,
1002,
2023,
1011,
1028,
2544,
2075,
28992,
3085,
2094,
1025,
1002,
2023,
1011,
1028,
2544,
2075,
30524,
8189,
23242,
1025,
1065,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/Zend/Cache/Frontend/Class.php | Zend_Cache_Frontend_Class.setCachedEntity | public function setCachedEntity($cachedEntity)
{
if (!is_string($cachedEntity) && !is_object($cachedEntity)) {
Zend_Cache::throwException('cached_entity must be an object or a class name');
}
$this->_cachedEntity = $cachedEntity;
$this->_specificOptions['cached_entity'] =... | php | public function setCachedEntity($cachedEntity)
{
if (!is_string($cachedEntity) && !is_object($cachedEntity)) {
Zend_Cache::throwException('cached_entity must be an object or a class name');
}
$this->_cachedEntity = $cachedEntity;
$this->_specificOptions['cached_entity'] =... | [
"public",
"function",
"setCachedEntity",
"(",
"$",
"cachedEntity",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"cachedEntity",
")",
"&&",
"!",
"is_object",
"(",
"$",
"cachedEntity",
")",
")",
"{",
"Zend_Cache",
"::",
"throwException",
"(",
"'cached_enti... | Specific method to set the cachedEntity
if set to a class name, we will cache an abstract class and will use only static calls
if set to an object, we will cache this object methods
@param mixed $cachedEntity | [
"Specific",
"method",
"to",
"set",
"the",
"cachedEntity"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache/Frontend/Class.php#L168-L181 | train | Set the cached entity | [
30522,
2270,
3853,
2275,
3540,
7690,
4765,
3012,
1006,
1002,
17053,
16454,
3012,
1007,
1063,
2065,
1006,
999,
2003,
1035,
5164,
1006,
1002,
17053,
16454,
3012,
1007,
1004,
1004,
999,
2003,
1035,
4874,
1006,
1002,
17053,
16454,
3012,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Support/Collection.php | Collection.groupBy | public function groupBy($groupBy, $preserveKeys = false)
{
if (is_array($groupBy)) {
$nextGroups = $groupBy;
$groupBy = array_shift($nextGroups);
}
$groupBy = $this->valueRetriever($groupBy);
$results = [];
foreach ($this->items as $key => $value) ... | php | public function groupBy($groupBy, $preserveKeys = false)
{
if (is_array($groupBy)) {
$nextGroups = $groupBy;
$groupBy = array_shift($nextGroups);
}
$groupBy = $this->valueRetriever($groupBy);
$results = [];
foreach ($this->items as $key => $value) ... | [
"public",
"function",
"groupBy",
"(",
"$",
"groupBy",
",",
"$",
"preserveKeys",
"=",
"false",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"groupBy",
")",
")",
"{",
"$",
"nextGroups",
"=",
"$",
"groupBy",
";",
"$",
"groupBy",
"=",
"array_shift",
"(",
"... | Group an associative array by a field or using a callback.
@param array|callable|string $groupBy
@param bool $preserveKeys
@return static | [
"Group",
"an",
"associative",
"array",
"by",
"a",
"field",
"or",
"using",
"a",
"callback",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Support/Collection.php#L890-L927 | train | Group by method. | [
30522,
2270,
3853,
2177,
3762,
1006,
1002,
2177,
3762,
1010,
1002,
7969,
14839,
2015,
1027,
6270,
1007,
1063,
2065,
1006,
2003,
1035,
9140,
1006,
1002,
2177,
3762,
1007,
1007,
1063,
1002,
2279,
17058,
2015,
1027,
1002,
2177,
3762,
1025,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
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 | Worker.php | Worker.safeEcho | public static function safeEcho($msg, $decorated = false)
{
$stream = static::outputStream();
if (!$stream) {
return false;
}
if (!$decorated) {
$line = $white = $green = $end = '';
if (static::$_outputDecorated) {
$line = "\033[1A\... | php | public static function safeEcho($msg, $decorated = false)
{
$stream = static::outputStream();
if (!$stream) {
return false;
}
if (!$decorated) {
$line = $white = $green = $end = '';
if (static::$_outputDecorated) {
$line = "\033[1A\... | [
"public",
"static",
"function",
"safeEcho",
"(",
"$",
"msg",
",",
"$",
"decorated",
"=",
"false",
")",
"{",
"$",
"stream",
"=",
"static",
"::",
"outputStream",
"(",
")",
";",
"if",
"(",
"!",
"$",
"stream",
")",
"{",
"return",
"false",
";",
"}",
"if... | Safe Echo.
@param $msg
@param bool $decorated
@return bool | [
"Safe",
"Echo",
"."
] | 13649907f05014fcfffcfccaef01e63ad3339351 | https://github.com/walkor/Workerman/blob/13649907f05014fcfffcfccaef01e63ad3339351/Worker.php#L2090-L2112 | train | Echoes a message to the screen | [
30522,
2270,
10763,
3853,
3647,
15937,
2080,
1006,
1002,
5796,
2290,
1010,
1002,
7429,
1027,
6270,
1007,
1063,
1002,
5460,
1027,
10763,
1024,
1024,
27852,
25379,
1006,
1007,
1025,
2065,
1006,
999,
1002,
5460,
1007,
1063,
2709,
6270,
1025,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/Login/Login.php | Login.noAccess | public function noAccess(Exception $exception)
{
$frontController = FrontController::getInstance();
if (Common::isXmlHttpRequest()) {
echo $frontController->dispatch(Piwik::getLoginPluginName(), 'ajaxNoAccess', array($exception->getMessage()));
return;
}
ech... | php | public function noAccess(Exception $exception)
{
$frontController = FrontController::getInstance();
if (Common::isXmlHttpRequest()) {
echo $frontController->dispatch(Piwik::getLoginPluginName(), 'ajaxNoAccess', array($exception->getMessage()));
return;
}
ech... | [
"public",
"function",
"noAccess",
"(",
"Exception",
"$",
"exception",
")",
"{",
"$",
"frontController",
"=",
"FrontController",
"::",
"getInstance",
"(",
")",
";",
"if",
"(",
"Common",
"::",
"isXmlHttpRequest",
"(",
")",
")",
"{",
"echo",
"$",
"frontControll... | Redirects to Login form with error message.
Listens to User.isNotAuthorized hook. | [
"Redirects",
"to",
"Login",
"form",
"with",
"error",
"message",
".",
"Listens",
"to",
"User",
".",
"isNotAuthorized",
"hook",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Login/Login.php#L159-L169 | train | This method is called by Piwik to display a message to the user that is not allowed to access the user. | [
30522,
2270,
3853,
2053,
6305,
9623,
2015,
1006,
6453,
1002,
6453,
1007,
1063,
1002,
2392,
8663,
13181,
10820,
1027,
2392,
8663,
13181,
10820,
1024,
1024,
2131,
7076,
26897,
1006,
1007,
1025,
2065,
1006,
2691,
1024,
1024,
2003,
2595,
19968,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Row.php | Row.getMetadata | public function getMetadata($name = null)
{
if (is_null($name)) {
return $this->metadata;
}
if (!isset($this->metadata[$name])) {
return false;
}
return $this->metadata[$name];
} | php | public function getMetadata($name = null)
{
if (is_null($name)) {
return $this->metadata;
}
if (!isset($this->metadata[$name])) {
return false;
}
return $this->metadata[$name];
} | [
"public",
"function",
"getMetadata",
"(",
"$",
"name",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"name",
")",
")",
"{",
"return",
"$",
"this",
"->",
"metadata",
";",
"}",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"metadata",
"... | Returns the array of all metadata, or one requested metadata value.
@param string|null $name The name of the metadata to return or null to return all metadata.
@return mixed | [
"Returns",
"the",
"array",
"of",
"all",
"metadata",
"or",
"one",
"requested",
"metadata",
"value",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable/Row.php#L197-L206 | train | Get metadata of the current language | [
30522,
2270,
3853,
2131,
11368,
8447,
2696,
1006,
1002,
2171,
1027,
19701,
1007,
1063,
2065,
1006,
2003,
1035,
19701,
1006,
1002,
2171,
1007,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
27425,
1025,
1065,
2065,
1006,
999,
26354,
3388,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/Proxy/Controller.php | Controller.redirect | public function redirect()
{
$url = Common::getRequestVar('url', '', 'string', $_GET);
if (!UrlHelper::isLookLikeUrl($url)) {
die('Please check the &url= parameter: it should to be a valid URL');
}
// validate referrer
$referrer = Url::getReferrer();
if (e... | php | public function redirect()
{
$url = Common::getRequestVar('url', '', 'string', $_GET);
if (!UrlHelper::isLookLikeUrl($url)) {
die('Please check the &url= parameter: it should to be a valid URL');
}
// validate referrer
$referrer = Url::getReferrer();
if (e... | [
"public",
"function",
"redirect",
"(",
")",
"{",
"$",
"url",
"=",
"Common",
"::",
"getRequestVar",
"(",
"'url'",
",",
"''",
",",
"'string'",
",",
"$",
"_GET",
")",
";",
"if",
"(",
"!",
"UrlHelper",
"::",
"isLookLikeUrl",
"(",
"$",
"url",
")",
")",
... | Output redirection page instead of linking directly to avoid
exposing the referrer on the Piwik demo.
@internal param string $url (via $_GET)
@deprecated @since 3.6.0 | [
"Output",
"redirection",
"page",
"instead",
"of",
"linking",
"directly",
"to",
"avoid",
"exposing",
"the",
"referrer",
"on",
"the",
"Piwik",
"demo",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Proxy/Controller.php#L79-L103 | train | Redirects to the referrer URL | [
30522,
2270,
3853,
2417,
7442,
6593,
1006,
1007,
1063,
1002,
24471,
2140,
1027,
2691,
1024,
1024,
2131,
2890,
15500,
10755,
1006,
1005,
24471,
2140,
1005,
1010,
1005,
1005,
1010,
1005,
5164,
1005,
1010,
1002,
1035,
2131,
1007,
1025,
2065,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/system/traits/ConfigMaker.php | ConfigMaker.makeConfigFromArray | public function makeConfigFromArray($configArray = [])
{
$object = new stdClass;
if (!is_array($configArray)) {
return $object;
}
foreach ($configArray as $name => $value) {
$_name = camel_case($name);
$object->{$name} = $object->{$_name} = $valu... | php | public function makeConfigFromArray($configArray = [])
{
$object = new stdClass;
if (!is_array($configArray)) {
return $object;
}
foreach ($configArray as $name => $value) {
$_name = camel_case($name);
$object->{$name} = $object->{$_name} = $valu... | [
"public",
"function",
"makeConfigFromArray",
"(",
"$",
"configArray",
"=",
"[",
"]",
")",
"{",
"$",
"object",
"=",
"new",
"stdClass",
";",
"if",
"(",
"!",
"is_array",
"(",
"$",
"configArray",
")",
")",
"{",
"return",
"$",
"object",
";",
"}",
"foreach",... | Makes a config object from an array, making the first level keys properties a new object.
Property values are converted to camelCase and are not set if one already exists.
@param array $configArray Config array.
@return stdClass The config object | [
"Makes",
"a",
"config",
"object",
"from",
"an",
"array",
"making",
"the",
"first",
"level",
"keys",
"properties",
"a",
"new",
"object",
".",
"Property",
"values",
"are",
"converted",
"to",
"camelCase",
"and",
"are",
"not",
"set",
"if",
"one",
"already",
"e... | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/traits/ConfigMaker.php#L108-L122 | train | Make config from array | [
30522,
2270,
3853,
2191,
8663,
8873,
25708,
21716,
2906,
9447,
1006,
1002,
9530,
8873,
6843,
9447,
1027,
1031,
1033,
1007,
1063,
1002,
4874,
1027,
2047,
2358,
16409,
27102,
1025,
2065,
1006,
999,
2003,
1035,
9140,
1006,
1002,
9530,
8873,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Validation/Factory.php | Factory.extendImplicit | public function extendImplicit($rule, $extension, $message = null)
{
$this->implicitExtensions[$rule] = $extension;
if ($message) {
$this->fallbackMessages[Str::snake($rule)] = $message;
}
} | php | public function extendImplicit($rule, $extension, $message = null)
{
$this->implicitExtensions[$rule] = $extension;
if ($message) {
$this->fallbackMessages[Str::snake($rule)] = $message;
}
} | [
"public",
"function",
"extendImplicit",
"(",
"$",
"rule",
",",
"$",
"extension",
",",
"$",
"message",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"implicitExtensions",
"[",
"$",
"rule",
"]",
"=",
"$",
"extension",
";",
"if",
"(",
"$",
"message",
")",
"... | Register a custom implicit validator extension.
@param string $rule
@param \Closure|string $extension
@param string $message
@return void | [
"Register",
"a",
"custom",
"implicit",
"validator",
"extension",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Validation/Factory.php#L204-L211 | train | Extend implicit rules with a specific extension | [
30522,
2270,
3853,
7949,
5714,
24759,
30524,
2015,
1031,
1002,
3627,
1033,
1027,
1002,
5331,
1025,
2065,
1006,
1002,
4471,
1007,
1063,
1002,
2023,
1011,
1028,
2991,
5963,
7834,
3736,
8449,
1031,
2358,
2099,
1024,
1024,
7488,
1006,
1002,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/HTML/QuickForm2/Renderer/Default.php | HTML_QuickForm2_Renderer_Default.prepareTemplate | public function prepareTemplate($elTpl, HTML_QuickForm2_Node $element)
{
// if element is required
$elTpl = $this->markRequired($elTpl, $element->isRequired());
$elTpl = $this->outputError($elTpl, $element->getError());
return $this->outputLabel($elTpl, $element->getLabel());
} | php | public function prepareTemplate($elTpl, HTML_QuickForm2_Node $element)
{
// if element is required
$elTpl = $this->markRequired($elTpl, $element->isRequired());
$elTpl = $this->outputError($elTpl, $element->getError());
return $this->outputLabel($elTpl, $element->getLabel());
} | [
"public",
"function",
"prepareTemplate",
"(",
"$",
"elTpl",
",",
"HTML_QuickForm2_Node",
"$",
"element",
")",
"{",
"// if element is required",
"$",
"elTpl",
"=",
"$",
"this",
"->",
"markRequired",
"(",
"$",
"elTpl",
",",
"$",
"element",
"->",
"isRequired",
"(... | Processes the element's template, adding label(s), required note and error message
@param string Element template
@param HTML_QuickForm2_Node Element being rendered
@return string Template with some substitutions done | [
"Processes",
"the",
"element",
"s",
"template",
"adding",
"label",
"(",
"s",
")",
"required",
"note",
"and",
"error",
"message"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Renderer/Default.php#L519-L525 | train | prepare template for validation | [
30522,
2270,
3853,
7374,
18532,
15725,
1006,
1002,
3449,
25856,
2140,
1010,
16129,
1035,
4248,
14192,
2475,
1035,
13045,
1002,
5783,
1007,
1063,
1013,
1013,
2065,
5783,
2003,
3223,
1002,
3449,
25856,
2140,
1027,
1002,
2023,
1011,
1028,
2928... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.getDefaultCurrency | public function getDefaultCurrency()
{
Piwik::checkUserHasSomeAdminAccess();
$defaultCurrency = Option::get(self::OPTION_DEFAULT_CURRENCY);
if ($defaultCurrency) {
return $defaultCurrency;
}
return 'USD';
} | php | public function getDefaultCurrency()
{
Piwik::checkUserHasSomeAdminAccess();
$defaultCurrency = Option::get(self::OPTION_DEFAULT_CURRENCY);
if ($defaultCurrency) {
return $defaultCurrency;
}
return 'USD';
} | [
"public",
"function",
"getDefaultCurrency",
"(",
")",
"{",
"Piwik",
"::",
"checkUserHasSomeAdminAccess",
"(",
")",
";",
"$",
"defaultCurrency",
"=",
"Option",
"::",
"get",
"(",
"self",
"::",
"OPTION_DEFAULT_CURRENCY",
")",
";",
"if",
"(",
"$",
"defaultCurrency",... | Returns the default currency that will be set when creating a website through the API.
@return string Currency ID eg. 'USD' | [
"Returns",
"the",
"default",
"currency",
"that",
"will",
"be",
"set",
"when",
"creating",
"a",
"website",
"through",
"the",
"API",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SitesManager/API.php#L1154-L1162 | train | Returns the default currency | [
30522,
2270,
3853,
2131,
3207,
7011,
11314,
10841,
14343,
9407,
1006,
1007,
1063,
14255,
9148,
2243,
1024,
1024,
4638,
20330,
14949,
14045,
4215,
22311,
9468,
7971,
1006,
1007,
1025,
1002,
12398,
10841,
14343,
9407,
1027,
5724,
1024,
1024,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Filesystem/Filesystem.php | Filesystem.get | public function get($path, $lock = false)
{
if ($this->isFile($path)) {
return $lock ? $this->sharedGet($path) : file_get_contents($path);
}
throw new FileNotFoundException("File does not exist at path {$path}");
} | php | public function get($path, $lock = false)
{
if ($this->isFile($path)) {
return $lock ? $this->sharedGet($path) : file_get_contents($path);
}
throw new FileNotFoundException("File does not exist at path {$path}");
} | [
"public",
"function",
"get",
"(",
"$",
"path",
",",
"$",
"lock",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isFile",
"(",
"$",
"path",
")",
")",
"{",
"return",
"$",
"lock",
"?",
"$",
"this",
"->",
"sharedGet",
"(",
"$",
"path",
")",... | Get the contents of a file.
@param string $path
@param bool $lock
@return string
@throws \Illuminate\Contracts\Filesystem\FileNotFoundException | [
"Get",
"the",
"contents",
"of",
"a",
"file",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Filesystem/Filesystem.php#L35-L42 | train | Get the content of a file | [
30522,
2270,
3853,
2131,
1006,
1002,
4130,
1010,
1002,
5843,
1027,
6270,
1007,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
2003,
8873,
2571,
1006,
1002,
4130,
1007,
1007,
1063,
2709,
1002,
5843,
1029,
1002,
2023,
1011,
1028,
4207,
18150,
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/DependencyInjection/Definition.php | Definition.setFactory | public function setFactory($factory)
{
$this->changes['factory'] = true;
if (\is_string($factory) && false !== strpos($factory, '::')) {
$factory = explode('::', $factory, 2);
} elseif ($factory instanceof Reference) {
$factory = [$factory, '__invoke'];
}
... | php | public function setFactory($factory)
{
$this->changes['factory'] = true;
if (\is_string($factory) && false !== strpos($factory, '::')) {
$factory = explode('::', $factory, 2);
} elseif ($factory instanceof Reference) {
$factory = [$factory, '__invoke'];
}
... | [
"public",
"function",
"setFactory",
"(",
"$",
"factory",
")",
"{",
"$",
"this",
"->",
"changes",
"[",
"'factory'",
"]",
"=",
"true",
";",
"if",
"(",
"\\",
"is_string",
"(",
"$",
"factory",
")",
"&&",
"false",
"!==",
"strpos",
"(",
"$",
"factory",
","... | Sets a factory.
@param string|array|Reference $factory A PHP function, reference or an array containing a class/Reference and a method to call
@return $this | [
"Sets",
"a",
"factory",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/DependencyInjection/Definition.php#L102-L115 | train | Set factory. | [
30522,
2270,
3853,
2275,
21450,
1006,
1002,
4713,
1007,
1063,
1002,
2023,
1011,
1028,
3431,
1031,
1005,
4713,
1005,
1033,
1027,
2995,
1025,
2065,
1006,
1032,
2003,
1035,
5164,
1006,
1002,
4713,
1007,
1004,
1004,
6270,
999,
1027,
1027,
235... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/UserCountry/LocationProvider/GeoIp/Pecl.php | Pecl.getLocation | public function getLocation($info)
{
$ip = $this->getIpFromInfo($info);
$result = array();
// get location data
if (self::isCityDatabaseAvailable()) {
// Must hide errors because missing IPV6:
$location = @geoip_record_by_name($ip);
if (!empty($l... | php | public function getLocation($info)
{
$ip = $this->getIpFromInfo($info);
$result = array();
// get location data
if (self::isCityDatabaseAvailable()) {
// Must hide errors because missing IPV6:
$location = @geoip_record_by_name($ip);
if (!empty($l... | [
"public",
"function",
"getLocation",
"(",
"$",
"info",
")",
"{",
"$",
"ip",
"=",
"$",
"this",
"->",
"getIpFromInfo",
"(",
"$",
"info",
")",
";",
"$",
"result",
"=",
"array",
"(",
")",
";",
"// get location data",
"if",
"(",
"self",
"::",
"isCityDatabas... | Uses the GeoIP PECL module to get a visitor's location based on their IP address.
This function will return different results based on the data available. If a city
database can be detected by the PECL module, it may return the country code,
region code, city name, area code, latitude, longitude and postal code of the... | [
"Uses",
"the",
"GeoIP",
"PECL",
"module",
"to",
"get",
"a",
"visitor",
"s",
"location",
"based",
"on",
"their",
"IP",
"address",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UserCountry/LocationProvider/GeoIp/Pecl.php#L53-L104 | train | Get location data | [
30522,
2270,
3853,
2131,
4135,
10719,
1006,
1002,
18558,
1007,
1063,
1002,
12997,
1027,
1002,
2023,
1011,
1028,
2131,
11514,
19699,
20936,
2078,
14876,
1006,
1002,
18558,
1007,
1025,
1002,
2765,
1027,
9140,
1006,
1007,
1025,
1013,
1013,
213... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/WorkflowExtension.php | WorkflowExtension.getMarkedPlaces | public function getMarkedPlaces($subject, $placesNameOnly = true, $name = null)
{
$places = $this->workflowRegistry->get($subject, $name)->getMarking($subject)->getPlaces();
if ($placesNameOnly) {
return array_keys($places);
}
return $places;
} | php | public function getMarkedPlaces($subject, $placesNameOnly = true, $name = null)
{
$places = $this->workflowRegistry->get($subject, $name)->getMarking($subject)->getPlaces();
if ($placesNameOnly) {
return array_keys($places);
}
return $places;
} | [
"public",
"function",
"getMarkedPlaces",
"(",
"$",
"subject",
",",
"$",
"placesNameOnly",
"=",
"true",
",",
"$",
"name",
"=",
"null",
")",
"{",
"$",
"places",
"=",
"$",
"this",
"->",
"workflowRegistry",
"->",
"get",
"(",
"$",
"subject",
",",
"$",
"name... | Returns marked places.
@param object $subject A subject
@param bool $placesNameOnly If true, returns only places name. If false returns the raw representation
@param string $name A workflow name
@return string[]|int[] | [
"Returns",
"marked",
"places",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bridge/Twig/Extension/WorkflowExtension.php#L96-L105 | train | Get the places marked by a subject | [
30522,
2270,
3853,
2131,
10665,
2098,
24759,
10732,
2015,
1006,
1002,
3395,
1010,
1002,
3182,
18442,
2239,
2135,
1027,
2995,
1010,
1002,
2171,
1027,
19701,
1007,
1063,
1002,
3182,
1027,
1002,
2023,
1011,
1028,
2147,
12314,
2890,
24063,
2854... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | Worker.php | Worker.writeStatisticsToStatusFile | protected static function writeStatisticsToStatusFile()
{
// For master process.
if (static::$_masterPid === posix_getpid()) {
$all_worker_info = array();
foreach(static::$_pidMap as $worker_id => $pid_array) {
/** @var /Workerman/Worker $worker */
... | php | protected static function writeStatisticsToStatusFile()
{
// For master process.
if (static::$_masterPid === posix_getpid()) {
$all_worker_info = array();
foreach(static::$_pidMap as $worker_id => $pid_array) {
/** @var /Workerman/Worker $worker */
... | [
"protected",
"static",
"function",
"writeStatisticsToStatusFile",
"(",
")",
"{",
"// For master process.",
"if",
"(",
"static",
"::",
"$",
"_masterPid",
"===",
"posix_getpid",
"(",
")",
")",
"{",
"$",
"all_worker_info",
"=",
"array",
"(",
")",
";",
"foreach",
... | Write statistics data to disk.
@return void | [
"Write",
"statistics",
"data",
"to",
"disk",
"."
] | 13649907f05014fcfffcfccaef01e63ad3339351 | https://github.com/walkor/Workerman/blob/13649907f05014fcfffcfccaef01e63ad3339351/Worker.php#L1850-L1923 | train | Write statistics to status file | [
30522,
5123,
10763,
3853,
7009,
29336,
6553,
16033,
9153,
5809,
8873,
2571,
1006,
1007,
1063,
1013,
1013,
2005,
3040,
2832,
1012,
2065,
1006,
10763,
1024,
1024,
1002,
1035,
3040,
23267,
1027,
1027,
1027,
13433,
5332,
2595,
1035,
2131,
23267... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/ProfessionalServices/Advertising.php | Advertising.addPromoCampaignParametersToUrl | public function addPromoCampaignParametersToUrl($url, $campaignName, $campaignMedium, $campaignContent = '')
{
if (empty($url)) {
return '';
}
if (strpos($url, '?') === false) {
$url .= '?';
} else {
$url .= '&';
}
$url .= $this->... | php | public function addPromoCampaignParametersToUrl($url, $campaignName, $campaignMedium, $campaignContent = '')
{
if (empty($url)) {
return '';
}
if (strpos($url, '?') === false) {
$url .= '?';
} else {
$url .= '&';
}
$url .= $this->... | [
"public",
"function",
"addPromoCampaignParametersToUrl",
"(",
"$",
"url",
",",
"$",
"campaignName",
",",
"$",
"campaignMedium",
",",
"$",
"campaignContent",
"=",
"''",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"url",
")",
")",
"{",
"return",
"''",
";",
"}"... | Appends campaign parameters to the given URL for promoting any Professional Support for Piwik service.
@param string $url
@param string $campaignName
@param string $campaignMedium
@param string $campaignContent
@return string | [
"Appends",
"campaign",
"parameters",
"to",
"the",
"given",
"URL",
"for",
"promoting",
"any",
"Professional",
"Support",
"for",
"Piwik",
"service",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/ProfessionalServices/Advertising.php#L78-L93 | train | Add campaign parameters to promo url | [
30522,
2270,
3853,
5587,
21572,
5302,
26468,
4886,
16206,
28689,
22828,
16033,
3126,
2140,
1006,
1002,
24471,
2140,
1010,
1002,
3049,
18442,
1010,
1002,
3049,
7583,
5007,
1010,
1002,
3049,
8663,
6528,
2102,
1027,
1005,
1005,
30524,
1063,
27... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Mime/Header/IdentificationHeader.php | IdentificationHeader.setIds | public function setIds(array $ids)
{
$this->ids = [];
$this->idsAsAddresses = [];
foreach ($ids as $id) {
$this->idsAsAddresses[] = new Address($id);
$this->ids[] = $id;
}
} | php | public function setIds(array $ids)
{
$this->ids = [];
$this->idsAsAddresses = [];
foreach ($ids as $id) {
$this->idsAsAddresses[] = new Address($id);
$this->ids[] = $id;
}
} | [
"public",
"function",
"setIds",
"(",
"array",
"$",
"ids",
")",
"{",
"$",
"this",
"->",
"ids",
"=",
"[",
"]",
";",
"$",
"this",
"->",
"idsAsAddresses",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"ids",
"as",
"$",
"id",
")",
"{",
"$",
"this",
"->",... | Set a collection of IDs to use in the value of this Header.
@param string[] $ids
@throws RfcComplianceException | [
"Set",
"a",
"collection",
"of",
"IDs",
"to",
"use",
"in",
"the",
"value",
"of",
"this",
"Header",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Mime/Header/IdentificationHeader.php#L86-L94 | train | Set the list of address ids | [
30522,
2270,
3853,
2275,
9821,
1006,
9140,
1002,
8909,
2015,
1007,
1063,
1002,
2023,
1011,
1028,
8909,
2015,
1027,
1031,
1033,
1025,
1002,
2023,
1011,
1028,
8909,
20939,
4215,
16200,
11393,
2015,
1027,
1031,
1033,
1025,
18921,
6776,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Form/ChoiceList/Factory/PropertyAccessDecorator.php | PropertyAccessDecorator.createListFromChoices | public function createListFromChoices($choices, $value = null)
{
if (\is_string($value)) {
$value = new PropertyPath($value);
}
if ($value instanceof PropertyPath) {
$accessor = $this->propertyAccessor;
$value = function ($choice) use ($accessor, $value) ... | php | public function createListFromChoices($choices, $value = null)
{
if (\is_string($value)) {
$value = new PropertyPath($value);
}
if ($value instanceof PropertyPath) {
$accessor = $this->propertyAccessor;
$value = function ($choice) use ($accessor, $value) ... | [
"public",
"function",
"createListFromChoices",
"(",
"$",
"choices",
",",
"$",
"value",
"=",
"null",
")",
"{",
"if",
"(",
"\\",
"is_string",
"(",
"$",
"value",
")",
")",
"{",
"$",
"value",
"=",
"new",
"PropertyPath",
"(",
"$",
"value",
")",
";",
"}",
... | {@inheritdoc}
@param iterable $choices The choices
@param callable|string|PropertyPath|null $value The callable or path for
generating the choice values
@return ChoiceListInterface The choice list | [
"{",
"@inheritdoc",
"}"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/ChoiceList/Factory/PropertyAccessDecorator.php#L68-L88 | train | Create a list from choices | [
30522,
2270,
3853,
3443,
9863,
19699,
5358,
9905,
23522,
1006,
1002,
9804,
1010,
1002,
3643,
1027,
19701,
1007,
1063,
2065,
1006,
1032,
2003,
1035,
5164,
1006,
1002,
3643,
1007,
1007,
1063,
1002,
3643,
1027,
2047,
3200,
15069,
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... |
laravel/framework | src/Illuminate/Foundation/Application.php | Application.registerCoreContainerAliases | public function registerCoreContainerAliases()
{
foreach ([
'app' => [\Illuminate\Foundation\Application::class, \Illuminate\Contracts\Container\Container::class, \Illuminate\Contracts\Foundation\Application::class, \Psr\Container\ContainerInterface::class],
'auth' ... | php | public function registerCoreContainerAliases()
{
foreach ([
'app' => [\Illuminate\Foundation\Application::class, \Illuminate\Contracts\Container\Container::class, \Illuminate\Contracts\Foundation\Application::class, \Psr\Container\ContainerInterface::class],
'auth' ... | [
"public",
"function",
"registerCoreContainerAliases",
"(",
")",
"{",
"foreach",
"(",
"[",
"'app'",
"=>",
"[",
"\\",
"Illuminate",
"\\",
"Foundation",
"\\",
"Application",
"::",
"class",
",",
"\\",
"Illuminate",
"\\",
"Contracts",
"\\",
"Container",
"\\",
"Cont... | Register the core class aliases in the container.
@return void | [
"Register",
"the",
"core",
"class",
"aliases",
"in",
"the",
"container",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Foundation/Application.php#L1118-L1161 | train | Register core container aliases | [
30522,
2270,
3853,
4236,
17345,
8663,
18249,
21673,
7951,
2229,
1006,
1007,
1063,
18921,
6776,
1006,
1031,
1005,
10439,
1005,
1027,
1028,
1031,
1032,
5665,
12717,
12556,
1032,
3192,
1032,
4646,
1024,
1024,
2465,
1010,
1032,
5665,
12717,
125... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.fetchRow | public function fetchRow($sql, $bind = array(), $fetchMode = null)
{
if ($fetchMode === null) {
$fetchMode = $this->_fetchMode;
}
$stmt = $this->query($sql, $bind);
$result = $stmt->fetch($fetchMode);
return $result;
} | php | public function fetchRow($sql, $bind = array(), $fetchMode = null)
{
if ($fetchMode === null) {
$fetchMode = $this->_fetchMode;
}
$stmt = $this->query($sql, $bind);
$result = $stmt->fetch($fetchMode);
return $result;
} | [
"public",
"function",
"fetchRow",
"(",
"$",
"sql",
",",
"$",
"bind",
"=",
"array",
"(",
")",
",",
"$",
"fetchMode",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"fetchMode",
"===",
"null",
")",
"{",
"$",
"fetchMode",
"=",
"$",
"this",
"->",
"_fetchMode",... | Fetches the first row of the SQL result.
Uses the current fetchMode for the adapter.
@param string|Zend_Db_Select $sql An SQL SELECT statement.
@param mixed $bind Data to bind into SELECT placeholders.
@param mixed $fetchMode Override current fetch mode.
@return array | [
"Fetches",
"the",
"first",
"row",
"of",
"the",
"SQL",
"result",
".",
"Uses",
"the",
"current",
"fetchMode",
"for",
"the",
"adapter",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Adapter/Abstract.php#L750-L758 | train | Returns the first row of the result set of a query | [
30522,
2270,
3853,
18584,
10524,
1006,
1002,
29296,
1010,
1002,
14187,
1027,
9140,
1006,
1007,
1010,
1002,
18584,
5302,
3207,
1027,
19701,
1007,
1063,
2065,
1006,
1002,
18584,
5302,
3207,
1027,
1027,
1027,
19701,
1007,
1063,
1002,
18584,
53... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/FormFieldRegistry.php | FormFieldRegistry.create | private static function create($base, array $values)
{
$registry = new static();
$registry->base = $base;
$registry->fields = $values;
return $registry;
} | php | private static function create($base, array $values)
{
$registry = new static();
$registry->base = $base;
$registry->fields = $values;
return $registry;
} | [
"private",
"static",
"function",
"create",
"(",
"$",
"base",
",",
"array",
"$",
"values",
")",
"{",
"$",
"registry",
"=",
"new",
"static",
"(",
")",
";",
"$",
"registry",
"->",
"base",
"=",
"$",
"base",
";",
"$",
"registry",
"->",
"fields",
"=",
"$... | Creates an instance of the class.
This function is made private because it allows overriding the $base and
the $values properties without any type checking.
@param string $base The fully qualified name of the base field
@param array $values The values of the fields
@return static | [
"Creates",
"an",
"instance",
"of",
"the",
"class",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/DomCrawler/FormFieldRegistry.php#L154-L161 | train | Create a new instance of the class | [
30522,
2797,
10763,
3853,
3443,
1006,
1002,
2918,
1010,
9140,
1002,
5300,
1007,
1063,
1002,
15584,
1027,
2047,
10763,
1006,
1007,
1025,
1002,
15584,
1011,
1028,
2918,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Bridge/Doctrine/Form/ChoiceList/IdReader.php | IdReader.getIdValue | public function getIdValue($object)
{
if (!$object) {
return;
}
if (!$this->om->contains($object)) {
throw new RuntimeException(sprintf('Entity of type "%s" passed to the choice field must be managed. Maybe you forget to persist it in the entity manager?', \get_class... | php | public function getIdValue($object)
{
if (!$object) {
return;
}
if (!$this->om->contains($object)) {
throw new RuntimeException(sprintf('Entity of type "%s" passed to the choice field must be managed. Maybe you forget to persist it in the entity manager?', \get_class... | [
"public",
"function",
"getIdValue",
"(",
"$",
"object",
")",
"{",
"if",
"(",
"!",
"$",
"object",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"$",
"this",
"->",
"om",
"->",
"contains",
"(",
"$",
"object",
")",
")",
"{",
"throw",
"new",
"RuntimeE... | Returns the ID value for an object.
This method assumes that the object has a single-column ID.
@param object $object The object
@return mixed The ID value | [
"Returns",
"the",
"ID",
"value",
"for",
"an",
"object",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bridge/Doctrine/Form/ChoiceList/IdReader.php#L91-L110 | train | Returns the id value of the object | [
30522,
2270,
3853,
2131,
3593,
10175,
5657,
1006,
1002,
4874,
1007,
1063,
2065,
1006,
999,
1002,
4874,
1007,
1063,
2709,
1025,
1065,
2065,
1006,
999,
1002,
2023,
1011,
1028,
18168,
1011,
1028,
3397,
1006,
1002,
4874,
1007,
1007,
1063,
546... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/DependencyInjection/Compiler/InlineServiceDefinitionsPass.php | InlineServiceDefinitionsPass.setRepeatedPass | public function setRepeatedPass(RepeatedPass $repeatedPass)
{
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.2.', __METHOD__), E_USER_DEPRECATED);
$this->repeatedPass = $repeatedPass;
} | php | public function setRepeatedPass(RepeatedPass $repeatedPass)
{
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.2.', __METHOD__), E_USER_DEPRECATED);
$this->repeatedPass = $repeatedPass;
} | [
"public",
"function",
"setRepeatedPass",
"(",
"RepeatedPass",
"$",
"repeatedPass",
")",
"{",
"@",
"trigger_error",
"(",
"sprintf",
"(",
"'The \"%s()\" method is deprecated since Symfony 4.2.'",
",",
"__METHOD__",
")",
",",
"E_USER_DEPRECATED",
")",
";",
"$",
"this",
"... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/DependencyInjection/Compiler/InlineServiceDefinitionsPass.php#L43-L47 | train | Sets the repeated pass | [
30522,
2270,
3853,
2275,
2890,
5051,
4383,
15194,
1006,
5567,
15194,
1002,
5567,
15194,
1007,
1063,
1030,
9495,
1035,
7561,
1006,
9043,
2546,
1006,
1005,
1996,
1000,
1003,
1055,
1006,
1007,
1000,
4118,
2003,
2139,
28139,
12921,
2144,
25353,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Intl/Data/Provider/DateTimeFormatProvider.php | DateTimeFormatProvider.getFormatPattern | public function getFormatPattern($format)
{
switch ($format) {
case self::DATETIME_FORMAT_LONG:
return 'EEEE, MMMM d, y HH:mm:ss';
case self::DATETIME_FORMAT_SHORT:
return 'MMM d, y HH:mm:ss';
case self::DATE_FORMAT_LONG:
... | php | public function getFormatPattern($format)
{
switch ($format) {
case self::DATETIME_FORMAT_LONG:
return 'EEEE, MMMM d, y HH:mm:ss';
case self::DATETIME_FORMAT_SHORT:
return 'MMM d, y HH:mm:ss';
case self::DATE_FORMAT_LONG:
... | [
"public",
"function",
"getFormatPattern",
"(",
"$",
"format",
")",
"{",
"switch",
"(",
"$",
"format",
")",
"{",
"case",
"self",
"::",
"DATETIME_FORMAT_LONG",
":",
"return",
"'EEEE, MMMM d, y HH:mm:ss'",
";",
"case",
"self",
"::",
"DATETIME_FORMAT_SHORT",
":",
"r... | Returns the format pattern for the given format type
@param int $format one of the format constants
@return string | [
"Returns",
"the",
"format",
"pattern",
"for",
"the",
"given",
"format",
"type"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Intl/Data/Provider/DateTimeFormatProvider.php#L33-L65 | train | Return the format pattern | [
30522,
2270,
3853,
2131,
14192,
4017,
4502,
12079,
2078,
1006,
1002,
4289,
1007,
1063,
6942,
1006,
1002,
4289,
1007,
1063,
2553,
2969,
1024,
1024,
3058,
7292,
1035,
4289,
1035,
2146,
1024,
2709,
1005,
25212,
4402,
1010,
25391,
2213,
1040,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/MorphTo.php | MorphTo.matchToMorphParents | protected function matchToMorphParents($type, Collection $results)
{
foreach ($results as $result) {
$ownerKey = ! is_null($this->ownerKey) ? $result->{$this->ownerKey} : $result->getKey();
if (isset($this->dictionary[$type][$ownerKey])) {
foreach ($this->dictionary[... | php | protected function matchToMorphParents($type, Collection $results)
{
foreach ($results as $result) {
$ownerKey = ! is_null($this->ownerKey) ? $result->{$this->ownerKey} : $result->getKey();
if (isset($this->dictionary[$type][$ownerKey])) {
foreach ($this->dictionary[... | [
"protected",
"function",
"matchToMorphParents",
"(",
"$",
"type",
",",
"Collection",
"$",
"results",
")",
"{",
"foreach",
"(",
"$",
"results",
"as",
"$",
"result",
")",
"{",
"$",
"ownerKey",
"=",
"!",
"is_null",
"(",
"$",
"this",
"->",
"ownerKey",
")",
... | Match the results for a given type to their parents.
@param string $type
@param \Illuminate\Database\Eloquent\Collection $results
@return void | [
"Match",
"the",
"results",
"for",
"a",
"given",
"type",
"to",
"their",
"parents",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Relations/MorphTo.php#L167-L178 | train | Match to morph parents | [
30522,
5123,
3853,
2674,
20389,
2953,
8458,
19362,
11187,
1006,
1002,
2828,
1010,
3074,
1002,
3463,
1007,
1063,
18921,
6776,
1006,
1002,
3463,
2004,
1002,
2765,
1007,
1063,
1002,
3954,
14839,
1027,
999,
2003,
1035,
19701,
1006,
1002,
2023,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/HttpKernel/HttpCache/AbstractSurrogate.php | AbstractSurrogate.hasSurrogateCapability | public function hasSurrogateCapability(Request $request)
{
if (null === $value = $request->headers->get('Surrogate-Capability')) {
return false;
}
return false !== strpos($value, sprintf('%s/1.0', strtoupper($this->getName())));
} | php | public function hasSurrogateCapability(Request $request)
{
if (null === $value = $request->headers->get('Surrogate-Capability')) {
return false;
}
return false !== strpos($value, sprintf('%s/1.0', strtoupper($this->getName())));
} | [
"public",
"function",
"hasSurrogateCapability",
"(",
"Request",
"$",
"request",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"value",
"=",
"$",
"request",
"->",
"headers",
"->",
"get",
"(",
"'Surrogate-Capability'",
")",
")",
"{",
"return",
"false",
";",
"}",
... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpKernel/HttpCache/AbstractSurrogate.php#L54-L61 | train | Returns true if the request has the surrogate capability | [
30522,
2270,
3853,
2038,
26210,
21799,
17695,
8010,
1006,
5227,
1002,
5227,
1007,
1063,
2065,
1006,
19701,
1027,
1027,
1027,
1002,
3643,
1027,
1002,
5227,
1011,
1028,
20346,
2015,
1011,
1028,
2131,
1006,
1005,
7505,
21799,
1011,
10673,
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... |
getgrav/grav | system/src/Grav/Common/Page/Page.php | Page.routable | public function routable($var = null)
{
if ($var !== null) {
$this->routable = (bool)$var;
}
return $this->routable && $this->published();
} | php | public function routable($var = null)
{
if ($var !== null) {
$this->routable = (bool)$var;
}
return $this->routable && $this->published();
} | [
"public",
"function",
"routable",
"(",
"$",
"var",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"var",
"!==",
"null",
")",
"{",
"$",
"this",
"->",
"routable",
"=",
"(",
"bool",
")",
"$",
"var",
";",
"}",
"return",
"$",
"this",
"->",
"routable",
"&&",
... | Gets and Sets whether or not this Page is routable, ie you can reach it
via a URL.
The page must be *routable* and *published*
@param bool $var true if the page is routable
@return bool true if the page is routable | [
"Gets",
"and",
"Sets",
"whether",
"or",
"not",
"this",
"Page",
"is",
"routable",
"ie",
"you",
"can",
"reach",
"it",
"via",
"a",
"URL",
".",
"The",
"page",
"must",
"be",
"*",
"routable",
"*",
"and",
"*",
"published",
"*"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Page/Page.php#L1619-L1626 | train | Check if this page is routable | [
30522,
2270,
3853,
20996,
23056,
1006,
1002,
13075,
1027,
19701,
1007,
1063,
2065,
1006,
1002,
13075,
999,
1027,
1027,
19701,
1007,
1063,
1002,
2023,
1011,
1028,
20996,
23056,
1027,
1006,
22017,
2140,
1007,
1002,
13075,
1025,
1065,
2709,
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/DependencyInjection/Loader/Configurator/AbstractServiceConfigurator.php | AbstractServiceConfigurator.load | final public function load(string $namespace, string $resource): PrototypeConfigurator
{
$this->__destruct();
return $this->parent->load($namespace, $resource);
} | php | final public function load(string $namespace, string $resource): PrototypeConfigurator
{
$this->__destruct();
return $this->parent->load($namespace, $resource);
} | [
"final",
"public",
"function",
"load",
"(",
"string",
"$",
"namespace",
",",
"string",
"$",
"resource",
")",
":",
"PrototypeConfigurator",
"{",
"$",
"this",
"->",
"__destruct",
"(",
")",
";",
"return",
"$",
"this",
"->",
"parent",
"->",
"load",
"(",
"$",... | Registers a PSR-4 namespace using a glob pattern. | [
"Registers",
"a",
"PSR",
"-",
"4",
"namespace",
"using",
"a",
"glob",
"pattern",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/DependencyInjection/Loader/Configurator/AbstractServiceConfigurator.php#L65-L70 | train | Loads a namespace and resource | [
30522,
2345,
2270,
3853,
7170,
1006,
5164,
1002,
3415,
15327,
1010,
5164,
1002,
7692,
1007,
1024,
8773,
8663,
8873,
27390,
8844,
1063,
1002,
2023,
1011,
1028,
1035,
1035,
4078,
18300,
1006,
1007,
1025,
2709,
1002,
2023,
1011,
1028,
6687,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/DependencyInjection/Argument/BoundArgument.php | BoundArgument.setValues | public function setValues(array $values)
{
if (5 === \count($values)) {
list($this->value, $this->identifier, $this->used, $this->type, $this->file) = $values;
} else {
list($this->value, $this->identifier, $this->used) = $values;
}
} | php | public function setValues(array $values)
{
if (5 === \count($values)) {
list($this->value, $this->identifier, $this->used, $this->type, $this->file) = $values;
} else {
list($this->value, $this->identifier, $this->used) = $values;
}
} | [
"public",
"function",
"setValues",
"(",
"array",
"$",
"values",
")",
"{",
"if",
"(",
"5",
"===",
"\\",
"count",
"(",
"$",
"values",
")",
")",
"{",
"list",
"(",
"$",
"this",
"->",
"value",
",",
"$",
"this",
"->",
"identifier",
",",
"$",
"this",
"-... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/DependencyInjection/Argument/BoundArgument.php#L54-L61 | train | setValues - Set the values of the attribute | [
30522,
2270,
3853,
2275,
10175,
15808,
1006,
9140,
1002,
5300,
1007,
1063,
2065,
1006,
1019,
1027,
1027,
1027,
1032,
4175,
1006,
1002,
5300,
1007,
1007,
1063,
2862,
1006,
1002,
2023,
1011,
1028,
3643,
1010,
1002,
2023,
1011,
1028,
8909,
4... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/MobileMessaging/API.php | API.deleteSMSAPICredential | public function deleteSMSAPICredential()
{
$this->checkCredentialManagementRights();
$settings = $this->getCredentialManagerSettings();
$settings[MobileMessaging::API_KEY_OPTION] = null;
$this->setCredentialManagerSettings($settings);
return true;
} | php | public function deleteSMSAPICredential()
{
$this->checkCredentialManagementRights();
$settings = $this->getCredentialManagerSettings();
$settings[MobileMessaging::API_KEY_OPTION] = null;
$this->setCredentialManagerSettings($settings);
return true;
} | [
"public",
"function",
"deleteSMSAPICredential",
"(",
")",
"{",
"$",
"this",
"->",
"checkCredentialManagementRights",
"(",
")",
";",
"$",
"settings",
"=",
"$",
"this",
"->",
"getCredentialManagerSettings",
"(",
")",
";",
"$",
"settings",
"[",
"MobileMessaging",
"... | delete the SMS API credential
@return bool true | [
"delete",
"the",
"SMS",
"API",
"credential"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/MobileMessaging/API.php#L346-L357 | train | Delete SMS API Credential | [
30522,
30524,
10906,
1027,
1002,
2023,
1011,
1028,
2131,
16748,
16454,
4818,
24805,
15776,
18319,
3070,
2015,
1006,
1007,
1025,
1002,
10906,
1031,
4684,
7834,
3736,
4726,
1024,
1024,
17928,
1035,
3145,
1035,
5724,
1033,
1027,
19701,
1025,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Translation/LoggingTranslator.php | LoggingTranslator.log | private function log($id, $domain, $locale)
{
if (null === $domain) {
$domain = 'messages';
}
$id = (string) $id;
$catalogue = $this->translator->getCatalogue($locale);
if ($catalogue->defines($id, $domain)) {
return;
}
if ($catalogue... | php | private function log($id, $domain, $locale)
{
if (null === $domain) {
$domain = 'messages';
}
$id = (string) $id;
$catalogue = $this->translator->getCatalogue($locale);
if ($catalogue->defines($id, $domain)) {
return;
}
if ($catalogue... | [
"private",
"function",
"log",
"(",
"$",
"id",
",",
"$",
"domain",
",",
"$",
"locale",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"domain",
")",
"{",
"$",
"domain",
"=",
"'messages'",
";",
"}",
"$",
"id",
"=",
"(",
"string",
")",
"$",
"id",
";",
... | Logs for missing translations.
@param string $id
@param string|null $domain
@param string|null $locale | [
"Logs",
"for",
"missing",
"translations",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Translation/LoggingTranslator.php#L135-L152 | train | Log translation. | [
30522,
2797,
3853,
8833,
1006,
1002,
8909,
1010,
1002,
5884,
1010,
1002,
2334,
2063,
1007,
1063,
2065,
1006,
19701,
1027,
1027,
1027,
1002,
5884,
1007,
1063,
1002,
5884,
1027,
1005,
7696,
1005,
1025,
1065,
1002,
8909,
1027,
1006,
5164,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/Tracker/Db/Pdo/Mysql.php | Mysql.fetchCol | public function fetchCol($sql, $bind = array())
{
try {
$sth = $this->query($sql, $bind);
if ($sth === false) {
return false;
}
$result = $sth->fetchAll(PDO::FETCH_COLUMN, 0);
return $result;
} catch (PDOException $e) {
... | php | public function fetchCol($sql, $bind = array())
{
try {
$sth = $this->query($sql, $bind);
if ($sth === false) {
return false;
}
$result = $sth->fetchAll(PDO::FETCH_COLUMN, 0);
return $result;
} catch (PDOException $e) {
... | [
"public",
"function",
"fetchCol",
"(",
"$",
"sql",
",",
"$",
"bind",
"=",
"array",
"(",
")",
")",
"{",
"try",
"{",
"$",
"sth",
"=",
"$",
"this",
"->",
"query",
"(",
"$",
"sql",
",",
"$",
"bind",
")",
";",
"if",
"(",
"$",
"sth",
"===",
"false"... | Fetches the first column of all SQL result rows as an array.
@param string $sql An SQL SELECT statement.
@param mixed $bind Data to bind into SELECT placeholders.
@throws \Piwik\Tracker\Db\DbException
@return string | [
"Fetches",
"the",
"first",
"column",
"of",
"all",
"SQL",
"result",
"rows",
"as",
"an",
"array",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Tracker/Db/Pdo/Mysql.php#L172-L184 | train | Fetch a single column from the result set | [
30522,
2270,
3853,
18584,
25778,
1006,
1002,
29296,
1010,
1002,
14187,
1027,
9140,
1006,
1007,
1007,
1063,
3046,
1063,
1002,
2358,
2232,
1027,
1002,
2023,
1011,
1028,
23032,
1006,
1002,
29296,
1010,
1002,
14187,
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... |
matomo-org/matomo | plugins/API/API.php | API.getSuggestedValuesForSegment | public function getSuggestedValuesForSegment($segmentName, $idSite)
{
if (empty(Config::getInstance()->General['enable_segment_suggested_values'])) {
return array();
}
Piwik::checkUserHasViewAccess($idSite);
$maxSuggestionsToReturn = 30;
$segment = $this->findSe... | php | public function getSuggestedValuesForSegment($segmentName, $idSite)
{
if (empty(Config::getInstance()->General['enable_segment_suggested_values'])) {
return array();
}
Piwik::checkUserHasViewAccess($idSite);
$maxSuggestionsToReturn = 30;
$segment = $this->findSe... | [
"public",
"function",
"getSuggestedValuesForSegment",
"(",
"$",
"segmentName",
",",
"$",
"idSite",
")",
"{",
"if",
"(",
"empty",
"(",
"Config",
"::",
"getInstance",
"(",
")",
"->",
"General",
"[",
"'enable_segment_suggested_values'",
"]",
")",
")",
"{",
"retur... | Given a segment, will return a list of the most used values for this particular segment.
@param $segmentName
@param $idSite
@throws \Exception
@return array | [
"Given",
"a",
"segment",
"will",
"return",
"a",
"list",
"of",
"the",
"most",
"used",
"values",
"for",
"this",
"particular",
"segment",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/API/API.php#L566-L621 | train | Returns the suggested values for the given site | [
30522,
2270,
3853,
4152,
15916,
8449,
3064,
10175,
15808,
29278,
3366,
21693,
4765,
1006,
1002,
6903,
18442,
1010,
1002,
8909,
28032,
2063,
1007,
1063,
2065,
1006,
4064,
1006,
9530,
8873,
2290,
1024,
1024,
2131,
7076,
26897,
1006,
1007,
101... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Validation/Concerns/ReplacesAttributes.php | ReplacesAttributes.replaceBeforeOrEqual | protected function replaceBeforeOrEqual($message, $attribute, $rule, $parameters)
{
return $this->replaceBefore($message, $attribute, $rule, $parameters);
} | php | protected function replaceBeforeOrEqual($message, $attribute, $rule, $parameters)
{
return $this->replaceBefore($message, $attribute, $rule, $parameters);
} | [
"protected",
"function",
"replaceBeforeOrEqual",
"(",
"$",
"message",
",",
"$",
"attribute",
",",
"$",
"rule",
",",
"$",
"parameters",
")",
"{",
"return",
"$",
"this",
"->",
"replaceBefore",
"(",
"$",
"message",
",",
"$",
"attribute",
",",
"$",
"rule",
"... | Replace all place-holders for the before_or_equal rule.
@param string $message
@param string $attribute
@param string $rule
@param array $parameters
@return string | [
"Replace",
"all",
"place",
"-",
"holders",
"for",
"the",
"before_or_equal",
"rule",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Validation/Concerns/ReplacesAttributes.php#L404-L407 | train | Replace all place - holders for the before_or_equal rule. | [
30522,
5123,
3853,
5672,
4783,
29278,
8780,
2890,
26426,
1006,
1002,
4471,
1010,
1002,
17961,
1010,
1002,
3627,
1010,
1002,
11709,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
5672,
4783,
29278,
2063,
1006,
1002,
4471,
1010,
1002,
17961,
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/Query/Builder.php | Builder.truncate | public function truncate()
{
foreach ($this->grammar->compileTruncate($this) as $sql => $bindings) {
$this->connection->statement($sql, $bindings);
}
} | php | public function truncate()
{
foreach ($this->grammar->compileTruncate($this) as $sql => $bindings) {
$this->connection->statement($sql, $bindings);
}
} | [
"public",
"function",
"truncate",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"grammar",
"->",
"compileTruncate",
"(",
"$",
"this",
")",
"as",
"$",
"sql",
"=>",
"$",
"bindings",
")",
"{",
"$",
"this",
"->",
"connection",
"->",
"statement",
"(",
... | Run a truncate statement on the table.
@return void | [
"Run",
"a",
"truncate",
"statement",
"on",
"the",
"table",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Query/Builder.php#L2781-L2786 | train | Truncate the table | [
30522,
2270,
3853,
19817,
4609,
16280,
1006,
1007,
1063,
18921,
6776,
1006,
1002,
2023,
1011,
1028,
8035,
1011,
1028,
4012,
22090,
16344,
4609,
16280,
1006,
1002,
2023,
1007,
2004,
1002,
29296,
1027,
1028,
1002,
8031,
2015,
1007,
1063,
1002... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
z-song/laravel-admin | src/Console/MakeCommand.php | MakeCommand.getNameInput | protected function getNameInput()
{
$name = trim($this->argument('name'));
$this->type = $this->qualifyClass($name);
return $name;
} | php | protected function getNameInput()
{
$name = trim($this->argument('name'));
$this->type = $this->qualifyClass($name);
return $name;
} | [
"protected",
"function",
"getNameInput",
"(",
")",
"{",
"$",
"name",
"=",
"trim",
"(",
"$",
"this",
"->",
"argument",
"(",
"'name'",
")",
")",
";",
"$",
"this",
"->",
"type",
"=",
"$",
"this",
"->",
"qualifyClass",
"(",
"$",
"name",
")",
";",
"retu... | Get the desired class name from the input.
@return string | [
"Get",
"the",
"desired",
"class",
"name",
"from",
"the",
"input",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Console/MakeCommand.php#L170-L177 | train | Get name input | [
30522,
5123,
3853,
2131,
18442,
2378,
18780,
1006,
1007,
1063,
1002,
2171,
1027,
12241,
1006,
1002,
2023,
1011,
1028,
6685,
1006,
1005,
2171,
1005,
1007,
1007,
1025,
1002,
2023,
1011,
1028,
2828,
1027,
1002,
2023,
1011,
1028,
7515,
26266,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/UploadedFile.php | UploadedFile.parseUploadedFiles | private static function parseUploadedFiles(array $uploadedFiles)
{
$parsed = [];
foreach ($uploadedFiles as $field => $uploadedFile) {
if (!isset($uploadedFile['error'])) {
if (is_array($uploadedFile)) {
$parsed[$field] = static::parseUploadedFiles($up... | php | private static function parseUploadedFiles(array $uploadedFiles)
{
$parsed = [];
foreach ($uploadedFiles as $field => $uploadedFile) {
if (!isset($uploadedFile['error'])) {
if (is_array($uploadedFile)) {
$parsed[$field] = static::parseUploadedFiles($up... | [
"private",
"static",
"function",
"parseUploadedFiles",
"(",
"array",
"$",
"uploadedFiles",
")",
"{",
"$",
"parsed",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"uploadedFiles",
"as",
"$",
"field",
"=>",
"$",
"uploadedFile",
")",
"{",
"if",
"(",
"!",
"isset"... | Parse a non-normalized, i.e. $_FILES superglobal, tree of uploaded file data.
Returns a normalized tree of UploadedFile instances.
@param array $uploadedFiles The non-normalized tree of uploaded file data.
@return array | [
"Parse",
"a",
"non",
"-",
"normalized",
"i",
".",
"e",
".",
"$_FILES",
"superglobal",
"tree",
"of",
"uploaded",
"file",
"data",
"."
] | ccef5f7d8bcd469d59cbe64f6210d83764f91543 | https://github.com/slimphp/Slim/blob/ccef5f7d8bcd469d59cbe64f6210d83764f91543/Slim/Http/UploadedFile.php#L110-L147 | train | Parses uploaded files into an array of File objects | [
30522,
2797,
10763,
3853,
11968,
3366,
6279,
17468,
8873,
4244,
1006,
9140,
1002,
21345,
8873,
4244,
1007,
1063,
1002,
11968,
6924,
1027,
1031,
1033,
1025,
18921,
6776,
1006,
1002,
21345,
8873,
4244,
2004,
1002,
2492,
1027,
1028,
1002,
2134... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/RouteUrlGenerator.php | RouteUrlGenerator.getRouteDomain | protected function getRouteDomain($route, &$parameters)
{
return $route->getDomain() ? $this->formatDomain($route, $parameters) : null;
} | php | protected function getRouteDomain($route, &$parameters)
{
return $route->getDomain() ? $this->formatDomain($route, $parameters) : null;
} | [
"protected",
"function",
"getRouteDomain",
"(",
"$",
"route",
",",
"&",
"$",
"parameters",
")",
"{",
"return",
"$",
"route",
"->",
"getDomain",
"(",
")",
"?",
"$",
"this",
"->",
"formatDomain",
"(",
"$",
"route",
",",
"$",
"parameters",
")",
":",
"null... | Get the formatted domain for a given route.
@param \Illuminate\Routing\Route $route
@param array $parameters
@return string | [
"Get",
"the",
"formatted",
"domain",
"for",
"a",
"given",
"route",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/RouteUrlGenerator.php#L119-L122 | train | Get domain of route | [
30522,
5123,
3853,
2131,
25849,
9626,
2378,
1006,
1002,
2799,
1010,
1004,
1002,
11709,
1007,
1063,
2709,
1002,
2799,
1011,
1028,
2131,
9527,
8113,
1006,
1007,
1029,
1002,
2023,
1011,
1028,
4289,
9527,
8113,
1006,
1002,
2799,
1010,
1002,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Database/Concerns/BuildsQueries.php | BuildsQueries.paginator | protected function paginator($items, $total, $perPage, $currentPage, $options)
{
return Container::getInstance()->makeWith(LengthAwarePaginator::class, compact(
'items', 'total', 'perPage', 'currentPage', 'options'
));
} | php | protected function paginator($items, $total, $perPage, $currentPage, $options)
{
return Container::getInstance()->makeWith(LengthAwarePaginator::class, compact(
'items', 'total', 'perPage', 'currentPage', 'options'
));
} | [
"protected",
"function",
"paginator",
"(",
"$",
"items",
",",
"$",
"total",
",",
"$",
"perPage",
",",
"$",
"currentPage",
",",
"$",
"options",
")",
"{",
"return",
"Container",
"::",
"getInstance",
"(",
")",
"->",
"makeWith",
"(",
"LengthAwarePaginator",
":... | Create a new length-aware paginator instance.
@param \Illuminate\Support\Collection $items
@param int $total
@param int $perPage
@param int $currentPage
@param array $options
@return \Illuminate\Pagination\LengthAwarePaginator | [
"Create",
"a",
"new",
"length",
"-",
"aware",
"paginator",
"instance",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Concerns/BuildsQueries.php#L139-L144 | train | Create a paginator for the items | [
30522,
5123,
3853,
6643,
20876,
4263,
1006,
1002,
5167,
1010,
1002,
2561,
1010,
1002,
2566,
13704,
1010,
1002,
2783,
13704,
1010,
1002,
7047,
1007,
1063,
2709,
11661,
1024,
1024,
2131,
7076,
26897,
1006,
1007,
1011,
1028,
2191,
24415,
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/IssnValidator.php | IssnValidator.validate | public function validate($value, Constraint $constraint)
{
if (!$constraint instanceof Issn) {
throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\Issn');
}
if (null === $value || '' === $value) {
return;
}
if (!is_scalar($value) && !(\is_... | php | public function validate($value, Constraint $constraint)
{
if (!$constraint instanceof Issn) {
throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\Issn');
}
if (null === $value || '' === $value) {
return;
}
if (!is_scalar($value) && !(\is_... | [
"public",
"function",
"validate",
"(",
"$",
"value",
",",
"Constraint",
"$",
"constraint",
")",
"{",
"if",
"(",
"!",
"$",
"constraint",
"instanceof",
"Issn",
")",
"{",
"throw",
"new",
"UnexpectedTypeException",
"(",
"$",
"constraint",
",",
"__NAMESPACE__",
"... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Validator/Constraints/IssnValidator.php#L32-L133 | train | Validate the value | [
30522,
2270,
3853,
9398,
3686,
1006,
1002,
3643,
1010,
27142,
1002,
27142,
1007,
1063,
2065,
1006,
999,
1002,
27142,
6013,
11253,
23486,
1007,
1063,
5466,
2047,
9223,
13874,
10288,
24422,
1006,
1002,
27142,
1010,
1035,
1035,
3415,
15327,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/UserCountry/LocationProvider/DefaultProvider.php | DefaultProvider.getSupportedLocationInfo | public function getSupportedLocationInfo()
{
return array(self::CONTINENT_CODE_KEY => true,
self::CONTINENT_NAME_KEY => true,
self::COUNTRY_CODE_KEY => true,
self::COUNTRY_NAME_KEY => true);
} | php | public function getSupportedLocationInfo()
{
return array(self::CONTINENT_CODE_KEY => true,
self::CONTINENT_NAME_KEY => true,
self::COUNTRY_CODE_KEY => true,
self::COUNTRY_NAME_KEY => true);
} | [
"public",
"function",
"getSupportedLocationInfo",
"(",
")",
"{",
"return",
"array",
"(",
"self",
"::",
"CONTINENT_CODE_KEY",
"=>",
"true",
",",
"self",
"::",
"CONTINENT_NAME_KEY",
"=>",
"true",
",",
"self",
"::",
"COUNTRY_CODE_KEY",
"=>",
"true",
",",
"self",
... | Returns an array describing the types of location information this provider will
return.
This provider supports the following types of location info:
- continent code
- continent name
- country code
- country name
@return array | [
"Returns",
"an",
"array",
"describing",
"the",
"types",
"of",
"location",
"information",
"this",
"provider",
"will",
"return",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UserCountry/LocationProvider/DefaultProvider.php#L83-L89 | train | Get supported location info | [
30522,
2270,
3853,
4152,
6279,
6442,
2098,
4135,
10719,
2378,
14876,
1006,
1007,
1063,
2709,
9140,
1006,
2969,
1024,
1024,
9983,
1035,
3642,
1035,
3145,
1027,
1028,
2995,
1010,
2969,
1024,
1024,
9983,
1035,
2171,
1035,
3145,
1027,
1028,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Queue/Listener.php | Listener.makeProcess | public function makeProcess($connection, $queue, ListenerOptions $options)
{
$command = $this->createCommand(
$connection,
$queue,
$options
);
// If the environment is set, we will append it to the command array so the
// workers will run under th... | php | public function makeProcess($connection, $queue, ListenerOptions $options)
{
$command = $this->createCommand(
$connection,
$queue,
$options
);
// If the environment is set, we will append it to the command array so the
// workers will run under th... | [
"public",
"function",
"makeProcess",
"(",
"$",
"connection",
",",
"$",
"queue",
",",
"ListenerOptions",
"$",
"options",
")",
"{",
"$",
"command",
"=",
"$",
"this",
"->",
"createCommand",
"(",
"$",
"connection",
",",
"$",
"queue",
",",
"$",
"options",
")"... | Create a new Symfony process for the worker.
@param string $connection
@param string $queue
@param \Illuminate\Queue\ListenerOptions $options
@return \Symfony\Component\Process\Process | [
"Create",
"a",
"new",
"Symfony",
"process",
"for",
"the",
"worker",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Queue/Listener.php#L102-L124 | train | Creates a process for the given connection and queue | [
30522,
2270,
3853,
2191,
21572,
9623,
2015,
1006,
1002,
4434,
1010,
1002,
24240,
1010,
19373,
7361,
9285,
1002,
7047,
1007,
1063,
1002,
3094,
1027,
1002,
2023,
1011,
1028,
3443,
9006,
2386,
2094,
1006,
1002,
4434,
1010,
1002,
24240,
1010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/backend/widgets/MediaManager.php | MediaManager.copyBrokenImage | protected function copyBrokenImage($path)
{
try {
$thumbnailDir = dirname($path);
if (!File::isDirectory($thumbnailDir) && File::makeDirectory($thumbnailDir, 0777, true) === false) {
return;
}
File::copy($this->getBrokenImagePath(), $path);
... | php | protected function copyBrokenImage($path)
{
try {
$thumbnailDir = dirname($path);
if (!File::isDirectory($thumbnailDir) && File::makeDirectory($thumbnailDir, 0777, true) === false) {
return;
}
File::copy($this->getBrokenImagePath(), $path);
... | [
"protected",
"function",
"copyBrokenImage",
"(",
"$",
"path",
")",
"{",
"try",
"{",
"$",
"thumbnailDir",
"=",
"dirname",
"(",
"$",
"path",
")",
";",
"if",
"(",
"!",
"File",
"::",
"isDirectory",
"(",
"$",
"thumbnailDir",
")",
"&&",
"File",
"::",
"makeDi... | Copy broken image to destination
@param string $path
@return void | [
"Copy",
"broken",
"image",
"to",
"destination"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/MediaManager.php#L1431-L1444 | train | Copy broken image to destination path | [
30522,
5123,
3853,
6100,
29162,
9581,
3351,
1006,
1002,
4130,
1007,
1063,
3046,
1063,
1002,
7639,
25464,
4305,
2099,
1027,
16101,
18442,
1006,
1002,
4130,
1007,
1025,
2065,
1006,
999,
5371,
1024,
1024,
2003,
4305,
2890,
16761,
2100,
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/HttpFoundation/Session/Storage/MockFileSessionStorage.php | MockFileSessionStorage.save | public function save()
{
if (!$this->started) {
throw new \RuntimeException('Trying to save a session that was not started yet or was already closed');
}
$data = $this->data;
foreach ($this->bags as $bag) {
if (empty($data[$key = $bag->getStorageKey()])) {
... | php | public function save()
{
if (!$this->started) {
throw new \RuntimeException('Trying to save a session that was not started yet or was already closed');
}
$data = $this->data;
foreach ($this->bags as $bag) {
if (empty($data[$key = $bag->getStorageKey()])) {
... | [
"public",
"function",
"save",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"started",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"'Trying to save a session that was not started yet or was already closed'",
")",
";",
"}",
"$",
"data",
"=",
"$",... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpFoundation/Session/Storage/MockFileSessionStorage.php#L88-L119 | train | Save session data | [
30522,
2270,
3853,
3828,
1006,
1007,
1063,
2065,
1006,
999,
1002,
2023,
1011,
1028,
2318,
1007,
1063,
5466,
2047,
1032,
2448,
7292,
10288,
24422,
1006,
1005,
2667,
2000,
3828,
1037,
5219,
2008,
2001,
2025,
2318,
2664,
2030,
2001,
2525,
27... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Column.php | Column.callSupportDisplayer | protected function callSupportDisplayer($abstract, $arguments)
{
return $this->display(function ($value) use ($abstract, $arguments) {
if (is_array($value) || $value instanceof Arrayable) {
return call_user_func_array([collect($value), $abstract], $arguments);
}
... | php | protected function callSupportDisplayer($abstract, $arguments)
{
return $this->display(function ($value) use ($abstract, $arguments) {
if (is_array($value) || $value instanceof Arrayable) {
return call_user_func_array([collect($value), $abstract], $arguments);
}
... | [
"protected",
"function",
"callSupportDisplayer",
"(",
"$",
"abstract",
",",
"$",
"arguments",
")",
"{",
"return",
"$",
"this",
"->",
"display",
"(",
"function",
"(",
"$",
"value",
")",
"use",
"(",
"$",
"abstract",
",",
"$",
"arguments",
")",
"{",
"if",
... | Call Illuminate/Support displayer.
@param string $abstract
@param array $arguments
@return Column | [
"Call",
"Illuminate",
"/",
"Support",
"displayer",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Grid/Column.php#L626-L639 | train | Calls the displayer of the current language | [
30522,
5123,
3853,
4455,
6279,
6442,
10521,
13068,
2121,
1006,
1002,
10061,
1010,
1002,
9918,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
4653,
1006,
3853,
1006,
1002,
3643,
1007,
2224,
1006,
1002,
10061,
1010,
1002,
9918,
1007,
1063,
2065,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Console/Style/SymfonyStyle.php | SymfonyStyle.ask | public function ask($question, $default = null, $validator = null)
{
$question = new Question($question, $default);
$question->setValidator($validator);
return $this->askQuestion($question);
} | php | public function ask($question, $default = null, $validator = null)
{
$question = new Question($question, $default);
$question->setValidator($validator);
return $this->askQuestion($question);
} | [
"public",
"function",
"ask",
"(",
"$",
"question",
",",
"$",
"default",
"=",
"null",
",",
"$",
"validator",
"=",
"null",
")",
"{",
"$",
"question",
"=",
"new",
"Question",
"(",
"$",
"question",
",",
"$",
"default",
")",
";",
"$",
"question",
"->",
... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Style/SymfonyStyle.php#L196-L202 | train | Asks a question to the user. | [
30522,
2270,
3853,
3198,
1006,
1002,
3160,
1010,
1002,
12398,
1027,
19701,
1010,
1002,
9398,
8844,
1027,
19701,
1007,
1063,
1002,
3160,
1027,
2047,
3160,
1006,
1002,
3160,
1010,
1002,
12398,
1007,
1025,
1002,
3160,
1011,
1028,
2275,
10175,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Common/Debugger.php | Debugger.startTimer | public function startTimer($name, $description = null)
{
if (strpos($name, '_') === 0 || $this->enabled()) {
$this->debugbar['time']->startMeasure($name, $description);
$this->timers[] = $name;
}
return $this;
} | php | public function startTimer($name, $description = null)
{
if (strpos($name, '_') === 0 || $this->enabled()) {
$this->debugbar['time']->startMeasure($name, $description);
$this->timers[] = $name;
}
return $this;
} | [
"public",
"function",
"startTimer",
"(",
"$",
"name",
",",
"$",
"description",
"=",
"null",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"name",
",",
"'_'",
")",
"===",
"0",
"||",
"$",
"this",
"->",
"enabled",
"(",
")",
")",
"{",
"$",
"this",
"->",
... | Start a timer with an associated name and description
@param string $name
@param string|null $description
@return $this | [
"Start",
"a",
"timer",
"with",
"an",
"associated",
"name",
"and",
"description"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Debugger.php#L275-L283 | train | Start a timer | [
30522,
2270,
3853,
2707,
7292,
2099,
1006,
1002,
2171,
1010,
1002,
6412,
1027,
19701,
1007,
1063,
2065,
1006,
2358,
14536,
2891,
1006,
1002,
2171,
1010,
1005,
1035,
1005,
1007,
1027,
1027,
1027,
1014,
1064,
1064,
1002,
2023,
1011,
1028,
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... |
laravel/framework | src/Illuminate/Foundation/Console/ViewCacheCommand.php | ViewCacheCommand.paths | protected function paths()
{
$finder = $this->laravel['view']->getFinder();
return collect($finder->getPaths())->merge(
collect($finder->getHints())->flatten()
);
} | php | protected function paths()
{
$finder = $this->laravel['view']->getFinder();
return collect($finder->getPaths())->merge(
collect($finder->getHints())->flatten()
);
} | [
"protected",
"function",
"paths",
"(",
")",
"{",
"$",
"finder",
"=",
"$",
"this",
"->",
"laravel",
"[",
"'view'",
"]",
"->",
"getFinder",
"(",
")",
";",
"return",
"collect",
"(",
"$",
"finder",
"->",
"getPaths",
"(",
")",
")",
"->",
"merge",
"(",
"... | Get all of the possible view paths.
@return \Illuminate\Support\Collection | [
"Get",
"all",
"of",
"the",
"possible",
"view",
"paths",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Foundation/Console/ViewCacheCommand.php#L79-L86 | train | Get all paths from the finder | [
30522,
5123,
3853,
10425,
1006,
1007,
1063,
1002,
2424,
2121,
1027,
1002,
2023,
1011,
1028,
13679,
15985,
1031,
1005,
3193,
1005,
1033,
1011,
1028,
2131,
23695,
1006,
1007,
1025,
2709,
8145,
1006,
1002,
2424,
2121,
1011,
1028,
2131,
15069,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/VarDumper/Dumper/CliDumper.php | CliDumper.dumpEllipsis | protected function dumpEllipsis(Cursor $cursor, $hasChild, $cut)
{
if ($cut) {
$this->line .= ' …';
if (0 < $cut) {
$this->line .= $cut;
}
if ($hasChild) {
$this->dumpLine($cursor->depth + 1);
}
}
} | php | protected function dumpEllipsis(Cursor $cursor, $hasChild, $cut)
{
if ($cut) {
$this->line .= ' …';
if (0 < $cut) {
$this->line .= $cut;
}
if ($hasChild) {
$this->dumpLine($cursor->depth + 1);
}
}
} | [
"protected",
"function",
"dumpEllipsis",
"(",
"Cursor",
"$",
"cursor",
",",
"$",
"hasChild",
",",
"$",
"cut",
")",
"{",
"if",
"(",
"$",
"cut",
")",
"{",
"$",
"this",
"->",
"line",
".=",
"' …';",
"",
"if",
"(",
"0",
"<",
"$",
"cut",
")",
"{",
"$... | Dumps an ellipsis for cut children.
@param Cursor $cursor The Cursor position in the dump
@param bool $hasChild When the dump of the hash has child item
@param int $cut The number of items the hash has been cut by | [
"Dumps",
"an",
"ellipsis",
"for",
"cut",
"children",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/VarDumper/Dumper/CliDumper.php#L325-L336 | train | Dump ellipsis line | [
30522,
5123,
3853,
15653,
13348,
18409,
1006,
12731,
25301,
2099,
1002,
12731,
25301,
2099,
1010,
1002,
2038,
19339,
1010,
1002,
3013,
1007,
1063,
2065,
1006,
1002,
3013,
1007,
1063,
1002,
2023,
1011,
1028,
2240,
1012,
1027,
1005,
1529,
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/Console/Application.php | Application.extractNamespace | public function extractNamespace($name, $limit = null)
{
$parts = explode(':', $name);
array_pop($parts);
return implode(':', null === $limit ? $parts : \array_slice($parts, 0, $limit));
} | php | public function extractNamespace($name, $limit = null)
{
$parts = explode(':', $name);
array_pop($parts);
return implode(':', null === $limit ? $parts : \array_slice($parts, 0, $limit));
} | [
"public",
"function",
"extractNamespace",
"(",
"$",
"name",
",",
"$",
"limit",
"=",
"null",
")",
"{",
"$",
"parts",
"=",
"explode",
"(",
"':'",
",",
"$",
"name",
")",
";",
"array_pop",
"(",
"$",
"parts",
")",
";",
"return",
"implode",
"(",
"':'",
"... | Returns the namespace part of the command name.
This method is not part of public API and should not be used directly.
@param string $name The full name of the command
@param string $limit The maximum number of parts of the namespace
@return string The namespace of the command | [
"Returns",
"the",
"namespace",
"part",
"of",
"the",
"command",
"name",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Application.php#L1031-L1037 | train | Extract namespace from name | [
30522,
2270,
3853,
14817,
18442,
23058,
1006,
1002,
2171,
1010,
1002,
5787,
1027,
19701,
1007,
1063,
1002,
3033,
1027,
15044,
1006,
1005,
1024,
1005,
1010,
1002,
2171,
1007,
1025,
9140,
1035,
3769,
1006,
1002,
3033,
1007,
1025,
2709,
17727,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/Zend/Db/Adapter/Pdo/Abstract.php | Zend_Db_Adapter_Pdo_Abstract.getServerVersion | public function getServerVersion()
{
$this->_connect();
try {
$version = $this->_connection->getAttribute(PDO::ATTR_SERVER_VERSION);
} catch (PDOException $e) {
// In case of the driver doesn't support getting attributes
return null;
}
$mat... | php | public function getServerVersion()
{
$this->_connect();
try {
$version = $this->_connection->getAttribute(PDO::ATTR_SERVER_VERSION);
} catch (PDOException $e) {
// In case of the driver doesn't support getting attributes
return null;
}
$mat... | [
"public",
"function",
"getServerVersion",
"(",
")",
"{",
"$",
"this",
"->",
"_connect",
"(",
")",
";",
"try",
"{",
"$",
"version",
"=",
"$",
"this",
"->",
"_connection",
"->",
"getAttribute",
"(",
"PDO",
"::",
"ATTR_SERVER_VERSION",
")",
";",
"}",
"catch... | Retrieve server version in PHP style
@return string | [
"Retrieve",
"server",
"version",
"in",
"PHP",
"style"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Adapter/Pdo/Abstract.php#L384-L399 | train | Get the server version | [
30522,
2270,
3853,
4152,
2121,
6299,
27774,
1006,
1007,
1063,
1002,
2023,
1011,
1028,
1035,
7532,
1006,
1007,
1025,
3046,
1063,
1002,
2544,
1027,
1002,
2023,
1011,
1028,
1035,
4434,
1011,
1028,
2131,
19321,
3089,
8569,
2618,
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... |
matomo-org/matomo | core/AssetManager.php | AssetManager.getAssetDirectory | public function getAssetDirectory()
{
$mergedFileDirectory = StaticContainer::get('path.tmp') . '/assets';
if (!is_dir($mergedFileDirectory)) {
Filesystem::mkdir($mergedFileDirectory);
}
if (!is_writable($mergedFileDirectory)) {
throw new Exception("Director... | php | public function getAssetDirectory()
{
$mergedFileDirectory = StaticContainer::get('path.tmp') . '/assets';
if (!is_dir($mergedFileDirectory)) {
Filesystem::mkdir($mergedFileDirectory);
}
if (!is_writable($mergedFileDirectory)) {
throw new Exception("Director... | [
"public",
"function",
"getAssetDirectory",
"(",
")",
"{",
"$",
"mergedFileDirectory",
"=",
"StaticContainer",
"::",
"get",
"(",
"'path.tmp'",
")",
".",
"'/assets'",
";",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"mergedFileDirectory",
")",
")",
"{",
"Filesystem",
... | Check if the merged file directory exists and is writable.
@return string The directory location
@throws Exception if directory is not writable. | [
"Check",
"if",
"the",
"merged",
"file",
"directory",
"exists",
"and",
"is",
"writable",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/AssetManager.php#L242-L255 | train | Get merged file directory | [
30522,
2270,
3853,
2131,
27241,
2102,
4305,
2890,
16761,
2100,
1006,
1007,
1063,
1002,
5314,
8873,
3709,
7442,
16761,
2100,
1027,
10763,
8663,
18249,
2121,
1024,
1024,
2131,
1006,
1005,
4130,
1012,
1056,
30524,
16101,
1006,
1002,
5314,
8873... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/system/classes/PluginBase.php | PluginBase.pluginDetails | public function pluginDetails()
{
$thisClass = get_class($this);
$configuration = $this->getConfigurationFromYaml(sprintf('Plugin configuration file plugin.yaml is not '.
'found for the plugin class %s. Create the file or override pluginDetails() '.
'method in the plugin cla... | php | public function pluginDetails()
{
$thisClass = get_class($this);
$configuration = $this->getConfigurationFromYaml(sprintf('Plugin configuration file plugin.yaml is not '.
'found for the plugin class %s. Create the file or override pluginDetails() '.
'method in the plugin cla... | [
"public",
"function",
"pluginDetails",
"(",
")",
"{",
"$",
"thisClass",
"=",
"get_class",
"(",
"$",
"this",
")",
";",
"$",
"configuration",
"=",
"$",
"this",
"->",
"getConfigurationFromYaml",
"(",
"sprintf",
"(",
"'Plugin configuration file plugin.yaml is not '",
... | Returns information about this plugin, including plugin name and developer name.
@return array
@throws SystemException | [
"Returns",
"information",
"about",
"this",
"plugin",
"including",
"plugin",
"name",
"and",
"developer",
"name",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/PluginBase.php#L43-L58 | train | Returns the plugin details from the plugin. yaml file | [
30522,
2270,
3853,
13354,
22254,
12928,
12146,
1006,
1007,
1063,
1002,
2023,
26266,
1027,
2131,
1035,
2465,
1006,
1002,
2023,
1007,
1025,
1002,
9563,
1027,
1002,
2023,
1011,
1028,
2131,
8663,
8873,
27390,
3370,
19699,
16940,
3286,
2140,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Cookie/CookieJar.php | CookieJar.getPathAndDomain | protected function getPathAndDomain($path, $domain, $secure = null, $sameSite = null)
{
return [$path ?: $this->path, $domain ?: $this->domain, is_bool($secure) ? $secure : $this->secure, $sameSite ?: $this->sameSite];
} | php | protected function getPathAndDomain($path, $domain, $secure = null, $sameSite = null)
{
return [$path ?: $this->path, $domain ?: $this->domain, is_bool($secure) ? $secure : $this->secure, $sameSite ?: $this->sameSite];
} | [
"protected",
"function",
"getPathAndDomain",
"(",
"$",
"path",
",",
"$",
"domain",
",",
"$",
"secure",
"=",
"null",
",",
"$",
"sameSite",
"=",
"null",
")",
"{",
"return",
"[",
"$",
"path",
"?",
":",
"$",
"this",
"->",
"path",
",",
"$",
"domain",
"?... | Get the path and domain, or the default values.
@param string $path
@param string $domain
@param bool|null $secure
@param string $sameSite
@return array | [
"Get",
"the",
"path",
"and",
"domain",
"or",
"the",
"default",
"values",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Cookie/CookieJar.php#L164-L167 | train | Returns path domain secure and sameSite | [
30522,
5123,
3853,
2131,
15069,
5685,
9527,
8113,
1006,
1002,
4130,
1010,
1002,
5884,
1010,
1002,
5851,
1027,
19701,
1010,
1002,
2168,
28032,
2063,
1027,
19701,
1007,
1063,
2709,
1031,
1002,
4130,
1029,
1024,
1002,
2023,
1011,
1028,
4130,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Broadcasting/Broadcasters/UsePusherChannelConventions.php | UsePusherChannelConventions.normalizeChannelName | public function normalizeChannelName($channel)
{
if ($this->isGuardedChannel($channel)) {
return Str::startsWith($channel, 'private-')
? Str::replaceFirst('private-', '', $channel)
: Str::replaceFirst('presence-', '', $channel);
}
return $channel;... | php | public function normalizeChannelName($channel)
{
if ($this->isGuardedChannel($channel)) {
return Str::startsWith($channel, 'private-')
? Str::replaceFirst('private-', '', $channel)
: Str::replaceFirst('presence-', '', $channel);
}
return $channel;... | [
"public",
"function",
"normalizeChannelName",
"(",
"$",
"channel",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isGuardedChannel",
"(",
"$",
"channel",
")",
")",
"{",
"return",
"Str",
"::",
"startsWith",
"(",
"$",
"channel",
",",
"'private-'",
")",
"?",
"Str... | Remove prefix from channel name.
@param string $channel
@return string | [
"Remove",
"prefix",
"from",
"channel",
"name",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Broadcasting/Broadcasters/UsePusherChannelConventions.php#L26-L35 | train | Normalize channel name | [
30522,
2270,
3853,
3671,
4697,
26058,
18442,
1006,
1002,
3149,
1007,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
2003,
18405,
2098,
26058,
1006,
1002,
3149,
1007,
1007,
1063,
2709,
2358,
2099,
1024,
1024,
4627,
24415,
1006,
1002,
3149,
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... |
getgrav/grav | system/src/Grav/Common/Plugin.php | Plugin.parseLinks | protected function parseLinks($content, $function, $internal_regex = '(.*)')
{
$regex = '/\[plugin:(?:' . $this->name . ')\]\(' . $internal_regex . '\)/i';
return preg_replace_callback($regex, $function, $content);
} | php | protected function parseLinks($content, $function, $internal_regex = '(.*)')
{
$regex = '/\[plugin:(?:' . $this->name . ')\]\(' . $internal_regex . '\)/i';
return preg_replace_callback($regex, $function, $content);
} | [
"protected",
"function",
"parseLinks",
"(",
"$",
"content",
",",
"$",
"function",
",",
"$",
"internal_regex",
"=",
"'(.*)'",
")",
"{",
"$",
"regex",
"=",
"'/\\[plugin:(?:'",
".",
"$",
"this",
"->",
"name",
".",
"')\\]\\('",
".",
"$",
"internal_regex",
".",... | This function will search a string for markdown links in a specific format. The link value can be
optionally compared against via the $internal_regex and operated on by the callback $function
provided.
format: [plugin:myplugin_name](function_data)
@param string $content The string to perform operations upon... | [
"This",
"function",
"will",
"search",
"a",
"string",
"for",
"markdown",
"links",
"in",
"a",
"specific",
"format",
".",
"The",
"link",
"value",
"can",
"be",
"optionally",
"compared",
"against",
"via",
"the",
"$internal_regex",
"and",
"operated",
"on",
"by",
"... | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Plugin.php#L252-L257 | train | Parse links in the content | [
30522,
5123,
3853,
11968,
11246,
19839,
2015,
1006,
1002,
4180,
1010,
1002,
3853,
1010,
1002,
4722,
1035,
19723,
10288,
1027,
1005,
1006,
1012,
1008,
1007,
1005,
1007,
1063,
1002,
19723,
10288,
1027,
1005,
1013,
1032,
1031,
13354,
2378,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/UserCountry/Controller.php | Controller.updateGeoIPLinks | public function updateGeoIPLinks()
{
$this->dieIfGeolocationAdminIsDisabled();
Piwik::checkUserHasSuperUserAccess();
if ($_SERVER["REQUEST_METHOD"] == "POST") {
Json::sendHeaderJSON();
try {
$this->checkTokenInUrl();
if ($this->isGeoIp... | php | public function updateGeoIPLinks()
{
$this->dieIfGeolocationAdminIsDisabled();
Piwik::checkUserHasSuperUserAccess();
if ($_SERVER["REQUEST_METHOD"] == "POST") {
Json::sendHeaderJSON();
try {
$this->checkTokenInUrl();
if ($this->isGeoIp... | [
"public",
"function",
"updateGeoIPLinks",
"(",
")",
"{",
"$",
"this",
"->",
"dieIfGeolocationAdminIsDisabled",
"(",
")",
";",
"Piwik",
"::",
"checkUserHasSuperUserAccess",
"(",
")",
";",
"if",
"(",
"$",
"_SERVER",
"[",
"\"REQUEST_METHOD\"",
"]",
"==",
"\"POST\""... | Sets the URLs used to download new versions of the installed GeoIP databases.
Input (query params):
'loc_db' - URL for a GeoIP location database.
'isp_db' - URL for a GeoIP ISP database (optional).
'org_db' - URL for a GeoIP Org database (optional).
'period' - 'weekly' or 'monthly'. Determines how often update is run.... | [
"Sets",
"the",
"URLs",
"used",
"to",
"download",
"new",
"versions",
"of",
"the",
"installed",
"GeoIP",
"databases",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UserCountry/Controller.php#L278-L312 | train | Returns the HTML for the next run time link | [
30522,
2270,
3853,
10651,
3351,
10448,
28296,
5705,
1006,
1007,
1063,
1002,
2023,
1011,
1028,
3280,
10128,
3351,
12898,
10719,
4215,
25300,
16150,
14268,
23242,
1006,
1007,
1025,
14255,
9148,
2243,
1024,
1024,
4638,
20330,
14949,
6342,
4842,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Bundle/Writer/TextBundleWriter.php | TextBundleWriter.writeIntVector | private function writeIntVector($file, array $value, $indentation)
{
fwrite($file, ":intvector{\n");
foreach ($value as $int) {
fprintf($file, "%s%d,\n", str_repeat(' ', $indentation + 1), $int);
}
fprintf($file, '%s}', str_repeat(' ', $indentation));
} | php | private function writeIntVector($file, array $value, $indentation)
{
fwrite($file, ":intvector{\n");
foreach ($value as $int) {
fprintf($file, "%s%d,\n", str_repeat(' ', $indentation + 1), $int);
}
fprintf($file, '%s}', str_repeat(' ', $indentation));
} | [
"private",
"function",
"writeIntVector",
"(",
"$",
"file",
",",
"array",
"$",
"value",
",",
"$",
"indentation",
")",
"{",
"fwrite",
"(",
"$",
"file",
",",
"\":intvector{\\n\"",
")",
";",
"foreach",
"(",
"$",
"value",
"as",
"$",
"int",
")",
"{",
"fprint... | Writes an "intvector" node.
@param resource $file The file handle to write to
@param array $value The value of the node
@param int $indentation The number of levels to indent
@see http://source.icu-project.org/repos/icu/icuhtml/trunk/design/bnf_rb.txt | [
"Writes",
"an",
"intvector",
"node",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Intl/Data/Bundle/Writer/TextBundleWriter.php#L139-L148 | train | Write a intvector | [
30522,
2797,
3853,
4339,
18447,
3726,
16761,
1006,
1002,
5371,
1010,
9140,
1002,
3643,
1010,
1002,
27427,
19304,
1007,
1063,
1042,
26373,
1006,
1002,
5371,
1010,
1000,
1024,
20014,
3726,
16761,
1063,
1032,
1050,
1000,
1007,
1025,
18921,
677... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Filter.php | Filter.defineFilterScopes | protected function defineFilterScopes()
{
if ($this->scopesDefined) {
return;
}
/**
* @event backend.filter.extendScopesBefore
* Provides an opportunity to interact with the Filter widget before defining the filter scopes
*
* Example usage:
... | php | protected function defineFilterScopes()
{
if ($this->scopesDefined) {
return;
}
/**
* @event backend.filter.extendScopesBefore
* Provides an opportunity to interact with the Filter widget before defining the filter scopes
*
* Example usage:
... | [
"protected",
"function",
"defineFilterScopes",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"scopesDefined",
")",
"{",
"return",
";",
"}",
"/**\n * @event backend.filter.extendScopesBefore\n * Provides an opportunity to interact with the Filter widget before definin... | Creates a flat array of filter scopes from the configuration. | [
"Creates",
"a",
"flat",
"array",
"of",
"filter",
"scopes",
"from",
"the",
"configuration",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/Filter.php#L504-L562 | train | Define the filter scopes | [
30522,
5123,
3853,
9375,
8873,
21928,
26127,
2015,
1006,
1007,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
9531,
16150,
28344,
1007,
30524,
9531,
2015,
1008,
1008,
2742,
8192,
1024,
1008,
1008,
2724,
1024,
1024,
4952,
1006,
1005,
2067,
10497,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/cms/controllers/Index.php | Index.upgradeSettings | protected function upgradeSettings($settings)
{
/*
* Handle component usage
*/
$componentProperties = post('component_properties');
$componentNames = post('component_names');
$componentAliases = post('component_aliases');
if ($componentProperties !== null) ... | php | protected function upgradeSettings($settings)
{
/*
* Handle component usage
*/
$componentProperties = post('component_properties');
$componentNames = post('component_names');
$componentAliases = post('component_aliases');
if ($componentProperties !== null) ... | [
"protected",
"function",
"upgradeSettings",
"(",
"$",
"settings",
")",
"{",
"/*\n * Handle component usage\n */",
"$",
"componentProperties",
"=",
"post",
"(",
"'component_properties'",
")",
";",
"$",
"componentNames",
"=",
"post",
"(",
"'component_names'"... | Processes the component settings so they are ready to be saved
@param array $settings
@return array | [
"Processes",
"the",
"component",
"settings",
"so",
"they",
"are",
"ready",
"to",
"be",
"saved"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/controllers/Index.php#L551-L614 | train | Upgrade settings from post to post array | [
30522,
5123,
3853,
18739,
18319,
3070,
2015,
1006,
1002,
10906,
1007,
1063,
1013,
1008,
1008,
5047,
6922,
8192,
1008,
1013,
1002,
6922,
21572,
4842,
7368,
1027,
2695,
1006,
1005,
6922,
1035,
5144,
1005,
1007,
1025,
1002,
6922,
18442,
2015,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Routing/Middleware/ThrottleRequestsWithRedis.php | ThrottleRequestsWithRedis.tooManyAttempts | protected function tooManyAttempts($key, $maxAttempts, $decayMinutes)
{
$limiter = new DurationLimiter(
$this->redis, $key, $maxAttempts, $decayMinutes * 60
);
return tap(! $limiter->acquire(), function () use ($limiter) {
[$this->decaysAt, $this->remaining] = [
... | php | protected function tooManyAttempts($key, $maxAttempts, $decayMinutes)
{
$limiter = new DurationLimiter(
$this->redis, $key, $maxAttempts, $decayMinutes * 60
);
return tap(! $limiter->acquire(), function () use ($limiter) {
[$this->decaysAt, $this->remaining] = [
... | [
"protected",
"function",
"tooManyAttempts",
"(",
"$",
"key",
",",
"$",
"maxAttempts",
",",
"$",
"decayMinutes",
")",
"{",
"$",
"limiter",
"=",
"new",
"DurationLimiter",
"(",
"$",
"this",
"->",
"redis",
",",
"$",
"key",
",",
"$",
"maxAttempts",
",",
"$",
... | Determine if the given key has been "accessed" too many times.
@param string $key
@param int $maxAttempts
@param int $decayMinutes
@return mixed | [
"Determine",
"if",
"the",
"given",
"key",
"has",
"been",
"accessed",
"too",
"many",
"times",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/Middleware/ThrottleRequestsWithRedis.php#L80-L91 | train | Ensures that the key exists in the cache and adds the remaining delays to the array. | [
30522,
5123,
3853,
2205,
2386,
26139,
18532,
22798,
1006,
1002,
3145,
1010,
1002,
4098,
19321,
6633,
22798,
1010,
1002,
13121,
10020,
10421,
2015,
1007,
1063,
1002,
5787,
2121,
1027,
2047,
9367,
17960,
21646,
1006,
1002,
2023,
1011,
1028,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Common/Utils.php | Utils.arrayFlattenDotNotation | public static function arrayFlattenDotNotation($array, $prepend = '')
{
$results = array();
foreach ($array as $key => $value) {
if (is_array($value)) {
$results = array_merge($results, static::arrayFlattenDotNotation($value, $prepend.$key.'.'));
} else {
... | php | public static function arrayFlattenDotNotation($array, $prepend = '')
{
$results = array();
foreach ($array as $key => $value) {
if (is_array($value)) {
$results = array_merge($results, static::arrayFlattenDotNotation($value, $prepend.$key.'.'));
} else {
... | [
"public",
"static",
"function",
"arrayFlattenDotNotation",
"(",
"$",
"array",
",",
"$",
"prepend",
"=",
"''",
")",
"{",
"$",
"results",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"array",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
... | Flatten a multi-dimensional associative array into dot notation
@param array $array
@param string $prepend
@return array | [
"Flatten",
"a",
"multi",
"-",
"dimensional",
"associative",
"array",
"into",
"dot",
"notation"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Utils.php#L929-L941 | train | Flatten a dot notation array into a single level | [
30522,
2270,
10763,
3853,
9140,
10258,
19321,
10497,
4140,
17048,
3370,
1006,
1002,
9140,
1010,
1002,
17463,
10497,
1027,
1005,
1005,
1007,
1063,
1002,
3463,
1027,
9140,
1006,
1007,
1025,
18921,
6776,
1006,
1002,
9140,
2004,
1002,
3145,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Form/Extension/DataCollector/EventListener/DataCollectorListener.php | DataCollectorListener.postSetData | public function postSetData(FormEvent $event)
{
if ($event->getForm()->isRoot()) {
// Collect basic information about each form
$this->dataCollector->collectConfiguration($event->getForm());
// Collect the default data
$this->dataCollector->collectDefaultData... | php | public function postSetData(FormEvent $event)
{
if ($event->getForm()->isRoot()) {
// Collect basic information about each form
$this->dataCollector->collectConfiguration($event->getForm());
// Collect the default data
$this->dataCollector->collectDefaultData... | [
"public",
"function",
"postSetData",
"(",
"FormEvent",
"$",
"event",
")",
"{",
"if",
"(",
"$",
"event",
"->",
"getForm",
"(",
")",
"->",
"isRoot",
"(",
")",
")",
"{",
"// Collect basic information about each form",
"$",
"this",
"->",
"dataCollector",
"->",
"... | Listener for the {@link FormEvents::POST_SET_DATA} event. | [
"Listener",
"for",
"the",
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/Extension/DataCollector/EventListener/DataCollectorListener.php#L50-L59 | train | Post Set Data event | [
30522,
2270,
3853,
8466,
3388,
2850,
2696,
1006,
2433,
18697,
3372,
1002,
2724,
1007,
1063,
2065,
1006,
1002,
2724,
1011,
1028,
2131,
14192,
1006,
1007,
1011,
1028,
2003,
3217,
4140,
1006,
1007,
1007,
1063,
1013,
1013,
8145,
3937,
2592,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Common/Page/Page.php | Page.value | public function value($name, $default = null)
{
if ($name === 'content') {
return $this->raw_content;
}
if ($name === 'route') {
$parent = $this->parent();
return $parent ? $parent->rawRoute() : '';
}
if ($name === 'order') {
$... | php | public function value($name, $default = null)
{
if ($name === 'content') {
return $this->raw_content;
}
if ($name === 'route') {
$parent = $this->parent();
return $parent ? $parent->rawRoute() : '';
}
if ($name === 'order') {
$... | [
"public",
"function",
"value",
"(",
"$",
"name",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"name",
"===",
"'content'",
")",
"{",
"return",
"$",
"this",
"->",
"raw_content",
";",
"}",
"if",
"(",
"$",
"name",
"===",
"'route'",
")",
... | Get value from a page variable (used mostly for creating edit forms).
@param string $name Variable name.
@param mixed $default
@return mixed | [
"Get",
"value",
"from",
"a",
"page",
"variable",
"(",
"used",
"mostly",
"for",
"creating",
"edit",
"forms",
")",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Page/Page.php#L892-L964 | train | Return the value of the field | [
30522,
2270,
3853,
3643,
1006,
1002,
2171,
1010,
1002,
12398,
1027,
19701,
1007,
1063,
2065,
1006,
1002,
2171,
1027,
1027,
1027,
1005,
4180,
1005,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
6315,
1035,
4180,
1025,
1065,
2065,
1006,
1002,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/CssSelector/Parser/TokenStream.php | TokenStream.getNext | public function getNext()
{
if ($this->peeking) {
$this->peeking = false;
$this->used[] = $this->peeked;
return $this->peeked;
}
if (!isset($this->tokens[$this->cursor])) {
throw new InternalErrorException('Unexpected token stream end.');
... | php | public function getNext()
{
if ($this->peeking) {
$this->peeking = false;
$this->used[] = $this->peeked;
return $this->peeked;
}
if (!isset($this->tokens[$this->cursor])) {
throw new InternalErrorException('Unexpected token stream end.');
... | [
"public",
"function",
"getNext",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"peeking",
")",
"{",
"$",
"this",
"->",
"peeking",
"=",
"false",
";",
"$",
"this",
"->",
"used",
"[",
"]",
"=",
"$",
"this",
"->",
"peeked",
";",
"return",
"$",
"this",... | Returns next token.
@return Token
@throws InternalErrorException If there is no more token | [
"Returns",
"next",
"token",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/CssSelector/Parser/TokenStream.php#L83-L97 | train | Returns the next token from the token stream. | [
30522,
2270,
3853,
2131,
2638,
18413,
1006,
1007,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
28222,
1007,
1063,
1002,
2023,
1011,
1028,
28222,
1027,
6270,
1025,
1002,
2023,
1011,
1028,
2109,
1031,
1033,
1027,
1002,
2023,
1011,
1028,
18652,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
barryvdh/laravel-debugbar | src/DataCollector/LogsCollector.php | LogsCollector.getStorageLogs | public function getStorageLogs($path)
{
if (!file_exists($path)) {
return;
}
//Load the latest lines, guessing about 15x the number of log entries (for stack traces etc)
$file = implode("", $this->tailFile($path, $this->lines));
foreach ($this->getLogs($file) as... | php | public function getStorageLogs($path)
{
if (!file_exists($path)) {
return;
}
//Load the latest lines, guessing about 15x the number of log entries (for stack traces etc)
$file = implode("", $this->tailFile($path, $this->lines));
foreach ($this->getLogs($file) as... | [
"public",
"function",
"getStorageLogs",
"(",
"$",
"path",
")",
"{",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"path",
")",
")",
"{",
"return",
";",
"}",
"//Load the latest lines, guessing about 15x the number of log entries (for stack traces etc)",
"$",
"file",
"=",
... | get logs apache in app/storage/logs
only 24 last of current day
@param string $path
@return array | [
"get",
"logs",
"apache",
"in",
"app",
"/",
"storage",
"/",
"logs",
"only",
"24",
"last",
"of",
"current",
"day"
] | 2d195779ea4f809f69764a795e2ec371dbb76a96 | https://github.com/barryvdh/laravel-debugbar/blob/2d195779ea4f809f69764a795e2ec371dbb76a96/src/DataCollector/LogsCollector.php#L46-L58 | train | Get logs from the file | [
30522,
2270,
3853,
4152,
4263,
4270,
21197,
2015,
1006,
1002,
4130,
1007,
1063,
2065,
1006,
999,
5371,
1035,
6526,
1006,
1002,
4130,
1007,
1007,
1063,
2709,
1025,
1065,
1013,
1013,
7170,
1996,
6745,
3210,
1010,
16986,
2055,
2321,
2595,
19... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php | HasRelationships.morphToMany | public function morphToMany($related, $name, $table = null, $foreignPivotKey = null,
$relatedPivotKey = null, $parentKey = null,
$relatedKey = null, $inverse = false)
{
$caller = $this->guessBelongsToManyRelation();
// First, we will n... | php | public function morphToMany($related, $name, $table = null, $foreignPivotKey = null,
$relatedPivotKey = null, $parentKey = null,
$relatedKey = null, $inverse = false)
{
$caller = $this->guessBelongsToManyRelation();
// First, we will n... | [
"public",
"function",
"morphToMany",
"(",
"$",
"related",
",",
"$",
"name",
",",
"$",
"table",
"=",
"null",
",",
"$",
"foreignPivotKey",
"=",
"null",
",",
"$",
"relatedPivotKey",
"=",
"null",
",",
"$",
"parentKey",
"=",
"null",
",",
"$",
"relatedKey",
... | Define a polymorphic many-to-many relationship.
@param string $related
@param string $name
@param string $table
@param string $foreignPivotKey
@param string $relatedPivotKey
@param string $parentKey
@param string $relatedKey
@param bool $inverse
@return \Illuminate\Database\Eloquent\Relations\MorphToMa... | [
"Define",
"a",
"polymorphic",
"many",
"-",
"to",
"-",
"many",
"relationship",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php#L513-L544 | train | Create a new query builder for a morphToMany relation | [
30522,
2270,
3853,
22822,
8458,
20389,
19092,
1006,
1002,
3141,
1010,
1002,
2171,
1010,
1002,
2795,
1027,
19701,
1010,
1002,
3097,
8197,
22994,
14839,
1027,
19701,
1010,
1002,
3141,
8197,
22994,
14839,
1027,
19701,
1010,
1002,
6687,
14839,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Auth/Database/HasPermissions.php | HasPermissions.can | public function can($ability, $arguments = []) : bool
{
if ($this->isAdministrator()) {
return true;
}
if ($this->permissions->pluck('slug')->contains($ability)) {
return true;
}
return $this->roles->pluck('permissions')->flatten()->pluck('slug')->co... | php | public function can($ability, $arguments = []) : bool
{
if ($this->isAdministrator()) {
return true;
}
if ($this->permissions->pluck('slug')->contains($ability)) {
return true;
}
return $this->roles->pluck('permissions')->flatten()->pluck('slug')->co... | [
"public",
"function",
"can",
"(",
"$",
"ability",
",",
"$",
"arguments",
"=",
"[",
"]",
")",
":",
"bool",
"{",
"if",
"(",
"$",
"this",
"->",
"isAdministrator",
"(",
")",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"permiss... | Check if user has permission.
@param $ability
@param array $arguments
@return bool | [
"Check",
"if",
"user",
"has",
"permission",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Auth/Database/HasPermissions.php#L27-L38 | train | Can user access to this role | [
30522,
2270,
3853,
2064,
1006,
1002,
3754,
1010,
1002,
9918,
1027,
1031,
1033,
1007,
1024,
22017,
2140,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
18061,
22117,
5498,
20528,
4263,
1006,
1007,
1007,
1063,
2709,
2995,
1025,
1065,
2065,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/LanguagesManager/Commands/Update.php | Update.getPluginsInCore | public static function getPluginsInCore()
{
static $pluginsInCore;
if (!empty($pluginsInCore)) {
return $pluginsInCore;
}
$submodules = shell_exec('git submodule status');
preg_match_all('/plugins\/([a-zA-z]+) /', $submodules, $matches);
$submodulePlugin... | php | public static function getPluginsInCore()
{
static $pluginsInCore;
if (!empty($pluginsInCore)) {
return $pluginsInCore;
}
$submodules = shell_exec('git submodule status');
preg_match_all('/plugins\/([a-zA-z]+) /', $submodules, $matches);
$submodulePlugin... | [
"public",
"static",
"function",
"getPluginsInCore",
"(",
")",
"{",
"static",
"$",
"pluginsInCore",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"pluginsInCore",
")",
")",
"{",
"return",
"$",
"pluginsInCore",
";",
"}",
"$",
"submodules",
"=",
"shell_exec",
"(",
... | Returns all plugins having their own translations that are bundled in core
@return array | [
"Returns",
"all",
"plugins",
"having",
"their",
"own",
"translations",
"that",
"are",
"bundled",
"in",
"core"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/LanguagesManager/Commands/Update.php#L178-L209 | train | Get all plugins in core | [
30522,
2270,
10763,
3853,
2131,
24759,
15916,
7076,
2378,
17345,
1006,
1007,
1063,
10763,
1002,
13354,
30524,
1035,
2674,
1035,
2035,
1006,
1005,
1013,
13354,
7076,
1032,
1013,
1006,
1031,
1037,
1011,
23564,
1011,
1062,
1033,
1009,
1007,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/HTML/QuickForm2/Controller.php | HTML_QuickForm2_Controller.isValid | public function isValid(HTML_QuickForm2_Controller_Page $reference = null)
{
$container = $this->getSessionContainer();
foreach ($this->pages as $id => $page) {
if ($reference === $page) {
return true;
}
if (!$container->getValidationStatus($id)) {... | php | public function isValid(HTML_QuickForm2_Controller_Page $reference = null)
{
$container = $this->getSessionContainer();
foreach ($this->pages as $id => $page) {
if ($reference === $page) {
return true;
}
if (!$container->getValidationStatus($id)) {... | [
"public",
"function",
"isValid",
"(",
"HTML_QuickForm2_Controller_Page",
"$",
"reference",
"=",
"null",
")",
"{",
"$",
"container",
"=",
"$",
"this",
"->",
"getSessionContainer",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"pages",
"as",
"$",
"id",
"... | Checks whether the pages of the controller are valid
@param HTML_QuickForm2_Controller_Page If given, check only the pages
before (not including) that page
@return bool | [
"Checks",
"whether",
"the",
"pages",
"of",
"the",
"controller",
"are",
"valid"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Controller.php#L391-L419 | train | Returns true if the page is valid | [
30522,
2270,
3853,
2003,
10175,
3593,
1006,
16129,
1035,
4248,
14192,
2475,
1035,
11486,
1035,
3931,
1002,
4431,
1027,
19701,
1007,
1063,
1002,
11661,
1027,
1002,
2023,
1011,
1028,
4152,
7971,
3258,
8663,
18249,
2121,
1006,
1007,
1025,
1892... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Text.php | Text.input | public static function input($buffer, TcpConnection $connection)
{
// Judge whether the package length exceeds the limit.
if (strlen($buffer) >= $connection->maxPackageSize) {
$connection->close();
return 0;
}
// Find the position of "\n".
$pos = str... | php | public static function input($buffer, TcpConnection $connection)
{
// Judge whether the package length exceeds the limit.
if (strlen($buffer) >= $connection->maxPackageSize) {
$connection->close();
return 0;
}
// Find the position of "\n".
$pos = str... | [
"public",
"static",
"function",
"input",
"(",
"$",
"buffer",
",",
"TcpConnection",
"$",
"connection",
")",
"{",
"// Judge whether the package length exceeds the limit.",
"if",
"(",
"strlen",
"(",
"$",
"buffer",
")",
">=",
"$",
"connection",
"->",
"maxPackageSize",
... | Check the integrity of the package.
@param string $buffer
@param TcpConnection $connection
@return int | [
"Check",
"the",
"integrity",
"of",
"the",
"package",
"."
] | 13649907f05014fcfffcfccaef01e63ad3339351 | https://github.com/walkor/Workerman/blob/13649907f05014fcfffcfccaef01e63ad3339351/Protocols/Text.php#L30-L45 | train | This method is used to determine the package length. | [
30522,
2270,
10763,
3853,
7953,
1006,
1002,
17698,
1010,
22975,
15042,
18256,
7542,
1002,
4434,
1007,
1063,
1013,
1013,
3648,
3251,
1996,
7427,
3091,
23651,
1996,
5787,
1012,
2065,
1006,
2358,
20927,
2078,
1006,
1002,
17698,
1007,
1028,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/Plugin/Metric.php | Metric.getActualMetricColumn | public static function getActualMetricColumn(DataTable $table, $columnName, $mappingNameToId = null)
{
$firstRow = $table->getFirstRow();
if (!empty($firstRow) && $firstRow->hasColumn($columnName) === false) {
if (empty($mappingIdToName)) {
$mappingNameToId = Metrics::g... | php | public static function getActualMetricColumn(DataTable $table, $columnName, $mappingNameToId = null)
{
$firstRow = $table->getFirstRow();
if (!empty($firstRow) && $firstRow->hasColumn($columnName) === false) {
if (empty($mappingIdToName)) {
$mappingNameToId = Metrics::g... | [
"public",
"static",
"function",
"getActualMetricColumn",
"(",
"DataTable",
"$",
"table",
",",
"$",
"columnName",
",",
"$",
"mappingNameToId",
"=",
"null",
")",
"{",
"$",
"firstRow",
"=",
"$",
"table",
"->",
"getFirstRow",
"(",
")",
";",
"if",
"(",
"!",
"... | Helper method that determines the actual column for a metric in a {@link Piwik\DataTable}.
@param DataTable $table
@param string $columnName
@param int[]|null $mappingNameToId A custom mapping of metric names to special index values. By
default {@link Metrics::getMappingFromNameToId()} is used.
@return string | [
"Helper",
"method",
"that",
"determines",
"the",
"actual",
"column",
"for",
"a",
"metric",
"in",
"a",
"{",
"@link",
"Piwik",
"\\",
"DataTable",
"}",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Plugin/Metric.php#L185-L201 | train | Returns actual metric column name | [
30522,
2270,
10763,
3853,
2131,
18908,
8787,
12589,
25778,
2819,
2078,
1006,
2951,
10880,
1002,
2795,
1010,
1002,
5930,
18442,
1010,
1002,
12375,
18442,
3406,
3593,
1027,
19701,
1007,
1063,
1002,
2034,
10524,
1027,
1002,
2795,
1011,
1028,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/system/classes/VersionManager.php | VersionManager.getDatabaseVersion | protected function getDatabaseVersion($code)
{
if ($this->databaseVersions === null) {
$this->databaseVersions = Db::table('system_plugin_versions')->lists('version', 'code');
}
if (!isset($this->databaseVersions[$code])) {
$this->databaseVersions[$code] = Db::table(... | php | protected function getDatabaseVersion($code)
{
if ($this->databaseVersions === null) {
$this->databaseVersions = Db::table('system_plugin_versions')->lists('version', 'code');
}
if (!isset($this->databaseVersions[$code])) {
$this->databaseVersions[$code] = Db::table(... | [
"protected",
"function",
"getDatabaseVersion",
"(",
"$",
"code",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"databaseVersions",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"databaseVersions",
"=",
"Db",
"::",
"table",
"(",
"'system_plugin_versions'",
")",
"->",... | Returns the latest version of a plugin from the database. | [
"Returns",
"the",
"latest",
"version",
"of",
"a",
"plugin",
"from",
"the",
"database",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/VersionManager.php#L315-L329 | train | Get database version by code | [
30522,
5123,
3853,
2131,
2850,
2696,
15058,
27774,
1006,
1002,
3642,
1007,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
7809,
27774,
2015,
1027,
1027,
1027,
19701,
1007,
1063,
1002,
2023,
1011,
1028,
7809,
27774,
2015,
1027,
16962,
1024,
1024,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Routing/Loader/Configurator/CollectionConfigurator.php | CollectionConfigurator.collection | final public function collection($name = '')
{
return new self($this->collection, $this->name.$name, $this, $this->prefixes);
} | php | final public function collection($name = '')
{
return new self($this->collection, $this->name.$name, $this, $this->prefixes);
} | [
"final",
"public",
"function",
"collection",
"(",
"$",
"name",
"=",
"''",
")",
"{",
"return",
"new",
"self",
"(",
"$",
"this",
"->",
"collection",
",",
"$",
"this",
"->",
"name",
".",
"$",
"name",
",",
"$",
"this",
",",
"$",
"this",
"->",
"prefixes... | Creates a sub-collection.
@return self | [
"Creates",
"a",
"sub",
"-",
"collection",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Routing/Loader/Configurator/CollectionConfigurator.php#L53-L56 | train | Create a new PageCollection | [
30522,
2345,
2270,
3853,
3074,
1006,
1002,
2171,
1027,
1005,
1005,
1007,
1063,
2709,
2047,
2969,
1006,
1002,
2023,
30524,
1011,
1028,
2171,
1012,
1002,
2171,
1010,
1002,
2023,
1010,
1002,
2023,
1011,
1028,
17576,
2229,
1007,
1025,
1065,
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/ExpressionLanguage/ExpressionFunction.php | ExpressionFunction.fromPhp | public static function fromPhp($phpFunctionName, $expressionFunctionName = null)
{
$phpFunctionName = ltrim($phpFunctionName, '\\');
if (!\function_exists($phpFunctionName)) {
throw new \InvalidArgumentException(sprintf('PHP function "%s" does not exist.', $phpFunctionName));
}
... | php | public static function fromPhp($phpFunctionName, $expressionFunctionName = null)
{
$phpFunctionName = ltrim($phpFunctionName, '\\');
if (!\function_exists($phpFunctionName)) {
throw new \InvalidArgumentException(sprintf('PHP function "%s" does not exist.', $phpFunctionName));
}
... | [
"public",
"static",
"function",
"fromPhp",
"(",
"$",
"phpFunctionName",
",",
"$",
"expressionFunctionName",
"=",
"null",
")",
"{",
"$",
"phpFunctionName",
"=",
"ltrim",
"(",
"$",
"phpFunctionName",
",",
"'\\\\'",
")",
";",
"if",
"(",
"!",
"\\",
"function_exi... | Creates an ExpressionFunction from a PHP function name.
@param string $phpFunctionName The PHP function name
@param string|null $expressionFunctionName The expression function name (default: same than the PHP function name)
@return self
@throws \InvalidArgumentException if given PHP function name does no... | [
"Creates",
"an",
"ExpressionFunction",
"from",
"a",
"PHP",
"function",
"name",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/ExpressionLanguage/ExpressionFunction.php#L76-L97 | train | Create a new instance from a PHP function name and an expression function name. | [
30522,
2270,
10763,
3853,
2013,
8458,
2361,
1006,
1002,
25718,
11263,
27989,
18442,
1010,
1002,
3670,
11263,
27989,
18442,
1027,
19701,
1007,
1063,
1002,
25718,
11263,
27989,
18442,
1027,
8318,
20026,
1006,
1002,
25718,
11263,
27989,
18442,
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/HTML/QuickForm2/Renderer/Smarty.php | HTML_QuickForm2_Renderer_Smarty.buildCommonFields | public function buildCommonFields(HTML_QuickForm2_Node $element)
{
$keyn = $this->options['key_id'] ? 'id' : 'name';
$ary = array(
'id' => $element->getId(),
'frozen' => $element->toggleFrozen(),
'name' => $element->getName(),
);
// Key tha... | php | public function buildCommonFields(HTML_QuickForm2_Node $element)
{
$keyn = $this->options['key_id'] ? 'id' : 'name';
$ary = array(
'id' => $element->getId(),
'frozen' => $element->toggleFrozen(),
'name' => $element->getName(),
);
// Key tha... | [
"public",
"function",
"buildCommonFields",
"(",
"HTML_QuickForm2_Node",
"$",
"element",
")",
"{",
"$",
"keyn",
"=",
"$",
"this",
"->",
"options",
"[",
"'key_id'",
"]",
"?",
"'id'",
":",
"'name'",
";",
"$",
"ary",
"=",
"array",
"(",
"'id'",
"=>",
"$",
"... | Creates an array with fields that are common to all elements
@param HTML_QuickForm2_Node Element being rendered
@return array | [
"Creates",
"an",
"array",
"with",
"fields",
"that",
"are",
"common",
"to",
"all",
"elements"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Renderer/Smarty.php#L169-L216 | train | Build the common fields array | [
30522,
2270,
3853,
3857,
9006,
8202,
15155,
1006,
16129,
1035,
4248,
14192,
2475,
1035,
13045,
1002,
5783,
1007,
1063,
1002,
3145,
2078,
1027,
1002,
2023,
1011,
1028,
7047,
1031,
1005,
3145,
1035,
8909,
1005,
1033,
1029,
1005,
8909,
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... |
z-song/laravel-admin | src/Form/Tab.php | Tab.collectFields | protected function collectFields(\Closure $content)
{
call_user_func($content, $this->form);
$fields = clone $this->form->builder()->fields();
$all = $fields->toArray();
foreach ($this->form->rows as $row) {
$rowFields = array_map(function ($field) {
re... | php | protected function collectFields(\Closure $content)
{
call_user_func($content, $this->form);
$fields = clone $this->form->builder()->fields();
$all = $fields->toArray();
foreach ($this->form->rows as $row) {
$rowFields = array_map(function ($field) {
re... | [
"protected",
"function",
"collectFields",
"(",
"\\",
"Closure",
"$",
"content",
")",
"{",
"call_user_func",
"(",
"$",
"content",
",",
"$",
"this",
"->",
"form",
")",
";",
"$",
"fields",
"=",
"clone",
"$",
"this",
"->",
"form",
"->",
"builder",
"(",
")"... | Collect fields under current tab.
@param \Closure $content
@return Collection | [
"Collect",
"fields",
"under",
"current",
"tab",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Form/Tab.php#L64-L97 | train | Collect fields from form | [
30522,
5123,
3853,
8145,
15155,
1006,
1032,
8503,
1002,
4180,
1007,
1063,
2655,
1035,
5310,
1035,
4569,
2278,
1006,
1002,
4180,
1010,
1002,
2023,
1011,
1028,
2433,
1007,
1025,
1002,
4249,
1027,
17598,
1002,
2023,
1011,
1028,
2433,
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/Config/Definition/Builder/ExprBuilder.php | ExprBuilder.buildExpressions | public static function buildExpressions(array $expressions)
{
foreach ($expressions as $k => $expr) {
if ($expr instanceof self) {
$if = $expr->ifPart;
$then = $expr->thenPart;
$expressions[$k] = function ($v) use ($if, $then) {
... | php | public static function buildExpressions(array $expressions)
{
foreach ($expressions as $k => $expr) {
if ($expr instanceof self) {
$if = $expr->ifPart;
$then = $expr->thenPart;
$expressions[$k] = function ($v) use ($if, $then) {
... | [
"public",
"static",
"function",
"buildExpressions",
"(",
"array",
"$",
"expressions",
")",
"{",
"foreach",
"(",
"$",
"expressions",
"as",
"$",
"k",
"=>",
"$",
"expr",
")",
"{",
"if",
"(",
"$",
"expr",
"instanceof",
"self",
")",
"{",
"$",
"if",
"=",
"... | Builds the expressions.
@param ExprBuilder[] $expressions An array of ExprBuilder instances to build
@return array | [
"Builds",
"the",
"expressions",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Config/Definition/Builder/ExprBuilder.php#L234-L247 | train | Build expressions to be used in the code | [
30522,
2270,
10763,
3853,
3857,
10288,
20110,
8496,
1006,
9140,
1002,
11423,
1007,
1063,
18921,
6776,
1006,
1002,
11423,
2004,
1002,
1047,
1027,
1028,
1002,
4654,
18098,
1007,
1063,
2065,
1006,
1002,
4654,
18098,
6013,
11253,
2969,
1007,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/backend/widgets/MediaManager.php | MediaManager.setViewMode | protected function setViewMode($viewMode)
{
if (!in_array($viewMode, [
self::VIEW_MODE_GRID,
self::VIEW_MODE_LIST,
self::VIEW_MODE_TILES
])) {
throw new ApplicationException('Invalid input data');
}
$this->putSession('view_mode', $view... | php | protected function setViewMode($viewMode)
{
if (!in_array($viewMode, [
self::VIEW_MODE_GRID,
self::VIEW_MODE_LIST,
self::VIEW_MODE_TILES
])) {
throw new ApplicationException('Invalid input data');
}
$this->putSession('view_mode', $view... | [
"protected",
"function",
"setViewMode",
"(",
"$",
"viewMode",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"viewMode",
",",
"[",
"self",
"::",
"VIEW_MODE_GRID",
",",
"self",
"::",
"VIEW_MODE_LIST",
",",
"self",
"::",
"VIEW_MODE_TILES",
"]",
")",
")",
... | Stores a view mode in the session
@param string $viewMode
@return void | [
"Stores",
"a",
"view",
"mode",
"in",
"the",
"session"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/MediaManager.php#L1129-L1140 | train | Set view mode | [
30522,
5123,
3853,
2275,
8584,
5302,
3207,
1006,
1002,
3193,
5302,
3207,
1007,
1063,
2065,
1006,
999,
1999,
1035,
9140,
1006,
1002,
3193,
5302,
3207,
1010,
1031,
2969,
1024,
1024,
3193,
1035,
5549,
1035,
8370,
1010,
2969,
1024,
1024,
3193... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
z-song/laravel-admin | src/Middleware/Pjax.php | Pjax.fetchContents | protected function fetchContents($crawler, $container)
{
$content = $crawler->filter($container);
if (!$content->count()) {
abort(422);
}
return $this->decodeUtf8HtmlEntities($content->html());
} | php | protected function fetchContents($crawler, $container)
{
$content = $crawler->filter($container);
if (!$content->count()) {
abort(422);
}
return $this->decodeUtf8HtmlEntities($content->html());
} | [
"protected",
"function",
"fetchContents",
"(",
"$",
"crawler",
",",
"$",
"container",
")",
"{",
"$",
"content",
"=",
"$",
"crawler",
"->",
"filter",
"(",
"$",
"container",
")",
";",
"if",
"(",
"!",
"$",
"content",
"->",
"count",
"(",
")",
")",
"{",
... | Fetch the PJAX-specific HTML from the response.
@param Crawler $crawler
@param string $container
@return string | [
"Fetch",
"the",
"PJAX",
"-",
"specific",
"HTML",
"from",
"the",
"response",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Middleware/Pjax.php#L122-L131 | train | Fetch the content of a given container | [
30522,
5123,
3853,
18584,
8663,
6528,
3215,
1006,
1002,
13529,
2121,
1010,
1002,
11661,
1007,
1063,
1002,
4180,
1027,
1002,
13529,
2121,
1011,
1028,
11307,
1006,
1002,
11661,
1007,
1025,
2065,
1006,
999,
1002,
4180,
1011,
1028,
4175,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/Zend/Db/Statement/Sqlsrv.php | Zend_Db_Statement_Sqlsrv._prepare | protected function _prepare($sql)
{
$connection = $this->_adapter->getConnection();
$this->_stmt = sqlsrv_prepare($connection, $sql);
if (!$this->_stmt) {
// require_once 'Zend/Db/Statement/Sqlsrv/Exception.php';
throw new Zend_Db_Statement_Sqlsrv_Exception(sqlsrv_e... | php | protected function _prepare($sql)
{
$connection = $this->_adapter->getConnection();
$this->_stmt = sqlsrv_prepare($connection, $sql);
if (!$this->_stmt) {
// require_once 'Zend/Db/Statement/Sqlsrv/Exception.php';
throw new Zend_Db_Statement_Sqlsrv_Exception(sqlsrv_e... | [
"protected",
"function",
"_prepare",
"(",
"$",
"sql",
")",
"{",
"$",
"connection",
"=",
"$",
"this",
"->",
"_adapter",
"->",
"getConnection",
"(",
")",
";",
"$",
"this",
"->",
"_stmt",
"=",
"sqlsrv_prepare",
"(",
"$",
"connection",
",",
"$",
"sql",
")"... | Prepares statement handle
@param string $sql
@return void
@throws Zend_Db_Statement_Sqlsrv_Exception | [
"Prepares",
"statement",
"handle"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Statement/Sqlsrv.php#L62-L74 | train | Prepare the statement | [
30522,
5123,
3853,
1035,
7374,
1006,
1002,
29296,
1007,
1063,
1002,
4434,
1027,
1002,
2023,
1011,
1028,
1035,
15581,
2121,
1011,
1028,
2131,
8663,
2638,
7542,
1006,
1007,
1025,
1002,
2023,
1011,
1028,
1035,
2358,
20492,
1027,
29296,
21338,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.