repo
stringclasses
21 values
path
stringlengths
10
100
func_name
stringlengths
6
71
original_string
stringlengths
115
97k
language
stringclasses
1 value
code
stringlengths
115
97k
code_tokens
listlengths
27
7.5k
docstring
stringlengths
6
1.88k
docstring_tokens
listlengths
1
177
sha
stringclasses
21 values
url
stringlengths
100
189
partition
stringclasses
1 value
summary
stringlengths
9
340
input_ids
listlengths
502
502
token_type_ids
listlengths
502
502
attention_mask
listlengths
502
502
labels
listlengths
502
502
matomo-org/matomo
libs/Zend/Mail/Storage/Writable/Maildir.php
Zend_Mail_Storage_Writable_Maildir.copyMessage
public function copyMessage($id, $folder) { if ($this->_quota && $this->checkQuota()) { /** * @see Zend_Mail_Storage_Exception */ // require_once 'Zend/Mail/Storage/Exception.php'; throw new Zend_Mail_Storage_Exception('storage is over quota!'); } if (!($folder instanceof Zend_Mail_Storage_Folder)) { $folder = $this->getFolders($folder); } $filedata = $this->_getFileData($id); $old_file = $filedata['filename']; $flags = $filedata['flags']; // copied message can't be recent while (($key = array_search(Zend_Mail_Storage::FLAG_RECENT, $flags)) !== false) { unset($flags[$key]); } $info = $this->_getInfoString($flags); // we're creating the copy as temp file before moving to cur/ $temp_file = $this->_createTmpFile($folder->getGlobalName()); // we don't write directly to the file fclose($temp_file['handle']); // we're adding the size to the filename for maildir++ $size = filesize($old_file); if ($size !== false) { $info = ',S=' . $size . $info; } $new_file = $temp_file['dirname'] . DIRECTORY_SEPARATOR . 'cur' . DIRECTORY_SEPARATOR . $temp_file['uniq'] . $info; // we're throwing any exception after removing our temp file and saving it to this variable instead $exception = null; if (!copy($old_file, $temp_file['filename'])) { /** * @see Zend_Mail_Storage_Exception */ // require_once 'Zend/Mail/Storage/Exception.php'; $exception = new Zend_Mail_Storage_Exception('cannot copy message file'); } else if (!link($temp_file['filename'], $new_file)) { /** * @see Zend_Mail_Storage_Exception */ // require_once 'Zend/Mail/Storage/Exception.php'; $exception = new Zend_Mail_Storage_Exception('cannot link message file to final dir'); } @unlink($temp_file['filename']); if ($exception) { throw $exception; } if ($folder->getGlobalName() == $this->_currentFolder || ($this->_currentFolder == 'INBOX' && $folder->getGlobalName() == '/')) { $this->_files[] = array('uniq' => $temp_file['uniq'], 'flags' => $flags, 'filename' => $new_file); } if ($this->_quota) { $this->_addQuotaEntry((int)$size, 1); } }
php
public function copyMessage($id, $folder) { if ($this->_quota && $this->checkQuota()) { /** * @see Zend_Mail_Storage_Exception */ // require_once 'Zend/Mail/Storage/Exception.php'; throw new Zend_Mail_Storage_Exception('storage is over quota!'); } if (!($folder instanceof Zend_Mail_Storage_Folder)) { $folder = $this->getFolders($folder); } $filedata = $this->_getFileData($id); $old_file = $filedata['filename']; $flags = $filedata['flags']; // copied message can't be recent while (($key = array_search(Zend_Mail_Storage::FLAG_RECENT, $flags)) !== false) { unset($flags[$key]); } $info = $this->_getInfoString($flags); // we're creating the copy as temp file before moving to cur/ $temp_file = $this->_createTmpFile($folder->getGlobalName()); // we don't write directly to the file fclose($temp_file['handle']); // we're adding the size to the filename for maildir++ $size = filesize($old_file); if ($size !== false) { $info = ',S=' . $size . $info; } $new_file = $temp_file['dirname'] . DIRECTORY_SEPARATOR . 'cur' . DIRECTORY_SEPARATOR . $temp_file['uniq'] . $info; // we're throwing any exception after removing our temp file and saving it to this variable instead $exception = null; if (!copy($old_file, $temp_file['filename'])) { /** * @see Zend_Mail_Storage_Exception */ // require_once 'Zend/Mail/Storage/Exception.php'; $exception = new Zend_Mail_Storage_Exception('cannot copy message file'); } else if (!link($temp_file['filename'], $new_file)) { /** * @see Zend_Mail_Storage_Exception */ // require_once 'Zend/Mail/Storage/Exception.php'; $exception = new Zend_Mail_Storage_Exception('cannot link message file to final dir'); } @unlink($temp_file['filename']); if ($exception) { throw $exception; } if ($folder->getGlobalName() == $this->_currentFolder || ($this->_currentFolder == 'INBOX' && $folder->getGlobalName() == '/')) { $this->_files[] = array('uniq' => $temp_file['uniq'], 'flags' => $flags, 'filename' => $new_file); } if ($this->_quota) { $this->_addQuotaEntry((int)$size, 1); } }
[ "public", "function", "copyMessage", "(", "$", "id", ",", "$", "folder", ")", "{", "if", "(", "$", "this", "->", "_quota", "&&", "$", "this", "->", "checkQuota", "(", ")", ")", "{", "/**\n * @see Zend_Mail_Storage_Exception\n */", "// req...
copy an existing message @param int $id number of message @param string|Zend_Mail_Storage_Folder $folder name or instance of targer folder @return null @throws Zend_Mail_Storage_Exception
[ "copy", "an", "existing", "message" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail/Storage/Writable/Maildir.php#L615-L684
train
Copy a message to a new location
[ 30522, 2270, 3853, 6100, 7834, 3736, 3351, 1006, 1002, 8909, 1010, 1002, 19622, 1007, 1063, 2065, 1006, 1002, 2023, 1011, 1028, 1035, 20563, 1004, 1004, 1002, 2023, 1011, 1028, 4638, 28940, 17287, 1006, 1007, 1007, 1063, 1013, 1008, 1008, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/Validator/Context/ExecutionContext.php
ExecutionContext.getClassName
public function getClassName() { return $this->metadata instanceof MemberMetadata || $this->metadata instanceof ClassMetadataInterface ? $this->metadata->getClassName() : null; }
php
public function getClassName() { return $this->metadata instanceof MemberMetadata || $this->metadata instanceof ClassMetadataInterface ? $this->metadata->getClassName() : null; }
[ "public", "function", "getClassName", "(", ")", "{", "return", "$", "this", "->", "metadata", "instanceof", "MemberMetadata", "||", "$", "this", "->", "metadata", "instanceof", "ClassMetadataInterface", "?", "$", "this", "->", "metadata", "->", "getClassName", "...
{@inheritdoc}
[ "{" ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Validator/Context/ExecutionContext.php#L283-L286
train
Returns the class name of the current object
[ 30522, 2270, 3853, 2131, 26266, 18442, 1006, 1007, 1063, 2709, 1002, 2023, 1011, 1028, 27425, 6013, 11253, 2266, 11368, 8447, 2696, 1064, 1064, 1002, 2023, 1011, 1028, 27425, 6013, 11253, 2465, 11368, 8447, 18249, 3334, 12172, 1029, 1002, 2...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
laravel/framework
src/Illuminate/Database/Schema/Grammars/ChangeColumn.php
ChangeColumn.getDoctrineColumn
protected static function getDoctrineColumn(Table $table, Fluent $fluent) { return $table->changeColumn( $fluent['name'], static::getDoctrineColumnChangeOptions($fluent) )->getColumn($fluent['name']); }
php
protected static function getDoctrineColumn(Table $table, Fluent $fluent) { return $table->changeColumn( $fluent['name'], static::getDoctrineColumnChangeOptions($fluent) )->getColumn($fluent['name']); }
[ "protected", "static", "function", "getDoctrineColumn", "(", "Table", "$", "table", ",", "Fluent", "$", "fluent", ")", "{", "return", "$", "table", "->", "changeColumn", "(", "$", "fluent", "[", "'name'", "]", ",", "static", "::", "getDoctrineColumnChangeOptio...
Get the Doctrine column instance for a column change. @param \Doctrine\DBAL\Schema\Table $table @param \Illuminate\Support\Fluent $fluent @return \Doctrine\DBAL\Schema\Column
[ "Get", "the", "Doctrine", "column", "instance", "for", "a", "column", "change", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Schema/Grammars/ChangeColumn.php#L100-L105
train
Get Doctrine Column
[ 30522, 5123, 10763, 3853, 2131, 3527, 6593, 11467, 25778, 2819, 2078, 1006, 2795, 1002, 2795, 1010, 19376, 1002, 19376, 1007, 1063, 2709, 1002, 2795, 1011, 1028, 2689, 25778, 2819, 2078, 1006, 1002, 19376, 1031, 1005, 2171, 1005, 1033, 1010...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
getgrav/grav
system/src/Grav/Common/Page/Pages.php
Pages.sortCollection
public function sortCollection(Collection $collection, $orderBy, $orderDir = 'asc', $orderManual = null, $sort_flags = null) { $items = $collection->toArray(); if (!$items) { return []; } $lookup = md5(json_encode($items) . json_encode($orderManual) . $orderBy . $orderDir); if (!isset($this->sort[$lookup][$orderBy])) { $this->buildSort($lookup, $items, $orderBy, $orderManual, $sort_flags); } $sort = $this->sort[$lookup][$orderBy]; if ($orderDir !== 'asc') { $sort = array_reverse($sort); } return $sort; }
php
public function sortCollection(Collection $collection, $orderBy, $orderDir = 'asc', $orderManual = null, $sort_flags = null) { $items = $collection->toArray(); if (!$items) { return []; } $lookup = md5(json_encode($items) . json_encode($orderManual) . $orderBy . $orderDir); if (!isset($this->sort[$lookup][$orderBy])) { $this->buildSort($lookup, $items, $orderBy, $orderManual, $sort_flags); } $sort = $this->sort[$lookup][$orderBy]; if ($orderDir !== 'asc') { $sort = array_reverse($sort); } return $sort; }
[ "public", "function", "sortCollection", "(", "Collection", "$", "collection", ",", "$", "orderBy", ",", "$", "orderDir", "=", "'asc'", ",", "$", "orderManual", "=", "null", ",", "$", "sort_flags", "=", "null", ")", "{", "$", "items", "=", "$", "collectio...
@param Collection $collection @param string|int $orderBy @param string $orderDir @param array|null $orderManual @param int|null $sort_flags @return array @internal
[ "@param", "Collection", "$collection", "@param", "string|int", "$orderBy", "@param", "string", "$orderDir", "@param", "array|null", "$orderManual", "@param", "int|null", "$sort_flags" ]
1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72
https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Page/Pages.php#L362-L382
train
Sort Collection Collection
[ 30522, 2270, 3853, 4066, 26895, 18491, 1006, 3074, 1002, 3074, 1010, 1002, 2344, 3762, 1010, 1002, 2344, 4305, 2099, 1027, 1005, 2004, 2278, 1005, 1010, 1002, 2344, 2386, 8787, 1027, 19701, 1010, 1002, 4066, 1035, 9245, 1027, 19701, 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/Connectors/PostgresConnector.php
PostgresConnector.configureApplicationName
protected function configureApplicationName($connection, $config) { if (isset($config['application_name'])) { $applicationName = $config['application_name']; $connection->prepare("set application_name to '$applicationName'")->execute(); } }
php
protected function configureApplicationName($connection, $config) { if (isset($config['application_name'])) { $applicationName = $config['application_name']; $connection->prepare("set application_name to '$applicationName'")->execute(); } }
[ "protected", "function", "configureApplicationName", "(", "$", "connection", ",", "$", "config", ")", "{", "if", "(", "isset", "(", "$", "config", "[", "'application_name'", "]", ")", ")", "{", "$", "applicationName", "=", "$", "config", "[", "'application_n...
Set the schema on the connection. @param \PDO $connection @param array $config @return void
[ "Set", "the", "schema", "on", "the", "connection", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Connectors/PostgresConnector.php#L123-L130
train
Configure application name
[ 30522, 5123, 3853, 9530, 8873, 27390, 5243, 9397, 19341, 3508, 18442, 1006, 1002, 4434, 1010, 1002, 9530, 8873, 2290, 1007, 1063, 2065, 1006, 26354, 3388, 1006, 1002, 9530, 8873, 2290, 1031, 1005, 4646, 1035, 2171, 1005, 1033, 1007, 1007, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
google/flatbuffers
php/FlatbufferBuilder.php
FlatbufferBuilder.sizedByteArray
public function sizedByteArray() { $start = $this->space; $length = $this->bb->capacity() - $this->space; $result = str_repeat("\0", $length); $this->bb->setPosition($start); $this->bb->getX($result); return $result; }
php
public function sizedByteArray() { $start = $this->space; $length = $this->bb->capacity() - $this->space; $result = str_repeat("\0", $length); $this->bb->setPosition($start); $this->bb->getX($result); return $result; }
[ "public", "function", "sizedByteArray", "(", ")", "{", "$", "start", "=", "$", "this", "->", "space", ";", "$", "length", "=", "$", "this", "->", "bb", "->", "capacity", "(", ")", "-", "$", "this", "->", "space", ";", "$", "result", "=", "str_repea...
Utility function to copy and return the FlatBuffer data from the underlying ByteBuffer. @return string A string (representing a byte[]) that contains a copy of the FlatBuffer data.
[ "Utility", "function", "to", "copy", "and", "return", "the", "FlatBuffer", "data", "from", "the", "underlying", "ByteBuffer", "." ]
af74f87ccd6ea9bcf9e325427dca7c7faf1d79c1
https://github.com/google/flatbuffers/blob/af74f87ccd6ea9bcf9e325427dca7c7faf1d79c1/php/FlatbufferBuilder.php#L964-L974
train
Returns the size of the buffer in bytes.
[ 30522, 2270, 3853, 7451, 3762, 27058, 11335, 2100, 1006, 1007, 1063, 1002, 2707, 1027, 1002, 2023, 1011, 1028, 2686, 1025, 1002, 3091, 1027, 1002, 2023, 1011, 1028, 22861, 1011, 1028, 3977, 1006, 1007, 1011, 1002, 2023, 1011, 1028, 2686, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/Social.php
Social.loadYmlData
public function loadYmlData($yml) { $searchEngines = \Spyc::YAMLLoadString($yml); $this->definitionList = $this->transformData($searchEngines); return $this->definitionList; }
php
public function loadYmlData($yml) { $searchEngines = \Spyc::YAMLLoadString($yml); $this->definitionList = $this->transformData($searchEngines); return $this->definitionList; }
[ "public", "function", "loadYmlData", "(", "$", "yml", ")", "{", "$", "searchEngines", "=", "\\", "Spyc", "::", "YAMLLoadString", "(", "$", "yml", ")", ";", "$", "this", "->", "definitionList", "=", "$", "this", "->", "transformData", "(", "$", "searchEng...
Parses the given YML string and caches the resulting definitions @param string $yml @return array
[ "Parses", "the", "given", "YML", "string", "and", "caches", "the", "resulting", "definitions" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Referrers/Social.php#L75-L82
train
Load the search engine definitions from a YAML string
[ 30522, 2270, 3853, 7170, 24335, 15150, 2696, 1006, 1002, 1061, 19968, 1007, 1063, 1002, 3945, 13159, 10586, 1027, 1032, 8645, 2278, 1024, 1024, 8038, 19968, 11066, 3367, 4892, 1006, 1002, 1061, 19968, 1007, 1025, 1002, 2023, 1011, 1028, 621...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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.orWhereJsonLength
public function orWhereJsonLength($column, $operator, $value = null) { [$value, $operator] = $this->prepareValueAndOperator( $value, $operator, func_num_args() === 2 ); return $this->whereJsonLength($column, $operator, $value, 'or'); }
php
public function orWhereJsonLength($column, $operator, $value = null) { [$value, $operator] = $this->prepareValueAndOperator( $value, $operator, func_num_args() === 2 ); return $this->whereJsonLength($column, $operator, $value, 'or'); }
[ "public", "function", "orWhereJsonLength", "(", "$", "column", ",", "$", "operator", ",", "$", "value", "=", "null", ")", "{", "[", "$", "value", ",", "$", "operator", "]", "=", "$", "this", "->", "prepareValueAndOperator", "(", "$", "value", ",", "$",...
Add a "or where JSON length" clause to the query. @param string $column @param mixed $operator @param mixed $value @return $this
[ "Add", "a", "or", "where", "JSON", "length", "clause", "to", "the", "query", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Query/Builder.php#L1599-L1606
train
Add or where JSON length clause to query.
[ 30522, 2270, 3853, 2030, 2860, 5886, 20518, 3385, 7770, 13512, 2232, 1006, 1002, 5930, 1010, 1002, 6872, 1010, 1002, 3643, 1027, 19701, 1007, 1063, 1031, 1002, 3643, 1010, 1002, 6872, 1033, 1027, 1002, 2023, 1011, 1028, 7374, 10175, 5657, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/Worker.php
Worker.handleJobException
protected function handleJobException($connectionName, $job, WorkerOptions $options, $e) { try { // First, we will go ahead and mark the job as failed if it will exceed the maximum // attempts it is allowed to run the next time we process it. If so we will just // go ahead and mark it as failed now so we do not have to release this again. if (! $job->hasFailed()) { $this->markJobAsFailedIfWillExceedMaxAttempts( $connectionName, $job, (int) $options->maxTries, $e ); } $this->raiseExceptionOccurredJobEvent( $connectionName, $job, $e ); } finally { // If we catch an exception, we will attempt to release the job back onto the queue // so it is not lost entirely. This'll let the job be retried at a later time by // another listener (or this same one). We will re-throw this exception after. if (! $job->isDeleted() && ! $job->isReleased() && ! $job->hasFailed()) { $job->release( method_exists($job, 'delaySeconds') && ! is_null($job->delaySeconds()) ? $job->delaySeconds() : $options->delay ); } } throw $e; }
php
protected function handleJobException($connectionName, $job, WorkerOptions $options, $e) { try { // First, we will go ahead and mark the job as failed if it will exceed the maximum // attempts it is allowed to run the next time we process it. If so we will just // go ahead and mark it as failed now so we do not have to release this again. if (! $job->hasFailed()) { $this->markJobAsFailedIfWillExceedMaxAttempts( $connectionName, $job, (int) $options->maxTries, $e ); } $this->raiseExceptionOccurredJobEvent( $connectionName, $job, $e ); } finally { // If we catch an exception, we will attempt to release the job back onto the queue // so it is not lost entirely. This'll let the job be retried at a later time by // another listener (or this same one). We will re-throw this exception after. if (! $job->isDeleted() && ! $job->isReleased() && ! $job->hasFailed()) { $job->release( method_exists($job, 'delaySeconds') && ! is_null($job->delaySeconds()) ? $job->delaySeconds() : $options->delay ); } } throw $e; }
[ "protected", "function", "handleJobException", "(", "$", "connectionName", ",", "$", "job", ",", "WorkerOptions", "$", "options", ",", "$", "e", ")", "{", "try", "{", "// First, we will go ahead and mark the job as failed if it will exceed the maximum", "// attempts it is a...
Handle an exception that occurred while the job was running. @param string $connectionName @param \Illuminate\Contracts\Queue\Job $job @param \Illuminate\Queue\WorkerOptions $options @param \Exception $e @return void @throws \Exception
[ "Handle", "an", "exception", "that", "occurred", "while", "the", "job", "was", "running", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Queue/Worker.php#L350-L379
train
Handle exception thrown by the worker
[ 30522, 5123, 3853, 5047, 5558, 4783, 2595, 24422, 1006, 1002, 4434, 18442, 1010, 1002, 3105, 1010, 7309, 7361, 9285, 1002, 7047, 1010, 1002, 1041, 1007, 1063, 3046, 1063, 1013, 1013, 2034, 1010, 2057, 2097, 2175, 3805, 1998, 2928, 1996, 3...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
overtrue/wechat
src/MiniProgram/OpenData/Client.php
Client.formatKVLists
protected function formatKVLists(array $params) { $formatted = []; foreach ($params as $name => $value) { $formatted[] = [ 'key' => $name, 'value' => strval($value), ]; } return $formatted; }
php
protected function formatKVLists(array $params) { $formatted = []; foreach ($params as $name => $value) { $formatted[] = [ 'key' => $name, 'value' => strval($value), ]; } return $formatted; }
[ "protected", "function", "formatKVLists", "(", "array", "$", "params", ")", "{", "$", "formatted", "=", "[", "]", ";", "foreach", "(", "$", "params", "as", "$", "name", "=>", "$", "value", ")", "{", "$", "formatted", "[", "]", "=", "[", "'key'", "=...
@param array $params @return array
[ "@param", "array", "$params" ]
120c72faaa93c270365bc75c73c362d5fd583209
https://github.com/overtrue/wechat/blob/120c72faaa93c270365bc75c73c362d5fd583209/src/MiniProgram/OpenData/Client.php#L81-L93
train
Format the key value pairs into a list of arrays
[ 30522, 5123, 3853, 4289, 2243, 2615, 27103, 1006, 9140, 1002, 11498, 5244, 1007, 1063, 1002, 4289, 3064, 1027, 1031, 1033, 1025, 18921, 6776, 1006, 1002, 11498, 5244, 2004, 1002, 2171, 1027, 1028, 1002, 3643, 1007, 1063, 1002, 4289, 3064, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/Form/Extension/DataCollector/Proxy/ResolvedTypeDataCollectorProxy.php
ResolvedTypeDataCollectorProxy.finishView
public function finishView(FormView $view, FormInterface $form, array $options) { $this->proxiedType->finishView($view, $form, $options); // Remember which view belongs to which form instance, so that we can // get the collected data for a view when its form instance is not // available (e.g. CSRF token) $this->dataCollector->associateFormWithView($form, $view); // Since the CSRF token is only present in the FormView tree, we also // need to check the FormView tree instead of calling isRoot() on the // FormInterface tree if (null === $view->parent) { $this->dataCollector->collectViewVariables($view); // Re-assemble data, in case FormView instances were added, for // which no FormInterface instances were present (e.g. CSRF token). // Since finishView() is called after finishing the views of all // children, we can safely assume that information has been // collected about the complete form tree. $this->dataCollector->buildFinalFormTree($form, $view); } }
php
public function finishView(FormView $view, FormInterface $form, array $options) { $this->proxiedType->finishView($view, $form, $options); // Remember which view belongs to which form instance, so that we can // get the collected data for a view when its form instance is not // available (e.g. CSRF token) $this->dataCollector->associateFormWithView($form, $view); // Since the CSRF token is only present in the FormView tree, we also // need to check the FormView tree instead of calling isRoot() on the // FormInterface tree if (null === $view->parent) { $this->dataCollector->collectViewVariables($view); // Re-assemble data, in case FormView instances were added, for // which no FormInterface instances were present (e.g. CSRF token). // Since finishView() is called after finishing the views of all // children, we can safely assume that information has been // collected about the complete form tree. $this->dataCollector->buildFinalFormTree($form, $view); } }
[ "public", "function", "finishView", "(", "FormView", "$", "view", ",", "FormInterface", "$", "form", ",", "array", "$", "options", ")", "{", "$", "this", "->", "proxiedType", "->", "finishView", "(", "$", "view", ",", "$", "form", ",", "$", "options", ...
{@inheritdoc}
[ "{" ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/Extension/DataCollector/Proxy/ResolvedTypeDataCollectorProxy.php#L109-L131
train
Finishes the form view
[ 30522, 2270, 3853, 3926, 8584, 1006, 2433, 8584, 1002, 3193, 1010, 2433, 18447, 30524, 1010, 2061, 2008, 2057, 2064, 1013, 1013, 2131, 1996, 5067, 2951, 2005, 1037, 3193, 2043, 2049, 2433, 6013, 2003, 2025, 1013, 1013, 2800, 1006, 1041, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
octobercms/october
modules/cms/classes/CmsObject.php
CmsObject.save
public function save(array $options = null) { try { parent::save($options); } catch (Exception $ex) { $this->throwHalcyonSaveException($ex); } }
php
public function save(array $options = null) { try { parent::save($options); } catch (Exception $ex) { $this->throwHalcyonSaveException($ex); } }
[ "public", "function", "save", "(", "array", "$", "options", "=", "null", ")", "{", "try", "{", "parent", "::", "save", "(", "$", "options", ")", ";", "}", "catch", "(", "Exception", "$", "ex", ")", "{", "$", "this", "->", "throwHalcyonSaveException", ...
Save the object to the theme. @param array $options @return bool
[ "Save", "the", "object", "to", "the", "theme", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/CmsObject.php#L193-L201
train
Save the current session to the database
[ 30522, 2270, 3853, 3828, 1006, 9140, 1002, 7047, 1027, 19701, 1007, 1063, 3046, 1063, 6687, 1024, 1024, 3828, 1006, 1002, 7047, 1007, 1025, 1065, 4608, 1006, 6453, 1002, 4654, 1007, 1063, 1002, 2023, 1011, 1028, 5466, 8865, 5666, 5644, 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/Validation/Concerns/ValidatesAttributes.php
ValidatesAttributes.validateMimetypes
public function validateMimetypes($attribute, $value, $parameters) { if (! $this->isValidFileInstance($value)) { return false; } if ($this->shouldBlockPhpUpload($value, $parameters)) { return false; } return $value->getPath() !== '' && (in_array($value->getMimeType(), $parameters) || in_array(explode('/', $value->getMimeType())[0].'/*', $parameters)); }
php
public function validateMimetypes($attribute, $value, $parameters) { if (! $this->isValidFileInstance($value)) { return false; } if ($this->shouldBlockPhpUpload($value, $parameters)) { return false; } return $value->getPath() !== '' && (in_array($value->getMimeType(), $parameters) || in_array(explode('/', $value->getMimeType())[0].'/*', $parameters)); }
[ "public", "function", "validateMimetypes", "(", "$", "attribute", ",", "$", "value", ",", "$", "parameters", ")", "{", "if", "(", "!", "$", "this", "->", "isValidFileInstance", "(", "$", "value", ")", ")", "{", "return", "false", ";", "}", "if", "(", ...
Validate the MIME type of a file upload attribute is in a set of MIME types. @param string $attribute @param mixed $value @param array $parameters @return bool
[ "Validate", "the", "MIME", "type", "of", "a", "file", "upload", "attribute", "is", "in", "a", "set", "of", "MIME", "types", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Validation/Concerns/ValidatesAttributes.php#L1154-L1167
train
Validate the mimetypes of a file
[ 30522, 2270, 3853, 9398, 3686, 4328, 11368, 18863, 2015, 1006, 1002, 17961, 1010, 1002, 3643, 1010, 1002, 11709, 1007, 1063, 2065, 1006, 999, 1002, 2023, 1011, 1028, 2003, 10175, 3593, 8873, 19856, 12693, 3401, 1006, 1002, 3643, 1007, 1007,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
core/Metrics/Formatter.php
Formatter.getPrettyMoney
public function getPrettyMoney($value, $idSite) { $space = ' '; $currencySymbol = Site::getCurrencySymbolFor($idSite); $currencyBefore = $currencySymbol . $space; $currencyAfter = ''; // (maybe more currencies prefer this notation?) $currencySymbolToAppend = array('€', 'kr', 'zł'); // manually put the currency symbol after the amount if (in_array($currencySymbol, $currencySymbolToAppend)) { $currencyAfter = $space . $currencySymbol; $currencyBefore = ''; } // if the input is a number (it could be a string or INPUT form), // and if this number is not an int, we round to precision 2 if (is_numeric($value)) { if ($value == round($value)) { // 0.0 => 0 $value = round($value); } else { $precision = GoalManager::REVENUE_PRECISION; $value = sprintf("%01." . $precision . "f", $value); } } $prettyMoney = $currencyBefore . $value . $currencyAfter; return $prettyMoney; }
php
public function getPrettyMoney($value, $idSite) { $space = ' '; $currencySymbol = Site::getCurrencySymbolFor($idSite); $currencyBefore = $currencySymbol . $space; $currencyAfter = ''; // (maybe more currencies prefer this notation?) $currencySymbolToAppend = array('€', 'kr', 'zł'); // manually put the currency symbol after the amount if (in_array($currencySymbol, $currencySymbolToAppend)) { $currencyAfter = $space . $currencySymbol; $currencyBefore = ''; } // if the input is a number (it could be a string or INPUT form), // and if this number is not an int, we round to precision 2 if (is_numeric($value)) { if ($value == round($value)) { // 0.0 => 0 $value = round($value); } else { $precision = GoalManager::REVENUE_PRECISION; $value = sprintf("%01." . $precision . "f", $value); } } $prettyMoney = $currencyBefore . $value . $currencyAfter; return $prettyMoney; }
[ "public", "function", "getPrettyMoney", "(", "$", "value", ",", "$", "idSite", ")", "{", "$", "space", "=", "' '", ";", "$", "currencySymbol", "=", "Site", "::", "getCurrencySymbolFor", "(", "$", "idSite", ")", ";", "$", "currencyBefore", "=", "$", "curr...
Returns a pretty formatted monetary value using the currency associated with a site. @param int|string $value The monetary value to format. @param int $idSite The ID of the site whose currency will be used. @return string @api
[ "Returns", "a", "pretty", "formatted", "monetary", "value", "using", "the", "currency", "associated", "with", "a", "site", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Metrics/Formatter.php#L155-L181
train
Returns a pretty representation of the value
[ 30522, 2270, 3853, 2131, 28139, 15353, 8202, 3240, 1006, 1002, 3643, 1010, 1002, 8909, 28032, 2063, 1007, 1063, 1002, 2686, 1027, 1005, 1005, 1025, 1002, 9598, 6508, 13344, 2140, 1027, 2609, 1024, 1024, 2131, 10841, 14343, 9407, 6508, 13344...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/Field/ChoiceFormField.php
ChoiceFormField.tick
public function tick() { if ('checkbox' !== $this->type) { throw new \LogicException(sprintf('You cannot tick "%s" as it is not a checkbox (%s).', $this->name, $this->type)); } $this->setValue(true); }
php
public function tick() { if ('checkbox' !== $this->type) { throw new \LogicException(sprintf('You cannot tick "%s" as it is not a checkbox (%s).', $this->name, $this->type)); } $this->setValue(true); }
[ "public", "function", "tick", "(", ")", "{", "if", "(", "'checkbox'", "!==", "$", "this", "->", "type", ")", "{", "throw", "new", "\\", "LogicException", "(", "sprintf", "(", "'You cannot tick \"%s\" as it is not a checkbox (%s).'", ",", "$", "this", "->", "na...
Ticks a checkbox. @throws \LogicException When the type provided is not correct
[ "Ticks", "a", "checkbox", "." ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/DomCrawler/Field/ChoiceFormField.php#L90-L97
train
This method is called when the field is a checkbox.
[ 30522, 2270, 3853, 16356, 1006, 1007, 1063, 2065, 1006, 1005, 4638, 8758, 1005, 999, 1027, 1027, 1002, 2023, 1011, 1028, 2828, 1007, 1063, 5466, 2047, 1032, 7961, 10288, 24422, 1006, 9043, 2546, 1006, 1005, 2017, 3685, 16356, 1000, 1003, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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.getCleanedHTML
private static function getCleanedHTML(DOMDocument $doc, $container) { while ($doc->firstChild) { $doc->removeChild($doc->firstChild); } while ($container->firstChild ) { $doc->appendChild($container->firstChild); } $html = trim($doc->saveHTML()); return $html; }
php
private static function getCleanedHTML(DOMDocument $doc, $container) { while ($doc->firstChild) { $doc->removeChild($doc->firstChild); } while ($container->firstChild ) { $doc->appendChild($container->firstChild); } $html = trim($doc->saveHTML()); return $html; }
[ "private", "static", "function", "getCleanedHTML", "(", "DOMDocument", "$", "doc", ",", "$", "container", ")", "{", "while", "(", "$", "doc", "->", "firstChild", ")", "{", "$", "doc", "->", "removeChild", "(", "$", "doc", "->", "firstChild", ")", ";", ...
Clean extra code @param DOMDocument $doc @param $container @return string
[ "Clean", "extra", "code" ]
1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72
https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Helpers/Truncator.php#L196-L208
train
Returns the HTML of the first level of the container.
[ 30522, 2797, 10763, 3853, 2131, 14321, 7231, 16425, 21246, 2140, 1006, 14383, 3527, 24894, 4765, 1002, 9986, 1010, 1002, 11661, 1007, 1063, 2096, 1006, 1002, 9986, 1011, 1028, 2034, 19339, 1007, 1063, 1002, 9986, 1011, 1028, 6366, 19339, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
getgrav/grav
system/src/Grav/Framework/Uri/UriPartsFilter.php
UriPartsFilter.filterPath
public static function filterPath($path) { if (!\is_string($path)) { throw new \InvalidArgumentException('Uri path must be a string'); } return preg_replace_callback( '/(?:[^a-zA-Z0-9_\-\.~:@&=\+\$,\/;%]+|%(?![A-Fa-f0-9]{2}))/u', function ($match) { return rawurlencode($match[0]); }, $path ) ?? ''; }
php
public static function filterPath($path) { if (!\is_string($path)) { throw new \InvalidArgumentException('Uri path must be a string'); } return preg_replace_callback( '/(?:[^a-zA-Z0-9_\-\.~:@&=\+\$,\/;%]+|%(?![A-Fa-f0-9]{2}))/u', function ($match) { return rawurlencode($match[0]); }, $path ) ?? ''; }
[ "public", "static", "function", "filterPath", "(", "$", "path", ")", "{", "if", "(", "!", "\\", "is_string", "(", "$", "path", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "'Uri path must be a string'", ")", ";", "}", "return", "pr...
Filter Uri path. This method percent-encodes all reserved characters in the provided path string. This method will NOT double-encode characters that are already percent-encoded. @param string $path The raw uri path. @return string The RFC 3986 percent-encoded uri path. @throws \InvalidArgumentException If the path is invalid. @link http://www.faqs.org/rfcs/rfc3986.html
[ "Filter", "Uri", "path", "." ]
1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72
https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Framework/Uri/UriPartsFilter.php#L105-L118
train
Filters a URI path to ensure it is properly encoded
[ 30522, 2270, 10763, 3853, 11307, 15069, 1006, 1002, 4130, 1007, 1063, 2065, 1006, 999, 1032, 2003, 1035, 5164, 1006, 1002, 4130, 1007, 1007, 1063, 5466, 2047, 1032, 19528, 2906, 22850, 15781, 2595, 24422, 1006, 1005, 24471, 2072, 4130, 2442...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
php-ai/php-ml
src/Association/Apriori.php
Apriori.confidence
private function confidence(array $set, array $subset): float { return $this->support($set) / $this->support($subset); }
php
private function confidence(array $set, array $subset): float { return $this->support($set) / $this->support($subset); }
[ "private", "function", "confidence", "(", "array", "$", "set", ",", "array", "$", "subset", ")", ":", "float", "{", "return", "$", "this", "->", "support", "(", "$", "set", ")", "/", "$", "this", "->", "support", "(", "$", "subset", ")", ";", "}" ]
Calculates confidence for $set. Confidence is the relative amount of sets containing $subset which also contain $set. @param mixed[] $set @param mixed[] $subset
[ "Calculates", "confidence", "for", "$set", ".", "Confidence", "is", "the", "relative", "amount", "of", "sets", "containing", "$subset", "which", "also", "contain", "$set", "." ]
f6aa1a59b0525b8fca3d2786d661ab3e70904016
https://github.com/php-ai/php-ml/blob/f6aa1a59b0525b8fca3d2786d661ab3e70904016/src/Association/Apriori.php#L264-L267
train
Return confidence of the set and subset
[ 30522, 2797, 3853, 7023, 1006, 9140, 1002, 2275, 1010, 9140, 1002, 16745, 1007, 1024, 14257, 1063, 2709, 1002, 2023, 1011, 1028, 2490, 1006, 1002, 2275, 1007, 1013, 1002, 2023, 1011, 1028, 2490, 1006, 1002, 16745, 1007, 1025, 1065, 102, 0...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/ArrayNode.php
ArrayNode.getDefaultValue
public function getDefaultValue() { if (!$this->hasDefaultValue()) { throw new \RuntimeException(sprintf('The node at path "%s" has no default value.', $this->getPath())); } $defaults = []; foreach ($this->children as $name => $child) { if ($child->hasDefaultValue()) { $defaults[$name] = $child->getDefaultValue(); } } return $defaults; }
php
public function getDefaultValue() { if (!$this->hasDefaultValue()) { throw new \RuntimeException(sprintf('The node at path "%s" has no default value.', $this->getPath())); } $defaults = []; foreach ($this->children as $name => $child) { if ($child->hasDefaultValue()) { $defaults[$name] = $child->getDefaultValue(); } } return $defaults; }
[ "public", "function", "getDefaultValue", "(", ")", "{", "if", "(", "!", "$", "this", "->", "hasDefaultValue", "(", ")", ")", "{", "throw", "new", "\\", "RuntimeException", "(", "sprintf", "(", "'The node at path \"%s\" has no default value.'", ",", "$", "this", ...
{@inheritdoc}
[ "{" ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Config/Definition/ArrayNode.php#L174-L188
train
Returns the default value of the node
[ 30522, 2270, 3853, 2131, 3207, 7011, 11314, 10175, 5657, 1006, 1007, 1063, 2065, 1006, 999, 1002, 2023, 1011, 1028, 2038, 3207, 7011, 11314, 10175, 5657, 1006, 1007, 1007, 1063, 5466, 2047, 1032, 30524, 1028, 2131, 15069, 1006, 1007, 1007, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
spatie/laravel-permission
src/Traits/HasPermissions.php
HasPermissions.hasDirectPermission
public function hasDirectPermission($permission): bool { $permissionClass = $this->getPermissionClass(); if (is_string($permission)) { $permission = $permissionClass->findByName($permission, $this->getDefaultGuardName()); if (! $permission) { return false; } } if (is_int($permission)) { $permission = $permissionClass->findById($permission, $this->getDefaultGuardName()); if (! $permission) { return false; } } if (! $permission instanceof Permission) { return false; } return $this->permissions->contains('id', $permission->id); }
php
public function hasDirectPermission($permission): bool { $permissionClass = $this->getPermissionClass(); if (is_string($permission)) { $permission = $permissionClass->findByName($permission, $this->getDefaultGuardName()); if (! $permission) { return false; } } if (is_int($permission)) { $permission = $permissionClass->findById($permission, $this->getDefaultGuardName()); if (! $permission) { return false; } } if (! $permission instanceof Permission) { return false; } return $this->permissions->contains('id', $permission->id); }
[ "public", "function", "hasDirectPermission", "(", "$", "permission", ")", ":", "bool", "{", "$", "permissionClass", "=", "$", "this", "->", "getPermissionClass", "(", ")", ";", "if", "(", "is_string", "(", "$", "permission", ")", ")", "{", "$", "permission...
Determine if the model has the given permission. @param string|int|\Spatie\Permission\Contracts\Permission $permission @return bool
[ "Determine", "if", "the", "model", "has", "the", "given", "permission", "." ]
81dbe9d372d70c255b66a2727a235076509f8d45
https://github.com/spatie/laravel-permission/blob/81dbe9d372d70c255b66a2727a235076509f8d45/src/Traits/HasPermissions.php#L235-L258
train
Has direct permission
[ 30522, 2270, 3853, 2038, 4305, 2890, 6593, 4842, 25481, 1006, 1002, 6656, 1007, 1024, 22017, 2140, 1063, 1002, 6656, 26266, 1027, 1002, 2023, 1011, 1028, 2131, 4842, 25481, 26266, 1006, 1007, 1025, 2065, 1006, 2003, 1035, 5164, 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/Queue/Console/WorkCommand.php
WorkCommand.logFailedJob
protected function logFailedJob(JobFailed $event) { $this->laravel['queue.failer']->log( $event->connectionName, $event->job->getQueue(), $event->job->getRawBody(), $event->exception ); }
php
protected function logFailedJob(JobFailed $event) { $this->laravel['queue.failer']->log( $event->connectionName, $event->job->getQueue(), $event->job->getRawBody(), $event->exception ); }
[ "protected", "function", "logFailedJob", "(", "JobFailed", "$", "event", ")", "{", "$", "this", "->", "laravel", "[", "'queue.failer'", "]", "->", "log", "(", "$", "event", "->", "connectionName", ",", "$", "event", "->", "job", "->", "getQueue", "(", ")...
Store a failed job event. @param \Illuminate\Queue\Events\JobFailed $event @return void
[ "Store", "a", "failed", "job", "event", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Queue/Console/WorkCommand.php#L186-L192
train
Logs a failed job.
[ 30522, 5123, 3853, 8833, 7011, 18450, 5558, 2497, 1006, 3105, 7011, 18450, 1002, 2724, 1007, 1063, 1002, 2023, 1011, 1028, 13679, 15985, 1031, 1005, 24240, 1012, 8246, 2121, 1005, 1033, 1011, 1028, 8833, 1006, 1002, 2724, 1011, 1028, 4434, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
octobercms/october
modules/backend/models/ImportModel.php
ImportModel.processImportData
protected function processImportData($filePath, $matches, $options) { /* * Parse options */ $defaultOptions = [ 'firstRowTitles' => true, 'delimiter' => null, 'enclosure' => null, 'escape' => null, 'encoding' => null ]; $options = array_merge($defaultOptions, $options); /* * Read CSV */ $reader = CsvReader::createFromPath($filePath, 'r'); // Filter out empty rows $reader->addFilter(function (array $row) { return count($row) > 1 || reset($row) !== null; }); 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['firstRowTitles']) { $reader->setOffset(1); } if ( $options['encoding'] !== null && $reader->isActiveStreamFilter() ) { $reader->appendStreamFilter(sprintf( '%s%s:%s', TranscodeFilter::FILTER_NAME, strtolower($options['encoding']), 'utf-8' )); } $result = []; $contents = $reader->fetch(); foreach ($contents as $row) { $result[] = $this->processImportRow($row, $matches); } return $result; }
php
protected function processImportData($filePath, $matches, $options) { /* * Parse options */ $defaultOptions = [ 'firstRowTitles' => true, 'delimiter' => null, 'enclosure' => null, 'escape' => null, 'encoding' => null ]; $options = array_merge($defaultOptions, $options); /* * Read CSV */ $reader = CsvReader::createFromPath($filePath, 'r'); // Filter out empty rows $reader->addFilter(function (array $row) { return count($row) > 1 || reset($row) !== null; }); 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['firstRowTitles']) { $reader->setOffset(1); } if ( $options['encoding'] !== null && $reader->isActiveStreamFilter() ) { $reader->appendStreamFilter(sprintf( '%s%s:%s', TranscodeFilter::FILTER_NAME, strtolower($options['encoding']), 'utf-8' )); } $result = []; $contents = $reader->fetch(); foreach ($contents as $row) { $result[] = $this->processImportRow($row, $matches); } return $result; }
[ "protected", "function", "processImportData", "(", "$", "filePath", ",", "$", "matches", ",", "$", "options", ")", "{", "/*\n * Parse options\n */", "$", "defaultOptions", "=", "[", "'firstRowTitles'", "=>", "true", ",", "'delimiter'", "=>", "null", ...
Converts column index to database column map to an array containing database column names and values pulled from the CSV file. Eg: [0 => [first_name], 1 => [last_name]] Will return: [first_name => Joe, last_name => Blogs], [first_name => Harry, last_name => Potter], [...] @return array
[ "Converts", "column", "index", "to", "database", "column", "map", "to", "an", "array", "containing", "database", "column", "names", "and", "values", "pulled", "from", "the", "CSV", "file", ".", "Eg", ":" ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/models/ImportModel.php#L91-L151
train
Process import data
[ 30522, 5123, 3853, 2832, 5714, 6442, 2850, 2696, 1006, 1002, 5371, 15069, 1010, 1002, 3503, 1010, 1002, 7047, 1007, 1063, 1013, 1008, 1008, 11968, 3366, 7047, 1008, 1013, 1002, 12398, 7361, 9285, 1027, 1031, 1005, 2034, 10524, 27430, 1005, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
libs/HTML/QuickForm2/Rule/Each.php
HTML_QuickForm2_Rule_Each.setConfig
public function setConfig($config) { if (!$config instanceof HTML_QuickForm2_Rule) { throw new HTML_QuickForm2_InvalidArgumentException( 'Each Rule requires a template Rule to validate with, ' . preg_replace('/\s+/', ' ', var_export($config, true)) . ' given' ); } elseif ($config instanceof HTML_QuickForm2_Rule_Required) { throw new HTML_QuickForm2_InvalidArgumentException( 'Cannot use "required" Rule as a template' ); } return parent::setConfig($config); }
php
public function setConfig($config) { if (!$config instanceof HTML_QuickForm2_Rule) { throw new HTML_QuickForm2_InvalidArgumentException( 'Each Rule requires a template Rule to validate with, ' . preg_replace('/\s+/', ' ', var_export($config, true)) . ' given' ); } elseif ($config instanceof HTML_QuickForm2_Rule_Required) { throw new HTML_QuickForm2_InvalidArgumentException( 'Cannot use "required" Rule as a template' ); } return parent::setConfig($config); }
[ "public", "function", "setConfig", "(", "$", "config", ")", "{", "if", "(", "!", "$", "config", "instanceof", "HTML_QuickForm2_Rule", ")", "{", "throw", "new", "HTML_QuickForm2_InvalidArgumentException", "(", "'Each Rule requires a template Rule to validate with, '", ".",...
Sets the template Rule to use for actual validation We do not allow using Required rules here, they are able to validate containers themselves without the help of Each rule. @param HTML_QuickForm2_Rule Template Rule @return HTML_QuickForm2_Rule @throws HTML_QuickForm2_InvalidArgumentException if $config is either not an instance of Rule or is an instance of Rule_Required
[ "Sets", "the", "template", "Rule", "to", "use", "for", "actual", "validation" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Rule/Each.php#L104-L117
train
Set the config for the validation process
[ 30522, 2270, 3853, 2275, 8663, 8873, 2290, 1006, 1002, 9530, 8873, 2290, 1007, 1063, 2065, 1006, 999, 1002, 9530, 8873, 2290, 6013, 11253, 16129, 1035, 4248, 14192, 2475, 1035, 3627, 1007, 1063, 5466, 2047, 16129, 1035, 4248, 14192, 2475, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/Tools.php
Tools.getViewPath
protected function getViewPath() { $key = $this->form->getResourceId(); if ($key) { return $this->getListPath().'/'.$key; } else { return $this->getListPath(); } }
php
protected function getViewPath() { $key = $this->form->getResourceId(); if ($key) { return $this->getListPath().'/'.$key; } else { return $this->getListPath(); } }
[ "protected", "function", "getViewPath", "(", ")", "{", "$", "key", "=", "$", "this", "->", "form", "->", "getResourceId", "(", ")", ";", "if", "(", "$", "key", ")", "{", "return", "$", "this", "->", "getListPath", "(", ")", ".", "'/'", ".", "$", ...
Get request path for delete. @return string
[ "Get", "request", "path", "for", "delete", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Form/Tools.php#L151-L160
train
Get view path
[ 30522, 5123, 3853, 2131, 8584, 15069, 1006, 1007, 1063, 1002, 3145, 1027, 1002, 2023, 1011, 1028, 2433, 1011, 1028, 2131, 6072, 8162, 3401, 3593, 1006, 1007, 1025, 2065, 1006, 1002, 3145, 1007, 1063, 2709, 1002, 2023, 1011, 1028, 2131, 98...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/ConstraintViolationList.php
ConstraintViolationList.offsetSet
public function offsetSet($offset, $violation) { if (null === $offset) { $this->add($violation); } else { $this->set($offset, $violation); } }
php
public function offsetSet($offset, $violation) { if (null === $offset) { $this->add($violation); } else { $this->set($offset, $violation); } }
[ "public", "function", "offsetSet", "(", "$", "offset", ",", "$", "violation", ")", "{", "if", "(", "null", "===", "$", "offset", ")", "{", "$", "this", "->", "add", "(", "$", "violation", ")", ";", "}", "else", "{", "$", "this", "->", "set", "(",...
{@inheritdoc}
[ "{" ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Validator/ConstraintViolationList.php#L145-L152
train
Set the violation at the specified offset
[ 30522, 2270, 3853, 16396, 13462, 1006, 1002, 16396, 1010, 1002, 11371, 1007, 1063, 2065, 1006, 19701, 1027, 1027, 1027, 1002, 16396, 1007, 1063, 1002, 2023, 1011, 1028, 5587, 1006, 1002, 11371, 1007, 1025, 1065, 2842, 1063, 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...
z-song/laravel-admin
src/Form/Field/MultipleSelect.php
MultipleSelect.fill
public function fill($data) { $relations = Arr::get($data, $this->column); if (is_string($relations)) { $this->value = explode(',', $relations); } if (!is_array($relations)) { return; } $first = current($relations); if (is_null($first)) { $this->value = null; // MultipleSelect value store as an ont-to-many relationship. } elseif (is_array($first)) { foreach ($relations as $relation) { $this->value[] = Arr::get($relation, "pivot.{$this->getOtherKey()}"); } // MultipleSelect value store as a column. } else { $this->value = $relations; } }
php
public function fill($data) { $relations = Arr::get($data, $this->column); if (is_string($relations)) { $this->value = explode(',', $relations); } if (!is_array($relations)) { return; } $first = current($relations); if (is_null($first)) { $this->value = null; // MultipleSelect value store as an ont-to-many relationship. } elseif (is_array($first)) { foreach ($relations as $relation) { $this->value[] = Arr::get($relation, "pivot.{$this->getOtherKey()}"); } // MultipleSelect value store as a column. } else { $this->value = $relations; } }
[ "public", "function", "fill", "(", "$", "data", ")", "{", "$", "relations", "=", "Arr", "::", "get", "(", "$", "data", ",", "$", "this", "->", "column", ")", ";", "if", "(", "is_string", "(", "$", "relations", ")", ")", "{", "$", "this", "->", ...
{@inheritdoc}
[ "{" ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Form/Field/MultipleSelect.php#L46-L73
train
Fill the value of the field from the given data
[ 30522, 2270, 3853, 6039, 1006, 1002, 2951, 1007, 1063, 1002, 4262, 1027, 12098, 2099, 1024, 1024, 2131, 1006, 1002, 2951, 1010, 1002, 2023, 1011, 1028, 5930, 1007, 1025, 2065, 1006, 2003, 1035, 5164, 1006, 1002, 4262, 1007, 1007, 1063, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
laravel/framework
src/Illuminate/Notifications/NotificationSender.php
NotificationSender.preferredLocale
protected function preferredLocale($notifiable, $notification) { return $notification->locale ?? $this->locale ?? value(function () use ($notifiable) { if ($notifiable instanceof HasLocalePreference) { return $notifiable->preferredLocale(); } }); }
php
protected function preferredLocale($notifiable, $notification) { return $notification->locale ?? $this->locale ?? value(function () use ($notifiable) { if ($notifiable instanceof HasLocalePreference) { return $notifiable->preferredLocale(); } }); }
[ "protected", "function", "preferredLocale", "(", "$", "notifiable", ",", "$", "notification", ")", "{", "return", "$", "notification", "->", "locale", "??", "$", "this", "->", "locale", "??", "value", "(", "function", "(", ")", "use", "(", "$", "notifiable...
Get the notifiable's preferred locale for the notification. @param mixed $notifiable @param mixed $notification @return string|null
[ "Get", "the", "notifiable", "s", "preferred", "locale", "for", "the", "notification", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Notifications/NotificationSender.php#L116-L123
train
Return the preferred locale for the notifiable
[ 30522, 5123, 3853, 6871, 4135, 9289, 2063, 1006, 1002, 2025, 10128, 19210, 1010, 1002, 26828, 1007, 1063, 2709, 1002, 26828, 1011, 1028, 2334, 2063, 1029, 1029, 1002, 2023, 1011, 1028, 2334, 2063, 1029, 1029, 3643, 1006, 3853, 1006, 1007, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
plugins/API/ProcessedReport.php
ProcessedReport.isValidReportForSite
public function isValidReportForSite($idSite, $apiMethodUniqueId) { $report = $this->getReportMetadataByUniqueId($idSite, $apiMethodUniqueId); return !empty($report); }
php
public function isValidReportForSite($idSite, $apiMethodUniqueId) { $report = $this->getReportMetadataByUniqueId($idSite, $apiMethodUniqueId); return !empty($report); }
[ "public", "function", "isValidReportForSite", "(", "$", "idSite", ",", "$", "apiMethodUniqueId", ")", "{", "$", "report", "=", "$", "this", "->", "getReportMetadataByUniqueId", "(", "$", "idSite", ",", "$", "apiMethodUniqueId", ")", ";", "return", "!", "empty"...
Verfies whether the given report exists for the given site. @param int $idSite @param string $apiMethodUniqueId For example 'MultiSites_getAll' @return bool
[ "Verfies", "whether", "the", "given", "report", "exists", "for", "the", "given", "site", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/API/ProcessedReport.php#L102-L107
train
Checks if a report is valid for the given site and API method unique identifier
[ 30522, 2270, 3853, 2003, 10175, 3593, 2890, 6442, 29278, 28032, 2063, 1006, 1002, 8909, 28032, 2063, 1010, 1002, 17928, 11368, 6806, 27584, 7413, 3593, 1007, 1063, 1002, 3189, 1027, 1002, 2023, 1011, 1028, 2131, 2890, 6442, 11368, 8447, 269...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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.validateBoolean
public function validateBoolean($attribute, $value) { $acceptable = [true, false, 0, 1, '0', '1']; return in_array($value, $acceptable, true); }
php
public function validateBoolean($attribute, $value) { $acceptable = [true, false, 0, 1, '0', '1']; return in_array($value, $acceptable, true); }
[ "public", "function", "validateBoolean", "(", "$", "attribute", ",", "$", "value", ")", "{", "$", "acceptable", "=", "[", "true", ",", "false", ",", "0", ",", "1", ",", "'0'", ",", "'1'", "]", ";", "return", "in_array", "(", "$", "value", ",", "$",...
Validate that an attribute is a boolean. @param string $attribute @param mixed $value @return bool
[ "Validate", "that", "an", "attribute", "is", "a", "boolean", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Validation/Concerns/ValidatesAttributes.php#L348-L353
train
Validate that an attribute is a boolean value
[ 30522, 2270, 3853, 9398, 3686, 5092, 9890, 2319, 1006, 1002, 17961, 1010, 1002, 3643, 1007, 1063, 1002, 11701, 1027, 1031, 2995, 1010, 6270, 1010, 1014, 1010, 1015, 1010, 1005, 1014, 1005, 1010, 1005, 1015, 1005, 1033, 1025, 2709, 1999, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
walkor/Workerman
Worker.php
Worker.checkIfChildRunning
public static function checkIfChildRunning() { foreach (static::$_pidMap as $worker_id => $worker_pid_array) { foreach ($worker_pid_array as $pid => $worker_pid) { if (!posix_kill($pid, 0)) { unset(static::$_pidMap[$worker_id][$pid]); } } } }
php
public static function checkIfChildRunning() { foreach (static::$_pidMap as $worker_id => $worker_pid_array) { foreach ($worker_pid_array as $pid => $worker_pid) { if (!posix_kill($pid, 0)) { unset(static::$_pidMap[$worker_id][$pid]); } } } }
[ "public", "static", "function", "checkIfChildRunning", "(", ")", "{", "foreach", "(", "static", "::", "$", "_pidMap", "as", "$", "worker_id", "=>", "$", "worker_pid_array", ")", "{", "foreach", "(", "$", "worker_pid_array", "as", "$", "pid", "=>", "$", "wo...
check if child processes is really running
[ "check", "if", "child", "processes", "is", "really", "running" ]
13649907f05014fcfffcfccaef01e63ad3339351
https://github.com/walkor/Workerman/blob/13649907f05014fcfffcfccaef01e63ad3339351/Worker.php#L1814-L1823
train
Check if child processes are running
[ 30522, 2270, 10763, 3853, 4638, 10128, 19339, 15532, 5582, 1006, 1007, 1063, 18921, 6776, 1006, 10763, 1024, 1024, 1002, 1035, 14255, 22117, 9331, 2004, 1002, 7309, 1035, 8909, 1027, 1028, 1002, 7309, 1035, 14255, 2094, 1035, 9140, 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...
z-song/laravel-admin
src/Grid/Filter/Group.php
Group.render
public function render() { $this->injectScript(); if ($this->builder && $this->group->isEmpty()) { call_user_func($this->builder, $this); } return parent::render(); }
php
public function render() { $this->injectScript(); if ($this->builder && $this->group->isEmpty()) { call_user_func($this->builder, $this); } return parent::render(); }
[ "public", "function", "render", "(", ")", "{", "$", "this", "->", "injectScript", "(", ")", ";", "if", "(", "$", "this", "->", "builder", "&&", "$", "this", "->", "group", "->", "isEmpty", "(", ")", ")", "{", "call_user_func", "(", "$", "this", "->...
{@inheritdoc}
[ "{" ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Grid/Filter/Group.php#L317-L326
train
Render the current group
[ 30522, 2270, 3853, 17552, 30524, 1028, 12508, 1004, 1004, 1002, 2023, 1011, 1028, 2177, 1011, 1028, 2003, 6633, 13876, 2100, 1006, 1007, 1007, 1063, 2655, 1035, 5310, 1035, 4569, 2278, 1006, 1002, 2023, 1011, 1028, 12508, 1010, 1002, 2023, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
libs/Zend/Mail.php
Zend_Mail.setDate
public function setDate($date = null) { if ($this->_date === null) { if ($date === null) { $date = date('r'); } else if (is_int($date)) { $date = date('r', $date); } else if (is_string($date)) { $date = strtotime($date); if ($date === false || $date < 0) { /** * @see Zend_Mail_Exception */ // require_once 'Zend/Mail/Exception.php'; throw new Zend_Mail_Exception('String representations of Date Header must be ' . 'strtotime()-compatible'); } $date = date('r', $date); } else if ($date instanceof Zend_Date) { $date = $date->get(Zend_Date::RFC_2822); } else { /** * @see Zend_Mail_Exception */ // require_once 'Zend/Mail/Exception.php'; throw new Zend_Mail_Exception(__METHOD__ . ' only accepts UNIX timestamps, Zend_Date objects, ' . ' and strtotime()-compatible strings'); } $this->_date = $date; $this->_storeHeader('Date', $date); } else { /** * @see Zend_Mail_Exception */ // require_once 'Zend/Mail/Exception.php'; throw new Zend_Mail_Exception('Date Header set twice'); } return $this; }
php
public function setDate($date = null) { if ($this->_date === null) { if ($date === null) { $date = date('r'); } else if (is_int($date)) { $date = date('r', $date); } else if (is_string($date)) { $date = strtotime($date); if ($date === false || $date < 0) { /** * @see Zend_Mail_Exception */ // require_once 'Zend/Mail/Exception.php'; throw new Zend_Mail_Exception('String representations of Date Header must be ' . 'strtotime()-compatible'); } $date = date('r', $date); } else if ($date instanceof Zend_Date) { $date = $date->get(Zend_Date::RFC_2822); } else { /** * @see Zend_Mail_Exception */ // require_once 'Zend/Mail/Exception.php'; throw new Zend_Mail_Exception(__METHOD__ . ' only accepts UNIX timestamps, Zend_Date objects, ' . ' and strtotime()-compatible strings'); } $this->_date = $date; $this->_storeHeader('Date', $date); } else { /** * @see Zend_Mail_Exception */ // require_once 'Zend/Mail/Exception.php'; throw new Zend_Mail_Exception('Date Header set twice'); } return $this; }
[ "public", "function", "setDate", "(", "$", "date", "=", "null", ")", "{", "if", "(", "$", "this", "->", "_date", "===", "null", ")", "{", "if", "(", "$", "date", "===", "null", ")", "{", "$", "date", "=", "date", "(", "'r'", ")", ";", "}", "e...
Sets Date-header @param timestamp|string|Zend_Date $date @return Zend_Mail Provides fluent interface @throws Zend_Mail_Exception if called subsequent times or wrong date format.
[ "Sets", "Date", "-", "header" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail.php#L968-L1006
train
Set Date Header
[ 30522, 2270, 3853, 2275, 13701, 1006, 1002, 3058, 1027, 19701, 1007, 1063, 2065, 1006, 1002, 2023, 1011, 1028, 1035, 3058, 1027, 1027, 1027, 19701, 1007, 1063, 2065, 1006, 1002, 3058, 1027, 1027, 1027, 19701, 1007, 1063, 1002, 3058, 1027, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/HttpFoundation/JsonResponse.php
JsonResponse.setCallback
public function setCallback($callback = null) { if (null !== $callback) { // partially taken from http://www.geekality.net/2011/08/03/valid-javascript-identifier/ // partially taken from https://github.com/willdurand/JsonpCallbackValidator // JsonpCallbackValidator is released under the MIT License. See https://github.com/willdurand/JsonpCallbackValidator/blob/v1.1.0/LICENSE for details. // (c) William Durand <william.durand1@gmail.com> $pattern = '/^[$_\p{L}][$_\p{L}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{200C}\x{200D}]*(?:\[(?:"(?:\\\.|[^"\\\])*"|\'(?:\\\.|[^\'\\\])*\'|\d+)\])*?$/u'; $reserved = [ 'break', 'do', 'instanceof', 'typeof', 'case', 'else', 'new', 'var', 'catch', 'finally', 'return', 'void', 'continue', 'for', 'switch', 'while', 'debugger', 'function', 'this', 'with', 'default', 'if', 'throw', 'delete', 'in', 'try', 'class', 'enum', 'extends', 'super', 'const', 'export', 'import', 'implements', 'let', 'private', 'public', 'yield', 'interface', 'package', 'protected', 'static', 'null', 'true', 'false', ]; $parts = explode('.', $callback); foreach ($parts as $part) { if (!preg_match($pattern, $part) || \in_array($part, $reserved, true)) { throw new \InvalidArgumentException('The callback name is not valid.'); } } } $this->callback = $callback; return $this->update(); }
php
public function setCallback($callback = null) { if (null !== $callback) { // partially taken from http://www.geekality.net/2011/08/03/valid-javascript-identifier/ // partially taken from https://github.com/willdurand/JsonpCallbackValidator // JsonpCallbackValidator is released under the MIT License. See https://github.com/willdurand/JsonpCallbackValidator/blob/v1.1.0/LICENSE for details. // (c) William Durand <william.durand1@gmail.com> $pattern = '/^[$_\p{L}][$_\p{L}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{200C}\x{200D}]*(?:\[(?:"(?:\\\.|[^"\\\])*"|\'(?:\\\.|[^\'\\\])*\'|\d+)\])*?$/u'; $reserved = [ 'break', 'do', 'instanceof', 'typeof', 'case', 'else', 'new', 'var', 'catch', 'finally', 'return', 'void', 'continue', 'for', 'switch', 'while', 'debugger', 'function', 'this', 'with', 'default', 'if', 'throw', 'delete', 'in', 'try', 'class', 'enum', 'extends', 'super', 'const', 'export', 'import', 'implements', 'let', 'private', 'public', 'yield', 'interface', 'package', 'protected', 'static', 'null', 'true', 'false', ]; $parts = explode('.', $callback); foreach ($parts as $part) { if (!preg_match($pattern, $part) || \in_array($part, $reserved, true)) { throw new \InvalidArgumentException('The callback name is not valid.'); } } } $this->callback = $callback; return $this->update(); }
[ "public", "function", "setCallback", "(", "$", "callback", "=", "null", ")", "{", "if", "(", "null", "!==", "$", "callback", ")", "{", "// partially taken from http://www.geekality.net/2011/08/03/valid-javascript-identifier/", "// partially taken from https://github.com/willdur...
Sets the JSONP callback. @param string|null $callback The JSONP callback or null to use none @return $this @throws \InvalidArgumentException When the callback name is not valid
[ "Sets", "the", "JSONP", "callback", "." ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpFoundation/JsonResponse.php#L89-L113
train
Set the callback name
[ 30522, 2270, 3853, 2275, 9289, 20850, 8684, 1006, 1002, 2655, 5963, 1027, 19701, 1007, 1063, 2065, 1006, 19701, 999, 1027, 1027, 1002, 2655, 5963, 1007, 1063, 1013, 1013, 6822, 2579, 2013, 30524, 1012, 29294, 23732, 1012, 5658, 1013, 2249, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/Settings/Storage/Factory.php
Factory.getMeasurableSettingsStorage
public function getMeasurableSettingsStorage($idSite, $pluginName) { $id = 'measurableSettings' . (int) $idSite . '#' . $pluginName; if (empty($idSite)) { return $this->getNonPersistentStorage($id . '#nonpersistent'); } if (!isset($this->cache[$id])) { $backend = new Backend\MeasurableSettingsTable($idSite, $pluginName); $this->cache[$id] = $this->makeStorage($backend); } return $this->cache[$id]; }
php
public function getMeasurableSettingsStorage($idSite, $pluginName) { $id = 'measurableSettings' . (int) $idSite . '#' . $pluginName; if (empty($idSite)) { return $this->getNonPersistentStorage($id . '#nonpersistent'); } if (!isset($this->cache[$id])) { $backend = new Backend\MeasurableSettingsTable($idSite, $pluginName); $this->cache[$id] = $this->makeStorage($backend); } return $this->cache[$id]; }
[ "public", "function", "getMeasurableSettingsStorage", "(", "$", "idSite", ",", "$", "pluginName", ")", "{", "$", "id", "=", "'measurableSettings'", ".", "(", "int", ")", "$", "idSite", ".", "'#'", ".", "$", "pluginName", ";", "if", "(", "empty", "(", "$"...
Get a storage instance for measurable settings. The storage will hold values that belong to the given idSite and plugin name. Be aware that a storage instance for a specific site and plugin will be cached during one request for better performance. @param int $idSite If idSite is empty it will use a backend that never actually persists any value. Pass $idSite = 0 to create a storage for a site that is about to be created. @param string $pluginName @return Storage
[ "Get", "a", "storage", "instance", "for", "measurable", "settings", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Settings/Storage/Factory.php#L73-L87
train
Get the measurable settings storage
[ 30522, 2270, 3853, 2131, 4168, 28329, 21678, 8613, 23809, 4270, 1006, 1002, 8909, 28032, 2063, 1010, 1002, 13354, 23111, 14074, 1007, 1063, 1002, 8909, 1027, 1005, 2033, 28329, 21678, 8613, 1005, 1012, 1006, 20014, 1007, 1002, 8909, 28032, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
libs/HTML/QuickForm2/Element/Select.php
HTML_QuickForm2_Element_Select_OptionContainer.addOptgroup
public function addOptgroup($label, $attributes = null) { $optgroup = new HTML_QuickForm2_Element_Select_Optgroup( $this->values, $this->possibleValues, $label, $attributes ); $this->options[] = $optgroup; return $optgroup; }
php
public function addOptgroup($label, $attributes = null) { $optgroup = new HTML_QuickForm2_Element_Select_Optgroup( $this->values, $this->possibleValues, $label, $attributes ); $this->options[] = $optgroup; return $optgroup; }
[ "public", "function", "addOptgroup", "(", "$", "label", ",", "$", "attributes", "=", "null", ")", "{", "$", "optgroup", "=", "new", "HTML_QuickForm2_Element_Select_Optgroup", "(", "$", "this", "->", "values", ",", "$", "this", "->", "possibleValues", ",", "$...
Adds a new optgroup @param string 'label' attribute for optgroup tag @param mixed Additional attributes for <optgroup> tag (either as a string or as an associative array) @return HTML_QuickForm2_Element_Select_Optgroup
[ "Adds", "a", "new", "optgroup" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Element/Select.php#L142-L150
train
Adds an optgroup to the select
[ 30522, 2270, 3853, 5587, 7361, 2102, 17058, 1006, 1002, 3830, 1010, 1002, 12332, 1027, 19701, 1007, 1063, 1002, 23569, 17058, 1027, 2047, 16129, 1035, 4248, 14192, 2475, 1035, 5783, 1035, 7276, 1035, 23569, 17058, 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...
matomo-org/matomo
plugins/UserCountry/Controller.php
Controller.getLocationUsingProvider
public function getLocationUsingProvider() { $providerId = Common::getRequestVar('id'); $provider = LocationProvider::getProviderById($providerId); if (empty($provider)) { throw new Exception("Invalid provider ID: '$providerId'."); } $location = $provider->getLocation(array('ip' => IP::getIpFromHeader(), 'lang' => Common::getBrowserLanguage(), 'disable_fallbacks' => true)); $location = LocationProvider::prettyFormatLocation( $location, $newline = '<br/>', $includeExtra = true); return $location; }
php
public function getLocationUsingProvider() { $providerId = Common::getRequestVar('id'); $provider = LocationProvider::getProviderById($providerId); if (empty($provider)) { throw new Exception("Invalid provider ID: '$providerId'."); } $location = $provider->getLocation(array('ip' => IP::getIpFromHeader(), 'lang' => Common::getBrowserLanguage(), 'disable_fallbacks' => true)); $location = LocationProvider::prettyFormatLocation( $location, $newline = '<br/>', $includeExtra = true); return $location; }
[ "public", "function", "getLocationUsingProvider", "(", ")", "{", "$", "providerId", "=", "Common", "::", "getRequestVar", "(", "'id'", ")", ";", "$", "provider", "=", "LocationProvider", "::", "getProviderById", "(", "$", "providerId", ")", ";", "if", "(", "...
Echo's a pretty formatted location using a specific LocationProvider. Input: The 'id' query parameter must be set to the ID of the LocationProvider to use. Output: The pretty formatted location that was obtained. Will be HTML.
[ "Echo", "s", "a", "pretty", "formatted", "location", "using", "a", "specific", "LocationProvider", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UserCountry/Controller.php#L395-L410
train
Returns the location using the provider
[ 30522, 2270, 3853, 2131, 4135, 10719, 18161, 21572, 17258, 2121, 1006, 1007, 1063, 1002, 10802, 3593, 1027, 2691, 1024, 1024, 2131, 2890, 15500, 10755, 1006, 1005, 8909, 1005, 1007, 1025, 1002, 10802, 1027, 3295, 21572, 17258, 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...
octobercms/october
modules/backend/widgets/Lists.php
Lists.isColumnRelated
protected function isColumnRelated($column, $multi = false) { if (!isset($column->relation) || $this->isColumnPivot($column)) { return false; } if (!$this->model->hasRelation($column->relation)) { throw new ApplicationException(Lang::get( 'backend::lang.model.missing_relation', ['class'=>get_class($this->model), 'relation'=>$column->relation] )); } if (!$multi) { return true; } $relationType = $this->model->getRelationType($column->relation); return in_array($relationType, [ 'hasMany', 'belongsToMany', 'morphToMany', 'morphedByMany', 'morphMany', 'attachMany', 'hasManyThrough' ]); }
php
protected function isColumnRelated($column, $multi = false) { if (!isset($column->relation) || $this->isColumnPivot($column)) { return false; } if (!$this->model->hasRelation($column->relation)) { throw new ApplicationException(Lang::get( 'backend::lang.model.missing_relation', ['class'=>get_class($this->model), 'relation'=>$column->relation] )); } if (!$multi) { return true; } $relationType = $this->model->getRelationType($column->relation); return in_array($relationType, [ 'hasMany', 'belongsToMany', 'morphToMany', 'morphedByMany', 'morphMany', 'attachMany', 'hasManyThrough' ]); }
[ "protected", "function", "isColumnRelated", "(", "$", "column", ",", "$", "multi", "=", "false", ")", "{", "if", "(", "!", "isset", "(", "$", "column", "->", "relation", ")", "||", "$", "this", "->", "isColumnPivot", "(", "$", "column", ")", ")", "{"...
Check if column refers to a relation of the model @param ListColumn $column List column object @param boolean $multi If set, returns true only if the relation is a "multiple relation type" @return boolean
[ "Check", "if", "column", "refers", "to", "a", "relation", "of", "the", "model" ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/Lists.php#L1688-L1716
train
Checks if a column has a related field
[ 30522, 5123, 3853, 2003, 25778, 2819, 16118, 10581, 3064, 1006, 1002, 5930, 1010, 1002, 4800, 1027, 6270, 1007, 1063, 2065, 1006, 999, 26354, 3388, 1006, 1002, 5930, 1011, 1028, 7189, 1007, 1064, 1064, 1002, 2023, 1011, 1028, 2003, 25778, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/FormErrorIterator.php
FormErrorIterator.seek
public function seek($position) { if (!isset($this->errors[$position])) { throw new OutOfBoundsException('The offset '.$position.' does not exist.'); } reset($this->errors); while ($position !== key($this->errors)) { next($this->errors); } }
php
public function seek($position) { if (!isset($this->errors[$position])) { throw new OutOfBoundsException('The offset '.$position.' does not exist.'); } reset($this->errors); while ($position !== key($this->errors)) { next($this->errors); } }
[ "public", "function", "seek", "(", "$", "position", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "errors", "[", "$", "position", "]", ")", ")", "{", "throw", "new", "OutOfBoundsException", "(", "'The offset '", ".", "$", "position", ".", ...
Sets the position of the iterator. @param int $position The new position @throws OutOfBoundsException If the position is invalid
[ "Sets", "the", "position", "of", "the", "iterator", "." ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/FormErrorIterator.php#L239-L250
train
Seeks to the next error in the error array.
[ 30522, 2270, 3853, 6148, 1006, 1002, 30524, 2047, 2041, 11253, 15494, 3366, 2595, 24422, 1006, 1005, 1996, 16396, 1005, 1012, 1002, 2597, 1012, 1005, 2515, 2025, 4839, 1012, 1005, 1007, 1025, 1065, 25141, 1006, 1002, 2023, 1011, 1028, 10697...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/Notifications/VerifyEmail.php
VerifyEmail.verificationUrl
protected function verificationUrl($notifiable) { return URL::temporarySignedRoute( 'verification.verify', Carbon::now()->addMinutes(Config::get('auth.verification.expire', 60)), ['id' => $notifiable->getKey()] ); }
php
protected function verificationUrl($notifiable) { return URL::temporarySignedRoute( 'verification.verify', Carbon::now()->addMinutes(Config::get('auth.verification.expire', 60)), ['id' => $notifiable->getKey()] ); }
[ "protected", "function", "verificationUrl", "(", "$", "notifiable", ")", "{", "return", "URL", "::", "temporarySignedRoute", "(", "'verification.verify'", ",", "Carbon", "::", "now", "(", ")", "->", "addMinutes", "(", "Config", "::", "get", "(", "'auth.verificat...
Get the verification URL for the given notifiable. @param mixed $notifiable @return string
[ "Get", "the", "verification", "URL", "for", "the", "given", "notifiable", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Auth/Notifications/VerifyEmail.php#L60-L67
train
Return URL to verify user.
[ 30522, 5123, 3853, 22616, 3126, 2140, 1006, 1002, 2025, 10128, 19210, 1007, 1063, 2709, 24471, 2140, 1024, 1024, 5741, 5332, 19225, 22494, 2618, 1006, 1005, 22616, 1012, 20410, 1005, 1010, 6351, 1024, 1024, 2085, 1006, 1007, 1011, 1028, 558...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/Settings/Measurable/MeasurableSetting.php
MeasurableSetting.isWritableByCurrentUser
public function isWritableByCurrentUser() { if (isset($this->hasWritePermission)) { return $this->hasWritePermission; } // performance improvement, do not detect this in __construct otherwise likely rather "big" query to DB. if ($this->hasSiteBeenCreated()) { $this->hasWritePermission = Piwik::isUserHasAdminAccess($this->idSite); } else { $this->hasWritePermission = Piwik::hasUserSuperUserAccess(); } return $this->hasWritePermission; }
php
public function isWritableByCurrentUser() { if (isset($this->hasWritePermission)) { return $this->hasWritePermission; } // performance improvement, do not detect this in __construct otherwise likely rather "big" query to DB. if ($this->hasSiteBeenCreated()) { $this->hasWritePermission = Piwik::isUserHasAdminAccess($this->idSite); } else { $this->hasWritePermission = Piwik::hasUserSuperUserAccess(); } return $this->hasWritePermission; }
[ "public", "function", "isWritableByCurrentUser", "(", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "hasWritePermission", ")", ")", "{", "return", "$", "this", "->", "hasWritePermission", ";", "}", "// performance improvement, do not detect this in __construct...
Returns `true` if this setting can be displayed for the current user, `false` if otherwise. @return bool
[ "Returns", "true", "if", "this", "setting", "can", "be", "displayed", "for", "the", "current", "user", "false", "if", "otherwise", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Settings/Measurable/MeasurableSetting.php#L52-L66
train
Returns true if the user has write access to the current user.
[ 30522, 2270, 3853, 2003, 13088, 6590, 3468, 3762, 10841, 14343, 3372, 20330, 1006, 1007, 1063, 2065, 1006, 26354, 3388, 1006, 1002, 2023, 1011, 1028, 2038, 30524, 2023, 1999, 1035, 1035, 9570, 4728, 3497, 2738, 1000, 2502, 1000, 23032, 2000...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/ImplicitRouteBinding.php
ImplicitRouteBinding.getParameterName
protected static function getParameterName($name, $parameters) { if (array_key_exists($name, $parameters)) { return $name; } if (array_key_exists($snakedName = Str::snake($name), $parameters)) { return $snakedName; } }
php
protected static function getParameterName($name, $parameters) { if (array_key_exists($name, $parameters)) { return $name; } if (array_key_exists($snakedName = Str::snake($name), $parameters)) { return $snakedName; } }
[ "protected", "static", "function", "getParameterName", "(", "$", "name", ",", "$", "parameters", ")", "{", "if", "(", "array_key_exists", "(", "$", "name", ",", "$", "parameters", ")", ")", "{", "return", "$", "name", ";", "}", "if", "(", "array_key_exis...
Return the parameter name if it exists in the given parameters. @param string $name @param array $parameters @return string|null
[ "Return", "the", "parameter", "name", "if", "it", "exists", "in", "the", "given", "parameters", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/ImplicitRouteBinding.php#L52-L61
train
Get the parameter name from the parameters array
[ 30522, 5123, 10763, 3853, 2131, 28689, 22828, 18442, 1006, 1002, 2171, 1010, 1002, 11709, 30524, 1002, 11709, 1007, 1007, 1063, 2709, 1002, 2171, 1025, 1065, 2065, 1006, 9140, 1035, 3145, 1035, 6526, 1006, 1002, 7488, 28911, 4168, 1027, 235...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/DependencyInjection/Loader/Configurator/AbstractServiceConfigurator.php
AbstractServiceConfigurator.alias
final public function alias(string $id, string $referencedId): AliasConfigurator { $this->__destruct(); return $this->parent->alias($id, $referencedId); }
php
final public function alias(string $id, string $referencedId): AliasConfigurator { $this->__destruct(); return $this->parent->alias($id, $referencedId); }
[ "final", "public", "function", "alias", "(", "string", "$", "id", ",", "string", "$", "referencedId", ")", ":", "AliasConfigurator", "{", "$", "this", "->", "__destruct", "(", ")", ";", "return", "$", "this", "->", "parent", "->", "alias", "(", "$", "i...
Creates an alias.
[ "Creates", "an", "alias", "." ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/DependencyInjection/Loader/Configurator/AbstractServiceConfigurator.php#L55-L60
train
Alias the specified id with the specified id.
[ 30522, 2345, 2270, 3853, 14593, 1006, 5164, 1002, 8909, 1010, 5164, 1002, 14964, 3593, 1007, 1024, 14593, 8663, 8873, 27390, 8844, 1063, 1002, 2023, 1011, 1028, 1035, 1035, 4078, 18300, 1006, 1007, 1025, 2709, 1002, 2023, 1011, 1028, 6687, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
octobercms/october
modules/backend/controllers/Auth.php
Auth.restore
public function restore() { try { if (post('postback')) { return $this->restore_onSubmit(); } } catch (Exception $ex) { Flash::error($ex->getMessage()); } }
php
public function restore() { try { if (post('postback')) { return $this->restore_onSubmit(); } } catch (Exception $ex) { Flash::error($ex->getMessage()); } }
[ "public", "function", "restore", "(", ")", "{", "try", "{", "if", "(", "post", "(", "'postback'", ")", ")", "{", "return", "$", "this", "->", "restore_onSubmit", "(", ")", ";", "}", "}", "catch", "(", "Exception", "$", "ex", ")", "{", "Flash", "::"...
Request a password reset verification code.
[ "Request", "a", "password", "reset", "verification", "code", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/controllers/Auth.php#L114-L124
train
Restore on submit
[ 30522, 2270, 3853, 9239, 1006, 1007, 1063, 3046, 1063, 2065, 1006, 2695, 1006, 1005, 2695, 5963, 1005, 1007, 1007, 1063, 2709, 1002, 2023, 1011, 1028, 9239, 1035, 2006, 6342, 25526, 4183, 1006, 1007, 1025, 1065, 1065, 4608, 1006, 6453, 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/Container/Container.php
Container.tag
public function tag($abstracts, $tags) { $tags = is_array($tags) ? $tags : array_slice(func_get_args(), 1); foreach ($tags as $tag) { if (! isset($this->tags[$tag])) { $this->tags[$tag] = []; } foreach ((array) $abstracts as $abstract) { $this->tags[$tag][] = $abstract; } } }
php
public function tag($abstracts, $tags) { $tags = is_array($tags) ? $tags : array_slice(func_get_args(), 1); foreach ($tags as $tag) { if (! isset($this->tags[$tag])) { $this->tags[$tag] = []; } foreach ((array) $abstracts as $abstract) { $this->tags[$tag][] = $abstract; } } }
[ "public", "function", "tag", "(", "$", "abstracts", ",", "$", "tags", ")", "{", "$", "tags", "=", "is_array", "(", "$", "tags", ")", "?", "$", "tags", ":", "array_slice", "(", "func_get_args", "(", ")", ",", "1", ")", ";", "foreach", "(", "$", "t...
Assign a set of tags to a given binding. @param array|string $abstracts @param array|mixed ...$tags @return void
[ "Assign", "a", "set", "of", "tags", "to", "a", "given", "binding", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Container/Container.php#L441-L454
train
Tag an abstracts with a tag
[ 30522, 2270, 3853, 6415, 1006, 1002, 29474, 1010, 1002, 22073, 1007, 1063, 1002, 22073, 1027, 2003, 1035, 9140, 1006, 1002, 22073, 1007, 1029, 1002, 22073, 1024, 9140, 1035, 14704, 1006, 4569, 2278, 1035, 2131, 1035, 12098, 5620, 1006, 1007...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
core/Profiler.php
Profiler.printQueryCount
public static function printQueryCount() { $totalTime = self::getDbElapsedSecs(); $queryCount = Profiler::getQueryCount(); if ($queryCount > 0) { Log::debug(sprintf("Total queries = %d (total sql time = %.2fs)", $queryCount, $totalTime)); } }
php
public static function printQueryCount() { $totalTime = self::getDbElapsedSecs(); $queryCount = Profiler::getQueryCount(); if ($queryCount > 0) { Log::debug(sprintf("Total queries = %d (total sql time = %.2fs)", $queryCount, $totalTime)); } }
[ "public", "static", "function", "printQueryCount", "(", ")", "{", "$", "totalTime", "=", "self", "::", "getDbElapsedSecs", "(", ")", ";", "$", "queryCount", "=", "Profiler", "::", "getQueryCount", "(", ")", ";", "if", "(", "$", "queryCount", ">", "0", ")...
Print number of queries and elapsed time
[ "Print", "number", "of", "queries", "and", "elapsed", "time" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Profiler.php#L142-L149
train
Print query count
[ 30522, 2270, 10763, 3853, 6140, 4226, 2854, 3597, 16671, 1006, 1007, 1063, 1002, 2561, 7292, 1027, 2969, 1024, 1024, 2131, 18939, 10581, 29251, 5104, 8586, 2015, 1006, 1007, 1025, 1002, 23032, 3597, 16671, 1027, 6337, 2099, 1024, 1024, 2131...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/Form/Form.php
Form.add
public function add($child, $type = null, array $options = []) { if ($this->submitted) { throw new AlreadySubmittedException('You cannot add children to a submitted form'); } if (!$this->config->getCompound()) { throw new LogicException('You cannot add children to a simple form. Maybe you should set the option "compound" to true?'); } if (!$child instanceof FormInterface) { if (!\is_string($child) && !\is_int($child)) { throw new UnexpectedTypeException($child, 'string, integer or Symfony\Component\Form\FormInterface'); } if (null !== $type && !\is_string($type) && !$type instanceof FormTypeInterface) { throw new UnexpectedTypeException($type, 'string or Symfony\Component\Form\FormTypeInterface'); } // Never initialize child forms automatically $options['auto_initialize'] = false; if (null === $type && null === $this->config->getDataClass()) { $type = 'Symfony\Component\Form\Extension\Core\Type\TextType'; } if (null === $type) { $child = $this->config->getFormFactory()->createForProperty($this->config->getDataClass(), $child, null, $options); } else { $child = $this->config->getFormFactory()->createNamed($child, $type, null, $options); } } elseif ($child->getConfig()->getAutoInitialize()) { throw new RuntimeException(sprintf('Automatic initialization is only supported on root forms. You should set the "auto_initialize" option to false on the field "%s".', $child->getName())); } $this->children[$child->getName()] = $child; $child->setParent($this); // If setData() is currently being called, there is no need to call // mapDataToForms() here, as mapDataToForms() is called at the end // of setData() anyway. Not doing this check leads to an endless // recursion when initializing the form lazily and an event listener // (such as ResizeFormListener) adds fields depending on the data: // // * setData() is called, the form is not initialized yet // * add() is called by the listener (setData() is not complete, so // the form is still not initialized) // * getViewData() is called // * setData() is called since the form is not initialized yet // * ... endless recursion ... // // Also skip data mapping if setData() has not been called yet. // setData() will be called upon form initialization and data mapping // will take place by then. if (!$this->lockSetData && $this->defaultDataSet && !$this->inheritData) { $viewData = $this->getViewData(); $this->config->getDataMapper()->mapDataToForms( $viewData, new \RecursiveIteratorIterator(new InheritDataAwareIterator(new \ArrayIterator([$child->getName() => $child]))) ); } return $this; }
php
public function add($child, $type = null, array $options = []) { if ($this->submitted) { throw new AlreadySubmittedException('You cannot add children to a submitted form'); } if (!$this->config->getCompound()) { throw new LogicException('You cannot add children to a simple form. Maybe you should set the option "compound" to true?'); } if (!$child instanceof FormInterface) { if (!\is_string($child) && !\is_int($child)) { throw new UnexpectedTypeException($child, 'string, integer or Symfony\Component\Form\FormInterface'); } if (null !== $type && !\is_string($type) && !$type instanceof FormTypeInterface) { throw new UnexpectedTypeException($type, 'string or Symfony\Component\Form\FormTypeInterface'); } // Never initialize child forms automatically $options['auto_initialize'] = false; if (null === $type && null === $this->config->getDataClass()) { $type = 'Symfony\Component\Form\Extension\Core\Type\TextType'; } if (null === $type) { $child = $this->config->getFormFactory()->createForProperty($this->config->getDataClass(), $child, null, $options); } else { $child = $this->config->getFormFactory()->createNamed($child, $type, null, $options); } } elseif ($child->getConfig()->getAutoInitialize()) { throw new RuntimeException(sprintf('Automatic initialization is only supported on root forms. You should set the "auto_initialize" option to false on the field "%s".', $child->getName())); } $this->children[$child->getName()] = $child; $child->setParent($this); // If setData() is currently being called, there is no need to call // mapDataToForms() here, as mapDataToForms() is called at the end // of setData() anyway. Not doing this check leads to an endless // recursion when initializing the form lazily and an event listener // (such as ResizeFormListener) adds fields depending on the data: // // * setData() is called, the form is not initialized yet // * add() is called by the listener (setData() is not complete, so // the form is still not initialized) // * getViewData() is called // * setData() is called since the form is not initialized yet // * ... endless recursion ... // // Also skip data mapping if setData() has not been called yet. // setData() will be called upon form initialization and data mapping // will take place by then. if (!$this->lockSetData && $this->defaultDataSet && !$this->inheritData) { $viewData = $this->getViewData(); $this->config->getDataMapper()->mapDataToForms( $viewData, new \RecursiveIteratorIterator(new InheritDataAwareIterator(new \ArrayIterator([$child->getName() => $child]))) ); } return $this; }
[ "public", "function", "add", "(", "$", "child", ",", "$", "type", "=", "null", ",", "array", "$", "options", "=", "[", "]", ")", "{", "if", "(", "$", "this", "->", "submitted", ")", "{", "throw", "new", "AlreadySubmittedException", "(", "'You cannot ad...
{@inheritdoc}
[ "{" ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/Form.php#L835-L899
train
Adds a child form to the form
[ 30522, 2270, 3853, 5587, 1006, 1002, 2775, 1010, 1002, 2828, 1027, 19701, 1010, 9140, 1002, 7047, 1027, 1031, 1033, 1007, 1063, 2065, 1006, 1002, 2023, 1011, 1028, 7864, 1007, 1063, 5466, 2047, 2525, 6342, 25526, 27100, 3207, 2595, 24422, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
google/flatbuffers
php/FlatbufferBuilder.php
FlatbufferBuilder.pad
public function pad($byte_size) { for ($i = 0; $i < $byte_size; $i++) { $this->bb->putByte(--$this->space, "\0"); } }
php
public function pad($byte_size) { for ($i = 0; $i < $byte_size; $i++) { $this->bb->putByte(--$this->space, "\0"); } }
[ "public", "function", "pad", "(", "$", "byte_size", ")", "{", "for", "(", "$", "i", "=", "0", ";", "$", "i", "<", "$", "byte_size", ";", "$", "i", "++", ")", "{", "$", "this", "->", "bb", "->", "putByte", "(", "--", "$", "this", "->", "space"...
padding buffer @param $byte_size
[ "padding", "buffer" ]
af74f87ccd6ea9bcf9e325427dca7c7faf1d79c1
https://github.com/google/flatbuffers/blob/af74f87ccd6ea9bcf9e325427dca7c7faf1d79c1/php/FlatbufferBuilder.php#L125-L130
train
Pads the buffer with zeros to the specified byte size
[ 30522, 2270, 3853, 11687, 1006, 1002, 24880, 1035, 2946, 1007, 1063, 2005, 1006, 1002, 1045, 1027, 1014, 1025, 1002, 1045, 1026, 1002, 24880, 1035, 2946, 1025, 1002, 1045, 1009, 1009, 1007, 1063, 1002, 2023, 1011, 1028, 22861, 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/EventDispatcher/Debug/TraceableEventDispatcher.php
TraceableEventDispatcher.dispatch
public function dispatch($event/*, string $eventName = null*/) { if (null === $this->callStack) { $this->callStack = new \SplObjectStorage(); } $currentRequestHash = $this->currentRequestHash = $this->requestStack && ($request = $this->requestStack->getCurrentRequest()) ? spl_object_hash($request) : ''; $eventName = 1 < \func_num_args() ? \func_get_arg(1) : null; if (\is_object($event)) { $eventName = $eventName ?? \get_class($event); } else { @trigger_error(sprintf('Calling the "%s::dispatch()" method with the event name as first argument is deprecated since Symfony 4.3, pass it second and provide the event object first instead.', EventDispatcherInterface::class), E_USER_DEPRECATED); $swap = $event; $event = $eventName ?? new Event(); $eventName = $swap; if (!$event instanceof Event) { throw new \TypeError(sprintf('Argument 1 passed to "%s::dispatch()" must be an instance of %s, %s given.', EventDispatcherInterface::class, Event::class, \is_object($event) ? \get_class($event) : \gettype($event))); } } if (null !== $this->logger && ($event instanceof Event || $event instanceof ContractsEvent || $event instanceof StoppableEventInterface) && $event->isPropagationStopped()) { $this->logger->debug(sprintf('The "%s" event is already stopped. No listeners have been called.', $eventName)); } $this->preProcess($eventName); try { $this->beforeDispatch($eventName, $event); try { $e = $this->stopwatch->start($eventName, 'section'); try { $this->dispatcher->dispatch($event, $eventName); } finally { if ($e->isStarted()) { $e->stop(); } } } finally { $this->afterDispatch($eventName, $event); } } finally { $this->currentRequestHash = $currentRequestHash; $this->postProcess($eventName); } return $event; }
php
public function dispatch($event/*, string $eventName = null*/) { if (null === $this->callStack) { $this->callStack = new \SplObjectStorage(); } $currentRequestHash = $this->currentRequestHash = $this->requestStack && ($request = $this->requestStack->getCurrentRequest()) ? spl_object_hash($request) : ''; $eventName = 1 < \func_num_args() ? \func_get_arg(1) : null; if (\is_object($event)) { $eventName = $eventName ?? \get_class($event); } else { @trigger_error(sprintf('Calling the "%s::dispatch()" method with the event name as first argument is deprecated since Symfony 4.3, pass it second and provide the event object first instead.', EventDispatcherInterface::class), E_USER_DEPRECATED); $swap = $event; $event = $eventName ?? new Event(); $eventName = $swap; if (!$event instanceof Event) { throw new \TypeError(sprintf('Argument 1 passed to "%s::dispatch()" must be an instance of %s, %s given.', EventDispatcherInterface::class, Event::class, \is_object($event) ? \get_class($event) : \gettype($event))); } } if (null !== $this->logger && ($event instanceof Event || $event instanceof ContractsEvent || $event instanceof StoppableEventInterface) && $event->isPropagationStopped()) { $this->logger->debug(sprintf('The "%s" event is already stopped. No listeners have been called.', $eventName)); } $this->preProcess($eventName); try { $this->beforeDispatch($eventName, $event); try { $e = $this->stopwatch->start($eventName, 'section'); try { $this->dispatcher->dispatch($event, $eventName); } finally { if ($e->isStarted()) { $e->stop(); } } } finally { $this->afterDispatch($eventName, $event); } } finally { $this->currentRequestHash = $currentRequestHash; $this->postProcess($eventName); } return $event; }
[ "public", "function", "dispatch", "(", "$", "event", "/*, string $eventName = null*/", ")", "{", "if", "(", "null", "===", "$", "this", "->", "callStack", ")", "{", "$", "this", "->", "callStack", "=", "new", "\\", "SplObjectStorage", "(", ")", ";", "}", ...
{@inheritdoc} @param string|null $eventName
[ "{", "@inheritdoc", "}" ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcher.php#L136-L183
train
Dispatches an event to the dispatcher
[ 30522, 2270, 3853, 18365, 1006, 1002, 2724, 1013, 1008, 1010, 5164, 1002, 2724, 18442, 1027, 19701, 1008, 1013, 1007, 1063, 2065, 1006, 19701, 1027, 1027, 1027, 1002, 2023, 1011, 1028, 4455, 2696, 3600, 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...
matomo-org/matomo
libs/Zend/Cache/Core.php
Zend_Cache_Core._loggerSanity
protected function _loggerSanity() { if (!isset($this->_options['logging']) || !$this->_options['logging']) { return; } if (isset($this->_options['logger']) && $this->_options['logger'] instanceof Zend_Log) { return; } // Create a default logger to the standard output stream // require_once 'Zend/Log.php'; // require_once 'Zend/Log/Writer/Stream.php'; // require_once 'Zend/Log/Filter/Priority.php'; $logger = new Zend_Log(new Zend_Log_Writer_Stream('php://output')); $logger->addFilter(new Zend_Log_Filter_Priority(Zend_Log::WARN, '<=')); $this->_options['logger'] = $logger; }
php
protected function _loggerSanity() { if (!isset($this->_options['logging']) || !$this->_options['logging']) { return; } if (isset($this->_options['logger']) && $this->_options['logger'] instanceof Zend_Log) { return; } // Create a default logger to the standard output stream // require_once 'Zend/Log.php'; // require_once 'Zend/Log/Writer/Stream.php'; // require_once 'Zend/Log/Filter/Priority.php'; $logger = new Zend_Log(new Zend_Log_Writer_Stream('php://output')); $logger->addFilter(new Zend_Log_Filter_Priority(Zend_Log::WARN, '<=')); $this->_options['logger'] = $logger; }
[ "protected", "function", "_loggerSanity", "(", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "_options", "[", "'logging'", "]", ")", "||", "!", "$", "this", "->", "_options", "[", "'logging'", "]", ")", "{", "return", ";", "}", "if", "...
Make sure if we enable logging that the Zend_Log class is available. Create a default log object if none is set. @throws Zend_Cache_Exception @return void
[ "Make", "sure", "if", "we", "enable", "logging", "that", "the", "Zend_Log", "class", "is", "available", ".", "Create", "a", "default", "log", "object", "if", "none", "is", "set", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache/Core.php#L710-L727
train
Sanity check for logger options
[ 30522, 5123, 3853, 1035, 8833, 15776, 7088, 3723, 1006, 1007, 1063, 2065, 1006, 999, 26354, 3388, 1006, 1002, 2023, 1011, 1028, 1035, 7047, 1031, 1005, 15899, 1005, 1033, 1007, 1064, 1064, 999, 1002, 2023, 1011, 1028, 1035, 7047, 1031, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
libs/Zend/Cache.php
Zend_Cache._isReadable
private static function _isReadable($filename) { if (!$fh = @fopen($filename, 'r', true)) { return false; } @fclose($fh); return true; }
php
private static function _isReadable($filename) { if (!$fh = @fopen($filename, 'r', true)) { return false; } @fclose($fh); return true; }
[ "private", "static", "function", "_isReadable", "(", "$", "filename", ")", "{", "if", "(", "!", "$", "fh", "=", "@", "fopen", "(", "$", "filename", ",", "'r'", ",", "true", ")", ")", "{", "return", "false", ";", "}", "@", "fclose", "(", "$", "fh"...
Returns TRUE if the $filename is readable, or FALSE otherwise. This function uses the PHP include_path, where PHP's is_readable() does not. Note : this method comes from Zend_Loader (see #ZF-2891 for details) @param string $filename @return boolean
[ "Returns", "TRUE", "if", "the", "$filename", "is", "readable", "or", "FALSE", "otherwise", ".", "This", "function", "uses", "the", "PHP", "include_path", "where", "PHP", "s", "is_readable", "()", "does", "not", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache.php#L241-L248
train
Check if the file is readable
[ 30522, 2797, 10763, 3853, 1035, 2003, 16416, 20782, 1006, 1002, 5371, 18442, 1007, 1063, 2065, 1006, 999, 1002, 1042, 2232, 1027, 1030, 1042, 26915, 1006, 1002, 5371, 18442, 1010, 1005, 1054, 1005, 1010, 2995, 1007, 1007, 1063, 2709, 6270, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
core/Db/Adapter/Pdo/Pgsql.php
Pgsql.checkServerVersion
public function checkServerVersion() { $databaseVersion = $this->getServerVersion(); $requiredVersion = Config::getInstance()->General['minimum_pgsql_version']; if (version_compare($databaseVersion, $requiredVersion) === -1) { throw new Exception(Piwik::translate('General_ExceptionDatabaseVersion', array('PostgreSQL', $databaseVersion, $requiredVersion))); } }
php
public function checkServerVersion() { $databaseVersion = $this->getServerVersion(); $requiredVersion = Config::getInstance()->General['minimum_pgsql_version']; if (version_compare($databaseVersion, $requiredVersion) === -1) { throw new Exception(Piwik::translate('General_ExceptionDatabaseVersion', array('PostgreSQL', $databaseVersion, $requiredVersion))); } }
[ "public", "function", "checkServerVersion", "(", ")", "{", "$", "databaseVersion", "=", "$", "this", "->", "getServerVersion", "(", ")", ";", "$", "requiredVersion", "=", "Config", "::", "getInstance", "(", ")", "->", "General", "[", "'minimum_pgsql_version'", ...
Check PostgreSQL version @throws Exception
[ "Check", "PostgreSQL", "version" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Db/Adapter/Pdo/Pgsql.php#L46-L54
train
Check the PostgreSQL version of the current database.
[ 30522, 2270, 3853, 14148, 2121, 6299, 27774, 1006, 1007, 1063, 1002, 7809, 27774, 1027, 1002, 2023, 1011, 1028, 4152, 2121, 6299, 27774, 1006, 1007, 1025, 1002, 3223, 27774, 1027, 9530, 8873, 2290, 1024, 1024, 2131, 7076, 26897, 1006, 1007,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
overtrue/wechat
src/Payment/Refund/Client.php
Client.refund
protected function refund(string $refundNumber, int $totalFee, int $refundFee, $optional = []) { $params = array_merge([ 'out_refund_no' => $refundNumber, 'total_fee' => $totalFee, 'refund_fee' => $refundFee, 'appid' => $this->app['config']->app_id, ], $optional); return $this->safeRequest($this->wrap( $this->app->inSandbox() ? 'pay/refund' : 'secapi/pay/refund' ), $params); }
php
protected function refund(string $refundNumber, int $totalFee, int $refundFee, $optional = []) { $params = array_merge([ 'out_refund_no' => $refundNumber, 'total_fee' => $totalFee, 'refund_fee' => $refundFee, 'appid' => $this->app['config']->app_id, ], $optional); return $this->safeRequest($this->wrap( $this->app->inSandbox() ? 'pay/refund' : 'secapi/pay/refund' ), $params); }
[ "protected", "function", "refund", "(", "string", "$", "refundNumber", ",", "int", "$", "totalFee", ",", "int", "$", "refundFee", ",", "$", "optional", "=", "[", "]", ")", "{", "$", "params", "=", "array_merge", "(", "[", "'out_refund_no'", "=>", "$", ...
Refund. @param string $refundNumber @param int $totalFee @param int $refundFee @param array $optional @return \Psr\Http\Message\ResponseInterface|\EasyWeChat\Kernel\Support\Collection|array|object|string @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException
[ "Refund", "." ]
120c72faaa93c270365bc75c73c362d5fd583209
https://github.com/overtrue/wechat/blob/120c72faaa93c270365bc75c73c362d5fd583209/src/Payment/Refund/Client.php#L122-L134
train
Refund a refund
[ 30522, 5123, 3853, 25416, 8630, 1006, 5164, 1002, 25416, 8630, 19172, 5677, 1010, 20014, 1002, 2561, 7959, 2063, 1010, 20014, 1002, 25416, 8630, 7959, 2063, 1010, 1002, 11887, 1027, 1031, 1033, 1007, 1063, 1002, 11498, 5244, 1027, 9140, 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...
octobercms/october
modules/backend/widgets/Lists.php
Lists.getSortColumn
protected function getSortColumn() { if (!$this->isSortable()) { return false; } if ($this->sortColumn !== null) { return $this->sortColumn; } /* * User preference */ if ($this->showSorting && ($sortOptions = $this->getSession('sort'))) { $this->sortColumn = $sortOptions['column']; $this->sortDirection = $sortOptions['direction']; } /* * Supplied default */ else { if (is_string($this->defaultSort)) { $this->sortColumn = $this->defaultSort; $this->sortDirection = 'desc'; } elseif (is_array($this->defaultSort) && isset($this->defaultSort['column'])) { $this->sortColumn = $this->defaultSort['column']; $this->sortDirection = $this->defaultSort['direction'] ?? 'desc'; } } /* * First available column */ if ($this->sortColumn === null || !$this->isSortable($this->sortColumn)) { $columns = $this->visibleColumns ?: $this->getVisibleColumns(); $columns = array_filter($columns, function ($column) { return $column->sortable; }); $this->sortColumn = key($columns); $this->sortDirection = 'desc'; } return $this->sortColumn; }
php
protected function getSortColumn() { if (!$this->isSortable()) { return false; } if ($this->sortColumn !== null) { return $this->sortColumn; } /* * User preference */ if ($this->showSorting && ($sortOptions = $this->getSession('sort'))) { $this->sortColumn = $sortOptions['column']; $this->sortDirection = $sortOptions['direction']; } /* * Supplied default */ else { if (is_string($this->defaultSort)) { $this->sortColumn = $this->defaultSort; $this->sortDirection = 'desc'; } elseif (is_array($this->defaultSort) && isset($this->defaultSort['column'])) { $this->sortColumn = $this->defaultSort['column']; $this->sortDirection = $this->defaultSort['direction'] ?? 'desc'; } } /* * First available column */ if ($this->sortColumn === null || !$this->isSortable($this->sortColumn)) { $columns = $this->visibleColumns ?: $this->getVisibleColumns(); $columns = array_filter($columns, function ($column) { return $column->sortable; }); $this->sortColumn = key($columns); $this->sortDirection = 'desc'; } return $this->sortColumn; }
[ "protected", "function", "getSortColumn", "(", ")", "{", "if", "(", "!", "$", "this", "->", "isSortable", "(", ")", ")", "{", "return", "false", ";", "}", "if", "(", "$", "this", "->", "sortColumn", "!==", "null", ")", "{", "return", "$", "this", "...
Returns the current sorting column, saved in a session or cached.
[ "Returns", "the", "current", "sorting", "column", "saved", "in", "a", "session", "or", "cached", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/Lists.php#L1493-L1536
train
Return the column name of the sort column
[ 30522, 5123, 3853, 4152, 11589, 25778, 2819, 2078, 1006, 1007, 1063, 2065, 1006, 999, 1002, 2023, 1011, 1028, 26354, 11589, 3085, 1006, 1007, 1007, 1063, 2709, 6270, 1025, 1065, 2065, 1006, 1002, 2023, 1011, 1028, 4066, 25778, 2819, 2078, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
overtrue/wechat
src/OfficialAccount/Card/Client.php
Client.list
public function list($offset = 0, $count = 10, $statusList = 'CARD_STATUS_VERIFY_OK') { $params = [ 'offset' => $offset, 'count' => $count, 'status_list' => $statusList, ]; return $this->httpPostJson('card/batchget', $params); }
php
public function list($offset = 0, $count = 10, $statusList = 'CARD_STATUS_VERIFY_OK') { $params = [ 'offset' => $offset, 'count' => $count, 'status_list' => $statusList, ]; return $this->httpPostJson('card/batchget', $params); }
[ "public", "function", "list", "(", "$", "offset", "=", "0", ",", "$", "count", "=", "10", ",", "$", "statusList", "=", "'CARD_STATUS_VERIFY_OK'", ")", "{", "$", "params", "=", "[", "'offset'", "=>", "$", "offset", ",", "'count'", "=>", "$", "count", ...
批量查询卡列表. @param int $offset @param int $count @param string $statusList @return mixed
[ "批量查询卡列表", "." ]
120c72faaa93c270365bc75c73c362d5fd583209
https://github.com/overtrue/wechat/blob/120c72faaa93c270365bc75c73c362d5fd583209/src/OfficialAccount/Card/Client.php#L110-L119
train
Get list of all card types
[ 30522, 2270, 3853, 2862, 1006, 1002, 16396, 1027, 1014, 1010, 1002, 4175, 1027, 2184, 1010, 1002, 3570, 9863, 1027, 1005, 4003, 1035, 3570, 1035, 20410, 1035, 7929, 1005, 1007, 1063, 1002, 11498, 5244, 1027, 1031, 1005, 16396, 1005, 1027, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
getgrav/grav
system/src/Grav/Common/Page/Pages.php
Pages.addPage
public function addPage(PageInterface $page, $route = null) { if (!isset($this->instances[$page->path()])) { $this->instances[$page->path()] = $page; } $route = $page->route($route); if ($page->parent()) { $this->children[$page->parent()->path()][$page->path()] = ['slug' => $page->slug()]; } $this->routes[$route] = $page->path(); $this->grav->fireEvent('onPageProcessed', new Event(['page' => $page])); }
php
public function addPage(PageInterface $page, $route = null) { if (!isset($this->instances[$page->path()])) { $this->instances[$page->path()] = $page; } $route = $page->route($route); if ($page->parent()) { $this->children[$page->parent()->path()][$page->path()] = ['slug' => $page->slug()]; } $this->routes[$route] = $page->path(); $this->grav->fireEvent('onPageProcessed', new Event(['page' => $page])); }
[ "public", "function", "addPage", "(", "PageInterface", "$", "page", ",", "$", "route", "=", "null", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "instances", "[", "$", "page", "->", "path", "(", ")", "]", ")", ")", "{", "$", "this",...
Adds a page and assigns a route to it. @param PageInterface $page Page to be added. @param string $route Optional route (uses route from the object if not set).
[ "Adds", "a", "page", "and", "assigns", "a", "route", "to", "it", "." ]
1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72
https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Page/Pages.php#L300-L312
train
Add page to the page list
[ 30522, 2270, 3853, 5587, 13704, 1006, 3931, 18447, 2121, 12172, 1002, 3931, 1010, 1002, 2799, 1027, 19701, 1007, 1063, 2065, 1006, 999, 26354, 3388, 1006, 1002, 2023, 1011, 1028, 12107, 1031, 1002, 3931, 1011, 1028, 4130, 1006, 1007, 1033, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
laravel/framework
src/Illuminate/Mail/Mailer.php
Mailer.queue
public function queue($view, $queue = null) { if (! $view instanceof MailableContract) { throw new InvalidArgumentException('Only mailables may be queued.'); } if (is_string($queue)) { $view->onQueue($queue); } return $view->queue($this->queue); }
php
public function queue($view, $queue = null) { if (! $view instanceof MailableContract) { throw new InvalidArgumentException('Only mailables may be queued.'); } if (is_string($queue)) { $view->onQueue($queue); } return $view->queue($this->queue); }
[ "public", "function", "queue", "(", "$", "view", ",", "$", "queue", "=", "null", ")", "{", "if", "(", "!", "$", "view", "instanceof", "MailableContract", ")", "{", "throw", "new", "InvalidArgumentException", "(", "'Only mailables may be queued.'", ")", ";", ...
Queue a new e-mail message for sending. @param \Illuminate\Contracts\Mail\Mailable $view @param string|null $queue @return mixed @throws \InvalidArgumentException
[ "Queue", "a", "new", "e", "-", "mail", "message", "for", "sending", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Mail/Mailer.php#L378-L389
train
Queue a view
[ 30522, 2270, 3853, 24240, 1006, 1002, 3193, 1010, 1002, 24240, 1027, 19701, 1007, 1063, 2065, 1006, 999, 1002, 3193, 6013, 11253, 5653, 3085, 8663, 6494, 6593, 1007, 1063, 5466, 2047, 19528, 2906, 22850, 15781, 2595, 24422, 1006, 1005, 2069...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/Intl/DateFormatter/DateFormat/QuarterTransformer.php
QuarterTransformer.format
public function format(\DateTime $dateTime, int $length): string { $month = (int) $dateTime->format('n'); $quarter = (int) floor(($month - 1) / 3) + 1; switch ($length) { case 1: case 2: return $this->padLeft($quarter, $length); case 3: return 'Q'.$quarter; default: $map = [1 => '1st quarter', 2 => '2nd quarter', 3 => '3rd quarter', 4 => '4th quarter']; return $map[$quarter]; } }
php
public function format(\DateTime $dateTime, int $length): string { $month = (int) $dateTime->format('n'); $quarter = (int) floor(($month - 1) / 3) + 1; switch ($length) { case 1: case 2: return $this->padLeft($quarter, $length); case 3: return 'Q'.$quarter; default: $map = [1 => '1st quarter', 2 => '2nd quarter', 3 => '3rd quarter', 4 => '4th quarter']; return $map[$quarter]; } }
[ "public", "function", "format", "(", "\\", "DateTime", "$", "dateTime", ",", "int", "$", "length", ")", ":", "string", "{", "$", "month", "=", "(", "int", ")", "$", "dateTime", "->", "format", "(", "'n'", ")", ";", "$", "quarter", "=", "(", "int", ...
{@inheritdoc}
[ "{" ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Intl/DateFormatter/DateFormat/QuarterTransformer.php#L26-L41
train
Returns the string representation of a date
[ 30522, 2270, 3853, 4289, 1006, 1032, 3058, 7292, 1002, 3058, 7292, 1010, 20014, 1002, 3091, 1007, 1024, 5164, 1063, 1002, 3204, 1027, 1006, 20014, 1007, 1002, 3058, 7292, 1011, 1028, 4289, 1006, 1005, 1050, 1005, 1007, 1025, 1002, 4284, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
getgrav/grav
system/src/Grav/Common/Config/CompiledConfig.php
CompiledConfig.loadFile
protected function loadFile($name, $filename) { $file = CompiledYamlFile::instance($filename); $this->object->join($name, $file->content(), '/'); $file->free(); }
php
protected function loadFile($name, $filename) { $file = CompiledYamlFile::instance($filename); $this->object->join($name, $file->content(), '/'); $file->free(); }
[ "protected", "function", "loadFile", "(", "$", "name", ",", "$", "filename", ")", "{", "$", "file", "=", "CompiledYamlFile", "::", "instance", "(", "$", "filename", ")", ";", "$", "this", "->", "object", "->", "join", "(", "$", "name", ",", "$", "fil...
Load single configuration file and append it to the correct position. @param string $name Name of the position. @param string $filename File to be loaded.
[ "Load", "single", "configuration", "file", "and", "append", "it", "to", "the", "correct", "position", "." ]
1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72
https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Config/CompiledConfig.php#L95-L100
train
Load a YAML file into the current context
[ 30522, 5123, 3853, 7170, 8873, 2571, 1006, 1002, 2171, 1010, 1002, 5371, 18442, 1007, 1063, 1002, 5371, 1027, 9227, 14852, 10270, 9463, 1024, 1024, 6013, 1006, 1002, 5371, 18442, 1007, 1025, 1002, 2023, 1011, 1028, 4874, 1011, 1028, 3693, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
laravel/framework
src/Illuminate/Foundation/Auth/VerifiesEmails.php
VerifiesEmails.resend
public function resend(Request $request) { if ($request->user()->hasVerifiedEmail()) { return redirect($this->redirectPath()); } $request->user()->sendEmailVerificationNotification(); return back()->with('resent', true); }
php
public function resend(Request $request) { if ($request->user()->hasVerifiedEmail()) { return redirect($this->redirectPath()); } $request->user()->sendEmailVerificationNotification(); return back()->with('resent', true); }
[ "public", "function", "resend", "(", "Request", "$", "request", ")", "{", "if", "(", "$", "request", "->", "user", "(", ")", "->", "hasVerifiedEmail", "(", ")", ")", "{", "return", "redirect", "(", "$", "this", "->", "redirectPath", "(", ")", ")", ";...
Resend the email verification notification. @param \Illuminate\Http\Request $request @return \Illuminate\Http\Response
[ "Resend", "the", "email", "verification", "notification", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Foundation/Auth/VerifiesEmails.php#L56-L65
train
Resend the email verification notification
[ 30522, 2270, 3853, 24501, 10497, 1006, 5227, 1002, 5227, 1007, 1063, 2065, 1006, 1002, 5227, 1011, 1028, 5310, 1006, 1007, 1011, 1028, 2038, 6299, 7810, 14545, 4014, 1006, 1007, 1007, 1063, 2709, 2417, 7442, 6593, 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...
symfony/symfony
src/Symfony/Bridge/Monolog/Handler/ConsoleHandler.php
ConsoleHandler.onCommand
public function onCommand(ConsoleCommandEvent $event) { $output = $event->getOutput(); if ($output instanceof ConsoleOutputInterface) { $output = $output->getErrorOutput(); } $this->setOutput($output); }
php
public function onCommand(ConsoleCommandEvent $event) { $output = $event->getOutput(); if ($output instanceof ConsoleOutputInterface) { $output = $output->getErrorOutput(); } $this->setOutput($output); }
[ "public", "function", "onCommand", "(", "ConsoleCommandEvent", "$", "event", ")", "{", "$", "output", "=", "$", "event", "->", "getOutput", "(", ")", ";", "if", "(", "$", "output", "instanceof", "ConsoleOutputInterface", ")", "{", "$", "output", "=", "$", ...
Before a command is executed, the handler gets activated and the console output is set in order to know where to write the logs.
[ "Before", "a", "command", "is", "executed", "the", "handler", "gets", "activated", "and", "the", "console", "output", "is", "set", "in", "order", "to", "know", "where", "to", "write", "the", "logs", "." ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bridge/Monolog/Handler/ConsoleHandler.php#L114-L122
train
Called when a command is executed
[ 30522, 2270, 3853, 2006, 9006, 2386, 2094, 1006, 10122, 9006, 2386, 24844, 4765, 1002, 2724, 1007, 1063, 1002, 6434, 1027, 1002, 2724, 1011, 1028, 2131, 5833, 18780, 1006, 1007, 1025, 2065, 1006, 1002, 6434, 6013, 11253, 10122, 5833, 18780,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/DependencyInjection/Loader/Configurator/Traits/LazyTrait.php
LazyTrait.lazy
final public function lazy($lazy = true) { $this->definition->setLazy((bool) $lazy); if (\is_string($lazy)) { $this->definition->addTag('proxy', ['interface' => $lazy]); } return $this; }
php
final public function lazy($lazy = true) { $this->definition->setLazy((bool) $lazy); if (\is_string($lazy)) { $this->definition->addTag('proxy', ['interface' => $lazy]); } return $this; }
[ "final", "public", "function", "lazy", "(", "$", "lazy", "=", "true", ")", "{", "$", "this", "->", "definition", "->", "setLazy", "(", "(", "bool", ")", "$", "lazy", ")", ";", "if", "(", "\\", "is_string", "(", "$", "lazy", ")", ")", "{", "$", ...
Sets the lazy flag of this service. @param bool|string $lazy A FQCN to derivate the lazy proxy from or `true` to make it extend from the definition's class @return $this
[ "Sets", "the", "lazy", "flag", "of", "this", "service", "." ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/DependencyInjection/Loader/Configurator/Traits/LazyTrait.php#L23-L31
train
Set lazy - mode
[ 30522, 2345, 2270, 3853, 13971, 1006, 1002, 13971, 1027, 2995, 1007, 1063, 1002, 2023, 1011, 1028, 6210, 1011, 1028, 2275, 2721, 9096, 1006, 1006, 22017, 2140, 1007, 1002, 13971, 1007, 1025, 2065, 1006, 1032, 2003, 1035, 5164, 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/Validator/Mapping/Loader/YamlFileLoader.php
YamlFileLoader.loadClassMetadata
public function loadClassMetadata(ClassMetadata $metadata) { if (null === $this->classes) { $this->loadClassesFromYaml(); } if (isset($this->classes[$metadata->getClassName()])) { $classDescription = $this->classes[$metadata->getClassName()]; $this->loadClassMetadataFromYaml($metadata, $classDescription); return true; } return false; }
php
public function loadClassMetadata(ClassMetadata $metadata) { if (null === $this->classes) { $this->loadClassesFromYaml(); } if (isset($this->classes[$metadata->getClassName()])) { $classDescription = $this->classes[$metadata->getClassName()]; $this->loadClassMetadataFromYaml($metadata, $classDescription); return true; } return false; }
[ "public", "function", "loadClassMetadata", "(", "ClassMetadata", "$", "metadata", ")", "{", "if", "(", "null", "===", "$", "this", "->", "classes", ")", "{", "$", "this", "->", "loadClassesFromYaml", "(", ")", ";", "}", "if", "(", "isset", "(", "$", "t...
{@inheritdoc}
[ "{" ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Validator/Mapping/Loader/YamlFileLoader.php#L43-L58
train
Load class metadata from yaml
[ 30522, 2270, 3853, 7170, 26266, 11368, 8447, 2696, 1006, 2465, 11368, 8447, 2696, 1002, 27425, 1007, 1063, 2065, 1006, 19701, 1027, 1027, 1027, 1002, 2023, 1011, 1028, 4280, 1007, 1063, 1002, 2023, 1011, 1028, 7170, 26266, 2229, 19699, 1694...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/Container/Container.php
Container.removeAbstractAlias
protected function removeAbstractAlias($searched) { if (! isset($this->aliases[$searched])) { return; } foreach ($this->abstractAliases as $abstract => $aliases) { foreach ($aliases as $index => $alias) { if ($alias == $searched) { unset($this->abstractAliases[$abstract][$index]); } } } }
php
protected function removeAbstractAlias($searched) { if (! isset($this->aliases[$searched])) { return; } foreach ($this->abstractAliases as $abstract => $aliases) { foreach ($aliases as $index => $alias) { if ($alias == $searched) { unset($this->abstractAliases[$abstract][$index]); } } } }
[ "protected", "function", "removeAbstractAlias", "(", "$", "searched", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "aliases", "[", "$", "searched", "]", ")", ")", "{", "return", ";", "}", "foreach", "(", "$", "this", "->", "abstractAliase...
Remove an alias from the contextual binding alias cache. @param string $searched @return void
[ "Remove", "an", "alias", "from", "the", "contextual", "binding", "alias", "cache", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Container/Container.php#L419-L432
train
Removes an abstract alias from the aliases array
[ 30522, 5123, 3853, 6366, 7875, 20528, 25572, 6632, 2015, 1006, 1002, 9022, 1007, 1063, 2065, 1006, 999, 26354, 3388, 1006, 1002, 2023, 1011, 1028, 14593, 2229, 1031, 1002, 9022, 1033, 1007, 1007, 1063, 2709, 1025, 1065, 18921, 6776, 1006, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/Form/Form.php
Form.handleRequest
public function handleRequest($request = null) { $this->config->getRequestHandler()->handleRequest($this, $request); return $this; }
php
public function handleRequest($request = null) { $this->config->getRequestHandler()->handleRequest($this, $request); return $this; }
[ "public", "function", "handleRequest", "(", "$", "request", "=", "null", ")", "{", "$", "this", "->", "config", "->", "getRequestHandler", "(", ")", "->", "handleRequest", "(", "$", "this", ",", "$", "request", ")", ";", "return", "$", "this", ";", "}"...
{@inheritdoc}
[ "{" ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/Form.php#L491-L496
train
Handle request and return the result
[ 30522, 2270, 3853, 28213, 2063, 15500, 1006, 1002, 5227, 1027, 19701, 1007, 1063, 1002, 2023, 1011, 1028, 9530, 8873, 2290, 1011, 1028, 2131, 2890, 15500, 11774, 3917, 1006, 1007, 1011, 1028, 28213, 2063, 15500, 1006, 1002, 2023, 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...
matomo-org/matomo
core/FrontController.php
FrontController.throwIfPiwikVersionIsOlderThanDBSchema
private function throwIfPiwikVersionIsOlderThanDBSchema() { // When developing this situation happens often when switching branches if (Development::isEnabled()) { return; } if (!StaticContainer::get('EnableDbVersionCheck')) { return; } $updater = new Updater(); $dbSchemaVersion = $updater->getCurrentComponentVersion('core'); $current = Version::VERSION; if (-1 === version_compare($current, $dbSchemaVersion)) { $messages = array( Piwik::translate('General_ExceptionDatabaseVersionNewerThanCodebase', array($current, $dbSchemaVersion)), Piwik::translate('General_ExceptionDatabaseVersionNewerThanCodebaseWait'), // we cannot fill in the Super User emails as we are failing before Authentication was ready Piwik::translate('General_ExceptionContactSupportGeneric', array('', '')) ); throw new DatabaseSchemaIsNewerThanCodebaseException(implode(" ", $messages)); } }
php
private function throwIfPiwikVersionIsOlderThanDBSchema() { // When developing this situation happens often when switching branches if (Development::isEnabled()) { return; } if (!StaticContainer::get('EnableDbVersionCheck')) { return; } $updater = new Updater(); $dbSchemaVersion = $updater->getCurrentComponentVersion('core'); $current = Version::VERSION; if (-1 === version_compare($current, $dbSchemaVersion)) { $messages = array( Piwik::translate('General_ExceptionDatabaseVersionNewerThanCodebase', array($current, $dbSchemaVersion)), Piwik::translate('General_ExceptionDatabaseVersionNewerThanCodebaseWait'), // we cannot fill in the Super User emails as we are failing before Authentication was ready Piwik::translate('General_ExceptionContactSupportGeneric', array('', '')) ); throw new DatabaseSchemaIsNewerThanCodebaseException(implode(" ", $messages)); } }
[ "private", "function", "throwIfPiwikVersionIsOlderThanDBSchema", "(", ")", "{", "// When developing this situation happens often when switching branches", "if", "(", "Development", "::", "isEnabled", "(", ")", ")", "{", "return", ";", "}", "if", "(", "!", "StaticContainer...
This method ensures that Piwik Platform cannot be running when using a NEWER database.
[ "This", "method", "ensures", "that", "Piwik", "Platform", "cannot", "be", "running", "when", "using", "a", "NEWER", "database", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/FrontController.php#L622-L646
train
Throws an exception if Piwik version is newer than DB schema
[ 30522, 2797, 3853, 5466, 10128, 8197, 9148, 2243, 27774, 19565, 16502, 21604, 18939, 22842, 2863, 1006, 1007, 1063, 1013, 1013, 2043, 4975, 2023, 3663, 6433, 2411, 2043, 11991, 5628, 2065, 1006, 2458, 1024, 1024, 2003, 8189, 23242, 1006, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
libs/HTML/QuickForm2/Node.php
HTML_QuickForm2_Node.addRule
public function addRule($rule, $messageOrRunAt = '', $options = null, $runAt = HTML_QuickForm2_Rule::RUNAT_SERVER) { if ($rule instanceof HTML_QuickForm2_Rule) { $rule->setOwner($this); $runAt = '' == $messageOrRunAt? HTML_QuickForm2_Rule::RUNAT_SERVER: $messageOrRunAt; } elseif (is_string($rule)) { $rule = HTML_QuickForm2_Factory::createRule($rule, $this, $messageOrRunAt, $options); } else { throw new HTML_QuickForm2_InvalidArgumentException( 'addRule() expects either a rule type or ' . 'a HTML_QuickForm2_Rule instance' ); } $this->rules[] = array($rule, $runAt); return $rule; }
php
public function addRule($rule, $messageOrRunAt = '', $options = null, $runAt = HTML_QuickForm2_Rule::RUNAT_SERVER) { if ($rule instanceof HTML_QuickForm2_Rule) { $rule->setOwner($this); $runAt = '' == $messageOrRunAt? HTML_QuickForm2_Rule::RUNAT_SERVER: $messageOrRunAt; } elseif (is_string($rule)) { $rule = HTML_QuickForm2_Factory::createRule($rule, $this, $messageOrRunAt, $options); } else { throw new HTML_QuickForm2_InvalidArgumentException( 'addRule() expects either a rule type or ' . 'a HTML_QuickForm2_Rule instance' ); } $this->rules[] = array($rule, $runAt); return $rule; }
[ "public", "function", "addRule", "(", "$", "rule", ",", "$", "messageOrRunAt", "=", "''", ",", "$", "options", "=", "null", ",", "$", "runAt", "=", "HTML_QuickForm2_Rule", "::", "RUNAT_SERVER", ")", "{", "if", "(", "$", "rule", "instanceof", "HTML_QuickFor...
Adds a validation rule @param HTML_QuickForm2_Rule|string Validation rule or rule type @param string|int If first parameter is rule type, then message to display if validation fails, otherwise constant showing whether to perfom validation client-side and/or server-side @param mixed Additional data for the rule @param int Whether to perfom validation server-side and/or client side. Combination of HTML_QuickForm2_Rule::RUNAT_* constants @return HTML_QuickForm2_Rule The added rule @throws HTML_QuickForm2_InvalidArgumentException if $rule is of a wrong type or rule name isn't registered with Factory @throws HTML_QuickForm2_NotFoundException if class for a given rule name cannot be found @todo Need some means to mark the Rules for running client-side
[ "Adds", "a", "validation", "rule" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Node.php#L500-L517
train
Adds a new rule to the list of rules
[ 30522, 2270, 3853, 5587, 6820, 2571, 1006, 1002, 3627, 1010, 1002, 4471, 2953, 26605, 2102, 1027, 1005, 1005, 1010, 1002, 7047, 1027, 19701, 1010, 1002, 2448, 4017, 1027, 16129, 1035, 4248, 14192, 2475, 1035, 3627, 1024, 1024, 2448, 4017, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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.storeCachedInfo
protected function storeCachedInfo($result) { $cacheItem = $result; $cacheItem['mtime'] = $this->object->mtime; $cached = $this->getCachedInfo() ?: []; $cached[$this->filePath] = $cacheItem; Cache::put($this->dataCacheKey, base64_encode(serialize($cached)), 1440); self::$cache[$this->filePath] = $result; }
php
protected function storeCachedInfo($result) { $cacheItem = $result; $cacheItem['mtime'] = $this->object->mtime; $cached = $this->getCachedInfo() ?: []; $cached[$this->filePath] = $cacheItem; Cache::put($this->dataCacheKey, base64_encode(serialize($cached)), 1440); self::$cache[$this->filePath] = $result; }
[ "protected", "function", "storeCachedInfo", "(", "$", "result", ")", "{", "$", "cacheItem", "=", "$", "result", ";", "$", "cacheItem", "[", "'mtime'", "]", "=", "$", "this", "->", "object", "->", "mtime", ";", "$", "cached", "=", "$", "this", "->", "...
Stores result data inside cache. @param array $result @return void
[ "Stores", "result", "data", "inside", "cache", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/CodeParser.php#L217-L228
train
Stores the cached info of the file in the cache
[ 30522, 5123, 3853, 3573, 3540, 7690, 2378, 14876, 1006, 1002, 2765, 1007, 1063, 1002, 17053, 4221, 2213, 1027, 1002, 2765, 1025, 1002, 17053, 4221, 2213, 1031, 1005, 11047, 14428, 1005, 1033, 1027, 1002, 2023, 1011, 1028, 4874, 1011, 1028, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
core/CronArchive.php
CronArchive.findWebsiteIdsInTimezoneWithNewDay
private function findWebsiteIdsInTimezoneWithNewDay($websiteIds) { $timezones = $this->getTimezonesHavingNewDaySinceLastRun(); $websiteDayHasFinishedSinceLastRun = APISitesManager::getInstance()->getSitesIdFromTimezones($timezones); $websiteDayHasFinishedSinceLastRun = array_intersect($websiteDayHasFinishedSinceLastRun, $websiteIds); $this->websiteDayHasFinishedSinceLastRun = $websiteDayHasFinishedSinceLastRun; if (count($websiteDayHasFinishedSinceLastRun) > 0) { $ids = !empty($websiteDayHasFinishedSinceLastRun) ? ", IDs: " . implode(", ", $websiteDayHasFinishedSinceLastRun) : ""; $this->logger->info("- Will process " . count($websiteDayHasFinishedSinceLastRun) . " other websites because the last time they were archived was on a different day (in the website's timezone) " . $ids); } return $websiteDayHasFinishedSinceLastRun; }
php
private function findWebsiteIdsInTimezoneWithNewDay($websiteIds) { $timezones = $this->getTimezonesHavingNewDaySinceLastRun(); $websiteDayHasFinishedSinceLastRun = APISitesManager::getInstance()->getSitesIdFromTimezones($timezones); $websiteDayHasFinishedSinceLastRun = array_intersect($websiteDayHasFinishedSinceLastRun, $websiteIds); $this->websiteDayHasFinishedSinceLastRun = $websiteDayHasFinishedSinceLastRun; if (count($websiteDayHasFinishedSinceLastRun) > 0) { $ids = !empty($websiteDayHasFinishedSinceLastRun) ? ", IDs: " . implode(", ", $websiteDayHasFinishedSinceLastRun) : ""; $this->logger->info("- Will process " . count($websiteDayHasFinishedSinceLastRun) . " other websites because the last time they were archived was on a different day (in the website's timezone) " . $ids); } return $websiteDayHasFinishedSinceLastRun; }
[ "private", "function", "findWebsiteIdsInTimezoneWithNewDay", "(", "$", "websiteIds", ")", "{", "$", "timezones", "=", "$", "this", "->", "getTimezonesHavingNewDaySinceLastRun", "(", ")", ";", "$", "websiteDayHasFinishedSinceLastRun", "=", "APISitesManager", "::", "getIn...
Returns the list of websites in which timezones today is a new day (compared to the last time archiving was executed) @param $websiteIds @return array Website IDs
[ "Returns", "the", "list", "of", "websites", "in", "which", "timezones", "today", "is", "a", "new", "day", "(", "compared", "to", "the", "last", "time", "archiving", "was", "executed", ")" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/CronArchive.php#L1350-L1365
train
Find websites ids that have been archived since the last time they were archived since the last time they were archived since the last time they were archived since the last time they were archived since the last time they were archived.
[ 30522, 2797, 3853, 2424, 8545, 5910, 4221, 9821, 18447, 14428, 15975, 24415, 2638, 21724, 4710, 1006, 1002, 4037, 9821, 1007, 1063, 1002, 2051, 15975, 2015, 1027, 1002, 2023, 1011, 1028, 2131, 7292, 15975, 7377, 6455, 2638, 21724, 22916, 23...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/Queue.php
Queue.laterOn
public function laterOn($queue, $delay, $job, $data = '') { return $this->later($delay, $job, $data, $queue); }
php
public function laterOn($queue, $delay, $job, $data = '') { return $this->later($delay, $job, $data, $queue); }
[ "public", "function", "laterOn", "(", "$", "queue", ",", "$", "delay", ",", "$", "job", ",", "$", "data", "=", "''", ")", "{", "return", "$", "this", "->", "later", "(", "$", "delay", ",", "$", "job", ",", "$", "data", ",", "$", "queue", ")", ...
Push a new job onto the queue after a delay. @param string $queue @param \DateTimeInterface|\DateInterval|int $delay @param string $job @param mixed $data @return mixed
[ "Push", "a", "new", "job", "onto", "the", "queue", "after", "a", "delay", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Queue/Queue.php#L56-L59
train
This method will be called by the Timer to run the next job in the queue.
[ 30522, 2270, 3853, 2101, 2239, 1006, 1002, 24240, 1010, 1002, 8536, 1010, 1002, 3105, 1010, 1002, 2951, 1027, 1005, 1005, 1007, 1063, 2709, 1002, 2023, 1011, 1028, 2101, 1006, 1002, 8536, 1010, 1002, 3105, 1010, 1002, 2951, 1010, 1002, 24...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/Models/Role.php
Role.findByName
public static function findByName(string $name, $guardName = null): RoleContract { $guardName = $guardName ?? Guard::getDefaultName(static::class); $role = static::where('name', $name)->where('guard_name', $guardName)->first(); if (! $role) { throw RoleDoesNotExist::named($name); } return $role; }
php
public static function findByName(string $name, $guardName = null): RoleContract { $guardName = $guardName ?? Guard::getDefaultName(static::class); $role = static::where('name', $name)->where('guard_name', $guardName)->first(); if (! $role) { throw RoleDoesNotExist::named($name); } return $role; }
[ "public", "static", "function", "findByName", "(", "string", "$", "name", ",", "$", "guardName", "=", "null", ")", ":", "RoleContract", "{", "$", "guardName", "=", "$", "guardName", "??", "Guard", "::", "getDefaultName", "(", "static", "::", "class", ")", ...
Find a role by its name and guard name. @param string $name @param string|null $guardName @return \Spatie\Permission\Contracts\Role|\Spatie\Permission\Models\Role @throws \Spatie\Permission\Exceptions\RoleDoesNotExist
[ "Find", "a", "role", "by", "its", "name", "and", "guard", "name", "." ]
81dbe9d372d70c255b66a2727a235076509f8d45
https://github.com/spatie/laravel-permission/blob/81dbe9d372d70c255b66a2727a235076509f8d45/src/Models/Role.php#L84-L95
train
Find a role by its name and guard name
[ 30522, 2270, 10763, 3853, 2424, 3762, 18442, 1006, 5164, 1002, 2171, 1010, 1002, 3457, 18442, 1027, 19701, 1007, 1024, 2535, 8663, 6494, 6593, 1063, 1002, 3457, 18442, 1027, 1002, 3457, 18442, 1029, 1029, 3457, 1024, 1024, 2131, 30524, 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/HttpKernel/HttpCache/Store.php
Store.invalidate
public function invalidate(Request $request) { $modified = false; $key = $this->getCacheKey($request); $entries = []; foreach ($this->getMetadata($key) as $entry) { $response = $this->restoreResponse($entry[1]); if ($response->isFresh()) { $response->expire(); $modified = true; $entries[] = [$entry[0], $this->persistResponse($response)]; } else { $entries[] = $entry; } } if ($modified && false === $this->save($key, serialize($entries))) { throw new \RuntimeException('Unable to store the metadata.'); } }
php
public function invalidate(Request $request) { $modified = false; $key = $this->getCacheKey($request); $entries = []; foreach ($this->getMetadata($key) as $entry) { $response = $this->restoreResponse($entry[1]); if ($response->isFresh()) { $response->expire(); $modified = true; $entries[] = [$entry[0], $this->persistResponse($response)]; } else { $entries[] = $entry; } } if ($modified && false === $this->save($key, serialize($entries))) { throw new \RuntimeException('Unable to store the metadata.'); } }
[ "public", "function", "invalidate", "(", "Request", "$", "request", ")", "{", "$", "modified", "=", "false", ";", "$", "key", "=", "$", "this", "->", "getCacheKey", "(", "$", "request", ")", ";", "$", "entries", "=", "[", "]", ";", "foreach", "(", ...
Invalidates all cache entries that match the request. @throws \RuntimeException
[ "Invalidates", "all", "cache", "entries", "that", "match", "the", "request", "." ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpKernel/HttpCache/Store.php#L232-L252
train
Invalidate all response cache entries for a request
[ 30522, 2270, 3853, 19528, 3686, 1006, 5227, 1002, 5227, 1007, 1063, 1002, 6310, 1027, 6270, 1025, 1002, 3145, 1027, 1002, 2023, 1011, 1028, 2131, 3540, 5403, 14839, 1006, 1002, 5227, 1007, 1025, 1002, 10445, 1027, 1031, 1033, 1025, 18921, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/Csrf/TokenStorage/NativeSessionTokenStorage.php
NativeSessionTokenStorage.setToken
public function setToken($tokenId, $token) { if (!$this->sessionStarted) { $this->startSession(); } $_SESSION[$this->namespace][$tokenId] = (string) $token; }
php
public function setToken($tokenId, $token) { if (!$this->sessionStarted) { $this->startSession(); } $_SESSION[$this->namespace][$tokenId] = (string) $token; }
[ "public", "function", "setToken", "(", "$", "tokenId", ",", "$", "token", ")", "{", "if", "(", "!", "$", "this", "->", "sessionStarted", ")", "{", "$", "this", "->", "startSession", "(", ")", ";", "}", "$", "_SESSION", "[", "$", "this", "->", "name...
{@inheritdoc}
[ "{" ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Security/Csrf/TokenStorage/NativeSessionTokenStorage.php#L60-L67
train
Set a token in the session
[ 30522, 2270, 3853, 2275, 18715, 2368, 1006, 1002, 19204, 3593, 1010, 1002, 19204, 1007, 1063, 2065, 1006, 999, 1002, 2023, 1011, 1028, 6521, 7559, 3064, 1007, 1063, 1002, 2023, 1011, 1028, 4627, 7971, 3258, 1006, 1007, 1025, 1065, 1002, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
octobercms/october
modules/system/helpers/Cache.php
Cache.clearMeta
public function clearMeta() { File::delete(storage_path().'/cms/disabled.json'); File::delete(App::getCachedCompilePath()); File::delete(App::getCachedServicesPath()); }
php
public function clearMeta() { File::delete(storage_path().'/cms/disabled.json'); File::delete(App::getCachedCompilePath()); File::delete(App::getCachedServicesPath()); }
[ "public", "function", "clearMeta", "(", ")", "{", "File", "::", "delete", "(", "storage_path", "(", ")", ".", "'/cms/disabled.json'", ")", ";", "File", "::", "delete", "(", "App", "::", "getCachedCompilePath", "(", ")", ")", ";", "File", "::", "delete", ...
/* Meta
[ "/", "*", "Meta" ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/helpers/Cache.php#L67-L72
train
Clear all meta data
[ 30522, 2270, 3853, 3154, 11368, 2050, 1006, 1007, 1063, 5371, 1024, 1024, 3972, 12870, 1006, 5527, 1035, 4130, 1006, 1007, 1012, 1005, 1013, 4642, 2015, 1013, 9776, 1012, 1046, 3385, 1005, 1007, 1025, 5371, 1024, 1024, 3972, 12870, 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
core/Db/Adapter.php
Adapter.getAdapterClassName
private static function getAdapterClassName($adapterName) { $className = 'Piwik\Db\Adapter\\' . str_replace(' ', '\\', ucwords(str_replace(array('_', '\\'), ' ', strtolower($adapterName)))); if (!class_exists($className)) { throw new \Exception(sprintf("Adapter '%s' is not valid. Maybe check that your Matomo configuration files in config/*.ini.php are readable by the webserver.", $adapterName)); } return $className; }
php
private static function getAdapterClassName($adapterName) { $className = 'Piwik\Db\Adapter\\' . str_replace(' ', '\\', ucwords(str_replace(array('_', '\\'), ' ', strtolower($adapterName)))); if (!class_exists($className)) { throw new \Exception(sprintf("Adapter '%s' is not valid. Maybe check that your Matomo configuration files in config/*.ini.php are readable by the webserver.", $adapterName)); } return $className; }
[ "private", "static", "function", "getAdapterClassName", "(", "$", "adapterName", ")", "{", "$", "className", "=", "'Piwik\\Db\\Adapter\\\\'", ".", "str_replace", "(", "' '", ",", "'\\\\'", ",", "ucwords", "(", "str_replace", "(", "array", "(", "'_'", ",", "'\\...
Get adapter class name @param string $adapterName @return string @throws \Exception
[ "Get", "adapter", "class", "name" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Db/Adapter.php#L68-L75
train
Get adapter class name
[ 30522, 2797, 10763, 3853, 2131, 8447, 13876, 2121, 26266, 18442, 1006, 1002, 15581, 11795, 14074, 1007, 1063, 1002, 2465, 18442, 1027, 1005, 14255, 9148, 2243, 1032, 16962, 1032, 15581, 2121, 1032, 1032, 1005, 1012, 2358, 2099, 1035, 5672, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/Db2.php
Zend_Db_Statement_Db2._prepare
public function _prepare($sql) { $connection = $this->_adapter->getConnection(); // db2_prepare on i5 emits errors, these need to be // suppressed so that proper exceptions can be thrown $this->_stmt = @db2_prepare($connection, $sql); if (!$this->_stmt) { /** * @see Zend_Db_Statement_Db2_Exception */ // require_once 'Zend/Db/Statement/Db2/Exception.php'; throw new Zend_Db_Statement_Db2_Exception( db2_stmt_errormsg(), db2_stmt_error() ); } }
php
public function _prepare($sql) { $connection = $this->_adapter->getConnection(); // db2_prepare on i5 emits errors, these need to be // suppressed so that proper exceptions can be thrown $this->_stmt = @db2_prepare($connection, $sql); if (!$this->_stmt) { /** * @see Zend_Db_Statement_Db2_Exception */ // require_once 'Zend/Db/Statement/Db2/Exception.php'; throw new Zend_Db_Statement_Db2_Exception( db2_stmt_errormsg(), db2_stmt_error() ); } }
[ "public", "function", "_prepare", "(", "$", "sql", ")", "{", "$", "connection", "=", "$", "this", "->", "_adapter", "->", "getConnection", "(", ")", ";", "// db2_prepare on i5 emits errors, these need to be", "// suppressed so that proper exceptions can be thrown", "$", ...
Prepare a statement handle. @param string $sql @return void @throws Zend_Db_Statement_Db2_Exception
[ "Prepare", "a", "statement", "handle", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Statement/Db2.php#L56-L74
train
Prepare statement for execution
[ 30522, 2270, 3853, 1035, 7374, 1006, 1002, 29296, 1007, 1063, 1002, 4434, 1027, 1002, 2023, 1011, 1028, 1035, 15581, 2121, 1011, 1028, 2131, 8663, 2638, 7542, 1006, 1007, 1025, 1013, 1013, 16962, 2475, 1035, 7374, 2006, 1045, 2629, 12495, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
dompdf/dompdf
src/Css/Style.php
Style.get_font_family
function get_font_family() { if (isset($this->_font_family)) { return $this->_font_family; } $DEBUGCSS = $this->_stylesheet->get_dompdf()->getOptions()->getDebugCss(); // Select the appropriate font. First determine the subtype, then check // the specified font-families for a candidate. // Resolve font-weight $weight = $this->__get("font_weight"); if (is_numeric($weight)) { if ($weight < 600) { $weight = "normal"; } else { $weight = "bold"; } } else if ($weight === "bold" || $weight === "bolder") { $weight = "bold"; } else { $weight = "normal"; } // Resolve font-style $font_style = $this->__get("font_style"); if ($weight === "bold" && ($font_style === "italic" || $font_style === "oblique")) { $subtype = "bold_italic"; } else if ($weight === "bold" && $font_style !== "italic" && $font_style !== "oblique") { $subtype = "bold"; } else if ($weight !== "bold" && ($font_style === "italic" || $font_style === "oblique")) { $subtype = "italic"; } else { $subtype = "normal"; } // Resolve the font family if ($DEBUGCSS) { print "<pre>[get_font_family:"; print '(' . $this->_props["font_family"] . '.' . $font_style . '.' . $this->__get("font_weight") . '.' . $weight . '.' . $subtype . ')'; } $families = preg_split("/\s*,\s*/", $this->_props["font_family"]); $font = null; foreach ($families as $family) { //remove leading and trailing string delimiters, e.g. on font names with spaces; //remove leading and trailing whitespace $family = trim($family, " \t\n\r\x0B\"'"); if ($DEBUGCSS) { print '(' . $family . ')'; } $font = $this->getFontMetrics()->getFont($family, $subtype); if ($font) { if ($DEBUGCSS) { print '(' . $font . ")get_font_family]\n</pre>"; } return $this->_font_family = $font; } } $family = null; if ($DEBUGCSS) { print '(default)'; } $font = $this->getFontMetrics()->getFont($family, $subtype); if ($font) { if ($DEBUGCSS) { print '(' . $font . ")get_font_family]\n</pre>"; } return $this->_font_family = $font; } throw new Exception("Unable to find a suitable font replacement for: '" . $this->_props["font_family"] . "'"); }
php
function get_font_family() { if (isset($this->_font_family)) { return $this->_font_family; } $DEBUGCSS = $this->_stylesheet->get_dompdf()->getOptions()->getDebugCss(); // Select the appropriate font. First determine the subtype, then check // the specified font-families for a candidate. // Resolve font-weight $weight = $this->__get("font_weight"); if (is_numeric($weight)) { if ($weight < 600) { $weight = "normal"; } else { $weight = "bold"; } } else if ($weight === "bold" || $weight === "bolder") { $weight = "bold"; } else { $weight = "normal"; } // Resolve font-style $font_style = $this->__get("font_style"); if ($weight === "bold" && ($font_style === "italic" || $font_style === "oblique")) { $subtype = "bold_italic"; } else if ($weight === "bold" && $font_style !== "italic" && $font_style !== "oblique") { $subtype = "bold"; } else if ($weight !== "bold" && ($font_style === "italic" || $font_style === "oblique")) { $subtype = "italic"; } else { $subtype = "normal"; } // Resolve the font family if ($DEBUGCSS) { print "<pre>[get_font_family:"; print '(' . $this->_props["font_family"] . '.' . $font_style . '.' . $this->__get("font_weight") . '.' . $weight . '.' . $subtype . ')'; } $families = preg_split("/\s*,\s*/", $this->_props["font_family"]); $font = null; foreach ($families as $family) { //remove leading and trailing string delimiters, e.g. on font names with spaces; //remove leading and trailing whitespace $family = trim($family, " \t\n\r\x0B\"'"); if ($DEBUGCSS) { print '(' . $family . ')'; } $font = $this->getFontMetrics()->getFont($family, $subtype); if ($font) { if ($DEBUGCSS) { print '(' . $font . ")get_font_family]\n</pre>"; } return $this->_font_family = $font; } } $family = null; if ($DEBUGCSS) { print '(default)'; } $font = $this->getFontMetrics()->getFont($family, $subtype); if ($font) { if ($DEBUGCSS) { print '(' . $font . ")get_font_family]\n</pre>"; } return $this->_font_family = $font; } throw new Exception("Unable to find a suitable font replacement for: '" . $this->_props["font_family"] . "'"); }
[ "function", "get_font_family", "(", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "_font_family", ")", ")", "{", "return", "$", "this", "->", "_font_family", ";", "}", "$", "DEBUGCSS", "=", "$", "this", "->", "_stylesheet", "->", "get_dompdf", ...
Getter for the 'font-family' CSS property. Uses the {@link FontMetrics} class to resolve the font family into an actual font file. @link http://www.w3.org/TR/CSS21/fonts.html#propdef-font-family @throws Exception @return string
[ "Getter", "for", "the", "font", "-", "family", "CSS", "property", ".", "Uses", "the", "{", "@link", "FontMetrics", "}", "class", "to", "resolve", "the", "font", "family", "into", "an", "actual", "font", "file", "." ]
75f13c700009be21a1965dc2c5b68a8708c22ba2
https://github.com/dompdf/dompdf/blob/75f13c700009be21a1965dc2c5b68a8708c22ba2/src/Css/Style.php#L919-L999
train
Return the font - family
[ 30522, 3853, 2131, 1035, 15489, 1035, 2155, 1006, 1007, 1063, 2065, 1006, 26354, 3388, 30524, 7361, 9285, 1006, 1007, 1011, 1028, 2131, 3207, 8569, 18195, 4757, 1006, 1007, 1025, 1013, 1013, 7276, 1996, 6413, 15489, 1012, 2034, 5646, 1996, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
laravel/framework
src/Illuminate/Database/Query/Grammars/Grammar.php
Grammar.whereColumn
protected function whereColumn(Builder $query, $where) { return $this->wrap($where['first']).' '.$where['operator'].' '.$this->wrap($where['second']); }
php
protected function whereColumn(Builder $query, $where) { return $this->wrap($where['first']).' '.$where['operator'].' '.$this->wrap($where['second']); }
[ "protected", "function", "whereColumn", "(", "Builder", "$", "query", ",", "$", "where", ")", "{", "return", "$", "this", "->", "wrap", "(", "$", "where", "[", "'first'", "]", ")", ".", "' '", ".", "$", "where", "[", "'operator'", "]", ".", "' '", ...
Compile a where clause comparing two columns.. @param \Illuminate\Database\Query\Builder $query @param array $where @return string
[ "Compile", "a", "where", "clause", "comparing", "two", "columns", ".." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Query/Grammars/Grammar.php#L466-L469
train
Protected whereColumn - Helper function
[ 30522, 5123, 3853, 2073, 25778, 2819, 2078, 1006, 12508, 1002, 23032, 1010, 1002, 2073, 1007, 1063, 2709, 1002, 2023, 1011, 1028, 10236, 1006, 1002, 2073, 1031, 1005, 2034, 1005, 1033, 1007, 1012, 1005, 1005, 1012, 1002, 2073, 1031, 1005, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
plugins/Actions/ArchivingHelper.php
ArchivingHelper.setCachedActionRow
private static function setCachedActionRow($idAction, $actionType, $actionRow) { $cacheLabel = self::getCachedActionRowKey($idAction, $actionType); self::$cacheParsedAction[$cacheLabel] = $actionRow; }
php
private static function setCachedActionRow($idAction, $actionType, $actionRow) { $cacheLabel = self::getCachedActionRowKey($idAction, $actionType); self::$cacheParsedAction[$cacheLabel] = $actionRow; }
[ "private", "static", "function", "setCachedActionRow", "(", "$", "idAction", ",", "$", "actionType", ",", "$", "actionRow", ")", "{", "$", "cacheLabel", "=", "self", "::", "getCachedActionRowKey", "(", "$", "idAction", ",", "$", "actionType", ")", ";", "self...
Set cached action row for an id & type. @param int $idAction @param int $actionType @param \DataTable\Row
[ "Set", "cached", "action", "row", "for", "an", "id", "&", "type", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Actions/ArchivingHelper.php#L546-L550
train
Set Cached Action Row
[ 30522, 2797, 10763, 3853, 2275, 3540, 7690, 18908, 3258, 10524, 1006, 1002, 16096, 7542, 1010, 1002, 2895, 13874, 1010, 1002, 2895, 10524, 1007, 1063, 1002, 17053, 20470, 2884, 1027, 2969, 1024, 1024, 2131, 3540, 7690, 18908, 3258, 10524, 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/Pagination/UrlWindow.php
UrlWindow.getSliderTooCloseToEnding
protected function getSliderTooCloseToEnding($window) { $last = $this->paginator->getUrlRange( $this->lastPage() - ($window + 2), $this->lastPage() ); return [ 'first' => $this->getStart(), 'slider' => null, 'last' => $last, ]; }
php
protected function getSliderTooCloseToEnding($window) { $last = $this->paginator->getUrlRange( $this->lastPage() - ($window + 2), $this->lastPage() ); return [ 'first' => $this->getStart(), 'slider' => null, 'last' => $last, ]; }
[ "protected", "function", "getSliderTooCloseToEnding", "(", "$", "window", ")", "{", "$", "last", "=", "$", "this", "->", "paginator", "->", "getUrlRange", "(", "$", "this", "->", "lastPage", "(", ")", "-", "(", "$", "window", "+", "2", ")", ",", "$", ...
Get the slider of URLs when too close to ending of window. @param int $window @return array
[ "Get", "the", "slider", "of", "URLs", "when", "too", "close", "to", "ending", "of", "window", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Pagination/UrlWindow.php#L123-L135
train
Get Slider too close to ending
[ 30522, 5123, 3853, 4152, 24198, 5339, 9541, 20464, 9232, 3406, 18537, 1006, 1002, 3332, 1007, 1063, 1002, 2197, 1027, 1002, 2023, 1011, 1028, 6643, 20876, 4263, 1011, 1028, 2131, 3126, 20974, 22043, 1006, 1002, 2023, 1011, 1028, 2197, 13704...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/Repeater.php
Repeater.getLoadValueFromIndex
protected function getLoadValueFromIndex($index) { $loadValue = $this->getLoadValue(); if (!is_array($loadValue)) { $loadValue = []; } return array_get($loadValue, $index, []); }
php
protected function getLoadValueFromIndex($index) { $loadValue = $this->getLoadValue(); if (!is_array($loadValue)) { $loadValue = []; } return array_get($loadValue, $index, []); }
[ "protected", "function", "getLoadValueFromIndex", "(", "$", "index", ")", "{", "$", "loadValue", "=", "$", "this", "->", "getLoadValue", "(", ")", ";", "if", "(", "!", "is_array", "(", "$", "loadValue", ")", ")", "{", "$", "loadValue", "=", "[", "]", ...
Returns the load data at a given index. @param int $index
[ "Returns", "the", "load", "data", "at", "a", "given", "index", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/formwidgets/Repeater.php#L286-L294
train
Get Load Value From Index
[ 30522, 5123, 3853, 2131, 11066, 10175, 5657, 19699, 20936, 13629, 2595, 1006, 1002, 5950, 1007, 1063, 1002, 7170, 10175, 5657, 1027, 1002, 2023, 1011, 1028, 2131, 11066, 10175, 5657, 1006, 1007, 1025, 2065, 1006, 999, 2003, 1035, 9140, 1006...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
plugins/CustomVariables/API.php
API.getDataTable
protected function getDataTable($idSite, $period, $date, $segment, $expanded, $flat, $idSubtable) { $dataTable = Archive::createDataTableFromArchive(Archiver::CUSTOM_VARIABLE_RECORD_NAME, $idSite, $period, $date, $segment, $expanded, $flat, $idSubtable); $dataTable->queueFilter('ColumnDelete', 'nb_uniq_visitors'); if ($flat) { $dataTable->filterSubtables('Sort', array(Metrics::INDEX_NB_ACTIONS, 'desc', $naturalSort = false, $expanded)); $dataTable->queueFilterSubtables('ColumnDelete', 'nb_uniq_visitors'); } return $dataTable; }
php
protected function getDataTable($idSite, $period, $date, $segment, $expanded, $flat, $idSubtable) { $dataTable = Archive::createDataTableFromArchive(Archiver::CUSTOM_VARIABLE_RECORD_NAME, $idSite, $period, $date, $segment, $expanded, $flat, $idSubtable); $dataTable->queueFilter('ColumnDelete', 'nb_uniq_visitors'); if ($flat) { $dataTable->filterSubtables('Sort', array(Metrics::INDEX_NB_ACTIONS, 'desc', $naturalSort = false, $expanded)); $dataTable->queueFilterSubtables('ColumnDelete', 'nb_uniq_visitors'); } return $dataTable; }
[ "protected", "function", "getDataTable", "(", "$", "idSite", ",", "$", "period", ",", "$", "date", ",", "$", "segment", ",", "$", "expanded", ",", "$", "flat", ",", "$", "idSubtable", ")", "{", "$", "dataTable", "=", "Archive", "::", "createDataTableFrom...
@param int $idSite @param string $period @param Date $date @param string $segment @param bool $expanded @param int $idSubtable @return DataTable|DataTable\Map
[ "@param", "int", "$idSite", "@param", "string", "$period", "@param", "Date", "$date", "@param", "string", "$segment", "@param", "bool", "$expanded", "@param", "int", "$idSubtable" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/CustomVariables/API.php#L37-L48
train
Get datatable for custom variable
[ 30522, 5123, 3853, 2131, 2850, 29336, 3085, 1006, 1002, 8909, 28032, 2063, 1010, 1002, 2558, 1010, 1002, 3058, 1010, 1002, 6903, 1010, 1002, 4423, 1010, 1002, 4257, 1010, 1002, 8909, 6342, 19279, 3085, 1007, 1063, 1002, 2951, 10880, 1027, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
octobercms/october
modules/system/helpers/DateTime.php
DateTime.timeTense
public static function timeTense($datetime) { $datetime = self::makeCarbon($datetime); $yesterday = $datetime->subDays(1); $tomorrow = $datetime->addDays(1); $time = $datetime->format('H:i'); $date = $datetime->format('j M Y'); if ($datetime->isToday()) { $date = 'Today'; } elseif ($datetime->isYesterday()) { $date = 'Yesterday'; } elseif ($datetime->isTomorrow()) { $date = 'Tomorrow'; } return $date.' at '.$time; }
php
public static function timeTense($datetime) { $datetime = self::makeCarbon($datetime); $yesterday = $datetime->subDays(1); $tomorrow = $datetime->addDays(1); $time = $datetime->format('H:i'); $date = $datetime->format('j M Y'); if ($datetime->isToday()) { $date = 'Today'; } elseif ($datetime->isYesterday()) { $date = 'Yesterday'; } elseif ($datetime->isTomorrow()) { $date = 'Tomorrow'; } return $date.' at '.$time; }
[ "public", "static", "function", "timeTense", "(", "$", "datetime", ")", "{", "$", "datetime", "=", "self", "::", "makeCarbon", "(", "$", "datetime", ")", ";", "$", "yesterday", "=", "$", "datetime", "->", "subDays", "(", "1", ")", ";", "$", "tomorrow",...
Returns 24-hour time and the day using the grammatical tense of the current time. Eg: Today at 12:49, Yesterday at 4:00 or 18 Sep 2015 at 14:33. @return string
[ "Returns", "24", "-", "hour", "time", "and", "the", "day", "using", "the", "grammatical", "tense", "of", "the", "current", "time", ".", "Eg", ":", "Today", "at", "12", ":", "49", "Yesterday", "at", "4", ":", "00", "or", "18", "Sep", "2015", "at", "...
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/helpers/DateTime.php#L28-L47
train
Returns a string representation of a datetime
[ 30522, 2270, 10763, 3853, 2051, 25808, 2063, 1006, 1002, 3058, 7292, 1007, 1063, 1002, 3058, 7292, 1027, 2969, 1024, 1024, 2191, 26190, 1006, 1002, 3058, 7292, 1007, 1025, 1002, 7483, 1027, 1002, 3058, 7292, 1011, 1028, 4942, 10259, 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...
symfony/symfony
src/Symfony/Component/Config/Definition/Builder/ExprBuilder.php
ExprBuilder.always
public function always(\Closure $then = null) { $this->ifPart = function ($v) { return true; }; if (null !== $then) { $this->thenPart = $then; } return $this; }
php
public function always(\Closure $then = null) { $this->ifPart = function ($v) { return true; }; if (null !== $then) { $this->thenPart = $then; } return $this; }
[ "public", "function", "always", "(", "\\", "Closure", "$", "then", "=", "null", ")", "{", "$", "this", "->", "ifPart", "=", "function", "(", "$", "v", ")", "{", "return", "true", ";", "}", ";", "if", "(", "null", "!==", "$", "then", ")", "{", "...
Marks the expression as being always used. @return $this
[ "Marks", "the", "expression", "as", "being", "always", "used", "." ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Config/Definition/Builder/ExprBuilder.php#L38-L47
train
Set the ifPart and thenPart
[ 30522, 2270, 3853, 2467, 1006, 1032, 8503, 1002, 2059, 1027, 19701, 1007, 1063, 1002, 2023, 1011, 1028, 2065, 19362, 2102, 1027, 3853, 1006, 1002, 1058, 1007, 1063, 2709, 2995, 1025, 1065, 1025, 2065, 1006, 19701, 999, 1027, 1027, 1002, 2...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
laravel/framework
src/Illuminate/Http/Resources/CollectsResources.php
CollectsResources.collects
protected function collects() { if ($this->collects) { return $this->collects; } if (Str::endsWith(class_basename($this), 'Collection') && class_exists($class = Str::replaceLast('Collection', '', get_class($this)))) { return $class; } }
php
protected function collects() { if ($this->collects) { return $this->collects; } if (Str::endsWith(class_basename($this), 'Collection') && class_exists($class = Str::replaceLast('Collection', '', get_class($this)))) { return $class; } }
[ "protected", "function", "collects", "(", ")", "{", "if", "(", "$", "this", "->", "collects", ")", "{", "return", "$", "this", "->", "collects", ";", "}", "if", "(", "Str", "::", "endsWith", "(", "class_basename", "(", "$", "this", ")", ",", "'Collec...
Get the resource that this resource collects. @return string|null
[ "Get", "the", "resource", "that", "this", "resource", "collects", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Http/Resources/CollectsResources.php#L38-L48
train
Get the class that contains the Collection
[ 30522, 5123, 3853, 17427, 1006, 1007, 1063, 2065, 1006, 1002, 2023, 1011, 1028, 17427, 1007, 1063, 2709, 1002, 2023, 1011, 1028, 17427, 1025, 1065, 2065, 1006, 2358, 2099, 1024, 1024, 4515, 24415, 1006, 2465, 1035, 2918, 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...
overtrue/wechat
src/Payment/Notify/Handler.php
Handler.decryptMessage
public function decryptMessage(string $key) { $message = $this->getMessage(); if (empty($message[$key])) { return null; } return Support\AES::decrypt( base64_decode($message[$key], true), md5($this->app['config']->key), '', OPENSSL_RAW_DATA, 'AES-256-ECB' ); }
php
public function decryptMessage(string $key) { $message = $this->getMessage(); if (empty($message[$key])) { return null; } return Support\AES::decrypt( base64_decode($message[$key], true), md5($this->app['config']->key), '', OPENSSL_RAW_DATA, 'AES-256-ECB' ); }
[ "public", "function", "decryptMessage", "(", "string", "$", "key", ")", "{", "$", "message", "=", "$", "this", "->", "getMessage", "(", ")", ";", "if", "(", "empty", "(", "$", "message", "[", "$", "key", "]", ")", ")", "{", "return", "null", ";", ...
Decrypt message. @param string $key @return string|null @throws \EasyWeChat\Kernel\Exceptions\Exception
[ "Decrypt", "message", "." ]
120c72faaa93c270365bc75c73c362d5fd583209
https://github.com/overtrue/wechat/blob/120c72faaa93c270365bc75c73c362d5fd583209/src/Payment/Notify/Handler.php#L160-L170
train
Decrypt message by key
[ 30522, 2270, 3853, 11703, 2854, 13876, 7834, 3736, 3351, 1006, 5164, 1002, 3145, 1007, 1063, 1002, 4471, 1027, 1002, 2023, 1011, 1028, 2131, 7834, 3736, 3351, 1006, 1007, 1025, 2065, 1006, 4064, 1006, 1002, 4471, 1031, 1002, 3145, 1033, 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/Mime/Encoder/QpEncoder.php
QpEncoder.encodeString
public function encodeString(string $string, ?string $charset = 'utf-8', int $firstLineOffset = 0, int $maxLineLength = 0): string { if ($maxLineLength > 76 || $maxLineLength <= 0) { $maxLineLength = 76; } $thisLineLength = $maxLineLength - $firstLineOffset; $lines = []; $lNo = 0; $lines[$lNo] = ''; $currentLine = &$lines[$lNo++]; $size = $lineLen = 0; $charStream = new CharacterStream($string, $charset); // Fetching more than 4 chars at one is slower, as is fetching fewer bytes // Conveniently 4 chars is the UTF-8 safe number since UTF-8 has up to 6 // bytes per char and (6 * 4 * 3 = 72 chars per line) * =NN is 3 bytes while (null !== $bytes = $charStream->readBytes(4)) { $enc = $this->encodeByteSequence($bytes, $size); $i = strpos($enc, '=0D=0A'); $newLineLength = $lineLen + (false === $i ? $size : $i); if ($currentLine && $newLineLength >= $thisLineLength) { $lines[$lNo] = ''; $currentLine = &$lines[$lNo++]; $thisLineLength = $maxLineLength; $lineLen = 0; } $currentLine .= $enc; if (false === $i) { $lineLen += $size; } else { // 6 is the length of '=0D=0A'. $lineLen = $size - strrpos($enc, '=0D=0A') - 6; } } return $this->standardize(implode("=\r\n", $lines)); }
php
public function encodeString(string $string, ?string $charset = 'utf-8', int $firstLineOffset = 0, int $maxLineLength = 0): string { if ($maxLineLength > 76 || $maxLineLength <= 0) { $maxLineLength = 76; } $thisLineLength = $maxLineLength - $firstLineOffset; $lines = []; $lNo = 0; $lines[$lNo] = ''; $currentLine = &$lines[$lNo++]; $size = $lineLen = 0; $charStream = new CharacterStream($string, $charset); // Fetching more than 4 chars at one is slower, as is fetching fewer bytes // Conveniently 4 chars is the UTF-8 safe number since UTF-8 has up to 6 // bytes per char and (6 * 4 * 3 = 72 chars per line) * =NN is 3 bytes while (null !== $bytes = $charStream->readBytes(4)) { $enc = $this->encodeByteSequence($bytes, $size); $i = strpos($enc, '=0D=0A'); $newLineLength = $lineLen + (false === $i ? $size : $i); if ($currentLine && $newLineLength >= $thisLineLength) { $lines[$lNo] = ''; $currentLine = &$lines[$lNo++]; $thisLineLength = $maxLineLength; $lineLen = 0; } $currentLine .= $enc; if (false === $i) { $lineLen += $size; } else { // 6 is the length of '=0D=0A'. $lineLen = $size - strrpos($enc, '=0D=0A') - 6; } } return $this->standardize(implode("=\r\n", $lines)); }
[ "public", "function", "encodeString", "(", "string", "$", "string", ",", "?", "string", "$", "charset", "=", "'utf-8'", ",", "int", "$", "firstLineOffset", "=", "0", ",", "int", "$", "maxLineLength", "=", "0", ")", ":", "string", "{", "if", "(", "$", ...
{@inheritdoc} Takes an unencoded string and produces a QP encoded string from it. QP encoded strings have a maximum line length of 76 characters. If the first line needs to be shorter, indicate the difference with $firstLineOffset.
[ "{", "@inheritdoc", "}" ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Mime/Encoder/QpEncoder.php#L119-L161
train
Encodes a string to UTF - 8
[ 30522, 2270, 3853, 4372, 23237, 18886, 3070, 1006, 5164, 1002, 5164, 1010, 1029, 5164, 1002, 25869, 13462, 1027, 1005, 21183, 2546, 1011, 1022, 1005, 1010, 20014, 1002, 2034, 4179, 27475, 3388, 1027, 1014, 1010, 20014, 1002, 4098, 4179, 777...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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.getConfiguredUrls
public static function getConfiguredUrls() { $result = array(); foreach (self::$urlOptions as $key => $optionName) { $result[$key] = Option::get($optionName); } return $result; }
php
public static function getConfiguredUrls() { $result = array(); foreach (self::$urlOptions as $key => $optionName) { $result[$key] = Option::get($optionName); } return $result; }
[ "public", "static", "function", "getConfiguredUrls", "(", ")", "{", "$", "result", "=", "array", "(", ")", ";", "foreach", "(", "self", "::", "$", "urlOptions", "as", "$", "key", "=>", "$", "optionName", ")", "{", "$", "result", "[", "$", "key", "]",...
Retrieves the URLs used to update various GeoIP 2 database files. @return array
[ "Retrieves", "the", "URLs", "used", "to", "update", "various", "GeoIP", "2", "database", "files", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/GeoIp2/GeoIP2AutoUpdater.php#L376-L383
train
Get all the URLs that are configured in the options array
[ 30522, 2270, 10763, 3853, 2131, 8663, 8873, 27390, 2098, 3126, 4877, 1006, 1007, 1063, 1002, 2765, 1027, 9140, 1006, 1007, 1025, 18921, 6776, 1006, 2969, 1024, 1024, 1002, 24471, 4135, 16790, 2015, 2004, 1002, 3145, 1027, 1028, 1002, 5724, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
overtrue/wechat
src/Kernel/Log/LogManager.php
LogManager.createDailyDriver
protected function createDailyDriver(array $config) { return new Monolog($this->parseChannel($config), [ $this->prepareHandler(new RotatingFileHandler( $config['path'], $config['days'] ?? 7, $this->level($config) )), ]); }
php
protected function createDailyDriver(array $config) { return new Monolog($this->parseChannel($config), [ $this->prepareHandler(new RotatingFileHandler( $config['path'], $config['days'] ?? 7, $this->level($config) )), ]); }
[ "protected", "function", "createDailyDriver", "(", "array", "$", "config", ")", "{", "return", "new", "Monolog", "(", "$", "this", "->", "parseChannel", "(", "$", "config", ")", ",", "[", "$", "this", "->", "prepareHandler", "(", "new", "RotatingFileHandler"...
Create an instance of the daily file log driver. @param array $config @return \Psr\Log\LoggerInterface
[ "Create", "an", "instance", "of", "the", "daily", "file", "log", "driver", "." ]
120c72faaa93c270365bc75c73c362d5fd583209
https://github.com/overtrue/wechat/blob/120c72faaa93c270365bc75c73c362d5fd583209/src/Kernel/Log/LogManager.php#L231-L238
train
Create daily log driver
[ 30522, 5123, 3853, 2580, 12502, 25688, 24352, 1006, 9140, 1002, 9530, 8873, 2290, 1007, 1063, 2709, 2047, 18847, 21197, 1006, 1002, 2023, 1011, 1028, 11968, 3366, 26058, 1006, 1002, 9530, 8873, 2290, 1007, 1010, 1031, 1002, 2023, 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/Cache/MemcachedLock.php
MemcachedLock.acquire
public function acquire() { return $this->memcached->add( $this->name, $this->owner, $this->seconds ); }
php
public function acquire() { return $this->memcached->add( $this->name, $this->owner, $this->seconds ); }
[ "public", "function", "acquire", "(", ")", "{", "return", "$", "this", "->", "memcached", "->", "add", "(", "$", "this", "->", "name", ",", "$", "this", "->", "owner", ",", "$", "this", "->", "seconds", ")", ";", "}" ]
Attempt to acquire the lock. @return bool
[ "Attempt", "to", "acquire", "the", "lock", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Cache/MemcachedLock.php#L35-L40
train
Acquire the cache entry
[ 30522, 2270, 3853, 9878, 1006, 1007, 1063, 2709, 1002, 2023, 1011, 1028, 2033, 12458, 15395, 2094, 1011, 1028, 5587, 1006, 1002, 2023, 1011, 1028, 2171, 1010, 1002, 2023, 1011, 1028, 3954, 1010, 1002, 2023, 1011, 1028, 3823, 1007, 1025, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
plugins/Annotations/Controller.php
Controller.saveAnnotation
public function saveAnnotation() { if ($_SERVER["REQUEST_METHOD"] == "POST") { $this->checkTokenInUrl(); $view = new View('@Annotations/saveAnnotation'); // NOTE: permissions checked in API method // save the annotation $view->annotation = Request::processRequest("Annotations.save"); return $view->render(); } }
php
public function saveAnnotation() { if ($_SERVER["REQUEST_METHOD"] == "POST") { $this->checkTokenInUrl(); $view = new View('@Annotations/saveAnnotation'); // NOTE: permissions checked in API method // save the annotation $view->annotation = Request::processRequest("Annotations.save"); return $view->render(); } }
[ "public", "function", "saveAnnotation", "(", ")", "{", "if", "(", "$", "_SERVER", "[", "\"REQUEST_METHOD\"", "]", "==", "\"POST\"", ")", "{", "$", "this", "->", "checkTokenInUrl", "(", ")", ";", "$", "view", "=", "new", "View", "(", "'@Annotations/saveAnno...
Controller action that modifies an annotation and returns HTML displaying the modified annotation. Query Param Input: - idSite: The ID of the site the annotation belongs to. Only one ID is allowed. - idNote: The ID of the annotation. - date: The new date value for the annotation. (optional) - note: The new text for the annotation. (optional) - starred: Either 1 or 0. Whether the note should be starred or not. (optional) Output: - HTML displaying modified annotation. If an optional query param is not supplied, that part of the annotation is not modified.
[ "Controller", "action", "that", "modifies", "an", "annotation", "and", "returns", "HTML", "displaying", "the", "modified", "annotation", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Annotations/Controller.php#L106-L119
train
Save annotation to database
[ 30522, 2270, 3853, 3828, 11639, 17287, 3508, 1006, 1007, 1063, 2065, 1006, 1002, 1035, 8241, 1031, 1000, 5227, 1035, 4118, 1000, 1033, 1027, 1027, 1000, 2695, 1000, 1007, 1063, 1002, 2023, 1011, 1028, 4638, 18715, 18595, 11231, 12190, 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
core/Settings/Storage/Backend/MeasurableSettingsTable.php
MeasurableSettingsTable.save
public function save($values) { $this->initDbIfNeeded(); $table = $this->getTableName(); $this->delete(); foreach ($values as $name => $value) { if (!isset($value)) { continue; } if (is_array($value) || is_object($value)) { $jsonEncoded = 1; $value = json_encode($value); } else { $jsonEncoded = 0; if (is_bool($value)) { // we are currently not storing booleans as json as it could result in trouble with the UI and regress // preselecting the correct value $value = (int) $value; } } $sql = "INSERT INTO $table (`idsite`, `plugin_name`, `setting_name`, `setting_value`, `json_encoded`) VALUES (?, ?, ?, ?, ?)"; $bind = array($this->idSite, $this->pluginName, $name, $value, $jsonEncoded); $this->db->query($sql, $bind); } }
php
public function save($values) { $this->initDbIfNeeded(); $table = $this->getTableName(); $this->delete(); foreach ($values as $name => $value) { if (!isset($value)) { continue; } if (is_array($value) || is_object($value)) { $jsonEncoded = 1; $value = json_encode($value); } else { $jsonEncoded = 0; if (is_bool($value)) { // we are currently not storing booleans as json as it could result in trouble with the UI and regress // preselecting the correct value $value = (int) $value; } } $sql = "INSERT INTO $table (`idsite`, `plugin_name`, `setting_name`, `setting_value`, `json_encoded`) VALUES (?, ?, ?, ?, ?)"; $bind = array($this->idSite, $this->pluginName, $name, $value, $jsonEncoded); $this->db->query($sql, $bind); } }
[ "public", "function", "save", "(", "$", "values", ")", "{", "$", "this", "->", "initDbIfNeeded", "(", ")", ";", "$", "table", "=", "$", "this", "->", "getTableName", "(", ")", ";", "$", "this", "->", "delete", "(", ")", ";", "foreach", "(", "$", ...
Saves (persists) the current setting values in the database.
[ "Saves", "(", "persists", ")", "the", "current", "setting", "values", "in", "the", "database", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Settings/Storage/Backend/MeasurableSettingsTable.php#L73-L103
train
Save the settings to the database
[ 30522, 2270, 3853, 3828, 1006, 1002, 5300, 1007, 1063, 1002, 2023, 1011, 1028, 1999, 4183, 18939, 10128, 24045, 5732, 1006, 1007, 1025, 1002, 2795, 1027, 1002, 2023, 1011, 1028, 2131, 10880, 18442, 1006, 1007, 1025, 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...
octobercms/october
modules/backend/classes/Controller.php
Controller.actionUrl
public function actionUrl($action = null, $path = null) { if ($action === null) { $action = $this->action; } $class = get_called_class(); $uriPath = dirname(dirname(strtolower(str_replace('\\', '/', $class)))); $controllerName = strtolower(class_basename($class)); $url = $uriPath.'/'.$controllerName.'/'.$action; if ($path) { $url .= '/'.$path; } return Backend::url($url); }
php
public function actionUrl($action = null, $path = null) { if ($action === null) { $action = $this->action; } $class = get_called_class(); $uriPath = dirname(dirname(strtolower(str_replace('\\', '/', $class)))); $controllerName = strtolower(class_basename($class)); $url = $uriPath.'/'.$controllerName.'/'.$action; if ($path) { $url .= '/'.$path; } return Backend::url($url); }
[ "public", "function", "actionUrl", "(", "$", "action", "=", "null", ",", "$", "path", "=", "null", ")", "{", "if", "(", "$", "action", "===", "null", ")", "{", "$", "action", "=", "$", "this", "->", "action", ";", "}", "$", "class", "=", "get_cal...
Returns a URL for this controller and supplied action.
[ "Returns", "a", "URL", "for", "this", "controller", "and", "supplied", "action", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/Controller.php#L299-L315
train
Return the action URL
[ 30522, 2270, 3853, 2895, 3126, 2140, 1006, 1002, 2895, 1027, 19701, 1010, 1002, 4130, 1027, 19701, 1007, 1063, 2065, 1006, 1002, 2895, 1027, 1027, 1027, 19701, 1007, 1063, 1002, 2895, 1027, 1002, 2023, 1011, 1028, 2895, 1025, 1065, 1002, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
core/Url.php
Url.isHostInUrls
public static function isHostInUrls($host, $urls) { if (empty($host)) { return false; } $host = Common::mb_strtolower($host); if (!empty($urls)) { foreach ($urls as $url) { if (Common::mb_strtolower($url) === $host) { return true; } $siteHost = self::getHostFromUrl($url); if ($siteHost === $host) { return true; } if (Common::stringEndsWith($siteHost, '.' . $host)) { // allow subdomains return true; } } } return in_array($host, self::getAlwaysTrustedHosts()); }
php
public static function isHostInUrls($host, $urls) { if (empty($host)) { return false; } $host = Common::mb_strtolower($host); if (!empty($urls)) { foreach ($urls as $url) { if (Common::mb_strtolower($url) === $host) { return true; } $siteHost = self::getHostFromUrl($url); if ($siteHost === $host) { return true; } if (Common::stringEndsWith($siteHost, '.' . $host)) { // allow subdomains return true; } } } return in_array($host, self::getAlwaysTrustedHosts()); }
[ "public", "static", "function", "isHostInUrls", "(", "$", "host", ",", "$", "urls", ")", "{", "if", "(", "empty", "(", "$", "host", ")", ")", "{", "return", "false", ";", "}", "$", "host", "=", "Common", "::", "mb_strtolower", "(", "$", "host", ")"...
Checks whether any of the given URLs has the given host. If not, we will also check whether any URL uses a subdomain of the given host. For instance if host is "example.com" and a URL is "http://www.example.com" we consider this as valid and return true. The always trusted hosts such as "127.0.0.1" are considered valid as well. @param $host @param $urls @return bool
[ "Checks", "whether", "any", "of", "the", "given", "URLs", "has", "the", "given", "host", ".", "If", "not", "we", "will", "also", "check", "whether", "any", "URL", "uses", "a", "subdomain", "of", "the", "given", "host", ".", "For", "instance", "if", "ho...
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Url.php#L663-L691
train
Returns true if the host is in the list of urls
[ 30522, 2270, 10763, 3853, 2003, 15006, 7629, 3126, 4877, 1006, 1002, 3677, 1010, 1002, 24471, 4877, 1007, 1063, 2065, 1006, 4064, 1006, 1002, 3677, 1007, 1007, 1063, 2709, 6270, 1025, 1065, 1002, 3677, 1027, 2691, 1024, 1024, 16914, 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...
slimphp/Slim
Slim/App.php
App.processInvalidMethod
protected function processInvalidMethod(ServerRequestInterface $request, ResponseInterface $response) { $router = $this->container->get('router'); if (is_callable([$request->getUri(), 'getBasePath']) && is_callable([$router, 'setBasePath'])) { $router->setBasePath($request->getUri()->getBasePath()); } $request = $this->dispatchRouterAndPrepareRoute($request, $router); $routeInfo = $request->getAttribute('routeInfo', [RouterInterface::DISPATCH_STATUS => Dispatcher::NOT_FOUND]); if ($routeInfo[RouterInterface::DISPATCH_STATUS] === Dispatcher::METHOD_NOT_ALLOWED) { return $this->handleException( new MethodNotAllowedException($request, $response, $routeInfo[RouterInterface::ALLOWED_METHODS]), $request, $response ); } return $this->handleException(new NotFoundException($request, $response), $request, $response); }
php
protected function processInvalidMethod(ServerRequestInterface $request, ResponseInterface $response) { $router = $this->container->get('router'); if (is_callable([$request->getUri(), 'getBasePath']) && is_callable([$router, 'setBasePath'])) { $router->setBasePath($request->getUri()->getBasePath()); } $request = $this->dispatchRouterAndPrepareRoute($request, $router); $routeInfo = $request->getAttribute('routeInfo', [RouterInterface::DISPATCH_STATUS => Dispatcher::NOT_FOUND]); if ($routeInfo[RouterInterface::DISPATCH_STATUS] === Dispatcher::METHOD_NOT_ALLOWED) { return $this->handleException( new MethodNotAllowedException($request, $response, $routeInfo[RouterInterface::ALLOWED_METHODS]), $request, $response ); } return $this->handleException(new NotFoundException($request, $response), $request, $response); }
[ "protected", "function", "processInvalidMethod", "(", "ServerRequestInterface", "$", "request", ",", "ResponseInterface", "$", "response", ")", "{", "$", "router", "=", "$", "this", "->", "container", "->", "get", "(", "'router'", ")", ";", "if", "(", "is_call...
Pull route info for a request with a bad method to decide whether to return a not-found error (default) or a bad-method error, then run the handler for that error, returning the resulting response. Used for cases where an incoming request has an unrecognized method, rather than throwing an exception and not catching it all the way up. @param ServerRequestInterface $request @param ResponseInterface $response @return ResponseInterface @throws ContainerException
[ "Pull", "route", "info", "for", "a", "request", "with", "a", "bad", "method", "to", "decide", "whether", "to", "return", "a", "not", "-", "found", "error", "(", "default", ")", "or", "a", "bad", "-", "method", "error", "then", "run", "the", "handler", ...
ccef5f7d8bcd469d59cbe64f6210d83764f91543
https://github.com/slimphp/Slim/blob/ccef5f7d8bcd469d59cbe64f6210d83764f91543/Slim/App.php#L341-L360
train
Process invalid method
[ 30522, 5123, 3853, 2832, 2378, 10175, 3593, 11368, 6806, 2094, 1006, 8241, 2890, 15500, 18447, 2121, 12172, 1002, 5227, 1010, 3433, 18447, 2121, 12172, 1002, 3433, 1007, 1063, 1002, 2799, 2099, 1027, 1002, 2023, 1011, 1028, 11661, 1011, 102...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
octobercms/october
modules/cms/widgets/AssetList.php
AssetList.checkUploadPostback
protected function checkUploadPostback() { $fileName = null; try { $uploadedFile = Input::file('file_data'); if (!is_object($uploadedFile)) { return; } $fileName = $uploadedFile->getClientOriginalName(); /* * Check valid upload */ if (!$uploadedFile->isValid()) { throw new ApplicationException(Lang::get('cms::lang.asset.file_not_valid')); } /* * Check file size */ $maxSize = UploadedFile::getMaxFilesize(); if ($uploadedFile->getSize() > $maxSize) { throw new ApplicationException(Lang::get( 'cms::lang.asset.too_large', ['max_size' => File::sizeToString($maxSize)] )); } /* * Check for valid file extensions */ if (!$this->validateFileType($fileName)) { throw new ApplicationException(Lang::get( 'cms::lang.asset.type_not_allowed', ['allowed_types' => implode(', ', $this->assetExtensions)] )); } /* * Accept the uploaded file */ $uploadedFile->move($this->getCurrentPath(), $uploadedFile->getClientOriginalName()); die('success'); } catch (Exception $ex) { $message = $fileName !== null ? Lang::get('cms::lang.asset.error_uploading_file', ['name' => $fileName, 'error' => $ex->getMessage()]) : $ex->getMessage(); die($message); } }
php
protected function checkUploadPostback() { $fileName = null; try { $uploadedFile = Input::file('file_data'); if (!is_object($uploadedFile)) { return; } $fileName = $uploadedFile->getClientOriginalName(); /* * Check valid upload */ if (!$uploadedFile->isValid()) { throw new ApplicationException(Lang::get('cms::lang.asset.file_not_valid')); } /* * Check file size */ $maxSize = UploadedFile::getMaxFilesize(); if ($uploadedFile->getSize() > $maxSize) { throw new ApplicationException(Lang::get( 'cms::lang.asset.too_large', ['max_size' => File::sizeToString($maxSize)] )); } /* * Check for valid file extensions */ if (!$this->validateFileType($fileName)) { throw new ApplicationException(Lang::get( 'cms::lang.asset.type_not_allowed', ['allowed_types' => implode(', ', $this->assetExtensions)] )); } /* * Accept the uploaded file */ $uploadedFile->move($this->getCurrentPath(), $uploadedFile->getClientOriginalName()); die('success'); } catch (Exception $ex) { $message = $fileName !== null ? Lang::get('cms::lang.asset.error_uploading_file', ['name' => $fileName, 'error' => $ex->getMessage()]) : $ex->getMessage(); die($message); } }
[ "protected", "function", "checkUploadPostback", "(", ")", "{", "$", "fileName", "=", "null", ";", "try", "{", "$", "uploadedFile", "=", "Input", "::", "file", "(", "'file_data'", ")", ";", "if", "(", "!", "is_object", "(", "$", "uploadedFile", ")", ")", ...
Checks the current request to see if it is a postback containing a file upload for this particular widget.
[ "Checks", "the", "current", "request", "to", "see", "if", "it", "is", "a", "postback", "containing", "a", "file", "upload", "for", "this", "particular", "widget", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/widgets/AssetList.php#L618-L673
train
Check upload postback
[ 30522, 5123, 3853, 4638, 6279, 11066, 19894, 5963, 1006, 1007, 1063, 1002, 5371, 18442, 1027, 19701, 1025, 3046, 1063, 1002, 21345, 8873, 2571, 1027, 7953, 1024, 1024, 5371, 1006, 1005, 5371, 1035, 2951, 1005, 1007, 1025, 2065, 1006, 999, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/DBStats/MySQLMetadataProvider.php
MySQLMetadataProvider.reduceArchiveRowName
public function reduceArchiveRowName($name) { // all 'done...' fields are considered the same if (strpos($name, 'done') === 0) { return 'done'; } // check for goal id, if present (Goals_... reports should not be reduced here, just Goal_... ones) if (preg_match("/^Goal_(?:-?[0-9]+_)?(.*)/", $name, $matches)) { $name = "Goal_*_" . $matches[1]; } // remove subtable id suffix, if present if (preg_match("/^(.*)_[0-9]+$/", $name, $matches)) { $name = $matches[1] . "_*"; } return $name; }
php
public function reduceArchiveRowName($name) { // all 'done...' fields are considered the same if (strpos($name, 'done') === 0) { return 'done'; } // check for goal id, if present (Goals_... reports should not be reduced here, just Goal_... ones) if (preg_match("/^Goal_(?:-?[0-9]+_)?(.*)/", $name, $matches)) { $name = "Goal_*_" . $matches[1]; } // remove subtable id suffix, if present if (preg_match("/^(.*)_[0-9]+$/", $name, $matches)) { $name = $matches[1] . "_*"; } return $name; }
[ "public", "function", "reduceArchiveRowName", "(", "$", "name", ")", "{", "// all 'done...' fields are considered the same", "if", "(", "strpos", "(", "$", "name", ",", "'done'", ")", "===", "0", ")", "{", "return", "'done'", ";", "}", "// check for goal id, if pr...
Reduces the given metric name. Used to simplify certain reports. Some metrics, like goal metrics, can have different string names. For goal metrics, there's one name per goal ID. Grouping metrics and reports like these together simplifies the tables that display them. This function makes goal names, 'done...' names and names of the format .*_[0-9]+ equivalent.
[ "Reduces", "the", "given", "metric", "name", ".", "Used", "to", "simplify", "certain", "reports", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/DBStats/MySQLMetadataProvider.php#L323-L341
train
Reduce archive row name
[ 30522, 2270, 3853, 5547, 2906, 5428, 6299, 12384, 14074, 1006, 1002, 2171, 1007, 1063, 1013, 1013, 2035, 1005, 2589, 1012, 1012, 1012, 1005, 4249, 2024, 2641, 1996, 2168, 2065, 1006, 2358, 14536, 2891, 1006, 1002, 2171, 1010, 1005, 2589, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
slimphp/Slim
Slim/App.php
App.handleException
protected function handleException(Exception $e, ServerRequestInterface $request, ResponseInterface $response) { if ($e instanceof MethodNotAllowedException) { $handler = 'notAllowedHandler'; $params = [$e->getRequest(), $e->getResponse(), $e->getAllowedMethods()]; } elseif ($e instanceof NotFoundException) { $handler = 'notFoundHandler'; $params = [$e->getRequest(), $e->getResponse(), $e]; } elseif ($e instanceof SlimException) { // This is a Stop exception and contains the response return $e->getResponse(); } else { // Other exception, use $request and $response params $handler = 'errorHandler'; $params = [$request, $response, $e]; } if ($this->container->has($handler)) { $callable = $this->container->get($handler); // Call the registered handler return call_user_func_array($callable, $params); } // No handlers found, so just throw the exception throw $e; }
php
protected function handleException(Exception $e, ServerRequestInterface $request, ResponseInterface $response) { if ($e instanceof MethodNotAllowedException) { $handler = 'notAllowedHandler'; $params = [$e->getRequest(), $e->getResponse(), $e->getAllowedMethods()]; } elseif ($e instanceof NotFoundException) { $handler = 'notFoundHandler'; $params = [$e->getRequest(), $e->getResponse(), $e]; } elseif ($e instanceof SlimException) { // This is a Stop exception and contains the response return $e->getResponse(); } else { // Other exception, use $request and $response params $handler = 'errorHandler'; $params = [$request, $response, $e]; } if ($this->container->has($handler)) { $callable = $this->container->get($handler); // Call the registered handler return call_user_func_array($callable, $params); } // No handlers found, so just throw the exception throw $e; }
[ "protected", "function", "handleException", "(", "Exception", "$", "e", ",", "ServerRequestInterface", "$", "request", ",", "ResponseInterface", "$", "response", ")", "{", "if", "(", "$", "e", "instanceof", "MethodNotAllowedException", ")", "{", "$", "handler", ...
Call relevant handler from the Container if needed. If it doesn't exist, then just re-throw. @param Exception $e @param ServerRequestInterface $request @param ResponseInterface $response @return ResponseInterface @throws Exception If a handler is needed and not found
[ "Call", "relevant", "handler", "from", "the", "Container", "if", "needed", ".", "If", "it", "doesn", "t", "exist", "then", "just", "re", "-", "throw", "." ]
ccef5f7d8bcd469d59cbe64f6210d83764f91543
https://github.com/slimphp/Slim/blob/ccef5f7d8bcd469d59cbe64f6210d83764f91543/Slim/App.php#L681-L706
train
Handle an exception
[ 30522, 5123, 3853, 5047, 10288, 24422, 1006, 6453, 1002, 1041, 1010, 8241, 2890, 15500, 18447, 2121, 12172, 1002, 5227, 1010, 3433, 18447, 2121, 12172, 1002, 3433, 1007, 1063, 2065, 1006, 1002, 1041, 6013, 11253, 4118, 17048, 8095, 15096, 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/formwidgets/FileUpload.php
FileUpload.prepareVars
protected function prepareVars() { if ($this->formField->disabled) { $this->previewMode = true; } if ($this->previewMode) { $this->useCaption = false; } $this->vars['fileList'] = $fileList = $this->getFileList(); $this->vars['singleFile'] = $fileList->first(); $this->vars['displayMode'] = $this->getDisplayMode(); $this->vars['emptyIcon'] = $this->getConfig('emptyIcon', 'icon-upload'); $this->vars['imageHeight'] = $this->imageHeight; $this->vars['imageWidth'] = $this->imageWidth; $this->vars['acceptedFileTypes'] = $this->getAcceptedFileTypes(true); $this->vars['cssDimensions'] = $this->getCssDimensions(); $this->vars['cssBlockDimensions'] = $this->getCssDimensions('block'); $this->vars['useCaption'] = $this->useCaption; $this->vars['prompt'] = $this->getPromptText(); }
php
protected function prepareVars() { if ($this->formField->disabled) { $this->previewMode = true; } if ($this->previewMode) { $this->useCaption = false; } $this->vars['fileList'] = $fileList = $this->getFileList(); $this->vars['singleFile'] = $fileList->first(); $this->vars['displayMode'] = $this->getDisplayMode(); $this->vars['emptyIcon'] = $this->getConfig('emptyIcon', 'icon-upload'); $this->vars['imageHeight'] = $this->imageHeight; $this->vars['imageWidth'] = $this->imageWidth; $this->vars['acceptedFileTypes'] = $this->getAcceptedFileTypes(true); $this->vars['cssDimensions'] = $this->getCssDimensions(); $this->vars['cssBlockDimensions'] = $this->getCssDimensions('block'); $this->vars['useCaption'] = $this->useCaption; $this->vars['prompt'] = $this->getPromptText(); }
[ "protected", "function", "prepareVars", "(", ")", "{", "if", "(", "$", "this", "->", "formField", "->", "disabled", ")", "{", "$", "this", "->", "previewMode", "=", "true", ";", "}", "if", "(", "$", "this", "->", "previewMode", ")", "{", "$", "this",...
Prepares the view data
[ "Prepares", "the", "view", "data" ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/formwidgets/FileUpload.php#L122-L143
train
Prepares the variables for the view
[ 30522, 5123, 3853, 7374, 10755, 2015, 1006, 1007, 1063, 2065, 1006, 1002, 2023, 1011, 1028, 2433, 3790, 1011, 1028, 9776, 1007, 1063, 1002, 2023, 1011, 1028, 19236, 5302, 3207, 1027, 2995, 1025, 1065, 2065, 1006, 1002, 2023, 1011, 1028, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
laravel/framework
src/Illuminate/Queue/Console/WorkCommand.php
WorkCommand.gatherWorkerOptions
protected function gatherWorkerOptions() { return new WorkerOptions( $this->option('delay'), $this->option('memory'), $this->option('timeout'), $this->option('sleep'), $this->option('tries'), $this->option('force'), $this->option('stop-when-empty') ); }
php
protected function gatherWorkerOptions() { return new WorkerOptions( $this->option('delay'), $this->option('memory'), $this->option('timeout'), $this->option('sleep'), $this->option('tries'), $this->option('force'), $this->option('stop-when-empty') ); }
[ "protected", "function", "gatherWorkerOptions", "(", ")", "{", "return", "new", "WorkerOptions", "(", "$", "this", "->", "option", "(", "'delay'", ")", ",", "$", "this", "->", "option", "(", "'memory'", ")", ",", "$", "this", "->", "option", "(", "'timeo...
Gather all of the queue worker options as a single object. @return \Illuminate\Queue\WorkerOptions
[ "Gather", "all", "of", "the", "queue", "worker", "options", "as", "a", "single", "object", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Queue/Console/WorkCommand.php#L111-L119
train
Gathers worker options
[ 30522, 5123, 3853, 8587, 6198, 10624, 16790, 2015, 1006, 1007, 1063, 2709, 2047, 7309, 7361, 9285, 1006, 1002, 2023, 1011, 1028, 5724, 1006, 1005, 8536, 1005, 1007, 1010, 1002, 2023, 1011, 1028, 5724, 1006, 1005, 3638, 1005, 1007, 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/SitesManager/API.php
API.updateSite
public function updateSite($idSite, $siteName = null, $urls = null, $ecommerce = null, $siteSearch = null, $searchKeywordParameters = null, $searchCategoryParameters = null, $excludedIps = null, $excludedQueryParameters = null, $timezone = null, $currency = null, $group = null, $startDate = null, $excludedUserAgents = null, $keepURLFragments = null, $type = null, $settingValues = null, $excludeUnknownUrls = null) { Piwik::checkUserHasAdminAccess($idSite); $idSites = $this->getSitesId(); if (!in_array($idSite, $idSites)) { throw new Exception("website id = $idSite not found"); } // Build the SQL UPDATE based on specified updates to perform $bind = array(); if (!is_null($siteName)) { $this->checkName($siteName); $bind['name'] = $siteName; } if (!isset($settingValues)) { $settingValues = array(); } if (empty($coreProperties)) { $coreProperties = array(); } $coreProperties = $this->setSettingValue('urls', $urls, $coreProperties, $settingValues); $coreProperties = $this->setSettingValue('group', $group, $coreProperties, $settingValues); $coreProperties = $this->setSettingValue('ecommerce', $ecommerce, $coreProperties, $settingValues); $coreProperties = $this->setSettingValue('sitesearch', $siteSearch, $coreProperties, $settingValues); $coreProperties = $this->setSettingValue('sitesearch_keyword_parameters', explode(',', $searchKeywordParameters), $coreProperties, $settingValues); $coreProperties = $this->setSettingValue('sitesearch_category_parameters', explode(',', $searchCategoryParameters), $coreProperties, $settingValues); $coreProperties = $this->setSettingValue('keep_url_fragment', $keepURLFragments, $coreProperties, $settingValues); $coreProperties = $this->setSettingValue('exclude_unknown_urls', $excludeUnknownUrls, $coreProperties, $settingValues); $coreProperties = $this->setSettingValue('excluded_ips', explode(',', $excludedIps), $coreProperties, $settingValues); $coreProperties = $this->setSettingValue('excluded_parameters', explode(',', $excludedQueryParameters), $coreProperties, $settingValues); $coreProperties = $this->setSettingValue('excluded_user_agents', explode(',', $excludedUserAgents), $coreProperties, $settingValues); if (isset($currency)) { $currency = trim($currency); $this->checkValidCurrency($currency); $bind['currency'] = $currency; } if (isset($timezone)) { $timezone = trim($timezone); $this->checkValidTimezone($timezone); $bind['timezone'] = $timezone; } if (isset($group) && Piwik::hasUserSuperUserAccess() ) { $bind['group'] = trim($group); } if (isset($startDate)) { $bind['ts_created'] = Date::factory($startDate)->getDatetime(); } if (isset($type)) { $bind['type'] = $this->checkAndReturnType($type); } if (!empty($coreProperties)) { $this->setAndValidateMeasurableSettings($idSite, $idType = 'website', $coreProperties); } if (!empty($settingValues)) { $this->setAndValidateMeasurableSettings($idSite, $idType = null, $settingValues); } if (!empty($bind)) { $this->getModel()->updateSite($bind, $idSite); } if (!empty($coreProperties)) { $this->saveMeasurableSettings($idSite, $idType = 'website', $coreProperties); } if (!empty($settingValues)) { $this->saveMeasurableSettings($idSite, $idType = null, $settingValues); } $this->postUpdateWebsite($idSite); }
php
public function updateSite($idSite, $siteName = null, $urls = null, $ecommerce = null, $siteSearch = null, $searchKeywordParameters = null, $searchCategoryParameters = null, $excludedIps = null, $excludedQueryParameters = null, $timezone = null, $currency = null, $group = null, $startDate = null, $excludedUserAgents = null, $keepURLFragments = null, $type = null, $settingValues = null, $excludeUnknownUrls = null) { Piwik::checkUserHasAdminAccess($idSite); $idSites = $this->getSitesId(); if (!in_array($idSite, $idSites)) { throw new Exception("website id = $idSite not found"); } // Build the SQL UPDATE based on specified updates to perform $bind = array(); if (!is_null($siteName)) { $this->checkName($siteName); $bind['name'] = $siteName; } if (!isset($settingValues)) { $settingValues = array(); } if (empty($coreProperties)) { $coreProperties = array(); } $coreProperties = $this->setSettingValue('urls', $urls, $coreProperties, $settingValues); $coreProperties = $this->setSettingValue('group', $group, $coreProperties, $settingValues); $coreProperties = $this->setSettingValue('ecommerce', $ecommerce, $coreProperties, $settingValues); $coreProperties = $this->setSettingValue('sitesearch', $siteSearch, $coreProperties, $settingValues); $coreProperties = $this->setSettingValue('sitesearch_keyword_parameters', explode(',', $searchKeywordParameters), $coreProperties, $settingValues); $coreProperties = $this->setSettingValue('sitesearch_category_parameters', explode(',', $searchCategoryParameters), $coreProperties, $settingValues); $coreProperties = $this->setSettingValue('keep_url_fragment', $keepURLFragments, $coreProperties, $settingValues); $coreProperties = $this->setSettingValue('exclude_unknown_urls', $excludeUnknownUrls, $coreProperties, $settingValues); $coreProperties = $this->setSettingValue('excluded_ips', explode(',', $excludedIps), $coreProperties, $settingValues); $coreProperties = $this->setSettingValue('excluded_parameters', explode(',', $excludedQueryParameters), $coreProperties, $settingValues); $coreProperties = $this->setSettingValue('excluded_user_agents', explode(',', $excludedUserAgents), $coreProperties, $settingValues); if (isset($currency)) { $currency = trim($currency); $this->checkValidCurrency($currency); $bind['currency'] = $currency; } if (isset($timezone)) { $timezone = trim($timezone); $this->checkValidTimezone($timezone); $bind['timezone'] = $timezone; } if (isset($group) && Piwik::hasUserSuperUserAccess() ) { $bind['group'] = trim($group); } if (isset($startDate)) { $bind['ts_created'] = Date::factory($startDate)->getDatetime(); } if (isset($type)) { $bind['type'] = $this->checkAndReturnType($type); } if (!empty($coreProperties)) { $this->setAndValidateMeasurableSettings($idSite, $idType = 'website', $coreProperties); } if (!empty($settingValues)) { $this->setAndValidateMeasurableSettings($idSite, $idType = null, $settingValues); } if (!empty($bind)) { $this->getModel()->updateSite($bind, $idSite); } if (!empty($coreProperties)) { $this->saveMeasurableSettings($idSite, $idType = 'website', $coreProperties); } if (!empty($settingValues)) { $this->saveMeasurableSettings($idSite, $idType = null, $settingValues); } $this->postUpdateWebsite($idSite); }
[ "public", "function", "updateSite", "(", "$", "idSite", ",", "$", "siteName", "=", "null", ",", "$", "urls", "=", "null", ",", "$", "ecommerce", "=", "null", ",", "$", "siteSearch", "=", "null", ",", "$", "searchKeywordParameters", "=", "null", ",", "$...
Update an existing website. If only one URL is specified then only the main url will be updated. If several URLs are specified, both the main URL and the alias URLs will be updated. @param int $idSite website ID defining the website to edit @param string $siteName website name @param string|array $urls the website URLs When calling API via HTTP specify multiple URLs via `&urls[]=http...&urls[]=http...`. @param int $ecommerce Whether Ecommerce is enabled, 0 or 1 @param null|int $siteSearch Whether site search is enabled, 0 or 1 @param string $searchKeywordParameters Comma separated list of search keyword parameter names @param string $searchCategoryParameters Comma separated list of search category parameter names @param string $excludedIps Comma separated list of IPs to exclude from being tracked (allows wildcards) @param null|string $excludedQueryParameters @param string $timezone Timezone @param string $currency Currency code @param string $group Group name where this website belongs @param string $startDate Date at which the statistics for this website will start. Defaults to today's date in YYYY-MM-DD format @param null|string $excludedUserAgents @param int|null $keepURLFragments If 1, URL fragments will be kept when tracking. If 2, they will be removed. If 0, the default global behavior will be used. @param string $type The Website type, default value is "website" @param array|null $settingValues JSON serialized settings eg {settingName: settingValue, ...} @param bool|null $excludeUnknownUrls Track only URL matching one of website URLs @throws Exception @see getKeepURLFragmentsGlobal. If null, the existing value will not be modified. @return bool true on success
[ "Update", "an", "existing", "website", ".", "If", "only", "one", "URL", "is", "specified", "then", "only", "the", "main", "url", "will", "be", "updated", ".", "If", "several", "URLs", "are", "specified", "both", "the", "main", "URL", "and", "the", "alias...
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SitesManager/API.php#L1238-L1337
train
Update a website
[ 30522, 2270, 3853, 14409, 4221, 1006, 1002, 8909, 28032, 2063, 1010, 1002, 2609, 18442, 1027, 19701, 1010, 1002, 24471, 4877, 1027, 19701, 1010, 1002, 17338, 15810, 3401, 1027, 19701, 1010, 1002, 4573, 14644, 2818, 1027, 19701, 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...