repository_name
stringlengths
5
67
func_path_in_repository
stringlengths
4
234
func_name
stringlengths
0
314
whole_func_string
stringlengths
52
3.87M
language
stringclasses
6 values
func_code_string
stringlengths
52
3.87M
func_code_tokens
listlengths
15
672k
func_documentation_string
stringlengths
1
47.2k
func_documentation_tokens
listlengths
1
3.92k
split_name
stringclasses
1 value
func_code_url
stringlengths
85
339
marqu3s/nrsgateway
src/SMSService.php
SMSService.send
public function send() { # Check it $this->to is an array. if (!is_array($this->to)) { return [ 0 => [ 'result' => [ 'httpCode' => 400, 'header' => '', 'body' => '{"error":{"code":...
php
public function send() { # Check it $this->to is an array. if (!is_array($this->to)) { return [ 0 => [ 'result' => [ 'httpCode' => 400, 'header' => '', 'body' => '{"error":{"code":...
[ "public", "function", "send", "(", ")", "{", "# Check it $this->to is an array.", "if", "(", "!", "is_array", "(", "$", "this", "->", "to", ")", ")", "{", "return", "[", "0", "=>", "[", "'result'", "=>", "[", "'httpCode'", "=>", "400", ",", "'header'", ...
Splits the the $to list in chunks of self::TO_LIMIT_PER_REQUEST. Send the message to every element in all chunks. @return array|boolean
[ "Splits", "the", "the", "$to", "list", "in", "chunks", "of", "self", "::", "TO_LIMIT_PER_REQUEST", ".", "Send", "the", "message", "to", "every", "element", "in", "all", "chunks", "." ]
train
https://github.com/marqu3s/nrsgateway/blob/37af229810468518c6c0d25d9742f20f778b9ad1/src/SMSService.php#L58-L131
phramework/jsonapi
src/Controller/Base.php
Base.viewData
public static function viewData( $data, $links = null, $meta = null, $included = null ) { $viewParameters = new \stdClass(); if ($links) { $viewParameters->links = $links; } $viewParameters->data = $data; if ($included !== null) ...
php
public static function viewData( $data, $links = null, $meta = null, $included = null ) { $viewParameters = new \stdClass(); if ($links) { $viewParameters->links = $links; } $viewParameters->data = $data; if ($included !== null) ...
[ "public", "static", "function", "viewData", "(", "$", "data", ",", "$", "links", "=", "null", ",", "$", "meta", "=", "null", ",", "$", "included", "=", "null", ")", "{", "$", "viewParameters", "=", "new", "\\", "stdClass", "(", ")", ";", "if", "(",...
View JSONAPI data @param object $data @uses \Phramework\Viewers\JSONAPI @return boolean
[ "View", "JSONAPI", "data" ]
train
https://github.com/phramework/jsonapi/blob/af20882a8b6f6e5be9c8e09e5b87f6c23a4b0726/src/Controller/Base.php#L85-L112
phramework/jsonapi
src/Controller/Base.php
Base.getRequestInclude
protected static function getRequestInclude($parameters, $modelClass = null) { //work with arrays if (!is_object($parameters) && is_array($parameters)) { $parameters = (object) $parameters; } $include = []; if ($modelClass !== null) { //Add additiona...
php
protected static function getRequestInclude($parameters, $modelClass = null) { //work with arrays if (!is_object($parameters) && is_array($parameters)) { $parameters = (object) $parameters; } $include = []; if ($modelClass !== null) { //Add additiona...
[ "protected", "static", "function", "getRequestInclude", "(", "$", "parameters", ",", "$", "modelClass", "=", "null", ")", "{", "//work with arrays", "if", "(", "!", "is_object", "(", "$", "parameters", ")", "&&", "is_array", "(", "$", "parameters", ")", ")",...
Extract included related resources from parameters @param object $parameters Request parameters @param string|null $modelClass If not null, will add additional include by default from resource model's relationships @return string[]
[ "Extract", "included", "related", "resources", "from", "parameters" ]
train
https://github.com/phramework/jsonapi/blob/af20882a8b6f6e5be9c8e09e5b87f6c23a4b0726/src/Controller/Base.php#L120-L148
phramework/jsonapi
src/Controller/Base.php
Base.getRequestAttributes
protected static function getRequestAttributes($parameters) { //work with objects if (is_array($parameters)) { $parameters = (object) $parameters; } //Require data Request::requireParameters($parameters, ['data']); //Require data attributes Reque...
php
protected static function getRequestAttributes($parameters) { //work with objects if (is_array($parameters)) { $parameters = (object) $parameters; } //Require data Request::requireParameters($parameters, ['data']); //Require data attributes Reque...
[ "protected", "static", "function", "getRequestAttributes", "(", "$", "parameters", ")", "{", "//work with objects", "if", "(", "is_array", "(", "$", "parameters", ")", ")", "{", "$", "parameters", "=", "(", "object", ")", "$", "parameters", ";", "}", "//Requ...
Get request data attributes. The request is expected to have json api structure Like the following example: ``` (object) [ data => (object) [ 'type' => 'user', 'attributes' => [(object) 'email' => 'nohponex@gmail.com', 'password' => 'XXXXXXXXXXXXXXXXXX' ] ] ] ``` @param object $parameters Request parameters @uses R...
[ "Get", "request", "data", "attributes", ".", "The", "request", "is", "expected", "to", "have", "json", "api", "structure", "Like", "the", "following", "example", ":", "(", "object", ")", "[", "data", "=", ">", "(", "object", ")", "[", "type", "=", ">",...
train
https://github.com/phramework/jsonapi/blob/af20882a8b6f6e5be9c8e09e5b87f6c23a4b0726/src/Controller/Base.php#L169-L188
phramework/jsonapi
src/Controller/Base.php
Base.getRequestData
protected static function getRequestData($parameters) { //work with objects if (!is_object($parameters) && is_array($parameters)) { $parameters = (object) $parameters; } //Require data Request::requireParameters($parameters, ['data']); return $parameters...
php
protected static function getRequestData($parameters) { //work with objects if (!is_object($parameters) && is_array($parameters)) { $parameters = (object) $parameters; } //Require data Request::requireParameters($parameters, ['data']); return $parameters...
[ "protected", "static", "function", "getRequestData", "(", "$", "parameters", ")", "{", "//work with objects", "if", "(", "!", "is_object", "(", "$", "parameters", ")", "&&", "is_array", "(", "$", "parameters", ")", ")", "{", "$", "parameters", "=", "(", "o...
Get request primary data @param object $parameters Request parameters @uses Request::requireParameters @return object|object[]
[ "Get", "request", "primary", "data" ]
train
https://github.com/phramework/jsonapi/blob/af20882a8b6f6e5be9c8e09e5b87f6c23a4b0726/src/Controller/Base.php#L196-L207
phramework/jsonapi
src/Controller/Base.php
Base.getRequestRelationships
protected static function getRequestRelationships($parameters) { //work with objects if (!is_object($parameters) && is_array($parameters)) { $parameters = (object) $parameters; } //Require data Request::requireParameters($parameters, ['data']); //Require...
php
protected static function getRequestRelationships($parameters) { //work with objects if (!is_object($parameters) && is_array($parameters)) { $parameters = (object) $parameters; } //Require data Request::requireParameters($parameters, ['data']); //Require...
[ "protected", "static", "function", "getRequestRelationships", "(", "$", "parameters", ")", "{", "//work with objects", "if", "(", "!", "is_object", "(", "$", "parameters", ")", "&&", "is_array", "(", "$", "parameters", ")", ")", "{", "$", "parameters", "=", ...
Get request relationships if any attributes. @param object $parameters Request parameters @return object
[ "Get", "request", "relationships", "if", "any", "attributes", "." ]
train
https://github.com/phramework/jsonapi/blob/af20882a8b6f6e5be9c8e09e5b87f6c23a4b0726/src/Controller/Base.php#L214-L230
sasedev/composer-plugin-filecopier
src/Sasedev/Composer/Plugin/Filescopier/Processor.php
Processor.startsWith
private function startsWith($string, $prefix) { return $prefix === "" || strrpos($string, $prefix, -strlen($string)) !== FALSE; }
php
private function startsWith($string, $prefix) { return $prefix === "" || strrpos($string, $prefix, -strlen($string)) !== FALSE; }
[ "private", "function", "startsWith", "(", "$", "string", ",", "$", "prefix", ")", "{", "return", "$", "prefix", "===", "\"\"", "||", "strrpos", "(", "$", "string", ",", "$", "prefix", ",", "-", "strlen", "(", "$", "string", ")", ")", "!==", "FALSE", ...
Check if a string starts with a prefix @param string $string @param string $prefix @return boolean
[ "Check", "if", "a", "string", "starts", "with", "a", "prefix" ]
train
https://github.com/sasedev/composer-plugin-filecopier/blob/0cb2430d9a95b3955e05a8fe43054751c08b9f07/src/Sasedev/Composer/Plugin/Filescopier/Processor.php#L189-L191
sasedev/composer-plugin-filecopier
src/Sasedev/Composer/Plugin/Filescopier/Processor.php
Processor.endswith
private function endswith($string, $suffix) { $strlen = strlen($string); $testlen = strlen($suffix); if ($testlen > $strlen) { return false; } return substr_compare($string, $suffix, -$testlen) === 0; }
php
private function endswith($string, $suffix) { $strlen = strlen($string); $testlen = strlen($suffix); if ($testlen > $strlen) { return false; } return substr_compare($string, $suffix, -$testlen) === 0; }
[ "private", "function", "endswith", "(", "$", "string", ",", "$", "suffix", ")", "{", "$", "strlen", "=", "strlen", "(", "$", "string", ")", ";", "$", "testlen", "=", "strlen", "(", "$", "suffix", ")", ";", "if", "(", "$", "testlen", ">", "$", "st...
Check if a string ends with a suffix @param string $string @param string $suffix @return boolean
[ "Check", "if", "a", "string", "ends", "with", "a", "suffix" ]
train
https://github.com/sasedev/composer-plugin-filecopier/blob/0cb2430d9a95b3955e05a8fe43054751c08b9f07/src/Sasedev/Composer/Plugin/Filescopier/Processor.php#L201-L210
harp-orm/query
src/Compiler/Delete.php
Delete.render
public static function render(Query\Delete $query) { return Compiler::withDb($query->getDb(), function () use ($query) { return Compiler::expression(array( 'DELETE', $query->getType(), Aliased::combine($query->getTable()), Compiler:...
php
public static function render(Query\Delete $query) { return Compiler::withDb($query->getDb(), function () use ($query) { return Compiler::expression(array( 'DELETE', $query->getType(), Aliased::combine($query->getTable()), Compiler:...
[ "public", "static", "function", "render", "(", "Query", "\\", "Delete", "$", "query", ")", "{", "return", "Compiler", "::", "withDb", "(", "$", "query", "->", "getDb", "(", ")", ",", "function", "(", ")", "use", "(", "$", "query", ")", "{", "return",...
Render a Delete object @param Query\Delete $query @return string
[ "Render", "a", "Delete", "object" ]
train
https://github.com/harp-orm/query/blob/98ce2468a0a31fe15ed3692bad32547bf6dbe41a/src/Compiler/Delete.php#L19-L33
darkwebdesign/doctrine-unit-testing
src/Mocks/CacheRegionMock.php
CacheRegionMock.getReturn
private function getReturn($method, $default) { if (isset($this->returns[$method]) && ! empty($this->returns[$method])) { return array_shift($this->returns[$method]); } return $default; }
php
private function getReturn($method, $default) { if (isset($this->returns[$method]) && ! empty($this->returns[$method])) { return array_shift($this->returns[$method]); } return $default; }
[ "private", "function", "getReturn", "(", "$", "method", ",", "$", "default", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "returns", "[", "$", "method", "]", ")", "&&", "!", "empty", "(", "$", "this", "->", "returns", "[", "$", "method", ...
Dequeue a value for a specific method invocation @param string $method @param mixed $default @return mixed
[ "Dequeue", "a", "value", "for", "a", "specific", "method", "invocation" ]
train
https://github.com/darkwebdesign/doctrine-unit-testing/blob/0daf50359563bc0679925e573a7105d6cd57168a/src/Mocks/CacheRegionMock.php#L39-L46
darkwebdesign/doctrine-unit-testing
src/Mocks/CacheRegionMock.php
CacheRegionMock.contains
public function contains(CacheKey $key) { $this->calls[__FUNCTION__][] = ['key' => $key]; return $this->getReturn(__FUNCTION__, false); }
php
public function contains(CacheKey $key) { $this->calls[__FUNCTION__][] = ['key' => $key]; return $this->getReturn(__FUNCTION__, false); }
[ "public", "function", "contains", "(", "CacheKey", "$", "key", ")", "{", "$", "this", "->", "calls", "[", "__FUNCTION__", "]", "[", "]", "=", "[", "'key'", "=>", "$", "key", "]", ";", "return", "$", "this", "->", "getReturn", "(", "__FUNCTION__", ","...
{@inheritdoc}
[ "{" ]
train
https://github.com/darkwebdesign/doctrine-unit-testing/blob/0daf50359563bc0679925e573a7105d6cd57168a/src/Mocks/CacheRegionMock.php#L61-L66
darkwebdesign/doctrine-unit-testing
src/Mocks/CacheRegionMock.php
CacheRegionMock.evict
public function evict(CacheKey $key) { $this->calls[__FUNCTION__][] = ['key' => $key]; return $this->getReturn(__FUNCTION__, true); }
php
public function evict(CacheKey $key) { $this->calls[__FUNCTION__][] = ['key' => $key]; return $this->getReturn(__FUNCTION__, true); }
[ "public", "function", "evict", "(", "CacheKey", "$", "key", ")", "{", "$", "this", "->", "calls", "[", "__FUNCTION__", "]", "[", "]", "=", "[", "'key'", "=>", "$", "key", "]", ";", "return", "$", "this", "->", "getReturn", "(", "__FUNCTION__", ",", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/darkwebdesign/doctrine-unit-testing/blob/0daf50359563bc0679925e573a7105d6cd57168a/src/Mocks/CacheRegionMock.php#L71-L76
darkwebdesign/doctrine-unit-testing
src/Mocks/CacheRegionMock.php
CacheRegionMock.get
public function get(CacheKey $key) { $this->calls[__FUNCTION__][] = ['key' => $key]; return $this->getReturn(__FUNCTION__, null); }
php
public function get(CacheKey $key) { $this->calls[__FUNCTION__][] = ['key' => $key]; return $this->getReturn(__FUNCTION__, null); }
[ "public", "function", "get", "(", "CacheKey", "$", "key", ")", "{", "$", "this", "->", "calls", "[", "__FUNCTION__", "]", "[", "]", "=", "[", "'key'", "=>", "$", "key", "]", ";", "return", "$", "this", "->", "getReturn", "(", "__FUNCTION__", ",", "...
{@inheritdoc}
[ "{" ]
train
https://github.com/darkwebdesign/doctrine-unit-testing/blob/0daf50359563bc0679925e573a7105d6cd57168a/src/Mocks/CacheRegionMock.php#L91-L96
darkwebdesign/doctrine-unit-testing
src/Mocks/CacheRegionMock.php
CacheRegionMock.getMultiple
public function getMultiple(CollectionCacheEntry $collection) { $this->calls[__FUNCTION__][] = ['collection' => $collection]; return $this->getReturn(__FUNCTION__, null); }
php
public function getMultiple(CollectionCacheEntry $collection) { $this->calls[__FUNCTION__][] = ['collection' => $collection]; return $this->getReturn(__FUNCTION__, null); }
[ "public", "function", "getMultiple", "(", "CollectionCacheEntry", "$", "collection", ")", "{", "$", "this", "->", "calls", "[", "__FUNCTION__", "]", "[", "]", "=", "[", "'collection'", "=>", "$", "collection", "]", ";", "return", "$", "this", "->", "getRet...
{@inheritdoc}
[ "{" ]
train
https://github.com/darkwebdesign/doctrine-unit-testing/blob/0daf50359563bc0679925e573a7105d6cd57168a/src/Mocks/CacheRegionMock.php#L101-L106
darkwebdesign/doctrine-unit-testing
src/Mocks/CacheRegionMock.php
CacheRegionMock.put
public function put(CacheKey $key, CacheEntry $entry, Lock $lock = null) { $this->calls[__FUNCTION__][] = ['key' => $key, 'entry' => $entry]; return $this->getReturn(__FUNCTION__, true); }
php
public function put(CacheKey $key, CacheEntry $entry, Lock $lock = null) { $this->calls[__FUNCTION__][] = ['key' => $key, 'entry' => $entry]; return $this->getReturn(__FUNCTION__, true); }
[ "public", "function", "put", "(", "CacheKey", "$", "key", ",", "CacheEntry", "$", "entry", ",", "Lock", "$", "lock", "=", "null", ")", "{", "$", "this", "->", "calls", "[", "__FUNCTION__", "]", "[", "]", "=", "[", "'key'", "=>", "$", "key", ",", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/darkwebdesign/doctrine-unit-testing/blob/0daf50359563bc0679925e573a7105d6cd57168a/src/Mocks/CacheRegionMock.php#L111-L116
fsi-open/datasource-bundle
DataSource/Extension/Symfony/Core/EventSubscriber/BindParameters.php
BindParameters.preBindParameters
public function preBindParameters(DataSourceEvent\ParametersEventArgs $event) { $parameters = $event->getParameters(); if ($parameters instanceof Request) { $event->setParameters($parameters->query->all()); } }
php
public function preBindParameters(DataSourceEvent\ParametersEventArgs $event) { $parameters = $event->getParameters(); if ($parameters instanceof Request) { $event->setParameters($parameters->query->all()); } }
[ "public", "function", "preBindParameters", "(", "DataSourceEvent", "\\", "ParametersEventArgs", "$", "event", ")", "{", "$", "parameters", "=", "$", "event", "->", "getParameters", "(", ")", ";", "if", "(", "$", "parameters", "instanceof", "Request", ")", "{",...
Method called at PreBindParameters event. @param DataSourceEvent\ParametersEventArgs $event
[ "Method", "called", "at", "PreBindParameters", "event", "." ]
train
https://github.com/fsi-open/datasource-bundle/blob/06964672c838af9f4125065e3a90b2df4e8aa077/DataSource/Extension/Symfony/Core/EventSubscriber/BindParameters.php#L35-L41
vincentchalamon/VinceCmsSonataAdminBundle
Form/Type/MetaType.php
MetaType.buildForm
public function buildForm(FormBuilderInterface $builder, array $options) { foreach ($options['metas'] as $meta) { /** @var Meta $meta */ $builder->add($meta->getName(), $meta->getType(), array( 'label' => $meta->getTitle(), 'required' => fal...
php
public function buildForm(FormBuilderInterface $builder, array $options) { foreach ($options['metas'] as $meta) { /** @var Meta $meta */ $builder->add($meta->getName(), $meta->getType(), array( 'label' => $meta->getTitle(), 'required' => fal...
[ "public", "function", "buildForm", "(", "FormBuilderInterface", "$", "builder", ",", "array", "$", "options", ")", "{", "foreach", "(", "$", "options", "[", "'metas'", "]", "as", "$", "meta", ")", "{", "/** @var Meta $meta */", "$", "builder", "->", "add", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/vincentchalamon/VinceCmsSonataAdminBundle/blob/edc768061734a92ba116488dd7b61ad40af21ceb/Form/Type/MetaType.php#L28-L38
bestit/commercetools-order-export-bundle
src/DependencyInjection/Configuration.php
Configuration.getConfigTreeBuilder
public function getConfigTreeBuilder() { $builder = new TreeBuilder(); $rootNode = $builder->root('best_it_ct_order_export'); $rootNode ->children() ->arrayNode('commercetools_client') ->isRequired() ->children() ...
php
public function getConfigTreeBuilder() { $builder = new TreeBuilder(); $rootNode = $builder->root('best_it_ct_order_export'); $rootNode ->children() ->arrayNode('commercetools_client') ->isRequired() ->children() ...
[ "public", "function", "getConfigTreeBuilder", "(", ")", "{", "$", "builder", "=", "new", "TreeBuilder", "(", ")", ";", "$", "rootNode", "=", "$", "builder", "->", "root", "(", "'best_it_ct_order_export'", ")", ";", "$", "rootNode", "->", "children", "(", "...
Parses the config. @return TreeBuilder
[ "Parses", "the", "config", "." ]
train
https://github.com/bestit/commercetools-order-export-bundle/blob/44bd0dedff6edab5ecf5803dcf6d24ffe0dbf845/src/DependencyInjection/Configuration.php#L21-L76
movoin/one-swoole
src/Swoole/Components/Task/Provider.php
Provider.register
public function register() { $this->bind('task', function ($server) { $scheduler = new Scheduler; $scheduler->setSwoole($server->getSwoole()); // {{ Attach Task Handlers $tasks = $this->config('task', []); foreach ($tasks as $name => $handler) { ...
php
public function register() { $this->bind('task', function ($server) { $scheduler = new Scheduler; $scheduler->setSwoole($server->getSwoole()); // {{ Attach Task Handlers $tasks = $this->config('task', []); foreach ($tasks as $name => $handler) { ...
[ "public", "function", "register", "(", ")", "{", "$", "this", "->", "bind", "(", "'task'", ",", "function", "(", "$", "server", ")", "{", "$", "scheduler", "=", "new", "Scheduler", ";", "$", "scheduler", "->", "setSwoole", "(", "$", "server", "->", "...
注册服务
[ "注册服务" ]
train
https://github.com/movoin/one-swoole/blob/b9b175963ead91416cc50902a04e05ff3ef571de/src/Swoole/Components/Task/Provider.php#L22-L40
phramework/jsonapi
src/Model/Directives.php
Directives.handleGet
protected static function handleGet( $query, Page $page = null, Filter $filter = null, Sort $sort = null, Fields $fields = null, $hasWhere = true ) { $query = str_replace('{{table}}', static::getTable(), $query); $query = trim(self::handleFields( ...
php
protected static function handleGet( $query, Page $page = null, Filter $filter = null, Sort $sort = null, Fields $fields = null, $hasWhere = true ) { $query = str_replace('{{table}}', static::getTable(), $query); $query = trim(self::handleFields( ...
[ "protected", "static", "function", "handleGet", "(", "$", "query", ",", "Page", "$", "page", "=", "null", ",", "Filter", "$", "filter", "=", "null", ",", "Sort", "$", "sort", "=", "null", ",", "Fields", "$", "fields", "=", "null", ",", "$", "hasWhere...
Apply page, filter, sort and fields directives to query. This method will replace `{{table}}`, `{{sort}}`, `{{page}}`, `{{filter}}` and `{{fields}}` in query. @uses static::handlePage @uses static::handleSort @uses static::handleFilter @uses static::handleFields @param string $query Query string @param Page...
[ "Apply", "page", "filter", "sort", "and", "fields", "directives", "to", "query", ".", "This", "method", "will", "replace", "{{", "table", "}}", "{{", "sort", "}}", "{{", "page", "}}", "{{", "filter", "}}", "and", "{{", "fields", "}}", "in", "query", "....
train
https://github.com/phramework/jsonapi/blob/af20882a8b6f6e5be9c8e09e5b87f6c23a4b0726/src/Model/Directives.php#L71-L97
phramework/jsonapi
src/Model/Directives.php
Directives.handleSort
private static function handleSort($query, $sort = null) { $replace = ''; if ($sort !== null) { $sort ->validate(static::class); $tableAttribute = ( $sort->table === null ? $sort->attribute : $sort->table . '"."' .$sort->attri...
php
private static function handleSort($query, $sort = null) { $replace = ''; if ($sort !== null) { $sort ->validate(static::class); $tableAttribute = ( $sort->table === null ? $sort->attribute : $sort->table . '"."' .$sort->attri...
[ "private", "static", "function", "handleSort", "(", "$", "query", ",", "$", "sort", "=", "null", ")", "{", "$", "replace", "=", "''", ";", "if", "(", "$", "sort", "!==", "null", ")", "{", "$", "sort", "->", "validate", "(", "static", "::", "class",...
This method will update `{{sort}}` string inside query parameter with the provided sort directive @param string $query Query @param Sort|null $sort @return string Query
[ "This", "method", "will", "update", "{{", "sort", "}}", "string", "inside", "query", "parameter", "with", "the", "provided", "sort", "directive" ]
train
https://github.com/phramework/jsonapi/blob/af20882a8b6f6e5be9c8e09e5b87f6c23a4b0726/src/Model/Directives.php#L106-L133
phramework/jsonapi
src/Model/Directives.php
Directives.handlePage
private static function handlePage($query, $page = null) { /** * string[] */ $additionalQuery = []; if ($page === null) { //Use resource model's default page $page = static::getDefaultPage(); } if ($page->limit !== null) { ...
php
private static function handlePage($query, $page = null) { /** * string[] */ $additionalQuery = []; if ($page === null) { //Use resource model's default page $page = static::getDefaultPage(); } if ($page->limit !== null) { ...
[ "private", "static", "function", "handlePage", "(", "$", "query", ",", "$", "page", "=", "null", ")", "{", "/**\n * string[]\n */", "$", "additionalQuery", "=", "[", "]", ";", "if", "(", "$", "page", "===", "null", ")", "{", "//Use resource m...
This method will update `{{page}}` string inside query parameter with the provided pagination directive @param string $query Query @param Page|null $page @return string Query @uses Model::getDefaultPage if page is null @throws RequestException
[ "This", "method", "will", "update", "{{", "page", "}}", "string", "inside", "query", "parameter", "with", "the", "provided", "pagination", "directive" ]
train
https://github.com/phramework/jsonapi/blob/af20882a8b6f6e5be9c8e09e5b87f6c23a4b0726/src/Model/Directives.php#L144-L183
phramework/jsonapi
src/Model/Directives.php
Directives.handleFields
private static function handleFields( $query, Fields $fields = null ) { $type = static::getType(); if ($fields === null || empty($fields->get($type))) { //Use resource model's default fields $fields = static::getDefaultFields(); $attributes = ar...
php
private static function handleFields( $query, Fields $fields = null ) { $type = static::getType(); if ($fields === null || empty($fields->get($type))) { //Use resource model's default fields $fields = static::getDefaultFields(); $attributes = ar...
[ "private", "static", "function", "handleFields", "(", "$", "query", ",", "Fields", "$", "fields", "=", "null", ")", "{", "$", "type", "=", "static", "::", "getType", "(", ")", ";", "if", "(", "$", "fields", "===", "null", "||", "empty", "(", "$", "...
This method will update `{{fields}}` string inside query parameter with the provided fields directives @param string $query @param Fields|null $fields @return string @since 1.0.0 @todo add table prefix @uses Model::getDefaultFields if fields is null
[ "This", "method", "will", "update", "{{", "fields", "}}", "string", "inside", "query", "parameter", "with", "the", "provided", "fields", "directives" ]
train
https://github.com/phramework/jsonapi/blob/af20882a8b6f6e5be9c8e09e5b87f6c23a4b0726/src/Model/Directives.php#L447-L519
heyday/heystack
src/Output/GroupedProcessor.php
GroupedProcessor.process
public function process(\Controller $controller, $result = null) { foreach ($this->processors as $processor) { $processor->process($controller, $result); } return $controller->getResponse(); }
php
public function process(\Controller $controller, $result = null) { foreach ($this->processors as $processor) { $processor->process($controller, $result); } return $controller->getResponse(); }
[ "public", "function", "process", "(", "\\", "Controller", "$", "controller", ",", "$", "result", "=", "null", ")", "{", "foreach", "(", "$", "this", "->", "processors", "as", "$", "processor", ")", "{", "$", "processor", "->", "process", "(", "$", "con...
Runs over the list of processors running them all in turn @param \Controller $controller The controller the request was handled by @param mixed $result The result from the previosly run input processor/s @return \SS_HTTPResponse Controller response
[ "Runs", "over", "the", "list", "of", "processors", "running", "them", "all", "in", "turn" ]
train
https://github.com/heyday/heystack/blob/2c051933f8c532d0a9a23be6ee1ff5c619e47dfe/src/Output/GroupedProcessor.php#L70-L77
Atlantic18/CoralCoreBundle
Service/Request/Request.php
Request.isCacheable
private function isCacheable(RequestHandleInterface $handle) { if(null === $this->cache) { return false; } if($handle->getMethod() != self::GET) { return false; } return true; }
php
private function isCacheable(RequestHandleInterface $handle) { if(null === $this->cache) { return false; } if($handle->getMethod() != self::GET) { return false; } return true; }
[ "private", "function", "isCacheable", "(", "RequestHandleInterface", "$", "handle", ")", "{", "if", "(", "null", "===", "$", "this", "->", "cache", ")", "{", "return", "false", ";", "}", "if", "(", "$", "handle", "->", "getMethod", "(", ")", "!=", "sel...
Returns true if handle is possible to be cached @param RequestHandleInterface $handle Request handle @return boolean True if can be cached
[ "Returns", "true", "if", "handle", "is", "possible", "to", "be", "cached" ]
train
https://github.com/Atlantic18/CoralCoreBundle/blob/7d74ffaf51046ad13cbfc2b0b69d656a499f38ab/Service/Request/Request.php#L49-L61
Atlantic18/CoralCoreBundle
Service/Request/Request.php
Request.doRequestAndParse
public function doRequestAndParse(RequestHandleInterface $handle, $contentType = 'application/json') { if($this->isCacheable($handle) && (false !== ($params = $this->cache->fetch('parser_' . $handle->hash())))) { $parser = new JsonParser; $parser->setParams($params); ...
php
public function doRequestAndParse(RequestHandleInterface $handle, $contentType = 'application/json') { if($this->isCacheable($handle) && (false !== ($params = $this->cache->fetch('parser_' . $handle->hash())))) { $parser = new JsonParser; $parser->setParams($params); ...
[ "public", "function", "doRequestAndParse", "(", "RequestHandleInterface", "$", "handle", ",", "$", "contentType", "=", "'application/json'", ")", "{", "if", "(", "$", "this", "->", "isCacheable", "(", "$", "handle", ")", "&&", "(", "false", "!==", "(", "$", ...
Do request and return response as a Parser instance. Note: if you need response headers use doRequest instead. @param RequestHandleInterface $handle Request handle @param string $contentType ContentType of the request @return Parser
[ "Do", "request", "and", "return", "response", "as", "a", "Parser", "instance", ".", "Note", ":", "if", "you", "need", "response", "headers", "use", "doRequest", "instead", "." ]
train
https://github.com/Atlantic18/CoralCoreBundle/blob/7d74ffaf51046ad13cbfc2b0b69d656a499f38ab/Service/Request/Request.php#L83-L136
Atlantic18/CoralCoreBundle
Service/Request/Request.php
Request.doRequest
public function doRequest(RequestHandleInterface $handle, $contentType = 'application/json') { if ( $this->isCacheable($handle) && (false !== ($rawResponse = $this->cache->fetch('response_' . $handle->hash()))) ) { return new Response($...
php
public function doRequest(RequestHandleInterface $handle, $contentType = 'application/json') { if ( $this->isCacheable($handle) && (false !== ($rawResponse = $this->cache->fetch('response_' . $handle->hash()))) ) { return new Response($...
[ "public", "function", "doRequest", "(", "RequestHandleInterface", "$", "handle", ",", "$", "contentType", "=", "'application/json'", ")", "{", "if", "(", "$", "this", "->", "isCacheable", "(", "$", "handle", ")", "&&", "(", "false", "!==", "(", "$", "rawRe...
Do request @param RequestHandleInterface $handle Request handle @param string $contentType ContentType of the request @return Response
[ "Do", "request" ]
train
https://github.com/Atlantic18/CoralCoreBundle/blob/7d74ffaf51046ad13cbfc2b0b69d656a499f38ab/Service/Request/Request.php#L146-L190
stubbles/stubbles-webapp-core
src/main/php/routing/Routing.php
Routing.onGet
public function onGet(string $path, $target): ConfigurableRoute { return $this->addRoute(new Route($path, $target, 'GET')); }
php
public function onGet(string $path, $target): ConfigurableRoute { return $this->addRoute(new Route($path, $target, 'GET')); }
[ "public", "function", "onGet", "(", "string", "$", "path", ",", "$", "target", ")", ":", "ConfigurableRoute", "{", "return", "$", "this", "->", "addRoute", "(", "new", "Route", "(", "$", "path", ",", "$", "target", ",", "'GET'", ")", ")", ";", "}" ]
reply with given class or callable for GET request on given path @param string $path path this route is applicable for @param string|callable|\stubbles\webapp\Target $target code to be executed when the route is active @return \stubbles\webapp\routing\ConfigurableRoute
[ "reply", "with", "given", "class", "or", "callable", "for", "GET", "request", "on", "given", "path" ]
train
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Routing.php#L88-L91
stubbles/stubbles-webapp-core
src/main/php/routing/Routing.php
Routing.passThroughOnGet
public function passThroughOnGet( string $path = '/[a-zA-Z0-9-_]+.html$', $target = HtmlFilePassThrough::class ): ConfigurableRoute { return $this->onGet($path, $target); }
php
public function passThroughOnGet( string $path = '/[a-zA-Z0-9-_]+.html$', $target = HtmlFilePassThrough::class ): ConfigurableRoute { return $this->onGet($path, $target); }
[ "public", "function", "passThroughOnGet", "(", "string", "$", "path", "=", "'/[a-zA-Z0-9-_]+.html$'", ",", "$", "target", "=", "HtmlFilePassThrough", "::", "class", ")", ":", "ConfigurableRoute", "{", "return", "$", "this", "->", "onGet", "(", "$", "path", ","...
reply with HTML file stored in pages path @param string $path optional path this route is applicable for @param string|callable|\stubbles\webapp\Target $target optional code to be executed when the route is active @return \stubbles\webapp\routing\ConfigurableRoute @since ...
[ "reply", "with", "HTML", "file", "stored", "in", "pages", "path" ]
train
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Routing.php#L101-L106
stubbles/stubbles-webapp-core
src/main/php/routing/Routing.php
Routing.apiIndexOnGet
public function apiIndexOnGet(string $path): ConfigurableRoute { return $this->onGet($path, new Index($this->routes, $this->mimeTypes)); }
php
public function apiIndexOnGet(string $path): ConfigurableRoute { return $this->onGet($path, new Index($this->routes, $this->mimeTypes)); }
[ "public", "function", "apiIndexOnGet", "(", "string", "$", "path", ")", ":", "ConfigurableRoute", "{", "return", "$", "this", "->", "onGet", "(", "$", "path", ",", "new", "Index", "(", "$", "this", "->", "routes", ",", "$", "this", "->", "mimeTypes", "...
reply with API index overview @param string $path @return \stubbles\webapp\routing\ConfigurableRoute @since 6.1.0
[ "reply", "with", "API", "index", "overview" ]
train
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Routing.php#L115-L118
stubbles/stubbles-webapp-core
src/main/php/routing/Routing.php
Routing.redirectOnGet
public function redirectOnGet(string $path, $target, int $statusCode = 302): ConfigurableRoute { return $this->onGet($path, new Redirect($target, $statusCode)); }
php
public function redirectOnGet(string $path, $target, int $statusCode = 302): ConfigurableRoute { return $this->onGet($path, new Redirect($target, $statusCode)); }
[ "public", "function", "redirectOnGet", "(", "string", "$", "path", ",", "$", "target", ",", "int", "$", "statusCode", "=", "302", ")", ":", "ConfigurableRoute", "{", "return", "$", "this", "->", "onGet", "(", "$", "path", ",", "new", "Redirect", "(", "...
reply with a redirect If the given $target is a string it is used in different ways: - if the string starts with http it is assumed to be a complete uri - else it is assumed to be a path within the application @param string $path path this route is applicable for @param string|...
[ "reply", "with", "a", "redirect" ]
train
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Routing.php#L133-L136
stubbles/stubbles-webapp-core
src/main/php/routing/Routing.php
Routing.onHead
public function onHead(string $path, $target): ConfigurableRoute { return $this->addRoute(new Route($path, $target, 'HEAD')); }
php
public function onHead(string $path, $target): ConfigurableRoute { return $this->addRoute(new Route($path, $target, 'HEAD')); }
[ "public", "function", "onHead", "(", "string", "$", "path", ",", "$", "target", ")", ":", "ConfigurableRoute", "{", "return", "$", "this", "->", "addRoute", "(", "new", "Route", "(", "$", "path", ",", "$", "target", ",", "'HEAD'", ")", ")", ";", "}" ...
reply with given class or callable for HEAD request on given path @param string $path path this route is applicable for @param string|callable|\stubbles\webapp\Target $target code to be executed when the route is active @return \stubbles\webapp\routing\ConfigurableRoute
[ "reply", "with", "given", "class", "or", "callable", "for", "HEAD", "request", "on", "given", "path" ]
train
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Routing.php#L145-L148
stubbles/stubbles-webapp-core
src/main/php/routing/Routing.php
Routing.onPost
public function onPost(string $path, $target): ConfigurableRoute { return $this->addRoute(new Route($path, $target, 'POST')); }
php
public function onPost(string $path, $target): ConfigurableRoute { return $this->addRoute(new Route($path, $target, 'POST')); }
[ "public", "function", "onPost", "(", "string", "$", "path", ",", "$", "target", ")", ":", "ConfigurableRoute", "{", "return", "$", "this", "->", "addRoute", "(", "new", "Route", "(", "$", "path", ",", "$", "target", ",", "'POST'", ")", ")", ";", "}" ...
reply with given class or callable for POST request on given path @param string $path path this route is applicable for @param string|callable|\stubbles\webapp\Target $target code to be executed when the route is active @return \stubbles\webapp\routing\ConfigurableRoute
[ "reply", "with", "given", "class", "or", "callable", "for", "POST", "request", "on", "given", "path" ]
train
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Routing.php#L157-L160
stubbles/stubbles-webapp-core
src/main/php/routing/Routing.php
Routing.onPut
public function onPut(string $path, $target): ConfigurableRoute { return $this->addRoute(new Route($path, $target, 'PUT')); }
php
public function onPut(string $path, $target): ConfigurableRoute { return $this->addRoute(new Route($path, $target, 'PUT')); }
[ "public", "function", "onPut", "(", "string", "$", "path", ",", "$", "target", ")", ":", "ConfigurableRoute", "{", "return", "$", "this", "->", "addRoute", "(", "new", "Route", "(", "$", "path", ",", "$", "target", ",", "'PUT'", ")", ")", ";", "}" ]
reply with given class or callable for PUT request on given path @param string $path path this route is applicable for @param string|callable|\stubbles\webapp\Target $target code to be executed when the route is active @return \stubbles\webapp\routing\ConfigurableRoute
[ "reply", "with", "given", "class", "or", "callable", "for", "PUT", "request", "on", "given", "path" ]
train
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Routing.php#L169-L172
stubbles/stubbles-webapp-core
src/main/php/routing/Routing.php
Routing.onDelete
public function onDelete(string $path, $target): ConfigurableRoute { return $this->addRoute(new Route($path, $target, 'DELETE')); }
php
public function onDelete(string $path, $target): ConfigurableRoute { return $this->addRoute(new Route($path, $target, 'DELETE')); }
[ "public", "function", "onDelete", "(", "string", "$", "path", ",", "$", "target", ")", ":", "ConfigurableRoute", "{", "return", "$", "this", "->", "addRoute", "(", "new", "Route", "(", "$", "path", ",", "$", "target", ",", "'DELETE'", ")", ")", ";", ...
reply with given class or callable for DELETE request on given path @param string $path path this route is applicable for @param string|callable|\stubbles\webapp\Target $target code to be executed when the route is active @return \stubbles\webapp\routing\ConfigurableRoute
[ "reply", "with", "given", "class", "or", "callable", "for", "DELETE", "request", "on", "given", "path" ]
train
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Routing.php#L181-L184
stubbles/stubbles-webapp-core
src/main/php/routing/Routing.php
Routing.onAll
public function onAll(string $path, $target, $requestMethod = null): ConfigurableRoute { return $this->addRoute(new Route($path, $target, $requestMethod)); }
php
public function onAll(string $path, $target, $requestMethod = null): ConfigurableRoute { return $this->addRoute(new Route($path, $target, $requestMethod)); }
[ "public", "function", "onAll", "(", "string", "$", "path", ",", "$", "target", ",", "$", "requestMethod", "=", "null", ")", ":", "ConfigurableRoute", "{", "return", "$", "this", "->", "addRoute", "(", "new", "Route", "(", "$", "path", ",", "$", "target...
reply with given class or callable for request method(s) on given path If no request method(s) specified it replies to request methods GET, HEAD, POST, PUT and DELETE. @param string $path path this route is applicable for @param string|callable|\stubbles\webapp\Target ...
[ "reply", "with", "given", "class", "or", "callable", "for", "request", "method", "(", "s", ")", "on", "given", "path" ]
train
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Routing.php#L198-L201
stubbles/stubbles-webapp-core
src/main/php/routing/Routing.php
Routing.findResource
public function findResource($uri, string $requestMethod = null): UriResource { $calledUri = CalledUri::castFrom($uri, $requestMethod); $matchingRoutes = $this->routes->match($calledUri); if ($matchingRoutes->hasExactMatch()) { return $this->handleMatchingRoute( ...
php
public function findResource($uri, string $requestMethod = null): UriResource { $calledUri = CalledUri::castFrom($uri, $requestMethod); $matchingRoutes = $this->routes->match($calledUri); if ($matchingRoutes->hasExactMatch()) { return $this->handleMatchingRoute( ...
[ "public", "function", "findResource", "(", "$", "uri", ",", "string", "$", "requestMethod", "=", "null", ")", ":", "UriResource", "{", "$", "calledUri", "=", "CalledUri", "::", "castFrom", "(", "$", "uri", ",", "$", "requestMethod", ")", ";", "$", "match...
returns resource which is applicable for given request @param string|\stubbles\webapp\routing\CalledUri $uri actually called uri @param string $requestMethod optional when $calledUri is an instance of stubbles\webapp\routing\CalledUri @return \stubbles\webapp\routi...
[ "returns", "resource", "which", "is", "applicable", "for", "given", "request" ]
train
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Routing.php#L221-L245
stubbles/stubbles-webapp-core
src/main/php/routing/Routing.php
Routing.handleMatchingRoute
private function handleMatchingRoute(CalledUri $calledUri, Route $route): UriResource { if ($route->requiresAuth()) { return new ProtectedResource( $route->authConstraint(), $this->resolveResource($calledUri, $route), $this->injector );...
php
private function handleMatchingRoute(CalledUri $calledUri, Route $route): UriResource { if ($route->requiresAuth()) { return new ProtectedResource( $route->authConstraint(), $this->resolveResource($calledUri, $route), $this->injector );...
[ "private", "function", "handleMatchingRoute", "(", "CalledUri", "$", "calledUri", ",", "Route", "$", "route", ")", ":", "UriResource", "{", "if", "(", "$", "route", "->", "requiresAuth", "(", ")", ")", "{", "return", "new", "ProtectedResource", "(", "$", "...
creates a processable route for given route @param \stubbles\webapp\routing\CalledUri $calledUri @param \stubbles\webapp\routing\Route $route @return \stubbles\webapp\routing\UriResource
[ "creates", "a", "processable", "route", "for", "given", "route" ]
train
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Routing.php#L254-L265
stubbles/stubbles-webapp-core
src/main/php/routing/Routing.php
Routing.resolveResource
private function resolveResource(CalledUri $calledUri, Route $route): ResolvingResource { return new ResolvingResource( $this->injector, $calledUri, $this->collectInterceptors($calledUri, $route), $this->supportedMimeTypes($route), ...
php
private function resolveResource(CalledUri $calledUri, Route $route): ResolvingResource { return new ResolvingResource( $this->injector, $calledUri, $this->collectInterceptors($calledUri, $route), $this->supportedMimeTypes($route), ...
[ "private", "function", "resolveResource", "(", "CalledUri", "$", "calledUri", ",", "Route", "$", "route", ")", ":", "ResolvingResource", "{", "return", "new", "ResolvingResource", "(", "$", "this", "->", "injector", ",", "$", "calledUri", ",", "$", "this", "...
creates matching route @param \stubbles\webapp\routing\CalledUri $calledUri @param \stubbles\webapp\routing\Route $route @return \stubbles\webapp\routing\ResolvingResource
[ "creates", "matching", "route" ]
train
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Routing.php#L274-L283
stubbles/stubbles-webapp-core
src/main/php/routing/Routing.php
Routing.handleNonMethodMatchingRoutes
private function handleNonMethodMatchingRoutes( CalledUri $calledUri, MatchingRoutes $matchingRoutes ): UriResource { if ($calledUri->methodEquals('OPTIONS')) { return new ResourceOptions( $this->injector, $calledUri, ...
php
private function handleNonMethodMatchingRoutes( CalledUri $calledUri, MatchingRoutes $matchingRoutes ): UriResource { if ($calledUri->methodEquals('OPTIONS')) { return new ResourceOptions( $this->injector, $calledUri, ...
[ "private", "function", "handleNonMethodMatchingRoutes", "(", "CalledUri", "$", "calledUri", ",", "MatchingRoutes", "$", "matchingRoutes", ")", ":", "UriResource", "{", "if", "(", "$", "calledUri", "->", "methodEquals", "(", "'OPTIONS'", ")", ")", "{", "return", ...
creates a processable route when a route can be found regardless of request method @param \stubbles\webapp\routing\CalledUri $calledUri @param \stubbles\webapp\routing\MatchingRoutes $matchingRoutes @return \stubbles\webapp\routing\UriResource
[ "creates", "a", "processable", "route", "when", "a", "route", "can", "be", "found", "regardless", "of", "request", "method" ]
train
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Routing.php#L292-L314
stubbles/stubbles-webapp-core
src/main/php/routing/Routing.php
Routing.preInterceptOnGet
public function preInterceptOnGet($preInterceptor, string $path = null): RoutingConfigurator { return $this->preIntercept($preInterceptor, $path, 'GET'); }
php
public function preInterceptOnGet($preInterceptor, string $path = null): RoutingConfigurator { return $this->preIntercept($preInterceptor, $path, 'GET'); }
[ "public", "function", "preInterceptOnGet", "(", "$", "preInterceptor", ",", "string", "$", "path", "=", "null", ")", ":", "RoutingConfigurator", "{", "return", "$", "this", "->", "preIntercept", "(", "$", "preInterceptor", ",", "$", "path", ",", "'GET'", ")"...
pre intercept with given class or callable on all GET requests @param string|callable|\stubbles\webapp\intercepto\PreInterceptor $preInterceptor pre interceptor to add @param string $path optional path for which pre interceptor should be executed @...
[ "pre", "intercept", "with", "given", "class", "or", "callable", "on", "all", "GET", "requests" ]
train
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Routing.php#L323-L326
stubbles/stubbles-webapp-core
src/main/php/routing/Routing.php
Routing.preInterceptOnHead
public function preInterceptOnHead($preInterceptor, string $path = null): RoutingConfigurator { return $this->preIntercept($preInterceptor, $path, 'HEAD'); }
php
public function preInterceptOnHead($preInterceptor, string $path = null): RoutingConfigurator { return $this->preIntercept($preInterceptor, $path, 'HEAD'); }
[ "public", "function", "preInterceptOnHead", "(", "$", "preInterceptor", ",", "string", "$", "path", "=", "null", ")", ":", "RoutingConfigurator", "{", "return", "$", "this", "->", "preIntercept", "(", "$", "preInterceptor", ",", "$", "path", ",", "'HEAD'", "...
pre intercept with given class or callable on all HEAD requests @param string|callable|\stubbles\webapp\interceptor\PreInterceptor $preInterceptor pre interceptor to add @param string $path optional path for which pre interceptor should be execute...
[ "pre", "intercept", "with", "given", "class", "or", "callable", "on", "all", "HEAD", "requests" ]
train
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Routing.php#L335-L338
stubbles/stubbles-webapp-core
src/main/php/routing/Routing.php
Routing.preInterceptOnPost
public function preInterceptOnPost($preInterceptor, string $path = null): RoutingConfigurator { return $this->preIntercept($preInterceptor, $path, 'POST'); }
php
public function preInterceptOnPost($preInterceptor, string $path = null): RoutingConfigurator { return $this->preIntercept($preInterceptor, $path, 'POST'); }
[ "public", "function", "preInterceptOnPost", "(", "$", "preInterceptor", ",", "string", "$", "path", "=", "null", ")", ":", "RoutingConfigurator", "{", "return", "$", "this", "->", "preIntercept", "(", "$", "preInterceptor", ",", "$", "path", ",", "'POST'", "...
pre intercept with given class or callable on all POST requests @param string|callable|\stubbles\webapp\interceptor\PreInterceptor $preInterceptor pre interceptor to add @param string $path optional path for which pre interceptor should be execute...
[ "pre", "intercept", "with", "given", "class", "or", "callable", "on", "all", "POST", "requests" ]
train
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Routing.php#L347-L350
stubbles/stubbles-webapp-core
src/main/php/routing/Routing.php
Routing.preInterceptOnPut
public function preInterceptOnPut($preInterceptor, string $path = null): RoutingConfigurator { return $this->preIntercept($preInterceptor, $path, 'PUT'); }
php
public function preInterceptOnPut($preInterceptor, string $path = null): RoutingConfigurator { return $this->preIntercept($preInterceptor, $path, 'PUT'); }
[ "public", "function", "preInterceptOnPut", "(", "$", "preInterceptor", ",", "string", "$", "path", "=", "null", ")", ":", "RoutingConfigurator", "{", "return", "$", "this", "->", "preIntercept", "(", "$", "preInterceptor", ",", "$", "path", ",", "'PUT'", ")"...
pre intercept with given class or callable on all PUT requests @param string|callable|\stubbles\webapp\interceptor\PreInterceptor $preInterceptor pre interceptor to add @param string $path optional path for which pre interceptor should be executed...
[ "pre", "intercept", "with", "given", "class", "or", "callable", "on", "all", "PUT", "requests" ]
train
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Routing.php#L359-L362
stubbles/stubbles-webapp-core
src/main/php/routing/Routing.php
Routing.preInterceptOnDelete
public function preInterceptOnDelete($preInterceptor, string $path = null): RoutingConfigurator { return $this->preIntercept($preInterceptor, $path, 'DELETE'); }
php
public function preInterceptOnDelete($preInterceptor, string $path = null): RoutingConfigurator { return $this->preIntercept($preInterceptor, $path, 'DELETE'); }
[ "public", "function", "preInterceptOnDelete", "(", "$", "preInterceptor", ",", "string", "$", "path", "=", "null", ")", ":", "RoutingConfigurator", "{", "return", "$", "this", "->", "preIntercept", "(", "$", "preInterceptor", ",", "$", "path", ",", "'DELETE'",...
pre intercept with given class or callable on all DELETE requests @param string|callable|\stubbles\webapp\interceptor\PreInterceptor $preInterceptor pre interceptor to add @param string $path optional path for which pre interceptor should be execu...
[ "pre", "intercept", "with", "given", "class", "or", "callable", "on", "all", "DELETE", "requests" ]
train
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Routing.php#L371-L374
stubbles/stubbles-webapp-core
src/main/php/routing/Routing.php
Routing.preIntercept
public function preIntercept($preInterceptor, string $path = null, string $requestMethod = null): RoutingConfigurator { if (!is_callable($preInterceptor) && !($preInterceptor instanceof PreInterceptor) && !class_exists((string) $preInterceptor)) { throw new \InvalidArgumentException( ...
php
public function preIntercept($preInterceptor, string $path = null, string $requestMethod = null): RoutingConfigurator { if (!is_callable($preInterceptor) && !($preInterceptor instanceof PreInterceptor) && !class_exists((string) $preInterceptor)) { throw new \InvalidArgumentException( ...
[ "public", "function", "preIntercept", "(", "$", "preInterceptor", ",", "string", "$", "path", "=", "null", ",", "string", "$", "requestMethod", "=", "null", ")", ":", "RoutingConfigurator", "{", "if", "(", "!", "is_callable", "(", "$", "preInterceptor", ")",...
pre intercept with given class or callable on all requests @param string|callable|\stubbles\webapp\interceptor\PreInterceptor $preInterceptor pre interceptor to add @param string $path optional path for which pre interceptor should be executed @pa...
[ "pre", "intercept", "with", "given", "class", "or", "callable", "on", "all", "requests" ]
train
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Routing.php#L385-L401
stubbles/stubbles-webapp-core
src/main/php/routing/Routing.php
Routing.postInterceptOnGet
public function postInterceptOnGet($postInterceptor, string $path = null): RoutingConfigurator { return $this->postIntercept($postInterceptor, $path, 'GET'); }
php
public function postInterceptOnGet($postInterceptor, string $path = null): RoutingConfigurator { return $this->postIntercept($postInterceptor, $path, 'GET'); }
[ "public", "function", "postInterceptOnGet", "(", "$", "postInterceptor", ",", "string", "$", "path", "=", "null", ")", ":", "RoutingConfigurator", "{", "return", "$", "this", "->", "postIntercept", "(", "$", "postInterceptor", ",", "$", "path", ",", "'GET'", ...
post intercept with given class or callable on all GET requests @param string|callable|\stubbles\webapp\interceptor\PostInterceptor $postInterceptor post interceptor to add @param string $path optional path for which post interceptor should be e...
[ "post", "intercept", "with", "given", "class", "or", "callable", "on", "all", "GET", "requests" ]
train
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Routing.php#L410-L413
stubbles/stubbles-webapp-core
src/main/php/routing/Routing.php
Routing.postInterceptOnHead
public function postInterceptOnHead($postInterceptor, string $path = null): RoutingConfigurator { return $this->postIntercept($postInterceptor, $path, 'HEAD'); }
php
public function postInterceptOnHead($postInterceptor, string $path = null): RoutingConfigurator { return $this->postIntercept($postInterceptor, $path, 'HEAD'); }
[ "public", "function", "postInterceptOnHead", "(", "$", "postInterceptor", ",", "string", "$", "path", "=", "null", ")", ":", "RoutingConfigurator", "{", "return", "$", "this", "->", "postIntercept", "(", "$", "postInterceptor", ",", "$", "path", ",", "'HEAD'",...
post intercept with given class or callable on all HEAD requests @param string|callable|\stubbles\webapp\interceptor\PostInterceptor $postInterceptor post interceptor to add @param string $path optional path for which post interceptor should be ...
[ "post", "intercept", "with", "given", "class", "or", "callable", "on", "all", "HEAD", "requests" ]
train
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Routing.php#L422-L425
stubbles/stubbles-webapp-core
src/main/php/routing/Routing.php
Routing.postInterceptOnPost
public function postInterceptOnPost($postInterceptor, string $path = null): RoutingConfigurator { return $this->postIntercept($postInterceptor, $path, 'POST'); }
php
public function postInterceptOnPost($postInterceptor, string $path = null): RoutingConfigurator { return $this->postIntercept($postInterceptor, $path, 'POST'); }
[ "public", "function", "postInterceptOnPost", "(", "$", "postInterceptor", ",", "string", "$", "path", "=", "null", ")", ":", "RoutingConfigurator", "{", "return", "$", "this", "->", "postIntercept", "(", "$", "postInterceptor", ",", "$", "path", ",", "'POST'",...
post intercept with given class or callable on all POST requests @param string|callable|\stubbles\webapp\interceptor\PostInterceptor $postInterceptor post interceptor to add @param string $path optional path for which post interceptor should be ...
[ "post", "intercept", "with", "given", "class", "or", "callable", "on", "all", "POST", "requests" ]
train
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Routing.php#L434-L437
stubbles/stubbles-webapp-core
src/main/php/routing/Routing.php
Routing.postInterceptOnPut
public function postInterceptOnPut($postInterceptor, string $path = null): RoutingConfigurator { return $this->postIntercept($postInterceptor, $path, 'PUT'); }
php
public function postInterceptOnPut($postInterceptor, string $path = null): RoutingConfigurator { return $this->postIntercept($postInterceptor, $path, 'PUT'); }
[ "public", "function", "postInterceptOnPut", "(", "$", "postInterceptor", ",", "string", "$", "path", "=", "null", ")", ":", "RoutingConfigurator", "{", "return", "$", "this", "->", "postIntercept", "(", "$", "postInterceptor", ",", "$", "path", ",", "'PUT'", ...
post intercept with given class or callable on all PUT requests @param string|callable|\stubbles\webapp\interceptor\PostInterceptor $postInterceptor post interceptor to add @param string $path optional path for which post interceptor should be e...
[ "post", "intercept", "with", "given", "class", "or", "callable", "on", "all", "PUT", "requests" ]
train
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Routing.php#L446-L449
stubbles/stubbles-webapp-core
src/main/php/routing/Routing.php
Routing.postInterceptOnDelete
public function postInterceptOnDelete($postInterceptor, string $path = null): RoutingConfigurator { return $this->postIntercept($postInterceptor, $path, 'DELETE'); }
php
public function postInterceptOnDelete($postInterceptor, string $path = null): RoutingConfigurator { return $this->postIntercept($postInterceptor, $path, 'DELETE'); }
[ "public", "function", "postInterceptOnDelete", "(", "$", "postInterceptor", ",", "string", "$", "path", "=", "null", ")", ":", "RoutingConfigurator", "{", "return", "$", "this", "->", "postIntercept", "(", "$", "postInterceptor", ",", "$", "path", ",", "'DELET...
post intercept with given class or callable on all DELETE requests @param string|callable|\stubbles\webapp\interceptor\PostInterceptor $postInterceptor post interceptor to add @param string $path optional path for which post interceptor should b...
[ "post", "intercept", "with", "given", "class", "or", "callable", "on", "all", "DELETE", "requests" ]
train
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Routing.php#L458-L461
stubbles/stubbles-webapp-core
src/main/php/routing/Routing.php
Routing.postIntercept
public function postIntercept($postInterceptor, string $path = null, string $requestMethod = null): RoutingConfigurator { if (!is_callable($postInterceptor) && !($postInterceptor instanceof PostInterceptor) && !class_exists((string) $postInterceptor)) { throw new \InvalidArgumentException( ...
php
public function postIntercept($postInterceptor, string $path = null, string $requestMethod = null): RoutingConfigurator { if (!is_callable($postInterceptor) && !($postInterceptor instanceof PostInterceptor) && !class_exists((string) $postInterceptor)) { throw new \InvalidArgumentException( ...
[ "public", "function", "postIntercept", "(", "$", "postInterceptor", ",", "string", "$", "path", "=", "null", ",", "string", "$", "requestMethod", "=", "null", ")", ":", "RoutingConfigurator", "{", "if", "(", "!", "is_callable", "(", "$", "postInterceptor", "...
post intercept with given class or callable on all requests @param string|callable|\stubbles\webapp\interceptor\PostInterceptor $postInterceptor post interceptor to add @param string $path optional path for which post interceptor should be execu...
[ "post", "intercept", "with", "given", "class", "or", "callable", "on", "all", "requests" ]
train
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Routing.php#L472-L488
stubbles/stubbles-webapp-core
src/main/php/routing/Routing.php
Routing.collectInterceptors
private function collectInterceptors(CalledUri $calledUri, Route $route = null): Interceptors { return new Interceptors( $this->injector, $this->getPreInterceptors($calledUri, $route), $this->getPostInterceptors($calledUri, $route) ); }
php
private function collectInterceptors(CalledUri $calledUri, Route $route = null): Interceptors { return new Interceptors( $this->injector, $this->getPreInterceptors($calledUri, $route), $this->getPostInterceptors($calledUri, $route) ); }
[ "private", "function", "collectInterceptors", "(", "CalledUri", "$", "calledUri", ",", "Route", "$", "route", "=", "null", ")", ":", "Interceptors", "{", "return", "new", "Interceptors", "(", "$", "this", "->", "injector", ",", "$", "this", "->", "getPreInte...
collects interceptors @param \stubbles\webapp\routing\CalledUri $calledUri @param \stubbles\webapp\routing\Route $route @return \stubbles\webapp\interceptor\Interceptors
[ "collects", "interceptors" ]
train
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Routing.php#L497-L504
stubbles/stubbles-webapp-core
src/main/php/routing/Routing.php
Routing.getPreInterceptors
private function getPreInterceptors(CalledUri $calledUri, Route $route = null): array { $global = $this->getApplicable($calledUri, $this->preInterceptors); if (null === $route) { return $global; } return array_merge($global, $route->preInterceptors()); }
php
private function getPreInterceptors(CalledUri $calledUri, Route $route = null): array { $global = $this->getApplicable($calledUri, $this->preInterceptors); if (null === $route) { return $global; } return array_merge($global, $route->preInterceptors()); }
[ "private", "function", "getPreInterceptors", "(", "CalledUri", "$", "calledUri", ",", "Route", "$", "route", "=", "null", ")", ":", "array", "{", "$", "global", "=", "$", "this", "->", "getApplicable", "(", "$", "calledUri", ",", "$", "this", "->", "preI...
returns list of applicable pre interceptors for this request @param \stubbles\webapp\routing\CalledUri $calledUri @param \stubbles\webapp\routing\Route $route @return array
[ "returns", "list", "of", "applicable", "pre", "interceptors", "for", "this", "request" ]
train
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Routing.php#L513-L521
stubbles/stubbles-webapp-core
src/main/php/routing/Routing.php
Routing.getPostInterceptors
private function getPostInterceptors(CalledUri $calledUri, Route $route = null): array { $global = $this->getApplicable($calledUri, $this->postInterceptors); if (null === $route) { return $global; } return array_merge($route->postInterceptors(), $global); }
php
private function getPostInterceptors(CalledUri $calledUri, Route $route = null): array { $global = $this->getApplicable($calledUri, $this->postInterceptors); if (null === $route) { return $global; } return array_merge($route->postInterceptors(), $global); }
[ "private", "function", "getPostInterceptors", "(", "CalledUri", "$", "calledUri", ",", "Route", "$", "route", "=", "null", ")", ":", "array", "{", "$", "global", "=", "$", "this", "->", "getApplicable", "(", "$", "calledUri", ",", "$", "this", "->", "pos...
returns list of applicable post interceptors for this request @param \stubbles\webapp\routing\CalledUri $calledUri @param \stubbles\webapp\routing\Route $route @return array
[ "returns", "list", "of", "applicable", "post", "interceptors", "for", "this", "request" ]
train
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Routing.php#L530-L538
stubbles/stubbles-webapp-core
src/main/php/routing/Routing.php
Routing.getApplicable
private function getApplicable(CalledUri $calledUri, array $interceptors): array { $applicable = []; foreach ($interceptors as $interceptor) { if ($calledUri->satisfies($interceptor['requestMethod'], $interceptor['path'])) { $applicable[] = $interceptor['interceptor']; ...
php
private function getApplicable(CalledUri $calledUri, array $interceptors): array { $applicable = []; foreach ($interceptors as $interceptor) { if ($calledUri->satisfies($interceptor['requestMethod'], $interceptor['path'])) { $applicable[] = $interceptor['interceptor']; ...
[ "private", "function", "getApplicable", "(", "CalledUri", "$", "calledUri", ",", "array", "$", "interceptors", ")", ":", "array", "{", "$", "applicable", "=", "[", "]", ";", "foreach", "(", "$", "interceptors", "as", "$", "interceptor", ")", "{", "if", "...
calculates which interceptors are applicable for given request method @param \stubbles\webapp\routing\CalledUri $calledUri @param array[] $interceptors list of interceptors to check @return array
[ "calculates", "which", "interceptors", "are", "applicable", "for", "given", "request", "method" ]
train
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Routing.php#L547-L557
stubbles/stubbles-webapp-core
src/main/php/routing/Routing.php
Routing.setDefaultMimeTypeClass
public function setDefaultMimeTypeClass(string $mimeType, $mimeTypeClass): RoutingConfigurator { SupportedMimeTypes::setDefaultMimeTypeClass($mimeType, $mimeTypeClass); return $this; }
php
public function setDefaultMimeTypeClass(string $mimeType, $mimeTypeClass): RoutingConfigurator { SupportedMimeTypes::setDefaultMimeTypeClass($mimeType, $mimeTypeClass); return $this; }
[ "public", "function", "setDefaultMimeTypeClass", "(", "string", "$", "mimeType", ",", "$", "mimeTypeClass", ")", ":", "RoutingConfigurator", "{", "SupportedMimeTypes", "::", "setDefaultMimeTypeClass", "(", "$", "mimeType", ",", "$", "mimeTypeClass", ")", ";", "retur...
sets a default mime type class for given mime type, but doesn't mark the mime type as supported for all routes @param string $mimeType mime type to set default class for @param string $mimeTypeClass class to use @return \stubbles\webapp\routing\Routing @since 5.1.0
[ "sets", "a", "default", "mime", "type", "class", "for", "given", "mime", "type", "but", "doesn", "t", "mark", "the", "mime", "type", "as", "supported", "for", "all", "routes" ]
train
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Routing.php#L567-L571
stubbles/stubbles-webapp-core
src/main/php/routing/Routing.php
Routing.supportsMimeType
public function supportsMimeType(string $mimeType, $mimeTypeClass = null): RoutingConfigurator { if (null === $mimeTypeClass && !SupportedMimeTypes::provideDefaultClassFor($mimeType)) { throw new \InvalidArgumentException( 'No default class known for mime type ' . $mimeType ...
php
public function supportsMimeType(string $mimeType, $mimeTypeClass = null): RoutingConfigurator { if (null === $mimeTypeClass && !SupportedMimeTypes::provideDefaultClassFor($mimeType)) { throw new \InvalidArgumentException( 'No default class known for mime type ' . $mimeType ...
[ "public", "function", "supportsMimeType", "(", "string", "$", "mimeType", ",", "$", "mimeTypeClass", "=", "null", ")", ":", "RoutingConfigurator", "{", "if", "(", "null", "===", "$", "mimeTypeClass", "&&", "!", "SupportedMimeTypes", "::", "provideDefaultClassFor",...
add a supported mime type @param string $mimeType @param string $mimeTypeClass optional special class to be used for given mime type on this route @return \stubbles\webapp\routing\Routing @throws \InvalidArgumentException
[ "add", "a", "supported", "mime", "type" ]
train
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Routing.php#L581-L596
stubbles/stubbles-webapp-core
src/main/php/routing/Routing.php
Routing.supportedMimeTypes
private function supportedMimeTypes(Route $route = null): SupportedMimeTypes { if ($this->disableContentNegotation) { return SupportedMimeTypes::createWithDisabledContentNegotation(); } if (null !== $route) { return $route->supportedMimeTypes( $th...
php
private function supportedMimeTypes(Route $route = null): SupportedMimeTypes { if ($this->disableContentNegotation) { return SupportedMimeTypes::createWithDisabledContentNegotation(); } if (null !== $route) { return $route->supportedMimeTypes( $th...
[ "private", "function", "supportedMimeTypes", "(", "Route", "$", "route", "=", "null", ")", ":", "SupportedMimeTypes", "{", "if", "(", "$", "this", "->", "disableContentNegotation", ")", "{", "return", "SupportedMimeTypes", "::", "createWithDisabledContentNegotation", ...
retrieves list of supported mime types @param \stubbles\webapp\routing\Route $route @return \stubbles\webapp\routing\SupportedMimeTypes
[ "retrieves", "list", "of", "supported", "mime", "types" ]
train
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Routing.php#L616-L630
jan-dolata/crude-crud
src/Engine/CrudeSetup.php
CrudeSetup.getJSData
public function getJSData() { return [ 'name' => $this->name, 'title' => $this->title, 'description' => $this->description, 'column' => $this->column, 'extraColumn' => $this->extraColumn, 'columnFormat' => $...
php
public function getJSData() { return [ 'name' => $this->name, 'title' => $this->title, 'description' => $this->description, 'column' => $this->column, 'extraColumn' => $this->extraColumn, 'columnFormat' => $...
[ "public", "function", "getJSData", "(", ")", "{", "return", "[", "'name'", "=>", "$", "this", "->", "name", ",", "'title'", "=>", "$", "this", "->", "title", ",", "'description'", "=>", "$", "this", "->", "description", ",", "'column'", "=>", "$", "thi...
Prepare data for JS list config model @return array
[ "Prepare", "data", "for", "JS", "list", "config", "model" ]
train
https://github.com/jan-dolata/crude-crud/blob/9129ea08278835cf5cecfd46a90369226ae6bdd7/src/Engine/CrudeSetup.php#L73-L120
blast-project/CoreBundle
src/Admin/CoreAdmin.php
CoreAdmin.configureRoutes
protected function configureRoutes(RouteCollection $collection) { parent::configureRoutes($collection); $collection->add('duplicate', $this->getRouterIdParameter() . '/duplicate'); $collection->add('generateEntityCode'); /* Needed or not needed ... * in sonata-project/admin...
php
protected function configureRoutes(RouteCollection $collection) { parent::configureRoutes($collection); $collection->add('duplicate', $this->getRouterIdParameter() . '/duplicate'); $collection->add('generateEntityCode'); /* Needed or not needed ... * in sonata-project/admin...
[ "protected", "function", "configureRoutes", "(", "RouteCollection", "$", "collection", ")", "{", "parent", "::", "configureRoutes", "(", "$", "collection", ")", ";", "$", "collection", "->", "add", "(", "'duplicate'", ",", "$", "this", "->", "getRouterIdParamete...
Configure routes for list actions. @param RouteCollection $collection
[ "Configure", "routes", "for", "list", "actions", "." ]
train
https://github.com/blast-project/CoreBundle/blob/7a0832758ca14e5bc5d65515532c1220df3930ae/src/Admin/CoreAdmin.php#L72-L86
blast-project/CoreBundle
src/Admin/CoreAdmin.php
CoreAdmin.arrayDepth
private static function arrayDepth($array, $level = 0) { if (!$array) { return $level; } if (!is_array($array)) { return $level; } ++$level; foreach ($array as $key => $value) { if (is_array($value)) { $level = $le...
php
private static function arrayDepth($array, $level = 0) { if (!$array) { return $level; } if (!is_array($array)) { return $level; } ++$level; foreach ($array as $key => $value) { if (is_array($value)) { $level = $le...
[ "private", "static", "function", "arrayDepth", "(", "$", "array", ",", "$", "level", "=", "0", ")", "{", "if", "(", "!", "$", "array", ")", "{", "return", "$", "level", ";", "}", "if", "(", "!", "is_array", "(", "$", "array", ")", ")", "{", "re...
Returns the level of depth of an array. @param array $array @param int $level : do not use, just used for recursivity @return int : depth
[ "Returns", "the", "level", "of", "depth", "of", "an", "array", "." ]
train
https://github.com/blast-project/CoreBundle/blob/7a0832758ca14e5bc5d65515532c1220df3930ae/src/Admin/CoreAdmin.php#L216-L234
blast-project/CoreBundle
src/Admin/CoreAdmin.php
CoreAdmin.getExtraTemplates
public function getExtraTemplates($view) { if (empty($this->extraTemplates[$view])) { $this->extraTemplates[$view] = []; } return $this->extraTemplates[$view]; }
php
public function getExtraTemplates($view) { if (empty($this->extraTemplates[$view])) { $this->extraTemplates[$view] = []; } return $this->extraTemplates[$view]; }
[ "public", "function", "getExtraTemplates", "(", "$", "view", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "extraTemplates", "[", "$", "view", "]", ")", ")", "{", "$", "this", "->", "extraTemplates", "[", "$", "view", "]", "=", "[", "]", ";...
@param string $view 'list', 'show', 'form', etc @return array array of template names
[ "@param", "string", "$view", "list", "show", "form", "etc" ]
train
https://github.com/blast-project/CoreBundle/blob/7a0832758ca14e5bc5d65515532c1220df3930ae/src/Admin/CoreAdmin.php#L275-L282
blast-project/CoreBundle
src/Admin/CoreAdmin.php
CoreAdmin.getHelperLinks
public function getHelperLinks($view) { if (empty($this->helperLinks[$view])) { $this->helperLinks[$view] = []; } return $this->helperLinks[$view]; }
php
public function getHelperLinks($view) { if (empty($this->helperLinks[$view])) { $this->helperLinks[$view] = []; } return $this->helperLinks[$view]; }
[ "public", "function", "getHelperLinks", "(", "$", "view", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "helperLinks", "[", "$", "view", "]", ")", ")", "{", "$", "this", "->", "helperLinks", "[", "$", "view", "]", "=", "[", "]", ";", "}",...
@param string $view 'list', 'show', 'form', etc @return array array of links (each link is an array with keys 'label', 'url', 'class' and 'title')
[ "@param", "string", "$view", "list", "show", "form", "etc" ]
train
https://github.com/blast-project/CoreBundle/blob/7a0832758ca14e5bc5d65515532c1220df3930ae/src/Admin/CoreAdmin.php#L314-L321
blast-project/CoreBundle
src/Admin/CoreAdmin.php
CoreAdmin.bundleExists
public function bundleExists($bundle) { $kernelBundles = $this->getConfigurationPool()->getContainer()->getParameter('kernel.bundles'); if (array_key_exists($bundle, $kernelBundles)) { return true; } if (in_array($bundle, $kernelBundles)) { return true; ...
php
public function bundleExists($bundle) { $kernelBundles = $this->getConfigurationPool()->getContainer()->getParameter('kernel.bundles'); if (array_key_exists($bundle, $kernelBundles)) { return true; } if (in_array($bundle, $kernelBundles)) { return true; ...
[ "public", "function", "bundleExists", "(", "$", "bundle", ")", "{", "$", "kernelBundles", "=", "$", "this", "->", "getConfigurationPool", "(", ")", "->", "getContainer", "(", ")", "->", "getParameter", "(", "'kernel.bundles'", ")", ";", "if", "(", "array_key...
Checks if a Bundle is installed. @param string $bundle Bundle name or class FQN
[ "Checks", "if", "a", "Bundle", "is", "installed", "." ]
train
https://github.com/blast-project/CoreBundle/blob/7a0832758ca14e5bc5d65515532c1220df3930ae/src/Admin/CoreAdmin.php#L328-L339
blast-project/CoreBundle
src/Admin/CoreAdmin.php
CoreAdmin.renameFormTab
public function renameFormTab($tabName, $newTabName, $keepOrder = true) { $tabs = $this->getFormTabs(); if (!$tabs) { return; } if (!isset($tabs[$tabName])) { throw new \Exception(sprintf('Tab %s does not exist.', $tabName)); } if (isset($tab...
php
public function renameFormTab($tabName, $newTabName, $keepOrder = true) { $tabs = $this->getFormTabs(); if (!$tabs) { return; } if (!isset($tabs[$tabName])) { throw new \Exception(sprintf('Tab %s does not exist.', $tabName)); } if (isset($tab...
[ "public", "function", "renameFormTab", "(", "$", "tabName", ",", "$", "newTabName", ",", "$", "keepOrder", "=", "true", ")", "{", "$", "tabs", "=", "$", "this", "->", "getFormTabs", "(", ")", ";", "if", "(", "!", "$", "tabs", ")", "{", "return", ";...
Rename a form tab after form fields have been configured. TODO: groups of the renamed tab are still prefixed with the old tab name @param type $tabName the name of the tab to be renamed @param type $newTabName the new name for the tab
[ "Rename", "a", "form", "tab", "after", "form", "fields", "have", "been", "configured", "." ]
train
https://github.com/blast-project/CoreBundle/blob/7a0832758ca14e5bc5d65515532c1220df3930ae/src/Admin/CoreAdmin.php#L349-L374
blast-project/CoreBundle
src/Admin/CoreAdmin.php
CoreAdmin.renameShowTab
public function renameShowTab($tabName, $newTabName, $keepOrder = true) { $tabs = $this->getShowTabs(); if (!$tabs) { return; } if (!isset($tabs[$tabName])) { throw new \Exception(sprintf('Tab %s does not exist.', $tabName)); } if (isset($tab...
php
public function renameShowTab($tabName, $newTabName, $keepOrder = true) { $tabs = $this->getShowTabs(); if (!$tabs) { return; } if (!isset($tabs[$tabName])) { throw new \Exception(sprintf('Tab %s does not exist.', $tabName)); } if (isset($tab...
[ "public", "function", "renameShowTab", "(", "$", "tabName", ",", "$", "newTabName", ",", "$", "keepOrder", "=", "true", ")", "{", "$", "tabs", "=", "$", "this", "->", "getShowTabs", "(", ")", ";", "if", "(", "!", "$", "tabs", ")", "{", "return", ";...
Rename a show tab after show fields have been configured. TODO: groups of the renamed tab are still prefixed with the old tab name @param type $tabName the name of the tab to be renamed @param type $newTabName the new name for the tab
[ "Rename", "a", "show", "tab", "after", "show", "fields", "have", "been", "configured", "." ]
train
https://github.com/blast-project/CoreBundle/blob/7a0832758ca14e5bc5d65515532c1220df3930ae/src/Admin/CoreAdmin.php#L384-L409
blast-project/CoreBundle
src/Admin/CoreAdmin.php
CoreAdmin.renameFormGroup
public function renameFormGroup($group, $tab, $newGroupName) { $groups = $this->getFormGroups(); // When the default tab is used, the tabname is not prepended to the index in the group array if ($tab !== 'default') { $group = $tab . '.' . $group; } $newGroup = ($...
php
public function renameFormGroup($group, $tab, $newGroupName) { $groups = $this->getFormGroups(); // When the default tab is used, the tabname is not prepended to the index in the group array if ($tab !== 'default') { $group = $tab . '.' . $group; } $newGroup = ($...
[ "public", "function", "renameFormGroup", "(", "$", "group", ",", "$", "tab", ",", "$", "newGroupName", ")", "{", "$", "groups", "=", "$", "this", "->", "getFormGroups", "(", ")", ";", "// When the default tab is used, the tabname is not prepended to the index in the g...
Rename a form group. @param string $group the old group name @param string $tab the tab the group belongs to @param string $newGroupName the new group name @return self
[ "Rename", "a", "form", "group", "." ]
train
https://github.com/blast-project/CoreBundle/blob/7a0832758ca14e5bc5d65515532c1220df3930ae/src/Admin/CoreAdmin.php#L420-L452
blast-project/CoreBundle
src/Admin/CoreAdmin.php
CoreAdmin.removeTab
public function removeTab($tabNames, $mapper) { $currentTabs = $this->getFormTabs(); foreach ($currentTabs as $k => $item) { if (is_array($tabNames) && in_array($item['name'], $tabNames) || !is_array($tabNames) && $item['name'] === $tabNames) { foreach ($item['groups'] as...
php
public function removeTab($tabNames, $mapper) { $currentTabs = $this->getFormTabs(); foreach ($currentTabs as $k => $item) { if (is_array($tabNames) && in_array($item['name'], $tabNames) || !is_array($tabNames) && $item['name'] === $tabNames) { foreach ($item['groups'] as...
[ "public", "function", "removeTab", "(", "$", "tabNames", ",", "$", "mapper", ")", "{", "$", "currentTabs", "=", "$", "this", "->", "getFormTabs", "(", ")", ";", "foreach", "(", "$", "currentTabs", "as", "$", "k", "=>", "$", "item", ")", "{", "if", ...
Removes tab in current form Mapper. @param string|array $tabNames name or array of names of tabs to be removed @param FormMapper $mapper Sonata Admin form mapper
[ "Removes", "tab", "in", "current", "form", "Mapper", "." ]
train
https://github.com/blast-project/CoreBundle/blob/7a0832758ca14e5bc5d65515532c1220df3930ae/src/Admin/CoreAdmin.php#L460-L472
blast-project/CoreBundle
src/Admin/CoreAdmin.php
CoreAdmin.removeAllFieldsFromFormGroup
public function removeAllFieldsFromFormGroup($groupName, $mapper) { $formGroups = $this->getFormGroups(); foreach ($formGroups as $name => $formGroup) { if ($name === $groupName) { foreach ($formGroups[$name]['fields'] as $key => $field) { $mapper->rem...
php
public function removeAllFieldsFromFormGroup($groupName, $mapper) { $formGroups = $this->getFormGroups(); foreach ($formGroups as $name => $formGroup) { if ($name === $groupName) { foreach ($formGroups[$name]['fields'] as $key => $field) { $mapper->rem...
[ "public", "function", "removeAllFieldsFromFormGroup", "(", "$", "groupName", ",", "$", "mapper", ")", "{", "$", "formGroups", "=", "$", "this", "->", "getFormGroups", "(", ")", ";", "foreach", "(", "$", "formGroups", "as", "$", "name", "=>", "$", "formGrou...
Removes all fields from form groups and remove them from mapper. @param string $groupName Name of the group to remove @param FormMapper $mapper Sonata Admin form mapper
[ "Removes", "all", "fields", "from", "form", "groups", "and", "remove", "them", "from", "mapper", "." ]
train
https://github.com/blast-project/CoreBundle/blob/7a0832758ca14e5bc5d65515532c1220df3930ae/src/Admin/CoreAdmin.php#L480-L490
blast-project/CoreBundle
src/Admin/CoreAdmin.php
CoreAdmin.prePersist
public function prePersist($object) { parent::prePersist($object); $hasCodeGenerator = CodeGeneratorRegistry::hasGeneratorForClass(get_class($object)); if ($hasCodeGenerator) { $accessor = PropertyAccess::createPropertyAccessor(); foreach (CodeGeneratorRegistry::getC...
php
public function prePersist($object) { parent::prePersist($object); $hasCodeGenerator = CodeGeneratorRegistry::hasGeneratorForClass(get_class($object)); if ($hasCodeGenerator) { $accessor = PropertyAccess::createPropertyAccessor(); foreach (CodeGeneratorRegistry::getC...
[ "public", "function", "prePersist", "(", "$", "object", ")", "{", "parent", "::", "prePersist", "(", "$", "object", ")", ";", "$", "hasCodeGenerator", "=", "CodeGeneratorRegistry", "::", "hasGeneratorForClass", "(", "get_class", "(", "$", "object", ")", ")", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/blast-project/CoreBundle/blob/7a0832758ca14e5bc5d65515532c1220df3930ae/src/Admin/CoreAdmin.php#L547-L558
blast-project/CoreBundle
src/Admin/CoreAdmin.php
CoreAdmin.preBatchAction
public function preBatchAction($actionName, ProxyQueryInterface $query, array &$idx, $allElements) { parent::preBatchAction($actionName, $query, $idx, $allElements); if ($actionName === 'delete') { $cascadingRelationChecker = $this->getConfigurationPool()->getContainer()->get('blast_cor...
php
public function preBatchAction($actionName, ProxyQueryInterface $query, array &$idx, $allElements) { parent::preBatchAction($actionName, $query, $idx, $allElements); if ($actionName === 'delete') { $cascadingRelationChecker = $this->getConfigurationPool()->getContainer()->get('blast_cor...
[ "public", "function", "preBatchAction", "(", "$", "actionName", ",", "ProxyQueryInterface", "$", "query", ",", "array", "&", "$", "idx", ",", "$", "allElements", ")", "{", "parent", "::", "preBatchAction", "(", "$", "actionName", ",", "$", "query", ",", "$...
{@inheritdoc}
[ "{" ]
train
https://github.com/blast-project/CoreBundle/blob/7a0832758ca14e5bc5d65515532c1220df3930ae/src/Admin/CoreAdmin.php#L568-L602
ekyna/GlsUniBox
Api/Response.php
Response.create
public static function create($body) { if (0 !== strpos($body, static::START_TOKEN)) { throw new InvalidArgumentException("Unexpected response body."); } if (static::END_TOKEN !== substr($body, -strlen(static::END_TOKEN))) { throw new InvalidArgumentException("Unexpec...
php
public static function create($body) { if (0 !== strpos($body, static::START_TOKEN)) { throw new InvalidArgumentException("Unexpected response body."); } if (static::END_TOKEN !== substr($body, -strlen(static::END_TOKEN))) { throw new InvalidArgumentException("Unexpec...
[ "public", "static", "function", "create", "(", "$", "body", ")", "{", "if", "(", "0", "!==", "strpos", "(", "$", "body", ",", "static", "::", "START_TOKEN", ")", ")", "{", "throw", "new", "InvalidArgumentException", "(", "\"Unexpected response body.\"", ")",...
Creates a response from the given http response body. @param string $body @return Response
[ "Creates", "a", "response", "from", "the", "given", "http", "response", "body", "." ]
train
https://github.com/ekyna/GlsUniBox/blob/b474271ba355c3917074422306dc64abf09584d0/Api/Response.php#L27-L63
czim/laravel-pxlcms
src/Commands/GenerateCommand.php
GenerateCommand.handle
public function handle() { $modelsOnly = (bool) $this->option('models-only'); $dryRun = (bool) $this->option('dry-run'); $interactive = ! (bool) $this->option('auto'); $this->listenForLogEvents(); $generator = new Generator( ! $dryRun, $this); $generator->gen...
php
public function handle() { $modelsOnly = (bool) $this->option('models-only'); $dryRun = (bool) $this->option('dry-run'); $interactive = ! (bool) $this->option('auto'); $this->listenForLogEvents(); $generator = new Generator( ! $dryRun, $this); $generator->gen...
[ "public", "function", "handle", "(", ")", "{", "$", "modelsOnly", "=", "(", "bool", ")", "$", "this", "->", "option", "(", "'models-only'", ")", ";", "$", "dryRun", "=", "(", "bool", ")", "$", "this", "->", "option", "(", "'dry-run'", ")", ";", "$"...
Execute the console command. @return mixed
[ "Execute", "the", "console", "command", "." ]
train
https://github.com/czim/laravel-pxlcms/blob/910297d2a3f2db86dde51b0e10fe5aad45f1aa1a/src/Commands/GenerateCommand.php#L39-L52
movoin/one-swoole
src/Swoole/Commands/StartCommand.php
StartCommand.execute
protected function execute(InputInterface $input, OutputInterface $output) { // 读取所有服务 $servers = array_keys(Config::get('server', [])); // 当前服务 $server = $input->getArgument('server'); if ($server !== null && ! isset($servers[$server])) { $this->error('启动失败, 未定义...
php
protected function execute(InputInterface $input, OutputInterface $output) { // 读取所有服务 $servers = array_keys(Config::get('server', [])); // 当前服务 $server = $input->getArgument('server'); if ($server !== null && ! isset($servers[$server])) { $this->error('启动失败, 未定义...
[ "protected", "function", "execute", "(", "InputInterface", "$", "input", ",", "OutputInterface", "$", "output", ")", "{", "// 读取所有服务", "$", "servers", "=", "array_keys", "(", "Config", "::", "get", "(", "'server'", ",", "[", "]", ")", ")", ";", "// 当前服务", ...
执行命令 @param \Symfony\Component\Console\Input\InputInterface $input @param \Symfony\Component\Console\Output\OutputInterface $output
[ "执行命令" ]
train
https://github.com/movoin/one-swoole/blob/b9b175963ead91416cc50902a04e05ff3ef571de/src/Swoole/Commands/StartCommand.php#L43-L92
huasituo/hstcms
src/Http/Controllers/Manage/FormController.php
FormController.content
public function content($formid, Request $request) { if(!$formid) { return $this->showError('hstcms::public.no.id', '', 5); } $info = CommonFormModel::getForm($formid); if(!$info) { return $this->showError('hstcms::public.no.data', '', 5); } $...
php
public function content($formid, Request $request) { if(!$formid) { return $this->showError('hstcms::public.no.id', '', 5); } $info = CommonFormModel::getForm($formid); if(!$info) { return $this->showError('hstcms::public.no.data', '', 5); } $...
[ "public", "function", "content", "(", "$", "formid", ",", "Request", "$", "request", ")", "{", "if", "(", "!", "$", "formid", ")", "{", "return", "$", "this", "->", "showError", "(", "'hstcms::public.no.id'", ",", "''", ",", "5", ")", ";", "}", "$", ...
内容管理
[ "内容管理" ]
train
https://github.com/huasituo/hstcms/blob/12819979289e58ce38e3e92540aeeb16e205e525/src/Http/Controllers/Manage/FormController.php#L172-L222
dreamcommerce/common-bundle
src/DreamCommerce/Bundle/CommonBundle/Command/LogViewCommand.php
LogViewCommand.execute
protected function execute(InputInterface $input, OutputInterface $output) { $this->output = $output; $this->input = $input; $helper = $this->getHelper('question'); $logs = $this->getLogsList(); $question = new ChoiceQuestion( 'Choose file to view', $...
php
protected function execute(InputInterface $input, OutputInterface $output) { $this->output = $output; $this->input = $input; $helper = $this->getHelper('question'); $logs = $this->getLogsList(); $question = new ChoiceQuestion( 'Choose file to view', $...
[ "protected", "function", "execute", "(", "InputInterface", "$", "input", ",", "OutputInterface", "$", "output", ")", "{", "$", "this", "->", "output", "=", "$", "output", ";", "$", "this", "->", "input", "=", "$", "input", ";", "$", "helper", "=", "$",...
{@inheritdoc}
[ "{" ]
train
https://github.com/dreamcommerce/common-bundle/blob/adb0850e90e63c3997f10d1ce110bf13a84b63ab/src/DreamCommerce/Bundle/CommonBundle/Command/LogViewCommand.php#L47-L70
harp-orm/query
src/Compiler/Join.php
Join.render
public static function render(SQL\Join $join) { $condition = $join->getCondition(); $table = $join->getTable(); return Compiler::expression(array( $join->getType(), 'JOIN', $table instanceof SQL\Aliased ? Aliased::render($table) : $table, is_a...
php
public static function render(SQL\Join $join) { $condition = $join->getCondition(); $table = $join->getTable(); return Compiler::expression(array( $join->getType(), 'JOIN', $table instanceof SQL\Aliased ? Aliased::render($table) : $table, is_a...
[ "public", "static", "function", "render", "(", "SQL", "\\", "Join", "$", "join", ")", "{", "$", "condition", "=", "$", "join", "->", "getCondition", "(", ")", ";", "$", "table", "=", "$", "join", "->", "getTable", "(", ")", ";", "return", "Compiler",...
Render a Join object @param SQL\Join $join @return string
[ "Render", "a", "Join", "object" ]
train
https://github.com/harp-orm/query/blob/98ce2468a0a31fe15ed3692bad32547bf6dbe41a/src/Compiler/Join.php#L50-L61
discophp/framework
core/classes/Controller.class.php
Controller.template
public function template($template, $data = Array()){ \Template::with($template, $data); \View::serve(); }
php
public function template($template, $data = Array()){ \Template::with($template, $data); \View::serve(); }
[ "public", "function", "template", "(", "$", "template", ",", "$", "data", "=", "Array", "(", ")", ")", "{", "\\", "Template", "::", "with", "(", "$", "template", ",", "$", "data", ")", ";", "\\", "View", "::", "serve", "(", ")", ";", "}" ]
A template to add to the view and return. @param string $template The template name to load into the view. @param array $data The data to bind into the template. Defaults to empty array.
[ "A", "template", "to", "add", "to", "the", "view", "and", "return", "." ]
train
https://github.com/discophp/framework/blob/40ff3ea5225810534195494dc6c21083da4d1356/core/classes/Controller.class.php#L42-L45
esperecyan/dictionary-php
src/parser/CatchmParser.php
CatchmParser.parseLine
protected function parseLine(Dictionary $dictionary, string $line) { // コメントの分離 $textAndDescription = preg_split('#(/+|;+|\\[)#u', $line, 2, PREG_SPLIT_DELIM_CAPTURE); if ($textAndDescription[0] !== '' && str_replace(' ', '', $textAndDescription[0]) === '') { // 空行でなく、半角...
php
protected function parseLine(Dictionary $dictionary, string $line) { // コメントの分離 $textAndDescription = preg_split('#(/+|;+|\\[)#u', $line, 2, PREG_SPLIT_DELIM_CAPTURE); if ($textAndDescription[0] !== '' && str_replace(' ', '', $textAndDescription[0]) === '') { // 空行でなく、半角...
[ "protected", "function", "parseLine", "(", "Dictionary", "$", "dictionary", ",", "string", "$", "line", ")", "{", "// コメントの分離", "$", "textAndDescription", "=", "preg_split", "(", "'#(/+|;+|\\\\[)#u'", ",", "$", "line", ",", "2", ",", "PREG_SPLIT_DELIM_CAPTURE", ...
行を解析し、text、answer、descriptionフィールドに対応する文字列を取り出します。 @param Dictionary $dictionary @param string $line
[ "行を解析し、text、answer、descriptionフィールドに対応する文字列を取り出します。" ]
train
https://github.com/esperecyan/dictionary-php/blob/14fad08fb43006995c763094e8e7ed0dc0e26676/src/parser/CatchmParser.php#L13-L54
ray-di/Ray.WebFormModule
src/VndErrorHandler.php
VndErrorHandler.handle
public function handle(AbstractValidation $formValidation, MethodInvocation $invocation, AbstractForm $form) { unset($formValidation); $vndError = $this->reader->getMethodAnnotation($invocation->getMethod(), VndError::class); $error = new FormValidationError($this->makeVndError($form, $vndEr...
php
public function handle(AbstractValidation $formValidation, MethodInvocation $invocation, AbstractForm $form) { unset($formValidation); $vndError = $this->reader->getMethodAnnotation($invocation->getMethod(), VndError::class); $error = new FormValidationError($this->makeVndError($form, $vndEr...
[ "public", "function", "handle", "(", "AbstractValidation", "$", "formValidation", ",", "MethodInvocation", "$", "invocation", ",", "AbstractForm", "$", "form", ")", "{", "unset", "(", "$", "formValidation", ")", ";", "$", "vndError", "=", "$", "this", "->", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/ray-di/Ray.WebFormModule/blob/4b6d33adb4a5c285278a068f3e7a5afdc4e680d9/src/VndErrorHandler.php#L30-L37
jan-dolata/crude-crud
src/CrudeCRUDServiceProvider.php
CrudeCRUDServiceProvider.boot
public function boot() { // use this if your package has views $this->loadViewsFrom(__DIR__.'/resources/views', 'CrudeCRUD'); // use this if your package has lang files $this->loadTranslationsFrom(__DIR__.'/resources/lang', 'CrudeCRUD'); // use this if your package has rout...
php
public function boot() { // use this if your package has views $this->loadViewsFrom(__DIR__.'/resources/views', 'CrudeCRUD'); // use this if your package has lang files $this->loadTranslationsFrom(__DIR__.'/resources/lang', 'CrudeCRUD'); // use this if your package has rout...
[ "public", "function", "boot", "(", ")", "{", "// use this if your package has views", "$", "this", "->", "loadViewsFrom", "(", "__DIR__", ".", "'/resources/views'", ",", "'CrudeCRUD'", ")", ";", "// use this if your package has lang files", "$", "this", "->", "loadTrans...
Perform post-registration booting of services. @return void
[ "Perform", "post", "-", "registration", "booting", "of", "services", "." ]
train
https://github.com/jan-dolata/crude-crud/blob/9129ea08278835cf5cecfd46a90369226ae6bdd7/src/CrudeCRUDServiceProvider.php#L22-L60
jan-dolata/crude-crud
src/CrudeCRUDServiceProvider.php
CrudeCRUDServiceProvider.register
public function register() { $this->registerCrudeCRUD(); config([ 'config/crude.php', ]); $loader = \Illuminate\Foundation\AliasLoader::getInstance(); $loader->alias('Crude', 'JanDolata\CrudeCRUD\Engine\Crude'); $loader->alias('CrudeListInterface', 'Ja...
php
public function register() { $this->registerCrudeCRUD(); config([ 'config/crude.php', ]); $loader = \Illuminate\Foundation\AliasLoader::getInstance(); $loader->alias('Crude', 'JanDolata\CrudeCRUD\Engine\Crude'); $loader->alias('CrudeListInterface', 'Ja...
[ "public", "function", "register", "(", ")", "{", "$", "this", "->", "registerCrudeCRUD", "(", ")", ";", "config", "(", "[", "'config/crude.php'", ",", "]", ")", ";", "$", "loader", "=", "\\", "Illuminate", "\\", "Foundation", "\\", "AliasLoader", "::", "...
Register any package services. @return void
[ "Register", "any", "package", "services", "." ]
train
https://github.com/jan-dolata/crude-crud/blob/9129ea08278835cf5cecfd46a90369226ae6bdd7/src/CrudeCRUDServiceProvider.php#L81-L118
refinery29/piston
src/Request.php
Request.setOffsetLimit
public function setOffsetLimit($offset, $limit) { $this->offset = $offset; $this->limit = $limit; $this->paginationType = self::OFFSET_LIMIT_PAGINATION; }
php
public function setOffsetLimit($offset, $limit) { $this->offset = $offset; $this->limit = $limit; $this->paginationType = self::OFFSET_LIMIT_PAGINATION; }
[ "public", "function", "setOffsetLimit", "(", "$", "offset", ",", "$", "limit", ")", "{", "$", "this", "->", "offset", "=", "$", "offset", ";", "$", "this", "->", "limit", "=", "$", "limit", ";", "$", "this", "->", "paginationType", "=", "self", "::",...
@param string $offset @param string $limit @deprecated
[ "@param", "string", "$offset", "@param", "string", "$limit" ]
train
https://github.com/refinery29/piston/blob/75c402e814136577fa9a02479e8803aca664c865/src/Request.php#L178-L183
refinery29/piston
src/Request.php
Request.withCookie
public function withCookie($key, $val) { $this->cookieJar->set($key, $val); return $this->withCookieParams($this->cookieJar->all()); }
php
public function withCookie($key, $val) { $this->cookieJar->set($key, $val); return $this->withCookieParams($this->cookieJar->all()); }
[ "public", "function", "withCookie", "(", "$", "key", ",", "$", "val", ")", "{", "$", "this", "->", "cookieJar", "->", "set", "(", "$", "key", ",", "$", "val", ")", ";", "return", "$", "this", "->", "withCookieParams", "(", "$", "this", "->", "cooki...
@param string $key @param mixed $val @return ServerRequest
[ "@param", "string", "$key", "@param", "mixed", "$val" ]
train
https://github.com/refinery29/piston/blob/75c402e814136577fa9a02479e8803aca664c865/src/Request.php#L211-L216
refinery29/piston
src/Request.php
Request.clearCookie
public function clearCookie($key) { $this->cookieJar->clear($key); return $this->withCookieParams($this->cookieJar->all()); }
php
public function clearCookie($key) { $this->cookieJar->clear($key); return $this->withCookieParams($this->cookieJar->all()); }
[ "public", "function", "clearCookie", "(", "$", "key", ")", "{", "$", "this", "->", "cookieJar", "->", "clear", "(", "$", "key", ")", ";", "return", "$", "this", "->", "withCookieParams", "(", "$", "this", "->", "cookieJar", "->", "all", "(", ")", ")"...
@param string $key @return ServerRequest
[ "@param", "string", "$key" ]
train
https://github.com/refinery29/piston/blob/75c402e814136577fa9a02479e8803aca664c865/src/Request.php#L241-L246
refinery29/piston
src/Request.php
Request.withOffsetLimit
public function withOffsetLimit($offset, $limit) { $new = clone $this; $new->offset = $offset; $new->limit = $limit; $new->paginationType = self::OFFSET_LIMIT_PAGINATION; return $new; }
php
public function withOffsetLimit($offset, $limit) { $new = clone $this; $new->offset = $offset; $new->limit = $limit; $new->paginationType = self::OFFSET_LIMIT_PAGINATION; return $new; }
[ "public", "function", "withOffsetLimit", "(", "$", "offset", ",", "$", "limit", ")", "{", "$", "new", "=", "clone", "$", "this", ";", "$", "new", "->", "offset", "=", "$", "offset", ";", "$", "new", "->", "limit", "=", "$", "limit", ";", "$", "ne...
@param int $offset @param int $limit @return Request
[ "@param", "int", "$offset", "@param", "int", "$limit" ]
train
https://github.com/refinery29/piston/blob/75c402e814136577fa9a02479e8803aca664c865/src/Request.php#L319-L327
refinery29/piston
src/Request.php
Request.withPageAndPerPage
public function withPageAndPerPage($page, $perPage) { $new = clone $this; $new->offset = ($page - 1) * $perPage; $new->limit = $perPage; $new->paginationType = self::PAGED_PAGINATION; return $new; }
php
public function withPageAndPerPage($page, $perPage) { $new = clone $this; $new->offset = ($page - 1) * $perPage; $new->limit = $perPage; $new->paginationType = self::PAGED_PAGINATION; return $new; }
[ "public", "function", "withPageAndPerPage", "(", "$", "page", ",", "$", "perPage", ")", "{", "$", "new", "=", "clone", "$", "this", ";", "$", "new", "->", "offset", "=", "(", "$", "page", "-", "1", ")", "*", "$", "perPage", ";", "$", "new", "->",...
@param int $page @param int $perPage @return Request
[ "@param", "int", "$page", "@param", "int", "$perPage" ]
train
https://github.com/refinery29/piston/blob/75c402e814136577fa9a02479e8803aca664c865/src/Request.php#L405-L413
phpmob/twig-modify-bundle
Modifier/CSSMin.php
CSSMin.minify
public static function minify($content, array $options = []) { $compressor = new Minifier(); if (array_key_exists('remove_important_comments', $options)) { $compressor->removeImportantComments($options['remove_important_comments']); } if (array_key_exists('keep_source_m...
php
public static function minify($content, array $options = []) { $compressor = new Minifier(); if (array_key_exists('remove_important_comments', $options)) { $compressor->removeImportantComments($options['remove_important_comments']); } if (array_key_exists('keep_source_m...
[ "public", "static", "function", "minify", "(", "$", "content", ",", "array", "$", "options", "=", "[", "]", ")", "{", "$", "compressor", "=", "new", "Minifier", "(", ")", ";", "if", "(", "array_key_exists", "(", "'remove_important_comments'", ",", "$", "...
@param $content @param array $options @return string
[ "@param", "$content", "@param", "array", "$options" ]
train
https://github.com/phpmob/twig-modify-bundle/blob/30b70ca3ea7b902f2f29c8457cd4f8da45b1d29e/Modifier/CSSMin.php#L27-L40
VDMi/Guzzle-oAuth
src/GuzzleOauth/BaseConsumerOauth2.php
BaseConsumerOauth2.getAuthorizeUrl
public function getAuthorizeUrl($request_token, $callback_uri = NULL, $state = NULL) { if (empty($callback_uri) && isset($request_token['callback_uri'])) { $callback_uri = $request_token['callback_uri']; } if (empty($state)) { $state = md5(mt_rand()); } $params = array(); if ($this->...
php
public function getAuthorizeUrl($request_token, $callback_uri = NULL, $state = NULL) { if (empty($callback_uri) && isset($request_token['callback_uri'])) { $callback_uri = $request_token['callback_uri']; } if (empty($state)) { $state = md5(mt_rand()); } $params = array(); if ($this->...
[ "public", "function", "getAuthorizeUrl", "(", "$", "request_token", ",", "$", "callback_uri", "=", "NULL", ",", "$", "state", "=", "NULL", ")", "{", "if", "(", "empty", "(", "$", "callback_uri", ")", "&&", "isset", "(", "$", "request_token", "[", "'callb...
Return a redirect url.
[ "Return", "a", "redirect", "url", "." ]
train
https://github.com/VDMi/Guzzle-oAuth/blob/e2b2561e4e402e13ba605082bf768b29942f90cb/src/GuzzleOauth/BaseConsumerOauth2.php#L75-L99
VDMi/Guzzle-oAuth
src/GuzzleOauth/BaseConsumerOauth2.php
BaseConsumerOauth2.getAccessToken
public function getAccessToken($query_data, $request_token) { $post = array( 'client_id' => $this->getConfig('consumer_key'), 'client_secret' => $this->getConfig('consumer_secret'), 'redirect_uri' => $request_token['callback_uri'], 'code' => $query_data['code'], 'grant_type' => 'autho...
php
public function getAccessToken($query_data, $request_token) { $post = array( 'client_id' => $this->getConfig('consumer_key'), 'client_secret' => $this->getConfig('consumer_secret'), 'redirect_uri' => $request_token['callback_uri'], 'code' => $query_data['code'], 'grant_type' => 'autho...
[ "public", "function", "getAccessToken", "(", "$", "query_data", ",", "$", "request_token", ")", "{", "$", "post", "=", "array", "(", "'client_id'", "=>", "$", "this", "->", "getConfig", "(", "'consumer_key'", ")", ",", "'client_secret'", "=>", "$", "this", ...
Get a Access Token.
[ "Get", "a", "Access", "Token", "." ]
train
https://github.com/VDMi/Guzzle-oAuth/blob/e2b2561e4e402e13ba605082bf768b29942f90cb/src/GuzzleOauth/BaseConsumerOauth2.php#L111-L141
VDMi/Guzzle-oAuth
src/GuzzleOauth/BaseConsumerOauth2.php
BaseConsumerOauth2.normalizeAccessToken
protected function normalizeAccessToken($access_token) { if (!isset($access_token['token_type'])) { $access_token['token_type'] = 'Bearer'; } if (!isset($access_token['expires_at']) && isset($access_token['expires_in'])) { $access_token['expires_at'] = $access_token['expires_in'] + $access_token...
php
protected function normalizeAccessToken($access_token) { if (!isset($access_token['token_type'])) { $access_token['token_type'] = 'Bearer'; } if (!isset($access_token['expires_at']) && isset($access_token['expires_in'])) { $access_token['expires_at'] = $access_token['expires_in'] + $access_token...
[ "protected", "function", "normalizeAccessToken", "(", "$", "access_token", ")", "{", "if", "(", "!", "isset", "(", "$", "access_token", "[", "'token_type'", "]", ")", ")", "{", "$", "access_token", "[", "'token_type'", "]", "=", "'Bearer'", ";", "}", "if",...
Normalize access token
[ "Normalize", "access", "token" ]
train
https://github.com/VDMi/Guzzle-oAuth/blob/e2b2561e4e402e13ba605082bf768b29942f90cb/src/GuzzleOauth/BaseConsumerOauth2.php#L153-L161
VDMi/Guzzle-oAuth
src/GuzzleOauth/BaseConsumerOauth2.php
BaseConsumerOauth2.setToken
public function setToken($token, $token_secret = '') { $this->getOauthPlugin()->setToken($token, $token_secret); $this->getConfig()->set('access_token', $token); return $this; }
php
public function setToken($token, $token_secret = '') { $this->getOauthPlugin()->setToken($token, $token_secret); $this->getConfig()->set('access_token', $token); return $this; }
[ "public", "function", "setToken", "(", "$", "token", ",", "$", "token_secret", "=", "''", ")", "{", "$", "this", "->", "getOauthPlugin", "(", ")", "->", "setToken", "(", "$", "token", ",", "$", "token_secret", ")", ";", "$", "this", "->", "getConfig", ...
Set Token (and secret)
[ "Set", "Token", "(", "and", "secret", ")" ]
train
https://github.com/VDMi/Guzzle-oAuth/blob/e2b2561e4e402e13ba605082bf768b29942f90cb/src/GuzzleOauth/BaseConsumerOauth2.php#L166-L170
VDMi/Guzzle-oAuth
src/GuzzleOauth/BaseConsumerOauth2.php
BaseConsumerOauth2.getScope
public function getScope() { $scope = $this->getConfig('scope'); if (empty($scope)) { $scope = array(); } if (is_string($scope)) { $this->addScope($scope); $scope = $this->getConfig('scope'); } return $scope; }
php
public function getScope() { $scope = $this->getConfig('scope'); if (empty($scope)) { $scope = array(); } if (is_string($scope)) { $this->addScope($scope); $scope = $this->getConfig('scope'); } return $scope; }
[ "public", "function", "getScope", "(", ")", "{", "$", "scope", "=", "$", "this", "->", "getConfig", "(", "'scope'", ")", ";", "if", "(", "empty", "(", "$", "scope", ")", ")", "{", "$", "scope", "=", "array", "(", ")", ";", "}", "if", "(", "is_s...
Get Scope
[ "Get", "Scope" ]
train
https://github.com/VDMi/Guzzle-oAuth/blob/e2b2561e4e402e13ba605082bf768b29942f90cb/src/GuzzleOauth/BaseConsumerOauth2.php#L183-L193
VDMi/Guzzle-oAuth
src/GuzzleOauth/BaseConsumerOauth2.php
BaseConsumerOauth2.addScope
public function addScope($extra_scope) { $scope = $this->getConfig('scope'); if (empty($scope)) { $scope = array(); } if (is_string($scope)) { $scope = preg_split('/\s,\s|\s,|,\s|,|\s/', $scope); } if (is_string($extra_scope)) { $extra_scope = preg_split('/\s,\s|\s,|,\s|,|\s/',...
php
public function addScope($extra_scope) { $scope = $this->getConfig('scope'); if (empty($scope)) { $scope = array(); } if (is_string($scope)) { $scope = preg_split('/\s,\s|\s,|,\s|,|\s/', $scope); } if (is_string($extra_scope)) { $extra_scope = preg_split('/\s,\s|\s,|,\s|,|\s/',...
[ "public", "function", "addScope", "(", "$", "extra_scope", ")", "{", "$", "scope", "=", "$", "this", "->", "getConfig", "(", "'scope'", ")", ";", "if", "(", "empty", "(", "$", "scope", ")", ")", "{", "$", "scope", "=", "array", "(", ")", ";", "}"...
Add Scope
[ "Add", "Scope" ]
train
https://github.com/VDMi/Guzzle-oAuth/blob/e2b2561e4e402e13ba605082bf768b29942f90cb/src/GuzzleOauth/BaseConsumerOauth2.php#L198-L219
phramework/jsonapi
src/Model/Relationship.php
Relationship.getRelationshipData
public static function getRelationshipData( $relationshipKey, $id, Fields $fields = null, $primaryDataParameters = [], $relationshipParameters = [] ) { if (!static::relationshipExists($relationshipKey)) { throw new \Phramework\Exceptions\ServerException(sp...
php
public static function getRelationshipData( $relationshipKey, $id, Fields $fields = null, $primaryDataParameters = [], $relationshipParameters = [] ) { if (!static::relationshipExists($relationshipKey)) { throw new \Phramework\Exceptions\ServerException(sp...
[ "public", "static", "function", "getRelationshipData", "(", "$", "relationshipKey", ",", "$", "id", ",", "Fields", "$", "fields", "=", "null", ",", "$", "primaryDataParameters", "=", "[", "]", ",", "$", "relationshipParameters", "=", "[", "]", ")", "{", "i...
Get records from a relationship link @param string $relationshipKey @param string $id @param Fields|null $fields @return RelationshipResource|RelationshipResource[] @throws \Phramework\Exceptions\ServerException If relationship doesn't exist @throws \Phramework\Exceptions\ServerException If relationship's class method ...
[ "Get", "records", "from", "a", "relationship", "link" ]
train
https://github.com/phramework/jsonapi/blob/af20882a8b6f6e5be9c8e09e5b87f6c23a4b0726/src/Model/Relationship.php#L69-L128
phramework/jsonapi
src/Model/Relationship.php
Relationship.getIncludedData
public static function getIncludedData( $primaryData, $include = [], Fields $fields = null, $additionalResourceParameters = [] ) { /** * Store relationshipKeys as key and ids of their related data as value * @example * ```php * (object) [ ...
php
public static function getIncludedData( $primaryData, $include = [], Fields $fields = null, $additionalResourceParameters = [] ) { /** * Store relationshipKeys as key and ids of their related data as value * @example * ```php * (object) [ ...
[ "public", "static", "function", "getIncludedData", "(", "$", "primaryData", ",", "$", "include", "=", "[", "]", ",", "Fields", "$", "fields", "=", "null", ",", "$", "additionalResourceParameters", "=", "[", "]", ")", "{", "/**\n * Store relationshipKeys ...
Get jsonapi's included object, selected by include argument, using id's of relationship's data from resources in primary data object @param Resource|Resource[] $primaryData Primary data resource or resources @param string[] $include An array with the keys of relationships to include @param Fields|null ...
[ "Get", "jsonapi", "s", "included", "object", "selected", "by", "include", "argument", "using", "id", "s", "of", "relationship", "s", "data", "from", "resources", "in", "primary", "data", "object" ]
train
https://github.com/phramework/jsonapi/blob/af20882a8b6f6e5be9c8e09e5b87f6c23a4b0726/src/Model/Relationship.php#L150-L261
acasademont/wurfl
WURFL/WURFLManagerFactory.php
WURFL_WURFLManagerFactory.reload
private function reload() { $this->persistenceStorage->setWURFLLoaded(false); $this->invalidateCache(); $this->init(); $this->persistenceStorage->save(self::WURFL_API_STATE, $this->getState()); }
php
private function reload() { $this->persistenceStorage->setWURFLLoaded(false); $this->invalidateCache(); $this->init(); $this->persistenceStorage->save(self::WURFL_API_STATE, $this->getState()); }
[ "private", "function", "reload", "(", ")", "{", "$", "this", "->", "persistenceStorage", "->", "setWURFLLoaded", "(", "false", ")", ";", "$", "this", "->", "invalidateCache", "(", ")", ";", "$", "this", "->", "init", "(", ")", ";", "$", "this", "->", ...
Reload the WURFL Data into the persistence provider
[ "Reload", "the", "WURFL", "Data", "into", "the", "persistence", "provider" ]
train
https://github.com/acasademont/wurfl/blob/0f4fb6e06b452ba95ad1d15e7d8226d0974b60c2/WURFL/WURFLManagerFactory.php#L91-L97
acasademont/wurfl
WURFL/WURFLManagerFactory.php
WURFL_WURFLManagerFactory.hasToBeReloaded
public function hasToBeReloaded() { if (!$this->wurflConfig->allowReload) { return false; } $state = $this->persistenceStorage->load(self::WURFL_API_STATE); return !$this->isStateCurrent($state); }
php
public function hasToBeReloaded() { if (!$this->wurflConfig->allowReload) { return false; } $state = $this->persistenceStorage->load(self::WURFL_API_STATE); return !$this->isStateCurrent($state); }
[ "public", "function", "hasToBeReloaded", "(", ")", "{", "if", "(", "!", "$", "this", "->", "wurflConfig", "->", "allowReload", ")", "{", "return", "false", ";", "}", "$", "state", "=", "$", "this", "->", "persistenceStorage", "->", "load", "(", "self", ...
Returns true if the WURFL is out of date or otherwise needs to be reloaded @return bool
[ "Returns", "true", "if", "the", "WURFL", "is", "out", "of", "date", "or", "otherwise", "needs", "to", "be", "reloaded" ]
train
https://github.com/acasademont/wurfl/blob/0f4fb6e06b452ba95ad1d15e7d8226d0974b60c2/WURFL/WURFLManagerFactory.php#L103-L110
acasademont/wurfl
WURFL/WURFLManagerFactory.php
WURFL_WURFLManagerFactory.init
private function init() { $logger = null; //$this->logger($wurflConfig->logger); $context = new WURFL_Context($this->persistenceStorage, $this->cacheStorage, $logger); $userAgentHandlerChain = WURFL_UserAgentHandlerChainFactory::createFrom($context); $deviceRepository = $this->device...
php
private function init() { $logger = null; //$this->logger($wurflConfig->logger); $context = new WURFL_Context($this->persistenceStorage, $this->cacheStorage, $logger); $userAgentHandlerChain = WURFL_UserAgentHandlerChainFactory::createFrom($context); $deviceRepository = $this->device...
[ "private", "function", "init", "(", ")", "{", "$", "logger", "=", "null", ";", "//$this->logger($wurflConfig->logger);", "$", "context", "=", "new", "WURFL_Context", "(", "$", "this", "->", "persistenceStorage", ",", "$", "this", "->", "cacheStorage", ",", "$"...
Initializes the WURFL Manager Factory by assigning cache and persistence providers
[ "Initializes", "the", "WURFL", "Manager", "Factory", "by", "assigning", "cache", "and", "persistence", "providers" ]
train
https://github.com/acasademont/wurfl/blob/0f4fb6e06b452ba95ad1d15e7d8226d0974b60c2/WURFL/WURFLManagerFactory.php#L155-L164