repo stringclasses 21
values | path stringlengths 10 105 | func_name stringlengths 6 64 | original_string stringlengths 105 15.6k | language stringclasses 1
value | code stringlengths 105 15.6k | code_tokens listlengths 29 2.15k | docstring stringlengths 11 2.85k | docstring_tokens listlengths 1 290 | sha stringclasses 21
values | url stringlengths 100 194 | partition stringclasses 1
value | summary stringlengths 8 319 | input_ids listlengths 502 502 | token_type_ids listlengths 502 502 | attention_mask listlengths 502 502 | labels listlengths 502 502 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
matomo-org/matomo | libs/Zend/Mime/Message.php | Zend_Mime_Message._disassembleMime | protected static function _disassembleMime($body, $boundary)
{
$start = 0;
$res = array();
// find every mime part limiter and cut out the
// string before it.
// the part before the first boundary string is discarded:
$p = strpos($body, '--'.$boundary."\n", $start);
... | php | protected static function _disassembleMime($body, $boundary)
{
$start = 0;
$res = array();
// find every mime part limiter and cut out the
// string before it.
// the part before the first boundary string is discarded:
$p = strpos($body, '--'.$boundary."\n", $start);
... | [
"protected",
"static",
"function",
"_disassembleMime",
"(",
"$",
"body",
",",
"$",
"boundary",
")",
"{",
"$",
"start",
"=",
"0",
";",
"$",
"res",
"=",
"array",
"(",
")",
";",
"// find every mime part limiter and cut out the",
"// string before it.",
"// the part b... | Explode MIME multipart string into seperate parts
Parts consist of the header and the body of each MIME part.
@param string $body
@param string $boundary
@return array | [
"Explode",
"MIME",
"multipart",
"string",
"into",
"seperate",
"parts"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mime/Message.php#L202-L232 | train | Disassemble the MIME part of the message | [
30522,
5123,
10763,
3853,
1035,
4487,
20939,
3366,
19661,
4328,
4168,
1006,
1002,
2303,
1010,
1002,
6192,
1007,
1063,
1002,
2707,
1027,
1014,
1025,
1002,
24501,
1027,
9140,
1006,
1007,
1025,
1013,
1013,
2424,
2296,
2771,
4168,
2112,
5787,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
opencart/opencart | upload/admin/controller/event/statistics.php | ControllerEventStatistics.deleteReview | public function deleteReview(&$route, &$args, &$output) {
$this->load->model('report/statistics');
$this->model_report_statistics->removeValue('review', 1);
} | php | public function deleteReview(&$route, &$args, &$output) {
$this->load->model('report/statistics');
$this->model_report_statistics->removeValue('review', 1);
} | [
"public",
"function",
"deleteReview",
"(",
"&",
"$",
"route",
",",
"&",
"$",
"args",
",",
"&",
"$",
"output",
")",
"{",
"$",
"this",
"->",
"load",
"->",
"model",
"(",
"'report/statistics'",
")",
";",
"$",
"this",
"->",
"model_report_statistics",
"->",
... | admin/model/catalog/review/deleteReview/after | [
"admin",
"/",
"model",
"/",
"catalog",
"/",
"review",
"/",
"deleteReview",
"/",
"after"
] | e7933b56ba05aafb3655c6b490c9733cd18b5c69 | https://github.com/opencart/opencart/blob/e7933b56ba05aafb3655c6b490c9733cd18b5c69/upload/admin/controller/event/statistics.php#L11-L15 | train | Delete a review | [
30522,
2270,
3853,
3972,
15141,
6777,
2666,
2860,
1006,
1004,
1002,
2799,
1010,
1004,
1002,
12098,
5620,
1010,
1004,
1002,
6434,
1007,
1063,
1002,
2023,
1011,
1028,
7170,
1011,
1028,
2944,
1006,
1005,
3189,
1013,
6747,
1005,
1007,
1025,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/ScheduledReports/API.php | API.getReports | public function getReports($idSite = false, $period = false, $idReport = false, $ifSuperUserReturnOnlySuperUserReports = false, $idSegment = false)
{
Piwik::checkUserHasSomeViewAccess();
$cacheKey = (int)$idSite . '.' . (string)$period . '.' . (int)$idReport . '.' . (int)$ifSuperUserReturnOnlySuper... | php | public function getReports($idSite = false, $period = false, $idReport = false, $ifSuperUserReturnOnlySuperUserReports = false, $idSegment = false)
{
Piwik::checkUserHasSomeViewAccess();
$cacheKey = (int)$idSite . '.' . (string)$period . '.' . (int)$idReport . '.' . (int)$ifSuperUserReturnOnlySuper... | [
"public",
"function",
"getReports",
"(",
"$",
"idSite",
"=",
"false",
",",
"$",
"period",
"=",
"false",
",",
"$",
"idReport",
"=",
"false",
",",
"$",
"ifSuperUserReturnOnlySuperUserReports",
"=",
"false",
",",
"$",
"idSegment",
"=",
"false",
")",
"{",
"Piw... | Returns the list of reports matching the passed parameters
@param bool|int $idSite If specified, will filter reports that belong to a specific idsite
@param bool|string $period If specified, will filter reports that are scheduled for this period (day,week,month)
@param bool|int $idReport If specified, will filter the ... | [
"Returns",
"the",
"list",
"of",
"reports",
"matching",
"the",
"passed",
"parameters"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/ScheduledReports/API.php#L220-L293 | train | Get all reports from the database | [
30522,
2270,
3853,
2131,
2890,
25378,
1006,
1002,
8909,
28032,
2063,
1027,
6270,
1010,
1002,
2558,
1027,
6270,
1010,
1002,
8909,
2890,
6442,
1027,
6270,
1010,
1002,
2065,
6342,
4842,
20330,
13465,
14287,
2239,
2135,
6342,
4842,
20330,
2890,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Security/Core/Authentication/Provider/DaoAuthenticationProvider.php | DaoAuthenticationProvider.checkAuthentication | protected function checkAuthentication(UserInterface $user, UsernamePasswordToken $token)
{
$currentUser = $token->getUser();
if ($currentUser instanceof UserInterface) {
if ($currentUser->getPassword() !== $user->getPassword()) {
throw new BadCredentialsException('The cr... | php | protected function checkAuthentication(UserInterface $user, UsernamePasswordToken $token)
{
$currentUser = $token->getUser();
if ($currentUser instanceof UserInterface) {
if ($currentUser->getPassword() !== $user->getPassword()) {
throw new BadCredentialsException('The cr... | [
"protected",
"function",
"checkAuthentication",
"(",
"UserInterface",
"$",
"user",
",",
"UsernamePasswordToken",
"$",
"token",
")",
"{",
"$",
"currentUser",
"=",
"$",
"token",
"->",
"getUser",
"(",
")",
";",
"if",
"(",
"$",
"currentUser",
"instanceof",
"UserIn... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Security/Core/Authentication/Provider/DaoAuthenticationProvider.php#L45-L61 | train | Check if the user is authenticated | [
30522,
5123,
3853,
4638,
4887,
10760,
16778,
10719,
1006,
5310,
18447,
2121,
12172,
1002,
5310,
1010,
5310,
18442,
15194,
18351,
18715,
2368,
1002,
19204,
1007,
1063,
1002,
2783,
20330,
1027,
1002,
19204,
1011,
1028,
2131,
20330,
1006,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/Piwik.php | Piwik.getUnnamespacedClassName | public static function getUnnamespacedClassName($object)
{
$className = is_string($object) ? $object : get_class($object);
$parts = explode('\\', $className);
return end($parts);
} | php | public static function getUnnamespacedClassName($object)
{
$className = is_string($object) ? $object : get_class($object);
$parts = explode('\\', $className);
return end($parts);
} | [
"public",
"static",
"function",
"getUnnamespacedClassName",
"(",
"$",
"object",
")",
"{",
"$",
"className",
"=",
"is_string",
"(",
"$",
"object",
")",
"?",
"$",
"object",
":",
"get_class",
"(",
"$",
"object",
")",
";",
"$",
"parts",
"=",
"explode",
"(",
... | Returns the class name of an object without its namespace.
@param mixed|string $object
@return string | [
"Returns",
"the",
"class",
"name",
"of",
"an",
"object",
"without",
"its",
"namespace",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Piwik.php#L760-L765 | train | Get the unnamespaced class name of an object | [
30522,
2270,
10763,
3853,
2131,
4609,
18442,
23058,
16409,
27102,
18442,
1006,
1002,
4874,
1007,
1063,
1002,
2465,
18442,
1027,
2003,
1035,
5164,
1006,
1002,
4874,
1007,
1029,
1002,
4874,
1024,
2131,
1035,
2465,
1006,
1002,
4874,
1007,
1025... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/cms/classes/PartialStack.php | PartialStack.findComponentFromStack | protected function findComponentFromStack($name, $stack)
{
foreach ($stack['components'] as $componentInfo) {
if ($componentInfo['name'] == $name) {
return $componentInfo['obj'];
}
}
return null;
} | php | protected function findComponentFromStack($name, $stack)
{
foreach ($stack['components'] as $componentInfo) {
if ($componentInfo['name'] == $name) {
return $componentInfo['obj'];
}
}
return null;
} | [
"protected",
"function",
"findComponentFromStack",
"(",
"$",
"name",
",",
"$",
"stack",
")",
"{",
"foreach",
"(",
"$",
"stack",
"[",
"'components'",
"]",
"as",
"$",
"componentInfo",
")",
"{",
"if",
"(",
"$",
"componentInfo",
"[",
"'name'",
"]",
"==",
"$"... | Locates a component by its alias from the supplied stack. | [
"Locates",
"a",
"component",
"by",
"its",
"alias",
"from",
"the",
"supplied",
"stack",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/PartialStack.php#L83-L92 | train | Find a component from the stack | [
30522,
5123,
3853,
2424,
9006,
29513,
3372,
19699,
22225,
2696,
3600,
1006,
1002,
2171,
1010,
1002,
9991,
1007,
1063,
18921,
6776,
1006,
1002,
9991,
1031,
1005,
6177,
1005,
1033,
2004,
1002,
6922,
2378,
14876,
1007,
1063,
2065,
1006,
1002,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Common/Scheduler/Job.php | Job.isOverlapping | public function isOverlapping()
{
return $this->lockFile &&
file_exists($this->lockFile) &&
call_user_func($this->whenOverlapping, filemtime($this->lockFile)) === false;
} | php | public function isOverlapping()
{
return $this->lockFile &&
file_exists($this->lockFile) &&
call_user_func($this->whenOverlapping, filemtime($this->lockFile)) === false;
} | [
"public",
"function",
"isOverlapping",
"(",
")",
"{",
"return",
"$",
"this",
"->",
"lockFile",
"&&",
"file_exists",
"(",
"$",
"this",
"->",
"lockFile",
")",
"&&",
"call_user_func",
"(",
"$",
"this",
"->",
"whenOverlapping",
",",
"filemtime",
"(",
"$",
"thi... | Check if the Job is overlapping.
@return bool | [
"Check",
"if",
"the",
"Job",
"is",
"overlapping",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Scheduler/Job.php#L168-L173 | train | Check if the file is overlapping | [
30522,
2270,
3853,
11163,
6299,
2721,
14853,
1006,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
5843,
8873,
2571,
1004,
1004,
5371,
1035,
6526,
1006,
1002,
2023,
1011,
1028,
5843,
8873,
2571,
1007,
1004,
1004,
2655,
1035,
5310,
1035,
4569,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
z-song/laravel-admin | src/Grid/Filter/Group.php | Group.initialize | protected function initialize()
{
$this->id = $this->formatId($this->column);
$this->group = new Collection();
$this->name = "{$this->id}-filter-group";
$this->setupDefaultPresenter();
} | php | protected function initialize()
{
$this->id = $this->formatId($this->column);
$this->group = new Collection();
$this->name = "{$this->id}-filter-group";
$this->setupDefaultPresenter();
} | [
"protected",
"function",
"initialize",
"(",
")",
"{",
"$",
"this",
"->",
"id",
"=",
"$",
"this",
"->",
"formatId",
"(",
"$",
"this",
"->",
"column",
")",
";",
"$",
"this",
"->",
"group",
"=",
"new",
"Collection",
"(",
")",
";",
"$",
"this",
"->",
... | Initialize a group filter. | [
"Initialize",
"a",
"group",
"filter",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Grid/Filter/Group.php#L53-L60 | train | Initialize the filter | [
30522,
5123,
3853,
3988,
4697,
1006,
1007,
1063,
1002,
2023,
1011,
1028,
8909,
1027,
1002,
2023,
1011,
1028,
4289,
3593,
1006,
1002,
2023,
1011,
1028,
5930,
1007,
1025,
1002,
2023,
1011,
1028,
2177,
1027,
2047,
3074,
1006,
1007,
1025,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
z-song/laravel-admin | src/Grid/Column.php | Column.bindOriginalRowModel | protected function bindOriginalRowModel(Closure $callback, $key)
{
$rowModel = static::$originalGridModels[$key];
return $callback->bindTo($rowModel);
} | php | protected function bindOriginalRowModel(Closure $callback, $key)
{
$rowModel = static::$originalGridModels[$key];
return $callback->bindTo($rowModel);
} | [
"protected",
"function",
"bindOriginalRowModel",
"(",
"Closure",
"$",
"callback",
",",
"$",
"key",
")",
"{",
"$",
"rowModel",
"=",
"static",
"::",
"$",
"originalGridModels",
"[",
"$",
"key",
"]",
";",
"return",
"$",
"callback",
"->",
"bindTo",
"(",
"$",
... | Set original grid data to column.
@param Closure $callback
@param int $key
@return Closure | [
"Set",
"original",
"grid",
"data",
"to",
"column",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Grid/Column.php#L453-L458 | train | Bind original row model to the callback | [
30522,
5123,
3853,
14187,
10050,
24965,
10524,
5302,
9247,
1006,
8503,
1002,
2655,
5963,
1010,
1002,
3145,
1007,
1063,
1002,
5216,
5302,
9247,
1027,
10763,
1024,
1024,
1002,
2434,
16523,
3593,
5302,
9247,
2015,
1031,
1002,
3145,
1033,
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... |
getgrav/grav | system/src/Grav/Common/User/FlexUser/UserCollection.php | UserCollection.load | public function load($username): UserInterface
{
if ($username !== '') {
$key = mb_strtolower($username);
$user = $this->get($key);
if ($user) {
return $user;
}
} else {
$key = '';
}
$directory = $this->getF... | php | public function load($username): UserInterface
{
if ($username !== '') {
$key = mb_strtolower($username);
$user = $this->get($key);
if ($user) {
return $user;
}
} else {
$key = '';
}
$directory = $this->getF... | [
"public",
"function",
"load",
"(",
"$",
"username",
")",
":",
"UserInterface",
"{",
"if",
"(",
"$",
"username",
"!==",
"''",
")",
"{",
"$",
"key",
"=",
"mb_strtolower",
"(",
"$",
"username",
")",
";",
"$",
"user",
"=",
"$",
"this",
"->",
"get",
"("... | Load user account.
Always creates user object. To check if user exists, use $this->exists().
@param string $username
@return User | [
"Load",
"user",
"account",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/User/FlexUser/UserCollection.php#L27-L51 | train | Load user by username | [
30522,
2270,
3853,
7170,
1006,
1002,
5310,
18442,
1007,
1024,
5310,
18447,
2121,
12172,
1063,
2065,
1006,
1002,
5310,
18442,
999,
1027,
1027,
1005,
1005,
1007,
1063,
1002,
3145,
1027,
16914,
1035,
2358,
5339,
12898,
13777,
1006,
1002,
5310,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/GeoIp2/GeoIP2AutoUpdater.php | GeoIP2AutoUpdater.update | public function update()
{
try {
Option::set(self::LAST_RUN_TIME_OPTION_NAME, Date::factory('today')->getTimestamp());
$locUrl = Option::get(self::LOC_URL_OPTION_NAME);
if (!empty($locUrl)) {
$this->downloadFile('loc', $locUrl);
}
... | php | public function update()
{
try {
Option::set(self::LAST_RUN_TIME_OPTION_NAME, Date::factory('today')->getTimestamp());
$locUrl = Option::get(self::LOC_URL_OPTION_NAME);
if (!empty($locUrl)) {
$this->downloadFile('loc', $locUrl);
}
... | [
"public",
"function",
"update",
"(",
")",
"{",
"try",
"{",
"Option",
"::",
"set",
"(",
"self",
"::",
"LAST_RUN_TIME_OPTION_NAME",
",",
"Date",
"::",
"factory",
"(",
"'today'",
")",
"->",
"getTimestamp",
"(",
")",
")",
";",
"$",
"locUrl",
"=",
"Option",
... | Attempts to download new location & ISP GeoIP databases and
replace the existing ones w/ them. | [
"Attempts",
"to",
"download",
"new",
"location",
"&",
"ISP",
"GeoIP",
"databases",
"and",
"replace",
"the",
"existing",
"ones",
"w",
"/",
"them",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/GeoIp2/GeoIP2AutoUpdater.php#L87-L109 | train | Update the database | [
30522,
2270,
3853,
10651,
1006,
1007,
1063,
3046,
1063,
5724,
1024,
1024,
2275,
1006,
2969,
1024,
1024,
2197,
1035,
2448,
1035,
2051,
1035,
5724,
1035,
2171,
1010,
3058,
1024,
1024,
4713,
1006,
1005,
2651,
1005,
1007,
1011,
1028,
2131,
72... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/system/classes/CombineAssets.php | CombineAssets.getTargetPath | protected function getTargetPath($path = null)
{
if ($path === null) {
$baseUri = substr(Request::getBaseUrl(), strlen(Request::getBasePath()));
$path = $baseUri.'/combine';
}
if (strpos($path, '/') === 0) {
$path = substr($path, 1);
}
$p... | php | protected function getTargetPath($path = null)
{
if ($path === null) {
$baseUri = substr(Request::getBaseUrl(), strlen(Request::getBasePath()));
$path = $baseUri.'/combine';
}
if (strpos($path, '/') === 0) {
$path = substr($path, 1);
}
$p... | [
"protected",
"function",
"getTargetPath",
"(",
"$",
"path",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"path",
"===",
"null",
")",
"{",
"$",
"baseUri",
"=",
"substr",
"(",
"Request",
"::",
"getBaseUrl",
"(",
")",
",",
"strlen",
"(",
"Request",
"::",
"get... | Returns the target path for use with the combiner. The target
path helps generate relative links within CSS.
/combine returns combine/
/index.php/combine returns index-php/combine/
@param string|null $path
@return string The new target path | [
"Returns",
"the",
"target",
"path",
"for",
"use",
"with",
"the",
"combiner",
".",
"The",
"target",
"path",
"helps",
"generate",
"relative",
"links",
"within",
"CSS",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/CombineAssets.php#L517-L530 | train | Get Target Path | [
30522,
5123,
3853,
2131,
7559,
18150,
15069,
1006,
1002,
4130,
1027,
19701,
1007,
1063,
2065,
1006,
1002,
4130,
1027,
1027,
1027,
19701,
1007,
1063,
1002,
2918,
9496,
1027,
4942,
3367,
2099,
1006,
5227,
1024,
1024,
2131,
15058,
3126,
30524,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Validator/Constraints/DateTimeValidator.php | DateTimeValidator.validate | public function validate($value, Constraint $constraint)
{
if (!$constraint instanceof DateTime) {
throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\DateTime');
}
if (null === $value || '' === $value) {
return;
}
if ($value instanceof \D... | php | public function validate($value, Constraint $constraint)
{
if (!$constraint instanceof DateTime) {
throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\DateTime');
}
if (null === $value || '' === $value) {
return;
}
if ($value instanceof \D... | [
"public",
"function",
"validate",
"(",
"$",
"value",
",",
"Constraint",
"$",
"constraint",
")",
"{",
"if",
"(",
"!",
"$",
"constraint",
"instanceof",
"DateTime",
")",
"{",
"throw",
"new",
"UnexpectedTypeException",
"(",
"$",
"constraint",
",",
"__NAMESPACE__",... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Validator/Constraints/DateTimeValidator.php#L27-L80 | train | Validates a DateTime value with the current locale | [
30522,
2270,
3853,
9398,
3686,
1006,
1002,
3643,
1010,
27142,
1002,
27142,
1007,
1063,
2065,
1006,
999,
1002,
27142,
6013,
11253,
3058,
7292,
1007,
1063,
5466,
2047,
9223,
13874,
10288,
24422,
1006,
1002,
27142,
1010,
1035,
1035,
3415,
1532... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/PropertyAccess/PropertyPath.php | PropertyPath.getElement | public function getElement($index)
{
if (!isset($this->elements[$index])) {
throw new OutOfBoundsException(sprintf('The index %s is not within the property path', $index));
}
return $this->elements[$index];
} | php | public function getElement($index)
{
if (!isset($this->elements[$index])) {
throw new OutOfBoundsException(sprintf('The index %s is not within the property path', $index));
}
return $this->elements[$index];
} | [
"public",
"function",
"getElement",
"(",
"$",
"index",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"elements",
"[",
"$",
"index",
"]",
")",
")",
"{",
"throw",
"new",
"OutOfBoundsException",
"(",
"sprintf",
"(",
"'The index %s is not within t... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/PropertyAccess/PropertyPath.php#L173-L180 | train | Returns the element at the given index | [
30522,
2270,
3853,
2131,
12260,
3672,
1006,
1002,
5950,
1007,
1063,
2065,
1006,
999,
26354,
3388,
1006,
1002,
2023,
1011,
1028,
3787,
1031,
1002,
5950,
1033,
1007,
1007,
1063,
5466,
2047,
2041,
11253,
15494,
3366,
2595,
24422,
1006,
9043,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
php-ai/php-ml | src/Helper/Optimizer/ConjugateGradient.php | ConjugateGradient.getNewTheta | protected function getNewTheta(float $alpha, array $d): array
{
return MP::add($this->theta, MP::muls($d, $alpha));
} | php | protected function getNewTheta(float $alpha, array $d): array
{
return MP::add($this->theta, MP::muls($d, $alpha));
} | [
"protected",
"function",
"getNewTheta",
"(",
"float",
"$",
"alpha",
",",
"array",
"$",
"d",
")",
":",
"array",
"{",
"return",
"MP",
"::",
"add",
"(",
"$",
"this",
"->",
"theta",
",",
"MP",
"::",
"muls",
"(",
"$",
"d",
",",
"$",
"alpha",
")",
")",... | Calculates new set of solutions with given alpha (for each θ(k)) and
gradient direction.
θ(k+1) = θ(k) + α.d | [
"Calculates",
"new",
"set",
"of",
"solutions",
"with",
"given",
"alpha",
"(",
"for",
"each",
"θ",
"(",
"k",
"))",
"and",
"gradient",
"direction",
"."
] | f6aa1a59b0525b8fca3d2786d661ab3e70904016 | https://github.com/php-ai/php-ml/blob/f6aa1a59b0525b8fca3d2786d661ab3e70904016/src/Helper/Optimizer/ConjugateGradient.php#L164-L167 | train | Returns new theta | [
30522,
5123,
3853,
2131,
2638,
26677,
27065,
2050,
1006,
14257,
1002,
6541,
1010,
9140,
1002,
1040,
1007,
1024,
9140,
1063,
2709,
6131,
1024,
1024,
5587,
1006,
1002,
2023,
1011,
1028,
23963,
1010,
6131,
1024,
1024,
14163,
4877,
1006,
1002,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/Common.php | Common.extractLanguageAndRegionCodeFromBrowserLanguage | public static function extractLanguageAndRegionCodeFromBrowserLanguage($browserLanguage, $validLanguages = array())
{
$validLanguages = self::checkValidLanguagesIsSet($validLanguages);
if (!preg_match_all('/(?:^|,)([a-z]{2,3})([-][a-z]{2})?/', $browserLanguage, $matches, PREG_SET_ORDER)) {
... | php | public static function extractLanguageAndRegionCodeFromBrowserLanguage($browserLanguage, $validLanguages = array())
{
$validLanguages = self::checkValidLanguagesIsSet($validLanguages);
if (!preg_match_all('/(?:^|,)([a-z]{2,3})([-][a-z]{2})?/', $browserLanguage, $matches, PREG_SET_ORDER)) {
... | [
"public",
"static",
"function",
"extractLanguageAndRegionCodeFromBrowserLanguage",
"(",
"$",
"browserLanguage",
",",
"$",
"validLanguages",
"=",
"array",
"(",
")",
")",
"{",
"$",
"validLanguages",
"=",
"self",
"::",
"checkValidLanguagesIsSet",
"(",
"$",
"validLanguage... | Returns the language and region string, based only on the Browser 'accepted language' information.
* The language tag is defined by ISO 639-1
* The region tag is defined by ISO 3166-1
@param string $browserLanguage Browser's accepted langauge header
@param array $validLanguages array of valid language codes. Note that... | [
"Returns",
"the",
"language",
"and",
"region",
"string",
"based",
"only",
"on",
"the",
"Browser",
"accepted",
"language",
"information",
".",
"*",
"The",
"language",
"tag",
"is",
"defined",
"by",
"ISO",
"639",
"-",
"1",
"*",
"The",
"region",
"tag",
"is",
... | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Common.php#L1033-L1064 | train | Extract language and region code from browser language | [
30522,
2270,
10763,
3853,
14817,
25023,
6692,
3351,
5685,
23784,
16044,
19699,
5358,
12618,
9333,
2121,
25023,
6692,
3351,
1006,
1002,
16602,
25023,
6692,
3351,
1010,
1002,
9398,
25023,
6692,
8449,
1027,
9140,
1006,
1007,
1007,
1063,
1002,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/CoreHome/DataTableRowAction/MultiRowEvolution.php | MultiRowEvolution.renderPopover | public function renderPopover($controller, $view)
{
// add data for metric select box
$view->availableMetrics = $this->metricsForSelect;
$view->selectedMetric = $this->metric;
$view->availableRecordsText = $this->dimension . ': '
. Piwik::translate('RowEvolution_Comparin... | php | public function renderPopover($controller, $view)
{
// add data for metric select box
$view->availableMetrics = $this->metricsForSelect;
$view->selectedMetric = $this->metric;
$view->availableRecordsText = $this->dimension . ': '
. Piwik::translate('RowEvolution_Comparin... | [
"public",
"function",
"renderPopover",
"(",
"$",
"controller",
",",
"$",
"view",
")",
"{",
"// add data for metric select box",
"$",
"view",
"->",
"availableMetrics",
"=",
"$",
"this",
"->",
"metricsForSelect",
";",
"$",
"view",
"->",
"selectedMetric",
"=",
"$",... | Render the popover
@param \Piwik\Plugins\CoreHome\Controller $controller
@param View (the popover_rowevolution template) | [
"Render",
"the",
"popover"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/CoreHome/DataTableRowAction/MultiRowEvolution.php#L60-L70 | train | This method is called by the parent class to render the popover. | [
30522,
2270,
3853,
17552,
16340,
7840,
1006,
1002,
11486,
1010,
1002,
3193,
1007,
1063,
1013,
1013,
5587,
2951,
2005,
12046,
7276,
3482,
1002,
3193,
1011,
1028,
2800,
12589,
2015,
1027,
1002,
2023,
1011,
1028,
12046,
22747,
5668,
12260,
659... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Common2.php | HTML_Common2.parseAttributes | protected static function parseAttributes($attrString)
{
$attributes = array();
if (preg_match_all(
"/(([A-Za-z_:]|[^\\x00-\\x7F])([A-Za-z0-9_:.-]|[^\\x00-\\x7F])*)" .
"([ \\n\\t\\r]+)?(=([ \\n\\t\\r]+)?(\"[^\"]*\"|'[^']*'|[^ \\n\\t\\r]*))?/",
$attrStr... | php | protected static function parseAttributes($attrString)
{
$attributes = array();
if (preg_match_all(
"/(([A-Za-z_:]|[^\\x00-\\x7F])([A-Za-z0-9_:.-]|[^\\x00-\\x7F])*)" .
"([ \\n\\t\\r]+)?(=([ \\n\\t\\r]+)?(\"[^\"]*\"|'[^']*'|[^ \\n\\t\\r]*))?/",
$attrStr... | [
"protected",
"static",
"function",
"parseAttributes",
"(",
"$",
"attrString",
")",
"{",
"$",
"attributes",
"=",
"array",
"(",
")",
";",
"if",
"(",
"preg_match_all",
"(",
"\"/(([A-Za-z_:]|[^\\\\x00-\\\\x7F])([A-Za-z0-9_:.-]|[^\\\\x00-\\\\x7F])*)\"",
".",
"\"([ \\\\n\\\\t\\... | Parses the HTML attributes given as string
@param string HTML attribute string
@return array An associative aray of attributes | [
"Parses",
"the",
"HTML",
"attributes",
"given",
"as",
"string"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/Common2.php#L145-L169 | train | Parse attributes from string | [
30522,
5123,
10763,
3853,
11968,
17310,
4779,
3089,
8569,
4570,
1006,
1002,
2012,
16344,
3367,
4892,
1007,
1063,
1002,
12332,
1027,
9140,
1006,
1007,
1025,
2065,
1006,
3653,
2290,
1035,
2674,
1035,
2035,
1006,
1000,
1013,
1006,
1006,
1031,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/View/Factory.php | Factory.viewInstance | protected function viewInstance($view, $path, $data)
{
return new View($this, $this->getEngineFromPath($path), $view, $path, $data);
} | php | protected function viewInstance($view, $path, $data)
{
return new View($this, $this->getEngineFromPath($path), $view, $path, $data);
} | [
"protected",
"function",
"viewInstance",
"(",
"$",
"view",
",",
"$",
"path",
",",
"$",
"data",
")",
"{",
"return",
"new",
"View",
"(",
"$",
"this",
",",
"$",
"this",
"->",
"getEngineFromPath",
"(",
"$",
"path",
")",
",",
"$",
"view",
",",
"$",
"pat... | Create a new view instance from the given arguments.
@param string $view
@param string $path
@param \Illuminate\Contracts\Support\Arrayable|array $data
@return \Illuminate\Contracts\View\View | [
"Create",
"a",
"new",
"view",
"instance",
"from",
"the",
"given",
"arguments",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/View/Factory.php#L250-L253 | train | Create a view instance from a view name and a view path | [
30522,
5123,
3853,
3193,
7076,
26897,
1006,
1002,
3193,
1010,
1002,
4130,
1010,
1002,
2951,
1007,
1063,
2709,
2047,
3193,
1006,
1002,
2023,
1010,
1002,
2023,
1011,
1028,
2131,
13159,
3170,
19699,
25377,
8988,
1006,
1002,
4130,
1007,
1010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Security/Http/AccessMap.php | AccessMap.getPatterns | public function getPatterns(Request $request)
{
foreach ($this->map as $elements) {
if (null === $elements[0] || $elements[0]->matches($request)) {
return [$elements[1], $elements[2]];
}
}
return [null, null];
} | php | public function getPatterns(Request $request)
{
foreach ($this->map as $elements) {
if (null === $elements[0] || $elements[0]->matches($request)) {
return [$elements[1], $elements[2]];
}
}
return [null, null];
} | [
"public",
"function",
"getPatterns",
"(",
"Request",
"$",
"request",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"map",
"as",
"$",
"elements",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"elements",
"[",
"0",
"]",
"||",
"$",
"elements",
"[",
"0",
"]"... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Security/Http/AccessMap.php#L40-L49 | train | Get the patterns that match the request | [
30522,
2270,
3853,
2131,
4502,
12079,
3619,
1006,
5227,
1002,
5227,
1007,
1063,
18921,
6776,
1006,
1002,
2023,
1011,
1028,
4949,
2004,
1002,
3787,
1007,
1063,
2065,
1006,
19701,
1027,
1027,
1027,
1002,
3787,
1031,
1014,
1033,
1064,
1064,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Cache/Traits/AbstractAdapterTrait.php | AbstractAdapterTrait.getItems | public function getItems(array $keys = [])
{
if ($this->deferred) {
$this->commit();
}
$ids = [];
foreach ($keys as $key) {
$ids[] = $this->getId($key);
}
try {
$items = $this->doFetch($ids);
} catch (\Exception $e) {
... | php | public function getItems(array $keys = [])
{
if ($this->deferred) {
$this->commit();
}
$ids = [];
foreach ($keys as $key) {
$ids[] = $this->getId($key);
}
try {
$items = $this->doFetch($ids);
} catch (\Exception $e) {
... | [
"public",
"function",
"getItems",
"(",
"array",
"$",
"keys",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"deferred",
")",
"{",
"$",
"this",
"->",
"commit",
"(",
")",
";",
"}",
"$",
"ids",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"k... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Cache/Traits/AbstractAdapterTrait.php#L64-L83 | train | Get items from cache | [
30522,
2270,
3853,
2131,
4221,
5244,
1006,
9140,
1002,
6309,
1027,
1031,
1033,
1007,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
13366,
28849,
2094,
1007,
1063,
1002,
2023,
1011,
1028,
10797,
1006,
1007,
1025,
1065,
1002,
8909,
2015,
1027,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/Zend/Validate/Ip.php | Zend_Validate_Ip._validateIPv4 | protected function _validateIPv4($value) {
$ip2long = ip2long($value);
if($ip2long === false) {
return false;
}
return $value == long2ip($ip2long);
} | php | protected function _validateIPv4($value) {
$ip2long = ip2long($value);
if($ip2long === false) {
return false;
}
return $value == long2ip($ip2long);
} | [
"protected",
"function",
"_validateIPv4",
"(",
"$",
"value",
")",
"{",
"$",
"ip2long",
"=",
"ip2long",
"(",
"$",
"value",
")",
";",
"if",
"(",
"$",
"ip2long",
"===",
"false",
")",
"{",
"return",
"false",
";",
"}",
"return",
"$",
"value",
"==",
"long2... | Validates an IPv4 address
@param string $value | [
"Validates",
"an",
"IPv4",
"address"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Validate/Ip.php#L145-L152 | train | Validate IPv4 address | [
30522,
5123,
3853,
1035,
9398,
3686,
11514,
2615,
2549,
1006,
1002,
3643,
1007,
1063,
1002,
12997,
2475,
10052,
1027,
12997,
2475,
10052,
1006,
1002,
3643,
1007,
1025,
2065,
1006,
1002,
12997,
2475,
10052,
1027,
1027,
1027,
6270,
1007,
1063... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Bridge/Doctrine/Messenger/DoctrinePingConnectionMiddleware.php | DoctrinePingConnectionMiddleware.handle | public function handle(Envelope $envelope, StackInterface $stack): Envelope
{
$entityManager = $this->managerRegistry->getManager($this->entityManagerName);
if (!$entityManager instanceof EntityManagerInterface) {
throw new \InvalidArgumentException(sprintf('The ObjectManager with name ... | php | public function handle(Envelope $envelope, StackInterface $stack): Envelope
{
$entityManager = $this->managerRegistry->getManager($this->entityManagerName);
if (!$entityManager instanceof EntityManagerInterface) {
throw new \InvalidArgumentException(sprintf('The ObjectManager with name ... | [
"public",
"function",
"handle",
"(",
"Envelope",
"$",
"envelope",
",",
"StackInterface",
"$",
"stack",
")",
":",
"Envelope",
"{",
"$",
"entityManager",
"=",
"$",
"this",
"->",
"managerRegistry",
"->",
"getManager",
"(",
"$",
"this",
"->",
"entityManagerName",
... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bridge/Doctrine/Messenger/DoctrinePingConnectionMiddleware.php#L41-L61 | train | Handle the next message | [
30522,
2270,
3853,
5047,
1006,
11255,
1002,
11255,
1010,
9991,
18447,
2121,
12172,
1002,
9991,
1007,
1024,
11255,
1063,
1002,
9178,
24805,
4590,
1027,
1002,
2023,
1011,
1028,
3208,
2890,
24063,
2854,
1011,
1028,
2131,
24805,
4590,
1006,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/system/classes/PluginManager.php | PluginManager.getPluginPath | public function getPluginPath($id)
{
$classId = $this->getIdentifier($id);
if (!isset($this->pathMap[$classId])) {
return null;
}
return File::normalizePath($this->pathMap[$classId]);
} | php | public function getPluginPath($id)
{
$classId = $this->getIdentifier($id);
if (!isset($this->pathMap[$classId])) {
return null;
}
return File::normalizePath($this->pathMap[$classId]);
} | [
"public",
"function",
"getPluginPath",
"(",
"$",
"id",
")",
"{",
"$",
"classId",
"=",
"$",
"this",
"->",
"getIdentifier",
"(",
"$",
"id",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"pathMap",
"[",
"$",
"classId",
"]",
")",
")",
"{... | Returns the directory path to a plugin | [
"Returns",
"the",
"directory",
"path",
"to",
"a",
"plugin"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/PluginManager.php#L300-L308 | train | Get plugin path | [
30522,
2270,
3853,
2131,
24759,
15916,
2378,
15069,
1006,
1002,
8909,
1007,
1063,
1002,
2465,
3593,
1027,
1002,
2023,
1011,
1028,
2131,
5178,
16778,
8873,
2121,
1006,
1002,
8909,
1007,
1025,
2065,
1006,
999,
26354,
3388,
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/Form/ChoiceList/Factory/PropertyAccessDecorator.php | PropertyAccessDecorator.createListFromLoader | public function createListFromLoader(ChoiceLoaderInterface $loader, $value = null)
{
if (\is_string($value)) {
$value = new PropertyPath($value);
}
if ($value instanceof PropertyPath) {
$accessor = $this->propertyAccessor;
$value = function ($choice) use ... | php | public function createListFromLoader(ChoiceLoaderInterface $loader, $value = null)
{
if (\is_string($value)) {
$value = new PropertyPath($value);
}
if ($value instanceof PropertyPath) {
$accessor = $this->propertyAccessor;
$value = function ($choice) use ... | [
"public",
"function",
"createListFromLoader",
"(",
"ChoiceLoaderInterface",
"$",
"loader",
",",
"$",
"value",
"=",
"null",
")",
"{",
"if",
"(",
"\\",
"is_string",
"(",
"$",
"value",
")",
")",
"{",
"$",
"value",
"=",
"new",
"PropertyPath",
"(",
"$",
"valu... | {@inheritdoc}
@param ChoiceLoaderInterface $loader The choice loader
@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#L99-L119 | train | Create a ChoiceList from a ChoiceLoaderInterface | [
30522,
2270,
3853,
3443,
9863,
19699,
5358,
11066,
2121,
1006,
3601,
11066,
23282,
3334,
12172,
1002,
7170,
2121,
1010,
1002,
3643,
1027,
19701,
1007,
1063,
2065,
1006,
1032,
2003,
1035,
5164,
1006,
1002,
3643,
1007,
1007,
1063,
1002,
3643,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php | AssetsInstallCommand.hardCopy | private function hardCopy(string $originDir, string $targetDir): string
{
$this->filesystem->mkdir($targetDir, 0777);
// We use a custom iterator to ignore VCS files
$this->filesystem->mirror($originDir, $targetDir, Finder::create()->ignoreDotFiles(false)->in($originDir));
return se... | php | private function hardCopy(string $originDir, string $targetDir): string
{
$this->filesystem->mkdir($targetDir, 0777);
// We use a custom iterator to ignore VCS files
$this->filesystem->mirror($originDir, $targetDir, Finder::create()->ignoreDotFiles(false)->in($originDir));
return se... | [
"private",
"function",
"hardCopy",
"(",
"string",
"$",
"originDir",
",",
"string",
"$",
"targetDir",
")",
":",
"string",
"{",
"$",
"this",
"->",
"filesystem",
"->",
"mkdir",
"(",
"$",
"targetDir",
",",
"0777",
")",
";",
"// We use a custom iterator to ignore V... | Copies origin to target. | [
"Copies",
"origin",
"to",
"target",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php#L256-L263 | train | Copy the files from the origin directory to the target directory | [
30522,
2797,
3853,
2524,
3597,
7685,
1006,
5164,
1002,
4761,
4305,
2099,
1010,
5164,
1002,
4539,
4305,
2099,
1007,
1024,
5164,
1063,
1002,
2023,
1011,
1028,
6764,
27268,
6633,
1011,
1028,
12395,
4305,
2099,
1006,
1002,
4539,
4305,
2099,
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... |
dompdf/dompdf | src/Frame/FrameTree.php | FrameTree._remove_node | protected function _remove_node(DOMNode $node, array &$children, $index)
{
$child = $children[$index];
$previousChild = $child->previousSibling;
$nextChild = $child->nextSibling;
$node->removeChild($child);
if (isset($previousChild, $nextChild)) {
if ($previousChi... | php | protected function _remove_node(DOMNode $node, array &$children, $index)
{
$child = $children[$index];
$previousChild = $child->previousSibling;
$nextChild = $child->nextSibling;
$node->removeChild($child);
if (isset($previousChild, $nextChild)) {
if ($previousChi... | [
"protected",
"function",
"_remove_node",
"(",
"DOMNode",
"$",
"node",
",",
"array",
"&",
"$",
"children",
",",
"$",
"index",
")",
"{",
"$",
"child",
"=",
"$",
"children",
"[",
"$",
"index",
"]",
";",
"$",
"previousChild",
"=",
"$",
"child",
"->",
"pr... | Remove a child from a node
Remove a child from a node. If the removed node results in two
adjacent #text nodes then combine them.
@param DOMNode $node the current DOMNode being considered
@param array $children an array of nodes that are the children of $node
@param int $index index from the $children array of the no... | [
"Remove",
"a",
"child",
"from",
"a",
"node"
] | 75f13c700009be21a1965dc2c5b68a8708c22ba2 | https://github.com/dompdf/dompdf/blob/75f13c700009be21a1965dc2c5b68a8708c22ba2/src/Frame/FrameTree.php#L204-L217 | train | Remove a node from the children array | [
30522,
5123,
3853,
1035,
6366,
1035,
13045,
1006,
14383,
3630,
3207,
1002,
13045,
1010,
9140,
1004,
1002,
2336,
1010,
1002,
5950,
1007,
1063,
1002,
2775,
1027,
1002,
2336,
1031,
1002,
5950,
1033,
1025,
1002,
3025,
19339,
1027,
1002,
2775,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Concurrency/DistributedList.php | DistributedList.setAll | public function setAll($items)
{
foreach ($items as $key => &$item) {
if (is_array($item)) {
throw new \InvalidArgumentException("Array item encountered in DistributedList::setAll() [ key = $key ].");
} else {
$item = (string)$item;
}
... | php | public function setAll($items)
{
foreach ($items as $key => &$item) {
if (is_array($item)) {
throw new \InvalidArgumentException("Array item encountered in DistributedList::setAll() [ key = $key ].");
} else {
$item = (string)$item;
}
... | [
"public",
"function",
"setAll",
"(",
"$",
"items",
")",
"{",
"foreach",
"(",
"$",
"items",
"as",
"$",
"key",
"=>",
"&",
"$",
"item",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"item",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
... | Sets the contents of the list in the option table.
@param string[] $items | [
"Sets",
"the",
"contents",
"of",
"the",
"list",
"in",
"the",
"option",
"table",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Concurrency/DistributedList.php#L77-L88 | train | Set all items in the option | [
30522,
2270,
3853,
2275,
8095,
1006,
1002,
5167,
1007,
1063,
18921,
6776,
1006,
1002,
5167,
2004,
1002,
3145,
1027,
1028,
1004,
1002,
8875,
1007,
1063,
2065,
1006,
2003,
1035,
9140,
1006,
1002,
8875,
1007,
1007,
1063,
5466,
2047,
1032,
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/Relations/MorphTo.php | MorphTo.gatherKeysByType | protected function gatherKeysByType($type)
{
return collect($this->dictionary[$type])->map(function ($models) {
return head($models)->{$this->foreignKey};
})->values()->unique()->all();
} | php | protected function gatherKeysByType($type)
{
return collect($this->dictionary[$type])->map(function ($models) {
return head($models)->{$this->foreignKey};
})->values()->unique()->all();
} | [
"protected",
"function",
"gatherKeysByType",
"(",
"$",
"type",
")",
"{",
"return",
"collect",
"(",
"$",
"this",
"->",
"dictionary",
"[",
"$",
"type",
"]",
")",
"->",
"map",
"(",
"function",
"(",
"$",
"models",
")",
"{",
"return",
"head",
"(",
"$",
"m... | Gather all of the foreign keys for a given type.
@param string $type
@return array | [
"Gather",
"all",
"of",
"the",
"foreign",
"keys",
"for",
"a",
"given",
"type",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Relations/MorphTo.php#L127-L132 | train | Gather all keys by type | [
30522,
5123,
3853,
8587,
14839,
14478,
13874,
1006,
1002,
2828,
1007,
1063,
2709,
8145,
1006,
1002,
2023,
1011,
1028,
9206,
1031,
1002,
2828,
1033,
1007,
1011,
1028,
4949,
1006,
3853,
1006,
1002,
4275,
1007,
1063,
2709,
2132,
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/UserCountry/LocationProvider/GeoIp/ServerBased.php | ServerBased.isAvailable | public function isAvailable()
{
// check if apache module is installed
if (function_exists('apache_get_modules')) {
foreach (apache_get_modules() as $name) {
if (strpos($name, 'geoip') !== false) {
return true;
}
}
}... | php | public function isAvailable()
{
// check if apache module is installed
if (function_exists('apache_get_modules')) {
foreach (apache_get_modules() as $name) {
if (strpos($name, 'geoip') !== false) {
return true;
}
}
}... | [
"public",
"function",
"isAvailable",
"(",
")",
"{",
"// check if apache module is installed",
"if",
"(",
"function_exists",
"(",
"'apache_get_modules'",
")",
")",
"{",
"foreach",
"(",
"apache_get_modules",
"(",
")",
"as",
"$",
"name",
")",
"{",
"if",
"(",
"strpo... | Checks if an HTTP server module has been installed. It checks by looking for
the GEOIP_ADDR server variable.
There's a special check for the Apache module, but we can't check specifically
for anything else.
@return bool|string | [
"Checks",
"if",
"an",
"HTTP",
"server",
"module",
"has",
"been",
"installed",
".",
"It",
"checks",
"by",
"looking",
"for",
"the",
"GEOIP_ADDR",
"server",
"variable",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UserCountry/LocationProvider/GeoIp/ServerBased.php#L147-L180 | train | Check if the Apache module is available | [
30522,
2270,
3853,
18061,
3567,
11733,
3468,
1006,
1007,
1063,
1013,
1013,
4638,
2065,
15895,
11336,
2003,
5361,
2065,
1006,
3853,
1035,
6526,
1006,
1005,
15895,
1035,
2131,
1035,
14184,
1005,
1007,
1007,
30524,
2358,
14536,
2891,
1006,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Foundation/Auth/Access/AuthorizesRequests.php | AuthorizesRequests.parseAbilityAndArguments | protected function parseAbilityAndArguments($ability, $arguments)
{
if (is_string($ability) && strpos($ability, '\\') === false) {
return [$ability, $arguments];
}
$method = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 3)[2]['function'];
return [$this->normalizeGuessedA... | php | protected function parseAbilityAndArguments($ability, $arguments)
{
if (is_string($ability) && strpos($ability, '\\') === false) {
return [$ability, $arguments];
}
$method = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 3)[2]['function'];
return [$this->normalizeGuessedA... | [
"protected",
"function",
"parseAbilityAndArguments",
"(",
"$",
"ability",
",",
"$",
"arguments",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"ability",
")",
"&&",
"strpos",
"(",
"$",
"ability",
",",
"'\\\\'",
")",
"===",
"false",
")",
"{",
"return",
"[",... | Guesses the ability's name if it wasn't provided.
@param mixed $ability
@param mixed|array $arguments
@return array | [
"Guesses",
"the",
"ability",
"s",
"name",
"if",
"it",
"wasn",
"t",
"provided",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Foundation/Auth/Access/AuthorizesRequests.php#L50-L59 | train | Parse the given ability and arguments and return the result as array | [
30522,
5123,
3853,
11968,
17310,
8553,
13832,
10623,
30524,
3754,
1007,
1004,
1004,
2358,
14536,
2891,
1006,
1002,
3754,
1010,
1005,
1032,
1032,
1005,
1007,
1027,
1027,
1027,
6270,
1007,
1063,
2709,
1031,
1002,
3754,
1010,
1002,
9918,
1033,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/system/classes/MediaLibrary.php | MediaLibrary.getStorageDisk | protected function getStorageDisk()
{
if ($this->storageDisk) {
return $this->storageDisk;
}
return $this->storageDisk = Storage::disk(
Config::get('cms.storage.media.disk', 'local')
);
} | php | protected function getStorageDisk()
{
if ($this->storageDisk) {
return $this->storageDisk;
}
return $this->storageDisk = Storage::disk(
Config::get('cms.storage.media.disk', 'local')
);
} | [
"protected",
"function",
"getStorageDisk",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"storageDisk",
")",
"{",
"return",
"$",
"this",
"->",
"storageDisk",
";",
"}",
"return",
"$",
"this",
"->",
"storageDisk",
"=",
"Storage",
"::",
"disk",
"(",
"Config"... | Initializes and returns the Media Library disk.
This method should always be used instead of trying to access the
$storageDisk property directly as initializing the disc requires
communicating with the remote storage.
@return mixed Returns the storage disk object. | [
"Initializes",
"and",
"returns",
"the",
"Media",
"Library",
"disk",
".",
"This",
"method",
"should",
"always",
"be",
"used",
"instead",
"of",
"trying",
"to",
"access",
"the",
"$storageDisk",
"property",
"directly",
"as",
"initializing",
"the",
"disc",
"requires"... | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/MediaLibrary.php#L758-L767 | train | Get Storage Disk | [
30522,
5123,
3853,
4152,
4263,
18655,
20573,
1006,
1007,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
5527,
10521,
2243,
1007,
1063,
2709,
1002,
2023,
1011,
30524,
2023,
1011,
1028,
5527,
10521,
2243,
1027,
5527,
1024,
1024,
9785,
1006,
9530,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Mime/Header/AbstractHeader.php | AbstractHeader.createPhrase | protected function createPhrase(HeaderInterface $header, string $string, string $charset, bool $shorten = false): string
{
// Treat token as exactly what was given
$phraseStr = $string;
// If it's not valid
if (!preg_match('/^'.self::PHRASE_PATTERN.'$/D', $phraseStr)) {
... | php | protected function createPhrase(HeaderInterface $header, string $string, string $charset, bool $shorten = false): string
{
// Treat token as exactly what was given
$phraseStr = $string;
// If it's not valid
if (!preg_match('/^'.self::PHRASE_PATTERN.'$/D', $phraseStr)) {
... | [
"protected",
"function",
"createPhrase",
"(",
"HeaderInterface",
"$",
"header",
",",
"string",
"$",
"string",
",",
"string",
"$",
"charset",
",",
"bool",
"$",
"shorten",
"=",
"false",
")",
":",
"string",
"{",
"// Treat token as exactly what was given",
"$",
"phr... | Produces a compliant, formatted RFC 2822 'phrase' based on the string given.
@param string $string as displayed
@param bool $shorten the first line to make remove for header name | [
"Produces",
"a",
"compliant",
"formatted",
"RFC",
"2822",
"phrase",
"based",
"on",
"the",
"string",
"given",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Mime/Header/AbstractHeader.php#L90-L117 | train | Create phrase string | [
30522,
5123,
3853,
3443,
8458,
23797,
1006,
20346,
18447,
2121,
12172,
1002,
20346,
1010,
5164,
1002,
5164,
1010,
5164,
1002,
25869,
13462,
1010,
22017,
2140,
1002,
2460,
2368,
1027,
6270,
1007,
1024,
5164,
1063,
1013,
1013,
7438,
19204,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Common/Twig/Twig.php | Twig.processPage | public function processPage(PageInterface $item, $content = null)
{
$content = $content ?? $item->content();
// override the twig header vars for local resolution
$this->grav->fireEvent('onTwigPageVariables', new Event(['page' => $item]));
$twig_vars = $this->twig_vars;
$tw... | php | public function processPage(PageInterface $item, $content = null)
{
$content = $content ?? $item->content();
// override the twig header vars for local resolution
$this->grav->fireEvent('onTwigPageVariables', new Event(['page' => $item]));
$twig_vars = $this->twig_vars;
$tw... | [
"public",
"function",
"processPage",
"(",
"PageInterface",
"$",
"item",
",",
"$",
"content",
"=",
"null",
")",
"{",
"$",
"content",
"=",
"$",
"content",
"??",
"$",
"item",
"->",
"content",
"(",
")",
";",
"// override the twig header vars for local resolution",
... | Twig process that renders a page item. It supports two variations:
1) Handles modular pages by rendering a specific page based on its modular twig template
2) Renders individual page items for twig processing before the site rendering
@param PageInterface $item The page item to render
@param string $content Opt... | [
"Twig",
"process",
"that",
"renders",
"a",
"page",
"item",
".",
"It",
"supports",
"two",
"variations",
":",
"1",
")",
"Handles",
"modular",
"pages",
"by",
"rendering",
"a",
"specific",
"page",
"based",
"on",
"its",
"modular",
"twig",
"template",
"2",
")",
... | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Twig/Twig.php#L259-L296 | train | Process a page | [
30522,
2270,
3853,
2832,
13704,
1006,
3931,
18447,
2121,
12172,
1002,
8875,
1010,
1002,
4180,
1027,
19701,
1007,
1063,
1002,
4180,
1027,
1002,
4180,
1029,
1029,
1002,
8875,
1011,
1028,
4180,
1006,
1007,
1025,
1013,
1013,
2058,
15637,
1996,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Validation/Validator.php | Validator.validateAttribute | protected function validateAttribute($attribute, $rule)
{
$this->currentRule = $rule;
[$rule, $parameters] = ValidationRuleParser::parse($rule);
if ($rule == '') {
return;
}
// First we will get the correct keys for the given attribute in case the field is nest... | php | protected function validateAttribute($attribute, $rule)
{
$this->currentRule = $rule;
[$rule, $parameters] = ValidationRuleParser::parse($rule);
if ($rule == '') {
return;
}
// First we will get the correct keys for the given attribute in case the field is nest... | [
"protected",
"function",
"validateAttribute",
"(",
"$",
"attribute",
",",
"$",
"rule",
")",
"{",
"$",
"this",
"->",
"currentRule",
"=",
"$",
"rule",
";",
"[",
"$",
"rule",
",",
"$",
"parameters",
"]",
"=",
"ValidationRuleParser",
"::",
"parse",
"(",
"$",... | Validate a given attribute against a rule.
@param string $attribute
@param string $rule
@return void | [
"Validate",
"a",
"given",
"attribute",
"against",
"a",
"rule",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Validation/Validator.php#L356-L401 | train | Validate an attribute using the given rule | [
30522,
5123,
3853,
9398,
3686,
19321,
3089,
8569,
2618,
1006,
1002,
17961,
1010,
1002,
3627,
1007,
1063,
1002,
2023,
1011,
1028,
2783,
6820,
2571,
1027,
1002,
3627,
1025,
1031,
1002,
3627,
1010,
1002,
11709,
1033,
1027,
27354,
6820,
2571,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Work/OA/Client.php | Client.checkinRecords | public function checkinRecords(int $startTime, int $endTime, array $userList, int $type = 3)
{
$params = [
'opencheckindatatype' => $type,
'starttime' => $startTime,
'endtime' => $endTime,
'useridlist' => $userList,
];
return $this->httpPostJs... | php | public function checkinRecords(int $startTime, int $endTime, array $userList, int $type = 3)
{
$params = [
'opencheckindatatype' => $type,
'starttime' => $startTime,
'endtime' => $endTime,
'useridlist' => $userList,
];
return $this->httpPostJs... | [
"public",
"function",
"checkinRecords",
"(",
"int",
"$",
"startTime",
",",
"int",
"$",
"endTime",
",",
"array",
"$",
"userList",
",",
"int",
"$",
"type",
"=",
"3",
")",
"{",
"$",
"params",
"=",
"[",
"'opencheckindatatype'",
"=>",
"$",
"type",
",",
"'st... | Get the checkin data.
@param int $startTime
@param int $endTime
@param array $userList
@param int $type
@return mixed | [
"Get",
"the",
"checkin",
"data",
"."
] | 120c72faaa93c270365bc75c73c362d5fd583209 | https://github.com/overtrue/wechat/blob/120c72faaa93c270365bc75c73c362d5fd583209/src/Work/OA/Client.php#L33-L43 | train | Get checkin records | [
30522,
2270,
3853,
4638,
2378,
2890,
27108,
5104,
1006,
20014,
1002,
2707,
7292,
1010,
20014,
1002,
2203,
7292,
1010,
9140,
1002,
5310,
9863,
1010,
20014,
1002,
2828,
1027,
1017,
1007,
1063,
1002,
11498,
5244,
1027,
1031,
1005,
2330,
5403,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/NumericNode.php | NumericNode.finalizeValue | protected function finalizeValue($value)
{
$value = parent::finalizeValue($value);
$errorMsg = null;
if (isset($this->min) && $value < $this->min) {
$errorMsg = sprintf('The value %s is too small for path "%s". Should be greater than or equal to %s', $value, $this->getPath(), $t... | php | protected function finalizeValue($value)
{
$value = parent::finalizeValue($value);
$errorMsg = null;
if (isset($this->min) && $value < $this->min) {
$errorMsg = sprintf('The value %s is too small for path "%s". Should be greater than or equal to %s', $value, $this->getPath(), $t... | [
"protected",
"function",
"finalizeValue",
"(",
"$",
"value",
")",
"{",
"$",
"value",
"=",
"parent",
"::",
"finalizeValue",
"(",
"$",
"value",
")",
";",
"$",
"errorMsg",
"=",
"null",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"min",
")",
"&&",
... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Config/Definition/NumericNode.php#L36-L54 | train | Finalize value. | [
30522,
5123,
3853,
2345,
4697,
10175,
5657,
1006,
1002,
3643,
1007,
1063,
1002,
3643,
1027,
6687,
1024,
1024,
2345,
4697,
10175,
5657,
1006,
1002,
3643,
1007,
1025,
1002,
7561,
5244,
2290,
1027,
19701,
1025,
2065,
1006,
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... |
octobercms/october | modules/system/console/OctoberEnv.php | OctoberEnv.parseConfigFile | private function parseConfigFile()
{
$lines = [];
foreach ($this->lines() as $line) {
$keys = $this->config()[$this->config];
$lines[] = $this->parseLine($line, $keys);
}
$this->writeToEnv("\n");
return implode('', $lines);
} | php | private function parseConfigFile()
{
$lines = [];
foreach ($this->lines() as $line) {
$keys = $this->config()[$this->config];
$lines[] = $this->parseLine($line, $keys);
}
$this->writeToEnv("\n");
return implode('', $lines);
} | [
"private",
"function",
"parseConfigFile",
"(",
")",
"{",
"$",
"lines",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"lines",
"(",
")",
"as",
"$",
"line",
")",
"{",
"$",
"keys",
"=",
"$",
"this",
"->",
"config",
"(",
")",
"[",
"$",
"th... | Parse config file line by line
@return string | [
"Parse",
"config",
"file",
"line",
"by",
"line"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/console/OctoberEnv.php#L90-L103 | train | Parse config file and return result | [
30522,
2797,
3853,
11968,
3366,
8663,
8873,
25708,
9463,
1006,
1007,
1063,
1002,
3210,
1027,
1031,
1033,
1025,
18921,
6776,
1006,
1002,
2023,
1011,
1028,
3210,
1006,
1007,
2004,
1002,
2240,
1007,
1063,
1002,
6309,
1027,
1002,
2023,
1011,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Ldap/Adapter/ExtLdap/EntryManager.php | EntryManager.move | public function move(Entry $entry, string $newParent)
{
$con = $this->getConnectionResource();
$rdn = $this->parseRdnFromEntry($entry);
// deleteOldRdn does not matter here, since the Rdn will not be changing in the move.
if (!@ldap_rename($con, $entry->getDn(), $rdn, $newParent, tru... | php | public function move(Entry $entry, string $newParent)
{
$con = $this->getConnectionResource();
$rdn = $this->parseRdnFromEntry($entry);
// deleteOldRdn does not matter here, since the Rdn will not be changing in the move.
if (!@ldap_rename($con, $entry->getDn(), $rdn, $newParent, tru... | [
"public",
"function",
"move",
"(",
"Entry",
"$",
"entry",
",",
"string",
"$",
"newParent",
")",
"{",
"$",
"con",
"=",
"$",
"this",
"->",
"getConnectionResource",
"(",
")",
";",
"$",
"rdn",
"=",
"$",
"this",
"->",
"parseRdnFromEntry",
"(",
"$",
"entry",... | Moves an entry on the Ldap server.
@throws NotBoundException if the connection has not been previously bound
@throws LdapException if an error is thrown during the rename operation | [
"Moves",
"an",
"entry",
"on",
"the",
"Ldap",
"server",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Ldap/Adapter/ExtLdap/EntryManager.php#L119-L127 | train | Moves an entry to a new parent | [
30522,
2270,
3853,
2693,
1006,
4443,
1002,
4443,
1010,
5164,
1002,
2047,
19362,
4765,
1007,
1063,
1002,
9530,
1027,
1002,
2023,
1011,
1028,
2131,
8663,
2638,
7542,
6072,
8162,
3401,
1006,
1007,
1025,
1002,
16428,
2078,
1027,
1002,
2023,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php | BelongsToMany.performJoin | protected function performJoin($query = null)
{
$query = $query ?: $this->query;
// We need to join to the intermediate table on the related model's primary
// key column with the intermediate table's foreign key for the related
// model instance. Then we can set the "where" for the... | php | protected function performJoin($query = null)
{
$query = $query ?: $this->query;
// We need to join to the intermediate table on the related model's primary
// key column with the intermediate table's foreign key for the related
// model instance. Then we can set the "where" for the... | [
"protected",
"function",
"performJoin",
"(",
"$",
"query",
"=",
"null",
")",
"{",
"$",
"query",
"=",
"$",
"query",
"?",
":",
"$",
"this",
"->",
"query",
";",
"// We need to join to the intermediate table on the related model's primary",
"// key column with the intermedi... | Set the join clause for the relation query.
@param \Illuminate\Database\Eloquent\Builder|null $query
@return $this | [
"Set",
"the",
"join",
"clause",
"for",
"the",
"relation",
"query",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php#L199-L213 | train | Perform a join to the related table | [
30522,
5123,
3853,
4685,
5558,
2378,
1006,
1002,
23032,
1027,
19701,
1007,
1063,
1002,
23032,
1027,
30524,
1025,
1013,
1013,
2057,
2342,
2000,
3693,
2000,
1996,
7783,
2795,
2006,
1996,
3141,
2944,
1005,
1055,
3078,
1013,
1013,
3145,
5930,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Mail/Mailable.php | Mailable.queue | public function queue(Queue $queue)
{
if (isset($this->delay)) {
return $this->later($this->delay, $queue);
}
$connection = property_exists($this, 'connection') ? $this->connection : null;
$queueName = property_exists($this, 'queue') ? $this->queue : null;
retu... | php | public function queue(Queue $queue)
{
if (isset($this->delay)) {
return $this->later($this->delay, $queue);
}
$connection = property_exists($this, 'connection') ? $this->connection : null;
$queueName = property_exists($this, 'queue') ? $this->queue : null;
retu... | [
"public",
"function",
"queue",
"(",
"Queue",
"$",
"queue",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"delay",
")",
")",
"{",
"return",
"$",
"this",
"->",
"later",
"(",
"$",
"this",
"->",
"delay",
",",
"$",
"queue",
")",
";",
"}",
"$... | Queue the message for sending.
@param \Illuminate\Contracts\Queue\Factory $queue
@return mixed | [
"Queue",
"the",
"message",
"for",
"sending",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Mail/Mailable.php#L169-L182 | train | Push a message to the queue | [
30522,
2270,
3853,
24240,
1006,
24240,
1002,
24240,
1007,
1063,
2065,
1006,
26354,
3388,
1006,
1002,
2023,
1011,
1028,
8536,
1007,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
2101,
1006,
1002,
2023,
1011,
1028,
8536,
1010,
1002,
24240,
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/behaviors/FormController.php | FormController.formFindModelObject | public function formFindModelObject($recordId)
{
if (!strlen($recordId)) {
throw new ApplicationException($this->getLang('not-found-message', 'backend::lang.form.missing_id'));
}
$model = $this->controller->formCreateModelObject();
/*
* Prepare query and find m... | php | public function formFindModelObject($recordId)
{
if (!strlen($recordId)) {
throw new ApplicationException($this->getLang('not-found-message', 'backend::lang.form.missing_id'));
}
$model = $this->controller->formCreateModelObject();
/*
* Prepare query and find m... | [
"public",
"function",
"formFindModelObject",
"(",
"$",
"recordId",
")",
"{",
"if",
"(",
"!",
"strlen",
"(",
"$",
"recordId",
")",
")",
"{",
"throw",
"new",
"ApplicationException",
"(",
"$",
"this",
"->",
"getLang",
"(",
"'not-found-message'",
",",
"'backend:... | Finds a Model record by its primary identifier, used by update actions. This logic
can be changed by overriding it in the controller.
@param string $recordId
@return Model | [
"Finds",
"a",
"Model",
"record",
"by",
"its",
"primary",
"identifier",
"used",
"by",
"update",
"actions",
".",
"This",
"logic",
"can",
"be",
"changed",
"by",
"overriding",
"it",
"in",
"the",
"controller",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/behaviors/FormController.php#L747-L771 | train | Find model object by record id | [
30522,
2270,
3853,
2433,
16294,
22117,
10244,
4135,
2497,
20614,
1006,
1002,
2501,
3593,
1007,
1063,
2065,
1006,
999,
2358,
20927,
2078,
1006,
1002,
2501,
3593,
1007,
1007,
1063,
5466,
2047,
4646,
10288,
24422,
1006,
1002,
2023,
1011,
1028,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/HttpKernel/DataCollector/RouterDataCollector.php | RouterDataCollector.collect | public function collect(Request $request, Response $response, \Exception $exception = null)
{
if ($response instanceof RedirectResponse) {
$this->data['redirect'] = true;
$this->data['url'] = $response->getTargetUrl();
if ($this->controllers->contains($request)) {
... | php | public function collect(Request $request, Response $response, \Exception $exception = null)
{
if ($response instanceof RedirectResponse) {
$this->data['redirect'] = true;
$this->data['url'] = $response->getTargetUrl();
if ($this->controllers->contains($request)) {
... | [
"public",
"function",
"collect",
"(",
"Request",
"$",
"request",
",",
"Response",
"$",
"response",
",",
"\\",
"Exception",
"$",
"exception",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"response",
"instanceof",
"RedirectResponse",
")",
"{",
"$",
"this",
"->",
... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpKernel/DataCollector/RouterDataCollector.php#L37-L49 | train | Collects data for the request and response | [
30522,
2270,
3853,
8145,
1006,
5227,
1002,
5227,
1010,
3433,
1002,
3433,
1010,
1032,
6453,
1002,
6453,
1027,
19701,
1007,
1063,
2065,
1006,
1002,
3433,
6013,
11253,
2417,
7442,
6593,
6072,
26029,
3366,
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... |
symfony/symfony | src/Symfony/Component/Security/Core/Authorization/Voter/ExpressionVoter.php | ExpressionVoter.vote | public function vote(TokenInterface $token, $subject, array $attributes)
{
$result = VoterInterface::ACCESS_ABSTAIN;
$variables = null;
foreach ($attributes as $attribute) {
if (!$attribute instanceof Expression) {
continue;
}
if (null ===... | php | public function vote(TokenInterface $token, $subject, array $attributes)
{
$result = VoterInterface::ACCESS_ABSTAIN;
$variables = null;
foreach ($attributes as $attribute) {
if (!$attribute instanceof Expression) {
continue;
}
if (null ===... | [
"public",
"function",
"vote",
"(",
"TokenInterface",
"$",
"token",
",",
"$",
"subject",
",",
"array",
"$",
"attributes",
")",
"{",
"$",
"result",
"=",
"VoterInterface",
"::",
"ACCESS_ABSTAIN",
";",
"$",
"variables",
"=",
"null",
";",
"foreach",
"(",
"$",
... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Security/Core/Authorization/Voter/ExpressionVoter.php#L74-L94 | train | Vote for the subject and attributes | [
30522,
2270,
3853,
3789,
1006,
19204,
18447,
2121,
12172,
1002,
19204,
1010,
1002,
3395,
1010,
9140,
1002,
12332,
1007,
1063,
1002,
2765,
1027,
14303,
18447,
2121,
12172,
1024,
1024,
3229,
1035,
14689,
18249,
1025,
1002,
10857,
1027,
19701,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
opencart/opencart | upload/catalog/controller/event/activity.php | ControllerEventActivity.editCustomer | public function editCustomer(&$route, &$args, &$output) {
if ($this->config->get('config_customer_activity')) {
$this->load->model('account/activity');
$activity_data = array(
'customer_id' => $this->customer->getId(),
'name' => $this->customer->getFirstName() . ' ' . $this->customer->getLastNam... | php | public function editCustomer(&$route, &$args, &$output) {
if ($this->config->get('config_customer_activity')) {
$this->load->model('account/activity');
$activity_data = array(
'customer_id' => $this->customer->getId(),
'name' => $this->customer->getFirstName() . ' ' . $this->customer->getLastNam... | [
"public",
"function",
"editCustomer",
"(",
"&",
"$",
"route",
",",
"&",
"$",
"args",
",",
"&",
"$",
"output",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"config",
"->",
"get",
"(",
"'config_customer_activity'",
")",
")",
"{",
"$",
"this",
"->",
"load",
... | catalog/model/account/customer/editCustomer/after | [
"catalog",
"/",
"model",
"/",
"account",
"/",
"customer",
"/",
"editCustomer",
"/",
"after"
] | e7933b56ba05aafb3655c6b490c9733cd18b5c69 | https://github.com/opencart/opencart/blob/e7933b56ba05aafb3655c6b490c9733cd18b5c69/upload/catalog/controller/event/activity.php#L18-L29 | train | Edit a customer activity | [
30522,
2270,
3853,
10086,
7874,
20389,
2121,
1006,
1004,
1002,
2799,
1010,
1004,
1002,
12098,
5620,
1010,
1004,
1002,
6434,
1007,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
9530,
8873,
2290,
1011,
1028,
2131,
1006,
1005,
9530,
8873,
2290,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Updates/3.0.0-b4.php | Updates_3_0_0_b4.getUserDatabaseMigrations | private function getUserDatabaseMigrations($queries)
{
$queries[] = $this->migration->db->changeColumn($this->userTable, 'password', 'password', 'VARCHAR(255) NOT NULL');
return $queries;
} | php | private function getUserDatabaseMigrations($queries)
{
$queries[] = $this->migration->db->changeColumn($this->userTable, 'password', 'password', 'VARCHAR(255) NOT NULL');
return $queries;
} | [
"private",
"function",
"getUserDatabaseMigrations",
"(",
"$",
"queries",
")",
"{",
"$",
"queries",
"[",
"]",
"=",
"$",
"this",
"->",
"migration",
"->",
"db",
"->",
"changeColumn",
"(",
"$",
"this",
"->",
"userTable",
",",
"'password'",
",",
"'password'",
"... | Returns database migrations for this update.
@param Migration[] $queries
@return Migration[] | [
"Returns",
"database",
"migrations",
"for",
"this",
"update",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Updates/3.0.0-b4.php#L64-L69 | train | Get user database migrations | [
30522,
2797,
3853,
2131,
20330,
2850,
2696,
15058,
4328,
29397,
2015,
1006,
1002,
10861,
5134,
1007,
1063,
1002,
10861,
5134,
1031,
1033,
1027,
1002,
2023,
1011,
1028,
9230,
1011,
1028,
16962,
1011,
1028,
2689,
25778,
2819,
2078,
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/UserCountry/LocationProvider/GeoIp/ServerBased.php | ServerBased.isWorking | public function isWorking()
{
if (empty($_SERVER[self::TEST_SERVER_VAR])
&& empty($_SERVER[self::TEST_SERVER_VAR_ALT])
&& empty($_SERVER[self::TEST_SERVER_VAR_ALT_IPV6])
) {
return Piwik::translate("UserCountry_CannotFindGeoIPServerVar", self::TEST_SERVER_VAR . ' ... | php | public function isWorking()
{
if (empty($_SERVER[self::TEST_SERVER_VAR])
&& empty($_SERVER[self::TEST_SERVER_VAR_ALT])
&& empty($_SERVER[self::TEST_SERVER_VAR_ALT_IPV6])
) {
return Piwik::translate("UserCountry_CannotFindGeoIPServerVar", self::TEST_SERVER_VAR . ' ... | [
"public",
"function",
"isWorking",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"_SERVER",
"[",
"self",
"::",
"TEST_SERVER_VAR",
"]",
")",
"&&",
"empty",
"(",
"$",
"_SERVER",
"[",
"self",
"::",
"TEST_SERVER_VAR_ALT",
"]",
")",
"&&",
"empty",
"(",
"$",
... | Returns true if the GEOIP_ADDR server variable is defined.
@return bool | [
"Returns",
"true",
"if",
"the",
"GEOIP_ADDR",
"server",
"variable",
"is",
"defined",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UserCountry/LocationProvider/GeoIp/ServerBased.php#L187-L197 | train | Is this IP address working? | [
30522,
2270,
3853,
2003,
21398,
1006,
1007,
1063,
2065,
30524,
1002,
1035,
8241,
1031,
2969,
1024,
1024,
3231,
1035,
8241,
1035,
13075,
1035,
12456,
1033,
1007,
1004,
1004,
4064,
1006,
1002,
1035,
8241,
1031,
2969,
1024,
1024,
3231,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/LanguagesManager/API.php | API.setLanguageForUser | public function setLanguageForUser($login, $languageCode)
{
Piwik::checkUserHasSuperUserAccessOrIsTheUser($login);
Piwik::checkUserIsNotAnonymous();
if (!$this->isLanguageAvailable($languageCode)) {
return false;
}
$this->getModel()->setLanguageForUser($login, $... | php | public function setLanguageForUser($login, $languageCode)
{
Piwik::checkUserHasSuperUserAccessOrIsTheUser($login);
Piwik::checkUserIsNotAnonymous();
if (!$this->isLanguageAvailable($languageCode)) {
return false;
}
$this->getModel()->setLanguageForUser($login, $... | [
"public",
"function",
"setLanguageForUser",
"(",
"$",
"login",
",",
"$",
"languageCode",
")",
"{",
"Piwik",
"::",
"checkUserHasSuperUserAccessOrIsTheUser",
"(",
"$",
"login",
")",
";",
"Piwik",
"::",
"checkUserIsNotAnonymous",
"(",
")",
";",
"if",
"(",
"!",
"$... | Sets the language for the user
@param string $login
@param string $languageCode
@return bool | [
"Sets",
"the",
"language",
"for",
"the",
"user"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/LanguagesManager/API.php#L298-L310 | train | Set the language for the user | [
30522,
2270,
3853,
2275,
25023,
6692,
3351,
29278,
20330,
1006,
1002,
8833,
2378,
1010,
1002,
2653,
16044,
1007,
1063,
14255,
9148,
2243,
1024,
1024,
4638,
20330,
14949,
6342,
4842,
20330,
6305,
9623,
21748,
2923,
5369,
20330,
1006,
1002,
8... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Handlers/AbstractError.php | AbstractError.renderThrowableAsText | protected function renderThrowableAsText($throwable)
{
$text = sprintf('Type: %s' . PHP_EOL, get_class($throwable));
if ($code = $throwable->getCode()) {
$text .= sprintf('Code: %s' . PHP_EOL, $code);
}
if ($message = $throwable->getMessage()) {
$text .= spr... | php | protected function renderThrowableAsText($throwable)
{
$text = sprintf('Type: %s' . PHP_EOL, get_class($throwable));
if ($code = $throwable->getCode()) {
$text .= sprintf('Code: %s' . PHP_EOL, $code);
}
if ($message = $throwable->getMessage()) {
$text .= spr... | [
"protected",
"function",
"renderThrowableAsText",
"(",
"$",
"throwable",
")",
"{",
"$",
"text",
"=",
"sprintf",
"(",
"'Type: %s'",
".",
"PHP_EOL",
",",
"get_class",
"(",
"$",
"throwable",
")",
")",
";",
"if",
"(",
"$",
"code",
"=",
"$",
"throwable",
"->"... | Render error as Text.
@param Exception|Throwable $throwable
@return string | [
"Render",
"error",
"as",
"Text",
"."
] | ccef5f7d8bcd469d59cbe64f6210d83764f91543 | https://github.com/slimphp/Slim/blob/ccef5f7d8bcd469d59cbe64f6210d83764f91543/Slim/Handlers/AbstractError.php#L60-L85 | train | Render Throwable as text | [
30522,
5123,
3853,
17552,
2705,
10524,
3085,
14083,
10288,
2102,
1006,
1002,
5466,
3085,
1007,
1063,
1002,
3793,
1027,
9043,
2546,
1006,
1005,
2828,
1024,
1003,
1055,
1005,
1012,
25718,
1035,
1041,
4747,
1010,
2131,
1035,
2465,
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/CorePluginsAdmin/Controller.php | Controller.isAllowedToTroubleshootAsSuperUser | protected function isAllowedToTroubleshootAsSuperUser()
{
$isAllowedToTroubleshootAsSuperUser = false;
$salt = SettingsPiwik::getSalt();
if (!empty($salt)) {
$saltFromRequest = Common::getRequestVar('i_am_super_user', '', 'string');
$isAllowedToTroubleshootAsSuperUser... | php | protected function isAllowedToTroubleshootAsSuperUser()
{
$isAllowedToTroubleshootAsSuperUser = false;
$salt = SettingsPiwik::getSalt();
if (!empty($salt)) {
$saltFromRequest = Common::getRequestVar('i_am_super_user', '', 'string');
$isAllowedToTroubleshootAsSuperUser... | [
"protected",
"function",
"isAllowedToTroubleshootAsSuperUser",
"(",
")",
"{",
"$",
"isAllowedToTroubleshootAsSuperUser",
"=",
"false",
";",
"$",
"salt",
"=",
"SettingsPiwik",
"::",
"getSalt",
"(",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"salt",
")",
")",
... | Let Super User troubleshoot in safe mode, even when Login is broken, with this special trick
@return bool
@throws Exception | [
"Let",
"Super",
"User",
"troubleshoot",
"in",
"safe",
"mode",
"even",
"when",
"Login",
"is",
"broken",
"with",
"this",
"special",
"trick"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/CorePluginsAdmin/Controller.php#L588-L597 | train | Check if the current user is allowed to troubleshoot as a super user | [
30522,
5123,
3853,
18061,
7174,
15557,
3406,
13181,
12083,
4244,
23416,
12054,
6279,
21608,
2121,
1006,
1007,
1063,
1002,
18061,
7174,
15557,
3406,
13181,
12083,
4244,
23416,
12054,
6279,
21608,
2121,
1027,
6270,
1025,
1002,
5474,
1027,
10906... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/SitesManager/Model.php | Model.getSitesFromIds | public function getSitesFromIds($idSites, $limit = false)
{
if (count($idSites) === 0) {
return array();
}
if ($limit) {
$limit = "LIMIT " . (int)$limit;
} else {
$limit = '';
}
$idSites = array_map('intval', $idSites);
$... | php | public function getSitesFromIds($idSites, $limit = false)
{
if (count($idSites) === 0) {
return array();
}
if ($limit) {
$limit = "LIMIT " . (int)$limit;
} else {
$limit = '';
}
$idSites = array_map('intval', $idSites);
$... | [
"public",
"function",
"getSitesFromIds",
"(",
"$",
"idSites",
",",
"$",
"limit",
"=",
"false",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"idSites",
")",
"===",
"0",
")",
"{",
"return",
"array",
"(",
")",
";",
"}",
"if",
"(",
"$",
"limit",
")",
"{",... | Returns the list of websites from the ID array in parameters.
@param array $idSites list of website ID
@param bool $limit
@return array | [
"Returns",
"the",
"list",
"of",
"websites",
"from",
"the",
"ID",
"array",
"in",
"parameters",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SitesManager/Model.php#L201-L221 | train | Get list of all the sites from the list of websites | [
30522,
2270,
3853,
4152,
7616,
19699,
20936,
5104,
1006,
1002,
8909,
28032,
2229,
1010,
1002,
5787,
1027,
6270,
1007,
1063,
2065,
1006,
4175,
1006,
1002,
8909,
28032,
2229,
1007,
1027,
1027,
1027,
1014,
1007,
1063,
2709,
9140,
1006,
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/widgets/Filter.php | Filter.makeFilterScope | protected function makeFilterScope($name, $config)
{
$label = $config['label'] ?? null;
$scopeType = $config['type'] ?? null;
$scope = new FilterScope($name, $label);
$scope->displayAs($scopeType, $config);
/*
* Set scope value
*/
$scope->value = $... | php | protected function makeFilterScope($name, $config)
{
$label = $config['label'] ?? null;
$scopeType = $config['type'] ?? null;
$scope = new FilterScope($name, $label);
$scope->displayAs($scopeType, $config);
/*
* Set scope value
*/
$scope->value = $... | [
"protected",
"function",
"makeFilterScope",
"(",
"$",
"name",
",",
"$",
"config",
")",
"{",
"$",
"label",
"=",
"$",
"config",
"[",
"'label'",
"]",
"??",
"null",
";",
"$",
"scopeType",
"=",
"$",
"config",
"[",
"'type'",
"]",
"??",
"null",
";",
"$",
... | Creates a filter scope object from name and configuration. | [
"Creates",
"a",
"filter",
"scope",
"object",
"from",
"name",
"and",
"configuration",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/Filter.php#L635-L649 | train | Create a filter scope | [
30522,
5123,
3853,
2191,
8873,
21928,
26127,
1006,
1002,
2171,
1010,
1002,
9530,
8873,
2290,
1007,
1063,
1002,
3830,
1027,
1002,
9530,
8873,
2290,
1031,
1005,
3830,
1005,
1033,
1029,
1029,
19701,
1025,
1002,
9531,
13874,
1027,
1002,
9530,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/SitesManager/API.php | API.getSitesIdFromSiteUrl | public function getSitesIdFromSiteUrl($url)
{
$url = $this->removeTrailingSlash($url);
$normalisedUrls = $this->getNormalizedUrls($url);
if (Piwik::hasUserSuperUserAccess()) {
$ids = $this->getModel()->getAllSitesIdFromSiteUrl($normalisedUrls);
} else {
$lo... | php | public function getSitesIdFromSiteUrl($url)
{
$url = $this->removeTrailingSlash($url);
$normalisedUrls = $this->getNormalizedUrls($url);
if (Piwik::hasUserSuperUserAccess()) {
$ids = $this->getModel()->getAllSitesIdFromSiteUrl($normalisedUrls);
} else {
$lo... | [
"public",
"function",
"getSitesIdFromSiteUrl",
"(",
"$",
"url",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"removeTrailingSlash",
"(",
"$",
"url",
")",
";",
"$",
"normalisedUrls",
"=",
"$",
"this",
"->",
"getNormalizedUrls",
"(",
"$",
"url",
")",
";",... | Returns the list of websites ID associated with a URL.
@param string $url
@return array list of websites ID | [
"Returns",
"the",
"list",
"of",
"websites",
"ID",
"associated",
"with",
"a",
"URL",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SitesManager/API.php#L515-L528 | train | Returns the list of websites id from a given URL. | [
30522,
2270,
3853,
4152,
7616,
3593,
19699,
22225,
4221,
3126,
2140,
1006,
1002,
24471,
2140,
1007,
1063,
1002,
24471,
2140,
1027,
1002,
2023,
1011,
1028,
6366,
6494,
16281,
14540,
11823,
1006,
1002,
24471,
2140,
1007,
1025,
1002,
3671,
508... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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._connect | protected function _connect()
{
if (is_resource($this->_connection)) {
// connection already exists
return;
}
if (!extension_loaded('oci8')) {
/**
* @see Zend_Db_Adapter_Oracle_Exception
*/
// require_once 'Zend/Db/Ad... | php | protected function _connect()
{
if (is_resource($this->_connection)) {
// connection already exists
return;
}
if (!extension_loaded('oci8')) {
/**
* @see Zend_Db_Adapter_Oracle_Exception
*/
// require_once 'Zend/Db/Ad... | [
"protected",
"function",
"_connect",
"(",
")",
"{",
"if",
"(",
"is_resource",
"(",
"$",
"this",
"->",
"_connection",
")",
")",
"{",
"// connection already exists",
"return",
";",
"}",
"if",
"(",
"!",
"extension_loaded",
"(",
"'oci8'",
")",
")",
"{",
"/**\n... | Creates a connection resource.
@return void
@throws Zend_Db_Adapter_Oracle_Exception | [
"Creates",
"a",
"connection",
"resource",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Adapter/Oracle.php#L107-L140 | train | Connect to the database using the OCI8 extension | [
30522,
5123,
3853,
1035,
7532,
1006,
1007,
1063,
2065,
1006,
2003,
1035,
7692,
1006,
1002,
2023,
1011,
1028,
1035,
4434,
1007,
1007,
1063,
1013,
1013,
4434,
2525,
6526,
2709,
1025,
1065,
2065,
1006,
999,
5331,
1035,
8209,
1006,
1005,
1051... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Common/Assets/Pipeline.php | Pipeline.renderCss | public function renderCss($assets, $group, $attributes = [])
{
// temporary list of assets to pipeline
$inline_group = false;
if (array_key_exists('loading', $attributes) && $attributes['loading'] === 'inline') {
$inline_group = true;
unset($attributes['loading']);
... | php | public function renderCss($assets, $group, $attributes = [])
{
// temporary list of assets to pipeline
$inline_group = false;
if (array_key_exists('loading', $attributes) && $attributes['loading'] === 'inline') {
$inline_group = true;
unset($attributes['loading']);
... | [
"public",
"function",
"renderCss",
"(",
"$",
"assets",
",",
"$",
"group",
",",
"$",
"attributes",
"=",
"[",
"]",
")",
"{",
"// temporary list of assets to pipeline",
"$",
"inline_group",
"=",
"false",
";",
"if",
"(",
"array_key_exists",
"(",
"'loading'",
",",
... | Minify and concatenate CSS
@param array $assets
@param string $group
@param array $attributes
@return bool|string URL or generated content if available, else false | [
"Minify",
"and",
"concatenate",
"CSS"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Assets/Pipeline.php#L94-L147 | train | Render css assets | [
30522,
2270,
3853,
17552,
6169,
2015,
1006,
1002,
7045,
1010,
1002,
2177,
1010,
1002,
12332,
1027,
1031,
1033,
1007,
1063,
1013,
1013,
5741,
2862,
1997,
7045,
2000,
13117,
1002,
23881,
1035,
2177,
1027,
6270,
1025,
2065,
1006,
9140,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/system/console/OctoberUtil.php | OctoberUtil.handle | public function handle()
{
$command = implode(' ', (array) $this->argument('name'));
$method = 'util'.studly_case($command);
$methods = preg_grep('/^util/', get_class_methods(get_called_class()));
$list = array_map(function ($item) {
return "october:".snake_case($item, "... | php | public function handle()
{
$command = implode(' ', (array) $this->argument('name'));
$method = 'util'.studly_case($command);
$methods = preg_grep('/^util/', get_class_methods(get_called_class()));
$list = array_map(function ($item) {
return "october:".snake_case($item, "... | [
"public",
"function",
"handle",
"(",
")",
"{",
"$",
"command",
"=",
"implode",
"(",
"' '",
",",
"(",
"array",
")",
"$",
"this",
"->",
"argument",
"(",
"'name'",
")",
")",
";",
"$",
"method",
"=",
"'util'",
".",
"studly_case",
"(",
"$",
"command",
"... | Execute the console command. | [
"Execute",
"the",
"console",
"command",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/console/OctoberUtil.php#L54-L82 | train | Handle the current request | [
30522,
2270,
3853,
5047,
1006,
1007,
1063,
1002,
3094,
1027,
17727,
4135,
3207,
1006,
1005,
1005,
1010,
1006,
9140,
1007,
1002,
2023,
1011,
1028,
6685,
1006,
1005,
2171,
1005,
1007,
1007,
1025,
1002,
4118,
1027,
1005,
21183,
4014,
1005,
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/DataTable/Row.php | Row.addMetadata | public function addMetadata($name, $value)
{
if (isset($this->metadata[$name])) {
throw new Exception("Metadata $name already in the array!");
}
$this->setMetadata($name, $value);
} | php | public function addMetadata($name, $value)
{
if (isset($this->metadata[$name])) {
throw new Exception("Metadata $name already in the array!");
}
$this->setMetadata($name, $value);
} | [
"public",
"function",
"addMetadata",
"(",
"$",
"name",
",",
"$",
"value",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"metadata",
"[",
"$",
"name",
"]",
")",
")",
"{",
"throw",
"new",
"Exception",
"(",
"\"Metadata $name already in the array!\"",
... | Add a new metadata to the row. If the metadata already exists, throws an exception.
@param string $name name of the metadata to add.
@param mixed $value value of the metadata to set.
@throws Exception if the metadata already exists. | [
"Add",
"a",
"new",
"metadata",
"to",
"the",
"row",
".",
"If",
"the",
"metadata",
"already",
"exists",
"throws",
"an",
"exception",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable/Row.php#L427-L433 | train | Add metadata to the array | [
30522,
2270,
3853,
5587,
11368,
8447,
2696,
1006,
1002,
2171,
1010,
1002,
3643,
1007,
1063,
2065,
1006,
26354,
3388,
1006,
1002,
2023,
1011,
1028,
27425,
1031,
1002,
2171,
1033,
1007,
1007,
1063,
30524,
1000,
27425,
1002,
2171,
2525,
1999,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Bridge/Doctrine/Form/DataTransformer/CollectionToArrayTransformer.php | CollectionToArrayTransformer.transform | public function transform($collection)
{
if (null === $collection) {
return [];
}
// For cases when the collection getter returns $collection->toArray()
// in order to prevent modifications of the returned collection
if (\is_array($collection)) {
retu... | php | public function transform($collection)
{
if (null === $collection) {
return [];
}
// For cases when the collection getter returns $collection->toArray()
// in order to prevent modifications of the returned collection
if (\is_array($collection)) {
retu... | [
"public",
"function",
"transform",
"(",
"$",
"collection",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"collection",
")",
"{",
"return",
"[",
"]",
";",
"}",
"// For cases when the collection getter returns $collection->toArray()",
"// in order to prevent modifications of the... | Transforms a collection into an array.
@return mixed An array of entities
@throws TransformationFailedException | [
"Transforms",
"a",
"collection",
"into",
"an",
"array",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bridge/Doctrine/Form/DataTransformer/CollectionToArrayTransformer.php#L31-L48 | train | Transforms a Collection object into an array | [
30522,
2270,
3853,
10938,
1006,
1002,
3074,
1007,
1063,
2065,
1006,
19701,
1027,
1027,
1027,
1002,
3074,
1007,
1063,
2709,
1031,
1033,
1025,
1065,
1013,
1013,
2005,
3572,
2043,
1996,
3074,
2131,
3334,
5651,
1002,
3074,
1011,
1028,
2000,
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/Ldap/Adapter/ExtLdap/Adapter.php | Adapter.createQuery | public function createQuery($dn, $query, array $options = [])
{
return new Query($this->getConnection(), $dn, $query, $options);
} | php | public function createQuery($dn, $query, array $options = [])
{
return new Query($this->getConnection(), $dn, $query, $options);
} | [
"public",
"function",
"createQuery",
"(",
"$",
"dn",
",",
"$",
"query",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"return",
"new",
"Query",
"(",
"$",
"this",
"->",
"getConnection",
"(",
")",
",",
"$",
"dn",
",",
"$",
"query",
",",
"$... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Ldap/Adapter/ExtLdap/Adapter.php#L62-L65 | train | Create a new Query object | [
30522,
2270,
30524,
1025,
1065,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/OpenWork/Provider/Client.php | Client.getRegisterUri | public function getRegisterUri(string $registerCode = '')
{
$registerCode || $registerCode = $this->getRegisterCode()['register_code'];
$params = ['register_code' => $registerCode];
return 'https://open.work.weixin.qq.com/3rdservice/wework/register?'.http_build_query($params);
} | php | public function getRegisterUri(string $registerCode = '')
{
$registerCode || $registerCode = $this->getRegisterCode()['register_code'];
$params = ['register_code' => $registerCode];
return 'https://open.work.weixin.qq.com/3rdservice/wework/register?'.http_build_query($params);
} | [
"public",
"function",
"getRegisterUri",
"(",
"string",
"$",
"registerCode",
"=",
"''",
")",
"{",
"$",
"registerCode",
"||",
"$",
"registerCode",
"=",
"$",
"this",
"->",
"getRegisterCode",
"(",
")",
"[",
"'register_code'",
"]",
";",
"$",
"params",
"=",
"[",... | 获取注册定制化URL.
@param string $registerCode
@return string
@throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException | [
"获取注册定制化URL",
"."
] | 120c72faaa93c270365bc75c73c362d5fd583209 | https://github.com/overtrue/wechat/blob/120c72faaa93c270365bc75c73c362d5fd583209/src/OpenWork/Provider/Client.php#L85-L91 | train | Get URI for register code | [
30522,
2270,
3853,
2131,
2890,
24063,
2121,
9496,
1006,
5164,
1002,
4236,
16044,
1027,
1005,
1005,
1007,
1063,
1002,
4236,
16044,
1064,
1064,
1002,
4236,
16044,
1027,
1002,
2023,
1011,
1028,
2131,
2890,
24063,
2121,
16044,
1006,
1007,
1031,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Database/Schema/Grammars/MySqlGrammar.php | MySqlGrammar.modifyCharset | protected function modifyCharset(Blueprint $blueprint, Fluent $column)
{
if (! is_null($column->charset)) {
return ' character set '.$column->charset;
}
} | php | protected function modifyCharset(Blueprint $blueprint, Fluent $column)
{
if (! is_null($column->charset)) {
return ' character set '.$column->charset;
}
} | [
"protected",
"function",
"modifyCharset",
"(",
"Blueprint",
"$",
"blueprint",
",",
"Fluent",
"$",
"column",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"column",
"->",
"charset",
")",
")",
"{",
"return",
"' character set '",
".",
"$",
"column",
"->",
... | Get the SQL for a character set column modifier.
@param \Illuminate\Database\Schema\Blueprint $blueprint
@param \Illuminate\Support\Fluent $column
@return string|null | [
"Get",
"the",
"SQL",
"for",
"a",
"character",
"set",
"column",
"modifier",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Schema/Grammars/MySqlGrammar.php#L912-L917 | train | Protected modify charset | [
30522,
5123,
3853,
19933,
7507,
22573,
2102,
1006,
2630,
16550,
1002,
2630,
16550,
1010,
19376,
1002,
5930,
1007,
1063,
2065,
1006,
999,
2003,
1035,
19701,
1006,
1002,
5930,
1011,
1028,
25869,
13462,
1007,
1007,
1063,
2709,
1005,
2839,
2275... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/HttpFoundation/Session/Session.php | Session.invalidate | public function invalidate($lifetime = null)
{
$this->storage->clear();
return $this->migrate(true, $lifetime);
} | php | public function invalidate($lifetime = null)
{
$this->storage->clear();
return $this->migrate(true, $lifetime);
} | [
"public",
"function",
"invalidate",
"(",
"$",
"lifetime",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"storage",
"->",
"clear",
"(",
")",
";",
"return",
"$",
"this",
"->",
"migrate",
"(",
"true",
",",
"$",
"lifetime",
")",
";",
"}"
] | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpFoundation/Session/Session.php#L176-L181 | train | Invalidate all cache entries | [
30522,
2270,
3853,
19528,
3686,
1006,
1002,
6480,
1027,
19701,
1007,
1063,
1002,
2023,
1011,
1028,
5527,
1011,
1028,
3154,
1006,
1007,
1025,
30524,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.maxCount | public function maxCount($var = null)
{
//user_error(__CLASS__ . '::' . __FUNCTION__ . '() is deprecated since Grav 1.6', E_USER_DEPRECATED);
if ($var !== null) {
$this->max_count = (int)$var;
}
if (empty($this->max_count)) {
/** @var Config $config */
... | php | public function maxCount($var = null)
{
//user_error(__CLASS__ . '::' . __FUNCTION__ . '() is deprecated since Grav 1.6', E_USER_DEPRECATED);
if ($var !== null) {
$this->max_count = (int)$var;
}
if (empty($this->max_count)) {
/** @var Config $config */
... | [
"public",
"function",
"maxCount",
"(",
"$",
"var",
"=",
"null",
")",
"{",
"//user_error(__CLASS__ . '::' . __FUNCTION__ . '() is deprecated since Grav 1.6', E_USER_DEPRECATED);",
"if",
"(",
"$",
"var",
"!==",
"null",
")",
"{",
"$",
"this",
"->",
"max_count",
"=",
"(",... | Gets and sets the maxCount field which describes how many sub-pages should be displayed if the
sub_pages header property is set for this page object.
@param int $var the maximum number of sub-pages
@return int the maximum number of sub-pages
@deprecated 1.6 | [
"Gets",
"and",
"sets",
"the",
"maxCount",
"field",
"which",
"describes",
"how",
"many",
"sub",
"-",
"pages",
"should",
"be",
"displayed",
"if",
"the",
"sub_pages",
"header",
"property",
"is",
"set",
"for",
"this",
"page",
"object",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Page/Page.php#L2271-L2285 | train | Get max count of pages | [
30522,
2270,
3853,
4098,
3597,
16671,
1006,
1002,
13075,
1027,
19701,
1007,
1063,
1013,
1013,
5310,
1035,
7561,
1006,
1035,
1035,
2465,
1035,
1035,
1012,
1005,
1024,
1024,
1005,
1012,
1035,
1035,
3853,
1035,
1035,
1012,
1005,
1006,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Command/CachePoolDeleteCommand.php | CachePoolDeleteCommand.execute | protected function execute(InputInterface $input, OutputInterface $output)
{
$io = new SymfonyStyle($input, $output);
$pool = $input->getArgument('pool');
$key = $input->getArgument('key');
$cachePool = $this->poolClearer->getPool($pool);
if (!$cachePool->hasItem($key)) {
... | php | protected function execute(InputInterface $input, OutputInterface $output)
{
$io = new SymfonyStyle($input, $output);
$pool = $input->getArgument('pool');
$key = $input->getArgument('key');
$cachePool = $this->poolClearer->getPool($pool);
if (!$cachePool->hasItem($key)) {
... | [
"protected",
"function",
"execute",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"io",
"=",
"new",
"SymfonyStyle",
"(",
"$",
"input",
",",
"$",
"output",
")",
";",
"$",
"pool",
"=",
"$",
"input",
"->",
"get... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bundle/FrameworkBundle/Command/CachePoolDeleteCommand.php#L62-L80 | train | Delete a cache item | [
30522,
5123,
3853,
15389,
1006,
7953,
18447,
2121,
12172,
1002,
7953,
1010,
6434,
18447,
2121,
12172,
1002,
6434,
1007,
1063,
1002,
22834,
1027,
2047,
25353,
2213,
14876,
4890,
21756,
2571,
1006,
1002,
7953,
1010,
1002,
6434,
1007,
1025,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/DataAccess/LogAggregator.php | LogAggregator.queryVisitsByDimension | public function queryVisitsByDimension(array $dimensions = array(), $where = false, array $additionalSelects = array(),
$metrics = false, $rankingQuery = false)
{
$tableName = self::LOG_VISIT_TABLE;
$availableMetrics = $this->getVisitsMetricFields();
... | php | public function queryVisitsByDimension(array $dimensions = array(), $where = false, array $additionalSelects = array(),
$metrics = false, $rankingQuery = false)
{
$tableName = self::LOG_VISIT_TABLE;
$availableMetrics = $this->getVisitsMetricFields();
... | [
"public",
"function",
"queryVisitsByDimension",
"(",
"array",
"$",
"dimensions",
"=",
"array",
"(",
")",
",",
"$",
"where",
"=",
"false",
",",
"array",
"$",
"additionalSelects",
"=",
"array",
"(",
")",
",",
"$",
"metrics",
"=",
"false",
",",
"$",
"rankin... | Executes and returns a query aggregating visit logs, optionally grouping by some dimension. Returns
a DB statement that can be used to iterate over the result
**Result Set**
The following columns are in each row of the result set:
- **{@link Piwik\Metrics::INDEX_NB_UNIQ_VISITORS}**: The total number of unique visito... | [
"Executes",
"and",
"returns",
"a",
"query",
"aggregating",
"visit",
"logs",
"optionally",
"grouping",
"by",
"some",
"dimension",
".",
"Returns",
"a",
"DB",
"statement",
"that",
"can",
"be",
"used",
"to",
"iterate",
"over",
"the",
"result"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataAccess/LogAggregator.php#L326-L361 | train | Queries visits by dimension | [
30522,
2270,
3853,
23032,
11365,
12762,
3762,
22172,
6132,
3258,
1006,
9140,
1002,
9646,
1027,
9140,
1006,
1007,
1010,
1002,
2073,
1027,
6270,
1010,
9140,
1002,
3176,
11246,
22471,
2015,
1027,
9140,
1006,
1007,
1010,
30524,
1002,
2800,
1258... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Http/Concerns/InteractsWithFlashData.php | InteractsWithFlashData.flashExcept | public function flashExcept($keys)
{
$this->session()->flashInput(
$this->except(is_array($keys) ? $keys : func_get_args())
);
} | php | public function flashExcept($keys)
{
$this->session()->flashInput(
$this->except(is_array($keys) ? $keys : func_get_args())
);
} | [
"public",
"function",
"flashExcept",
"(",
"$",
"keys",
")",
"{",
"$",
"this",
"->",
"session",
"(",
")",
"->",
"flashInput",
"(",
"$",
"this",
"->",
"except",
"(",
"is_array",
"(",
"$",
"keys",
")",
"?",
"$",
"keys",
":",
"func_get_args",
"(",
")",
... | Flash only some of the input to the session.
@param array|mixed $keys
@return void | [
"Flash",
"only",
"some",
"of",
"the",
"input",
"to",
"the",
"session",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Http/Concerns/InteractsWithFlashData.php#L48-L53 | train | Flash the input except the given keys. | [
30522,
2270,
3853,
5956,
10288,
3401,
13876,
1006,
1002,
6309,
1007,
1063,
1002,
2023,
1011,
1028,
5219,
1006,
1007,
1011,
1028,
5956,
2378,
18780,
1006,
1002,
2023,
1011,
1028,
3272,
1006,
2003,
1035,
9140,
1006,
1002,
6309,
1007,
1029,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Common/Twig/WriteCacheFileTrait.php | WriteCacheFileTrait.writeCacheFile | protected function writeCacheFile($file, $content)
{
if (empty($file)) {
return;
}
if (!isset(self::$umask)) {
self::$umask = Grav::instance()['config']->get('system.twig.umask_fix', false);
}
if (self::$umask) {
$dir = dirname($file);
... | php | protected function writeCacheFile($file, $content)
{
if (empty($file)) {
return;
}
if (!isset(self::$umask)) {
self::$umask = Grav::instance()['config']->get('system.twig.umask_fix', false);
}
if (self::$umask) {
$dir = dirname($file);
... | [
"protected",
"function",
"writeCacheFile",
"(",
"$",
"file",
",",
"$",
"content",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"file",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"umask",
")",
")",
"{",
"self",
... | This exists so template cache files use the same
group between apache and cli
@param string $file
@param string $content | [
"This",
"exists",
"so",
"template",
"cache",
"files",
"use",
"the",
"same",
"group",
"between",
"apache",
"and",
"cli"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Twig/WriteCacheFileTrait.php#L26-L48 | train | Write cache file | [
30522,
5123,
3853,
4339,
3540,
5403,
8873,
2571,
1006,
1002,
5371,
1010,
1002,
4180,
1007,
1063,
2065,
1006,
4064,
1006,
1002,
5371,
1007,
1007,
1063,
2709,
1025,
1065,
2065,
1006,
999,
26354,
3388,
1006,
2969,
1024,
1024,
1002,
8529,
198... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/ResourceGenerator.php | ResourceGenerator.getModel | protected function getModel($model)
{
if ($model instanceof Model) {
return $model;
}
if (!class_exists($model) || !is_string($model) || !is_subclass_of($model, Model::class)) {
throw new \InvalidArgumentException("Invalid model [$model] !");
}
retur... | php | protected function getModel($model)
{
if ($model instanceof Model) {
return $model;
}
if (!class_exists($model) || !is_string($model) || !is_subclass_of($model, Model::class)) {
throw new \InvalidArgumentException("Invalid model [$model] !");
}
retur... | [
"protected",
"function",
"getModel",
"(",
"$",
"model",
")",
"{",
"if",
"(",
"$",
"model",
"instanceof",
"Model",
")",
"{",
"return",
"$",
"model",
";",
"}",
"if",
"(",
"!",
"class_exists",
"(",
"$",
"model",
")",
"||",
"!",
"is_string",
"(",
"$",
... | @param mixed $model
@return mixed | [
"@param",
"mixed",
"$model"
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Console/ResourceGenerator.php#L63-L74 | train | Get Model Object | [
30522,
5123,
3853,
2131,
5302,
9247,
1006,
1002,
2944,
1007,
1063,
2065,
1006,
1002,
2944,
6013,
11253,
2944,
1007,
1063,
2709,
1002,
2944,
1025,
1065,
2065,
1006,
999,
2465,
1035,
6526,
1006,
1002,
2944,
1007,
1064,
1064,
999,
2003,
1035... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/system/classes/UpdateManager.php | UpdateManager.applyHttpAttributes | protected function applyHttpAttributes($http, $postData)
{
$postData['protocol_version'] = '1.1';
$postData['client'] = 'october';
$postData['server'] = base64_encode(serialize([
'php' => PHP_VERSION,
'url' => Url::to('/'),
'since' => PluginVersion::o... | php | protected function applyHttpAttributes($http, $postData)
{
$postData['protocol_version'] = '1.1';
$postData['client'] = 'october';
$postData['server'] = base64_encode(serialize([
'php' => PHP_VERSION,
'url' => Url::to('/'),
'since' => PluginVersion::o... | [
"protected",
"function",
"applyHttpAttributes",
"(",
"$",
"http",
",",
"$",
"postData",
")",
"{",
"$",
"postData",
"[",
"'protocol_version'",
"]",
"=",
"'1.1'",
";",
"$",
"postData",
"[",
"'client'",
"]",
"=",
"'october'",
";",
"$",
"postData",
"[",
"'serv... | Modifies the Network HTTP object with common attributes.
@param Http $http Network object
@param array $postData Post data
@return void | [
"Modifies",
"the",
"Network",
"HTTP",
"object",
"with",
"common",
"attributes",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/UpdateManager.php#L920-L951 | train | Apply HTTP attributes to the response | [
30522,
5123,
3853,
6611,
11039,
25856,
19321,
3089,
8569,
4570,
1006,
1002,
8299,
1010,
1002,
2695,
2850,
2696,
1007,
1063,
1002,
2695,
2850,
2696,
1031,
1005,
8778,
1035,
2544,
1005,
1033,
1027,
1005,
1015,
1012,
1015,
1005,
1025,
1002,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/cms/helpers/File.php | File.validateExtension | public static function validateExtension($fileName, $allowedExtensions, $allowEmpty = true)
{
$extension = strtolower(pathinfo($fileName, PATHINFO_EXTENSION));
if (empty($extension)) {
return $allowEmpty;
}
return in_array($extension, $allowedExtensions);
} | php | public static function validateExtension($fileName, $allowedExtensions, $allowEmpty = true)
{
$extension = strtolower(pathinfo($fileName, PATHINFO_EXTENSION));
if (empty($extension)) {
return $allowEmpty;
}
return in_array($extension, $allowedExtensions);
} | [
"public",
"static",
"function",
"validateExtension",
"(",
"$",
"fileName",
",",
"$",
"allowedExtensions",
",",
"$",
"allowEmpty",
"=",
"true",
")",
"{",
"$",
"extension",
"=",
"strtolower",
"(",
"pathinfo",
"(",
"$",
"fileName",
",",
"PATHINFO_EXTENSION",
")",... | Validates whether a file has an allowed extension.
@param string $fileName Specifies a path to validate
@param array $allowedExtensions A list of allowed file extensions
@param boolean $allowEmpty Determines whether the file extension could be empty.
@return boolean Returns true if the file extension is valid. Otherwis... | [
"Validates",
"whether",
"a",
"file",
"has",
"an",
"allowed",
"extension",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/helpers/File.php#L30-L38 | train | Validate file extension | [
30522,
2270,
10763,
3853,
9398,
3686,
10288,
29048,
1006,
1002,
5371,
18442,
1010,
1002,
3039,
10288,
29048,
2015,
1010,
1002,
3499,
6633,
13876,
2100,
1027,
2995,
1007,
1063,
1002,
5331,
1027,
2358,
5339,
12898,
13777,
1006,
4130,
2378,
14... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Serializer/Normalizer/PropertyNormalizer.php | PropertyNormalizer.supports | private function supports(string $class): bool
{
$class = new \ReflectionClass($class);
// We look for at least one non-static property
do {
foreach ($class->getProperties() as $property) {
if (!$property->isStatic()) {
return true;
... | php | private function supports(string $class): bool
{
$class = new \ReflectionClass($class);
// We look for at least one non-static property
do {
foreach ($class->getProperties() as $property) {
if (!$property->isStatic()) {
return true;
... | [
"private",
"function",
"supports",
"(",
"string",
"$",
"class",
")",
":",
"bool",
"{",
"$",
"class",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"$",
"class",
")",
";",
"// We look for at least one non-static property",
"do",
"{",
"foreach",
"(",
"$",
"class",
... | Checks if the given class has any non-static property. | [
"Checks",
"if",
"the",
"given",
"class",
"has",
"any",
"non",
"-",
"static",
"property",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Serializer/Normalizer/PropertyNormalizer.php#L60-L74 | train | Checks if a class supports static properties | [
30522,
2797,
3853,
6753,
1006,
5164,
1002,
2465,
1007,
1024,
22017,
2140,
1063,
1002,
2465,
1027,
2047,
1032,
9185,
26266,
1006,
1002,
2465,
1007,
1025,
1013,
1013,
2057,
2298,
2005,
2012,
2560,
2028,
2512,
1011,
10763,
3200,
2079,
1063,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/DataTable/Renderer/Html.php | Html.buildTableStructure | protected function buildTableStructure($table, $columnToAdd = null, $valueToAdd = null)
{
$i = $this->i;
$someMetadata = false;
$someIdSubTable = false;
/*
* table = array
* ROW1 = col1 | col2 | col3 | metadata | idSubTable
* ROW2 = col1 | col2 (no value b... | php | protected function buildTableStructure($table, $columnToAdd = null, $valueToAdd = null)
{
$i = $this->i;
$someMetadata = false;
$someIdSubTable = false;
/*
* table = array
* ROW1 = col1 | col2 | col3 | metadata | idSubTable
* ROW2 = col1 | col2 (no value b... | [
"protected",
"function",
"buildTableStructure",
"(",
"$",
"table",
",",
"$",
"columnToAdd",
"=",
"null",
",",
"$",
"valueToAdd",
"=",
"null",
")",
"{",
"$",
"i",
"=",
"$",
"this",
"->",
"i",
";",
"$",
"someMetadata",
"=",
"false",
";",
"$",
"someIdSubT... | Adds the given data table to the table structure array
@param DataTable $table
@param null|string $columnToAdd
@param null|string $valueToAdd
@throws Exception | [
"Adds",
"the",
"given",
"data",
"table",
"to",
"the",
"table",
"structure",
"array"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable/Renderer/Html.php#L91-L144 | train | Build the table structure | [
30522,
5123,
3853,
3857,
10880,
3367,
6820,
14890,
1006,
1002,
2795,
1010,
1002,
5930,
3406,
4215,
2094,
1027,
19701,
30524,
1002,
2070,
11368,
8447,
2696,
1027,
6270,
1025,
1002,
2070,
9821,
12083,
10880,
1027,
6270,
1025,
1013,
1008,
1008... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/system/classes/MarkupManager.php | MarkupManager.isWildCallable | protected function isWildCallable($callable, $replaceWith = false)
{
$isWild = false;
if (is_string($callable) && strpos($callable, '*') !== false) {
$isWild = $replaceWith ? str_replace('*', $replaceWith, $callable) : true;
}
if (is_array($callable)) {
if (... | php | protected function isWildCallable($callable, $replaceWith = false)
{
$isWild = false;
if (is_string($callable) && strpos($callable, '*') !== false) {
$isWild = $replaceWith ? str_replace('*', $replaceWith, $callable) : true;
}
if (is_array($callable)) {
if (... | [
"protected",
"function",
"isWildCallable",
"(",
"$",
"callable",
",",
"$",
"replaceWith",
"=",
"false",
")",
"{",
"$",
"isWild",
"=",
"false",
";",
"if",
"(",
"is_string",
"(",
"$",
"callable",
")",
"&&",
"strpos",
"(",
"$",
"callable",
",",
"'*'",
")"... | Tests if a callable type contains a wildcard, also acts as a
utility to replace the wildcard with a string.
@param callable $callable
@param string|bool $replaceWith
@return mixed | [
"Tests",
"if",
"a",
"callable",
"type",
"contains",
"a",
"wildcard",
"also",
"acts",
"as",
"a",
"utility",
"to",
"replace",
"the",
"wildcard",
"with",
"a",
"string",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/MarkupManager.php#L316-L347 | train | Is the callable wild? | [
30522,
5123,
3853,
2003,
29602,
16409,
25425,
3468,
1006,
1002,
2655,
3085,
1010,
1002,
5672,
24415,
1027,
6270,
1007,
1063,
1002,
2003,
29602,
2094,
1027,
6270,
1025,
2065,
1006,
2003,
1035,
5164,
1006,
1002,
2655,
3085,
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... |
octobercms/october | modules/system/database/migrations/2017_10_01_000021_Db_System_Sessions_Update.php | DbSystemSessionsUpdate.up | public function up()
{
Schema::table('sessions', function (Blueprint $table) {
$table->unsignedInteger('user_id')->nullable();
$table->string('ip_address', 45)->nullable();
$table->text('user_agent')->nullable();
});
} | php | public function up()
{
Schema::table('sessions', function (Blueprint $table) {
$table->unsignedInteger('user_id')->nullable();
$table->string('ip_address', 45)->nullable();
$table->text('user_agent')->nullable();
});
} | [
"public",
"function",
"up",
"(",
")",
"{",
"Schema",
"::",
"table",
"(",
"'sessions'",
",",
"function",
"(",
"Blueprint",
"$",
"table",
")",
"{",
"$",
"table",
"->",
"unsignedInteger",
"(",
"'user_id'",
")",
"->",
"nullable",
"(",
")",
";",
"$",
"table... | Run the migrations.
@return void | [
"Run",
"the",
"migrations",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/database/migrations/2017_10_01_000021_Db_System_Sessions_Update.php#L13-L20 | train | Upgrades the database to the database. | [
30522,
2270,
3853,
2039,
1006,
1007,
1063,
8040,
28433,
1024,
1024,
2795,
1006,
1005,
6521,
1005,
1010,
3853,
1006,
2630,
16550,
1002,
2795,
1007,
1063,
1002,
2795,
1011,
1028,
27121,
18447,
26320,
1006,
1005,
5310,
1035,
8909,
1005,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/Zend/Mime/Part.php | Zend_Mime_Part.getHeaders | public function getHeaders($EOL = Zend_Mime::LINEEND)
{
$res = '';
foreach ($this->getHeadersArray($EOL) as $header) {
$res .= $header[0] . ': ' . $header[1] . $EOL;
}
return $res;
} | php | public function getHeaders($EOL = Zend_Mime::LINEEND)
{
$res = '';
foreach ($this->getHeadersArray($EOL) as $header) {
$res .= $header[0] . ': ' . $header[1] . $EOL;
}
return $res;
} | [
"public",
"function",
"getHeaders",
"(",
"$",
"EOL",
"=",
"Zend_Mime",
"::",
"LINEEND",
")",
"{",
"$",
"res",
"=",
"''",
";",
"foreach",
"(",
"$",
"this",
"->",
"getHeadersArray",
"(",
"$",
"EOL",
")",
"as",
"$",
"header",
")",
"{",
"$",
"res",
".=... | Return the headers for this part as a string
@return String | [
"Return",
"the",
"headers",
"for",
"this",
"part",
"as",
"a",
"string"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mime/Part.php#L221-L229 | train | Get the headers of the message | [
30522,
2270,
3853,
2131,
4974,
2545,
1006,
1002,
1041,
4747,
1027,
16729,
2094,
1035,
2771,
4168,
1024,
1024,
2240,
10497,
1007,
1063,
1002,
24501,
1027,
1005,
1005,
1025,
18921,
6776,
1006,
1002,
2023,
1011,
1028,
2131,
4974,
2545,
2906,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/cms/classes/Controller.php | Controller.runAjaxHandler | protected function runAjaxHandler($handler)
{
/**
* @event cms.ajax.beforeRunHandler
* Provides an opportunity to modify an AJAX request
*
* The parameter provided is `$handler` (the requested AJAX handler to be run)
*
* Example usage (forwards AJAX hand... | php | protected function runAjaxHandler($handler)
{
/**
* @event cms.ajax.beforeRunHandler
* Provides an opportunity to modify an AJAX request
*
* The parameter provided is `$handler` (the requested AJAX handler to be run)
*
* Example usage (forwards AJAX hand... | [
"protected",
"function",
"runAjaxHandler",
"(",
"$",
"handler",
")",
"{",
"/**\n * @event cms.ajax.beforeRunHandler\n * Provides an opportunity to modify an AJAX request\n *\n * The parameter provided is `$handler` (the requested AJAX handler to be run)\n *\n ... | Tries to find and run an AJAX handler in the page, layout, components and plugins.
The method stops as soon as the handler is found.
@param string $handler name of the ajax handler
@return boolean Returns true if the handler was found. Returns false otherwise. | [
"Tries",
"to",
"find",
"and",
"run",
"an",
"AJAX",
"handler",
"in",
"the",
"page",
"layout",
"components",
"and",
"plugins",
".",
"The",
"method",
"stops",
"as",
"soon",
"as",
"the",
"handler",
"is",
"found",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/Controller.php#L805-L886 | train | Runs an AJAX handler | [
30522,
5123,
3853,
2448,
22734,
2595,
11774,
3917,
1006,
1002,
28213,
1007,
1063,
1013,
1008,
1008,
1008,
1030,
2724,
4642,
2015,
1012,
18176,
1012,
2077,
15532,
11774,
3917,
1008,
3640,
2019,
4495,
2000,
19933,
2019,
18176,
5227,
1008,
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... |
matomo-org/matomo | core/Tracker/VisitExcluded.php | VisitExcluded.isUserAgentExcluded | protected function isUserAgentExcluded()
{
$excludedAgents = $this->getAttributes('excluded_user_agents', 'global_excluded_user_agents');
if (!empty($excludedAgents)) {
foreach ($excludedAgents as $excludedUserAgent) {
// if the excluded user agent string part is in this... | php | protected function isUserAgentExcluded()
{
$excludedAgents = $this->getAttributes('excluded_user_agents', 'global_excluded_user_agents');
if (!empty($excludedAgents)) {
foreach ($excludedAgents as $excludedUserAgent) {
// if the excluded user agent string part is in this... | [
"protected",
"function",
"isUserAgentExcluded",
"(",
")",
"{",
"$",
"excludedAgents",
"=",
"$",
"this",
"->",
"getAttributes",
"(",
"'excluded_user_agents'",
",",
"'global_excluded_user_agents'",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"excludedAgents",
")",
... | Returns true if the specified user agent should be excluded for the current site or not.
Visits whose user agent string contains one of the excluded_user_agents strings for the
site being tracked (or one of the global strings) will be excluded.
@internal param string $this ->userAgent The user agent string.
@return b... | [
"Returns",
"true",
"if",
"the",
"specified",
"user",
"agent",
"should",
"be",
"excluded",
"for",
"the",
"current",
"site",
"or",
"not",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Tracker/VisitExcluded.php#L342-L356 | train | Returns true if the user agent string part of the visit should be excluded | [
30522,
5123,
3853,
2003,
20330,
4270,
10111,
2595,
20464,
13936,
1006,
1007,
1063,
1002,
12421,
4270,
7666,
1027,
1002,
2023,
1011,
1028,
2131,
19321,
3089,
8569,
4570,
1006,
1005,
12421,
1035,
5310,
1035,
6074,
1005,
1010,
1005,
3795,
1035... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/API/ResponseBuilder.php | ResponseBuilder.getResponse | public function getResponse($value = null, $apiModule = false, $apiMethod = false)
{
$this->apiModule = $apiModule;
$this->apiMethod = $apiMethod;
$this->sendHeaderIfEnabled();
// when null or void is returned from the api call, we handle it as a successful operation
if (!i... | php | public function getResponse($value = null, $apiModule = false, $apiMethod = false)
{
$this->apiModule = $apiModule;
$this->apiMethod = $apiMethod;
$this->sendHeaderIfEnabled();
// when null or void is returned from the api call, we handle it as a successful operation
if (!i... | [
"public",
"function",
"getResponse",
"(",
"$",
"value",
"=",
"null",
",",
"$",
"apiModule",
"=",
"false",
",",
"$",
"apiMethod",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"apiModule",
"=",
"$",
"apiModule",
";",
"$",
"this",
"->",
"apiMethod",
"=",
... | This method processes the data resulting from the API call.
- If the data resulted from the API call is a DataTable then
- we apply the standard filters if the parameters have been found
in the URL. For example to offset,limit the Table you can add the following parameters to any API
call that returns a DataTable: fil... | [
"This",
"method",
"processes",
"the",
"data",
"resulting",
"from",
"the",
"API",
"call",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/API/ResponseBuilder.php#L83-L124 | train | Return the response | [
30522,
2270,
3853,
2131,
6072,
26029,
3366,
1006,
1002,
3643,
1027,
19701,
1010,
1002,
17928,
5302,
8566,
2571,
1027,
6270,
1010,
1002,
17928,
11368,
6806,
2094,
1027,
6270,
1007,
1063,
1002,
2023,
1011,
1028,
17928,
5302,
8566,
2571,
1027,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/DataTable/Map.php | Map.deleteColumns | public function deleteColumns($columns, $deleteRecursiveInSubtables = false)
{
foreach ($this->getDataTables() as $table) {
$table->deleteColumns($columns);
}
} | php | public function deleteColumns($columns, $deleteRecursiveInSubtables = false)
{
foreach ($this->getDataTables() as $table) {
$table->deleteColumns($columns);
}
} | [
"public",
"function",
"deleteColumns",
"(",
"$",
"columns",
",",
"$",
"deleteRecursiveInSubtables",
"=",
"false",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getDataTables",
"(",
")",
"as",
"$",
"table",
")",
"{",
"$",
"table",
"->",
"deleteColumns",
"("... | Deletes the specified columns in each contained {@link DataTable}.
See {@link DataTable::deleteColumns()}.
@param array $columns The columns to delete.
@param bool $deleteRecursiveInSubtables This param is currently not used. | [
"Deletes",
"the",
"specified",
"columns",
"in",
"each",
"contained",
"{",
"@link",
"DataTable",
"}",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable/Map.php#L292-L297 | train | Delete columns from all tables in this table | [
30522,
2270,
3853,
3972,
12870,
25778,
2819,
3619,
1006,
1002,
7753,
1010,
1002,
3972,
15141,
8586,
9236,
3512,
7076,
12083,
10880,
2015,
1027,
6270,
1007,
1063,
18921,
6776,
1006,
1002,
2023,
1011,
1028,
2131,
2850,
29336,
3085,
2015,
1006... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
walkor/Workerman | Protocols/Ws.php | Ws.decode | public static function decode($bytes, $connection)
{
$data_length = ord($bytes[1]);
if ($data_length === 126) {
$decoded_data = substr($bytes, 4);
} else if ($data_length === 127) {
$decoded_data = substr($bytes, 10);
} else {
$decoded_data = subs... | php | public static function decode($bytes, $connection)
{
$data_length = ord($bytes[1]);
if ($data_length === 126) {
$decoded_data = substr($bytes, 4);
} else if ($data_length === 127) {
$decoded_data = substr($bytes, 10);
} else {
$decoded_data = subs... | [
"public",
"static",
"function",
"decode",
"(",
"$",
"bytes",
",",
"$",
"connection",
")",
"{",
"$",
"data_length",
"=",
"ord",
"(",
"$",
"bytes",
"[",
"1",
"]",
")",
";",
"if",
"(",
"$",
"data_length",
"===",
"126",
")",
"{",
"$",
"decoded_data",
"... | Websocket decode.
@param string $buffer
@param ConnectionInterface $connection
@return string | [
"Websocket",
"decode",
"."
] | 13649907f05014fcfffcfccaef01e63ad3339351 | https://github.com/walkor/Workerman/blob/13649907f05014fcfffcfccaef01e63ad3339351/Protocols/Ws.php#L303-L324 | train | Decodes the bytes from the WebSocket | [
30522,
2270,
10763,
3853,
21933,
3207,
1006,
1002,
27507,
1010,
1002,
4434,
1007,
1063,
1002,
2951,
1035,
3091,
1027,
2030,
2094,
1006,
1002,
27507,
1031,
1015,
1033,
1007,
1025,
2065,
1006,
1002,
2951,
1035,
3091,
1027,
1027,
1027,
14010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/Zend/Cache/Backend/Memcached.php | Zend_Cache_Backend_Memcached.touch | public function touch($id, $extraLifetime)
{
if ($this->_options['compression']) {
$flag = MEMCACHE_COMPRESSED;
} else {
$flag = 0;
}
$tmp = $this->_memcache->get($id);
if (is_array($tmp)) {
$data = $tmp[0];
$mtime = $tmp[1];
... | php | public function touch($id, $extraLifetime)
{
if ($this->_options['compression']) {
$flag = MEMCACHE_COMPRESSED;
} else {
$flag = 0;
}
$tmp = $this->_memcache->get($id);
if (is_array($tmp)) {
$data = $tmp[0];
$mtime = $tmp[1];
... | [
"public",
"function",
"touch",
"(",
"$",
"id",
",",
"$",
"extraLifetime",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_options",
"[",
"'compression'",
"]",
")",
"{",
"$",
"flag",
"=",
"MEMCACHE_COMPRESSED",
";",
"}",
"else",
"{",
"$",
"flag",
"=",
"0",
... | Give (if possible) an extra lifetime to the given cache id
@param string $id cache id
@param int $extraLifetime
@return boolean true if ok | [
"Give",
"(",
"if",
"possible",
")",
"an",
"extra",
"lifetime",
"to",
"the",
"given",
"cache",
"id"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache/Backend/Memcached.php#L448-L476 | train | touches a cache record | [
30522,
2270,
3853,
3543,
1006,
1002,
8909,
1010,
1002,
4469,
15509,
7292,
1007,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
1035,
7047,
1031,
1005,
13379,
1005,
1033,
1007,
1063,
1002,
5210,
1027,
2033,
12458,
15395,
1035,
16620,
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... |
octobercms/october | modules/backend/classes/NavigationManager.php | NavigationManager.isMainMenuItemActive | public function isMainMenuItemActive($item)
{
return $this->contextOwner == $item->owner && $this->contextMainMenuItemCode == $item->code;
} | php | public function isMainMenuItemActive($item)
{
return $this->contextOwner == $item->owner && $this->contextMainMenuItemCode == $item->code;
} | [
"public",
"function",
"isMainMenuItemActive",
"(",
"$",
"item",
")",
"{",
"return",
"$",
"this",
"->",
"contextOwner",
"==",
"$",
"item",
"->",
"owner",
"&&",
"$",
"this",
"->",
"contextMainMenuItemCode",
"==",
"$",
"item",
"->",
"code",
";",
"}"
] | Determines if a main menu item is active.
@param mixed $item Specifies the item object.
@return boolean Returns true if the menu item is active. | [
"Determines",
"if",
"a",
"main",
"menu",
"item",
"is",
"active",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/NavigationManager.php#L410-L413 | train | Checks if the main menu item is active | [
30522,
2270,
3853,
2003,
24238,
3549,
14663,
14545,
15277,
1006,
1002,
8875,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
6123,
12384,
2121,
1027,
1027,
1002,
8875,
1011,
1028,
3954,
1004,
1004,
1002,
2023,
1011,
1028,
6123,
24238,
3549,
14663... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/MockArraySessionStorage.php | MockArraySessionStorage.start | public function start()
{
if ($this->started) {
return true;
}
if (empty($this->id)) {
$this->id = $this->generateId();
}
$this->loadSession();
return true;
} | php | public function start()
{
if ($this->started) {
return true;
}
if (empty($this->id)) {
$this->id = $this->generateId();
}
$this->loadSession();
return true;
} | [
"public",
"function",
"start",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"started",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"id",
")",
")",
"{",
"$",
"this",
"->",
"id",
"=",
"$",
"this",
"->",
"ge... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpFoundation/Session/Storage/MockArraySessionStorage.php#L79-L92 | train | Start the session | [
30522,
2270,
3853,
2707,
1006,
1007,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
2318,
1007,
1063,
2709,
2995,
1025,
1065,
2065,
1006,
4064,
1006,
1002,
2023,
1011,
1028,
8909,
1007,
1007,
1063,
1002,
2023,
1011,
1028,
8909,
1027,
1002,
202... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
spatie/laravel-permission | src/Traits/HasPermissions.php | HasPermissions.convertToPermissionModels | protected function convertToPermissionModels($permissions): array
{
if ($permissions instanceof Collection) {
$permissions = $permissions->all();
}
$permissions = is_array($permissions) ? $permissions : [$permissions];
return array_map(function ($permission) {
... | php | protected function convertToPermissionModels($permissions): array
{
if ($permissions instanceof Collection) {
$permissions = $permissions->all();
}
$permissions = is_array($permissions) ? $permissions : [$permissions];
return array_map(function ($permission) {
... | [
"protected",
"function",
"convertToPermissionModels",
"(",
"$",
"permissions",
")",
":",
"array",
"{",
"if",
"(",
"$",
"permissions",
"instanceof",
"Collection",
")",
"{",
"$",
"permissions",
"=",
"$",
"permissions",
"->",
"all",
"(",
")",
";",
"}",
"$",
"... | @param string|array|\Spatie\Permission\Contracts\Permission|\Illuminate\Support\Collection $permissions
@return array | [
"@param",
"string|array|",
"\\",
"Spatie",
"\\",
"Permission",
"\\",
"Contracts",
"\\",
"Permission|",
"\\",
"Illuminate",
"\\",
"Support",
"\\",
"Collection",
"$permissions"
] | 81dbe9d372d70c255b66a2727a235076509f8d45 | https://github.com/spatie/laravel-permission/blob/81dbe9d372d70c255b66a2727a235076509f8d45/src/Traits/HasPermissions.php#L93-L108 | train | Converts permission objects to permission models | [
30522,
5123,
3853,
10463,
14399,
2121,
25481,
5302,
9247,
2015,
1006,
1002,
6656,
2015,
1007,
1024,
9140,
1063,
2065,
30524,
2015,
1027,
2003,
1035,
9140,
1006,
1002,
6656,
2015,
1007,
1029,
1002,
6656,
2015,
1024,
1031,
1002,
6656,
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... |
dompdf/dompdf | src/Helpers.php | Helpers.encodeURI | public static function encodeURI($uri) {
$unescaped = array(
'%2D'=>'-','%5F'=>'_','%2E'=>'.','%21'=>'!', '%7E'=>'~',
'%2A'=>'*', '%27'=>"'", '%28'=>'(', '%29'=>')'
);
$reserved = array(
'%3B'=>';','%2C'=>',','%2F'=>'/','%3F'=>'?','%3A'=>':',
'%40'... | php | public static function encodeURI($uri) {
$unescaped = array(
'%2D'=>'-','%5F'=>'_','%2E'=>'.','%21'=>'!', '%7E'=>'~',
'%2A'=>'*', '%27'=>"'", '%28'=>'(', '%29'=>')'
);
$reserved = array(
'%3B'=>';','%2C'=>',','%2F'=>'/','%3F'=>'?','%3A'=>':',
'%40'... | [
"public",
"static",
"function",
"encodeURI",
"(",
"$",
"uri",
")",
"{",
"$",
"unescaped",
"=",
"array",
"(",
"'%2D'",
"=>",
"'-'",
",",
"'%5F'",
"=>",
"'_'",
",",
"'%2E'",
"=>",
"'.'",
",",
"'%21'",
"=>",
"'!'",
",",
"'%7E'",
"=>",
"'~'",
",",
"'%2... | Encodes a Uniform Resource Identifier (URI) by replacing non-alphanumeric
characters with a percent (%) sign followed by two hex digits, excepting
characters in the URI reserved character set.
Assumes that the URI is a complete URI, so does not encode reserved
characters that have special meaning in the URI.
Simulate... | [
"Encodes",
"a",
"Uniform",
"Resource",
"Identifier",
"(",
"URI",
")",
"by",
"replacing",
"non",
"-",
"alphanumeric",
"characters",
"with",
"a",
"percent",
"(",
"%",
")",
"sign",
"followed",
"by",
"two",
"hex",
"digits",
"excepting",
"characters",
"in",
"the"... | 75f13c700009be21a1965dc2c5b68a8708c22ba2 | https://github.com/dompdf/dompdf/blob/75f13c700009be21a1965dc2c5b68a8708c22ba2/src/Helpers.php#L228-L241 | train | Encodes the URI to its string representation | [
30522,
2270,
10763,
3853,
4372,
16044,
9496,
1006,
1002,
24471,
2072,
1007,
1063,
1002,
16655,
15782,
5669,
1027,
9140,
1006,
1005,
1003,
14134,
1005,
1027,
1028,
1005,
1011,
1005,
1010,
1005,
1003,
1019,
2546,
1005,
1027,
1028,
1005,
1035,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/CronArchive.php | CronArchive.logSection | private function logSection($title = "")
{
$this->logger->info("---------------------------");
if (!empty($title)) {
$this->logger->info($title);
}
} | php | private function logSection($title = "")
{
$this->logger->info("---------------------------");
if (!empty($title)) {
$this->logger->info($title);
}
} | [
"private",
"function",
"logSection",
"(",
"$",
"title",
"=",
"\"\"",
")",
"{",
"$",
"this",
"->",
"logger",
"->",
"info",
"(",
"\"---------------------------\"",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"title",
")",
")",
"{",
"$",
"this",
"->",
... | Logs a section in the output
@param string $title | [
"Logs",
"a",
"section",
"in",
"the",
"output"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/CronArchive.php#L1057-L1063 | train | Log section of the page | [
30522,
2797,
3853,
15664,
18491,
1006,
1002,
2516,
1027,
1000,
1000,
1007,
1063,
1002,
2023,
1011,
1028,
8833,
4590,
1011,
1028,
18558,
1006,
1000,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/DataTable/Renderer/Csv.php | Csv.renderDataTableMap | protected function renderDataTableMap($table, &$allColumns = array())
{
$str = '';
foreach ($table->getDataTables() as $currentLinePrefix => $dataTable) {
$returned = explode("\n", $this->renderTable($dataTable, $allColumns));
// get rid of the columns names
$ret... | php | protected function renderDataTableMap($table, &$allColumns = array())
{
$str = '';
foreach ($table->getDataTables() as $currentLinePrefix => $dataTable) {
$returned = explode("\n", $this->renderTable($dataTable, $allColumns));
// get rid of the columns names
$ret... | [
"protected",
"function",
"renderDataTableMap",
"(",
"$",
"table",
",",
"&",
"$",
"allColumns",
"=",
"array",
"(",
")",
")",
"{",
"$",
"str",
"=",
"''",
";",
"foreach",
"(",
"$",
"table",
"->",
"getDataTables",
"(",
")",
"as",
"$",
"currentLinePrefix",
... | Computes the output of the given data table array
@param DataTable\Map $table
@param array $allColumns
@return string | [
"Computes",
"the",
"output",
"of",
"the",
"given",
"data",
"table",
"array"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable/Renderer/Csv.php#L141-L167 | train | Render the data table | [
30522,
5123,
3853,
17552,
2850,
29336,
3085,
2863,
2361,
1006,
1002,
2795,
1010,
1004,
1002,
2035,
25778,
2819,
3619,
1027,
9140,
1006,
1007,
1007,
1063,
1002,
2358,
2099,
1027,
1005,
1005,
1025,
18921,
6776,
1006,
1002,
2795,
1011,
1028,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/backend/widgets/Form.php | Form.getField | public function getField($field)
{
if (isset($this->allFields[$field])) {
return $this->allFields[$field];
}
return null;
} | php | public function getField($field)
{
if (isset($this->allFields[$field])) {
return $this->allFields[$field];
}
return null;
} | [
"public",
"function",
"getField",
"(",
"$",
"field",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"allFields",
"[",
"$",
"field",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"allFields",
"[",
"$",
"field",
"]",
";",
"}",
"return",
"... | Get a specified field object
@param string $field
@return mixed | [
"Get",
"a",
"specified",
"field",
"object"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/Form.php#L1007-L1014 | train | Get Field by Field Name | [
30522,
2270,
3853,
2131,
3790,
1006,
1002,
2492,
1007,
1063,
2065,
1006,
26354,
3388,
1006,
1002,
2023,
1011,
1028,
2035,
15155,
1031,
1002,
2492,
1033,
1007,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
2035,
15155,
1031,
1002,
2492,
1033,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Database/Eloquent/Relations/HasManyThrough.php | HasManyThrough.chunkById | public function chunkById($count, callable $callback, $column = null, $alias = null)
{
$column = $column ?? $this->getRelated()->getQualifiedKeyName();
$alias = $alias ?? $this->getRelated()->getKeyName();
return $this->prepareQueryBuilder()->chunkById($count, $callback, $column, $alias);
... | php | public function chunkById($count, callable $callback, $column = null, $alias = null)
{
$column = $column ?? $this->getRelated()->getQualifiedKeyName();
$alias = $alias ?? $this->getRelated()->getKeyName();
return $this->prepareQueryBuilder()->chunkById($count, $callback, $column, $alias);
... | [
"public",
"function",
"chunkById",
"(",
"$",
"count",
",",
"callable",
"$",
"callback",
",",
"$",
"column",
"=",
"null",
",",
"$",
"alias",
"=",
"null",
")",
"{",
"$",
"column",
"=",
"$",
"column",
"??",
"$",
"this",
"->",
"getRelated",
"(",
")",
"... | Chunk the results of a query by comparing numeric IDs.
@param int $count
@param callable $callback
@param string|null $column
@param string|null $alias
@return bool | [
"Chunk",
"the",
"results",
"of",
"a",
"query",
"by",
"comparing",
"numeric",
"IDs",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Relations/HasManyThrough.php#L441-L448 | train | Returns a query builder to fetch a chunk of objects by id. | [
30522,
2270,
3853,
20000,
3762,
3593,
1006,
1002,
4175,
1010,
2655,
3085,
1002,
2655,
5963,
1010,
1002,
5930,
1027,
19701,
1010,
1002,
14593,
1027,
19701,
1007,
1063,
1002,
5930,
1027,
1002,
5930,
1029,
1029,
1002,
2023,
1011,
1028,
2131,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Form/Extension/DataCollector/FormDataCollector.php | FormDataCollector.getCasters | protected function getCasters()
{
return parent::getCasters() + [
\Exception::class => function (\Exception $e, array $a, Stub $s) {
foreach (["\0Exception\0previous", "\0Exception\0trace"] as $k) {
if (isset($a[$k])) {
unset($a[$k]);
... | php | protected function getCasters()
{
return parent::getCasters() + [
\Exception::class => function (\Exception $e, array $a, Stub $s) {
foreach (["\0Exception\0previous", "\0Exception\0trace"] as $k) {
if (isset($a[$k])) {
unset($a[$k]);
... | [
"protected",
"function",
"getCasters",
"(",
")",
"{",
"return",
"parent",
"::",
"getCasters",
"(",
")",
"+",
"[",
"\\",
"Exception",
"::",
"class",
"=>",
"function",
"(",
"\\",
"Exception",
"$",
"e",
",",
"array",
"$",
"a",
",",
"Stub",
"$",
"s",
")"... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/Extension/DataCollector/FormDataCollector.php#L253-L281 | train | Returns all casters | [
30522,
5123,
3853,
2131,
25490,
2015,
1006,
1007,
1063,
2709,
6687,
1024,
1024,
2131,
25490,
2015,
1006,
1007,
1009,
1031,
1032,
6453,
1024,
1024,
2465,
1027,
1028,
3853,
1006,
1032,
6453,
1002,
1041,
1010,
9140,
1002,
1037,
1010,
24646,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/ReportsProvider.php | ReportsProvider.factory | public static function factory($module, $action)
{
$listApiToReport = self::getMapOfModuleActionsToReport();
$api = $module . '.' . ucfirst($action);
if (!array_key_exists($api, $listApiToReport)) {
return null;
}
$klassName = $listApiToReport[$api];
re... | php | public static function factory($module, $action)
{
$listApiToReport = self::getMapOfModuleActionsToReport();
$api = $module . '.' . ucfirst($action);
if (!array_key_exists($api, $listApiToReport)) {
return null;
}
$klassName = $listApiToReport[$api];
re... | [
"public",
"static",
"function",
"factory",
"(",
"$",
"module",
",",
"$",
"action",
")",
"{",
"$",
"listApiToReport",
"=",
"self",
"::",
"getMapOfModuleActionsToReport",
"(",
")",
";",
"$",
"api",
"=",
"$",
"module",
".",
"'.'",
".",
"ucfirst",
"(",
"$",
... | Get an instance of a specific report belonging to the given module and having the given action.
@param string $module
@param string $action
@return null|\Piwik\Plugin\Report
@api | [
"Get",
"an",
"instance",
"of",
"a",
"specific",
"report",
"belonging",
"to",
"the",
"given",
"module",
"and",
"having",
"the",
"given",
"action",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Plugin/ReportsProvider.php#L34-L46 | train | Factory method to create a new instance of the class that implements the module and action | [
30522,
2270,
10763,
3853,
4713,
1006,
1002,
11336,
1010,
1002,
2895,
1007,
1063,
1002,
2862,
9331,
15660,
13699,
11589,
1027,
2969,
1024,
1024,
2131,
2863,
6873,
16715,
7716,
9307,
18908,
8496,
19277,
6442,
1006,
1007,
1025,
1002,
17928,
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/Columns/MetricsList.php | MetricsList.get | public static function get()
{
$cache = Cache::getTransientCache();
$cacheKey = CacheId::siteAware('MetricsList');
if ($cache->contains($cacheKey)) {
return $cache->fetch($cacheKey);
}
$list = new static;
/**
* Triggered to add new metrics that... | php | public static function get()
{
$cache = Cache::getTransientCache();
$cacheKey = CacheId::siteAware('MetricsList');
if ($cache->contains($cacheKey)) {
return $cache->fetch($cacheKey);
}
$list = new static;
/**
* Triggered to add new metrics that... | [
"public",
"static",
"function",
"get",
"(",
")",
"{",
"$",
"cache",
"=",
"Cache",
"::",
"getTransientCache",
"(",
")",
";",
"$",
"cacheKey",
"=",
"CacheId",
"::",
"siteAware",
"(",
"'MetricsList'",
")",
";",
"if",
"(",
"$",
"cache",
"->",
"contains",
"... | Get all metrics defined in the Piwik platform.
@ignore
@return static | [
"Get",
"all",
"metrics",
"defined",
"in",
"the",
"Piwik",
"platform",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Columns/MetricsList.php#L103-L189 | train | Returns the list of all metrics that can be added to the list | [
30522,
2270,
10763,
3853,
2131,
1006,
1007,
1063,
1002,
17053,
1027,
17053,
1024,
1024,
2131,
6494,
3619,
11638,
3540,
5403,
1006,
1007,
1025,
1002,
17053,
14839,
1027,
17053,
3593,
1024,
1024,
2609,
10830,
2890,
1006,
1005,
12046,
14540,
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/Validator/Context/ExecutionContext.php | ExecutionContext.buildViolation | public function buildViolation($message, array $parameters = [])
{
return new ConstraintViolationBuilder(
$this->violations,
$this->constraint,
$message,
$parameters,
$this->root,
$this->propertyPath,
$this->value,
... | php | public function buildViolation($message, array $parameters = [])
{
return new ConstraintViolationBuilder(
$this->violations,
$this->constraint,
$message,
$parameters,
$this->root,
$this->propertyPath,
$this->value,
... | [
"public",
"function",
"buildViolation",
"(",
"$",
"message",
",",
"array",
"$",
"parameters",
"=",
"[",
"]",
")",
"{",
"return",
"new",
"ConstraintViolationBuilder",
"(",
"$",
"this",
"->",
"violations",
",",
"$",
"this",
"->",
"constraint",
",",
"$",
"mes... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Validator/Context/ExecutionContext.php#L204-L217 | train | Returns ConstraintViolationBuilder which will create a ConstraintViolation object for the given constraint and parameters. | [
30522,
2270,
3853,
3857,
25500,
13490,
1006,
1002,
4471,
1010,
9140,
1002,
11709,
1027,
1031,
1033,
1007,
1063,
2709,
2047,
27142,
25500,
13490,
8569,
23891,
2099,
1006,
1002,
2023,
1011,
1028,
13302,
1010,
1002,
2023,
1011,
30524,
1028,
54... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Notifications/Channels/MailChannel.php | MailChannel.send | public function send($notifiable, Notification $notification)
{
$message = $notification->toMail($notifiable);
if (! $notifiable->routeNotificationFor('mail', $notification) &&
! $message instanceof Mailable) {
return;
}
if ($message instanceof Mailable) {
... | php | public function send($notifiable, Notification $notification)
{
$message = $notification->toMail($notifiable);
if (! $notifiable->routeNotificationFor('mail', $notification) &&
! $message instanceof Mailable) {
return;
}
if ($message instanceof Mailable) {
... | [
"public",
"function",
"send",
"(",
"$",
"notifiable",
",",
"Notification",
"$",
"notification",
")",
"{",
"$",
"message",
"=",
"$",
"notification",
"->",
"toMail",
"(",
"$",
"notifiable",
")",
";",
"if",
"(",
"!",
"$",
"notifiable",
"->",
"routeNotificatio... | Send the given notification.
@param mixed $notifiable
@param \Illuminate\Notifications\Notification $notification
@return void | [
"Send",
"the",
"given",
"notification",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Notifications/Channels/MailChannel.php#L49-L67 | train | Send a Notification to the mail | [
30522,
2270,
3853,
4604,
1006,
1002,
2025,
10128,
19210,
1010,
26828,
1002,
26828,
1007,
1063,
1002,
4471,
1027,
1002,
26828,
1011,
1028,
3419,
12502,
1006,
1002,
2025,
10128,
19210,
1007,
1025,
2065,
1006,
999,
1002,
2025,
10128,
19210,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Common/Scheduler/Scheduler.php | Scheduler.saveJobStates | private function saveJobStates()
{
$now = time();
$new_states = [];
foreach ($this->jobs_run as $job) {
if ($job->isSuccessful()) {
$new_states[$job->getId()] = ['state' => 'success', 'last-run' => $now];
$this->pushExecutedJob($job);
... | php | private function saveJobStates()
{
$now = time();
$new_states = [];
foreach ($this->jobs_run as $job) {
if ($job->isSuccessful()) {
$new_states[$job->getId()] = ['state' => 'success', 'last-run' => $now];
$this->pushExecutedJob($job);
... | [
"private",
"function",
"saveJobStates",
"(",
")",
"{",
"$",
"now",
"=",
"time",
"(",
")",
";",
"$",
"new_states",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"jobs_run",
"as",
"$",
"job",
")",
"{",
"if",
"(",
"$",
"job",
"->",
"isSucce... | Save job states to statys file | [
"Save",
"job",
"states",
"to",
"statys",
"file"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Scheduler/Scheduler.php#L276-L293 | train | Save Job States | [
30522,
2797,
3853,
3828,
5558,
5910,
12259,
2015,
1006,
1007,
1063,
1002,
2085,
1027,
2051,
1006,
1007,
1025,
1002,
2047,
1035,
2163,
1027,
1031,
1033,
1025,
18921,
6776,
1006,
1002,
2023,
1011,
1028,
5841,
1035,
2448,
2004,
1002,
3105,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Common/Page/Pages.php | Pages.root | public function root()
{
/** @var UniformResourceLocator $locator */
$locator = $this->grav['locator'];
return $this->instances[rtrim($locator->findResource('page://'), DS)];
} | php | public function root()
{
/** @var UniformResourceLocator $locator */
$locator = $this->grav['locator'];
return $this->instances[rtrim($locator->findResource('page://'), DS)];
} | [
"public",
"function",
"root",
"(",
")",
"{",
"/** @var UniformResourceLocator $locator */",
"$",
"locator",
"=",
"$",
"this",
"->",
"grav",
"[",
"'locator'",
"]",
";",
"return",
"$",
"this",
"->",
"instances",
"[",
"rtrim",
"(",
"$",
"locator",
"->",
"findRe... | Get root page.
@return PageInterface | [
"Get",
"root",
"page",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Page/Pages.php#L567-L573 | train | Get root page | [
30522,
2270,
3853,
7117,
1006,
1007,
1063,
1013,
1008,
1008,
1030,
13075,
6375,
6072,
8162,
29109,
24755,
4263,
1002,
8840,
11266,
2953,
1008,
1013,
1002,
8840,
11266,
2953,
1027,
1002,
2023,
1011,
1028,
24665,
11431,
1031,
1005,
8840,
1126... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Model.php | Model.setKeysForSaveQuery | protected function setKeysForSaveQuery(Builder $query)
{
$query->where($this->getKeyName(), '=', $this->getKeyForSaveQuery());
return $query;
} | php | protected function setKeysForSaveQuery(Builder $query)
{
$query->where($this->getKeyName(), '=', $this->getKeyForSaveQuery());
return $query;
} | [
"protected",
"function",
"setKeysForSaveQuery",
"(",
"Builder",
"$",
"query",
")",
"{",
"$",
"query",
"->",
"where",
"(",
"$",
"this",
"->",
"getKeyName",
"(",
")",
",",
"'='",
",",
"$",
"this",
"->",
"getKeyForSaveQuery",
"(",
")",
")",
";",
"return",
... | Set the keys for a save update query.
@param \Illuminate\Database\Eloquent\Builder $query
@return \Illuminate\Database\Eloquent\Builder | [
"Set",
"the",
"keys",
"for",
"a",
"save",
"update",
"query",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Model.php#L757-L762 | train | Set the keys for save query | [
30522,
5123,
3853,
2275,
14839,
22747,
5668,
10696,
4226,
2854,
1006,
12508,
1002,
23032,
1007,
1063,
1002,
23032,
1011,
1028,
2073,
1006,
1002,
2023,
1011,
1028,
2131,
14839,
18442,
1006,
1007,
1010,
1005,
1027,
1005,
1010,
1002,
2023,
101... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Log/LogManager.php | LogManager.createErrorlogDriver | protected function createErrorlogDriver(array $config)
{
return new Monolog($this->parseChannel($config), [
$this->prepareHandler(new ErrorLogHandler(
$config['type'] ?? ErrorLogHandler::OPERATING_SYSTEM, $this->level($config)
)),
]);
} | php | protected function createErrorlogDriver(array $config)
{
return new Monolog($this->parseChannel($config), [
$this->prepareHandler(new ErrorLogHandler(
$config['type'] ?? ErrorLogHandler::OPERATING_SYSTEM, $this->level($config)
)),
]);
} | [
"protected",
"function",
"createErrorlogDriver",
"(",
"array",
"$",
"config",
")",
"{",
"return",
"new",
"Monolog",
"(",
"$",
"this",
"->",
"parseChannel",
"(",
"$",
"config",
")",
",",
"[",
"$",
"this",
"->",
"prepareHandler",
"(",
"new",
"ErrorLogHandler",... | Create an instance of the "error log" log driver.
@param array $config
@return \Psr\Log\LoggerInterface | [
"Create",
"an",
"instance",
"of",
"the",
"error",
"log",
"log",
"driver",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Log/LogManager.php#L307-L314 | train | Create an instance of the error log driver | [
30522,
5123,
3853,
3443,
2121,
29165,
21197,
23663,
2099,
1006,
9140,
1002,
9530,
8873,
2290,
1007,
1063,
2709,
2047,
18847,
21197,
1006,
1002,
2023,
1011,
1028,
11968,
3366,
26058,
1006,
1002,
9530,
8873,
2290,
1007,
1010,
1031,
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/Config/Definition/Builder/TreeBuilder.php | TreeBuilder.root | public function root($name, $type = 'array', NodeBuilder $builder = null)
{
@trigger_error(sprintf('The "%s()" method called for the "%s" configuration is deprecated since Symfony 4.3, pass the root name to the constructor instead.', __METHOD__, $name), E_USER_DEPRECATED);
$builder = $builder ?: ne... | php | public function root($name, $type = 'array', NodeBuilder $builder = null)
{
@trigger_error(sprintf('The "%s()" method called for the "%s" configuration is deprecated since Symfony 4.3, pass the root name to the constructor instead.', __METHOD__, $name), E_USER_DEPRECATED);
$builder = $builder ?: ne... | [
"public",
"function",
"root",
"(",
"$",
"name",
",",
"$",
"type",
"=",
"'array'",
",",
"NodeBuilder",
"$",
"builder",
"=",
"null",
")",
"{",
"@",
"trigger_error",
"(",
"sprintf",
"(",
"'The \"%s()\" method called for the \"%s\" configuration is deprecated since Symfon... | Creates the root node.
@param string $name The name of the root node
@param string $type The type of the root node
@param NodeBuilder $builder A custom node builder instance
@return ArrayNodeDefinition|NodeDefinition The root node (as an ArrayNodeDefinition when the type is 'array')
@throws \RuntimeE... | [
"Creates",
"the",
"root",
"node",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Config/Definition/Builder/TreeBuilder.php#L50-L57 | train | This method sets the root node of the tree | [
30522,
2270,
3853,
7117,
1006,
1002,
2171,
1010,
1002,
2828,
1027,
1005,
9140,
1005,
1010,
13045,
8569,
23891,
2099,
1002,
12508,
1027,
19701,
1007,
1063,
1030,
9495,
1035,
7561,
1006,
9043,
2546,
1006,
1005,
1996,
1000,
1003,
1055,
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... |
dompdf/dompdf | src/Cellmap.php | Cellmap.get_spanned_cells | public function get_spanned_cells(Frame $frame)
{
$key = $frame->get_id();
if (isset($this->_frames[$key])) {
return $this->_frames[$key];
}
return null;
} | php | public function get_spanned_cells(Frame $frame)
{
$key = $frame->get_id();
if (isset($this->_frames[$key])) {
return $this->_frames[$key];
}
return null;
} | [
"public",
"function",
"get_spanned_cells",
"(",
"Frame",
"$",
"frame",
")",
"{",
"$",
"key",
"=",
"$",
"frame",
"->",
"get_id",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_frames",
"[",
"$",
"key",
"]",
")",
")",
"{",
"return",
"... | @param Frame $frame
@return null|Frame | [
"@param",
"Frame",
"$frame"
] | 75f13c700009be21a1965dc2c5b68a8708c22ba2 | https://github.com/dompdf/dompdf/blob/75f13c700009be21a1965dc2c5b68a8708c22ba2/src/Cellmap.php#L314-L323 | train | Get the spanned cells for a Frame | [
30522,
2270,
3853,
2131,
1035,
18212,
1035,
4442,
1006,
4853,
1002,
4853,
1007,
1063,
1002,
3145,
1027,
1002,
4853,
1011,
1028,
2131,
1035,
8909,
1006,
1007,
1025,
2065,
1006,
26354,
3388,
1006,
1002,
2023,
1011,
1028,
1035,
11048,
1031,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.