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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
laravel/framework | src/Illuminate/Database/Eloquent/Builder.php | Builder.withoutGlobalScopes | public function withoutGlobalScopes(array $scopes = null)
{
if (! is_array($scopes)) {
$scopes = array_keys($this->scopes);
}
foreach ($scopes as $scope) {
$this->withoutGlobalScope($scope);
}
return $this;
} | php | public function withoutGlobalScopes(array $scopes = null)
{
if (! is_array($scopes)) {
$scopes = array_keys($this->scopes);
}
foreach ($scopes as $scope) {
$this->withoutGlobalScope($scope);
}
return $this;
} | [
"public",
"function",
"withoutGlobalScopes",
"(",
"array",
"$",
"scopes",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"scopes",
")",
")",
"{",
"$",
"scopes",
"=",
"array_keys",
"(",
"$",
"this",
"->",
"scopes",
")",
";",
"}",
"foreac... | Remove all or passed registered global scopes.
@param array|null $scopes
@return $this | [
"Remove",
"all",
"or",
"passed",
"registered",
"global",
"scopes",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Builder.php#L157-L168 | train | Remove all global scopes from the current context | [
30522,
2270,
3853,
2302,
23296,
16429,
9777,
16186,
2015,
1006,
9140,
1002,
9531,
2015,
1027,
19701,
1007,
1063,
2065,
1006,
999,
2003,
1035,
9140,
1006,
1002,
9531,
2015,
1007,
1007,
1063,
1002,
9531,
2015,
1027,
9140,
1035,
6309,
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... |
barryvdh/laravel-debugbar | src/DataCollector/MultiAuthCollector.php | MultiAuthCollector.getUserInformation | protected function getUserInformation($user = null)
{
// Defaults
if (is_null($user)) {
return [
'name' => 'Guest',
'user' => ['guest' => true],
];
}
// The default auth identifer is the ID number, which isn't all that
... | php | protected function getUserInformation($user = null)
{
// Defaults
if (is_null($user)) {
return [
'name' => 'Guest',
'user' => ['guest' => true],
];
}
// The default auth identifer is the ID number, which isn't all that
... | [
"protected",
"function",
"getUserInformation",
"(",
"$",
"user",
"=",
"null",
")",
"{",
"// Defaults",
"if",
"(",
"is_null",
"(",
"$",
"user",
")",
")",
"{",
"return",
"[",
"'name'",
"=>",
"'Guest'",
",",
"'user'",
"=>",
"[",
"'guest'",
"=>",
"true",
"... | Get displayed user information
@param \Illuminate\Auth\UserInterface $user
@return array | [
"Get",
"displayed",
"user",
"information"
] | 2d195779ea4f809f69764a795e2ec371dbb76a96 | https://github.com/barryvdh/laravel-debugbar/blob/2d195779ea4f809f69764a795e2ec371dbb76a96/src/DataCollector/MultiAuthCollector.php#L103-L131 | train | Get user information | [
30522,
5123,
3853,
2131,
20330,
2378,
14192,
3370,
1006,
1002,
5310,
1027,
19701,
1007,
1063,
1013,
1013,
12398,
2015,
2065,
1006,
2003,
1035,
19701,
1006,
1002,
5310,
1007,
1007,
1063,
2709,
1031,
1005,
2171,
1005,
1027,
1028,
1005,
4113,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/Zend/Db/Adapter/Db2.php | Zend_Db_Adapter_Db2._connect | protected function _connect()
{
if (is_resource($this->_connection)) {
// connection already exists
return;
}
if (!extension_loaded('ibm_db2')) {
/**
* @see Zend_Db_Adapter_Db2_Exception
*/
// require_once 'Zend/Db/Ad... | php | protected function _connect()
{
if (is_resource($this->_connection)) {
// connection already exists
return;
}
if (!extension_loaded('ibm_db2')) {
/**
* @see Zend_Db_Adapter_Db2_Exception
*/
// require_once 'Zend/Db/Ad... | [
"protected",
"function",
"_connect",
"(",
")",
"{",
"if",
"(",
"is_resource",
"(",
"$",
"this",
"->",
"_connection",
")",
")",
"{",
"// connection already exists",
"return",
";",
"}",
"if",
"(",
"!",
"extension_loaded",
"(",
"'ibm_db2'",
")",
")",
"{",
"/*... | Creates a connection resource.
@return void | [
"Creates",
"a",
"connection",
"resource",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Adapter/Db2.php#L119-L198 | train | Connect to the database | [
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,
9980... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/ServiceProvider.php | ServiceProvider.register | public function register()
{
parent::register('system');
$this->registerSingletons();
$this->registerPrivilegedActions();
/*
* Register all plugins
*/
PluginManager::instance()->registerAll();
$this->registerConsole();
$this->registerError... | php | public function register()
{
parent::register('system');
$this->registerSingletons();
$this->registerPrivilegedActions();
/*
* Register all plugins
*/
PluginManager::instance()->registerAll();
$this->registerConsole();
$this->registerError... | [
"public",
"function",
"register",
"(",
")",
"{",
"parent",
"::",
"register",
"(",
"'system'",
")",
";",
"$",
"this",
"->",
"registerSingletons",
"(",
")",
";",
"$",
"this",
"->",
"registerPrivilegedActions",
"(",
")",
";",
"/*\n * Register all plugins\n ... | Register the service provider.
@return void | [
"Register",
"the",
"service",
"provider",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/ServiceProvider.php#L37-L77 | train | Registers all modules | [
30522,
2270,
3853,
4236,
1006,
1007,
1063,
6687,
1024,
1024,
4236,
1006,
1005,
2291,
1005,
1007,
1025,
1002,
2023,
1011,
1028,
18687,
2075,
19263,
2015,
1006,
1007,
1025,
1002,
2023,
1011,
1028,
4236,
18098,
12848,
9463,
5999,
18908,
8496,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Connectors/Connector.php | Connector.createPdoConnection | protected function createPdoConnection($dsn, $username, $password, $options)
{
if (class_exists(PDOConnection::class) && ! $this->isPersistentConnection($options)) {
return new PDOConnection($dsn, $username, $password, $options);
}
return new PDO($dsn, $username, $password, $opt... | php | protected function createPdoConnection($dsn, $username, $password, $options)
{
if (class_exists(PDOConnection::class) && ! $this->isPersistentConnection($options)) {
return new PDOConnection($dsn, $username, $password, $options);
}
return new PDO($dsn, $username, $password, $opt... | [
"protected",
"function",
"createPdoConnection",
"(",
"$",
"dsn",
",",
"$",
"username",
",",
"$",
"password",
",",
"$",
"options",
")",
"{",
"if",
"(",
"class_exists",
"(",
"PDOConnection",
"::",
"class",
")",
"&&",
"!",
"$",
"this",
"->",
"isPersistentConn... | Create a new PDO connection instance.
@param string $dsn
@param string $username
@param string $password
@param array $options
@return \PDO | [
"Create",
"a",
"new",
"PDO",
"connection",
"instance",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Connectors/Connector.php#L64-L71 | train | Create a PDO connection | [
30522,
5123,
3853,
3443,
17299,
24163,
10087,
7542,
1006,
1002,
16233,
2078,
1010,
1002,
5310,
18442,
1010,
1002,
20786,
1010,
1002,
7047,
1007,
1063,
2065,
1006,
2465,
1035,
6526,
1006,
22851,
24163,
10087,
7542,
1024,
1024,
2465,
1007,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/Plugin/Controller.php | Controller.getLastUnitGraphAcrossPlugins | protected function getLastUnitGraphAcrossPlugins($currentModuleName, $currentControllerAction, $columnsToDisplay = false,
$selectableColumns = array(), $reportDocumentation = false,
$apiMethod = 'API.get')
{
... | php | protected function getLastUnitGraphAcrossPlugins($currentModuleName, $currentControllerAction, $columnsToDisplay = false,
$selectableColumns = array(), $reportDocumentation = false,
$apiMethod = 'API.get')
{
... | [
"protected",
"function",
"getLastUnitGraphAcrossPlugins",
"(",
"$",
"currentModuleName",
",",
"$",
"currentControllerAction",
",",
"$",
"columnsToDisplay",
"=",
"false",
",",
"$",
"selectableColumns",
"=",
"array",
"(",
")",
",",
"$",
"reportDocumentation",
"=",
"fa... | Same as {@link getLastUnitGraph()}, but will set some properties of the ViewDataTable
object based on the arguments supplied.
@param string $currentModuleName The name of the current plugin.
@param string $currentControllerAction The name of the action that renders the desired
report.
@param array $columnsToDisplay Th... | [
"Same",
"as",
"{",
"@link",
"getLastUnitGraph",
"()",
"}",
"but",
"will",
"set",
"some",
"properties",
"of",
"the",
"ViewDataTable",
"object",
"based",
"on",
"the",
"arguments",
"supplied",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Plugin/Controller.php#L390-L430 | train | This method is used to get the last unit graph of the API. | [
30522,
5123,
3853,
2131,
8523,
8525,
3490,
2102,
14413,
6305,
25725,
24759,
15916,
7076,
1006,
1002,
2783,
5302,
8566,
20844,
4168,
1010,
1002,
2783,
8663,
13181,
10820,
18908,
3258,
1010,
1002,
7753,
3406,
10521,
13068,
1027,
6270,
1010,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Bridge/Monolog/Handler/SwiftMailerHandler.php | SwiftMailerHandler.flushMemorySpool | private function flushMemorySpool()
{
$mailerTransport = $this->mailer->getTransport();
if (!$mailerTransport instanceof \Swift_Transport_SpoolTransport) {
return;
}
$spool = $mailerTransport->getSpool();
if (!$spool instanceof \Swift_MemorySpool) {
r... | php | private function flushMemorySpool()
{
$mailerTransport = $this->mailer->getTransport();
if (!$mailerTransport instanceof \Swift_Transport_SpoolTransport) {
return;
}
$spool = $mailerTransport->getSpool();
if (!$spool instanceof \Swift_MemorySpool) {
r... | [
"private",
"function",
"flushMemorySpool",
"(",
")",
"{",
"$",
"mailerTransport",
"=",
"$",
"this",
"->",
"mailer",
"->",
"getTransport",
"(",
")",
";",
"if",
"(",
"!",
"$",
"mailerTransport",
"instanceof",
"\\",
"Swift_Transport_SpoolTransport",
")",
"{",
"re... | Flushes the mail queue if a memory spool is used. | [
"Flushes",
"the",
"mail",
"queue",
"if",
"a",
"memory",
"spool",
"is",
"used",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bridge/Monolog/Handler/SwiftMailerHandler.php#L75-L92 | train | Flushes the memory spool of the mail queue | [
30522,
2797,
3853,
13862,
4168,
5302,
24769,
16869,
1006,
1007,
1063,
1002,
5653,
8743,
5521,
20205,
1027,
1002,
2023,
1011,
1028,
5653,
2121,
1011,
1028,
2131,
6494,
3619,
6442,
1006,
1007,
1025,
2065,
1006,
999,
1002,
5653,
8743,
5521,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Console/Migrations/BaseCommand.php | BaseCommand.getMigrationPaths | protected function getMigrationPaths()
{
// Here, we will check to see if a path option has been defined. If it has we will
// use the path relative to the root of the installation folder so our database
// migrations may be run for any customized path from within the application.
if... | php | protected function getMigrationPaths()
{
// Here, we will check to see if a path option has been defined. If it has we will
// use the path relative to the root of the installation folder so our database
// migrations may be run for any customized path from within the application.
if... | [
"protected",
"function",
"getMigrationPaths",
"(",
")",
"{",
"// Here, we will check to see if a path option has been defined. If it has we will",
"// use the path relative to the root of the installation folder so our database",
"// migrations may be run for any customized path from within the appl... | Get all of the migration paths.
@return array | [
"Get",
"all",
"of",
"the",
"migration",
"paths",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Console/Migrations/BaseCommand.php#L14-L30 | train | Get the migration paths | [
30522,
5123,
3853,
2131,
4328,
29397,
15069,
2015,
1006,
1007,
1063,
1013,
1013,
2182,
1010,
2057,
2097,
4638,
2000,
2156,
2065,
1037,
4130,
5724,
2038,
2042,
4225,
1012,
2065,
2009,
2038,
2057,
2097,
1013,
1013,
2224,
1996,
4130,
5816,
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/Filesystem/Filesystem.php | Filesystem.readlink | public function readlink($path, $canonicalize = false)
{
if (!$canonicalize && !is_link($path)) {
return;
}
if ($canonicalize) {
if (!$this->exists($path)) {
return;
}
if ('\\' === \DIRECTORY_SEPARATOR) {
$path... | php | public function readlink($path, $canonicalize = false)
{
if (!$canonicalize && !is_link($path)) {
return;
}
if ($canonicalize) {
if (!$this->exists($path)) {
return;
}
if ('\\' === \DIRECTORY_SEPARATOR) {
$path... | [
"public",
"function",
"readlink",
"(",
"$",
"path",
",",
"$",
"canonicalize",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"$",
"canonicalize",
"&&",
"!",
"is_link",
"(",
"$",
"path",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"$",
"canonicalize",
")... | Resolves links in paths.
With $canonicalize = false (default)
- if $path does not exist or is not a link, returns null
- if $path is a link, returns the next direct target of the link without considering the existence of the target
With $canonicalize = true
- if $path does not exist, returns null
- if $path exists, r... | [
"Resolves",
"links",
"in",
"paths",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Filesystem/Filesystem.php#L414-L437 | train | Read link. | [
30522,
2270,
3853,
3191,
13767,
1006,
1002,
4130,
1010,
1002,
18562,
4697,
1027,
6270,
1007,
1063,
2065,
1006,
999,
1002,
18562,
4697,
1004,
1004,
999,
2003,
1035,
4957,
1006,
1002,
4130,
1007,
1007,
1063,
2709,
1025,
1065,
2065,
1006,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
dompdf/dompdf | src/Dompdf.php | Dompdf.loadHtmlFile | public function loadHtmlFile($file)
{
$this->saveLocale();
if (!$this->protocol && !$this->baseHost && !$this->basePath) {
list($this->protocol, $this->baseHost, $this->basePath) = Helpers::explode_url($file);
}
$protocol = strtolower($this->protocol);
if ( !in_... | php | public function loadHtmlFile($file)
{
$this->saveLocale();
if (!$this->protocol && !$this->baseHost && !$this->basePath) {
list($this->protocol, $this->baseHost, $this->basePath) = Helpers::explode_url($file);
}
$protocol = strtolower($this->protocol);
if ( !in_... | [
"public",
"function",
"loadHtmlFile",
"(",
"$",
"file",
")",
"{",
"$",
"this",
"->",
"saveLocale",
"(",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"protocol",
"&&",
"!",
"$",
"this",
"->",
"baseHost",
"&&",
"!",
"$",
"this",
"->",
"basePath",
")"... | Loads an HTML file
Parse errors are stored in the global array _dompdf_warnings.
@param string $file a filename or url to load
@throws Exception | [
"Loads",
"an",
"HTML",
"file",
"Parse",
"errors",
"are",
"stored",
"in",
"the",
"global",
"array",
"_dompdf_warnings",
"."
] | 75f13c700009be21a1965dc2c5b68a8708c22ba2 | https://github.com/dompdf/dompdf/blob/75f13c700009be21a1965dc2c5b68a8708c22ba2/src/Dompdf.php#L349-L402 | train | Load HTML File | [
30522,
2270,
3853,
7170,
11039,
19968,
8873,
2571,
1006,
1002,
5371,
1007,
1063,
1002,
2023,
1011,
1028,
3828,
4135,
9289,
2063,
1006,
1007,
1025,
2065,
1006,
999,
1002,
2023,
1011,
1028,
8778,
1004,
1004,
999,
1002,
2023,
1011,
1028,
291... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/AbstractNormalizer.php | AbstractNormalizer.handleCircularReference | protected function handleCircularReference($object/*, string $format = null, array $context = []*/)
{
if (\func_num_args() < 2 && __CLASS__ !== \get_class($this) && __CLASS__ !== (new \ReflectionMethod($this, __FUNCTION__))->getDeclaringClass()->getName() && !$this instanceof \PHPUnit\Framework\MockObject\M... | php | protected function handleCircularReference($object/*, string $format = null, array $context = []*/)
{
if (\func_num_args() < 2 && __CLASS__ !== \get_class($this) && __CLASS__ !== (new \ReflectionMethod($this, __FUNCTION__))->getDeclaringClass()->getName() && !$this instanceof \PHPUnit\Framework\MockObject\M... | [
"protected",
"function",
"handleCircularReference",
"(",
"$",
"object",
"/*, string $format = null, array $context = []*/",
")",
"{",
"if",
"(",
"\\",
"func_num_args",
"(",
")",
"<",
"2",
"&&",
"__CLASS__",
"!==",
"\\",
"get_class",
"(",
"$",
"this",
")",
"&&",
... | Handles a circular reference.
If a circular reference handler is set, it will be called. Otherwise, a
{@class CircularReferenceException} will be thrown.
@final since Symfony 4.2
@param object $object
@param string|null $format
@param array $context
@return mixed
@throws CircularReferenceException | [
"Handles",
"a",
"circular",
"reference",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Serializer/Normalizer/AbstractNormalizer.php#L319-L333 | train | Handles circular references | [
30522,
5123,
3853,
5047,
6895,
11890,
7934,
2890,
25523,
1006,
1002,
4874,
1013,
1008,
1010,
5164,
1002,
4289,
1027,
19701,
1010,
9140,
1002,
6123,
1027,
1031,
1033,
1008,
1013,
1007,
1063,
2065,
1006,
1032,
4569,
2278,
1035,
16371,
2213,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Response.php | Response.isRedirect | public function isRedirect(string $location = null): bool
{
return \in_array($this->statusCode, [201, 301, 302, 303, 307, 308]) && (null === $location ?: $location == $this->headers->get('Location'));
} | php | public function isRedirect(string $location = null): bool
{
return \in_array($this->statusCode, [201, 301, 302, 303, 307, 308]) && (null === $location ?: $location == $this->headers->get('Location'));
} | [
"public",
"function",
"isRedirect",
"(",
"string",
"$",
"location",
"=",
"null",
")",
":",
"bool",
"{",
"return",
"\\",
"in_array",
"(",
"$",
"this",
"->",
"statusCode",
",",
"[",
"201",
",",
"301",
",",
"302",
",",
"303",
",",
"307",
",",
"308",
"... | Is the response a redirect of some form?
@final | [
"Is",
"the",
"response",
"a",
"redirect",
"of",
"some",
"form?"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpFoundation/Response.php#L1189-L1192 | train | Is this response a redirect? | [
30522,
2270,
3853,
2003,
5596,
7442,
6593,
1006,
5164,
1002,
3295,
1027,
19701,
1007,
1024,
22017,
2140,
1063,
2709,
1032,
1999,
1035,
9140,
1006,
1002,
2023,
1011,
1028,
3570,
16044,
1010,
1031,
16345,
1010,
19123,
1010,
22060,
1010,
19988... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/API/API.php | API.getMetadata | public function getMetadata($idSite, $apiModule, $apiAction, $apiParameters = array(), $language = false,
$period = false, $date = false, $hideMetricsDoc = false, $showSubtableReports = false)
{
Piwik::checkUserHasViewAccess($idSite);
if ($language) {
/**... | php | public function getMetadata($idSite, $apiModule, $apiAction, $apiParameters = array(), $language = false,
$period = false, $date = false, $hideMetricsDoc = false, $showSubtableReports = false)
{
Piwik::checkUserHasViewAccess($idSite);
if ($language) {
/**... | [
"public",
"function",
"getMetadata",
"(",
"$",
"idSite",
",",
"$",
"apiModule",
",",
"$",
"apiAction",
",",
"$",
"apiParameters",
"=",
"array",
"(",
")",
",",
"$",
"language",
"=",
"false",
",",
"$",
"period",
"=",
"false",
",",
"$",
"date",
"=",
"fa... | Loads reports metadata, then return the requested one,
matching optional API parameters. | [
"Loads",
"reports",
"metadata",
"then",
"return",
"the",
"requested",
"one",
"matching",
"optional",
"API",
"parameters",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/API/API.php#L295-L308 | train | Returns metadata for the specified site | [
30522,
2270,
3853,
2131,
11368,
8447,
2696,
1006,
1002,
8909,
28032,
2063,
1010,
1002,
17928,
5302,
8566,
2571,
1010,
1002,
17928,
18908,
3258,
1010,
1002,
30524,
5342,
12589,
16150,
10085,
1027,
6270,
1010,
1002,
3065,
12083,
10880,
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... |
dompdf/dompdf | src/Css/Style.php | Style.set_background_repeat | function set_background_repeat($val)
{
if (is_null($val)) {
$val = self::$_defaults["background_repeat"];
}
//see __set and __get, on all assignments clear cache, not needed on direct set through __set
$this->_prop_cache["background_repeat"] = null;
$this->_props... | php | function set_background_repeat($val)
{
if (is_null($val)) {
$val = self::$_defaults["background_repeat"];
}
//see __set and __get, on all assignments clear cache, not needed on direct set through __set
$this->_prop_cache["background_repeat"] = null;
$this->_props... | [
"function",
"set_background_repeat",
"(",
"$",
"val",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"val",
")",
")",
"{",
"$",
"val",
"=",
"self",
"::",
"$",
"_defaults",
"[",
"\"background_repeat\"",
"]",
";",
"}",
"//see __set and __get, on all assignments clear... | Sets the background repeat
@link http://www.w3.org/TR/CSS21/colors.html#propdef-background-repeat
@param string $val | [
"Sets",
"the",
"background",
"repeat"
] | 75f13c700009be21a1965dc2c5b68a8708c22ba2 | https://github.com/dompdf/dompdf/blob/75f13c700009be21a1965dc2c5b68a8708c22ba2/src/Css/Style.php#L1858-L1867 | train | set background repeat | [
30522,
3853,
2275,
1035,
4281,
1035,
9377,
1006,
1002,
11748,
1007,
1063,
2065,
1006,
2003,
1035,
19701,
1006,
1002,
11748,
1007,
1007,
1063,
1002,
11748,
1027,
2969,
1024,
1024,
1002,
1035,
12398,
2015,
1031,
1000,
4281,
1035,
9377,
1000,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Common/Utils.php | Utils.arrayMergeRecursiveUnique | public static function arrayMergeRecursiveUnique($array1, $array2)
{
if (empty($array1)) {
// Optimize the base case
return $array2;
}
foreach ($array2 as $key => $value) {
if (is_array($value) && isset($array1[$key]) && is_array($array1[$key])) {
... | php | public static function arrayMergeRecursiveUnique($array1, $array2)
{
if (empty($array1)) {
// Optimize the base case
return $array2;
}
foreach ($array2 as $key => $value) {
if (is_array($value) && isset($array1[$key]) && is_array($array1[$key])) {
... | [
"public",
"static",
"function",
"arrayMergeRecursiveUnique",
"(",
"$",
"array1",
",",
"$",
"array2",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"array1",
")",
")",
"{",
"// Optimize the base case",
"return",
"$",
"array2",
";",
"}",
"foreach",
"(",
"$",
"arra... | Recursive Merge with uniqueness
@param array $array1
@param array $array2
@return array | [
"Recursive",
"Merge",
"with",
"uniqueness"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Utils.php#L284-L299 | train | Recursive merge array1 = > array2 | [
30522,
2270,
10763,
3853,
9140,
5017,
4590,
8586,
9236,
3512,
19496,
4226,
1006,
1002,
9140,
2487,
1010,
1002,
9140,
2475,
1007,
1063,
2065,
1006,
4064,
1006,
1002,
9140,
2487,
1007,
1007,
1063,
1013,
1013,
23569,
27605,
4371,
1996,
2918,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/Zend/Mail/Storage/Mbox.php | Zend_Mail_Storage_Mbox.getMessage | public function getMessage($id)
{
// TODO that's ugly, would be better to let the message class decide
if (strtolower($this->_messageClass) == 'zend_mail_message_file' || is_subclass_of($this->_messageClass, 'zend_mail_message_file')) {
// TODO top/body lines
$messagePos = $t... | php | public function getMessage($id)
{
// TODO that's ugly, would be better to let the message class decide
if (strtolower($this->_messageClass) == 'zend_mail_message_file' || is_subclass_of($this->_messageClass, 'zend_mail_message_file')) {
// TODO top/body lines
$messagePos = $t... | [
"public",
"function",
"getMessage",
"(",
"$",
"id",
")",
"{",
"// TODO that's ugly, would be better to let the message class decide",
"if",
"(",
"strtolower",
"(",
"$",
"this",
"->",
"_messageClass",
")",
"==",
"'zend_mail_message_file'",
"||",
"is_subclass_of",
"(",
"$... | Fetch a message
@param int $id number of message
@return Zend_Mail_Message_File
@throws Zend_Mail_Storage_Exception | [
"Fetch",
"a",
"message"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail/Storage/Mbox.php#L142-L164 | train | Returns the message object for the given message id | [
30522,
2270,
3853,
2131,
7834,
3736,
3351,
1006,
1002,
8909,
1007,
1063,
1013,
1013,
28681,
2080,
2008,
1005,
1055,
9200,
1010,
2052,
2022,
2488,
2000,
2292,
1996,
4471,
2465,
5630,
2065,
1006,
2358,
5339,
12898,
13777,
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... |
matomo-org/matomo | core/Plugin/Dimension/DimensionMetadataProvider.php | DimensionMetadataProvider.getActionReferenceColumnsByTable | public function getActionReferenceColumnsByTable()
{
$result = array(
'log_link_visit_action' => array('idaction_url',
'idaction_url_ref',
'idaction_name_ref'
),
'log_conversion' => array('idaction_url'),
'log_visit' ... | php | public function getActionReferenceColumnsByTable()
{
$result = array(
'log_link_visit_action' => array('idaction_url',
'idaction_url_ref',
'idaction_name_ref'
),
'log_conversion' => array('idaction_url'),
'log_visit' ... | [
"public",
"function",
"getActionReferenceColumnsByTable",
"(",
")",
"{",
"$",
"result",
"=",
"array",
"(",
"'log_link_visit_action'",
"=>",
"array",
"(",
"'idaction_url'",
",",
"'idaction_url_ref'",
",",
"'idaction_name_ref'",
")",
",",
"'log_conversion'",
"=>",
"arra... | Returns a list of idaction column names organized by table name. Uses dimension metadata
to find idaction columns dynamically.
Note: It is not currently possible to use the Piwik platform to add idaction columns to tables
other than log_link_visit_action (w/o doing something unsupported), so idaction columns in
other ... | [
"Returns",
"a",
"list",
"of",
"idaction",
"column",
"names",
"organized",
"by",
"table",
"name",
".",
"Uses",
"dimension",
"metadata",
"to",
"find",
"idaction",
"columns",
"dynamically",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Plugin/Dimension/DimensionMetadataProvider.php#L41-L94 | train | Returns an array of action reference columns by table name | [
30522,
2270,
3853,
2131,
18908,
3258,
2890,
25523,
25778,
2819,
3619,
3762,
10880,
1006,
1007,
1063,
1002,
2765,
1027,
9140,
1006,
1005,
8833,
1035,
4957,
1035,
3942,
1035,
2895,
1005,
1027,
1028,
9140,
1006,
1005,
16096,
7542,
1035,
24471,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Apc.php | Zend_Cache_Backend_Apc.load | public function load($id, $doNotTestCacheValidity = false)
{
$tmp = apc_fetch($id);
if (is_array($tmp)) {
return $tmp[0];
}
return false;
} | php | public function load($id, $doNotTestCacheValidity = false)
{
$tmp = apc_fetch($id);
if (is_array($tmp)) {
return $tmp[0];
}
return false;
} | [
"public",
"function",
"load",
"(",
"$",
"id",
",",
"$",
"doNotTestCacheValidity",
"=",
"false",
")",
"{",
"$",
"tmp",
"=",
"apc_fetch",
"(",
"$",
"id",
")",
";",
"if",
"(",
"is_array",
"(",
"$",
"tmp",
")",
")",
"{",
"return",
"$",
"tmp",
"[",
"0... | Test if a cache is available for the given id and (if yes) return it (false else)
WARNING $doNotTestCacheValidity=true is unsupported by the Apc backend
@param string $id cache id
@param boolean $doNotTestCacheValidity if set to true, the cache validity won't be tested
@return string cached dat... | [
"Test",
"if",
"a",
"cache",
"is",
"available",
"for",
"the",
"given",
"id",
"and",
"(",
"if",
"yes",
")",
"return",
"it",
"(",
"false",
"else",
")"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache/Backend/Apc.php#L73-L80 | train | Load a language from the cache | [
30522,
2270,
3853,
7170,
1006,
1002,
8909,
1010,
1002,
2123,
28495,
3367,
3540,
16179,
11475,
25469,
1027,
6270,
1007,
1063,
1002,
1056,
8737,
1027,
9706,
2278,
1035,
18584,
1006,
1002,
8909,
1007,
1025,
2065,
1006,
2003,
1035,
9140,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Validator/Mapping/ClassMetadata.php | ClassMetadata.setGroupSequenceProvider | public function setGroupSequenceProvider($active)
{
if ($this->hasGroupSequence()) {
throw new GroupDefinitionException('Defining a group sequence provider is not allowed with a static group sequence');
}
if (!$this->getReflectionClass()->implementsInterface('Symfony\Component\V... | php | public function setGroupSequenceProvider($active)
{
if ($this->hasGroupSequence()) {
throw new GroupDefinitionException('Defining a group sequence provider is not allowed with a static group sequence');
}
if (!$this->getReflectionClass()->implementsInterface('Symfony\Component\V... | [
"public",
"function",
"setGroupSequenceProvider",
"(",
"$",
"active",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasGroupSequence",
"(",
")",
")",
"{",
"throw",
"new",
"GroupDefinitionException",
"(",
"'Defining a group sequence provider is not allowed with a static group s... | Sets whether a group sequence provider should be used.
@param bool $active
@throws GroupDefinitionException | [
"Sets",
"whether",
"a",
"group",
"sequence",
"provider",
"should",
"be",
"used",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Validator/Mapping/ClassMetadata.php#L461-L472 | train | Set the group sequence provider | [
30522,
2270,
3853,
2275,
17058,
3366,
4226,
5897,
21572,
17258,
2121,
1006,
1002,
3161,
1007,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
2038,
17058,
3366,
4226,
5897,
1006,
1007,
1007,
1063,
5466,
2047,
2177,
3207,
16294,
22753,
10288,
2442... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
overtrue/wechat | src/OfficialAccount/Card/SubMerchantClient.php | SubMerchantClient.update | public function update(int $merchantId, array $info = [])
{
$params = [
'info' => array_merge(['merchant_id' => $merchantId],
Arr::only($info, [
'brand_name',
'logo_url',
'protocol',
'end_time',
... | php | public function update(int $merchantId, array $info = [])
{
$params = [
'info' => array_merge(['merchant_id' => $merchantId],
Arr::only($info, [
'brand_name',
'logo_url',
'protocol',
'end_time',
... | [
"public",
"function",
"update",
"(",
"int",
"$",
"merchantId",
",",
"array",
"$",
"info",
"=",
"[",
"]",
")",
"{",
"$",
"params",
"=",
"[",
"'info'",
"=>",
"array_merge",
"(",
"[",
"'merchant_id'",
"=>",
"$",
"merchantId",
"]",
",",
"Arr",
"::",
"onl... | 更新子商户.
@param int $merchantId
@param array $info
@return mixed | [
"更新子商户",
"."
] | 120c72faaa93c270365bc75c73c362d5fd583209 | https://github.com/overtrue/wechat/blob/120c72faaa93c270365bc75c73c362d5fd583209/src/OfficialAccount/Card/SubMerchantClient.php#L58-L76 | train | Update a card submerchant | [
30522,
2270,
3853,
10651,
1006,
20014,
1002,
6432,
3593,
1010,
9140,
1002,
18558,
1027,
1031,
1033,
1007,
1063,
1002,
11498,
5244,
1027,
1031,
1005,
18558,
1005,
1027,
1028,
9140,
1035,
13590,
1006,
1031,
1005,
6432,
1035,
8909,
1005,
1027,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Common/Page/Page.php | Page.menu | public function menu($var = null)
{
if ($var !== null) {
$this->menu = $var;
}
if (empty($this->menu)) {
$this->menu = $this->title();
}
return $this->menu;
} | php | public function menu($var = null)
{
if ($var !== null) {
$this->menu = $var;
}
if (empty($this->menu)) {
$this->menu = $this->title();
}
return $this->menu;
} | [
"public",
"function",
"menu",
"(",
"$",
"var",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"var",
"!==",
"null",
")",
"{",
"$",
"this",
"->",
"menu",
"=",
"$",
"var",
";",
"}",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"menu",
")",
")",
"{",
"... | Gets and sets the menu name for this Page. This is the text that can be used specifically for navigation.
If no menu field is set, it will use the title()
@param string $var the menu field for the page
@return string the menu field for the page | [
"Gets",
"and",
"sets",
"the",
"menu",
"name",
"for",
"this",
"Page",
".",
"This",
"is",
"the",
"text",
"that",
"can",
"be",
"used",
"specifically",
"for",
"navigation",
".",
"If",
"no",
"menu",
"field",
"is",
"set",
"it",
"will",
"use",
"the",
"title",... | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Page/Page.php#L1519-L1529 | train | Get menu of the page | [
30522,
2270,
3853,
12183,
1006,
1002,
13075,
1027,
19701,
1007,
1063,
2065,
1006,
1002,
13075,
999,
1027,
1027,
19701,
1007,
1063,
1002,
2023,
1011,
1028,
12183,
1027,
1002,
13075,
1025,
1065,
2065,
1006,
4064,
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/Form/ChoiceList/Loader/CallbackChoiceLoader.php | CallbackChoiceLoader.loadChoiceList | public function loadChoiceList($value = null)
{
if (null !== $this->choiceList) {
return $this->choiceList;
}
return $this->choiceList = new ArrayChoiceList(($this->callback)(), $value);
} | php | public function loadChoiceList($value = null)
{
if (null !== $this->choiceList) {
return $this->choiceList;
}
return $this->choiceList = new ArrayChoiceList(($this->callback)(), $value);
} | [
"public",
"function",
"loadChoiceList",
"(",
"$",
"value",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"choiceList",
")",
"{",
"return",
"$",
"this",
"->",
"choiceList",
";",
"}",
"return",
"$",
"this",
"->",
"choiceList",
"=",
... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/ChoiceList/Loader/CallbackChoiceLoader.php#L43-L50 | train | Load the choice list | [
30522,
2270,
3853,
7170,
9905,
6610,
9863,
1006,
1002,
3643,
1027,
19701,
1007,
1063,
2065,
1006,
19701,
999,
1027,
1027,
1002,
2023,
1011,
1028,
3601,
9863,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
3601,
9863,
1025,
1065,
2709,
1002,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/Overlay/Controller.php | Controller.showErrorWrongDomain | public function showErrorWrongDomain()
{
$this->checkSitePermission();
Piwik::checkUserHasViewAccess($this->idSite);
$url = Common::getRequestVar('url', '');
$url = Common::unsanitizeInputValue($url);
$message = Piwik::translate('Overlay_RedirectUrlError', array($url, "\n")... | php | public function showErrorWrongDomain()
{
$this->checkSitePermission();
Piwik::checkUserHasViewAccess($this->idSite);
$url = Common::getRequestVar('url', '');
$url = Common::unsanitizeInputValue($url);
$message = Piwik::translate('Overlay_RedirectUrlError', array($url, "\n")... | [
"public",
"function",
"showErrorWrongDomain",
"(",
")",
"{",
"$",
"this",
"->",
"checkSitePermission",
"(",
")",
";",
"Piwik",
"::",
"checkUserHasViewAccess",
"(",
"$",
"this",
"->",
"idSite",
")",
";",
"$",
"url",
"=",
"Common",
"::",
"getRequestVar",
"(",
... | This method is called when the JS from startOverlaySession() detects that the target domain
is not configured for the current site. | [
"This",
"method",
"is",
"called",
"when",
"the",
"JS",
"from",
"startOverlaySession",
"()",
"detects",
"that",
"the",
"target",
"domain",
"is",
"not",
"configured",
"for",
"the",
"current",
"site",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Overlay/Controller.php#L189-L217 | train | Show the error wrong domain | [
30522,
2270,
3853,
6457,
29165,
13088,
5063,
9527,
8113,
1006,
1007,
1063,
1002,
2023,
1011,
1028,
14148,
4221,
4842,
25481,
1006,
1007,
1025,
14255,
9148,
2243,
1024,
1024,
4638,
20330,
14949,
8584,
6305,
9623,
2015,
1006,
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... |
matomo-org/matomo | plugins/Login/PasswordResetter.php | PasswordResetter.getPasswordToResetTo | private function getPasswordToResetTo($login)
{
$optionName = self::getPasswordResetInfoOptionName($login);
$optionValue = Option::get($optionName);
$optionValue = json_decode($optionValue, $isAssoc = true);
return $optionValue;
} | php | private function getPasswordToResetTo($login)
{
$optionName = self::getPasswordResetInfoOptionName($login);
$optionValue = Option::get($optionName);
$optionValue = json_decode($optionValue, $isAssoc = true);
return $optionValue;
} | [
"private",
"function",
"getPasswordToResetTo",
"(",
"$",
"login",
")",
"{",
"$",
"optionName",
"=",
"self",
"::",
"getPasswordResetInfoOptionName",
"(",
"$",
"login",
")",
";",
"$",
"optionValue",
"=",
"Option",
"::",
"get",
"(",
"$",
"optionName",
")",
";",... | Gets password hash stored in password reset info.
@param string $login The user login to check for.
@return string|false The hashed password or false if no reset info exists. | [
"Gets",
"password",
"hash",
"stored",
"in",
"password",
"reset",
"info",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Login/PasswordResetter.php#L479-L485 | train | Get password to reset to | [
30522,
2797,
3853,
2131,
15194,
18351,
19277,
21678,
2080,
1006,
1002,
8833,
2378,
1007,
1063,
1002,
5724,
18442,
1027,
2969,
1024,
1024,
2131,
15194,
18351,
6072,
20624,
2078,
14876,
7361,
3508,
18442,
1006,
1002,
8833,
2378,
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... |
dompdf/dompdf | src/Helpers.php | Helpers.record_warnings | public static function record_warnings($errno, $errstr, $errfile, $errline)
{
// Not a warning or notice
if (!($errno & (E_WARNING | E_NOTICE | E_USER_NOTICE | E_USER_WARNING))) {
throw new Exception($errstr . " $errno");
}
global $_dompdf_warnings;
global $_domp... | php | public static function record_warnings($errno, $errstr, $errfile, $errline)
{
// Not a warning or notice
if (!($errno & (E_WARNING | E_NOTICE | E_USER_NOTICE | E_USER_WARNING))) {
throw new Exception($errstr . " $errno");
}
global $_dompdf_warnings;
global $_domp... | [
"public",
"static",
"function",
"record_warnings",
"(",
"$",
"errno",
",",
"$",
"errstr",
",",
"$",
"errfile",
",",
"$",
"errline",
")",
"{",
"// Not a warning or notice",
"if",
"(",
"!",
"(",
"$",
"errno",
"&",
"(",
"E_WARNING",
"|",
"E_NOTICE",
"|",
"E... | Stores warnings in an array for display later
This function allows warnings generated by the DomDocument parser
and CSS loader ({@link Stylesheet}) to be captured and displayed
later. Without this function, errors are displayed immediately and
PDF streaming is impossible.
@see http://www.php.net/manual/en/function.set... | [
"Stores",
"warnings",
"in",
"an",
"array",
"for",
"display",
"later",
"This",
"function",
"allows",
"warnings",
"generated",
"by",
"the",
"DomDocument",
"parser",
"and",
"CSS",
"loader",
"(",
"{",
"@link",
"Stylesheet",
"}",
")",
"to",
"be",
"captured",
"and... | 75f13c700009be21a1965dc2c5b68a8708c22ba2 | https://github.com/dompdf/dompdf/blob/75f13c700009be21a1965dc2c5b68a8708c22ba2/src/Helpers.php#L503-L518 | train | Record dompdf warnings | [
30522,
2270,
10763,
3853,
2501,
1035,
16234,
1006,
1002,
9413,
19139,
1010,
1002,
9413,
12096,
2099,
1010,
1002,
9413,
12881,
9463,
1010,
1002,
9413,
19403,
2063,
1007,
1063,
1013,
1013,
2025,
1037,
5432,
2030,
5060,
2065,
1006,
999,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/DevicesDetection/API.php | API.getType | public function getType($idSite, $period, $date, $segment = false)
{
$dataTable = $this->getDataTable('DevicesDetection_types', $idSite, $period, $date, $segment);
// ensure all device types are in the list
$this->ensureDefaultRowsInTable($dataTable);
$mapping = DeviceParserAbstract... | php | public function getType($idSite, $period, $date, $segment = false)
{
$dataTable = $this->getDataTable('DevicesDetection_types', $idSite, $period, $date, $segment);
// ensure all device types are in the list
$this->ensureDefaultRowsInTable($dataTable);
$mapping = DeviceParserAbstract... | [
"public",
"function",
"getType",
"(",
"$",
"idSite",
",",
"$",
"period",
",",
"$",
"date",
",",
"$",
"segment",
"=",
"false",
")",
"{",
"$",
"dataTable",
"=",
"$",
"this",
"->",
"getDataTable",
"(",
"'DevicesDetection_types'",
",",
"$",
"idSite",
",",
... | Gets datatable displaying number of visits by device type (eg. desktop, smartphone, tablet)
@param int $idSite
@param string $period
@param string $date
@param bool|string $segment
@return DataTable | [
"Gets",
"datatable",
"displaying",
"number",
"of",
"visits",
"by",
"device",
"type",
"(",
"eg",
".",
"desktop",
"smartphone",
"tablet",
")"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/DevicesDetection/API.php#L50-L61 | train | Get the data table for device detection types | [
30522,
2270,
3853,
2131,
13874,
1006,
1002,
8909,
28032,
2063,
1010,
1002,
2558,
1010,
1002,
3058,
1010,
1002,
6903,
1027,
6270,
1007,
1063,
1002,
2951,
10880,
1027,
1002,
2023,
1011,
1028,
2131,
2850,
29336,
3085,
1006,
1005,
5733,
3207,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
dompdf/dompdf | src/Helpers.php | Helpers.explode_url | public static function explode_url($url)
{
$protocol = "";
$host = "";
$path = "";
$file = "";
$arr = parse_url($url);
if ( isset($arr["scheme"]) ) {
$arr["scheme"] = mb_strtolower($arr["scheme"]);
}
// Exclude windows drive letters...
... | php | public static function explode_url($url)
{
$protocol = "";
$host = "";
$path = "";
$file = "";
$arr = parse_url($url);
if ( isset($arr["scheme"]) ) {
$arr["scheme"] = mb_strtolower($arr["scheme"]);
}
// Exclude windows drive letters...
... | [
"public",
"static",
"function",
"explode_url",
"(",
"$",
"url",
")",
"{",
"$",
"protocol",
"=",
"\"\"",
";",
"$",
"host",
"=",
"\"\"",
";",
"$",
"path",
"=",
"\"\"",
";",
"$",
"file",
"=",
"\"\"",
";",
"$",
"arr",
"=",
"parse_url",
"(",
"$",
"url... | parse a full url or pathname and return an array(protocol, host, path,
file + query + fragment)
@param string $url
@return array | [
"parse",
"a",
"full",
"url",
"or",
"pathname",
"and",
"return",
"an",
"array",
"(",
"protocol",
"host",
"path",
"file",
"+",
"query",
"+",
"fragment",
")"
] | 75f13c700009be21a1965dc2c5b68a8708c22ba2 | https://github.com/dompdf/dompdf/blob/75f13c700009be21a1965dc2c5b68a8708c22ba2/src/Helpers.php#L377-L469 | train | Explodes a URL into its components | [
30522,
2270,
10763,
3853,
15044,
1035,
24471,
2140,
1006,
1002,
24471,
2140,
1007,
1063,
1002,
8778,
1027,
1000,
1000,
1025,
1002,
3677,
1027,
1000,
1000,
1025,
1002,
4130,
1027,
1000,
1000,
1025,
1002,
5371,
1027,
1000,
1000,
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... |
getgrav/grav | system/src/Grav/Framework/Flex/Storage/FolderStorage.php | FolderStorage.buildIndex | protected function buildIndex(): array
{
$path = $this->getStoragePath();
if (!file_exists($path)) {
return [];
}
if ($this->prefixed) {
$list = $this->buildPrefixedIndexFromFilesystem($path);
} else {
$list = $this->buildIndexFromFilesyst... | php | protected function buildIndex(): array
{
$path = $this->getStoragePath();
if (!file_exists($path)) {
return [];
}
if ($this->prefixed) {
$list = $this->buildPrefixedIndexFromFilesystem($path);
} else {
$list = $this->buildIndexFromFilesyst... | [
"protected",
"function",
"buildIndex",
"(",
")",
":",
"array",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"getStoragePath",
"(",
")",
";",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"path",
")",
")",
"{",
"return",
"[",
"]",
";",
"}",
"if",
"(",
"$"... | Returns list of all stored keys in [key => timestamp] pairs.
@return array | [
"Returns",
"list",
"of",
"all",
"stored",
"keys",
"in",
"[",
"key",
"=",
">",
"timestamp",
"]",
"pairs",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Framework/Flex/Storage/FolderStorage.php#L371-L387 | train | Build the index from the filesystem | [
30522,
5123,
3853,
3857,
22254,
10288,
1006,
1007,
1024,
9140,
1063,
1002,
4130,
1027,
1002,
2023,
1011,
1028,
4152,
4263,
4270,
15069,
1006,
1007,
1025,
2065,
1006,
999,
5371,
1035,
6526,
1006,
1002,
4130,
1007,
1007,
1063,
2709,
1031,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/HTML/QuickForm2/Container.php | HTML_QuickForm2_Container.getValue | public function getValue()
{
$values = array();
foreach ($this as $child) {
$value = $child->getValue();
if (null !== $value) {
if ($child instanceof HTML_QuickForm2_Container
&& !$child->prependsName()
) {
... | php | public function getValue()
{
$values = array();
foreach ($this as $child) {
$value = $child->getValue();
if (null !== $value) {
if ($child instanceof HTML_QuickForm2_Container
&& !$child->prependsName()
) {
... | [
"public",
"function",
"getValue",
"(",
")",
"{",
"$",
"values",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"as",
"$",
"child",
")",
"{",
"$",
"value",
"=",
"$",
"child",
"->",
"getValue",
"(",
")",
";",
"if",
"(",
"null",
"!==",
... | Returns the element's value
The default implementation for Containers is to return an array with
contained elements' values. The array is indexed the same way $_GET and
$_POST arrays would be for these elements.
@return array|null | [
"Returns",
"the",
"element",
"s",
"value"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Container.php#L115-L145 | train | Returns the value of the form element | [
30522,
2270,
3853,
2131,
10175,
5657,
1006,
1007,
1063,
1002,
5300,
1027,
9140,
1006,
1007,
1025,
18921,
6776,
1006,
1002,
2023,
2004,
1002,
2775,
1007,
1063,
1002,
3643,
1027,
1002,
2775,
1011,
1028,
2131,
10175,
5657,
1006,
1007,
1025,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Form/ResolvedFormType.php | ResolvedFormType.createBuilder | public function createBuilder(FormFactoryInterface $factory, $name, array $options = [])
{
$options = $this->getOptionsResolver()->resolve($options);
// Should be decoupled from the specific option at some point
$dataClass = isset($options['data_class']) ? $options['data_class'] : null;
... | php | public function createBuilder(FormFactoryInterface $factory, $name, array $options = [])
{
$options = $this->getOptionsResolver()->resolve($options);
// Should be decoupled from the specific option at some point
$dataClass = isset($options['data_class']) ? $options['data_class'] : null;
... | [
"public",
"function",
"createBuilder",
"(",
"FormFactoryInterface",
"$",
"factory",
",",
"$",
"name",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"options",
"=",
"$",
"this",
"->",
"getOptionsResolver",
"(",
")",
"->",
"resolve",
"(",
"$"... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/ResolvedFormType.php#L93-L104 | train | Create a new builder for the current type | [
30522,
2270,
3853,
3443,
8569,
23891,
2099,
1006,
2433,
21450,
18447,
2121,
12172,
1002,
4713,
1010,
1002,
2171,
1010,
9140,
1002,
7047,
1027,
1031,
1033,
1007,
1063,
1002,
7047,
1027,
1002,
2023,
1011,
1028,
2131,
7361,
9285,
6072,
4747,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Filesystem/FilesystemAdapter.php | FilesystemAdapter.assertMissing | public function assertMissing($path)
{
$paths = Arr::wrap($path);
foreach ($paths as $path) {
PHPUnit::assertFalse(
$this->exists($path), "Found unexpected file at path [{$path}]."
);
}
return $this;
} | php | public function assertMissing($path)
{
$paths = Arr::wrap($path);
foreach ($paths as $path) {
PHPUnit::assertFalse(
$this->exists($path), "Found unexpected file at path [{$path}]."
);
}
return $this;
} | [
"public",
"function",
"assertMissing",
"(",
"$",
"path",
")",
"{",
"$",
"paths",
"=",
"Arr",
"::",
"wrap",
"(",
"$",
"path",
")",
";",
"foreach",
"(",
"$",
"paths",
"as",
"$",
"path",
")",
"{",
"PHPUnit",
"::",
"assertFalse",
"(",
"$",
"this",
"->"... | Assert that the given file does not exist.
@param string|array $path
@return $this | [
"Assert",
"that",
"the",
"given",
"file",
"does",
"not",
"exist",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Filesystem/FilesystemAdapter.php#L76-L87 | train | Assert that a file does not exist at the given path | [
30522,
2270,
3853,
20865,
15630,
7741,
1006,
1002,
4130,
1007,
1063,
1002,
10425,
1027,
12098,
2099,
1024,
1024,
10236,
1006,
1002,
4130,
1007,
1025,
18921,
6776,
1006,
1002,
10425,
2004,
1002,
4130,
1007,
1063,
25718,
19496,
2102,
1024,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Database/Query/Grammars/Grammar.php | Grammar.whereColumn | protected function whereColumn(Builder $query, $where)
{
return $this->wrap($where['first']).' '.$where['operator'].' '.$this->wrap($where['second']);
} | php | protected function whereColumn(Builder $query, $where)
{
return $this->wrap($where['first']).' '.$where['operator'].' '.$this->wrap($where['second']);
} | [
"protected",
"function",
"whereColumn",
"(",
"Builder",
"$",
"query",
",",
"$",
"where",
")",
"{",
"return",
"$",
"this",
"->",
"wrap",
"(",
"$",
"where",
"[",
"'first'",
"]",
")",
".",
"' '",
".",
"$",
"where",
"[",
"'operator'",
"]",
".",
"' '",
... | Compile a where clause comparing two columns..
@param \Illuminate\Database\Query\Builder $query
@param array $where
@return string | [
"Compile",
"a",
"where",
"clause",
"comparing",
"two",
"columns",
".."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Query/Grammars/Grammar.php#L466-L469 | train | Protected whereColumn - Helper function | [
30522,
5123,
3853,
2073,
25778,
2819,
2078,
1006,
12508,
1002,
23032,
1010,
1002,
2073,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
10236,
1006,
1002,
2073,
1031,
1005,
2034,
1005,
1033,
1007,
1012,
1005,
1005,
1012,
1002,
2073,
1031,
1005,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/Plugin/Dimension/VisitDimension.php | VisitDimension.uninstall | public function uninstall()
{
if (empty($this->columnName) || empty($this->columnType)) {
return;
}
try {
$sql = "ALTER TABLE `" . Common::prefixTable($this->dbTableName) . "` DROP COLUMN `$this->columnName`";
Db::exec($sql);
} catch (Exception $e... | php | public function uninstall()
{
if (empty($this->columnName) || empty($this->columnType)) {
return;
}
try {
$sql = "ALTER TABLE `" . Common::prefixTable($this->dbTableName) . "` DROP COLUMN `$this->columnName`";
Db::exec($sql);
} catch (Exception $e... | [
"public",
"function",
"uninstall",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"columnName",
")",
"||",
"empty",
"(",
"$",
"this",
"->",
"columnType",
")",
")",
"{",
"return",
";",
"}",
"try",
"{",
"$",
"sql",
"=",
"\"ALTER TABLE `\"",... | Uninstalls the dimension if a {@link $columnName} and {@link columnType} is set. In case you perform any custom
actions during {@link install()} - for instance adding an index - you should make sure to undo those actions by
overwriting this method. Make sure to call this parent method to make sure the uninstallation of... | [
"Uninstalls",
"the",
"dimension",
"if",
"a",
"{"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Plugin/Dimension/VisitDimension.php#L118-L145 | train | Uninstalls the column if it s not present in the database | [
30522,
2270,
3853,
4895,
7076,
9080,
2140,
1006,
1007,
1063,
2065,
1006,
4064,
1006,
1002,
2023,
1011,
1028,
5930,
18442,
1007,
1064,
1064,
4064,
1006,
1002,
2023,
1011,
1028,
5930,
13874,
1007,
1007,
1063,
2709,
1025,
1065,
3046,
1063,
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/UsersManager/UsersManager.php | UsersManager.isValidPasswordString | public static function isValidPasswordString($input)
{
if (!SettingsPiwik::isUserCredentialsSanityCheckEnabled()
&& !empty($input)
) {
return true;
}
$l = strlen($input);
return $l >= self::PASSWORD_MIN_LENGTH;
} | php | public static function isValidPasswordString($input)
{
if (!SettingsPiwik::isUserCredentialsSanityCheckEnabled()
&& !empty($input)
) {
return true;
}
$l = strlen($input);
return $l >= self::PASSWORD_MIN_LENGTH;
} | [
"public",
"static",
"function",
"isValidPasswordString",
"(",
"$",
"input",
")",
"{",
"if",
"(",
"!",
"SettingsPiwik",
"::",
"isUserCredentialsSanityCheckEnabled",
"(",
")",
"&&",
"!",
"empty",
"(",
"$",
"input",
")",
")",
"{",
"return",
"true",
";",
"}",
... | Returns true if the password is complex enough (at least 6 characters and max 26 characters)
@param $input string
@return bool | [
"Returns",
"true",
"if",
"the",
"password",
"is",
"complex",
"enough",
"(",
"at",
"least",
"6",
"characters",
"and",
"max",
"26",
"characters",
")"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UsersManager/UsersManager.php#L157-L168 | train | Returns true if the input string is valid for the password minimum length | [
30522,
2270,
10763,
3853,
2003,
10175,
3593,
15194,
22104,
18886,
3070,
1006,
1002,
7953,
1007,
1063,
2065,
1006,
999,
10906,
8197,
9148,
2243,
1024,
1024,
2003,
20330,
16748,
16454,
26340,
8791,
3012,
5403,
19766,
3085,
2094,
1006,
1007,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Yaml/Inline.php | Inline.dumpArray | private static function dumpArray(array $value, int $flags): string
{
// array
if (($value || Yaml::DUMP_EMPTY_ARRAY_AS_SEQUENCE & $flags) && !self::isHash($value)) {
$output = [];
foreach ($value as $val) {
$output[] = self::dump($val, $flags);
}
... | php | private static function dumpArray(array $value, int $flags): string
{
// array
if (($value || Yaml::DUMP_EMPTY_ARRAY_AS_SEQUENCE & $flags) && !self::isHash($value)) {
$output = [];
foreach ($value as $val) {
$output[] = self::dump($val, $flags);
}
... | [
"private",
"static",
"function",
"dumpArray",
"(",
"array",
"$",
"value",
",",
"int",
"$",
"flags",
")",
":",
"string",
"{",
"// array",
"if",
"(",
"(",
"$",
"value",
"||",
"Yaml",
"::",
"DUMP_EMPTY_ARRAY_AS_SEQUENCE",
"&",
"$",
"flags",
")",
"&&",
"!",
... | Dumps a PHP array to a YAML string.
@param array $value The PHP array to dump
@param int $flags A bit field of Yaml::DUMP_* constants to customize the dumped YAML string
@return string The YAML string representing the PHP array | [
"Dumps",
"a",
"PHP",
"array",
"to",
"a",
"YAML",
"string",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Yaml/Inline.php#L238-L257 | train | Dump array value | [
30522,
2797,
10763,
3853,
15653,
2906,
9447,
1006,
9140,
1002,
3643,
1010,
20014,
1002,
9245,
1007,
1024,
5164,
1063,
1013,
1013,
9140,
2065,
1006,
1006,
1002,
3643,
1064,
1064,
8038,
19968,
1024,
1024,
15653,
1035,
4064,
1035,
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... |
symfony/symfony | src/Symfony/Component/Form/Extension/DataCollector/FormDataCollector.php | FormDataCollector.collectDefaultData | public function collectDefaultData(FormInterface $form)
{
$hash = spl_object_hash($form);
if (!isset($this->dataByForm[$hash])) {
$this->dataByForm[$hash] = [];
}
$this->dataByForm[$hash] = array_replace(
$this->dataByForm[$hash],
$this->dataExtr... | php | public function collectDefaultData(FormInterface $form)
{
$hash = spl_object_hash($form);
if (!isset($this->dataByForm[$hash])) {
$this->dataByForm[$hash] = [];
}
$this->dataByForm[$hash] = array_replace(
$this->dataByForm[$hash],
$this->dataExtr... | [
"public",
"function",
"collectDefaultData",
"(",
"FormInterface",
"$",
"form",
")",
"{",
"$",
"hash",
"=",
"spl_object_hash",
"(",
"$",
"form",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"dataByForm",
"[",
"$",
"hash",
"]",
")",
")",
... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/Extension/DataCollector/FormDataCollector.php#L129-L145 | train | Collect default data for form | [
30522,
2270,
3853,
8145,
3207,
7011,
11314,
2850,
2696,
1006,
2433,
18447,
2121,
12172,
1002,
2433,
1007,
1063,
1002,
23325,
1027,
11867,
2140,
1035,
4874,
1035,
23325,
1006,
1002,
2433,
1007,
1025,
2065,
1006,
999,
26354,
3388,
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... |
guzzle/guzzle | src/Cookie/CookieJar.php | CookieJar.getCookiePathFromRequest | private function getCookiePathFromRequest(RequestInterface $request)
{
$uriPath = $request->getUri()->getPath();
if ('' === $uriPath) {
return '/';
}
if (0 !== strpos($uriPath, '/')) {
return '/';
}
if ('/' === $uriPath) {
return '... | php | private function getCookiePathFromRequest(RequestInterface $request)
{
$uriPath = $request->getUri()->getPath();
if ('' === $uriPath) {
return '/';
}
if (0 !== strpos($uriPath, '/')) {
return '/';
}
if ('/' === $uriPath) {
return '... | [
"private",
"function",
"getCookiePathFromRequest",
"(",
"RequestInterface",
"$",
"request",
")",
"{",
"$",
"uriPath",
"=",
"$",
"request",
"->",
"getUri",
"(",
")",
"->",
"getPath",
"(",
")",
";",
"if",
"(",
"''",
"===",
"$",
"uriPath",
")",
"{",
"return... | Computes cookie path following RFC 6265 section 5.1.4
@link https://tools.ietf.org/html/rfc6265#section-5.1.4
@param RequestInterface $request
@return string | [
"Computes",
"cookie",
"path",
"following",
"RFC",
"6265",
"section",
"5",
".",
"1",
".",
"4"
] | bf595424e4d442a190582e088985dc835a789071 | https://github.com/guzzle/guzzle/blob/bf595424e4d442a190582e088985dc835a789071/src/Cookie/CookieJar.php#L254-L271 | train | Get cookie path from request | [
30522,
2797,
3853,
2131,
3597,
23212,
13699,
8988,
19699,
5358,
2890,
15500,
1006,
5227,
18447,
2121,
12172,
1002,
5227,
1007,
1063,
1002,
24471,
11514,
8988,
1027,
1002,
5227,
1011,
1028,
2131,
9496,
1006,
1007,
1011,
1028,
2131,
15069,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Notifications/Messages/SimpleMessage.php | SimpleMessage.formatLine | protected function formatLine($line)
{
if ($line instanceof Htmlable) {
return $line;
}
if (is_array($line)) {
return implode(' ', array_map('trim', $line));
}
return trim(implode(' ', array_map('trim', preg_split('/\\r\\n|\\r|\\n/', $line))));
} | php | protected function formatLine($line)
{
if ($line instanceof Htmlable) {
return $line;
}
if (is_array($line)) {
return implode(' ', array_map('trim', $line));
}
return trim(implode(' ', array_map('trim', preg_split('/\\r\\n|\\r|\\n/', $line))));
} | [
"protected",
"function",
"formatLine",
"(",
"$",
"line",
")",
"{",
"if",
"(",
"$",
"line",
"instanceof",
"Htmlable",
")",
"{",
"return",
"$",
"line",
";",
"}",
"if",
"(",
"is_array",
"(",
"$",
"line",
")",
")",
"{",
"return",
"implode",
"(",
"' '",
... | Format the given line of text.
@param \Illuminate\Contracts\Support\Htmlable|string|array $line
@return \Illuminate\Contracts\Support\Htmlable|string | [
"Format",
"the",
"given",
"line",
"of",
"text",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Notifications/Messages/SimpleMessage.php#L178-L189 | train | Format a line of code | [
30522,
5123,
3853,
4289,
4179,
1006,
1002,
2240,
1007,
1063,
2065,
1006,
1002,
2240,
6013,
11253,
16129,
3085,
1007,
1063,
2709,
1002,
2240,
1025,
1065,
2065,
1006,
2003,
1035,
9140,
1006,
1002,
2240,
1007,
1007,
1063,
2709,
17727,
4135,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/HTML/QuickForm2/Renderer/Default.php | HTML_QuickForm2_Renderer_Default.setElementTemplateForGroupClass | public function setElementTemplateForGroupClass($groupClass, $elementClass, $template)
{
$this->elementTemplatesForGroupClass[strtolower($groupClass)][strtolower($elementClass)] = $template;
return $this;
} | php | public function setElementTemplateForGroupClass($groupClass, $elementClass, $template)
{
$this->elementTemplatesForGroupClass[strtolower($groupClass)][strtolower($elementClass)] = $template;
return $this;
} | [
"public",
"function",
"setElementTemplateForGroupClass",
"(",
"$",
"groupClass",
",",
"$",
"elementClass",
",",
"$",
"template",
")",
"{",
"$",
"this",
"->",
"elementTemplatesForGroupClass",
"[",
"strtolower",
"(",
"$",
"groupClass",
")",
"]",
"[",
"strtolower",
... | Sets grouped elements templates using group class
Templates set via {@link setTemplateForClass()} will not be used for
grouped form elements. When searching for a template to use, the renderer
will first consider template set for a specific group id, then the
group templates set by group class.
@param string Grou... | [
"Sets",
"grouped",
"elements",
"templates",
"using",
"group",
"class"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Renderer/Default.php#L227-L231 | train | Set the element template for the group class | [
30522,
2270,
3853,
2275,
12260,
3672,
18532,
15725,
29278,
17058,
26266,
1006,
1002,
2177,
26266,
1010,
1002,
5783,
26266,
1010,
1002,
23561,
1007,
1063,
1002,
2023,
1011,
1028,
5783,
18532,
15725,
22747,
21759,
22107,
26266,
1031,
2358,
5339... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Queue/SqsQueue.php | SqsQueue.size | public function size($queue = null)
{
$response = $this->sqs->getQueueAttributes([
'QueueUrl' => $this->getQueue($queue),
'AttributeNames' => ['ApproximateNumberOfMessages'],
]);
$attributes = $response->get('Attributes');
return (int) $attributes['Approxima... | php | public function size($queue = null)
{
$response = $this->sqs->getQueueAttributes([
'QueueUrl' => $this->getQueue($queue),
'AttributeNames' => ['ApproximateNumberOfMessages'],
]);
$attributes = $response->get('Attributes');
return (int) $attributes['Approxima... | [
"public",
"function",
"size",
"(",
"$",
"queue",
"=",
"null",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"sqs",
"->",
"getQueueAttributes",
"(",
"[",
"'QueueUrl'",
"=>",
"$",
"this",
"->",
"getQueue",
"(",
"$",
"queue",
")",
",",
"'AttributeNam... | Get the size of the queue.
@param string $queue
@return int | [
"Get",
"the",
"size",
"of",
"the",
"queue",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Queue/SqsQueue.php#L53-L63 | train | Get the size of all messages in the queue | [
30522,
2270,
3853,
2946,
1006,
1002,
24240,
1027,
19701,
1007,
1063,
1002,
3433,
1027,
1002,
2023,
1011,
1028,
5490,
2015,
1011,
1028,
2131,
4226,
5657,
19321,
3089,
8569,
4570,
1006,
1031,
1005,
24240,
3126,
2140,
1005,
1027,
1028,
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/QuickForm2.php | QuickForm2.getSubmitValue | public function getSubmitValue($elementName)
{
$value = $this->getValue();
return isset($value[$elementName]) ? $value[$elementName] : null;
} | php | public function getSubmitValue($elementName)
{
$value = $this->getValue();
return isset($value[$elementName]) ? $value[$elementName] : null;
} | [
"public",
"function",
"getSubmitValue",
"(",
"$",
"elementName",
")",
"{",
"$",
"value",
"=",
"$",
"this",
"->",
"getValue",
"(",
")",
";",
"return",
"isset",
"(",
"$",
"value",
"[",
"$",
"elementName",
"]",
")",
"?",
"$",
"value",
"[",
"$",
"element... | Ported from HTML_QuickForm to minimize changes to Controllers
@param string $elementName
@return mixed | [
"Ported",
"from",
"HTML_QuickForm",
"to",
"minimize",
"changes",
"to",
"Controllers"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/QuickForm2.php#L104-L108 | train | Get Submit Value | [
30522,
2270,
3853,
4152,
12083,
22930,
10175,
5657,
1006,
1002,
5783,
18442,
1007,
1063,
1002,
3643,
1027,
1002,
2023,
1011,
1028,
2131,
10175,
5657,
1006,
1007,
1025,
2709,
26354,
3388,
1006,
1002,
3643,
1031,
1002,
5783,
18442,
1033,
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... |
walkor/Workerman | Connection/TcpConnection.php | TcpConnection.pauseRecv | public function pauseRecv()
{
Worker::$globalEvent->del($this->_socket, EventInterface::EV_READ);
$this->_isPaused = true;
} | php | public function pauseRecv()
{
Worker::$globalEvent->del($this->_socket, EventInterface::EV_READ);
$this->_isPaused = true;
} | [
"public",
"function",
"pauseRecv",
"(",
")",
"{",
"Worker",
"::",
"$",
"globalEvent",
"->",
"del",
"(",
"$",
"this",
"->",
"_socket",
",",
"EventInterface",
"::",
"EV_READ",
")",
";",
"$",
"this",
"->",
"_isPaused",
"=",
"true",
";",
"}"
] | Pauses the reading of data. That is onMessage will not be emitted. Useful to throttle back an upload.
@return void | [
"Pauses",
"the",
"reading",
"of",
"data",
".",
"That",
"is",
"onMessage",
"will",
"not",
"be",
"emitted",
".",
"Useful",
"to",
"throttle",
"back",
"an",
"upload",
"."
] | 13649907f05014fcfffcfccaef01e63ad3339351 | https://github.com/walkor/Workerman/blob/13649907f05014fcfffcfccaef01e63ad3339351/Connection/TcpConnection.php#L548-L552 | train | Pause the receive process. | [
30522,
2270,
3853,
8724,
2890,
2278,
2615,
1006,
1007,
1063,
7309,
1024,
1024,
1002,
3795,
18697,
3372,
1011,
1028,
3972,
1006,
1002,
2023,
1011,
1028,
1035,
22278,
1010,
2724,
18447,
2121,
12172,
1024,
1024,
23408,
1035,
3191,
1007,
1025,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/Zend/Cache/Backend/Apc.php | Zend_Cache_Backend_Apc.getMetadatas | public function getMetadatas($id)
{
$tmp = apc_fetch($id);
if (is_array($tmp)) {
$data = $tmp[0];
$mtime = $tmp[1];
if (!isset($tmp[2])) {
// because this record is only with 1.7 release
// if old cache records are still there...
... | php | public function getMetadatas($id)
{
$tmp = apc_fetch($id);
if (is_array($tmp)) {
$data = $tmp[0];
$mtime = $tmp[1];
if (!isset($tmp[2])) {
// because this record is only with 1.7 release
// if old cache records are still there...
... | [
"public",
"function",
"getMetadatas",
"(",
"$",
"id",
")",
"{",
"$",
"tmp",
"=",
"apc_fetch",
"(",
"$",
"id",
")",
";",
"if",
"(",
"is_array",
"(",
"$",
"tmp",
")",
")",
"{",
"$",
"data",
"=",
"$",
"tmp",
"[",
"0",
"]",
";",
"$",
"mtime",
"="... | Return an array of metadatas for the given cache id
The array must include these keys :
- expire : the expire timestamp
- tags : a string array of tags
- mtime : timestamp of last modification time
@param string $id cache id
@return array array of metadatas (false if the cache id is not found) | [
"Return",
"an",
"array",
"of",
"metadatas",
"for",
"the",
"given",
"cache",
"id"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache/Backend/Apc.php#L279-L298 | train | Returns array of cache record information | [
30522,
2270,
3853,
2131,
11368,
8447,
10230,
1006,
1002,
8909,
1007,
1063,
1002,
1056,
8737,
1027,
9706,
2278,
1035,
18584,
1006,
1002,
8909,
1007,
1025,
2065,
1006,
2003,
1035,
9140,
1006,
1002,
1056,
8737,
1007,
1007,
1063,
1002,
2951,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Common/Data/Validation.php | Validation.validate | public static function validate($value, array $field)
{
if (!isset($field['type'])) {
$field['type'] = 'text';
}
$type = $validate['type'] ?? $field['type'];
$validate = (array)($field['validate'] ?? null);
$required = $validate['required'] ?? false;
// I... | php | public static function validate($value, array $field)
{
if (!isset($field['type'])) {
$field['type'] = 'text';
}
$type = $validate['type'] ?? $field['type'];
$validate = (array)($field['validate'] ?? null);
$required = $validate['required'] ?? false;
// I... | [
"public",
"static",
"function",
"validate",
"(",
"$",
"value",
",",
"array",
"$",
"field",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"field",
"[",
"'type'",
"]",
")",
")",
"{",
"$",
"field",
"[",
"'type'",
"]",
"=",
"'text'",
";",
"}",
"$",
... | Validate value against a blueprint field definition.
@param mixed $value
@param array $field
@return array | [
"Validate",
"value",
"against",
"a",
"blueprint",
"field",
"definition",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Data/Validation.php#L25-L78 | train | Validate a value with the type and optional validation rules. | [
30522,
2270,
10763,
3853,
9398,
3686,
1006,
1002,
3643,
1010,
9140,
1002,
2492,
1007,
1063,
2065,
1006,
999,
26354,
3388,
1006,
1002,
2492,
1031,
1005,
2828,
1005,
1033,
1007,
1007,
1063,
1002,
2492,
1031,
1005,
2828,
1005,
1033,
1027,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/HttpKernel/Kernel.php | Kernel.locateResource | public function locateResource($name, $dir = null, $first = true)
{
if ('@' !== $name[0]) {
throw new \InvalidArgumentException(sprintf('A resource name must start with @ ("%s" given).', $name));
}
if (false !== strpos($name, '..')) {
throw new \RuntimeException(spri... | php | public function locateResource($name, $dir = null, $first = true)
{
if ('@' !== $name[0]) {
throw new \InvalidArgumentException(sprintf('A resource name must start with @ ("%s" given).', $name));
}
if (false !== strpos($name, '..')) {
throw new \RuntimeException(spri... | [
"public",
"function",
"locateResource",
"(",
"$",
"name",
",",
"$",
"dir",
"=",
"null",
",",
"$",
"first",
"=",
"true",
")",
"{",
"if",
"(",
"'@'",
"!==",
"$",
"name",
"[",
"0",
"]",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
... | {@inheritdoc}
@throws \RuntimeException if a custom resource is hidden by a resource in a derived bundle | [
"{",
"@inheritdoc",
"}"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpKernel/Kernel.php#L242-L279 | train | Locates a resource file | [
30522,
2270,
3853,
12453,
6072,
8162,
3401,
1006,
1002,
2171,
1010,
1002,
16101,
1027,
19701,
1010,
1002,
2034,
1027,
2995,
1007,
1063,
2065,
1006,
1005,
1030,
1005,
999,
1027,
1027,
1002,
2171,
1031,
1014,
1033,
1007,
1063,
5466,
2047,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/CssSelector/Parser/Parser.php | Parser.parse | public function parse(string $source): array
{
$reader = new Reader($source);
$stream = $this->tokenizer->tokenize($reader);
return $this->parseSelectorList($stream);
} | php | public function parse(string $source): array
{
$reader = new Reader($source);
$stream = $this->tokenizer->tokenize($reader);
return $this->parseSelectorList($stream);
} | [
"public",
"function",
"parse",
"(",
"string",
"$",
"source",
")",
":",
"array",
"{",
"$",
"reader",
"=",
"new",
"Reader",
"(",
"$",
"source",
")",
";",
"$",
"stream",
"=",
"$",
"this",
"->",
"tokenizer",
"->",
"tokenize",
"(",
"$",
"reader",
")",
"... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/CssSelector/Parser/Parser.php#L40-L46 | train | Parse a selector list | [
30522,
2270,
3853,
11968,
3366,
1006,
5164,
1002,
3120,
1007,
1024,
9140,
1063,
1002,
8068,
1027,
2047,
8068,
1006,
1002,
3120,
1007,
1025,
1002,
5460,
1027,
1002,
2023,
1011,
1028,
19204,
17629,
1011,
1028,
19204,
4697,
1006,
1002,
8068,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/HTML/QuickForm2/Element/Select.php | HTML_QuickForm2_Element_Select.getValue | public function getValue()
{
if (!empty($this->attributes['disabled']) || 0 == count($this->values)
|| ($this->data['intrinsic_validation']
&& (0 == count($this->optionContainer) || 0 == count($this->possibleValues)))
) {
return null;
}
$value... | php | public function getValue()
{
if (!empty($this->attributes['disabled']) || 0 == count($this->values)
|| ($this->data['intrinsic_validation']
&& (0 == count($this->optionContainer) || 0 == count($this->possibleValues)))
) {
return null;
}
$value... | [
"public",
"function",
"getValue",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"attributes",
"[",
"'disabled'",
"]",
")",
"||",
"0",
"==",
"count",
"(",
"$",
"this",
"->",
"values",
")",
"||",
"(",
"$",
"this",
"->",
"data",
"[... | Returns the value of the <select> element
Please note that the returned value may not necessarily be equal to that
passed to {@link setValue()}. It passes "intrinsic validation" confirming
that such value could possibly be submitted by this <select> element.
Specifically, this method will return null if the elements "... | [
"Returns",
"the",
"value",
"of",
"the",
"<select",
">",
"element"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Element/Select.php#L423-L455 | train | Returns the value of the select field | [
30522,
2270,
3853,
2131,
10175,
5657,
1006,
1007,
1063,
2065,
1006,
999,
4064,
1006,
1002,
2023,
1011,
1028,
12332,
1031,
1005,
9776,
1005,
1033,
1007,
1064,
1064,
1014,
1027,
1027,
4175,
1006,
1002,
2023,
1011,
1028,
5300,
1007,
1064,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/HttpFoundation/Session/Storage/Handler/PdoSessionHandler.php | PdoSessionHandler.commit | private function commit()
{
if ($this->inTransaction) {
try {
// commit read-write transaction which also releases the lock
if ('sqlite' === $this->driver) {
$this->pdo->exec('COMMIT');
} else {
$this->pdo->c... | php | private function commit()
{
if ($this->inTransaction) {
try {
// commit read-write transaction which also releases the lock
if ('sqlite' === $this->driver) {
$this->pdo->exec('COMMIT');
} else {
$this->pdo->c... | [
"private",
"function",
"commit",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"inTransaction",
")",
"{",
"try",
"{",
"// commit read-write transaction which also releases the lock",
"if",
"(",
"'sqlite'",
"===",
"$",
"this",
"->",
"driver",
")",
"{",
"$",
"thi... | Helper method to commit a transaction. | [
"Helper",
"method",
"to",
"commit",
"a",
"transaction",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/PdoSessionHandler.php#L562-L579 | train | Commits the current transaction | [
30522,
2797,
3853,
10797,
1006,
1007,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
26721,
3619,
18908,
3258,
1007,
1063,
3046,
1063,
1013,
1013,
10797,
3191,
1011,
4339,
12598,
2029,
2036,
7085,
1996,
5843,
2065,
1006,
1005,
29296,
4221,
1005,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Routing/Router.php | Router.view | public function view($uri, $view, $data = [])
{
return $this->match(['GET', 'HEAD'], $uri, '\Illuminate\Routing\ViewController')
->defaults('view', $view)
->defaults('data', $data);
} | php | public function view($uri, $view, $data = [])
{
return $this->match(['GET', 'HEAD'], $uri, '\Illuminate\Routing\ViewController')
->defaults('view', $view)
->defaults('data', $data);
} | [
"public",
"function",
"view",
"(",
"$",
"uri",
",",
"$",
"view",
",",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"match",
"(",
"[",
"'GET'",
",",
"'HEAD'",
"]",
",",
"$",
"uri",
",",
"'\\Illuminate\\Routing\\ViewController'",
... | Register a new route that returns a view.
@param string $uri
@param string $view
@param array $data
@return \Illuminate\Routing\Route | [
"Register",
"a",
"new",
"route",
"that",
"returns",
"a",
"view",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/Router.php#L269-L274 | train | View a controller | [
30522,
2270,
3853,
3193,
1006,
1002,
24471,
2072,
1010,
1002,
3193,
1010,
1002,
2951,
1027,
1031,
1033,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
30524,
12717,
12556,
1032,
16972,
1032,
3193,
8663,
13181,
10820,
1005,
1007,
1011,
1028,
1239... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/EventDispatcher/EventDispatcher.php | EventDispatcher.hasListeners | public function hasListeners($eventName = null)
{
if (null !== $eventName) {
return !empty($this->listeners[$eventName]);
}
foreach ($this->listeners as $eventListeners) {
if ($eventListeners) {
return true;
}
}
return fal... | php | public function hasListeners($eventName = null)
{
if (null !== $eventName) {
return !empty($this->listeners[$eventName]);
}
foreach ($this->listeners as $eventListeners) {
if ($eventListeners) {
return true;
}
}
return fal... | [
"public",
"function",
"hasListeners",
"(",
"$",
"eventName",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"eventName",
")",
"{",
"return",
"!",
"empty",
"(",
"$",
"this",
"->",
"listeners",
"[",
"$",
"eventName",
"]",
")",
";",
"}",
"foreach... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/EventDispatcher/EventDispatcher.php#L135-L148 | train | Has listeners? | [
30522,
2270,
3853,
2038,
9863,
24454,
2015,
1006,
1002,
2724,
18442,
1027,
19701,
1007,
1063,
2065,
1006,
19701,
999,
1027,
1027,
1002,
2724,
18442,
1007,
1063,
2709,
999,
4064,
1006,
1002,
2023,
1011,
1028,
13810,
1031,
1002,
2724,
18442,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Database/Console/Migrations/RefreshCommand.php | RefreshCommand.runReset | protected function runReset($database, $path)
{
$this->call('migrate:reset', array_filter([
'--database' => $database,
'--path' => $path,
'--realpath' => $this->input->getOption('realpath'),
'--force' => true,
]));
} | php | protected function runReset($database, $path)
{
$this->call('migrate:reset', array_filter([
'--database' => $database,
'--path' => $path,
'--realpath' => $this->input->getOption('realpath'),
'--force' => true,
]));
} | [
"protected",
"function",
"runReset",
"(",
"$",
"database",
",",
"$",
"path",
")",
"{",
"$",
"this",
"->",
"call",
"(",
"'migrate:reset'",
",",
"array_filter",
"(",
"[",
"'--database'",
"=>",
"$",
"database",
",",
"'--path'",
"=>",
"$",
"path",
",",
"'--r... | Run the reset command.
@param string $database
@param string $path
@return void | [
"Run",
"the",
"reset",
"command",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Console/Migrations/RefreshCommand.php#L97-L105 | train | Runs the reset command on the next reset process. | [
30522,
5123,
3853,
2448,
6072,
3388,
1006,
1002,
7809,
1010,
1002,
4130,
1007,
1063,
1002,
2023,
1011,
1028,
2655,
1006,
1005,
22806,
1024,
25141,
1005,
1010,
9140,
1035,
11307,
1006,
1031,
1005,
1011,
1011,
7809,
1005,
1027,
1028,
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/CoreAdminHome/Commands/SetConfig/ConfigSettingManipulation.php | ConfigSettingManipulation.manipulate | public function manipulate(Config $config)
{
if ($this->isArrayAppend) {
$this->appendToArraySetting($config);
} else {
$this->setSingleConfigValue($config);
}
} | php | public function manipulate(Config $config)
{
if ($this->isArrayAppend) {
$this->appendToArraySetting($config);
} else {
$this->setSingleConfigValue($config);
}
} | [
"public",
"function",
"manipulate",
"(",
"Config",
"$",
"config",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isArrayAppend",
")",
"{",
"$",
"this",
"->",
"appendToArraySetting",
"(",
"$",
"config",
")",
";",
"}",
"else",
"{",
"$",
"this",
"->",
"setSingl... | Performs the INI config manipulation.
@param Config $config
@throws \Exception if trying to append to a non-array setting value or if trying to set an
array value to a non-array setting | [
"Performs",
"the",
"INI",
"config",
"manipulation",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/CoreAdminHome/Commands/SetConfig/ConfigSettingManipulation.php#L60-L67 | train | This method is called by the parent class to manipulate the config. | [
30522,
2270,
3853,
17708,
1006,
9530,
8873,
2290,
1002,
9530,
8873,
2290,
1007,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
18061,
11335,
3148,
21512,
4859,
1007,
1063,
1002,
2023,
1011,
1028,
10439,
10497,
3406,
2906,
9447,
21678,
2075,
1006... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Http/Concerns/InteractsWithInput.php | InteractsWithInput.input | public function input($key = null, $default = null)
{
return data_get(
$this->getInputSource()->all() + $this->query->all(), $key, $default
);
} | php | public function input($key = null, $default = null)
{
return data_get(
$this->getInputSource()->all() + $this->query->all(), $key, $default
);
} | [
"public",
"function",
"input",
"(",
"$",
"key",
"=",
"null",
",",
"$",
"default",
"=",
"null",
")",
"{",
"return",
"data_get",
"(",
"$",
"this",
"->",
"getInputSource",
"(",
")",
"->",
"all",
"(",
")",
"+",
"$",
"this",
"->",
"query",
"->",
"all",
... | Retrieve an input item from the request.
@param string|null $key
@param string|array|null $default
@return string|array|null | [
"Retrieve",
"an",
"input",
"item",
"from",
"the",
"request",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Http/Concerns/InteractsWithInput.php#L206-L211 | train | Get the input from the request | [
30522,
2270,
3853,
7953,
1006,
1002,
3145,
1027,
19701,
1010,
1002,
12398,
1027,
19701,
1007,
1063,
2709,
2951,
1035,
2131,
1006,
1002,
2023,
1011,
1028,
2131,
2378,
18780,
6499,
3126,
3401,
1006,
1007,
1011,
1028,
2035,
1006,
1007,
1009,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/CoreVisualizations/JqplotDataGenerator.php | JqplotDataGenerator.factory | public static function factory($type, $properties)
{
switch ($type) {
case 'evolution':
return new JqplotDataGenerator\Evolution($properties, $type);
case 'pie':
case 'bar':
return new JqplotDataGenerator($properties, $type);
de... | php | public static function factory($type, $properties)
{
switch ($type) {
case 'evolution':
return new JqplotDataGenerator\Evolution($properties, $type);
case 'pie':
case 'bar':
return new JqplotDataGenerator($properties, $type);
de... | [
"public",
"static",
"function",
"factory",
"(",
"$",
"type",
",",
"$",
"properties",
")",
"{",
"switch",
"(",
"$",
"type",
")",
"{",
"case",
"'evolution'",
":",
"return",
"new",
"JqplotDataGenerator",
"\\",
"Evolution",
"(",
"$",
"properties",
",",
"$",
... | Creates a new JqplotDataGenerator instance for a graph type and view properties.
@param string $type 'pie', 'bar', or 'evolution'
@param array $properties The view properties.
@throws \Exception
@return JqplotDataGenerator | [
"Creates",
"a",
"new",
"JqplotDataGenerator",
"instance",
"for",
"a",
"graph",
"type",
"and",
"view",
"properties",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/CoreVisualizations/JqplotDataGenerator.php#L45-L56 | train | Factory method for the given type and properties | [
30522,
2270,
10763,
3853,
4713,
1006,
1002,
2828,
1010,
1002,
5144,
1007,
1063,
6942,
1006,
1002,
2828,
1007,
1063,
2553,
1005,
6622,
1005,
1024,
2709,
2047,
1046,
4160,
24759,
4140,
2850,
26702,
3678,
8844,
1032,
6622,
1006,
1002,
5144,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/DomCrawler/Crawler.php | Crawler.filterXPath | public function filterXPath($xpath)
{
$xpath = $this->relativize($xpath);
// If we dropped all expressions in the XPath while preparing it, there would be no match
if ('' === $xpath) {
return $this->createSubCrawler(null);
}
return $this->filterRelativeXPath($xp... | php | public function filterXPath($xpath)
{
$xpath = $this->relativize($xpath);
// If we dropped all expressions in the XPath while preparing it, there would be no match
if ('' === $xpath) {
return $this->createSubCrawler(null);
}
return $this->filterRelativeXPath($xp... | [
"public",
"function",
"filterXPath",
"(",
"$",
"xpath",
")",
"{",
"$",
"xpath",
"=",
"$",
"this",
"->",
"relativize",
"(",
"$",
"xpath",
")",
";",
"// If we dropped all expressions in the XPath while preparing it, there would be no match",
"if",
"(",
"''",
"===",
"$... | Filters the list of nodes with an XPath expression.
The XPath expression is evaluated in the context of the crawler, which
is considered as a fake parent of the elements inside it.
This means that a child selector "div" or "./div" will match only
the div elements of the current crawler, not their children.
@param str... | [
"Filters",
"the",
"list",
"of",
"nodes",
"with",
"an",
"XPath",
"expression",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/DomCrawler/Crawler.php#L698-L708 | train | Filter the XPath to a single node | [
30522,
2270,
3853,
11307,
2595,
15069,
1006,
1002,
26726,
8988,
1007,
1063,
1002,
26726,
8988,
1027,
1002,
2023,
1011,
1028,
2128,
20051,
12848,
4697,
1006,
1002,
26726,
8988,
1007,
1025,
1013,
1013,
2065,
2057,
3333,
2035,
11423,
1999,
199... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Translation/TranslationServiceProvider.php | TranslationServiceProvider.register | public function register()
{
$this->registerLoader();
$this->app->singleton('translator', function ($app) {
$loader = $app['translation.loader'];
// When registering the translator component, we'll need to set the default
// locale as well as the fallback locale... | php | public function register()
{
$this->registerLoader();
$this->app->singleton('translator', function ($app) {
$loader = $app['translation.loader'];
// When registering the translator component, we'll need to set the default
// locale as well as the fallback locale... | [
"public",
"function",
"register",
"(",
")",
"{",
"$",
"this",
"->",
"registerLoader",
"(",
")",
";",
"$",
"this",
"->",
"app",
"->",
"singleton",
"(",
"'translator'",
",",
"function",
"(",
"$",
"app",
")",
"{",
"$",
"loader",
"=",
"$",
"app",
"[",
... | Register the service provider.
@return void | [
"Register",
"the",
"service",
"provider",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Translation/TranslationServiceProvider.php#L15-L33 | train | Registers the translator component | [
30522,
2270,
3853,
4236,
1006,
1007,
1063,
1002,
2023,
1011,
1028,
4236,
11066,
2121,
1006,
1007,
1025,
1002,
2023,
1011,
1028,
10439,
1011,
1028,
28159,
1006,
1005,
11403,
1005,
1010,
3853,
1006,
1002,
10439,
1007,
1063,
1002,
7170,
2121,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/Zend/Cache/Backend/Libmemcached.php | Zend_Cache_Backend_Libmemcached.clean | public function clean($mode = Zend_Cache::CLEANING_MODE_ALL, $tags = array())
{
switch ($mode) {
case Zend_Cache::CLEANING_MODE_ALL:
return $this->_memcache->flush();
break;
case Zend_Cache::CLEANING_MODE_OLD:
$this->_log("Zend_Cache_Ba... | php | public function clean($mode = Zend_Cache::CLEANING_MODE_ALL, $tags = array())
{
switch ($mode) {
case Zend_Cache::CLEANING_MODE_ALL:
return $this->_memcache->flush();
break;
case Zend_Cache::CLEANING_MODE_OLD:
$this->_log("Zend_Cache_Ba... | [
"public",
"function",
"clean",
"(",
"$",
"mode",
"=",
"Zend_Cache",
"::",
"CLEANING_MODE_ALL",
",",
"$",
"tags",
"=",
"array",
"(",
")",
")",
"{",
"switch",
"(",
"$",
"mode",
")",
"{",
"case",
"Zend_Cache",
"::",
"CLEANING_MODE_ALL",
":",
"return",
"$",
... | Clean some cache records
Available modes are :
'all' (default) => remove all cache entries ($tags is not used)
'old' => unsupported
'matchingTag' => unsupported
'notMatchingTag' => unsupported
'matchingAnyTag' => unsupported
@param string $mode Clean mode
@param array $tags Array of tags
@throws Zen... | [
"Clean",
"some",
"cache",
"records"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache/Backend/Libmemcached.php#L245-L263 | train | Flushes all cache | [
30522,
2270,
3853,
4550,
1006,
1002,
5549,
1027,
16729,
2094,
1035,
17053,
1024,
1024,
9344,
1035,
5549,
1035,
2035,
1010,
1002,
22073,
1027,
9140,
1006,
1007,
1007,
1063,
6942,
1006,
1002,
5549,
1007,
1063,
2553,
16729,
2094,
1035,
17053,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/File/Size.php | Zend_Validate_File_Size.getMin | public function getMin($raw = false)
{
$min = $this->_min;
if (!$raw && $this->useByteString()) {
$min = $this->_toByteString($min);
}
return $min;
} | php | public function getMin($raw = false)
{
$min = $this->_min;
if (!$raw && $this->useByteString()) {
$min = $this->_toByteString($min);
}
return $min;
} | [
"public",
"function",
"getMin",
"(",
"$",
"raw",
"=",
"false",
")",
"{",
"$",
"min",
"=",
"$",
"this",
"->",
"_min",
";",
"if",
"(",
"!",
"$",
"raw",
"&&",
"$",
"this",
"->",
"useByteString",
"(",
")",
")",
"{",
"$",
"min",
"=",
"$",
"this",
... | Returns the minimum filesize
@param bool $raw Whether or not to force return of the raw value (defaults off)
@return integer|string | [
"Returns",
"the",
"minimum",
"filesize"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Validate/File/Size.php#L164-L172 | train | Get Minimum Value of this Field | [
30522,
2270,
3853,
2131,
10020,
1006,
1002,
6315,
1027,
6270,
1007,
1063,
1002,
8117,
1027,
1002,
2023,
1011,
1028,
1035,
8117,
1025,
2065,
1006,
999,
1002,
6315,
1004,
1004,
1002,
2023,
1011,
1028,
2224,
3762,
22199,
4892,
1006,
1007,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/DependencyInjection/Loader/Configurator/Traits/FactoryTrait.php | FactoryTrait.factory | final public function factory($factory)
{
if (\is_string($factory) && 1 === substr_count($factory, ':')) {
$factoryParts = explode(':', $factory);
throw new InvalidArgumentException(sprintf('Invalid factory "%s": the "service:method" notation is not available when using PHP-based DI... | php | final public function factory($factory)
{
if (\is_string($factory) && 1 === substr_count($factory, ':')) {
$factoryParts = explode(':', $factory);
throw new InvalidArgumentException(sprintf('Invalid factory "%s": the "service:method" notation is not available when using PHP-based DI... | [
"final",
"public",
"function",
"factory",
"(",
"$",
"factory",
")",
"{",
"if",
"(",
"\\",
"is_string",
"(",
"$",
"factory",
")",
"&&",
"1",
"===",
"substr_count",
"(",
"$",
"factory",
",",
"':'",
")",
")",
"{",
"$",
"factoryParts",
"=",
"explode",
"(... | Sets a factory.
@param string|array $factory A PHP callable reference
@return $this | [
"Sets",
"a",
"factory",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/DependencyInjection/Loader/Configurator/Traits/FactoryTrait.php#L25-L36 | train | Sets the factory for the class | [
30522,
2345,
2270,
3853,
4713,
1006,
1002,
4713,
1007,
1063,
2065,
1006,
1032,
2003,
1035,
5164,
1006,
1002,
4713,
1007,
1004,
1004,
1015,
1027,
1027,
1027,
4942,
3367,
2099,
1035,
4175,
1006,
1002,
4713,
1010,
1005,
1024,
1005,
1007,
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/DataTable/Manager.php | Manager.deleteAll | public function deleteAll($deleteWhenIdTableGreaterThan = 0)
{
foreach ($this as $id => $table) {
if ($id > $deleteWhenIdTableGreaterThan) {
$this->deleteTable($id);
}
}
if ($deleteWhenIdTableGreaterThan == 0) {
$this->exchangeArray(array(... | php | public function deleteAll($deleteWhenIdTableGreaterThan = 0)
{
foreach ($this as $id => $table) {
if ($id > $deleteWhenIdTableGreaterThan) {
$this->deleteTable($id);
}
}
if ($deleteWhenIdTableGreaterThan == 0) {
$this->exchangeArray(array(... | [
"public",
"function",
"deleteAll",
"(",
"$",
"deleteWhenIdTableGreaterThan",
"=",
"0",
")",
"{",
"foreach",
"(",
"$",
"this",
"as",
"$",
"id",
"=>",
"$",
"table",
")",
"{",
"if",
"(",
"$",
"id",
">",
"$",
"deleteWhenIdTableGreaterThan",
")",
"{",
"$",
... | Delete all the registered DataTables from the manager | [
"Delete",
"all",
"the",
"registered",
"DataTables",
"from",
"the",
"manager"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable/Manager.php#L84-L96 | train | Delete all tables from the database | [
30522,
2270,
3853,
3972,
12870,
8095,
1006,
1002,
3972,
12870,
2860,
10222,
3593,
10880,
17603,
24932,
21604,
1027,
1014,
1007,
1063,
18921,
6776,
1006,
1002,
2023,
2004,
1002,
8909,
1027,
1028,
1002,
2795,
1007,
1063,
2065,
1006,
1002,
890... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.setGlobalSearchParameters | public function setGlobalSearchParameters($searchKeywordParameters, $searchCategoryParameters)
{
Piwik::checkUserHasSuperUserAccess();
Option::set(self::OPTION_SEARCH_KEYWORD_QUERY_PARAMETERS_GLOBAL, $searchKeywordParameters);
Option::set(self::OPTION_SEARCH_CATEGORY_QUERY_PARAMETERS_GLOBAL,... | php | public function setGlobalSearchParameters($searchKeywordParameters, $searchCategoryParameters)
{
Piwik::checkUserHasSuperUserAccess();
Option::set(self::OPTION_SEARCH_KEYWORD_QUERY_PARAMETERS_GLOBAL, $searchKeywordParameters);
Option::set(self::OPTION_SEARCH_CATEGORY_QUERY_PARAMETERS_GLOBAL,... | [
"public",
"function",
"setGlobalSearchParameters",
"(",
"$",
"searchKeywordParameters",
",",
"$",
"searchCategoryParameters",
")",
"{",
"Piwik",
"::",
"checkUserHasSuperUserAccess",
"(",
")",
";",
"Option",
"::",
"set",
"(",
"self",
"::",
"OPTION_SEARCH_KEYWORD_QUERY_PA... | Sets Site Search keyword/category parameter names, to be used on websites which have not specified these values
Expects Comma separated list of query params names
@param string
@param string
@return bool | [
"Sets",
"Site",
"Search",
"keyword",
"/",
"category",
"parameter",
"names",
"to",
"be",
"used",
"on",
"websites",
"which",
"have",
"not",
"specified",
"these",
"values",
"Expects",
"Comma",
"separated",
"list",
"of",
"query",
"params",
"names"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SitesManager/API.php#L985-L992 | train | This method sets the global search parameters for the current language. | [
30522,
2270,
3853,
2275,
23296,
16429,
9777,
14644,
2818,
28689,
22828,
2015,
1006,
1002,
3945,
14839,
18351,
28689,
22828,
2015,
1010,
1002,
3945,
16280,
20255,
22571,
5400,
22828,
2015,
1007,
1063,
14255,
9148,
2243,
1024,
1024,
4638,
20330... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/backend/classes/FormField.php | FormField.getFieldNameFromData | protected function getFieldNameFromData($fieldName, $data, $default = null)
{
/*
* Array field name, eg: field[key][key2][key3]
*/
$keyParts = HtmlHelper::nameToArray($fieldName);
$lastField = end($keyParts);
$result = $data;
/*
* Loop the field ke... | php | protected function getFieldNameFromData($fieldName, $data, $default = null)
{
/*
* Array field name, eg: field[key][key2][key3]
*/
$keyParts = HtmlHelper::nameToArray($fieldName);
$lastField = end($keyParts);
$result = $data;
/*
* Loop the field ke... | [
"protected",
"function",
"getFieldNameFromData",
"(",
"$",
"fieldName",
",",
"$",
"data",
",",
"$",
"default",
"=",
"null",
")",
"{",
"/*\n * Array field name, eg: field[key][key2][key3]\n */",
"$",
"keyParts",
"=",
"HtmlHelper",
"::",
"nameToArray",
"("... | Internal method to extract the value of a field name from a data set.
@param string $fieldName
@param mixed $data
@param mixed $default
@return mixed | [
"Internal",
"method",
"to",
"extract",
"the",
"value",
"of",
"a",
"field",
"name",
"from",
"a",
"data",
"set",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/FormField.php#L676-L716 | train | Get the field name from the data | [
30522,
5123,
3853,
2131,
3790,
18442,
19699,
5358,
2850,
2696,
1006,
1002,
2492,
18442,
1010,
1002,
2951,
1010,
1002,
12398,
1027,
19701,
1007,
1063,
1013,
1008,
1008,
9140,
2492,
2171,
1010,
1041,
2290,
1024,
2492,
1031,
3145,
1033,
1031,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/API/Proxy.php | Proxy.registerClass | public function registerClass($className)
{
if (isset($this->alreadyRegistered[$className])) {
return;
}
$this->includeApiFile($className);
$this->checkClassIsSingleton($className);
$rClass = new ReflectionClass($className);
if (!$this->shouldHideAPIMetho... | php | public function registerClass($className)
{
if (isset($this->alreadyRegistered[$className])) {
return;
}
$this->includeApiFile($className);
$this->checkClassIsSingleton($className);
$rClass = new ReflectionClass($className);
if (!$this->shouldHideAPIMetho... | [
"public",
"function",
"registerClass",
"(",
"$",
"className",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"alreadyRegistered",
"[",
"$",
"className",
"]",
")",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"includeApiFile",
"(",
"$",
"clas... | Registers the API information of a given module.
The module to be registered must be
- a singleton (providing a getInstance() method)
- the API file must be located in plugins/ModuleName/API.php
for example plugins/Referrers/API.php
The method will introspect the methods, their parameters, etc.
@param string $classN... | [
"Registers",
"the",
"API",
"information",
"of",
"a",
"given",
"module",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/API/Proxy.php#L75-L92 | train | Registers the API method metadata for the given class. | [
30522,
2270,
3853,
4236,
26266,
1006,
1002,
2465,
18442,
1007,
1063,
2065,
1006,
26354,
3388,
1006,
1002,
2023,
1011,
1028,
2525,
2890,
24063,
6850,
1031,
1002,
2465,
18442,
1033,
1007,
1007,
1063,
2709,
1025,
1065,
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/HttpKernel.php | HttpKernel.finishRequest | private function finishRequest(Request $request, int $type)
{
$this->dispatcher->dispatch(new FinishRequestEvent($this, $request, $type), KernelEvents::FINISH_REQUEST);
$this->requestStack->pop();
} | php | private function finishRequest(Request $request, int $type)
{
$this->dispatcher->dispatch(new FinishRequestEvent($this, $request, $type), KernelEvents::FINISH_REQUEST);
$this->requestStack->pop();
} | [
"private",
"function",
"finishRequest",
"(",
"Request",
"$",
"request",
",",
"int",
"$",
"type",
")",
"{",
"$",
"this",
"->",
"dispatcher",
"->",
"dispatch",
"(",
"new",
"FinishRequestEvent",
"(",
"$",
"this",
",",
"$",
"request",
",",
"$",
"type",
")",
... | Publishes the finish request event, then pop the request from the stack.
Note that the order of the operations is important here, otherwise
operations such as {@link RequestStack::getParentRequest()} can lead to
weird results. | [
"Publishes",
"the",
"finish",
"request",
"event",
"then",
"pop",
"the",
"request",
"from",
"the",
"stack",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpKernel/HttpKernel.php#L204-L208 | train | Finishes the current request | [
30522,
2797,
3853,
3926,
2890,
15500,
1006,
5227,
1002,
5227,
1010,
20014,
1002,
2828,
1007,
1063,
1002,
2023,
1011,
1028,
18365,
2121,
1011,
1028,
18365,
1006,
2047,
3926,
2890,
15500,
18697,
3372,
1006,
1002,
2023,
1010,
1002,
5227,
1010,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/Plugin/LogTablesProvider.php | LogTablesProvider.getLogTable | public function getLogTable($tableNameWithoutPrefix)
{
foreach ($this->getAllLogTables() as $table) {
if ($table->getName() === $tableNameWithoutPrefix) {
return $table;
}
}
} | php | public function getLogTable($tableNameWithoutPrefix)
{
foreach ($this->getAllLogTables() as $table) {
if ($table->getName() === $tableNameWithoutPrefix) {
return $table;
}
}
} | [
"public",
"function",
"getLogTable",
"(",
"$",
"tableNameWithoutPrefix",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getAllLogTables",
"(",
")",
"as",
"$",
"table",
")",
"{",
"if",
"(",
"$",
"table",
"->",
"getName",
"(",
")",
"===",
"$",
"tableNameWit... | Get an instance of a specific log table if such a log table exists.
@param string $tableNameWithoutPrefix eg "log_visit"
@return LogTable|null | [
"Get",
"an",
"instance",
"of",
"a",
"specific",
"log",
"table",
"if",
"such",
"a",
"log",
"table",
"exists",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Plugin/LogTablesProvider.php#L38-L45 | train | Get the log table for a given name without prefix | [
30522,
2270,
3853,
2131,
21197,
10880,
1006,
1002,
2795,
18442,
24415,
5833,
28139,
8873,
2595,
1007,
1063,
18921,
6776,
1006,
1002,
2023,
1011,
1028,
2131,
8095,
21197,
10880,
2015,
1006,
1007,
2004,
1002,
2795,
1007,
1063,
2065,
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/Console/RouteListCommand.php | RouteListCommand.handle | public function handle()
{
if (empty($this->routes)) {
return $this->error("Your application doesn't have any routes.");
}
if (empty($routes = $this->getRoutes())) {
return $this->error("Your application doesn't have any routes matching the given criteria.");
... | php | public function handle()
{
if (empty($this->routes)) {
return $this->error("Your application doesn't have any routes.");
}
if (empty($routes = $this->getRoutes())) {
return $this->error("Your application doesn't have any routes matching the given criteria.");
... | [
"public",
"function",
"handle",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"routes",
")",
")",
"{",
"return",
"$",
"this",
"->",
"error",
"(",
"\"Your application doesn't have any routes.\"",
")",
";",
"}",
"if",
"(",
"empty",
"(",
"$",
... | Execute the console command.
@return void | [
"Execute",
"the",
"console",
"command",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Foundation/Console/RouteListCommand.php#L68-L79 | train | Handle the request | [
30522,
2270,
3853,
5047,
1006,
1007,
1063,
2065,
1006,
4064,
1006,
1002,
2023,
1011,
1028,
5847,
1007,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
7561,
1006,
1000,
2115,
30524,
1012,
1000,
1007,
1025,
1065,
2065,
1006,
4064,
1006,
1002,
58... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Php.php | Php.render | public function render($dataTable = null)
{
if (is_null($dataTable)) {
$dataTable = $this->table;
}
$toReturn = $this->flatRender($dataTable);
if ($this->prettyDisplay) {
if (!is_array($toReturn)) {
$toReturn = Common::safe_unserialize($toRetu... | php | public function render($dataTable = null)
{
if (is_null($dataTable)) {
$dataTable = $this->table;
}
$toReturn = $this->flatRender($dataTable);
if ($this->prettyDisplay) {
if (!is_array($toReturn)) {
$toReturn = Common::safe_unserialize($toRetu... | [
"public",
"function",
"render",
"(",
"$",
"dataTable",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"dataTable",
")",
")",
"{",
"$",
"dataTable",
"=",
"$",
"this",
"->",
"table",
";",
"}",
"$",
"toReturn",
"=",
"$",
"this",
"->",
"flatRen... | Computes the dataTable output and returns the string/binary
@param null|DataTable|DataTable\Map|Simple $dataTable
@return string | [
"Computes",
"the",
"dataTable",
"output",
"and",
"returns",
"the",
"string",
"/",
"binary"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable/Renderer/Php.php#L72-L86 | train | Render the table | [
30522,
2270,
3853,
17552,
1006,
1002,
2951,
10880,
1027,
19701,
1007,
1063,
2065,
1006,
2003,
1035,
19701,
1006,
1002,
2951,
10880,
1007,
1007,
1063,
1002,
2951,
10880,
1027,
1002,
2023,
1011,
1028,
2795,
1025,
1065,
1002,
9538,
22299,
1027... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Cache/Simple/PhpArrayCache.php | PhpArrayCache.create | public static function create($file, Psr16CacheInterface $fallbackPool)
{
// Shared memory is available in PHP 7.0+ with OPCache enabled
if (filter_var(ini_get('opcache.enable'), FILTER_VALIDATE_BOOLEAN)) {
return new static($file, $fallbackPool);
}
return $fallbackPool;... | php | public static function create($file, Psr16CacheInterface $fallbackPool)
{
// Shared memory is available in PHP 7.0+ with OPCache enabled
if (filter_var(ini_get('opcache.enable'), FILTER_VALIDATE_BOOLEAN)) {
return new static($file, $fallbackPool);
}
return $fallbackPool;... | [
"public",
"static",
"function",
"create",
"(",
"$",
"file",
",",
"Psr16CacheInterface",
"$",
"fallbackPool",
")",
"{",
"// Shared memory is available in PHP 7.0+ with OPCache enabled",
"if",
"(",
"filter_var",
"(",
"ini_get",
"(",
"'opcache.enable'",
")",
",",
"FILTER_V... | This adapter takes advantage of how PHP stores arrays in its latest versions.
@param string $file The PHP file were values are cached
@return Psr16CacheInterface | [
"This",
"adapter",
"takes",
"advantage",
"of",
"how",
"PHP",
"stores",
"arrays",
"in",
"its",
"latest",
"versions",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Cache/Simple/PhpArrayCache.php#L48-L56 | train | Create a new instance of the class | [
30522,
2270,
10763,
3853,
3443,
1006,
1002,
5371,
1010,
8827,
2099,
16048,
3540,
5403,
18447,
2121,
12172,
1002,
2991,
5963,
16869,
1007,
1063,
1013,
1013,
4207,
3638,
2003,
2800,
1999,
25718,
1021,
1012,
1014,
1009,
2007,
6728,
3540,
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... |
matomo-org/matomo | libs/HTML/QuickForm2/Rule.php | HTML_QuickForm2_Rule.or_ | public function or_(HTML_QuickForm2_Rule $next)
{
if ($next instanceof HTML_QuickForm2_Rule_Required) {
throw new HTML_QuickForm2_InvalidArgumentException(
'or_(): Cannot add a "required" rule'
);
}
$this->chainedRules[] = array($next);
return ... | php | public function or_(HTML_QuickForm2_Rule $next)
{
if ($next instanceof HTML_QuickForm2_Rule_Required) {
throw new HTML_QuickForm2_InvalidArgumentException(
'or_(): Cannot add a "required" rule'
);
}
$this->chainedRules[] = array($next);
return ... | [
"public",
"function",
"or_",
"(",
"HTML_QuickForm2_Rule",
"$",
"next",
")",
"{",
"if",
"(",
"$",
"next",
"instanceof",
"HTML_QuickForm2_Rule_Required",
")",
"{",
"throw",
"new",
"HTML_QuickForm2_InvalidArgumentException",
"(",
"'or_(): Cannot add a \"required\" rule'",
")... | Adds a rule to the chain with an "or" operator
Evaluation is short-circuited, next rule will not be evaluated if the
previous one returns true. The method is named this way because "or" is
a reserved word in PHP.
@param HTML_QuickForm2_Rule
@return HTML_QuickForm2_Rule first rule in the chain (i.e. $this)
@th... | [
"Adds",
"a",
"rule",
"to",
"the",
"chain",
"with",
"an",
"or",
"operator"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Rule.php#L225-L234 | train | Adds a rule to the chain of rules and returns the current one | [
30522,
2270,
3853,
2030,
1035,
1006,
16129,
1035,
4248,
14192,
2475,
1035,
3627,
1002,
2279,
1007,
1063,
2065,
1006,
1002,
2279,
6013,
11253,
16129,
1035,
4248,
14192,
2475,
1035,
3627,
1035,
3223,
1007,
1063,
5466,
2047,
16129,
1035,
4248,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Config.php | Zend_Config.getSectionName | public function getSectionName()
{
if(is_array($this->_loadedSection) && count($this->_loadedSection) == 1) {
$this->_loadedSection = $this->_loadedSection[0];
}
return $this->_loadedSection;
} | php | public function getSectionName()
{
if(is_array($this->_loadedSection) && count($this->_loadedSection) == 1) {
$this->_loadedSection = $this->_loadedSection[0];
}
return $this->_loadedSection;
} | [
"public",
"function",
"getSectionName",
"(",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"this",
"->",
"_loadedSection",
")",
"&&",
"count",
"(",
"$",
"this",
"->",
"_loadedSection",
")",
"==",
"1",
")",
"{",
"$",
"this",
"->",
"_loadedSection",
"=",
"$... | Returns the section name(s) loaded.
@return mixed | [
"Returns",
"the",
"section",
"name",
"(",
"s",
")",
"loaded",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Config.php#L314-L320 | train | Get Section Name | [
30522,
2270,
3853,
4152,
18491,
18442,
1006,
1007,
1063,
2065,
1006,
2003,
1035,
9140,
1006,
1002,
2023,
1011,
1028,
1035,
8209,
29015,
1007,
1004,
1004,
4175,
1006,
1002,
2023,
1011,
1028,
1035,
8209,
29015,
1007,
1027,
1027,
1015,
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/Tracker/RequestSet.php | RequestSet.shouldPerformRedirectToUrl | public function shouldPerformRedirectToUrl()
{
if (!$this->hasRedirectUrl()) {
return false;
}
if (!$this->hasRequests()) {
return false;
}
$redirectUrl = $this->getRedirectUrl();
$host = Url::getHostFromUrl($redirectUrl);
if ... | php | public function shouldPerformRedirectToUrl()
{
if (!$this->hasRedirectUrl()) {
return false;
}
if (!$this->hasRequests()) {
return false;
}
$redirectUrl = $this->getRedirectUrl();
$host = Url::getHostFromUrl($redirectUrl);
if ... | [
"public",
"function",
"shouldPerformRedirectToUrl",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasRedirectUrl",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"!",
"$",
"this",
"->",
"hasRequests",
"(",
")",
")",
"{",
"return",
"... | TODO maybe move to response? or somewhere else? not sure where! | [
"TODO",
"maybe",
"move",
"to",
"response?",
"or",
"somewhere",
"else?",
"not",
"sure",
"where!"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Tracker/RequestSet.php#L149-L181 | train | Returns the redirect url if the request should be redirected to the same host as the redirect url if it is in the site list | [
30522,
2270,
3853,
2323,
4842,
14192,
5596,
7442,
6593,
21163,
2140,
1006,
1007,
1063,
2065,
1006,
999,
1002,
2023,
1011,
1028,
2038,
5596,
7442,
6593,
3126,
2140,
1006,
1007,
1007,
1063,
2709,
6270,
1025,
1065,
2065,
1006,
999,
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... |
matomo-org/matomo | plugins/API/RowEvolution.php | RowEvolution.getSingleRowEvolution | private function getSingleRowEvolution($idSite, $dataTable, $metadata, $apiModule, $apiAction, $label, $labelUseAbsoluteUrl = true)
{
$metricNames = array_keys($metadata['metrics']);
$logo = $actualLabel = false;
$urlFound = false;
foreach ($dataTable->getDataTables() as $subTable) ... | php | private function getSingleRowEvolution($idSite, $dataTable, $metadata, $apiModule, $apiAction, $label, $labelUseAbsoluteUrl = true)
{
$metricNames = array_keys($metadata['metrics']);
$logo = $actualLabel = false;
$urlFound = false;
foreach ($dataTable->getDataTables() as $subTable) ... | [
"private",
"function",
"getSingleRowEvolution",
"(",
"$",
"idSite",
",",
"$",
"dataTable",
",",
"$",
"metadata",
",",
"$",
"apiModule",
",",
"$",
"apiAction",
",",
"$",
"label",
",",
"$",
"labelUseAbsoluteUrl",
"=",
"true",
")",
"{",
"$",
"metricNames",
"=... | Get row evolution for a single label
@param DataTable\Map $dataTable
@param array $metadata
@param string $apiModule
@param string $apiAction
@param string $label
@param bool $labelUseAbsoluteUrl
@return array containing report data, metadata, label, logo | [
"Get",
"row",
"evolution",
"for",
"a",
"single",
"label"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/API/RowEvolution.php#L141-L192 | train | Returns the row evolution information for a single row | [
30522,
2797,
3853,
4152,
2075,
3917,
29385,
6767,
7630,
3508,
1006,
1002,
8909,
28032,
2063,
1010,
1002,
2951,
10880,
1010,
1002,
27425,
1010,
1002,
17928,
5302,
8566,
2571,
1010,
1002,
17928,
18908,
3258,
1010,
1002,
3830,
1010,
1002,
3830... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hhxsv5/laravel-s | src/Swoole/Task/Task.php | Task.deliver | public static function deliver(Task $task, $bySendMessage = false)
{
$task->bySendMessage = $bySendMessage;
$deliver = function () use ($task, $bySendMessage) {
/**
* @var \swoole_http_server $swoole
*/
$swoole = app('swoole');
if ($bySen... | php | public static function deliver(Task $task, $bySendMessage = false)
{
$task->bySendMessage = $bySendMessage;
$deliver = function () use ($task, $bySendMessage) {
/**
* @var \swoole_http_server $swoole
*/
$swoole = app('swoole');
if ($bySen... | [
"public",
"static",
"function",
"deliver",
"(",
"Task",
"$",
"task",
",",
"$",
"bySendMessage",
"=",
"false",
")",
"{",
"$",
"task",
"->",
"bySendMessage",
"=",
"$",
"bySendMessage",
";",
"$",
"deliver",
"=",
"function",
"(",
")",
"use",
"(",
"$",
"tas... | Deliver a task
@param Task $task The task object
@param bool $bySendMessage If set to true, the task will be delivered via the pipe message, and this task does not support the finish callback. Default false.
@return bool | [
"Deliver",
"a",
"task"
] | 247b86c9d5aee0f347f1b37fe89d739f806057bd | https://github.com/hhxsv5/laravel-s/blob/247b86c9d5aee0f347f1b37fe89d739f806057bd/src/Swoole/Task/Task.php#L54-L89 | train | Deliver a task | [
30522,
2270,
10763,
3853,
8116,
1006,
4708,
1002,
4708,
1010,
1002,
2011,
5054,
22117,
7971,
4270,
1027,
6270,
1007,
1063,
1002,
4708,
1011,
1028,
2011,
5054,
22117,
7971,
4270,
1027,
1002,
2011,
5054,
22117,
7971,
4270,
1025,
1002,
8116,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Pipeline/Hub.php | Hub.pipe | public function pipe($object, $pipeline = null)
{
$pipeline = $pipeline ?: 'default';
return call_user_func(
$this->pipelines[$pipeline], new Pipeline($this->container), $object
);
} | php | public function pipe($object, $pipeline = null)
{
$pipeline = $pipeline ?: 'default';
return call_user_func(
$this->pipelines[$pipeline], new Pipeline($this->container), $object
);
} | [
"public",
"function",
"pipe",
"(",
"$",
"object",
",",
"$",
"pipeline",
"=",
"null",
")",
"{",
"$",
"pipeline",
"=",
"$",
"pipeline",
"?",
":",
"'default'",
";",
"return",
"call_user_func",
"(",
"$",
"this",
"->",
"pipelines",
"[",
"$",
"pipeline",
"]"... | Send an object through one of the available pipelines.
@param mixed $object
@param string|null $pipeline
@return mixed | [
"Send",
"an",
"object",
"through",
"one",
"of",
"the",
"available",
"pipelines",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Pipeline/Hub.php#L66-L73 | train | Pipe an object to the pipeline | [
30522,
2270,
3853,
8667,
1006,
1002,
4874,
1010,
1002,
13117,
1027,
19701,
1007,
1063,
1002,
13117,
1027,
1002,
13117,
1029,
1024,
1005,
12398,
1005,
1025,
2709,
2655,
1035,
5310,
1035,
4569,
2278,
1006,
1002,
2023,
1011,
1028,
13117,
2015,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Validation/ValidationRuleParser.php | ValidationRuleParser.parseParameters | protected static function parseParameters($rule, $parameter)
{
$rule = strtolower($rule);
if (in_array($rule, ['regex', 'not_regex', 'notregex'], true)) {
return [$parameter];
}
return str_getcsv($parameter);
} | php | protected static function parseParameters($rule, $parameter)
{
$rule = strtolower($rule);
if (in_array($rule, ['regex', 'not_regex', 'notregex'], true)) {
return [$parameter];
}
return str_getcsv($parameter);
} | [
"protected",
"static",
"function",
"parseParameters",
"(",
"$",
"rule",
",",
"$",
"parameter",
")",
"{",
"$",
"rule",
"=",
"strtolower",
"(",
"$",
"rule",
")",
";",
"if",
"(",
"in_array",
"(",
"$",
"rule",
",",
"[",
"'regex'",
",",
"'not_regex'",
",",
... | Parse a parameter list.
@param string $rule
@param string $parameter
@return array | [
"Parse",
"a",
"parameter",
"list",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Validation/ValidationRuleParser.php#L249-L258 | train | Parse parameters from the rule | [
30522,
5123,
10763,
3853,
11968,
3366,
28689,
22828,
2015,
1006,
1002,
3627,
1010,
1002,
16381,
1007,
1063,
1002,
3627,
1027,
2358,
5339,
12898,
13777,
1006,
1002,
3627,
1007,
1025,
2065,
1006,
1999,
1035,
9140,
1006,
1002,
3627,
1010,
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... |
php-ai/php-ml | src/Association/Apriori.php | Apriori.getRules | public function getRules(): array
{
if (count($this->large) === 0) {
$this->large = $this->apriori();
}
if (count($this->rules) > 0) {
return $this->rules;
}
$this->rules = [];
$this->generateAllRules();
return $this->rules;
} | php | public function getRules(): array
{
if (count($this->large) === 0) {
$this->large = $this->apriori();
}
if (count($this->rules) > 0) {
return $this->rules;
}
$this->rules = [];
$this->generateAllRules();
return $this->rules;
} | [
"public",
"function",
"getRules",
"(",
")",
":",
"array",
"{",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"large",
")",
"===",
"0",
")",
"{",
"$",
"this",
"->",
"large",
"=",
"$",
"this",
"->",
"apriori",
"(",
")",
";",
"}",
"if",
"(",
"count"... | Get all association rules which are generated for every k-length frequent item set.
@return mixed[][] | [
"Get",
"all",
"association",
"rules",
"which",
"are",
"generated",
"for",
"every",
"k",
"-",
"length",
"frequent",
"item",
"set",
"."
] | f6aa1a59b0525b8fca3d2786d661ab3e70904016 | https://github.com/php-ai/php-ml/blob/f6aa1a59b0525b8fca3d2786d661ab3e70904016/src/Association/Apriori.php#L65-L80 | train | Get rules from all languages | [
30522,
2270,
3853,
2131,
6820,
4244,
1006,
1007,
1024,
9140,
1063,
2065,
1006,
4175,
1006,
1002,
2023,
1011,
1028,
2312,
1007,
1027,
1027,
1027,
1014,
1007,
1063,
1002,
2023,
1011,
1028,
2312,
1027,
1002,
2023,
1011,
1028,
19804,
25346,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/Tracker/PageUrl.php | PageUrl.getQueryParametersToExclude | public static function getQueryParametersToExclude($idSite)
{
$campaignTrackingParameters = Common::getCampaignParameters();
$campaignTrackingParameters = array_merge(
$campaignTrackingParameters[0], // campaign name parameters
$campaignTrackingParameters[1] // campaign keyw... | php | public static function getQueryParametersToExclude($idSite)
{
$campaignTrackingParameters = Common::getCampaignParameters();
$campaignTrackingParameters = array_merge(
$campaignTrackingParameters[0], // campaign name parameters
$campaignTrackingParameters[1] // campaign keyw... | [
"public",
"static",
"function",
"getQueryParametersToExclude",
"(",
"$",
"idSite",
")",
"{",
"$",
"campaignTrackingParameters",
"=",
"Common",
"::",
"getCampaignParameters",
"(",
")",
";",
"$",
"campaignTrackingParameters",
"=",
"array_merge",
"(",
"$",
"campaignTrack... | Returns the array of parameters names that must be excluded from the Query String in all tracked URLs
@static
@param $idSite
@return array | [
"Returns",
"the",
"array",
"of",
"parameters",
"names",
"that",
"must",
"be",
"excluded",
"from",
"the",
"Query",
"String",
"in",
"all",
"tracked",
"URLs"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Tracker/PageUrl.php#L73-L103 | train | Returns an array of parameters that should be excluded from the URL | [
30522,
2270,
10763,
3853,
2131,
4226,
2854,
28689,
22828,
16033,
10288,
20464,
12672,
1006,
1002,
8909,
28032,
2063,
1007,
1063,
1002,
3049,
6494,
23177,
28689,
22828,
2015,
1027,
2691,
1024,
1024,
2131,
26468,
4886,
16206,
28689,
22828,
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... |
octobercms/october | modules/cms/ServiceProvider.php | ServiceProvider.registerComponents | protected function registerComponents()
{
ComponentManager::instance()->registerComponents(function ($manager) {
$manager->registerComponent(\Cms\Components\ViewBag::class, 'viewBag');
$manager->registerComponent(\Cms\Components\Resources::class, 'resources');
});
} | php | protected function registerComponents()
{
ComponentManager::instance()->registerComponents(function ($manager) {
$manager->registerComponent(\Cms\Components\ViewBag::class, 'viewBag');
$manager->registerComponent(\Cms\Components\Resources::class, 'resources');
});
} | [
"protected",
"function",
"registerComponents",
"(",
")",
"{",
"ComponentManager",
"::",
"instance",
"(",
")",
"->",
"registerComponents",
"(",
"function",
"(",
"$",
"manager",
")",
"{",
"$",
"manager",
"->",
"registerComponent",
"(",
"\\",
"Cms",
"\\",
"Compon... | Register components. | [
"Register",
"components",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/ServiceProvider.php#L61-L67 | train | Registers the view bag and resources components | [
30522,
5123,
3853,
4236,
9006,
29513,
7666,
1006,
1007,
1063,
6922,
24805,
4590,
1024,
1024,
6013,
1006,
1007,
1011,
1028,
4236,
9006,
29513,
7666,
1006,
3853,
1006,
1002,
3208,
1007,
1063,
1002,
3208,
1011,
1028,
4236,
9006,
29513,
3372,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Session/SaveHandler/DbTable.php | DbTable.write | public function write($id, $data)
{
$sql = 'INSERT INTO ' . $this->config['name']
. ' (' . $this->config['primary'] . ','
. $this->config['modifiedColumn'] . ','
. $this->config['lifetimeColumn'] . ','
. $this->config['dataColumn'] . ')'
. ' VALUES... | php | public function write($id, $data)
{
$sql = 'INSERT INTO ' . $this->config['name']
. ' (' . $this->config['primary'] . ','
. $this->config['modifiedColumn'] . ','
. $this->config['lifetimeColumn'] . ','
. $this->config['dataColumn'] . ')'
. ' VALUES... | [
"public",
"function",
"write",
"(",
"$",
"id",
",",
"$",
"data",
")",
"{",
"$",
"sql",
"=",
"'INSERT INTO '",
".",
"$",
"this",
"->",
"config",
"[",
"'name'",
"]",
".",
"' ('",
".",
"$",
"this",
"->",
"config",
"[",
"'primary'",
"]",
".",
"','",
... | Write Session - commit data to resource
@param string $id
@param mixed $data
@return boolean | [
"Write",
"Session",
"-",
"commit",
"data",
"to",
"resource"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Session/SaveHandler/DbTable.php#L132-L148 | train | Write a record to the database | [
30522,
2270,
3853,
4339,
1006,
1002,
8909,
1010,
1002,
2951,
1007,
1063,
1002,
29296,
1027,
1005,
19274,
2046,
1005,
1012,
1002,
2023,
1011,
1028,
9530,
8873,
2290,
1031,
1005,
2171,
1005,
1033,
1012,
1005,
1006,
1005,
1012,
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/Foundation/Console/ViewCacheCommand.php | ViewCacheCommand.bladeFilesIn | protected function bladeFilesIn(array $paths)
{
return collect(
Finder::create()
->in($paths)
->exclude('vendor')
->name('*.blade.php')
->files()
);
} | php | protected function bladeFilesIn(array $paths)
{
return collect(
Finder::create()
->in($paths)
->exclude('vendor')
->name('*.blade.php')
->files()
);
} | [
"protected",
"function",
"bladeFilesIn",
"(",
"array",
"$",
"paths",
")",
"{",
"return",
"collect",
"(",
"Finder",
"::",
"create",
"(",
")",
"->",
"in",
"(",
"$",
"paths",
")",
"->",
"exclude",
"(",
"'vendor'",
")",
"->",
"name",
"(",
"'*.blade.php'",
... | Get the Blade files in the given path.
@param array $paths
@return \Illuminate\Support\Collection | [
"Get",
"the",
"Blade",
"files",
"in",
"the",
"given",
"path",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Foundation/Console/ViewCacheCommand.php#L63-L72 | train | Returns all blade files in the given paths | [
30522,
5123,
3853,
6085,
8873,
4244,
2378,
1006,
9140,
1002,
10425,
1007,
1063,
2709,
8145,
1006,
2424,
2121,
1024,
1024,
3443,
1006,
1007,
1011,
1028,
1999,
1006,
1002,
10425,
1007,
1011,
1028,
23329,
1006,
1005,
21431,
1005,
1007,
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/ViewDataTable/Manager.php | Manager.getIdsWithInheritance | public static function getIdsWithInheritance($klass)
{
$klasses = Common::getClassLineage($klass);
$result = array();
foreach ($klasses as $klass) {
try {
$result[] = $klass::getViewDataTableId();
} catch (\Exception $e) {
// in case $... | php | public static function getIdsWithInheritance($klass)
{
$klasses = Common::getClassLineage($klass);
$result = array();
foreach ($klasses as $klass) {
try {
$result[] = $klass::getViewDataTableId();
} catch (\Exception $e) {
// in case $... | [
"public",
"static",
"function",
"getIdsWithInheritance",
"(",
"$",
"klass",
")",
"{",
"$",
"klasses",
"=",
"Common",
"::",
"getClassLineage",
"(",
"$",
"klass",
")",
";",
"$",
"result",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"klasses",
"as",
... | Returns the viewDataTable IDs of a visualization's class lineage.
@see self::getVisualizationClassLineage
@param string $klass The visualization class.
@return array | [
"Returns",
"the",
"viewDataTable",
"IDs",
"of",
"a",
"visualization",
"s",
"class",
"lineage",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/ViewDataTable/Manager.php#L40-L55 | train | Returns an array of all viewDataTable IDs that have a parent class | [
30522,
2270,
10763,
3853,
2131,
9821,
24415,
2378,
5886,
25451,
3401,
1006,
1002,
1047,
27102,
1007,
1063,
1002,
1047,
27102,
2229,
1027,
2691,
1024,
1024,
2131,
26266,
4179,
4270,
1006,
1002,
1047,
27102,
1007,
1025,
1002,
2765,
1027,
9140... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
spatie/laravel-permission | src/PermissionServiceProvider.php | PermissionServiceProvider.getMigrationFileName | protected function getMigrationFileName(Filesystem $filesystem): string
{
$timestamp = date('Y_m_d_His');
return Collection::make($this->app->databasePath().DIRECTORY_SEPARATOR.'migrations'.DIRECTORY_SEPARATOR)
->flatMap(function ($path) use ($filesystem) {
return $files... | php | protected function getMigrationFileName(Filesystem $filesystem): string
{
$timestamp = date('Y_m_d_His');
return Collection::make($this->app->databasePath().DIRECTORY_SEPARATOR.'migrations'.DIRECTORY_SEPARATOR)
->flatMap(function ($path) use ($filesystem) {
return $files... | [
"protected",
"function",
"getMigrationFileName",
"(",
"Filesystem",
"$",
"filesystem",
")",
":",
"string",
"{",
"$",
"timestamp",
"=",
"date",
"(",
"'Y_m_d_His'",
")",
";",
"return",
"Collection",
"::",
"make",
"(",
"$",
"this",
"->",
"app",
"->",
"databaseP... | Returns existing migration file if found, else uses the current timestamp.
@param Filesystem $filesystem
@return string | [
"Returns",
"existing",
"migration",
"file",
"if",
"found",
"else",
"uses",
"the",
"current",
"timestamp",
"."
] | 81dbe9d372d70c255b66a2727a235076509f8d45 | https://github.com/spatie/laravel-permission/blob/81dbe9d372d70c255b66a2727a235076509f8d45/src/PermissionServiceProvider.php#L157-L166 | train | Get the migration file name. | [
30522,
5123,
3853,
2131,
4328,
29397,
8873,
20844,
4168,
1006,
6764,
27268,
6633,
1002,
6764,
27268,
6633,
1007,
1024,
5164,
1063,
1002,
2335,
15464,
2361,
1027,
3058,
1006,
1005,
1061,
1035,
1049,
1035,
1040,
1035,
2010,
1005,
1007,
1025,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Messenger/Middleware/LoggingMiddleware.php | LoggingMiddleware.handle | public function handle(Envelope $envelope, StackInterface $stack): Envelope
{
$message = $envelope->getMessage();
$context = [
'message' => $message,
'class' => \get_class($envelope->getMessage()),
];
$this->logger->debug('Starting handling message "{class}"',... | php | public function handle(Envelope $envelope, StackInterface $stack): Envelope
{
$message = $envelope->getMessage();
$context = [
'message' => $message,
'class' => \get_class($envelope->getMessage()),
];
$this->logger->debug('Starting handling message "{class}"',... | [
"public",
"function",
"handle",
"(",
"Envelope",
"$",
"envelope",
",",
"StackInterface",
"$",
"stack",
")",
":",
"Envelope",
"{",
"$",
"message",
"=",
"$",
"envelope",
"->",
"getMessage",
"(",
")",
";",
"$",
"context",
"=",
"[",
"'message'",
"=>",
"$",
... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Messenger/Middleware/LoggingMiddleware.php#L36-L57 | train | Handle the message | [
30522,
2270,
3853,
5047,
1006,
11255,
1002,
11255,
1010,
9991,
18447,
2121,
12172,
1002,
9991,
1007,
1024,
11255,
1063,
1002,
4471,
1027,
1002,
11255,
1011,
1028,
2131,
7834,
3736,
3351,
1006,
1007,
1025,
1002,
6123,
1027,
1031,
1005,
4471,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/Zend/Mail/Storage/Folder/Mbox.php | Zend_Mail_Storage_Folder_Mbox._buildFolderTree | protected function _buildFolderTree($currentDir, $parentFolder = null, $parentGlobalName = '')
{
if (!$parentFolder) {
$this->_rootFolder = new Zend_Mail_Storage_Folder('/', '/', false);
$parentFolder = $this->_rootFolder;
}
$dh = @opendir($currentDir);
if (!... | php | protected function _buildFolderTree($currentDir, $parentFolder = null, $parentGlobalName = '')
{
if (!$parentFolder) {
$this->_rootFolder = new Zend_Mail_Storage_Folder('/', '/', false);
$parentFolder = $this->_rootFolder;
}
$dh = @opendir($currentDir);
if (!... | [
"protected",
"function",
"_buildFolderTree",
"(",
"$",
"currentDir",
",",
"$",
"parentFolder",
"=",
"null",
",",
"$",
"parentGlobalName",
"=",
"''",
")",
"{",
"if",
"(",
"!",
"$",
"parentFolder",
")",
"{",
"$",
"this",
"->",
"_rootFolder",
"=",
"new",
"Z... | find all subfolders and mbox files for folder structure
Result is save in Zend_Mail_Storage_Folder instances with the root in $this->_rootFolder.
$parentFolder and $parentGlobalName are only used internally for recursion.
@param string $currentDir call with root dir, also used for recursion.
@param Zend_Mail_Storage_... | [
"find",
"all",
"subfolders",
"and",
"mbox",
"files",
"for",
"folder",
"structure"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail/Storage/Folder/Mbox.php#L121-L156 | train | Recursive method to build the tree structure of the folder tree | [
30522,
5123,
3853,
1035,
3857,
10371,
8743,
9910,
1006,
1002,
2783,
4305,
2099,
1010,
1002,
6687,
10371,
2121,
1027,
19701,
1010,
1002,
6687,
23296,
16429,
2389,
18442,
1027,
1005,
1005,
1007,
1063,
2065,
1006,
999,
1002,
6687,
10371,
2121,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Events/Dispatcher.php | Dispatcher.forgetPushed | public function forgetPushed()
{
foreach ($this->listeners as $key => $value) {
if (Str::endsWith($key, '_pushed')) {
$this->forget($key);
}
}
} | php | public function forgetPushed()
{
foreach ($this->listeners as $key => $value) {
if (Str::endsWith($key, '_pushed')) {
$this->forget($key);
}
}
} | [
"public",
"function",
"forgetPushed",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"listeners",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"Str",
"::",
"endsWith",
"(",
"$",
"key",
",",
"'_pushed'",
")",
")",
"{",
"$",
"this",
... | Forget all of the pushed listeners.
@return void | [
"Forget",
"all",
"of",
"the",
"pushed",
"listeners",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Events/Dispatcher.php#L529-L536 | train | Forget all pushed messages | [
30522,
2270,
3853,
5293,
12207,
9072,
1006,
1007,
1063,
18921,
6776,
1006,
1002,
2023,
1011,
1028,
13810,
2004,
1002,
3145,
1027,
1028,
1002,
3643,
1007,
1063,
2065,
1006,
2358,
2099,
1024,
1024,
4515,
24415,
1006,
1002,
3145,
1010,
1005,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Cache/Traits/MemcachedTrait.php | MemcachedTrait.createConnection | public static function createConnection($servers, array $options = [])
{
if (\is_string($servers)) {
$servers = [$servers];
} elseif (!\is_array($servers)) {
throw new InvalidArgumentException(sprintf('MemcachedAdapter::createClient() expects array or string as first argument... | php | public static function createConnection($servers, array $options = [])
{
if (\is_string($servers)) {
$servers = [$servers];
} elseif (!\is_array($servers)) {
throw new InvalidArgumentException(sprintf('MemcachedAdapter::createClient() expects array or string as first argument... | [
"public",
"static",
"function",
"createConnection",
"(",
"$",
"servers",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"\\",
"is_string",
"(",
"$",
"servers",
")",
")",
"{",
"$",
"servers",
"=",
"[",
"$",
"servers",
"]",
";",
"}... | Creates a Memcached instance.
By default, the binary protocol, no block, and libketama compatible options are enabled.
Examples for servers:
- 'memcached://user:pass@localhost?weight=33'
- [['localhost', 11211, 33]]
@param array[]|string|string[] $servers An array of servers, a DSN, or an array of DSNs
@param array ... | [
"Creates",
"a",
"Memcached",
"instance",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Cache/Traits/MemcachedTrait.php#L80-L222 | train | Creates a Memcached client using the memcached server and options | [
30522,
2270,
10763,
3853,
3443,
8663,
2638,
7542,
1006,
1002,
14903,
1010,
9140,
1002,
7047,
1027,
1031,
1033,
1007,
1063,
2065,
1006,
1032,
2003,
1035,
5164,
1006,
1002,
14903,
1007,
1007,
1063,
1002,
14903,
1027,
1031,
1002,
14903,
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/cms/widgets/TemplateList.php | TemplateList.render | public function render()
{
$toolbarClass = Str::contains($this->controlClass, 'hero') ? 'separator' : null;
$this->vars['toolbarClass'] = $toolbarClass;
return $this->makePartial('body', [
'data' => $this->getData()
]);
} | php | public function render()
{
$toolbarClass = Str::contains($this->controlClass, 'hero') ? 'separator' : null;
$this->vars['toolbarClass'] = $toolbarClass;
return $this->makePartial('body', [
'data' => $this->getData()
]);
} | [
"public",
"function",
"render",
"(",
")",
"{",
"$",
"toolbarClass",
"=",
"Str",
"::",
"contains",
"(",
"$",
"this",
"->",
"controlClass",
",",
"'hero'",
")",
"?",
"'separator'",
":",
"null",
";",
"$",
"this",
"->",
"vars",
"[",
"'toolbarClass'",
"]",
"... | Renders the widget.
@return string | [
"Renders",
"the",
"widget",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/widgets/TemplateList.php#L112-L121 | train | Render the body of the form | [
30522,
2270,
3853,
17552,
1006,
1007,
1063,
1002,
6994,
8237,
26266,
1027,
2358,
2099,
1024,
1024,
3397,
1006,
1002,
2023,
1011,
1028,
2491,
26266,
1010,
1005,
5394,
1005,
1007,
1029,
1005,
19802,
25879,
2953,
1005,
1024,
19701,
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/system/ServiceProvider.php | ServiceProvider.registerTwigParser | protected function registerTwigParser()
{
/*
* Register system Twig environment
*/
App::singleton('twig.environment', function ($app) {
$twig = new Twig_Environment(new TwigLoader, ['auto_reload' => true]);
$twig->addExtension(new TwigExtension);
... | php | protected function registerTwigParser()
{
/*
* Register system Twig environment
*/
App::singleton('twig.environment', function ($app) {
$twig = new Twig_Environment(new TwigLoader, ['auto_reload' => true]);
$twig->addExtension(new TwigExtension);
... | [
"protected",
"function",
"registerTwigParser",
"(",
")",
"{",
"/*\n * Register system Twig environment\n */",
"App",
"::",
"singleton",
"(",
"'twig.environment'",
",",
"function",
"(",
"$",
"app",
")",
"{",
"$",
"twig",
"=",
"new",
"Twig_Environment",
... | /*
Register text twig parser | [
"/",
"*",
"Register",
"text",
"twig",
"parser"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/ServiceProvider.php#L275-L292 | train | Register Twig parser | [
30522,
5123,
3853,
4236,
2102,
16279,
19362,
8043,
1006,
1007,
1063,
1013,
1008,
1008,
4236,
2291,
1056,
16279,
4044,
1008,
1013,
10439,
1024,
1024,
28159,
1006,
1005,
1056,
16279,
1012,
4044,
1005,
1010,
3853,
1006,
1002,
10439,
1007,
1063... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Redis/Connections/PhpRedisConnection.php | PhpRedisConnection.psubscribe | public function psubscribe($channels, Closure $callback)
{
$this->client->psubscribe((array) $channels, function ($redis, $pattern, $channel, $message) use ($callback) {
$callback($message, $channel);
});
} | php | public function psubscribe($channels, Closure $callback)
{
$this->client->psubscribe((array) $channels, function ($redis, $pattern, $channel, $message) use ($callback) {
$callback($message, $channel);
});
} | [
"public",
"function",
"psubscribe",
"(",
"$",
"channels",
",",
"Closure",
"$",
"callback",
")",
"{",
"$",
"this",
"->",
"client",
"->",
"psubscribe",
"(",
"(",
"array",
")",
"$",
"channels",
",",
"function",
"(",
"$",
"redis",
",",
"$",
"pattern",
",",... | Subscribe to a set of given channels with wildcards.
@param array|string $channels
@param \Closure $callback
@return void | [
"Subscribe",
"to",
"a",
"set",
"of",
"given",
"channels",
"with",
"wildcards",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Redis/Connections/PhpRedisConnection.php#L371-L376 | train | Subscribes to a list of channels | [
30522,
2270,
3853,
8827,
12083,
29234,
1006,
1002,
6833,
1010,
8503,
1002,
2655,
5963,
1007,
1063,
1002,
2023,
1011,
1028,
7396,
1011,
1028,
8827,
12083,
29234,
1006,
1006,
9140,
1007,
1002,
6833,
1010,
3853,
1006,
1002,
2417,
2483,
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/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php | AbstractDoctrineExtension.setMappingDriverAlias | protected function setMappingDriverAlias($mappingConfig, $mappingName)
{
if (isset($mappingConfig['alias'])) {
$this->aliasMap[$mappingConfig['alias']] = $mappingConfig['prefix'];
} else {
$this->aliasMap[$mappingName] = $mappingConfig['prefix'];
}
} | php | protected function setMappingDriverAlias($mappingConfig, $mappingName)
{
if (isset($mappingConfig['alias'])) {
$this->aliasMap[$mappingConfig['alias']] = $mappingConfig['prefix'];
} else {
$this->aliasMap[$mappingName] = $mappingConfig['prefix'];
}
} | [
"protected",
"function",
"setMappingDriverAlias",
"(",
"$",
"mappingConfig",
",",
"$",
"mappingName",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"mappingConfig",
"[",
"'alias'",
"]",
")",
")",
"{",
"$",
"this",
"->",
"aliasMap",
"[",
"$",
"mappingConfig",
"["... | Register the alias for this mapping driver.
Aliases can be used in the Query languages of all the Doctrine object managers to simplify writing tasks.
@param array $mappingConfig
@param string $mappingName | [
"Register",
"the",
"alias",
"for",
"this",
"mapping",
"driver",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php#L108-L115 | train | Set mapping driver alias | [
30522,
5123,
3853,
2275,
2863,
14853,
23663,
7941,
7951,
1006,
1002,
12375,
8663,
8873,
2290,
1010,
1002,
12375,
18442,
1007,
1063,
2065,
1006,
26354,
3388,
1006,
1002,
12375,
8663,
8873,
2290,
1031,
1005,
14593,
1005,
1033,
1007,
1007,
106... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.prepareRequest | protected function prepareRequest(array $assets, $localPath = null)
{
if (substr($localPath, -1) != '/') {
$localPath = $localPath.'/';
}
$this->localPath = $localPath;
$this->storagePath = storage_path('cms/combiner/assets');
list($assets, $extension) = $this->... | php | protected function prepareRequest(array $assets, $localPath = null)
{
if (substr($localPath, -1) != '/') {
$localPath = $localPath.'/';
}
$this->localPath = $localPath;
$this->storagePath = storage_path('cms/combiner/assets');
list($assets, $extension) = $this->... | [
"protected",
"function",
"prepareRequest",
"(",
"array",
"$",
"assets",
",",
"$",
"localPath",
"=",
"null",
")",
"{",
"if",
"(",
"substr",
"(",
"$",
"localPath",
",",
"-",
"1",
")",
"!=",
"'/'",
")",
"{",
"$",
"localPath",
"=",
"$",
"localPath",
".",... | Combines asset file references of a single type to produce
a URL reference to the combined contents.
@param array $assets List of asset files.
@param string $localPath File extension, used for aesthetic purposes only.
@return string URL to contents. | [
"Combines",
"asset",
"file",
"references",
"of",
"a",
"single",
"type",
"to",
"produce",
"a",
"URL",
"reference",
"to",
"the",
"combined",
"contents",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/CombineAssets.php#L358-L401 | train | Prepare request for asset manipulation | [
30522,
5123,
3853,
7374,
2890,
15500,
1006,
9140,
1002,
7045,
1010,
1002,
2334,
15069,
1027,
19701,
1007,
1063,
2065,
1006,
4942,
3367,
2099,
1006,
1002,
2334,
15069,
1010,
1011,
1015,
1007,
999,
1027,
1005,
1013,
1005,
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 | libs/Zend/Db/Statement/Sqlsrv.php | Zend_Db_Statement_Sqlsrv.getColumnMeta | public function getColumnMeta($column)
{
$fields = sqlsrv_field_metadata($this->_stmt);
if (!$fields) {
throw new Zend_Db_Statement_Sqlsrv_Exception('Column metadata can not be fetched');
}
if (!isset($fields[$column])) {
throw new Zend_Db_Statement_Sqlsrv_E... | php | public function getColumnMeta($column)
{
$fields = sqlsrv_field_metadata($this->_stmt);
if (!$fields) {
throw new Zend_Db_Statement_Sqlsrv_Exception('Column metadata can not be fetched');
}
if (!isset($fields[$column])) {
throw new Zend_Db_Statement_Sqlsrv_E... | [
"public",
"function",
"getColumnMeta",
"(",
"$",
"column",
")",
"{",
"$",
"fields",
"=",
"sqlsrv_field_metadata",
"(",
"$",
"this",
"->",
"_stmt",
")",
";",
"if",
"(",
"!",
"$",
"fields",
")",
"{",
"throw",
"new",
"Zend_Db_Statement_Sqlsrv_Exception",
"(",
... | Returns metadata for a column in a result set.
@param int $column
@return mixed
@throws Zend_Db_Statement_Sqlsrv_Exception | [
"Returns",
"metadata",
"for",
"a",
"column",
"in",
"a",
"result",
"set",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Statement/Sqlsrv.php#L350-L363 | train | Get column metadata | [
30522,
2270,
3853,
2131,
25778,
2819,
2078,
11368,
2050,
1006,
1002,
5930,
1007,
1063,
1002,
4249,
1027,
29296,
21338,
2615,
1035,
2492,
1035,
27425,
1006,
1002,
2023,
1011,
1028,
1035,
2358,
20492,
1007,
1025,
2065,
1006,
999,
1002,
4249,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/Zend/Db/Table/Abstract.php | Zend_Db_Table_Abstract.find | public function find()
{
$this->_setupPrimaryKey();
$args = func_get_args();
$keyNames = array_values((array) $this->_primary);
if (count($args) < count($keyNames)) {
// require_once 'Zend/Db/Table/Exception.php';
throw new Zend_Db_Table_Exception("Too few co... | php | public function find()
{
$this->_setupPrimaryKey();
$args = func_get_args();
$keyNames = array_values((array) $this->_primary);
if (count($args) < count($keyNames)) {
// require_once 'Zend/Db/Table/Exception.php';
throw new Zend_Db_Table_Exception("Too few co... | [
"public",
"function",
"find",
"(",
")",
"{",
"$",
"this",
"->",
"_setupPrimaryKey",
"(",
")",
";",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"$",
"keyNames",
"=",
"array_values",
"(",
"(",
"array",
")",
"$",
"this",
"->",
"_primary",
")",
";"... | Fetches rows by primary key. The argument specifies one or more primary
key value(s). To find multiple rows by primary key, the argument must
be an array.
This method accepts a variable number of arguments. If the table has a
multi-column primary key, the number of arguments must be the same as
the number of column... | [
"Fetches",
"rows",
"by",
"primary",
"key",
".",
"The",
"argument",
"specifies",
"one",
"or",
"more",
"primary",
"key",
"value",
"(",
"s",
")",
".",
"To",
"find",
"multiple",
"rows",
"by",
"primary",
"key",
"the",
"argument",
"must",
"be",
"an",
"array",
... | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Table/Abstract.php#L1240-L1310 | train | Find all records matching the given conditions | [
30522,
2270,
3853,
2424,
1006,
1007,
1063,
1002,
2023,
1011,
1028,
1035,
16437,
18098,
9581,
2854,
14839,
1006,
1007,
1025,
1002,
12098,
5620,
1027,
4569,
2278,
1035,
2131,
1035,
12098,
5620,
1006,
1007,
1025,
1002,
3145,
18442,
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... |
octobercms/october | modules/backend/widgets/Form.php | Form.defineFormFields | protected function defineFormFields()
{
if ($this->fieldsDefined) {
return;
}
/**
* @event backend.form.extendFieldsBefore
* Called before the form fields are defined
*
* Example usage:
*
* Event::listen('backend.form.ext... | php | protected function defineFormFields()
{
if ($this->fieldsDefined) {
return;
}
/**
* @event backend.form.extendFieldsBefore
* Called before the form fields are defined
*
* Example usage:
*
* Event::listen('backend.form.ext... | [
"protected",
"function",
"defineFormFields",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"fieldsDefined",
")",
"{",
"return",
";",
"}",
"/**\n * @event backend.form.extendFieldsBefore\n * Called before the form fields are defined\n *\n * Example usa... | Creates a flat array of form fields from the configuration.
Also slots fields in to their respective tabs.
@return void | [
"Creates",
"a",
"flat",
"array",
"of",
"form",
"fields",
"from",
"the",
"configuration",
".",
"Also",
"slots",
"fields",
"in",
"to",
"their",
"respective",
"tabs",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/Form.php#L461-L646 | train | Define form fields | [
30522,
5123,
3853,
9375,
14192,
15155,
1006,
1007,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
4249,
3207,
23460,
2094,
1007,
1063,
2709,
1025,
1065,
1013,
1008,
1008,
1008,
1030,
2724,
2067,
10497,
1012,
2433,
1012,
7949,
15155,
4783,
29278,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Process/Process.php | Process.readPipes | private function readPipes(bool $blocking, bool $close)
{
$result = $this->processPipes->readAndWrite($blocking, $close);
$callback = $this->callback;
foreach ($result as $type => $data) {
if (3 !== $type) {
$callback(self::STDOUT === $type ? self::OUT : self::ER... | php | private function readPipes(bool $blocking, bool $close)
{
$result = $this->processPipes->readAndWrite($blocking, $close);
$callback = $this->callback;
foreach ($result as $type => $data) {
if (3 !== $type) {
$callback(self::STDOUT === $type ? self::OUT : self::ER... | [
"private",
"function",
"readPipes",
"(",
"bool",
"$",
"blocking",
",",
"bool",
"$",
"close",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"processPipes",
"->",
"readAndWrite",
"(",
"$",
"blocking",
",",
"$",
"close",
")",
";",
"$",
"callback",
"=",... | Reads pipes, executes callback.
@param bool $blocking Whether to use blocking calls or not
@param bool $close Whether to close file handles or not | [
"Reads",
"pipes",
"executes",
"callback",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Process/Process.php#L1421-L1433 | train | Read pipes and write to the output stream | [
30522,
2797,
3853,
3191,
24548,
2015,
1006,
22017,
2140,
1002,
10851,
1010,
22017,
2140,
1002,
2485,
1007,
1063,
1002,
2765,
1027,
1002,
2023,
1011,
1028,
2832,
24548,
2015,
1011,
1028,
3191,
5685,
26373,
30524,
1006,
2969,
1024,
1024,
2358... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/DataTable/Renderer/Xml.php | Xml.renderArray | private function renderArray($array, $prefixLines)
{
$isAssociativeArray = Piwik::isAssociativeArray($array);
// check if array contains arrays, and if not wrap the result in an extra <row> element
// (only check if this is the root renderArray call)
// NOTE: this is for backwards c... | php | private function renderArray($array, $prefixLines)
{
$isAssociativeArray = Piwik::isAssociativeArray($array);
// check if array contains arrays, and if not wrap the result in an extra <row> element
// (only check if this is the root renderArray call)
// NOTE: this is for backwards c... | [
"private",
"function",
"renderArray",
"(",
"$",
"array",
",",
"$",
"prefixLines",
")",
"{",
"$",
"isAssociativeArray",
"=",
"Piwik",
"::",
"isAssociativeArray",
"(",
"$",
"array",
")",
";",
"// check if array contains arrays, and if not wrap the result in an extra <row> e... | Renders an array as XML.
@param array $array The array to render.
@param string $prefixLines The string to prefix each line in the output.
@return string | [
"Renders",
"an",
"array",
"as",
"XML",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable/Renderer/Xml.php#L136-L213 | train | Renders the array | [
30522,
2797,
3853,
17552,
2906,
9447,
1006,
1002,
9140,
1010,
1002,
17576,
30524,
5783,
1013,
1013,
1006,
2069,
4638,
2065,
2023,
2003,
1996,
7117,
17552,
2906,
9447,
2655,
1007,
1013,
1013,
3602,
1024,
2023,
2003,
2005,
11043,
21778,
1012,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
overtrue/wechat | src/OpenPlatform/Auth/ServiceProvider.php | ServiceProvider.register | public function register(Container $app)
{
$app['verify_ticket'] = function ($app) {
return new VerifyTicket($app);
};
$app['access_token'] = function ($app) {
return new AccessToken($app);
};
} | php | public function register(Container $app)
{
$app['verify_ticket'] = function ($app) {
return new VerifyTicket($app);
};
$app['access_token'] = function ($app) {
return new AccessToken($app);
};
} | [
"public",
"function",
"register",
"(",
"Container",
"$",
"app",
")",
"{",
"$",
"app",
"[",
"'verify_ticket'",
"]",
"=",
"function",
"(",
"$",
"app",
")",
"{",
"return",
"new",
"VerifyTicket",
"(",
"$",
"app",
")",
";",
"}",
";",
"$",
"app",
"[",
"'... | {@inheritdoc}. | [
"{"
] | 120c72faaa93c270365bc75c73c362d5fd583209 | https://github.com/overtrue/wechat/blob/120c72faaa93c270365bc75c73c362d5fd583209/src/OpenPlatform/Auth/ServiceProvider.php#L27-L36 | train | Register the verify ticket and access token | [
30522,
2270,
3853,
4236,
1006,
11661,
1002,
10439,
1007,
1063,
1002,
10439,
1031,
1005,
20410,
1035,
7281,
1005,
1033,
1027,
3853,
1006,
1002,
10439,
1007,
1063,
2709,
2047,
20410,
26348,
3388,
1006,
1002,
10439,
1007,
1025,
1065,
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... |
laravel/framework | src/Illuminate/Database/Eloquent/Relations/HasManyThrough.php | HasManyThrough.shouldSelect | protected function shouldSelect(array $columns = ['*'])
{
if ($columns == ['*']) {
$columns = [$this->related->getTable().'.*'];
}
return array_merge($columns, [$this->getQualifiedFirstKeyName().' as laravel_through_key']);
} | php | protected function shouldSelect(array $columns = ['*'])
{
if ($columns == ['*']) {
$columns = [$this->related->getTable().'.*'];
}
return array_merge($columns, [$this->getQualifiedFirstKeyName().' as laravel_through_key']);
} | [
"protected",
"function",
"shouldSelect",
"(",
"array",
"$",
"columns",
"=",
"[",
"'*'",
"]",
")",
"{",
"if",
"(",
"$",
"columns",
"==",
"[",
"'*'",
"]",
")",
"{",
"$",
"columns",
"=",
"[",
"$",
"this",
"->",
"related",
"->",
"getTable",
"(",
")",
... | Set the select clause for the relation query.
@param array $columns
@return array | [
"Set",
"the",
"select",
"clause",
"for",
"the",
"relation",
"query",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Relations/HasManyThrough.php#L411-L418 | train | Returns the columns that should be selected. | [
30522,
5123,
3853,
2323,
11246,
22471,
1006,
9140,
1002,
7753,
1027,
1031,
1005,
1008,
1005,
1033,
1007,
1063,
2065,
1006,
1002,
7753,
1027,
1027,
1031,
1005,
1008,
1005,
1033,
1007,
1063,
1002,
7753,
1027,
1031,
1002,
2023,
1011,
1028,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/Db/BatchInsert.php | BatchInsert.tableInsertBatchIterate | public static function tableInsertBatchIterate($tableName, $fields, $values, $ignoreWhenDuplicate = true)
{
$fieldList = '(' . join(',', $fields) . ')';
$ignore = $ignoreWhenDuplicate ? 'IGNORE' : '';
foreach ($values as $row) {
$query = "INSERT $ignore INTO " . $tableName . ... | php | public static function tableInsertBatchIterate($tableName, $fields, $values, $ignoreWhenDuplicate = true)
{
$fieldList = '(' . join(',', $fields) . ')';
$ignore = $ignoreWhenDuplicate ? 'IGNORE' : '';
foreach ($values as $row) {
$query = "INSERT $ignore INTO " . $tableName . ... | [
"public",
"static",
"function",
"tableInsertBatchIterate",
"(",
"$",
"tableName",
",",
"$",
"fields",
",",
"$",
"values",
",",
"$",
"ignoreWhenDuplicate",
"=",
"true",
")",
"{",
"$",
"fieldList",
"=",
"'('",
".",
"join",
"(",
"','",
",",
"$",
"fields",
"... | Performs a batch insert into a specific table by iterating through the data
NOTE: you should use tableInsertBatch() which will fallback to this function if LOAD DATA INFILE not available
@param string $tableName PREFIXED table name! you must call Common::prefixTable() before passing the table name
@param array $field... | [
"Performs",
"a",
"batch",
"insert",
"into",
"a",
"specific",
"table",
"by",
"iterating",
"through",
"the",
"data"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Db/BatchInsert.php#L31-L42 | train | Insert Batch Iterators | [
30522,
2270,
10763,
3853,
2795,
7076,
8743,
14479,
5428,
14621,
2618,
1006,
1002,
2795,
18442,
1010,
1002,
4249,
1010,
1002,
5300,
1010,
1002,
8568,
2860,
22342,
6279,
19341,
2618,
1027,
2995,
1007,
1063,
1002,
2492,
9863,
1027,
1005,
1006,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/HttpClient/HttpClientTrait.php | HttpClientTrait.prepareRequest | private static function prepareRequest(?string $method, ?string $url, array $options, array $defaultOptions = [], bool $allowExtraOptions = false): array
{
if (null !== $method) {
if (\strlen($method) !== strspn($method, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')) {
throw new InvalidArgumentE... | php | private static function prepareRequest(?string $method, ?string $url, array $options, array $defaultOptions = [], bool $allowExtraOptions = false): array
{
if (null !== $method) {
if (\strlen($method) !== strspn($method, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')) {
throw new InvalidArgumentE... | [
"private",
"static",
"function",
"prepareRequest",
"(",
"?",
"string",
"$",
"method",
",",
"?",
"string",
"$",
"url",
",",
"array",
"$",
"options",
",",
"array",
"$",
"defaultOptions",
"=",
"[",
"]",
",",
"bool",
"$",
"allowExtraOptions",
"=",
"false",
"... | Validates and normalizes method, URL and options, and merges them with defaults.
@throws InvalidArgumentException When a not-supported option is found | [
"Validates",
"and",
"normalizes",
"method",
"URL",
"and",
"options",
"and",
"merges",
"them",
"with",
"defaults",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpClient/HttpClientTrait.php#L34-L132 | train | Prepares the request. | [
30522,
2797,
10763,
3853,
7374,
2890,
15500,
1006,
1029,
5164,
1002,
4118,
1010,
1029,
5164,
1002,
24471,
2140,
1010,
9140,
1002,
7047,
1010,
9140,
1002,
12398,
7361,
9285,
1027,
1031,
1033,
1010,
22017,
2140,
1002,
3499,
10288,
6494,
7361,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.