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
PHPPowertools/HTML5
src/PowerTools/HTML5/Parser/Tokenizer.php
HTML5_Parser_Tokenizer.sequenceMatches
protected function sequenceMatches($sequence) { $len = strlen($sequence); $buffer = ''; for ($i = 0; $i < $len; ++$i) { $buffer .= $this->scanner->current(); // EOF. Rewind and let the caller handle it. if ($this->scanner->current() === false) { ...
php
protected function sequenceMatches($sequence) { $len = strlen($sequence); $buffer = ''; for ($i = 0; $i < $len; ++$i) { $buffer .= $this->scanner->current(); // EOF. Rewind and let the caller handle it. if ($this->scanner->current() === false) { ...
[ "protected", "function", "sequenceMatches", "(", "$", "sequence", ")", "{", "$", "len", "=", "strlen", "(", "$", "sequence", ")", ";", "$", "buffer", "=", "''", ";", "for", "(", "$", "i", "=", "0", ";", "$", "i", "<", "$", "len", ";", "++", "$"...
Check if upcomming chars match the given sequence. This will read the stream for the $sequence. If it's found, this will return true. If not, return false. Since this unconsumes any chars it reads, the caller will still need to read the next sequence, even if this returns true. Example: $this->sequenceMatches('</scri...
[ "Check", "if", "upcomming", "chars", "match", "the", "given", "sequence", "." ]
train
https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/Tokenizer.php#L965-L981
PHPPowertools/HTML5
src/PowerTools/HTML5/Parser/Tokenizer.php
HTML5_Parser_Tokenizer.flushBuffer
protected function flushBuffer() { if ($this->text === '') { return; } $this->events->text($this->text); $this->text = ''; }
php
protected function flushBuffer() { if ($this->text === '') { return; } $this->events->text($this->text); $this->text = ''; }
[ "protected", "function", "flushBuffer", "(", ")", "{", "if", "(", "$", "this", "->", "text", "===", "''", ")", "{", "return", ";", "}", "$", "this", "->", "events", "->", "text", "(", "$", "this", "->", "text", ")", ";", "$", "this", "->", "text"...
Send a TEXT event with the contents of the text buffer. This emits an HTML5_Parser_EventHandler::text() event with the current contents of the temporary text buffer. (The buffer is used to group as much PCDATA as we can instead of emitting lots and lots of TEXT events.)
[ "Send", "a", "TEXT", "event", "with", "the", "contents", "of", "the", "text", "buffer", "." ]
train
https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/Tokenizer.php#L990-L996
PHPPowertools/HTML5
src/PowerTools/HTML5/Parser/Tokenizer.php
HTML5_Parser_Tokenizer.parseError
protected function parseError($msg) { $args = func_get_args(); if (count($args) > 1) { array_shift($args); $msg = vsprintf($msg, $args); } $line = $this->scanner->currentLine(); $col = $this->scanner->columnOffset(); $this->events->parseError($ms...
php
protected function parseError($msg) { $args = func_get_args(); if (count($args) > 1) { array_shift($args); $msg = vsprintf($msg, $args); } $line = $this->scanner->currentLine(); $col = $this->scanner->columnOffset(); $this->events->parseError($ms...
[ "protected", "function", "parseError", "(", "$", "msg", ")", "{", "$", "args", "=", "func_get_args", "(", ")", ";", "if", "(", "count", "(", "$", "args", ")", ">", "1", ")", "{", "array_shift", "(", "$", "args", ")", ";", "$", "msg", "=", "vsprin...
Emit a parse error. A parse error always returns false because it never consumes any characters.
[ "Emit", "a", "parse", "error", "." ]
train
https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/Tokenizer.php#L1013-L1025
PHPPowertools/HTML5
src/PowerTools/HTML5/Parser/Tokenizer.php
HTML5_Parser_Tokenizer.decodeCharacterReference
protected function decodeCharacterReference($inAttribute = false) { // If it fails this, it's definitely not an entity. if ($this->scanner->current() != '&') { return false; } // Next char after &. $tok = $this->scanner->next(); $entity = ''; $start ...
php
protected function decodeCharacterReference($inAttribute = false) { // If it fails this, it's definitely not an entity. if ($this->scanner->current() != '&') { return false; } // Next char after &. $tok = $this->scanner->next(); $entity = ''; $start ...
[ "protected", "function", "decodeCharacterReference", "(", "$", "inAttribute", "=", "false", ")", "{", "// If it fails this, it's definitely not an entity.", "if", "(", "$", "this", "->", "scanner", "->", "current", "(", ")", "!=", "'&'", ")", "{", "return", "false...
Decode a character reference and return the string. Returns false if the entity could not be found. If $inAttribute is set to true, a bare & will be returned as-is. @param boolean $inAttribute Set to true if the text is inside of an attribute value. false otherwise.
[ "Decode", "a", "character", "reference", "and", "return", "the", "string", "." ]
train
https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/Tokenizer.php#L1037-L1122
Danack/GithubArtaxService
lib/GithubService/Operation/updateAuthorization.php
updateAuthorization.createRequest
public function createRequest() { $request = new \Amp\Artax\Request(); $url = null; $request->setMethod(''); $jsonParams = []; $value = $this->getFilteredParameter('scopes'); $jsonParams['scopes'] = $value; $value = $this->getFilteredParameter('add_scopes'); ...
php
public function createRequest() { $request = new \Amp\Artax\Request(); $url = null; $request->setMethod(''); $jsonParams = []; $value = $this->getFilteredParameter('scopes'); $jsonParams['scopes'] = $value; $value = $this->getFilteredParameter('add_scopes'); ...
[ "public", "function", "createRequest", "(", ")", "{", "$", "request", "=", "new", "\\", "Amp", "\\", "Artax", "\\", "Request", "(", ")", ";", "$", "url", "=", "null", ";", "$", "request", "->", "setMethod", "(", "''", ")", ";", "$", "jsonParams", "...
Create an Amp\Artax\Request object from the operation. @return \Amp\Artax\Request
[ "Create", "an", "Amp", "\\", "Artax", "\\", "Request", "object", "from", "the", "operation", "." ]
train
https://github.com/Danack/GithubArtaxService/blob/9f62b5be4f413207d4012e7fa084d0ae505680eb/lib/GithubService/Operation/updateAuthorization.php#L192-L224
wenbinye/PhalconX
src/Helper/ClassHelper.php
ClassHelper.splitName
public static function splitName($class) { $pos = strrpos($class, '\\'); if ($pos === false) { return [null, $class]; } else { return [substr($class, 0, $pos), substr($class, $pos+1)]; } }
php
public static function splitName($class) { $pos = strrpos($class, '\\'); if ($pos === false) { return [null, $class]; } else { return [substr($class, 0, $pos), substr($class, $pos+1)]; } }
[ "public", "static", "function", "splitName", "(", "$", "class", ")", "{", "$", "pos", "=", "strrpos", "(", "$", "class", ",", "'\\\\'", ")", ";", "if", "(", "$", "pos", "===", "false", ")", "{", "return", "[", "null", ",", "$", "class", "]", ";",...
Splits class name to namespace and class name @param string $class @return array
[ "Splits", "class", "name", "to", "namespace", "and", "class", "name" ]
train
https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Helper/ClassHelper.php#L47-L55
weew/http
src/Weew/Http/HttpRequest.php
HttpRequest.getParameter
public function getParameter($key, $default = null) { $value = $this->getUrl()->getQuery()->get($key); if ($value === null) { $value = $this->getData()->get($key, $default); } return $value; }
php
public function getParameter($key, $default = null) { $value = $this->getUrl()->getQuery()->get($key); if ($value === null) { $value = $this->getData()->get($key, $default); } return $value; }
[ "public", "function", "getParameter", "(", "$", "key", ",", "$", "default", "=", "null", ")", "{", "$", "value", "=", "$", "this", "->", "getUrl", "(", ")", "->", "getQuery", "(", ")", "->", "get", "(", "$", "key", ")", ";", "if", "(", "$", "va...
Retrieve a value from url query or message body. @param string $key @param null $default @return mixed
[ "Retrieve", "a", "value", "from", "url", "query", "or", "message", "body", "." ]
train
https://github.com/weew/http/blob/fd34d3d5643ca01c8e0946e888224a8e8dcc3c0d/src/Weew/Http/HttpRequest.php#L314-L322
weew/http
src/Weew/Http/HttpRequest.php
HttpRequest.setDefaults
protected function setDefaults() { if ($this->getAccept() === null) { $this->setDefaultAccept(); } if ($this->getContentType() === null) { $this->setDefaultContentType(); } }
php
protected function setDefaults() { if ($this->getAccept() === null) { $this->setDefaultAccept(); } if ($this->getContentType() === null) { $this->setDefaultContentType(); } }
[ "protected", "function", "setDefaults", "(", ")", "{", "if", "(", "$", "this", "->", "getAccept", "(", ")", "===", "null", ")", "{", "$", "this", "->", "setDefaultAccept", "(", ")", ";", "}", "if", "(", "$", "this", "->", "getContentType", "(", ")", ...
Use this as hook to extend your custom request.
[ "Use", "this", "as", "hook", "to", "extend", "your", "custom", "request", "." ]
train
https://github.com/weew/http/blob/fd34d3d5643ca01c8e0946e888224a8e8dcc3c0d/src/Weew/Http/HttpRequest.php#L344-L352
DesignPond/newsletter
src/Http/Controllers/Backend/SubscriberController.php
SubscriberController.subscribers
public function subscribers(Request $request) { $order = $request->input('order'); $search = $request->input('search',null); $search = ($search ? $search['value'] : null); return $this->subscriber->get_ajax( $request->input('draw'), $request->input('start'), $request->i...
php
public function subscribers(Request $request) { $order = $request->input('order'); $search = $request->input('search',null); $search = ($search ? $search['value'] : null); return $this->subscriber->get_ajax( $request->input('draw'), $request->input('start'), $request->i...
[ "public", "function", "subscribers", "(", "Request", "$", "request", ")", "{", "$", "order", "=", "$", "request", "->", "input", "(", "'order'", ")", ";", "$", "search", "=", "$", "request", "->", "input", "(", "'search'", ",", "null", ")", ";", "$",...
Display a listing of tsubscribers for ajax GET /subscriber/getAllAbos @return Response
[ "Display", "a", "listing", "of", "tsubscribers", "for", "ajax", "GET", "/", "subscriber", "/", "getAllAbos" ]
train
https://github.com/DesignPond/newsletter/blob/0bf0e7a8a42fa4b90a5e937771bb80058e0a91c3/src/Http/Controllers/Backend/SubscriberController.php#L50-L59
DesignPond/newsletter
src/Http/Controllers/Backend/SubscriberController.php
SubscriberController.store
public function store(Request $request) { // Subscribe user with activation token to website list and sync newsletter abos $subscribe = $this->subscriber->create( [ 'email' => $request->input('email'), 'activated_at' => \Carbon\Carbon::now(), ...
php
public function store(Request $request) { // Subscribe user with activation token to website list and sync newsletter abos $subscribe = $this->subscriber->create( [ 'email' => $request->input('email'), 'activated_at' => \Carbon\Carbon::now(), ...
[ "public", "function", "store", "(", "Request", "$", "request", ")", "{", "// Subscribe user with activation token to website list and sync newsletter abos", "$", "subscribe", "=", "$", "this", "->", "subscriber", "->", "create", "(", "[", "'email'", "=>", "$", "reques...
Store a newly created resource in storage. POST /subscriber @return Response
[ "Store", "a", "newly", "created", "resource", "in", "storage", ".", "POST", "/", "subscriber" ]
train
https://github.com/DesignPond/newsletter/blob/0bf0e7a8a42fa4b90a5e937771bb80058e0a91c3/src/Http/Controllers/Backend/SubscriberController.php#L80-L107
DesignPond/newsletter
src/Http/Controllers/Backend/SubscriberController.php
SubscriberController.show
public function show($id) { $subscriber = $this->subscriber->find($id); $newsletter = $this->newsletter->getAll(); return view('newsletter::Backend.subscribers.show')->with(['subscriber' => $subscriber , 'newsletter' => $newsletter]); }
php
public function show($id) { $subscriber = $this->subscriber->find($id); $newsletter = $this->newsletter->getAll(); return view('newsletter::Backend.subscribers.show')->with(['subscriber' => $subscriber , 'newsletter' => $newsletter]); }
[ "public", "function", "show", "(", "$", "id", ")", "{", "$", "subscriber", "=", "$", "this", "->", "subscriber", "->", "find", "(", "$", "id", ")", ";", "$", "newsletter", "=", "$", "this", "->", "newsletter", "->", "getAll", "(", ")", ";", "return...
Show the form for editing the specified resource. GET /subscriber/{id}/edit @param int $id @return Response
[ "Show", "the", "form", "for", "editing", "the", "specified", "resource", ".", "GET", "/", "subscriber", "/", "{", "id", "}", "/", "edit" ]
train
https://github.com/DesignPond/newsletter/blob/0bf0e7a8a42fa4b90a5e937771bb80058e0a91c3/src/Http/Controllers/Backend/SubscriberController.php#L116-L122
DesignPond/newsletter
src/Http/Controllers/Backend/SubscriberController.php
SubscriberController.update
public function update(RemoveNewsletterUserRequest $request, $id) { $activated_at = ($request->input('activation') ? date('Y-m-d G:i:s') : null); $subscriber = $this->subscriber->find($id); $new = $request->input('newsletter_id',[]); $has = $subscriber->subscriptions->pluck('id')-...
php
public function update(RemoveNewsletterUserRequest $request, $id) { $activated_at = ($request->input('activation') ? date('Y-m-d G:i:s') : null); $subscriber = $this->subscriber->find($id); $new = $request->input('newsletter_id',[]); $has = $subscriber->subscriptions->pluck('id')-...
[ "public", "function", "update", "(", "RemoveNewsletterUserRequest", "$", "request", ",", "$", "id", ")", "{", "$", "activated_at", "=", "(", "$", "request", "->", "input", "(", "'activation'", ")", "?", "date", "(", "'Y-m-d G:i:s'", ")", ":", "null", ")", ...
Update the specified resource in storage. PUT /subscriber/{id} @param int $id @return Response
[ "Update", "the", "specified", "resource", "in", "storage", ".", "PUT", "/", "subscriber", "/", "{", "id", "}" ]
train
https://github.com/DesignPond/newsletter/blob/0bf0e7a8a42fa4b90a5e937771bb80058e0a91c3/src/Http/Controllers/Backend/SubscriberController.php#L131-L171
DesignPond/newsletter
src/Http/Controllers/Backend/SubscriberController.php
SubscriberController.destroy
public function destroy($id,Request $request) { // Validate the email $this->validate($request, array('email' => 'required')); // find the abo $subscriber = $this->subscriber->findByEmail($request->email); // Remove all the abos we have $subscriber->subscriptions()-...
php
public function destroy($id,Request $request) { // Validate the email $this->validate($request, array('email' => 'required')); // find the abo $subscriber = $this->subscriber->findByEmail($request->email); // Remove all the abos we have $subscriber->subscriptions()-...
[ "public", "function", "destroy", "(", "$", "id", ",", "Request", "$", "request", ")", "{", "// Validate the email", "$", "this", "->", "validate", "(", "$", "request", ",", "array", "(", "'email'", "=>", "'required'", ")", ")", ";", "// find the abo", "$",...
Remove the specified resource from storage. DELETE /subscriber/{id} @param int $email @return Response
[ "Remove", "the", "specified", "resource", "from", "storage", ".", "DELETE", "/", "subscriber", "/", "{", "id", "}" ]
train
https://github.com/DesignPond/newsletter/blob/0bf0e7a8a42fa4b90a5e937771bb80058e0a91c3/src/Http/Controllers/Backend/SubscriberController.php#L180-L210
m4grio/bangkok-insurance-php
src/Client/PremiumClient.php
PremiumClient.call
public function call($method, Array $params = []) { $rawResult = parent::call($method, $params); /** * I know this is just awful; will do it properly later on * * @todo */ switch ($method) { case 'calculator_vol_prem': $result ...
php
public function call($method, Array $params = []) { $rawResult = parent::call($method, $params); /** * I know this is just awful; will do it properly later on * * @todo */ switch ($method) { case 'calculator_vol_prem': $result ...
[ "public", "function", "call", "(", "$", "method", ",", "Array", "$", "params", "=", "[", "]", ")", "{", "$", "rawResult", "=", "parent", "::", "call", "(", "$", "method", ",", "$", "params", ")", ";", "/**\n * I know this is just awful; will do it pr...
@param $method @param array $params @return PremiumResult
[ "@param", "$method", "@param", "array", "$params" ]
train
https://github.com/m4grio/bangkok-insurance-php/blob/400266d043abe6b7cacb9da36064cbb169149c2a/src/Client/PremiumClient.php#L23-L42
wenbinye/PhalconX
src/Helper/ClassParser.php
ClassParser.getImports
public function getImports() { $imports = []; $tokens = token_get_all(file_get_contents($this->file)); reset($tokens); $token = ''; while ($token !== false) { $token = next($tokens); if (!is_array($token)) { continue; } ...
php
public function getImports() { $imports = []; $tokens = token_get_all(file_get_contents($this->file)); reset($tokens); $token = ''; while ($token !== false) { $token = next($tokens); if (!is_array($token)) { continue; } ...
[ "public", "function", "getImports", "(", ")", "{", "$", "imports", "=", "[", "]", ";", "$", "tokens", "=", "token_get_all", "(", "file_get_contents", "(", "$", "this", "->", "file", ")", ")", ";", "reset", "(", "$", "tokens", ")", ";", "$", "token", ...
Gets all imported classes @return array
[ "Gets", "all", "imported", "classes" ]
train
https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Helper/ClassParser.php#L57-L76
zicht/z
src/Zicht/Tool/Container/Task.php
Task.compile
public function compile(Buffer $buffer) { parent::compile($buffer); if (substr($this->getName(), 0, 1) !== '_') { $buffer ->writeln('try {') ->indent(1) ->writeln('$z->addCommand(') ->indent(1) ...
php
public function compile(Buffer $buffer) { parent::compile($buffer); if (substr($this->getName(), 0, 1) !== '_') { $buffer ->writeln('try {') ->indent(1) ->writeln('$z->addCommand(') ->indent(1) ...
[ "public", "function", "compile", "(", "Buffer", "$", "buffer", ")", "{", "parent", "::", "compile", "(", "$", "buffer", ")", ";", "if", "(", "substr", "(", "$", "this", "->", "getName", "(", ")", ",", "0", ",", "1", ")", "!==", "'_'", ")", "{", ...
Compiles the task initialization code into the buffer. @param \Zicht\Tool\Script\Buffer $buffer @return void
[ "Compiles", "the", "task", "initialization", "code", "into", "the", "buffer", "." ]
train
https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Container/Task.php#L63-L93
zicht/z
src/Zicht/Tool/Container/Task.php
Task.compileBody
public function compileBody(Buffer $buffer) { $buffer->writeln('$ret = null;'); foreach ($this->taskDef['flags'] as $flag => $value) { $buffer ->write('if (null === $z->resolve(')->asPhp($flag)->raw(', false)) {')->eol() ->indent(1) ->writ...
php
public function compileBody(Buffer $buffer) { $buffer->writeln('$ret = null;'); foreach ($this->taskDef['flags'] as $flag => $value) { $buffer ->write('if (null === $z->resolve(')->asPhp($flag)->raw(', false)) {')->eol() ->indent(1) ->writ...
[ "public", "function", "compileBody", "(", "Buffer", "$", "buffer", ")", "{", "$", "buffer", "->", "writeln", "(", "'$ret = null;'", ")", ";", "foreach", "(", "$", "this", "->", "taskDef", "[", "'flags'", "]", "as", "$", "flag", "=>", "$", "value", ")",...
Compile the node @param Buffer $buffer @return void
[ "Compile", "the", "node" ]
train
https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Container/Task.php#L102-L178
zicht/z
src/Zicht/Tool/Container/Task.php
Task.getArguments
public function getArguments($onlyPublic = true) { $ret = array(); if (isset($this->taskDef['args'])) { foreach ($this->taskDef['args'] as $name => $expr) { if ($onlyPublic && $name{0} === '_') { // Variables prefixed with an underscore are considered ...
php
public function getArguments($onlyPublic = true) { $ret = array(); if (isset($this->taskDef['args'])) { foreach ($this->taskDef['args'] as $name => $expr) { if ($onlyPublic && $name{0} === '_') { // Variables prefixed with an underscore are considered ...
[ "public", "function", "getArguments", "(", "$", "onlyPublic", "=", "true", ")", "{", "$", "ret", "=", "array", "(", ")", ";", "if", "(", "isset", "(", "$", "this", "->", "taskDef", "[", "'args'", "]", ")", ")", "{", "foreach", "(", "$", "this", "...
Returns all variables that can be injected into the task. @param bool $onlyPublic @return array
[ "Returns", "all", "variables", "that", "can", "be", "injected", "into", "the", "task", "." ]
train
https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Container/Task.php#L187-L204
zicht/z
src/Zicht/Tool/Container/Task.php
Task.getOptions
public function getOptions() { $ret = array(); if (!empty($this->taskDef['opts'])) { foreach ($this->taskDef['opts'] as $opt) { $ret[] = $opt->name; } } return $ret; }
php
public function getOptions() { $ret = array(); if (!empty($this->taskDef['opts'])) { foreach ($this->taskDef['opts'] as $opt) { $ret[] = $opt->name; } } return $ret; }
[ "public", "function", "getOptions", "(", ")", "{", "$", "ret", "=", "array", "(", ")", ";", "if", "(", "!", "empty", "(", "$", "this", "->", "taskDef", "[", "'opts'", "]", ")", ")", "{", "foreach", "(", "$", "this", "->", "taskDef", "[", "'opts'"...
Returns all variables that can be injected into the task. @return array
[ "Returns", "all", "variables", "that", "can", "be", "injected", "into", "the", "task", "." ]
train
https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Container/Task.php#L211-L220
heidelpay/PhpDoc
src/phpDocumentor/Compiler/Pass/PackageTreeBuilder.php
PackageTreeBuilder.execute
public function execute(ProjectDescriptor $project) { $rootPackageDescriptor = new PackageDescriptor(); $rootPackageDescriptor->setName('\\'); $project->getIndexes()->set('packages', new Collection()); $project->getIndexes()->packages['\\'] = $rootPackageDescriptor; foreach ...
php
public function execute(ProjectDescriptor $project) { $rootPackageDescriptor = new PackageDescriptor(); $rootPackageDescriptor->setName('\\'); $project->getIndexes()->set('packages', new Collection()); $project->getIndexes()->packages['\\'] = $rootPackageDescriptor; foreach ...
[ "public", "function", "execute", "(", "ProjectDescriptor", "$", "project", ")", "{", "$", "rootPackageDescriptor", "=", "new", "PackageDescriptor", "(", ")", ";", "$", "rootPackageDescriptor", "->", "setName", "(", "'\\\\'", ")", ";", "$", "project", "->", "ge...
Compiles a 'packages' index on the project and create all Package Descriptors necessary. @param ProjectDescriptor $project @return void
[ "Compiles", "a", "packages", "index", "on", "the", "project", "and", "create", "all", "Package", "Descriptors", "necessary", "." ]
train
https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Compiler/Pass/PackageTreeBuilder.php#L49-L64
heidelpay/PhpDoc
src/phpDocumentor/Compiler/Pass/PackageTreeBuilder.php
PackageTreeBuilder.addElementsOfTypeToPackage
protected function addElementsOfTypeToPackage(ProjectDescriptor $project, array $elements, $type) { /** @var DescriptorAbstract $element */ foreach ($elements as $element) { $packageName = ''; $packageTags = $element->getTags()->get('package'); if ($packageTags in...
php
protected function addElementsOfTypeToPackage(ProjectDescriptor $project, array $elements, $type) { /** @var DescriptorAbstract $element */ foreach ($elements as $element) { $packageName = ''; $packageTags = $element->getTags()->get('package'); if ($packageTags in...
[ "protected", "function", "addElementsOfTypeToPackage", "(", "ProjectDescriptor", "$", "project", ",", "array", "$", "elements", ",", "$", "type", ")", "{", "/** @var DescriptorAbstract $element */", "foreach", "(", "$", "elements", "as", "$", "element", ")", "{", ...
Adds the given elements of a specific type to their respective Package Descriptors. This method will assign the given elements to the package as registered in the package field of that element. If a package does not exist yet it will automatically be created. @param ProjectDescriptor $project @param DescriptorAbst...
[ "Adds", "the", "given", "elements", "of", "a", "specific", "type", "to", "their", "respective", "Package", "Descriptors", "." ]
train
https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Compiler/Pass/PackageTreeBuilder.php#L80-L120
platformsh/platformsh-oauth2-php
src/Provider/Platformsh.php
Platformsh.checkResponse
protected function checkResponse(ResponseInterface $response, $data) { if (!empty($data['error'])) { $message = !empty($data['error_description']) ? $data['error_description'] : $data['error']; if ($this->requiresTfa($response)) { throw new TfaRequiredException($messa...
php
protected function checkResponse(ResponseInterface $response, $data) { if (!empty($data['error'])) { $message = !empty($data['error_description']) ? $data['error_description'] : $data['error']; if ($this->requiresTfa($response)) { throw new TfaRequiredException($messa...
[ "protected", "function", "checkResponse", "(", "ResponseInterface", "$", "response", ",", "$", "data", ")", "{", "if", "(", "!", "empty", "(", "$", "data", "[", "'error'", "]", ")", ")", "{", "$", "message", "=", "!", "empty", "(", "$", "data", "[", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/platformsh/platformsh-oauth2-php/blob/c5056b818f326e8ee358521224ac7f803d1e9d6b/src/Provider/Platformsh.php#L73-L82
platformsh/platformsh-oauth2-php
src/Provider/Platformsh.php
Platformsh.getAccessToken
public function getAccessToken($grant, array $options = []) { $grant = $this->verifyGrant($grant); $params = [ 'client_id' => $this->clientId, 'client_secret' => $this->clientSecret, 'redirect_uri' => $this->redirectUri, ]; $params = $grant->prep...
php
public function getAccessToken($grant, array $options = []) { $grant = $this->verifyGrant($grant); $params = [ 'client_id' => $this->clientId, 'client_secret' => $this->clientSecret, 'redirect_uri' => $this->redirectUri, ]; $params = $grant->prep...
[ "public", "function", "getAccessToken", "(", "$", "grant", ",", "array", "$", "options", "=", "[", "]", ")", "{", "$", "grant", "=", "$", "this", "->", "verifyGrant", "(", "$", "grant", ")", ";", "$", "params", "=", "[", "'client_id'", "=>", "$", "...
{@inheritdoc} The option 'totp' can be provided for two-factor authentication.
[ "{", "@inheritdoc", "}" ]
train
https://github.com/platformsh/platformsh-oauth2-php/blob/c5056b818f326e8ee358521224ac7f803d1e9d6b/src/Provider/Platformsh.php#L97-L119
platformsh/platformsh-oauth2-php
src/Provider/Platformsh.php
Platformsh.requiresTfa
private function requiresTfa(ResponseInterface $response) { return substr($response->getStatusCode(), 0, 1) === '4' && $response->hasHeader(self::TFA_HEADER); }
php
private function requiresTfa(ResponseInterface $response) { return substr($response->getStatusCode(), 0, 1) === '4' && $response->hasHeader(self::TFA_HEADER); }
[ "private", "function", "requiresTfa", "(", "ResponseInterface", "$", "response", ")", "{", "return", "substr", "(", "$", "response", "->", "getStatusCode", "(", ")", ",", "0", ",", "1", ")", "===", "'4'", "&&", "$", "response", "->", "hasHeader", "(", "s...
Check whether the response requires two-factor authentication. @param \Psr\Http\Message\ResponseInterface $response @return bool
[ "Check", "whether", "the", "response", "requires", "two", "-", "factor", "authentication", "." ]
train
https://github.com/platformsh/platformsh-oauth2-php/blob/c5056b818f326e8ee358521224ac7f803d1e9d6b/src/Provider/Platformsh.php#L128-L131
maestroprog/saw-php
src/Standalone/Worker/WorkerThreadRunner.php
WorkerThreadRunner.runThreads
public function runThreads(array $threads): bool { if (!$this->disabled) { foreach ($threads as $thread) { $this->runThreadPool->add($thread); try { $this->commander->runAsync(new ThreadRun( $this->client, ...
php
public function runThreads(array $threads): bool { if (!$this->disabled) { foreach ($threads as $thread) { $this->runThreadPool->add($thread); try { $this->commander->runAsync(new ThreadRun( $this->client, ...
[ "public", "function", "runThreads", "(", "array", "$", "threads", ")", ":", "bool", "{", "if", "(", "!", "$", "this", "->", "disabled", ")", "{", "foreach", "(", "$", "threads", "as", "$", "thread", ")", "{", "$", "this", "->", "runThreadPool", "->",...
Воркер не должен запускать потоки из приложения. Метод нужен для совместимости работы приложений из скрипта и на воркерах. @param AbstractThread[] $threads @return bool
[ "Воркер", "не", "должен", "запускать", "потоки", "из", "приложения", ".", "Метод", "нужен", "для", "совместимости", "работы", "приложений", "из", "скрипта", "и", "на", "воркерах", "." ]
train
https://github.com/maestroprog/saw-php/blob/159215a4d7a951cca2a9c2eed3e1aa4f5b624cfb/src/Standalone/Worker/WorkerThreadRunner.php#L63-L86
surebert/surebert-framework
src/sb/Controller/HTTP.php
HTTP.unsetCookie
public function unsetCookie($name, $path = '/') { setcookie($name, '', time() - 86400, '/', '', 0); if (isset($_COOKIE) && isset($_COOKIE[$name])) { unset($_COOKIE[$name]); } if (isset($this->request->cookie[$name])) { unset($this->request->cookie[$name]); ...
php
public function unsetCookie($name, $path = '/') { setcookie($name, '', time() - 86400, '/', '', 0); if (isset($_COOKIE) && isset($_COOKIE[$name])) { unset($_COOKIE[$name]); } if (isset($this->request->cookie[$name])) { unset($this->request->cookie[$name]); ...
[ "public", "function", "unsetCookie", "(", "$", "name", ",", "$", "path", "=", "'/'", ")", "{", "setcookie", "(", "$", "name", ",", "''", ",", "time", "(", ")", "-", "86400", ",", "'/'", ",", "''", ",", "0", ")", ";", "if", "(", "isset", "(", ...
Unsets a cookie value by setting it to expire @param string $name The cookie name @param string path The path to clear, defaults to /
[ "Unsets", "a", "cookie", "value", "by", "setting", "it", "to", "expire" ]
train
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Controller/HTTP.php#L79-L88
surebert/surebert-framework
src/sb/Controller/HTTP.php
HTTP.sendError
public function sendError($error_num, $err_str = '') { if (empty($err_str)) { switch ($error_num) { case 400: $err_str = 'Bad Request'; break; case 401: $err_str = 'Unauthorized'; br...
php
public function sendError($error_num, $err_str = '') { if (empty($err_str)) { switch ($error_num) { case 400: $err_str = 'Bad Request'; break; case 401: $err_str = 'Unauthorized'; br...
[ "public", "function", "sendError", "(", "$", "error_num", ",", "$", "err_str", "=", "''", ")", "{", "if", "(", "empty", "(", "$", "err_str", ")", ")", "{", "switch", "(", "$", "error_num", ")", "{", "case", "400", ":", "$", "err_str", "=", "'Bad Re...
Send an http error header @param integer $error_num The number of the error as found http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html @param string $err_str The error string to send, defaults sent for 400, 401, 403, 404, 405, 410, 415, 500, 501 unless specified
[ "Send", "an", "http", "error", "header" ]
train
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Controller/HTTP.php#L119-L162
surebert/surebert-framework
src/sb/Controller/HTTP.php
HTTP.requireBasicAuth
public function requireBasicAuth($check_auth = '', $realm = 'Please enter your username and password') { $authorized = false; if (!isset($_SERVER['PHP_AUTH_USER'])) { header('WWW-Authenticate: Basic realm="' . $realm . '"'); header('HTTP/1.0 401 Unauthorized'); e...
php
public function requireBasicAuth($check_auth = '', $realm = 'Please enter your username and password') { $authorized = false; if (!isset($_SERVER['PHP_AUTH_USER'])) { header('WWW-Authenticate: Basic realm="' . $realm . '"'); header('HTTP/1.0 401 Unauthorized'); e...
[ "public", "function", "requireBasicAuth", "(", "$", "check_auth", "=", "''", ",", "$", "realm", "=", "'Please enter your username and password'", ")", "{", "$", "authorized", "=", "false", ";", "if", "(", "!", "isset", "(", "$", "_SERVER", "[", "'PHP_AUTH_USER...
Added option for requesting basic auth. ONLY USE OVER SSL @param callable $check_auth the callable that determines success or not @param string $realm the realm beings used @return boolean
[ "Added", "option", "for", "requesting", "basic", "auth", ".", "ONLY", "USE", "OVER", "SSL" ]
train
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Controller/HTTP.php#L295-L317
php-lug/lug
src/Bundle/ResourceBundle/DependencyInjection/Extension/ResourceConfiguration.php
ResourceConfiguration.getConfigTreeBuilder
public function getConfigTreeBuilder() { $treeBuilder = $this->createTreeBuilder(); $children = $treeBuilder->root($this->bundle->getAlias())->children(); $this->configureBundle($children); $children->append($this->createResourceNodes()); return $treeBuilder; }
php
public function getConfigTreeBuilder() { $treeBuilder = $this->createTreeBuilder(); $children = $treeBuilder->root($this->bundle->getAlias())->children(); $this->configureBundle($children); $children->append($this->createResourceNodes()); return $treeBuilder; }
[ "public", "function", "getConfigTreeBuilder", "(", ")", "{", "$", "treeBuilder", "=", "$", "this", "->", "createTreeBuilder", "(", ")", ";", "$", "children", "=", "$", "treeBuilder", "->", "root", "(", "$", "this", "->", "bundle", "->", "getAlias", "(", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/ResourceBundle/DependencyInjection/Extension/ResourceConfiguration.php#L48-L57
php-lug/lug
src/Bundle/ResourceBundle/DependencyInjection/Extension/ResourceConfiguration.php
ResourceConfiguration.createResourceNode
private function createResourceNode(ResourceInterface $resource, $name = null) { $resourceNode = $this->createNode($name ?: $resource->getName())->addDefaultsIfNotSet(); $childrenNode = $resourceNode->children() ->append($this->createClassNode( 'model', $r...
php
private function createResourceNode(ResourceInterface $resource, $name = null) { $resourceNode = $this->createNode($name ?: $resource->getName())->addDefaultsIfNotSet(); $childrenNode = $resourceNode->children() ->append($this->createClassNode( 'model', $r...
[ "private", "function", "createResourceNode", "(", "ResourceInterface", "$", "resource", ",", "$", "name", "=", "null", ")", "{", "$", "resourceNode", "=", "$", "this", "->", "createNode", "(", "$", "name", "?", ":", "$", "resource", "->", "getName", "(", ...
@param ResourceInterface $resource @param string|null $name @return ArrayNodeDefinition
[ "@param", "ResourceInterface", "$resource", "@param", "string|null", "$name" ]
train
https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/ResourceBundle/DependencyInjection/Extension/ResourceConfiguration.php#L87-L136
php-lug/lug
src/Bundle/ResourceBundle/DependencyInjection/Extension/ResourceConfiguration.php
ResourceConfiguration.createDriverNode
private function createDriverNode(ResourceInterface $resource) { $driverNode = $this->createNode('driver')->addDefaultsIfNotSet(); $driverNode->children() ->append($this->createNode('name', 'scalar', $resource->getDriver())) ->append($this->createNode('manager', 'scalar', $re...
php
private function createDriverNode(ResourceInterface $resource) { $driverNode = $this->createNode('driver')->addDefaultsIfNotSet(); $driverNode->children() ->append($this->createNode('name', 'scalar', $resource->getDriver())) ->append($this->createNode('manager', 'scalar', $re...
[ "private", "function", "createDriverNode", "(", "ResourceInterface", "$", "resource", ")", "{", "$", "driverNode", "=", "$", "this", "->", "createNode", "(", "'driver'", ")", "->", "addDefaultsIfNotSet", "(", ")", ";", "$", "driverNode", "->", "children", "(",...
@param ResourceInterface $resource @return ArrayNodeDefinition
[ "@param", "ResourceInterface", "$resource" ]
train
https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/ResourceBundle/DependencyInjection/Extension/ResourceConfiguration.php#L143-L152
php-lug/lug
src/Bundle/ResourceBundle/DependencyInjection/Extension/ResourceConfiguration.php
ResourceConfiguration.createDriverMappingNode
private function createDriverMappingNode(ResourceInterface $resource) { $mappingNode = $this->createNode('mapping')->addDefaultsIfNotSet(); $mappingNode->children() ->append($this->createNode('path', 'scalar', $resource->getDriverMappingPath())) ->append($this->createNode('fo...
php
private function createDriverMappingNode(ResourceInterface $resource) { $mappingNode = $this->createNode('mapping')->addDefaultsIfNotSet(); $mappingNode->children() ->append($this->createNode('path', 'scalar', $resource->getDriverMappingPath())) ->append($this->createNode('fo...
[ "private", "function", "createDriverMappingNode", "(", "ResourceInterface", "$", "resource", ")", "{", "$", "mappingNode", "=", "$", "this", "->", "createNode", "(", "'mapping'", ")", "->", "addDefaultsIfNotSet", "(", ")", ";", "$", "mappingNode", "->", "childre...
@param ResourceInterface $resource @return ArrayNodeDefinition
[ "@param", "ResourceInterface", "$resource" ]
train
https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/ResourceBundle/DependencyInjection/Extension/ResourceConfiguration.php#L159-L167
php-lug/lug
src/Bundle/ResourceBundle/DependencyInjection/Extension/ResourceConfiguration.php
ResourceConfiguration.createClassNode
private function createClassNode($name, $class, array $interfaces = [], $required = false) { return $this->createNode($name, 'scalar', $class, function ($class) use ($interfaces, $required) { if ($class === null) { return $required; } if (!class_exists($c...
php
private function createClassNode($name, $class, array $interfaces = [], $required = false) { return $this->createNode($name, 'scalar', $class, function ($class) use ($interfaces, $required) { if ($class === null) { return $required; } if (!class_exists($c...
[ "private", "function", "createClassNode", "(", "$", "name", ",", "$", "class", ",", "array", "$", "interfaces", "=", "[", "]", ",", "$", "required", "=", "false", ")", "{", "return", "$", "this", "->", "createNode", "(", "$", "name", ",", "'scalar'", ...
@param string $name @param string $class @param string[] $interfaces @param bool $required @return NodeDefinition
[ "@param", "string", "$name", "@param", "string", "$class", "@param", "string", "[]", "$interfaces", "@param", "bool", "$required" ]
train
https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/ResourceBundle/DependencyInjection/Extension/ResourceConfiguration.php#L177-L198
php-lug/lug
src/Bundle/ResourceBundle/DependencyInjection/Extension/ResourceConfiguration.php
ResourceConfiguration.createNode
private function createNode($name, $type = 'array', $default = null, $if = null, $then = null) { $node = $this->createTreeBuilder()->root($name, $type); if ($default !== null) { $node->defaultValue($default); } if ($if !== null && $then !== null) { $node->va...
php
private function createNode($name, $type = 'array', $default = null, $if = null, $then = null) { $node = $this->createTreeBuilder()->root($name, $type); if ($default !== null) { $node->defaultValue($default); } if ($if !== null && $then !== null) { $node->va...
[ "private", "function", "createNode", "(", "$", "name", ",", "$", "type", "=", "'array'", ",", "$", "default", "=", "null", ",", "$", "if", "=", "null", ",", "$", "then", "=", "null", ")", "{", "$", "node", "=", "$", "this", "->", "createTreeBuilder...
@param string $name @param string $type @param mixed $default @param callable|null $if @param string|null $then @return ArrayNodeDefinition|NodeDefinition
[ "@param", "string", "$name", "@param", "string", "$type", "@param", "mixed", "$default", "@param", "callable|null", "$if", "@param", "string|null", "$then" ]
train
https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/ResourceBundle/DependencyInjection/Extension/ResourceConfiguration.php#L209-L222
wenbinye/PhalconX
src/Di/FactoryDefault.php
FactoryDefault.autoload
public function autoload(array $autoloads, $provider, $options = []) { foreach ($autoloads as $name => $alias) { if (is_int($name)) { $name = $alias; } if (empty($name)) { throw new \InvalidArgumentException("Cannot not autoload empty servi...
php
public function autoload(array $autoloads, $provider, $options = []) { foreach ($autoloads as $name => $alias) { if (is_int($name)) { $name = $alias; } if (empty($name)) { throw new \InvalidArgumentException("Cannot not autoload empty servi...
[ "public", "function", "autoload", "(", "array", "$", "autoloads", ",", "$", "provider", ",", "$", "options", "=", "[", "]", ")", "{", "foreach", "(", "$", "autoloads", "as", "$", "name", "=>", "$", "alias", ")", "{", "if", "(", "is_int", "(", "$", ...
mark autoload service definition from service provider @param array $autoloads name of service. service alias @param string|ServiceProvider $provider service provider @param array options: shared, instances, prefix
[ "mark", "autoload", "service", "definition", "from", "service", "provider" ]
train
https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Di/FactoryDefault.php#L78-L108
wenbinye/PhalconX
src/Di/FactoryDefault.php
FactoryDefault.load
public function load($provider, $options = null) { if (!is_object($provider)) { $provider = $this->getShared($provider); } $names = $provider->getNames(); if (isset($options['aliases'])) { $services = $this->createServiceAliases($names, $options['aliases']); ...
php
public function load($provider, $options = null) { if (!is_object($provider)) { $provider = $this->getShared($provider); } $names = $provider->getNames(); if (isset($options['aliases'])) { $services = $this->createServiceAliases($names, $options['aliases']); ...
[ "public", "function", "load", "(", "$", "provider", ",", "$", "options", "=", "null", ")", "{", "if", "(", "!", "is_object", "(", "$", "provider", ")", ")", "{", "$", "provider", "=", "$", "this", "->", "getShared", "(", "$", "provider", ")", ";", ...
load all service definition from service provider @param string|ServiceProvider $provider service provider @param array $options non-shared service names - aliases - shared - instances - prefix
[ "load", "all", "service", "definition", "from", "service", "provider" ]
train
https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Di/FactoryDefault.php#L120-L133
nabab/bbn
src/bbn/appui/observer.php
observer.get_file
private static function get_file(): string { if ( null === self::$path ){ if ( \defined('BBN_DATA_PATH') ){ self::$path = BBN_DATA_PATH; } else{ self::$path = __DIR__.'/'; } } return self::$path.'plugins/appui-cron/appui-observer.txt'; }
php
private static function get_file(): string { if ( null === self::$path ){ if ( \defined('BBN_DATA_PATH') ){ self::$path = BBN_DATA_PATH; } else{ self::$path = __DIR__.'/'; } } return self::$path.'plugins/appui-cron/appui-observer.txt'; }
[ "private", "static", "function", "get_file", "(", ")", ":", "string", "{", "if", "(", "null", "===", "self", "::", "$", "path", ")", "{", "if", "(", "\\", "defined", "(", "'BBN_DATA_PATH'", ")", ")", "{", "self", "::", "$", "path", "=", "BBN_DATA_PAT...
Returns the observer txt file's full path. @return string
[ "Returns", "the", "observer", "txt", "file", "s", "full", "path", "." ]
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/observer.php#L48-L59
nabab/bbn
src/bbn/appui/observer.php
observer._exec
private function _exec($request, $params = null): ?string { if ( is_string($request) && bbn\str::is_json($request) ){ $request = json_decode($request, true); } if ( is_array($request) ){ return $this->_exec_array($request); } return $this->_exec_string($request, $params); }
php
private function _exec($request, $params = null): ?string { if ( is_string($request) && bbn\str::is_json($request) ){ $request = json_decode($request, true); } if ( is_array($request) ){ return $this->_exec_array($request); } return $this->_exec_string($request, $params); }
[ "private", "function", "_exec", "(", "$", "request", ",", "$", "params", "=", "null", ")", ":", "?", "string", "{", "if", "(", "is_string", "(", "$", "request", ")", "&&", "bbn", "\\", "str", "::", "is_json", "(", "$", "request", ")", ")", "{", "...
Executes a request (kept in the observer) and returns its (single) result. @param string $request The SQL Query to be executed. @param string|null $params The base64 encoded of a JSON string of the parameters to send with the query. @return mixed
[ "Executes", "a", "request", "(", "kept", "in", "the", "observer", ")", "and", "returns", "its", "(", "single", ")", "result", "." ]
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/observer.php#L68-L77
nabab/bbn
src/bbn/appui/observer.php
observer._exec_string
private function _exec_string(string $request, $params = null): ?string { if ( $this->check() ){ $res = !empty($params) ? $this->db->get_one($request, array_map('base64_decode', json_decode($params))) : $this->db->get_one($request); return md5((string)$res); } return null; }
php
private function _exec_string(string $request, $params = null): ?string { if ( $this->check() ){ $res = !empty($params) ? $this->db->get_one($request, array_map('base64_decode', json_decode($params))) : $this->db->get_one($request); return md5((string)$res); } return null; }
[ "private", "function", "_exec_string", "(", "string", "$", "request", ",", "$", "params", "=", "null", ")", ":", "?", "string", "{", "if", "(", "$", "this", "->", "check", "(", ")", ")", "{", "$", "res", "=", "!", "empty", "(", "$", "params", ")"...
Executes a request (kept in the observer) and returns its (single) result. @param string $request The SQL Query to be executed. @param string|null $params The base64 encoded of a JSON string of the parameters to send with the query. @return mixed
[ "Executes", "a", "request", "(", "kept", "in", "the", "observer", ")", "and", "returns", "its", "(", "single", ")", "result", "." ]
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/observer.php#L86-L93
nabab/bbn
src/bbn/appui/observer.php
observer._exec_array
private function _exec_array(array $request): ?string { if ( $this->check() ){ return md5((string)$this->db->select_one($request)); } return null; }
php
private function _exec_array(array $request): ?string { if ( $this->check() ){ return md5((string)$this->db->select_one($request)); } return null; }
[ "private", "function", "_exec_array", "(", "array", "$", "request", ")", ":", "?", "string", "{", "if", "(", "$", "this", "->", "check", "(", ")", ")", "{", "return", "md5", "(", "(", "string", ")", "$", "this", "->", "db", "->", "select_one", "(",...
Executes a request (kept in the observer as an array) and returns its (single) result. @param string $request The config to be executed. @return mixed
[ "Executes", "a", "request", "(", "kept", "in", "the", "observer", "as", "an", "array", ")", "and", "returns", "its", "(", "single", ")", "result", "." ]
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/observer.php#L101-L107
nabab/bbn
src/bbn/appui/observer.php
observer._get_id
private function _get_id(string $request, $params): ?string { if ( $this->check() ){ if ( $params ){ return $this->db->select_one('bbn_observers', 'id', [ 'id_string' => $this->_get_id_string($request, $params) ]); } return $this->db->get_one(" SELECT id ...
php
private function _get_id(string $request, $params): ?string { if ( $this->check() ){ if ( $params ){ return $this->db->select_one('bbn_observers', 'id', [ 'id_string' => $this->_get_id_string($request, $params) ]); } return $this->db->get_one(" SELECT id ...
[ "private", "function", "_get_id", "(", "string", "$", "request", ",", "$", "params", ")", ":", "?", "string", "{", "if", "(", "$", "this", "->", "check", "(", ")", ")", "{", "if", "(", "$", "params", ")", "{", "return", "$", "this", "->", "db", ...
Returns the ID of an observer with public = 1 and with similar request and params. @param string $request @param string $params @return null|string
[ "Returns", "the", "ID", "of", "an", "observer", "with", "public", "=", "1", "and", "with", "similar", "request", "and", "params", "." ]
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/observer.php#L121-L138
nabab/bbn
src/bbn/appui/observer.php
observer._get_id_from_user
private function _get_id_from_user(string $request, $params): ?string { if ( $this->id_user && $this->check() ){ $sql = ' SELECT `o`.`id` FROM bbn_observers AS `o` LEFT JOIN bbn_observers AS `ro` ON `o`.`id_alias` = `ro`.`id` WHERE `o`.`id_user` = ? AND ...
php
private function _get_id_from_user(string $request, $params): ?string { if ( $this->id_user && $this->check() ){ $sql = ' SELECT `o`.`id` FROM bbn_observers AS `o` LEFT JOIN bbn_observers AS `ro` ON `o`.`id_alias` = `ro`.`id` WHERE `o`.`id_user` = ? AND ...
[ "private", "function", "_get_id_from_user", "(", "string", "$", "request", ",", "$", "params", ")", ":", "?", "string", "{", "if", "(", "$", "this", "->", "id_user", "&&", "$", "this", "->", "check", "(", ")", ")", "{", "$", "sql", "=", "'\n S...
Returns the ID of an observer for the current user and with similar request and params. @param string $request @param string $params @return null|string
[ "Returns", "the", "ID", "of", "an", "observer", "for", "the", "current", "user", "and", "with", "similar", "request", "and", "params", "." ]
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/observer.php#L147-L174
nabab/bbn
src/bbn/appui/observer.php
observer._get_id_string
private function _get_id_string(string $request, string $params = null): string { return md5($request.($params ?: '')); }
php
private function _get_id_string(string $request, string $params = null): string { return md5($request.($params ?: '')); }
[ "private", "function", "_get_id_string", "(", "string", "$", "request", ",", "string", "$", "params", "=", "null", ")", ":", "string", "{", "return", "md5", "(", "$", "request", ".", "(", "$", "params", "?", ":", "''", ")", ")", ";", "}" ]
Returns the unique string representing the request + the parameters (md5 of concatenated strings). @param string $request @param array|null $params @return string
[ "Returns", "the", "unique", "string", "representing", "the", "request", "+", "the", "parameters", "(", "md5", "of", "concatenated", "strings", ")", "." ]
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/observer.php#L183-L186
nabab/bbn
src/bbn/appui/observer.php
observer._update_next
private function _update_next($id): bool { $id_alias = $this->db->select_one('bbn_observers', 'id_alias', ['id' => $id]); return $this->db->query(<<<MYSQL UPDATE bbn_observers SET next = NOW() + INTERVAL frequency SECOND WHERE id = ? MYSQL , hex2bin($id_alias ?: $id)) ? true : fa...
php
private function _update_next($id): bool { $id_alias = $this->db->select_one('bbn_observers', 'id_alias', ['id' => $id]); return $this->db->query(<<<MYSQL UPDATE bbn_observers SET next = NOW() + INTERVAL frequency SECOND WHERE id = ? MYSQL , hex2bin($id_alias ?: $id)) ? true : fa...
[ "private", "function", "_update_next", "(", "$", "id", ")", ":", "bool", "{", "$", "id_alias", "=", "$", "this", "->", "db", "->", "select_one", "(", "'bbn_observers'", ",", "'id_alias'", ",", "[", "'id'", "=>", "$", "id", "]", ")", ";", "return", "$...
Sets the time of next execution in the observer's main row. @param $id @return bbn\db\query|int
[ "Sets", "the", "time", "of", "next", "execution", "in", "the", "observer", "s", "main", "row", "." ]
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/observer.php#L194-L204
nabab/bbn
src/bbn/appui/observer.php
observer.check_result
public function check_result($id) { if ( $d = $this->get($id) ){ $t = new bbn\util\timer(); $t->start(); $res = $this->_exec($d['request'], $d['params']); $duration = (int)ceil($t->stop() * 1000); if ( $res !== $d['result'] ){ $this->db->update('bbn_observers', [ 'r...
php
public function check_result($id) { if ( $d = $this->get($id) ){ $t = new bbn\util\timer(); $t->start(); $res = $this->_exec($d['request'], $d['params']); $duration = (int)ceil($t->stop() * 1000); if ( $res !== $d['result'] ){ $this->db->update('bbn_observers', [ 'r...
[ "public", "function", "check_result", "(", "$", "id", ")", "{", "if", "(", "$", "d", "=", "$", "this", "->", "get", "(", "$", "id", ")", ")", "{", "$", "t", "=", "new", "bbn", "\\", "util", "\\", "timer", "(", ")", ";", "$", "t", "->", "sta...
Confronts the current result with the one kept in database. @param $id @return bool
[ "Confronts", "the", "current", "result", "with", "the", "one", "kept", "in", "database", "." ]
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/observer.php#L223-L241
nabab/bbn
src/bbn/appui/observer.php
observer.add
public function add(array $cfg): ?string { if ( $this->id_user && (null !== $cfg['request']) && $this->check() ){ $t = new bbn\util\timer(); $t->start(); if ( is_string($cfg['request']) ){ $params = self::sanitize_params($cfg['params'] ?? []); $request = tri...
php
public function add(array $cfg): ?string { if ( $this->id_user && (null !== $cfg['request']) && $this->check() ){ $t = new bbn\util\timer(); $t->start(); if ( is_string($cfg['request']) ){ $params = self::sanitize_params($cfg['params'] ?? []); $request = tri...
[ "public", "function", "add", "(", "array", "$", "cfg", ")", ":", "?", "string", "{", "if", "(", "$", "this", "->", "id_user", "&&", "(", "null", "!==", "$", "cfg", "[", "'request'", "]", ")", "&&", "$", "this", "->", "check", "(", ")", ")", "{"...
Adds a new observer and returns its id or the id of an existing one. @param array $cfg @return null|string
[ "Adds", "a", "new", "observer", "and", "returns", "its", "id", "or", "the", "id", "of", "an", "existing", "one", "." ]
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/observer.php#L249-L324
nabab/bbn
src/bbn/appui/observer.php
observer.get
public function get($id): ?array { if ( $this->check() ){ $d = $this->db->rselect('bbn_observers', [], [ 'id' => $id ]); if ( !$d['id_alias'] ){ return $d; } $alias = $this->db->rselect('bbn_observers', [], [ 'id' => $d['id_alias'] ]); $alias['id']...
php
public function get($id): ?array { if ( $this->check() ){ $d = $this->db->rselect('bbn_observers', [], [ 'id' => $id ]); if ( !$d['id_alias'] ){ return $d; } $alias = $this->db->rselect('bbn_observers', [], [ 'id' => $d['id_alias'] ]); $alias['id']...
[ "public", "function", "get", "(", "$", "id", ")", ":", "?", "array", "{", "if", "(", "$", "this", "->", "check", "(", ")", ")", "{", "$", "d", "=", "$", "this", "->", "db", "->", "rselect", "(", "'bbn_observers'", ",", "[", "]", ",", "[", "'i...
Returns an observer with its alias properties if there is one (except id and result). @param $id @return array|null
[ "Returns", "an", "observer", "with", "its", "alias", "properties", "if", "there", "is", "one", "(", "except", "id", "and", "result", ")", "." ]
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/observer.php#L332-L350
nabab/bbn
src/bbn/appui/observer.php
observer.user_delete
public function user_delete($id): int { if ( property_exists($this, 'user') && $this->check() ){ return $this->db->delete('bbn_observers', ['id' => $id, 'id_user' => $this->user]); } return 0; }
php
public function user_delete($id): int { if ( property_exists($this, 'user') && $this->check() ){ return $this->db->delete('bbn_observers', ['id' => $id, 'id_user' => $this->user]); } return 0; }
[ "public", "function", "user_delete", "(", "$", "id", ")", ":", "int", "{", "if", "(", "property_exists", "(", "$", "this", ",", "'user'", ")", "&&", "$", "this", "->", "check", "(", ")", ")", "{", "return", "$", "this", "->", "db", "->", "delete", ...
Deletes the given observer for the current user @param string $id @return int
[ "Deletes", "the", "given", "observer", "for", "the", "current", "user" ]
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/observer.php#L403-L409
nabab/bbn
src/bbn/appui/observer.php
observer.observe
public function observe() { if ( $this->check() ){ $sql = <<<MYSQL SELECT o.id, o.id_user, o.request, o.params, GROUP_CONCAT(HEX(aliases.id) SEPARATOR ',') AS aliases, GROUP_CONCAT(HEX(aliases.id_user) SEPARATOR ',') AS users, GROUP_CONCAT(aliases.result SEPARATOR ',') AS results FROM bbn_observer...
php
public function observe() { if ( $this->check() ){ $sql = <<<MYSQL SELECT o.id, o.id_user, o.request, o.params, GROUP_CONCAT(HEX(aliases.id) SEPARATOR ',') AS aliases, GROUP_CONCAT(HEX(aliases.id_user) SEPARATOR ',') AS users, GROUP_CONCAT(aliases.result SEPARATOR ',') AS results FROM bbn_observer...
[ "public", "function", "observe", "(", ")", "{", "if", "(", "$", "this", "->", "check", "(", ")", ")", "{", "$", "sql", "=", " <<<MYSQL\n SELECT o.id, o.id_user, o.request, o.params,\n GROUP_CONCAT(HEX(aliases.id) SEPARATOR ',') AS aliases,\n GROUP_CONCAT(HEX(aliases.id_user)...
Checks the observers, execute their requests every given interval, it will stop when it finds differences in the results, and returns the observers to be updated (meant to be executed from a cron task). @return array
[ "Checks", "the", "observers", "execute", "their", "requests", "every", "given", "interval", "it", "will", "stop", "when", "it", "finds", "differences", "in", "the", "results", "and", "returns", "the", "observers", "to", "be", "updated", "(", "meant", "to", "...
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/observer.php#L417-L493
technote-space/wordpress-plugin-base
src/classes/models/lib/define.php
Define.initialize
protected function initialize() { $this->plugin_name = $this->app->plugin_name; $this->plugin_file = $this->app->plugin_file; $this->plugin_namespace = ucwords( $this->plugin_name, '_' ); $this->plugin_dir = dirname( $this->plugin_file ); $this->plugin_dir_name = basename( $this->plugin_dir ); $this...
php
protected function initialize() { $this->plugin_name = $this->app->plugin_name; $this->plugin_file = $this->app->plugin_file; $this->plugin_namespace = ucwords( $this->plugin_name, '_' ); $this->plugin_dir = dirname( $this->plugin_file ); $this->plugin_dir_name = basename( $this->plugin_dir ); $this...
[ "protected", "function", "initialize", "(", ")", "{", "$", "this", "->", "plugin_name", "=", "$", "this", "->", "app", "->", "plugin_name", ";", "$", "this", "->", "plugin_file", "=", "$", "this", "->", "app", "->", "plugin_file", ";", "$", "this", "->...
initialize @since 2.1.0 Changed: load textdomain from plugin data @since 2.10.1 Improved: for theme (#115)
[ "initialize" ]
train
https://github.com/technote-space/wordpress-plugin-base/blob/02cfcba358432a2539af07a69d9db00ff7c14eac/src/classes/models/lib/define.php#L109-L167
odiaseo/pagebuilder
src/PageBuilder/View/Helper/PageBuilder.php
PageBuilder.init
public function init($pageId, Navigation $menuTree = null, AbstractEntity $activeSiteTheme = null) { if ($this->getOptions()->getEnabled()) { /** @var PageTemplateModel $templateModel */ /** @var PageModel $pageModel */ /** @var LayoutService $layoutService */ ...
php
public function init($pageId, Navigation $menuTree = null, AbstractEntity $activeSiteTheme = null) { if ($this->getOptions()->getEnabled()) { /** @var PageTemplateModel $templateModel */ /** @var PageModel $pageModel */ /** @var LayoutService $layoutService */ ...
[ "public", "function", "init", "(", "$", "pageId", ",", "Navigation", "$", "menuTree", "=", "null", ",", "AbstractEntity", "$", "activeSiteTheme", "=", "null", ")", "{", "if", "(", "$", "this", "->", "getOptions", "(", ")", "->", "getEnabled", "(", ")", ...
Prepare page data and widgets Get the active site theme and find a layout for the the current page that matches the site theme If not layout is found, use the template assigned to the page if set @param int $pageId @param Navigation $menuTree @param AbstractEntity $activeSiteTheme @return $this
[ "Prepare", "page", "data", "and", "widgets", "Get", "the", "active", "site", "theme", "and", "find", "a", "layout", "for", "the", "the", "current", "page", "that", "matches", "the", "site", "theme", "If", "not", "layout", "is", "found", "use", "the", "te...
train
https://github.com/odiaseo/pagebuilder/blob/88ef7cccf305368561307efe4ca07fac8e5774f3/src/PageBuilder/View/Helper/PageBuilder.php#L77-L150
odiaseo/pagebuilder
src/PageBuilder/View/Helper/PageBuilder.php
PageBuilder.getItem
protected function getItem($itemType, $itemId, TagAttributes $attr) { $data = ''; switch ($itemType) { case self::LAYOUT_WIDGET: try { /** @var $data \PageBuilder\BaseWidget */ $widgetName = $itemId . WidgetFactory::WIDGE...
php
protected function getItem($itemType, $itemId, TagAttributes $attr) { $data = ''; switch ($itemType) { case self::LAYOUT_WIDGET: try { /** @var $data \PageBuilder\BaseWidget */ $widgetName = $itemId . WidgetFactory::WIDGE...
[ "protected", "function", "getItem", "(", "$", "itemType", ",", "$", "itemId", ",", "TagAttributes", "$", "attr", ")", "{", "$", "data", "=", "''", ";", "switch", "(", "$", "itemType", ")", "{", "case", "self", "::", "LAYOUT_WIDGET", ":", "try", "{", ...
@param $itemType @param $itemId @param TagAttributes $attr @return object @throws RuntimeException
[ "@param", "$itemType", "@param", "$itemId", "@param", "TagAttributes", "$attr" ]
train
https://github.com/odiaseo/pagebuilder/blob/88ef7cccf305368561307efe4ca07fac8e5774f3/src/PageBuilder/View/Helper/PageBuilder.php#L259-L325
odiaseo/pagebuilder
src/PageBuilder/View/Helper/PageBuilder.php
PageBuilder.applyFormats
protected function applyFormats($data) { if ($this->getOptions()->getOutputFormatters()) { foreach ($this->getOptions()->getOutputFormatters() as $formatter) { if ($formatter instanceof FormatterInterface) { /** @var $formatter \PageBuilder\FormatterInt...
php
protected function applyFormats($data) { if ($this->getOptions()->getOutputFormatters()) { foreach ($this->getOptions()->getOutputFormatters() as $formatter) { if ($formatter instanceof FormatterInterface) { /** @var $formatter \PageBuilder\FormatterInt...
[ "protected", "function", "applyFormats", "(", "$", "data", ")", "{", "if", "(", "$", "this", "->", "getOptions", "(", ")", "->", "getOutputFormatters", "(", ")", ")", "{", "foreach", "(", "$", "this", "->", "getOptions", "(", ")", "->", "getOutputFormatt...
Apply formatter using the formatters in the order they were defined @param $data @return string
[ "Apply", "formatter", "using", "the", "formatters", "in", "the", "order", "they", "were", "defined" ]
train
https://github.com/odiaseo/pagebuilder/blob/88ef7cccf305368561307efe4ca07fac8e5774f3/src/PageBuilder/View/Helper/PageBuilder.php#L334-L349
odiaseo/pagebuilder
src/PageBuilder/View/Helper/PageBuilder.php
PageBuilder.setServiceLocator
public function setServiceLocator(ServiceLocatorInterface $serviceLocator) { /** @var ServiceManager $serviceLocator */ $this->serviceManager = $serviceLocator; $this->serviceManager->setAllowOverride(true); $this->setPluginManager($serviceLocator); return $this; ...
php
public function setServiceLocator(ServiceLocatorInterface $serviceLocator) { /** @var ServiceManager $serviceLocator */ $this->serviceManager = $serviceLocator; $this->serviceManager->setAllowOverride(true); $this->setPluginManager($serviceLocator); return $this; ...
[ "public", "function", "setServiceLocator", "(", "ServiceLocatorInterface", "$", "serviceLocator", ")", "{", "/** @var ServiceManager $serviceLocator */", "$", "this", "->", "serviceManager", "=", "$", "serviceLocator", ";", "$", "this", "->", "serviceManager", "->", "se...
@param ServiceLocatorInterface $serviceLocator @return $this
[ "@param", "ServiceLocatorInterface", "$serviceLocator" ]
train
https://github.com/odiaseo/pagebuilder/blob/88ef7cccf305368561307efe4ca07fac8e5774f3/src/PageBuilder/View/Helper/PageBuilder.php#L378-L386
odiaseo/pagebuilder
src/PageBuilder/View/Helper/PageBuilder.php
PageBuilder.getTopBottomContainers
protected function getTopBottomContainers(TagAttributes $attr, $section = '') { $top = $bottom = ''; if ($wrapper = $attr->getWrapper()) { /** @var $microDataHelper MicroData */ $microDataHelper = $this->pluginManager->get('microData'); switch ($section) {...
php
protected function getTopBottomContainers(TagAttributes $attr, $section = '') { $top = $bottom = ''; if ($wrapper = $attr->getWrapper()) { /** @var $microDataHelper MicroData */ $microDataHelper = $this->pluginManager->get('microData'); switch ($section) {...
[ "protected", "function", "getTopBottomContainers", "(", "TagAttributes", "$", "attr", ",", "$", "section", "=", "''", ")", "{", "$", "top", "=", "$", "bottom", "=", "''", ";", "if", "(", "$", "wrapper", "=", "$", "attr", "->", "getWrapper", "(", ")", ...
@param TagAttributes $attr @param TagAttributes $attr @param string $section @return array
[ "@param", "TagAttributes", "$attr", "@param", "TagAttributes", "$attr", "@param", "string", "$section" ]
train
https://github.com/odiaseo/pagebuilder/blob/88ef7cccf305368561307efe4ca07fac8e5774f3/src/PageBuilder/View/Helper/PageBuilder.php#L405-L453
odiaseo/pagebuilder
src/PageBuilder/View/Helper/PageBuilder.php
PageBuilder.isShared
private function isShared($options) { if (!array_key_exists(self::SHARE_KEY, $options)) { return true; } if (is_bool($options[self::SHARE_KEY])) { return $options[self::SHARE_KEY]; } if (is_numeric($options[self::SHARE_KEY])) { $...
php
private function isShared($options) { if (!array_key_exists(self::SHARE_KEY, $options)) { return true; } if (is_bool($options[self::SHARE_KEY])) { return $options[self::SHARE_KEY]; } if (is_numeric($options[self::SHARE_KEY])) { $...
[ "private", "function", "isShared", "(", "$", "options", ")", "{", "if", "(", "!", "array_key_exists", "(", "self", "::", "SHARE_KEY", ",", "$", "options", ")", ")", "{", "return", "true", ";", "}", "if", "(", "is_bool", "(", "$", "options", "[", "sel...
@param $options @return bool
[ "@param", "$options" ]
train
https://github.com/odiaseo/pagebuilder/blob/88ef7cccf305368561307efe4ca07fac8e5774f3/src/PageBuilder/View/Helper/PageBuilder.php#L476-L496
odiaseo/pagebuilder
src/PageBuilder/View/Helper/PageBuilder.php
PageBuilder.transform
protected function transform($class) { if ($this->options->getBootstrapVersion() > 2) { foreach ($this->options->getCssClassmap() as $search => $replace) { $pattern = '/' . $search . '/i'; if (preg_match($pattern, $class, $matches)) { $do...
php
protected function transform($class) { if ($this->options->getBootstrapVersion() > 2) { foreach ($this->options->getCssClassmap() as $search => $replace) { $pattern = '/' . $search . '/i'; if (preg_match($pattern, $class, $matches)) { $do...
[ "protected", "function", "transform", "(", "$", "class", ")", "{", "if", "(", "$", "this", "->", "options", "->", "getBootstrapVersion", "(", ")", ">", "2", ")", "{", "foreach", "(", "$", "this", "->", "options", "->", "getCssClassmap", "(", ")", "as",...
@param $class @return mixed
[ "@param", "$class" ]
train
https://github.com/odiaseo/pagebuilder/blob/88ef7cccf305368561307efe4ca07fac8e5774f3/src/PageBuilder/View/Helper/PageBuilder.php#L503-L517
lokhman/silex-tools
src/Silex/Application/ToolsTrait.php
ToolsTrait.redirectToRoute
public function redirectToRoute($route, array $parameters = [], $status = 302) { return new RedirectResponse($this['url_generator']->generate($route, $parameters), $status); }
php
public function redirectToRoute($route, array $parameters = [], $status = 302) { return new RedirectResponse($this['url_generator']->generate($route, $parameters), $status); }
[ "public", "function", "redirectToRoute", "(", "$", "route", ",", "array", "$", "parameters", "=", "[", "]", ",", "$", "status", "=", "302", ")", "{", "return", "new", "RedirectResponse", "(", "$", "this", "[", "'url_generator'", "]", "->", "generate", "(...
Redirects the user to route with the given parameters. @param string $route The name of the route @param mixed $parameters An array of parameters @param int $status The status code (302 by default) @return RedirectResponse
[ "Redirects", "the", "user", "to", "route", "with", "the", "given", "parameters", "." ]
train
https://github.com/lokhman/silex-tools/blob/91e84099479beb4e866abc88a55ed1e457a8a9e9/src/Silex/Application/ToolsTrait.php#L54-L57
lokhman/silex-tools
src/Silex/Application/ToolsTrait.php
ToolsTrait.forward
public function forward($uri, $method, array $parameters = []) { $request = Request::create($uri, $method, $parameters); return $this->handle($request, HttpKernelInterface::SUB_REQUEST); }
php
public function forward($uri, $method, array $parameters = []) { $request = Request::create($uri, $method, $parameters); return $this->handle($request, HttpKernelInterface::SUB_REQUEST); }
[ "public", "function", "forward", "(", "$", "uri", ",", "$", "method", ",", "array", "$", "parameters", "=", "[", "]", ")", "{", "$", "request", "=", "Request", "::", "create", "(", "$", "uri", ",", "$", "method", ",", "$", "parameters", ")", ";", ...
Forward the request to another controller by the URI. @param string $uri @param string $method @param array $parameters @return Symfony\Component\HttpFoundation\Response
[ "Forward", "the", "request", "to", "another", "controller", "by", "the", "URI", "." ]
train
https://github.com/lokhman/silex-tools/blob/91e84099479beb4e866abc88a55ed1e457a8a9e9/src/Silex/Application/ToolsTrait.php#L68-L73
lokhman/silex-tools
src/Silex/Application/ToolsTrait.php
ToolsTrait.forwardToRoute
public function forwardToRoute($route, $method, array $parameters = []) { return $this->forward($this['url_generator']->generate($route, $parameters), $method); }
php
public function forwardToRoute($route, $method, array $parameters = []) { return $this->forward($this['url_generator']->generate($route, $parameters), $method); }
[ "public", "function", "forwardToRoute", "(", "$", "route", ",", "$", "method", ",", "array", "$", "parameters", "=", "[", "]", ")", "{", "return", "$", "this", "->", "forward", "(", "$", "this", "[", "'url_generator'", "]", "->", "generate", "(", "$", ...
Forward the request to another controller by the route name. @param string $route @param string $method @param array $parameters @return Symfony\Component\HttpFoundation\Response
[ "Forward", "the", "request", "to", "another", "controller", "by", "the", "route", "name", "." ]
train
https://github.com/lokhman/silex-tools/blob/91e84099479beb4e866abc88a55ed1e457a8a9e9/src/Silex/Application/ToolsTrait.php#L84-L87
sabre-io/cs
lib/ControlSpaces.php
ControlSpaces.fix
function fix(\SplFileInfo $file, $content) { $tokens = Tokens::fromCode($content); $controlStructureTokens = $this->getControlStructureTokens(); foreach ($tokens as $index => $token) { // looking for start brace if (!$token->equals('(')) { continue;...
php
function fix(\SplFileInfo $file, $content) { $tokens = Tokens::fromCode($content); $controlStructureTokens = $this->getControlStructureTokens(); foreach ($tokens as $index => $token) { // looking for start brace if (!$token->equals('(')) { continue;...
[ "function", "fix", "(", "\\", "SplFileInfo", "$", "file", ",", "$", "content", ")", "{", "$", "tokens", "=", "Tokens", "::", "fromCode", "(", "$", "content", ")", ";", "$", "controlStructureTokens", "=", "$", "this", "->", "getControlStructureTokens", "(",...
{@inheritdoc}
[ "{" ]
train
https://github.com/sabre-io/cs/blob/a4c57e213bf3f5e7d6b29a2f70d1ca4b0dce6d86/lib/ControlSpaces.php#L45-L72
sabre-io/cs
lib/ControlSpaces.php
ControlSpaces.fixControlStructure
private function fixControlStructure(Tokens $tokens, $index) { // Ensure a single whitespace if (!$tokens[$index - 1]->isWhitespace() || $tokens[$index - 1]->isWhitespace($this->singleLineWhitespaceOptions)) { $tokens->ensureWhitespaceAtIndex($index - 1, 1, ' '); } }
php
private function fixControlStructure(Tokens $tokens, $index) { // Ensure a single whitespace if (!$tokens[$index - 1]->isWhitespace() || $tokens[$index - 1]->isWhitespace($this->singleLineWhitespaceOptions)) { $tokens->ensureWhitespaceAtIndex($index - 1, 1, ' '); } }
[ "private", "function", "fixControlStructure", "(", "Tokens", "$", "tokens", ",", "$", "index", ")", "{", "// Ensure a single whitespace", "if", "(", "!", "$", "tokens", "[", "$", "index", "-", "1", "]", "->", "isWhitespace", "(", ")", "||", "$", "tokens", ...
Fixes whitespaces around braces of a control structure. @param Tokens $tokens tokens to handle @param int $index index of token
[ "Fixes", "whitespaces", "around", "braces", "of", "a", "control", "structure", "." ]
train
https://github.com/sabre-io/cs/blob/a4c57e213bf3f5e7d6b29a2f70d1ca4b0dce6d86/lib/ControlSpaces.php#L88-L95
sabre-io/cs
lib/ControlSpaces.php
ControlSpaces.getControlStructureTokens
private function getControlStructureTokens() { static $tokens = null; if (null === $tokens) { $tokens = [ T_IF, T_ELSEIF, T_FOR, T_FOREACH, T_WHILE, T_DO, T_CATCH, ...
php
private function getControlStructureTokens() { static $tokens = null; if (null === $tokens) { $tokens = [ T_IF, T_ELSEIF, T_FOR, T_FOREACH, T_WHILE, T_DO, T_CATCH, ...
[ "private", "function", "getControlStructureTokens", "(", ")", "{", "static", "$", "tokens", "=", "null", ";", "if", "(", "null", "===", "$", "tokens", ")", "{", "$", "tokens", "=", "[", "T_IF", ",", "T_ELSEIF", ",", "T_FOR", ",", "T_FOREACH", ",", "T_W...
Gets the name of control structure tokens. @staticvar string[] $tokens Token names. @return string[] Token names.
[ "Gets", "the", "name", "of", "control", "structure", "tokens", "." ]
train
https://github.com/sabre-io/cs/blob/a4c57e213bf3f5e7d6b29a2f70d1ca4b0dce6d86/lib/ControlSpaces.php#L104-L123
php-lug/lug
src/Bundle/ResourceBundle/DependencyInjection/Compiler/RegisterResourcePass.php
RegisterResourcePass.process
public function process(ContainerBuilder $container) { $registry = $container->getDefinition('lug.resource.registry'); foreach (array_keys($container->findTaggedServiceIds('lug.resource')) as $resource) { $registry->addMethodCall('offsetSet', [ $container->getDefinition(...
php
public function process(ContainerBuilder $container) { $registry = $container->getDefinition('lug.resource.registry'); foreach (array_keys($container->findTaggedServiceIds('lug.resource')) as $resource) { $registry->addMethodCall('offsetSet', [ $container->getDefinition(...
[ "public", "function", "process", "(", "ContainerBuilder", "$", "container", ")", "{", "$", "registry", "=", "$", "container", "->", "getDefinition", "(", "'lug.resource.registry'", ")", ";", "foreach", "(", "array_keys", "(", "$", "container", "->", "findTaggedS...
{@inheritdoc}
[ "{" ]
train
https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/ResourceBundle/DependencyInjection/Compiler/RegisterResourcePass.php#L26-L36
blast-project/BaseEntitiesBundle
src/Entity/Traits/Addressable.php
Addressable.getFulltextAddress
public function getFulltextAddress($separator = "\n") { $elems = []; if ($this->address) { $elems[] = $this->address; } $zip_city = []; if ($this->zip) { $zip_city[] = $this->zip; } if ($this->city) { $zip_city[] = $this->ci...
php
public function getFulltextAddress($separator = "\n") { $elems = []; if ($this->address) { $elems[] = $this->address; } $zip_city = []; if ($this->zip) { $zip_city[] = $this->zip; } if ($this->city) { $zip_city[] = $this->ci...
[ "public", "function", "getFulltextAddress", "(", "$", "separator", "=", "\"\\n\"", ")", "{", "$", "elems", "=", "[", "]", ";", "if", "(", "$", "this", "->", "address", ")", "{", "$", "elems", "[", "]", "=", "$", "this", "->", "address", ";", "}", ...
@param string $separator @return string
[ "@param", "string", "$separator" ]
train
https://github.com/blast-project/BaseEntitiesBundle/blob/abd06891fc38922225ab7e4fcb437a286ba2c0c4/src/Entity/Traits/Addressable.php#L199-L221
AOEpeople/Aoe_Layout
app/code/local/Aoe/Layout/Block/Widget/Tabs.php
Aoe_Layout_Block_Widget_Tabs.addTab
public function addTab($tabId, $tab) { parent::addTab($tabId, $tab); if ($this->_tabs[$tabId] instanceof Mage_Core_Block_Abstract && $this->_tabs[$tabId]->getParentBlock() === null) { $this->append($this->_tabs[$tabId]); } return $this; }
php
public function addTab($tabId, $tab) { parent::addTab($tabId, $tab); if ($this->_tabs[$tabId] instanceof Mage_Core_Block_Abstract && $this->_tabs[$tabId]->getParentBlock() === null) { $this->append($this->_tabs[$tabId]); } return $this; }
[ "public", "function", "addTab", "(", "$", "tabId", ",", "$", "tab", ")", "{", "parent", "::", "addTab", "(", "$", "tabId", ",", "$", "tab", ")", ";", "if", "(", "$", "this", "->", "_tabs", "[", "$", "tabId", "]", "instanceof", "Mage_Core_Block_Abstra...
Add new tab @param string $tabId @param array|Varien_Object $tab @return Mage_Adminhtml_Block_Widget_Tabs
[ "Add", "new", "tab" ]
train
https://github.com/AOEpeople/Aoe_Layout/blob/d88ba3406cf12dbaf09548477133c3cb27d155ed/app/code/local/Aoe/Layout/Block/Widget/Tabs.php#L15-L24
NuclearCMS/Hierarchy
src/Builders/MigrationBuilder.php
MigrationBuilder.buildSourceTableMigration
public function buildSourceTableMigration($name) { $path = $this->getMigrationPath($name); $migration = $this->getTableMigrationName($name); $contents = view('_hierarchy::migrations.table', [ 'table' => source_table_name($name), 'migration' => $migration ...
php
public function buildSourceTableMigration($name) { $path = $this->getMigrationPath($name); $migration = $this->getTableMigrationName($name); $contents = view('_hierarchy::migrations.table', [ 'table' => source_table_name($name), 'migration' => $migration ...
[ "public", "function", "buildSourceTableMigration", "(", "$", "name", ")", "{", "$", "path", "=", "$", "this", "->", "getMigrationPath", "(", "$", "name", ")", ";", "$", "migration", "=", "$", "this", "->", "getTableMigrationName", "(", "$", "name", ")", ...
Builds a source table migration @param string $name @return string
[ "Builds", "a", "source", "table", "migration" ]
train
https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/Builders/MigrationBuilder.php#L81-L94
NuclearCMS/Hierarchy
src/Builders/MigrationBuilder.php
MigrationBuilder.destroySourceTableMigration
public function destroySourceTableMigration($name, array $fields) { $path = $this->getMigrationPath($name); $this->delete($path); foreach ($fields as $field) { $this->destroyFieldMigrationForTable($field, $name); } }
php
public function destroySourceTableMigration($name, array $fields) { $path = $this->getMigrationPath($name); $this->delete($path); foreach ($fields as $field) { $this->destroyFieldMigrationForTable($field, $name); } }
[ "public", "function", "destroySourceTableMigration", "(", "$", "name", ",", "array", "$", "fields", ")", "{", "$", "path", "=", "$", "this", "->", "getMigrationPath", "(", "$", "name", ")", ";", "$", "this", "->", "delete", "(", "$", "path", ")", ";", ...
Destroy a source table migration @param string $name @param array $fields
[ "Destroy", "a", "source", "table", "migration" ]
train
https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/Builders/MigrationBuilder.php#L102-L112
NuclearCMS/Hierarchy
src/Builders/MigrationBuilder.php
MigrationBuilder.buildFieldMigrationForTable
public function buildFieldMigrationForTable($name, $type, $indexed, $tableName) { $path = $this->getMigrationPath($tableName, $name); $migration = $this->getTableFieldMigrationName($name, $tableName); $contents = view('_hierarchy::migrations.field', [ 'field' => $name, ...
php
public function buildFieldMigrationForTable($name, $type, $indexed, $tableName) { $path = $this->getMigrationPath($tableName, $name); $migration = $this->getTableFieldMigrationName($name, $tableName); $contents = view('_hierarchy::migrations.field', [ 'field' => $name, ...
[ "public", "function", "buildFieldMigrationForTable", "(", "$", "name", ",", "$", "type", ",", "$", "indexed", ",", "$", "tableName", ")", "{", "$", "path", "=", "$", "this", "->", "getMigrationPath", "(", "$", "tableName", ",", "$", "name", ")", ";", "...
Builds a field migration for a table @param string $name @param string $type @param bool $indexed @param string $tableName @return string
[ "Builds", "a", "field", "migration", "for", "a", "table" ]
train
https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/Builders/MigrationBuilder.php#L123-L139
NuclearCMS/Hierarchy
src/Builders/MigrationBuilder.php
MigrationBuilder.destroyFieldMigrationForTable
public function destroyFieldMigrationForTable($name, $tableName) { $path = $this->getMigrationPath($tableName, $name); $this->delete($path); }
php
public function destroyFieldMigrationForTable($name, $tableName) { $path = $this->getMigrationPath($tableName, $name); $this->delete($path); }
[ "public", "function", "destroyFieldMigrationForTable", "(", "$", "name", ",", "$", "tableName", ")", "{", "$", "path", "=", "$", "this", "->", "getMigrationPath", "(", "$", "tableName", ",", "$", "name", ")", ";", "$", "this", "->", "delete", "(", "$", ...
Destroys a field migration for a table @param string $name @param string $tableName
[ "Destroys", "a", "field", "migration", "for", "a", "table" ]
train
https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/Builders/MigrationBuilder.php#L147-L152
NuclearCMS/Hierarchy
src/Builders/MigrationBuilder.php
MigrationBuilder.getTableFieldMigrationName
public function getTableFieldMigrationName($name, $tableName) { return sprintf( MigrationBuilder::PATTERN_FIELD, ucfirst($name), ucfirst($tableName) ); }
php
public function getTableFieldMigrationName($name, $tableName) { return sprintf( MigrationBuilder::PATTERN_FIELD, ucfirst($name), ucfirst($tableName) ); }
[ "public", "function", "getTableFieldMigrationName", "(", "$", "name", ",", "$", "tableName", ")", "{", "return", "sprintf", "(", "MigrationBuilder", "::", "PATTERN_FIELD", ",", "ucfirst", "(", "$", "name", ")", ",", "ucfirst", "(", "$", "tableName", ")", ")"...
Returns the migration name for a field in table @param string $name @param string $tableName @return string
[ "Returns", "the", "migration", "name", "for", "a", "field", "in", "table" ]
train
https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/Builders/MigrationBuilder.php#L175-L182
NuclearCMS/Hierarchy
src/Builders/MigrationBuilder.php
MigrationBuilder.getMigrationPath
public function getMigrationPath($table, $field = null) { $name = is_null($field) ? $this->getTableMigrationName($table) : $this->getTableFieldMigrationName($field, $table); return sprintf( $this->getBasePath() . '/%s.php', $name); }
php
public function getMigrationPath($table, $field = null) { $name = is_null($field) ? $this->getTableMigrationName($table) : $this->getTableFieldMigrationName($field, $table); return sprintf( $this->getBasePath() . '/%s.php', $name); }
[ "public", "function", "getMigrationPath", "(", "$", "table", ",", "$", "field", "=", "null", ")", "{", "$", "name", "=", "is_null", "(", "$", "field", ")", "?", "$", "this", "->", "getTableMigrationName", "(", "$", "table", ")", ":", "$", "this", "->...
Returns the path for the migration @param string $table @param string|null $field @return string
[ "Returns", "the", "path", "for", "the", "migration" ]
train
https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/Builders/MigrationBuilder.php#L201-L210
NuclearCMS/Hierarchy
src/Builders/MigrationBuilder.php
MigrationBuilder.getMigrationClassPathByKey
public function getMigrationClassPathByKey($table, $field = null) { $name = is_null($field) ? $this->getTableMigrationName($table) : $this->getTableFieldMigrationName($field, $table); return $this->getMigrationClassPath($name); }
php
public function getMigrationClassPathByKey($table, $field = null) { $name = is_null($field) ? $this->getTableMigrationName($table) : $this->getTableFieldMigrationName($field, $table); return $this->getMigrationClassPath($name); }
[ "public", "function", "getMigrationClassPathByKey", "(", "$", "table", ",", "$", "field", "=", "null", ")", "{", "$", "name", "=", "is_null", "(", "$", "field", ")", "?", "$", "this", "->", "getTableMigrationName", "(", "$", "table", ")", ":", "$", "th...
Returns the migration class path by key @param string $table @param string|null $field @return string
[ "Returns", "the", "migration", "class", "path", "by", "key" ]
train
https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/Builders/MigrationBuilder.php#L230-L237
NuclearCMS/Hierarchy
src/Builders/MigrationBuilder.php
MigrationBuilder.getColumnType
public function getColumnType($type) { if (array_key_exists($type, $this->typeMap)) { return $this->typeMap[$type]; } return $this->defaultType; }
php
public function getColumnType($type) { if (array_key_exists($type, $this->typeMap)) { return $this->typeMap[$type]; } return $this->defaultType; }
[ "public", "function", "getColumnType", "(", "$", "type", ")", "{", "if", "(", "array_key_exists", "(", "$", "type", ",", "$", "this", "->", "typeMap", ")", ")", "{", "return", "$", "this", "->", "typeMap", "[", "$", "type", "]", ";", "}", "return", ...
Returns the column type for key @param string $type @return string
[ "Returns", "the", "column", "type", "for", "key" ]
train
https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/Builders/MigrationBuilder.php#L245-L253
xiewulong/yii2-fileupload
oss/libs/symfony/class-loader/Symfony/Component/ClassLoader/ClassLoader.php
ClassLoader.addPrefix
public function addPrefix($prefix, $paths) { if (!$prefix) { foreach ((array) $paths as $path) { $this->fallbackDirs[] = $path; } return; } if (isset($this->prefixes[$prefix])) { $this->prefixes[$prefix] = array_merge( ...
php
public function addPrefix($prefix, $paths) { if (!$prefix) { foreach ((array) $paths as $path) { $this->fallbackDirs[] = $path; } return; } if (isset($this->prefixes[$prefix])) { $this->prefixes[$prefix] = array_merge( ...
[ "public", "function", "addPrefix", "(", "$", "prefix", ",", "$", "paths", ")", "{", "if", "(", "!", "$", "prefix", ")", "{", "foreach", "(", "(", "array", ")", "$", "paths", "as", "$", "path", ")", "{", "$", "this", "->", "fallbackDirs", "[", "]"...
Registers a set of classes @param string $prefix The classes prefix @param array|string $paths The location(s) of the classes
[ "Registers", "a", "set", "of", "classes" ]
train
https://github.com/xiewulong/yii2-fileupload/blob/3e75b17a4a18dd8466e3f57c63136de03470ca82/oss/libs/symfony/class-loader/Symfony/Component/ClassLoader/ClassLoader.php#L84-L101
xiewulong/yii2-fileupload
oss/libs/symfony/class-loader/Symfony/Component/ClassLoader/ClassLoader.php
ClassLoader.findFile
public function findFile($class) { if (false !== $pos = strrpos($class, '\\')) { // namespaced class name $classPath = str_replace('\\', DIRECTORY_SEPARATOR, substr($class, 0, $pos)).DIRECTORY_SEPARATOR; $className = substr($class, $pos + 1); } else { ...
php
public function findFile($class) { if (false !== $pos = strrpos($class, '\\')) { // namespaced class name $classPath = str_replace('\\', DIRECTORY_SEPARATOR, substr($class, 0, $pos)).DIRECTORY_SEPARATOR; $className = substr($class, $pos + 1); } else { ...
[ "public", "function", "findFile", "(", "$", "class", ")", "{", "if", "(", "false", "!==", "$", "pos", "=", "strrpos", "(", "$", "class", ",", "'\\\\'", ")", ")", "{", "// namespaced class name", "$", "classPath", "=", "str_replace", "(", "'\\\\'", ",", ...
Finds the path to the file where the class is defined. @param string $class The name of the class @return string|null The path, if found
[ "Finds", "the", "path", "to", "the", "file", "where", "the", "class", "is", "defined", "." ]
train
https://github.com/xiewulong/yii2-fileupload/blob/3e75b17a4a18dd8466e3f57c63136de03470ca82/oss/libs/symfony/class-loader/Symfony/Component/ClassLoader/ClassLoader.php#L165-L198
mothership-ec/composer
src/Composer/Repository/RepositoryManager.php
RepositoryManager.findPackages
public function findPackages($name, $version) { $packages = array(); foreach ($this->repositories as $repository) { $packages = array_merge($packages, $repository->findPackages($name, $version)); } return $packages; }
php
public function findPackages($name, $version) { $packages = array(); foreach ($this->repositories as $repository) { $packages = array_merge($packages, $repository->findPackages($name, $version)); } return $packages; }
[ "public", "function", "findPackages", "(", "$", "name", ",", "$", "version", ")", "{", "$", "packages", "=", "array", "(", ")", ";", "foreach", "(", "$", "this", "->", "repositories", "as", "$", "repository", ")", "{", "$", "packages", "=", "array_merg...
Searches for all packages matching a name and optionally a version in managed repositories. @param string $name package name @param string $version package version @return array
[ "Searches", "for", "all", "packages", "matching", "a", "name", "and", "optionally", "a", "version", "in", "managed", "repositories", "." ]
train
https://github.com/mothership-ec/composer/blob/fa6ad031a939d8d33b211e428fdbdd28cfce238c/src/Composer/Repository/RepositoryManager.php#L67-L76
mothership-ec/composer
src/Composer/Repository/RepositoryManager.php
RepositoryManager.createRepository
public function createRepository($type, $config) { if (!isset($this->repositoryClasses[$type])) { throw new \InvalidArgumentException('Repository type is not registered: '.$type); } $class = $this->repositoryClasses[$type]; return new $class($config, $this->io, $this->c...
php
public function createRepository($type, $config) { if (!isset($this->repositoryClasses[$type])) { throw new \InvalidArgumentException('Repository type is not registered: '.$type); } $class = $this->repositoryClasses[$type]; return new $class($config, $this->io, $this->c...
[ "public", "function", "createRepository", "(", "$", "type", ",", "$", "config", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "repositoryClasses", "[", "$", "type", "]", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", ...
Returns a new repository for a specific installation type. @param string $type repository type @param array $config repository configuration @return RepositoryInterface @throws \InvalidArgumentException if repository for provided type is not registered
[ "Returns", "a", "new", "repository", "for", "a", "specific", "installation", "type", "." ]
train
https://github.com/mothership-ec/composer/blob/fa6ad031a939d8d33b211e428fdbdd28cfce238c/src/Composer/Repository/RepositoryManager.php#L96-L105
zhouyl/mellivora
Mellivora/View/ViewServiceProvider.php
ViewServiceProvider.registerFactory
public function registerFactory() { $this->container['view'] = function ($container) { // Next we need to grab the engine resolver instance that will be used by the // environment. The resolver will be used by an environment to get each of // the various engine implementa...
php
public function registerFactory() { $this->container['view'] = function ($container) { // Next we need to grab the engine resolver instance that will be used by the // environment. The resolver will be used by an environment to get each of // the various engine implementa...
[ "public", "function", "registerFactory", "(", ")", "{", "$", "this", "->", "container", "[", "'view'", "]", "=", "function", "(", "$", "container", ")", "{", "// Next we need to grab the engine resolver instance that will be used by the", "// environment. The resolver will ...
Register the view environment. @return void
[ "Register", "the", "view", "environment", "." ]
train
https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/View/ViewServiceProvider.php#L31-L50
zhouyl/mellivora
Mellivora/View/ViewServiceProvider.php
ViewServiceProvider.registerEngineResolver
public function registerEngineResolver() { $this->container['view.engine.resolver'] = function () { $resolver = new EngineResolver; // Next, we will register the various view engines with the resolver so that the // environment will resolve the engines needed for various...
php
public function registerEngineResolver() { $this->container['view.engine.resolver'] = function () { $resolver = new EngineResolver; // Next, we will register the various view engines with the resolver so that the // environment will resolve the engines needed for various...
[ "public", "function", "registerEngineResolver", "(", ")", "{", "$", "this", "->", "container", "[", "'view.engine.resolver'", "]", "=", "function", "(", ")", "{", "$", "resolver", "=", "new", "EngineResolver", ";", "// Next, we will register the various view engines w...
Register the engine resolver instance. @return void
[ "Register", "the", "engine", "resolver", "instance", "." ]
train
https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/View/ViewServiceProvider.php#L71-L85
zhouyl/mellivora
Mellivora/View/ViewServiceProvider.php
ViewServiceProvider.registerBladeEngine
public function registerBladeEngine($resolver) { // The Compiler engine requires an instance of the CompilerInterface, which in // this case will be the Blade compiler, so we'll first create the compiler // instance to pass into the engine so it can compile the views properly. $this-...
php
public function registerBladeEngine($resolver) { // The Compiler engine requires an instance of the CompilerInterface, which in // this case will be the Blade compiler, so we'll first create the compiler // instance to pass into the engine so it can compile the views properly. $this-...
[ "public", "function", "registerBladeEngine", "(", "$", "resolver", ")", "{", "// The Compiler engine requires an instance of the CompilerInterface, which in", "// this case will be the Blade compiler, so we'll first create the compiler", "// instance to pass into the engine so it can compile the...
Register the Blade engine implementation. @param \Mellivora\View\Engines\EngineResolver $resolver @return void
[ "Register", "the", "Blade", "engine", "implementation", "." ]
train
https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/View/ViewServiceProvider.php#L122-L134
yuncms/yii2-authentication
backend/controllers/AuthenticationController.php
AuthenticationController.actionIndex
public function actionIndex() { $searchModel = Yii::createObject(AuthenticationSearch::className()); $dataProvider = $searchModel->search(Yii::$app->request->get()); return $this->render('index', [ 'searchModel' => $searchModel, 'dataProvider' => $dataProvider, ...
php
public function actionIndex() { $searchModel = Yii::createObject(AuthenticationSearch::className()); $dataProvider = $searchModel->search(Yii::$app->request->get()); return $this->render('index', [ 'searchModel' => $searchModel, 'dataProvider' => $dataProvider, ...
[ "public", "function", "actionIndex", "(", ")", "{", "$", "searchModel", "=", "Yii", "::", "createObject", "(", "AuthenticationSearch", "::", "className", "(", ")", ")", ";", "$", "dataProvider", "=", "$", "searchModel", "->", "search", "(", "Yii", "::", "$...
Lists all Authentication models. @return mixed
[ "Lists", "all", "Authentication", "models", "." ]
train
https://github.com/yuncms/yii2-authentication/blob/02b70f7d2587480edb6dcc18ce256db662f1ed0d/backend/controllers/AuthenticationController.php#L40-L49
inhere/php-librarys
src/DI/CallableResolver.php
CallableResolver.resolve
public function resolve($toResolve) { if (\is_callable($toResolve)) { return $toResolve; } if (!\is_string($toResolve)) { $this->assertCallable($toResolve); } // check for slim callable as "class:method" if (preg_match(self::CALLABLE_PATTERN,...
php
public function resolve($toResolve) { if (\is_callable($toResolve)) { return $toResolve; } if (!\is_string($toResolve)) { $this->assertCallable($toResolve); } // check for slim callable as "class:method" if (preg_match(self::CALLABLE_PATTERN,...
[ "public", "function", "resolve", "(", "$", "toResolve", ")", "{", "if", "(", "\\", "is_callable", "(", "$", "toResolve", ")", ")", "{", "return", "$", "toResolve", ";", "}", "if", "(", "!", "\\", "is_string", "(", "$", "toResolve", ")", ")", "{", "...
Resolve toResolve into a closure that that the router can dispatch. If toResolve is of the format 'class:method', then try to extract 'class' from the container otherwise instantiate it and then dispatch 'method'. @param mixed $toResolve @return callable @throws RuntimeException if the callable does not exist @thro...
[ "Resolve", "toResolve", "into", "a", "closure", "that", "that", "the", "router", "can", "dispatch", "." ]
train
https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/DI/CallableResolver.php#L50-L72
inhere/php-librarys
src/DI/CallableResolver.php
CallableResolver.resolveCallable
private function resolveCallable($class, $method = '__invoke') { if ($cb = $this->container->getIfExist($class)) { return [$cb, $method]; } if (!class_exists($class)) { throw new RuntimeException(sprintf('Callable %s does not exist', $class)); } retu...
php
private function resolveCallable($class, $method = '__invoke') { if ($cb = $this->container->getIfExist($class)) { return [$cb, $method]; } if (!class_exists($class)) { throw new RuntimeException(sprintf('Callable %s does not exist', $class)); } retu...
[ "private", "function", "resolveCallable", "(", "$", "class", ",", "$", "method", "=", "'__invoke'", ")", "{", "if", "(", "$", "cb", "=", "$", "this", "->", "container", "->", "getIfExist", "(", "$", "class", ")", ")", "{", "return", "[", "$", "cb", ...
Check if string is something in the DIC that's callable or is a class name which has an __invoke() method. @param string $class @param string $method @return callable @throws \InvalidArgumentException @throws \RuntimeException if the callable does not exist
[ "Check", "if", "string", "is", "something", "in", "the", "DIC", "that", "s", "callable", "or", "is", "a", "class", "name", "which", "has", "an", "__invoke", "()", "method", "." ]
train
https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/DI/CallableResolver.php#L85-L96
GrupaZero/api
src/Gzero/Api/Controller/ApiController.php
ApiController.respond
protected function respond($data, $code, array $headers = []) { return response()->json($data, $code, array_merge($this->defaultHeaders(), $headers)); }
php
protected function respond($data, $code, array $headers = []) { return response()->json($data, $code, array_merge($this->defaultHeaders(), $headers)); }
[ "protected", "function", "respond", "(", "$", "data", ",", "$", "code", ",", "array", "$", "headers", "=", "[", "]", ")", "{", "return", "response", "(", ")", "->", "json", "(", "$", "data", ",", "$", "code", ",", "array_merge", "(", "$", "this", ...
Return response in json format @param mixed $data Response data @param int $code Response code @param array $headers HTTP headers @return \Illuminate\Http\JsonResponse
[ "Return", "response", "in", "json", "format" ]
train
https://github.com/GrupaZero/api/blob/fc544bb6057274e9d5e7b617346c3f854ea5effd/src/Gzero/Api/Controller/ApiController.php#L54-L57
GrupaZero/api
src/Gzero/Api/Controller/ApiController.php
ApiController.respondTransformer
protected function respondTransformer($data, $code, TransformerAbstract $transformer, array $headers = []) { if ($data === null) { // If we have empty result return $this->respond( [ 'data' => [] ], $code, $heade...
php
protected function respondTransformer($data, $code, TransformerAbstract $transformer, array $headers = []) { if ($data === null) { // If we have empty result return $this->respond( [ 'data' => [] ], $code, $heade...
[ "protected", "function", "respondTransformer", "(", "$", "data", ",", "$", "code", ",", "TransformerAbstract", "$", "transformer", ",", "array", "$", "headers", "=", "[", "]", ")", "{", "if", "(", "$", "data", "===", "null", ")", "{", "// If we have empty ...
Return transformed response in json format @param mixed $data Response data @param int $code Response code @param TransformerAbstract $transformer Transformer class @param array $headers HTTP headers @return \Illuminate\Http\JsonResponse
[ "Return", "transformed", "response", "in", "json", "format" ]
train
https://github.com/GrupaZero/api/blob/fc544bb6057274e9d5e7b617346c3f854ea5effd/src/Gzero/Api/Controller/ApiController.php#L69-L115
GrupaZero/api
src/Gzero/Api/Controller/ApiController.php
ApiController.respondWithSuccess
protected function respondWithSuccess($data, TransformerAbstract $transformer = null, array $headers = []) { if ($transformer) { return $this->respondTransformer($data, SymfonyResponse::HTTP_OK, $transformer, $headers); } return $this->respondWithSimpleSuccess($data); }
php
protected function respondWithSuccess($data, TransformerAbstract $transformer = null, array $headers = []) { if ($transformer) { return $this->respondTransformer($data, SymfonyResponse::HTTP_OK, $transformer, $headers); } return $this->respondWithSimpleSuccess($data); }
[ "protected", "function", "respondWithSuccess", "(", "$", "data", ",", "TransformerAbstract", "$", "transformer", "=", "null", ",", "array", "$", "headers", "=", "[", "]", ")", "{", "if", "(", "$", "transformer", ")", "{", "return", "$", "this", "->", "re...
Return success response in json format @param mixed $data Response data @param TransformerAbstract $transformer Transformer class @param array $headers HTTP Header @return mixed
[ "Return", "success", "response", "in", "json", "format" ]
train
https://github.com/GrupaZero/api/blob/fc544bb6057274e9d5e7b617346c3f854ea5effd/src/Gzero/Api/Controller/ApiController.php#L126-L132
GrupaZero/api
src/Gzero/Api/Controller/ApiController.php
ApiController.respondWithError
protected function respondWithError( $message = 'Bad Request', $code = SymfonyResponse::HTTP_BAD_REQUEST, array $headers = [] ) { return abort($code, $message, $headers); }
php
protected function respondWithError( $message = 'Bad Request', $code = SymfonyResponse::HTTP_BAD_REQUEST, array $headers = [] ) { return abort($code, $message, $headers); }
[ "protected", "function", "respondWithError", "(", "$", "message", "=", "'Bad Request'", ",", "$", "code", "=", "SymfonyResponse", "::", "HTTP_BAD_REQUEST", ",", "array", "$", "headers", "=", "[", "]", ")", "{", "return", "abort", "(", "$", "code", ",", "$"...
Return server error response in json format @param string $message Custom error message @param int $code Error code @param array $headers HTTP headers @return mixed
[ "Return", "server", "error", "response", "in", "json", "format" ]
train
https://github.com/GrupaZero/api/blob/fc544bb6057274e9d5e7b617346c3f854ea5effd/src/Gzero/Api/Controller/ApiController.php#L156-L162
GrupaZero/api
src/Gzero/Api/Controller/ApiController.php
ApiController.getSerializer
protected function getSerializer() { if (!isset($this->serializer)) { $this->serializer = \App::make('League\Fractal\Manager'); } return $this->serializer; }
php
protected function getSerializer() { if (!isset($this->serializer)) { $this->serializer = \App::make('League\Fractal\Manager'); } return $this->serializer; }
[ "protected", "function", "getSerializer", "(", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "serializer", ")", ")", "{", "$", "this", "->", "serializer", "=", "\\", "App", "::", "make", "(", "'League\\Fractal\\Manager'", ")", ";", "}", "r...
Get serializer @return \League\Fractal\Manager
[ "Get", "serializer" ]
train
https://github.com/GrupaZero/api/blob/fc544bb6057274e9d5e7b617346c3f854ea5effd/src/Gzero/Api/Controller/ApiController.php#L182-L188
jaxon-php/jaxon-jquery
src/Dom/Element.php
Element.getScript
public function getScript() { if(count($this->aScripts) == 0) { return ''; } if(($this->sContext)) { $js = "$('" . $this->sSelector . "', $('" . $this->sContext . "'))"; } else { $js = "$('" . $this->sSelector . "')"...
php
public function getScript() { if(count($this->aScripts) == 0) { return ''; } if(($this->sContext)) { $js = "$('" . $this->sSelector . "', $('" . $this->sContext . "'))"; } else { $js = "$('" . $this->sSelector . "')"...
[ "public", "function", "getScript", "(", ")", "{", "if", "(", "count", "(", "$", "this", "->", "aScripts", ")", "==", "0", ")", "{", "return", "''", ";", "}", "if", "(", "(", "$", "this", "->", "sContext", ")", ")", "{", "$", "js", "=", "\"$('\"...
Generate the jQuery call. @return string
[ "Generate", "the", "jQuery", "call", "." ]
train
https://github.com/jaxon-php/jaxon-jquery/blob/90766a8ea8a4124a3f110e96b316370f71762380/src/Dom/Element.php#L67-L82
kenphp/ken
src/Http/BaseMiddleware.php
BaseMiddleware.next
final protected function next(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { if ($this->_next) { return $this->_next->process($request, $handler); } return $handler->handle($request); }
php
final protected function next(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { if ($this->_next) { return $this->_next->process($request, $handler); } return $handler->handle($request); }
[ "final", "protected", "function", "next", "(", "ServerRequestInterface", "$", "request", ",", "RequestHandlerInterface", "$", "handler", ")", ":", "ResponseInterface", "{", "if", "(", "$", "this", "->", "_next", ")", "{", "return", "$", "this", "->", "_next", ...
Pass request to the next middleware. If there are no next middleware, it will pass the request to the handler @param ServerRequestInterface $request @param RequestHandlerInterface $handler @return ResponseInterface
[ "Pass", "request", "to", "the", "next", "middleware", ".", "If", "there", "are", "no", "next", "middleware", "it", "will", "pass", "the", "request", "to", "the", "handler" ]
train
https://github.com/kenphp/ken/blob/c454a86f0ab55c52c88e9bff5bc6fb4e7bd9e0eb/src/Http/BaseMiddleware.php#L44-L49
digitalingenieur/churchtools-php-sdk
src/Models/Model.php
Model.get
public static function get() { $instance = new static; $request = new Request($instance->functionCall, $instance->module); $instance->fill($request->execute()); return $instance; }
php
public static function get() { $instance = new static; $request = new Request($instance->functionCall, $instance->module); $instance->fill($request->execute()); return $instance; }
[ "public", "static", "function", "get", "(", ")", "{", "$", "instance", "=", "new", "static", ";", "$", "request", "=", "new", "Request", "(", "$", "instance", "->", "functionCall", ",", "$", "instance", "->", "module", ")", ";", "$", "instance", "->", ...
get wenn nur ein model zurückerwartet wird
[ "get", "wenn", "nur", "ein", "model", "zurückerwartet", "wird" ]
train
https://github.com/digitalingenieur/churchtools-php-sdk/blob/68af220e37c7cd2e52e3e5a717985dd582b50e34/src/Models/Model.php#L28-L37
digitalingenieur/churchtools-php-sdk
src/Models/Model.php
Model.all
public static function all($column='') { $instance = new static; $result = $instance->newRequest($instance->functionCall,$instance->module); $collection = $instance->newCollection(); foreach($result as $key => $object){ $collection->put($key, new static((array) $object)...
php
public static function all($column='') { $instance = new static; $result = $instance->newRequest($instance->functionCall,$instance->module); $collection = $instance->newCollection(); foreach($result as $key => $object){ $collection->put($key, new static((array) $object)...
[ "public", "static", "function", "all", "(", "$", "column", "=", "''", ")", "{", "$", "instance", "=", "new", "static", ";", "$", "result", "=", "$", "instance", "->", "newRequest", "(", "$", "instance", "->", "functionCall", ",", "$", "instance", "->",...
all wenn eine collection zurückerwartet wird
[ "all", "wenn", "eine", "collection", "zurückerwartet", "wird" ]
train
https://github.com/digitalingenieur/churchtools-php-sdk/blob/68af220e37c7cd2e52e3e5a717985dd582b50e34/src/Models/Model.php#L40-L51
technote-space/wordpress-plugin-base
src/classes/models/lib/social.php
Social.get_social_service
private function get_social_service( $state ) { $name = $this->get_social_service_name( $state ); if ( empty( $name ) ) { return null; } foreach ( $this->get_class_list() as $class ) { /** @var \Technote\Interfaces\Helper\Social $class */ if ( $name === $class->get_service_name() ) { return...
php
private function get_social_service( $state ) { $name = $this->get_social_service_name( $state ); if ( empty( $name ) ) { return null; } foreach ( $this->get_class_list() as $class ) { /** @var \Technote\Interfaces\Helper\Social $class */ if ( $name === $class->get_service_name() ) { return...
[ "private", "function", "get_social_service", "(", "$", "state", ")", "{", "$", "name", "=", "$", "this", "->", "get_social_service_name", "(", "$", "state", ")", ";", "if", "(", "empty", "(", "$", "name", ")", ")", "{", "return", "null", ";", "}", "f...
@param $state @return \Technote\Interfaces\Helper\Social|null
[ "@param", "$state" ]
train
https://github.com/technote-space/wordpress-plugin-base/blob/02cfcba358432a2539af07a69d9db00ff7c14eac/src/classes/models/lib/social.php#L135-L148
maestroprog/saw-php
src/Saw.php
Saw.init
public function init(string $configPath): self { defined('INTERVAL') or define('INTERVAL', 10000); defined('SAW_DIR') or define('SAW_DIR', __DIR__); $config = array_merge( require __DIR__ . '/../config/saw.php', require $configPath ); // todo include c...
php
public function init(string $configPath): self { defined('INTERVAL') or define('INTERVAL', 10000); defined('SAW_DIR') or define('SAW_DIR', __DIR__); $config = array_merge( require __DIR__ . '/../config/saw.php', require $configPath ); // todo include c...
[ "public", "function", "init", "(", "string", "$", "configPath", ")", ":", "self", "{", "defined", "(", "'INTERVAL'", ")", "or", "define", "(", "'INTERVAL'", ",", "10000", ")", ";", "defined", "(", "'SAW_DIR'", ")", "or", "define", "(", "'SAW_DIR'", ",", ...
Инициализация фреймворка с заданным конфигом. @param string $configPath @return Saw
[ "Инициализация", "фреймворка", "с", "заданным", "конфигом", "." ]
train
https://github.com/maestroprog/saw-php/blob/159215a4d7a951cca2a9c2eed3e1aa4f5b624cfb/src/Saw.php#L85-L154
maestroprog/saw-php
src/Saw.php
Saw.instanceApp
public function instanceApp(string $appClass): ApplicationInterface { return $this ->container ->getApplicationContainer() ->add($this->applicationLoader->instanceApp($appClass)); }
php
public function instanceApp(string $appClass): ApplicationInterface { return $this ->container ->getApplicationContainer() ->add($this->applicationLoader->instanceApp($appClass)); }
[ "public", "function", "instanceApp", "(", "string", "$", "appClass", ")", ":", "ApplicationInterface", "{", "return", "$", "this", "->", "container", "->", "getApplicationContainer", "(", ")", "->", "add", "(", "$", "this", "->", "applicationLoader", "->", "in...
Инстанцирование приложения. @param string $appClass @return ApplicationInterface
[ "Инстанцирование", "приложения", "." ]
train
https://github.com/maestroprog/saw-php/blob/159215a4d7a951cca2a9c2eed3e1aa4f5b624cfb/src/Saw.php#L167-L173
maestroprog/saw-php
src/Saw.php
Saw.instanceController
public function instanceController(): Controller { $this->sawContainer->setEnvironment(SawEnv::controller()); return new Controller( $this->container->get('WorkCycle'), $this->container->get(ControllerCore::class), $this->container->get('ControllerServer'), ...
php
public function instanceController(): Controller { $this->sawContainer->setEnvironment(SawEnv::controller()); return new Controller( $this->container->get('WorkCycle'), $this->container->get(ControllerCore::class), $this->container->get('ControllerServer'), ...
[ "public", "function", "instanceController", "(", ")", ":", "Controller", "{", "$", "this", "->", "sawContainer", "->", "setEnvironment", "(", "SawEnv", "::", "controller", "(", ")", ")", ";", "return", "new", "Controller", "(", "$", "this", "->", "container"...
Создаёт новый инстанс объекта контроллера. @return Controller
[ "Создаёт", "новый", "инстанс", "объекта", "контроллера", "." ]
train
https://github.com/maestroprog/saw-php/blob/159215a4d7a951cca2a9c2eed3e1aa4f5b624cfb/src/Saw.php#L180-L191
heidelpay/PhpDoc
src/phpDocumentor/Descriptor/ClassDescriptor.php
ClassDescriptor.getInheritedConstants
public function getInheritedConstants() { if (!$this->getParent() || (!$this->getParent() instanceof ClassDescriptor)) { return new Collection(); } $inheritedConstants = clone $this->getParent()->getConstants(); return $inheritedConstants->merge($this->getParent()->getI...
php
public function getInheritedConstants() { if (!$this->getParent() || (!$this->getParent() instanceof ClassDescriptor)) { return new Collection(); } $inheritedConstants = clone $this->getParent()->getConstants(); return $inheritedConstants->merge($this->getParent()->getI...
[ "public", "function", "getInheritedConstants", "(", ")", "{", "if", "(", "!", "$", "this", "->", "getParent", "(", ")", "||", "(", "!", "$", "this", "->", "getParent", "(", ")", "instanceof", "ClassDescriptor", ")", ")", "{", "return", "new", "Collection...
{@inheritDoc}
[ "{" ]
train
https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Descriptor/ClassDescriptor.php#L140-L149
heidelpay/PhpDoc
src/phpDocumentor/Descriptor/ClassDescriptor.php
ClassDescriptor.getInheritedProperties
public function getInheritedProperties() { $inheritedProperties = new Collection(); foreach ($this->getUsedTraits() as $trait) { if (!$trait instanceof TraitDescriptor) { continue; } $inheritedProperties = $inheritedProperties->merge(clone $trait...
php
public function getInheritedProperties() { $inheritedProperties = new Collection(); foreach ($this->getUsedTraits() as $trait) { if (!$trait instanceof TraitDescriptor) { continue; } $inheritedProperties = $inheritedProperties->merge(clone $trait...
[ "public", "function", "getInheritedProperties", "(", ")", "{", "$", "inheritedProperties", "=", "new", "Collection", "(", ")", ";", "foreach", "(", "$", "this", "->", "getUsedTraits", "(", ")", "as", "$", "trait", ")", "{", "if", "(", "!", "$", "trait", ...
{@inheritDoc}
[ "{" ]
train
https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Descriptor/ClassDescriptor.php#L244-L263
josegonzalez/cakephp-sanction
View/Helper/ClearanceHelper.php
ClearanceHelper.link
public function link($title, $url = null, $options = array(), $confirmMessage = false) { if (!is_array($url)) { return $this->Html->link($title, $url, $options, $confirmMessage); } if (!isset($url['plugin']) && !empty($url['plugin'])) { $url['plugin'] = $this->params['plugin']; } if (!isset($url['cont...
php
public function link($title, $url = null, $options = array(), $confirmMessage = false) { if (!is_array($url)) { return $this->Html->link($title, $url, $options, $confirmMessage); } if (!isset($url['plugin']) && !empty($url['plugin'])) { $url['plugin'] = $this->params['plugin']; } if (!isset($url['cont...
[ "public", "function", "link", "(", "$", "title", ",", "$", "url", "=", "null", ",", "$", "options", "=", "array", "(", ")", ",", "$", "confirmMessage", "=", "false", ")", "{", "if", "(", "!", "is_array", "(", "$", "url", ")", ")", "{", "return", ...
Creates an HTML link. If $url starts with "http://" this is treated as an external link. Else, it is treated as a path to controller/action and parsed against the routes included in app/config/permit.php. If there is a match and the User's session clears with the rules, it is then sent off to the HtmlHelper::link() me...
[ "Creates", "an", "HTML", "link", "." ]
train
https://github.com/josegonzalez/cakephp-sanction/blob/df2a8f0c0602c0ace802773db2c2ca6c89555c47/View/Helper/ClearanceHelper.php#L85-L118