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
slimphp/Slim
Slim/Handlers/Error.php
Error.renderHtmlExceptionOrError
protected function renderHtmlExceptionOrError($exception) { if (!$exception instanceof Exception && !$exception instanceof \Error) { throw new RuntimeException("Unexpected type. Expected Exception or Error."); } $html = sprintf('<div><strong>Type:</strong> %s</div>', get_class($exception)); if (($code = $exception->getCode())) { $html .= sprintf('<div><strong>Code:</strong> %s</div>', $code); } if (($message = $exception->getMessage())) { $html .= sprintf('<div><strong>Message:</strong> %s</div>', htmlentities($message)); } if (($file = $exception->getFile())) { $html .= sprintf('<div><strong>File:</strong> %s</div>', $file); } if (($line = $exception->getLine())) { $html .= sprintf('<div><strong>Line:</strong> %s</div>', $line); } if (($trace = $exception->getTraceAsString())) { $html .= '<h2>Trace</h2>'; $html .= sprintf('<pre>%s</pre>', htmlentities($trace)); } return $html; }
php
protected function renderHtmlExceptionOrError($exception) { if (!$exception instanceof Exception && !$exception instanceof \Error) { throw new RuntimeException("Unexpected type. Expected Exception or Error."); } $html = sprintf('<div><strong>Type:</strong> %s</div>', get_class($exception)); if (($code = $exception->getCode())) { $html .= sprintf('<div><strong>Code:</strong> %s</div>', $code); } if (($message = $exception->getMessage())) { $html .= sprintf('<div><strong>Message:</strong> %s</div>', htmlentities($message)); } if (($file = $exception->getFile())) { $html .= sprintf('<div><strong>File:</strong> %s</div>', $file); } if (($line = $exception->getLine())) { $html .= sprintf('<div><strong>Line:</strong> %s</div>', $line); } if (($trace = $exception->getTraceAsString())) { $html .= '<h2>Trace</h2>'; $html .= sprintf('<pre>%s</pre>', htmlentities($trace)); } return $html; }
[ "protected", "function", "renderHtmlExceptionOrError", "(", "$", "exception", ")", "{", "if", "(", "!", "$", "exception", "instanceof", "Exception", "&&", "!", "$", "exception", "instanceof", "\\", "Error", ")", "{", "throw", "new", "RuntimeException", "(", "\...
Render exception or error as HTML. @param Exception|\Error $exception @return string @throws RuntimeException
[ "Render", "exception", "or", "error", "as", "HTML", "." ]
ccef5f7d8bcd469d59cbe64f6210d83764f91543
https://github.com/slimphp/Slim/blob/ccef5f7d8bcd469d59cbe64f6210d83764f91543/Slim/Handlers/Error.php#L120-L150
train
Render Html Exception or Error
[ 30522, 5123, 3853, 17552, 11039, 19968, 10288, 24422, 5686, 18933, 2099, 1006, 1002, 6453, 1007, 1063, 2065, 1006, 999, 1002, 6453, 6013, 11253, 6453, 1004, 1004, 999, 1002, 6453, 6013, 11253, 1032, 7561, 1007, 1063, 5466, 2047, 2448, 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
libs/Zend/Db/Select.php
Zend_Db_Select.from
public function from($name, $cols = '*', $schema = null) { return $this->_join(self::FROM, $name, null, $cols, $schema); }
php
public function from($name, $cols = '*', $schema = null) { return $this->_join(self::FROM, $name, null, $cols, $schema); }
[ "public", "function", "from", "(", "$", "name", ",", "$", "cols", "=", "'*'", ",", "$", "schema", "=", "null", ")", "{", "return", "$", "this", "->", "_join", "(", "self", "::", "FROM", ",", "$", "name", ",", "null", ",", "$", "cols", ",", "$",...
Adds a FROM table and optional columns to the query. The first parameter $name can be a simple string, in which case the correlation name is generated automatically. If you want to specify the correlation name, the first parameter must be an associative array in which the key is the correlation name, and the value is the physical table name. For example, array('alias' => 'table'). The correlation name is prepended to all columns fetched for this table. The second parameter can be a single string or Zend_Db_Expr object, or else an array of strings or Zend_Db_Expr objects. The first parameter can be null or an empty string, in which case no correlation name is generated or prepended to the columns named in the second parameter. @param array|string|Zend_Db_Expr $name The table name or an associative array relating correlation name to table name. @param array|string|Zend_Db_Expr $cols The columns to select from this table. @param string $schema The schema name to specify, if any. @return Zend_Db_Select This Zend_Db_Select object.
[ "Adds", "a", "FROM", "table", "and", "optional", "columns", "to", "the", "query", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Select.php#L228-L231
train
Create a JOIN statement
[ 30522, 2270, 3853, 2013, 1006, 1002, 2171, 1010, 1002, 8902, 2015, 1027, 1005, 1008, 1005, 1010, 1002, 8040, 28433, 1027, 19701, 1007, 1063, 2709, 1002, 2023, 1011, 1028, 1035, 3693, 1006, 2969, 1024, 1024, 2013, 1010, 1002, 2171, 1010, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
plugins/PrivacyManager/PrivacyManager.php
PrivacyManager.getUserIdSalt
public static function getUserIdSalt() { $salt = Option::get(self::OPTION_USERID_SALT); if (empty($salt)) { $salt = Common::getRandomString($len = 40, $alphabet = "abcdefghijklmnoprstuvwxyzABCDEFGHIJKLMNOPRSTUVWXYZ0123456789_-$"); Option::set(self::OPTION_USERID_SALT, $salt, 1); } return $salt; }
php
public static function getUserIdSalt() { $salt = Option::get(self::OPTION_USERID_SALT); if (empty($salt)) { $salt = Common::getRandomString($len = 40, $alphabet = "abcdefghijklmnoprstuvwxyzABCDEFGHIJKLMNOPRSTUVWXYZ0123456789_-$"); Option::set(self::OPTION_USERID_SALT, $salt, 1); } return $salt; }
[ "public", "static", "function", "getUserIdSalt", "(", ")", "{", "$", "salt", "=", "Option", "::", "get", "(", "self", "::", "OPTION_USERID_SALT", ")", ";", "if", "(", "empty", "(", "$", "salt", ")", ")", "{", "$", "salt", "=", "Common", "::", "getRan...
Returns a unique salt used for pseudonimisation of user id only @return string
[ "Returns", "a", "unique", "salt", "used", "for", "pseudonimisation", "of", "user", "id", "only" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/PrivacyManager/PrivacyManager.php#L606-L614
train
Get User ID salt
[ 30522, 2270, 10763, 3853, 2131, 20330, 9821, 2389, 2102, 1006, 1007, 1063, 1002, 5474, 1027, 5724, 1024, 1024, 2131, 1006, 2969, 1024, 1024, 5724, 1035, 5310, 3593, 1035, 5474, 1007, 1025, 2065, 1006, 4064, 1006, 1002, 5474, 1007, 1007, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
z-song/laravel-admin
src/Form/Field.php
Field.removeRule
protected function removeRule($rule) { if (!is_string($this->rules)) { return; } $pattern = "/{$rule}[^\|]?(\||$)/"; $this->rules = preg_replace($pattern, '', $this->rules, -1); }
php
protected function removeRule($rule) { if (!is_string($this->rules)) { return; } $pattern = "/{$rule}[^\|]?(\||$)/"; $this->rules = preg_replace($pattern, '', $this->rules, -1); }
[ "protected", "function", "removeRule", "(", "$", "rule", ")", "{", "if", "(", "!", "is_string", "(", "$", "this", "->", "rules", ")", ")", "{", "return", ";", "}", "$", "pattern", "=", "\"/{$rule}[^\\|]?(\\||$)/\"", ";", "$", "this", "->", "rules", "="...
Remove a specific rule by keyword. @param string $rule @return void
[ "Remove", "a", "specific", "rule", "by", "keyword", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Form/Field.php#L538-L546
train
Remove a rule from the list of rules
[ 30522, 5123, 3853, 6366, 6820, 2571, 1006, 1002, 3627, 1007, 1063, 2065, 1006, 999, 2003, 1035, 5164, 1006, 1002, 2023, 1011, 1028, 3513, 1007, 1007, 1063, 2709, 1025, 1065, 1002, 5418, 1027, 1000, 1013, 1063, 1002, 3627, 1065, 1031, 1034...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
laravel/framework
src/Illuminate/Queue/Connectors/BeanstalkdConnector.php
BeanstalkdConnector.pheanstalk
protected function pheanstalk(array $config) { return Pheanstalk::create( $config['host'], $config['port'] ?? Pheanstalk::DEFAULT_PORT, $config['timeout'] ?? Connection::DEFAULT_CONNECT_TIMEOUT ); }
php
protected function pheanstalk(array $config) { return Pheanstalk::create( $config['host'], $config['port'] ?? Pheanstalk::DEFAULT_PORT, $config['timeout'] ?? Connection::DEFAULT_CONNECT_TIMEOUT ); }
[ "protected", "function", "pheanstalk", "(", "array", "$", "config", ")", "{", "return", "Pheanstalk", "::", "create", "(", "$", "config", "[", "'host'", "]", ",", "$", "config", "[", "'port'", "]", "??", "Pheanstalk", "::", "DEFAULT_PORT", ",", "$", "con...
Create a Pheanstalk instance. @param array $config @return \Pheanstalk\Pheanstalk
[ "Create", "a", "Pheanstalk", "instance", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Queue/Connectors/BeanstalkdConnector.php#L33-L40
train
Create a pheanstalk connection
[ 30522, 5123, 3853, 6887, 11219, 9153, 13687, 1006, 9140, 1002, 9530, 8873, 2290, 1007, 1063, 2709, 6887, 11219, 9153, 13687, 1024, 1024, 3443, 1006, 1002, 9530, 8873, 2290, 1031, 1005, 3677, 1005, 1033, 1010, 1002, 9530, 8873, 2290, 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...
z-song/laravel-admin
src/Grid/Column.php
Column.fill
public function fill(array $data) { foreach ($data as $key => &$row) { $this->original = $value = Arr::get($row, $this->name); $value = $this->htmlEntityEncode($value); Arr::set($row, $this->name, $value); if ($this->isDefinedColumn()) { $this->useDefinedColumn(); } if ($this->hasDisplayCallbacks()) { $value = $this->callDisplayCallbacks($this->original, $key); Arr::set($row, $this->name, $value); } } return $data; }
php
public function fill(array $data) { foreach ($data as $key => &$row) { $this->original = $value = Arr::get($row, $this->name); $value = $this->htmlEntityEncode($value); Arr::set($row, $this->name, $value); if ($this->isDefinedColumn()) { $this->useDefinedColumn(); } if ($this->hasDisplayCallbacks()) { $value = $this->callDisplayCallbacks($this->original, $key); Arr::set($row, $this->name, $value); } } return $data; }
[ "public", "function", "fill", "(", "array", "$", "data", ")", "{", "foreach", "(", "$", "data", "as", "$", "key", "=>", "&", "$", "row", ")", "{", "$", "this", "->", "original", "=", "$", "value", "=", "Arr", "::", "get", "(", "$", "row", ",", ...
Fill all data to every column. @param array $data @return mixed
[ "Fill", "all", "data", "to", "every", "column", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Grid/Column.php#L467-L487
train
Fill the column with values from the array
[ 30522, 2270, 3853, 6039, 1006, 9140, 1002, 2951, 1007, 1063, 18921, 6776, 1006, 1002, 2951, 2004, 1002, 3145, 1027, 1028, 1004, 1002, 5216, 1007, 1063, 1002, 2023, 1011, 1028, 2434, 1027, 1002, 3643, 1027, 12098, 2099, 1024, 1024, 2131, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
libs/Zend/Validate/File/Count.php
Zend_Validate_File_Count.addFile
public function addFile($file) { if (is_string($file)) { $file = array($file); } if (is_array($file)) { foreach ($file as $name) { if (!isset($this->_files[$name]) && !empty($name)) { $this->_files[$name] = $name; } } } return $this; }
php
public function addFile($file) { if (is_string($file)) { $file = array($file); } if (is_array($file)) { foreach ($file as $name) { if (!isset($this->_files[$name]) && !empty($name)) { $this->_files[$name] = $name; } } } return $this; }
[ "public", "function", "addFile", "(", "$", "file", ")", "{", "if", "(", "is_string", "(", "$", "file", ")", ")", "{", "$", "file", "=", "array", "(", "$", "file", ")", ";", "}", "if", "(", "is_array", "(", "$", "file", ")", ")", "{", "foreach",...
Adds a file for validation @param string|array $file
[ "Adds", "a", "file", "for", "validation" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Validate/File/Count.php#L214-L229
train
Add a file to the list of files
[ 30522, 2270, 3853, 5587, 8873, 2571, 1006, 1002, 5371, 1007, 1063, 2065, 1006, 2003, 1035, 5164, 1006, 1002, 5371, 1007, 1007, 1063, 1002, 5371, 1027, 9140, 1006, 1002, 5371, 1007, 1025, 1065, 2065, 1006, 2003, 1035, 9140, 1006, 1002, 537...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/Intl/Data/Bundle/Compiler/GenrbCompiler.php
GenrbCompiler.compile
public function compile($sourcePath, $targetDir) { if (is_dir($sourcePath)) { $sourcePath .= '/*.txt'; } exec($this->genrb.' --quiet -e UTF-8 -d '.$targetDir.' '.$sourcePath, $output, $status); if (0 !== $status) { throw new RuntimeException(sprintf('genrb failed with status %d while compiling %s to %s.', $status, $sourcePath, $targetDir)); } }
php
public function compile($sourcePath, $targetDir) { if (is_dir($sourcePath)) { $sourcePath .= '/*.txt'; } exec($this->genrb.' --quiet -e UTF-8 -d '.$targetDir.' '.$sourcePath, $output, $status); if (0 !== $status) { throw new RuntimeException(sprintf('genrb failed with status %d while compiling %s to %s.', $status, $sourcePath, $targetDir)); } }
[ "public", "function", "compile", "(", "$", "sourcePath", ",", "$", "targetDir", ")", "{", "if", "(", "is_dir", "(", "$", "sourcePath", ")", ")", "{", "$", "sourcePath", ".=", "'/*.txt'", ";", "}", "exec", "(", "$", "this", "->", "genrb", ".", "' --qu...
{@inheritdoc}
[ "{" ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Intl/Data/Bundle/Compiler/GenrbCompiler.php#L49-L60
train
Compile the source file to the target directory
[ 30522, 2270, 3853, 4012, 22090, 1006, 1002, 3120, 15069, 1010, 1002, 4539, 4305, 2099, 1007, 1063, 2065, 1006, 2003, 1035, 16101, 1006, 1002, 3120, 15069, 1007, 1007, 1063, 1002, 3120, 15069, 1012, 1027, 1005, 1013, 1008, 1012, 19067, 2102,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/Session.php
Zend_Session.setId
public static function setId($id) { if (!self::$_unitTestEnabled && defined('SID')) { /** @see Zend_Session_Exception */ // require_once 'Zend/Session/Exception.php'; throw new Zend_Session_Exception('The session has already been started. The session id must be set first.'); } if (!self::$_unitTestEnabled && headers_sent($filename, $linenum)) { /** @see Zend_Session_Exception */ // require_once 'Zend/Session/Exception.php'; throw new Zend_Session_Exception("You must call ".__CLASS__.'::'.__FUNCTION__. "() before any output has been sent to the browser; output started in {$filename}/{$linenum}"); } if (!is_string($id) || $id === '') { /** @see Zend_Session_Exception */ // require_once 'Zend/Session/Exception.php'; throw new Zend_Session_Exception('You must provide a non-empty string as a session identifier.'); } session_id($id); }
php
public static function setId($id) { if (!self::$_unitTestEnabled && defined('SID')) { /** @see Zend_Session_Exception */ // require_once 'Zend/Session/Exception.php'; throw new Zend_Session_Exception('The session has already been started. The session id must be set first.'); } if (!self::$_unitTestEnabled && headers_sent($filename, $linenum)) { /** @see Zend_Session_Exception */ // require_once 'Zend/Session/Exception.php'; throw new Zend_Session_Exception("You must call ".__CLASS__.'::'.__FUNCTION__. "() before any output has been sent to the browser; output started in {$filename}/{$linenum}"); } if (!is_string($id) || $id === '') { /** @see Zend_Session_Exception */ // require_once 'Zend/Session/Exception.php'; throw new Zend_Session_Exception('You must provide a non-empty string as a session identifier.'); } session_id($id); }
[ "public", "static", "function", "setId", "(", "$", "id", ")", "{", "if", "(", "!", "self", "::", "$", "_unitTestEnabled", "&&", "defined", "(", "'SID'", ")", ")", "{", "/** @see Zend_Session_Exception */", "// require_once 'Zend/Session/Exception.php';", "throw", ...
setId() - set an id to a user specified id @throws Zend_Session_Exception @param string $id @return void
[ "setId", "()", "-", "set", "an", "id", "to", "a", "user", "specified", "id" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Session.php#L625-L647
train
Set the session identifier
[ 30522, 2270, 10763, 3853, 2275, 3593, 1006, 1002, 8909, 1007, 1063, 2065, 1006, 999, 2969, 1024, 1024, 1002, 1035, 3131, 22199, 8189, 23242, 1004, 1004, 4225, 1006, 1005, 15765, 1005, 1007, 1007, 1063, 1013, 1008, 1008, 1030, 2156, 16729, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
core/DataTable/Map.php
Map.filterSubtables
public function filterSubtables($className, $parameters = array()) { foreach ($this->getDataTables() as $table) { $table->filterSubtables($className, $parameters); } }
php
public function filterSubtables($className, $parameters = array()) { foreach ($this->getDataTables() as $table) { $table->filterSubtables($className, $parameters); } }
[ "public", "function", "filterSubtables", "(", "$", "className", ",", "$", "parameters", "=", "array", "(", ")", ")", "{", "foreach", "(", "$", "this", "->", "getDataTables", "(", ")", "as", "$", "table", ")", "{", "$", "table", "->", "filterSubtables", ...
Apply a filter to all subtables contained by this instance. @param string|Closure $className Name of filter class or a Closure. @param array $parameters Parameters to pass to the filter.
[ "Apply", "a", "filter", "to", "all", "subtables", "contained", "by", "this", "instance", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable/Map.php#L119-L124
train
Filter all subtables of the given class name
[ 30522, 2270, 3853, 17736, 12083, 10880, 2015, 1006, 1002, 2465, 18442, 1010, 1002, 11709, 1027, 9140, 1006, 1007, 1007, 1063, 18921, 6776, 1006, 1002, 2023, 1011, 1028, 2131, 2850, 29336, 3085, 2015, 1006, 1007, 2004, 1002, 2795, 1007, 1063...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
overtrue/wechat
src/OfficialAccount/Card/CodeClient.php
CodeClient.check
public function check(string $cardId, array $codes) { $params = [ 'card_id' => $cardId, 'code' => $codes, ]; return $this->httpPostJson('card/code/checkcode', $params); }
php
public function check(string $cardId, array $codes) { $params = [ 'card_id' => $cardId, 'code' => $codes, ]; return $this->httpPostJson('card/code/checkcode', $params); }
[ "public", "function", "check", "(", "string", "$", "cardId", ",", "array", "$", "codes", ")", "{", "$", "params", "=", "[", "'card_id'", "=>", "$", "cardId", ",", "'code'", "=>", "$", "codes", ",", "]", ";", "return", "$", "this", "->", "httpPostJson...
核查code接口. @param string $cardId @param array $codes @return mixed
[ "核查code接口", "." ]
120c72faaa93c270365bc75c73c362d5fd583209
https://github.com/overtrue/wechat/blob/120c72faaa93c270365bc75c73c362d5fd583209/src/OfficialAccount/Card/CodeClient.php#L65-L73
train
Check codes for a card
[ 30522, 2270, 3853, 4638, 1006, 5164, 1002, 4003, 3593, 1010, 9140, 1002, 9537, 1007, 1063, 1002, 11498, 5244, 1027, 1031, 1005, 4003, 1035, 8909, 1005, 1027, 1028, 1002, 4003, 3593, 1010, 1005, 3642, 1005, 1027, 1028, 1002, 9537, 1010, 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/Validator/ValidatorBuilder.php
ValidatorBuilder.addXmlMapping
public function addXmlMapping($path) { if (null !== $this->metadataFactory) { throw new ValidatorException('You cannot add custom mappings after setting a custom metadata factory. Configure your metadata factory instead.'); } $this->xmlMappings[] = $path; return $this; }
php
public function addXmlMapping($path) { if (null !== $this->metadataFactory) { throw new ValidatorException('You cannot add custom mappings after setting a custom metadata factory. Configure your metadata factory instead.'); } $this->xmlMappings[] = $path; return $this; }
[ "public", "function", "addXmlMapping", "(", "$", "path", ")", "{", "if", "(", "null", "!==", "$", "this", "->", "metadataFactory", ")", "{", "throw", "new", "ValidatorException", "(", "'You cannot add custom mappings after setting a custom metadata factory. Configure your...
{@inheritdoc}
[ "{" ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Validator/ValidatorBuilder.php#L105-L114
train
Add custom xml mappings
[ 30522, 2270, 3853, 5587, 2595, 19968, 2863, 14853, 1006, 1002, 4130, 1007, 1063, 2065, 1006, 19701, 999, 1027, 1027, 1002, 2023, 1011, 1028, 27425, 21450, 1007, 1063, 5466, 2047, 9398, 8844, 10288, 24422, 1006, 1005, 2017, 3685, 5587, 7661,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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.sign
public function sign($cert_filename, $key_filename, $key_pass, $extracerts_filename = '') { $this->sign_cert_file = $cert_filename; $this->sign_key_file = $key_filename; $this->sign_key_pass = $key_pass; $this->sign_extracerts_file = $extracerts_filename; }
php
public function sign($cert_filename, $key_filename, $key_pass, $extracerts_filename = '') { $this->sign_cert_file = $cert_filename; $this->sign_key_file = $key_filename; $this->sign_key_pass = $key_pass; $this->sign_extracerts_file = $extracerts_filename; }
[ "public", "function", "sign", "(", "$", "cert_filename", ",", "$", "key_filename", ",", "$", "key_pass", ",", "$", "extracerts_filename", "=", "''", ")", "{", "$", "this", "->", "sign_cert_file", "=", "$", "cert_filename", ";", "$", "this", "->", "sign_key...
Set the public and private key files and password for S/MIME signing. @param string $cert_filename @param string $key_filename @param string $key_pass Password for private key @param string $extracerts_filename Optional path to chain certificate
[ "Set", "the", "public", "and", "private", "key", "files", "and", "password", "for", "S", "/", "MIME", "signing", "." ]
3d7132341659a8a201adbc3ba11b1e202ee2857c
https://github.com/PHPMailer/PHPMailer/blob/3d7132341659a8a201adbc3ba11b1e202ee2857c/src/PHPMailer.php#L4180-L4186
train
Signs the certificate with the given filename and key.
[ 30522, 2270, 3853, 3696, 1006, 1002, 8292, 5339, 1035, 5371, 18442, 1010, 1002, 3145, 1035, 5371, 18442, 1010, 1002, 3145, 1035, 3413, 1010, 1002, 4469, 17119, 3215, 1035, 5371, 18442, 1027, 1005, 1005, 1007, 1063, 1002, 2023, 1011, 1028, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/DomCrawler/Crawler.php
Crawler.images
public function images() { $images = []; foreach ($this as $node) { if (!$node instanceof \DOMElement) { throw new \InvalidArgumentException(sprintf('The current node list should contain only DOMElement instances, "%s" found.', \get_class($node))); } $images[] = new Image($node, $this->baseHref); } return $images; }
php
public function images() { $images = []; foreach ($this as $node) { if (!$node instanceof \DOMElement) { throw new \InvalidArgumentException(sprintf('The current node list should contain only DOMElement instances, "%s" found.', \get_class($node))); } $images[] = new Image($node, $this->baseHref); } return $images; }
[ "public", "function", "images", "(", ")", "{", "$", "images", "=", "[", "]", ";", "foreach", "(", "$", "this", "as", "$", "node", ")", "{", "if", "(", "!", "$", "node", "instanceof", "\\", "DOMElement", ")", "{", "throw", "new", "\\", "InvalidArgum...
Returns an array of Image objects for the nodes in the list. @return Image[] An array of Image instances
[ "Returns", "an", "array", "of", "Image", "objects", "for", "the", "nodes", "in", "the", "list", "." ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/DomCrawler/Crawler.php#L843-L855
train
Returns all images in the list
[ 30522, 2270, 3853, 4871, 1006, 1007, 1063, 1002, 4871, 1027, 1031, 1033, 1025, 18921, 6776, 1006, 1002, 2023, 2004, 1002, 13045, 1007, 1063, 2065, 1006, 999, 1002, 13045, 6013, 11253, 1032, 8514, 16930, 4765, 1007, 1063, 5466, 2047, 1032, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
plugins/UserCountry/Controller.php
Controller.getNextMissingDbUrlInfo
private function getNextMissingDbUrlInfo() { if ($this->isGeoIp2Enabled()) { return $this->getNextMissingDbUrlInfoGeoIp2(); } $missingDbs = GeoIPAutoUpdater::getMissingDatabases(); if (!empty($missingDbs)) { $missingDbKey = $missingDbs[0]; $missingDbName = GeoIp::$dbNames[$missingDbKey][0]; $url = GeoIPAutoUpdater::getConfiguredUrl($missingDbKey); $link = '<a href="' . $url . '">' . $missingDbName . '</a>'; return array( 'to_download' => $missingDbKey, 'to_download_label' => Piwik::translate('UserCountry_DownloadingDb', $link) . '...', ); } return false; }
php
private function getNextMissingDbUrlInfo() { if ($this->isGeoIp2Enabled()) { return $this->getNextMissingDbUrlInfoGeoIp2(); } $missingDbs = GeoIPAutoUpdater::getMissingDatabases(); if (!empty($missingDbs)) { $missingDbKey = $missingDbs[0]; $missingDbName = GeoIp::$dbNames[$missingDbKey][0]; $url = GeoIPAutoUpdater::getConfiguredUrl($missingDbKey); $link = '<a href="' . $url . '">' . $missingDbName . '</a>'; return array( 'to_download' => $missingDbKey, 'to_download_label' => Piwik::translate('UserCountry_DownloadingDb', $link) . '...', ); } return false; }
[ "private", "function", "getNextMissingDbUrlInfo", "(", ")", "{", "if", "(", "$", "this", "->", "isGeoIp2Enabled", "(", ")", ")", "{", "return", "$", "this", "->", "getNextMissingDbUrlInfoGeoIp2", "(", ")", ";", "}", "$", "missingDbs", "=", "GeoIPAutoUpdater", ...
Gets information for the first missing GeoIP database (if any). @return array|bool
[ "Gets", "information", "for", "the", "first", "missing", "GeoIP", "database", "(", "if", "any", ")", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UserCountry/Controller.php#L429-L449
train
Get next missing database URL info
[ 30522, 2797, 3853, 2131, 2638, 18413, 15630, 7741, 18939, 3126, 4115, 14876, 1006, 1007, 1063, 2065, 1006, 1002, 2023, 1011, 1028, 2003, 3351, 10448, 2361, 2475, 8189, 23242, 1006, 1007, 1007, 1063, 2709, 1002, 2023, 1011, 1028, 2131, 2638,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
plugins/GeoIp2/GeoIP2AutoUpdater.php
GeoIP2AutoUpdater.getOldAndNewPathsForBrokenDb
private function getOldAndNewPathsForBrokenDb($possibleDbNames) { $pathToDb = LocationProviderGeoIp2::getPathToGeoIpDatabase($possibleDbNames); $newPath = false; if ($pathToDb !== false) { $newPath = $pathToDb . ".broken"; } return array($pathToDb, $newPath); }
php
private function getOldAndNewPathsForBrokenDb($possibleDbNames) { $pathToDb = LocationProviderGeoIp2::getPathToGeoIpDatabase($possibleDbNames); $newPath = false; if ($pathToDb !== false) { $newPath = $pathToDb . ".broken"; } return array($pathToDb, $newPath); }
[ "private", "function", "getOldAndNewPathsForBrokenDb", "(", "$", "possibleDbNames", ")", "{", "$", "pathToDb", "=", "LocationProviderGeoIp2", "::", "getPathToGeoIpDatabase", "(", "$", "possibleDbNames", ")", ";", "$", "newPath", "=", "false", ";", "if", "(", "$", ...
Returns the path to a GeoIP 2 database and a path to rename it to if it's broken. @param array $possibleDbNames The possible names of the database. @return array Array with two elements, the path to the existing database, and the path to rename it to if it is broken. The second will end with something like .broken .
[ "Returns", "the", "path", "to", "a", "GeoIP", "2", "database", "and", "a", "path", "to", "rename", "it", "to", "if", "it", "s", "broken", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/GeoIp2/GeoIP2AutoUpdater.php#L550-L560
train
Returns the old and new paths for broken database
[ 30522, 2797, 3853, 2131, 11614, 5685, 2638, 2860, 15069, 22747, 2953, 29162, 18939, 1006, 1002, 2825, 18939, 18442, 2015, 1007, 1063, 1002, 4130, 3406, 18939, 1027, 3295, 21572, 17258, 2121, 3351, 10448, 2361, 2475, 1024, 1024, 2131, 15069, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
laravel/framework
src/Illuminate/Queue/DatabaseQueue.php
DatabaseQueue.release
public function release($queue, $job, $delay) { return $this->pushToDatabase($queue, $job->payload, $delay, $job->attempts); }
php
public function release($queue, $job, $delay) { return $this->pushToDatabase($queue, $job->payload, $delay, $job->attempts); }
[ "public", "function", "release", "(", "$", "queue", ",", "$", "job", ",", "$", "delay", ")", "{", "return", "$", "this", "->", "pushToDatabase", "(", "$", "queue", ",", "$", "job", "->", "payload", ",", "$", "delay", ",", "$", "job", "->", "attempt...
Release a reserved job back onto the queue. @param string $queue @param \Illuminate\Queue\Jobs\DatabaseJobRecord $job @param int $delay @return mixed
[ "Release", "a", "reserved", "job", "back", "onto", "the", "queue", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Queue/DatabaseQueue.php#L144-L147
train
Release a job to the database
[ 30522, 2270, 3853, 2713, 1006, 1002, 24240, 1010, 1002, 3105, 1010, 1002, 8536, 1007, 1063, 2709, 1002, 2023, 1011, 1028, 5245, 3406, 2850, 2696, 15058, 1006, 1002, 24240, 1010, 1002, 3105, 1011, 1028, 18093, 1010, 1002, 8536, 1010, 1002, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
laravel/framework
src/Illuminate/Database/Schema/Grammars/Grammar.php
Grammar.getDoctrineTableDiff
public function getDoctrineTableDiff(Blueprint $blueprint, SchemaManager $schema) { $table = $this->getTablePrefix().$blueprint->getTable(); return tap(new TableDiff($table), function ($tableDiff) use ($schema, $table) { $tableDiff->fromTable = $schema->listTableDetails($table); }); }
php
public function getDoctrineTableDiff(Blueprint $blueprint, SchemaManager $schema) { $table = $this->getTablePrefix().$blueprint->getTable(); return tap(new TableDiff($table), function ($tableDiff) use ($schema, $table) { $tableDiff->fromTable = $schema->listTableDetails($table); }); }
[ "public", "function", "getDoctrineTableDiff", "(", "Blueprint", "$", "blueprint", ",", "SchemaManager", "$", "schema", ")", "{", "$", "table", "=", "$", "this", "->", "getTablePrefix", "(", ")", ".", "$", "blueprint", "->", "getTable", "(", ")", ";", "retu...
Create an empty Doctrine DBAL TableDiff from the Blueprint. @param \Illuminate\Database\Schema\Blueprint $blueprint @param \Doctrine\DBAL\Schema\AbstractSchemaManager $schema @return \Doctrine\DBAL\Schema\TableDiff
[ "Create", "an", "empty", "Doctrine", "DBAL", "TableDiff", "from", "the", "Blueprint", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Schema/Grammars/Grammar.php#L258-L265
train
Get Doctrine TableDiff for blueprint.
[ 30522, 2270, 3853, 2131, 3527, 6593, 11467, 10880, 4305, 4246, 1006, 2630, 16550, 1002, 2630, 16550, 1010, 8040, 28433, 24805, 4590, 1002, 8040, 28433, 1007, 1063, 1002, 2795, 1027, 1002, 2023, 1011, 1028, 2131, 10880, 28139, 8873, 2595, 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...
spatie/laravel-permission
src/Traits/HasPermissions.php
HasPermissions.ensureModelSharesGuard
protected function ensureModelSharesGuard($roleOrPermission) { if (! $this->getGuardNames()->contains($roleOrPermission->guard_name)) { throw GuardDoesNotMatch::create($roleOrPermission->guard_name, $this->getGuardNames()); } }
php
protected function ensureModelSharesGuard($roleOrPermission) { if (! $this->getGuardNames()->contains($roleOrPermission->guard_name)) { throw GuardDoesNotMatch::create($roleOrPermission->guard_name, $this->getGuardNames()); } }
[ "protected", "function", "ensureModelSharesGuard", "(", "$", "roleOrPermission", ")", "{", "if", "(", "!", "$", "this", "->", "getGuardNames", "(", ")", "->", "contains", "(", "$", "roleOrPermission", "->", "guard_name", ")", ")", "{", "throw", "GuardDoesNotMa...
@param \Spatie\Permission\Contracts\Permission|\Spatie\Permission\Contracts\Role $roleOrPermission @throws \Spatie\Permission\Exceptions\GuardDoesNotMatch
[ "@param", "\\", "Spatie", "\\", "Permission", "\\", "Contracts", "\\", "Permission|", "\\", "Spatie", "\\", "Permission", "\\", "Contracts", "\\", "Role", "$roleOrPermission" ]
81dbe9d372d70c255b66a2727a235076509f8d45
https://github.com/spatie/laravel-permission/blob/81dbe9d372d70c255b66a2727a235076509f8d45/src/Traits/HasPermissions.php#L409-L414
train
Ensures that the model shares the guard
[ 30522, 5123, 3853, 5676, 5302, 9247, 7377, 6072, 18405, 1006, 1002, 2535, 2953, 4842, 25481, 1007, 1063, 2065, 1006, 999, 1002, 2023, 1011, 1028, 2131, 18405, 18442, 2015, 1006, 1007, 1011, 1028, 3397, 1006, 1002, 2535, 2953, 4842, 25481, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
overtrue/wechat
src/Payment/Kernel/BaseClient.php
BaseClient.requestRaw
protected function requestRaw($endpoint, array $params = [], $method = 'post', array $options = []) { return $this->request($endpoint, $params, $method, $options, true); }
php
protected function requestRaw($endpoint, array $params = [], $method = 'post', array $options = []) { return $this->request($endpoint, $params, $method, $options, true); }
[ "protected", "function", "requestRaw", "(", "$", "endpoint", ",", "array", "$", "params", "=", "[", "]", ",", "$", "method", "=", "'post'", ",", "array", "$", "options", "=", "[", "]", ")", "{", "return", "$", "this", "->", "request", "(", "$", "en...
Make a request and return raw response. @param string $endpoint @param array $params @param string $method @param array $options @return ResponseInterface @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException @throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException
[ "Make", "a", "request", "and", "return", "raw", "response", "." ]
120c72faaa93c270365bc75c73c362d5fd583209
https://github.com/overtrue/wechat/blob/120c72faaa93c270365bc75c73c362d5fd583209/src/Payment/Kernel/BaseClient.php#L128-L131
train
Request raw HTTP request
[ 30522, 5123, 3853, 5227, 2527, 2860, 1006, 1002, 2203, 8400, 1010, 9140, 1002, 11498, 5244, 30524, 102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/HttpFoundation/Response.php
Response.expire
public function expire() { if ($this->isFresh()) { $this->headers->set('Age', $this->getMaxAge()); $this->headers->remove('Expires'); } return $this; }
php
public function expire() { if ($this->isFresh()) { $this->headers->set('Age', $this->getMaxAge()); $this->headers->remove('Expires'); } return $this; }
[ "public", "function", "expire", "(", ")", "{", "if", "(", "$", "this", "->", "isFresh", "(", ")", ")", "{", "$", "this", "->", "headers", "->", "set", "(", "'Age'", ",", "$", "this", "->", "getMaxAge", "(", ")", ")", ";", "$", "this", "->", "he...
Marks the response stale by setting the Age header to be equal to the maximum age of the response. @return $this
[ "Marks", "the", "response", "stale", "by", "setting", "the", "Age", "header", "to", "be", "equal", "to", "the", "maximum", "age", "of", "the", "response", "." ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpFoundation/Response.php#L695-L703
train
Set Expires header
[ 30522, 2270, 3853, 4654, 20781, 1006, 1007, 1063, 2065, 1006, 1002, 2023, 1011, 1028, 2003, 19699, 9953, 1006, 1007, 1007, 1063, 1002, 2023, 1011, 1028, 20346, 2015, 1011, 1028, 2275, 1006, 1005, 2287, 1005, 1010, 1002, 2023, 1011, 1028, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
laravel/framework
src/Illuminate/Routing/Router.php
Router.toResponse
public static function toResponse($request, $response) { if ($response instanceof Responsable) { $response = $response->toResponse($request); } if ($response instanceof PsrResponseInterface) { $response = (new HttpFoundationFactory)->createResponse($response); } elseif ($response instanceof Model && $response->wasRecentlyCreated) { $response = new JsonResponse($response, 201); } elseif (! $response instanceof SymfonyResponse && ($response instanceof Arrayable || $response instanceof Jsonable || $response instanceof ArrayObject || $response instanceof JsonSerializable || is_array($response))) { $response = new JsonResponse($response); } elseif (! $response instanceof SymfonyResponse) { $response = new Response($response); } if ($response->getStatusCode() === Response::HTTP_NOT_MODIFIED) { $response->setNotModified(); } return $response->prepare($request); }
php
public static function toResponse($request, $response) { if ($response instanceof Responsable) { $response = $response->toResponse($request); } if ($response instanceof PsrResponseInterface) { $response = (new HttpFoundationFactory)->createResponse($response); } elseif ($response instanceof Model && $response->wasRecentlyCreated) { $response = new JsonResponse($response, 201); } elseif (! $response instanceof SymfonyResponse && ($response instanceof Arrayable || $response instanceof Jsonable || $response instanceof ArrayObject || $response instanceof JsonSerializable || is_array($response))) { $response = new JsonResponse($response); } elseif (! $response instanceof SymfonyResponse) { $response = new Response($response); } if ($response->getStatusCode() === Response::HTTP_NOT_MODIFIED) { $response->setNotModified(); } return $response->prepare($request); }
[ "public", "static", "function", "toResponse", "(", "$", "request", ",", "$", "response", ")", "{", "if", "(", "$", "response", "instanceof", "Responsable", ")", "{", "$", "response", "=", "$", "response", "->", "toResponse", "(", "$", "request", ")", ";"...
Static version of prepareResponse. @param \Symfony\Component\HttpFoundation\Request $request @param mixed $response @return \Illuminate\Http\Response|\Illuminate\Http\JsonResponse
[ "Static", "version", "of", "prepareResponse", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/Router.php#L730-L756
train
Convert to response
[ 30522, 2270, 10763, 3853, 9538, 13102, 5644, 2063, 1006, 1002, 5227, 1010, 1002, 3433, 1007, 1063, 2065, 1006, 1002, 3433, 6013, 11253, 24501, 26029, 19150, 1007, 1063, 1002, 3433, 1027, 1002, 3433, 1011, 1028, 9538, 13102, 5644, 2063, 1006...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
plugins/SitesManager/Model.php
Model.getUsedTypeIds
public function getUsedTypeIds() { $types = array(); $db = $this->getDb(); $rows = $db->fetchAll("SELECT DISTINCT `type` as typeid FROM " . $this->table); foreach ($rows as $row) { $types[] = $row['typeid']; } return $types; }
php
public function getUsedTypeIds() { $types = array(); $db = $this->getDb(); $rows = $db->fetchAll("SELECT DISTINCT `type` as typeid FROM " . $this->table); foreach ($rows as $row) { $types[] = $row['typeid']; } return $types; }
[ "public", "function", "getUsedTypeIds", "(", ")", "{", "$", "types", "=", "array", "(", ")", ";", "$", "db", "=", "$", "this", "->", "getDb", "(", ")", ";", "$", "rows", "=", "$", "db", "->", "fetchAll", "(", "\"SELECT DISTINCT `type` as typeid FROM \"",...
Returns all used type ids (unique) @return array of used type ids
[ "Returns", "all", "used", "type", "ids", "(", "unique", ")" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SitesManager/Model.php#L362-L374
train
Get all types used by this language
[ 30522, 2270, 3853, 2131, 13901, 13874, 9821, 1006, 1007, 1063, 1002, 4127, 1027, 9140, 1006, 1007, 1025, 1002, 16962, 1027, 1002, 2023, 1011, 1028, 2131, 18939, 1006, 1007, 1025, 1002, 10281, 1027, 1002, 16962, 1011, 1028, 18584, 8095, 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/DependencyInjection/ContainerBuilder.php
ContainerBuilder.resolveEnvPlaceholders
public function resolveEnvPlaceholders($value, $format = null, array &$usedEnvs = null) { if (null === $format) { $format = '%%env(%s)%%'; } $bag = $this->getParameterBag(); if (true === $format) { $value = $bag->resolveValue($value); } if ($value instanceof Definition) { $value = (array) $value; } if (\is_array($value)) { $result = []; foreach ($value as $k => $v) { $result[\is_string($k) ? $this->resolveEnvPlaceholders($k, $format, $usedEnvs) : $k] = $this->resolveEnvPlaceholders($v, $format, $usedEnvs); } return $result; } if (!\is_string($value) || 38 > \strlen($value)) { return $value; } $envPlaceholders = $bag instanceof EnvPlaceholderParameterBag ? $bag->getEnvPlaceholders() : $this->envPlaceholders; $completed = false; foreach ($envPlaceholders as $env => $placeholders) { foreach ($placeholders as $placeholder) { if (false !== stripos($value, $placeholder)) { if (true === $format) { $resolved = $bag->escapeValue($this->getEnv($env)); } else { $resolved = sprintf($format, $env); } if ($placeholder === $value) { $value = $resolved; $completed = true; } else { if (!\is_string($resolved) && !is_numeric($resolved)) { throw new RuntimeException(sprintf('A string value must be composed of strings and/or numbers, but found parameter "env(%s)" of type %s inside string value "%s".', $env, \gettype($resolved), $this->resolveEnvPlaceholders($value))); } $value = str_ireplace($placeholder, $resolved, $value); } $usedEnvs[$env] = $env; $this->envCounters[$env] = isset($this->envCounters[$env]) ? 1 + $this->envCounters[$env] : 1; if ($completed) { break 2; } } } } return $value; }
php
public function resolveEnvPlaceholders($value, $format = null, array &$usedEnvs = null) { if (null === $format) { $format = '%%env(%s)%%'; } $bag = $this->getParameterBag(); if (true === $format) { $value = $bag->resolveValue($value); } if ($value instanceof Definition) { $value = (array) $value; } if (\is_array($value)) { $result = []; foreach ($value as $k => $v) { $result[\is_string($k) ? $this->resolveEnvPlaceholders($k, $format, $usedEnvs) : $k] = $this->resolveEnvPlaceholders($v, $format, $usedEnvs); } return $result; } if (!\is_string($value) || 38 > \strlen($value)) { return $value; } $envPlaceholders = $bag instanceof EnvPlaceholderParameterBag ? $bag->getEnvPlaceholders() : $this->envPlaceholders; $completed = false; foreach ($envPlaceholders as $env => $placeholders) { foreach ($placeholders as $placeholder) { if (false !== stripos($value, $placeholder)) { if (true === $format) { $resolved = $bag->escapeValue($this->getEnv($env)); } else { $resolved = sprintf($format, $env); } if ($placeholder === $value) { $value = $resolved; $completed = true; } else { if (!\is_string($resolved) && !is_numeric($resolved)) { throw new RuntimeException(sprintf('A string value must be composed of strings and/or numbers, but found parameter "env(%s)" of type %s inside string value "%s".', $env, \gettype($resolved), $this->resolveEnvPlaceholders($value))); } $value = str_ireplace($placeholder, $resolved, $value); } $usedEnvs[$env] = $env; $this->envCounters[$env] = isset($this->envCounters[$env]) ? 1 + $this->envCounters[$env] : 1; if ($completed) { break 2; } } } } return $value; }
[ "public", "function", "resolveEnvPlaceholders", "(", "$", "value", ",", "$", "format", "=", "null", ",", "array", "&", "$", "usedEnvs", "=", "null", ")", "{", "if", "(", "null", "===", "$", "format", ")", "{", "$", "format", "=", "'%%env(%s)%%'", ";", ...
Resolves env parameter placeholders in a string or an array. @param mixed $value The value to resolve @param string|true|null $format A sprintf() format returning the replacement for each env var name or null to resolve back to the original "%env(VAR)%" format or true to resolve to the actual values of the referenced env vars @param array &$usedEnvs Env vars found while resolving are added to this array @return mixed The value with env parameters resolved if a string or an array is passed
[ "Resolves", "env", "parameter", "placeholders", "in", "a", "string", "or", "an", "array", "." ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/DependencyInjection/ContainerBuilder.php#L1409-L1467
train
Resolves the environment variables in the given value.
[ 30522, 2270, 3853, 10663, 2368, 2615, 24759, 10732, 17794, 1006, 1002, 3643, 1010, 1002, 4289, 1027, 19701, 1010, 9140, 1004, 1002, 2109, 2368, 15088, 1027, 19701, 1007, 1063, 2065, 1006, 19701, 1027, 1027, 1027, 1002, 4289, 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...
matomo-org/matomo
plugins/UserCountry/Controller.php
Controller.downloadFreeGeoIPDB
public function downloadFreeGeoIPDB() { $this->dieIfGeolocationAdminIsDisabled(); Piwik::checkUserHasSuperUserAccess(); if ($this->isGeoIp2Enabled()) { return $this->downloadFreeGeoIP2DB(); } if ($_SERVER["REQUEST_METHOD"] == "POST") { $this->checkTokenInUrl(); Json::sendHeaderJSON(); $outputPath = GeoIp::getPathForGeoIpDatabase('GeoIPCity.dat') . '.gz'; try { $result = Http::downloadChunk( $url = GeoIp::GEO_LITE_URL, $outputPath, $continue = Common::getRequestVar('continue', true, 'int') ); // if the file is done if ($result['current_size'] >= $result['expected_file_size']) { GeoIPAutoUpdater::unzipDownloadedFile($outputPath, $unlink = true); // setup the auto updater GeoIPAutoUpdater::setUpdaterOptions(array( 'loc' => GeoIp::GEO_LITE_URL, 'period' => GeoIPAutoUpdater::SCHEDULE_PERIOD_MONTHLY, )); // make sure to echo out the geoip updater management screen $result['settings'] = GeoIPAutoUpdater::getConfiguredUrls(); } return json_encode($result); } catch (Exception $ex) { return json_encode(array('error' => $ex->getMessage())); } } }
php
public function downloadFreeGeoIPDB() { $this->dieIfGeolocationAdminIsDisabled(); Piwik::checkUserHasSuperUserAccess(); if ($this->isGeoIp2Enabled()) { return $this->downloadFreeGeoIP2DB(); } if ($_SERVER["REQUEST_METHOD"] == "POST") { $this->checkTokenInUrl(); Json::sendHeaderJSON(); $outputPath = GeoIp::getPathForGeoIpDatabase('GeoIPCity.dat') . '.gz'; try { $result = Http::downloadChunk( $url = GeoIp::GEO_LITE_URL, $outputPath, $continue = Common::getRequestVar('continue', true, 'int') ); // if the file is done if ($result['current_size'] >= $result['expected_file_size']) { GeoIPAutoUpdater::unzipDownloadedFile($outputPath, $unlink = true); // setup the auto updater GeoIPAutoUpdater::setUpdaterOptions(array( 'loc' => GeoIp::GEO_LITE_URL, 'period' => GeoIPAutoUpdater::SCHEDULE_PERIOD_MONTHLY, )); // make sure to echo out the geoip updater management screen $result['settings'] = GeoIPAutoUpdater::getConfiguredUrls(); } return json_encode($result); } catch (Exception $ex) { return json_encode(array('error' => $ex->getMessage())); } } }
[ "public", "function", "downloadFreeGeoIPDB", "(", ")", "{", "$", "this", "->", "dieIfGeolocationAdminIsDisabled", "(", ")", ";", "Piwik", "::", "checkUserHasSuperUserAccess", "(", ")", ";", "if", "(", "$", "this", "->", "isGeoIp2Enabled", "(", ")", ")", "{", ...
Starts or continues download of GeoLiteCity.dat. To avoid a server/PHP timeout & to show progress of the download to the user, we use the HTTP Range header to download one chunk of the file at a time. After each chunk, it is the browser's responsibility to call the method again to continue the download. Input: 'continue' query param - if set to 1, will assume we are currently downloading & use Range: HTTP header to get another chunk of the file. Output (in JSON): 'current_size' - Current size of the partially downloaded file on disk. 'expected_file_size' - The expected finished file size as returned by the HTTP server. 'next_screen' - When the download finishes, this is the next screen that should be shown. 'error' - When an error occurs, the message is returned in this property.
[ "Starts", "or", "continues", "download", "of", "GeoLiteCity", ".", "dat", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UserCountry/Controller.php#L109-L148
train
Download Free GeoIPDB
[ 30522, 2270, 3853, 8816, 23301, 3351, 10448, 17299, 2497, 1006, 1007, 1063, 1002, 2023, 1011, 1028, 3280, 10128, 3351, 12898, 10719, 4215, 25300, 16150, 14268, 23242, 1006, 1007, 1025, 14255, 9148, 2243, 1024, 1024, 4638, 20330, 14949, 6342, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/Console/Application.php
Application.doRun
public function doRun(InputInterface $input, OutputInterface $output) { if (true === $input->hasParameterOption(['--version', '-V'], true)) { $output->writeln($this->getLongVersion()); return 0; } try { // Makes ArgvInput::getFirstArgument() able to distinguish an option from an argument. $input->bind($this->getDefinition()); } catch (ExceptionInterface $e) { // Errors must be ignored, full binding/validation happens later when the command is known. } $name = $this->getCommandName($input); if (true === $input->hasParameterOption(['--help', '-h'], true)) { if (!$name) { $name = 'help'; $input = new ArrayInput(['command_name' => $this->defaultCommand]); } else { $this->wantHelps = true; } } if (!$name) { $name = $this->defaultCommand; $definition = $this->getDefinition(); $definition->setArguments(array_merge( $definition->getArguments(), [ 'command' => new InputArgument('command', InputArgument::OPTIONAL, $definition->getArgument('command')->getDescription(), $name), ] )); } try { $this->runningCommand = null; // the command name MUST be the first element of the input $command = $this->find($name); } catch (\Throwable $e) { if (!($e instanceof CommandNotFoundException && !$e instanceof NamespaceNotFoundException) || 1 !== \count($alternatives = $e->getAlternatives()) || !$input->isInteractive()) { if (null !== $this->dispatcher) { $event = new ConsoleErrorEvent($input, $output, $e); $this->dispatcher->dispatch($event, ConsoleEvents::ERROR); if (0 === $event->getExitCode()) { return 0; } $e = $event->getError(); } throw $e; } $alternative = $alternatives[0]; $style = new SymfonyStyle($input, $output); $style->block(sprintf("\nCommand \"%s\" is not defined.\n", $name), null, 'error'); if (!$style->confirm(sprintf('Do you want to run "%s" instead? ', $alternative), false)) { if (null !== $this->dispatcher) { $event = new ConsoleErrorEvent($input, $output, $e); $this->dispatcher->dispatch($event, ConsoleEvents::ERROR); return $event->getExitCode(); } return 1; } $command = $this->find($alternative); } $this->runningCommand = $command; $exitCode = $this->doRunCommand($command, $input, $output); $this->runningCommand = null; return $exitCode; }
php
public function doRun(InputInterface $input, OutputInterface $output) { if (true === $input->hasParameterOption(['--version', '-V'], true)) { $output->writeln($this->getLongVersion()); return 0; } try { // Makes ArgvInput::getFirstArgument() able to distinguish an option from an argument. $input->bind($this->getDefinition()); } catch (ExceptionInterface $e) { // Errors must be ignored, full binding/validation happens later when the command is known. } $name = $this->getCommandName($input); if (true === $input->hasParameterOption(['--help', '-h'], true)) { if (!$name) { $name = 'help'; $input = new ArrayInput(['command_name' => $this->defaultCommand]); } else { $this->wantHelps = true; } } if (!$name) { $name = $this->defaultCommand; $definition = $this->getDefinition(); $definition->setArguments(array_merge( $definition->getArguments(), [ 'command' => new InputArgument('command', InputArgument::OPTIONAL, $definition->getArgument('command')->getDescription(), $name), ] )); } try { $this->runningCommand = null; // the command name MUST be the first element of the input $command = $this->find($name); } catch (\Throwable $e) { if (!($e instanceof CommandNotFoundException && !$e instanceof NamespaceNotFoundException) || 1 !== \count($alternatives = $e->getAlternatives()) || !$input->isInteractive()) { if (null !== $this->dispatcher) { $event = new ConsoleErrorEvent($input, $output, $e); $this->dispatcher->dispatch($event, ConsoleEvents::ERROR); if (0 === $event->getExitCode()) { return 0; } $e = $event->getError(); } throw $e; } $alternative = $alternatives[0]; $style = new SymfonyStyle($input, $output); $style->block(sprintf("\nCommand \"%s\" is not defined.\n", $name), null, 'error'); if (!$style->confirm(sprintf('Do you want to run "%s" instead? ', $alternative), false)) { if (null !== $this->dispatcher) { $event = new ConsoleErrorEvent($input, $output, $e); $this->dispatcher->dispatch($event, ConsoleEvents::ERROR); return $event->getExitCode(); } return 1; } $command = $this->find($alternative); } $this->runningCommand = $command; $exitCode = $this->doRunCommand($command, $input, $output); $this->runningCommand = null; return $exitCode; }
[ "public", "function", "doRun", "(", "InputInterface", "$", "input", ",", "OutputInterface", "$", "output", ")", "{", "if", "(", "true", "===", "$", "input", "->", "hasParameterOption", "(", "[", "'--version'", ",", "'-V'", "]", ",", "true", ")", ")", "{"...
Runs the current application. @return int 0 if everything went fine, or an error code
[ "Runs", "the", "current", "application", "." ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Application.php#L198-L277
train
Runs the command
[ 30522, 2270, 3853, 2079, 15532, 1006, 7953, 18447, 2121, 12172, 1002, 7953, 1010, 6434, 18447, 2121, 12172, 1002, 6434, 1007, 1063, 2065, 1006, 2995, 1027, 1027, 1027, 1002, 7953, 1011, 1028, 2038, 28689, 22828, 7361, 3508, 1006, 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...
octobercms/october
modules/system/models/File.php
File.getPath
public function getPath() { $url = ''; if (!$this->isPublic() && class_exists(Files::class)) { $url = Files::getDownloadUrl($this); } else { $url = parent::getPath(); } return $url; }
php
public function getPath() { $url = ''; if (!$this->isPublic() && class_exists(Files::class)) { $url = Files::getDownloadUrl($this); } else { $url = parent::getPath(); } return $url; }
[ "public", "function", "getPath", "(", ")", "{", "$", "url", "=", "''", ";", "if", "(", "!", "$", "this", "->", "isPublic", "(", ")", "&&", "class_exists", "(", "Files", "::", "class", ")", ")", "{", "$", "url", "=", "Files", "::", "getDownloadUrl",...
{@inheritDoc}
[ "{" ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/models/File.php#L45-L55
train
Get path of file
[ 30522, 2270, 3853, 2131, 15069, 1006, 1007, 1063, 1002, 24471, 2140, 1027, 1005, 1005, 1025, 2065, 1006, 999, 1002, 2023, 1011, 1028, 2003, 14289, 16558, 2594, 1006, 1007, 1004, 1004, 2465, 1035, 6526, 1006, 6764, 1024, 1024, 2465, 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/Database/Eloquent/Relations/HasOneOrMany.php
HasOneOrMany.firstOrNew
public function firstOrNew(array $attributes, array $values = []) { if (is_null($instance = $this->where($attributes)->first())) { $instance = $this->related->newInstance($attributes + $values); $this->setForeignAttributesForCreate($instance); } return $instance; }
php
public function firstOrNew(array $attributes, array $values = []) { if (is_null($instance = $this->where($attributes)->first())) { $instance = $this->related->newInstance($attributes + $values); $this->setForeignAttributesForCreate($instance); } return $instance; }
[ "public", "function", "firstOrNew", "(", "array", "$", "attributes", ",", "array", "$", "values", "=", "[", "]", ")", "{", "if", "(", "is_null", "(", "$", "instance", "=", "$", "this", "->", "where", "(", "$", "attributes", ")", "->", "first", "(", ...
Get the first related model record matching the attributes or instantiate it. @param array $attributes @param array $values @return \Illuminate\Database\Eloquent\Model
[ "Get", "the", "first", "related", "model", "record", "matching", "the", "attributes", "or", "instantiate", "it", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Relations/HasOneOrMany.php#L199-L208
train
Get first or new instance of related model
[ 30522, 2270, 3853, 2034, 23846, 2860, 1006, 9140, 1002, 12332, 1010, 9140, 1002, 5300, 1027, 1031, 1033, 1007, 1063, 2065, 1006, 2003, 1035, 19701, 1006, 1002, 6013, 1027, 1002, 2023, 1011, 1028, 2073, 1006, 1002, 12332, 1007, 1011, 1028, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/Ldap/Ldap.php
Ldap.escape
public function escape($subject, $ignore = '', $flags = 0) { return $this->adapter->escape($subject, $ignore, $flags); }
php
public function escape($subject, $ignore = '', $flags = 0) { return $this->adapter->escape($subject, $ignore, $flags); }
[ "public", "function", "escape", "(", "$", "subject", ",", "$", "ignore", "=", "''", ",", "$", "flags", "=", "0", ")", "{", "return", "$", "this", "->", "adapter", "->", "escape", "(", "$", "subject", ",", "$", "ignore", ",", "$", "flags", ")", ";...
{@inheritdoc}
[ "{" ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Ldap/Ldap.php#L60-L63
train
Escape a subject
[ 30522, 2270, 3853, 4019, 1006, 1002, 3395, 1010, 1002, 8568, 1027, 1005, 1005, 1010, 1002, 9245, 1027, 1014, 1007, 1063, 2709, 1002, 2023, 1011, 1028, 15581, 2121, 1011, 1028, 4019, 1006, 1002, 3395, 1010, 1002, 8568, 1010, 1002, 9245, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
laravel/framework
src/Illuminate/Console/Scheduling/Event.php
Event.run
public function run(Container $container) { if ($this->withoutOverlapping && ! $this->mutex->create($this)) { return; } $this->runInBackground ? $this->runCommandInBackground($container) : $this->runCommandInForeground($container); }
php
public function run(Container $container) { if ($this->withoutOverlapping && ! $this->mutex->create($this)) { return; } $this->runInBackground ? $this->runCommandInBackground($container) : $this->runCommandInForeground($container); }
[ "public", "function", "run", "(", "Container", "$", "container", ")", "{", "if", "(", "$", "this", "->", "withoutOverlapping", "&&", "!", "$", "this", "->", "mutex", "->", "create", "(", "$", "this", ")", ")", "{", "return", ";", "}", "$", "this", ...
Run the given event. @param \Illuminate\Contracts\Container\Container $container @return void
[ "Run", "the", "given", "event", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Console/Scheduling/Event.php#L186-L196
train
Runs the command in background or foreground
[ 30522, 2270, 3853, 2448, 1006, 11661, 1002, 11661, 1007, 1063, 2065, 1006, 1002, 2023, 1011, 1028, 2302, 7840, 2721, 14853, 1004, 1004, 999, 1002, 2023, 1011, 1028, 20101, 2595, 1011, 1028, 3443, 1006, 1002, 2023, 1007, 1007, 1063, 2709, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
laravel/framework
src/Illuminate/View/Concerns/ManagesLayouts.php
ManagesLayouts.parentPlaceholder
public static function parentPlaceholder($section = '') { if (! isset(static::$parentPlaceholder[$section])) { static::$parentPlaceholder[$section] = '##parent-placeholder-'.sha1($section).'##'; } return static::$parentPlaceholder[$section]; }
php
public static function parentPlaceholder($section = '') { if (! isset(static::$parentPlaceholder[$section])) { static::$parentPlaceholder[$section] = '##parent-placeholder-'.sha1($section).'##'; } return static::$parentPlaceholder[$section]; }
[ "public", "static", "function", "parentPlaceholder", "(", "$", "section", "=", "''", ")", "{", "if", "(", "!", "isset", "(", "static", "::", "$", "parentPlaceholder", "[", "$", "section", "]", ")", ")", "{", "static", "::", "$", "parentPlaceholder", "[",...
Get the parent placeholder for the current request. @param string $section @return string
[ "Get", "the", "parent", "placeholder", "for", "the", "current", "request", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/View/Concerns/ManagesLayouts.php#L168-L175
train
Get parent placeholder
[ 30522, 2270, 10763, 3853, 6687, 24759, 10732, 14528, 1006, 1002, 2930, 1027, 1005, 1005, 1007, 1063, 2065, 1006, 999, 26354, 3388, 1006, 10763, 1024, 1024, 1002, 6687, 24759, 10732, 14528, 1031, 1002, 2930, 1033, 1007, 1007, 1063, 10763, 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/Config/Definition/Builder/NodeDefinition.php
NodeDefinition.normalization
protected function normalization() { if (null === $this->normalization) { $this->normalization = new NormalizationBuilder($this); } return $this->normalization; }
php
protected function normalization() { if (null === $this->normalization) { $this->normalization = new NormalizationBuilder($this); } return $this->normalization; }
[ "protected", "function", "normalization", "(", ")", "{", "if", "(", "null", "===", "$", "this", "->", "normalization", ")", "{", "$", "this", "->", "normalization", "=", "new", "NormalizationBuilder", "(", "$", "this", ")", ";", "}", "return", "$", "this...
Gets the builder for normalization rules. @return NormalizationBuilder
[ "Gets", "the", "builder", "for", "normalization", "rules", "." ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Config/Definition/Builder/NodeDefinition.php#L334-L341
train
Returns the normalization builder
[ 30522, 5123, 3853, 3671, 3989, 1006, 1007, 1063, 2065, 1006, 19701, 1027, 1027, 1027, 1002, 2023, 1011, 1028, 3671, 3989, 1007, 1063, 1002, 2023, 1011, 1028, 3671, 3989, 1027, 2047, 3671, 3989, 8569, 23891, 2099, 1006, 1002, 2023, 1007, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
octobercms/october
modules/backend/behaviors/ImportExportController.php
ImportExportController.createCsvReader
protected function createCsvReader($path) { $reader = CsvReader::createFromPath($path); $options = $this->getFormatOptionsFromPost(); if ($options['delimiter'] !== null) { $reader->setDelimiter($options['delimiter']); } if ($options['enclosure'] !== null) { $reader->setEnclosure($options['enclosure']); } if ($options['escape'] !== null) { $reader->setEscape($options['escape']); } if ( $options['encoding'] !== null && $reader->isActiveStreamFilter() ) { $reader->appendStreamFilter(sprintf( '%s%s:%s', TranscodeFilter::FILTER_NAME, strtolower($options['encoding']), 'utf-8' )); } return $reader; }
php
protected function createCsvReader($path) { $reader = CsvReader::createFromPath($path); $options = $this->getFormatOptionsFromPost(); if ($options['delimiter'] !== null) { $reader->setDelimiter($options['delimiter']); } if ($options['enclosure'] !== null) { $reader->setEnclosure($options['enclosure']); } if ($options['escape'] !== null) { $reader->setEscape($options['escape']); } if ( $options['encoding'] !== null && $reader->isActiveStreamFilter() ) { $reader->appendStreamFilter(sprintf( '%s%s:%s', TranscodeFilter::FILTER_NAME, strtolower($options['encoding']), 'utf-8' )); } return $reader; }
[ "protected", "function", "createCsvReader", "(", "$", "path", ")", "{", "$", "reader", "=", "CsvReader", "::", "createFromPath", "(", "$", "path", ")", ";", "$", "options", "=", "$", "this", "->", "getFormatOptionsFromPost", "(", ")", ";", "if", "(", "$"...
Create a new CSV reader with options selected by the user @param string $path @return CsvReader
[ "Create", "a", "new", "CSV", "reader", "with", "options", "selected", "by", "the", "user", "@param", "string", "$path" ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/behaviors/ImportExportController.php#L760-L790
train
Create CsvReader with options from POST
[ 30522, 5123, 3853, 3443, 6169, 12229, 9648, 2099, 1006, 1002, 4130, 1007, 1063, 1002, 8068, 1027, 20116, 12229, 9648, 2099, 1024, 1024, 3443, 19699, 25377, 8988, 1006, 1002, 4130, 1007, 1025, 1002, 7047, 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...
octobercms/october
modules/backend/formwidgets/FileUpload.php
FileUpload.onSortAttachments
public function onSortAttachments() { if ($sortData = post('sortOrder')) { $ids = array_keys($sortData); $orders = array_values($sortData); $fileModel = $this->getRelationModel(); $fileModel->setSortableOrder($ids, $orders); } }
php
public function onSortAttachments() { if ($sortData = post('sortOrder')) { $ids = array_keys($sortData); $orders = array_values($sortData); $fileModel = $this->getRelationModel(); $fileModel->setSortableOrder($ids, $orders); } }
[ "public", "function", "onSortAttachments", "(", ")", "{", "if", "(", "$", "sortData", "=", "post", "(", "'sortOrder'", ")", ")", "{", "$", "ids", "=", "array_keys", "(", "$", "sortData", ")", ";", "$", "orders", "=", "array_values", "(", "$", "sortData...
Sorts file attachments.
[ "Sorts", "file", "attachments", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/formwidgets/FileUpload.php#L288-L297
train
onSortAttachments callback.
[ 30522, 2270, 3853, 2006, 21748, 29336, 2696, 22729, 2015, 1006, 1007, 1063, 2065, 1006, 1002, 4066, 2850, 2696, 1027, 2695, 1006, 1005, 4066, 8551, 2121, 1005, 1007, 1007, 1063, 1002, 8909, 2015, 1027, 9140, 1035, 6309, 1006, 1002, 4066, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/PropertyInfo/Extractor/ReflectionExtractor.php
ReflectionExtractor.getTypes
public function getTypes($class, $property, array $context = []) { if ($fromMutator = $this->extractFromMutator($class, $property)) { return $fromMutator; } if ($fromAccessor = $this->extractFromAccessor($class, $property)) { return $fromAccessor; } if ( ($context['enable_constructor_extraction'] ?? $this->enableConstructorExtraction) && $fromConstructor = $this->extractFromConstructor($class, $property) ) { return $fromConstructor; } if ($fromDefaultValue = $this->extractFromDefaultValue($class, $property)) { return $fromDefaultValue; } }
php
public function getTypes($class, $property, array $context = []) { if ($fromMutator = $this->extractFromMutator($class, $property)) { return $fromMutator; } if ($fromAccessor = $this->extractFromAccessor($class, $property)) { return $fromAccessor; } if ( ($context['enable_constructor_extraction'] ?? $this->enableConstructorExtraction) && $fromConstructor = $this->extractFromConstructor($class, $property) ) { return $fromConstructor; } if ($fromDefaultValue = $this->extractFromDefaultValue($class, $property)) { return $fromDefaultValue; } }
[ "public", "function", "getTypes", "(", "$", "class", ",", "$", "property", ",", "array", "$", "context", "=", "[", "]", ")", "{", "if", "(", "$", "fromMutator", "=", "$", "this", "->", "extractFromMutator", "(", "$", "class", ",", "$", "property", ")...
{@inheritdoc}
[ "{" ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/PropertyInfo/Extractor/ReflectionExtractor.php#L134-L154
train
Get types from class property
[ 30522, 2270, 3853, 2131, 13874, 2015, 1006, 1002, 2465, 1010, 1002, 3200, 1010, 9140, 1002, 6123, 1027, 1031, 1033, 1007, 1063, 2065, 1006, 1002, 2013, 28120, 8844, 1027, 1002, 2023, 1011, 1028, 14817, 19699, 5358, 28120, 8844, 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/HttpFoundation/Session/Attribute/NamespacedAttributeBag.php
NamespacedAttributeBag.has
public function has($name) { // reference mismatch: if fixed, re-introduced in array_key_exists; keep as it is $attributes = $this->resolveAttributePath($name); $name = $this->resolveKey($name); if (null === $attributes) { return false; } return \array_key_exists($name, $attributes); }
php
public function has($name) { // reference mismatch: if fixed, re-introduced in array_key_exists; keep as it is $attributes = $this->resolveAttributePath($name); $name = $this->resolveKey($name); if (null === $attributes) { return false; } return \array_key_exists($name, $attributes); }
[ "public", "function", "has", "(", "$", "name", ")", "{", "// reference mismatch: if fixed, re-introduced in array_key_exists; keep as it is", "$", "attributes", "=", "$", "this", "->", "resolveAttributePath", "(", "$", "name", ")", ";", "$", "name", "=", "$", "this"...
{@inheritdoc}
[ "{" ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpFoundation/Session/Attribute/NamespacedAttributeBag.php#L37-L48
train
Has attribute name
[ 30522, 2270, 3853, 2038, 1006, 1002, 2171, 1007, 1063, 1013, 1013, 4431, 28616, 18900, 2818, 1024, 2065, 4964, 1010, 2128, 1011, 3107, 1999, 9140, 1035, 3145, 1035, 6526, 1025, 2562, 2004, 2009, 2003, 1002, 12332, 1027, 1002, 2023, 1011, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
dompdf/dompdf
src/Frame.php
Frame.get_content_box
public function get_content_box() { $style = $this->_style; $cb = $this->_containing_block; $x = $this->_position["x"] + (float)$style->length_in_pt(array($style->margin_left, $style->border_left_width, $style->padding_left), $cb["w"]); $y = $this->_position["y"] + (float)$style->length_in_pt(array($style->margin_top, $style->border_top_width, $style->padding_top), $cb["h"]); $w = $style->length_in_pt($style->width, $cb["w"]); $h = $style->length_in_pt($style->height, $cb["h"]); return array(0 => $x, "x" => $x, 1 => $y, "y" => $y, 2 => $w, "w" => $w, 3 => $h, "h" => $h); }
php
public function get_content_box() { $style = $this->_style; $cb = $this->_containing_block; $x = $this->_position["x"] + (float)$style->length_in_pt(array($style->margin_left, $style->border_left_width, $style->padding_left), $cb["w"]); $y = $this->_position["y"] + (float)$style->length_in_pt(array($style->margin_top, $style->border_top_width, $style->padding_top), $cb["h"]); $w = $style->length_in_pt($style->width, $cb["w"]); $h = $style->length_in_pt($style->height, $cb["h"]); return array(0 => $x, "x" => $x, 1 => $y, "y" => $y, 2 => $w, "w" => $w, 3 => $h, "h" => $h); }
[ "public", "function", "get_content_box", "(", ")", "{", "$", "style", "=", "$", "this", "->", "_style", ";", "$", "cb", "=", "$", "this", "->", "_containing_block", ";", "$", "x", "=", "$", "this", "->", "_position", "[", "\"x\"", "]", "+", "(", "f...
Return the content box (x,y,w,h) of the frame @return array
[ "Return", "the", "content", "box", "(", "x", "y", "w", "h", ")", "of", "the", "frame" ]
75f13c700009be21a1965dc2c5b68a8708c22ba2
https://github.com/dompdf/dompdf/blob/75f13c700009be21a1965dc2c5b68a8708c22ba2/src/Frame.php#L533-L558
train
Return the content box of the page
[ 30522, 2270, 3853, 2131, 1035, 4180, 1035, 3482, 1006, 1007, 1063, 1002, 2806, 1027, 1002, 2023, 1011, 1028, 1035, 2806, 1025, 1002, 17324, 1027, 1002, 2023, 1011, 1028, 1035, 4820, 1035, 3796, 1025, 1002, 1060, 1027, 1002, 2023, 1011, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php
AssetsInstallCommand.symlink
private function symlink(string $originDir, string $targetDir, bool $relative = false) { if ($relative) { $this->filesystem->mkdir(\dirname($targetDir)); $originDir = $this->filesystem->makePathRelative($originDir, realpath(\dirname($targetDir))); } $this->filesystem->symlink($originDir, $targetDir); if (!file_exists($targetDir)) { throw new IOException(sprintf('Symbolic link "%s" was created but appears to be broken.', $targetDir), 0, null, $targetDir); } }
php
private function symlink(string $originDir, string $targetDir, bool $relative = false) { if ($relative) { $this->filesystem->mkdir(\dirname($targetDir)); $originDir = $this->filesystem->makePathRelative($originDir, realpath(\dirname($targetDir))); } $this->filesystem->symlink($originDir, $targetDir); if (!file_exists($targetDir)) { throw new IOException(sprintf('Symbolic link "%s" was created but appears to be broken.', $targetDir), 0, null, $targetDir); } }
[ "private", "function", "symlink", "(", "string", "$", "originDir", ",", "string", "$", "targetDir", ",", "bool", "$", "relative", "=", "false", ")", "{", "if", "(", "$", "relative", ")", "{", "$", "this", "->", "filesystem", "->", "mkdir", "(", "\\", ...
Creates symbolic link. @throws IOException if link can not be created
[ "Creates", "symbolic", "link", "." ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php#L241-L251
train
Creates a symlink to the origin directory.
[ 30522, 2797, 3853, 25353, 19968, 19839, 1006, 5164, 1002, 4761, 4305, 2099, 1010, 5164, 1002, 4539, 4305, 2099, 1010, 22017, 2140, 1002, 5816, 1027, 6270, 1007, 1063, 2065, 1006, 1002, 5816, 1007, 1063, 1002, 2023, 1011, 1028, 6764, 27268, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/HttpKernel/EventListener/FragmentListener.php
FragmentListener.onKernelRequest
public function onKernelRequest(GetResponseEvent $event) { $request = $event->getRequest(); if ($this->fragmentPath !== rawurldecode($request->getPathInfo())) { return; } if ($request->attributes->has('_controller')) { // Is a sub-request: no need to parse _path but it should still be removed from query parameters as below. $request->query->remove('_path'); return; } if ($event->isMasterRequest()) { $this->validateRequest($request); } parse_str($request->query->get('_path', ''), $attributes); $request->attributes->add($attributes); $request->attributes->set('_route_params', array_replace($request->attributes->get('_route_params', []), $attributes)); $request->query->remove('_path'); }
php
public function onKernelRequest(GetResponseEvent $event) { $request = $event->getRequest(); if ($this->fragmentPath !== rawurldecode($request->getPathInfo())) { return; } if ($request->attributes->has('_controller')) { // Is a sub-request: no need to parse _path but it should still be removed from query parameters as below. $request->query->remove('_path'); return; } if ($event->isMasterRequest()) { $this->validateRequest($request); } parse_str($request->query->get('_path', ''), $attributes); $request->attributes->add($attributes); $request->attributes->set('_route_params', array_replace($request->attributes->get('_route_params', []), $attributes)); $request->query->remove('_path'); }
[ "public", "function", "onKernelRequest", "(", "GetResponseEvent", "$", "event", ")", "{", "$", "request", "=", "$", "event", "->", "getRequest", "(", ")", ";", "if", "(", "$", "this", "->", "fragmentPath", "!==", "rawurldecode", "(", "$", "request", "->", ...
Fixes request attributes when the path is '/_fragment'. @throws AccessDeniedHttpException if the request does not come from a trusted IP
[ "Fixes", "request", "attributes", "when", "the", "path", "is", "/", "_fragment", "." ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpKernel/EventListener/FragmentListener.php#L54-L77
train
Called when a kernel request is dispatched.
[ 30522, 2270, 3853, 2006, 5484, 11877, 2890, 15500, 1006, 2131, 6072, 26029, 19763, 15338, 1002, 2724, 1007, 1063, 1002, 5227, 1027, 1002, 2724, 1011, 1028, 2131, 2890, 15500, 1006, 1007, 1025, 2065, 1006, 1002, 2023, 1011, 1028, 15778, 1506...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
overtrue/wechat
src/OpenPlatform/Application.php
Application.officialAccount
public function officialAccount(string $appId, string $refreshToken = null, AccessToken $accessToken = null): OfficialAccount { $application = new OfficialAccount($this->getAuthorizerConfig($appId, $refreshToken), $this->getReplaceServices($accessToken) + [ 'encryptor' => $this['encryptor'], 'account' => function ($app) { return new AccountClient($app, $this); }, ]); $application->extend('oauth', function ($socialite) { /* @var \Overtrue\Socialite\Providers\WeChatProvider $socialite */ return $socialite->component(new ComponentDelegate($this)); }); return $application; }
php
public function officialAccount(string $appId, string $refreshToken = null, AccessToken $accessToken = null): OfficialAccount { $application = new OfficialAccount($this->getAuthorizerConfig($appId, $refreshToken), $this->getReplaceServices($accessToken) + [ 'encryptor' => $this['encryptor'], 'account' => function ($app) { return new AccountClient($app, $this); }, ]); $application->extend('oauth', function ($socialite) { /* @var \Overtrue\Socialite\Providers\WeChatProvider $socialite */ return $socialite->component(new ComponentDelegate($this)); }); return $application; }
[ "public", "function", "officialAccount", "(", "string", "$", "appId", ",", "string", "$", "refreshToken", "=", "null", ",", "AccessToken", "$", "accessToken", "=", "null", ")", ":", "OfficialAccount", "{", "$", "application", "=", "new", "OfficialAccount", "("...
Creates the officialAccount application. @param string $appId @param string|null $refreshToken @param \EasyWeChat\OpenPlatform\Authorizer\Auth\AccessToken|null $accessToken @return \EasyWeChat\OpenPlatform\Authorizer\OfficialAccount\Application
[ "Creates", "the", "officialAccount", "application", "." ]
120c72faaa93c270365bc75c73c362d5fd583209
https://github.com/overtrue/wechat/blob/120c72faaa93c270365bc75c73c362d5fd583209/src/OpenPlatform/Application.php#L71-L87
train
Return an account with all the services needed to authenticate with the application
[ 30522, 2270, 3853, 2880, 6305, 3597, 16671, 1006, 5164, 1002, 10439, 3593, 1010, 5164, 1002, 25416, 21898, 18715, 2368, 1027, 19701, 1010, 3229, 18715, 2368, 1002, 3229, 18715, 2368, 1027, 19701, 1007, 1024, 2880, 6305, 3597, 16671, 1063, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
z-song/laravel-admin
src/Grid/Model.php
Model.handleInvalidPage
protected function handleInvalidPage(LengthAwarePaginator $paginator) { if ($paginator->lastPage() && $paginator->currentPage() > $paginator->lastPage()) { $lastPageUrl = Request::fullUrlWithQuery([ $paginator->getPageName() => $paginator->lastPage(), ]); Pjax::respond(redirect($lastPageUrl)); } }
php
protected function handleInvalidPage(LengthAwarePaginator $paginator) { if ($paginator->lastPage() && $paginator->currentPage() > $paginator->lastPage()) { $lastPageUrl = Request::fullUrlWithQuery([ $paginator->getPageName() => $paginator->lastPage(), ]); Pjax::respond(redirect($lastPageUrl)); } }
[ "protected", "function", "handleInvalidPage", "(", "LengthAwarePaginator", "$", "paginator", ")", "{", "if", "(", "$", "paginator", "->", "lastPage", "(", ")", "&&", "$", "paginator", "->", "currentPage", "(", ")", ">", "$", "paginator", "->", "lastPage", "(...
If current page is greater than last page, then redirect to last page. @param LengthAwarePaginator $paginator @return void
[ "If", "current", "page", "is", "greater", "than", "last", "page", "then", "redirect", "to", "last", "page", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Grid/Model.php#L423-L432
train
Handle invalid page
[ 30522, 5123, 3853, 5047, 2378, 10175, 3593, 13704, 1006, 3091, 10830, 2890, 4502, 20876, 4263, 1002, 6643, 20876, 4263, 1007, 1063, 2065, 1006, 1002, 6643, 20876, 4263, 1011, 1028, 2197, 13704, 1006, 1007, 1004, 1004, 1002, 6643, 20876, 426...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
libs/Zend/Db/Adapter/Db2.php
Zend_Db_Adapter_Db2.getServerVersion
public function getServerVersion() { $this->_connect(); $server_info = db2_server_info($this->_connection); if ($server_info !== false) { $version = $server_info->DBMS_VER; if ($this->_isI5) { $version = (int) substr($version, 0, 2) . '.' . (int) substr($version, 2, 2) . '.' . (int) substr($version, 4); } return $version; } else { return null; } }
php
public function getServerVersion() { $this->_connect(); $server_info = db2_server_info($this->_connection); if ($server_info !== false) { $version = $server_info->DBMS_VER; if ($this->_isI5) { $version = (int) substr($version, 0, 2) . '.' . (int) substr($version, 2, 2) . '.' . (int) substr($version, 4); } return $version; } else { return null; } }
[ "public", "function", "getServerVersion", "(", ")", "{", "$", "this", "->", "_connect", "(", ")", ";", "$", "server_info", "=", "db2_server_info", "(", "$", "this", "->", "_connection", ")", ";", "if", "(", "$", "server_info", "!==", "false", ")", "{", ...
Retrieve server version in PHP style @return string
[ "Retrieve", "server", "version", "in", "PHP", "style" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Adapter/Db2.php#L726-L739
train
Get Server Version
[ 30522, 2270, 3853, 4152, 2121, 6299, 27774, 1006, 1007, 1063, 1002, 2023, 1011, 1028, 1035, 7532, 1006, 1007, 1025, 1002, 8241, 1035, 18558, 1027, 16962, 2475, 1035, 8241, 1035, 18558, 1006, 1002, 2023, 1011, 1028, 1035, 4434, 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/HttpKernel/HttpCache/HttpCache.php
HttpCache.waitForLock
private function waitForLock(Request $request): bool { $wait = 0; while ($this->store->isLocked($request) && $wait < 100) { usleep(50000); ++$wait; } return $wait < 100; }
php
private function waitForLock(Request $request): bool { $wait = 0; while ($this->store->isLocked($request) && $wait < 100) { usleep(50000); ++$wait; } return $wait < 100; }
[ "private", "function", "waitForLock", "(", "Request", "$", "request", ")", ":", "bool", "{", "$", "wait", "=", "0", ";", "while", "(", "$", "this", "->", "store", "->", "isLocked", "(", "$", "request", ")", "&&", "$", "wait", "<", "100", ")", "{", ...
Waits for the store to release a locked entry.
[ "Waits", "for", "the", "store", "to", "release", "a", "locked", "entry", "." ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php#L704-L713
train
Wait for the lock for the given request
[ 30522, 2797, 3853, 3524, 29278, 7878, 1006, 5227, 1002, 5227, 1007, 1024, 22017, 2140, 1063, 1002, 3524, 1027, 1014, 1025, 30524, 3573, 1011, 1028, 2003, 7878, 2098, 1006, 1002, 5227, 1007, 1004, 1004, 1002, 3524, 1026, 2531, 1007, 1063, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
core/Report/ReportWidgetFactory.php
ReportWidgetFactory.createWidget
public function createWidget() { $widget = new ReportWidgetConfig(); $widget->setName($this->report->getName()); $widget->setCategoryId($this->report->getCategoryId()); if ($this->report->getDefaultTypeViewDataTable()) { $widget->setDefaultViewDataTable($this->report->getDefaultTypeViewDataTable()); } if ($this->report->getSubcategoryId()) { $widget->setSubcategoryId($this->report->getSubcategoryId()); } $widget->setModule($this->report->getModule()); $widget->setAction($this->report->getAction()); $orderThatListsReportsAtTheEndOfEachCategory = 100 + $this->report->getOrder(); $widget->setOrder($orderThatListsReportsAtTheEndOfEachCategory); $parameters = $this->report->getParameters(); if (!empty($parameters)) { $widget->setParameters($parameters); } return $widget; }
php
public function createWidget() { $widget = new ReportWidgetConfig(); $widget->setName($this->report->getName()); $widget->setCategoryId($this->report->getCategoryId()); if ($this->report->getDefaultTypeViewDataTable()) { $widget->setDefaultViewDataTable($this->report->getDefaultTypeViewDataTable()); } if ($this->report->getSubcategoryId()) { $widget->setSubcategoryId($this->report->getSubcategoryId()); } $widget->setModule($this->report->getModule()); $widget->setAction($this->report->getAction()); $orderThatListsReportsAtTheEndOfEachCategory = 100 + $this->report->getOrder(); $widget->setOrder($orderThatListsReportsAtTheEndOfEachCategory); $parameters = $this->report->getParameters(); if (!empty($parameters)) { $widget->setParameters($parameters); } return $widget; }
[ "public", "function", "createWidget", "(", ")", "{", "$", "widget", "=", "new", "ReportWidgetConfig", "(", ")", ";", "$", "widget", "->", "setName", "(", "$", "this", "->", "report", "->", "getName", "(", ")", ")", ";", "$", "widget", "->", "setCategor...
Creates a widget based on the specified report in {@link construct()}. It will automatically use the report's name, categoryId, subcategoryId (if specified), defaultViewDataTable, module, action, order and parameters in order to create the widget. @return ReportWidgetConfig
[ "Creates", "a", "widget", "based", "on", "the", "specified", "report", "in", "{", "@link", "construct", "()", "}", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Report/ReportWidgetFactory.php#L46-L72
train
Create a new report widget config
[ 30522, 2270, 3853, 3443, 9148, 24291, 1006, 1007, 1063, 1002, 15536, 24291, 1027, 2047, 3189, 9148, 24291, 8663, 8873, 2290, 1006, 1007, 1025, 1002, 15536, 24291, 1011, 1028, 2275, 18442, 1006, 1002, 2023, 1011, 1028, 3189, 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...
dompdf/dompdf
src/Cellmap.php
Cellmap.remove_row_group
public function remove_row_group(Frame $group) { $key = $group->get_id(); if (!isset($this->_frames[$key])) { return; // Presumably this row has alredy been removed } $iter = $group->get_first_child(); while ($iter) { $this->remove_row($iter); $iter = $iter->get_next_sibling(); } $this->_frames[$key] = null; unset($this->_frames[$key]); }
php
public function remove_row_group(Frame $group) { $key = $group->get_id(); if (!isset($this->_frames[$key])) { return; // Presumably this row has alredy been removed } $iter = $group->get_first_child(); while ($iter) { $this->remove_row($iter); $iter = $iter->get_next_sibling(); } $this->_frames[$key] = null; unset($this->_frames[$key]); }
[ "public", "function", "remove_row_group", "(", "Frame", "$", "group", ")", "{", "$", "key", "=", "$", "group", "->", "get_id", "(", ")", ";", "if", "(", "!", "isset", "(", "$", "this", "->", "_frames", "[", "$", "key", "]", ")", ")", "{", "return...
Remove a row group from the cellmap. @param Frame $group The group to remove
[ "Remove", "a", "row", "group", "from", "the", "cellmap", "." ]
75f13c700009be21a1965dc2c5b68a8708c22ba2
https://github.com/dompdf/dompdf/blob/75f13c700009be21a1965dc2c5b68a8708c22ba2/src/Cellmap.php#L774-L789
train
Remove a row group
[ 30522, 2270, 3853, 6366, 1035, 5216, 1035, 2177, 1006, 4853, 1002, 2177, 1007, 1063, 1002, 3145, 1027, 1002, 2177, 1011, 1028, 2131, 1035, 8909, 1006, 1007, 1025, 2065, 1006, 999, 26354, 3388, 1006, 1002, 2023, 1011, 1028, 1035, 11048, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/HttpClient/Response/ResponseTrait.php
ResponseTrait.getHeaders
public function getHeaders(bool $throw = true): array { if ($this->initializer) { ($this->initializer)($this); $this->initializer = null; } if ($throw) { $this->checkStatusCode(); } return $this->headers; }
php
public function getHeaders(bool $throw = true): array { if ($this->initializer) { ($this->initializer)($this); $this->initializer = null; } if ($throw) { $this->checkStatusCode(); } return $this->headers; }
[ "public", "function", "getHeaders", "(", "bool", "$", "throw", "=", "true", ")", ":", "array", "{", "if", "(", "$", "this", "->", "initializer", ")", "{", "(", "$", "this", "->", "initializer", ")", "(", "$", "this", ")", ";", "$", "this", "->", ...
{@inheritdoc}
[ "{" ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpClient/Response/ResponseTrait.php#L77-L89
train
Get Headers array
[ 30522, 2270, 3853, 2131, 4974, 2545, 1006, 22017, 2140, 1002, 5466, 1027, 2995, 1007, 1024, 9140, 1063, 2065, 1006, 1002, 2023, 1011, 1028, 3988, 17629, 1007, 1063, 1006, 1002, 2023, 1011, 1028, 3988, 17629, 1007, 1006, 1002, 2023, 1007, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/Cache/Adapter/ChainAdapter.php
ChainAdapter.deleteItem
public function deleteItem($key) { $deleted = true; $i = $this->adapterCount; while ($i--) { $deleted = $this->adapters[$i]->deleteItem($key) && $deleted; } return $deleted; }
php
public function deleteItem($key) { $deleted = true; $i = $this->adapterCount; while ($i--) { $deleted = $this->adapters[$i]->deleteItem($key) && $deleted; } return $deleted; }
[ "public", "function", "deleteItem", "(", "$", "key", ")", "{", "$", "deleted", "=", "true", ";", "$", "i", "=", "$", "this", "->", "adapterCount", ";", "while", "(", "$", "i", "--", ")", "{", "$", "deleted", "=", "$", "this", "->", "adapters", "[...
{@inheritdoc}
[ "{" ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Cache/Adapter/ChainAdapter.php#L211-L221
train
Delete an item from the cache
[ 30522, 2270, 3853, 3972, 12870, 4221, 2213, 1006, 1002, 3145, 1007, 1063, 1002, 17159, 1027, 2995, 1025, 1002, 1045, 1027, 1002, 2023, 1011, 1028, 15581, 2121, 3597, 16671, 1025, 2096, 1006, 1002, 1045, 1011, 1011, 1007, 1063, 1002, 17159, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/DependencyInjection/Loader/FileLoader.php
FileLoader.registerClasses
public function registerClasses(Definition $prototype, $namespace, $resource, $exclude = null) { if ('\\' !== substr($namespace, -1)) { throw new InvalidArgumentException(sprintf('Namespace prefix must end with a "\\": %s.', $namespace)); } if (!preg_match('/^(?:[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*+\\\\)++$/', $namespace)) { throw new InvalidArgumentException(sprintf('Namespace is not a valid PSR-4 prefix: %s.', $namespace)); } $classes = $this->findClasses($namespace, $resource, (array) $exclude); // prepare for deep cloning $serializedPrototype = serialize($prototype); $interfaces = []; $singlyImplemented = []; foreach ($classes as $class => $errorMessage) { if (interface_exists($class, false)) { $interfaces[] = $class; } else { $this->setDefinition($class, $definition = unserialize($serializedPrototype)); if (null !== $errorMessage) { $definition->addError($errorMessage); continue; } foreach (class_implements($class, false) as $interface) { $singlyImplemented[$interface] = isset($singlyImplemented[$interface]) ? false : $class; } } } foreach ($interfaces as $interface) { if (!empty($singlyImplemented[$interface])) { $this->container->setAlias($interface, $singlyImplemented[$interface]) ->setPublic(false); } } }
php
public function registerClasses(Definition $prototype, $namespace, $resource, $exclude = null) { if ('\\' !== substr($namespace, -1)) { throw new InvalidArgumentException(sprintf('Namespace prefix must end with a "\\": %s.', $namespace)); } if (!preg_match('/^(?:[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*+\\\\)++$/', $namespace)) { throw new InvalidArgumentException(sprintf('Namespace is not a valid PSR-4 prefix: %s.', $namespace)); } $classes = $this->findClasses($namespace, $resource, (array) $exclude); // prepare for deep cloning $serializedPrototype = serialize($prototype); $interfaces = []; $singlyImplemented = []; foreach ($classes as $class => $errorMessage) { if (interface_exists($class, false)) { $interfaces[] = $class; } else { $this->setDefinition($class, $definition = unserialize($serializedPrototype)); if (null !== $errorMessage) { $definition->addError($errorMessage); continue; } foreach (class_implements($class, false) as $interface) { $singlyImplemented[$interface] = isset($singlyImplemented[$interface]) ? false : $class; } } } foreach ($interfaces as $interface) { if (!empty($singlyImplemented[$interface])) { $this->container->setAlias($interface, $singlyImplemented[$interface]) ->setPublic(false); } } }
[ "public", "function", "registerClasses", "(", "Definition", "$", "prototype", ",", "$", "namespace", ",", "$", "resource", ",", "$", "exclude", "=", "null", ")", "{", "if", "(", "'\\\\'", "!==", "substr", "(", "$", "namespace", ",", "-", "1", ")", ")",...
Registers a set of classes as services using PSR-4 for discovery. @param Definition $prototype A definition to use as template @param string $namespace The namespace prefix of classes in the scanned directory @param string $resource The directory to look for classes, glob-patterns allowed @param string|string[]|null $exclude A globbed path of files to exclude or an array of globbed paths of files to exclude
[ "Registers", "a", "set", "of", "classes", "as", "services", "using", "PSR", "-", "4", "for", "discovery", "." ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/DependencyInjection/Loader/FileLoader.php#L48-L84
train
Registers classes in the container
[ 30522, 2270, 3853, 4236, 26266, 2229, 1006, 6210, 1002, 8773, 1010, 1002, 3415, 15327, 1010, 1002, 7692, 1010, 1002, 23329, 1027, 19701, 1007, 1063, 2065, 1006, 1005, 1032, 1032, 1005, 999, 1027, 1027, 4942, 3367, 2099, 1006, 1002, 3415, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/DataTableFactory.php
DataTableFactory.createDataTable
private function createDataTable($data, $keyMetadata) { if ($this->dataType == 'blob') { $result = $this->makeFromBlobRow($data, $keyMetadata); } else { $result = $this->makeFromMetricsArray($data, $keyMetadata); } return $result; }
php
private function createDataTable($data, $keyMetadata) { if ($this->dataType == 'blob') { $result = $this->makeFromBlobRow($data, $keyMetadata); } else { $result = $this->makeFromMetricsArray($data, $keyMetadata); } return $result; }
[ "private", "function", "createDataTable", "(", "$", "data", ",", "$", "keyMetadata", ")", "{", "if", "(", "$", "this", "->", "dataType", "==", "'blob'", ")", "{", "$", "result", "=", "$", "this", "->", "makeFromBlobRow", "(", "$", "data", ",", "$", "...
Creates a DataTable instance from an index row. @param array $data An archive data row. @param array $keyMetadata The metadata to add to the table(s) when created. @return DataTable|DataTable\Map
[ "Creates", "a", "DataTable", "instance", "from", "an", "index", "row", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Archive/DataTableFactory.php#L357-L366
train
Create a DataTable from the data and key metadata
[ 30522, 2797, 3853, 2580, 6790, 10880, 1006, 1002, 2951, 1010, 1002, 3145, 11368, 8447, 2696, 1007, 1063, 2065, 1006, 1002, 2023, 1011, 1028, 2951, 13874, 1027, 1027, 1005, 1038, 4135, 2497, 1005, 1007, 1063, 1002, 2765, 1027, 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...
PHPMailer/PHPMailer
src/SMTP.php
SMTP.recipient
public function recipient($address, $dsn = '') { if (empty($dsn)) { $rcpt = 'RCPT TO:<' . $address . '>'; } else { $dsn = strtoupper($dsn); $notify = []; if (strpos($dsn, 'NEVER') !== false) { $notify[] = 'NEVER'; } else { foreach (['SUCCESS', 'FAILURE', 'DELAY'] as $value) { if (strpos($dsn, $value) !== false) { $notify[] = $value; } } } $rcpt = 'RCPT TO:<' . $address . '> NOTIFY=' . implode(',', $notify); } return $this->sendCommand( 'RCPT TO', $rcpt, [250, 251] ); }
php
public function recipient($address, $dsn = '') { if (empty($dsn)) { $rcpt = 'RCPT TO:<' . $address . '>'; } else { $dsn = strtoupper($dsn); $notify = []; if (strpos($dsn, 'NEVER') !== false) { $notify[] = 'NEVER'; } else { foreach (['SUCCESS', 'FAILURE', 'DELAY'] as $value) { if (strpos($dsn, $value) !== false) { $notify[] = $value; } } } $rcpt = 'RCPT TO:<' . $address . '> NOTIFY=' . implode(',', $notify); } return $this->sendCommand( 'RCPT TO', $rcpt, [250, 251] ); }
[ "public", "function", "recipient", "(", "$", "address", ",", "$", "dsn", "=", "''", ")", "{", "if", "(", "empty", "(", "$", "dsn", ")", ")", "{", "$", "rcpt", "=", "'RCPT TO:<'", ".", "$", "address", ".", "'>'", ";", "}", "else", "{", "$", "dsn...
Send an SMTP RCPT command. Sets the TO argument to $toaddr. Returns true if the recipient was accepted false if it was rejected. Implements from RFC 821: RCPT <SP> TO:<forward-path> <CRLF>. @param string $address The address the message is being sent to @param string $dsn Comma separated list of DSN notifications. NEVER, SUCCESS, FAILURE or DELAY. If you specify NEVER all other notifications are ignored. @return bool
[ "Send", "an", "SMTP", "RCPT", "command", ".", "Sets", "the", "TO", "argument", "to", "$toaddr", ".", "Returns", "true", "if", "the", "recipient", "was", "accepted", "false", "if", "it", "was", "rejected", ".", "Implements", "from", "RFC", "821", ":", "RC...
3d7132341659a8a201adbc3ba11b1e202ee2857c
https://github.com/PHPMailer/PHPMailer/blob/3d7132341659a8a201adbc3ba11b1e202ee2857c/src/SMTP.php#L861-L887
train
Send a recipient to a node
[ 30522, 2270, 3853, 7799, 1006, 1002, 4769, 1010, 1002, 16233, 2078, 1027, 1005, 1005, 1007, 1063, 2065, 1006, 4064, 1006, 1002, 16233, 2078, 1007, 1007, 1063, 1002, 22110, 13876, 1027, 1005, 22110, 13876, 2000, 1024, 1026, 1005, 1012, 1002,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
z-song/laravel-admin
src/Controllers/PermissionController.php
PermissionController.detail
protected function detail($id) { $permissionModel = config('admin.database.permissions_model'); $show = new Show($permissionModel::findOrFail($id)); $show->id('ID'); $show->slug(trans('admin.slug')); $show->name(trans('admin.name')); $show->http_path(trans('admin.route'))->as(function ($path) { return collect(explode("\r\n", $path))->map(function ($path) { $method = $this->http_method ?: ['ANY']; if (Str::contains($path, ':')) { list($method, $path) = explode(':', $path); $method = explode(',', $method); } $method = collect($method)->map(function ($name) { return strtoupper($name); })->map(function ($name) { return "<span class='label label-primary'>{$name}</span>"; })->implode('&nbsp;'); if (!empty(config('admin.route.prefix'))) { $path = '/'.trim(config('admin.route.prefix'), '/').$path; } return "<div style='margin-bottom: 5px;'>$method<code>$path</code></div>"; })->implode(''); }); $show->created_at(trans('admin.created_at')); $show->updated_at(trans('admin.updated_at')); return $show; }
php
protected function detail($id) { $permissionModel = config('admin.database.permissions_model'); $show = new Show($permissionModel::findOrFail($id)); $show->id('ID'); $show->slug(trans('admin.slug')); $show->name(trans('admin.name')); $show->http_path(trans('admin.route'))->as(function ($path) { return collect(explode("\r\n", $path))->map(function ($path) { $method = $this->http_method ?: ['ANY']; if (Str::contains($path, ':')) { list($method, $path) = explode(':', $path); $method = explode(',', $method); } $method = collect($method)->map(function ($name) { return strtoupper($name); })->map(function ($name) { return "<span class='label label-primary'>{$name}</span>"; })->implode('&nbsp;'); if (!empty(config('admin.route.prefix'))) { $path = '/'.trim(config('admin.route.prefix'), '/').$path; } return "<div style='margin-bottom: 5px;'>$method<code>$path</code></div>"; })->implode(''); }); $show->created_at(trans('admin.created_at')); $show->updated_at(trans('admin.updated_at')); return $show; }
[ "protected", "function", "detail", "(", "$", "id", ")", "{", "$", "permissionModel", "=", "config", "(", "'admin.database.permissions_model'", ")", ";", "$", "show", "=", "new", "Show", "(", "$", "permissionModel", "::", "findOrFail", "(", "$", "id", ")", ...
Make a show builder. @param mixed $id @return Show
[ "Make", "a", "show", "builder", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Controllers/PermissionController.php#L135-L172
train
Detail show.
[ 30522, 5123, 3853, 6987, 1006, 1002, 8909, 1007, 1063, 1002, 6656, 5302, 9247, 1027, 9530, 8873, 2290, 1006, 1005, 4748, 10020, 1012, 7809, 1012, 6656, 2015, 1035, 2944, 1005, 1007, 1025, 1002, 2265, 1027, 2047, 2265, 1006, 1002, 6656, 53...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
libs/Zend/Db/Statement/Sqlsrv.php
Zend_Db_Statement_Sqlsrv.fetch
public function fetch($style = null, $cursor = null, $offset = null) { if (!$this->_stmt) { return false; } if (null === $style) { $style = $this->_fetchMode; } $values = sqlsrv_fetch_array($this->_stmt, SQLSRV_FETCH_ASSOC); if (!$values && (null !== $error = sqlsrv_errors())) { // require_once 'Zend/Db/Statement/Sqlsrv/Exception.php'; throw new Zend_Db_Statement_Sqlsrv_Exception($error); } if (null === $values) { return null; } if (!$this->_keys) { foreach ($values as $key => $value) { $this->_keys[] = $this->_adapter->foldCase($key); } } $values = array_values($values); $row = false; switch ($style) { case Zend_Db::FETCH_NUM: $row = $values; break; case Zend_Db::FETCH_ASSOC: $row = array_combine($this->_keys, $values); break; case Zend_Db::FETCH_BOTH: $assoc = array_combine($this->_keys, $values); $row = array_merge($values, $assoc); break; case Zend_Db::FETCH_OBJ: $row = (object) array_combine($this->_keys, $values); break; case Zend_Db::FETCH_BOUND: $assoc = array_combine($this->_keys, $values); $row = array_merge($values, $assoc); $row = $this->_fetchBound($row); break; default: // require_once 'Zend/Db/Statement/Sqlsrv/Exception.php'; throw new Zend_Db_Statement_Sqlsrv_Exception("Invalid fetch mode '$style' specified"); break; } return $row; }
php
public function fetch($style = null, $cursor = null, $offset = null) { if (!$this->_stmt) { return false; } if (null === $style) { $style = $this->_fetchMode; } $values = sqlsrv_fetch_array($this->_stmt, SQLSRV_FETCH_ASSOC); if (!$values && (null !== $error = sqlsrv_errors())) { // require_once 'Zend/Db/Statement/Sqlsrv/Exception.php'; throw new Zend_Db_Statement_Sqlsrv_Exception($error); } if (null === $values) { return null; } if (!$this->_keys) { foreach ($values as $key => $value) { $this->_keys[] = $this->_adapter->foldCase($key); } } $values = array_values($values); $row = false; switch ($style) { case Zend_Db::FETCH_NUM: $row = $values; break; case Zend_Db::FETCH_ASSOC: $row = array_combine($this->_keys, $values); break; case Zend_Db::FETCH_BOTH: $assoc = array_combine($this->_keys, $values); $row = array_merge($values, $assoc); break; case Zend_Db::FETCH_OBJ: $row = (object) array_combine($this->_keys, $values); break; case Zend_Db::FETCH_BOUND: $assoc = array_combine($this->_keys, $values); $row = array_merge($values, $assoc); $row = $this->_fetchBound($row); break; default: // require_once 'Zend/Db/Statement/Sqlsrv/Exception.php'; throw new Zend_Db_Statement_Sqlsrv_Exception("Invalid fetch mode '$style' specified"); break; } return $row; }
[ "public", "function", "fetch", "(", "$", "style", "=", "null", ",", "$", "cursor", "=", "null", ",", "$", "offset", "=", "null", ")", "{", "if", "(", "!", "$", "this", "->", "_stmt", ")", "{", "return", "false", ";", "}", "if", "(", "null", "==...
Fetches a row from the result set. @param int $style OPTIONAL Fetch mode for this fetch operation. @param int $cursor OPTIONAL Absolute, relative, or other. @param int $offset OPTIONAL Number for absolute or relative cursors. @return mixed Array, object, or scalar depending on fetch mode. @throws Zend_Db_Statement_Exception
[ "Fetches", "a", "row", "from", "the", "result", "set", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Statement/Sqlsrv.php#L223-L279
train
Fetch a result
[ 30522, 2270, 3853, 18584, 1006, 1002, 2806, 1027, 19701, 1010, 1002, 12731, 25301, 2099, 1027, 19701, 1010, 1002, 16396, 1027, 19701, 1007, 1063, 2065, 1006, 999, 1002, 2023, 1011, 1028, 1035, 2358, 30524, 20492, 1010, 29296, 21338, 2615, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
core/Notification.php
Notification.getPriority
public function getPriority() { if (!isset($this->priority)) { $typeToPriority = array(static::CONTEXT_ERROR => static::PRIORITY_MAX, static::CONTEXT_WARNING => static::PRIORITY_HIGH, static::CONTEXT_SUCCESS => static::PRIORITY_MIN, static::CONTEXT_INFO => static::PRIORITY_LOW); if (array_key_exists($this->context, $typeToPriority)) { return $typeToPriority[$this->context]; } return static::PRIORITY_LOW; } return $this->priority; }
php
public function getPriority() { if (!isset($this->priority)) { $typeToPriority = array(static::CONTEXT_ERROR => static::PRIORITY_MAX, static::CONTEXT_WARNING => static::PRIORITY_HIGH, static::CONTEXT_SUCCESS => static::PRIORITY_MIN, static::CONTEXT_INFO => static::PRIORITY_LOW); if (array_key_exists($this->context, $typeToPriority)) { return $typeToPriority[$this->context]; } return static::PRIORITY_LOW; } return $this->priority; }
[ "public", "function", "getPriority", "(", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "priority", ")", ")", "{", "$", "typeToPriority", "=", "array", "(", "static", "::", "CONTEXT_ERROR", "=>", "static", "::", "PRIORITY_MAX", ",", "static"...
Returns the notification's priority. If no priority has been set, a priority will be set based on the notification's context. @return int
[ "Returns", "the", "notification", "s", "priority", ".", "If", "no", "priority", "has", "been", "set", "a", "priority", "will", "be", "set", "based", "on", "the", "notification", "s", "context", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Notification.php#L197-L213
train
Get priority of the context
[ 30522, 2270, 3853, 2131, 18098, 25346, 3012, 1006, 1007, 1063, 2065, 1006, 999, 26354, 3388, 1006, 1002, 2023, 1011, 1028, 9470, 1007, 1007, 1063, 1002, 2828, 14399, 9488, 15780, 1027, 9140, 1006, 10763, 1024, 1024, 6123, 1035, 7561, 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...
laravel/framework
src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php
BelongsToMany.resolveTableName
protected function resolveTableName($table) { if (! Str::contains($table, '\\') || ! class_exists($table)) { return $table; } $model = new $table; if (! $model instanceof Model) { return $table; } if ($model instanceof Pivot) { $this->using($table); } return $model->getTable(); }
php
protected function resolveTableName($table) { if (! Str::contains($table, '\\') || ! class_exists($table)) { return $table; } $model = new $table; if (! $model instanceof Model) { return $table; } if ($model instanceof Pivot) { $this->using($table); } return $model->getTable(); }
[ "protected", "function", "resolveTableName", "(", "$", "table", ")", "{", "if", "(", "!", "Str", "::", "contains", "(", "$", "table", ",", "'\\\\'", ")", "||", "!", "class_exists", "(", "$", "table", ")", ")", "{", "return", "$", "table", ";", "}", ...
Attempt to resolve the intermediate table name from the given string. @param string $table @return string
[ "Attempt", "to", "resolve", "the", "intermediate", "table", "name", "from", "the", "given", "string", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php#L160-L177
train
Resolve table name
[ 30522, 5123, 3853, 10663, 10880, 18442, 1006, 1002, 2795, 1007, 1063, 2065, 1006, 999, 2358, 2099, 1024, 1024, 3397, 1006, 1002, 2795, 1010, 1005, 1032, 1032, 1005, 1007, 1064, 1064, 999, 2465, 1035, 6526, 1006, 1002, 2795, 1007, 1007, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToArrayTransformer.php
DateTimeToArrayTransformer.transform
public function transform($dateTime) { if (null === $dateTime) { return array_intersect_key([ 'year' => '', 'month' => '', 'day' => '', 'hour' => '', 'minute' => '', 'second' => '', ], array_flip($this->fields)); } if (!$dateTime instanceof \DateTimeInterface) { throw new TransformationFailedException('Expected a \DateTimeInterface.'); } if ($this->inputTimezone !== $this->outputTimezone) { if (!$dateTime instanceof \DateTimeImmutable) { $dateTime = clone $dateTime; } $dateTime = $dateTime->setTimezone(new \DateTimeZone($this->outputTimezone)); } $result = array_intersect_key([ 'year' => $dateTime->format('Y'), 'month' => $dateTime->format('m'), 'day' => $dateTime->format('d'), 'hour' => $dateTime->format('H'), 'minute' => $dateTime->format('i'), 'second' => $dateTime->format('s'), ], array_flip($this->fields)); if (!$this->pad) { foreach ($result as &$entry) { // remove leading zeros $entry = (string) (int) $entry; } // unset reference to keep scope clear unset($entry); } return $result; }
php
public function transform($dateTime) { if (null === $dateTime) { return array_intersect_key([ 'year' => '', 'month' => '', 'day' => '', 'hour' => '', 'minute' => '', 'second' => '', ], array_flip($this->fields)); } if (!$dateTime instanceof \DateTimeInterface) { throw new TransformationFailedException('Expected a \DateTimeInterface.'); } if ($this->inputTimezone !== $this->outputTimezone) { if (!$dateTime instanceof \DateTimeImmutable) { $dateTime = clone $dateTime; } $dateTime = $dateTime->setTimezone(new \DateTimeZone($this->outputTimezone)); } $result = array_intersect_key([ 'year' => $dateTime->format('Y'), 'month' => $dateTime->format('m'), 'day' => $dateTime->format('d'), 'hour' => $dateTime->format('H'), 'minute' => $dateTime->format('i'), 'second' => $dateTime->format('s'), ], array_flip($this->fields)); if (!$this->pad) { foreach ($result as &$entry) { // remove leading zeros $entry = (string) (int) $entry; } // unset reference to keep scope clear unset($entry); } return $result; }
[ "public", "function", "transform", "(", "$", "dateTime", ")", "{", "if", "(", "null", "===", "$", "dateTime", ")", "{", "return", "array_intersect_key", "(", "[", "'year'", "=>", "''", ",", "'month'", "=>", "''", ",", "'day'", "=>", "''", ",", "'hour'"...
Transforms a normalized date into a localized date. @param \DateTimeInterface $dateTime A DateTimeInterface object @return array Localized date @throws TransformationFailedException If the given value is not a \DateTimeInterface
[ "Transforms", "a", "normalized", "date", "into", "a", "localized", "date", "." ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToArrayTransformer.php#L55-L99
train
Transform a \ DateTime object into a array of fields
[ 30522, 2270, 3853, 10938, 1006, 1002, 3058, 7292, 1007, 1063, 2065, 1006, 19701, 1027, 1027, 1027, 1002, 3058, 7292, 1007, 1063, 2709, 9140, 1035, 29261, 1035, 3145, 1006, 1031, 1005, 2095, 1005, 1027, 1028, 1005, 1005, 1010, 1005, 3204, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/AbstractRendererEngine.php
AbstractRendererEngine.getResourceHierarchyLevel
public function getResourceHierarchyLevel(FormView $view, array $blockNameHierarchy, $hierarchyLevel) { $cacheKey = $view->vars[self::CACHE_KEY_VAR]; $blockName = $blockNameHierarchy[$hierarchyLevel]; if (!isset($this->resources[$cacheKey][$blockName])) { $this->loadResourceForBlockNameHierarchy($cacheKey, $view, $blockNameHierarchy, $hierarchyLevel); } // If $block was previously rendered loaded with loadTemplateForBlock(), the template // is cached but the hierarchy level is not. In this case, we know that the block // exists at this very hierarchy level, so we can just set it. if (!isset($this->resourceHierarchyLevels[$cacheKey][$blockName])) { $this->resourceHierarchyLevels[$cacheKey][$blockName] = $hierarchyLevel; } return $this->resourceHierarchyLevels[$cacheKey][$blockName]; }
php
public function getResourceHierarchyLevel(FormView $view, array $blockNameHierarchy, $hierarchyLevel) { $cacheKey = $view->vars[self::CACHE_KEY_VAR]; $blockName = $blockNameHierarchy[$hierarchyLevel]; if (!isset($this->resources[$cacheKey][$blockName])) { $this->loadResourceForBlockNameHierarchy($cacheKey, $view, $blockNameHierarchy, $hierarchyLevel); } // If $block was previously rendered loaded with loadTemplateForBlock(), the template // is cached but the hierarchy level is not. In this case, we know that the block // exists at this very hierarchy level, so we can just set it. if (!isset($this->resourceHierarchyLevels[$cacheKey][$blockName])) { $this->resourceHierarchyLevels[$cacheKey][$blockName] = $hierarchyLevel; } return $this->resourceHierarchyLevels[$cacheKey][$blockName]; }
[ "public", "function", "getResourceHierarchyLevel", "(", "FormView", "$", "view", ",", "array", "$", "blockNameHierarchy", ",", "$", "hierarchyLevel", ")", "{", "$", "cacheKey", "=", "$", "view", "->", "vars", "[", "self", "::", "CACHE_KEY_VAR", "]", ";", "$"...
{@inheritdoc}
[ "{" ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/AbstractRendererEngine.php#L93-L110
train
Returns the hierarchy level of the block
[ 30522, 2270, 3853, 2131, 6072, 8162, 3401, 4048, 6906, 29389, 20414, 2884, 1006, 2433, 8584, 1002, 3193, 1010, 9140, 1002, 3796, 18442, 4048, 6906, 29389, 1010, 1002, 12571, 20414, 2884, 1007, 1063, 1002, 17053, 14839, 1027, 1002, 3193, 101...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
octobercms/october
modules/backend/formwidgets/MediaFinder.php
MediaFinder.prepareVars
public function prepareVars() { $value = $this->getLoadValue(); $this->vars['value'] = $value; $this->vars['imageUrl'] = $value ? MediaLibrary::url($value) : ''; $this->vars['field'] = $this->formField; $this->vars['prompt'] = str_replace('%s', '<i class="icon-folder"></i>', trans($this->prompt)); $this->vars['mode'] = $this->mode; $this->vars['imageWidth'] = $this->imageWidth; $this->vars['imageHeight'] = $this->imageHeight; }
php
public function prepareVars() { $value = $this->getLoadValue(); $this->vars['value'] = $value; $this->vars['imageUrl'] = $value ? MediaLibrary::url($value) : ''; $this->vars['field'] = $this->formField; $this->vars['prompt'] = str_replace('%s', '<i class="icon-folder"></i>', trans($this->prompt)); $this->vars['mode'] = $this->mode; $this->vars['imageWidth'] = $this->imageWidth; $this->vars['imageHeight'] = $this->imageHeight; }
[ "public", "function", "prepareVars", "(", ")", "{", "$", "value", "=", "$", "this", "->", "getLoadValue", "(", ")", ";", "$", "this", "->", "vars", "[", "'value'", "]", "=", "$", "value", ";", "$", "this", "->", "vars", "[", "'imageUrl'", "]", "=",...
Prepares the list data
[ "Prepares", "the", "list", "data" ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/formwidgets/MediaFinder.php#L84-L94
train
Prepare form field variables
[ 30522, 2270, 3853, 7374, 10755, 2015, 1006, 1007, 1063, 1002, 3643, 1027, 1002, 2023, 1011, 1028, 2131, 11066, 10175, 5657, 1006, 1007, 1025, 1002, 2023, 1011, 1028, 13075, 2015, 1031, 1005, 3643, 1005, 1033, 1027, 1002, 3643, 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...
matomo-org/matomo
libs/Zend/Cache/Backend/TwoLevels.php
Zend_Cache_Backend_TwoLevels.getCapabilities
public function getCapabilities() { $slowBackendCapabilities = $this->_slowBackend->getCapabilities(); return array( 'automatic_cleaning' => $slowBackendCapabilities['automatic_cleaning'], 'tags' => $slowBackendCapabilities['tags'], 'expired_read' => $slowBackendCapabilities['expired_read'], 'priority' => $slowBackendCapabilities['priority'], 'infinite_lifetime' => $slowBackendCapabilities['infinite_lifetime'], 'get_list' => $slowBackendCapabilities['get_list'] ); }
php
public function getCapabilities() { $slowBackendCapabilities = $this->_slowBackend->getCapabilities(); return array( 'automatic_cleaning' => $slowBackendCapabilities['automatic_cleaning'], 'tags' => $slowBackendCapabilities['tags'], 'expired_read' => $slowBackendCapabilities['expired_read'], 'priority' => $slowBackendCapabilities['priority'], 'infinite_lifetime' => $slowBackendCapabilities['infinite_lifetime'], 'get_list' => $slowBackendCapabilities['get_list'] ); }
[ "public", "function", "getCapabilities", "(", ")", "{", "$", "slowBackendCapabilities", "=", "$", "this", "->", "_slowBackend", "->", "getCapabilities", "(", ")", ";", "return", "array", "(", "'automatic_cleaning'", "=>", "$", "slowBackendCapabilities", "[", "'aut...
Return an associative array of capabilities (booleans) of the backend The array must include these keys : - automatic_cleaning (is automating cleaning necessary) - tags (are tags supported) - expired_read (is it possible to read expired cache records (for doNotTestCacheValidity option for example)) - priority does the backend deal with priority when saving - infinite_lifetime (is infinite lifetime can work with this backend) - get_list (is it possible to get the list of cache ids and the complete list of tags) @return array associative of with capabilities
[ "Return", "an", "associative", "array", "of", "capabilities", "(", "booleans", ")", "of", "the", "backend" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache/Backend/TwoLevels.php#L438-L449
train
Returns the capabilities of the slow backend
[ 30522, 2270, 3853, 2131, 17695, 28518, 15909, 3111, 1006, 1007, 1063, 1002, 4030, 5963, 10497, 17695, 28518, 15909, 3111, 1027, 1002, 2023, 1011, 1028, 1035, 4030, 5963, 10497, 1011, 1028, 2131, 17695, 28518, 15909, 3111, 1006, 1007, 1025, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/Routing/RouteCollection.php
RouteCollection.setHost
public function setHost($pattern, array $defaults = [], array $requirements = []) { foreach ($this->routes as $route) { $route->setHost($pattern); $route->addDefaults($defaults); $route->addRequirements($requirements); } }
php
public function setHost($pattern, array $defaults = [], array $requirements = []) { foreach ($this->routes as $route) { $route->setHost($pattern); $route->addDefaults($defaults); $route->addRequirements($requirements); } }
[ "public", "function", "setHost", "(", "$", "pattern", ",", "array", "$", "defaults", "=", "[", "]", ",", "array", "$", "requirements", "=", "[", "]", ")", "{", "foreach", "(", "$", "this", "->", "routes", "as", "$", "route", ")", "{", "$", "route",...
Sets the host pattern on all routes. @param string $pattern The pattern @param array $defaults An array of default values @param array $requirements An array of requirements
[ "Sets", "the", "host", "pattern", "on", "all", "routes", "." ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Routing/RouteCollection.php#L180-L187
train
Set Host Name
[ 30522, 2270, 3853, 6662, 14122, 1006, 1002, 5418, 1010, 9140, 1002, 12398, 2015, 1027, 1031, 1033, 1010, 9140, 1002, 5918, 1027, 1031, 1033, 1007, 1063, 18921, 6776, 1006, 1002, 2023, 1011, 1028, 5847, 2004, 1002, 2799, 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...
symfony/symfony
src/Symfony/Component/Intl/Intl.php
Intl.getLocaleBundle
public static function getLocaleBundle() { @trigger_error(sprintf('The method "%s()" is deprecated since Symfony 4.3, use "%s" instead.', __METHOD__, Locales::class), E_USER_DEPRECATED); if (null === self::$localeBundle) { self::$localeBundle = new LocaleBundle( self::getDataDirectory().'/'.self::LOCALE_DIR, self::getEntryReader() ); } return self::$localeBundle; }
php
public static function getLocaleBundle() { @trigger_error(sprintf('The method "%s()" is deprecated since Symfony 4.3, use "%s" instead.', __METHOD__, Locales::class), E_USER_DEPRECATED); if (null === self::$localeBundle) { self::$localeBundle = new LocaleBundle( self::getDataDirectory().'/'.self::LOCALE_DIR, self::getEntryReader() ); } return self::$localeBundle; }
[ "public", "static", "function", "getLocaleBundle", "(", ")", "{", "@", "trigger_error", "(", "sprintf", "(", "'The method \"%s()\" is deprecated since Symfony 4.3, use \"%s\" instead.'", ",", "__METHOD__", ",", "Locales", "::", "class", ")", ",", "E_USER_DEPRECATED", ")",...
Returns the bundle containing locale information. @return LocaleBundleInterface The locale resource bundle @deprecated since Symfony 4.3, to be removed in 5.0. Use {@see Locales} instead.
[ "Returns", "the", "bundle", "containing", "locale", "information", "." ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Intl/Intl.php#L172-L184
train
Returns the LocaleBundle
[ 30522, 2270, 10763, 3853, 2131, 4135, 9289, 15878, 8630, 2571, 1006, 1007, 1063, 1030, 9495, 1035, 7561, 1006, 9043, 2546, 1006, 1005, 1996, 4118, 1000, 1003, 1055, 1006, 1007, 1000, 2003, 2139, 28139, 12921, 2144, 25353, 2213, 14876, 4890,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/DependencyInjection/Compiler/ResolveReferencesToAliasesPass.php
ResolveReferencesToAliasesPass.processValue
protected function processValue($value, $isRoot = false) { if (!$value instanceof Reference) { return parent::processValue($value, $isRoot); } $defId = $this->getDefinitionId($id = (string) $value, $this->container); return $defId !== $id ? new Reference($defId, $value->getInvalidBehavior()) : $value; }
php
protected function processValue($value, $isRoot = false) { if (!$value instanceof Reference) { return parent::processValue($value, $isRoot); } $defId = $this->getDefinitionId($id = (string) $value, $this->container); return $defId !== $id ? new Reference($defId, $value->getInvalidBehavior()) : $value; }
[ "protected", "function", "processValue", "(", "$", "value", ",", "$", "isRoot", "=", "false", ")", "{", "if", "(", "!", "$", "value", "instanceof", "Reference", ")", "{", "return", "parent", "::", "processValue", "(", "$", "value", ",", "$", "isRoot", ...
{@inheritdoc}
[ "{" ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/DependencyInjection/Compiler/ResolveReferencesToAliasesPass.php#L45-L54
train
Process value of type Reference
[ 30522, 5123, 3853, 2832, 10175, 5657, 1006, 1002, 3643, 1010, 1002, 2003, 3217, 4140, 1027, 6270, 1007, 1063, 2065, 1006, 999, 1002, 3643, 6013, 11253, 4431, 1007, 1063, 2709, 6687, 1024, 1024, 2832, 10175, 5657, 1006, 1002, 3643, 1010, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
libs/Zend/Db/Table/Abstract.php
Zend_Db_Table_Abstract.setOptions
public function setOptions(Array $options) { foreach ($options as $key => $value) { switch ($key) { case self::ADAPTER: $this->_setAdapter($value); break; case self::DEFINITION: $this->setDefinition($value); break; case self::DEFINITION_CONFIG_NAME: $this->setDefinitionConfigName($value); break; case self::SCHEMA: $this->_schema = (string) $value; break; case self::NAME: $this->_name = (string) $value; break; case self::PRIMARY: $this->_primary = (array) $value; break; case self::ROW_CLASS: $this->setRowClass($value); break; case self::ROWSET_CLASS: $this->setRowsetClass($value); break; case self::REFERENCE_MAP: $this->setReferences($value); break; case self::DEPENDENT_TABLES: $this->setDependentTables($value); break; case self::METADATA_CACHE: $this->_setMetadataCache($value); break; case self::METADATA_CACHE_IN_CLASS: $this->setMetadataCacheInClass($value); break; case self::SEQUENCE: $this->_setSequence($value); break; default: // ignore unrecognized configuration directive break; } } return $this; }
php
public function setOptions(Array $options) { foreach ($options as $key => $value) { switch ($key) { case self::ADAPTER: $this->_setAdapter($value); break; case self::DEFINITION: $this->setDefinition($value); break; case self::DEFINITION_CONFIG_NAME: $this->setDefinitionConfigName($value); break; case self::SCHEMA: $this->_schema = (string) $value; break; case self::NAME: $this->_name = (string) $value; break; case self::PRIMARY: $this->_primary = (array) $value; break; case self::ROW_CLASS: $this->setRowClass($value); break; case self::ROWSET_CLASS: $this->setRowsetClass($value); break; case self::REFERENCE_MAP: $this->setReferences($value); break; case self::DEPENDENT_TABLES: $this->setDependentTables($value); break; case self::METADATA_CACHE: $this->_setMetadataCache($value); break; case self::METADATA_CACHE_IN_CLASS: $this->setMetadataCacheInClass($value); break; case self::SEQUENCE: $this->_setSequence($value); break; default: // ignore unrecognized configuration directive break; } } return $this; }
[ "public", "function", "setOptions", "(", "Array", "$", "options", ")", "{", "foreach", "(", "$", "options", "as", "$", "key", "=>", "$", "value", ")", "{", "switch", "(", "$", "key", ")", "{", "case", "self", "::", "ADAPTER", ":", "$", "this", "->"...
setOptions() @param array $options @return Zend_Db_Table_Abstract
[ "setOptions", "()" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Table/Abstract.php#L278-L328
train
Set the options
[ 30522, 2270, 3853, 2275, 7361, 9285, 1006, 9140, 1002, 7047, 1007, 1063, 18921, 6776, 1006, 1002, 7047, 2004, 1002, 3145, 1027, 1028, 1002, 3643, 1007, 1063, 6942, 1006, 1002, 3145, 1007, 1063, 2553, 2969, 1024, 1024, 15581, 2121, 1024, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/Validator/Constraints/IsbnValidator.php
IsbnValidator.validate
public function validate($value, Constraint $constraint) { if (!$constraint instanceof Isbn) { throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\Isbn'); } if (null === $value || '' === $value) { return; } if (!is_scalar($value) && !(\is_object($value) && method_exists($value, '__toString'))) { throw new UnexpectedValueException($value, 'string'); } $value = (string) $value; $canonical = str_replace('-', '', $value); // Explicitly validate against ISBN-10 if ('isbn10' === $constraint->type) { if (true !== ($code = $this->validateIsbn10($canonical))) { $this->context->buildViolation($this->getMessage($constraint, $constraint->type)) ->setParameter('{{ value }}', $this->formatValue($value)) ->setCode($code) ->addViolation(); } return; } // Explicitly validate against ISBN-13 if ('isbn13' === $constraint->type) { if (true !== ($code = $this->validateIsbn13($canonical))) { $this->context->buildViolation($this->getMessage($constraint, $constraint->type)) ->setParameter('{{ value }}', $this->formatValue($value)) ->setCode($code) ->addViolation(); } return; } // Try both ISBNs // First, try ISBN-10 $code = $this->validateIsbn10($canonical); // The ISBN can only be an ISBN-13 if the value was too long for ISBN-10 if (Isbn::TOO_LONG_ERROR === $code) { // Try ISBN-13 now $code = $this->validateIsbn13($canonical); // If too short, this means we have 11 or 12 digits if (Isbn::TOO_SHORT_ERROR === $code) { $code = Isbn::TYPE_NOT_RECOGNIZED_ERROR; } } if (true !== $code) { $this->context->buildViolation($this->getMessage($constraint)) ->setParameter('{{ value }}', $this->formatValue($value)) ->setCode($code) ->addViolation(); } }
php
public function validate($value, Constraint $constraint) { if (!$constraint instanceof Isbn) { throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\Isbn'); } if (null === $value || '' === $value) { return; } if (!is_scalar($value) && !(\is_object($value) && method_exists($value, '__toString'))) { throw new UnexpectedValueException($value, 'string'); } $value = (string) $value; $canonical = str_replace('-', '', $value); // Explicitly validate against ISBN-10 if ('isbn10' === $constraint->type) { if (true !== ($code = $this->validateIsbn10($canonical))) { $this->context->buildViolation($this->getMessage($constraint, $constraint->type)) ->setParameter('{{ value }}', $this->formatValue($value)) ->setCode($code) ->addViolation(); } return; } // Explicitly validate against ISBN-13 if ('isbn13' === $constraint->type) { if (true !== ($code = $this->validateIsbn13($canonical))) { $this->context->buildViolation($this->getMessage($constraint, $constraint->type)) ->setParameter('{{ value }}', $this->formatValue($value)) ->setCode($code) ->addViolation(); } return; } // Try both ISBNs // First, try ISBN-10 $code = $this->validateIsbn10($canonical); // The ISBN can only be an ISBN-13 if the value was too long for ISBN-10 if (Isbn::TOO_LONG_ERROR === $code) { // Try ISBN-13 now $code = $this->validateIsbn13($canonical); // If too short, this means we have 11 or 12 digits if (Isbn::TOO_SHORT_ERROR === $code) { $code = Isbn::TYPE_NOT_RECOGNIZED_ERROR; } } if (true !== $code) { $this->context->buildViolation($this->getMessage($constraint)) ->setParameter('{{ value }}', $this->formatValue($value)) ->setCode($code) ->addViolation(); } }
[ "public", "function", "validate", "(", "$", "value", ",", "Constraint", "$", "constraint", ")", "{", "if", "(", "!", "$", "constraint", "instanceof", "Isbn", ")", "{", "throw", "new", "UnexpectedTypeException", "(", "$", "constraint", ",", "__NAMESPACE__", "...
{@inheritdoc}
[ "{" ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Validator/Constraints/IsbnValidator.php#L33-L96
train
Validate the value against ISBN - 10 - ISBN - 13 - ISBN - 11 - 12 - ISBN - 12
[ 30522, 2270, 3853, 9398, 3686, 1006, 1002, 3643, 1010, 27142, 1002, 27142, 1007, 1063, 2065, 1006, 999, 1002, 27142, 6013, 11253, 3175, 1007, 1063, 5466, 2047, 9223, 13874, 10288, 24422, 1006, 1002, 27142, 1010, 1035, 1035, 3415, 15327, 103...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
libs/Zend/Cache/Backend/File.php
Zend_Cache_Backend_File.clean
public function clean($mode = Zend_Cache::CLEANING_MODE_ALL, $tags = array()) { // We use this protected method to hide the recursive stuff clearstatcache(); return $this->_clean($this->_options['cache_dir'], $mode, $tags); }
php
public function clean($mode = Zend_Cache::CLEANING_MODE_ALL, $tags = array()) { // We use this protected method to hide the recursive stuff clearstatcache(); return $this->_clean($this->_options['cache_dir'], $mode, $tags); }
[ "public", "function", "clean", "(", "$", "mode", "=", "Zend_Cache", "::", "CLEANING_MODE_ALL", ",", "$", "tags", "=", "array", "(", ")", ")", "{", "// We use this protected method to hide the recursive stuff", "clearstatcache", "(", ")", ";", "return", "$", "this"...
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 tags ($tags can be an array of strings or a single string) Zend_Cache::CLEANING_MODE_NOT_MATCHING_TAG => remove cache entries not {matching one of the given tags} ($tags can be an array of strings or a single string) Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG => remove cache entries matching any given tags ($tags can be an array of strings or a single string) @param string $mode clean mode @param tags array $tags array of tags @return boolean true if no problem
[ "Clean", "some", "cache", "records" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache/Backend/File.php#L285-L290
train
Clean the cache
[ 30522, 2270, 3853, 4550, 1006, 1002, 5549, 1027, 16729, 2094, 1035, 17053, 1024, 1024, 9344, 1035, 5549, 1035, 2035, 1010, 1002, 22073, 1027, 9140, 1006, 1007, 1007, 1063, 1013, 1013, 2057, 2224, 2023, 5123, 4118, 2000, 5342, 1996, 28667, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
laravel/framework
src/Illuminate/Validation/Factory.php
Factory.extend
public function extend($rule, $extension, $message = null) { $this->extensions[$rule] = $extension; if ($message) { $this->fallbackMessages[Str::snake($rule)] = $message; } }
php
public function extend($rule, $extension, $message = null) { $this->extensions[$rule] = $extension; if ($message) { $this->fallbackMessages[Str::snake($rule)] = $message; } }
[ "public", "function", "extend", "(", "$", "rule", ",", "$", "extension", ",", "$", "message", "=", "null", ")", "{", "$", "this", "->", "extensions", "[", "$", "rule", "]", "=", "$", "extension", ";", "if", "(", "$", "message", ")", "{", "$", "th...
Register a custom validator extension. @param string $rule @param \Closure|string $extension @param string $message @return void
[ "Register", "a", "custom", "validator", "extension", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Validation/Factory.php#L187-L194
train
Extend the current language with a new extension
[ 30522, 2270, 3853, 7949, 1006, 1002, 3627, 1010, 1002, 5331, 1010, 1002, 4471, 1027, 19701, 1007, 1063, 1002, 2023, 1011, 1028, 14305, 1031, 1002, 3627, 1033, 1027, 1002, 5331, 1025, 2065, 1006, 1002, 4471, 1007, 1063, 1002, 2023, 1011, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
laravel/framework
src/Illuminate/Validation/Concerns/ValidatesAttributes.php
ValidatesAttributes.parseNamedParameters
protected function parseNamedParameters($parameters) { return array_reduce($parameters, function ($result, $item) { [$key, $value] = array_pad(explode('=', $item, 2), 2, null); $result[$key] = $value; return $result; }); }
php
protected function parseNamedParameters($parameters) { return array_reduce($parameters, function ($result, $item) { [$key, $value] = array_pad(explode('=', $item, 2), 2, null); $result[$key] = $value; return $result; }); }
[ "protected", "function", "parseNamedParameters", "(", "$", "parameters", ")", "{", "return", "array_reduce", "(", "$", "parameters", ",", "function", "(", "$", "result", ",", "$", "item", ")", "{", "[", "$", "key", ",", "$", "value", "]", "=", "array_pad...
Parse named parameters to $key => $value items. @param array $parameters @return array
[ "Parse", "named", "parameters", "to", "$key", "=", ">", "$value", "items", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Validation/Concerns/ValidatesAttributes.php#L1703-L1712
train
Parse the parameters into a named array
[ 30522, 5123, 3853, 11968, 5054, 14074, 18927, 5400, 22828, 2015, 1006, 1002, 11709, 1007, 1063, 2709, 9140, 1035, 5547, 1006, 1002, 11709, 1010, 3853, 1006, 1002, 2765, 1010, 1002, 8875, 1007, 1063, 1031, 1002, 3145, 1010, 1002, 3643, 1033,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
z-song/laravel-admin
src/Grid/Filter/Between.php
Between.formatName
protected function formatName($column) { $columns = explode('.', $column); if (count($columns) == 1) { $name = $columns[0]; } else { $name = array_shift($columns); foreach ($columns as $column) { $name .= "[$column]"; } } return ['start' => "{$name}[start]", 'end' => "{$name}[end]"]; }
php
protected function formatName($column) { $columns = explode('.', $column); if (count($columns) == 1) { $name = $columns[0]; } else { $name = array_shift($columns); foreach ($columns as $column) { $name .= "[$column]"; } } return ['start' => "{$name}[start]", 'end' => "{$name}[end]"]; }
[ "protected", "function", "formatName", "(", "$", "column", ")", "{", "$", "columns", "=", "explode", "(", "'.'", ",", "$", "column", ")", ";", "if", "(", "count", "(", "$", "columns", ")", "==", "1", ")", "{", "$", "name", "=", "$", "columns", "[...
Format two field names of this filter. @param string $column @return array
[ "Format", "two", "field", "names", "of", "this", "filter", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Grid/Filter/Between.php#L36-L51
train
Format name of the column
[ 30522, 5123, 3853, 4289, 18442, 1006, 1002, 5930, 1007, 1063, 1002, 7753, 1027, 15044, 1006, 1005, 1012, 1005, 1010, 1002, 5930, 1007, 1025, 2065, 1006, 4175, 1006, 1002, 7753, 1007, 30524, 1063, 1002, 2171, 1027, 9140, 1035, 5670, 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/Support/Collection.php
Collection.reject
public function reject($callback = true) { $useAsCallable = $this->useAsCallable($callback); return $this->filter(function ($value, $key) use ($callback, $useAsCallable) { return $useAsCallable ? ! $callback($value, $key) : $value != $callback; }); }
php
public function reject($callback = true) { $useAsCallable = $this->useAsCallable($callback); return $this->filter(function ($value, $key) use ($callback, $useAsCallable) { return $useAsCallable ? ! $callback($value, $key) : $value != $callback; }); }
[ "public", "function", "reject", "(", "$", "callback", "=", "true", ")", "{", "$", "useAsCallable", "=", "$", "this", "->", "useAsCallable", "(", "$", "callback", ")", ";", "return", "$", "this", "->", "filter", "(", "function", "(", "$", "value", ",", ...
Create a collection of all elements that do not pass a given truth test. @param callable|mixed $callback @return static
[ "Create", "a", "collection", "of", "all", "elements", "that", "do", "not", "pass", "a", "given", "truth", "test", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Support/Collection.php#L1510-L1519
train
rejects all items that match the given callback
[ 30522, 2270, 3853, 15454, 1006, 1002, 2655, 5963, 1027, 2995, 1007, 1063, 1002, 2224, 3022, 9289, 20470, 2571, 1027, 1002, 2023, 1011, 1028, 2224, 3022, 9289, 20470, 2571, 1006, 1002, 2655, 5963, 1007, 1025, 2709, 1002, 2023, 1011, 1028, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/PropertyAccess/PropertyAccessor.php
PropertyAccessor.getValue
public function getValue($objectOrArray, $propertyPath) { $zval = [ self::VALUE => $objectOrArray, ]; if (\is_object($objectOrArray) && false === strpbrk((string) $propertyPath, '.[')) { return $this->readProperty($zval, $propertyPath, $this->ignoreInvalidProperty)[self::VALUE]; } $propertyPath = $this->getPropertyPath($propertyPath); $propertyValues = $this->readPropertiesUntil($zval, $propertyPath, $propertyPath->getLength(), $this->ignoreInvalidIndices); return $propertyValues[\count($propertyValues) - 1][self::VALUE]; }
php
public function getValue($objectOrArray, $propertyPath) { $zval = [ self::VALUE => $objectOrArray, ]; if (\is_object($objectOrArray) && false === strpbrk((string) $propertyPath, '.[')) { return $this->readProperty($zval, $propertyPath, $this->ignoreInvalidProperty)[self::VALUE]; } $propertyPath = $this->getPropertyPath($propertyPath); $propertyValues = $this->readPropertiesUntil($zval, $propertyPath, $propertyPath->getLength(), $this->ignoreInvalidIndices); return $propertyValues[\count($propertyValues) - 1][self::VALUE]; }
[ "public", "function", "getValue", "(", "$", "objectOrArray", ",", "$", "propertyPath", ")", "{", "$", "zval", "=", "[", "self", "::", "VALUE", "=>", "$", "objectOrArray", ",", "]", ";", "if", "(", "\\", "is_object", "(", "$", "objectOrArray", ")", "&&"...
{@inheritdoc}
[ "{" ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/PropertyAccess/PropertyAccessor.php#L85-L100
train
Get the value of the property
[ 30522, 2270, 3853, 2131, 10175, 5657, 1006, 1002, 4874, 6525, 11335, 2100, 1010, 1002, 3200, 15069, 1007, 1063, 1002, 1062, 10175, 1027, 1031, 2969, 1024, 1024, 3643, 1027, 1028, 1002, 4874, 6525, 11335, 2100, 1010, 1033, 1025, 2065, 1006, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
z-song/laravel-admin
src/Controllers/PermissionController.php
PermissionController.form
public function form() { $permissionModel = config('admin.database.permissions_model'); $form = new Form(new $permissionModel()); $form->display('id', 'ID'); $form->text('slug', trans('admin.slug'))->rules('required'); $form->text('name', trans('admin.name'))->rules('required'); $form->multipleSelect('http_method', trans('admin.http.method')) ->options($this->getHttpMethodsOptions()) ->help(trans('admin.all_methods_if_empty')); $form->textarea('http_path', trans('admin.http.path')); $form->display('created_at', trans('admin.created_at')); $form->display('updated_at', trans('admin.updated_at')); return $form; }
php
public function form() { $permissionModel = config('admin.database.permissions_model'); $form = new Form(new $permissionModel()); $form->display('id', 'ID'); $form->text('slug', trans('admin.slug'))->rules('required'); $form->text('name', trans('admin.name'))->rules('required'); $form->multipleSelect('http_method', trans('admin.http.method')) ->options($this->getHttpMethodsOptions()) ->help(trans('admin.all_methods_if_empty')); $form->textarea('http_path', trans('admin.http.path')); $form->display('created_at', trans('admin.created_at')); $form->display('updated_at', trans('admin.updated_at')); return $form; }
[ "public", "function", "form", "(", ")", "{", "$", "permissionModel", "=", "config", "(", "'admin.database.permissions_model'", ")", ";", "$", "form", "=", "new", "Form", "(", "new", "$", "permissionModel", "(", ")", ")", ";", "$", "form", "->", "display", ...
Make a form builder. @return Form
[ "Make", "a", "form", "builder", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Controllers/PermissionController.php#L179-L199
train
Form for the permissions
[ 30522, 2270, 3853, 2433, 1006, 1007, 1063, 1002, 6656, 5302, 9247, 1027, 9530, 8873, 2290, 1006, 1005, 4748, 10020, 1012, 7809, 1012, 6656, 2015, 1035, 2944, 1005, 1007, 1025, 1002, 2433, 1027, 2047, 2433, 1006, 2047, 1002, 6656, 5302, 92...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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.renameFolder
public function renameFolder($oldName, $newName) { if ($oldName instanceof Zend_Mail_Storage_Folder) { $oldName = $oldName->getGlobalName(); } if (!$this->_protocol->rename($oldName, $newName)) { /** * @see Zend_Mail_Storage_Exception */ // require_once 'Zend/Mail/Storage/Exception.php'; throw new Zend_Mail_Storage_Exception('cannot rename folder'); } }
php
public function renameFolder($oldName, $newName) { if ($oldName instanceof Zend_Mail_Storage_Folder) { $oldName = $oldName->getGlobalName(); } if (!$this->_protocol->rename($oldName, $newName)) { /** * @see Zend_Mail_Storage_Exception */ // require_once 'Zend/Mail/Storage/Exception.php'; throw new Zend_Mail_Storage_Exception('cannot rename folder'); } }
[ "public", "function", "renameFolder", "(", "$", "oldName", ",", "$", "newName", ")", "{", "if", "(", "$", "oldName", "instanceof", "Zend_Mail_Storage_Folder", ")", "{", "$", "oldName", "=", "$", "oldName", "->", "getGlobalName", "(", ")", ";", "}", "if", ...
rename and/or move folder The new name has the same restrictions as in createFolder() @param string|Zend_Mail_Storage_Folder $oldName name or instance of folder @param string $newName new global name of folder @return null @throws Zend_Mail_Storage_Exception
[ "rename", "and", "/", "or", "move", "folder" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail/Storage/Imap.php#L546-L559
train
Rename folder in the storage
[ 30522, 2270, 3853, 14916, 14074, 10371, 2121, 1006, 1002, 2214, 18442, 1010, 1002, 2047, 30524, 8778, 1011, 1028, 14916, 14074, 1006, 1002, 2214, 18442, 1010, 1002, 2047, 18442, 1007, 1007, 1063, 1013, 1008, 1008, 1008, 1030, 2156, 16729, 2...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/HttpClient/Response/NativeResponse.php
NativeResponse.getInfo
public function getInfo(string $type = null) { if (!$info = $this->finalInfo) { self::perform($this->multi); $info = $this->info; $info['url'] = implode('', $info['url']); unset($info['fopen_time'], $info['size_body']); if (null === $this->buffer) { $this->finalInfo = $info; } } return null !== $type ? $info[$type] ?? null : $info; }
php
public function getInfo(string $type = null) { if (!$info = $this->finalInfo) { self::perform($this->multi); $info = $this->info; $info['url'] = implode('', $info['url']); unset($info['fopen_time'], $info['size_body']); if (null === $this->buffer) { $this->finalInfo = $info; } } return null !== $type ? $info[$type] ?? null : $info; }
[ "public", "function", "getInfo", "(", "string", "$", "type", "=", "null", ")", "{", "if", "(", "!", "$", "info", "=", "$", "this", "->", "finalInfo", ")", "{", "self", "::", "perform", "(", "$", "this", "->", "multi", ")", ";", "$", "info", "=", ...
{@inheritdoc}
[ "{" ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpClient/Response/NativeResponse.php#L75-L89
train
Get Info of the page
[ 30522, 2270, 3853, 2131, 2378, 14876, 1006, 5164, 1002, 2828, 1027, 19701, 1007, 1063, 2065, 1006, 999, 1002, 18558, 1027, 1002, 2023, 1011, 1028, 2345, 2378, 14876, 1007, 1063, 2969, 1024, 1024, 4685, 1006, 1002, 2023, 1011, 1028, 4800, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/Process/Process.php
Process.validateTimeout
private function validateTimeout(?float $timeout): ?float { $timeout = (float) $timeout; if (0.0 === $timeout) { $timeout = null; } elseif ($timeout < 0) { throw new InvalidArgumentException('The timeout value must be a valid positive integer or float number.'); } return $timeout; }
php
private function validateTimeout(?float $timeout): ?float { $timeout = (float) $timeout; if (0.0 === $timeout) { $timeout = null; } elseif ($timeout < 0) { throw new InvalidArgumentException('The timeout value must be a valid positive integer or float number.'); } return $timeout; }
[ "private", "function", "validateTimeout", "(", "?", "float", "$", "timeout", ")", ":", "?", "float", "{", "$", "timeout", "=", "(", "float", ")", "$", "timeout", ";", "if", "(", "0.0", "===", "$", "timeout", ")", "{", "$", "timeout", "=", "null", "...
Validates and returns the filtered timeout. @throws InvalidArgumentException if the given timeout is a negative number
[ "Validates", "and", "returns", "the", "filtered", "timeout", "." ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Process/Process.php#L1402-L1413
train
Validate the timeout value
[ 30522, 2797, 3853, 9398, 3686, 7292, 5833, 1006, 1029, 14257, 1002, 2051, 5833, 1007, 1024, 1029, 14257, 1063, 1002, 2051, 5833, 1027, 1006, 14257, 1007, 1002, 2051, 5833, 1025, 2065, 1006, 1014, 1012, 1014, 1027, 1027, 1027, 1002, 2051, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/Grav.php
Grav.load
protected static function load(array $values) { $container = new static($values); $container['debugger'] = new Debugger(); $container['grav'] = function (Container $container) { user_error('Calling $grav[\'grav\'] or {{ grav.grav }} is deprecated since Grav 1.6, just use $grav or {{ grav }}', E_USER_DEPRECATED); return $container; }; $container->measureTime('_services', 'Services', function () use ($container) { $container->registerServices(); }); return $container; }
php
protected static function load(array $values) { $container = new static($values); $container['debugger'] = new Debugger(); $container['grav'] = function (Container $container) { user_error('Calling $grav[\'grav\'] or {{ grav.grav }} is deprecated since Grav 1.6, just use $grav or {{ grav }}', E_USER_DEPRECATED); return $container; }; $container->measureTime('_services', 'Services', function () use ($container) { $container->registerServices(); }); return $container; }
[ "protected", "static", "function", "load", "(", "array", "$", "values", ")", "{", "$", "container", "=", "new", "static", "(", "$", "values", ")", ";", "$", "container", "[", "'debugger'", "]", "=", "new", "Debugger", "(", ")", ";", "$", "container", ...
Initialize and return a Grav instance @param array $values @return static
[ "Initialize", "and", "return", "a", "Grav", "instance" ]
1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72
https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Grav.php#L462-L478
train
Load the container
[ 30522, 5123, 10763, 3853, 7170, 1006, 9140, 1002, 5300, 1007, 1063, 1002, 11661, 1027, 2047, 10763, 1006, 1002, 5300, 1007, 1025, 1002, 11661, 1031, 1005, 2139, 8569, 13327, 1005, 1033, 1027, 2047, 2139, 8569, 13327, 1006, 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...
matomo-org/matomo
plugins/UserCountry/LocationProvider/GeoIp/ServerBased.php
ServerBased.getInfo
public function getInfo() { if (function_exists('apache_note')) { $serverDesc = 'Apache'; } else { $serverDesc = Piwik::translate('UserCountry_HttpServerModule'); } $title = sprintf(self::TITLE, $serverDesc); $desc = Piwik::translate('UserCountry_GeoIpLocationProviderDesc_ServerBased1', array('<strong>', '</strong>')) . '<br/><br/>' . Piwik::translate('UserCountry_GeoIpLocationProviderDesc_ServerBasedAnonWarn') . '<br/><br/>' . Piwik::translate('UserCountry_GeoIpLocationProviderDesc_ServerBased2', array('<strong>', '</strong>', '<strong>', '</strong>')); $installDocs = '<a rel="noreferrer noopener" target="_blank" href="https://matomo.org/faq/how-to/#faq_165">' . Piwik::translate('UserCountry_HowToInstallApacheModule') . '</a><br/>' . '<a rel="noreferrer noopener" target="_blank" href="https://matomo.org/faq/how-to/#faq_166">' . Piwik::translate('UserCountry_HowToInstallNginxModule') . '</a>'; $geoipServerVars = array(); foreach ($_SERVER as $key => $value) { if (strpos($key, 'GEOIP') === 0) { $geoipServerVars[] = $key; } } if (empty($geoipServerVars)) { $extraMessage = '<strong>' . Piwik::translate('UserCountry_GeoIPNoServerVars', '$_SERVER') . '</strong>'; } else { $extraMessage = '<strong>' . Piwik::translate('UserCountry_GeoIPServerVarsFound', '$_SERVER') . ":</strong><br/><br/>\n<ul style=\"list-style:disc;margin-left:24px\">\n"; foreach ($geoipServerVars as $key) { $extraMessage .= '<li>' . $key . "</li>\n"; } $extraMessage .= '</ul>'; } return array('id' => self::ID, 'title' => $title, 'description' => $desc, 'order' => 14, 'install_docs' => $installDocs, 'extra_message' => $extraMessage); }
php
public function getInfo() { if (function_exists('apache_note')) { $serverDesc = 'Apache'; } else { $serverDesc = Piwik::translate('UserCountry_HttpServerModule'); } $title = sprintf(self::TITLE, $serverDesc); $desc = Piwik::translate('UserCountry_GeoIpLocationProviderDesc_ServerBased1', array('<strong>', '</strong>')) . '<br/><br/>' . Piwik::translate('UserCountry_GeoIpLocationProviderDesc_ServerBasedAnonWarn') . '<br/><br/>' . Piwik::translate('UserCountry_GeoIpLocationProviderDesc_ServerBased2', array('<strong>', '</strong>', '<strong>', '</strong>')); $installDocs = '<a rel="noreferrer noopener" target="_blank" href="https://matomo.org/faq/how-to/#faq_165">' . Piwik::translate('UserCountry_HowToInstallApacheModule') . '</a><br/>' . '<a rel="noreferrer noopener" target="_blank" href="https://matomo.org/faq/how-to/#faq_166">' . Piwik::translate('UserCountry_HowToInstallNginxModule') . '</a>'; $geoipServerVars = array(); foreach ($_SERVER as $key => $value) { if (strpos($key, 'GEOIP') === 0) { $geoipServerVars[] = $key; } } if (empty($geoipServerVars)) { $extraMessage = '<strong>' . Piwik::translate('UserCountry_GeoIPNoServerVars', '$_SERVER') . '</strong>'; } else { $extraMessage = '<strong>' . Piwik::translate('UserCountry_GeoIPServerVarsFound', '$_SERVER') . ":</strong><br/><br/>\n<ul style=\"list-style:disc;margin-left:24px\">\n"; foreach ($geoipServerVars as $key) { $extraMessage .= '<li>' . $key . "</li>\n"; } $extraMessage .= '</ul>'; } return array('id' => self::ID, 'title' => $title, 'description' => $desc, 'order' => 14, 'install_docs' => $installDocs, 'extra_message' => $extraMessage); }
[ "public", "function", "getInfo", "(", ")", "{", "if", "(", "function_exists", "(", "'apache_note'", ")", ")", "{", "$", "serverDesc", "=", "'Apache'", ";", "}", "else", "{", "$", "serverDesc", "=", "Piwik", "::", "translate", "(", "'UserCountry_HttpServerMod...
Returns information about this location provider. Contains an id, title & description: array( 'id' => 'geoip_serverbased', 'title' => '...', 'description' => '...' ); @return array
[ "Returns", "information", "about", "this", "location", "provider", ".", "Contains", "an", "id", "title", "&", "description", ":" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UserCountry/LocationProvider/GeoIp/ServerBased.php#L210-L257
train
Returns the info of the server
[ 30522, 2270, 3853, 2131, 2378, 14876, 1006, 1007, 1063, 2065, 1006, 3853, 1035, 6526, 1006, 1005, 15895, 1035, 3602, 1005, 1007, 1007, 1063, 1002, 8241, 6155, 2278, 1027, 1005, 15895, 1005, 1025, 1065, 2842, 1063, 1002, 8241, 6155, 2278, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
laravel/framework
src/Illuminate/Broadcasting/Broadcasters/RedisBroadcaster.php
RedisBroadcaster.auth
public function auth($request) { $channelName = $this->normalizeChannelName($request->channel_name); if ($this->isGuardedChannel($request->channel_name) && ! $this->retrieveUser($request, $channelName)) { throw new AccessDeniedHttpException; } return parent::verifyUserCanAccessChannel( $request, $channelName ); }
php
public function auth($request) { $channelName = $this->normalizeChannelName($request->channel_name); if ($this->isGuardedChannel($request->channel_name) && ! $this->retrieveUser($request, $channelName)) { throw new AccessDeniedHttpException; } return parent::verifyUserCanAccessChannel( $request, $channelName ); }
[ "public", "function", "auth", "(", "$", "request", ")", "{", "$", "channelName", "=", "$", "this", "->", "normalizeChannelName", "(", "$", "request", "->", "channel_name", ")", ";", "if", "(", "$", "this", "->", "isGuardedChannel", "(", "$", "request", "...
Authenticate the incoming request for a given channel. @param \Illuminate\Http\Request $request @return mixed @throws \Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException
[ "Authenticate", "the", "incoming", "request", "for", "a", "given", "channel", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Broadcasting/Broadcasters/RedisBroadcaster.php#L48-L60
train
Verify user can access channel
[ 30522, 2270, 3853, 8740, 2705, 1006, 1002, 5227, 1007, 1063, 1002, 3149, 18442, 1027, 1002, 2023, 1011, 1028, 3671, 4697, 26058, 18442, 1006, 1002, 5227, 1011, 1028, 3149, 1035, 2171, 1007, 1025, 2065, 1006, 1002, 2023, 1011, 1028, 2003, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/Security/Http/EntryPoint/BasicAuthenticationEntryPoint.php
BasicAuthenticationEntryPoint.start
public function start(Request $request, AuthenticationException $authException = null) { $response = new Response(); $response->headers->set('WWW-Authenticate', sprintf('Basic realm="%s"', $this->realmName)); $response->setStatusCode(401); return $response; }
php
public function start(Request $request, AuthenticationException $authException = null) { $response = new Response(); $response->headers->set('WWW-Authenticate', sprintf('Basic realm="%s"', $this->realmName)); $response->setStatusCode(401); return $response; }
[ "public", "function", "start", "(", "Request", "$", "request", ",", "AuthenticationException", "$", "authException", "=", "null", ")", "{", "$", "response", "=", "new", "Response", "(", ")", ";", "$", "response", "->", "headers", "->", "set", "(", "'WWW-Au...
{@inheritdoc}
[ "{" ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Security/Http/EntryPoint/BasicAuthenticationEntryPoint.php#L35-L42
train
This method is called by the HTTP client to start the authentication process.
[ 30522, 2270, 3853, 2707, 1006, 5227, 1002, 5227, 1010, 27280, 10288, 24422, 1002, 8740, 10760, 2595, 24422, 1027, 19701, 1007, 1063, 1002, 3433, 1027, 2047, 3433, 1006, 1007, 1025, 1002, 3433, 1011, 1028, 20346, 2015, 1011, 1028, 2275, 1006...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
getgrav/grav
system/src/Grav/Common/Language/Language.php
Language.setActiveFromUri
public function setActiveFromUri($uri) { $regex = '/(^\/(' . $this->getAvailable() . '))(?:\/|\?|$)/i'; // if languages set if ($this->enabled()) { // Try setting language from prefix of URL (/en/blah/blah). if (preg_match($regex, $uri, $matches)) { $this->lang_in_url = true; $this->active = $matches[2]; $uri = preg_replace("/\\" . $matches[1] . '/', '', $uri, 1); // Store in session if language is different. if (isset($this->grav['session']) && $this->grav['session']->isStarted() && $this->config->get('system.languages.session_store_active', true) && $this->grav['session']->active_language != $this->active ) { $this->grav['session']->active_language = $this->active; } } else { // Try getting language from the session, else no active. if (isset($this->grav['session']) && $this->grav['session']->isStarted() && $this->config->get('system.languages.session_store_active', true)) { $this->active = $this->grav['session']->active_language ?: null; } // if still null, try from http_accept_language header if ($this->active === null && $this->config->get('system.languages.http_accept_language') && $accept = $_SERVER['HTTP_ACCEPT_LANGUAGE'] ?? false) { $negotiator = new LanguageNegotiator(); $best_language = $negotiator->getBest($accept, $this->languages); if ($best_language instanceof AcceptLanguage) { $this->active = $best_language->getType(); } else { $this->active = $this->getDefault(); } } } } return $uri; }
php
public function setActiveFromUri($uri) { $regex = '/(^\/(' . $this->getAvailable() . '))(?:\/|\?|$)/i'; // if languages set if ($this->enabled()) { // Try setting language from prefix of URL (/en/blah/blah). if (preg_match($regex, $uri, $matches)) { $this->lang_in_url = true; $this->active = $matches[2]; $uri = preg_replace("/\\" . $matches[1] . '/', '', $uri, 1); // Store in session if language is different. if (isset($this->grav['session']) && $this->grav['session']->isStarted() && $this->config->get('system.languages.session_store_active', true) && $this->grav['session']->active_language != $this->active ) { $this->grav['session']->active_language = $this->active; } } else { // Try getting language from the session, else no active. if (isset($this->grav['session']) && $this->grav['session']->isStarted() && $this->config->get('system.languages.session_store_active', true)) { $this->active = $this->grav['session']->active_language ?: null; } // if still null, try from http_accept_language header if ($this->active === null && $this->config->get('system.languages.http_accept_language') && $accept = $_SERVER['HTTP_ACCEPT_LANGUAGE'] ?? false) { $negotiator = new LanguageNegotiator(); $best_language = $negotiator->getBest($accept, $this->languages); if ($best_language instanceof AcceptLanguage) { $this->active = $best_language->getType(); } else { $this->active = $this->getDefault(); } } } } return $uri; }
[ "public", "function", "setActiveFromUri", "(", "$", "uri", ")", "{", "$", "regex", "=", "'/(^\\/('", ".", "$", "this", "->", "getAvailable", "(", ")", ".", "'))(?:\\/|\\?|$)/i'", ";", "// if languages set", "if", "(", "$", "this", "->", "enabled", "(", ")"...
Sets the active language based on the first part of the URL @param string $uri @return string
[ "Sets", "the", "active", "language", "based", "on", "the", "first", "part", "of", "the", "URL" ]
1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72
https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Language/Language.php#L190-L234
train
Set active language from URI
[ 30522, 2270, 3853, 2275, 19620, 19699, 5358, 9496, 1006, 1002, 24471, 2072, 1007, 1063, 1002, 19723, 10288, 1027, 1005, 1013, 1006, 1034, 1032, 1013, 1006, 1005, 1012, 1002, 2023, 1011, 1028, 2131, 12462, 11733, 3468, 1006, 1007, 1012, 1005...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/DependencyInjection/Compiler/AutowirePass.php
AutowirePass.set
private function set(string $type, string $id) { // is this already a type/class that is known to match multiple services? if (isset($this->ambiguousServiceTypes[$type])) { $this->ambiguousServiceTypes[$type][] = $id; return; } // check to make sure the type doesn't match multiple services if (!isset($this->types[$type]) || $this->types[$type] === $id) { $this->types[$type] = $id; return; } // keep an array of all services matching this type if (!isset($this->ambiguousServiceTypes[$type])) { $this->ambiguousServiceTypes[$type] = [$this->types[$type]]; unset($this->types[$type]); } $this->ambiguousServiceTypes[$type][] = $id; }
php
private function set(string $type, string $id) { // is this already a type/class that is known to match multiple services? if (isset($this->ambiguousServiceTypes[$type])) { $this->ambiguousServiceTypes[$type][] = $id; return; } // check to make sure the type doesn't match multiple services if (!isset($this->types[$type]) || $this->types[$type] === $id) { $this->types[$type] = $id; return; } // keep an array of all services matching this type if (!isset($this->ambiguousServiceTypes[$type])) { $this->ambiguousServiceTypes[$type] = [$this->types[$type]]; unset($this->types[$type]); } $this->ambiguousServiceTypes[$type][] = $id; }
[ "private", "function", "set", "(", "string", "$", "type", ",", "string", "$", "id", ")", "{", "// is this already a type/class that is known to match multiple services?", "if", "(", "isset", "(", "$", "this", "->", "ambiguousServiceTypes", "[", "$", "type", "]", "...
Associates a type and a service id if applicable.
[ "Associates", "a", "type", "and", "a", "service", "id", "if", "applicable", "." ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/DependencyInjection/Compiler/AutowirePass.php#L352-L374
train
Set the type and id for the ambiguity
[ 30522, 2797, 3853, 2275, 1006, 5164, 1002, 2828, 1010, 5164, 1002, 8909, 1007, 1063, 1013, 1013, 2003, 2023, 2525, 1037, 2828, 1013, 2465, 2008, 2003, 2124, 2000, 2674, 3674, 2578, 1029, 2065, 1006, 26354, 3388, 1006, 1002, 2023, 1011, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/Serializer/Normalizer/AbstractObjectNormalizer.php
AbstractObjectNormalizer.normalize
public function normalize($object, $format = null, array $context = []) { if (!isset($context['cache_key'])) { $context['cache_key'] = $this->getCacheKey($format, $context); } if (isset($context[self::CALLBACKS])) { if (!\is_array($context[self::CALLBACKS])) { throw new InvalidArgumentException(sprintf('The "%s" context option must be an array of callables.', self::CALLBACKS)); } foreach ($context[self::CALLBACKS] as $attribute => $callback) { if (!\is_callable($callback)) { throw new InvalidArgumentException(sprintf('Invalid callback found for attribute "%s" in the "%s" context option.', $attribute, self::CALLBACKS)); } } } if ($this->isCircularReference($object, $context)) { return $this->handleCircularReference($object, $format, $context); } $data = []; $stack = []; $attributes = $this->getAttributes($object, $format, $context); $class = $this->objectClassResolver ? ($this->objectClassResolver)($object) : \get_class($object); $attributesMetadata = $this->classMetadataFactory ? $this->classMetadataFactory->getMetadataFor($class)->getAttributesMetadata() : null; if (isset($context[self::MAX_DEPTH_HANDLER])) { $maxDepthHandler = $context[self::MAX_DEPTH_HANDLER]; if (!\is_callable($maxDepthHandler)) { throw new InvalidArgumentException(sprintf('The "%s" given in the context is not callable.', self::MAX_DEPTH_HANDLER)); } } else { // already validated in constructor resp by type declaration of setMaxDepthHandler $maxDepthHandler = $this->defaultContext[self::MAX_DEPTH_HANDLER] ?? $this->maxDepthHandler; } foreach ($attributes as $attribute) { $maxDepthReached = false; if (null !== $attributesMetadata && ($maxDepthReached = $this->isMaxDepthReached($attributesMetadata, $class, $attribute, $context)) && !$maxDepthHandler) { continue; } $attributeValue = $this->getAttributeValue($object, $attribute, $format, $context); if ($maxDepthReached) { $attributeValue = $maxDepthHandler($attributeValue, $object, $attribute, $format, $context); } /** * @var callable|null */ $callback = $context[self::CALLBACKS][$attribute] ?? $this->defaultContext[self::CALLBACKS][$attribute] ?? $this->callbacks[$attribute] ?? null; if ($callback) { $attributeValue = $callback($attributeValue, $object, $attribute, $format, $context); } if (null !== $attributeValue && !is_scalar($attributeValue)) { $stack[$attribute] = $attributeValue; } $data = $this->updateData($data, $attribute, $attributeValue, $class, $format, $context); } foreach ($stack as $attribute => $attributeValue) { if (!$this->serializer instanceof NormalizerInterface) { throw new LogicException(sprintf('Cannot normalize attribute "%s" because the injected serializer is not a normalizer', $attribute)); } $data = $this->updateData($data, $attribute, $this->serializer->normalize($attributeValue, $format, $this->createChildContext($context, $attribute, $format)), $class, $format, $context); } return $data; }
php
public function normalize($object, $format = null, array $context = []) { if (!isset($context['cache_key'])) { $context['cache_key'] = $this->getCacheKey($format, $context); } if (isset($context[self::CALLBACKS])) { if (!\is_array($context[self::CALLBACKS])) { throw new InvalidArgumentException(sprintf('The "%s" context option must be an array of callables.', self::CALLBACKS)); } foreach ($context[self::CALLBACKS] as $attribute => $callback) { if (!\is_callable($callback)) { throw new InvalidArgumentException(sprintf('Invalid callback found for attribute "%s" in the "%s" context option.', $attribute, self::CALLBACKS)); } } } if ($this->isCircularReference($object, $context)) { return $this->handleCircularReference($object, $format, $context); } $data = []; $stack = []; $attributes = $this->getAttributes($object, $format, $context); $class = $this->objectClassResolver ? ($this->objectClassResolver)($object) : \get_class($object); $attributesMetadata = $this->classMetadataFactory ? $this->classMetadataFactory->getMetadataFor($class)->getAttributesMetadata() : null; if (isset($context[self::MAX_DEPTH_HANDLER])) { $maxDepthHandler = $context[self::MAX_DEPTH_HANDLER]; if (!\is_callable($maxDepthHandler)) { throw new InvalidArgumentException(sprintf('The "%s" given in the context is not callable.', self::MAX_DEPTH_HANDLER)); } } else { // already validated in constructor resp by type declaration of setMaxDepthHandler $maxDepthHandler = $this->defaultContext[self::MAX_DEPTH_HANDLER] ?? $this->maxDepthHandler; } foreach ($attributes as $attribute) { $maxDepthReached = false; if (null !== $attributesMetadata && ($maxDepthReached = $this->isMaxDepthReached($attributesMetadata, $class, $attribute, $context)) && !$maxDepthHandler) { continue; } $attributeValue = $this->getAttributeValue($object, $attribute, $format, $context); if ($maxDepthReached) { $attributeValue = $maxDepthHandler($attributeValue, $object, $attribute, $format, $context); } /** * @var callable|null */ $callback = $context[self::CALLBACKS][$attribute] ?? $this->defaultContext[self::CALLBACKS][$attribute] ?? $this->callbacks[$attribute] ?? null; if ($callback) { $attributeValue = $callback($attributeValue, $object, $attribute, $format, $context); } if (null !== $attributeValue && !is_scalar($attributeValue)) { $stack[$attribute] = $attributeValue; } $data = $this->updateData($data, $attribute, $attributeValue, $class, $format, $context); } foreach ($stack as $attribute => $attributeValue) { if (!$this->serializer instanceof NormalizerInterface) { throw new LogicException(sprintf('Cannot normalize attribute "%s" because the injected serializer is not a normalizer', $attribute)); } $data = $this->updateData($data, $attribute, $this->serializer->normalize($attributeValue, $format, $this->createChildContext($context, $attribute, $format)), $class, $format, $context); } return $data; }
[ "public", "function", "normalize", "(", "$", "object", ",", "$", "format", "=", "null", ",", "array", "$", "context", "=", "[", "]", ")", "{", "if", "(", "!", "isset", "(", "$", "context", "[", "'cache_key'", "]", ")", ")", "{", "$", "context", "...
{@inheritdoc}
[ "{" ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Serializer/Normalizer/AbstractObjectNormalizer.php#L138-L210
train
Normalize an object
[ 30522, 2270, 3853, 3671, 4697, 1006, 1002, 4874, 1010, 1002, 4289, 1027, 19701, 1010, 9140, 1002, 6123, 1027, 1031, 1033, 1007, 1063, 2065, 1006, 999, 26354, 3388, 1006, 1002, 6123, 1031, 1005, 17053, 1035, 3145, 1005, 1033, 1007, 1007, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
plugins/Referrers/Tasks.php
Tasks.updateSearchEngines
public function updateSearchEngines() { $url = 'https://raw.githubusercontent.com/matomo-org/searchengine-and-social-list/master/SearchEngines.yml'; $list = Http::sendHttpRequest($url, 30); $searchEngines = SearchEngine::getInstance()->loadYmlData($list); if (count($searchEngines) < 200) { return; } Option::set(SearchEngine::OPTION_STORAGE_NAME, base64_encode(serialize($searchEngines))); }
php
public function updateSearchEngines() { $url = 'https://raw.githubusercontent.com/matomo-org/searchengine-and-social-list/master/SearchEngines.yml'; $list = Http::sendHttpRequest($url, 30); $searchEngines = SearchEngine::getInstance()->loadYmlData($list); if (count($searchEngines) < 200) { return; } Option::set(SearchEngine::OPTION_STORAGE_NAME, base64_encode(serialize($searchEngines))); }
[ "public", "function", "updateSearchEngines", "(", ")", "{", "$", "url", "=", "'https://raw.githubusercontent.com/matomo-org/searchengine-and-social-list/master/SearchEngines.yml'", ";", "$", "list", "=", "Http", "::", "sendHttpRequest", "(", "$", "url", ",", "30", ")", ...
Update the search engine definitions @see https://github.com/matomo-org/searchengine-and-social-list
[ "Update", "the", "search", "engine", "definitions" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Referrers/Tasks.php#L31-L40
train
Update search engine options
[ 30522, 2270, 3853, 14409, 14644, 21043, 10586, 1006, 1007, 1063, 1002, 24471, 2140, 1027, 1005, 16770, 1024, 1013, 1013, 6315, 1012, 21025, 2705, 12083, 20330, 8663, 6528, 2102, 1012, 4012, 1013, 13523, 19506, 1011, 8917, 1013, 3945, 13159, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/Security/Http/ParameterBagUtils.php
ParameterBagUtils.getParameterBagValue
public static function getParameterBagValue(ParameterBag $parameters, $path) { if (false === $pos = strpos($path, '[')) { return $parameters->get($path); } $root = substr($path, 0, $pos); if (null === $value = $parameters->get($root)) { return; } if (null === self::$propertyAccessor) { self::$propertyAccessor = PropertyAccess::createPropertyAccessor(); } try { return self::$propertyAccessor->getValue($value, substr($path, $pos)); } catch (AccessException $e) { return; } }
php
public static function getParameterBagValue(ParameterBag $parameters, $path) { if (false === $pos = strpos($path, '[')) { return $parameters->get($path); } $root = substr($path, 0, $pos); if (null === $value = $parameters->get($root)) { return; } if (null === self::$propertyAccessor) { self::$propertyAccessor = PropertyAccess::createPropertyAccessor(); } try { return self::$propertyAccessor->getValue($value, substr($path, $pos)); } catch (AccessException $e) { return; } }
[ "public", "static", "function", "getParameterBagValue", "(", "ParameterBag", "$", "parameters", ",", "$", "path", ")", "{", "if", "(", "false", "===", "$", "pos", "=", "strpos", "(", "$", "path", ",", "'['", ")", ")", "{", "return", "$", "parameters", ...
Returns a "parameter" value. Paths like foo[bar] will be evaluated to find deeper items in nested data structures. @param ParameterBag $parameters The parameter bag @param string $path The key @return mixed @throws InvalidArgumentException when the given path is malformed
[ "Returns", "a", "parameter", "value", "." ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Security/Http/ParameterBagUtils.php#L39-L60
train
Get the value of a parameter bag
[ 30522, 2270, 10763, 3853, 2131, 28689, 22828, 16078, 10175, 5657, 1006, 16381, 16078, 1002, 11709, 1010, 1002, 4130, 1007, 1063, 2065, 1006, 6270, 1027, 30524, 13433, 2015, 1007, 1025, 2065, 1006, 19701, 1027, 1027, 1027, 1002, 3643, 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/Bridge/Twig/Extension/WorkflowExtension.php
WorkflowExtension.getEnabledTransitions
public function getEnabledTransitions($subject, $name = null) { return $this->workflowRegistry->get($subject, $name)->getEnabledTransitions($subject); }
php
public function getEnabledTransitions($subject, $name = null) { return $this->workflowRegistry->get($subject, $name)->getEnabledTransitions($subject); }
[ "public", "function", "getEnabledTransitions", "(", "$", "subject", ",", "$", "name", "=", "null", ")", "{", "return", "$", "this", "->", "workflowRegistry", "->", "get", "(", "$", "subject", ",", "$", "name", ")", "->", "getEnabledTransitions", "(", "$", ...
Returns all enabled transitions. @param object $subject A subject @param string $name A workflow name @return Transition[] All enabled transitions
[ "Returns", "all", "enabled", "transitions", "." ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bridge/Twig/Extension/WorkflowExtension.php#L68-L71
train
Get enabled transitions
[ 30522, 2270, 3853, 2131, 8189, 23242, 6494, 3619, 22753, 2015, 1006, 1002, 3395, 1010, 1002, 2171, 1027, 19701, 1007, 1063, 2709, 1002, 2023, 1011, 1028, 2147, 12314, 2890, 24063, 2854, 1011, 1028, 2131, 1006, 1002, 3395, 1010, 1002, 2171, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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.php
Zend_Mail.setFrom
public function setFrom($email, $name = null) { if (null !== $this->_from) { /** * @see Zend_Mail_Exception */ // require_once 'Zend/Mail/Exception.php'; throw new Zend_Mail_Exception('From Header set twice'); } $email = $this->_filterEmail($email); $name = $this->_filterName($name); $this->_from = $email; $this->_storeHeader('From', $this->_formatAddress($email, $name), true); return $this; }
php
public function setFrom($email, $name = null) { if (null !== $this->_from) { /** * @see Zend_Mail_Exception */ // require_once 'Zend/Mail/Exception.php'; throw new Zend_Mail_Exception('From Header set twice'); } $email = $this->_filterEmail($email); $name = $this->_filterName($name); $this->_from = $email; $this->_storeHeader('From', $this->_formatAddress($email, $name), true); return $this; }
[ "public", "function", "setFrom", "(", "$", "email", ",", "$", "name", "=", "null", ")", "{", "if", "(", "null", "!==", "$", "this", "->", "_from", ")", "{", "/**\n * @see Zend_Mail_Exception\n */", "// require_once 'Zend/Mail/Exception.php';", ...
Sets From-header and sender of the message @param string $email @param string $name @return Zend_Mail Provides fluent interface @throws Zend_Mail_Exception if called subsequent times
[ "Sets", "From", "-", "header", "and", "sender", "of", "the", "message" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail.php#L673-L689
train
Set From - header
[ 30522, 2270, 3853, 2275, 19699, 5358, 1006, 1002, 10373, 1010, 1002, 2171, 1027, 19701, 1007, 1063, 2065, 1006, 19701, 999, 1027, 1027, 1002, 2023, 1011, 1028, 1035, 2013, 1007, 1063, 1013, 1008, 1008, 1008, 1030, 2156, 16729, 2094, 1035, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
laravel/framework
src/Illuminate/Auth/Access/Gate.php
Gate.authorize
public function authorize($ability, $arguments = []) { $result = $this->raw($ability, $arguments); if ($result instanceof Response) { return $result; } return $result ? $this->allow() : $this->deny(); }
php
public function authorize($ability, $arguments = []) { $result = $this->raw($ability, $arguments); if ($result instanceof Response) { return $result; } return $result ? $this->allow() : $this->deny(); }
[ "public", "function", "authorize", "(", "$", "ability", ",", "$", "arguments", "=", "[", "]", ")", "{", "$", "result", "=", "$", "this", "->", "raw", "(", "$", "ability", ",", "$", "arguments", ")", ";", "if", "(", "$", "result", "instanceof", "Res...
Determine if the given ability should be granted for the current user. @param string $ability @param array|mixed $arguments @return \Illuminate\Auth\Access\Response @throws \Illuminate\Auth\Access\AuthorizationException
[ "Determine", "if", "the", "given", "ability", "should", "be", "granted", "for", "the", "current", "user", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Auth/Access/Gate.php#L319-L328
train
Authorize the user with the given ability
[ 30522, 2270, 3853, 3166, 4697, 1006, 1002, 3754, 1010, 1002, 9918, 1027, 1031, 1033, 1007, 1063, 1002, 2765, 1027, 1002, 2023, 1011, 1028, 6315, 1006, 1002, 3754, 1010, 1002, 9918, 1007, 1025, 2065, 1006, 1002, 2765, 6013, 11253, 3433, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
laravel/framework
src/Illuminate/Database/Query/Builder.php
Builder.whereNested
public function whereNested(Closure $callback, $boolean = 'and') { call_user_func($callback, $query = $this->forNestedWhere()); return $this->addNestedWhereQuery($query, $boolean); }
php
public function whereNested(Closure $callback, $boolean = 'and') { call_user_func($callback, $query = $this->forNestedWhere()); return $this->addNestedWhereQuery($query, $boolean); }
[ "public", "function", "whereNested", "(", "Closure", "$", "callback", ",", "$", "boolean", "=", "'and'", ")", "{", "call_user_func", "(", "$", "callback", ",", "$", "query", "=", "$", "this", "->", "forNestedWhere", "(", ")", ")", ";", "return", "$", "...
Add a nested where statement to the query. @param \Closure $callback @param string $boolean @return \Illuminate\Database\Query\Builder|static
[ "Add", "a", "nested", "where", "statement", "to", "the", "query", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Query/Builder.php#L1331-L1336
train
Adds a nested where clause to the query.
[ 30522, 2270, 3853, 2073, 5267, 3064, 1006, 8503, 1002, 2655, 5963, 1010, 1002, 22017, 20898, 1027, 1005, 1998, 1005, 1007, 1063, 2655, 1035, 5310, 1035, 4569, 2278, 1006, 1002, 2655, 5963, 1010, 1002, 23032, 1027, 1002, 2023, 1011, 1028, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
getgrav/grav
system/src/Grav/Common/Helpers/Truncator.php
Truncator.truncateLetters
public static function truncateLetters($html, $limit = 0, $ellipsis = '') { if ($limit <= 0) { return $html; } $doc = self::htmlToDomDocument($html); $container = $doc->getElementsByTagName('div')->item(0); $container = $container->parentNode->removeChild($container); // Iterate over letters. $letters = new DOMLettersIterator($container); $truncated = false; foreach ($letters as $letter) { // If we have exceeded the limit, we want to delete the remainder of this document. if ($letters->key() >= $limit) { $currentText = $letters->currentTextPosition(); $currentText[0]->nodeValue = mb_substr($currentText[0]->nodeValue, 0, $currentText[1] + 1); self::removeProceedingNodes($currentText[0], $container); if (!empty($ellipsis)) { self::insertEllipsis($currentText[0], $ellipsis); } $truncated = true; break; } } // Return original HTML if not truncated. if ($truncated) { $html = self::getCleanedHtml($doc, $container); } return $html; }
php
public static function truncateLetters($html, $limit = 0, $ellipsis = '') { if ($limit <= 0) { return $html; } $doc = self::htmlToDomDocument($html); $container = $doc->getElementsByTagName('div')->item(0); $container = $container->parentNode->removeChild($container); // Iterate over letters. $letters = new DOMLettersIterator($container); $truncated = false; foreach ($letters as $letter) { // If we have exceeded the limit, we want to delete the remainder of this document. if ($letters->key() >= $limit) { $currentText = $letters->currentTextPosition(); $currentText[0]->nodeValue = mb_substr($currentText[0]->nodeValue, 0, $currentText[1] + 1); self::removeProceedingNodes($currentText[0], $container); if (!empty($ellipsis)) { self::insertEllipsis($currentText[0], $ellipsis); } $truncated = true; break; } } // Return original HTML if not truncated. if ($truncated) { $html = self::getCleanedHtml($doc, $container); } return $html; }
[ "public", "static", "function", "truncateLetters", "(", "$", "html", ",", "$", "limit", "=", "0", ",", "$", "ellipsis", "=", "''", ")", "{", "if", "(", "$", "limit", "<=", "0", ")", "{", "return", "$", "html", ";", "}", "$", "doc", "=", "self", ...
Safely truncates HTML by a given number of letters. @param string $html Input HTML. @param int $limit Limit to how many letters we preserve. @param string $ellipsis String to use as ellipsis (if any). @return string Safe truncated HTML.
[ "Safely", "truncates", "HTML", "by", "a", "given", "number", "of", "letters", "." ]
1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72
https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Helpers/Truncator.php#L96-L134
train
Truncates HTML by removing all letters from the first level of the document.
[ 30522, 2270, 10763, 3853, 19817, 4609, 16280, 27901, 2869, 1006, 1002, 16129, 1010, 1002, 5787, 1027, 1014, 1010, 1002, 3449, 15000, 6190, 1027, 1005, 1005, 1007, 1063, 2065, 1006, 1002, 5787, 1026, 1027, 1014, 1007, 1063, 2709, 1002, 16129...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
z-song/laravel-admin
src/Grid/Filter/Presenter/Select.php
Select.loadRemoteOptions
protected function loadRemoteOptions($url, $parameters = [], $options = []) { $ajaxOptions = [ 'url' => $url.'?'.http_build_query($parameters), ]; $configs = array_merge([ 'allowClear' => true, 'placeholder' => [ 'id' => '', 'text' => trans('admin.choose'), ], ], $this->config); $configs = json_encode($configs); $configs = substr($configs, 1, strlen($configs) - 2); $ajaxOptions = json_encode(array_merge($ajaxOptions, $options), JSON_UNESCAPED_UNICODE); $values = (array) $this->filter->getValue(); $values = array_filter($values); $values = json_encode($values); $this->script = <<<EOT $.ajax($ajaxOptions).done(function(data) { $(".{$this->getElementClass()}").select2({ data: data, $configs }).val($values).trigger("change"); }); EOT; }
php
protected function loadRemoteOptions($url, $parameters = [], $options = []) { $ajaxOptions = [ 'url' => $url.'?'.http_build_query($parameters), ]; $configs = array_merge([ 'allowClear' => true, 'placeholder' => [ 'id' => '', 'text' => trans('admin.choose'), ], ], $this->config); $configs = json_encode($configs); $configs = substr($configs, 1, strlen($configs) - 2); $ajaxOptions = json_encode(array_merge($ajaxOptions, $options), JSON_UNESCAPED_UNICODE); $values = (array) $this->filter->getValue(); $values = array_filter($values); $values = json_encode($values); $this->script = <<<EOT $.ajax($ajaxOptions).done(function(data) { $(".{$this->getElementClass()}").select2({ data: data, $configs }).val($values).trigger("change"); }); EOT; }
[ "protected", "function", "loadRemoteOptions", "(", "$", "url", ",", "$", "parameters", "=", "[", "]", ",", "$", "options", "=", "[", "]", ")", "{", "$", "ajaxOptions", "=", "[", "'url'", "=>", "$", "url", ".", "'?'", ".", "http_build_query", "(", "$"...
Load options from remote. @param string $url @param array $parameters @param array $options @return $this
[ "Load", "options", "from", "remote", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Grid/Filter/Presenter/Select.php#L151-L184
train
Load remote options
[ 30522, 5123, 3853, 7170, 28578, 12184, 7361, 9285, 1006, 1002, 24471, 2140, 1010, 1002, 11709, 1027, 1031, 1033, 1010, 1002, 7047, 1027, 1031, 1033, 1007, 1063, 1002, 18176, 7361, 9285, 1027, 1031, 1005, 24471, 2140, 1005, 1027, 1028, 1002,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
libs/Zend/Cache/Backend/Static.php
Zend_Cache_Backend_Static._verifyPath
protected function _verifyPath($path) { $path = realpath($path); $base = realpath($this->_options['public_dir']); return strncmp($path, $base, strlen($base)) !== 0; }
php
protected function _verifyPath($path) { $path = realpath($path); $base = realpath($this->_options['public_dir']); return strncmp($path, $base, strlen($base)) !== 0; }
[ "protected", "function", "_verifyPath", "(", "$", "path", ")", "{", "$", "path", "=", "realpath", "(", "$", "path", ")", ";", "$", "base", "=", "realpath", "(", "$", "this", "->", "_options", "[", "'public_dir'", "]", ")", ";", "return", "strncmp", "...
Verify path exists and is non-empty @param string $path @return bool
[ "Verify", "path", "exists", "and", "is", "non", "-", "empty" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache/Backend/Static.php#L491-L496
train
Verify that the path is in the public directory of the current context
[ 30522, 5123, 3853, 1035, 20410, 15069, 1006, 1002, 4130, 1007, 1063, 1002, 4130, 1027, 2613, 15069, 1006, 1002, 4130, 1007, 1025, 1002, 2918, 1027, 2613, 15069, 1006, 1002, 2023, 1011, 1028, 1035, 7047, 1031, 1005, 2270, 1035, 16101, 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...
octobercms/october
modules/system/ServiceProvider.php
ServiceProvider.registerValidator
protected function registerValidator() { $this->app->resolving('validator', function($validator) { /* * Allowed file extensions, as opposed to mime types. * - extensions: png,jpg,txt */ $validator->extend('extensions', function ($attribute, $value, $parameters) { $extension = strtolower($value->getClientOriginalExtension()); return in_array($extension, $parameters); }); $validator->replacer('extensions', function ($message, $attribute, $rule, $parameters) { return strtr($message, [':values' => implode(', ', $parameters)]); }); }); }
php
protected function registerValidator() { $this->app->resolving('validator', function($validator) { /* * Allowed file extensions, as opposed to mime types. * - extensions: png,jpg,txt */ $validator->extend('extensions', function ($attribute, $value, $parameters) { $extension = strtolower($value->getClientOriginalExtension()); return in_array($extension, $parameters); }); $validator->replacer('extensions', function ($message, $attribute, $rule, $parameters) { return strtr($message, [':values' => implode(', ', $parameters)]); }); }); }
[ "protected", "function", "registerValidator", "(", ")", "{", "$", "this", "->", "app", "->", "resolving", "(", "'validator'", ",", "function", "(", "$", "validator", ")", "{", "/*\n * Allowed file extensions, as opposed to mime types.\n * - extension...
Extends the validator with custom rules
[ "Extends", "the", "validator", "with", "custom", "rules" ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/ServiceProvider.php#L528-L544
train
Registers the validator
[ 30522, 5123, 3853, 4236, 10175, 8524, 4263, 1006, 1007, 1063, 1002, 2023, 1011, 1028, 10439, 1011, 1028, 29304, 1006, 1005, 9398, 8844, 1005, 1010, 3853, 1006, 1002, 9398, 8844, 1007, 1063, 1013, 1008, 1008, 3039, 5371, 14305, 1010, 2004, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/Form/Extension/DataCollector/FormDataCollector.php
FormDataCollector.collectSubmittedData
public function collectSubmittedData(FormInterface $form) { $hash = spl_object_hash($form); if (!isset($this->dataByForm[$hash])) { // field was created by form event $this->collectConfiguration($form); $this->collectDefaultData($form); } $this->dataByForm[$hash] = array_replace( $this->dataByForm[$hash], $this->dataExtractor->extractSubmittedData($form) ); // Count errors if (isset($this->dataByForm[$hash]['errors'])) { $this->data['nb_errors'] += \count($this->dataByForm[$hash]['errors']); } foreach ($form as $child) { $this->collectSubmittedData($child); // Expand current form if there are children with errors if (empty($this->dataByForm[$hash]['has_children_error'])) { $childData = $this->dataByForm[spl_object_hash($child)]; $this->dataByForm[$hash]['has_children_error'] = !empty($childData['has_children_error']) || !empty($childData['errors']); } } }
php
public function collectSubmittedData(FormInterface $form) { $hash = spl_object_hash($form); if (!isset($this->dataByForm[$hash])) { // field was created by form event $this->collectConfiguration($form); $this->collectDefaultData($form); } $this->dataByForm[$hash] = array_replace( $this->dataByForm[$hash], $this->dataExtractor->extractSubmittedData($form) ); // Count errors if (isset($this->dataByForm[$hash]['errors'])) { $this->data['nb_errors'] += \count($this->dataByForm[$hash]['errors']); } foreach ($form as $child) { $this->collectSubmittedData($child); // Expand current form if there are children with errors if (empty($this->dataByForm[$hash]['has_children_error'])) { $childData = $this->dataByForm[spl_object_hash($child)]; $this->dataByForm[$hash]['has_children_error'] = !empty($childData['has_children_error']) || !empty($childData['errors']); } } }
[ "public", "function", "collectSubmittedData", "(", "FormInterface", "$", "form", ")", "{", "$", "hash", "=", "spl_object_hash", "(", "$", "form", ")", ";", "if", "(", "!", "isset", "(", "$", "this", "->", "dataByForm", "[", "$", "hash", "]", ")", ")", ...
{@inheritdoc}
[ "{" ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/Extension/DataCollector/FormDataCollector.php#L150-L179
train
Collect submitted data from form
[ 30522, 2270, 3853, 17427, 12083, 22930, 3064, 2850, 2696, 1006, 2433, 18447, 2121, 12172, 1002, 2433, 1007, 1063, 1002, 23325, 1027, 11867, 2140, 1035, 4874, 1035, 23325, 1006, 1002, 2433, 1007, 1025, 2065, 1006, 999, 26354, 3388, 1006, 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/Process/Pipes/AbstractPipes.php
AbstractPipes.hasSystemCallBeenInterrupted
protected function hasSystemCallBeenInterrupted() { $lastError = $this->lastError; $this->lastError = null; // stream_select returns false when the `select` system call is interrupted by an incoming signal return null !== $lastError && false !== stripos($lastError, 'interrupted system call'); }
php
protected function hasSystemCallBeenInterrupted() { $lastError = $this->lastError; $this->lastError = null; // stream_select returns false when the `select` system call is interrupted by an incoming signal return null !== $lastError && false !== stripos($lastError, 'interrupted system call'); }
[ "protected", "function", "hasSystemCallBeenInterrupted", "(", ")", "{", "$", "lastError", "=", "$", "this", "->", "lastError", ";", "$", "this", "->", "lastError", "=", "null", ";", "// stream_select returns false when the `select` system call is interrupted by an incoming ...
Returns true if a system call has been interrupted. @return bool
[ "Returns", "true", "if", "a", "system", "call", "has", "been", "interrupted", "." ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Process/Pipes/AbstractPipes.php#L60-L67
train
Checks if the system call has been interrupted
[ 30522, 5123, 3853, 2038, 6508, 13473, 12458, 8095, 11306, 11483, 3334, 21531, 3064, 1006, 1007, 1063, 1002, 2197, 2121, 29165, 1027, 1002, 2023, 1011, 1028, 2197, 2121, 29165, 1025, 1002, 2023, 1011, 1028, 2197, 2121, 29165, 1027, 19701, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
laravel/framework
src/Illuminate/Queue/Capsule/Manager.php
Manager.later
public static function later($delay, $job, $data = '', $queue = null, $connection = null) { return static::$instance->connection($connection)->later($delay, $job, $data, $queue); }
php
public static function later($delay, $job, $data = '', $queue = null, $connection = null) { return static::$instance->connection($connection)->later($delay, $job, $data, $queue); }
[ "public", "static", "function", "later", "(", "$", "delay", ",", "$", "job", ",", "$", "data", "=", "''", ",", "$", "queue", "=", "null", ",", "$", "connection", "=", "null", ")", "{", "return", "static", "::", "$", "instance", "->", "connection", ...
Push a new job onto the queue after a delay. @param \DateTimeInterface|\DateInterval|int $delay @param string $job @param mixed $data @param string $queue @param string $connection @return mixed
[ "Push", "a", "new", "job", "onto", "the", "queue", "after", "a", "delay", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Queue/Capsule/Manager.php#L126-L129
train
This method is a wrapper for the later function to create a new timer instance.
[ 30522, 2270, 10763, 3853, 2101, 1006, 1002, 8536, 1010, 1002, 3105, 1010, 1002, 2951, 1027, 1005, 1005, 1010, 1002, 24240, 1027, 19701, 1010, 1002, 4434, 1027, 19701, 1007, 1063, 2709, 10763, 1024, 1024, 1002, 6013, 1011, 1028, 4434, 1006, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
libs/Zend/Db/Select.php
Zend_Db_Select._joinUsing
public function _joinUsing($type, $name, $cond, $cols = '*', $schema = null) { if (empty($this->_parts[self::FROM])) { // require_once 'Zend/Db/Select/Exception.php'; throw new Zend_Db_Select_Exception("You can only perform a joinUsing after specifying a FROM table"); } $join = $this->_adapter->quoteIdentifier(key($this->_parts[self::FROM]), true); $from = $this->_adapter->quoteIdentifier($this->_uniqueCorrelation($name), true); $cond1 = $from . '.' . $cond; $cond2 = $join . '.' . $cond; $cond = $cond1 . ' = ' . $cond2; return $this->_join($type, $name, $cond, $cols, $schema); }
php
public function _joinUsing($type, $name, $cond, $cols = '*', $schema = null) { if (empty($this->_parts[self::FROM])) { // require_once 'Zend/Db/Select/Exception.php'; throw new Zend_Db_Select_Exception("You can only perform a joinUsing after specifying a FROM table"); } $join = $this->_adapter->quoteIdentifier(key($this->_parts[self::FROM]), true); $from = $this->_adapter->quoteIdentifier($this->_uniqueCorrelation($name), true); $cond1 = $from . '.' . $cond; $cond2 = $join . '.' . $cond; $cond = $cond1 . ' = ' . $cond2; return $this->_join($type, $name, $cond, $cols, $schema); }
[ "public", "function", "_joinUsing", "(", "$", "type", ",", "$", "name", ",", "$", "cond", ",", "$", "cols", "=", "'*'", ",", "$", "schema", "=", "null", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "_parts", "[", "self", "::", "FROM", ...
Handle JOIN... USING... syntax This is functionality identical to the existing JOIN methods, however the join condition can be passed as a single column name. This method then completes the ON condition by using the same field for the FROM table and the JOIN table. <code> $select = $db->select()->from('table1') ->joinUsing('table2', 'column1'); // SELECT * FROM table1 JOIN table2 ON table1.column1 = table2.column2 </code> These joins are called by the developer simply by adding 'Using' to the method name. E.g. * joinUsing * joinInnerUsing * joinFullUsing * joinRightUsing * joinLeftUsing @return Zend_Db_Select This Zend_Db_Select object.
[ "Handle", "JOIN", "...", "USING", "...", "syntax" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Select.php#L873-L888
train
Join using statement
[ 30522, 2270, 3853, 1035, 3693, 18161, 1006, 1002, 2828, 1010, 1002, 2171, 1010, 1002, 9530, 2094, 1010, 1002, 8902, 2015, 1027, 1005, 1008, 1005, 1010, 1002, 8040, 28433, 1027, 19701, 1007, 1063, 2065, 1006, 4064, 1006, 1002, 2023, 1011, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
octobercms/october
modules/cms/classes/CodeParser.php
CodeParser.getCacheFilePath
protected function getCacheFilePath() { $hash = md5($this->filePath); $result = storage_path().'/cms/cache/'; $result .= substr($hash, 0, 2).'/'; $result .= substr($hash, 2, 2).'/'; $result .= basename($this->filePath); $result .= '.php'; return $result; }
php
protected function getCacheFilePath() { $hash = md5($this->filePath); $result = storage_path().'/cms/cache/'; $result .= substr($hash, 0, 2).'/'; $result .= substr($hash, 2, 2).'/'; $result .= basename($this->filePath); $result .= '.php'; return $result; }
[ "protected", "function", "getCacheFilePath", "(", ")", "{", "$", "hash", "=", "md5", "(", "$", "this", "->", "filePath", ")", ";", "$", "result", "=", "storage_path", "(", ")", ".", "'/cms/cache/'", ";", "$", "result", ".=", "substr", "(", "$", "hash",...
Returns path to the cached parsed file @return string
[ "Returns", "path", "to", "the", "cached", "parsed", "file" ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/CodeParser.php#L234-L244
train
Get cache file path
[ 30522, 5123, 3853, 2131, 3540, 5403, 8873, 2571, 15069, 1006, 1007, 1063, 1002, 23325, 1027, 9108, 2629, 1006, 1002, 2023, 1011, 1028, 5371, 15069, 1007, 1025, 1002, 2765, 1027, 5527, 1035, 4130, 1006, 1007, 1012, 1005, 1013, 4642, 2015, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
plugins/SitesManager/API.php
API.getSitesFromGroup
public function getSitesFromGroup($group = '') { Piwik::checkUserHasSuperUserAccess(); $group = trim($group); $sites = $this->getModel()->getSitesFromGroup($group); foreach ($sites as &$site) { $this->enrichSite($site); } $sites = Site::setSitesFromArray($sites); return $sites; }
php
public function getSitesFromGroup($group = '') { Piwik::checkUserHasSuperUserAccess(); $group = trim($group); $sites = $this->getModel()->getSitesFromGroup($group); foreach ($sites as &$site) { $this->enrichSite($site); } $sites = Site::setSitesFromArray($sites); return $sites; }
[ "public", "function", "getSitesFromGroup", "(", "$", "group", "=", "''", ")", "{", "Piwik", "::", "checkUserHasSuperUserAccess", "(", ")", ";", "$", "group", "=", "trim", "(", "$", "group", ")", ";", "$", "sites", "=", "$", "this", "->", "getModel", "(...
Returns all websites belonging to the specified group @param string $group Group name @return array of sites
[ "Returns", "all", "websites", "belonging", "to", "the", "specified", "group" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SitesManager/API.php#L195-L208
train
Returns the list of all the sites in a group
[ 30522, 2270, 3853, 4152, 7616, 19699, 5358, 17058, 1006, 1002, 2177, 1027, 1005, 1005, 1007, 1063, 14255, 9148, 2243, 1024, 1024, 4638, 20330, 14949, 6342, 4842, 20330, 6305, 9623, 2015, 1006, 1007, 1025, 1002, 2177, 1027, 12241, 1006, 1002...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
laravel/framework
src/Illuminate/Auth/SessionGuard.php
SessionGuard.user
public function user() { if ($this->loggedOut) { return; } // If we've already retrieved the user for the current request we can just // return it back immediately. We do not want to fetch the user data on // every call to this method because that would be tremendously slow. if (! is_null($this->user)) { return $this->user; } $id = $this->session->get($this->getName()); // First we will try to load the user using the identifier in the session if // one exists. Otherwise we will check for a "remember me" cookie in this // request, and if one exists, attempt to retrieve the user using that. if (! is_null($id) && $this->user = $this->provider->retrieveById($id)) { $this->fireAuthenticatedEvent($this->user); } // If the user is null, but we decrypt a "recaller" cookie we can attempt to // pull the user data on that cookie which serves as a remember cookie on // the application. Once we have a user we can return it to the caller. if (is_null($this->user) && ! is_null($recaller = $this->recaller())) { $this->user = $this->userFromRecaller($recaller); if ($this->user) { $this->updateSession($this->user->getAuthIdentifier()); $this->fireLoginEvent($this->user, true); } } return $this->user; }
php
public function user() { if ($this->loggedOut) { return; } // If we've already retrieved the user for the current request we can just // return it back immediately. We do not want to fetch the user data on // every call to this method because that would be tremendously slow. if (! is_null($this->user)) { return $this->user; } $id = $this->session->get($this->getName()); // First we will try to load the user using the identifier in the session if // one exists. Otherwise we will check for a "remember me" cookie in this // request, and if one exists, attempt to retrieve the user using that. if (! is_null($id) && $this->user = $this->provider->retrieveById($id)) { $this->fireAuthenticatedEvent($this->user); } // If the user is null, but we decrypt a "recaller" cookie we can attempt to // pull the user data on that cookie which serves as a remember cookie on // the application. Once we have a user we can return it to the caller. if (is_null($this->user) && ! is_null($recaller = $this->recaller())) { $this->user = $this->userFromRecaller($recaller); if ($this->user) { $this->updateSession($this->user->getAuthIdentifier()); $this->fireLoginEvent($this->user, true); } } return $this->user; }
[ "public", "function", "user", "(", ")", "{", "if", "(", "$", "this", "->", "loggedOut", ")", "{", "return", ";", "}", "// If we've already retrieved the user for the current request we can just", "// return it back immediately. We do not want to fetch the user data on", "// eve...
Get the currently authenticated user. @return \Illuminate\Contracts\Auth\Authenticatable|null
[ "Get", "the", "currently", "authenticated", "user", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Auth/SessionGuard.php#L113-L149
train
Return the user object
[ 30522, 2270, 3853, 5310, 1006, 1007, 1063, 2065, 1006, 1002, 2023, 1011, 1028, 26618, 5833, 1007, 1063, 2709, 1025, 1065, 1013, 1013, 2065, 2057, 1005, 2310, 2525, 5140, 1996, 5310, 2005, 1996, 2783, 5227, 2057, 2064, 2074, 1013, 1013, 27...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
libs/Zend/Db/Adapter/Abstract.php
Zend_Db_Adapter_Abstract.foldCase
public function foldCase($key) { switch ($this->_caseFolding) { case Zend_Db::CASE_LOWER: $value = strtolower((string) $key); break; case Zend_Db::CASE_UPPER: $value = strtoupper((string) $key); break; case Zend_Db::CASE_NATURAL: default: $value = (string) $key; } return $value; }
php
public function foldCase($key) { switch ($this->_caseFolding) { case Zend_Db::CASE_LOWER: $value = strtolower((string) $key); break; case Zend_Db::CASE_UPPER: $value = strtoupper((string) $key); break; case Zend_Db::CASE_NATURAL: default: $value = (string) $key; } return $value; }
[ "public", "function", "foldCase", "(", "$", "key", ")", "{", "switch", "(", "$", "this", "->", "_caseFolding", ")", "{", "case", "Zend_Db", "::", "CASE_LOWER", ":", "$", "value", "=", "strtolower", "(", "(", "string", ")", "$", "key", ")", ";", "brea...
Helper method to change the case of the strings used when returning result sets in FETCH_ASSOC and FETCH_BOTH modes. This is not intended to be used by application code, but the method must be public so the Statement class can invoke it. @param string $key @return string
[ "Helper", "method", "to", "change", "the", "case", "of", "the", "strings", "used", "when", "returning", "result", "sets", "in", "FETCH_ASSOC", "and", "FETCH_BOTH", "modes", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Adapter/Abstract.php#L1101-L1115
train
Folds the case of the column
[ 30522, 2270, 3853, 10671, 18382, 1006, 1002, 3145, 1007, 1063, 6942, 1006, 1002, 2023, 1011, 1028, 1035, 2553, 21508, 1007, 1063, 2553, 16729, 2094, 1035, 16962, 1024, 1024, 2553, 1035, 2896, 1024, 1002, 3643, 1027, 2358, 5339, 12898, 13777...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/Validator/Mapping/Cache/Psr6Cache.php
Psr6Cache.write
public function write(ClassMetadata $metadata) { $item = $this->cacheItemPool->getItem($this->escapeClassName($metadata->getClassName())); $item->set($metadata); $this->cacheItemPool->save($item); }
php
public function write(ClassMetadata $metadata) { $item = $this->cacheItemPool->getItem($this->escapeClassName($metadata->getClassName())); $item->set($metadata); $this->cacheItemPool->save($item); }
[ "public", "function", "write", "(", "ClassMetadata", "$", "metadata", ")", "{", "$", "item", "=", "$", "this", "->", "cacheItemPool", "->", "getItem", "(", "$", "this", "->", "escapeClassName", "(", "$", "metadata", "->", "getClassName", "(", ")", ")", "...
{@inheritdoc}
[ "{" ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Validator/Mapping/Cache/Psr6Cache.php#L56-L62
train
Write the ClassMetadata to the cache.
[ 30522, 2270, 3853, 4339, 1006, 2465, 11368, 8447, 2696, 1002, 27425, 1007, 1063, 1002, 8875, 1027, 1002, 2023, 1011, 1028, 17053, 4221, 8737, 13669, 1011, 1028, 2131, 4221, 2213, 1006, 1002, 2023, 1011, 1028, 4019, 26266, 18442, 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...
PHPMailer/PHPMailer
src/PHPMailer.php
PHPMailer.encodeHeader
public function encodeHeader($str, $position = 'text') { $matchcount = 0; switch (strtolower($position)) { case 'phrase': if (!preg_match('/[\200-\377]/', $str)) { // Can't use addslashes as we don't know the value of magic_quotes_sybase $encoded = addcslashes($str, "\0..\37\177\\\""); if (($str == $encoded) and !preg_match('/[^A-Za-z0-9!#$%&\'*+\/=?^_`{|}~ -]/', $str)) { return $encoded; } return "\"$encoded\""; } $matchcount = preg_match_all('/[^\040\041\043-\133\135-\176]/', $str, $matches); break; /* @noinspection PhpMissingBreakStatementInspection */ case 'comment': $matchcount = preg_match_all('/[()"]/', $str, $matches); //fallthrough case 'text': default: $matchcount += preg_match_all('/[\000-\010\013\014\016-\037\177-\377]/', $str, $matches); break; } //RFCs specify a maximum line length of 78 chars, however mail() will sometimes //corrupt messages with headers longer than 65 chars. See #818 $lengthsub = 'mail' == $this->Mailer ? 13 : 0; $maxlen = static::STD_LINE_LENGTH - $lengthsub; // Try to select the encoding which should produce the shortest output if ($matchcount > strlen($str) / 3) { // More than a third of the content will need encoding, so B encoding will be most efficient $encoding = 'B'; //This calculation is: // max line length // - shorten to avoid mail() corruption // - Q/B encoding char overhead ("` =?<charset>?[QB]?<content>?=`") // - charset name length $maxlen = static::STD_LINE_LENGTH - $lengthsub - 8 - strlen($this->CharSet); if ($this->hasMultiBytes($str)) { // Use a custom function which correctly encodes and wraps long // multibyte strings without breaking lines within a character $encoded = $this->base64EncodeWrapMB($str, "\n"); } else { $encoded = base64_encode($str); $maxlen -= $maxlen % 4; $encoded = trim(chunk_split($encoded, $maxlen, "\n")); } $encoded = preg_replace('/^(.*)$/m', ' =?' . $this->CharSet . "?$encoding?\\1?=", $encoded); } elseif ($matchcount > 0) { //1 or more chars need encoding, use Q-encode $encoding = 'Q'; //Recalc max line length for Q encoding - see comments on B encode $maxlen = static::STD_LINE_LENGTH - $lengthsub - 8 - strlen($this->CharSet); $encoded = $this->encodeQ($str, $position); $encoded = $this->wrapText($encoded, $maxlen, true); $encoded = str_replace('=' . static::$LE, "\n", trim($encoded)); $encoded = preg_replace('/^(.*)$/m', ' =?' . $this->CharSet . "?$encoding?\\1?=", $encoded); } elseif (strlen($str) > $maxlen) { //No chars need encoding, but line is too long, so fold it $encoded = trim($this->wrapText($str, $maxlen, false)); if ($str == $encoded) { //Wrapping nicely didn't work, wrap hard instead $encoded = trim(chunk_split($str, static::STD_LINE_LENGTH, static::$LE)); } $encoded = str_replace(static::$LE, "\n", trim($encoded)); $encoded = preg_replace('/^(.*)$/m', ' \\1', $encoded); } else { //No reformatting needed return $str; } return trim(static::normalizeBreaks($encoded)); }
php
public function encodeHeader($str, $position = 'text') { $matchcount = 0; switch (strtolower($position)) { case 'phrase': if (!preg_match('/[\200-\377]/', $str)) { // Can't use addslashes as we don't know the value of magic_quotes_sybase $encoded = addcslashes($str, "\0..\37\177\\\""); if (($str == $encoded) and !preg_match('/[^A-Za-z0-9!#$%&\'*+\/=?^_`{|}~ -]/', $str)) { return $encoded; } return "\"$encoded\""; } $matchcount = preg_match_all('/[^\040\041\043-\133\135-\176]/', $str, $matches); break; /* @noinspection PhpMissingBreakStatementInspection */ case 'comment': $matchcount = preg_match_all('/[()"]/', $str, $matches); //fallthrough case 'text': default: $matchcount += preg_match_all('/[\000-\010\013\014\016-\037\177-\377]/', $str, $matches); break; } //RFCs specify a maximum line length of 78 chars, however mail() will sometimes //corrupt messages with headers longer than 65 chars. See #818 $lengthsub = 'mail' == $this->Mailer ? 13 : 0; $maxlen = static::STD_LINE_LENGTH - $lengthsub; // Try to select the encoding which should produce the shortest output if ($matchcount > strlen($str) / 3) { // More than a third of the content will need encoding, so B encoding will be most efficient $encoding = 'B'; //This calculation is: // max line length // - shorten to avoid mail() corruption // - Q/B encoding char overhead ("` =?<charset>?[QB]?<content>?=`") // - charset name length $maxlen = static::STD_LINE_LENGTH - $lengthsub - 8 - strlen($this->CharSet); if ($this->hasMultiBytes($str)) { // Use a custom function which correctly encodes and wraps long // multibyte strings without breaking lines within a character $encoded = $this->base64EncodeWrapMB($str, "\n"); } else { $encoded = base64_encode($str); $maxlen -= $maxlen % 4; $encoded = trim(chunk_split($encoded, $maxlen, "\n")); } $encoded = preg_replace('/^(.*)$/m', ' =?' . $this->CharSet . "?$encoding?\\1?=", $encoded); } elseif ($matchcount > 0) { //1 or more chars need encoding, use Q-encode $encoding = 'Q'; //Recalc max line length for Q encoding - see comments on B encode $maxlen = static::STD_LINE_LENGTH - $lengthsub - 8 - strlen($this->CharSet); $encoded = $this->encodeQ($str, $position); $encoded = $this->wrapText($encoded, $maxlen, true); $encoded = str_replace('=' . static::$LE, "\n", trim($encoded)); $encoded = preg_replace('/^(.*)$/m', ' =?' . $this->CharSet . "?$encoding?\\1?=", $encoded); } elseif (strlen($str) > $maxlen) { //No chars need encoding, but line is too long, so fold it $encoded = trim($this->wrapText($str, $maxlen, false)); if ($str == $encoded) { //Wrapping nicely didn't work, wrap hard instead $encoded = trim(chunk_split($str, static::STD_LINE_LENGTH, static::$LE)); } $encoded = str_replace(static::$LE, "\n", trim($encoded)); $encoded = preg_replace('/^(.*)$/m', ' \\1', $encoded); } else { //No reformatting needed return $str; } return trim(static::normalizeBreaks($encoded)); }
[ "public", "function", "encodeHeader", "(", "$", "str", ",", "$", "position", "=", "'text'", ")", "{", "$", "matchcount", "=", "0", ";", "switch", "(", "strtolower", "(", "$", "position", ")", ")", "{", "case", "'phrase'", ":", "if", "(", "!", "preg_m...
Encode a header value (not including its label) optimally. Picks shortest of Q, B, or none. Result includes folding if needed. See RFC822 definitions for phrase, comment and text positions. @param string $str The header value to encode @param string $position What context the string will be used in @return string
[ "Encode", "a", "header", "value", "(", "not", "including", "its", "label", ")", "optimally", ".", "Picks", "shortest", "of", "Q", "B", "or", "none", ".", "Result", "includes", "folding", "if", "needed", ".", "See", "RFC822", "definitions", "for", "phrase",...
3d7132341659a8a201adbc3ba11b1e202ee2857c
https://github.com/PHPMailer/PHPMailer/blob/3d7132341659a8a201adbc3ba11b1e202ee2857c/src/PHPMailer.php#L3091-L3165
train
Encode header string
[ 30522, 2270, 3853, 4372, 16044, 4974, 2121, 1006, 1002, 2358, 2099, 1010, 1002, 2597, 1027, 1005, 3793, 1005, 1007, 1063, 1002, 2674, 3597, 16671, 1027, 1014, 1025, 6942, 1006, 2358, 5339, 12898, 13777, 1006, 1002, 2597, 1007, 1007, 1063, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...