repo stringclasses 21
values | path stringlengths 10 105 | func_name stringlengths 6 64 | original_string stringlengths 105 15.6k | language stringclasses 1
value | code stringlengths 105 15.6k | code_tokens listlengths 29 2.15k | docstring stringlengths 11 2.85k | docstring_tokens listlengths 1 290 | sha stringclasses 21
values | url stringlengths 100 194 | partition stringclasses 1
value | summary stringlengths 8 319 | input_ids listlengths 502 502 | token_type_ids listlengths 502 502 | attention_mask listlengths 502 502 | labels listlengths 502 502 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
matomo-org/matomo | libs/Zend/Db/Adapter/Mysqli.php | Zend_Db_Adapter_Mysqli.prepare | public function prepare($sql)
{
$this->_connect();
if ($this->_stmt) {
$this->_stmt->close();
}
$stmtClass = $this->_defaultStmtClass;
if (!class_exists($stmtClass)) {
// require_once 'Zend/Loader.php';
Zend_Loader::loadClass($stmtClass);
... | php | public function prepare($sql)
{
$this->_connect();
if ($this->_stmt) {
$this->_stmt->close();
}
$stmtClass = $this->_defaultStmtClass;
if (!class_exists($stmtClass)) {
// require_once 'Zend/Loader.php';
Zend_Loader::loadClass($stmtClass);
... | [
"public",
"function",
"prepare",
"(",
"$",
"sql",
")",
"{",
"$",
"this",
"->",
"_connect",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"_stmt",
")",
"{",
"$",
"this",
"->",
"_stmt",
"->",
"close",
"(",
")",
";",
"}",
"$",
"stmtClass",
"=",
"$"... | Prepare a statement and return a PDOStatement-like object.
@param string $sql SQL query
@return Zend_Db_Statement_Mysqli | [
"Prepare",
"a",
"statement",
"and",
"return",
"a",
"PDOStatement",
"-",
"like",
"object",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Adapter/Mysqli.php#L406-L424 | train | Prepare statement for execution | [
30522,
2270,
3853,
7374,
1006,
1002,
29296,
1007,
1063,
1002,
2023,
1011,
1028,
1035,
7532,
1006,
1007,
1025,
2065,
1006,
1002,
2023,
1011,
1028,
1035,
2358,
20492,
1007,
1063,
1002,
2023,
1011,
1028,
1035,
2358,
20492,
1011,
1028,
2485,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Session.php | Session.getFlashObject | public function getFlashObject($name)
{
$serialized = $this->__get($name);
$object = \is_string($serialized) ? unserialize($serialized, ['allowed_classes' => true]) : $serialized;
$this->__unset($name);
if ($name === 'files-upload') {
$grav = Grav::instance();
... | php | public function getFlashObject($name)
{
$serialized = $this->__get($name);
$object = \is_string($serialized) ? unserialize($serialized, ['allowed_classes' => true]) : $serialized;
$this->__unset($name);
if ($name === 'files-upload') {
$grav = Grav::instance();
... | [
"public",
"function",
"getFlashObject",
"(",
"$",
"name",
")",
"{",
"$",
"serialized",
"=",
"$",
"this",
"->",
"__get",
"(",
"$",
"name",
")",
";",
"$",
"object",
"=",
"\\",
"is_string",
"(",
"$",
"serialized",
")",
"?",
"unserialize",
"(",
"$",
"ser... | Return object and remove it from session.
@param string $name
@return mixed | [
"Return",
"object",
"and",
"remove",
"it",
"from",
"session",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Session.php#L101-L133 | train | Returns the object of the specified flash field | [
30522,
2270,
3853,
2131,
10258,
11823,
16429,
20614,
1006,
1002,
2171,
1007,
1063,
1002,
27289,
1027,
1002,
2023,
1011,
1028,
1035,
1035,
2131,
1006,
1002,
2171,
1007,
1025,
1002,
4874,
1027,
1032,
2003,
1035,
5164,
1006,
1002,
27289,
1007,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/Zend/Db/Adapter/Abstract.php | Zend_Db_Adapter_Abstract.quoteColumnAs | public function quoteColumnAs($ident, $alias, $auto=false)
{
return $this->_quoteIdentifierAs($ident, $alias, $auto);
} | php | public function quoteColumnAs($ident, $alias, $auto=false)
{
return $this->_quoteIdentifierAs($ident, $alias, $auto);
} | [
"public",
"function",
"quoteColumnAs",
"(",
"$",
"ident",
",",
"$",
"alias",
",",
"$",
"auto",
"=",
"false",
")",
"{",
"return",
"$",
"this",
"->",
"_quoteIdentifierAs",
"(",
"$",
"ident",
",",
"$",
"alias",
",",
"$",
"auto",
")",
";",
"}"
] | Quote a column identifier and alias.
@param string|array|Zend_Db_Expr $ident The identifier or expression.
@param string $alias An alias for the column.
@param boolean $auto If true, heed the AUTO_QUOTE_IDENTIFIERS config option.
@return string The quoted identifier and alias. | [
"Quote",
"a",
"column",
"identifier",
"and",
"alias",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Adapter/Abstract.php#L977-L980 | train | Quote identifier as with alias if it is not already quoted. | [
30522,
2270,
3853,
14686,
25778,
2819,
11649,
1006,
1002,
8909,
4765,
1010,
1002,
14593,
1010,
1002,
8285,
1027,
6270,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
1035,
14686,
5178,
16778,
8873,
24140,
1006,
1002,
8909,
4765,
1010,
1002,
1459... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Form/Extension/Core/Type/LocaleType.php | LocaleType.loadChoicesForValues | public function loadChoicesForValues(array $values, $value = null)
{
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1, use the "choice_loader" option instead.', __METHOD__), E_USER_DEPRECATED);
// Optimize
$values = array_filter($values);
if (empty($values))... | php | public function loadChoicesForValues(array $values, $value = null)
{
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1, use the "choice_loader" option instead.', __METHOD__), E_USER_DEPRECATED);
// Optimize
$values = array_filter($values);
if (empty($values))... | [
"public",
"function",
"loadChoicesForValues",
"(",
"array",
"$",
"values",
",",
"$",
"value",
"=",
"null",
")",
"{",
"@",
"trigger_error",
"(",
"sprintf",
"(",
"'The \"%s()\" method is deprecated since Symfony 4.1, use the \"choice_loader\" option instead.'",
",",
"__METHOD... | {@inheritdoc}
@deprecated since Symfony 4.1 | [
"{",
"@inheritdoc",
"}"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/Extension/Core/Type/LocaleType.php#L94-L105 | train | Loads the choices for the given values. | [
30522,
2270,
3853,
7170,
9905,
23522,
29278,
10175,
15808,
1006,
9140,
1002,
5300,
1010,
1002,
3643,
1027,
19701,
1007,
1063,
1030,
9495,
1035,
7561,
1006,
9043,
2546,
1006,
1005,
1996,
1000,
1003,
1055,
1006,
1007,
1000,
4118,
2003,
2139,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Common/Scheduler/Job.php | Job.configure | public function configure(array $config = [])
{
// Check if config has defined a tempDir
if (isset($config['tempDir']) && is_dir($config['tempDir'])) {
$this->tempDir = $config['tempDir'];
}
return $this;
} | php | public function configure(array $config = [])
{
// Check if config has defined a tempDir
if (isset($config['tempDir']) && is_dir($config['tempDir'])) {
$this->tempDir = $config['tempDir'];
}
return $this;
} | [
"public",
"function",
"configure",
"(",
"array",
"$",
"config",
"=",
"[",
"]",
")",
"{",
"// Check if config has defined a tempDir",
"if",
"(",
"isset",
"(",
"$",
"config",
"[",
"'tempDir'",
"]",
")",
"&&",
"is_dir",
"(",
"$",
"config",
"[",
"'tempDir'",
"... | Configure the job.
@param array $config
@return self | [
"Configure",
"the",
"job",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Scheduler/Job.php#L249-L257 | train | Configure the class | [
30522,
2270,
3853,
9530,
8873,
27390,
2063,
1006,
9140,
1002,
9530,
8873,
2290,
1027,
1031,
1033,
1007,
1063,
1013,
1013,
4638,
2065,
9530,
8873,
2290,
2038,
4225,
1037,
8915,
8737,
4305,
2099,
2065,
1006,
26354,
3388,
1006,
1002,
9530,
8... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/HttpFoundation/Session/Storage/Handler/PdoSessionHandler.php | PdoSessionHandler.doWrite | protected function doWrite($sessionId, $data)
{
$maxlifetime = (int) ini_get('session.gc_maxlifetime');
try {
// We use a single MERGE SQL query when supported by the database.
$mergeStmt = $this->getMergeStatement($sessionId, $data, $maxlifetime);
if (null !== $... | php | protected function doWrite($sessionId, $data)
{
$maxlifetime = (int) ini_get('session.gc_maxlifetime');
try {
// We use a single MERGE SQL query when supported by the database.
$mergeStmt = $this->getMergeStatement($sessionId, $data, $maxlifetime);
if (null !== $... | [
"protected",
"function",
"doWrite",
"(",
"$",
"sessionId",
",",
"$",
"data",
")",
"{",
"$",
"maxlifetime",
"=",
"(",
"int",
")",
"ini_get",
"(",
"'session.gc_maxlifetime'",
")",
";",
"try",
"{",
"// We use a single MERGE SQL query when supported by the database.",
"... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/PdoSessionHandler.php#L324-L365 | train | Write session data | [
30522,
5123,
3853,
23268,
17625,
1006,
1002,
5219,
3593,
1010,
1002,
2951,
1007,
1063,
1002,
4098,
15509,
7292,
1027,
1006,
20014,
1007,
1999,
2072,
1035,
2131,
1006,
1005,
5219,
1012,
1043,
2278,
1035,
4098,
15509,
7292,
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... |
matomo-org/matomo | core/Updates/2.10.0-b5.php | Updates_2_10_0_b5.getFirstDayOfArchivedDeviceDetectorData | public static function getFirstDayOfArchivedDeviceDetectorData()
{
static $deviceDetectionBlobAvailableDate;
if (empty($deviceDetectionBlobAvailableDate)) {
$archiveBlobTables = self::getAllArchiveBlobTables();
$deviceDetectionBlobAvailableDate = null;
foreach (... | php | public static function getFirstDayOfArchivedDeviceDetectorData()
{
static $deviceDetectionBlobAvailableDate;
if (empty($deviceDetectionBlobAvailableDate)) {
$archiveBlobTables = self::getAllArchiveBlobTables();
$deviceDetectionBlobAvailableDate = null;
foreach (... | [
"public",
"static",
"function",
"getFirstDayOfArchivedDeviceDetectorData",
"(",
")",
"{",
"static",
"$",
"deviceDetectionBlobAvailableDate",
";",
"if",
"(",
"empty",
"(",
"$",
"deviceDetectionBlobAvailableDate",
")",
")",
"{",
"$",
"archiveBlobTables",
"=",
"self",
":... | Find the first day on which DevicesDetection archives were generated
@return int Timestamp | [
"Find",
"the",
"first",
"day",
"on",
"which",
"DevicesDetection",
"archives",
"were",
"generated"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Updates/2.10.0-b5.php#L156-L178 | train | Returns the date of the first day of archive device detection data | [
30522,
2270,
10763,
3853,
2131,
8873,
12096,
10259,
11253,
2906,
5428,
7178,
24844,
6610,
3207,
26557,
4263,
2850,
2696,
1006,
1007,
1063,
10763,
1002,
5080,
3207,
26557,
3508,
16558,
16429,
12462,
11733,
23242,
3686,
1025,
2065,
1006,
4064,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Material/Client.php | Client.updateArticle | public function updateArticle(string $mediaId, $article, int $index = 0)
{
if ($article instanceof Article) {
$article = $article->transformForJsonRequestWithoutType();
}
$params = [
'media_id' => $mediaId,
'index' => $index,
'articles' => iss... | php | public function updateArticle(string $mediaId, $article, int $index = 0)
{
if ($article instanceof Article) {
$article = $article->transformForJsonRequestWithoutType();
}
$params = [
'media_id' => $mediaId,
'index' => $index,
'articles' => iss... | [
"public",
"function",
"updateArticle",
"(",
"string",
"$",
"mediaId",
",",
"$",
"article",
",",
"int",
"$",
"index",
"=",
"0",
")",
"{",
"if",
"(",
"$",
"article",
"instanceof",
"Article",
")",
"{",
"$",
"article",
"=",
"$",
"article",
"->",
"transform... | Update article.
@param string $mediaId
@param array|Article $article
@param int $index
@return \Psr\Http\Message\ResponseInterface|\EasyWeChat\Kernel\Support\Collection|array|object|string
@throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException | [
"Update",
"article",
"."
] | 120c72faaa93c270365bc75c73c362d5fd583209 | https://github.com/overtrue/wechat/blob/120c72faaa93c270365bc75c73c362d5fd583209/src/OfficialAccount/Material/Client.php#L136-L149 | train | Update Article of a media | [
30522,
2270,
3853,
10651,
8445,
25128,
1006,
5164,
1002,
2865,
3593,
1010,
1002,
3720,
1010,
20014,
1002,
5950,
1027,
1014,
1007,
1063,
2065,
1006,
1002,
3720,
6013,
11253,
3720,
1007,
1063,
1002,
3720,
1027,
1002,
3720,
1011,
1028,
10938,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/cms/classes/CmsException.php | CmsException.applyMask | public function applyMask(Exception $exception)
{
if ($this->code == 100 || $this->processCompoundObject($exception) === false) {
parent::applyMask($exception);
return;
}
} | php | public function applyMask(Exception $exception)
{
if ($this->code == 100 || $this->processCompoundObject($exception) === false) {
parent::applyMask($exception);
return;
}
} | [
"public",
"function",
"applyMask",
"(",
"Exception",
"$",
"exception",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"code",
"==",
"100",
"||",
"$",
"this",
"->",
"processCompoundObject",
"(",
"$",
"exception",
")",
"===",
"false",
")",
"{",
"parent",
"::",
... | Masks this exception with the details of the supplied. The error code for
this exception object will determine how the supplied exception is used.
Error 100: A general exception. Inherits \System\Classes\ExceptionBase::applyMask()
Error 200: Mask the exception as INI content.
Error 300: Mask the exception as PHP conten... | [
"Masks",
"this",
"exception",
"with",
"the",
"details",
"of",
"the",
"supplied",
".",
"The",
"error",
"code",
"for",
"this",
"exception",
"object",
"will",
"determine",
"how",
"the",
"supplied",
"exception",
"is",
"used",
".",
"Error",
"100",
":",
"A",
"ge... | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/CmsException.php#L229-L235 | train | Apply mask for exception | [
30522,
2270,
3853,
6611,
9335,
2243,
1006,
6453,
1002,
6453,
1007,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
3642,
1027,
1027,
2531,
1064,
1064,
1002,
2023,
1011,
1028,
2832,
9006,
6873,
8630,
16429,
20614,
1006,
1002,
6453,
1007,
1027,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/cms/twig/FlashNode.php | FlashNode.compile | public function compile(Twig_Compiler $compiler)
{
$attrib = $this->getAttribute('name');
$compiler
->write('$_type = isset($context["type"]) ? $context["type"] : null;')
->write('$_message = isset($context["message"]) ? $context["message"] : null;')
;
if ($... | php | public function compile(Twig_Compiler $compiler)
{
$attrib = $this->getAttribute('name');
$compiler
->write('$_type = isset($context["type"]) ? $context["type"] : null;')
->write('$_message = isset($context["message"]) ? $context["message"] : null;')
;
if ($... | [
"public",
"function",
"compile",
"(",
"Twig_Compiler",
"$",
"compiler",
")",
"{",
"$",
"attrib",
"=",
"$",
"this",
"->",
"getAttribute",
"(",
"'name'",
")",
";",
"$",
"compiler",
"->",
"write",
"(",
"'$_type = isset($context[\"type\"]) ? $context[\"type\"] : null;'"... | Compiles the node to PHP.
@param Twig_Compiler $compiler A Twig_Compiler instance | [
"Compiles",
"the",
"node",
"to",
"PHP",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/twig/FlashNode.php#L24-L70 | train | Compiles the message into the given Twig compiler | [
30522,
2270,
3853,
4012,
22090,
1006,
1056,
16279,
1035,
21624,
1002,
21624,
1007,
1063,
1002,
2012,
18886,
2497,
1027,
1002,
2023,
1011,
1028,
2131,
19321,
3089,
8569,
2618,
1006,
1005,
2171,
1005,
1007,
1025,
1002,
21624,
1011,
1028,
4339... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Command/FailedMessagesShowCommand.php | FailedMessagesShowCommand.execute | protected function execute(InputInterface $input, OutputInterface $output)
{
$io = new SymfonyStyle($input, $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output);
$receiver = $this->getReceiver();
$this->printPendingMessagesMessage($receiver, $io);
if (!$... | php | protected function execute(InputInterface $input, OutputInterface $output)
{
$io = new SymfonyStyle($input, $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output);
$receiver = $this->getReceiver();
$this->printPendingMessagesMessage($receiver, $io);
if (!$... | [
"protected",
"function",
"execute",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"io",
"=",
"new",
"SymfonyStyle",
"(",
"$",
"input",
",",
"$",
"output",
"instanceof",
"ConsoleOutputInterface",
"?",
"$",
"output",
... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Messenger/Command/FailedMessagesShowCommand.php#L60-L76 | train | Execute the list message command | [
30522,
5123,
3853,
15389,
1006,
7953,
18447,
2121,
12172,
1002,
7953,
1010,
6434,
18447,
2121,
12172,
1002,
6434,
1007,
1063,
1002,
22834,
1027,
2047,
25353,
2213,
14876,
4890,
21756,
2571,
1006,
1002,
7953,
1010,
1002,
6434,
6013,
11253,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Config/Definition/Builder/NormalizationBuilder.php | NormalizationBuilder.remap | public function remap($key, $plural = null)
{
$this->remappings[] = [$key, null === $plural ? $key.'s' : $plural];
return $this;
} | php | public function remap($key, $plural = null)
{
$this->remappings[] = [$key, null === $plural ? $key.'s' : $plural];
return $this;
} | [
"public",
"function",
"remap",
"(",
"$",
"key",
",",
"$",
"plural",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"remappings",
"[",
"]",
"=",
"[",
"$",
"key",
",",
"null",
"===",
"$",
"plural",
"?",
"$",
"key",
".",
"'s'",
":",
"$",
"plural",
"]",... | Registers a key to remap to its plural form.
@param string $key The key to remap
@param string $plural The plural of the key in case of irregular plural
@return $this | [
"Registers",
"a",
"key",
"to",
"remap",
"to",
"its",
"plural",
"form",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Config/Definition/Builder/NormalizationBuilder.php#L38-L43 | train | Remaps a key = > plural name pair pair | [
30522,
2270,
3853,
2128,
2863,
2361,
1006,
1002,
3145,
1010,
1002,
13994,
1027,
19701,
1007,
1063,
1002,
30524,
1025,
2709,
1002,
2023,
1025,
1065,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Notifications/Channels/MailChannel.php | MailChannel.addAttachments | protected function addAttachments($mailMessage, $message)
{
foreach ($message->attachments as $attachment) {
$mailMessage->attach($attachment['file'], $attachment['options']);
}
foreach ($message->rawAttachments as $attachment) {
$mailMessage->attachData($attachment[... | php | protected function addAttachments($mailMessage, $message)
{
foreach ($message->attachments as $attachment) {
$mailMessage->attach($attachment['file'], $attachment['options']);
}
foreach ($message->rawAttachments as $attachment) {
$mailMessage->attachData($attachment[... | [
"protected",
"function",
"addAttachments",
"(",
"$",
"mailMessage",
",",
"$",
"message",
")",
"{",
"foreach",
"(",
"$",
"message",
"->",
"attachments",
"as",
"$",
"attachment",
")",
"{",
"$",
"mailMessage",
"->",
"attach",
"(",
"$",
"attachment",
"[",
"'fi... | Add the attachments to the message.
@param \Illuminate\Mail\Message $mailMessage
@param \Illuminate\Notifications\Messages\MailMessage $message
@return void | [
"Add",
"the",
"attachments",
"to",
"the",
"message",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Notifications/Channels/MailChannel.php#L218-L227 | train | Adds attachments to the message | [
30522,
5123,
3853,
5587,
19321,
6776,
8163,
1006,
1002,
5653,
7834,
3736,
3351,
1010,
1002,
4471,
1007,
1063,
18921,
6776,
1006,
1002,
4471,
1011,
1028,
14449,
2015,
2004,
1002,
14449,
1007,
1063,
1002,
5653,
7834,
3736,
3351,
1011,
1028,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/ViewDataTable/Config.php | Config.addRelatedReports | public function addRelatedReports($relatedReports)
{
foreach ($relatedReports as $report => $title) {
$this->addRelatedReport($report, $title);
}
} | php | public function addRelatedReports($relatedReports)
{
foreach ($relatedReports as $report => $title) {
$this->addRelatedReport($report, $title);
}
} | [
"public",
"function",
"addRelatedReports",
"(",
"$",
"relatedReports",
")",
"{",
"foreach",
"(",
"$",
"relatedReports",
"as",
"$",
"report",
"=>",
"$",
"title",
")",
"{",
"$",
"this",
"->",
"addRelatedReport",
"(",
"$",
"report",
",",
"$",
"title",
")",
... | Adds several related reports to the {@link $related_reports} property. If
any of the reports references the report that is currently being displayed, it will not
be added to the list. All other reports will still be added though.
If you need to make sure the related report URL has some extra query parameters,
use {@li... | [
"Adds",
"several",
"related",
"reports",
"to",
"the",
"{",
"@link",
"$related_reports",
"}",
"property",
".",
"If",
"any",
"of",
"the",
"reports",
"references",
"the",
"report",
"that",
"is",
"currently",
"being",
"displayed",
"it",
"will",
"not",
"be",
"add... | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/ViewDataTable/Config.php#L768-L773 | train | Adds related reports to the page | [
30522,
2270,
3853,
5587,
16570,
4383,
2890,
25378,
1006,
1002,
3141,
2890,
25378,
1007,
1063,
18921,
6776,
1006,
1002,
3141,
2890,
25378,
2004,
1002,
3189,
1027,
1028,
1002,
2516,
1007,
1063,
1002,
2023,
1011,
1028,
5587,
16570,
4383,
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... |
spatie/laravel-permission | src/Traits/HasPermissions.php | HasPermissions.hasAnyPermission | public function hasAnyPermission(...$permissions): bool
{
if (is_array($permissions[0])) {
$permissions = $permissions[0];
}
foreach ($permissions as $permission) {
if ($this->checkPermissionTo($permission)) {
return true;
}
}
... | php | public function hasAnyPermission(...$permissions): bool
{
if (is_array($permissions[0])) {
$permissions = $permissions[0];
}
foreach ($permissions as $permission) {
if ($this->checkPermissionTo($permission)) {
return true;
}
}
... | [
"public",
"function",
"hasAnyPermission",
"(",
"...",
"$",
"permissions",
")",
":",
"bool",
"{",
"if",
"(",
"is_array",
"(",
"$",
"permissions",
"[",
"0",
"]",
")",
")",
"{",
"$",
"permissions",
"=",
"$",
"permissions",
"[",
"0",
"]",
";",
"}",
"fore... | Determine if the model has any of the given permissions.
@param array ...$permissions
@return bool
@throws \Exception | [
"Determine",
"if",
"the",
"model",
"has",
"any",
"of",
"the",
"given",
"permissions",
"."
] | 81dbe9d372d70c255b66a2727a235076509f8d45 | https://github.com/spatie/laravel-permission/blob/81dbe9d372d70c255b66a2727a235076509f8d45/src/Traits/HasPermissions.php#L178-L191 | train | Has any permission | [
30522,
2270,
3853,
17000,
18863,
28550,
28231,
1006,
1012,
1012,
1012,
1002,
6656,
2015,
1007,
1024,
22017,
2140,
1063,
2065,
1006,
2003,
1035,
9140,
1006,
1002,
6656,
2015,
1031,
1014,
1033,
1007,
1007,
1063,
1002,
6656,
2015,
1027,
1002,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/backend/widgets/Filter.php | Filter.prepareVars | public function prepareVars()
{
$this->defineFilterScopes();
$this->vars['cssClasses'] = implode(' ', $this->cssClasses);
$this->vars['scopes'] = $this->allScopes;
} | php | public function prepareVars()
{
$this->defineFilterScopes();
$this->vars['cssClasses'] = implode(' ', $this->cssClasses);
$this->vars['scopes'] = $this->allScopes;
} | [
"public",
"function",
"prepareVars",
"(",
")",
"{",
"$",
"this",
"->",
"defineFilterScopes",
"(",
")",
";",
"$",
"this",
"->",
"vars",
"[",
"'cssClasses'",
"]",
"=",
"implode",
"(",
"' '",
",",
"$",
"this",
"->",
"cssClasses",
")",
";",
"$",
"this",
... | Prepares the view data | [
"Prepares",
"the",
"view",
"data"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/Filter.php#L89-L94 | train | Prepares the vars array for the current page | [
30522,
2270,
3853,
7374,
10755,
2015,
1006,
1007,
1063,
1002,
2023,
1011,
1028,
9375,
8873,
21928,
26127,
2015,
1006,
1007,
1025,
1002,
2023,
1011,
1028,
13075,
2015,
1031,
1005,
20116,
11020,
27102,
2229,
1005,
1033,
1027,
17727,
4135,
320... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Proxy/ResolvedTypeDataCollectorProxy.php | ResolvedTypeDataCollectorProxy.buildView | public function buildView(FormView $view, FormInterface $form, array $options)
{
$this->proxiedType->buildView($view, $form, $options);
} | php | public function buildView(FormView $view, FormInterface $form, array $options)
{
$this->proxiedType->buildView($view, $form, $options);
} | [
"public",
"function",
"buildView",
"(",
"FormView",
"$",
"view",
",",
"FormInterface",
"$",
"form",
",",
"array",
"$",
"options",
")",
"{",
"$",
"this",
"->",
"proxiedType",
"->",
"buildView",
"(",
"$",
"view",
",",
"$",
"form",
",",
"$",
"options",
")... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/Extension/DataCollector/Proxy/ResolvedTypeDataCollectorProxy.php#L101-L104 | train | Build the view of the proxy type | [
30522,
2270,
3853,
3857,
8584,
1006,
2433,
8584,
1002,
3193,
1010,
2433,
18447,
2121,
12172,
1002,
2433,
1010,
9140,
1002,
7047,
1007,
1063,
1002,
2023,
1011,
1028,
4013,
16898,
11927,
18863,
1011,
1028,
3857,
8584,
1006,
1002,
3193,
1010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/CoreVisualizations/Visualizations/Graph.php | Graph.determineWhichRowsAreSelectable | public function determineWhichRowsAreSelectable()
{
if ($this->config->row_picker_match_rows_by === false) {
return;
}
// collect all selectable rows
$self = $this;
$this->dataTable->filter(function ($dataTable) use ($self) {
/** @var DataTable $data... | php | public function determineWhichRowsAreSelectable()
{
if ($this->config->row_picker_match_rows_by === false) {
return;
}
// collect all selectable rows
$self = $this;
$this->dataTable->filter(function ($dataTable) use ($self) {
/** @var DataTable $data... | [
"public",
"function",
"determineWhichRowsAreSelectable",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"config",
"->",
"row_picker_match_rows_by",
"===",
"false",
")",
"{",
"return",
";",
"}",
"// collect all selectable rows",
"$",
"self",
"=",
"$",
"this",
";",
... | Determines what rows are selectable and stores them in the selectable_rows property in
a format the SeriesPicker JavaScript class can use. | [
"Determines",
"what",
"rows",
"are",
"selectable",
"and",
"stores",
"them",
"in",
"the",
"selectable_rows",
"property",
"in",
"a",
"format",
"the",
"SeriesPicker",
"JavaScript",
"class",
"can",
"use",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/CoreVisualizations/Visualizations/Graph.php#L71-L100 | train | Determines which rows are selectable | [
30522,
2270,
3853,
5646,
2860,
16066,
8093,
15568,
17933,
12260,
23576,
1006,
1007,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
9530,
8873,
2290,
1011,
1028,
5216,
1035,
4060,
2121,
1035,
2674,
1035,
10281,
1035,
2011,
1027,
1027,
1027,
6270,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Mail/Mailable.php | Mailable.buildMarkdownText | protected function buildMarkdownText($markdown, $data)
{
return $this->textView
?? $markdown->renderText($this->markdown, $data);
} | php | protected function buildMarkdownText($markdown, $data)
{
return $this->textView
?? $markdown->renderText($this->markdown, $data);
} | [
"protected",
"function",
"buildMarkdownText",
"(",
"$",
"markdown",
",",
"$",
"data",
")",
"{",
"return",
"$",
"this",
"->",
"textView",
"??",
"$",
"markdown",
"->",
"renderText",
"(",
"$",
"this",
"->",
"markdown",
",",
"$",
"data",
")",
";",
"}"
] | Build the text view for a Markdown message.
@param \Illuminate\Mail\Markdown $markdown
@param array $data
@return string | [
"Build",
"the",
"text",
"view",
"for",
"a",
"Markdown",
"message",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Mail/Mailable.php#L303-L307 | train | Build Markdown Text | [
30522,
5123,
3853,
3857,
10665,
7698,
18209,
1006,
1002,
2928,
7698,
1010,
1002,
2951,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
3793,
8584,
1029,
1029,
1002,
2928,
7698,
1011,
1028,
17552,
18209,
1006,
1002,
2023,
1011,
1028,
2928,
7698,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Debug/ErrorHandler.php | ErrorHandler.traceAt | public function traceAt($levels, $replace = false)
{
$prev = $this->tracedErrors;
$this->tracedErrors = (int) $levels;
if (!$replace) {
$this->tracedErrors |= $prev;
}
return $prev;
} | php | public function traceAt($levels, $replace = false)
{
$prev = $this->tracedErrors;
$this->tracedErrors = (int) $levels;
if (!$replace) {
$this->tracedErrors |= $prev;
}
return $prev;
} | [
"public",
"function",
"traceAt",
"(",
"$",
"levels",
",",
"$",
"replace",
"=",
"false",
")",
"{",
"$",
"prev",
"=",
"$",
"this",
"->",
"tracedErrors",
";",
"$",
"this",
"->",
"tracedErrors",
"=",
"(",
"int",
")",
"$",
"levels",
";",
"if",
"(",
"!",... | Sets the PHP error levels for which the stack trace is preserved.
@param int $levels A bit field of E_* constants for traced errors
@param bool $replace Replace or amend the previous value
@return int The previous value | [
"Sets",
"the",
"PHP",
"error",
"levels",
"for",
"which",
"the",
"stack",
"trace",
"is",
"preserved",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Debug/ErrorHandler.php#L319-L328 | train | Trace at a level | [
30522,
2270,
3853,
7637,
4017,
1006,
1002,
3798,
1010,
1002,
5672,
1027,
6270,
1007,
1063,
1002,
3653,
2615,
1027,
1002,
2023,
1011,
1028,
9551,
2121,
29165,
2015,
1025,
1002,
2023,
1011,
1028,
9551,
2121,
29165,
2015,
1027,
1006,
20014,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/cms/classes/CmsCompoundObject.php | CmsCompoundObject.hasComponent | public function hasComponent($componentName)
{
$componentManager = ComponentManager::instance();
$componentName = $componentManager->resolve($componentName);
foreach ($this->settings['components'] as $sectionName => $values) {
$result = $sectionName;
if ($sectionNa... | php | public function hasComponent($componentName)
{
$componentManager = ComponentManager::instance();
$componentName = $componentManager->resolve($componentName);
foreach ($this->settings['components'] as $sectionName => $values) {
$result = $sectionName;
if ($sectionNa... | [
"public",
"function",
"hasComponent",
"(",
"$",
"componentName",
")",
"{",
"$",
"componentManager",
"=",
"ComponentManager",
"::",
"instance",
"(",
")",
";",
"$",
"componentName",
"=",
"$",
"componentManager",
"->",
"resolve",
"(",
"$",
"componentName",
")",
"... | Checks if the object has a component with the specified name.
@param string $componentName Specifies the component name.
@return mixed Return false or the full component name used on the page (it could include the alias). | [
"Checks",
"if",
"the",
"object",
"has",
"a",
"component",
"with",
"the",
"specified",
"name",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/CmsCompoundObject.php#L234-L264 | train | Has Component? | [
30522,
2270,
3853,
2038,
9006,
29513,
3372,
1006,
1002,
6922,
18442,
1007,
1063,
1002,
6922,
24805,
4590,
1027,
6922,
24805,
4590,
1024,
1024,
6013,
1006,
1007,
1025,
1002,
6922,
18442,
1027,
1002,
6922,
24805,
4590,
1011,
1028,
10663,
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/Cache/Traits/PhpArrayTrait.php | PhpArrayTrait.initialize | private function initialize()
{
if (!file_exists($this->file)) {
$this->keys = $this->values = [];
return;
}
$values = (include $this->file) ?: [[], []];
if (2 !== \count($values) || !isset($values[0], $values[1])) {
$this->keys = $this->values =... | php | private function initialize()
{
if (!file_exists($this->file)) {
$this->keys = $this->values = [];
return;
}
$values = (include $this->file) ?: [[], []];
if (2 !== \count($values) || !isset($values[0], $values[1])) {
$this->keys = $this->values =... | [
"private",
"function",
"initialize",
"(",
")",
"{",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"this",
"->",
"file",
")",
")",
"{",
"$",
"this",
"->",
"keys",
"=",
"$",
"this",
"->",
"values",
"=",
"[",
"]",
";",
"return",
";",
"}",
"$",
"values",
... | Load the cache file. | [
"Load",
"the",
"cache",
"file",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Cache/Traits/PhpArrayTrait.php#L137-L151 | train | Initialize the array of keys and values from the file | [
30522,
2797,
3853,
3988,
4697,
1006,
1007,
1063,
2065,
1006,
999,
5371,
1035,
6526,
1006,
1002,
2023,
1011,
1028,
5371,
1007,
1007,
1063,
1002,
2023,
1011,
1028,
6309,
1027,
1002,
2023,
1011,
1028,
5300,
1027,
1031,
1033,
1025,
2709,
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/Routing/Loader/AnnotationFileLoader.php | AnnotationFileLoader.load | public function load($file, $type = null)
{
$path = $this->locator->locate($file);
$collection = new RouteCollection();
if ($class = $this->findClass($path)) {
$refl = new \ReflectionClass($class);
if ($refl->isAbstract()) {
return;
}
... | php | public function load($file, $type = null)
{
$path = $this->locator->locate($file);
$collection = new RouteCollection();
if ($class = $this->findClass($path)) {
$refl = new \ReflectionClass($class);
if ($refl->isAbstract()) {
return;
}
... | [
"public",
"function",
"load",
"(",
"$",
"file",
",",
"$",
"type",
"=",
"null",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"locator",
"->",
"locate",
"(",
"$",
"file",
")",
";",
"$",
"collection",
"=",
"new",
"RouteCollection",
"(",
")",
";",
... | Loads from annotations from a file.
@param string $file A PHP file path
@param string|null $type The resource type
@return RouteCollection A RouteCollection instance
@throws \InvalidArgumentException When the file does not exist or its routes cannot be parsed | [
"Loads",
"from",
"annotations",
"from",
"a",
"file",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Routing/Loader/AnnotationFileLoader.php#L53-L71 | train | Load a class or interface | [
30522,
2270,
3853,
7170,
1006,
1002,
5371,
1010,
1002,
2828,
1027,
19701,
1007,
1063,
1002,
4130,
1027,
1002,
2023,
1011,
1028,
8840,
11266,
2953,
1011,
1028,
12453,
1006,
1002,
5371,
1007,
1025,
1002,
3074,
1027,
2047,
2799,
26895,
18491,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/backend/widgets/MediaManager.php | MediaManager.onSetSorting | public function onSetSorting()
{
$sortBy = Input::get('sortBy', $this->getSortBy());
$sortDirection = Input::get('sortDirection', $this->getSortDirection());
$path = Input::get('path');
$this->setSortBy($sortBy);
$this->setSortDirection($sortDirection);
$this->setCur... | php | public function onSetSorting()
{
$sortBy = Input::get('sortBy', $this->getSortBy());
$sortDirection = Input::get('sortDirection', $this->getSortDirection());
$path = Input::get('path');
$this->setSortBy($sortBy);
$this->setSortDirection($sortDirection);
$this->setCur... | [
"public",
"function",
"onSetSorting",
"(",
")",
"{",
"$",
"sortBy",
"=",
"Input",
"::",
"get",
"(",
"'sortBy'",
",",
"$",
"this",
"->",
"getSortBy",
"(",
")",
")",
";",
"$",
"sortDirection",
"=",
"Input",
"::",
"get",
"(",
"'sortDirection'",
",",
"$",
... | Set sorting preference AJAX handler
@return array | [
"Set",
"sorting",
"preference",
"AJAX",
"handler"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/MediaManager.php#L261-L277 | train | onSetSorting callback - will be called for sorting - will be called on the page - view | [
30522,
2270,
3853,
14447,
21748,
3436,
1006,
1007,
1063,
1002,
4066,
3762,
1027,
7953,
1024,
1024,
2131,
1006,
1005,
4066,
3762,
1005,
1010,
1002,
2023,
1011,
1028,
4152,
11589,
3762,
1006,
1007,
1007,
30524,
1005,
4066,
4305,
2890,
7542,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/BasicService/Media/Client.php | Client.uploadVideoForBroadcasting | public function uploadVideoForBroadcasting(string $path, string $title, string $description)
{
$response = $this->uploadVideo($path);
$arrayResponse = $this->detectAndCastResponseToType($response, 'array');
if (!empty($arrayResponse['media_id'])) {
return $this->createVideoForBr... | php | public function uploadVideoForBroadcasting(string $path, string $title, string $description)
{
$response = $this->uploadVideo($path);
$arrayResponse = $this->detectAndCastResponseToType($response, 'array');
if (!empty($arrayResponse['media_id'])) {
return $this->createVideoForBr... | [
"public",
"function",
"uploadVideoForBroadcasting",
"(",
"string",
"$",
"path",
",",
"string",
"$",
"title",
",",
"string",
"$",
"description",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"uploadVideo",
"(",
"$",
"path",
")",
";",
"$",
"arrayRespons... | @param string $path
@param string $title
@param string $description
@return array|\EasyWeChat\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string
@throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException
@throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException | [
"@param",
"string",
"$path",
"@param",
"string",
"$title",
"@param",
"string",
"$description"
] | 120c72faaa93c270365bc75c73c362d5fd583209 | https://github.com/overtrue/wechat/blob/120c72faaa93c270365bc75c73c362d5fd583209/src/BasicService/Media/Client.php#L123-L133 | train | Upload video for Broadcasting | [
30522,
2270,
3853,
2039,
11066,
17258,
8780,
29278,
12618,
4215,
10526,
2075,
1006,
5164,
1002,
4130,
1010,
5164,
1002,
2516,
1010,
5164,
1002,
6412,
1007,
1063,
1002,
3433,
1027,
1002,
2023,
1011,
1028,
2039,
11066,
17258,
8780,
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... |
symfony/symfony | src/Symfony/Component/Intl/DateFormatter/DateFormat/Hour2401Transformer.php | Hour2401Transformer.format | public function format(\DateTime $dateTime, int $length): string
{
$hourOfDay = $dateTime->format('G');
$hourOfDay = ('0' == $hourOfDay) ? '24' : $hourOfDay;
return $this->padLeft($hourOfDay, $length);
} | php | public function format(\DateTime $dateTime, int $length): string
{
$hourOfDay = $dateTime->format('G');
$hourOfDay = ('0' == $hourOfDay) ? '24' : $hourOfDay;
return $this->padLeft($hourOfDay, $length);
} | [
"public",
"function",
"format",
"(",
"\\",
"DateTime",
"$",
"dateTime",
",",
"int",
"$",
"length",
")",
":",
"string",
"{",
"$",
"hourOfDay",
"=",
"$",
"dateTime",
"->",
"format",
"(",
"'G'",
")",
";",
"$",
"hourOfDay",
"=",
"(",
"'0'",
"==",
"$",
... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Intl/DateFormatter/DateFormat/Hour2401Transformer.php#L26-L32 | train | Returns the string representation of a \ DateTime object | [
30522,
2270,
3853,
4289,
1006,
1032,
3058,
7292,
1002,
3058,
7292,
1010,
20014,
1002,
3091,
1007,
1024,
5164,
1063,
1002,
3178,
11253,
10259,
1027,
1002,
3058,
7292,
1011,
1028,
4289,
1006,
1005,
1043,
1005,
1007,
1025,
1002,
3178,
11253,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/HTML/QuickForm2/Renderer/Array.php | HTML_QuickForm2_Renderer_Array.renderElement | public function renderElement(HTML_QuickForm2_Node $element)
{
$ary = $this->buildCommonFields($element) + array(
'value' => $element->getValue(),
'type' => $element->getType(),
'required' => $element->isRequired(),
);
$this->pushScalar($ary);
} | php | public function renderElement(HTML_QuickForm2_Node $element)
{
$ary = $this->buildCommonFields($element) + array(
'value' => $element->getValue(),
'type' => $element->getType(),
'required' => $element->isRequired(),
);
$this->pushScalar($ary);
} | [
"public",
"function",
"renderElement",
"(",
"HTML_QuickForm2_Node",
"$",
"element",
")",
"{",
"$",
"ary",
"=",
"$",
"this",
"->",
"buildCommonFields",
"(",
"$",
"element",
")",
"+",
"array",
"(",
"'value'",
"=>",
"$",
"element",
"->",
"getValue",
"(",
")",... | #@+
Implementations of abstract methods from {@link HTML_QuickForm2_Renderer} | [
"#"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Renderer/Array.php#L303-L311 | train | Render an element | [
30522,
2270,
3853,
17552,
12260,
3672,
1006,
16129,
1035,
4248,
14192,
2475,
1035,
13045,
1002,
5783,
1007,
1063,
1002,
12098,
2100,
1027,
1002,
2023,
1011,
1028,
3857,
9006,
8202,
15155,
1006,
1002,
5783,
1007,
1009,
9140,
1006,
1005,
3643... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/system/controllers/Updates.php | Updates.onAttachProject | public function onAttachProject()
{
try {
if (!$projectId = trim(post('project_id'))) {
throw new ApplicationException(Lang::get('system::lang.project.id.missing'));
}
$manager = UpdateManager::instance();
$result = $manager->requestProjectDet... | php | public function onAttachProject()
{
try {
if (!$projectId = trim(post('project_id'))) {
throw new ApplicationException(Lang::get('system::lang.project.id.missing'));
}
$manager = UpdateManager::instance();
$result = $manager->requestProjectDet... | [
"public",
"function",
"onAttachProject",
"(",
")",
"{",
"try",
"{",
"if",
"(",
"!",
"$",
"projectId",
"=",
"trim",
"(",
"post",
"(",
"'project_id'",
")",
")",
")",
"{",
"throw",
"new",
"ApplicationException",
"(",
"Lang",
"::",
"get",
"(",
"'system::lang... | Validate the project ID and execute the project installation | [
"Validate",
"the",
"project",
"ID",
"and",
"execute",
"the",
"project",
"installation"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/controllers/Updates.php#L656-L678 | train | onAttachProject Callback | [
30522,
2270,
3853,
2006,
19321,
6776,
21572,
20614,
1006,
1007,
1063,
3046,
1063,
2065,
1006,
999,
1002,
2622,
3593,
1027,
12241,
1006,
2695,
1006,
1005,
2622,
1035,
8909,
1005,
1007,
1007,
1007,
1063,
5466,
2047,
4646,
10288,
24422,
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/Bundle/FrameworkBundle/Controller/ControllerTrait.php | ControllerTrait.createAccessDeniedException | protected function createAccessDeniedException(string $message = 'Access Denied.', \Exception $previous = null): AccessDeniedException
{
if (!class_exists(AccessDeniedException::class)) {
throw new \LogicException('You can not use the "createAccessDeniedException" method if the Security componen... | php | protected function createAccessDeniedException(string $message = 'Access Denied.', \Exception $previous = null): AccessDeniedException
{
if (!class_exists(AccessDeniedException::class)) {
throw new \LogicException('You can not use the "createAccessDeniedException" method if the Security componen... | [
"protected",
"function",
"createAccessDeniedException",
"(",
"string",
"$",
"message",
"=",
"'Access Denied.'",
",",
"\\",
"Exception",
"$",
"previous",
"=",
"null",
")",
":",
"AccessDeniedException",
"{",
"if",
"(",
"!",
"class_exists",
"(",
"AccessDeniedException"... | Returns an AccessDeniedException.
This will result in a 403 response code. Usage example:
throw $this->createAccessDeniedException('Unable to access this page!');
@throws \LogicException If the Security component is not available
@final | [
"Returns",
"an",
"AccessDeniedException",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php#L306-L313 | train | Creates a AccessDeniedException | [
30522,
5123,
3853,
3443,
6305,
9623,
27903,
6340,
10288,
24422,
1006,
5164,
1002,
4471,
1027,
1005,
3229,
6380,
1012,
1005,
1010,
1032,
6453,
1002,
3025,
1027,
19701,
1007,
1024,
3229,
4181,
6340,
10288,
24422,
1063,
2065,
1006,
999,
2465,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
overtrue/wechat | src/Kernel/Support/File.php | File.getStreamExt | public static function getStreamExt($stream)
{
try {
if (is_readable($stream)) {
$stream = file_get_contents($stream);
}
} catch (\Exception $e) {
}
$fileInfo = new finfo(FILEINFO_MIME);
$mime = strstr($fileInfo->buffer($stream), ';',... | php | public static function getStreamExt($stream)
{
try {
if (is_readable($stream)) {
$stream = file_get_contents($stream);
}
} catch (\Exception $e) {
}
$fileInfo = new finfo(FILEINFO_MIME);
$mime = strstr($fileInfo->buffer($stream), ';',... | [
"public",
"static",
"function",
"getStreamExt",
"(",
"$",
"stream",
")",
"{",
"try",
"{",
"if",
"(",
"is_readable",
"(",
"$",
"stream",
")",
")",
"{",
"$",
"stream",
"=",
"file_get_contents",
"(",
"$",
"stream",
")",
";",
"}",
"}",
"catch",
"(",
"\\"... | Return steam extension.
@param string $stream
@return string|false | [
"Return",
"steam",
"extension",
"."
] | 120c72faaa93c270365bc75c73c362d5fd583209 | https://github.com/overtrue/wechat/blob/120c72faaa93c270365bc75c73c362d5fd583209/src/Kernel/Support/File.php#L98-L112 | train | Get the extension of a stream | [
30522,
2270,
10763,
3853,
4152,
25379,
10288,
2102,
1006,
1002,
5460,
1007,
1063,
3046,
1063,
2065,
1006,
2003,
1035,
3191,
3085,
1006,
1002,
5460,
1007,
1007,
1063,
1002,
5460,
1027,
5371,
1035,
2131,
1035,
8417,
1006,
1002,
5460,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Common/Page/Medium/Medium.php | Medium.setTimestamp | public function setTimestamp($timestamp = null)
{
$this->timestamp = (string)($timestamp ?? $this->modified());
return $this;
} | php | public function setTimestamp($timestamp = null)
{
$this->timestamp = (string)($timestamp ?? $this->modified());
return $this;
} | [
"public",
"function",
"setTimestamp",
"(",
"$",
"timestamp",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"timestamp",
"=",
"(",
"string",
")",
"(",
"$",
"timestamp",
"??",
"$",
"this",
"->",
"modified",
"(",
")",
")",
";",
"return",
"$",
"this",
";",
... | Set querystring to file modification timestamp (or value provided as a parameter).
@param string|int|null $timestamp
@return $this | [
"Set",
"querystring",
"to",
"file",
"modification",
"timestamp",
"(",
"or",
"value",
"provided",
"as",
"a",
"parameter",
")",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Page/Medium/Medium.php#L166-L171 | train | Set the timestamp of the entry | [
30522,
2270,
3853,
2275,
7292,
9153,
8737,
1006,
1002,
2335,
15464,
2361,
1027,
19701,
1007,
1063,
1002,
2023,
1011,
1028,
2335,
15464,
2361,
1027,
1006,
5164,
1007,
1006,
1002,
2335,
15464,
2361,
1029,
1029,
1002,
2023,
1011,
1028,
6310,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Translation/Extractor/PhpExtractor.php | PhpExtractor.seekToNextRelevantToken | private function seekToNextRelevantToken(\Iterator $tokenIterator)
{
for (; $tokenIterator->valid(); $tokenIterator->next()) {
$t = $tokenIterator->current();
if (T_WHITESPACE !== $t[0]) {
break;
}
}
} | php | private function seekToNextRelevantToken(\Iterator $tokenIterator)
{
for (; $tokenIterator->valid(); $tokenIterator->next()) {
$t = $tokenIterator->current();
if (T_WHITESPACE !== $t[0]) {
break;
}
}
} | [
"private",
"function",
"seekToNextRelevantToken",
"(",
"\\",
"Iterator",
"$",
"tokenIterator",
")",
"{",
"for",
"(",
";",
"$",
"tokenIterator",
"->",
"valid",
"(",
")",
";",
"$",
"tokenIterator",
"->",
"next",
"(",
")",
")",
"{",
"$",
"t",
"=",
"$",
"t... | Seeks to a non-whitespace token. | [
"Seeks",
"to",
"a",
"non",
"-",
"whitespace",
"token",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Translation/Extractor/PhpExtractor.php#L117-L125 | train | Seeks to the next non - whitespace token in the iterator. | [
30522,
2797,
3853,
6148,
5524,
18413,
16570,
13331,
3372,
18715,
2368,
1006,
1032,
2009,
6906,
4263,
1002,
19204,
21646,
8844,
1007,
1063,
2005,
1006,
1025,
1002,
19204,
21646,
8844,
1011,
1028,
9398,
1006,
1007,
1025,
1002,
19204,
21646,
8... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Templating/Helper/FormHelper.php | FormHelper.label | public function label(FormView $view, $label = null, array $variables = [])
{
if (null !== $label) {
$variables += ['label' => $label];
}
return $this->renderer->searchAndRenderBlock($view, 'label', $variables);
} | php | public function label(FormView $view, $label = null, array $variables = [])
{
if (null !== $label) {
$variables += ['label' => $label];
}
return $this->renderer->searchAndRenderBlock($view, 'label', $variables);
} | [
"public",
"function",
"label",
"(",
"FormView",
"$",
"view",
",",
"$",
"label",
"=",
"null",
",",
"array",
"$",
"variables",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"label",
")",
"{",
"$",
"variables",
"+=",
"[",
"'label'",
"=>",
... | Renders the label of the given view.
@param FormView $view The view for which to render the label
@param string $label The label
@param array $variables Additional variables passed to the template
@return string The HTML markup | [
"Renders",
"the",
"label",
"of",
"the",
"given",
"view",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/FormHelper.php#L167-L174 | train | Returns the label of the form | [
30522,
2270,
3853,
3830,
1006,
2433,
8584,
1002,
3193,
1010,
1002,
3830,
1027,
19701,
1010,
9140,
1002,
10857,
1027,
1031,
1033,
1007,
1063,
2065,
1006,
19701,
999,
1027,
1027,
1002,
3830,
1007,
1063,
1002,
10857,
1009,
1027,
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/ArchiveProcessor.php | ArchiveProcessor.aggregateNumericMetrics | public function aggregateNumericMetrics($columns, $operationToApply = false)
{
$metrics = $this->getAggregatedNumericMetrics($columns, $operationToApply);
foreach ($metrics as $column => $value) {
$value = Common::forceDotAsSeparatorForDecimalPoint($value);
$this->archiveWri... | php | public function aggregateNumericMetrics($columns, $operationToApply = false)
{
$metrics = $this->getAggregatedNumericMetrics($columns, $operationToApply);
foreach ($metrics as $column => $value) {
$value = Common::forceDotAsSeparatorForDecimalPoint($value);
$this->archiveWri... | [
"public",
"function",
"aggregateNumericMetrics",
"(",
"$",
"columns",
",",
"$",
"operationToApply",
"=",
"false",
")",
"{",
"$",
"metrics",
"=",
"$",
"this",
"->",
"getAggregatedNumericMetrics",
"(",
"$",
"columns",
",",
"$",
"operationToApply",
")",
";",
"for... | Aggregates one or more metrics for every subperiod of the current period and inserts the results
as metrics for the current period.
@param array|string $columns Array of metric names to aggregate.
@param bool|string $operationToApply The operation to apply to the metric. Either `'sum'`, `'max'` or `'min'`.
@return arr... | [
"Aggregates",
"one",
"or",
"more",
"metrics",
"for",
"every",
"subperiod",
"of",
"the",
"current",
"period",
"and",
"inserts",
"the",
"results",
"as",
"metrics",
"for",
"the",
"current",
"period",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/ArchiveProcessor.php#L256-L271 | train | Aggregate numeric metrics into archive | [
30522,
2270,
3853,
9572,
19172,
22420,
12589,
2015,
1006,
1002,
7753,
1010,
1002,
3169,
3406,
29098,
2135,
1027,
6270,
1007,
1063,
1002,
12046,
2015,
1027,
1002,
2023,
1011,
1028,
2131,
8490,
17603,
11644,
19172,
22420,
12589,
2015,
1006,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Common/Plugin.php | Plugin.loadBlueprint | protected function loadBlueprint()
{
if (!$this->blueprint) {
$grav = Grav::instance();
$plugins = $grav['plugins'];
$this->blueprint = $plugins->get($this->name)->blueprints();
}
} | php | protected function loadBlueprint()
{
if (!$this->blueprint) {
$grav = Grav::instance();
$plugins = $grav['plugins'];
$this->blueprint = $plugins->get($this->name)->blueprints();
}
} | [
"protected",
"function",
"loadBlueprint",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"blueprint",
")",
"{",
"$",
"grav",
"=",
"Grav",
"::",
"instance",
"(",
")",
";",
"$",
"plugins",
"=",
"$",
"grav",
"[",
"'plugins'",
"]",
";",
"$",
"this",... | Load blueprints. | [
"Load",
"blueprints",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Plugin.php#L365-L372 | train | Load blueprints for this plugin | [
30522,
5123,
3853,
7170,
16558,
5657,
16550,
1006,
1007,
1063,
2065,
1006,
999,
1002,
2023,
1011,
1028,
2630,
16550,
1007,
1063,
1002,
24665,
11431,
1027,
24665,
11431,
1024,
1024,
6013,
1006,
1007,
1025,
1002,
13354,
7076,
1027,
1002,
2466... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Bridge/ProxyManager/LazyProxy/PhpDumper/ProxyDumper.php | ProxyDumper.isProxyCandidate | public function isProxyCandidate(Definition $definition)
{
return ($definition->isLazy() || $definition->hasTag('proxy')) && $this->proxyGenerator->getProxifiedClass($definition);
} | php | public function isProxyCandidate(Definition $definition)
{
return ($definition->isLazy() || $definition->hasTag('proxy')) && $this->proxyGenerator->getProxifiedClass($definition);
} | [
"public",
"function",
"isProxyCandidate",
"(",
"Definition",
"$",
"definition",
")",
"{",
"return",
"(",
"$",
"definition",
"->",
"isLazy",
"(",
")",
"||",
"$",
"definition",
"->",
"hasTag",
"(",
"'proxy'",
")",
")",
"&&",
"$",
"this",
"->",
"proxyGenerato... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bridge/ProxyManager/LazyProxy/PhpDumper/ProxyDumper.php#L43-L46 | train | Returns true if the definition is a proxy class | [
30522,
2270,
3853,
2003,
21572,
18037,
9336,
4305,
13701,
1006,
6210,
1002,
6210,
1007,
1063,
2709,
1006,
1002,
6210,
1011,
1028,
25340,
9096,
1006,
1007,
1064,
1064,
1002,
6210,
1011,
1028,
2038,
15900,
1006,
1005,
24540,
1005,
1007,
1007,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/DataTable/Renderer/Xml.php | Xml.renderDataTable | protected function renderDataTable($array, $prefixLine = "")
{
$columnsHaveInvalidChars = $this->areTableLabelsInvalidXmlTagNames(reset($array));
$out = '';
foreach ($array as $rowId => $row) {
if (!is_array($row)) {
$value = self::formatValueXml($row);
... | php | protected function renderDataTable($array, $prefixLine = "")
{
$columnsHaveInvalidChars = $this->areTableLabelsInvalidXmlTagNames(reset($array));
$out = '';
foreach ($array as $rowId => $row) {
if (!is_array($row)) {
$value = self::formatValueXml($row);
... | [
"protected",
"function",
"renderDataTable",
"(",
"$",
"array",
",",
"$",
"prefixLine",
"=",
"\"\"",
")",
"{",
"$",
"columnsHaveInvalidChars",
"=",
"$",
"this",
"->",
"areTableLabelsInvalidXmlTagNames",
"(",
"reset",
"(",
"$",
"array",
")",
")",
";",
"$",
"ou... | Computes the output for the given data array
@param array $array
@param string $prefixLine
@return string | [
"Computes",
"the",
"output",
"for",
"the",
"given",
"data",
"array"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable/Renderer/Xml.php#L339-L396 | train | Render the data table | [
30522,
5123,
3853,
17552,
2850,
29336,
3085,
1006,
1002,
9140,
1010,
1002,
17576,
4179,
1027,
1000,
1000,
1007,
1063,
1002,
7753,
30524,
2595,
19968,
15900,
18442,
2015,
1006,
25141,
1006,
1002,
9140,
1007,
1007,
1025,
1002,
2041,
1027,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Common/Uri.php | Uri.params | public function params($id = null, $array = false)
{
$config = Grav::instance()['config'];
$sep = $config->get('system.param_sep');
$params = null;
if ($id === null) {
if ($array) {
return $this->params;
}
$output = [];
... | php | public function params($id = null, $array = false)
{
$config = Grav::instance()['config'];
$sep = $config->get('system.param_sep');
$params = null;
if ($id === null) {
if ($array) {
return $this->params;
}
$output = [];
... | [
"public",
"function",
"params",
"(",
"$",
"id",
"=",
"null",
",",
"$",
"array",
"=",
"false",
")",
"{",
"$",
"config",
"=",
"Grav",
"::",
"instance",
"(",
")",
"[",
"'config'",
"]",
";",
"$",
"sep",
"=",
"$",
"config",
"->",
"get",
"(",
"'system.... | Return all or a single query parameter as a URI compatible string.
@param string $id Optional parameter name.
@param boolean $array return the array format or not
@return null|string|array | [
"Return",
"all",
"or",
"a",
"single",
"query",
"parameter",
"as",
"a",
"URI",
"compatible",
"string",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Uri.php#L274-L297 | train | Return parameters of the current page | [
30522,
2270,
3853,
11498,
5244,
1006,
1002,
8909,
1027,
19701,
1010,
1002,
9140,
1027,
6270,
1007,
1063,
1002,
9530,
8873,
2290,
1027,
24665,
11431,
1024,
1024,
6013,
1006,
1007,
1031,
1005,
9530,
8873,
2290,
1005,
1033,
1025,
1002,
19802,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Language/Language.php | Language.getFallbackPageExtensions | public function getFallbackPageExtensions($file_ext = null)
{
if (empty($this->page_extensions)) {
if (!$file_ext) {
$file_ext = CONTENT_EXT;
}
if ($this->enabled()) {
$valid_lang_extensions = [];
foreach ($this->languages ... | php | public function getFallbackPageExtensions($file_ext = null)
{
if (empty($this->page_extensions)) {
if (!$file_ext) {
$file_ext = CONTENT_EXT;
}
if ($this->enabled()) {
$valid_lang_extensions = [];
foreach ($this->languages ... | [
"public",
"function",
"getFallbackPageExtensions",
"(",
"$",
"file_ext",
"=",
"null",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"page_extensions",
")",
")",
"{",
"if",
"(",
"!",
"$",
"file_ext",
")",
"{",
"$",
"file_ext",
"=",
"CONTENT_EXT",
... | Gets an array of valid extensions with active first, then fallback extensions
@param string|null $file_ext
@return array | [
"Gets",
"an",
"array",
"of",
"valid",
"extensions",
"with",
"active",
"first",
"then",
"fallback",
"extensions"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Language/Language.php#L286-L320 | train | Get the list of page extensions that are not in the fallback language | [
30522,
2270,
3853,
2131,
13976,
5963,
13704,
10288,
29048,
2015,
1006,
1002,
5371,
1035,
4654,
2102,
1027,
19701,
1007,
1063,
2065,
1006,
4064,
1006,
1002,
2023,
1011,
1028,
3931,
1035,
14305,
1007,
1007,
1063,
2065,
1006,
999,
1002,
5371,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hhxsv5/laravel-s | src/Swoole/Request.php | Request.toIlluminateRequest | public function toIlluminateRequest(array $rawServer = [], array $rawEnv = [])
{
$__GET = isset($this->swooleRequest->get) ? $this->swooleRequest->get : [];
$__POST = isset($this->swooleRequest->post) ? $this->swooleRequest->post : [];
$__COOKIE = isset($this->swooleRequest->cookie) ? $this-... | php | public function toIlluminateRequest(array $rawServer = [], array $rawEnv = [])
{
$__GET = isset($this->swooleRequest->get) ? $this->swooleRequest->get : [];
$__POST = isset($this->swooleRequest->post) ? $this->swooleRequest->post : [];
$__COOKIE = isset($this->swooleRequest->cookie) ? $this-... | [
"public",
"function",
"toIlluminateRequest",
"(",
"array",
"$",
"rawServer",
"=",
"[",
"]",
",",
"array",
"$",
"rawEnv",
"=",
"[",
"]",
")",
"{",
"$",
"__GET",
"=",
"isset",
"(",
"$",
"this",
"->",
"swooleRequest",
"->",
"get",
")",
"?",
"$",
"this",... | Convert SwooleRequest to IlluminateRequest
@param array $rawServer
@param array $rawEnv
@return IlluminateRequest | [
"Convert",
"SwooleRequest",
"to",
"IlluminateRequest"
] | 247b86c9d5aee0f347f1b37fe89d739f806057bd | https://github.com/hhxsv5/laravel-s/blob/247b86c9d5aee0f347f1b37fe89d739f806057bd/src/Swoole/Request.php#L24-L88 | train | Convert swoole request to Illuminate request | [
30522,
2270,
3853,
2000,
8591,
12717,
12556,
2890,
15500,
1006,
9140,
1002,
6315,
8043,
6299,
1027,
1031,
1033,
1010,
9140,
1002,
6315,
2368,
2615,
1027,
1031,
1033,
1007,
1063,
1002,
1035,
1035,
2131,
1027,
26354,
3388,
1006,
1002,
2023,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Foundation/Console/Presets/Preset.php | Preset.removeNodeModules | protected static function removeNodeModules()
{
tap(new Filesystem, function ($files) {
$files->deleteDirectory(base_path('node_modules'));
$files->delete(base_path('yarn.lock'));
});
} | php | protected static function removeNodeModules()
{
tap(new Filesystem, function ($files) {
$files->deleteDirectory(base_path('node_modules'));
$files->delete(base_path('yarn.lock'));
});
} | [
"protected",
"static",
"function",
"removeNodeModules",
"(",
")",
"{",
"tap",
"(",
"new",
"Filesystem",
",",
"function",
"(",
"$",
"files",
")",
"{",
"$",
"files",
"->",
"deleteDirectory",
"(",
"base_path",
"(",
"'node_modules'",
")",
")",
";",
"$",
"files... | Remove the installed Node modules.
@return void | [
"Remove",
"the",
"installed",
"Node",
"modules",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Foundation/Console/Presets/Preset.php#L57-L64 | train | Remove node modules and yarn. lock files | [
30522,
5123,
10763,
3853,
6366,
3630,
3207,
5302,
8566,
4244,
1006,
1007,
1063,
11112,
1006,
2047,
6764,
27268,
6633,
1010,
3853,
1006,
1002,
6764,
1007,
1063,
1002,
6764,
1011,
1028,
17159,
7442,
16761,
2100,
1006,
2918,
1035,
4130,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/backend/ServiceProvider.php | ServiceProvider.registerBackendReportWidgets | protected function registerBackendReportWidgets()
{
WidgetManager::instance()->registerReportWidgets(function ($manager) {
$manager->registerReportWidget(\Backend\ReportWidgets\Welcome::class, [
'label' => 'backend::lang.dashboard.welcome.widget_title_default',
... | php | protected function registerBackendReportWidgets()
{
WidgetManager::instance()->registerReportWidgets(function ($manager) {
$manager->registerReportWidget(\Backend\ReportWidgets\Welcome::class, [
'label' => 'backend::lang.dashboard.welcome.widget_title_default',
... | [
"protected",
"function",
"registerBackendReportWidgets",
"(",
")",
"{",
"WidgetManager",
"::",
"instance",
"(",
")",
"->",
"registerReportWidgets",
"(",
"function",
"(",
"$",
"manager",
")",
"{",
"$",
"manager",
"->",
"registerReportWidget",
"(",
"\\",
"Backend",
... | /*
Register report widgets | [
"/",
"*",
"Register",
"report",
"widgets"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/ServiceProvider.php#L119-L127 | train | Registers welcome widgets to the Widget Manager | [
30522,
5123,
3853,
4236,
5963,
10497,
2890,
6442,
9148,
28682,
1006,
1007,
1063,
15536,
24291,
24805,
4590,
1024,
1024,
6013,
1006,
1007,
1011,
1028,
4236,
2890,
6442,
9148,
28682,
1006,
3853,
1006,
1002,
3208,
1007,
1063,
1002,
3208,
1011,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Common/Twig/TwigExtension.php | TwigExtension.arrayIntersectFunc | public function arrayIntersectFunc($array1, $array2)
{
if ($array1 instanceof Collection && $array2 instanceof Collection) {
return $array1->intersect($array2);
}
return array_intersect($array1, $array2);
} | php | public function arrayIntersectFunc($array1, $array2)
{
if ($array1 instanceof Collection && $array2 instanceof Collection) {
return $array1->intersect($array2);
}
return array_intersect($array1, $array2);
} | [
"public",
"function",
"arrayIntersectFunc",
"(",
"$",
"array1",
",",
"$",
"array2",
")",
"{",
"if",
"(",
"$",
"array1",
"instanceof",
"Collection",
"&&",
"$",
"array2",
"instanceof",
"Collection",
")",
"{",
"return",
"$",
"array1",
"->",
"intersect",
"(",
... | Wrapper for array_intersect() method
@param array $array1
@param array $array2
@return array | [
"Wrapper",
"for",
"array_intersect",
"()",
"method"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Twig/TwigExtension.php#L959-L966 | train | Array Intersects 2 arrays | [
30522,
2270,
3853,
9140,
18447,
2545,
22471,
11263,
12273,
1006,
1002,
9140,
2487,
1010,
1002,
9140,
2475,
1007,
1063,
2065,
1006,
1002,
9140,
2487,
6013,
11253,
3074,
1004,
1004,
1002,
9140,
2475,
6013,
11253,
3074,
1007,
30524,
0,
0,
0,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/DependencyInjection/Definition.php | Definition.addError | public function addError($error)
{
if ($error instanceof self) {
$this->errors = array_merge($this->errors, $error->errors);
} else {
$this->errors[] = $error;
}
return $this;
} | php | public function addError($error)
{
if ($error instanceof self) {
$this->errors = array_merge($this->errors, $error->errors);
} else {
$this->errors[] = $error;
}
return $this;
} | [
"public",
"function",
"addError",
"(",
"$",
"error",
")",
"{",
"if",
"(",
"$",
"error",
"instanceof",
"self",
")",
"{",
"$",
"this",
"->",
"errors",
"=",
"array_merge",
"(",
"$",
"this",
"->",
"errors",
",",
"$",
"error",
"->",
"errors",
")",
";",
... | Add an error that occurred when building this Definition.
@param string|\Closure|self $error
@return $this | [
"Add",
"an",
"error",
"that",
"occurred",
"when",
"building",
"this",
"Definition",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/DependencyInjection/Definition.php#L888-L897 | train | Add error to the list of errors | [
30522,
2270,
3853,
5587,
2121,
29165,
1006,
1002,
7561,
1007,
1063,
2065,
1006,
1002,
7561,
6013,
11253,
2969,
1007,
1063,
1002,
2023,
1011,
1028,
10697,
1027,
9140,
1035,
13590,
1006,
1002,
2023,
1011,
1028,
10697,
1010,
1002,
7561,
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... |
octobercms/october | modules/backend/models/Preference.php | Preference.getTimezoneOptions | public function getTimezoneOptions()
{
$timezoneIdentifiers = DateTimeZone::listIdentifiers();
$utcTime = new DateTime('now', new DateTimeZone('UTC'));
$tempTimezones = [];
foreach ($timezoneIdentifiers as $timezoneIdentifier) {
$currentTimezone = new DateTimeZone($timez... | php | public function getTimezoneOptions()
{
$timezoneIdentifiers = DateTimeZone::listIdentifiers();
$utcTime = new DateTime('now', new DateTimeZone('UTC'));
$tempTimezones = [];
foreach ($timezoneIdentifiers as $timezoneIdentifier) {
$currentTimezone = new DateTimeZone($timez... | [
"public",
"function",
"getTimezoneOptions",
"(",
")",
"{",
"$",
"timezoneIdentifiers",
"=",
"DateTimeZone",
"::",
"listIdentifiers",
"(",
")",
";",
"$",
"utcTime",
"=",
"new",
"DateTime",
"(",
"'now'",
",",
"new",
"DateTimeZone",
"(",
"'UTC'",
")",
")",
";",... | Returns all available timezone options.
@return array | [
"Returns",
"all",
"available",
"timezone",
"options",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/models/Preference.php#L235-L265 | train | Returns the timezone options | [
30522,
2270,
3853,
2131,
7292,
15975,
7361,
9285,
1006,
1007,
1063,
1002,
2051,
15975,
5178,
16778,
8873,
2545,
1027,
3058,
7292,
15975,
1024,
1024,
2862,
5178,
16778,
8873,
2545,
1006,
1007,
1025,
1002,
11396,
7292,
1027,
2047,
3058,
7292,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.tableInsertBatch | public static function tableInsertBatch($tableName, $fields, $values, $throwException = false, $charset = 'utf8')
{
$loadDataInfileEnabled = Config::getInstance()->General['enable_load_data_infile'];
if ($loadDataInfileEnabled
&& Db::get()->hasBulkLoader()) {
$path = self::... | php | public static function tableInsertBatch($tableName, $fields, $values, $throwException = false, $charset = 'utf8')
{
$loadDataInfileEnabled = Config::getInstance()->General['enable_load_data_infile'];
if ($loadDataInfileEnabled
&& Db::get()->hasBulkLoader()) {
$path = self::... | [
"public",
"static",
"function",
"tableInsertBatch",
"(",
"$",
"tableName",
",",
"$",
"fields",
",",
"$",
"values",
",",
"$",
"throwException",
"=",
"false",
",",
"$",
"charset",
"=",
"'utf8'",
")",
"{",
"$",
"loadDataInfileEnabled",
"=",
"Config",
"::",
"g... | Performs a batch insert into a specific table using either LOAD DATA INFILE or plain INSERTs,
as a fallback. On MySQL, LOAD DATA INFILE is 20x faster than a series of plain INSERTs.
@param string $tableName PREFIXED table name! you must call Common::prefixTable() before passing the table name
@param array $fields arra... | [
"Performs",
"a",
"batch",
"insert",
"into",
"a",
"specific",
"table",
"using",
"either",
"LOAD",
"DATA",
"INFILE",
"or",
"plain",
"INSERTs",
"as",
"a",
"fallback",
".",
"On",
"MySQL",
"LOAD",
"DATA",
"INFILE",
"is",
"20x",
"faster",
"than",
"a",
"series",
... | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Db/BatchInsert.php#L57-L106 | train | Insert a batch of rows into a table | [
30522,
2270,
10763,
3853,
2795,
7076,
8743,
14479,
2818,
1006,
1002,
2795,
18442,
1010,
1002,
4249,
1010,
1002,
5300,
1010,
1002,
5466,
10288,
24422,
1027,
6270,
1010,
1002,
25869,
13462,
1027,
1005,
21183,
2546,
2620,
1005,
1007,
1063,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Debug/ErrorHandler.php | ErrorHandler.scopeAt | public function scopeAt($levels, $replace = false)
{
$prev = $this->scopedErrors;
$this->scopedErrors = (int) $levels;
if (!$replace) {
$this->scopedErrors |= $prev;
}
return $prev;
} | php | public function scopeAt($levels, $replace = false)
{
$prev = $this->scopedErrors;
$this->scopedErrors = (int) $levels;
if (!$replace) {
$this->scopedErrors |= $prev;
}
return $prev;
} | [
"public",
"function",
"scopeAt",
"(",
"$",
"levels",
",",
"$",
"replace",
"=",
"false",
")",
"{",
"$",
"prev",
"=",
"$",
"this",
"->",
"scopedErrors",
";",
"$",
"this",
"->",
"scopedErrors",
"=",
"(",
"int",
")",
"$",
"levels",
";",
"if",
"(",
"!",... | Sets the PHP error levels for which local variables are preserved.
@param int $levels A bit field of E_* constants for scoped errors
@param bool $replace Replace or amend the previous value
@return int The previous value | [
"Sets",
"the",
"PHP",
"error",
"levels",
"for",
"which",
"local",
"variables",
"are",
"preserved",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Debug/ErrorHandler.php#L300-L309 | train | Scope the error levels at the specified levels. | [
30522,
2270,
3853,
9531,
4017,
1006,
1002,
3798,
1010,
1002,
5672,
1027,
6270,
1007,
1063,
1002,
3653,
2615,
1027,
1002,
2023,
1011,
1028,
9531,
4063,
29165,
2015,
1025,
1002,
2023,
1011,
1028,
9531,
4063,
29165,
2015,
1027,
1006,
20014,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Console/Helper/TableStyle.php | TableStyle.setDefaultCrossingChar | public function setDefaultCrossingChar(string $char): self
{
return $this->setCrossingChars($char, $char, $char, $char, $char, $char, $char, $char, $char);
} | php | public function setDefaultCrossingChar(string $char): self
{
return $this->setCrossingChars($char, $char, $char, $char, $char, $char, $char, $char, $char);
} | [
"public",
"function",
"setDefaultCrossingChar",
"(",
"string",
"$",
"char",
")",
":",
"self",
"{",
"return",
"$",
"this",
"->",
"setCrossingChars",
"(",
"$",
"char",
",",
"$",
"char",
",",
"$",
"char",
",",
"$",
"char",
",",
"$",
"char",
",",
"$",
"c... | Sets default crossing character used for each cross.
@see {@link setCrossingChars()} for setting each crossing individually. | [
"Sets",
"default",
"crossing",
"character",
"used",
"for",
"each",
"cross",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Helper/TableStyle.php#L257-L260 | train | Set default crossing character | [
30522,
2270,
3853,
2275,
3207,
7011,
11314,
16458,
2075,
7507,
2099,
1006,
5164,
1002,
25869,
1007,
1024,
2969,
1063,
2709,
1002,
2023,
1011,
1028,
2275,
16458,
2075,
7507,
2869,
1006,
1002,
25869,
1010,
1002,
25869,
1010,
1002,
25869,
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... |
google/flatbuffers | php/FlatbufferBuilder.php | FlatbufferBuilder.prep | public function prep($size, $additional_bytes)
{
if ($size > $this->minalign) {
$this->minalign = $size;
}
$align_size = ((~($this->bb->capacity() - $this->space + $additional_bytes)) + 1) & ($size - 1);
while ($this->space < $align_size + $size + $additional_bytes) {
... | php | public function prep($size, $additional_bytes)
{
if ($size > $this->minalign) {
$this->minalign = $size;
}
$align_size = ((~($this->bb->capacity() - $this->space + $additional_bytes)) + 1) & ($size - 1);
while ($this->space < $align_size + $size + $additional_bytes) {
... | [
"public",
"function",
"prep",
"(",
"$",
"size",
",",
"$",
"additional_bytes",
")",
"{",
"if",
"(",
"$",
"size",
">",
"$",
"this",
"->",
"minalign",
")",
"{",
"$",
"this",
"->",
"minalign",
"=",
"$",
"size",
";",
"}",
"$",
"align_size",
"=",
"(",
... | prepare bytebuffer
@param $size
@param $additional_bytes
@throws \Exception | [
"prepare",
"bytebuffer"
] | af74f87ccd6ea9bcf9e325427dca7c7faf1d79c1 | https://github.com/google/flatbuffers/blob/af74f87ccd6ea9bcf9e325427dca7c7faf1d79c1/php/FlatbufferBuilder.php#L139-L153 | train | Pre - aligns the buffer | [
30522,
2270,
3853,
17463,
1006,
1002,
2946,
1010,
1002,
3176,
1035,
27507,
1007,
1063,
2065,
1006,
1002,
2946,
1028,
1002,
2023,
1011,
1028,
19808,
3669,
16206,
1007,
1063,
1002,
2023,
1011,
1028,
19808,
3669,
16206,
1027,
1002,
2946,
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/Routing/Matcher/Dumper/CompiledUrlMatcherDumper.php | CompiledUrlMatcherDumper.compileStaticRoutes | private function compileStaticRoutes(array $staticRoutes, array &$conditions): array
{
if (!$staticRoutes) {
return [];
}
$compiledRoutes = [];
foreach ($staticRoutes as $url => $routes) {
$compiledRoutes[$url] = [];
foreach ($routes as $name => l... | php | private function compileStaticRoutes(array $staticRoutes, array &$conditions): array
{
if (!$staticRoutes) {
return [];
}
$compiledRoutes = [];
foreach ($staticRoutes as $url => $routes) {
$compiledRoutes[$url] = [];
foreach ($routes as $name => l... | [
"private",
"function",
"compileStaticRoutes",
"(",
"array",
"$",
"staticRoutes",
",",
"array",
"&",
"$",
"conditions",
")",
":",
"array",
"{",
"if",
"(",
"!",
"$",
"staticRoutes",
")",
"{",
"return",
"[",
"]",
";",
"}",
"$",
"compiledRoutes",
"=",
"[",
... | Compiles static routes in a switch statement.
Condition-less paths are put in a static array in the switch's default, with generic matching logic.
Paths that can match two or more routes, or have user-specified conditions are put in separate switch's cases.
@throws \LogicException | [
"Compiles",
"static",
"routes",
"in",
"a",
"switch",
"statement",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Routing/Matcher/Dumper/CompiledUrlMatcherDumper.php#L215-L230 | train | Compiles static routes into array of static routes | [
30522,
2797,
3853,
4012,
22090,
16677,
22494,
4570,
1006,
9140,
1002,
10763,
22494,
4570,
1010,
9140,
1004,
1002,
3785,
1007,
1024,
9140,
1063,
2065,
1006,
999,
1002,
10763,
22494,
4570,
1007,
1063,
2709,
1031,
1033,
1025,
1065,
1002,
9227,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Console/GeneratorCommand.php | GeneratorCommand.replaceNamespace | protected function replaceNamespace(&$stub, $name)
{
$stub = str_replace(
['DummyNamespace', 'DummyRootNamespace', 'NamespacedDummyUserModel'],
[$this->getNamespace($name), $this->rootNamespace(), $this->userProviderModel()],
$stub
);
return $this;
} | php | protected function replaceNamespace(&$stub, $name)
{
$stub = str_replace(
['DummyNamespace', 'DummyRootNamespace', 'NamespacedDummyUserModel'],
[$this->getNamespace($name), $this->rootNamespace(), $this->userProviderModel()],
$stub
);
return $this;
} | [
"protected",
"function",
"replaceNamespace",
"(",
"&",
"$",
"stub",
",",
"$",
"name",
")",
"{",
"$",
"stub",
"=",
"str_replace",
"(",
"[",
"'DummyNamespace'",
",",
"'DummyRootNamespace'",
",",
"'NamespacedDummyUserModel'",
"]",
",",
"[",
"$",
"this",
"->",
"... | Replace the namespace for the given stub.
@param string $stub
@param string $name
@return $this | [
"Replace",
"the",
"namespace",
"for",
"the",
"given",
"stub",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Console/GeneratorCommand.php#L172-L181 | train | Replace namespace dummy | [
30522,
5123,
3853,
5672,
18442,
23058,
1006,
1004,
1002,
24646,
2497,
1010,
1002,
2171,
1007,
1063,
1002,
24646,
2497,
1027,
2358,
2099,
1035,
5672,
1006,
1031,
1005,
24369,
18442,
23058,
1005,
1010,
1005,
24369,
3217,
4140,
18442,
23058,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Bundle/TwigBundle/CacheWarmer/TemplateCacheCacheWarmer.php | TemplateCacheCacheWarmer.warmUp | public function warmUp($cacheDir)
{
if (null === $this->finder) {
return;
}
$twig = $this->container->get('twig');
$templates = $this->finder->findAllTemplates();
foreach ($this->paths as $path => $namespace) {
$templates = array_merge($templates, $... | php | public function warmUp($cacheDir)
{
if (null === $this->finder) {
return;
}
$twig = $this->container->get('twig');
$templates = $this->finder->findAllTemplates();
foreach ($this->paths as $path => $namespace) {
$templates = array_merge($templates, $... | [
"public",
"function",
"warmUp",
"(",
"$",
"cacheDir",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"finder",
")",
"{",
"return",
";",
"}",
"$",
"twig",
"=",
"$",
"this",
"->",
"container",
"->",
"get",
"(",
"'twig'",
")",
";",
"$",
"tem... | Warms up the cache.
@param string $cacheDir The cache directory | [
"Warms",
"up",
"the",
"cache",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bundle/TwigBundle/CacheWarmer/TemplateCacheCacheWarmer.php#L56-L77 | train | Warms up the templates in the cache directory | [
30522,
2270,
3853,
4010,
6279,
1006,
1002,
17053,
4305,
2099,
1007,
1063,
2065,
1006,
19701,
1027,
1027,
1027,
1002,
2023,
1011,
1028,
2424,
2121,
1007,
1063,
2709,
1025,
1065,
1002,
1056,
16279,
1027,
1002,
2023,
1011,
1028,
11661,
1011,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Form/Extension/Validator/ValidatorTypeGuesser.php | ValidatorTypeGuesser.guessPatternForConstraint | public function guessPatternForConstraint(Constraint $constraint)
{
switch (\get_class($constraint)) {
case 'Symfony\Component\Validator\Constraints\Length':
if (is_numeric($constraint->min)) {
return new ValueGuess(sprintf('.{%s,}', (string) $constraint->min)... | php | public function guessPatternForConstraint(Constraint $constraint)
{
switch (\get_class($constraint)) {
case 'Symfony\Component\Validator\Constraints\Length':
if (is_numeric($constraint->min)) {
return new ValueGuess(sprintf('.{%s,}', (string) $constraint->min)... | [
"public",
"function",
"guessPatternForConstraint",
"(",
"Constraint",
"$",
"constraint",
")",
"{",
"switch",
"(",
"\\",
"get_class",
"(",
"$",
"constraint",
")",
")",
"{",
"case",
"'Symfony\\Component\\Validator\\Constraints\\Length'",
":",
"if",
"(",
"is_numeric",
... | Guesses a field's pattern based on the given constraint.
@return ValueGuess|null The guess for the pattern | [
"Guesses",
"a",
"field",
"s",
"pattern",
"based",
"on",
"the",
"given",
"constraint",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/Extension/Validator/ValidatorTypeGuesser.php#L206-L235 | train | Guesses the HTML pattern for the given constraint | [
30522,
2270,
3853,
3984,
4502,
12079,
2078,
29278,
8663,
20528,
18447,
1006,
27142,
1002,
27142,
1007,
1063,
6942,
1006,
1032,
2131,
1035,
2465,
1006,
1002,
27142,
1007,
1007,
1063,
2553,
1005,
25353,
2213,
14876,
4890,
1032,
6922,
1032,
93... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/PropertyAccess/PropertyAccessor.php | PropertyAccessor.readProperty | private function readProperty($zval, $property, bool $ignoreInvalidProperty = false)
{
if (!\is_object($zval[self::VALUE])) {
throw new NoSuchPropertyException(sprintf('Cannot read property "%s" from an array. Maybe you intended to write the property path as "[%1$s]" instead.', $property));
... | php | private function readProperty($zval, $property, bool $ignoreInvalidProperty = false)
{
if (!\is_object($zval[self::VALUE])) {
throw new NoSuchPropertyException(sprintf('Cannot read property "%s" from an array. Maybe you intended to write the property path as "[%1$s]" instead.', $property));
... | [
"private",
"function",
"readProperty",
"(",
"$",
"zval",
",",
"$",
"property",
",",
"bool",
"$",
"ignoreInvalidProperty",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"\\",
"is_object",
"(",
"$",
"zval",
"[",
"self",
"::",
"VALUE",
"]",
")",
")",
"{",
"th... | Reads the a property from an object.
@param array $zval The array containing the object to read from
@param string $property The property to read
@param bool $ignoreInvalidProperty Whether to ignore invalid property or throw an exception
@return array The array containing the value of... | [
"Reads",
"the",
"a",
"property",
"from",
"an",
"object",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/PropertyAccess/PropertyAccessor.php#L385-L427 | train | Reads a property from an object | [
30522,
2797,
3853,
3191,
21572,
4842,
3723,
1006,
1002,
1062,
10175,
1010,
1002,
3200,
1010,
22017,
2140,
1002,
8568,
2378,
10175,
3593,
21572,
4842,
3723,
1027,
6270,
30524,
1006,
1002,
1062,
10175,
1031,
2969,
1024,
1024,
3643,
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... |
laravel/framework | src/Illuminate/Events/Dispatcher.php | Dispatcher.addInterfaceListeners | protected function addInterfaceListeners($eventName, array $listeners = [])
{
foreach (class_implements($eventName) as $interface) {
if (isset($this->listeners[$interface])) {
foreach ($this->listeners[$interface] as $names) {
$listeners = array_merge($listene... | php | protected function addInterfaceListeners($eventName, array $listeners = [])
{
foreach (class_implements($eventName) as $interface) {
if (isset($this->listeners[$interface])) {
foreach ($this->listeners[$interface] as $names) {
$listeners = array_merge($listene... | [
"protected",
"function",
"addInterfaceListeners",
"(",
"$",
"eventName",
",",
"array",
"$",
"listeners",
"=",
"[",
"]",
")",
"{",
"foreach",
"(",
"class_implements",
"(",
"$",
"eventName",
")",
"as",
"$",
"interface",
")",
"{",
"if",
"(",
"isset",
"(",
"... | Add the listeners for the event's interfaces to the given array.
@param string $eventName
@param array $listeners
@return array | [
"Add",
"the",
"listeners",
"for",
"the",
"event",
"s",
"interfaces",
"to",
"the",
"given",
"array",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Events/Dispatcher.php#L316-L327 | train | Adds all interfaces that have an event | [
30522,
5123,
3853,
5587,
18447,
2121,
12172,
9863,
24454,
2015,
1006,
1002,
2724,
18442,
1010,
9140,
1002,
13810,
1027,
1031,
1033,
1007,
1063,
18921,
6776,
1006,
2465,
1035,
22164,
1006,
1002,
2724,
18442,
1007,
2004,
1002,
8278,
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... |
laravel/framework | src/Illuminate/Auth/SessionGuard.php | SessionGuard.fireOtherDeviceLogoutEvent | protected function fireOtherDeviceLogoutEvent($user)
{
if (isset($this->events)) {
$this->events->dispatch(new Events\OtherDeviceLogout(
$this->name, $user
));
}
} | php | protected function fireOtherDeviceLogoutEvent($user)
{
if (isset($this->events)) {
$this->events->dispatch(new Events\OtherDeviceLogout(
$this->name, $user
));
}
} | [
"protected",
"function",
"fireOtherDeviceLogoutEvent",
"(",
"$",
"user",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"events",
")",
")",
"{",
"$",
"this",
"->",
"events",
"->",
"dispatch",
"(",
"new",
"Events",
"\\",
"OtherDeviceLogout",
"(",
"... | Fire the other device logout event if the dispatcher is set.
@param \Illuminate\Contracts\Auth\Authenticatable $user
@return void | [
"Fire",
"the",
"other",
"device",
"logout",
"event",
"if",
"the",
"dispatcher",
"is",
"set",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Auth/SessionGuard.php#L629-L636 | train | Fire OtherDeviceLogout event | [
30522,
5123,
3853,
2543,
14573,
2121,
24844,
6610,
21197,
5833,
18697,
3372,
1006,
1002,
5310,
1007,
1063,
2065,
1006,
26354,
3388,
1006,
1002,
2023,
1011,
1028,
2824,
1007,
1007,
1063,
1002,
2023,
1011,
1028,
2824,
1011,
1028,
18365,
1006,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Intl/Intl.php | Intl.getEntryReader | private static function getEntryReader()
{
if (null === self::$entryReader) {
self::$entryReader = new BundleEntryReader(new BufferedBundleReader(
new JsonBundleReader(),
self::BUFFER_SIZE
));
$localeDataProvider = new LocaleDataProvider(
... | php | private static function getEntryReader()
{
if (null === self::$entryReader) {
self::$entryReader = new BundleEntryReader(new BufferedBundleReader(
new JsonBundleReader(),
self::BUFFER_SIZE
));
$localeDataProvider = new LocaleDataProvider(
... | [
"private",
"static",
"function",
"getEntryReader",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"self",
"::",
"$",
"entryReader",
")",
"{",
"self",
"::",
"$",
"entryReader",
"=",
"new",
"BundleEntryReader",
"(",
"new",
"BufferedBundleReader",
"(",
"new",
"JsonBu... | Returns the cached bundle entry reader.
@return BundleEntryReaderInterface The bundle entry reader | [
"Returns",
"the",
"cached",
"bundle",
"entry",
"reader",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Intl/Intl.php#L277-L292 | train | Get the entry reader | [
30522,
2797,
10763,
3853,
2131,
4765,
2854,
16416,
4063,
1006,
1007,
1063,
2065,
1006,
19701,
1027,
1027,
1027,
2969,
1024,
1024,
1002,
4443,
16416,
4063,
1007,
1063,
2969,
1024,
1024,
1002,
4443,
16416,
4063,
1027,
2047,
14012,
4765,
2854,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getgrav/grav | system/src/Grav/Common/Page/Media.php | Media.init | protected function init()
{
/** @var UniformResourceLocator $locator */
$locator = Grav::instance()['locator'];
$config = Grav::instance()['config'];
$locator = Grav::instance()['locator'];
$exif_reader = isset(Grav::instance()['exif']) ? Grav::instance()['exif']->getReader()... | php | protected function init()
{
/** @var UniformResourceLocator $locator */
$locator = Grav::instance()['locator'];
$config = Grav::instance()['config'];
$locator = Grav::instance()['locator'];
$exif_reader = isset(Grav::instance()['exif']) ? Grav::instance()['exif']->getReader()... | [
"protected",
"function",
"init",
"(",
")",
"{",
"/** @var UniformResourceLocator $locator */",
"$",
"locator",
"=",
"Grav",
"::",
"instance",
"(",
")",
"[",
"'locator'",
"]",
";",
"$",
"config",
"=",
"Grav",
"::",
"instance",
"(",
")",
"[",
"'config'",
"]",
... | Initialize class. | [
"Initialize",
"class",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Page/Media.php#L76-L212 | train | Initialize the media list | [
30522,
5123,
3853,
1999,
4183,
1006,
1007,
1063,
1013,
1008,
1008,
1030,
13075,
6375,
6072,
8162,
29109,
24755,
4263,
1002,
8840,
11266,
2953,
1008,
1013,
1002,
8840,
11266,
2953,
1027,
24665,
11431,
1024,
1024,
6013,
1006,
1007,
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 | libs/Zend/Db/Adapter/Pdo/Mysql.php | Zend_Db_Adapter_Pdo_Mysql._connect | protected function _connect()
{
if ($this->_connection) {
return;
}
if (!empty($this->_config['charset'])) {
$initCommand = "SET NAMES '" . $this->_config['charset'] . "'";
$this->_config['driver_options'][1002] = $initCommand; // 1002 = PDO::MYSQL_ATTR_I... | php | protected function _connect()
{
if ($this->_connection) {
return;
}
if (!empty($this->_config['charset'])) {
$initCommand = "SET NAMES '" . $this->_config['charset'] . "'";
$this->_config['driver_options'][1002] = $initCommand; // 1002 = PDO::MYSQL_ATTR_I... | [
"protected",
"function",
"_connect",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_connection",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"_config",
"[",
"'charset'",
"]",
")",
")",
"{",
"$",
"initCommand",
"="... | Creates a PDO object and connects to the database.
@return void
@throws Zend_Db_Adapter_Exception | [
"Creates",
"a",
"PDO",
"object",
"and",
"connects",
"to",
"the",
"database",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Adapter/Pdo/Mysql.php#L98-L110 | train | Connection to the database | [
30522,
5123,
3853,
1035,
7532,
1006,
1007,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
1035,
4434,
1007,
1063,
2709,
1025,
1065,
2065,
1006,
999,
4064,
1006,
1002,
2023,
1011,
1028,
1035,
9530,
8873,
2290,
1031,
1005,
25869,
13462,
1005,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Serializer/Encoder/ChainEncoder.php | ChainEncoder.needsNormalization | public function needsNormalization($format, array $context = [])
{
$encoder = $this->getEncoder($format, $context);
if (!$encoder instanceof NormalizationAwareInterface) {
return true;
}
if ($encoder instanceof self) {
return $encoder->needsNormalization($fo... | php | public function needsNormalization($format, array $context = [])
{
$encoder = $this->getEncoder($format, $context);
if (!$encoder instanceof NormalizationAwareInterface) {
return true;
}
if ($encoder instanceof self) {
return $encoder->needsNormalization($fo... | [
"public",
"function",
"needsNormalization",
"(",
"$",
"format",
",",
"array",
"$",
"context",
"=",
"[",
"]",
")",
"{",
"$",
"encoder",
"=",
"$",
"this",
"->",
"getEncoder",
"(",
"$",
"format",
",",
"$",
"context",
")",
";",
"if",
"(",
"!",
"$",
"en... | Checks whether the normalization is needed for the given format.
@param string $format
@param array $context
@return bool | [
"Checks",
"whether",
"the",
"normalization",
"is",
"needed",
"for",
"the",
"given",
"format",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Serializer/Encoder/ChainEncoder.php#L65-L78 | train | Returns true if the encoder needs normalization | [
30522,
2270,
3853,
3791,
12131,
9067,
3989,
1006,
1002,
4289,
1010,
9140,
1002,
6123,
1027,
1031,
1033,
1007,
1063,
1002,
4372,
16044,
2099,
1027,
1002,
2023,
1011,
1028,
2131,
2368,
16044,
2099,
1006,
1002,
4289,
1010,
1002,
6123,
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/API/DataTablePostProcessor.php | DataTablePostProcessor.process | public function process(DataTableInterface $dataTable)
{
// TODO: when calculating metrics before hand, only calculate for needed metrics, not all. NOTE:
// this is non-trivial since it will require, eg, to make sure processed metrics aren't added
// after pivotBy is handled.
... | php | public function process(DataTableInterface $dataTable)
{
// TODO: when calculating metrics before hand, only calculate for needed metrics, not all. NOTE:
// this is non-trivial since it will require, eg, to make sure processed metrics aren't added
// after pivotBy is handled.
... | [
"public",
"function",
"process",
"(",
"DataTableInterface",
"$",
"dataTable",
")",
"{",
"// TODO: when calculating metrics before hand, only calculate for needed metrics, not all. NOTE:",
"// this is non-trivial since it will require, eg, to make sure processed metrics aren't added",
"//... | Apply post-processing logic to a DataTable of a report for an API request.
@param DataTableInterface $dataTable The data table to process.
@return DataTableInterface A new data table. | [
"Apply",
"post",
"-",
"processing",
"logic",
"to",
"a",
"DataTable",
"of",
"a",
"report",
"for",
"an",
"API",
"request",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/API/DataTablePostProcessor.php#L106-L134 | train | Apply all filters and return the processed metrics | [
30522,
2270,
3853,
2832,
1006,
2951,
10880,
18447,
2121,
12172,
1002,
2951,
10880,
1007,
1063,
1013,
1013,
28681,
2080,
1024,
2043,
20177,
12046,
2015,
2077,
2192,
1010,
2069,
18422,
2005,
2734,
12046,
2015,
1010,
2025,
2035,
1012,
3602,
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.getProjectDir | public function getProjectDir()
{
if (null === $this->projectDir) {
$r = new \ReflectionObject($this);
$dir = $rootDir = \dirname($r->getFileName());
while (!file_exists($dir.'/composer.json')) {
if ($dir === \dirname($dir)) {
return $t... | php | public function getProjectDir()
{
if (null === $this->projectDir) {
$r = new \ReflectionObject($this);
$dir = $rootDir = \dirname($r->getFileName());
while (!file_exists($dir.'/composer.json')) {
if ($dir === \dirname($dir)) {
return $t... | [
"public",
"function",
"getProjectDir",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"projectDir",
")",
"{",
"$",
"r",
"=",
"new",
"\\",
"ReflectionObject",
"(",
"$",
"this",
")",
";",
"$",
"dir",
"=",
"$",
"rootDir",
"=",
"\\",
"dirn... | Gets the application root dir (path of the project's composer file).
@return string The project root dir | [
"Gets",
"the",
"application",
"root",
"dir",
"(",
"path",
"of",
"the",
"project",
"s",
"composer",
"file",
")",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpKernel/Kernel.php#L342-L357 | train | Get project directory | [
30522,
2270,
3853,
2131,
21572,
20614,
4305,
2099,
1006,
1007,
1063,
2065,
1006,
19701,
1027,
1027,
1027,
1002,
2023,
1011,
1028,
2622,
4305,
2099,
1007,
1063,
1002,
1054,
1027,
2047,
1032,
9185,
16429,
20614,
1006,
1002,
2023,
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/HttpFoundation/Session/Storage/Handler/MongoDbSessionHandler.php | MongoDbSessionHandler.doWrite | protected function doWrite($sessionId, $data)
{
$expiry = new \MongoDB\BSON\UTCDateTime((time() + (int) ini_get('session.gc_maxlifetime')) * 1000);
$fields = [
$this->options['time_field'] => new \MongoDB\BSON\UTCDateTime(),
$this->options['expiry_field'] => $expiry,
... | php | protected function doWrite($sessionId, $data)
{
$expiry = new \MongoDB\BSON\UTCDateTime((time() + (int) ini_get('session.gc_maxlifetime')) * 1000);
$fields = [
$this->options['time_field'] => new \MongoDB\BSON\UTCDateTime(),
$this->options['expiry_field'] => $expiry,
... | [
"protected",
"function",
"doWrite",
"(",
"$",
"sessionId",
",",
"$",
"data",
")",
"{",
"$",
"expiry",
"=",
"new",
"\\",
"MongoDB",
"\\",
"BSON",
"\\",
"UTCDateTime",
"(",
"(",
"time",
"(",
")",
"+",
"(",
"int",
")",
"ini_get",
"(",
"'session.gc_maxlife... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MongoDbSessionHandler.php#L120-L137 | train | Write session data to database | [
30522,
5123,
3853,
23268,
17625,
1006,
1002,
5219,
3593,
1010,
1002,
2951,
1007,
1063,
1002,
4654,
8197,
2854,
1027,
2047,
1032,
12256,
3995,
18939,
1032,
18667,
2239,
1032,
11396,
13701,
7292,
1006,
1006,
2051,
1006,
1007,
1009,
1006,
2001... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/CronArchive.php | CronArchive.initStateFromParameters | private function initStateFromParameters()
{
$this->todayArchiveTimeToLive = Rules::getTodayArchiveTimeToLive();
$this->processPeriodsMaximumEverySeconds = $this->getDelayBetweenPeriodsArchives();
$this->lastSuccessRunTimestamp = $this->getLastSuccessRunTimestamp();
$this->shouldArch... | php | private function initStateFromParameters()
{
$this->todayArchiveTimeToLive = Rules::getTodayArchiveTimeToLive();
$this->processPeriodsMaximumEverySeconds = $this->getDelayBetweenPeriodsArchives();
$this->lastSuccessRunTimestamp = $this->getLastSuccessRunTimestamp();
$this->shouldArch... | [
"private",
"function",
"initStateFromParameters",
"(",
")",
"{",
"$",
"this",
"->",
"todayArchiveTimeToLive",
"=",
"Rules",
"::",
"getTodayArchiveTimeToLive",
"(",
")",
";",
"$",
"this",
"->",
"processPeriodsMaximumEverySeconds",
"=",
"$",
"this",
"->",
"getDelayBet... | Initializes the various parameters to the script, based on input parameters. | [
"Initializes",
"the",
"various",
"parameters",
"to",
"the",
"script",
"based",
"on",
"input",
"parameters",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/CronArchive.php#L1132-L1144 | train | Initiates the state from parameters | [
30522,
2797,
3853,
1999,
12762,
12259,
19699,
25377,
5400,
22828,
2015,
1006,
1007,
1063,
1002,
2023,
1011,
1028,
2651,
2906,
5428,
19510,
14428,
3406,
3669,
3726,
1027,
3513,
1024,
1024,
2131,
3406,
10259,
2906,
5428,
19510,
14428,
3406,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Form/Extension/Core/Type/DateType.php | DateType.finishView | public function finishView(FormView $view, FormInterface $form, array $options)
{
$view->vars['widget'] = $options['widget'];
// Change the input to a HTML5 date input if
// * the widget is set to "single_text"
// * the format matches the one expected by HTML5
// * the ht... | php | public function finishView(FormView $view, FormInterface $form, array $options)
{
$view->vars['widget'] = $options['widget'];
// Change the input to a HTML5 date input if
// * the widget is set to "single_text"
// * the format matches the one expected by HTML5
// * the ht... | [
"public",
"function",
"finishView",
"(",
"FormView",
"$",
"view",
",",
"FormInterface",
"$",
"form",
",",
"array",
"$",
"options",
")",
"{",
"$",
"view",
"->",
"vars",
"[",
"'widget'",
"]",
"=",
"$",
"options",
"[",
"'widget'",
"]",
";",
"// Change the i... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/Extension/Core/Type/DateType.php#L173-L208 | train | Finishes the view | [
30522,
2270,
3853,
3926,
8584,
1006,
2433,
8584,
1002,
3193,
1010,
2433,
18447,
2121,
12172,
1002,
2433,
1010,
9140,
1002,
7047,
1007,
1063,
1002,
3193,
1011,
1028,
13075,
2015,
1031,
1005,
15536,
24291,
1005,
1033,
1027,
1002,
7047,
1031,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Database/Query/Grammars/Grammar.php | Grammar.whereInRaw | protected function whereInRaw(Builder $query, $where)
{
if (! empty($where['values'])) {
return $this->wrap($where['column']).' in ('.implode(', ', $where['values']).')';
}
return '0 = 1';
} | php | protected function whereInRaw(Builder $query, $where)
{
if (! empty($where['values'])) {
return $this->wrap($where['column']).' in ('.implode(', ', $where['values']).')';
}
return '0 = 1';
} | [
"protected",
"function",
"whereInRaw",
"(",
"Builder",
"$",
"query",
",",
"$",
"where",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"where",
"[",
"'values'",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"wrap",
"(",
"$",
"where",
"[",
"'column... | Compile a "where in raw" clause.
For safety, whereIntegerInRaw ensures this method is only used with integer values.
@param \Illuminate\Database\Query\Builder $query
@param array $where
@return string | [
"Compile",
"a",
"where",
"in",
"raw",
"clause",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Query/Grammars/Grammar.php#L333-L340 | train | Protected in raw | [
30522,
5123,
3853,
16726,
2527,
2860,
1006,
12508,
1002,
23032,
1010,
1002,
2073,
1007,
1063,
2065,
1006,
999,
4064,
1006,
1002,
2073,
1031,
1005,
5300,
1005,
1033,
1007,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
10236,
1006,
1002,
2073,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
php-ai/php-ml | src/Helper/Optimizer/StochasticGD.php | StochasticGD.runOptimization | public function runOptimization(array $samples, array $targets, Closure $gradientCb): array
{
$this->samples = $samples;
$this->targets = $targets;
$this->gradientCb = $gradientCb;
$currIter = 0;
$bestTheta = null;
$bestScore = 0.0;
$this->costValues = [];
... | php | public function runOptimization(array $samples, array $targets, Closure $gradientCb): array
{
$this->samples = $samples;
$this->targets = $targets;
$this->gradientCb = $gradientCb;
$currIter = 0;
$bestTheta = null;
$bestScore = 0.0;
$this->costValues = [];
... | [
"public",
"function",
"runOptimization",
"(",
"array",
"$",
"samples",
",",
"array",
"$",
"targets",
",",
"Closure",
"$",
"gradientCb",
")",
":",
"array",
"{",
"$",
"this",
"->",
"samples",
"=",
"$",
"samples",
";",
"$",
"this",
"->",
"targets",
"=",
"... | Optimization procedure finds the unknow variables for the equation A.ϴ = y
for the given samples (A) and targets (y).<br>
The cost function to minimize and the gradient of the function are to be
handled by the callback function provided as the third parameter of the method. | [
"Optimization",
"procedure",
"finds",
"the",
"unknow",
"variables",
"for",
"the",
"equation",
"A",
".",
"ϴ",
"=",
"y",
"for",
"the",
"given",
"samples",
"(",
"A",
")",
"and",
"targets",
"(",
"y",
")",
".",
"<br",
">"
] | f6aa1a59b0525b8fca3d2786d661ab3e70904016 | https://github.com/php-ai/php-ml/blob/f6aa1a59b0525b8fca3d2786d661ab3e70904016/src/Helper/Optimizer/StochasticGD.php#L160-L198 | train | Runs the optimization algorithm. | [
30522,
2270,
3853,
2448,
7361,
3775,
4328,
9276,
1006,
9140,
1002,
8168,
1010,
9140,
1002,
7889,
1010,
8503,
1002,
17978,
27421,
1007,
1024,
9140,
1063,
1002,
2023,
1011,
1028,
8168,
1027,
1002,
8168,
1025,
1002,
2023,
1011,
1028,
7889,
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/Css/Style.php | Style.get_outline_color | function get_outline_color()
{
if ($this->_props["outline_color"] === "") {
//see __set and __get, on all assignments clear cache!
$this->_prop_cache["outline_color"] = null;
$this->_props["outline_color"] = $this->__get("color");
}
return $this->munge_co... | php | function get_outline_color()
{
if ($this->_props["outline_color"] === "") {
//see __set and __get, on all assignments clear cache!
$this->_prop_cache["outline_color"] = null;
$this->_props["outline_color"] = $this->__get("color");
}
return $this->munge_co... | [
"function",
"get_outline_color",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_props",
"[",
"\"outline_color\"",
"]",
"===",
"\"\"",
")",
"{",
"//see __set and __get, on all assignments clear cache!",
"$",
"this",
"->",
"_prop_cache",
"[",
"\"outline_color\"",
"]",... | Returns the outline color as an array
See {@link Style::get_color()}
@link http://www.w3.org/TR/CSS21/box.html#border-color-properties
@return array | [
"Returns",
"the",
"outline",
"color",
"as",
"an",
"array"
] | 75f13c700009be21a1965dc2c5b68a8708c22ba2 | https://github.com/dompdf/dompdf/blob/75f13c700009be21a1965dc2c5b68a8708c22ba2/src/Css/Style.php#L1524-L1533 | train | get outline color | [
30522,
3853,
2131,
1035,
12685,
1035,
3609,
1006,
1007,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
1035,
24387,
1031,
1000,
12685,
1035,
3609,
1000,
1033,
1027,
1027,
1027,
1000,
1000,
1007,
1063,
1013,
1013,
2156,
1035,
1035,
2275,
1998,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Templating/Helper/SlotsHelper.php | SlotsHelper.stop | public function stop()
{
if (!$this->openSlots) {
throw new \LogicException('No slot started.');
}
$name = array_pop($this->openSlots);
$this->slots[$name] = ob_get_clean();
} | php | public function stop()
{
if (!$this->openSlots) {
throw new \LogicException('No slot started.');
}
$name = array_pop($this->openSlots);
$this->slots[$name] = ob_get_clean();
} | [
"public",
"function",
"stop",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"openSlots",
")",
"{",
"throw",
"new",
"\\",
"LogicException",
"(",
"'No slot started.'",
")",
";",
"}",
"$",
"name",
"=",
"array_pop",
"(",
"$",
"this",
"->",
"openSlots",... | Stops a slot.
@throws \LogicException if no slot has been started | [
"Stops",
"a",
"slot",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Templating/Helper/SlotsHelper.php#L52-L61 | train | Stop the current slot | [
30522,
2270,
3853,
2644,
1006,
1007,
1063,
2065,
1006,
999,
1002,
2023,
1011,
1028,
7480,
10994,
2015,
1007,
1063,
5466,
2047,
1032,
7961,
10288,
24422,
1006,
1005,
2053,
10453,
2318,
1012,
1005,
1007,
1025,
1065,
1002,
2171,
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... |
laravel/framework | src/Illuminate/Database/Connectors/SqlServerConnector.php | SqlServerConnector.connect | public function connect(array $config)
{
$options = $this->getOptions($config);
return $this->createConnection($this->getDsn($config), $config, $options);
} | php | public function connect(array $config)
{
$options = $this->getOptions($config);
return $this->createConnection($this->getDsn($config), $config, $options);
} | [
"public",
"function",
"connect",
"(",
"array",
"$",
"config",
")",
"{",
"$",
"options",
"=",
"$",
"this",
"->",
"getOptions",
"(",
"$",
"config",
")",
";",
"return",
"$",
"this",
"->",
"createConnection",
"(",
"$",
"this",
"->",
"getDsn",
"(",
"$",
"... | Establish a database connection.
@param array $config
@return \PDO | [
"Establish",
"a",
"database",
"connection",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Connectors/SqlServerConnector.php#L28-L33 | train | Connect to the database and return the connection object | [
30522,
2270,
3853,
7532,
1006,
9140,
1002,
9530,
8873,
2290,
1007,
1063,
1002,
7047,
1027,
1002,
2023,
1011,
1028,
2131,
7361,
9285,
1006,
1002,
9530,
8873,
2290,
1007,
1025,
2709,
1002,
2023,
1011,
1028,
3443,
8663,
2638,
7542,
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... |
matomo-org/matomo | libs/Zend/Mail/Storage/Imap.php | Zend_Mail_Storage_Imap.removeFolder | public function removeFolder($name)
{
if ($name instanceof Zend_Mail_Storage_Folder) {
$name = $name->getGlobalName();
}
if (!$this->_protocol->delete($name)) {
/**
* @see Zend_Mail_Storage_Exception
*/
// require_once 'Zend/Mail... | php | public function removeFolder($name)
{
if ($name instanceof Zend_Mail_Storage_Folder) {
$name = $name->getGlobalName();
}
if (!$this->_protocol->delete($name)) {
/**
* @see Zend_Mail_Storage_Exception
*/
// require_once 'Zend/Mail... | [
"public",
"function",
"removeFolder",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"$",
"name",
"instanceof",
"Zend_Mail_Storage_Folder",
")",
"{",
"$",
"name",
"=",
"$",
"name",
"->",
"getGlobalName",
"(",
")",
";",
"}",
"if",
"(",
"!",
"$",
"this",
"->",
... | remove a folder
@param string|Zend_Mail_Storage_Folder $name name or instance of folder
@return null
@throws Zend_Mail_Storage_Exception | [
"remove",
"a",
"folder"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail/Storage/Imap.php#L521-L534 | train | Delete a folder | [
30522,
2270,
3853,
6366,
10371,
2121,
1006,
1002,
2171,
1007,
1063,
2065,
1006,
1002,
2171,
6013,
11253,
16729,
2094,
1035,
5653,
1035,
5527,
1035,
19622,
1007,
1063,
1002,
2171,
1027,
1002,
2171,
1011,
1028,
2131,
23296,
16429,
2389,
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... |
matomo-org/matomo | core/Archive.php | Archive.getArchiveIds | private function getArchiveIds($archiveNames)
{
$plugins = $this->getRequestedPlugins($archiveNames);
// figure out which archives haven't been processed (if an archive has been processed,
// then we have the archive IDs in $this->idarchives)
$doneFlags = array();
$archi... | php | private function getArchiveIds($archiveNames)
{
$plugins = $this->getRequestedPlugins($archiveNames);
// figure out which archives haven't been processed (if an archive has been processed,
// then we have the archive IDs in $this->idarchives)
$doneFlags = array();
$archi... | [
"private",
"function",
"getArchiveIds",
"(",
"$",
"archiveNames",
")",
"{",
"$",
"plugins",
"=",
"$",
"this",
"->",
"getRequestedPlugins",
"(",
"$",
"archiveNames",
")",
";",
"// figure out which archives haven't been processed (if an archive has been processed,",
"// then ... | Returns archive IDs for the sites, periods and archive names that are being
queried. This function will use the idarchive cache if it has the right data,
query archive tables for IDs w/o launching archiving, or launch archiving and
get the idarchive from ArchiveProcessor instances.
@param string $archiveNames
@return ... | [
"Returns",
"archive",
"IDs",
"for",
"the",
"sites",
"periods",
"and",
"archive",
"names",
"that",
"are",
"being",
"queried",
".",
"This",
"function",
"will",
"use",
"the",
"idarchive",
"cache",
"if",
"it",
"has",
"the",
"right",
"data",
"query",
"archive",
... | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Archive.php#L588-L629 | train | Returns archive IDs for all archives that have been processed | [
30522,
2797,
3853,
2131,
2906,
5428,
3726,
9821,
1006,
1002,
8756,
18442,
2015,
1007,
1063,
1002,
13354,
7076,
1027,
1002,
2023,
1011,
1028,
2131,
2890,
15500,
2098,
24759,
15916,
7076,
1006,
1002,
8756,
18442,
2015,
1007,
1025,
1013,
1013,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
overtrue/wechat | src/OfficialAccount/Broadcasting/Client.php | Client.sendImage | public function sendImage(string $mediaId, $reception = null, array $attributes = [])
{
return $this->sendMessage(new Image($mediaId), $reception, $attributes);
} | php | public function sendImage(string $mediaId, $reception = null, array $attributes = [])
{
return $this->sendMessage(new Image($mediaId), $reception, $attributes);
} | [
"public",
"function",
"sendImage",
"(",
"string",
"$",
"mediaId",
",",
"$",
"reception",
"=",
"null",
",",
"array",
"$",
"attributes",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"sendMessage",
"(",
"new",
"Image",
"(",
"$",
"mediaId",
")",
... | Send a image message.
@param mixed $mediaId
@param mixed $reception
@param array $attributes
@return \Psr\Http\Message\ResponseInterface|\EasyWeChat\Kernel\Support\Collection|array|object|string
@throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException
@throws \EasyWeChat\Kernel\Exceptions\RuntimeException | [
"Send",
"a",
"image",
"message",
"."
] | 120c72faaa93c270365bc75c73c362d5fd583209 | https://github.com/overtrue/wechat/blob/120c72faaa93c270365bc75c73c362d5fd583209/src/OfficialAccount/Broadcasting/Client.php#L180-L183 | train | Sends a image message to the user | [
30522,
2270,
3853,
4604,
9581,
3351,
1006,
5164,
1002,
2865,
3593,
1010,
1002,
7684,
1027,
19701,
1010,
9140,
1002,
12332,
1027,
1031,
1033,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
4604,
7834,
3736,
3351,
1006,
2047,
3746,
1006,
1002,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
PHPMailer/PHPMailer | src/PHPMailer.php | PHPMailer.getSentMIMEMessage | public function getSentMIMEMessage()
{
return rtrim($this->MIMEHeader . $this->mailHeader, "\n\r") . static::$LE . static::$LE . $this->MIMEBody;
} | php | public function getSentMIMEMessage()
{
return rtrim($this->MIMEHeader . $this->mailHeader, "\n\r") . static::$LE . static::$LE . $this->MIMEBody;
} | [
"public",
"function",
"getSentMIMEMessage",
"(",
")",
"{",
"return",
"rtrim",
"(",
"$",
"this",
"->",
"MIMEHeader",
".",
"$",
"this",
"->",
"mailHeader",
",",
"\"\\n\\r\"",
")",
".",
"static",
"::",
"$",
"LE",
".",
"static",
"::",
"$",
"LE",
".",
"$",
... | Returns the whole MIME message.
Includes complete headers and body.
Only valid post preSend().
@see PHPMailer::preSend()
@return string | [
"Returns",
"the",
"whole",
"MIME",
"message",
".",
"Includes",
"complete",
"headers",
"and",
"body",
".",
"Only",
"valid",
"post",
"preSend",
"()",
"."
] | 3d7132341659a8a201adbc3ba11b1e202ee2857c | https://github.com/PHPMailer/PHPMailer/blob/3d7132341659a8a201adbc3ba11b1e202ee2857c/src/PHPMailer.php#L2475-L2478 | train | Get the message body | [
30522,
2270,
3853,
4152,
4765,
4328,
4168,
7834,
3736,
3351,
1006,
1007,
1063,
2709,
19387,
20026,
1006,
1002,
2023,
1011,
1028,
2771,
4168,
4974,
2121,
1012,
1002,
2023,
1011,
1028,
5653,
4974,
2121,
1010,
1000,
1032,
1050,
1032,
1054,
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/OptionsResolver/OptionsResolver.php | OptionsResolver.setDefault | public function setDefault($option, $value)
{
// Setting is not possible once resolving starts, because then lazy
// options could manipulate the state of the object, leading to
// inconsistent results.
if ($this->locked) {
throw new AccessException('Default values cannot... | php | public function setDefault($option, $value)
{
// Setting is not possible once resolving starts, because then lazy
// options could manipulate the state of the object, leading to
// inconsistent results.
if ($this->locked) {
throw new AccessException('Default values cannot... | [
"public",
"function",
"setDefault",
"(",
"$",
"option",
",",
"$",
"value",
")",
"{",
"// Setting is not possible once resolving starts, because then lazy",
"// options could manipulate the state of the object, leading to",
"// inconsistent results.",
"if",
"(",
"$",
"this",
"->",... | Sets the default value of a given option.
If the default value should be set based on other options, you can pass
a closure with the following signature:
function (Options $options) {
// ...
}
The closure will be evaluated when {@link resolve()} is called. The
closure has access to the resolved values of other optio... | [
"Sets",
"the",
"default",
"value",
"of",
"a",
"given",
"option",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/OptionsResolver/OptionsResolver.php#L166-L230 | train | Sets the default value of the option. | [
30522,
2270,
3853,
2275,
3207,
7011,
11314,
1006,
1002,
5724,
1010,
1002,
3643,
1007,
1063,
1013,
1013,
4292,
2003,
2025,
2825,
2320,
29304,
4627,
1010,
2138,
2059,
13971,
1013,
1013,
7047,
2071,
17708,
1996,
2110,
1997,
1996,
4874,
1010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/VarDumper/Dumper/CliDumper.php | CliDumper.isWindowsTrueColor | private function isWindowsTrueColor()
{
$result = 183 <= getenv('ANSICON_VER')
|| 'ON' === getenv('ConEmuANSI')
|| 'xterm' === getenv('TERM')
|| 'Hyper' === getenv('TERM_PROGRAM');
if (!$result && \PHP_VERSION_ID >= 70200) {
$version = sprintf(
... | php | private function isWindowsTrueColor()
{
$result = 183 <= getenv('ANSICON_VER')
|| 'ON' === getenv('ConEmuANSI')
|| 'xterm' === getenv('TERM')
|| 'Hyper' === getenv('TERM_PROGRAM');
if (!$result && \PHP_VERSION_ID >= 70200) {
$version = sprintf(
... | [
"private",
"function",
"isWindowsTrueColor",
"(",
")",
"{",
"$",
"result",
"=",
"183",
"<=",
"getenv",
"(",
"'ANSICON_VER'",
")",
"||",
"'ON'",
"===",
"getenv",
"(",
"'ConEmuANSI'",
")",
"||",
"'xterm'",
"===",
"getenv",
"(",
"'TERM'",
")",
"||",
"'Hyper'"... | Returns true if the Windows terminal supports true color.
Note that this does not check an output stream, but relies on environment
variables from known implementations, or a PHP and Windows version that
supports true color.
@return bool | [
"Returns",
"true",
"if",
"the",
"Windows",
"terminal",
"supports",
"true",
"color",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/VarDumper/Dumper/CliDumper.php#L615-L633 | train | Returns true if the current environment is on windows true color | [
30522,
2797,
3853,
2003,
11101,
15568,
16344,
5657,
18717,
1006,
1007,
1063,
1002,
2765,
1027,
18677,
1026,
1027,
2131,
2368,
2615,
1006,
1005,
2019,
19570,
2239,
1035,
2310,
2099,
1005,
1007,
1064,
1064,
1005,
2006,
1005,
1027,
1027,
1027,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/DependencyInjection/ContainerBuilder.php | ContainerBuilder.has | public function has($id)
{
$id = (string) $id;
return isset($this->definitions[$id]) || isset($this->aliasDefinitions[$id]) || parent::has($id);
} | php | public function has($id)
{
$id = (string) $id;
return isset($this->definitions[$id]) || isset($this->aliasDefinitions[$id]) || parent::has($id);
} | [
"public",
"function",
"has",
"(",
"$",
"id",
")",
"{",
"$",
"id",
"=",
"(",
"string",
")",
"$",
"id",
";",
"return",
"isset",
"(",
"$",
"this",
"->",
"definitions",
"[",
"$",
"id",
"]",
")",
"||",
"isset",
"(",
"$",
"this",
"->",
"aliasDefinition... | Returns true if the given service is defined.
@param string $id The service identifier
@return bool true if the service is defined, false otherwise | [
"Returns",
"true",
"if",
"the",
"given",
"service",
"is",
"defined",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/DependencyInjection/ContainerBuilder.php#L530-L535 | train | Has the definition or alias definition? | [
30522,
2270,
3853,
2038,
1006,
1002,
8909,
1007,
1063,
1002,
8909,
1027,
1006,
5164,
1007,
1002,
8909,
1025,
2709,
26354,
3388,
1006,
1002,
2023,
1011,
1028,
15182,
1031,
1002,
8909,
1033,
1007,
1064,
1064,
26354,
3388,
1006,
1002,
2023,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/EventDispatcher/EventDispatcher.php | EventDispatcher.callListeners | protected function callListeners(iterable $listeners, string $eventName, $event)
{
if ($event instanceof Event) {
$this->doDispatch($listeners, $eventName, $event);
return;
}
$stoppable = $event instanceof ContractsEvent || $event instanceof StoppableEventInterface;... | php | protected function callListeners(iterable $listeners, string $eventName, $event)
{
if ($event instanceof Event) {
$this->doDispatch($listeners, $eventName, $event);
return;
}
$stoppable = $event instanceof ContractsEvent || $event instanceof StoppableEventInterface;... | [
"protected",
"function",
"callListeners",
"(",
"iterable",
"$",
"listeners",
",",
"string",
"$",
"eventName",
",",
"$",
"event",
")",
"{",
"if",
"(",
"$",
"event",
"instanceof",
"Event",
")",
"{",
"$",
"this",
"->",
"doDispatch",
"(",
"$",
"listeners",
"... | Triggers the listeners of an event.
This method can be overridden to add functionality that is executed
for each listener.
@param callable[] $listeners The event listeners
@param string $eventName The name of the event to dispatch
@param object $event The event object to pass to the event handlers/listene... | [
"Triggers",
"the",
"listeners",
"of",
"an",
"event",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/EventDispatcher/EventDispatcher.php#L232-L249 | train | Calls all listeners for the given event | [
30522,
5123,
3853,
2655,
9863,
24454,
2015,
1006,
2009,
6906,
3468,
1002,
13810,
1010,
5164,
1002,
2724,
18442,
1010,
1002,
2724,
1007,
1063,
2065,
1006,
1002,
2724,
6013,
11253,
2724,
1007,
1063,
1002,
2023,
1011,
1028,
26489,
2483,
4502,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Transport/Sender/SendersLocator.php | SendersLocator.getSenders | public function getSenders(Envelope $envelope, ?bool &$handle = false): iterable
{
$handle = false;
$sender = null;
$seen = [];
foreach (HandlersLocator::listTypes($envelope) as $type) {
// the old way of looking up senders
if ($this->useLegacyLookup) {
... | php | public function getSenders(Envelope $envelope, ?bool &$handle = false): iterable
{
$handle = false;
$sender = null;
$seen = [];
foreach (HandlersLocator::listTypes($envelope) as $type) {
// the old way of looking up senders
if ($this->useLegacyLookup) {
... | [
"public",
"function",
"getSenders",
"(",
"Envelope",
"$",
"envelope",
",",
"?",
"bool",
"&",
"$",
"handle",
"=",
"false",
")",
":",
"iterable",
"{",
"$",
"handle",
"=",
"false",
";",
"$",
"sender",
"=",
"null",
";",
"$",
"seen",
"=",
"[",
"]",
";",... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Messenger/Transport/Sender/SendersLocator.php#L59-L95 | train | Returns all senders for the given envelope | [
30522,
2270,
3853,
4152,
10497,
2545,
1006,
11255,
1002,
11255,
1010,
1029,
22017,
2140,
1004,
1002,
5047,
1027,
6270,
1007,
1024,
2009,
6906,
3468,
1063,
1002,
5047,
1027,
6270,
1025,
1002,
4604,
2121,
1027,
19701,
1025,
1002,
2464,
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... |
overtrue/wechat | src/OfficialAccount/CustomerService/Client.php | Client.create | public function create(string $account, string $nickname)
{
$params = [
'kf_account' => $account,
'nickname' => $nickname,
];
return $this->httpPostJson('customservice/kfaccount/add', $params);
} | php | public function create(string $account, string $nickname)
{
$params = [
'kf_account' => $account,
'nickname' => $nickname,
];
return $this->httpPostJson('customservice/kfaccount/add', $params);
} | [
"public",
"function",
"create",
"(",
"string",
"$",
"account",
",",
"string",
"$",
"nickname",
")",
"{",
"$",
"params",
"=",
"[",
"'kf_account'",
"=>",
"$",
"account",
",",
"'nickname'",
"=>",
"$",
"nickname",
",",
"]",
";",
"return",
"$",
"this",
"->"... | Create a staff.
@param string $account
@param string $nickname
@return mixed | [
"Create",
"a",
"staff",
"."
] | 120c72faaa93c270365bc75c73c362d5fd583209 | https://github.com/overtrue/wechat/blob/120c72faaa93c270365bc75c73c362d5fd583209/src/OfficialAccount/CustomerService/Client.php#L51-L59 | train | Create a new user | [
30522,
2270,
3853,
3443,
1006,
5164,
1002,
4070,
1010,
5164,
1002,
8367,
1007,
1063,
1002,
11498,
5244,
1027,
1031,
1005,
1047,
2546,
1035,
4070,
1005,
1027,
1028,
1002,
4070,
1010,
1005,
8367,
1005,
1027,
1028,
1002,
8367,
1010,
1033,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Cache/Adapter/FilesystemTagAwareAdapter.php | FilesystemTagAwareAdapter.doInvalidate | protected function doInvalidate(array $tagIds): bool
{
foreach ($tagIds as $tagId) {
$tagsFolder = $this->getTagFolder($tagId);
if (!file_exists($tagsFolder)) {
continue;
}
foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterato... | php | protected function doInvalidate(array $tagIds): bool
{
foreach ($tagIds as $tagId) {
$tagsFolder = $this->getTagFolder($tagId);
if (!file_exists($tagsFolder)) {
continue;
}
foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterato... | [
"protected",
"function",
"doInvalidate",
"(",
"array",
"$",
"tagIds",
")",
":",
"bool",
"{",
"foreach",
"(",
"$",
"tagIds",
"as",
"$",
"tagId",
")",
"{",
"$",
"tagsFolder",
"=",
"$",
"this",
"->",
"getTagFolder",
"(",
"$",
"tagId",
")",
";",
"if",
"(... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Cache/Adapter/FilesystemTagAwareAdapter.php#L115-L138 | train | Invalidate all tags | [
30522,
5123,
3853,
24341,
10175,
8524,
2618,
1006,
9140,
1002,
6415,
9821,
1007,
1024,
22017,
2140,
1063,
18921,
6776,
1006,
1002,
6415,
9821,
2004,
1002,
6415,
3593,
1007,
1063,
1002,
22073,
10371,
2121,
1027,
1002,
2023,
1011,
1028,
2131,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | core/Archive/ArchiveInvalidator.php | ArchiveInvalidator.getDatesByYearMonthAndPeriodType | private function getDatesByYearMonthAndPeriodType($dates)
{
$result = array();
foreach ($dates as $date) {
$yearMonth = ArchiveTableCreator::getTableMonthFromDate($date);
$result[$yearMonth][null][] = $date->toString();
// since we're removing all periods, we mus... | php | private function getDatesByYearMonthAndPeriodType($dates)
{
$result = array();
foreach ($dates as $date) {
$yearMonth = ArchiveTableCreator::getTableMonthFromDate($date);
$result[$yearMonth][null][] = $date->toString();
// since we're removing all periods, we mus... | [
"private",
"function",
"getDatesByYearMonthAndPeriodType",
"(",
"$",
"dates",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"dates",
"as",
"$",
"date",
")",
"{",
"$",
"yearMonth",
"=",
"ArchiveTableCreator",
"::",
"getTableMonthF... | Called when deleting all periods.
@param Date[] $dates
@return string[][][] | [
"Called",
"when",
"deleting",
"all",
"periods",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Archive/ArchiveInvalidator.php#L278-L291 | train | Returns array of dates by yearMonth and period type | [
30522,
2797,
3853,
2131,
27122,
3762,
29100,
9629,
11774,
4842,
3695,
11927,
18863,
1006,
1002,
5246,
1007,
1063,
1002,
2765,
1027,
9140,
1006,
1007,
1025,
18921,
6776,
1006,
1002,
5246,
2004,
1002,
3058,
1007,
1063,
1002,
2095,
9629,
2232,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Bootstrap/LoadEnvironmentVariables.php | LoadEnvironmentVariables.checkForSpecificEnvironmentFile | protected function checkForSpecificEnvironmentFile($app)
{
if ($app->runningInConsole() && ($input = new ArgvInput)->hasParameterOption('--env')) {
if ($this->setEnvironmentFilePath(
$app, $app->environmentFile().'.'.$input->getParameterOption('--env')
)) {
... | php | protected function checkForSpecificEnvironmentFile($app)
{
if ($app->runningInConsole() && ($input = new ArgvInput)->hasParameterOption('--env')) {
if ($this->setEnvironmentFilePath(
$app, $app->environmentFile().'.'.$input->getParameterOption('--env')
)) {
... | [
"protected",
"function",
"checkForSpecificEnvironmentFile",
"(",
"$",
"app",
")",
"{",
"if",
"(",
"$",
"app",
"->",
"runningInConsole",
"(",
")",
"&&",
"(",
"$",
"input",
"=",
"new",
"ArgvInput",
")",
"->",
"hasParameterOption",
"(",
"'--env'",
")",
")",
"... | Detect if a custom environment file matching the APP_ENV exists.
@param \Illuminate\Contracts\Foundation\Application $app
@return void | [
"Detect",
"if",
"a",
"custom",
"environment",
"file",
"matching",
"the",
"APP_ENV",
"exists",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Foundation/Bootstrap/LoadEnvironmentVariables.php#L44-L61 | train | Check for specific environment file | [
30522,
5123,
3853,
4638,
29278,
13102,
8586,
23664,
2078,
21663,
2239,
3672,
8873,
2571,
1006,
1002,
10439,
1007,
1063,
2065,
1006,
1002,
10439,
1011,
1028,
2770,
2378,
8663,
19454,
2063,
1006,
1007,
1004,
1004,
1006,
1002,
7953,
1027,
2047... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/ConnectionFactory.php | ConnectionFactory.createPdoResolver | protected function createPdoResolver(array $config)
{
return array_key_exists('host', $config)
? $this->createPdoResolverWithHosts($config)
: $this->createPdoResolverWithoutHosts($config);
} | php | protected function createPdoResolver(array $config)
{
return array_key_exists('host', $config)
? $this->createPdoResolverWithHosts($config)
: $this->createPdoResolverWithoutHosts($config);
} | [
"protected",
"function",
"createPdoResolver",
"(",
"array",
"$",
"config",
")",
"{",
"return",
"array_key_exists",
"(",
"'host'",
",",
"$",
"config",
")",
"?",
"$",
"this",
"->",
"createPdoResolverWithHosts",
"(",
"$",
"config",
")",
":",
"$",
"this",
"->",
... | Create a new Closure that resolves to a PDO instance.
@param array $config
@return \Closure | [
"Create",
"a",
"new",
"Closure",
"that",
"resolves",
"to",
"a",
"PDO",
"instance",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Connectors/ConnectionFactory.php#L162-L167 | train | Create a PDO Resolver for the current connection | [
30522,
5123,
3853,
3443,
17299,
16610,
4747,
6299,
1006,
9140,
1002,
9530,
8873,
2290,
1007,
1063,
2709,
9140,
1035,
3145,
1035,
6526,
1006,
1005,
3677,
1005,
1010,
1002,
9530,
8873,
2290,
1007,
1029,
1002,
2023,
1011,
1028,
3443,
17299,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Writer/Yaml.php | Zend_Config_Writer_Yaml.render | public function render()
{
$data = $this->_config->toArray();
$sectionName = $this->_config->getSectionName();
$extends = $this->_config->getExtends();
if (is_string($sectionName)) {
$data = array($sectionName => $data);
}
foreach ($extends as... | php | public function render()
{
$data = $this->_config->toArray();
$sectionName = $this->_config->getSectionName();
$extends = $this->_config->getExtends();
if (is_string($sectionName)) {
$data = array($sectionName => $data);
}
foreach ($extends as... | [
"public",
"function",
"render",
"(",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"_config",
"->",
"toArray",
"(",
")",
";",
"$",
"sectionName",
"=",
"$",
"this",
"->",
"_config",
"->",
"getSectionName",
"(",
")",
";",
"$",
"extends",
"=",
"$",
"... | Render a Zend_Config into a YAML config string.
@since 1.10
@return string | [
"Render",
"a",
"Zend_Config",
"into",
"a",
"YAML",
"config",
"string",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Config/Writer/Yaml.php#L80-L106 | train | Render the current configuration | [
30522,
2270,
3853,
17552,
1006,
1007,
1063,
1002,
2951,
1027,
1002,
2023,
1011,
1028,
1035,
9530,
8873,
2290,
1011,
1028,
2000,
2906,
9447,
1006,
1007,
1025,
1002,
2930,
18442,
1027,
1002,
2023,
1011,
1028,
1035,
9530,
8873,
2290,
1011,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
spatie/laravel-permission | src/Traits/HasPermissions.php | HasPermissions.givePermissionTo | public function givePermissionTo(...$permissions)
{
$permissions = collect($permissions)
->flatten()
->map(function ($permission) {
if (empty($permission)) {
return false;
}
return $this->getStoredPermission($permis... | php | public function givePermissionTo(...$permissions)
{
$permissions = collect($permissions)
->flatten()
->map(function ($permission) {
if (empty($permission)) {
return false;
}
return $this->getStoredPermission($permis... | [
"public",
"function",
"givePermissionTo",
"(",
"...",
"$",
"permissions",
")",
"{",
"$",
"permissions",
"=",
"collect",
"(",
"$",
"permissions",
")",
"->",
"flatten",
"(",
")",
"->",
"map",
"(",
"function",
"(",
"$",
"permission",
")",
"{",
"if",
"(",
... | Grant the given permission(s) to a role.
@param string|array|\Spatie\Permission\Contracts\Permission|\Illuminate\Support\Collection $permissions
@return $this | [
"Grant",
"the",
"given",
"permission",
"(",
"s",
")",
"to",
"a",
"role",
"."
] | 81dbe9d372d70c255b66a2727a235076509f8d45 | https://github.com/spatie/laravel-permission/blob/81dbe9d372d70c255b66a2727a235076509f8d45/src/Traits/HasPermissions.php#L294-L338 | train | Give a permission to the model | [
30522,
2270,
3853,
2507,
4842,
25481,
3406,
1006,
1012,
1012,
1012,
1002,
6656,
2015,
1007,
1063,
1002,
6656,
2015,
1027,
8145,
1006,
1002,
6656,
2015,
1007,
1011,
1028,
4257,
6528,
1006,
1007,
1011,
1028,
4949,
1006,
3853,
1006,
1002,
66... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | plugins/LanguagesManager/TranslationWriter/Filter/ByParameterCount.php | ByParameterCount.filter | public function filter($translations)
{
$cleanedTranslations = array();
foreach ($translations as $pluginName => $pluginTranslations) {
foreach ($pluginTranslations as $key => $translation) {
if (isset($this->baseTranslations[$pluginName][$key])) {
... | php | public function filter($translations)
{
$cleanedTranslations = array();
foreach ($translations as $pluginName => $pluginTranslations) {
foreach ($pluginTranslations as $key => $translation) {
if (isset($this->baseTranslations[$pluginName][$key])) {
... | [
"public",
"function",
"filter",
"(",
"$",
"translations",
")",
"{",
"$",
"cleanedTranslations",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"translations",
"as",
"$",
"pluginName",
"=>",
"$",
"pluginTranslations",
")",
"{",
"foreach",
"(",
"$",
"plug... | Removes all translations where the placeholder parameter count differs to base translation
@param array $translations
@return array filtered translations | [
"Removes",
"all",
"translations",
"where",
"the",
"placeholder",
"parameter",
"count",
"differs",
"to",
"base",
"translation"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/LanguagesManager/TranslationWriter/Filter/ByParameterCount.php#L33-L63 | train | Filter translations array | [
30522,
2270,
3853,
11307,
1006,
1002,
11913,
1007,
1063,
1002,
12176,
6494,
3619,
13490,
2015,
1027,
9140,
1006,
1007,
1025,
18921,
6776,
1006,
1002,
11913,
2004,
1002,
13354,
23111,
14074,
1027,
1028,
1002,
13354,
18447,
5521,
14540,
10708,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/ExpressionLanguage/ExpressionLanguage.php | ExpressionLanguage.parse | public function parse($expression, $names)
{
if ($expression instanceof ParsedExpression) {
return $expression;
}
asort($names);
$cacheKeyItems = [];
foreach ($names as $nameKey => $name) {
$cacheKeyItems[] = \is_int($nameKey) ? $name : $nameKey.':'.... | php | public function parse($expression, $names)
{
if ($expression instanceof ParsedExpression) {
return $expression;
}
asort($names);
$cacheKeyItems = [];
foreach ($names as $nameKey => $name) {
$cacheKeyItems[] = \is_int($nameKey) ? $name : $nameKey.':'.... | [
"public",
"function",
"parse",
"(",
"$",
"expression",
",",
"$",
"names",
")",
"{",
"if",
"(",
"$",
"expression",
"instanceof",
"ParsedExpression",
")",
"{",
"return",
"$",
"expression",
";",
"}",
"asort",
"(",
"$",
"names",
")",
";",
"$",
"cacheKeyItems... | Parses an expression.
@param Expression|string $expression The expression to parse
@param array $names An array of valid names
@return ParsedExpression A ParsedExpression instance | [
"Parses",
"an",
"expression",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/ExpressionLanguage/ExpressionLanguage.php#L78-L102 | train | Parse an expression | [
30522,
2270,
3853,
11968,
3366,
1006,
1002,
3670,
1010,
1002,
3415,
1007,
1063,
2065,
1006,
1002,
3670,
6013,
11253,
11968,
6924,
10288,
20110,
3258,
1007,
1063,
2709,
1002,
3670,
1025,
1065,
2004,
11589,
1006,
1002,
3415,
1007,
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/Common/Helpers/Excerpts.php | Excerpts.getExcerptFromHtml | public static function getExcerptFromHtml($html, $tag)
{
$doc = new \DOMDocument();
$doc->loadHTML($html);
$images = $doc->getElementsByTagName($tag);
$excerpt = null;
foreach ($images as $image) {
$attributes = [];
foreach ($image->attributes as $nam... | php | public static function getExcerptFromHtml($html, $tag)
{
$doc = new \DOMDocument();
$doc->loadHTML($html);
$images = $doc->getElementsByTagName($tag);
$excerpt = null;
foreach ($images as $image) {
$attributes = [];
foreach ($image->attributes as $nam... | [
"public",
"static",
"function",
"getExcerptFromHtml",
"(",
"$",
"html",
",",
"$",
"tag",
")",
"{",
"$",
"doc",
"=",
"new",
"\\",
"DOMDocument",
"(",
")",
";",
"$",
"doc",
"->",
"loadHTML",
"(",
"$",
"html",
")",
";",
"$",
"images",
"=",
"$",
"doc",... | Get an Excerpt array from a chunk of HTML
@param string $html Chunk of HTML
@param string $tag A tag, for example `img`
@return array|null returns nested array excerpt | [
"Get",
"an",
"Excerpt",
"array",
"from",
"a",
"chunk",
"of",
"HTML"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Helpers/Excerpts.php#L57-L78 | train | Get Excerpt from HTML | [
30522,
2270,
10763,
3853,
2131,
10288,
17119,
13876,
19699,
5358,
11039,
19968,
1006,
1002,
16129,
1010,
1002,
6415,
1007,
1063,
1002,
9986,
1027,
2047,
1032,
14383,
3527,
24894,
4765,
1006,
1007,
1025,
1002,
9986,
1011,
1028,
7170,
11039,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Client.php | Client.createLandingPage | public function createLandingPage($banner, $pageTitle, $canShare, $scene, $cardList)
{
$params = [
'banner' => $banner,
'page_title' => $pageTitle,
'can_share' => $canShare,
'scene' => $scene,
'card_list' => $cardList,
];
return $t... | php | public function createLandingPage($banner, $pageTitle, $canShare, $scene, $cardList)
{
$params = [
'banner' => $banner,
'page_title' => $pageTitle,
'can_share' => $canShare,
'scene' => $scene,
'card_list' => $cardList,
];
return $t... | [
"public",
"function",
"createLandingPage",
"(",
"$",
"banner",
",",
"$",
"pageTitle",
",",
"$",
"canShare",
",",
"$",
"scene",
",",
"$",
"cardList",
")",
"{",
"$",
"params",
"=",
"[",
"'banner'",
"=>",
"$",
"banner",
",",
"'page_title'",
"=>",
"$",
"pa... | 创建货架接口.
@param string $banner
@param string $pageTitle
@param bool $canShare
@param string $scene [SCENE_NEAR_BY 附近,SCENE_MENU 自定义菜单,SCENE_QRCODE 二维码,SCENE_ARTICLE 公众号文章,
SCENE_H5 h5页面,SCENE_IVR 自动回复,SCENE_CARD_CUSTOM_CELL 卡券自定义cell]
@param array $cardList
@return mixed | [
"创建货架接口",
"."
] | 120c72faaa93c270365bc75c73c362d5fd583209 | https://github.com/overtrue/wechat/blob/120c72faaa93c270365bc75c73c362d5fd583209/src/OfficialAccount/Card/Client.php#L216-L227 | train | Create Landing Page | [
30522,
2270,
3853,
3443,
3122,
2075,
13704,
1006,
1002,
9484,
1010,
1002,
3931,
3775,
9286,
1010,
1002,
18484,
8167,
2063,
1010,
1002,
3496,
1010,
1002,
4003,
9863,
1007,
1063,
1002,
11498,
5244,
1027,
1031,
1005,
9484,
1005,
1027,
1028,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Security/Core/Authentication/Provider/LdapBindAuthenticationProvider.php | LdapBindAuthenticationProvider.checkAuthentication | protected function checkAuthentication(UserInterface $user, UsernamePasswordToken $token)
{
$username = $token->getUsername();
$password = $token->getCredentials();
if ('' === (string) $password) {
throw new BadCredentialsException('The presented password must not be empty.');
... | php | protected function checkAuthentication(UserInterface $user, UsernamePasswordToken $token)
{
$username = $token->getUsername();
$password = $token->getCredentials();
if ('' === (string) $password) {
throw new BadCredentialsException('The presented password must not be empty.');
... | [
"protected",
"function",
"checkAuthentication",
"(",
"UserInterface",
"$",
"user",
",",
"UsernamePasswordToken",
"$",
"token",
")",
"{",
"$",
"username",
"=",
"$",
"token",
"->",
"getUsername",
"(",
")",
";",
"$",
"password",
"=",
"$",
"token",
"->",
"getCre... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Security/Core/Authentication/Provider/LdapBindAuthenticationProvider.php#L72-L100 | train | Checks if the user is authenticated. | [
30522,
5123,
3853,
4638,
4887,
10760,
16778,
10719,
1006,
5310,
18447,
2121,
12172,
1002,
5310,
1010,
5310,
18442,
15194,
18351,
18715,
2368,
1002,
19204,
1007,
1063,
1002,
5310,
18442,
1027,
1002,
19204,
1011,
1028,
2131,
20330,
18442,
1006,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laravel/framework | src/Illuminate/Database/Eloquent/Relations/Relation.php | Relation.buildMorphMapFromModels | protected static function buildMorphMapFromModels(array $models = null)
{
if (is_null($models) || Arr::isAssoc($models)) {
return $models;
}
return array_combine(array_map(function ($model) {
return (new $model)->getTable();
}, $models), $models);
} | php | protected static function buildMorphMapFromModels(array $models = null)
{
if (is_null($models) || Arr::isAssoc($models)) {
return $models;
}
return array_combine(array_map(function ($model) {
return (new $model)->getTable();
}, $models), $models);
} | [
"protected",
"static",
"function",
"buildMorphMapFromModels",
"(",
"array",
"$",
"models",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"models",
")",
"||",
"Arr",
"::",
"isAssoc",
"(",
"$",
"models",
")",
")",
"{",
"return",
"$",
"models",
"... | Builds a table-keyed array from model class names.
@param string[]|null $models
@return array|null | [
"Builds",
"a",
"table",
"-",
"keyed",
"array",
"from",
"model",
"class",
"names",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Relations/Relation.php#L351-L360 | train | Build a morph map from the models array | [
30522,
5123,
10763,
3853,
3857,
5302,
14536,
22444,
14376,
21716,
5302,
9247,
2015,
1006,
9140,
1002,
4275,
1027,
19701,
1007,
1063,
2065,
1006,
2003,
1035,
19701,
1006,
1002,
4275,
1007,
1064,
1064,
12098,
2099,
1024,
1024,
18061,
24137,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/Zend/Cache/Backend/File.php | Zend_Cache_Backend_File._path | protected function _path($id, $parts = false)
{
$partsArray = array();
$root = $this->_options['cache_dir'];
$prefix = $this->_options['file_name_prefix'];
if ($this->_options['hashed_directory_level']>0) {
$hash = hash('adler32', $id);
for ($i=0 ; $i < $this-... | php | protected function _path($id, $parts = false)
{
$partsArray = array();
$root = $this->_options['cache_dir'];
$prefix = $this->_options['file_name_prefix'];
if ($this->_options['hashed_directory_level']>0) {
$hash = hash('adler32', $id);
for ($i=0 ; $i < $this-... | [
"protected",
"function",
"_path",
"(",
"$",
"id",
",",
"$",
"parts",
"=",
"false",
")",
"{",
"$",
"partsArray",
"=",
"array",
"(",
")",
";",
"$",
"root",
"=",
"$",
"this",
"->",
"_options",
"[",
"'cache_dir'",
"]",
";",
"$",
"prefix",
"=",
"$",
"... | Return the complete directory path of a filename (including hashedDirectoryStructure)
@param string $id Cache id
@param boolean $parts if true, returns array of directory parts instead of single string
@return string Complete directory path | [
"Return",
"the",
"complete",
"directory",
"path",
"of",
"a",
"filename",
"(",
"including",
"hashedDirectoryStructure",
")"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache/Backend/File.php#L889-L906 | train | Return the path to the cache file | [
30522,
5123,
3853,
1035,
4130,
1006,
1002,
8909,
1010,
1002,
3033,
1027,
6270,
1007,
1063,
1002,
3033,
2906,
9447,
1027,
9140,
1006,
1007,
1025,
1002,
7117,
1027,
1002,
2023,
1011,
1028,
1035,
7047,
1031,
1005,
17053,
1035,
16101,
1005,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
symfony/symfony | src/Symfony/Component/Templating/Helper/SlotsHelper.php | SlotsHelper.start | public function start($name)
{
if (\in_array($name, $this->openSlots)) {
throw new \InvalidArgumentException(sprintf('A slot named "%s" is already started.', $name));
}
$this->openSlots[] = $name;
$this->slots[$name] = '';
ob_start();
ob_implicit_flush(0... | php | public function start($name)
{
if (\in_array($name, $this->openSlots)) {
throw new \InvalidArgumentException(sprintf('A slot named "%s" is already started.', $name));
}
$this->openSlots[] = $name;
$this->slots[$name] = '';
ob_start();
ob_implicit_flush(0... | [
"public",
"function",
"start",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"\\",
"in_array",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"openSlots",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'A slot named \"%s\" is al... | Starts a new slot.
This method starts an output buffer that will be
closed when the stop() method is called.
@param string $name The slot name
@throws \InvalidArgumentException if a slot with the same name is already started | [
"Starts",
"a",
"new",
"slot",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Templating/Helper/SlotsHelper.php#L34-L45 | train | Start a new slot | [
30522,
2270,
3853,
2707,
1006,
1002,
2171,
1007,
1063,
2065,
1006,
1032,
1999,
1035,
9140,
1006,
1002,
2171,
1010,
1002,
2023,
1011,
1028,
7480,
10994,
2015,
1007,
1007,
1063,
5466,
2047,
1032,
19528,
2906,
22850,
15781,
2595,
24422,
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/HttpKernel/Fragment/InlineFragmentRenderer.php | InlineFragmentRenderer.render | public function render($uri, Request $request, array $options = [])
{
$reference = null;
if ($uri instanceof ControllerReference) {
$reference = $uri;
// Remove attributes from the generated URI because if not, the Symfony
// routing system will use them to popul... | php | public function render($uri, Request $request, array $options = [])
{
$reference = null;
if ($uri instanceof ControllerReference) {
$reference = $uri;
// Remove attributes from the generated URI because if not, the Symfony
// routing system will use them to popul... | [
"public",
"function",
"render",
"(",
"$",
"uri",
",",
"Request",
"$",
"request",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"reference",
"=",
"null",
";",
"if",
"(",
"$",
"uri",
"instanceof",
"ControllerReference",
")",
"{",
"$",
"re... | {@inheritdoc}
Additional available options:
* alt: an alternative URI to render in case of an error | [
"{",
"@inheritdoc",
"}"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpKernel/Fragment/InlineFragmentRenderer.php#L47-L107 | train | Renders the URI and returns the response. | [
30522,
2270,
3853,
17552,
1006,
1002,
24471,
2072,
1010,
5227,
1002,
5227,
1010,
9140,
1002,
7047,
1027,
1031,
1033,
1007,
1063,
1002,
4431,
1027,
19701,
1025,
2065,
1006,
1002,
24471,
2072,
6013,
11253,
11486,
2890,
25523,
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/HTML/QuickForm2/Controller/Page.php | HTML_QuickForm2_Controller_Page.setDefaultAction | public function setDefaultAction($actionName, $imageSrc = '')
{
// require_once 'HTML/QuickForm2/Controller/DefaultAction.php';
if (0 == count($this->form)) {
$image = $this->form->appendChild(
new HTML_QuickForm2_Controller_DefaultAction(
$this->getB... | php | public function setDefaultAction($actionName, $imageSrc = '')
{
// require_once 'HTML/QuickForm2/Controller/DefaultAction.php';
if (0 == count($this->form)) {
$image = $this->form->appendChild(
new HTML_QuickForm2_Controller_DefaultAction(
$this->getB... | [
"public",
"function",
"setDefaultAction",
"(",
"$",
"actionName",
",",
"$",
"imageSrc",
"=",
"''",
")",
"{",
"// require_once 'HTML/QuickForm2/Controller/DefaultAction.php';",
"if",
"(",
"0",
"==",
"count",
"(",
"$",
"this",
"->",
"form",
")",
")",
"{",
"$",
"... | Sets the default action invoked on page-form submit
This is necessary as the user may just press Enter instead of
clicking one of the named submit buttons and then no action name will
be passed to the script.
@param string Default action name
@param string Path to a 1x1 transparent GIF image
@return object ... | [
"Sets",
"the",
"default",
"action",
"invoked",
"on",
"page",
"-",
"form",
"submit"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Controller/Page.php#L181-L210 | train | Set the default action for the form element | [
30522,
2270,
3853,
2275,
3207,
7011,
11314,
18908,
3258,
1006,
1002,
2895,
18442,
1010,
1002,
4871,
11890,
1027,
1005,
1005,
1007,
1063,
1013,
1013,
5478,
1035,
2320,
1005,
16129,
1013,
4248,
14192,
2475,
1013,
11486,
1013,
12398,
18908,
32... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/HTML/Common2.php | HTML_Common2.mergeAttributes | public function mergeAttributes($attributes)
{
$attributes = self::prepareAttributes($attributes);
foreach ($this->watchedAttributes as $watchedKey) {
if (isset($attributes[$watchedKey])) {
$this->onAttributeChange($watchedKey, $attributes[$watchedKey]);
u... | php | public function mergeAttributes($attributes)
{
$attributes = self::prepareAttributes($attributes);
foreach ($this->watchedAttributes as $watchedKey) {
if (isset($attributes[$watchedKey])) {
$this->onAttributeChange($watchedKey, $attributes[$watchedKey]);
u... | [
"public",
"function",
"mergeAttributes",
"(",
"$",
"attributes",
")",
"{",
"$",
"attributes",
"=",
"self",
"::",
"prepareAttributes",
"(",
"$",
"attributes",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"watchedAttributes",
"as",
"$",
"watchedKey",
")",
"{",... | Merges the existing attributes with the new ones
@param mixed Array of attribute 'name' => 'value' pairs or HTML attribute string
@return HTML_Common2 | [
"Merges",
"the",
"existing",
"attributes",
"with",
"the",
"new",
"ones"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/Common2.php#L314-L325 | train | Merge attributes of this node with the attributes of this node | [
30522,
2270,
3853,
13590,
19321,
3089,
8569,
4570,
1006,
1002,
12332,
1007,
1063,
1002,
12332,
1027,
2969,
1024,
1024,
7374,
19321,
3089,
8569,
4570,
1006,
1002,
12332,
1007,
1025,
18921,
6776,
1006,
1002,
2023,
1011,
1028,
3427,
19321,
308... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octobercms/october | modules/cms/classes/MediaViewHelper.php | MediaViewHelper.processHtml | public function processHtml($html)
{
if (!is_string($html)) {
return $html;
}
$mediaTags = $this->extractMediaTags($html);
foreach ($mediaTags as $tagInfo) {
$pattern = preg_quote($tagInfo['declaration']);
$generatedMarkup = $this->generateMediaTa... | php | public function processHtml($html)
{
if (!is_string($html)) {
return $html;
}
$mediaTags = $this->extractMediaTags($html);
foreach ($mediaTags as $tagInfo) {
$pattern = preg_quote($tagInfo['declaration']);
$generatedMarkup = $this->generateMediaTa... | [
"public",
"function",
"processHtml",
"(",
"$",
"html",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"html",
")",
")",
"{",
"return",
"$",
"html",
";",
"}",
"$",
"mediaTags",
"=",
"$",
"this",
"->",
"extractMediaTags",
"(",
"$",
"html",
")",
";"... | Replaces audio and video tags inserted by the Media Manager with players markup.
@param string $html Specifies the HTML string to process.
@return string Returns the processed HTML string. | [
"Replaces",
"audio",
"and",
"video",
"tags",
"inserted",
"by",
"the",
"Media",
"Manager",
"with",
"players",
"markup",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/MediaViewHelper.php#L22-L36 | train | Process HTML content | [
30522,
2270,
3853,
2832,
11039,
19968,
1006,
1002,
16129,
1007,
1063,
2065,
1006,
999,
2003,
1035,
5164,
1006,
1002,
16129,
1007,
1007,
1063,
2709,
1002,
16129,
1025,
1065,
1002,
2865,
15900,
2015,
1027,
1002,
2023,
1011,
1028,
14817,
16969... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
PHPMailer/PHPMailer | src/POP3.php | POP3.login | public function login($username = '', $password = '')
{
if (!$this->connected) {
$this->setError('Not connected to POP3 server');
}
if (empty($username)) {
$username = $this->username;
}
if (empty($password)) {
$password = $this->password;
... | php | public function login($username = '', $password = '')
{
if (!$this->connected) {
$this->setError('Not connected to POP3 server');
}
if (empty($username)) {
$username = $this->username;
}
if (empty($password)) {
$password = $this->password;
... | [
"public",
"function",
"login",
"(",
"$",
"username",
"=",
"''",
",",
"$",
"password",
"=",
"''",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"connected",
")",
"{",
"$",
"this",
"->",
"setError",
"(",
"'Not connected to POP3 server'",
")",
";",
"}",
... | Log in to the POP3 server.
Does not support APOP (RFC 2828, 4949).
@param string $username
@param string $password
@return bool | [
"Log",
"in",
"to",
"the",
"POP3",
"server",
".",
"Does",
"not",
"support",
"APOP",
"(",
"RFC",
"2828",
"4949",
")",
"."
] | 3d7132341659a8a201adbc3ba11b1e202ee2857c | https://github.com/PHPMailer/PHPMailer/blob/3d7132341659a8a201adbc3ba11b1e202ee2857c/src/POP3.php#L278-L303 | train | Login to POP3 server | [
30522,
2270,
3853,
8833,
2378,
1006,
1002,
5310,
18442,
1027,
1005,
1005,
1010,
1002,
20786,
1027,
1005,
1005,
1007,
1063,
2065,
1006,
999,
1002,
2023,
1011,
1028,
4198,
1007,
1063,
1002,
2023,
1011,
1028,
2275,
2121,
29165,
1006,
1005,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
matomo-org/matomo | libs/Zend/Cache/Backend/TwoLevels.php | Zend_Cache_Backend_TwoLevels.clean | public function clean($mode = Zend_Cache::CLEANING_MODE_ALL, $tags = array())
{
switch($mode) {
case Zend_Cache::CLEANING_MODE_ALL:
$boolFast = $this->_fastBackend->clean(Zend_Cache::CLEANING_MODE_ALL);
$boolSlow = $this->_slowBackend->clean(Zend_Cache::CLEANING_M... | php | public function clean($mode = Zend_Cache::CLEANING_MODE_ALL, $tags = array())
{
switch($mode) {
case Zend_Cache::CLEANING_MODE_ALL:
$boolFast = $this->_fastBackend->clean(Zend_Cache::CLEANING_MODE_ALL);
$boolSlow = $this->_slowBackend->clean(Zend_Cache::CLEANING_M... | [
"public",
"function",
"clean",
"(",
"$",
"mode",
"=",
"Zend_Cache",
"::",
"CLEANING_MODE_ALL",
",",
"$",
"tags",
"=",
"array",
"(",
")",
")",
"{",
"switch",
"(",
"$",
"mode",
")",
"{",
"case",
"Zend_Cache",
"::",
"CLEANING_MODE_ALL",
":",
"$",
"boolFast"... | Clean some cache records
Available modes are :
Zend_Cache::CLEANING_MODE_ALL (default) => remove all cache entries ($tags is not used)
Zend_Cache::CLEANING_MODE_OLD => remove too old cache entries ($tags is not used)
Zend_Cache::CLEANING_MODE_MATCHING_TAG => remove cache entries matching all given ... | [
"Clean",
"some",
"cache",
"records"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache/Backend/TwoLevels.php#L284-L325 | train | Remove all cache entries matching given tags | [
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.