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
laravel/framework
src/Illuminate/Database/Eloquent/Model.php
Model.insertAndSetId
protected function insertAndSetId(Builder $query, $attributes) { $id = $query->insertGetId($attributes, $keyName = $this->getKeyName()); $this->setAttribute($keyName, $id); }
php
protected function insertAndSetId(Builder $query, $attributes) { $id = $query->insertGetId($attributes, $keyName = $this->getKeyName()); $this->setAttribute($keyName, $id); }
[ "protected", "function", "insertAndSetId", "(", "Builder", "$", "query", ",", "$", "attributes", ")", "{", "$", "id", "=", "$", "query", "->", "insertGetId", "(", "$", "attributes", ",", "$", "keyName", "=", "$", "this", "->", "getKeyName", "(", ")", "...
Insert the given attributes and set the ID on the model. @param \Illuminate\Database\Eloquent\Builder $query @param array $attributes @return void
[ "Insert", "the", "given", "attributes", "and", "set", "the", "ID", "on", "the", "model", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Model.php#L833-L838
train
Insert and set the id of the record in the query and attributes
[ 30522, 5123, 3853, 19274, 29560, 20624, 2094, 1006, 12508, 1002, 23032, 1010, 1002, 12332, 1007, 1063, 1002, 8909, 1027, 1002, 23032, 1011, 1028, 19274, 18150, 3593, 1006, 1002, 12332, 1010, 1002, 3145, 18442, 1027, 1002, 2023, 1011, 1028, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Bridge/Monolog/Logger.php
Logger.getDebugLogger
private function getDebugLogger() { foreach ($this->processors as $processor) { if ($processor instanceof DebugLoggerInterface) { return $processor; } } foreach ($this->handlers as $handler) { if ($handler instanceof DebugLoggerInterface) { return $handler; } } }
php
private function getDebugLogger() { foreach ($this->processors as $processor) { if ($processor instanceof DebugLoggerInterface) { return $processor; } } foreach ($this->handlers as $handler) { if ($handler instanceof DebugLoggerInterface) { return $handler; } } }
[ "private", "function", "getDebugLogger", "(", ")", "{", "foreach", "(", "$", "this", "->", "processors", "as", "$", "processor", ")", "{", "if", "(", "$", "processor", "instanceof", "DebugLoggerInterface", ")", "{", "return", "$", "processor", ";", "}", "}...
Returns a DebugLoggerInterface instance if one is registered with this logger. @return DebugLoggerInterface|null A DebugLoggerInterface instance or null if none is registered
[ "Returns", "a", "DebugLoggerInterface", "instance", "if", "one", "is", "registered", "with", "this", "logger", "." ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bridge/Monolog/Logger.php#L103-L116
train
Returns DebugLoggerInterface object
[ 30522, 2797, 3853, 2131, 3207, 8569, 23296, 8649, 4590, 1006, 1007, 1063, 18921, 6776, 1006, 1002, 2023, 1011, 1028, 18017, 2004, 1002, 13151, 1007, 1063, 2065, 1006, 1002, 13151, 6013, 11253, 2139, 8569, 23296, 8649, 4590, 18447, 2121, 121...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/Tasks.php
Tasks.cacheDataByArchiveNameReports
public function cacheDataByArchiveNameReports() { $api = API::getInstance(); $api->getIndividualReportsSummary(true); $api->getIndividualMetricsSummary(true); $now = Date::now()->getLocalized(Date::DATE_FORMAT_SHORT); Option::set(DBStats::TIME_OF_LAST_TASK_RUN_OPTION, $now); }
php
public function cacheDataByArchiveNameReports() { $api = API::getInstance(); $api->getIndividualReportsSummary(true); $api->getIndividualMetricsSummary(true); $now = Date::now()->getLocalized(Date::DATE_FORMAT_SHORT); Option::set(DBStats::TIME_OF_LAST_TASK_RUN_OPTION, $now); }
[ "public", "function", "cacheDataByArchiveNameReports", "(", ")", "{", "$", "api", "=", "API", "::", "getInstance", "(", ")", ";", "$", "api", "->", "getIndividualReportsSummary", "(", "true", ")", ";", "$", "api", "->", "getIndividualMetricsSummary", "(", "tru...
Caches the intermediate DataTables used in the getIndividualReportsSummary and getIndividualMetricsSummary reports in the option table.
[ "Caches", "the", "intermediate", "DataTables", "used", "in", "the", "getIndividualReportsSummary", "and", "getIndividualMetricsSummary", "reports", "in", "the", "option", "table", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/DBStats/Tasks.php#L25-L33
train
Cache data by archive name reports
[ 30522, 2270, 3853, 17053, 2850, 2696, 3762, 2906, 5428, 8159, 14074, 2890, 25378, 1006, 1007, 1063, 1002, 17928, 1027, 17928, 1024, 1024, 2131, 7076, 26897, 1006, 1007, 1025, 1002, 17928, 1011, 1028, 2131, 22254, 12848, 3593, 8787, 2890, 25...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Bundle/FrameworkBundle/Controller/ControllerNameParser.php
ControllerNameParser.build
public function build($controller) { @trigger_error(sprintf('The %s class is deprecated since Symfony 4.1.', __CLASS__), E_USER_DEPRECATED); if (0 === preg_match('#^(.*?\\\\Controller\\\\(.+)Controller)::(.+)Action$#', $controller, $match)) { throw new \InvalidArgumentException(sprintf('The "%s" controller is not a valid "class::method" string.', $controller)); } $className = $match[1]; $controllerName = $match[2]; $actionName = $match[3]; foreach ($this->kernel->getBundles() as $name => $bundle) { if (0 !== strpos($className, $bundle->getNamespace())) { continue; } return sprintf('%s:%s:%s', $name, $controllerName, $actionName); } throw new \InvalidArgumentException(sprintf('Unable to find a bundle that defines controller "%s".', $controller)); }
php
public function build($controller) { @trigger_error(sprintf('The %s class is deprecated since Symfony 4.1.', __CLASS__), E_USER_DEPRECATED); if (0 === preg_match('#^(.*?\\\\Controller\\\\(.+)Controller)::(.+)Action$#', $controller, $match)) { throw new \InvalidArgumentException(sprintf('The "%s" controller is not a valid "class::method" string.', $controller)); } $className = $match[1]; $controllerName = $match[2]; $actionName = $match[3]; foreach ($this->kernel->getBundles() as $name => $bundle) { if (0 !== strpos($className, $bundle->getNamespace())) { continue; } return sprintf('%s:%s:%s', $name, $controllerName, $actionName); } throw new \InvalidArgumentException(sprintf('Unable to find a bundle that defines controller "%s".', $controller)); }
[ "public", "function", "build", "(", "$", "controller", ")", "{", "@", "trigger_error", "(", "sprintf", "(", "'The %s class is deprecated since Symfony 4.1.'", ",", "__CLASS__", ")", ",", "E_USER_DEPRECATED", ")", ";", "if", "(", "0", "===", "preg_match", "(", "'...
Converts a class::method notation to a short one (a:b:c). @param string $controller A string in the class::method notation @return string A short notation controller (a:b:c) @throws \InvalidArgumentException when the controller is not valid or cannot be found in any bundle
[ "Converts", "a", "class", "::", "method", "notation", "to", "a", "short", "one", "(", "a", ":", "b", ":", "c", ")", "." ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerNameParser.php#L94-L114
train
Builds the controller string
[ 30522, 2270, 3853, 3857, 1006, 1002, 11486, 1007, 1063, 1030, 9495, 1035, 7561, 1006, 9043, 2546, 1006, 1005, 1996, 1003, 1055, 2465, 2003, 2139, 28139, 12921, 2144, 25353, 2213, 14876, 4890, 1018, 1012, 1015, 1012, 1005, 1010, 1035, 1035, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
laravel/framework
src/Illuminate/Database/Eloquent/Relations/Concerns/InteractsWithPivotTable.php
InteractsWithPivotTable.updateExistingPivot
public function updateExistingPivot($id, array $attributes, $touch = true) { if ($this->using && empty($this->pivotWheres) && empty($this->pivotWhereIns)) { return $this->updateExistingPivotUsingCustomClass($id, $attributes, $touch); } if (in_array($this->updatedAt(), $this->pivotColumns)) { $attributes = $this->addTimestampsToAttachment($attributes, true); } $updated = $this->newPivotStatementForId($this->parseId($id))->update( $this->castAttributes($attributes) ); if ($touch) { $this->touchIfTouching(); } return $updated; }
php
public function updateExistingPivot($id, array $attributes, $touch = true) { if ($this->using && empty($this->pivotWheres) && empty($this->pivotWhereIns)) { return $this->updateExistingPivotUsingCustomClass($id, $attributes, $touch); } if (in_array($this->updatedAt(), $this->pivotColumns)) { $attributes = $this->addTimestampsToAttachment($attributes, true); } $updated = $this->newPivotStatementForId($this->parseId($id))->update( $this->castAttributes($attributes) ); if ($touch) { $this->touchIfTouching(); } return $updated; }
[ "public", "function", "updateExistingPivot", "(", "$", "id", ",", "array", "$", "attributes", ",", "$", "touch", "=", "true", ")", "{", "if", "(", "$", "this", "->", "using", "&&", "empty", "(", "$", "this", "->", "pivotWheres", ")", "&&", "empty", "...
Update an existing pivot record on the table. @param mixed $id @param array $attributes @param bool $touch @return int
[ "Update", "an", "existing", "pivot", "record", "on", "the", "table", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Relations/Concerns/InteractsWithPivotTable.php#L185-L204
train
Update an existing pivot table using the new statement for the id passed in parameter.
[ 30522, 2270, 3853, 10651, 10288, 2923, 2075, 8197, 22994, 1006, 1002, 8909, 1010, 9140, 1002, 12332, 1010, 1002, 3543, 1027, 2995, 1007, 1063, 2065, 1006, 1002, 2023, 1011, 1028, 2478, 1004, 1004, 4064, 1006, 1002, 2023, 1011, 1028, 14255, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
getgrav/grav
system/src/Grav/Common/Uri.php
Uri.uri
public function uri($include_root = true) { if ($include_root) { return $this->uri; } return str_replace($this->root_path, '', $this->uri); }
php
public function uri($include_root = true) { if ($include_root) { return $this->uri; } return str_replace($this->root_path, '', $this->uri); }
[ "public", "function", "uri", "(", "$", "include_root", "=", "true", ")", "{", "if", "(", "$", "include_root", ")", "{", "return", "$", "this", "->", "uri", ";", "}", "return", "str_replace", "(", "$", "this", "->", "root_path", ",", "''", ",", "$", ...
Return the full uri @param bool $include_root @return mixed
[ "Return", "the", "full", "uri" ]
1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72
https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Uri.php#L486-L493
train
Get the URI
[ 30522, 2270, 3853, 24471, 2072, 1006, 1002, 2421, 1035, 7117, 1027, 2995, 1007, 1063, 2065, 1006, 1002, 2421, 1035, 7117, 1007, 1063, 2709, 1002, 2023, 1011, 1028, 24471, 2072, 1025, 1065, 2709, 2358, 2099, 1035, 5672, 1006, 1002, 2023, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
octobercms/october
modules/backend/classes/Controller.php
Controller.execAjaxHandlers
protected function execAjaxHandlers() { if ($handler = $this->getAjaxHandler()) { try { /* * Validate the handler name */ if (!preg_match('/^(?:\w+\:{2})?on[A-Z]{1}[\w+]*$/', $handler)) { throw new SystemException(Lang::get('backend::lang.ajax_handler.invalid_name', ['name'=>$handler])); } /* * Validate the handler partial list */ if ($partialList = trim(Request::header('X_OCTOBER_REQUEST_PARTIALS'))) { $partialList = explode('&', $partialList); foreach ($partialList as $partial) { if (!preg_match('/^(?!.*\/\/)[a-z0-9\_][a-z0-9\_\-\/]*$/i', $partial)) { throw new SystemException(Lang::get('backend::lang.partial.invalid_name', ['name'=>$partial])); } } } else { $partialList = []; } $responseContents = []; /* * Execute the handler */ if (!$result = $this->runAjaxHandler($handler)) { throw new ApplicationException(Lang::get('backend::lang.ajax_handler.not_found', ['name'=>$handler])); } /* * Render partials and return the response as array that will be converted to JSON automatically. */ foreach ($partialList as $partial) { $responseContents[$partial] = $this->makePartial($partial); } /* * If the handler returned a redirect, process the URL and dispose of it so * framework.js knows to redirect the browser and not the request! */ if ($result instanceof RedirectResponse) { $responseContents['X_OCTOBER_REDIRECT'] = $result->getTargetUrl(); $result = null; } /* * No redirect is used, look for any flash messages */ elseif (Flash::check()) { $responseContents['#layout-flash-messages'] = $this->makeLayoutPartial('flash_messages'); } /* * Detect assets */ if ($this->hasAssetsDefined()) { $responseContents['X_OCTOBER_ASSETS'] = $this->getAssetPaths(); } /* * If the handler returned an array, we should add it to output for rendering. * If it is a string, add it to the array with the key "result". * If an object, pass it to Laravel as a response object. */ if (is_array($result)) { $responseContents = array_merge($responseContents, $result); } elseif (is_string($result)) { $responseContents['result'] = $result; } elseif (is_object($result)) { return $result; } return Response::make()->setContent($responseContents); } catch (ValidationException $ex) { /* * Handle validation error gracefully */ Flash::error($ex->getMessage()); $responseContents = []; $responseContents['#layout-flash-messages'] = $this->makeLayoutPartial('flash_messages'); $responseContents['X_OCTOBER_ERROR_FIELDS'] = $ex->getFields(); throw new AjaxException($responseContents); } catch (MassAssignmentException $ex) { throw new ApplicationException(Lang::get('backend::lang.model.mass_assignment_failed', ['attribute' => $ex->getMessage()])); } catch (Exception $ex) { throw $ex; } } return null; }
php
protected function execAjaxHandlers() { if ($handler = $this->getAjaxHandler()) { try { /* * Validate the handler name */ if (!preg_match('/^(?:\w+\:{2})?on[A-Z]{1}[\w+]*$/', $handler)) { throw new SystemException(Lang::get('backend::lang.ajax_handler.invalid_name', ['name'=>$handler])); } /* * Validate the handler partial list */ if ($partialList = trim(Request::header('X_OCTOBER_REQUEST_PARTIALS'))) { $partialList = explode('&', $partialList); foreach ($partialList as $partial) { if (!preg_match('/^(?!.*\/\/)[a-z0-9\_][a-z0-9\_\-\/]*$/i', $partial)) { throw new SystemException(Lang::get('backend::lang.partial.invalid_name', ['name'=>$partial])); } } } else { $partialList = []; } $responseContents = []; /* * Execute the handler */ if (!$result = $this->runAjaxHandler($handler)) { throw new ApplicationException(Lang::get('backend::lang.ajax_handler.not_found', ['name'=>$handler])); } /* * Render partials and return the response as array that will be converted to JSON automatically. */ foreach ($partialList as $partial) { $responseContents[$partial] = $this->makePartial($partial); } /* * If the handler returned a redirect, process the URL and dispose of it so * framework.js knows to redirect the browser and not the request! */ if ($result instanceof RedirectResponse) { $responseContents['X_OCTOBER_REDIRECT'] = $result->getTargetUrl(); $result = null; } /* * No redirect is used, look for any flash messages */ elseif (Flash::check()) { $responseContents['#layout-flash-messages'] = $this->makeLayoutPartial('flash_messages'); } /* * Detect assets */ if ($this->hasAssetsDefined()) { $responseContents['X_OCTOBER_ASSETS'] = $this->getAssetPaths(); } /* * If the handler returned an array, we should add it to output for rendering. * If it is a string, add it to the array with the key "result". * If an object, pass it to Laravel as a response object. */ if (is_array($result)) { $responseContents = array_merge($responseContents, $result); } elseif (is_string($result)) { $responseContents['result'] = $result; } elseif (is_object($result)) { return $result; } return Response::make()->setContent($responseContents); } catch (ValidationException $ex) { /* * Handle validation error gracefully */ Flash::error($ex->getMessage()); $responseContents = []; $responseContents['#layout-flash-messages'] = $this->makeLayoutPartial('flash_messages'); $responseContents['X_OCTOBER_ERROR_FIELDS'] = $ex->getFields(); throw new AjaxException($responseContents); } catch (MassAssignmentException $ex) { throw new ApplicationException(Lang::get('backend::lang.model.mass_assignment_failed', ['attribute' => $ex->getMessage()])); } catch (Exception $ex) { throw $ex; } } return null; }
[ "protected", "function", "execAjaxHandlers", "(", ")", "{", "if", "(", "$", "handler", "=", "$", "this", "->", "getAjaxHandler", "(", ")", ")", "{", "try", "{", "/*\n * Validate the handler name\n */", "if", "(", "!", "preg_match", ...
This method is used internally. Invokes a controller event handler and loads the supplied partials.
[ "This", "method", "is", "used", "internally", ".", "Invokes", "a", "controller", "event", "handler", "and", "loads", "the", "supplied", "partials", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/Controller.php#L395-L496
train
Executes the ajax handlers
[ 30522, 5123, 3853, 4654, 19281, 3900, 2595, 11774, 12910, 1006, 1007, 1063, 2065, 1006, 1002, 28213, 1027, 1002, 2023, 1011, 1028, 2131, 22734, 2595, 11774, 3917, 1006, 1007, 1007, 1063, 3046, 1063, 1013, 1008, 1008, 9398, 3686, 1996, 28213...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/Commands/AttributeHistoricalDataWithLocations.php
AttributeHistoricalDataWithLocations.onVisitProcessed
public function onVisitProcessed(OutputInterface $output) { ++$this->processed; $percent = ceil($this->processed / $this->amountOfVisits * 100); if ($percent > $this->processedPercent && $percent % $this->percentStep === 0 ) { $output->writeln(sprintf('%d%% processed. <comment>%s</comment>', $percent, $this->timer->__toString())); $this->processedPercent = $percent; } }
php
public function onVisitProcessed(OutputInterface $output) { ++$this->processed; $percent = ceil($this->processed / $this->amountOfVisits * 100); if ($percent > $this->processedPercent && $percent % $this->percentStep === 0 ) { $output->writeln(sprintf('%d%% processed. <comment>%s</comment>', $percent, $this->timer->__toString())); $this->processedPercent = $percent; } }
[ "public", "function", "onVisitProcessed", "(", "OutputInterface", "$", "output", ")", "{", "++", "$", "this", "->", "processed", ";", "$", "percent", "=", "ceil", "(", "$", "this", "->", "processed", "/", "$", "this", "->", "amountOfVisits", "*", "100", ...
Print information about progress. @param OutputInterface $output
[ "Print", "information", "about", "progress", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UserCountry/Commands/AttributeHistoricalDataWithLocations.php#L148-L161
train
Called when a visit has been processed
[ 30522, 2270, 3853, 2006, 11365, 4183, 21572, 9623, 6924, 1006, 6434, 18447, 2121, 12172, 1002, 6434, 1007, 1063, 1009, 1009, 1002, 2023, 1011, 1028, 13995, 1025, 1002, 3867, 1027, 8292, 4014, 1006, 1002, 2023, 1011, 1028, 13995, 1013, 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/Security/Core/Authorization/AuthorizationChecker.php
AuthorizationChecker.isGranted
final public function isGranted($attributes, $subject = null) { if (null === ($token = $this->tokenStorage->getToken())) { throw new AuthenticationCredentialsNotFoundException('The token storage contains no authentication token. One possible reason may be that there is no firewall configured for this URL.'); } if ($this->alwaysAuthenticate || !$token->isAuthenticated()) { $this->tokenStorage->setToken($token = $this->authenticationManager->authenticate($token)); } if (!\is_array($attributes)) { $attributes = [$attributes]; } return $this->accessDecisionManager->decide($token, $attributes, $subject); }
php
final public function isGranted($attributes, $subject = null) { if (null === ($token = $this->tokenStorage->getToken())) { throw new AuthenticationCredentialsNotFoundException('The token storage contains no authentication token. One possible reason may be that there is no firewall configured for this URL.'); } if ($this->alwaysAuthenticate || !$token->isAuthenticated()) { $this->tokenStorage->setToken($token = $this->authenticationManager->authenticate($token)); } if (!\is_array($attributes)) { $attributes = [$attributes]; } return $this->accessDecisionManager->decide($token, $attributes, $subject); }
[ "final", "public", "function", "isGranted", "(", "$", "attributes", ",", "$", "subject", "=", "null", ")", "{", "if", "(", "null", "===", "(", "$", "token", "=", "$", "this", "->", "tokenStorage", "->", "getToken", "(", ")", ")", ")", "{", "throw", ...
{@inheritdoc} @throws AuthenticationCredentialsNotFoundException when the token storage has no authentication token
[ "{", "@inheritdoc", "}" ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Security/Core/Authorization/AuthorizationChecker.php#L46-L61
train
Checks if the attributes are granted
[ 30522, 2345, 2270, 3853, 2003, 18980, 2098, 1006, 1002, 12332, 1010, 1002, 3395, 1027, 19701, 1007, 1063, 2065, 1006, 19701, 1027, 1027, 1027, 1006, 1002, 19204, 1027, 1002, 2023, 1011, 1028, 19204, 23809, 4270, 1011, 1028, 2131, 18715, 236...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
octobercms/october
modules/backend/behaviors/ListController.php
ListController.extendListFilterScopes
public static function extendListFilterScopes($callback) { $calledClass = self::getCalledExtensionClass(); Event::listen('backend.filter.extendScopes', function ($widget) use ($calledClass, $callback) { if (!is_a($widget->getController(), $calledClass)) { return; } call_user_func_array($callback, [$widget]); }); }
php
public static function extendListFilterScopes($callback) { $calledClass = self::getCalledExtensionClass(); Event::listen('backend.filter.extendScopes', function ($widget) use ($calledClass, $callback) { if (!is_a($widget->getController(), $calledClass)) { return; } call_user_func_array($callback, [$widget]); }); }
[ "public", "static", "function", "extendListFilterScopes", "(", "$", "callback", ")", "{", "$", "calledClass", "=", "self", "::", "getCalledExtensionClass", "(", ")", ";", "Event", "::", "listen", "(", "'backend.filter.extendScopes'", ",", "function", "(", "$", "...
Static helper for extending filter scopes. @param callable $callback @return void
[ "Static", "helper", "for", "extending", "filter", "scopes", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/behaviors/ListController.php#L568-L577
train
Extend list filter scopes with callback function
[ 30522, 2270, 10763, 3853, 7949, 9863, 8873, 21928, 26127, 2015, 1006, 1002, 2655, 5963, 1007, 1063, 1002, 2170, 26266, 1027, 2969, 1024, 1024, 2131, 9289, 3709, 10288, 29048, 26266, 1006, 1007, 1025, 2724, 1024, 1024, 4952, 1006, 1005, 2067...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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.getCurrentUrl
public static function getCurrentUrl() { return self::getCurrentScheme() . '://' . self::getCurrentHost() . self::getCurrentScriptName(false) . self::getCurrentQueryString(); }
php
public static function getCurrentUrl() { return self::getCurrentScheme() . '://' . self::getCurrentHost() . self::getCurrentScriptName(false) . self::getCurrentQueryString(); }
[ "public", "static", "function", "getCurrentUrl", "(", ")", "{", "return", "self", "::", "getCurrentScheme", "(", ")", ".", "'://'", ".", "self", "::", "getCurrentHost", "(", ")", ".", "self", "::", "getCurrentScriptName", "(", "false", ")", ".", "self", ":...
Returns the current URL. @return string eg, `"http://example.org/dir1/dir2/index.php?param1=value1&param2=value2"` @api
[ "Returns", "the", "current", "URL", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Url.php#L59-L65
train
Get Current URL
[ 30522, 2270, 10763, 3853, 2131, 10841, 14343, 3372, 3126, 2140, 1006, 1007, 1063, 2709, 2969, 1024, 1024, 2131, 10841, 14343, 7666, 5403, 4168, 1006, 1007, 1012, 1005, 1024, 1013, 1013, 1005, 1012, 2969, 1024, 1024, 2131, 10841, 14343, 3372...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
getgrav/grav
system/src/Grav/Common/Language/Language.php
Language.translate
public function translate($args, array $languages = null, $array_support = false, $html_out = false) { if (\is_array($args)) { $lookup = array_shift($args); } else { $lookup = $args; $args = []; } if ($this->config->get('system.languages.translations', true)) { if ($this->enabled() && $lookup) { if (empty($languages)) { if ($this->config->get('system.languages.translations_fallback', true)) { $languages = $this->getFallbackLanguages(); } else { $languages = (array)$this->getLanguage(); } } } else { $languages = ['en']; } foreach ((array)$languages as $lang) { $translation = $this->getTranslation($lang, $lookup, $array_support); if ($translation) { if (\count($args) >= 1) { return vsprintf($translation, $args); } return $translation; } } } if ($html_out) { return '<span class="untranslated">' . $lookup . '</span>'; } return $lookup; }
php
public function translate($args, array $languages = null, $array_support = false, $html_out = false) { if (\is_array($args)) { $lookup = array_shift($args); } else { $lookup = $args; $args = []; } if ($this->config->get('system.languages.translations', true)) { if ($this->enabled() && $lookup) { if (empty($languages)) { if ($this->config->get('system.languages.translations_fallback', true)) { $languages = $this->getFallbackLanguages(); } else { $languages = (array)$this->getLanguage(); } } } else { $languages = ['en']; } foreach ((array)$languages as $lang) { $translation = $this->getTranslation($lang, $lookup, $array_support); if ($translation) { if (\count($args) >= 1) { return vsprintf($translation, $args); } return $translation; } } } if ($html_out) { return '<span class="untranslated">' . $lookup . '</span>'; } return $lookup; }
[ "public", "function", "translate", "(", "$", "args", ",", "array", "$", "languages", "=", "null", ",", "$", "array_support", "=", "false", ",", "$", "html_out", "=", "false", ")", "{", "if", "(", "\\", "is_array", "(", "$", "args", ")", ")", "{", "...
Translate a key and possibly arguments into a string using current lang and fallbacks @param string|array $args The first argument is the lookup key value Other arguments can be passed and replaced in the translation with sprintf syntax @param array $languages @param bool $array_support @param bool $html_out @return string
[ "Translate", "a", "key", "and", "possibly", "arguments", "into", "a", "string", "using", "current", "lang", "and", "fallbacks" ]
1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72
https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Language/Language.php#L387-L427
train
Translates the given string
[ 30522, 2270, 3853, 17637, 1006, 1002, 12098, 5620, 1010, 9140, 1002, 4155, 1027, 19701, 1010, 1002, 9140, 1035, 2490, 1027, 6270, 1010, 1002, 16129, 1035, 2041, 1027, 6270, 1007, 1063, 2065, 1006, 1032, 2003, 1035, 9140, 1006, 1002, 12098, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
PHPMailer/PHPMailer
src/SMTP.php
SMTP.client_send
public function client_send($data, $command = '') { //If SMTP transcripts are left enabled, or debug output is posted online //it can leak credentials, so hide credentials in all but lowest level if (self::DEBUG_LOWLEVEL > $this->do_debug and in_array($command, ['User & Password', 'Username', 'Password'], true)) { $this->edebug('CLIENT -> SERVER: <credentials hidden>', self::DEBUG_CLIENT); } else { $this->edebug('CLIENT -> SERVER: ' . $data, self::DEBUG_CLIENT); } set_error_handler([$this, 'errorHandler']); $result = fwrite($this->smtp_conn, $data); restore_error_handler(); return $result; }
php
public function client_send($data, $command = '') { //If SMTP transcripts are left enabled, or debug output is posted online //it can leak credentials, so hide credentials in all but lowest level if (self::DEBUG_LOWLEVEL > $this->do_debug and in_array($command, ['User & Password', 'Username', 'Password'], true)) { $this->edebug('CLIENT -> SERVER: <credentials hidden>', self::DEBUG_CLIENT); } else { $this->edebug('CLIENT -> SERVER: ' . $data, self::DEBUG_CLIENT); } set_error_handler([$this, 'errorHandler']); $result = fwrite($this->smtp_conn, $data); restore_error_handler(); return $result; }
[ "public", "function", "client_send", "(", "$", "data", ",", "$", "command", "=", "''", ")", "{", "//If SMTP transcripts are left enabled, or debug output is posted online", "//it can leak credentials, so hide credentials in all but lowest level", "if", "(", "self", "::", "DEBUG...
Send raw data to the server. @param string $data The data to send @param string $command Optionally, the command this is part of, used only for controlling debug output @return int|bool The number of bytes sent to the server or false on error
[ "Send", "raw", "data", "to", "the", "server", "." ]
3d7132341659a8a201adbc3ba11b1e202ee2857c
https://github.com/PHPMailer/PHPMailer/blob/3d7132341659a8a201adbc3ba11b1e202ee2857c/src/SMTP.php#L1034-L1049
train
Sends data to the server
[ 30522, 2270, 3853, 7396, 1035, 4604, 1006, 1002, 2951, 1010, 1002, 3094, 1027, 1005, 1005, 1007, 1063, 1013, 1013, 2065, 15488, 25856, 24051, 2015, 2024, 2187, 9124, 1010, 2030, 2139, 8569, 2290, 6434, 2003, 6866, 3784, 1013, 1013, 2009, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/RoutesNotifications.php
RoutesNotifications.notifyNow
public function notifyNow($instance, array $channels = null) { app(Dispatcher::class)->sendNow($this, $instance, $channels); }
php
public function notifyNow($instance, array $channels = null) { app(Dispatcher::class)->sendNow($this, $instance, $channels); }
[ "public", "function", "notifyNow", "(", "$", "instance", ",", "array", "$", "channels", "=", "null", ")", "{", "app", "(", "Dispatcher", "::", "class", ")", "->", "sendNow", "(", "$", "this", ",", "$", "instance", ",", "$", "channels", ")", ";", "}" ...
Send the given notification immediately. @param mixed $instance @param array|null $channels @return void
[ "Send", "the", "given", "notification", "immediately", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Notifications/RoutesNotifications.php#L28-L31
train
Send notification now
[ 30522, 2270, 3853, 2025, 8757, 19779, 1006, 1002, 6013, 1010, 9140, 1002, 6833, 1027, 19701, 1007, 1063, 10439, 1006, 18365, 2121, 1024, 1024, 2465, 1007, 1011, 1028, 4604, 19779, 1006, 1002, 2023, 1010, 1002, 6013, 1010, 1002, 6833, 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/Schema/Grammars/Grammar.php
Grammar.addModifiers
protected function addModifiers($sql, Blueprint $blueprint, Fluent $column) { foreach ($this->modifiers as $modifier) { if (method_exists($this, $method = "modify{$modifier}")) { $sql .= $this->{$method}($blueprint, $column); } } return $sql; }
php
protected function addModifiers($sql, Blueprint $blueprint, Fluent $column) { foreach ($this->modifiers as $modifier) { if (method_exists($this, $method = "modify{$modifier}")) { $sql .= $this->{$method}($blueprint, $column); } } return $sql; }
[ "protected", "function", "addModifiers", "(", "$", "sql", ",", "Blueprint", "$", "blueprint", ",", "Fluent", "$", "column", ")", "{", "foreach", "(", "$", "this", "->", "modifiers", "as", "$", "modifier", ")", "{", "if", "(", "method_exists", "(", "$", ...
Add the column modifiers to the definition. @param string $sql @param \Illuminate\Database\Schema\Blueprint $blueprint @param \Illuminate\Support\Fluent $column @return string
[ "Add", "the", "column", "modifiers", "to", "the", "definition", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Schema/Grammars/Grammar.php#L152-L161
train
Adds modifiers to the SQL statement
[ 30522, 5123, 3853, 5587, 5302, 4305, 8873, 2545, 1006, 1002, 29296, 1010, 2630, 16550, 1002, 2630, 16550, 1010, 19376, 1002, 5930, 1007, 1063, 18921, 6776, 1006, 1002, 2023, 1011, 1028, 16913, 28295, 2004, 1002, 16913, 18095, 1007, 1063, 20...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
laravel/framework
src/Illuminate/Cache/CacheManager.php
CacheManager.forgetDriver
public function forgetDriver($name = null) { $name = $name ?? $this->getDefaultDriver(); foreach ((array) $name as $cacheName) { if (isset($this->stores[$cacheName])) { unset($this->stores[$cacheName]); } } return $this; }
php
public function forgetDriver($name = null) { $name = $name ?? $this->getDefaultDriver(); foreach ((array) $name as $cacheName) { if (isset($this->stores[$cacheName])) { unset($this->stores[$cacheName]); } } return $this; }
[ "public", "function", "forgetDriver", "(", "$", "name", "=", "null", ")", "{", "$", "name", "=", "$", "name", "??", "$", "this", "->", "getDefaultDriver", "(", ")", ";", "foreach", "(", "(", "array", ")", "$", "name", "as", "$", "cacheName", ")", "...
Unset the given driver instances. @param array|string|null $name @return $this
[ "Unset", "the", "given", "driver", "instances", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Cache/CacheManager.php#L320-L331
train
Forget driver.
[ 30522, 2270, 3853, 5293, 23663, 2099, 1006, 1002, 2171, 1027, 19701, 1007, 1063, 1002, 2171, 1027, 1002, 2171, 1029, 1029, 1002, 2023, 1011, 1028, 2131, 3207, 7011, 11314, 23663, 2099, 1006, 1007, 1025, 18921, 6776, 1006, 1006, 9140, 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/Live/ProfileSummaryProvider.php
ProfileSummaryProvider.getAllInstances
public function getAllInstances() { $cacheId = CacheId::pluginAware('ProfileSummaries'); $cache = Cache::getTransientCache(); if (!$cache->contains($cacheId)) { $instances = []; /** * Triggered to add new live profile summaries. * * **Example** * * public function addProfileSummary(&$profileSummaries) * { * $profileSummaries[] = new MyCustomProfileSummary(); * } * * @param ProfileSummaryAbstract[] $profileSummaries An array of profile summaries */ Piwik::postEvent('Live.addProfileSummaries', array(&$instances)); foreach ($this->getAllProfileSummaryClasses() as $className) { $instances[] = new $className(); } /** * Triggered to filter / restrict profile summaries. * * **Example** * * public function filterProfileSummary(&$profileSummaries) * { * foreach ($profileSummaries as $index => $profileSummary) { * if ($profileSummary->getId() === 'myid') {} * unset($profileSummaries[$index]); // remove all summaries having this ID * } * } * } * * @param ProfileSummaryAbstract[] $profileSummaries An array of profile summaries */ Piwik::postEvent('Live.filterProfileSummaries', array(&$instances)); $cache->save($cacheId, $instances); } return $cache->fetch($cacheId); }
php
public function getAllInstances() { $cacheId = CacheId::pluginAware('ProfileSummaries'); $cache = Cache::getTransientCache(); if (!$cache->contains($cacheId)) { $instances = []; /** * Triggered to add new live profile summaries. * * **Example** * * public function addProfileSummary(&$profileSummaries) * { * $profileSummaries[] = new MyCustomProfileSummary(); * } * * @param ProfileSummaryAbstract[] $profileSummaries An array of profile summaries */ Piwik::postEvent('Live.addProfileSummaries', array(&$instances)); foreach ($this->getAllProfileSummaryClasses() as $className) { $instances[] = new $className(); } /** * Triggered to filter / restrict profile summaries. * * **Example** * * public function filterProfileSummary(&$profileSummaries) * { * foreach ($profileSummaries as $index => $profileSummary) { * if ($profileSummary->getId() === 'myid') {} * unset($profileSummaries[$index]); // remove all summaries having this ID * } * } * } * * @param ProfileSummaryAbstract[] $profileSummaries An array of profile summaries */ Piwik::postEvent('Live.filterProfileSummaries', array(&$instances)); $cache->save($cacheId, $instances); } return $cache->fetch($cacheId); }
[ "public", "function", "getAllInstances", "(", ")", "{", "$", "cacheId", "=", "CacheId", "::", "pluginAware", "(", "'ProfileSummaries'", ")", ";", "$", "cache", "=", "Cache", "::", "getTransientCache", "(", ")", ";", "if", "(", "!", "$", "cache", "->", "c...
Returns all available profile summaries @return ProfileSummaryAbstract[] @throws \Exception
[ "Returns", "all", "available", "profile", "summaries" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Live/ProfileSummaryProvider.php#L38-L86
train
Returns all the instances of the profile summaries
[ 30522, 2270, 3853, 2131, 8095, 7076, 26897, 2015, 1006, 1007, 1063, 1002, 17053, 3593, 1027, 17053, 3593, 1024, 1024, 13354, 3981, 8059, 1006, 1005, 17879, 2819, 7849, 3111, 1005, 1007, 1025, 1002, 17053, 1027, 17053, 1024, 1024, 2131, 6494...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
libs/Zend/Db/Select.php
Zend_Db_Select.assemble
public function assemble() { $sql = self::SQL_SELECT; foreach (array_keys(self::$_partsInit) as $part) { $method = '_render' . ucfirst($part); if (method_exists($this, $method)) { $sql = $this->$method($sql); } } return $sql; }
php
public function assemble() { $sql = self::SQL_SELECT; foreach (array_keys(self::$_partsInit) as $part) { $method = '_render' . ucfirst($part); if (method_exists($this, $method)) { $sql = $this->$method($sql); } } return $sql; }
[ "public", "function", "assemble", "(", ")", "{", "$", "sql", "=", "self", "::", "SQL_SELECT", ";", "foreach", "(", "array_keys", "(", "self", "::", "$", "_partsInit", ")", "as", "$", "part", ")", "{", "$", "method", "=", "'_render'", ".", "ucfirst", ...
Converts this object to an SQL SELECT string. @return string|null This object as a SELECT string. (or null if a string cannot be produced.)
[ "Converts", "this", "object", "to", "an", "SQL", "SELECT", "string", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Select.php#L699-L709
train
Assemble the SQL statement
[ 30522, 2270, 3853, 21365, 1006, 1007, 1063, 1002, 29296, 1027, 2969, 1024, 1024, 29296, 1035, 7276, 1025, 18921, 6776, 1006, 9140, 1035, 6309, 1006, 2969, 30524, 1028, 1002, 4118, 1006, 1002, 29296, 1007, 1025, 1065, 1065, 2709, 1002, 29296...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/PropertyInfo/PropertyInfoExtractor.php
PropertyInfoExtractor.extract
private function extract(iterable $extractors, string $method, array $arguments) { foreach ($extractors as $extractor) { if (null !== $value = $extractor->{$method}(...$arguments)) { return $value; } } }
php
private function extract(iterable $extractors, string $method, array $arguments) { foreach ($extractors as $extractor) { if (null !== $value = $extractor->{$method}(...$arguments)) { return $value; } } }
[ "private", "function", "extract", "(", "iterable", "$", "extractors", ",", "string", "$", "method", ",", "array", "$", "arguments", ")", "{", "foreach", "(", "$", "extractors", "as", "$", "extractor", ")", "{", "if", "(", "null", "!==", "$", "value", "...
Iterates over registered extractors and return the first value found. @return mixed
[ "Iterates", "over", "registered", "extractors", "and", "return", "the", "first", "value", "found", "." ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/PropertyInfo/PropertyInfoExtractor.php#L106-L113
train
Extract value from the extractors
[ 30522, 2797, 3853, 14817, 1006, 2009, 6906, 3468, 1002, 14817, 5668, 1010, 5164, 1002, 4118, 1010, 9140, 1002, 9918, 1007, 1063, 18921, 6776, 1006, 1002, 14817, 5668, 2004, 1002, 14817, 2953, 1007, 1063, 2065, 1006, 19701, 999, 1027, 1027, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/Validator/Constraint.php
Constraint.addImplicitGroupName
public function addImplicitGroupName($group) { if (\in_array(self::DEFAULT_GROUP, $this->groups) && !\in_array($group, $this->groups)) { $this->groups[] = $group; } }
php
public function addImplicitGroupName($group) { if (\in_array(self::DEFAULT_GROUP, $this->groups) && !\in_array($group, $this->groups)) { $this->groups[] = $group; } }
[ "public", "function", "addImplicitGroupName", "(", "$", "group", ")", "{", "if", "(", "\\", "in_array", "(", "self", "::", "DEFAULT_GROUP", ",", "$", "this", "->", "groups", ")", "&&", "!", "\\", "in_array", "(", "$", "group", ",", "$", "this", "->", ...
Adds the given group if this constraint is in the Default group. @param string $group
[ "Adds", "the", "given", "group", "if", "this", "constraint", "is", "in", "the", "Default", "group", "." ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Validator/Constraint.php#L223-L228
train
Add implicit group name to the list of implicit groups
[ 30522, 2270, 3853, 5587, 5714, 24759, 28775, 2102, 17058, 18442, 1006, 1002, 2177, 1007, 1063, 2065, 1006, 1032, 1999, 1035, 9140, 1006, 2969, 1024, 1024, 12398, 1035, 2177, 1010, 1002, 2023, 1011, 1028, 2967, 1007, 1004, 1004, 999, 1032, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
overtrue/wechat
src/Payment/Jssdk/Client.php
Client.sdkConfig
public function sdkConfig(string $prepayId): array { $config = $this->bridgeConfig($prepayId, false); $config['timestamp'] = $config['timeStamp']; unset($config['timeStamp']); return $config; }
php
public function sdkConfig(string $prepayId): array { $config = $this->bridgeConfig($prepayId, false); $config['timestamp'] = $config['timeStamp']; unset($config['timeStamp']); return $config; }
[ "public", "function", "sdkConfig", "(", "string", "$", "prepayId", ")", ":", "array", "{", "$", "config", "=", "$", "this", "->", "bridgeConfig", "(", "$", "prepayId", ",", "false", ")", ";", "$", "config", "[", "'timestamp'", "]", "=", "$", "config", ...
[JSSDK] Generate js config for payment. <pre> wx.chooseWXPay({...}); </pre> @param string $prepayId @return array
[ "[", "JSSDK", "]", "Generate", "js", "config", "for", "payment", "." ]
120c72faaa93c270365bc75c73c362d5fd583209
https://github.com/overtrue/wechat/blob/120c72faaa93c270365bc75c73c362d5fd583209/src/Payment/Jssdk/Client.php#L66-L74
train
Get sdk config
[ 30522, 2270, 30524, 17463, 4710, 3593, 1007, 1024, 9140, 1063, 1002, 9530, 8873, 2290, 1027, 1002, 2023, 1011, 1028, 2958, 8663, 8873, 2290, 1006, 1002, 17463, 4710, 3593, 1010, 6270, 1007, 1025, 1002, 9530, 8873, 2290, 1031, 1005, 2335, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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.createSingleDriver
protected function createSingleDriver(array $config) { return new Monolog($this->parseChannel($config), [ $this->prepareHandler( new StreamHandler($config['path'], $this->level($config)) ), ]); }
php
protected function createSingleDriver(array $config) { return new Monolog($this->parseChannel($config), [ $this->prepareHandler( new StreamHandler($config['path'], $this->level($config)) ), ]); }
[ "protected", "function", "createSingleDriver", "(", "array", "$", "config", ")", "{", "return", "new", "Monolog", "(", "$", "this", "->", "parseChannel", "(", "$", "config", ")", ",", "[", "$", "this", "->", "prepareHandler", "(", "new", "StreamHandler", "...
Create an instance of the single file log driver. @param array $config @return \Psr\Log\LoggerInterface
[ "Create", "an", "instance", "of", "the", "single", "file", "log", "driver", "." ]
120c72faaa93c270365bc75c73c362d5fd583209
https://github.com/overtrue/wechat/blob/120c72faaa93c270365bc75c73c362d5fd583209/src/Kernel/Log/LogManager.php#L215-L222
train
Create a single logger with a single handler
[ 30522, 5123, 3853, 9005, 2075, 3709, 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...
z-song/laravel-admin
src/Grid.php
Grid.columns
public function columns($columns = []) { if (func_num_args() == 0) { return $this->columns; } if (func_num_args() == 1 && is_array($columns)) { foreach ($columns as $column => $label) { $this->column($column, $label); } return; } foreach (func_get_args() as $column) { $this->column($column); } }
php
public function columns($columns = []) { if (func_num_args() == 0) { return $this->columns; } if (func_num_args() == 1 && is_array($columns)) { foreach ($columns as $column => $label) { $this->column($column, $label); } return; } foreach (func_get_args() as $column) { $this->column($column); } }
[ "public", "function", "columns", "(", "$", "columns", "=", "[", "]", ")", "{", "if", "(", "func_num_args", "(", ")", "==", "0", ")", "{", "return", "$", "this", "->", "columns", ";", "}", "if", "(", "func_num_args", "(", ")", "==", "1", "&&", "is...
Batch add column to grid. @example 1.$grid->columns(['name' => 'Name', 'email' => 'Email' ...]); 2.$grid->columns('name', 'email' ...) @param array $columns @return Collection|null
[ "Batch", "add", "column", "to", "grid", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Grid.php#L331-L348
train
Set the columns of the table
[ 30522, 2270, 3853, 7753, 1006, 1002, 7753, 1027, 1031, 1033, 1007, 1063, 2065, 1006, 4569, 2278, 1035, 16371, 2213, 1035, 12098, 5620, 1006, 1007, 1027, 1027, 1014, 1007, 1063, 2709, 1002, 2023, 1011, 1028, 7753, 1025, 1065, 2065, 1006, 4...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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.getDisplayMode
protected function getDisplayMode() { $mode = $this->getConfig('mode', 'image'); if (str_contains($mode, '-')) { return $mode; } $relationType = $this->getRelationType(); $mode .= ($relationType == 'attachMany' || $relationType == 'morphMany') ? '-multi' : '-single'; return $mode; }
php
protected function getDisplayMode() { $mode = $this->getConfig('mode', 'image'); if (str_contains($mode, '-')) { return $mode; } $relationType = $this->getRelationType(); $mode .= ($relationType == 'attachMany' || $relationType == 'morphMany') ? '-multi' : '-single'; return $mode; }
[ "protected", "function", "getDisplayMode", "(", ")", "{", "$", "mode", "=", "$", "this", "->", "getConfig", "(", "'mode'", ",", "'image'", ")", ";", "if", "(", "str_contains", "(", "$", "mode", ",", "'-'", ")", ")", "{", "return", "$", "mode", ";", ...
Returns the display mode for the file upload. Eg: file-multi, image-single, etc. @return string
[ "Returns", "the", "display", "mode", "for", "the", "file", "upload", ".", "Eg", ":", "file", "-", "multi", "image", "-", "single", "etc", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/formwidgets/FileUpload.php#L168-L180
train
Get display mode
[ 30522, 5123, 3853, 2131, 10521, 13068, 5302, 3207, 1006, 1007, 1063, 1002, 5549, 1027, 1002, 2023, 1011, 1028, 2131, 8663, 8873, 2290, 1006, 1005, 5549, 1005, 1010, 1005, 3746, 1005, 1007, 1025, 2065, 1006, 2358, 2099, 1035, 3397, 1006, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
laravel/framework
src/Illuminate/Session/CookieSessionHandler.php
CookieSessionHandler.destroy
public function destroy($sessionId) { $this->cookie->queue($this->cookie->forget($sessionId)); return true; }
php
public function destroy($sessionId) { $this->cookie->queue($this->cookie->forget($sessionId)); return true; }
[ "public", "function", "destroy", "(", "$", "sessionId", ")", "{", "$", "this", "->", "cookie", "->", "queue", "(", "$", "this", "->", "cookie", "->", "forget", "(", "$", "sessionId", ")", ")", ";", "return", "true", ";", "}" ]
{@inheritdoc}
[ "{" ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Session/CookieSessionHandler.php#L96-L101
train
Destroy session and destroy session
[ 30522, 2270, 3853, 6033, 1006, 1002, 5219, 3593, 1007, 1063, 1002, 2023, 1011, 1028, 17387, 1011, 1028, 24240, 1006, 1002, 2023, 1011, 1028, 17387, 1011, 1028, 5293, 1006, 1002, 5219, 3593, 1007, 1007, 1025, 2709, 2995, 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...
matomo-org/matomo
plugins/UserCountry/LocationProvider.php
LocationProvider.getAvailableProviders
public static function getAvailableProviders() { $result = array(); foreach (self::getAllProviders() as $provider) { if ($provider->isAvailable()) { $result[] = $provider; } } return $result; }
php
public static function getAvailableProviders() { $result = array(); foreach (self::getAllProviders() as $provider) { if ($provider->isAvailable()) { $result[] = $provider; } } return $result; }
[ "public", "static", "function", "getAvailableProviders", "(", ")", "{", "$", "result", "=", "array", "(", ")", ";", "foreach", "(", "self", "::", "getAllProviders", "(", ")", "as", "$", "provider", ")", "{", "if", "(", "$", "provider", "->", "isAvailable...
Returns all provider instances that are 'available'. An 'available' provider is one that is available for use. They may not necessarily be working. @return array
[ "Returns", "all", "provider", "instances", "that", "are", "available", ".", "An", "available", "provider", "is", "one", "that", "is", "available", "for", "use", ".", "They", "may", "not", "necessarily", "be", "working", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UserCountry/LocationProvider.php#L205-L214
train
Get available providers
[ 30522, 2270, 10763, 3853, 2131, 12462, 11733, 3468, 21572, 17258, 2545, 1006, 1007, 1063, 1002, 2765, 1027, 9140, 1006, 1007, 1025, 18921, 6776, 1006, 2969, 1024, 1024, 2131, 8095, 21572, 17258, 2545, 1006, 1007, 2004, 1002, 10802, 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...
octobercms/october
modules/cms/traits/UrlMaker.php
UrlMaker.getUrlAttribute
public function getUrlAttribute() { if ($this->url === null) { $this->url = $this->makeUrl(); } return $this->url; }
php
public function getUrlAttribute() { if ($this->url === null) { $this->url = $this->makeUrl(); } return $this->url; }
[ "public", "function", "getUrlAttribute", "(", ")", "{", "if", "(", "$", "this", "->", "url", "===", "null", ")", "{", "$", "this", "->", "url", "=", "$", "this", "->", "makeUrl", "(", ")", ";", "}", "return", "$", "this", "->", "url", ";", "}" ]
Mutator for the "url" attribute. Returns the URL detected by the component. @return string
[ "Mutator", "for", "the", "url", "attribute", ".", "Returns", "the", "URL", "detected", "by", "the", "component", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/traits/UrlMaker.php#L104-L111
train
Get url attribute
[ 30522, 2270, 3853, 2131, 3126, 20051, 18886, 8569, 2618, 1006, 1007, 1063, 2065, 1006, 1002, 2023, 1011, 1028, 24471, 2140, 1027, 1027, 1027, 19701, 1007, 1063, 1002, 2023, 1011, 1028, 24471, 2140, 1027, 1002, 2023, 1011, 1028, 2191, 3126, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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.init
public function init() { if ($this->initialized) { return; } self::setRequestIdHeader(); $this->initialized = true; $tmpPath = StaticContainer::get('path.tmp'); $directoriesToCheck = array( $tmpPath, $tmpPath . '/assets/', $tmpPath . '/cache/', $tmpPath . '/logs/', $tmpPath . '/tcpdf/', $tmpPath . '/templates_c/', ); Filechecks::dieIfDirectoriesNotWritable($directoriesToCheck); $this->handleMaintenanceMode(); $this->handleProfiler(); $this->handleSSLRedirection(); Plugin\Manager::getInstance()->loadPluginTranslations(); Plugin\Manager::getInstance()->loadActivatedPlugins(); // try to connect to the database try { Db::createDatabaseObject(); Db::fetchAll("SELECT DATABASE()"); } catch (Exception $exception) { if (self::shouldRethrowException()) { throw $exception; } Log::debug($exception); /** * Triggered when Piwik cannot connect to the database. * * This event can be used to start the installation process or to display a custom error * message. * * @param Exception $exception The exception thrown from creating and testing the database * connection. */ Piwik::postEvent('Db.cannotConnectToDb', array($exception), $pending = true); throw $exception; } // try to get an option (to check if data can be queried) try { Option::get('TestingIfDatabaseConnectionWorked'); } catch (Exception $exception) { if (self::shouldRethrowException()) { throw $exception; } Log::debug($exception); /** * Triggered when Piwik cannot access database data. * * This event can be used to start the installation process or to display a custom error * message. * * @param Exception $exception The exception thrown from trying to get an option value. */ Piwik::postEvent('Config.badConfigurationFile', array($exception), $pending = true); throw $exception; } // Init the Access object, so that eg. core/Updates/* can enforce Super User and use some APIs Access::getInstance(); /** * Triggered just after the platform is initialized and plugins are loaded. * * This event can be used to do early initialization. * * _Note: At this point the user is not authenticated yet._ */ Piwik::postEvent('Request.dispatchCoreAndPluginUpdatesScreen'); $this->throwIfPiwikVersionIsOlderThanDBSchema(); $module = Piwik::getModule(); $action = Piwik::getAction(); if (empty($module) || empty($action) || $module !== 'Installation' || !in_array($action, array('getInstallationCss', 'getInstallationJs'))) { \Piwik\Plugin\Manager::getInstance()->installLoadedPlugins(); } // ensure the current Piwik URL is known for later use if (method_exists('Piwik\SettingsPiwik', 'getPiwikUrl')) { SettingsPiwik::getPiwikUrl(); } $loggedIn = false; // try authenticating w/ session first... $sessionAuth = $this->makeSessionAuthenticator(); if ($sessionAuth) { $loggedIn = Access::getInstance()->reloadAccess($sessionAuth); } // ... if session auth fails try normal auth (which will login the anonymous user) if (!$loggedIn) { $authAdapter = $this->makeAuthenticator(); Access::getInstance()->reloadAccess($authAdapter); } else { $this->makeAuthenticator($sessionAuth); // Piwik\Auth must be set to the correct Login plugin } // Force the auth to use the token_auth if specified, so that embed dashboard // and all other non widgetized controller methods works fine if (Common::getRequestVar('token_auth', false, 'string') !== false) { Request::reloadAuthUsingTokenAuth(); } SettingsServer::raiseMemoryLimitIfNecessary(); \Piwik\Plugin\Manager::getInstance()->postLoadPlugins(); /** * Triggered after the platform is initialized and after the user has been authenticated, but * before the platform has handled the request. * * Piwik uses this event to check for updates to Piwik. */ Piwik::postEvent('Platform.initialized'); }
php
public function init() { if ($this->initialized) { return; } self::setRequestIdHeader(); $this->initialized = true; $tmpPath = StaticContainer::get('path.tmp'); $directoriesToCheck = array( $tmpPath, $tmpPath . '/assets/', $tmpPath . '/cache/', $tmpPath . '/logs/', $tmpPath . '/tcpdf/', $tmpPath . '/templates_c/', ); Filechecks::dieIfDirectoriesNotWritable($directoriesToCheck); $this->handleMaintenanceMode(); $this->handleProfiler(); $this->handleSSLRedirection(); Plugin\Manager::getInstance()->loadPluginTranslations(); Plugin\Manager::getInstance()->loadActivatedPlugins(); // try to connect to the database try { Db::createDatabaseObject(); Db::fetchAll("SELECT DATABASE()"); } catch (Exception $exception) { if (self::shouldRethrowException()) { throw $exception; } Log::debug($exception); /** * Triggered when Piwik cannot connect to the database. * * This event can be used to start the installation process or to display a custom error * message. * * @param Exception $exception The exception thrown from creating and testing the database * connection. */ Piwik::postEvent('Db.cannotConnectToDb', array($exception), $pending = true); throw $exception; } // try to get an option (to check if data can be queried) try { Option::get('TestingIfDatabaseConnectionWorked'); } catch (Exception $exception) { if (self::shouldRethrowException()) { throw $exception; } Log::debug($exception); /** * Triggered when Piwik cannot access database data. * * This event can be used to start the installation process or to display a custom error * message. * * @param Exception $exception The exception thrown from trying to get an option value. */ Piwik::postEvent('Config.badConfigurationFile', array($exception), $pending = true); throw $exception; } // Init the Access object, so that eg. core/Updates/* can enforce Super User and use some APIs Access::getInstance(); /** * Triggered just after the platform is initialized and plugins are loaded. * * This event can be used to do early initialization. * * _Note: At this point the user is not authenticated yet._ */ Piwik::postEvent('Request.dispatchCoreAndPluginUpdatesScreen'); $this->throwIfPiwikVersionIsOlderThanDBSchema(); $module = Piwik::getModule(); $action = Piwik::getAction(); if (empty($module) || empty($action) || $module !== 'Installation' || !in_array($action, array('getInstallationCss', 'getInstallationJs'))) { \Piwik\Plugin\Manager::getInstance()->installLoadedPlugins(); } // ensure the current Piwik URL is known for later use if (method_exists('Piwik\SettingsPiwik', 'getPiwikUrl')) { SettingsPiwik::getPiwikUrl(); } $loggedIn = false; // try authenticating w/ session first... $sessionAuth = $this->makeSessionAuthenticator(); if ($sessionAuth) { $loggedIn = Access::getInstance()->reloadAccess($sessionAuth); } // ... if session auth fails try normal auth (which will login the anonymous user) if (!$loggedIn) { $authAdapter = $this->makeAuthenticator(); Access::getInstance()->reloadAccess($authAdapter); } else { $this->makeAuthenticator($sessionAuth); // Piwik\Auth must be set to the correct Login plugin } // Force the auth to use the token_auth if specified, so that embed dashboard // and all other non widgetized controller methods works fine if (Common::getRequestVar('token_auth', false, 'string') !== false) { Request::reloadAuthUsingTokenAuth(); } SettingsServer::raiseMemoryLimitIfNecessary(); \Piwik\Plugin\Manager::getInstance()->postLoadPlugins(); /** * Triggered after the platform is initialized and after the user has been authenticated, but * before the platform has handled the request. * * Piwik uses this event to check for updates to Piwik. */ Piwik::postEvent('Platform.initialized'); }
[ "public", "function", "init", "(", ")", "{", "if", "(", "$", "this", "->", "initialized", ")", "{", "return", ";", "}", "self", "::", "setRequestIdHeader", "(", ")", ";", "$", "this", "->", "initialized", "=", "true", ";", "$", "tmpPath", "=", "Stati...
Must be called before dispatch() - checks that directories are writable, - loads the configuration file, - loads the plugin, - inits the DB connection, - etc. @throws Exception @return void
[ "Must", "be", "called", "before", "dispatch", "()", "-", "checks", "that", "directories", "are", "writable", "-", "loads", "the", "configuration", "file", "-", "loads", "the", "plugin", "-", "inits", "the", "DB", "connection", "-", "etc", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/FrontController.php#L286-L425
train
Initializes the language
[ 30522, 2270, 3853, 1999, 4183, 1006, 1007, 1063, 2065, 1006, 1002, 2023, 1011, 1028, 3988, 3550, 1007, 1063, 2709, 1025, 1065, 2969, 1024, 1024, 2275, 2890, 15500, 3593, 4974, 2121, 1006, 1007, 1025, 1002, 2023, 1011, 1028, 3988, 3550, 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/LocationProvider/GeoIp/Php.php
Php.isWorking
public function isWorking() { if (!function_exists('mb_internal_encoding')) { return Piwik::translate('UserCountry_GeoIPCannotFindMbstringExtension', array('mb_internal_encoding', 'mbstring')); } $geoIpError = false; $catchGeoIpError = function ($errno, $errstr, $errfile, $errline) use (&$geoIpError) { $filename = basename($errfile); if ($filename == 'geoip.inc' || $filename == 'geoipcity.inc' ) { $geoIpError = array($errno, $errstr, $errfile, $errline); } else { throw new \Exception("Error in PHP GeoIP provider: $errstr on line $errline of $errfile"); // unexpected } }; // catch GeoIP errors set_error_handler($catchGeoIpError); $result = parent::isWorking(); restore_error_handler(); if ($geoIpError) { list($errno, $errstr, $errfile, $errline) = $geoIpError; Log::warning("Got GeoIP error when testing PHP GeoIP location provider: %s(%s): %s", $errfile, $errline, $errstr); return Piwik::translate('UserCountry_GeoIPIncorrectDatabaseFormat'); } return $result; }
php
public function isWorking() { if (!function_exists('mb_internal_encoding')) { return Piwik::translate('UserCountry_GeoIPCannotFindMbstringExtension', array('mb_internal_encoding', 'mbstring')); } $geoIpError = false; $catchGeoIpError = function ($errno, $errstr, $errfile, $errline) use (&$geoIpError) { $filename = basename($errfile); if ($filename == 'geoip.inc' || $filename == 'geoipcity.inc' ) { $geoIpError = array($errno, $errstr, $errfile, $errline); } else { throw new \Exception("Error in PHP GeoIP provider: $errstr on line $errline of $errfile"); // unexpected } }; // catch GeoIP errors set_error_handler($catchGeoIpError); $result = parent::isWorking(); restore_error_handler(); if ($geoIpError) { list($errno, $errstr, $errfile, $errline) = $geoIpError; Log::warning("Got GeoIP error when testing PHP GeoIP location provider: %s(%s): %s", $errfile, $errline, $errstr); return Piwik::translate('UserCountry_GeoIPIncorrectDatabaseFormat'); } return $result; }
[ "public", "function", "isWorking", "(", ")", "{", "if", "(", "!", "function_exists", "(", "'mb_internal_encoding'", ")", ")", "{", "return", "Piwik", "::", "translate", "(", "'UserCountry_GeoIPCannotFindMbstringExtension'", ",", "array", "(", "'mb_internal_encoding'",...
Returns true if this provider has been setup correctly, the error message if otherwise. @return bool|string
[ "Returns", "true", "if", "this", "provider", "has", "been", "setup", "correctly", "the", "error", "message", "if", "otherwise", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UserCountry/LocationProvider/GeoIp/Php.php#L208-L240
train
Returns true if the GeoIP location provider is working
[ 30522, 2270, 3853, 2003, 21398, 1006, 1007, 1063, 2065, 1006, 999, 3853, 1035, 6526, 1006, 1005, 16914, 1035, 4722, 1035, 17181, 1005, 1007, 1007, 1063, 2709, 14255, 9148, 2243, 1024, 1024, 17637, 1006, 1005, 5310, 3597, 16671, 2854, 1035, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
plugins/SitesManager/API.php
API.setDefaultTimezone
public function setDefaultTimezone($defaultTimezone) { Piwik::checkUserHasSuperUserAccess(); $this->checkValidTimezone($defaultTimezone); Option::set(self::OPTION_DEFAULT_TIMEZONE, $defaultTimezone); return true; }
php
public function setDefaultTimezone($defaultTimezone) { Piwik::checkUserHasSuperUserAccess(); $this->checkValidTimezone($defaultTimezone); Option::set(self::OPTION_DEFAULT_TIMEZONE, $defaultTimezone); return true; }
[ "public", "function", "setDefaultTimezone", "(", "$", "defaultTimezone", ")", "{", "Piwik", "::", "checkUserHasSuperUserAccess", "(", ")", ";", "$", "this", "->", "checkValidTimezone", "(", "$", "defaultTimezone", ")", ";", "Option", "::", "set", "(", "self", ...
Sets the default timezone that will be used when creating websites @param string $defaultTimezone Timezone string eg. Europe/Paris or UTC+8 @return bool
[ "Sets", "the", "default", "timezone", "that", "will", "be", "used", "when", "creating", "websites" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SitesManager/API.php#L1199-L1205
train
Set the default timezone for all languages.
[ 30522, 2270, 3853, 2275, 3207, 7011, 11314, 7292, 15975, 1006, 1002, 12398, 7292, 15975, 1007, 1063, 14255, 9148, 2243, 1024, 1024, 4638, 20330, 14949, 6342, 4842, 20330, 6305, 9623, 2015, 1006, 1007, 1025, 1002, 2023, 1011, 1028, 4638, 101...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/Security/Core/Encoder/MessageDigestPasswordEncoder.php
MessageDigestPasswordEncoder.encodePassword
public function encodePassword($raw, $salt) { if ($this->isPasswordTooLong($raw)) { throw new BadCredentialsException('Invalid password.'); } if (!\in_array($this->algorithm, hash_algos(), true)) { throw new \LogicException(sprintf('The algorithm "%s" is not supported.', $this->algorithm)); } $salted = $this->mergePasswordAndSalt($raw, $salt); $digest = hash($this->algorithm, $salted, true); // "stretch" hash for ($i = 1; $i < $this->iterations; ++$i) { $digest = hash($this->algorithm, $digest.$salted, true); } return $this->encodeHashAsBase64 ? base64_encode($digest) : bin2hex($digest); }
php
public function encodePassword($raw, $salt) { if ($this->isPasswordTooLong($raw)) { throw new BadCredentialsException('Invalid password.'); } if (!\in_array($this->algorithm, hash_algos(), true)) { throw new \LogicException(sprintf('The algorithm "%s" is not supported.', $this->algorithm)); } $salted = $this->mergePasswordAndSalt($raw, $salt); $digest = hash($this->algorithm, $salted, true); // "stretch" hash for ($i = 1; $i < $this->iterations; ++$i) { $digest = hash($this->algorithm, $digest.$salted, true); } return $this->encodeHashAsBase64 ? base64_encode($digest) : bin2hex($digest); }
[ "public", "function", "encodePassword", "(", "$", "raw", ",", "$", "salt", ")", "{", "if", "(", "$", "this", "->", "isPasswordTooLong", "(", "$", "raw", ")", ")", "{", "throw", "new", "BadCredentialsException", "(", "'Invalid password.'", ")", ";", "}", ...
{@inheritdoc}
[ "{" ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Security/Core/Encoder/MessageDigestPasswordEncoder.php#L42-L61
train
Encode the password using the algorithm and salt
[ 30522, 2270, 3853, 4372, 16044, 15194, 18351, 1006, 1002, 6315, 1010, 1002, 5474, 1007, 1063, 2065, 1006, 1002, 2023, 1011, 1028, 2003, 15194, 18351, 3406, 12898, 3070, 1006, 1002, 6315, 1007, 1007, 1063, 5466, 2047, 2919, 16748, 16454, 263...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/Cache/Adapter/ProxyAdapter.php
ProxyAdapter.getItem
public function getItem($key) { $f = $this->createCacheItem; $item = $this->pool->getItem($this->getId($key)); return $f($key, $item); }
php
public function getItem($key) { $f = $this->createCacheItem; $item = $this->pool->getItem($this->getId($key)); return $f($key, $item); }
[ "public", "function", "getItem", "(", "$", "key", ")", "{", "$", "f", "=", "$", "this", "->", "createCacheItem", ";", "$", "item", "=", "$", "this", "->", "pool", "->", "getItem", "(", "$", "this", "->", "getId", "(", "$", "key", ")", ")", ";", ...
{@inheritdoc}
[ "{" ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Cache/Adapter/ProxyAdapter.php#L118-L124
train
Get an item from the cache
[ 30522, 2270, 3853, 2131, 4221, 2213, 1006, 1002, 3145, 1007, 1063, 1002, 1042, 1027, 1002, 2023, 1011, 1028, 3443, 3540, 5403, 4221, 2213, 1025, 1002, 8875, 1027, 1002, 2023, 1011, 1028, 4770, 1011, 1028, 2131, 4221, 2213, 1006, 1002, 202...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeImmutableToDateTimeTransformer.php
DateTimeImmutableToDateTimeTransformer.reverseTransform
public function reverseTransform($value) { if (null === $value) { return null; } if (!$value instanceof \DateTime) { throw new TransformationFailedException('Expected a \DateTime.'); } return \DateTimeImmutable::createFromMutable($value); }
php
public function reverseTransform($value) { if (null === $value) { return null; } if (!$value instanceof \DateTime) { throw new TransformationFailedException('Expected a \DateTime.'); } return \DateTimeImmutable::createFromMutable($value); }
[ "public", "function", "reverseTransform", "(", "$", "value", ")", "{", "if", "(", "null", "===", "$", "value", ")", "{", "return", "null", ";", "}", "if", "(", "!", "$", "value", "instanceof", "\\", "DateTime", ")", "{", "throw", "new", "Transformation...
Transforms a DateTime object into a DateTimeImmutable object. @param \DateTime|null $value A DateTime object @return \DateTimeImmutable|null A DateTimeImmutable object @throws TransformationFailedException If the given value is not a \DateTime
[ "Transforms", "a", "DateTime", "object", "into", "a", "DateTimeImmutable", "object", "." ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeImmutableToDateTimeTransformer.php#L55-L66
train
Transforms a DateTime object into a DateTimeImmutable object
[ 30522, 2270, 3853, 7901, 6494, 3619, 14192, 1006, 1002, 3643, 1007, 1063, 2065, 1006, 19701, 1027, 1027, 1027, 1002, 3643, 1007, 1063, 2709, 19701, 1025, 1065, 2065, 1006, 999, 1002, 3643, 6013, 11253, 1032, 3058, 7292, 1007, 1063, 5466, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
libs/Zend/Cache/Backend/Sqlite.php
Zend_Cache_Backend_Sqlite.load
public function load($id, $doNotTestCacheValidity = false) { $this->_checkAndBuildStructure(); $sql = "SELECT content FROM cache WHERE id='$id'"; if (!$doNotTestCacheValidity) { $sql = $sql . " AND (expire=0 OR expire>" . time() . ')'; } $result = $this->_query($sql); $row = @sqlite_fetch_array($result); if ($row) { return $row['content']; } return false; }
php
public function load($id, $doNotTestCacheValidity = false) { $this->_checkAndBuildStructure(); $sql = "SELECT content FROM cache WHERE id='$id'"; if (!$doNotTestCacheValidity) { $sql = $sql . " AND (expire=0 OR expire>" . time() . ')'; } $result = $this->_query($sql); $row = @sqlite_fetch_array($result); if ($row) { return $row['content']; } return false; }
[ "public", "function", "load", "(", "$", "id", ",", "$", "doNotTestCacheValidity", "=", "false", ")", "{", "$", "this", "->", "_checkAndBuildStructure", "(", ")", ";", "$", "sql", "=", "\"SELECT content FROM cache WHERE id='$id'\"", ";", "if", "(", "!", "$", ...
Test if a cache is available for the given id and (if yes) return it (false else) @param string $id Cache id @param boolean $doNotTestCacheValidity If set to true, the cache validity won't be tested @return string|false Cached datas
[ "Test", "if", "a", "cache", "is", "available", "for", "the", "given", "id", "and", "(", "if", "yes", ")", "return", "it", "(", "false", "else", ")" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache/Backend/Sqlite.php#L113-L126
train
Load a language from the cache
[ 30522, 2270, 3853, 7170, 1006, 1002, 8909, 1010, 1002, 2123, 28495, 3367, 3540, 16179, 11475, 25469, 1027, 6270, 1007, 1063, 1002, 2023, 1011, 1028, 1035, 4638, 5685, 8569, 4014, 5104, 18300, 5397, 1006, 1007, 1025, 1002, 29296, 1027, 1000,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/Security/Http/RememberMe/AbstractRememberMeServices.php
AbstractRememberMeServices.cancelCookie
protected function cancelCookie(Request $request) { if (null !== $this->logger) { $this->logger->debug('Clearing remember-me cookie.', ['name' => $this->options['name']]); } $request->attributes->set(self::COOKIE_ATTR_NAME, new Cookie($this->options['name'], null, 1, $this->options['path'], $this->options['domain'], $this->options['secure'] ?? $request->isSecure(), $this->options['httponly'], false, $this->options['samesite'] ?? null)); }
php
protected function cancelCookie(Request $request) { if (null !== $this->logger) { $this->logger->debug('Clearing remember-me cookie.', ['name' => $this->options['name']]); } $request->attributes->set(self::COOKIE_ATTR_NAME, new Cookie($this->options['name'], null, 1, $this->options['path'], $this->options['domain'], $this->options['secure'] ?? $request->isSecure(), $this->options['httponly'], false, $this->options['samesite'] ?? null)); }
[ "protected", "function", "cancelCookie", "(", "Request", "$", "request", ")", "{", "if", "(", "null", "!==", "$", "this", "->", "logger", ")", "{", "$", "this", "->", "logger", "->", "debug", "(", "'Clearing remember-me cookie.'", ",", "[", "'name'", "=>",...
Deletes the remember-me cookie.
[ "Deletes", "the", "remember", "-", "me", "cookie", "." ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Security/Http/RememberMe/AbstractRememberMeServices.php#L268-L275
train
Cancels the remember - me cookie
[ 30522, 5123, 3853, 17542, 3597, 23212, 2063, 1006, 5227, 1002, 5227, 1007, 1063, 2065, 1006, 19701, 999, 1027, 1027, 1002, 2023, 1011, 1028, 8833, 4590, 1007, 1063, 1002, 2023, 1011, 1028, 8833, 4590, 1011, 1028, 2139, 8569, 2290, 1006, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
core/LogDeleter.php
LogDeleter.deleteVisitsFor
public function deleteVisitsFor($startDatetime, $endDatetime, $idSite = null, $iterationStep = 1000, $afterChunkDeleted = null) { $fields = array('idvisit'); $conditions = array(); if (!empty($startDatetime)) { $conditions[] = array('visit_last_action_time', '>=', $startDatetime); } if (!empty($endDatetime)) { $conditions[] = array('visit_last_action_time', '<', $endDatetime); } if (!empty($idSite)) { $conditions[] = array('idsite', '=', $idSite); } $logsDeleted = 0; $logPurger = $this; $this->rawLogDao->forAllLogs('log_visit', $fields, $conditions, $iterationStep, function ($logs) use ($logPurger, &$logsDeleted, $afterChunkDeleted) { $ids = array_map(function ($row) { return reset($row); }, $logs); $logsDeleted += $logPurger->deleteVisits($ids); if (!empty($afterChunkDeleted)) { $afterChunkDeleted($logsDeleted); } }); return $logsDeleted; }
php
public function deleteVisitsFor($startDatetime, $endDatetime, $idSite = null, $iterationStep = 1000, $afterChunkDeleted = null) { $fields = array('idvisit'); $conditions = array(); if (!empty($startDatetime)) { $conditions[] = array('visit_last_action_time', '>=', $startDatetime); } if (!empty($endDatetime)) { $conditions[] = array('visit_last_action_time', '<', $endDatetime); } if (!empty($idSite)) { $conditions[] = array('idsite', '=', $idSite); } $logsDeleted = 0; $logPurger = $this; $this->rawLogDao->forAllLogs('log_visit', $fields, $conditions, $iterationStep, function ($logs) use ($logPurger, &$logsDeleted, $afterChunkDeleted) { $ids = array_map(function ($row) { return reset($row); }, $logs); $logsDeleted += $logPurger->deleteVisits($ids); if (!empty($afterChunkDeleted)) { $afterChunkDeleted($logsDeleted); } }); return $logsDeleted; }
[ "public", "function", "deleteVisitsFor", "(", "$", "startDatetime", ",", "$", "endDatetime", ",", "$", "idSite", "=", "null", ",", "$", "iterationStep", "=", "1000", ",", "$", "afterChunkDeleted", "=", "null", ")", "{", "$", "fields", "=", "array", "(", ...
Deletes visits within the specified date range and belonging to the specified site (if any). Visits are deleted in chunks, so only `$iterationStep` visits are deleted at a time. @param string|null $startDatetime A datetime string. Visits that occur at this time or after are deleted. If not supplied, visits from the beginning of time are deleted. @param string|null $endDatetime A datetime string. Visits that occur before this time are deleted. If not supplied, visits from the end of time are deleted. @param int|null $idSite The site to delete visits from. @param int $iterationStep The number of visits to delete at a single time. @param callable $afterChunkDeleted Callback executed after every chunk of visits are deleted. @return int The number of visits deleted.
[ "Deletes", "visits", "within", "the", "specified", "date", "range", "and", "belonging", "to", "the", "specified", "site", "(", "if", "any", ")", ".", "Visits", "are", "deleted", "in", "chunks", "so", "only", "$iterationStep", "visits", "are", "deleted", "at"...
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/LogDeleter.php#L72-L101
train
Delete visits for a given start and end date
[ 30522, 2270, 3853, 3972, 12870, 11365, 12762, 29278, 1006, 1002, 2707, 13701, 7292, 1010, 1002, 2203, 13701, 7292, 1010, 1002, 8909, 28032, 2063, 1027, 19701, 1010, 1002, 27758, 13473, 2361, 1027, 6694, 1010, 1002, 2044, 20760, 8950, 9247, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
laravel/framework
src/Illuminate/Broadcasting/BroadcastManager.php
BroadcastManager.socket
public function socket($request = null) { if (! $request && ! $this->app->bound('request')) { return; } $request = $request ?: $this->app['request']; return $request->header('X-Socket-ID'); }
php
public function socket($request = null) { if (! $request && ! $this->app->bound('request')) { return; } $request = $request ?: $this->app['request']; return $request->header('X-Socket-ID'); }
[ "public", "function", "socket", "(", "$", "request", "=", "null", ")", "{", "if", "(", "!", "$", "request", "&&", "!", "$", "this", "->", "app", "->", "bound", "(", "'request'", ")", ")", "{", "return", ";", "}", "$", "request", "=", "$", "reques...
Get the socket ID for the given request. @param \Illuminate\Http\Request|null $request @return string|null
[ "Get", "the", "socket", "ID", "for", "the", "given", "request", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Broadcasting/BroadcastManager.php#L81-L90
train
Get the socket id
[ 30522, 2270, 3853, 22278, 1006, 1002, 5227, 1027, 19701, 1007, 1063, 2065, 1006, 999, 1002, 5227, 1004, 1004, 999, 1002, 2023, 1011, 1028, 10439, 1011, 1028, 5391, 1006, 1005, 5227, 1005, 1007, 1007, 1063, 2709, 1025, 1065, 1002, 5227, 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/FormatsMessages.php
FormatsMessages.getDisplayableAttribute
public function getDisplayableAttribute($attribute) { $primaryAttribute = $this->getPrimaryAttribute($attribute); $expectedAttributes = $attribute != $primaryAttribute ? [$attribute, $primaryAttribute] : [$attribute]; foreach ($expectedAttributes as $name) { // The developer may dynamically specify the array of custom attributes on this // validator instance. If the attribute exists in this array it is used over // the other ways of pulling the attribute name for this given attributes. if (isset($this->customAttributes[$name])) { return $this->customAttributes[$name]; } // We allow for a developer to specify language lines for any attribute in this // application, which allows flexibility for displaying a unique displayable // version of the attribute name instead of the name used in an HTTP POST. if ($line = $this->getAttributeFromTranslations($name)) { return $line; } } // When no language line has been specified for the attribute and it is also // an implicit attribute we will display the raw attribute's name and not // modify it with any of these replacements before we display the name. if (isset($this->implicitAttributes[$primaryAttribute])) { return $attribute; } return str_replace('_', ' ', Str::snake($attribute)); }
php
public function getDisplayableAttribute($attribute) { $primaryAttribute = $this->getPrimaryAttribute($attribute); $expectedAttributes = $attribute != $primaryAttribute ? [$attribute, $primaryAttribute] : [$attribute]; foreach ($expectedAttributes as $name) { // The developer may dynamically specify the array of custom attributes on this // validator instance. If the attribute exists in this array it is used over // the other ways of pulling the attribute name for this given attributes. if (isset($this->customAttributes[$name])) { return $this->customAttributes[$name]; } // We allow for a developer to specify language lines for any attribute in this // application, which allows flexibility for displaying a unique displayable // version of the attribute name instead of the name used in an HTTP POST. if ($line = $this->getAttributeFromTranslations($name)) { return $line; } } // When no language line has been specified for the attribute and it is also // an implicit attribute we will display the raw attribute's name and not // modify it with any of these replacements before we display the name. if (isset($this->implicitAttributes[$primaryAttribute])) { return $attribute; } return str_replace('_', ' ', Str::snake($attribute)); }
[ "public", "function", "getDisplayableAttribute", "(", "$", "attribute", ")", "{", "$", "primaryAttribute", "=", "$", "this", "->", "getPrimaryAttribute", "(", "$", "attribute", ")", ";", "$", "expectedAttributes", "=", "$", "attribute", "!=", "$", "primaryAttrib...
Get the displayable name of the attribute. @param string $attribute @return string
[ "Get", "the", "displayable", "name", "of", "the", "attribute", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Validation/Concerns/FormatsMessages.php#L226-L257
train
Returns the displayable attribute name
[ 30522, 2270, 3853, 2131, 10521, 13068, 3085, 19321, 3089, 8569, 2618, 1006, 1002, 17961, 1007, 1063, 1002, 3078, 19321, 3089, 8569, 2618, 1027, 1002, 2023, 1011, 1028, 2131, 18098, 9581, 20444, 4779, 3089, 8569, 2618, 1006, 1002, 17961, 100...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
libs/Zend/Db/Table/Abstract.php
Zend_Db_Table_Abstract.addReference
public function addReference($ruleKey, $columns, $refTableClass, $refColumns, $onDelete = null, $onUpdate = null) { $reference = array(self::COLUMNS => (array) $columns, self::REF_TABLE_CLASS => $refTableClass, self::REF_COLUMNS => (array) $refColumns); if (!empty($onDelete)) { $reference[self::ON_DELETE] = $onDelete; } if (!empty($onUpdate)) { $reference[self::ON_UPDATE] = $onUpdate; } $this->_referenceMap[$ruleKey] = $reference; return $this; }
php
public function addReference($ruleKey, $columns, $refTableClass, $refColumns, $onDelete = null, $onUpdate = null) { $reference = array(self::COLUMNS => (array) $columns, self::REF_TABLE_CLASS => $refTableClass, self::REF_COLUMNS => (array) $refColumns); if (!empty($onDelete)) { $reference[self::ON_DELETE] = $onDelete; } if (!empty($onUpdate)) { $reference[self::ON_UPDATE] = $onUpdate; } $this->_referenceMap[$ruleKey] = $reference; return $this; }
[ "public", "function", "addReference", "(", "$", "ruleKey", ",", "$", "columns", ",", "$", "refTableClass", ",", "$", "refColumns", ",", "$", "onDelete", "=", "null", ",", "$", "onUpdate", "=", "null", ")", "{", "$", "reference", "=", "array", "(", "sel...
Add a reference to the reference map @param string $ruleKey @param string|array $columns @param string $refTableClass @param string|array $refColumns @param string $onDelete @param string $onUpdate @return Zend_Db_Table_Abstract
[ "Add", "a", "reference", "to", "the", "reference", "map" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Table/Abstract.php#L423-L441
train
Add reference to the reference map
[ 30522, 2270, 3853, 5587, 2890, 25523, 1006, 1002, 3627, 14839, 1010, 1002, 7753, 1010, 1002, 25416, 10880, 26266, 1010, 1002, 25416, 25778, 2819, 3619, 1010, 1002, 2006, 9247, 12870, 1027, 19701, 1010, 1002, 2006, 6279, 13701, 1027, 19701, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
laravel/framework
src/Illuminate/Routing/RoutingServiceProvider.php
RoutingServiceProvider.registerRedirector
protected function registerRedirector() { $this->app->singleton('redirect', function ($app) { $redirector = new Redirector($app['url']); // If the session is set on the application instance, we'll inject it into // the redirector instance. This allows the redirect responses to allow // for the quite convenient "with" methods that flash to the session. if (isset($app['session.store'])) { $redirector->setSession($app['session.store']); } return $redirector; }); }
php
protected function registerRedirector() { $this->app->singleton('redirect', function ($app) { $redirector = new Redirector($app['url']); // If the session is set on the application instance, we'll inject it into // the redirector instance. This allows the redirect responses to allow // for the quite convenient "with" methods that flash to the session. if (isset($app['session.store'])) { $redirector->setSession($app['session.store']); } return $redirector; }); }
[ "protected", "function", "registerRedirector", "(", ")", "{", "$", "this", "->", "app", "->", "singleton", "(", "'redirect'", ",", "function", "(", "$", "app", ")", "{", "$", "redirector", "=", "new", "Redirector", "(", "$", "app", "[", "'url'", "]", "...
Register the Redirector service. @return void
[ "Register", "the", "Redirector", "service", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/RoutingServiceProvider.php#L104-L118
train
Register redirector.
[ 30522, 5123, 3853, 4236, 5596, 7442, 16761, 1006, 1007, 1063, 1002, 2023, 1011, 1028, 10439, 1011, 1028, 28159, 1006, 1005, 2417, 7442, 6593, 1005, 1010, 3853, 1006, 1002, 10439, 1007, 1063, 1002, 2417, 7442, 16761, 1027, 2047, 2417, 7442, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/HttpKernel/Fragment/AbstractSurrogateFragmentRenderer.php
AbstractSurrogateFragmentRenderer.render
public function render($uri, Request $request, array $options = []) { if (!$this->surrogate || !$this->surrogate->hasSurrogateCapability($request)) { if ($uri instanceof ControllerReference && $this->containsNonScalars($uri->attributes)) { throw new \InvalidArgumentException('Passing non-scalar values as part of URI attributes to the ESI and SSI rendering strategies is not supported. Use a different rendering strategy or pass scalar values.'); } return $this->inlineStrategy->render($uri, $request, $options); } if ($uri instanceof ControllerReference) { $uri = $this->generateSignedFragmentUri($uri, $request); } $alt = isset($options['alt']) ? $options['alt'] : null; if ($alt instanceof ControllerReference) { $alt = $this->generateSignedFragmentUri($alt, $request); } $tag = $this->surrogate->renderIncludeTag($uri, $alt, isset($options['ignore_errors']) ? $options['ignore_errors'] : false, isset($options['comment']) ? $options['comment'] : ''); return new Response($tag); }
php
public function render($uri, Request $request, array $options = []) { if (!$this->surrogate || !$this->surrogate->hasSurrogateCapability($request)) { if ($uri instanceof ControllerReference && $this->containsNonScalars($uri->attributes)) { throw new \InvalidArgumentException('Passing non-scalar values as part of URI attributes to the ESI and SSI rendering strategies is not supported. Use a different rendering strategy or pass scalar values.'); } return $this->inlineStrategy->render($uri, $request, $options); } if ($uri instanceof ControllerReference) { $uri = $this->generateSignedFragmentUri($uri, $request); } $alt = isset($options['alt']) ? $options['alt'] : null; if ($alt instanceof ControllerReference) { $alt = $this->generateSignedFragmentUri($alt, $request); } $tag = $this->surrogate->renderIncludeTag($uri, $alt, isset($options['ignore_errors']) ? $options['ignore_errors'] : false, isset($options['comment']) ? $options['comment'] : ''); return new Response($tag); }
[ "public", "function", "render", "(", "$", "uri", ",", "Request", "$", "request", ",", "array", "$", "options", "=", "[", "]", ")", "{", "if", "(", "!", "$", "this", "->", "surrogate", "||", "!", "$", "this", "->", "surrogate", "->", "hasSurrogateCapa...
{@inheritdoc} Note that if the current Request has no surrogate capability, this method falls back to use the inline rendering strategy. Additional available options: * alt: an alternative URI to render in case of an error * comment: a comment to add when returning the surrogate tag Note, that not all surrogate strategies support all options. For now 'alt' and 'comment' are only supported by ESI. @see Symfony\Component\HttpKernel\HttpCache\SurrogateInterface
[ "{", "@inheritdoc", "}" ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpKernel/Fragment/AbstractSurrogateFragmentRenderer.php#L62-L84
train
Renders the URI
[ 30522, 2270, 3853, 17552, 1006, 30524, 21799, 17695, 8010, 1006, 1002, 5227, 1007, 1007, 1063, 2065, 1006, 1002, 24471, 2072, 6013, 11253, 11486, 2890, 25523, 1004, 1004, 1002, 2023, 1011, 1028, 3397, 8540, 15782, 28695, 1006, 1002, 24471, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
getgrav/grav
system/src/Grav/Common/Page/Pages.php
Pages.arrayShuffle
protected function arrayShuffle($list) { $keys = array_keys($list); shuffle($keys); $new = []; foreach ($keys as $key) { $new[$key] = $list[$key]; } return $new; }
php
protected function arrayShuffle($list) { $keys = array_keys($list); shuffle($keys); $new = []; foreach ($keys as $key) { $new[$key] = $list[$key]; } return $new; }
[ "protected", "function", "arrayShuffle", "(", "$", "list", ")", "{", "$", "keys", "=", "array_keys", "(", "$", "list", ")", ";", "shuffle", "(", "$", "keys", ")", ";", "$", "new", "=", "[", "]", ";", "foreach", "(", "$", "keys", "as", "$", "key",...
Shuffles an associative array @param array $list @return array
[ "Shuffles", "an", "associative", "array" ]
1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72
https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Page/Pages.php#L1392-L1403
train
Shuffle the list of all the keys in the array
[ 30522, 5123, 3853, 27448, 6979, 18142, 1006, 1002, 2862, 1007, 1063, 1002, 6309, 1027, 9140, 1035, 6309, 1006, 1002, 2862, 1007, 1025, 23046, 1006, 1002, 6309, 1007, 1025, 1002, 2047, 1027, 1031, 1033, 1025, 18921, 6776, 1006, 1002, 6309, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
laravel/framework
src/Illuminate/Database/Eloquent/FactoryBuilder.php
FactoryBuilder.store
protected function store($results) { $results->each(function ($model) { if (! isset($this->connection)) { $model->setConnection($model->newQueryWithoutScopes()->getConnection()->getName()); } $model->save(); }); }
php
protected function store($results) { $results->each(function ($model) { if (! isset($this->connection)) { $model->setConnection($model->newQueryWithoutScopes()->getConnection()->getName()); } $model->save(); }); }
[ "protected", "function", "store", "(", "$", "results", ")", "{", "$", "results", "->", "each", "(", "function", "(", "$", "model", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "connection", ")", ")", "{", "$", "model", "->", "setConne...
Set the connection name on the results and store them. @param \Illuminate\Support\Collection $results @return void
[ "Set", "the", "connection", "name", "on", "the", "results", "and", "store", "them", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/FactoryBuilder.php#L199-L208
train
Stores the results into the database
[ 30522, 5123, 3853, 3573, 1006, 1002, 3463, 1007, 1063, 1002, 3463, 1011, 1028, 2169, 1006, 3853, 1006, 1002, 2944, 1007, 1063, 2065, 1006, 999, 26354, 3388, 1006, 1002, 2023, 1011, 1028, 4434, 1007, 1007, 1063, 1002, 2944, 1011, 1028, 227...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/Form/Extension/Core/Type/CollectionType.php
CollectionType.buildForm
public function buildForm(FormBuilderInterface $builder, array $options) { if ($options['allow_add'] && $options['prototype']) { $prototypeOptions = array_replace([ 'required' => $options['required'], 'label' => $options['prototype_name'].'label__', ], $options['entry_options']); if (null !== $options['prototype_data']) { $prototypeOptions['data'] = $options['prototype_data']; } $prototype = $builder->create($options['prototype_name'], $options['entry_type'], $prototypeOptions); $builder->setAttribute('prototype', $prototype->getForm()); } $resizeListener = new ResizeFormListener( $options['entry_type'], $options['entry_options'], $options['allow_add'], $options['allow_delete'], $options['delete_empty'] ); $builder->addEventSubscriber($resizeListener); }
php
public function buildForm(FormBuilderInterface $builder, array $options) { if ($options['allow_add'] && $options['prototype']) { $prototypeOptions = array_replace([ 'required' => $options['required'], 'label' => $options['prototype_name'].'label__', ], $options['entry_options']); if (null !== $options['prototype_data']) { $prototypeOptions['data'] = $options['prototype_data']; } $prototype = $builder->create($options['prototype_name'], $options['entry_type'], $prototypeOptions); $builder->setAttribute('prototype', $prototype->getForm()); } $resizeListener = new ResizeFormListener( $options['entry_type'], $options['entry_options'], $options['allow_add'], $options['allow_delete'], $options['delete_empty'] ); $builder->addEventSubscriber($resizeListener); }
[ "public", "function", "buildForm", "(", "FormBuilderInterface", "$", "builder", ",", "array", "$", "options", ")", "{", "if", "(", "$", "options", "[", "'allow_add'", "]", "&&", "$", "options", "[", "'prototype'", "]", ")", "{", "$", "prototypeOptions", "=...
{@inheritdoc}
[ "{" ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/Extension/Core/Type/CollectionType.php#L27-L52
train
Build the form
[ 30522, 2270, 3853, 3857, 14192, 1006, 2433, 8569, 23891, 6657, 3334, 12172, 1002, 12508, 1010, 9140, 1002, 7047, 1007, 1063, 2065, 1006, 1002, 7047, 1031, 1005, 3499, 1035, 5587, 1005, 1033, 1004, 1004, 1002, 7047, 1031, 1005, 8773, 1005, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
laravel/framework
src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php
HasRelationships.joiningTable
public function joiningTable($related, $instance = null) { // The joining table name, by convention, is simply the snake cased models // sorted alphabetically and concatenated with an underscore, so we can // just sort the models and join them together to get the table name. $segments = [ $instance ? $instance->joiningTableSegment() : Str::snake(class_basename($related)), $this->joiningTableSegment(), ]; // Now that we have the model names in an array we can just sort them and // use the implode function to join them together with an underscores, // which is typically used by convention within the database system. sort($segments); return strtolower(implode('_', $segments)); }
php
public function joiningTable($related, $instance = null) { // The joining table name, by convention, is simply the snake cased models // sorted alphabetically and concatenated with an underscore, so we can // just sort the models and join them together to get the table name. $segments = [ $instance ? $instance->joiningTableSegment() : Str::snake(class_basename($related)), $this->joiningTableSegment(), ]; // Now that we have the model names in an array we can just sort them and // use the implode function to join them together with an underscores, // which is typically used by convention within the database system. sort($segments); return strtolower(implode('_', $segments)); }
[ "public", "function", "joiningTable", "(", "$", "related", ",", "$", "instance", "=", "null", ")", "{", "// The joining table name, by convention, is simply the snake cased models", "// sorted alphabetically and concatenated with an underscore, so we can", "// just sort the models and ...
Get the joining table name for a many-to-many relation. @param string $related @param \Illuminate\Database\Eloquent\Model|null $instance @return string
[ "Get", "the", "joining", "table", "name", "for", "a", "many", "-", "to", "-", "many", "relation", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php#L621-L638
train
Returns the joining table name for the related model
[ 30522, 2270, 3853, 5241, 10880, 1006, 1002, 3141, 1010, 1002, 6013, 1027, 19701, 1007, 1063, 1013, 1013, 1996, 5241, 2795, 2171, 1010, 2011, 4680, 1010, 2003, 3432, 1996, 7488, 2553, 2094, 4275, 1013, 1013, 19616, 12440, 15004, 1998, 9530, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
getgrav/grav
system/src/Grav/Common/GPM/Licenses.php
Licenses.get
public static function get($slug = null) { $licenses = self::getLicenseFile(); $data = (array)$licenses->content(); $licenses->free(); $slug = strtolower($slug); if (!$slug) { return $data['licenses'] ?? []; } return $data['licenses'][$slug] ?? ''; }
php
public static function get($slug = null) { $licenses = self::getLicenseFile(); $data = (array)$licenses->content(); $licenses->free(); $slug = strtolower($slug); if (!$slug) { return $data['licenses'] ?? []; } return $data['licenses'][$slug] ?? ''; }
[ "public", "static", "function", "get", "(", "$", "slug", "=", "null", ")", "{", "$", "licenses", "=", "self", "::", "getLicenseFile", "(", ")", ";", "$", "data", "=", "(", "array", ")", "$", "licenses", "->", "content", "(", ")", ";", "$", "license...
Returns the license for a Premium package @param string $slug @return array|string
[ "Returns", "the", "license", "for", "a", "Premium", "package" ]
1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72
https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/GPM/Licenses.php#L74-L86
train
Get License By Slug
[ 30522, 2270, 10763, 3853, 2131, 1006, 1002, 23667, 1027, 19701, 1007, 1063, 1002, 15943, 1027, 2969, 1024, 1024, 2131, 13231, 12325, 8873, 2571, 1006, 1007, 1025, 1002, 2951, 1027, 1006, 9140, 1007, 1002, 15943, 1011, 1028, 4180, 1006, 1007...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
octobercms/october
modules/backend/behaviors/FormController.php
FormController.update_onDelete
public function update_onDelete($recordId = null) { $this->context = $this->getConfig('update[context]', self::CONTEXT_UPDATE); $model = $this->controller->formFindModelObject($recordId); $this->initForm($model); $model->delete(); $this->controller->formAfterDelete($model); Flash::success($this->getLang("{$this->context}[flashDelete]", 'backend::lang.form.delete_success')); if ($redirect = $this->makeRedirect('delete', $model)) { return $redirect; } }
php
public function update_onDelete($recordId = null) { $this->context = $this->getConfig('update[context]', self::CONTEXT_UPDATE); $model = $this->controller->formFindModelObject($recordId); $this->initForm($model); $model->delete(); $this->controller->formAfterDelete($model); Flash::success($this->getLang("{$this->context}[flashDelete]", 'backend::lang.form.delete_success')); if ($redirect = $this->makeRedirect('delete', $model)) { return $redirect; } }
[ "public", "function", "update_onDelete", "(", "$", "recordId", "=", "null", ")", "{", "$", "this", "->", "context", "=", "$", "this", "->", "getConfig", "(", "'update[context]'", ",", "self", "::", "CONTEXT_UPDATE", ")", ";", "$", "model", "=", "$", "thi...
AJAX handler "onDelete" called from the update action and used for deleting existing records. This handler will invoke the unique controller override `formAfterDelete`. @param int $recordId Record identifier @return mixed
[ "AJAX", "handler", "onDelete", "called", "from", "the", "update", "action", "and", "used", "for", "deleting", "existing", "records", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/behaviors/FormController.php#L337-L352
train
Delete record action
[ 30522, 2270, 3853, 10651, 1035, 2006, 9247, 12870, 1006, 1002, 2501, 3593, 1027, 19701, 1007, 1063, 1002, 2023, 1011, 1028, 6123, 30524, 16294, 22117, 10244, 4135, 2497, 20614, 1006, 1002, 2501, 3593, 1007, 1025, 1002, 2023, 1011, 1028, 199...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/Form/FormConfigBuilder.php
FormConfigBuilder.setAutoInitialize
public function setAutoInitialize($initialize) { if ($this->locked) { throw new BadMethodCallException('FormConfigBuilder methods cannot be accessed anymore once the builder is turned into a FormConfigInterface instance.'); } $this->autoInitialize = (bool) $initialize; return $this; }
php
public function setAutoInitialize($initialize) { if ($this->locked) { throw new BadMethodCallException('FormConfigBuilder methods cannot be accessed anymore once the builder is turned into a FormConfigInterface instance.'); } $this->autoInitialize = (bool) $initialize; return $this; }
[ "public", "function", "setAutoInitialize", "(", "$", "initialize", ")", "{", "if", "(", "$", "this", "->", "locked", ")", "{", "throw", "new", "BadMethodCallException", "(", "'FormConfigBuilder methods cannot be accessed anymore once the builder is turned into a FormConfigInt...
{@inheritdoc}
[ "{" ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/FormConfigBuilder.php#L740-L749
train
Set whether or not to auto initialize the form
[ 30522, 2270, 3853, 2275, 4887, 3406, 5498, 20925, 4697, 1006, 1002, 3988, 4697, 1007, 1063, 2065, 1006, 1002, 2023, 1011, 1028, 5299, 1007, 1063, 5466, 2047, 2919, 11368, 6806, 16409, 24164, 2595, 24422, 1006, 1005, 2433, 8663, 8873, 18259,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
libs/HTML/QuickForm2/Rule.php
HTML_QuickForm2_Rule.and_
public function and_(HTML_QuickForm2_Rule $next) { if ($next instanceof HTML_QuickForm2_Rule_Required) { throw new HTML_QuickForm2_InvalidArgumentException( 'and_(): Cannot add a "required" rule' ); } $this->chainedRules[count($this->chainedRules) - 1][] = $next; return $this; }
php
public function and_(HTML_QuickForm2_Rule $next) { if ($next instanceof HTML_QuickForm2_Rule_Required) { throw new HTML_QuickForm2_InvalidArgumentException( 'and_(): Cannot add a "required" rule' ); } $this->chainedRules[count($this->chainedRules) - 1][] = $next; return $this; }
[ "public", "function", "and_", "(", "HTML_QuickForm2_Rule", "$", "next", ")", "{", "if", "(", "$", "next", "instanceof", "HTML_QuickForm2_Rule_Required", ")", "{", "throw", "new", "HTML_QuickForm2_InvalidArgumentException", "(", "'and_(): Cannot add a \"required\" rule'", ...
Adds a rule to the chain with an "and" operator Evaluation is short-circuited, next rule will not be evaluated if the previous one returns false. The method is named this way because "and" is a reserved word in PHP. @param HTML_QuickForm2_Rule @return HTML_QuickForm2_Rule first rule in the chain (i.e. $this) @throws HTML_QuickForm2_InvalidArgumentException when trying to add a "required" rule to the chain
[ "Adds", "a", "rule", "to", "the", "chain", "with", "an", "and", "operator" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Rule.php#L202-L211
train
Adds a rule to the chain and returns the current one
[ 30522, 2270, 3853, 1998, 1035, 1006, 16129, 1035, 4248, 14192, 2475, 1035, 3627, 1002, 2279, 1007, 1063, 2065, 1006, 1002, 2279, 6013, 11253, 16129, 1035, 4248, 14192, 2475, 1035, 3627, 1035, 3223, 1007, 1063, 5466, 2047, 16129, 1035, 4248,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
dompdf/dompdf
src/Frame.php
Frame.get_opacity
public function get_opacity($opacity = null) { if ($opacity !== null) { $this->set_opacity($opacity); } return $this->_opacity; }
php
public function get_opacity($opacity = null) { if ($opacity !== null) { $this->set_opacity($opacity); } return $this->_opacity; }
[ "public", "function", "get_opacity", "(", "$", "opacity", "=", "null", ")", "{", "if", "(", "$", "opacity", "!==", "null", ")", "{", "$", "this", "->", "set_opacity", "(", "$", "opacity", ")", ";", "}", "return", "$", "this", "->", "_opacity", ";", ...
@param null $opacity @return float
[ "@param", "null", "$opacity" ]
75f13c700009be21a1965dc2c5b68a8708c22ba2
https://github.com/dompdf/dompdf/blob/75f13c700009be21a1965dc2c5b68a8708c22ba2/src/Frame.php#L635-L642
train
Get the opacity value
[ 30522, 2270, 3853, 2131, 1035, 6728, 6305, 3012, 1006, 1002, 6728, 6305, 3012, 1027, 19701, 1007, 1063, 2065, 1006, 1002, 6728, 6305, 3012, 999, 1027, 1027, 19701, 1007, 1063, 1002, 2023, 1011, 1028, 2275, 1035, 6728, 6305, 3012, 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...
octobercms/october
modules/system/helpers/View.php
View.getGlobalVars
public static function getGlobalVars() { if (static::$globalVarCache !== null) { return static::$globalVarCache; } $vars = array_filter(ViewFacade::getShared(), function ($var) { return is_scalar($var) || is_array($var); }); return static::$globalVarCache = $vars; }
php
public static function getGlobalVars() { if (static::$globalVarCache !== null) { return static::$globalVarCache; } $vars = array_filter(ViewFacade::getShared(), function ($var) { return is_scalar($var) || is_array($var); }); return static::$globalVarCache = $vars; }
[ "public", "static", "function", "getGlobalVars", "(", ")", "{", "if", "(", "static", "::", "$", "globalVarCache", "!==", "null", ")", "{", "return", "static", "::", "$", "globalVarCache", ";", "}", "$", "vars", "=", "array_filter", "(", "ViewFacade", "::",...
Returns shared view variables, this should be used for simple rendering cycles. Such as content blocks and mail templates. @return array
[ "Returns", "shared", "view", "variables", "this", "should", "be", "used", "for", "simple", "rendering", "cycles", ".", "Such", "as", "content", "blocks", "and", "mail", "templates", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/helpers/View.php#L28-L39
train
Get all the global variables
[ 30522, 2270, 10763, 3853, 2131, 23296, 16429, 2389, 10755, 2015, 30524, 3193, 7011, 21869, 1024, 1024, 4152, 8167, 2098, 1006, 1007, 1010, 3853, 1006, 1002, 13075, 1007, 1063, 2709, 2003, 1035, 26743, 2099, 1006, 1002, 13075, 1007, 1064, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
laravel/framework
src/Illuminate/Console/Scheduling/CallbackEvent.php
CallbackEvent.withoutOverlapping
public function withoutOverlapping($expiresAt = 1440) { if (! isset($this->description)) { throw new LogicException( "A scheduled event name is required to prevent overlapping. Use the 'name' method before 'withoutOverlapping'." ); } $this->withoutOverlapping = true; $this->expiresAt = $expiresAt; return $this->skip(function () { return $this->mutex->exists($this); }); }
php
public function withoutOverlapping($expiresAt = 1440) { if (! isset($this->description)) { throw new LogicException( "A scheduled event name is required to prevent overlapping. Use the 'name' method before 'withoutOverlapping'." ); } $this->withoutOverlapping = true; $this->expiresAt = $expiresAt; return $this->skip(function () { return $this->mutex->exists($this); }); }
[ "public", "function", "withoutOverlapping", "(", "$", "expiresAt", "=", "1440", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "description", ")", ")", "{", "throw", "new", "LogicException", "(", "\"A scheduled event name is required to prevent overlap...
Do not allow the event to overlap each other. @param int $expiresAt @return $this @throws \LogicException
[ "Do", "not", "allow", "the", "event", "to", "overlap", "each", "other", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Console/Scheduling/CallbackEvent.php#L106-L121
train
Prevent overlapping events from firing
[ 30522, 2270, 3853, 2302, 7840, 2721, 14853, 1006, 1002, 4654, 20781, 16846, 1027, 14748, 2692, 1007, 1063, 2065, 1006, 999, 26354, 3388, 1006, 1002, 2023, 1011, 1028, 6412, 1007, 1007, 1063, 5466, 2047, 7961, 10288, 24422, 1006, 1000, 1037,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/Device/Client.php
Client.message
public function message(string $deviceId, string $openid, string $content) { $params = [ 'device_type' => $this->app['config']['device_type'], 'device_id' => $deviceId, 'open_id' => $openid, 'content' => base64_encode($content), ]; return $this->httpPostJson('device/transmsg', $params); }
php
public function message(string $deviceId, string $openid, string $content) { $params = [ 'device_type' => $this->app['config']['device_type'], 'device_id' => $deviceId, 'open_id' => $openid, 'content' => base64_encode($content), ]; return $this->httpPostJson('device/transmsg', $params); }
[ "public", "function", "message", "(", "string", "$", "deviceId", ",", "string", "$", "openid", ",", "string", "$", "content", ")", "{", "$", "params", "=", "[", "'device_type'", "=>", "$", "this", "->", "app", "[", "'config'", "]", "[", "'device_type'", ...
@param string $deviceId @param string $openid @param string $content @return array|\EasyWeChat\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string
[ "@param", "string", "$deviceId", "@param", "string", "$openid", "@param", "string", "$content" ]
120c72faaa93c270365bc75c73c362d5fd583209
https://github.com/overtrue/wechat/blob/120c72faaa93c270365bc75c73c362d5fd583209/src/OfficialAccount/Device/Client.php#L32-L42
train
Send a message to the device
[ 30522, 2270, 3853, 4471, 1006, 5164, 1002, 5080, 3593, 1010, 5164, 1002, 2330, 3593, 1010, 5164, 1002, 4180, 1007, 1063, 1002, 11498, 5244, 1027, 1031, 1005, 5080, 1035, 2828, 1005, 1027, 1028, 1002, 2023, 1011, 1028, 10439, 1031, 1005, 9...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
octobercms/october
modules/system/classes/CombineAssets.php
CombineAssets.init
public function init() { /* * Register preferences */ $this->useCache = Config::get('cms.enableAssetCache', false); $this->useMinify = Config::get('cms.enableAssetMinify', null); $this->useDeepHashing = Config::get('cms.enableAssetDeepHashing', null); if ($this->useMinify === null) { $this->useMinify = !Config::get('app.debug', false); } if ($this->useDeepHashing === null) { $this->useDeepHashing = Config::get('app.debug', false); } /* * Register JavaScript filters */ $this->registerFilter('js', new \October\Rain\Parse\Assetic\JavascriptImporter); /* * Register CSS filters */ $this->registerFilter('css', new \Assetic\Filter\CssImportFilter); $this->registerFilter(['css', 'less', 'scss'], new \Assetic\Filter\CssRewriteFilter); $this->registerFilter('less', new \October\Rain\Parse\Assetic\LessCompiler); $this->registerFilter('scss', new \October\Rain\Parse\Assetic\ScssCompiler); /* * Minification filters */ if ($this->useMinify) { $this->registerFilter('js', new \Assetic\Filter\JSMinFilter); $this->registerFilter(['css', 'less', 'scss'], new \October\Rain\Parse\Assetic\StylesheetMinify); } /* * Common Aliases */ $this->registerAlias('jquery', '~/modules/backend/assets/js/vendor/jquery-and-migrate.min.js'); $this->registerAlias('framework', '~/modules/system/assets/js/framework.js'); $this->registerAlias('framework.extras', '~/modules/system/assets/js/framework.extras.js'); $this->registerAlias('framework.extras.js', '~/modules/system/assets/js/framework.extras.js'); $this->registerAlias('framework.extras', '~/modules/system/assets/css/framework.extras.css'); $this->registerAlias('framework.extras.css', '~/modules/system/assets/css/framework.extras.css'); /* * Deferred registration */ foreach (static::$callbacks as $callback) { $callback($this); } }
php
public function init() { /* * Register preferences */ $this->useCache = Config::get('cms.enableAssetCache', false); $this->useMinify = Config::get('cms.enableAssetMinify', null); $this->useDeepHashing = Config::get('cms.enableAssetDeepHashing', null); if ($this->useMinify === null) { $this->useMinify = !Config::get('app.debug', false); } if ($this->useDeepHashing === null) { $this->useDeepHashing = Config::get('app.debug', false); } /* * Register JavaScript filters */ $this->registerFilter('js', new \October\Rain\Parse\Assetic\JavascriptImporter); /* * Register CSS filters */ $this->registerFilter('css', new \Assetic\Filter\CssImportFilter); $this->registerFilter(['css', 'less', 'scss'], new \Assetic\Filter\CssRewriteFilter); $this->registerFilter('less', new \October\Rain\Parse\Assetic\LessCompiler); $this->registerFilter('scss', new \October\Rain\Parse\Assetic\ScssCompiler); /* * Minification filters */ if ($this->useMinify) { $this->registerFilter('js', new \Assetic\Filter\JSMinFilter); $this->registerFilter(['css', 'less', 'scss'], new \October\Rain\Parse\Assetic\StylesheetMinify); } /* * Common Aliases */ $this->registerAlias('jquery', '~/modules/backend/assets/js/vendor/jquery-and-migrate.min.js'); $this->registerAlias('framework', '~/modules/system/assets/js/framework.js'); $this->registerAlias('framework.extras', '~/modules/system/assets/js/framework.extras.js'); $this->registerAlias('framework.extras.js', '~/modules/system/assets/js/framework.extras.js'); $this->registerAlias('framework.extras', '~/modules/system/assets/css/framework.extras.css'); $this->registerAlias('framework.extras.css', '~/modules/system/assets/css/framework.extras.css'); /* * Deferred registration */ foreach (static::$callbacks as $callback) { $callback($this); } }
[ "public", "function", "init", "(", ")", "{", "/*\n * Register preferences\n */", "$", "this", "->", "useCache", "=", "Config", "::", "get", "(", "'cms.enableAssetCache'", ",", "false", ")", ";", "$", "this", "->", "useMinify", "=", "Config", "::"...
Constructor
[ "Constructor" ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/CombineAssets.php#L109-L163
train
Initializes the module
[ 30522, 2270, 3853, 1999, 4183, 1006, 1007, 1063, 1013, 1008, 1008, 4236, 18394, 1008, 1013, 1002, 2023, 1011, 1028, 2224, 3540, 5403, 1027, 9530, 8873, 2290, 1024, 1024, 2131, 1006, 1005, 4642, 2015, 1012, 9585, 27241, 13535, 15395, 1005, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
libs/Zend/Db/Select.php
Zend_Db_Select._uniqueCorrelation
private function _uniqueCorrelation($name) { if (is_array($name)) { $c = end($name); } else { // Extract just the last name of a qualified table name $dot = strrpos($name,'.'); $c = ($dot === false) ? $name : substr($name, $dot+1); } for ($i = 2; array_key_exists($c, $this->_parts[self::FROM]); ++$i) { $c = $name . '_' . (string) $i; } return $c; }
php
private function _uniqueCorrelation($name) { if (is_array($name)) { $c = end($name); } else { // Extract just the last name of a qualified table name $dot = strrpos($name,'.'); $c = ($dot === false) ? $name : substr($name, $dot+1); } for ($i = 2; array_key_exists($c, $this->_parts[self::FROM]); ++$i) { $c = $name . '_' . (string) $i; } return $c; }
[ "private", "function", "_uniqueCorrelation", "(", "$", "name", ")", "{", "if", "(", "is_array", "(", "$", "name", ")", ")", "{", "$", "c", "=", "end", "(", "$", "name", ")", ";", "}", "else", "{", "// Extract just the last name of a qualified table name", ...
Generate a unique correlation name @param string|array $name A qualified identifier. @return string A unique correlation name.
[ "Generate", "a", "unique", "correlation", "name" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Select.php#L896-L909
train
Return unique correlation name
[ 30522, 2797, 3853, 1035, 4310, 27108, 16570, 3370, 1006, 1002, 2171, 1007, 1063, 2065, 1006, 2003, 1035, 9140, 1006, 1002, 2171, 1007, 1007, 1063, 1002, 1039, 1027, 2203, 1006, 1002, 2171, 1007, 1025, 1065, 2842, 1063, 1013, 1013, 14817, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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.isShared
public function isShared($abstract) { return isset($this->instances[$abstract]) || (isset($this->bindings[$abstract]['shared']) && $this->bindings[$abstract]['shared'] === true); }
php
public function isShared($abstract) { return isset($this->instances[$abstract]) || (isset($this->bindings[$abstract]['shared']) && $this->bindings[$abstract]['shared'] === true); }
[ "public", "function", "isShared", "(", "$", "abstract", ")", "{", "return", "isset", "(", "$", "this", "->", "instances", "[", "$", "abstract", "]", ")", "||", "(", "isset", "(", "$", "this", "->", "bindings", "[", "$", "abstract", "]", "[", "'shared...
Determine if a given type is shared. @param string $abstract @return bool
[ "Determine", "if", "a", "given", "type", "is", "shared", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Container/Container.php#L196-L201
train
Returns true if the abstract is shared
[ 30522, 2270, 3853, 26354, 8167, 2098, 1006, 1002, 10061, 1007, 1063, 2709, 26354, 3388, 1006, 1002, 2023, 1011, 1028, 12107, 1031, 1002, 10061, 1033, 1007, 1064, 1064, 1006, 26354, 3388, 1006, 1002, 2023, 1011, 1028, 8031, 2015, 1031, 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/Mailer/Transport/Smtp/Auth/CramMd5Authenticator.php
CramMd5Authenticator.authenticate
public function authenticate(EsmtpTransport $client): void { $challenge = $client->executeCommand("AUTH CRAM-MD5\r\n", [334]); $challenge = base64_decode(substr($challenge, 4)); $message = base64_encode($client->getUsername().' '.$this->getResponse($client->getPassword(), $challenge)); $client->executeCommand(sprintf("%s\r\n", $message), [235]); }
php
public function authenticate(EsmtpTransport $client): void { $challenge = $client->executeCommand("AUTH CRAM-MD5\r\n", [334]); $challenge = base64_decode(substr($challenge, 4)); $message = base64_encode($client->getUsername().' '.$this->getResponse($client->getPassword(), $challenge)); $client->executeCommand(sprintf("%s\r\n", $message), [235]); }
[ "public", "function", "authenticate", "(", "EsmtpTransport", "$", "client", ")", ":", "void", "{", "$", "challenge", "=", "$", "client", "->", "executeCommand", "(", "\"AUTH CRAM-MD5\\r\\n\"", ",", "[", "334", "]", ")", ";", "$", "challenge", "=", "base64_de...
{@inheritdoc} @see https://www.ietf.org/rfc/rfc4954.txt
[ "{", "@inheritdoc", "}" ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Mailer/Transport/Smtp/Auth/CramMd5Authenticator.php#L35-L41
train
Authenticates the user using the username and password of the client.
[ 30522, 2270, 3853, 14469, 3686, 1006, 9686, 20492, 13876, 5521, 20205, 1002, 7396, 1007, 1024, 11675, 1063, 1002, 4119, 1027, 1002, 7396, 1011, 1028, 15389, 9006, 2386, 2094, 1006, 1000, 8740, 2705, 13675, 3286, 1011, 9108, 2629, 1032, 1054...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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.php
Grid.prependRowSelectorColumn
protected function prependRowSelectorColumn() { if (!$this->option('show_row_selector')) { return; } $this->prependColumn(Column::SELECT_COLUMN_NAME, ' ') ->displayUsing(Displayers\RowSelector::class); }
php
protected function prependRowSelectorColumn() { if (!$this->option('show_row_selector')) { return; } $this->prependColumn(Column::SELECT_COLUMN_NAME, ' ') ->displayUsing(Displayers\RowSelector::class); }
[ "protected", "function", "prependRowSelectorColumn", "(", ")", "{", "if", "(", "!", "$", "this", "->", "option", "(", "'show_row_selector'", ")", ")", "{", "return", ";", "}", "$", "this", "->", "prependColumn", "(", "Column", "::", "SELECT_COLUMN_NAME", ","...
Prepend checkbox column for grid. @return void
[ "Prepend", "checkbox", "column", "for", "grid", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Grid.php#L554-L562
train
Prepends the row selector column to the table header if the show_row_selector option is true
[ 30522, 5123, 3853, 17463, 10497, 10524, 11246, 22471, 2953, 25778, 2819, 2078, 1006, 1007, 1063, 2065, 1006, 999, 1002, 2023, 1011, 1028, 5724, 1006, 1005, 2265, 1035, 5216, 1035, 27000, 1005, 1007, 1007, 1063, 2709, 1025, 1065, 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/Mime/Message.php
Zend_Mime_Message.createFromMessage
public static function createFromMessage($message, $boundary, $EOL = Zend_Mime::LINEEND) { // require_once 'Zend/Mime/Decode.php'; $parts = Zend_Mime_Decode::splitMessageStruct($message, $boundary, $EOL); $res = new self(); foreach ($parts as $part) { // now we build a new MimePart for the current Message Part: $newPart = new Zend_Mime_Part($part['body']); foreach ($part['header'] as $key => $value) { /** * @todo check for characterset and filename */ switch(strtolower($key)) { case 'content-type': $newPart->type = $value; break; case 'content-transfer-encoding': $newPart->encoding = $value; break; case 'content-id': $newPart->id = trim($value,'<>'); break; case 'content-disposition': $newPart->disposition = $value; break; case 'content-description': $newPart->description = $value; break; case 'content-location': $newPart->location = $value; break; case 'content-language': $newPart->language = $value; break; default: throw new Zend_Exception('Unknown header ignored for MimePart:' . $key); } } $res->addPart($newPart); } return $res; }
php
public static function createFromMessage($message, $boundary, $EOL = Zend_Mime::LINEEND) { // require_once 'Zend/Mime/Decode.php'; $parts = Zend_Mime_Decode::splitMessageStruct($message, $boundary, $EOL); $res = new self(); foreach ($parts as $part) { // now we build a new MimePart for the current Message Part: $newPart = new Zend_Mime_Part($part['body']); foreach ($part['header'] as $key => $value) { /** * @todo check for characterset and filename */ switch(strtolower($key)) { case 'content-type': $newPart->type = $value; break; case 'content-transfer-encoding': $newPart->encoding = $value; break; case 'content-id': $newPart->id = trim($value,'<>'); break; case 'content-disposition': $newPart->disposition = $value; break; case 'content-description': $newPart->description = $value; break; case 'content-location': $newPart->location = $value; break; case 'content-language': $newPart->language = $value; break; default: throw new Zend_Exception('Unknown header ignored for MimePart:' . $key); } } $res->addPart($newPart); } return $res; }
[ "public", "static", "function", "createFromMessage", "(", "$", "message", ",", "$", "boundary", ",", "$", "EOL", "=", "Zend_Mime", "::", "LINEEND", ")", "{", "// require_once 'Zend/Mime/Decode.php';", "$", "parts", "=", "Zend_Mime_Decode", "::", "splitMessageStruct"...
Decodes a MIME encoded string and returns a Zend_Mime_Message object with all the MIME parts set according to the given string @param string $message @param string $boundary @param string $EOL EOL string; defaults to {@link Zend_Mime::LINEEND} @return Zend_Mime_Message
[ "Decodes", "a", "MIME", "encoded", "string", "and", "returns", "a", "Zend_Mime_Message", "object", "with", "all", "the", "MIME", "parts", "set", "according", "to", "the", "given", "string" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mime/Message.php#L243-L285
train
Create a new instance from a string
[ 30522, 2270, 10763, 3853, 3443, 19699, 5358, 7834, 3736, 3351, 1006, 1002, 4471, 1010, 1002, 6192, 1010, 1002, 1041, 4747, 1027, 16729, 2094, 1035, 2771, 4168, 1024, 1024, 2240, 10497, 1007, 1063, 30524, 2771, 4168, 1013, 21933, 3207, 1012,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/Console/Helper/ProgressBar.php
ProgressBar.overwrite
private function overwrite(string $message): void { if ($this->overwrite) { if (!$this->firstRun) { if ($this->output instanceof ConsoleSectionOutput) { $lines = floor(Helper::strlen($message) / $this->terminal->getWidth()) + $this->formatLineCount + 1; $this->output->clear($lines); } else { // Erase previous lines if ($this->formatLineCount > 0) { $message = str_repeat("\x1B[1A\x1B[2K", $this->formatLineCount).$message; } // Move the cursor to the beginning of the line and erase the line $message = "\x0D\x1B[2K$message"; } } } elseif ($this->step > 0) { $message = PHP_EOL.$message; } $this->firstRun = false; $this->output->write($message); }
php
private function overwrite(string $message): void { if ($this->overwrite) { if (!$this->firstRun) { if ($this->output instanceof ConsoleSectionOutput) { $lines = floor(Helper::strlen($message) / $this->terminal->getWidth()) + $this->formatLineCount + 1; $this->output->clear($lines); } else { // Erase previous lines if ($this->formatLineCount > 0) { $message = str_repeat("\x1B[1A\x1B[2K", $this->formatLineCount).$message; } // Move the cursor to the beginning of the line and erase the line $message = "\x0D\x1B[2K$message"; } } } elseif ($this->step > 0) { $message = PHP_EOL.$message; } $this->firstRun = false; $this->output->write($message); }
[ "private", "function", "overwrite", "(", "string", "$", "message", ")", ":", "void", "{", "if", "(", "$", "this", "->", "overwrite", ")", "{", "if", "(", "!", "$", "this", "->", "firstRun", ")", "{", "if", "(", "$", "this", "->", "output", "instanc...
Overwrites a previous message to the output.
[ "Overwrites", "a", "previous", "message", "to", "the", "output", "." ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Helper/ProgressBar.php#L394-L418
train
Overwrites the message if it should be written.
[ 30522, 2797, 3853, 2058, 26373, 1006, 5164, 1002, 4471, 1007, 1024, 11675, 1063, 2065, 1006, 1002, 2023, 1011, 1028, 2058, 26373, 1007, 1063, 2065, 1006, 999, 1002, 2023, 1011, 1028, 2034, 15532, 1007, 1063, 2065, 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...
getgrav/grav
system/src/Grav/Framework/Psr7/Response.php
Response.withRedirect
public function withRedirect(string $url, $status = null): ResponseInterface { $response = $this->getResponse()->withHeader('Location', $url); if ($status === null) { $status = 302; } $new = clone $this; $new->message = $response->withStatus($status); return $new; }
php
public function withRedirect(string $url, $status = null): ResponseInterface { $response = $this->getResponse()->withHeader('Location', $url); if ($status === null) { $status = 302; } $new = clone $this; $new->message = $response->withStatus($status); return $new; }
[ "public", "function", "withRedirect", "(", "string", "$", "url", ",", "$", "status", "=", "null", ")", ":", "ResponseInterface", "{", "$", "response", "=", "$", "this", "->", "getResponse", "(", ")", "->", "withHeader", "(", "'Location'", ",", "$", "url"...
Redirect. Note: This method is not part of the PSR-7 standard. This method prepares the response object to return an HTTP Redirect response to the client. @param string $url The redirect destination. @param int|null $status The redirect HTTP status code. @return static
[ "Redirect", "." ]
1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72
https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Framework/Psr7/Response.php#L92-L104
train
Redirect to a given URL
[ 30522, 2270, 3853, 2007, 5596, 7442, 6593, 1006, 5164, 1002, 24471, 2140, 1010, 1002, 3570, 1027, 19701, 1007, 1024, 3433, 18447, 2121, 12172, 1063, 1002, 3433, 1027, 1002, 2023, 1011, 1028, 2131, 6072, 26029, 3366, 1006, 1007, 1011, 1028, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
libs/Zend/Mail/Transport/Abstract.php
Zend_Mail_Transport_Abstract._buildBody
protected function _buildBody() { if (($text = $this->_mail->getBodyText()) && ($html = $this->_mail->getBodyHtml())) { // Generate unique boundary for multipart/alternative $mime = new Zend_Mime(null); $boundaryLine = $mime->boundaryLine($this->EOL); $boundaryEnd = $mime->mimeEnd($this->EOL); $text->disposition = false; $html->disposition = false; $body = $boundaryLine . $text->getHeaders($this->EOL) . $this->EOL . $text->getContent($this->EOL) . $this->EOL . $boundaryLine . $html->getHeaders($this->EOL) . $this->EOL . $html->getContent($this->EOL) . $this->EOL . $boundaryEnd; $mp = new Zend_Mime_Part($body); $mp->type = Zend_Mime::MULTIPART_ALTERNATIVE; $mp->boundary = $mime->boundary(); $this->_isMultipart = true; // Ensure first part contains text alternatives array_unshift($this->_parts, $mp); // Get headers $this->_headers = $this->_mail->getHeaders(); return; } // If not multipart, then get the body if (false !== ($body = $this->_mail->getBodyHtml())) { array_unshift($this->_parts, $body); } elseif (false !== ($body = $this->_mail->getBodyText())) { array_unshift($this->_parts, $body); } if (!$body) { /** * @see Zend_Mail_Transport_Exception */ // require_once 'Zend/Mail/Transport/Exception.php'; throw new Zend_Mail_Transport_Exception('No body specified'); } // Get headers $this->_headers = $this->_mail->getHeaders(); $headers = $body->getHeadersArray($this->EOL); foreach ($headers as $header) { // Headers in Zend_Mime_Part are kept as arrays with two elements, a // key and a value $this->_headers[$header[0]] = array($header[1]); } }
php
protected function _buildBody() { if (($text = $this->_mail->getBodyText()) && ($html = $this->_mail->getBodyHtml())) { // Generate unique boundary for multipart/alternative $mime = new Zend_Mime(null); $boundaryLine = $mime->boundaryLine($this->EOL); $boundaryEnd = $mime->mimeEnd($this->EOL); $text->disposition = false; $html->disposition = false; $body = $boundaryLine . $text->getHeaders($this->EOL) . $this->EOL . $text->getContent($this->EOL) . $this->EOL . $boundaryLine . $html->getHeaders($this->EOL) . $this->EOL . $html->getContent($this->EOL) . $this->EOL . $boundaryEnd; $mp = new Zend_Mime_Part($body); $mp->type = Zend_Mime::MULTIPART_ALTERNATIVE; $mp->boundary = $mime->boundary(); $this->_isMultipart = true; // Ensure first part contains text alternatives array_unshift($this->_parts, $mp); // Get headers $this->_headers = $this->_mail->getHeaders(); return; } // If not multipart, then get the body if (false !== ($body = $this->_mail->getBodyHtml())) { array_unshift($this->_parts, $body); } elseif (false !== ($body = $this->_mail->getBodyText())) { array_unshift($this->_parts, $body); } if (!$body) { /** * @see Zend_Mail_Transport_Exception */ // require_once 'Zend/Mail/Transport/Exception.php'; throw new Zend_Mail_Transport_Exception('No body specified'); } // Get headers $this->_headers = $this->_mail->getHeaders(); $headers = $body->getHeadersArray($this->EOL); foreach ($headers as $header) { // Headers in Zend_Mime_Part are kept as arrays with two elements, a // key and a value $this->_headers[$header[0]] = array($header[1]); } }
[ "protected", "function", "_buildBody", "(", ")", "{", "if", "(", "(", "$", "text", "=", "$", "this", "->", "_mail", "->", "getBodyText", "(", ")", ")", "&&", "(", "$", "html", "=", "$", "this", "->", "_mail", "->", "getBodyHtml", "(", ")", ")", "...
Generate MIME compliant message from the current configuration If both a text and HTML body are present, generates a multipart/alternative Zend_Mime_Part containing the headers and contents of each. Otherwise, uses whichever of the text or HTML parts present. The content part is then prepended to the list of Zend_Mime_Parts for this message. @return void
[ "Generate", "MIME", "compliant", "message", "from", "the", "current", "configuration" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail/Transport/Abstract.php#L233-L295
train
Build the message body
[ 30522, 5123, 3853, 1035, 3857, 23684, 1006, 1007, 1063, 2065, 1006, 1006, 1002, 3793, 1027, 1002, 2023, 1011, 1028, 1035, 5653, 1011, 1028, 2131, 23684, 18209, 1006, 1007, 1007, 1004, 1004, 1006, 1002, 16129, 1027, 1002, 2023, 1011, 1028, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
laravel/framework
src/Illuminate/Database/DatabaseManager.php
DatabaseManager.configure
protected function configure(Connection $connection, $type) { $connection = $this->setPdoForType($connection, $type); // First we'll set the fetch mode and a few other dependencies of the database // connection. This method basically just configures and prepares it to get // used by the application. Once we're finished we'll return it back out. if ($this->app->bound('events')) { $connection->setEventDispatcher($this->app['events']); } // Here we'll set a reconnector callback. This reconnector can be any callable // so we will set a Closure to reconnect from this manager with the name of // the connection, which will allow us to reconnect from the connections. $connection->setReconnector($this->reconnector); return $connection; }
php
protected function configure(Connection $connection, $type) { $connection = $this->setPdoForType($connection, $type); // First we'll set the fetch mode and a few other dependencies of the database // connection. This method basically just configures and prepares it to get // used by the application. Once we're finished we'll return it back out. if ($this->app->bound('events')) { $connection->setEventDispatcher($this->app['events']); } // Here we'll set a reconnector callback. This reconnector can be any callable // so we will set a Closure to reconnect from this manager with the name of // the connection, which will allow us to reconnect from the connections. $connection->setReconnector($this->reconnector); return $connection; }
[ "protected", "function", "configure", "(", "Connection", "$", "connection", ",", "$", "type", ")", "{", "$", "connection", "=", "$", "this", "->", "setPdoForType", "(", "$", "connection", ",", "$", "type", ")", ";", "// First we'll set the fetch mode and a few o...
Prepare the database connection instance. @param \Illuminate\Database\Connection $connection @param string $type @return \Illuminate\Database\Connection
[ "Prepare", "the", "database", "connection", "instance", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/DatabaseManager.php#L165-L182
train
Configure the connection and type of the database connection.
[ 30522, 5123, 3853, 9530, 8873, 27390, 2063, 1006, 4434, 1002, 4434, 1010, 1002, 2828, 1007, 1063, 1002, 4434, 1027, 1002, 2023, 1011, 1028, 2275, 17299, 11253, 11589, 18863, 1006, 1002, 4434, 1010, 1002, 2828, 1007, 1025, 1013, 1013, 2034, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/Stopwatch/Stopwatch.php
Stopwatch.start
public function start($name, $category = null) { return end($this->activeSections)->startEvent($name, $category); }
php
public function start($name, $category = null) { return end($this->activeSections)->startEvent($name, $category); }
[ "public", "function", "start", "(", "$", "name", ",", "$", "category", "=", "null", ")", "{", "return", "end", "(", "$", "this", "->", "activeSections", ")", "->", "startEvent", "(", "$", "name", ",", "$", "category", ")", ";", "}" ]
Starts an event. @param string $name The event name @param string|null $category The event category @return StopwatchEvent
[ "Starts", "an", "event", "." ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Stopwatch/Stopwatch.php#L106-L109
train
Start an event
[ 30522, 2270, 3853, 2707, 1006, 1002, 2171, 1010, 1002, 4696, 1027, 19701, 1007, 1063, 2709, 2203, 1006, 1002, 2023, 1011, 1028, 3161, 29015, 2015, 1007, 1011, 1028, 2707, 18697, 3372, 1006, 1002, 2171, 1010, 1002, 4696, 1007, 1025, 1065, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
spatie/laravel-permission
src/Traits/HasPermissions.php
HasPermissions.hasPermissionTo
public function hasPermissionTo($permission, $guardName = null): bool { $permissionClass = $this->getPermissionClass(); if (is_string($permission)) { $permission = $permissionClass->findByName( $permission, $guardName ?? $this->getDefaultGuardName() ); } if (is_int($permission)) { $permission = $permissionClass->findById( $permission, $guardName ?? $this->getDefaultGuardName() ); } if (! $permission instanceof Permission) { throw new PermissionDoesNotExist; } return $this->hasDirectPermission($permission) || $this->hasPermissionViaRole($permission); }
php
public function hasPermissionTo($permission, $guardName = null): bool { $permissionClass = $this->getPermissionClass(); if (is_string($permission)) { $permission = $permissionClass->findByName( $permission, $guardName ?? $this->getDefaultGuardName() ); } if (is_int($permission)) { $permission = $permissionClass->findById( $permission, $guardName ?? $this->getDefaultGuardName() ); } if (! $permission instanceof Permission) { throw new PermissionDoesNotExist; } return $this->hasDirectPermission($permission) || $this->hasPermissionViaRole($permission); }
[ "public", "function", "hasPermissionTo", "(", "$", "permission", ",", "$", "guardName", "=", "null", ")", ":", "bool", "{", "$", "permissionClass", "=", "$", "this", "->", "getPermissionClass", "(", ")", ";", "if", "(", "is_string", "(", "$", "permission",...
Determine if the model may perform the given permission. @param string|int|\Spatie\Permission\Contracts\Permission $permission @param string|null $guardName @return bool @throws PermissionDoesNotExist
[ "Determine", "if", "the", "model", "may", "perform", "the", "given", "permission", "." ]
81dbe9d372d70c255b66a2727a235076509f8d45
https://github.com/spatie/laravel-permission/blob/81dbe9d372d70c255b66a2727a235076509f8d45/src/Traits/HasPermissions.php#L119-L142
train
Has permission to a specific permission
[ 30522, 2270, 3853, 2038, 4842, 25481, 3406, 1006, 1002, 6656, 1010, 1002, 3457, 18442, 1027, 19701, 1007, 1024, 22017, 2140, 1063, 1002, 6656, 26266, 1027, 1002, 2023, 1011, 1028, 2131, 4842, 25481, 26266, 1006, 1007, 1025, 2065, 1006, 2003...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
dompdf/dompdf
src/Adapter/CPDF.php
CPDF.output
public function output($options = array()) { if (!isset($options["compress"])) $options["compress"] = true; $this->_add_page_text(); $debug = !$options['compress']; return $this->_pdf->output($debug); }
php
public function output($options = array()) { if (!isset($options["compress"])) $options["compress"] = true; $this->_add_page_text(); $debug = !$options['compress']; return $this->_pdf->output($debug); }
[ "public", "function", "output", "(", "$", "options", "=", "array", "(", ")", ")", "{", "if", "(", "!", "isset", "(", "$", "options", "[", "\"compress\"", "]", ")", ")", "$", "options", "[", "\"compress\"", "]", "=", "true", ";", "$", "this", "->", ...
Returns the PDF as a string. @param array $options Associative array: 'compress' => 1 or 0 (default 1). @return string
[ "Returns", "the", "PDF", "as", "a", "string", "." ]
75f13c700009be21a1965dc2c5b68a8708c22ba2
https://github.com/dompdf/dompdf/blob/75f13c700009be21a1965dc2c5b68a8708c22ba2/src/Adapter/CPDF.php#L1164-L1173
train
Output the pdf
[ 30522, 2270, 3853, 6434, 1006, 1002, 7047, 1027, 9140, 1006, 1007, 1007, 1063, 2065, 1006, 999, 26354, 3388, 1006, 1002, 7047, 1031, 1000, 4012, 20110, 1000, 1033, 1007, 1007, 1002, 7047, 1031, 1000, 4012, 20110, 1000, 1033, 1027, 2995, 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/Translation/MessageCatalogue.php
MessageCatalogue.add
public function add($messages, $domain = 'messages') { if (!isset($this->messages[$domain])) { $this->messages[$domain] = $messages; } else { $this->messages[$domain] = array_replace($this->messages[$domain], $messages); } }
php
public function add($messages, $domain = 'messages') { if (!isset($this->messages[$domain])) { $this->messages[$domain] = $messages; } else { $this->messages[$domain] = array_replace($this->messages[$domain], $messages); } }
[ "public", "function", "add", "(", "$", "messages", ",", "$", "domain", "=", "'messages'", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "messages", "[", "$", "domain", "]", ")", ")", "{", "$", "this", "->", "messages", "[", "$", "dom...
{@inheritdoc}
[ "{" ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Translation/MessageCatalogue.php#L154-L161
train
Add messages to the messages array
[ 30522, 2270, 3853, 5587, 1006, 1002, 7696, 1010, 1002, 5884, 1027, 1005, 7696, 1005, 1007, 1063, 2065, 1006, 999, 26354, 3388, 1006, 1002, 2023, 1011, 1028, 7696, 1031, 1002, 5884, 1033, 1007, 1007, 1063, 1002, 2023, 1011, 1028, 7696, 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...
symfony/symfony
src/Symfony/Bridge/Doctrine/ContainerAwareEventManager.php
ContainerAwareEventManager.dispatchEvent
public function dispatchEvent($eventName, EventArgs $eventArgs = null) { if (isset($this->listeners[$eventName])) { $eventArgs = null === $eventArgs ? EventArgs::getEmptyInstance() : $eventArgs; $initialized = isset($this->initialized[$eventName]); foreach ($this->listeners[$eventName] as $hash => $listener) { if (!$initialized && \is_string($listener)) { $this->listeners[$eventName][$hash] = $listener = $this->container->get($listener); } $listener->$eventName($eventArgs); } $this->initialized[$eventName] = true; } }
php
public function dispatchEvent($eventName, EventArgs $eventArgs = null) { if (isset($this->listeners[$eventName])) { $eventArgs = null === $eventArgs ? EventArgs::getEmptyInstance() : $eventArgs; $initialized = isset($this->initialized[$eventName]); foreach ($this->listeners[$eventName] as $hash => $listener) { if (!$initialized && \is_string($listener)) { $this->listeners[$eventName][$hash] = $listener = $this->container->get($listener); } $listener->$eventName($eventArgs); } $this->initialized[$eventName] = true; } }
[ "public", "function", "dispatchEvent", "(", "$", "eventName", ",", "EventArgs", "$", "eventArgs", "=", "null", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "listeners", "[", "$", "eventName", "]", ")", ")", "{", "$", "eventArgs", "=", "null", ...
Dispatches an event to all registered listeners. @param string $eventName The name of the event to dispatch. The name of the event is the name of the method that is invoked on listeners. @param EventArgs $eventArgs The event arguments to pass to the event handlers/listeners. If not supplied, the single empty EventArgs instance is used. @return bool
[ "Dispatches", "an", "event", "to", "all", "registered", "listeners", "." ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bridge/Doctrine/ContainerAwareEventManager.php#L49-L65
train
Dispatches an event to all registered listeners
[ 30522, 2270, 3853, 18365, 18697, 3372, 1006, 1002, 2724, 18442, 1010, 2724, 2906, 5620, 1002, 2724, 2906, 5620, 1027, 19701, 1007, 1063, 2065, 1006, 26354, 3388, 1006, 1002, 2023, 1011, 1028, 13810, 1031, 1002, 2724, 18442, 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...
laravel/framework
src/Illuminate/Database/Eloquent/Builder.php
Builder.simplePaginate
public function simplePaginate($perPage = null, $columns = ['*'], $pageName = 'page', $page = null) { $page = $page ?: Paginator::resolveCurrentPage($pageName); $perPage = $perPage ?: $this->model->getPerPage(); // Next we will set the limit and offset for this query so that when we get the // results we get the proper section of results. Then, we'll create the full // paginator instances for these results with the given page and per page. $this->skip(($page - 1) * $perPage)->take($perPage + 1); return $this->simplePaginator($this->get($columns), $perPage, $page, [ 'path' => Paginator::resolveCurrentPath(), 'pageName' => $pageName, ]); }
php
public function simplePaginate($perPage = null, $columns = ['*'], $pageName = 'page', $page = null) { $page = $page ?: Paginator::resolveCurrentPage($pageName); $perPage = $perPage ?: $this->model->getPerPage(); // Next we will set the limit and offset for this query so that when we get the // results we get the proper section of results. Then, we'll create the full // paginator instances for these results with the given page and per page. $this->skip(($page - 1) * $perPage)->take($perPage + 1); return $this->simplePaginator($this->get($columns), $perPage, $page, [ 'path' => Paginator::resolveCurrentPath(), 'pageName' => $pageName, ]); }
[ "public", "function", "simplePaginate", "(", "$", "perPage", "=", "null", ",", "$", "columns", "=", "[", "'*'", "]", ",", "$", "pageName", "=", "'page'", ",", "$", "page", "=", "null", ")", "{", "$", "page", "=", "$", "page", "?", ":", "Paginator",...
Paginate the given query into a simple paginator. @param int $perPage @param array $columns @param string $pageName @param int|null $page @return \Illuminate\Contracts\Pagination\Paginator
[ "Paginate", "the", "given", "query", "into", "a", "simple", "paginator", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Builder.php#L767-L782
train
Get the results of the query
[ 30522, 2270, 3853, 3722, 4502, 20876, 2618, 1006, 1002, 2566, 13704, 1027, 19701, 1010, 1002, 7753, 1027, 1031, 1005, 1008, 1005, 1033, 1010, 1002, 3931, 18442, 1027, 1005, 3931, 1005, 1010, 1002, 3931, 1027, 19701, 1007, 1063, 1002, 3931, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/RedisQueue.php
RedisQueue.deleteAndRelease
public function deleteAndRelease($queue, $job, $delay) { $queue = $this->getQueue($queue); $this->getConnection()->eval( LuaScripts::release(), 2, $queue.':delayed', $queue.':reserved', $job->getReservedJob(), $this->availableAt($delay) ); }
php
public function deleteAndRelease($queue, $job, $delay) { $queue = $this->getQueue($queue); $this->getConnection()->eval( LuaScripts::release(), 2, $queue.':delayed', $queue.':reserved', $job->getReservedJob(), $this->availableAt($delay) ); }
[ "public", "function", "deleteAndRelease", "(", "$", "queue", ",", "$", "job", ",", "$", "delay", ")", "{", "$", "queue", "=", "$", "this", "->", "getQueue", "(", "$", "queue", ")", ";", "$", "this", "->", "getConnection", "(", ")", "->", "eval", "(...
Delete a reserved job from the reserved queue and release it. @param string $queue @param \Illuminate\Queue\Jobs\RedisJob $job @param int $delay @return void
[ "Delete", "a", "reserved", "job", "from", "the", "reserved", "queue", "and", "release", "it", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Queue/RedisQueue.php#L260-L268
train
Delete and release a reserved job
[ 30522, 2270, 3853, 3972, 12870, 5685, 16570, 19500, 1006, 1002, 24240, 1010, 1002, 3105, 1010, 1002, 8536, 1007, 1063, 1002, 24240, 1027, 1002, 2023, 1011, 1028, 2131, 4226, 5657, 1006, 1002, 24240, 1007, 1025, 1002, 2023, 1011, 1028, 2131,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
core/Report/ReportWidgetFactory.php
ReportWidgetFactory.createContainerWidget
public function createContainerWidget($containerId) { $widget = new WidgetContainerConfig(); $widget->setCategoryId($this->report->getCategoryId()); $widget->setId($containerId); if ($this->report->getSubcategoryId()) { $widget->setSubcategoryId($this->report->getSubcategoryId()); } $orderThatListsReportsAtTheEndOfEachCategory = 100 + $this->report->getOrder(); $widget->setOrder($orderThatListsReportsAtTheEndOfEachCategory); return $widget; }
php
public function createContainerWidget($containerId) { $widget = new WidgetContainerConfig(); $widget->setCategoryId($this->report->getCategoryId()); $widget->setId($containerId); if ($this->report->getSubcategoryId()) { $widget->setSubcategoryId($this->report->getSubcategoryId()); } $orderThatListsReportsAtTheEndOfEachCategory = 100 + $this->report->getOrder(); $widget->setOrder($orderThatListsReportsAtTheEndOfEachCategory); return $widget; }
[ "public", "function", "createContainerWidget", "(", "$", "containerId", ")", "{", "$", "widget", "=", "new", "WidgetContainerConfig", "(", ")", ";", "$", "widget", "->", "setCategoryId", "(", "$", "this", "->", "report", "->", "getCategoryId", "(", ")", ")",...
Creates a new container widget based on the specified report in {@link construct()}. It will automatically use the report's categoryId, subcategoryId (if specified) and order in order to create the container. @param string $containerId eg 'Products' or 'Contents' see {Piwik\Widget\WidgetContainerConfig::setId()}. Other reports or widgets will be able to add more widgets to this container. This is useful when you want to show for example multiple related widgets together. @return WidgetContainerConfig
[ "Creates", "a", "new", "container", "widget", "based", "on", "the", "specified", "report", "in", "{", "@link", "construct", "()", "}", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Report/ReportWidgetFactory.php#L86-L100
train
Create the container widget
[ 30522, 2270, 3853, 3443, 8663, 18249, 2121, 9148, 24291, 1006, 1002, 11661, 3593, 1007, 1063, 1002, 15536, 24291, 1027, 2047, 15536, 24291, 8663, 18249, 2121, 8663, 8873, 2290, 1006, 1007, 1025, 1002, 15536, 24291, 1011, 1028, 2275, 16280, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
plugins/CoreHome/Controller.php
Controller.renderWidgetContainer
public function renderWidgetContainer() { Piwik::checkUserHasSomeViewAccess(); $this->checkSitePermission(); $view = new View('@CoreHome/widgetContainer'); $view->isWidgetized = (bool) Common::getRequestVar('widget', 0, 'int'); $view->containerId = Common::getRequestVar('containerId', null, 'string'); return $view->render(); }
php
public function renderWidgetContainer() { Piwik::checkUserHasSomeViewAccess(); $this->checkSitePermission(); $view = new View('@CoreHome/widgetContainer'); $view->isWidgetized = (bool) Common::getRequestVar('widget', 0, 'int'); $view->containerId = Common::getRequestVar('containerId', null, 'string'); return $view->render(); }
[ "public", "function", "renderWidgetContainer", "(", ")", "{", "Piwik", "::", "checkUserHasSomeViewAccess", "(", ")", ";", "$", "this", "->", "checkSitePermission", "(", ")", ";", "$", "view", "=", "new", "View", "(", "'@CoreHome/widgetContainer'", ")", ";", "$...
This is only used for exported widgets @return string @throws Exception @throws \Piwik\NoAccessException
[ "This", "is", "only", "used", "for", "exported", "widgets" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/CoreHome/Controller.php#L67-L77
train
Returns the HTML of the widget container
[ 30522, 2270, 3853, 17552, 9148, 24291, 8663, 18249, 2121, 1006, 1007, 1063, 14255, 9148, 2243, 1024, 1024, 4638, 20330, 14949, 14045, 8584, 6305, 9623, 2015, 1006, 1007, 1025, 1002, 2023, 1011, 1028, 14148, 4221, 4842, 25481, 1006, 1007, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/Translation/Formatter/IntlFormatter.php
IntlFormatter.formatIntl
public function formatIntl(string $message, string $locale, array $parameters = []): string { if (!$formatter = $this->cache[$locale][$message] ?? null) { if (!($this->hasMessageFormatter ?? $this->hasMessageFormatter = class_exists(\MessageFormatter::class))) { throw new LogicException('Cannot parse message translation: please install the "intl" PHP extension or the "symfony/polyfill-intl-messageformatter" package.'); } try { $this->cache[$locale][$message] = $formatter = new \MessageFormatter($locale, $message); } catch (\IntlException $e) { throw new InvalidArgumentException(sprintf('Invalid message format (error #%d): %s.', intl_get_error_code(), intl_get_error_message()), 0, $e); } } foreach ($parameters as $key => $value) { if (\in_array($key[0] ?? null, ['%', '{'], true)) { unset($parameters[$key]); $parameters[trim($key, '%{ }')] = $value; } } if (false === $message = $formatter->format($parameters)) { throw new InvalidArgumentException(sprintf('Unable to format message (error #%s): %s.', $formatter->getErrorCode(), $formatter->getErrorMessage())); } return $message; }
php
public function formatIntl(string $message, string $locale, array $parameters = []): string { if (!$formatter = $this->cache[$locale][$message] ?? null) { if (!($this->hasMessageFormatter ?? $this->hasMessageFormatter = class_exists(\MessageFormatter::class))) { throw new LogicException('Cannot parse message translation: please install the "intl" PHP extension or the "symfony/polyfill-intl-messageformatter" package.'); } try { $this->cache[$locale][$message] = $formatter = new \MessageFormatter($locale, $message); } catch (\IntlException $e) { throw new InvalidArgumentException(sprintf('Invalid message format (error #%d): %s.', intl_get_error_code(), intl_get_error_message()), 0, $e); } } foreach ($parameters as $key => $value) { if (\in_array($key[0] ?? null, ['%', '{'], true)) { unset($parameters[$key]); $parameters[trim($key, '%{ }')] = $value; } } if (false === $message = $formatter->format($parameters)) { throw new InvalidArgumentException(sprintf('Unable to format message (error #%s): %s.', $formatter->getErrorCode(), $formatter->getErrorMessage())); } return $message; }
[ "public", "function", "formatIntl", "(", "string", "$", "message", ",", "string", "$", "locale", ",", "array", "$", "parameters", "=", "[", "]", ")", ":", "string", "{", "if", "(", "!", "$", "formatter", "=", "$", "this", "->", "cache", "[", "$", "...
{@inheritdoc}
[ "{" ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Translation/Formatter/IntlFormatter.php#L29-L54
train
Formats message using intl
[ 30522, 2270, 3853, 4289, 18447, 2140, 1006, 5164, 1002, 4471, 1010, 5164, 1002, 2334, 2063, 1010, 9140, 1002, 11709, 1027, 1031, 1033, 1007, 1024, 5164, 1063, 2065, 1006, 999, 1002, 4289, 3334, 1027, 1002, 2023, 1011, 1028, 17053, 1031, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
octobercms/october
modules/backend/models/Preference.php
Preference.getLocaleOptions
public function getLocaleOptions() { $localeOptions = [ 'ar' => [Lang::get('system::lang.locale.ar'), 'flag-sa'], 'be' => [Lang::get('system::lang.locale.be'), 'flag-by'], 'bg' => [Lang::get('system::lang.locale.bg'), 'flag-bg'], 'ca' => [Lang::get('system::lang.locale.ca'), 'flag-es-ct'], 'cs' => [Lang::get('system::lang.locale.cs'), 'flag-cz'], 'da' => [Lang::get('system::lang.locale.da'), 'flag-dk'], 'de' => [Lang::get('system::lang.locale.de'), 'flag-de'], 'el' => [Lang::get('system::lang.locale.el'), 'flag-gr'], 'en' => [Lang::get('system::lang.locale.en'), 'flag-us'], 'en-au' => [Lang::get('system::lang.locale.en-au'), 'flag-au'], 'en-ca' => [Lang::get('system::lang.locale.en-ca'), 'flag-ca'], 'en-gb' => [Lang::get('system::lang.locale.en-gb'), 'flag-gb'], 'es' => [Lang::get('system::lang.locale.es'), 'flag-es'], 'es-ar' => [Lang::get('system::lang.locale.es-ar'), 'flag-ar'], 'et' => [Lang::get('system::lang.locale.et'), 'flag-ee'], 'fa' => [Lang::get('system::lang.locale.fa'), 'flag-ir'], 'fi' => [Lang::get('system::lang.locale.fi'), 'flag-fi'], 'fr' => [Lang::get('system::lang.locale.fr'), 'flag-fr'], 'fr-ca' => [Lang::get('system::lang.locale.fr-ca'), 'flag-ca'], 'hu' => [Lang::get('system::lang.locale.hu'), 'flag-hu'], 'id' => [Lang::get('system::lang.locale.id'), 'flag-id'], 'it' => [Lang::get('system::lang.locale.it'), 'flag-it'], 'ja' => [Lang::get('system::lang.locale.ja'), 'flag-jp'], 'kr' => [Lang::get('system::lang.locale.kr'), 'flag-kr'], 'lt' => [Lang::get('system::lang.locale.lt'), 'flag-lt'], 'lv' => [Lang::get('system::lang.locale.lv'), 'flag-lv'], 'nb-no' => [Lang::get('system::lang.locale.nb-no'), 'flag-no'], 'nl' => [Lang::get('system::lang.locale.nl'), 'flag-nl'], 'pl' => [Lang::get('system::lang.locale.pl'), 'flag-pl'], 'pt-br' => [Lang::get('system::lang.locale.pt-br'), 'flag-br'], 'pt-pt' => [Lang::get('system::lang.locale.pt-pt'), 'flag-pt'], 'ro' => [Lang::get('system::lang.locale.ro'), 'flag-ro'], 'ru' => [Lang::get('system::lang.locale.ru'), 'flag-ru'], 'sk' => [Lang::get('system::lang.locale.sk'), 'flag-sk'], 'sv' => [Lang::get('system::lang.locale.sv'), 'flag-se'], 'tr' => [Lang::get('system::lang.locale.tr'), 'flag-tr'], 'uk' => [Lang::get('system::lang.locale.uk'), 'flag-ua'], 'vn' => [Lang::get('system::lang.locale.vn'), 'flag-vn'], 'zh-cn' => [Lang::get('system::lang.locale.zh-cn'), 'flag-cn'], 'zh-tw' => [Lang::get('system::lang.locale.zh-tw'), 'flag-tw'], ]; $locales = Config::get('app.localeOptions', $localeOptions); // Sort locales alphabetically asort($locales); return $locales; }
php
public function getLocaleOptions() { $localeOptions = [ 'ar' => [Lang::get('system::lang.locale.ar'), 'flag-sa'], 'be' => [Lang::get('system::lang.locale.be'), 'flag-by'], 'bg' => [Lang::get('system::lang.locale.bg'), 'flag-bg'], 'ca' => [Lang::get('system::lang.locale.ca'), 'flag-es-ct'], 'cs' => [Lang::get('system::lang.locale.cs'), 'flag-cz'], 'da' => [Lang::get('system::lang.locale.da'), 'flag-dk'], 'de' => [Lang::get('system::lang.locale.de'), 'flag-de'], 'el' => [Lang::get('system::lang.locale.el'), 'flag-gr'], 'en' => [Lang::get('system::lang.locale.en'), 'flag-us'], 'en-au' => [Lang::get('system::lang.locale.en-au'), 'flag-au'], 'en-ca' => [Lang::get('system::lang.locale.en-ca'), 'flag-ca'], 'en-gb' => [Lang::get('system::lang.locale.en-gb'), 'flag-gb'], 'es' => [Lang::get('system::lang.locale.es'), 'flag-es'], 'es-ar' => [Lang::get('system::lang.locale.es-ar'), 'flag-ar'], 'et' => [Lang::get('system::lang.locale.et'), 'flag-ee'], 'fa' => [Lang::get('system::lang.locale.fa'), 'flag-ir'], 'fi' => [Lang::get('system::lang.locale.fi'), 'flag-fi'], 'fr' => [Lang::get('system::lang.locale.fr'), 'flag-fr'], 'fr-ca' => [Lang::get('system::lang.locale.fr-ca'), 'flag-ca'], 'hu' => [Lang::get('system::lang.locale.hu'), 'flag-hu'], 'id' => [Lang::get('system::lang.locale.id'), 'flag-id'], 'it' => [Lang::get('system::lang.locale.it'), 'flag-it'], 'ja' => [Lang::get('system::lang.locale.ja'), 'flag-jp'], 'kr' => [Lang::get('system::lang.locale.kr'), 'flag-kr'], 'lt' => [Lang::get('system::lang.locale.lt'), 'flag-lt'], 'lv' => [Lang::get('system::lang.locale.lv'), 'flag-lv'], 'nb-no' => [Lang::get('system::lang.locale.nb-no'), 'flag-no'], 'nl' => [Lang::get('system::lang.locale.nl'), 'flag-nl'], 'pl' => [Lang::get('system::lang.locale.pl'), 'flag-pl'], 'pt-br' => [Lang::get('system::lang.locale.pt-br'), 'flag-br'], 'pt-pt' => [Lang::get('system::lang.locale.pt-pt'), 'flag-pt'], 'ro' => [Lang::get('system::lang.locale.ro'), 'flag-ro'], 'ru' => [Lang::get('system::lang.locale.ru'), 'flag-ru'], 'sk' => [Lang::get('system::lang.locale.sk'), 'flag-sk'], 'sv' => [Lang::get('system::lang.locale.sv'), 'flag-se'], 'tr' => [Lang::get('system::lang.locale.tr'), 'flag-tr'], 'uk' => [Lang::get('system::lang.locale.uk'), 'flag-ua'], 'vn' => [Lang::get('system::lang.locale.vn'), 'flag-vn'], 'zh-cn' => [Lang::get('system::lang.locale.zh-cn'), 'flag-cn'], 'zh-tw' => [Lang::get('system::lang.locale.zh-tw'), 'flag-tw'], ]; $locales = Config::get('app.localeOptions', $localeOptions); // Sort locales alphabetically asort($locales); return $locales; }
[ "public", "function", "getLocaleOptions", "(", ")", "{", "$", "localeOptions", "=", "[", "'ar'", "=>", "[", "Lang", "::", "get", "(", "'system::lang.locale.ar'", ")", ",", "'flag-sa'", "]", ",", "'be'", "=>", "[", "Lang", "::", "get", "(", "'system::lang.l...
Returns available options for the "locale" attribute. @return array
[ "Returns", "available", "options", "for", "the", "locale", "attribute", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/models/Preference.php#L178-L229
train
Get locale options
[ 30522, 2270, 3853, 2131, 4135, 9289, 8780, 16790, 2015, 1006, 1007, 1063, 1002, 2334, 8780, 16790, 2015, 1027, 1031, 1005, 12098, 1005, 1027, 1028, 1031, 11374, 1024, 1024, 2131, 1006, 1005, 2291, 1024, 1024, 11374, 1012, 2334, 2063, 1012, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
core/Archive.php
Archive.cacheArchiveIdsWithoutLaunching
private function cacheArchiveIdsWithoutLaunching($plugins) { $idarchivesByReport = ArchiveSelector::getArchiveIds( $this->params->getIdSites(), $this->params->getPeriods(), $this->params->getSegment(), $plugins); // initialize archive ID cache for each report foreach ($plugins as $plugin) { $doneFlag = $this->getDoneStringForPlugin($plugin, $this->params->getIdSites()); $this->initializeArchiveIdCache($doneFlag); $globalDoneFlag = Rules::getDoneFlagArchiveContainsAllPlugins($this->params->getSegment()); $this->initializeArchiveIdCache($globalDoneFlag); } foreach ($idarchivesByReport as $doneFlag => $idarchivesByDate) { foreach ($idarchivesByDate as $dateRange => $idarchives) { foreach ($idarchives as $idarchive) { $this->idarchives[$doneFlag][$dateRange][] = $idarchive; } } } }
php
private function cacheArchiveIdsWithoutLaunching($plugins) { $idarchivesByReport = ArchiveSelector::getArchiveIds( $this->params->getIdSites(), $this->params->getPeriods(), $this->params->getSegment(), $plugins); // initialize archive ID cache for each report foreach ($plugins as $plugin) { $doneFlag = $this->getDoneStringForPlugin($plugin, $this->params->getIdSites()); $this->initializeArchiveIdCache($doneFlag); $globalDoneFlag = Rules::getDoneFlagArchiveContainsAllPlugins($this->params->getSegment()); $this->initializeArchiveIdCache($globalDoneFlag); } foreach ($idarchivesByReport as $doneFlag => $idarchivesByDate) { foreach ($idarchivesByDate as $dateRange => $idarchives) { foreach ($idarchives as $idarchive) { $this->idarchives[$doneFlag][$dateRange][] = $idarchive; } } } }
[ "private", "function", "cacheArchiveIdsWithoutLaunching", "(", "$", "plugins", ")", "{", "$", "idarchivesByReport", "=", "ArchiveSelector", "::", "getArchiveIds", "(", "$", "this", "->", "params", "->", "getIdSites", "(", ")", ",", "$", "this", "->", "params", ...
Gets the IDs of the archives we're querying for and stores them in $this->archives. This function will not launch the archiving process (and is thus much, much faster than cacheArchiveIdsAfterLaunching). @param array $plugins List of plugin names from which data is being requested.
[ "Gets", "the", "IDs", "of", "the", "archives", "we", "re", "querying", "for", "and", "stores", "them", "in", "$this", "-", ">", "archives", ".", "This", "function", "will", "not", "launch", "the", "archiving", "process", "(", "and", "is", "thus", "much",...
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Archive.php#L680-L700
train
Cache archive IDs without launching
[ 30522, 2797, 3853, 17053, 2906, 5428, 3726, 9821, 24415, 5833, 17298, 12680, 2075, 1006, 1002, 13354, 7076, 1007, 1063, 1002, 16096, 11140, 24653, 3762, 2890, 6442, 1027, 8264, 12260, 16761, 1024, 1024, 2131, 2906, 5428, 3726, 9821, 1006, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
laravel/framework
src/Illuminate/Cache/CacheManager.php
CacheManager.store
public function store($name = null) { $name = $name ?: $this->getDefaultDriver(); return $this->stores[$name] = $this->get($name); }
php
public function store($name = null) { $name = $name ?: $this->getDefaultDriver(); return $this->stores[$name] = $this->get($name); }
[ "public", "function", "store", "(", "$", "name", "=", "null", ")", "{", "$", "name", "=", "$", "name", "?", ":", "$", "this", "->", "getDefaultDriver", "(", ")", ";", "return", "$", "this", "->", "stores", "[", "$", "name", "]", "=", "$", "this",...
Get a cache store instance by name, wrapped in a repository. @param string|null $name @return \Illuminate\Contracts\Cache\Repository
[ "Get", "a", "cache", "store", "instance", "by", "name", "wrapped", "in", "a", "repository", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Cache/CacheManager.php#L56-L61
train
Stores a new instance of the specified driver
[ 30522, 2270, 3853, 3573, 1006, 1002, 2171, 1027, 19701, 1007, 1063, 1002, 2171, 1027, 1002, 2171, 1029, 1024, 1002, 2023, 1011, 1028, 2131, 3207, 7011, 11314, 23663, 2099, 1006, 1007, 1025, 2709, 1002, 2023, 1011, 1028, 5324, 1031, 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/Support/Collection.php
Collection.search
public function search($value, $strict = false) { if (! $this->useAsCallable($value)) { return array_search($value, $this->items, $strict); } foreach ($this->items as $key => $item) { if (call_user_func($value, $item, $key)) { return $key; } } return false; }
php
public function search($value, $strict = false) { if (! $this->useAsCallable($value)) { return array_search($value, $this->items, $strict); } foreach ($this->items as $key => $item) { if (call_user_func($value, $item, $key)) { return $key; } } return false; }
[ "public", "function", "search", "(", "$", "value", ",", "$", "strict", "=", "false", ")", "{", "if", "(", "!", "$", "this", "->", "useAsCallable", "(", "$", "value", ")", ")", "{", "return", "array_search", "(", "$", "value", ",", "$", "this", "->"...
Search the collection for a given value and return the corresponding key if successful. @param mixed $value @param bool $strict @return mixed
[ "Search", "the", "collection", "for", "a", "given", "value", "and", "return", "the", "corresponding", "key", "if", "successful", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Support/Collection.php#L1538-L1551
train
Search the array for a value
[ 30522, 2270, 3853, 3945, 1006, 1002, 3643, 1010, 1002, 9384, 1027, 6270, 1007, 1063, 2065, 1006, 999, 1002, 2023, 1011, 1028, 2224, 3022, 9289, 20470, 2571, 1006, 1002, 3643, 1007, 1007, 1063, 2709, 9140, 1035, 3945, 1006, 1002, 3643, 101...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
z-song/laravel-admin
src/Form/NestedForm.php
NestedForm.prepare
public function prepare($input) { foreach ($input as $key => $record) { $this->setFieldOriginalValue($key); $input[$key] = $this->prepareRecord($record); } return $input; }
php
public function prepare($input) { foreach ($input as $key => $record) { $this->setFieldOriginalValue($key); $input[$key] = $this->prepareRecord($record); } return $input; }
[ "public", "function", "prepare", "(", "$", "input", ")", "{", "foreach", "(", "$", "input", "as", "$", "key", "=>", "$", "record", ")", "{", "$", "this", "->", "setFieldOriginalValue", "(", "$", "key", ")", ";", "$", "input", "[", "$", "key", "]", ...
Prepare for insert or update. @param array $input @return mixed
[ "Prepare", "for", "insert", "or", "update", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Form/NestedForm.php#L220-L228
train
Prepare input array
[ 30522, 2270, 3853, 7374, 1006, 1002, 7953, 1007, 1063, 18921, 6776, 1006, 1002, 7953, 2004, 1002, 30524, 2023, 1011, 1028, 7374, 2890, 27108, 2094, 1006, 1002, 2501, 1007, 1025, 1065, 2709, 1002, 7953, 1025, 1065, 102, 0, 0, 0, 0, 0, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
z-song/laravel-admin
src/Form/Field.php
Field.data
public function data(array $data = null) { if (is_null($data)) { return $this->data; } $this->data = $data; return $this; }
php
public function data(array $data = null) { if (is_null($data)) { return $this->data; } $this->data = $data; return $this; }
[ "public", "function", "data", "(", "array", "$", "data", "=", "null", ")", "{", "if", "(", "is_null", "(", "$", "data", ")", ")", "{", "return", "$", "this", "->", "data", ";", "}", "$", "this", "->", "data", "=", "$", "data", ";", "return", "$...
Set or get data. @param array $data @return $this
[ "Set", "or", "get", "data", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Form/Field.php#L611-L620
train
Get the data of the current language
[ 30522, 2270, 3853, 2951, 1006, 9140, 1002, 2951, 1027, 19701, 1007, 1063, 2065, 1006, 2003, 1035, 19701, 1006, 1002, 2951, 1007, 1007, 1063, 2709, 1002, 2023, 1011, 1028, 2951, 1025, 1065, 1002, 2023, 1011, 1028, 2951, 1027, 1002, 2951, 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/Serializer/Mapping/ClassDiscriminatorMapping.php
ClassDiscriminatorMapping.getMappedObjectType
public function getMappedObjectType($object): ?string { foreach ($this->typesMapping as $type => $typeClass) { if (is_a($object, $typeClass)) { return $type; } } return null; }
php
public function getMappedObjectType($object): ?string { foreach ($this->typesMapping as $type => $typeClass) { if (is_a($object, $typeClass)) { return $type; } } return null; }
[ "public", "function", "getMappedObjectType", "(", "$", "object", ")", ":", "?", "string", "{", "foreach", "(", "$", "this", "->", "typesMapping", "as", "$", "type", "=>", "$", "typeClass", ")", "{", "if", "(", "is_a", "(", "$", "object", ",", "$", "t...
@param object|string $object @return string|null
[ "@param", "object|string", "$object" ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Serializer/Mapping/ClassDiscriminatorMapping.php#L43-L52
train
Get the type mapped to the object
[ 30522, 2270, 3853, 2131, 2863, 11469, 16429, 20614, 13874, 1006, 1002, 4874, 1007, 1024, 1029, 5164, 1063, 18921, 6776, 1006, 1002, 2023, 1011, 1028, 4127, 2863, 14853, 2004, 1002, 2828, 1027, 1028, 1002, 2828, 26266, 1007, 1063, 2065, 1006...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/Mime/FileinfoMimeTypeGuesser.php
FileinfoMimeTypeGuesser.guessMimeType
public function guessMimeType(string $path): ?string { if (!is_file($path) || !is_readable($path)) { throw new InvalidArgumentException(sprintf('The "%s" file does not exist or is not readable.', $path)); } if (!$this->isGuesserSupported()) { throw new LogicException(sprintf('The "%s" guesser is not supported.', __CLASS__)); } if (false === $finfo = new \finfo(FILEINFO_MIME_TYPE, $this->magicFile)) { return null; } return $finfo->file($path); }
php
public function guessMimeType(string $path): ?string { if (!is_file($path) || !is_readable($path)) { throw new InvalidArgumentException(sprintf('The "%s" file does not exist or is not readable.', $path)); } if (!$this->isGuesserSupported()) { throw new LogicException(sprintf('The "%s" guesser is not supported.', __CLASS__)); } if (false === $finfo = new \finfo(FILEINFO_MIME_TYPE, $this->magicFile)) { return null; } return $finfo->file($path); }
[ "public", "function", "guessMimeType", "(", "string", "$", "path", ")", ":", "?", "string", "{", "if", "(", "!", "is_file", "(", "$", "path", ")", "||", "!", "is_readable", "(", "$", "path", ")", ")", "{", "throw", "new", "InvalidArgumentException", "(...
{@inheritdoc}
[ "{" ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Mime/FileinfoMimeTypeGuesser.php#L49-L64
train
Guesses the mime type of a file
[ 30522, 2270, 3853, 3984, 4328, 11368, 18863, 1006, 5164, 1002, 4130, 1007, 1024, 1029, 5164, 1063, 2065, 1006, 999, 2003, 1035, 5371, 1006, 1002, 4130, 1007, 1064, 1064, 999, 2003, 1035, 3191, 3085, 1006, 1002, 4130, 1007, 1007, 1063, 546...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php
ControllerTrait.dispatchMessage
protected function dispatchMessage($message): Envelope { if (!$this->container->has('messenger.default_bus')) { $message = class_exists(Envelope::class) ? 'You need to define the "messenger.default_bus" configuration option.' : 'Try running "composer require symfony/messenger".'; throw new \LogicException('The message bus is not enabled in your application. '.$message); } return $this->container->get('messenger.default_bus')->dispatch($message); }
php
protected function dispatchMessage($message): Envelope { if (!$this->container->has('messenger.default_bus')) { $message = class_exists(Envelope::class) ? 'You need to define the "messenger.default_bus" configuration option.' : 'Try running "composer require symfony/messenger".'; throw new \LogicException('The message bus is not enabled in your application. '.$message); } return $this->container->get('messenger.default_bus')->dispatch($message); }
[ "protected", "function", "dispatchMessage", "(", "$", "message", ")", ":", "Envelope", "{", "if", "(", "!", "$", "this", "->", "container", "->", "has", "(", "'messenger.default_bus'", ")", ")", "{", "$", "message", "=", "class_exists", "(", "Envelope", ":...
Dispatches a message to the bus. @param object|Envelope $message The message or the message pre-wrapped in an envelope @final
[ "Dispatches", "a", "message", "to", "the", "bus", "." ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php#L404-L412
train
Dispatches a message to the message bus
[ 30522, 5123, 3853, 18365, 7834, 3736, 3351, 1006, 1002, 4471, 1007, 1024, 11255, 1063, 2065, 1006, 999, 1002, 2023, 1011, 1028, 11661, 1011, 1028, 2038, 1006, 1005, 11981, 1012, 12398, 1035, 3902, 1005, 1007, 1007, 1063, 1002, 4471, 1027, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
core/Archive/DataTableFactory.php
DataTableFactory.makeFromBlobRow
private function makeFromBlobRow($blobRow, $keyMetadata) { if ($blobRow === false) { return new DataTable(); } if (count($this->dataNames) === 1) { return $this->makeDataTableFromSingleBlob($blobRow, $keyMetadata); } else { return $this->makeIndexedByRecordNameDataTable($blobRow, $keyMetadata); } }
php
private function makeFromBlobRow($blobRow, $keyMetadata) { if ($blobRow === false) { return new DataTable(); } if (count($this->dataNames) === 1) { return $this->makeDataTableFromSingleBlob($blobRow, $keyMetadata); } else { return $this->makeIndexedByRecordNameDataTable($blobRow, $keyMetadata); } }
[ "private", "function", "makeFromBlobRow", "(", "$", "blobRow", ",", "$", "keyMetadata", ")", "{", "if", "(", "$", "blobRow", "===", "false", ")", "{", "return", "new", "DataTable", "(", ")", ";", "}", "if", "(", "count", "(", "$", "this", "->", "data...
Creates a DataTable|Set instance using an array of blobs. If only one record is being queried, a single DataTable will be returned. Otherwise, a DataTable\Map is returned that indexes DataTables by record name. If expandDataTable was called, and only one record is being queried, the created DataTable's subtables will be expanded. @param array $blobRow @return DataTable|DataTable\Map
[ "Creates", "a", "DataTable|Set", "instance", "using", "an", "array", "of", "blobs", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Archive/DataTableFactory.php#L239-L250
train
Make a DataTable from a blob row
[ 30522, 2797, 3853, 2191, 19699, 5358, 16558, 16429, 10524, 1006, 1002, 1038, 4135, 12618, 2860, 1010, 1002, 3145, 11368, 8447, 2696, 1007, 1063, 2065, 1006, 1002, 1038, 4135, 12618, 2860, 1027, 1027, 1027, 6270, 1007, 1063, 2709, 2047, 2951...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
libs/HTML/QuickForm2/Container.php
HTML_QuickForm2_Container.getJavascriptValue
public function getJavascriptValue() { $args = array(); foreach ($this as $child) { if ($child instanceof HTML_QuickForm2_Container) { $args[] = $child->getJavascriptValue(); } else { $args[] = "'" . $child->getId() . "'"; } } return 'qf.form.getContainerValue(' . implode(', ', $args) . ')'; }
php
public function getJavascriptValue() { $args = array(); foreach ($this as $child) { if ($child instanceof HTML_QuickForm2_Container) { $args[] = $child->getJavascriptValue(); } else { $args[] = "'" . $child->getId() . "'"; } } return 'qf.form.getContainerValue(' . implode(', ', $args) . ')'; }
[ "public", "function", "getJavascriptValue", "(", ")", "{", "$", "args", "=", "array", "(", ")", ";", "foreach", "(", "$", "this", "as", "$", "child", ")", "{", "if", "(", "$", "child", "instanceof", "HTML_QuickForm2_Container", ")", "{", "$", "args", "...
Returns Javascript code for getting the element's value @return string
[ "Returns", "Javascript", "code", "for", "getting", "the", "element", "s", "value" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Container.php#L446-L457
train
Returns the Javascript code that is used to get the value of the container
[ 30522, 2270, 3853, 2131, 3900, 12044, 23235, 10175, 5657, 1006, 1007, 1063, 1002, 12098, 5620, 1027, 9140, 1006, 1007, 1025, 18921, 6776, 1006, 1002, 2023, 2004, 1002, 2775, 1007, 1063, 2065, 1006, 1002, 2775, 6013, 11253, 16129, 1035, 4248...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
getgrav/grav
system/src/Grav/Common/Utils.php
Utils.multibyteParseUrl
public static function multibyteParseUrl($url) { $enc_url = preg_replace_callback( '%[^:/@?&=#]+%usD', function ($matches) { return urlencode($matches[0]); }, $url ); $parts = parse_url($enc_url); if($parts === false) { throw new \InvalidArgumentException('Malformed URL: ' . $url); } foreach($parts as $name => $value) { $parts[$name] = urldecode($value); } return $parts; }
php
public static function multibyteParseUrl($url) { $enc_url = preg_replace_callback( '%[^:/@?&=#]+%usD', function ($matches) { return urlencode($matches[0]); }, $url ); $parts = parse_url($enc_url); if($parts === false) { throw new \InvalidArgumentException('Malformed URL: ' . $url); } foreach($parts as $name => $value) { $parts[$name] = urldecode($value); } return $parts; }
[ "public", "static", "function", "multibyteParseUrl", "(", "$", "url", ")", "{", "$", "enc_url", "=", "preg_replace_callback", "(", "'%[^:/@?&=#]+%usD'", ",", "function", "(", "$", "matches", ")", "{", "return", "urlencode", "(", "$", "matches", "[", "0", "]"...
Multibyte-safe Parse URL function @param string $url @return array @throws \InvalidArgumentException
[ "Multibyte", "-", "safe", "Parse", "URL", "function" ]
1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72
https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Utils.php#L1430-L1451
train
Multibyte Parse URL
[ 30522, 2270, 10763, 3853, 4800, 3762, 2618, 19362, 3366, 3126, 2140, 1006, 1002, 24471, 2140, 1007, 1063, 1002, 4372, 2278, 1035, 24471, 2140, 1027, 3653, 2290, 1035, 5672, 1035, 2655, 5963, 1006, 1005, 1003, 1031, 1034, 1024, 1013, 1030, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/Media/Traits/MediaTrait.php
MediaTrait.getMediaUri
public function getMediaUri() { $folder = $this->getMediaFolder(); if (strpos($folder, '://')) { return $folder; } /** @var UniformResourceLocator $locator */ $locator = Grav::instance()['locator']; $user = $locator->findResource('user://'); if (strpos($folder, $user) === 0) { return 'user://' . substr($folder, \strlen($user)+1); } return null; }
php
public function getMediaUri() { $folder = $this->getMediaFolder(); if (strpos($folder, '://')) { return $folder; } /** @var UniformResourceLocator $locator */ $locator = Grav::instance()['locator']; $user = $locator->findResource('user://'); if (strpos($folder, $user) === 0) { return 'user://' . substr($folder, \strlen($user)+1); } return null; }
[ "public", "function", "getMediaUri", "(", ")", "{", "$", "folder", "=", "$", "this", "->", "getMediaFolder", "(", ")", ";", "if", "(", "strpos", "(", "$", "folder", ",", "'://'", ")", ")", "{", "return", "$", "folder", ";", "}", "/** @var UniformResour...
Get URI ot the associated media. Method will return null if path isn't URI. @return null|string
[ "Get", "URI", "ot", "the", "associated", "media", ".", "Method", "will", "return", "null", "if", "path", "isn", "t", "URI", "." ]
1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72
https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Media/Traits/MediaTrait.php#L45-L61
train
Returns the media URI of the file
[ 30522, 2270, 3853, 2131, 16969, 9496, 1006, 1007, 1063, 1002, 19622, 1027, 1002, 2023, 1011, 1028, 2131, 16969, 10371, 2121, 1006, 1007, 1025, 2065, 1006, 2358, 14536, 2891, 1006, 1002, 19622, 1010, 1005, 1024, 1013, 1013, 1005, 1007, 1007,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
laravel/framework
src/Illuminate/Auth/AuthServiceProvider.php
AuthServiceProvider.register
public function register() { $this->registerAuthenticator(); $this->registerUserResolver(); $this->registerAccessGate(); $this->registerRequestRebindHandler(); $this->registerEventRebindHandler(); }
php
public function register() { $this->registerAuthenticator(); $this->registerUserResolver(); $this->registerAccessGate(); $this->registerRequestRebindHandler(); $this->registerEventRebindHandler(); }
[ "public", "function", "register", "(", ")", "{", "$", "this", "->", "registerAuthenticator", "(", ")", ";", "$", "this", "->", "registerUserResolver", "(", ")", ";", "$", "this", "->", "registerAccessGate", "(", ")", ";", "$", "this", "->", "registerReques...
Register the service provider. @return void
[ "Register", "the", "service", "provider", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Auth/AuthServiceProvider.php#L17-L24
train
Register all the classes
[ 30522, 2270, 3853, 4236, 1006, 1007, 1063, 1002, 2023, 1011, 1028, 4236, 4887, 10760, 16778, 11266, 2953, 1006, 1007, 1025, 1002, 2023, 1011, 1028, 4236, 20330, 6072, 4747, 6299, 1006, 1007, 1025, 1002, 2023, 1011, 1028, 4236, 6305, 9623, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
getgrav/grav
system/src/Grav/Framework/Flex/FlexDirectory.php
FlexDirectory.getObject
public function getObject($key, string $keyField = null): ?FlexObjectInterface { return $this->getIndex(null, $keyField)->get($key); }
php
public function getObject($key, string $keyField = null): ?FlexObjectInterface { return $this->getIndex(null, $keyField)->get($key); }
[ "public", "function", "getObject", "(", "$", "key", ",", "string", "$", "keyField", "=", "null", ")", ":", "?", "FlexObjectInterface", "{", "return", "$", "this", "->", "getIndex", "(", "null", ",", "$", "keyField", ")", "->", "get", "(", "$", "key", ...
Returns an object if it exists. Note: It is not safe to use the object without checking if the user can access it. @param string $key @param string|null $keyField Field to be used as the key. @return FlexObjectInterface|null
[ "Returns", "an", "object", "if", "it", "exists", "." ]
1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72
https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Framework/Flex/FlexDirectory.php#L233-L236
train
Get a single object from the index
[ 30522, 2270, 3853, 2131, 16429, 20614, 1006, 1002, 3145, 1010, 5164, 1002, 3145, 3790, 1027, 19701, 1007, 1024, 1029, 23951, 16429, 20614, 18447, 2121, 12172, 1063, 2709, 1002, 2023, 1011, 1028, 2131, 22254, 10288, 1006, 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...
matomo-org/matomo
core/DataTable/Renderer.php
Renderer.formatValueXml
public static function formatValueXml($value) { if (is_string($value) && !is_numeric($value) ) { $value = html_entity_decode($value, ENT_COMPAT, 'UTF-8'); // make sure non-UTF-8 chars don't cause htmlspecialchars to choke if (function_exists('mb_convert_encoding')) { $value = @mb_convert_encoding($value, 'UTF-8', 'UTF-8'); } $value = htmlspecialchars($value, ENT_COMPAT, 'UTF-8'); $htmlentities = array("&nbsp;", "&iexcl;", "&cent;", "&pound;", "&curren;", "&yen;", "&brvbar;", "&sect;", "&uml;", "&copy;", "&ordf;", "&laquo;", "&not;", "&shy;", "&reg;", "&macr;", "&deg;", "&plusmn;", "&sup2;", "&sup3;", "&acute;", "&micro;", "&para;", "&middot;", "&cedil;", "&sup1;", "&ordm;", "&raquo;", "&frac14;", "&frac12;", "&frac34;", "&iquest;", "&Agrave;", "&Aacute;", "&Acirc;", "&Atilde;", "&Auml;", "&Aring;", "&AElig;", "&Ccedil;", "&Egrave;", "&Eacute;", "&Ecirc;", "&Euml;", "&Igrave;", "&Iacute;", "&Icirc;", "&Iuml;", "&ETH;", "&Ntilde;", "&Ograve;", "&Oacute;", "&Ocirc;", "&Otilde;", "&Ouml;", "&times;", "&Oslash;", "&Ugrave;", "&Uacute;", "&Ucirc;", "&Uuml;", "&Yacute;", "&THORN;", "&szlig;", "&agrave;", "&aacute;", "&acirc;", "&atilde;", "&auml;", "&aring;", "&aelig;", "&ccedil;", "&egrave;", "&eacute;", "&ecirc;", "&euml;", "&igrave;", "&iacute;", "&icirc;", "&iuml;", "&eth;", "&ntilde;", "&ograve;", "&oacute;", "&ocirc;", "&otilde;", "&ouml;", "&divide;", "&oslash;", "&ugrave;", "&uacute;", "&ucirc;", "&uuml;", "&yacute;", "&thorn;", "&yuml;", "&euro;"); $xmlentities = array("&#162;", "&#163;", "&#164;", "&#165;", "&#166;", "&#167;", "&#168;", "&#169;", "&#170;", "&#171;", "&#172;", "&#173;", "&#174;", "&#175;", "&#176;", "&#177;", "&#178;", "&#179;", "&#180;", "&#181;", "&#182;", "&#183;", "&#184;", "&#185;", "&#186;", "&#187;", "&#188;", "&#189;", "&#190;", "&#191;", "&#192;", "&#193;", "&#194;", "&#195;", "&#196;", "&#197;", "&#198;", "&#199;", "&#200;", "&#201;", "&#202;", "&#203;", "&#204;", "&#205;", "&#206;", "&#207;", "&#208;", "&#209;", "&#210;", "&#211;", "&#212;", "&#213;", "&#214;", "&#215;", "&#216;", "&#217;", "&#218;", "&#219;", "&#220;", "&#221;", "&#222;", "&#223;", "&#224;", "&#225;", "&#226;", "&#227;", "&#228;", "&#229;", "&#230;", "&#231;", "&#232;", "&#233;", "&#234;", "&#235;", "&#236;", "&#237;", "&#238;", "&#239;", "&#240;", "&#241;", "&#242;", "&#243;", "&#244;", "&#245;", "&#246;", "&#247;", "&#248;", "&#249;", "&#250;", "&#251;", "&#252;", "&#253;", "&#254;", "&#255;", "&#8364;"); $value = str_replace($htmlentities, $xmlentities, $value); } elseif ($value === false) { $value = 0; } return $value; }
php
public static function formatValueXml($value) { if (is_string($value) && !is_numeric($value) ) { $value = html_entity_decode($value, ENT_COMPAT, 'UTF-8'); // make sure non-UTF-8 chars don't cause htmlspecialchars to choke if (function_exists('mb_convert_encoding')) { $value = @mb_convert_encoding($value, 'UTF-8', 'UTF-8'); } $value = htmlspecialchars($value, ENT_COMPAT, 'UTF-8'); $htmlentities = array("&nbsp;", "&iexcl;", "&cent;", "&pound;", "&curren;", "&yen;", "&brvbar;", "&sect;", "&uml;", "&copy;", "&ordf;", "&laquo;", "&not;", "&shy;", "&reg;", "&macr;", "&deg;", "&plusmn;", "&sup2;", "&sup3;", "&acute;", "&micro;", "&para;", "&middot;", "&cedil;", "&sup1;", "&ordm;", "&raquo;", "&frac14;", "&frac12;", "&frac34;", "&iquest;", "&Agrave;", "&Aacute;", "&Acirc;", "&Atilde;", "&Auml;", "&Aring;", "&AElig;", "&Ccedil;", "&Egrave;", "&Eacute;", "&Ecirc;", "&Euml;", "&Igrave;", "&Iacute;", "&Icirc;", "&Iuml;", "&ETH;", "&Ntilde;", "&Ograve;", "&Oacute;", "&Ocirc;", "&Otilde;", "&Ouml;", "&times;", "&Oslash;", "&Ugrave;", "&Uacute;", "&Ucirc;", "&Uuml;", "&Yacute;", "&THORN;", "&szlig;", "&agrave;", "&aacute;", "&acirc;", "&atilde;", "&auml;", "&aring;", "&aelig;", "&ccedil;", "&egrave;", "&eacute;", "&ecirc;", "&euml;", "&igrave;", "&iacute;", "&icirc;", "&iuml;", "&eth;", "&ntilde;", "&ograve;", "&oacute;", "&ocirc;", "&otilde;", "&ouml;", "&divide;", "&oslash;", "&ugrave;", "&uacute;", "&ucirc;", "&uuml;", "&yacute;", "&thorn;", "&yuml;", "&euro;"); $xmlentities = array("&#162;", "&#163;", "&#164;", "&#165;", "&#166;", "&#167;", "&#168;", "&#169;", "&#170;", "&#171;", "&#172;", "&#173;", "&#174;", "&#175;", "&#176;", "&#177;", "&#178;", "&#179;", "&#180;", "&#181;", "&#182;", "&#183;", "&#184;", "&#185;", "&#186;", "&#187;", "&#188;", "&#189;", "&#190;", "&#191;", "&#192;", "&#193;", "&#194;", "&#195;", "&#196;", "&#197;", "&#198;", "&#199;", "&#200;", "&#201;", "&#202;", "&#203;", "&#204;", "&#205;", "&#206;", "&#207;", "&#208;", "&#209;", "&#210;", "&#211;", "&#212;", "&#213;", "&#214;", "&#215;", "&#216;", "&#217;", "&#218;", "&#219;", "&#220;", "&#221;", "&#222;", "&#223;", "&#224;", "&#225;", "&#226;", "&#227;", "&#228;", "&#229;", "&#230;", "&#231;", "&#232;", "&#233;", "&#234;", "&#235;", "&#236;", "&#237;", "&#238;", "&#239;", "&#240;", "&#241;", "&#242;", "&#243;", "&#244;", "&#245;", "&#246;", "&#247;", "&#248;", "&#249;", "&#250;", "&#251;", "&#252;", "&#253;", "&#254;", "&#255;", "&#8364;"); $value = str_replace($htmlentities, $xmlentities, $value); } elseif ($value === false) { $value = 0; } return $value; }
[ "public", "static", "function", "formatValueXml", "(", "$", "value", ")", "{", "if", "(", "is_string", "(", "$", "value", ")", "&&", "!", "is_numeric", "(", "$", "value", ")", ")", "{", "$", "value", "=", "html_entity_decode", "(", "$", "value", ",", ...
Format a value to xml @param string|number|bool $value value to format @return int|string
[ "Format", "a", "value", "to", "xml" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable/Renderer.php#L183-L203
train
Format value for XML
[ 30522, 2270, 10763, 3853, 4289, 10175, 5657, 2595, 19968, 1006, 1002, 3643, 1007, 1063, 2065, 1006, 2003, 1035, 5164, 1006, 1002, 3643, 1007, 1004, 1004, 999, 2003, 1035, 16371, 25531, 1006, 1002, 3643, 1007, 1007, 1063, 1002, 3643, 1027, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
overtrue/wechat
src/MiniProgram/Encryptor.php
Encryptor.decryptData
public function decryptData(string $sessionKey, string $iv, string $encrypted): array { $decrypted = AES::decrypt( base64_decode($encrypted, false), base64_decode($sessionKey, false), base64_decode($iv, false) ); $decrypted = json_decode($this->pkcs7Unpad($decrypted), true); if (!$decrypted) { throw new DecryptException('The given payload is invalid.'); } return $decrypted; }
php
public function decryptData(string $sessionKey, string $iv, string $encrypted): array { $decrypted = AES::decrypt( base64_decode($encrypted, false), base64_decode($sessionKey, false), base64_decode($iv, false) ); $decrypted = json_decode($this->pkcs7Unpad($decrypted), true); if (!$decrypted) { throw new DecryptException('The given payload is invalid.'); } return $decrypted; }
[ "public", "function", "decryptData", "(", "string", "$", "sessionKey", ",", "string", "$", "iv", ",", "string", "$", "encrypted", ")", ":", "array", "{", "$", "decrypted", "=", "AES", "::", "decrypt", "(", "base64_decode", "(", "$", "encrypted", ",", "fa...
Decrypt data. @param string $sessionKey @param string $iv @param string $encrypted @return array
[ "Decrypt", "data", "." ]
120c72faaa93c270365bc75c73c362d5fd583209
https://github.com/overtrue/wechat/blob/120c72faaa93c270365bc75c73c362d5fd583209/src/MiniProgram/Encryptor.php#L34-L47
train
Decrypt the given data
[ 30522, 2270, 3853, 11703, 2854, 13876, 2850, 2696, 1006, 5164, 1002, 5219, 14839, 1010, 5164, 1002, 4921, 1010, 5164, 1002, 4372, 26775, 22571, 3064, 1007, 1024, 9140, 1063, 1002, 11703, 2854, 13876, 2098, 1027, 29347, 2015, 1024, 1024, 117...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/Middleware/LogOperation.php
LogOperation.shouldLogOperation
protected function shouldLogOperation(Request $request) { return config('admin.operation_log.enable') && !$this->inExceptArray($request) && $this->inAllowedMethods($request->method()) && Admin::user(); }
php
protected function shouldLogOperation(Request $request) { return config('admin.operation_log.enable') && !$this->inExceptArray($request) && $this->inAllowedMethods($request->method()) && Admin::user(); }
[ "protected", "function", "shouldLogOperation", "(", "Request", "$", "request", ")", "{", "return", "config", "(", "'admin.operation_log.enable'", ")", "&&", "!", "$", "this", "->", "inExceptArray", "(", "$", "request", ")", "&&", "$", "this", "->", "inAllowedM...
@param Request $request @return bool
[ "@param", "Request", "$request" ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Middleware/LogOperation.php#L46-L52
train
Should the user log the operation?
[ 30522, 5123, 3853, 2323, 21197, 25918, 3370, 1006, 5227, 1002, 5227, 1007, 1063, 2709, 9530, 8873, 2290, 1006, 30524, 6806, 5104, 1006, 1002, 5227, 1011, 1028, 4118, 1006, 1007, 1007, 1004, 1004, 4748, 10020, 1024, 1024, 5310, 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...
laravel/framework
src/Illuminate/Routing/Router.php
Router.redirect
public function redirect($uri, $destination, $status = 302) { return $this->any($uri, '\Illuminate\Routing\RedirectController') ->defaults('destination', $destination) ->defaults('status', $status); }
php
public function redirect($uri, $destination, $status = 302) { return $this->any($uri, '\Illuminate\Routing\RedirectController') ->defaults('destination', $destination) ->defaults('status', $status); }
[ "public", "function", "redirect", "(", "$", "uri", ",", "$", "destination", ",", "$", "status", "=", "302", ")", "{", "return", "$", "this", "->", "any", "(", "$", "uri", ",", "'\\Illuminate\\Routing\\RedirectController'", ")", "->", "defaults", "(", "'des...
Create a redirect from one URI to another. @param string $uri @param string $destination @param int $status @return \Illuminate\Routing\Route
[ "Create", "a", "redirect", "from", "one", "URI", "to", "another", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/Router.php#L242-L247
train
Redirect to another location
[ 30522, 30524, 24471, 2072, 1010, 1005, 1032, 5665, 12717, 12556, 1032, 16972, 1032, 2417, 7442, 6593, 8663, 13181, 10820, 1005, 1007, 1011, 1028, 12398, 2015, 1006, 1005, 7688, 1005, 1010, 1002, 7688, 1007, 1011, 1028, 12398, 2015, 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...
symfony/symfony
src/Symfony/Component/Routing/Router.php
Router.getMatcher
public function getMatcher() { if (null !== $this->matcher) { return $this->matcher; } $compiled = is_a($this->options['matcher_class'], CompiledUrlMatcher::class, true) && (UrlMatcher::class === $this->options['matcher_base_class'] || RedirectableUrlMatcher::class === $this->options['matcher_base_class']); if (null === $this->options['cache_dir'] || null === $this->options['matcher_cache_class']) { $routes = $this->getRouteCollection(); if ($compiled) { $routes = (new CompiledUrlMatcherDumper($routes))->getCompiledRoutes(); } $this->matcher = new $this->options['matcher_class']($routes, $this->context); if (method_exists($this->matcher, 'addExpressionLanguageProvider')) { foreach ($this->expressionLanguageProviders as $provider) { $this->matcher->addExpressionLanguageProvider($provider); } } return $this->matcher; } $cache = $this->getConfigCacheFactory()->cache($this->options['cache_dir'].'/'.$this->options['matcher_cache_class'].'.php', function (ConfigCacheInterface $cache) { $dumper = $this->getMatcherDumperInstance(); if (method_exists($dumper, 'addExpressionLanguageProvider')) { foreach ($this->expressionLanguageProviders as $provider) { $dumper->addExpressionLanguageProvider($provider); } } $options = [ 'class' => $this->options['matcher_cache_class'], 'base_class' => $this->options['matcher_base_class'], ]; $cache->write($dumper->dump($options), $this->getRouteCollection()->getResources()); } ); if ($compiled) { return $this->matcher = new $this->options['matcher_class'](require $cache->getPath(), $this->context); } if (!class_exists($this->options['matcher_cache_class'], false)) { require_once $cache->getPath(); } return $this->matcher = new $this->options['matcher_cache_class']($this->context); }
php
public function getMatcher() { if (null !== $this->matcher) { return $this->matcher; } $compiled = is_a($this->options['matcher_class'], CompiledUrlMatcher::class, true) && (UrlMatcher::class === $this->options['matcher_base_class'] || RedirectableUrlMatcher::class === $this->options['matcher_base_class']); if (null === $this->options['cache_dir'] || null === $this->options['matcher_cache_class']) { $routes = $this->getRouteCollection(); if ($compiled) { $routes = (new CompiledUrlMatcherDumper($routes))->getCompiledRoutes(); } $this->matcher = new $this->options['matcher_class']($routes, $this->context); if (method_exists($this->matcher, 'addExpressionLanguageProvider')) { foreach ($this->expressionLanguageProviders as $provider) { $this->matcher->addExpressionLanguageProvider($provider); } } return $this->matcher; } $cache = $this->getConfigCacheFactory()->cache($this->options['cache_dir'].'/'.$this->options['matcher_cache_class'].'.php', function (ConfigCacheInterface $cache) { $dumper = $this->getMatcherDumperInstance(); if (method_exists($dumper, 'addExpressionLanguageProvider')) { foreach ($this->expressionLanguageProviders as $provider) { $dumper->addExpressionLanguageProvider($provider); } } $options = [ 'class' => $this->options['matcher_cache_class'], 'base_class' => $this->options['matcher_base_class'], ]; $cache->write($dumper->dump($options), $this->getRouteCollection()->getResources()); } ); if ($compiled) { return $this->matcher = new $this->options['matcher_class'](require $cache->getPath(), $this->context); } if (!class_exists($this->options['matcher_cache_class'], false)) { require_once $cache->getPath(); } return $this->matcher = new $this->options['matcher_cache_class']($this->context); }
[ "public", "function", "getMatcher", "(", ")", "{", "if", "(", "null", "!==", "$", "this", "->", "matcher", ")", "{", "return", "$", "this", "->", "matcher", ";", "}", "$", "compiled", "=", "is_a", "(", "$", "this", "->", "options", "[", "'matcher_cla...
Gets the UrlMatcher instance associated with this Router. @return UrlMatcherInterface A UrlMatcherInterface instance
[ "Gets", "the", "UrlMatcher", "instance", "associated", "with", "this", "Router", "." ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Routing/Router.php#L284-L334
train
Get the UrlMatcher
[ 30522, 2270, 3853, 2131, 18900, 7474, 1006, 1007, 1063, 2065, 1006, 19701, 999, 1027, 1027, 1002, 2023, 1011, 1028, 2674, 2121, 1007, 1063, 2709, 1002, 2023, 1011, 1028, 2674, 2121, 1025, 1065, 1002, 9227, 1027, 2003, 1035, 1037, 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...
z-song/laravel-admin
src/Show/Field.php
Field.using
public function using(array $values, $default = null) { return $this->as(function ($value) use ($values, $default) { if (is_null($value)) { return $default; } return Arr::get($values, $value, $default); }); }
php
public function using(array $values, $default = null) { return $this->as(function ($value) use ($values, $default) { if (is_null($value)) { return $default; } return Arr::get($values, $value, $default); }); }
[ "public", "function", "using", "(", "array", "$", "values", ",", "$", "default", "=", "null", ")", "{", "return", "$", "this", "->", "as", "(", "function", "(", "$", "value", ")", "use", "(", "$", "values", ",", "$", "default", ")", "{", "if", "(...
Display field using array value map. @param array $values @param null $default @return $this
[ "Display", "field", "using", "array", "value", "map", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Show/Field.php#L191-L200
train
Return the value of the field using an array
[ 30522, 2270, 3853, 2478, 1006, 9140, 1002, 5300, 1010, 1002, 12398, 1027, 19701, 1007, 1063, 2709, 1002, 2023, 1011, 1028, 2004, 1006, 3853, 1006, 1002, 3643, 1007, 2224, 1006, 1002, 5300, 1010, 1002, 12398, 1007, 1063, 2065, 1006, 2003, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
getgrav/grav
system/src/Grav/Common/Themes.php
Themes.all
public function all() { $list = []; /** @var UniformResourceLocator $locator */ $locator = $this->grav['locator']; $iterator = $locator->getIterator('themes://'); /** @var \DirectoryIterator $directory */ foreach ($iterator as $directory) { if (!$directory->isDir() || $directory->isDot()) { continue; } $theme = $directory->getFilename(); $result = $this->get($theme); if ($result) { $list[$theme] = $result; } } ksort($list); return $list; }
php
public function all() { $list = []; /** @var UniformResourceLocator $locator */ $locator = $this->grav['locator']; $iterator = $locator->getIterator('themes://'); /** @var \DirectoryIterator $directory */ foreach ($iterator as $directory) { if (!$directory->isDir() || $directory->isDot()) { continue; } $theme = $directory->getFilename(); $result = $this->get($theme); if ($result) { $list[$theme] = $result; } } ksort($list); return $list; }
[ "public", "function", "all", "(", ")", "{", "$", "list", "=", "[", "]", ";", "/** @var UniformResourceLocator $locator */", "$", "locator", "=", "$", "this", "->", "grav", "[", "'locator'", "]", ";", "$", "iterator", "=", "$", "locator", "->", "getIterator...
Return list of all theme data with their blueprints. @return array
[ "Return", "list", "of", "all", "theme", "data", "with", "their", "blueprints", "." ]
1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72
https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Themes.php#L87-L112
train
Get all theme
[ 30522, 2270, 3853, 2035, 1006, 1007, 1063, 1002, 2862, 1027, 1031, 1033, 1025, 1013, 1008, 1008, 1030, 13075, 6375, 6072, 8162, 29109, 24755, 4263, 1002, 8840, 11266, 2953, 1008, 1013, 1002, 8840, 11266, 2953, 1027, 1002, 2023, 1011, 30524,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/HttpClient/Response/ResponseTrait.php
ResponseTrait.doDestruct
private function doDestruct() { if ($this->initializer && null === $this->info['error']) { ($this->initializer)($this); $this->initializer = null; $this->checkStatusCode(); } }
php
private function doDestruct() { if ($this->initializer && null === $this->info['error']) { ($this->initializer)($this); $this->initializer = null; $this->checkStatusCode(); } }
[ "private", "function", "doDestruct", "(", ")", "{", "if", "(", "$", "this", "->", "initializer", "&&", "null", "===", "$", "this", "->", "info", "[", "'error'", "]", ")", "{", "(", "$", "this", "->", "initializer", ")", "(", "$", "this", ")", ";", ...
Ensures the request is always sent and that the response code was checked.
[ "Ensures", "the", "request", "is", "always", "sent", "and", "that", "the", "response", "code", "was", "checked", "." ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpClient/Response/ResponseTrait.php#L228-L235
train
Destructor.
[ 30522, 2797, 3853, 26489, 4355, 6820, 6593, 1006, 1007, 1063, 2065, 1006, 1002, 2023, 1011, 1028, 3988, 17629, 1004, 1004, 19701, 1027, 1027, 1027, 1002, 2023, 1011, 1028, 18558, 1031, 1005, 7561, 1005, 1033, 1007, 1063, 1006, 1002, 2023, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
plugins/MobileMessaging/API.php
API.areSMSAPICredentialProvided
public function areSMSAPICredentialProvided() { Piwik::checkUserHasSomeViewAccess(); $credential = $this->getSMSAPICredential(); return isset($credential[MobileMessaging::API_KEY_OPTION]); }
php
public function areSMSAPICredentialProvided() { Piwik::checkUserHasSomeViewAccess(); $credential = $this->getSMSAPICredential(); return isset($credential[MobileMessaging::API_KEY_OPTION]); }
[ "public", "function", "areSMSAPICredentialProvided", "(", ")", "{", "Piwik", "::", "checkUserHasSomeViewAccess", "(", ")", ";", "$", "credential", "=", "$", "this", "->", "getSMSAPICredential", "(", ")", ";", "return", "isset", "(", "$", "credential", "[", "Mo...
determine if SMS API credential are available for the current user @return bool true if SMS API credential are available for the current user
[ "determine", "if", "SMS", "API", "credential", "are", "available", "for", "the", "current", "user" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/MobileMessaging/API.php#L33-L39
train
Checks if the SMS API credential is provided.
[ 30522, 2270, 3853, 23631, 5244, 9331, 2594, 5596, 24271, 21572, 17258, 2098, 1006, 1007, 1063, 14255, 9148, 2243, 1024, 1024, 4638, 20330, 14949, 14045, 8584, 6305, 9623, 2015, 1006, 1007, 1025, 1002, 13675, 14728, 19909, 1027, 1002, 2023, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/Routing/Router.php
Router.setContext
public function setContext(RequestContext $context) { $this->context = $context; if (null !== $this->matcher) { $this->getMatcher()->setContext($context); } if (null !== $this->generator) { $this->getGenerator()->setContext($context); } }
php
public function setContext(RequestContext $context) { $this->context = $context; if (null !== $this->matcher) { $this->getMatcher()->setContext($context); } if (null !== $this->generator) { $this->getGenerator()->setContext($context); } }
[ "public", "function", "setContext", "(", "RequestContext", "$", "context", ")", "{", "$", "this", "->", "context", "=", "$", "context", ";", "if", "(", "null", "!==", "$", "this", "->", "matcher", ")", "{", "$", "this", "->", "getMatcher", "(", ")", ...
{@inheritdoc}
[ "{" ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Routing/Router.php#L221-L231
train
Set the context for the matcher and generator
[ 30522, 2270, 3853, 2275, 8663, 18209, 1006, 5227, 8663, 18209, 1002, 6123, 1007, 1063, 1002, 2023, 1011, 1028, 6123, 1027, 1002, 6123, 1025, 2065, 1006, 19701, 999, 1027, 1027, 1002, 2023, 1011, 1028, 2674, 2121, 1007, 1063, 1002, 2023, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/Mailer/Transport/Smtp/SmtpTransport.php
SmtpTransport.executeCommand
public function executeCommand(string $command, array $codes): string { $this->getLogger()->debug(sprintf('Email transport "%s" sent command "%s"', __CLASS__, trim($command))); $this->stream->write($command); $response = $this->getFullResponse(); $this->assertResponseCode($response, $codes); return $response; }
php
public function executeCommand(string $command, array $codes): string { $this->getLogger()->debug(sprintf('Email transport "%s" sent command "%s"', __CLASS__, trim($command))); $this->stream->write($command); $response = $this->getFullResponse(); $this->assertResponseCode($response, $codes); return $response; }
[ "public", "function", "executeCommand", "(", "string", "$", "command", ",", "array", "$", "codes", ")", ":", "string", "{", "$", "this", "->", "getLogger", "(", ")", "->", "debug", "(", "sprintf", "(", "'Email transport \"%s\" sent command \"%s\"'", ",", "__CL...
Runs a command against the stream, expecting the given response codes. @param int[] $codes @return string The server response @throws TransportException when an invalid response if received @internal
[ "Runs", "a", "command", "against", "the", "stream", "expecting", "the", "given", "response", "codes", "." ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Mailer/Transport/Smtp/SmtpTransport.php#L138-L146
train
Sends a command to the SMTP server and returns the response.
[ 30522, 2270, 3853, 15389, 9006, 2386, 2094, 1006, 5164, 1002, 3094, 1010, 9140, 1002, 9537, 1007, 1024, 5164, 1063, 1002, 2023, 1011, 1028, 2131, 21197, 4590, 1006, 1007, 1011, 1028, 2139, 8569, 2290, 1006, 9043, 2546, 1006, 1005, 10373, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Bridge/Twig/Extension/CodeExtension.php
CodeExtension.formatArgs
public function formatArgs($args) { $result = []; foreach ($args as $key => $item) { if ('object' === $item[0]) { $parts = explode('\\', $item[1]); $short = array_pop($parts); $formattedValue = sprintf('<em>object</em>(<abbr title="%s">%s</abbr>)', $item[1], $short); } elseif ('array' === $item[0]) { $formattedValue = sprintf('<em>array</em>(%s)', \is_array($item[1]) ? $this->formatArgs($item[1]) : $item[1]); } elseif ('null' === $item[0]) { $formattedValue = '<em>null</em>'; } elseif ('boolean' === $item[0]) { $formattedValue = '<em>'.strtolower(var_export($item[1], true)).'</em>'; } elseif ('resource' === $item[0]) { $formattedValue = '<em>resource</em>'; } else { $formattedValue = str_replace("\n", '', htmlspecialchars(var_export($item[1], true), ENT_COMPAT | ENT_SUBSTITUTE, $this->charset)); } $result[] = \is_int($key) ? $formattedValue : sprintf("'%s' => %s", $key, $formattedValue); } return implode(', ', $result); }
php
public function formatArgs($args) { $result = []; foreach ($args as $key => $item) { if ('object' === $item[0]) { $parts = explode('\\', $item[1]); $short = array_pop($parts); $formattedValue = sprintf('<em>object</em>(<abbr title="%s">%s</abbr>)', $item[1], $short); } elseif ('array' === $item[0]) { $formattedValue = sprintf('<em>array</em>(%s)', \is_array($item[1]) ? $this->formatArgs($item[1]) : $item[1]); } elseif ('null' === $item[0]) { $formattedValue = '<em>null</em>'; } elseif ('boolean' === $item[0]) { $formattedValue = '<em>'.strtolower(var_export($item[1], true)).'</em>'; } elseif ('resource' === $item[0]) { $formattedValue = '<em>resource</em>'; } else { $formattedValue = str_replace("\n", '', htmlspecialchars(var_export($item[1], true), ENT_COMPAT | ENT_SUBSTITUTE, $this->charset)); } $result[] = \is_int($key) ? $formattedValue : sprintf("'%s' => %s", $key, $formattedValue); } return implode(', ', $result); }
[ "public", "function", "formatArgs", "(", "$", "args", ")", "{", "$", "result", "=", "[", "]", ";", "foreach", "(", "$", "args", "as", "$", "key", "=>", "$", "item", ")", "{", "if", "(", "'object'", "===", "$", "item", "[", "0", "]", ")", "{", ...
Formats an array as a string. @param array $args The argument array @return string
[ "Formats", "an", "array", "as", "a", "string", "." ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bridge/Twig/Extension/CodeExtension.php#L89-L113
train
Formats the arguments for the debug function
[ 30522, 2270, 3853, 4289, 2906, 5620, 1006, 1002, 12098, 5620, 1007, 1063, 1002, 2765, 1027, 1031, 1033, 1025, 18921, 6776, 1006, 1002, 12098, 5620, 2004, 1002, 3145, 1027, 1028, 1002, 8875, 1007, 1063, 2065, 1006, 1005, 4874, 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...