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
Eresus/EresusCMS
src/core/framework/core/3rdparty/dwoo/Dwoo/Template/String.php
Dwoo_Template_String.templateFactory
public static function templateFactory(Dwoo $dwoo, $resourceId, $cacheTime = null, $cacheId = null, $compileId = null, Dwoo_ITemplate $parentTemplate = null) { return new self($resourceId, $cacheTime, $cacheId, $compileId); }
php
public static function templateFactory(Dwoo $dwoo, $resourceId, $cacheTime = null, $cacheId = null, $compileId = null, Dwoo_ITemplate $parentTemplate = null) { return new self($resourceId, $cacheTime, $cacheId, $compileId); }
[ "public", "static", "function", "templateFactory", "(", "Dwoo", "$", "dwoo", ",", "$", "resourceId", ",", "$", "cacheTime", "=", "null", ",", "$", "cacheId", "=", "null", ",", "$", "compileId", "=", "null", ",", "Dwoo_ITemplate", "$", "parentTemplate", "="...
returns a new template string object with the resource id being the template source code @param Dwoo $dwoo the dwoo instance requiring it @param mixed $resourceId the filename (relative to this template's dir) of the template to include @param int $cacheTime duration of the cache validity for this template, if null it...
[ "returns", "a", "new", "template", "string", "object", "with", "the", "resource", "id", "being", "the", "template", "source", "code" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Template/String.php#L407-L410
Eresus/EresusCMS
src/core/framework/core/3rdparty/dwoo/Dwoo/Template/String.php
Dwoo_Template_String.getCompiledFilename
protected function getCompiledFilename(Dwoo $dwoo) { // no compile id was provided, set default if ($this->compileId===null) { $this->compileId = $this->name; } return $dwoo->getCompileDir() . $this->compileId.'.d'.Dwoo::RELEASE_TAG.'.php'; }
php
protected function getCompiledFilename(Dwoo $dwoo) { // no compile id was provided, set default if ($this->compileId===null) { $this->compileId = $this->name; } return $dwoo->getCompileDir() . $this->compileId.'.d'.Dwoo::RELEASE_TAG.'.php'; }
[ "protected", "function", "getCompiledFilename", "(", "Dwoo", "$", "dwoo", ")", "{", "// no compile id was provided, set default", "if", "(", "$", "this", "->", "compileId", "===", "null", ")", "{", "$", "this", "->", "compileId", "=", "$", "this", "->", "name"...
returns the full compiled file name and assigns a default value to it if required @param Dwoo $dwoo the dwoo instance that requests the file name @return string the full path to the compiled file
[ "returns", "the", "full", "compiled", "file", "name", "and", "assigns", "a", "default", "value", "to", "it", "if", "required" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Template/String.php#L419-L426
Eresus/EresusCMS
src/core/framework/core/3rdparty/dwoo/Dwoo/Template/String.php
Dwoo_Template_String.getCacheFilename
protected function getCacheFilename(Dwoo $dwoo) { // no cache id provided, use request_uri as default if ($this->cacheId === null) { if (isset($_SERVER['REQUEST_URI']) === true) { $cacheId = $_SERVER['REQUEST_URI']; } elseif (isset($_SERVER['SCRIPT_FILENAME']) && isset($_SERVER['argv'])) { $cacheId =...
php
protected function getCacheFilename(Dwoo $dwoo) { // no cache id provided, use request_uri as default if ($this->cacheId === null) { if (isset($_SERVER['REQUEST_URI']) === true) { $cacheId = $_SERVER['REQUEST_URI']; } elseif (isset($_SERVER['SCRIPT_FILENAME']) && isset($_SERVER['argv'])) { $cacheId =...
[ "protected", "function", "getCacheFilename", "(", "Dwoo", "$", "dwoo", ")", "{", "// no cache id provided, use request_uri as default", "if", "(", "$", "this", "->", "cacheId", "===", "null", ")", "{", "if", "(", "isset", "(", "$", "_SERVER", "[", "'REQUEST_URI'...
returns the full cached file name and assigns a default value to it if required @param Dwoo $dwoo the dwoo instance that requests the file name @return string the full path to the cached file
[ "returns", "the", "full", "cached", "file", "name", "and", "assigns", "a", "default", "value", "to", "it", "if", "required" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Template/String.php#L435-L452
Eresus/EresusCMS
src/core/framework/core/3rdparty/dwoo/Dwoo/Template/String.php
Dwoo_Template_String.makeDirectory
protected function makeDirectory($path, $baseDir = null) { if (is_dir($path) === true) { return; } if ($this->chmod === null) { $chmod = 0777; } else { $chmod = $this->chmod; } mkdir($path, $chmod, true); // enforce the correct mode for all directories created if (strpos(PHP_OS, 'WIN') !== 0...
php
protected function makeDirectory($path, $baseDir = null) { if (is_dir($path) === true) { return; } if ($this->chmod === null) { $chmod = 0777; } else { $chmod = $this->chmod; } mkdir($path, $chmod, true); // enforce the correct mode for all directories created if (strpos(PHP_OS, 'WIN') !== 0...
[ "protected", "function", "makeDirectory", "(", "$", "path", ",", "$", "baseDir", "=", "null", ")", "{", "if", "(", "is_dir", "(", "$", "path", ")", "===", "true", ")", "{", "return", ";", "}", "if", "(", "$", "this", "->", "chmod", "===", "null", ...
ensures the given path exists @param string $path any path @param string $baseDir the base directory where the directory is created ($path must still contain the full path, $baseDir is only used for unix permissions)
[ "ensures", "the", "given", "path", "exists" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Template/String.php#L474-L496
bpolaszek/simple-dbal
src/Model/Adapter/Mysqli/Result.php
Result.resetResultset
private function resetResultset() { if (null !== $this->stmt) { $this->stmt->execute(); $this->result = $this->stmt->get_result(); } }
php
private function resetResultset() { if (null !== $this->stmt) { $this->stmt->execute(); $this->result = $this->stmt->get_result(); } }
[ "private", "function", "resetResultset", "(", ")", "{", "if", "(", "null", "!==", "$", "this", "->", "stmt", ")", "{", "$", "this", "->", "stmt", "->", "execute", "(", ")", ";", "$", "this", "->", "result", "=", "$", "this", "->", "stmt", "->", "...
Reset the resultset.
[ "Reset", "the", "resultset", "." ]
train
https://github.com/bpolaszek/simple-dbal/blob/52cb50d326ba5854191814b470f5e84950ebb6e6/src/Model/Adapter/Mysqli/Result.php#L226-L232
Smile-SA/EzUICronBundle
Controller/CronController.php
CronController.cronAction
public function cronAction($tabItem) { $this->performAccessChecks(); return $this->render('SmileEzUICronBundle:cron:index.html.twig', [ 'tab_items' => $this->tabItems, 'tab_item_selected' => $tabItem, 'params' => array(), 'hasErrors' => false ...
php
public function cronAction($tabItem) { $this->performAccessChecks(); return $this->render('SmileEzUICronBundle:cron:index.html.twig', [ 'tab_items' => $this->tabItems, 'tab_item_selected' => $tabItem, 'params' => array(), 'hasErrors' => false ...
[ "public", "function", "cronAction", "(", "$", "tabItem", ")", "{", "$", "this", "->", "performAccessChecks", "(", ")", ";", "return", "$", "this", "->", "render", "(", "'SmileEzUICronBundle:cron:index.html.twig'", ",", "[", "'tab_items'", "=>", "$", "this", "-...
Render tab item content @param string $tabItem tab item name @return \Symfony\Component\HttpFoundation\Response
[ "Render", "tab", "item", "content" ]
train
https://github.com/Smile-SA/EzUICronBundle/blob/c62fc6a3ab0b39e3f911742d9affe4aade90cf66/Controller/CronController.php#L31-L41
wenbinye/PhalconX
src/Text/LineEditor.php
LineEditor.delete
public function delete($line, $lines) { foreach (range(0, $lines-1) as $offset) { $this->lines[$line+$offset-1] = null; } return $this; }
php
public function delete($line, $lines) { foreach (range(0, $lines-1) as $offset) { $this->lines[$line+$offset-1] = null; } return $this; }
[ "public", "function", "delete", "(", "$", "line", ",", "$", "lines", ")", "{", "foreach", "(", "range", "(", "0", ",", "$", "lines", "-", "1", ")", "as", "$", "offset", ")", "{", "$", "this", "->", "lines", "[", "$", "line", "+", "$", "offset",...
deletes the content at $line @param int $line @param int $lines number of lines to delete
[ "deletes", "the", "content", "at", "$line" ]
train
https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Text/LineEditor.php#L64-L70
wenbinye/PhalconX
src/Text/LineEditor.php
LineEditor.replace
public function replace($line, $lines, $text) { if ($lines > 0) { $this->delete($line, $lines); } return $this->insert($line, $text); }
php
public function replace($line, $lines, $text) { if ($lines > 0) { $this->delete($line, $lines); } return $this->insert($line, $text); }
[ "public", "function", "replace", "(", "$", "line", ",", "$", "lines", ",", "$", "text", ")", "{", "if", "(", "$", "lines", ">", "0", ")", "{", "$", "this", "->", "delete", "(", "$", "line", ",", "$", "lines", ")", ";", "}", "return", "$", "th...
replaces the content at $line @param int $line @param int $lines number of lines to replace @param string text
[ "replaces", "the", "content", "at", "$line" ]
train
https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Text/LineEditor.php#L79-L85
wenbinye/PhalconX
src/Text/LineEditor.php
LineEditor.get
public function get($line) { return isset($this->lines[$line-1]) ? $this->lines[$line-1] : null; }
php
public function get($line) { return isset($this->lines[$line-1]) ? $this->lines[$line-1] : null; }
[ "public", "function", "get", "(", "$", "line", ")", "{", "return", "isset", "(", "$", "this", "->", "lines", "[", "$", "line", "-", "1", "]", ")", "?", "$", "this", "->", "lines", "[", "$", "line", "-", "1", "]", ":", "null", ";", "}" ]
Gets content of the line @return string return null if content deleted
[ "Gets", "content", "of", "the", "line" ]
train
https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Text/LineEditor.php#L92-L95
Eresus/EresusCMS
src/core/CMS/Request.php
Eresus_CMS_Request.setSiteRoot
public function setSiteRoot($url) { $url = strval($url); if ('' !== $url) { $url = rtrim(parse_url($url, PHP_URL_PATH), '/'); if (substr($url, 0, 1) != '/') { $url = '/' . $url; } } $this->siteRoot = $url; }
php
public function setSiteRoot($url) { $url = strval($url); if ('' !== $url) { $url = rtrim(parse_url($url, PHP_URL_PATH), '/'); if (substr($url, 0, 1) != '/') { $url = '/' . $url; } } $this->siteRoot = $url; }
[ "public", "function", "setSiteRoot", "(", "$", "url", ")", "{", "$", "url", "=", "strval", "(", "$", "url", ")", ";", "if", "(", "''", "!==", "$", "url", ")", "{", "$", "url", "=", "rtrim", "(", "parse_url", "(", "$", "url", ",", "PHP_URL_PATH", ...
Задаёт корневой адрес сайта Этот адрес будет вырезаться в таких методах как {@link getPath()}, {@link getDirectry()}, {@link getFile()}. @param mixed $url корневой URL или только путь относительно корня домена @since 3.01
[ "Задаёт", "корневой", "адрес", "сайта" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/CMS/Request.php#L85-L97
Eresus/EresusCMS
src/core/CMS/Request.php
Eresus_CMS_Request.getPath
public function getPath() { $path = parent::getPath(); if ('' == $path) { $path = '/'; } if ($this->siteRoot) { $path = substr($path, strlen($this->siteRoot)); } return $path; }
php
public function getPath() { $path = parent::getPath(); if ('' == $path) { $path = '/'; } if ($this->siteRoot) { $path = substr($path, strlen($this->siteRoot)); } return $path; }
[ "public", "function", "getPath", "(", ")", "{", "$", "path", "=", "parent", "::", "getPath", "(", ")", ";", "if", "(", "''", "==", "$", "path", ")", "{", "$", "path", "=", "'/'", ";", "}", "if", "(", "$", "this", "->", "siteRoot", ")", "{", "...
Возвращает путь (папку и имя файла) из запроса @return string @since 3.01
[ "Возвращает", "путь", "(", "папку", "и", "имя", "файла", ")", "из", "запроса" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/CMS/Request.php#L156-L168
oroinc/OroLayoutComponent
Templating/TextHelper.php
TextHelper.processText
public function processText($value, $domain = null) { if (empty($value)) { return $value; } if (is_string($value)) { return $this->translator->trans($value, [], $domain ?: self::DEFAULT_TRANS_DOMAIN); } if (is_array($value)) { $this->proce...
php
public function processText($value, $domain = null) { if (empty($value)) { return $value; } if (is_string($value)) { return $this->translator->trans($value, [], $domain ?: self::DEFAULT_TRANS_DOMAIN); } if (is_array($value)) { $this->proce...
[ "public", "function", "processText", "(", "$", "value", ",", "$", "domain", "=", "null", ")", "{", "if", "(", "empty", "(", "$", "value", ")", ")", "{", "return", "$", "value", ";", "}", "if", "(", "is_string", "(", "$", "value", ")", ")", "{", ...
Normalizes and translates (if needed) labels in the given value. @param mixed $value @param string|null $domain @return array
[ "Normalizes", "and", "translates", "(", "if", "needed", ")", "labels", "in", "the", "given", "value", "." ]
train
https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/Templating/TextHelper.php#L30-L44
oroinc/OroLayoutComponent
Templating/TextHelper.php
TextHelper.processArray
protected function processArray(&$value, $domain) { if (isset($value['label'])) { $label = $value['label']; if (is_string($label)) { if (empty($label)) { $value = $label; } else { $translatable = isset($value['tr...
php
protected function processArray(&$value, $domain) { if (isset($value['label'])) { $label = $value['label']; if (is_string($label)) { if (empty($label)) { $value = $label; } else { $translatable = isset($value['tr...
[ "protected", "function", "processArray", "(", "&", "$", "value", ",", "$", "domain", ")", "{", "if", "(", "isset", "(", "$", "value", "[", "'label'", "]", ")", ")", "{", "$", "label", "=", "$", "value", "[", "'label'", "]", ";", "if", "(", "is_st...
@param array $value @param string|null $domain @SuppressWarnings(PHPMD.NPathComplexity)
[ "@param", "array", "$value", "@param", "string|null", "$domain" ]
train
https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/Templating/TextHelper.php#L52-L96
AOEpeople/Aoe_Layout
app/code/local/Aoe/Layout/Block/Widget/Grid/Column/Renderer/Select.php
Aoe_Layout_Block_Widget_Grid_Column_Renderer_Select.render
public function render(Varien_Object $row) { $name = trim($this->getColumn()->getNamePattern()); if (!empty($name)) { $nameParams = array_map('trim', array_filter(explode(',', $this->getColumn()->getNameParams()))); if (count($nameParams)) { $params = [$name];...
php
public function render(Varien_Object $row) { $name = trim($this->getColumn()->getNamePattern()); if (!empty($name)) { $nameParams = array_map('trim', array_filter(explode(',', $this->getColumn()->getNameParams()))); if (count($nameParams)) { $params = [$name];...
[ "public", "function", "render", "(", "Varien_Object", "$", "row", ")", "{", "$", "name", "=", "trim", "(", "$", "this", "->", "getColumn", "(", ")", "->", "getNamePattern", "(", ")", ")", ";", "if", "(", "!", "empty", "(", "$", "name", ")", ")", ...
Renders grid column @param Varien_Object $row @return string
[ "Renders", "grid", "column" ]
train
https://github.com/AOEpeople/Aoe_Layout/blob/d88ba3406cf12dbaf09548477133c3cb27d155ed/app/code/local/Aoe/Layout/Block/Widget/Grid/Column/Renderer/Select.php#L12-L29
chubbyphp/chubbyphp-model-doctrine-dbal
src/Command/CreateDatabaseCommand.php
CreateDatabaseCommand.createDatabase
private function createDatabase( OutputInterface $output, Connection $tmpConnection, string $name, bool $shouldNotCreateDatabase ): int { try { if ($shouldNotCreateDatabase) { $output->writeln(sprintf('<info>Database <comment>%s</comment> already e...
php
private function createDatabase( OutputInterface $output, Connection $tmpConnection, string $name, bool $shouldNotCreateDatabase ): int { try { if ($shouldNotCreateDatabase) { $output->writeln(sprintf('<info>Database <comment>%s</comment> already e...
[ "private", "function", "createDatabase", "(", "OutputInterface", "$", "output", ",", "Connection", "$", "tmpConnection", ",", "string", "$", "name", ",", "bool", "$", "shouldNotCreateDatabase", ")", ":", "int", "{", "try", "{", "if", "(", "$", "shouldNotCreate...
@param OutputInterface $output @param Connection $tmpConnection @param string $name @param bool $shouldNotCreateDatabase @return int
[ "@param", "OutputInterface", "$output", "@param", "Connection", "$tmpConnection", "@param", "string", "$name", "@param", "bool", "$shouldNotCreateDatabase" ]
train
https://github.com/chubbyphp/chubbyphp-model-doctrine-dbal/blob/1079c28f5bffc2e2bec04122742d5008464c167f/src/Command/CreateDatabaseCommand.php#L101-L122
krakphp/job
src/ProcessManager/LoggingProcessManager.php
LoggingProcessManager.reap
public function reap() { $reaped = $this->manager->reap(); $this->logger->info('ProcessManager::reap', [ 'reaped' => $reaped ]); return $reaped; }
php
public function reap() { $reaped = $this->manager->reap(); $this->logger->info('ProcessManager::reap', [ 'reaped' => $reaped ]); return $reaped; }
[ "public", "function", "reap", "(", ")", "{", "$", "reaped", "=", "$", "this", "->", "manager", "->", "reap", "(", ")", ";", "$", "this", "->", "logger", "->", "info", "(", "'ProcessManager::reap'", ",", "[", "'reaped'", "=>", "$", "reaped", "]", ")",...
Go through and remove all of the jobs that have finished. Returns an array of 3-tuples `[$pid, $success, $output, $meta]`. - `$success` is flag of true for success or false for error. - `$output` is just the raw string content
[ "Go", "through", "and", "remove", "all", "of", "the", "jobs", "that", "have", "finished", ".", "Returns", "an", "array", "of", "3", "-", "tuples", "[", "$pid", "$success", "$output", "$meta", "]", "." ]
train
https://github.com/krakphp/job/blob/0c16020c1baa13d91f819ecba8334861ba7c4d6c/src/ProcessManager/LoggingProcessManager.php#L36-L42
mothership-ec/composer
src/Composer/Json/JsonFile.php
JsonFile.read
public function read() { try { if ($this->rfs) { $json = $this->rfs->getContents($this->path, $this->path, false); } else { $json = file_get_contents($this->path); } } catch (TransportException $e) { throw new \RuntimeEx...
php
public function read() { try { if ($this->rfs) { $json = $this->rfs->getContents($this->path, $this->path, false); } else { $json = file_get_contents($this->path); } } catch (TransportException $e) { throw new \RuntimeEx...
[ "public", "function", "read", "(", ")", "{", "try", "{", "if", "(", "$", "this", "->", "rfs", ")", "{", "$", "json", "=", "$", "this", "->", "rfs", "->", "getContents", "(", "$", "this", "->", "path", ",", "$", "this", "->", "path", ",", "false...
Reads json file. @throws \RuntimeException @return mixed
[ "Reads", "json", "file", "." ]
train
https://github.com/mothership-ec/composer/blob/fa6ad031a939d8d33b211e428fdbdd28cfce238c/src/Composer/Json/JsonFile.php#L80-L95
mothership-ec/composer
src/Composer/Json/JsonFile.php
JsonFile.validateSchema
public function validateSchema($schema = self::STRICT_SCHEMA) { $content = file_get_contents($this->path); $data = json_decode($content); if (null === $data && 'null' !== $content) { self::validateSyntax($content, $this->path); } $schemaFile = __DIR__ . '/../../...
php
public function validateSchema($schema = self::STRICT_SCHEMA) { $content = file_get_contents($this->path); $data = json_decode($content); if (null === $data && 'null' !== $content) { self::validateSyntax($content, $this->path); } $schemaFile = __DIR__ . '/../../...
[ "public", "function", "validateSchema", "(", "$", "schema", "=", "self", "::", "STRICT_SCHEMA", ")", "{", "$", "content", "=", "file_get_contents", "(", "$", "this", "->", "path", ")", ";", "$", "data", "=", "json_decode", "(", "$", "content", ")", ";", ...
Validates the schema of the current json file according to composer-schema.json rules @param int $schema a JsonFile::*_SCHEMA constant @return bool true on success @throws JsonValidationException
[ "Validates", "the", "schema", "of", "the", "current", "json", "file", "according", "to", "composer", "-", "schema", ".", "json", "rules" ]
train
https://github.com/mothership-ec/composer/blob/fa6ad031a939d8d33b211e428fdbdd28cfce238c/src/Composer/Json/JsonFile.php#L143-L174
gdbots/iam-php
src/UpdateRoleHandler.php
UpdateRoleHandler.beforePutEvents
protected function beforePutEvents(NodeUpdated $event, UpdateNode $command, Pbjx $pbjx): void { parent::beforePutEvents($event, $command, $pbjx); /** @var Role $newNode */ $newNode = $event->get('new_node'); $newNode // a role can only be "published" ->set('s...
php
protected function beforePutEvents(NodeUpdated $event, UpdateNode $command, Pbjx $pbjx): void { parent::beforePutEvents($event, $command, $pbjx); /** @var Role $newNode */ $newNode = $event->get('new_node'); $newNode // a role can only be "published" ->set('s...
[ "protected", "function", "beforePutEvents", "(", "NodeUpdated", "$", "event", ",", "UpdateNode", "$", "command", ",", "Pbjx", "$", "pbjx", ")", ":", "void", "{", "parent", "::", "beforePutEvents", "(", "$", "event", ",", "$", "command", ",", "$", "pbjx", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/gdbots/iam-php/blob/3dbfa602de183a7ac5fb5140304e8cf4c4b15ab3/src/UpdateRoleHandler.php#L29-L39
Innmind/Graphviz
src/Graph/Graph.php
Graph.nodes
public function nodes(): SetInterface { $map = $this->roots->reduce( new Map('string', Node::class), function(Map $nodes, Node $node): Map { return $this->accumulateNodes($nodes, $node); } ); return Set::of(Node::class, ...$map->values());...
php
public function nodes(): SetInterface { $map = $this->roots->reduce( new Map('string', Node::class), function(Map $nodes, Node $node): Map { return $this->accumulateNodes($nodes, $node); } ); return Set::of(Node::class, ...$map->values());...
[ "public", "function", "nodes", "(", ")", ":", "SetInterface", "{", "$", "map", "=", "$", "this", "->", "roots", "->", "reduce", "(", "new", "Map", "(", "'string'", ",", "Node", "::", "class", ")", ",", "function", "(", "Map", "$", "nodes", ",", "No...
{@inheritdoc}
[ "{" ]
train
https://github.com/Innmind/Graphviz/blob/6912f22a1482045e53e83477fcd04f29ad7cf85c/src/Graph/Graph.php#L100-L110
mvccore/ext-router-module
src/MvcCore/Ext/Routers/Module/PreAndPostRouting.php
PreAndPostRouting.routeDetectStrategy
protected function routeDetectStrategy () { list($requestCtrlName, $requestActionName) = parent::routeDetectStrategy(); if (!$this->internalRequest) $this->domainRouting(); return [$requestCtrlName, $requestActionName]; }
php
protected function routeDetectStrategy () { list($requestCtrlName, $requestActionName) = parent::routeDetectStrategy(); if (!$this->internalRequest) $this->domainRouting(); return [$requestCtrlName, $requestActionName]; }
[ "protected", "function", "routeDetectStrategy", "(", ")", "{", "list", "(", "$", "requestCtrlName", ",", "$", "requestActionName", ")", "=", "parent", "::", "routeDetectStrategy", "(", ")", ";", "if", "(", "!", "$", "this", "->", "internalRequest", ")", "$",...
Process normal route strategy detection from core router and than process domain routing, if request is not internal. Return array with possible query string controller name and action. @throws \LogicException Route configuration property is missing. @throws \InvalidArgumentException Wrong route pattern format. @return...
[ "Process", "normal", "route", "strategy", "detection", "from", "core", "router", "and", "than", "process", "domain", "routing", "if", "request", "is", "not", "internal", ".", "Return", "array", "with", "possible", "query", "string", "controller", "name", "and", ...
train
https://github.com/mvccore/ext-router-module/blob/7695784a451db86cca6a43c98d076803cd0a50a7/src/MvcCore/Ext/Routers/Module/PreAndPostRouting.php#L26-L30
mvccore/ext-router-module
src/MvcCore/Ext/Routers/Module/PreAndPostRouting.php
PreAndPostRouting.routeSetUpDefaultForHomeIfNoMatch
protected function routeSetUpDefaultForHomeIfNoMatch () { /** @var $this \MvcCore\Ext\Routers\Module */ $domainRouteNamespace = NULL; if ($this->currentDomainRoute !== NULL) $domainRouteNamespace = $this->currentDomainRoute->GetNamespace(); if ($this->currentRoute === NULL) { $request = & $this->request;...
php
protected function routeSetUpDefaultForHomeIfNoMatch () { /** @var $this \MvcCore\Ext\Routers\Module */ $domainRouteNamespace = NULL; if ($this->currentDomainRoute !== NULL) $domainRouteNamespace = $this->currentDomainRoute->GetNamespace(); if ($this->currentRoute === NULL) { $request = & $this->request;...
[ "protected", "function", "routeSetUpDefaultForHomeIfNoMatch", "(", ")", "{", "/** @var $this \\MvcCore\\Ext\\Routers\\Module */", "$", "domainRouteNamespace", "=", "NULL", ";", "if", "(", "$", "this", "->", "currentDomainRoute", "!==", "NULL", ")", "$", "domainRouteNamesp...
After routing is done, check if there is any current domain route and remember it's possible namespace value. Then check if there is any current route. If there is no current route found by any strategy, there is possible to create automatically new default route into current route property by configured default contro...
[ "After", "routing", "is", "done", "check", "if", "there", "is", "any", "current", "domain", "route", "and", "remember", "it", "s", "possible", "namespace", "value", ".", "Then", "check", "if", "there", "is", "any", "current", "route", ".", "If", "there", ...
train
https://github.com/mvccore/ext-router-module/blob/7695784a451db86cca6a43c98d076803cd0a50a7/src/MvcCore/Ext/Routers/Module/PreAndPostRouting.php#L53-L87
superjimpupcake/Pupcake
src/Pupcake/Router.php
Router.routeMatched
public function routeMatched($request_type, $route_pattern, $query_path) { $matched = $this->app->trigger( 'system.request.route.matching', array($this, 'processRouteMatching'), array( 'request_type'=> $request_type, 'query_path' => $quer...
php
public function routeMatched($request_type, $route_pattern, $query_path) { $matched = $this->app->trigger( 'system.request.route.matching', array($this, 'processRouteMatching'), array( 'request_type'=> $request_type, 'query_path' => $quer...
[ "public", "function", "routeMatched", "(", "$", "request_type", ",", "$", "route_pattern", ",", "$", "query_path", ")", "{", "$", "matched", "=", "$", "this", "->", "app", "->", "trigger", "(", "'system.request.route.matching'", ",", "array", "(", "$", "this...
check if a route is matched given a query path
[ "check", "if", "a", "route", "is", "matched", "given", "a", "query", "path" ]
train
https://github.com/superjimpupcake/Pupcake/blob/2f962818646e4e1d65f5d008eeb953cb41ebb3e0/src/Pupcake/Router.php#L86-L99
superjimpupcake/Pupcake
src/Pupcake/Router.php
Router.findMatchedRoute
public function findMatchedRoute($request_method = "", $query_path = "", $route_map) { $query_path = $this->normalize($query_path); $request_matched = false; $output = ""; if (count($route_map) > 0) { $request_types = array_keys($route_map); $request_types_to...
php
public function findMatchedRoute($request_method = "", $query_path = "", $route_map) { $query_path = $this->normalize($query_path); $request_matched = false; $output = ""; if (count($route_map) > 0) { $request_types = array_keys($route_map); $request_types_to...
[ "public", "function", "findMatchedRoute", "(", "$", "request_method", "=", "\"\"", ",", "$", "query_path", "=", "\"\"", ",", "$", "route_map", ")", "{", "$", "query_path", "=", "$", "this", "->", "normalize", "(", "$", "query_path", ")", ";", "$", "reque...
find a route
[ "find", "a", "route" ]
train
https://github.com/superjimpupcake/Pupcake/blob/2f962818646e4e1d65f5d008eeb953cb41ebb3e0/src/Pupcake/Router.php#L104-L133
superjimpupcake/Pupcake
src/Pupcake/Router.php
Router.processRouteMatchingNative
public function processRouteMatchingNative($event) { $request_type = $event->props('request_type'); $uri = $event->props('query_path'); $route_pattern= $event->props('route_pattern'); $result = false; $params = array(); $route_pattern_length = strlen($route_pattern);...
php
public function processRouteMatchingNative($event) { $request_type = $event->props('request_type'); $uri = $event->props('query_path'); $route_pattern= $event->props('route_pattern'); $result = false; $params = array(); $route_pattern_length = strlen($route_pattern);...
[ "public", "function", "processRouteMatchingNative", "(", "$", "event", ")", "{", "$", "request_type", "=", "$", "event", "->", "props", "(", "'request_type'", ")", ";", "$", "uri", "=", "$", "event", "->", "props", "(", "'query_path'", ")", ";", "$", "ro...
process route matching @param Event the event object @return boolean whether the route matched the uri or not
[ "process", "route", "matching" ]
train
https://github.com/superjimpupcake/Pupcake/blob/2f962818646e4e1d65f5d008eeb953cb41ebb3e0/src/Pupcake/Router.php#L140-L207
Innmind/neo4j-dbal
src/Clause/SetClause.php
SetClause.withParameter
public function withParameter(string $key, $value): Clause { if (Str::of($key)->empty()) { throw new DomainException; } $set = new self($this->cypher); $set->parameters = $this->parameters->put( $key, new Parameter($key, $value) ); ...
php
public function withParameter(string $key, $value): Clause { if (Str::of($key)->empty()) { throw new DomainException; } $set = new self($this->cypher); $set->parameters = $this->parameters->put( $key, new Parameter($key, $value) ); ...
[ "public", "function", "withParameter", "(", "string", "$", "key", ",", "$", "value", ")", ":", "Clause", "{", "if", "(", "Str", "::", "of", "(", "$", "key", ")", "->", "empty", "(", ")", ")", "{", "throw", "new", "DomainException", ";", "}", "$", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/Innmind/neo4j-dbal/blob/12cb71e698cc0f4d55b7f2eb40f7b353c778a20b/src/Clause/SetClause.php#L53-L66
Eresus/EresusCMS
src/core/settings.php
TSettings.mkstr
private function mkstr($name, $type = 'string', $options = array()) { $result = " define('$name', "; $quot = "'"; $value = isset($_POST[$name]) ? $_POST[$name] : null; if (isset($options['nobr']) && $options['nobr']) { $value = str_replace(array("\n", "\r"), ' '...
php
private function mkstr($name, $type = 'string', $options = array()) { $result = " define('$name', "; $quot = "'"; $value = isset($_POST[$name]) ? $_POST[$name] : null; if (isset($options['nobr']) && $options['nobr']) { $value = str_replace(array("\n", "\r"), ' '...
[ "private", "function", "mkstr", "(", "$", "name", ",", "$", "type", "=", "'string'", ",", "$", "options", "=", "array", "(", ")", ")", "{", "$", "result", "=", "\" define('$name', \"", ";", "$", "quot", "=", "\"'\"", ";", "$", "value", "=", "isset",...
Создаёт строку параметра для записи в файл @param string $name имя параметра @param string $type тип: string, bool или int @param array $options опции: nobr (true/false), savebr (true/false) @return string
[ "Создаёт", "строку", "параметра", "для", "записи", "в", "файл" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/settings.php#L50-L86
Eresus/EresusCMS
src/core/settings.php
TSettings.update
private function update() { Eresus_Kernel::log(__METHOD__, LOG_DEBUG, '()'); $settings = "<?php\n"; $settings .= $this->mkstr('siteName', 'string'); $settings .= $this->mkstr('siteTitle', 'string'); $settings .= $this->mkstr('siteTitleReverse', 'bool'); $settings .=...
php
private function update() { Eresus_Kernel::log(__METHOD__, LOG_DEBUG, '()'); $settings = "<?php\n"; $settings .= $this->mkstr('siteName', 'string'); $settings .= $this->mkstr('siteTitle', 'string'); $settings .= $this->mkstr('siteTitleReverse', 'bool'); $settings .=...
[ "private", "function", "update", "(", ")", "{", "Eresus_Kernel", "::", "log", "(", "__METHOD__", ",", "LOG_DEBUG", ",", "'()'", ")", ";", "$", "settings", "=", "\"<?php\\n\"", ";", "$", "settings", ".=", "$", "this", "->", "mkstr", "(", "'siteName'", ","...
Записывает настройки @return void @uses HTTP::goback
[ "Записывает", "настройки" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/settings.php#L93-L119
Eresus/EresusCMS
src/core/settings.php
TSettings.renderForm
private function renderForm() { /** @var TAdminUI $page */ $page = Eresus_Kernel::app()->getPage(); $template = $page->getUITheme()->getResource('SiteSettings/form.html'); $form = new EresusForm($template, LOCALE_CHARSET); /* Основные */ $form->setValue('siteName', op...
php
private function renderForm() { /** @var TAdminUI $page */ $page = Eresus_Kernel::app()->getPage(); $template = $page->getUITheme()->getResource('SiteSettings/form.html'); $form = new EresusForm($template, LOCALE_CHARSET); /* Основные */ $form->setValue('siteName', op...
[ "private", "function", "renderForm", "(", ")", "{", "/** @var TAdminUI $page */", "$", "page", "=", "Eresus_Kernel", "::", "app", "(", ")", "->", "getPage", "(", ")", ";", "$", "template", "=", "$", "page", "->", "getUITheme", "(", ")", "->", "getResource"...
Возвращает HTML-код раздела @return string HTML @uses EresusForm @uses Templates
[ "Возвращает", "HTML", "-", "код", "раздела" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/settings.php#L127-L183
Eresus/EresusCMS
src/core/settings.php
TSettings.adminRender
function adminRender() { Eresus_Kernel::log(__METHOD__, LOG_DEBUG, '()'); if (!UserRights($this->access)) { return ''; } if (HTTP::request()->getMethod() == 'POST') { $this->update(); } $html = $this->renderForm(); ret...
php
function adminRender() { Eresus_Kernel::log(__METHOD__, LOG_DEBUG, '()'); if (!UserRights($this->access)) { return ''; } if (HTTP::request()->getMethod() == 'POST') { $this->update(); } $html = $this->renderForm(); ret...
[ "function", "adminRender", "(", ")", "{", "Eresus_Kernel", "::", "log", "(", "__METHOD__", ",", "LOG_DEBUG", ",", "'()'", ")", ";", "if", "(", "!", "UserRights", "(", "$", "this", "->", "access", ")", ")", "{", "return", "''", ";", "}", "if", "(", ...
Отрисовка контента @return string @uses HTTP::request
[ "Отрисовка", "контента" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/settings.php#L190-L205
nabab/bbn
src/bbn/html/element.php
element._init
private static function _init(){ if ( !self::$validator ){ self::$validator = new \JsonSchema\Validator(); if ( \is_string(self::$schema) ){ self::$schema = json_decode(self::$schema); } } if ( !empty(static::$schema) ){ static::$schema = bbn\x::merge_objects(self::$schema, b...
php
private static function _init(){ if ( !self::$validator ){ self::$validator = new \JsonSchema\Validator(); if ( \is_string(self::$schema) ){ self::$schema = json_decode(self::$schema); } } if ( !empty(static::$schema) ){ static::$schema = bbn\x::merge_objects(self::$schema, b...
[ "private", "static", "function", "_init", "(", ")", "{", "if", "(", "!", "self", "::", "$", "validator", ")", "{", "self", "::", "$", "validator", "=", "new", "\\", "JsonSchema", "\\", "Validator", "(", ")", ";", "if", "(", "\\", "is_string", "(", ...
This creates a unique JSON schema validator object And for each type of class generates the according JSON schema By combining this root classs element schema And the child class' schema The schema has then to be called static::$schema and not self::$schema @return void
[ "This", "creates", "a", "unique", "JSON", "schema", "validator", "object", "And", "for", "each", "type", "of", "class", "generates", "the", "according", "JSON", "schema", "By", "combining", "this", "root", "classs", "element", "schema", "And", "the", "child", ...
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/html/element.php#L169-L182
nabab/bbn
src/bbn/html/element.php
element.cast
private static function cast(array $cfg, $schema=null){ if ( \is_null($schema) && \is_object(static::$schema) ){ $schema = static::$schema; } if ( \is_object($schema) && \is_array($cfg) && isset($schema->properties) ){ foreach ( $schema->properties as $k => $p ){ if ( empty($cfg[$k]) ){ ...
php
private static function cast(array $cfg, $schema=null){ if ( \is_null($schema) && \is_object(static::$schema) ){ $schema = static::$schema; } if ( \is_object($schema) && \is_array($cfg) && isset($schema->properties) ){ foreach ( $schema->properties as $k => $p ){ if ( empty($cfg[$k]) ){ ...
[ "private", "static", "function", "cast", "(", "array", "$", "cfg", ",", "$", "schema", "=", "null", ")", "{", "if", "(", "\\", "is_null", "(", "$", "schema", ")", "&&", "\\", "is_object", "(", "static", "::", "$", "schema", ")", ")", "{", "$", "s...
Returns a config more adequate for the schema: converts the types according to the schema @param array $cfg Configuration @param object $schema JSON Schema @return array
[ "Returns", "a", "config", "more", "adequate", "for", "the", "schema", ":", "converts", "the", "types", "according", "to", "the", "schema" ]
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/html/element.php#L192-L215
nabab/bbn
src/bbn/html/element.php
element.check_config
public static function check_config($cfg){ if ( !\is_array($cfg) ){ self::$error = "The configuration is not a valid array"; return false; } self::$validator->check(bbn\x::to_object($cfg), static::$schema); self::$error = ''; if ( self::$validator->isValid() ){ return 1; } ...
php
public static function check_config($cfg){ if ( !\is_array($cfg) ){ self::$error = "The configuration is not a valid array"; return false; } self::$validator->check(bbn\x::to_object($cfg), static::$schema); self::$error = ''; if ( self::$validator->isValid() ){ return 1; } ...
[ "public", "static", "function", "check_config", "(", "$", "cfg", ")", "{", "if", "(", "!", "\\", "is_array", "(", "$", "cfg", ")", ")", "{", "self", "::", "$", "error", "=", "\"The configuration is not a valid array\"", ";", "return", "false", ";", "}", ...
Confront the JSON schema object with the current configuration @param array $cfg Configuration @return bool
[ "Confront", "the", "JSON", "schema", "object", "with", "the", "current", "configuration" ]
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/html/element.php#L232-L247
nabab/bbn
src/bbn/html/element.php
element.css_to_string
public static function css_to_string($css){ if ( \is_string($css) ){ return ' style="'.bbn\str::escape_dquotes($css).'"'; } else if ( \is_array($css) && \count($css) > 0 ){ $st = ''; foreach ( $css as $prop => $val ){ $st .= $prop.':'.$val.';'; } return ' style="'.bbn\s...
php
public static function css_to_string($css){ if ( \is_string($css) ){ return ' style="'.bbn\str::escape_dquotes($css).'"'; } else if ( \is_array($css) && \count($css) > 0 ){ $st = ''; foreach ( $css as $prop => $val ){ $st .= $prop.':'.$val.';'; } return ' style="'.bbn\s...
[ "public", "static", "function", "css_to_string", "(", "$", "css", ")", "{", "if", "(", "\\", "is_string", "(", "$", "css", ")", ")", "{", "return", "' style=\"'", ".", "bbn", "\\", "str", "::", "escape_dquotes", "(", "$", "css", ")", ".", "'\"'", ";"...
Generates style string for a HTML tag @param array|string $css CSS properties/values array @return string
[ "Generates", "style", "string", "for", "a", "HTML", "tag" ]
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/html/element.php#L266-L277
nabab/bbn
src/bbn/html/element.php
element.update
protected function update() { $this->cfg = []; foreach ( $this as $key => $var ){ if ( $key !== 'cfg' && !\is_null($var) ){ if ( \is_array($var) ){ foreach ( $var as $k => $v ){ if ( !isset($this->cfg[$key]) ){ $this->cfg[$key] = []; } ...
php
protected function update() { $this->cfg = []; foreach ( $this as $key => $var ){ if ( $key !== 'cfg' && !\is_null($var) ){ if ( \is_array($var) ){ foreach ( $var as $k => $v ){ if ( !isset($this->cfg[$key]) ){ $this->cfg[$key] = []; } ...
[ "protected", "function", "update", "(", ")", "{", "$", "this", "->", "cfg", "=", "[", "]", ";", "foreach", "(", "$", "this", "as", "$", "key", "=>", "$", "var", ")", "{", "if", "(", "$", "key", "!==", "'cfg'", "&&", "!", "\\", "is_null", "(", ...
Sets the configuration property according to the current configuration @return bbn\html\element
[ "Sets", "the", "configuration", "property", "according", "to", "the", "current", "configuration" ]
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/html/element.php#L375-L396
nabab/bbn
src/bbn/html/element.php
element.append
public function append($ele) { $args = \func_get_args(); foreach ( $args as $ele ){ if ( !isset($this->content) ){ if ( \is_array($ele) && isset($ele[0]) ){ $this->content = $ele; } else{ $this->content = \is_object($ele) ? [$ele] : $ele; } } ...
php
public function append($ele) { $args = \func_get_args(); foreach ( $args as $ele ){ if ( !isset($this->content) ){ if ( \is_array($ele) && isset($ele[0]) ){ $this->content = $ele; } else{ $this->content = \is_object($ele) ? [$ele] : $ele; } } ...
[ "public", "function", "append", "(", "$", "ele", ")", "{", "$", "args", "=", "\\", "func_get_args", "(", ")", ";", "foreach", "(", "$", "args", "as", "$", "ele", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "content", ")", ")", "{...
Add an element to the content, or a string if it's one @param string|bbn\html\element $ele
[ "Add", "an", "element", "to", "the", "content", "or", "a", "string", "if", "it", "s", "one" ]
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/html/element.php#L403-L435
nabab/bbn
src/bbn/html/element.php
element.get_config
public function get_config() { $this->update(); $tmp = bbn\x::remove_empty($this->cfg); if ( isset($tmp['content']) && \is_array($tmp['content']) ){ foreach ( $tmp['content'] as $i => $c ){ if ( \is_object($c) ){ if (method_exists($c, 'get_config') ){ $tmp['content'][$i] =...
php
public function get_config() { $this->update(); $tmp = bbn\x::remove_empty($this->cfg); if ( isset($tmp['content']) && \is_array($tmp['content']) ){ foreach ( $tmp['content'] as $i => $c ){ if ( \is_object($c) ){ if (method_exists($c, 'get_config') ){ $tmp['content'][$i] =...
[ "public", "function", "get_config", "(", ")", "{", "$", "this", "->", "update", "(", ")", ";", "$", "tmp", "=", "bbn", "\\", "x", "::", "remove_empty", "(", "$", "this", "->", "cfg", ")", ";", "if", "(", "isset", "(", "$", "tmp", "[", "'content'"...
Returns the current configuration. @return array Current configuration
[ "Returns", "the", "current", "configuration", "." ]
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/html/element.php#L441-L455
nabab/bbn
src/bbn/html/element.php
element.script
public function script($with_ele=1) { $this->update(); $r = ''; if ( isset($this->attr['id']) ){ if ( isset($this->cfg['events']) ){ foreach ( $this->cfg['events'] as $event => $fn ){ $r .= '.'.$event.'('. ( strpos($fn, 'function') === 0 ? $fn : 'function(e){'.$fn.'}' ...
php
public function script($with_ele=1) { $this->update(); $r = ''; if ( isset($this->attr['id']) ){ if ( isset($this->cfg['events']) ){ foreach ( $this->cfg['events'] as $event => $fn ){ $r .= '.'.$event.'('. ( strpos($fn, 'function') === 0 ? $fn : 'function(e){'.$fn.'}' ...
[ "public", "function", "script", "(", "$", "with_ele", "=", "1", ")", "{", "$", "this", "->", "update", "(", ")", ";", "$", "r", "=", "''", ";", "if", "(", "isset", "(", "$", "this", "->", "attr", "[", "'id'", "]", ")", ")", "{", "if", "(", ...
Returns the javascript coming with the object @return string javascript string
[ "Returns", "the", "javascript", "coming", "with", "the", "object" ]
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/html/element.php#L482-L547
nabab/bbn
src/bbn/html/element.php
element.html
public function html($with_js = 1) { $html = ''; if ( $this->tag ){ $this->update(); // TAG $html .= '<'.$this->tag; foreach ( $this->attr as $key => $val ){ if ( \is_string($key) ){ $html .= ' '.htmlspecialchars($key).'="'; if ( is_numeric($val) ){ $htm...
php
public function html($with_js = 1) { $html = ''; if ( $this->tag ){ $this->update(); // TAG $html .= '<'.$this->tag; foreach ( $this->attr as $key => $val ){ if ( \is_string($key) ){ $html .= ' '.htmlspecialchars($key).'="'; if ( is_numeric($val) ){ $htm...
[ "public", "function", "html", "(", "$", "with_js", "=", "1", ")", "{", "$", "html", "=", "''", ";", "if", "(", "$", "this", "->", "tag", ")", "{", "$", "this", "->", "update", "(", ")", ";", "// TAG", "$", "html", ".=", "'<'", ".", "$", "this...
Returns the corresponding HTML string @param bool $with_js Includes the javascript @return string HTML string
[ "Returns", "the", "corresponding", "HTML", "string" ]
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/html/element.php#L601-L660
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/mbox/mbox_set.php
ezcMailMboxSet.getNextLine
public function getNextLine() { if ( $this->currentMessagePosition === 0 ) { $this->nextMail(); } if ( $this->hasMoreMailData ) { $data = fgets( $this->fh ); if ( feof( $this->fh ) || substr( $data, 0, 5 ) === "From " ) { ...
php
public function getNextLine() { if ( $this->currentMessagePosition === 0 ) { $this->nextMail(); } if ( $this->hasMoreMailData ) { $data = fgets( $this->fh ); if ( feof( $this->fh ) || substr( $data, 0, 5 ) === "From " ) { ...
[ "public", "function", "getNextLine", "(", ")", "{", "if", "(", "$", "this", "->", "currentMessagePosition", "===", "0", ")", "{", "$", "this", "->", "nextMail", "(", ")", ";", "}", "if", "(", "$", "this", "->", "hasMoreMailData", ")", "{", "$", "data...
Returns one line of data from the current mail in the set including the ending linebreak. Null is returned if there is no current mail in the set or the end of the mail is reached. @return string
[ "Returns", "one", "line", "of", "data", "from", "the", "current", "mail", "in", "the", "set", "including", "the", "ending", "linebreak", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/mbox/mbox_set.php#L101-L119
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/mbox/mbox_set.php
ezcMailMboxSet.nextMail
public function nextMail() { // seek to next message if available if ( $this->currentMessagePosition > count( $this->messagePositions ) - 1 ) { $this->hasMoreMailData = false; return false; } fseek( $this->fh, $this->messagePositions[$this->currentMess...
php
public function nextMail() { // seek to next message if available if ( $this->currentMessagePosition > count( $this->messagePositions ) - 1 ) { $this->hasMoreMailData = false; return false; } fseek( $this->fh, $this->messagePositions[$this->currentMess...
[ "public", "function", "nextMail", "(", ")", "{", "// seek to next message if available", "if", "(", "$", "this", "->", "currentMessagePosition", ">", "count", "(", "$", "this", "->", "messagePositions", ")", "-", "1", ")", "{", "$", "this", "->", "hasMoreMailD...
Moves the set to the next mail and returns true upon success. False is returned if there are no more mail in the set. @return bool
[ "Moves", "the", "set", "to", "the", "next", "mail", "and", "returns", "true", "upon", "success", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/mbox/mbox_set.php#L138-L151
artscorestudio/document-bundle
Controller/PostController.php
PostController.listAction
public function listAction() { $this->denyAccessUnlessGranted('ROLE_ADMIN', null, 'Unable to access this page !'); $postManager = $this->get('asf_document.post.manager'); // Define DataGrid Source $source = new Entity($postManager->getClassName()); // Get datagrid $grid = $this->get('grid'); $gr...
php
public function listAction() { $this->denyAccessUnlessGranted('ROLE_ADMIN', null, 'Unable to access this page !'); $postManager = $this->get('asf_document.post.manager'); // Define DataGrid Source $source = new Entity($postManager->getClassName()); // Get datagrid $grid = $this->get('grid'); $gr...
[ "public", "function", "listAction", "(", ")", "{", "$", "this", "->", "denyAccessUnlessGranted", "(", "'ROLE_ADMIN'", ",", "null", ",", "'Unable to access this page !'", ")", ";", "$", "postManager", "=", "$", "this", "->", "get", "(", "'asf_document.post.manager'...
List all blog posts @return \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response
[ "List", "all", "blog", "posts" ]
train
https://github.com/artscorestudio/document-bundle/blob/3aceab0f75de8f7dd0fad0d0db83d7940bf565c8/Controller/PostController.php#L42-L124
artscorestudio/document-bundle
Controller/PostController.php
PostController.editAction
public function editAction(Request $request, $id = null) { $this->denyAccessUnlessGranted('ROLE_ADMIN', null, 'Unable to access this page !'); $postManager = $this->get('asf_document.post.manager'); if ( !is_null($id) ) { $original = $postManager->getRepository()->findOneBy(array('id' => $id)); if (...
php
public function editAction(Request $request, $id = null) { $this->denyAccessUnlessGranted('ROLE_ADMIN', null, 'Unable to access this page !'); $postManager = $this->get('asf_document.post.manager'); if ( !is_null($id) ) { $original = $postManager->getRepository()->findOneBy(array('id' => $id)); if (...
[ "public", "function", "editAction", "(", "Request", "$", "request", ",", "$", "id", "=", "null", ")", "{", "$", "this", "->", "denyAccessUnlessGranted", "(", "'ROLE_ADMIN'", ",", "null", ",", "'Unable to access this page !'", ")", ";", "$", "postManager", "=",...
Add or edit a post @param integer $id ASFDocumentBundle:Post Entity ID @throws AccessDeniedException If user does not have ACL's rights for edit the post @throws \Exception Error on post's author not found or post not found @return \Symfony\Component\HttpFoundation\Response
[ "Add", "or", "edit", "a", "post" ]
train
https://github.com/artscorestudio/document-bundle/blob/3aceab0f75de8f7dd0fad0d0db83d7940bf565c8/Controller/PostController.php#L134-L196
artscorestudio/document-bundle
Controller/PostController.php
PostController.deleteAction
public function deleteAction($id) { $this->denyAccessUnlessGranted('ROLE_ADMIN', null, 'Unable to access this page !'); $postManager = $this->get('asf_document.post.manager'); $post = $postManager->getRepository()->findOneBy(array('id' => $id)); try { if ( is_null($post) ) throw new \Exception($this...
php
public function deleteAction($id) { $this->denyAccessUnlessGranted('ROLE_ADMIN', null, 'Unable to access this page !'); $postManager = $this->get('asf_document.post.manager'); $post = $postManager->getRepository()->findOneBy(array('id' => $id)); try { if ( is_null($post) ) throw new \Exception($this...
[ "public", "function", "deleteAction", "(", "$", "id", ")", "{", "$", "this", "->", "denyAccessUnlessGranted", "(", "'ROLE_ADMIN'", ",", "null", ",", "'Unable to access this page !'", ")", ";", "$", "postManager", "=", "$", "this", "->", "get", "(", "'asf_docum...
Delete a post @param integer $id ASFDocumentBundle:Post Entity ID @throws AccessDeniedException If user does not have ACL's rights for delete the post @throws \Exception Error on post not found or on removing element from DB @return \Symfony\Component\HttpFoundation\RedirectResponse
[ "Delete", "a", "post" ]
train
https://github.com/artscorestudio/document-bundle/blob/3aceab0f75de8f7dd0fad0d0db83d7940bf565c8/Controller/PostController.php#L206-L231
welderlourenco/laravel-seeder
src/WelderLourenco/LaravelSeeder/Providers/LaravelSeederServiceProvider.php
LaravelSeederServiceProvider.registerDbAll
public function registerDbAll() { $this->app->bind('welderlourenco::command.db.all', function($app) { return new \WelderLourenco\LaravelSeeder\Commands\LaravelSeederAllCommand(); }); $this->commands(array( 'welderlourenco::command.db.all' )); }
php
public function registerDbAll() { $this->app->bind('welderlourenco::command.db.all', function($app) { return new \WelderLourenco\LaravelSeeder\Commands\LaravelSeederAllCommand(); }); $this->commands(array( 'welderlourenco::command.db.all' )); }
[ "public", "function", "registerDbAll", "(", ")", "{", "$", "this", "->", "app", "->", "bind", "(", "'welderlourenco::command.db.all'", ",", "function", "(", "$", "app", ")", "{", "return", "new", "\\", "WelderLourenco", "\\", "LaravelSeeder", "\\", "Commands",...
Register the db:all command.
[ "Register", "the", "db", ":", "all", "command", "." ]
train
https://github.com/welderlourenco/laravel-seeder/blob/165d1f3bd596e985d5ef6ddd5fe3ad21589f17ad/src/WelderLourenco/LaravelSeeder/Providers/LaravelSeederServiceProvider.php#L49-L57
welderlourenco/laravel-seeder
src/WelderLourenco/LaravelSeeder/Providers/LaravelSeederServiceProvider.php
LaravelSeederServiceProvider.registerDbOnly
public function registerDbOnly() { $this->app->bind('welderlourenco::command.db.only', function($app) { return new \WelderLourenco\LaravelSeeder\Commands\LaravelSeederOnlyCommand(); }); $this->commands(array( 'welderlourenco::command.db.only' )); }
php
public function registerDbOnly() { $this->app->bind('welderlourenco::command.db.only', function($app) { return new \WelderLourenco\LaravelSeeder\Commands\LaravelSeederOnlyCommand(); }); $this->commands(array( 'welderlourenco::command.db.only' )); }
[ "public", "function", "registerDbOnly", "(", ")", "{", "$", "this", "->", "app", "->", "bind", "(", "'welderlourenco::command.db.only'", ",", "function", "(", "$", "app", ")", "{", "return", "new", "\\", "WelderLourenco", "\\", "LaravelSeeder", "\\", "Commands...
Register the db:only command.
[ "Register", "the", "db", ":", "only", "command", "." ]
train
https://github.com/welderlourenco/laravel-seeder/blob/165d1f3bd596e985d5ef6ddd5fe3ad21589f17ad/src/WelderLourenco/LaravelSeeder/Providers/LaravelSeederServiceProvider.php#L63-L71
kenphp/ken
src/Helpers/View.php
View.render
public static function render(ResponseInterface $response, $view, array $params = []) { return Application::getInstance()->view->render($response, $view, $params); }
php
public static function render(ResponseInterface $response, $view, array $params = []) { return Application::getInstance()->view->render($response, $view, $params); }
[ "public", "static", "function", "render", "(", "ResponseInterface", "$", "response", ",", "$", "view", ",", "array", "$", "params", "=", "[", "]", ")", "{", "return", "Application", "::", "getInstance", "(", ")", "->", "view", "->", "render", "(", "$", ...
Render a view file. @param ResponseInterface $response @param string $view Path of view file started from 'views' directory @param array $params Assosiative array containing parameters to be passed to view @return ResponseInterface
[ "Render", "a", "view", "file", "." ]
train
https://github.com/kenphp/ken/blob/c454a86f0ab55c52c88e9bff5bc6fb4e7bd9e0eb/src/Helpers/View.php#L22-L25
KunstmaanLegacy/KunstmaanSentryBundle
KunstmaanSentryBundle.php
KunstmaanSentryBundle.boot
public function boot() { if (!$this->container->getParameter('kunstmaan_sentry.enabled')) { return; } $errorHandler = new ErrorHandler($this->container->get('sentry.client')); $errorHandler->registerErrorHandler(true); $errorHandler->registerShutdownFunction(500)...
php
public function boot() { if (!$this->container->getParameter('kunstmaan_sentry.enabled')) { return; } $errorHandler = new ErrorHandler($this->container->get('sentry.client')); $errorHandler->registerErrorHandler(true); $errorHandler->registerShutdownFunction(500)...
[ "public", "function", "boot", "(", ")", "{", "if", "(", "!", "$", "this", "->", "container", "->", "getParameter", "(", "'kunstmaan_sentry.enabled'", ")", ")", "{", "return", ";", "}", "$", "errorHandler", "=", "new", "ErrorHandler", "(", "$", "this", "-...
{@inheritdoc}
[ "{" ]
train
https://github.com/KunstmaanLegacy/KunstmaanSentryBundle/blob/db2bcf2ac5c6864b24715bc596c5feb41c8951cf/KunstmaanSentryBundle.php#L16-L25
mustardandrew/muan-laravel-acl
src/Traits/HasPermissionsTrait.php
HasPermissionsTrait.hasPermissionThroughRole
public function hasPermissionThroughRole($permission) { if (! $this->isMethodRolesExists()) { return false; } if (! $permission = $this->preparePermission($permission)) { return false; } foreach ($permission->roles as $role) { if ($th...
php
public function hasPermissionThroughRole($permission) { if (! $this->isMethodRolesExists()) { return false; } if (! $permission = $this->preparePermission($permission)) { return false; } foreach ($permission->roles as $role) { if ($th...
[ "public", "function", "hasPermissionThroughRole", "(", "$", "permission", ")", "{", "if", "(", "!", "$", "this", "->", "isMethodRolesExists", "(", ")", ")", "{", "return", "false", ";", "}", "if", "(", "!", "$", "permission", "=", "$", "this", "->", "p...
Has permission through role @param Permission|string $permission @return boolean
[ "Has", "permission", "through", "role" ]
train
https://github.com/mustardandrew/muan-laravel-acl/blob/b5f23340b5536babb98d9fd0d727a7a3371c97d5/src/Traits/HasPermissionsTrait.php#L32-L49
mustardandrew/muan-laravel-acl
src/Traits/HasPermissionsTrait.php
HasPermissionsTrait.hasDirectPermission
public function hasDirectPermission($permission) { $name = $permission instanceof Permission ? $permission->name : $permission; return (bool) $this->permissions->where('name', $name)->count(); }
php
public function hasDirectPermission($permission) { $name = $permission instanceof Permission ? $permission->name : $permission; return (bool) $this->permissions->where('name', $name)->count(); }
[ "public", "function", "hasDirectPermission", "(", "$", "permission", ")", "{", "$", "name", "=", "$", "permission", "instanceof", "Permission", "?", "$", "permission", "->", "name", ":", "$", "permission", ";", "return", "(", "bool", ")", "$", "this", "->"...
Has direct permission @param Permission|string $permission @return boolean
[ "Has", "direct", "permission" ]
train
https://github.com/mustardandrew/muan-laravel-acl/blob/b5f23340b5536babb98d9fd0d727a7a3371c97d5/src/Traits/HasPermissionsTrait.php#L57-L61
mustardandrew/muan-laravel-acl
src/Traits/HasPermissionsTrait.php
HasPermissionsTrait.attachPermission
public function attachPermission(...$permissions) { $this->eachPermission($permissions, function($permission) { if (! $this->hasDirectPermission($permission)) { $this->permissions()->attach($permission->id); } }); return $this; }
php
public function attachPermission(...$permissions) { $this->eachPermission($permissions, function($permission) { if (! $this->hasDirectPermission($permission)) { $this->permissions()->attach($permission->id); } }); return $this; }
[ "public", "function", "attachPermission", "(", "...", "$", "permissions", ")", "{", "$", "this", "->", "eachPermission", "(", "$", "permissions", ",", "function", "(", "$", "permission", ")", "{", "if", "(", "!", "$", "this", "->", "hasDirectPermission", "...
Attach permission @param mixed ...$permissions @return $this
[ "Attach", "permission" ]
train
https://github.com/mustardandrew/muan-laravel-acl/blob/b5f23340b5536babb98d9fd0d727a7a3371c97d5/src/Traits/HasPermissionsTrait.php#L69-L78
mustardandrew/muan-laravel-acl
src/Traits/HasPermissionsTrait.php
HasPermissionsTrait.detachPermission
public function detachPermission(...$permissions) { $this->eachPermission($permissions, function($permission) { if ($this->hasDirectPermission($permission)) { $this->permissions()->detach($permission->id); } }); return $this; }
php
public function detachPermission(...$permissions) { $this->eachPermission($permissions, function($permission) { if ($this->hasDirectPermission($permission)) { $this->permissions()->detach($permission->id); } }); return $this; }
[ "public", "function", "detachPermission", "(", "...", "$", "permissions", ")", "{", "$", "this", "->", "eachPermission", "(", "$", "permissions", ",", "function", "(", "$", "permission", ")", "{", "if", "(", "$", "this", "->", "hasDirectPermission", "(", "...
Detach permission @param mixed ...$permissions @return $this
[ "Detach", "permission" ]
train
https://github.com/mustardandrew/muan-laravel-acl/blob/b5f23340b5536babb98d9fd0d727a7a3371c97d5/src/Traits/HasPermissionsTrait.php#L86-L95
mustardandrew/muan-laravel-acl
src/Traits/HasPermissionsTrait.php
HasPermissionsTrait.preparePermission
public function preparePermission($permission) { if ($permission instanceof Permission) { return $permission; } if (is_numeric($permission)) { return Permission::whereId($permission)->first(); } return Permission::whereName($permission)->first(); ...
php
public function preparePermission($permission) { if ($permission instanceof Permission) { return $permission; } if (is_numeric($permission)) { return Permission::whereId($permission)->first(); } return Permission::whereName($permission)->first(); ...
[ "public", "function", "preparePermission", "(", "$", "permission", ")", "{", "if", "(", "$", "permission", "instanceof", "Permission", ")", "{", "return", "$", "permission", ";", "}", "if", "(", "is_numeric", "(", "$", "permission", ")", ")", "{", "return"...
Prepare permission @param Permission|string $permission @return Permission
[ "Prepare", "permission" ]
train
https://github.com/mustardandrew/muan-laravel-acl/blob/b5f23340b5536babb98d9fd0d727a7a3371c97d5/src/Traits/HasPermissionsTrait.php#L125-L136
mustardandrew/muan-laravel-acl
src/Traits/HasPermissionsTrait.php
HasPermissionsTrait.eachPermission
public function eachPermission(array $permissions, callable $callback) { $permissions = array_flatten($permissions); foreach ($permissions as $permission) { if ($permission = $this->preparePermission($permission)) { $callback($permission); } } ...
php
public function eachPermission(array $permissions, callable $callback) { $permissions = array_flatten($permissions); foreach ($permissions as $permission) { if ($permission = $this->preparePermission($permission)) { $callback($permission); } } ...
[ "public", "function", "eachPermission", "(", "array", "$", "permissions", ",", "callable", "$", "callback", ")", "{", "$", "permissions", "=", "array_flatten", "(", "$", "permissions", ")", ";", "foreach", "(", "$", "permissions", "as", "$", "permission", ")...
Calc each permission @param array $permissions @param callable $callback
[ "Calc", "each", "permission" ]
train
https://github.com/mustardandrew/muan-laravel-acl/blob/b5f23340b5536babb98d9fd0d727a7a3371c97d5/src/Traits/HasPermissionsTrait.php#L144-L153
vaibhavpandeyvpz/sandesh
src/UriFactory.php
UriFactory.createUri
public function createUri($uri = '') { $obj = new Uri(); if (empty($uri)) { return $obj; } $url = parse_url($uri); if (!$url) { throw new \InvalidArgumentException('URL passed is not a well-formed URI'); } if (isset($url['fragment'])) {...
php
public function createUri($uri = '') { $obj = new Uri(); if (empty($uri)) { return $obj; } $url = parse_url($uri); if (!$url) { throw new \InvalidArgumentException('URL passed is not a well-formed URI'); } if (isset($url['fragment'])) {...
[ "public", "function", "createUri", "(", "$", "uri", "=", "''", ")", "{", "$", "obj", "=", "new", "Uri", "(", ")", ";", "if", "(", "empty", "(", "$", "uri", ")", ")", "{", "return", "$", "obj", ";", "}", "$", "url", "=", "parse_url", "(", "$",...
{@inheritdoc}
[ "{" ]
train
https://github.com/vaibhavpandeyvpz/sandesh/blob/bea2d06c7cac099ed82da973c922859de4158de0/src/UriFactory.php#L25-L58
bit3archive/php-remote-objects
src/RemoteObjects/Server.php
Server.handle
public function handle() { try { $request = $this->transport->receive(); list($method, $params) = $this->encoder->decodeMethod($request); if (!$method) { $result = null; } else { if ( $this->logger !== null && $this->logger->isHandling(\Monolog\Logger::DEBUG) ) { $this->lo...
php
public function handle() { try { $request = $this->transport->receive(); list($method, $params) = $this->encoder->decodeMethod($request); if (!$method) { $result = null; } else { if ( $this->logger !== null && $this->logger->isHandling(\Monolog\Logger::DEBUG) ) { $this->lo...
[ "public", "function", "handle", "(", ")", "{", "try", "{", "$", "request", "=", "$", "this", "->", "transport", "->", "receive", "(", ")", ";", "list", "(", "$", "method", ",", "$", "params", ")", "=", "$", "this", "->", "encoder", "->", "decodeMet...
Handle a remote invokation request. @return mixed
[ "Handle", "a", "remote", "invokation", "request", "." ]
train
https://github.com/bit3archive/php-remote-objects/blob/0a917cdb261d83b1e89bdbdce3627584823bff5f/src/RemoteObjects/Server.php#L138-L178
bit3archive/php-remote-objects
src/RemoteObjects/Server.php
Server.invoke
protected function invoke($targetObject, $methodName, array $methodParams) { if (strpos($methodName, '.') !== false) { list($propertyName, $methodName) = explode('.', $methodName, 2); // access native array item if (is_array($targetObject)) { if (array_key_exists($propertyName, $targetObject)) { r...
php
protected function invoke($targetObject, $methodName, array $methodParams) { if (strpos($methodName, '.') !== false) { list($propertyName, $methodName) = explode('.', $methodName, 2); // access native array item if (is_array($targetObject)) { if (array_key_exists($propertyName, $targetObject)) { r...
[ "protected", "function", "invoke", "(", "$", "targetObject", ",", "$", "methodName", ",", "array", "$", "methodParams", ")", "{", "if", "(", "strpos", "(", "$", "methodName", ",", "'.'", ")", "!==", "false", ")", "{", "list", "(", "$", "propertyName", ...
@param mixed $targetObject @param string $methodName @param array $methodParams @return mixed @throws \Exception
[ "@param", "mixed", "$targetObject", "@param", "string", "$methodName", "@param", "array", "$methodParams" ]
train
https://github.com/bit3archive/php-remote-objects/blob/0a917cdb261d83b1e89bdbdce3627584823bff5f/src/RemoteObjects/Server.php#L188-L295
zhouyl/mellivora
Mellivora/View/Compilers/Compiler.php
Compiler.isExpired
public function isExpired($path) { $compiled = $this->getCompiledPath($path); // If the compiled file doesn't exist we will indicate that the view is expired // so that it can be re-compiled. Else, we will verify the last modification // of the views is less than the modification ti...
php
public function isExpired($path) { $compiled = $this->getCompiledPath($path); // If the compiled file doesn't exist we will indicate that the view is expired // so that it can be re-compiled. Else, we will verify the last modification // of the views is less than the modification ti...
[ "public", "function", "isExpired", "(", "$", "path", ")", "{", "$", "compiled", "=", "$", "this", "->", "getCompiledPath", "(", "$", "path", ")", ";", "// If the compiled file doesn't exist we will indicate that the view is expired", "// so that it can be re-compiled. Else,...
Determine if the view at the given path is expired. @param string $path @return bool
[ "Determine", "if", "the", "view", "at", "the", "given", "path", "is", "expired", "." ]
train
https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/View/Compilers/Compiler.php#L62-L74
shabbyrobe/amiss
doc/demo/ar.php
ArtistRecord.getType
public function getType() { if ($this->type === null) { $this->type = $this->getRelated('type'); } return $this->type; }
php
public function getType() { if ($this->type === null) { $this->type = $this->getRelated('type'); } return $this->type; }
[ "public", "function", "getType", "(", ")", "{", "if", "(", "$", "this", "->", "type", "===", "null", ")", "{", "$", "this", "->", "type", "=", "$", "this", "->", "getRelated", "(", "'type'", ")", ";", "}", "return", "$", "this", "->", "type", ";"...
:amiss = {"has": {"type": "one", "of": "Amiss\\Demo\\Active\\ArtistType", "from": "artistTypeId"}};
[ ":", "amiss", "=", "{", "has", ":", "{", "type", ":", "one", "of", ":", "Amiss", "\\\\", "Demo", "\\\\", "Active", "\\\\", "ArtistType", "from", ":", "artistTypeId", "}}", ";" ]
train
https://github.com/shabbyrobe/amiss/blob/ba261f0d1f985ed36e9fd2903ac0df86c5b9498d/doc/demo/ar.php#L33-L39
shabbyrobe/amiss
doc/demo/ar.php
ArtistType.getArtists
public function getArtists() { if ($this->artists === null) { $this->artists = $this->getRelated('artists'); } return $this->artists; }
php
public function getArtists() { if ($this->artists === null) { $this->artists = $this->getRelated('artists'); } return $this->artists; }
[ "public", "function", "getArtists", "(", ")", "{", "if", "(", "$", "this", "->", "artists", "===", "null", ")", "{", "$", "this", "->", "artists", "=", "$", "this", "->", "getRelated", "(", "'artists'", ")", ";", "}", "return", "$", "this", "->", "...
:amiss = {"has": { "type": "many", "of" : "Amiss\\Demo\\Active\\ArtistRecord", "to" : "artistTypeId" }};
[ ":", "amiss", "=", "{", "has", ":", "{", "type", ":", "many", "of", ":", "Amiss", "\\\\", "Demo", "\\\\", "Active", "\\\\", "ArtistRecord", "to", ":", "artistTypeId", "}}", ";" ]
train
https://github.com/shabbyrobe/amiss/blob/ba261f0d1f985ed36e9fd2903ac0df86c5b9498d/doc/demo/ar.php#L66-L72
shabbyrobe/amiss
doc/demo/ar.php
EventRecord.getVenue
public function getVenue() { if (!$this->venue && $this->venueId) { $this->venue = $this->getRelated('venue'); } return $this->venue; }
php
public function getVenue() { if (!$this->venue && $this->venueId) { $this->venue = $this->getRelated('venue'); } return $this->venue; }
[ "public", "function", "getVenue", "(", ")", "{", "if", "(", "!", "$", "this", "->", "venue", "&&", "$", "this", "->", "venueId", ")", "{", "$", "this", "->", "venue", "=", "$", "this", "->", "getRelated", "(", "'venue'", ")", ";", "}", "return", ...
:amiss = {"has": {"type": "one", "of": "Amiss\\Demo\\Active\\VenueRecord", "from": "venueId"}};
[ ":", "amiss", "=", "{", "has", ":", "{", "type", ":", "one", "of", ":", "Amiss", "\\\\", "Demo", "\\\\", "Active", "\\\\", "VenueRecord", "from", ":", "venueId", "}}", ";" ]
train
https://github.com/shabbyrobe/amiss/blob/ba261f0d1f985ed36e9fd2903ac0df86c5b9498d/doc/demo/ar.php#L111-L117
wenbinye/PhalconX
src/Php/AutoUseFixer.php
AutoUseFixer.enterUse
public function enterUse(Node\Stmt\Use_ $node) { $this->stmts[] = $node; foreach ($node->uses as $use) { if (isset($this->uses[$use->alias])) { if ($this->logger) { $this->logger->warning("use {0} conflicts", [$use->name]); } ...
php
public function enterUse(Node\Stmt\Use_ $node) { $this->stmts[] = $node; foreach ($node->uses as $use) { if (isset($this->uses[$use->alias])) { if ($this->logger) { $this->logger->warning("use {0} conflicts", [$use->name]); } ...
[ "public", "function", "enterUse", "(", "Node", "\\", "Stmt", "\\", "Use_", "$", "node", ")", "{", "$", "this", "->", "stmts", "[", "]", "=", "$", "node", ";", "foreach", "(", "$", "node", "->", "uses", "as", "$", "use", ")", "{", "if", "(", "is...
collect use
[ "collect", "use" ]
train
https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Php/AutoUseFixer.php#L70-L82
rhosocial/yii2-user
rbac/DbManager.php
DbManager.getRolesByUser
public function getRolesByUser($userGuid) { if (!isset($userGuid) || $userGuid === '') { return []; } if ($userGuid instanceof User) { $userGuid = $userGuid->getGUID(); } $query = (new Query)->select('b.*') ->from(['a' => $this->a...
php
public function getRolesByUser($userGuid) { if (!isset($userGuid) || $userGuid === '') { return []; } if ($userGuid instanceof User) { $userGuid = $userGuid->getGUID(); } $query = (new Query)->select('b.*') ->from(['a' => $this->a...
[ "public", "function", "getRolesByUser", "(", "$", "userGuid", ")", "{", "if", "(", "!", "isset", "(", "$", "userGuid", ")", "||", "$", "userGuid", "===", "''", ")", "{", "return", "[", "]", ";", "}", "if", "(", "$", "userGuid", "instanceof", "User", ...
Get roles by user. @param string|User $userGuid @return array
[ "Get", "roles", "by", "user", "." ]
train
https://github.com/rhosocial/yii2-user/blob/96737a9d8ca7e9c42cd2b7736d6c0a90ede6e5bc/rbac/DbManager.php#L148-L169
rhosocial/yii2-user
rbac/DbManager.php
DbManager.getDirectPermissionsByUser
protected function getDirectPermissionsByUser($userGuid) { $query = (new Query)->select('b.*') ->from(['a' => $this->assignmentTable, 'b' => $this->itemTable]) ->where('{{a}}.[[item_name]]={{b}}.[[name]]') ->andWhere(['a.user_guid' => (string) $userGuid]) ->an...
php
protected function getDirectPermissionsByUser($userGuid) { $query = (new Query)->select('b.*') ->from(['a' => $this->assignmentTable, 'b' => $this->itemTable]) ->where('{{a}}.[[item_name]]={{b}}.[[name]]') ->andWhere(['a.user_guid' => (string) $userGuid]) ->an...
[ "protected", "function", "getDirectPermissionsByUser", "(", "$", "userGuid", ")", "{", "$", "query", "=", "(", "new", "Query", ")", "->", "select", "(", "'b.*'", ")", "->", "from", "(", "[", "'a'", "=>", "$", "this", "->", "assignmentTable", ",", "'b'", ...
Returns all permissions that are directly assigned to user. @param string|User $userGuid the user GUID (see [[\rhosocial\user\User::guid]]) @return Permission[] all direct permissions that the user has. The array is indexed by the permission names.
[ "Returns", "all", "permissions", "that", "are", "directly", "assigned", "to", "user", "." ]
train
https://github.com/rhosocial/yii2-user/blob/96737a9d8ca7e9c42cd2b7736d6c0a90ede6e5bc/rbac/DbManager.php#L176-L189
rhosocial/yii2-user
rbac/DbManager.php
DbManager.getInheritedPermissionsByUser
protected function getInheritedPermissionsByUser($userGuid) { $query = (new Query)->select('item_name') ->from($this->assignmentTable) ->where(['user_guid' => (string) $userGuid]); $childrenList = $this->getChildrenList(); $result = []; foreach ($query->colum...
php
protected function getInheritedPermissionsByUser($userGuid) { $query = (new Query)->select('item_name') ->from($this->assignmentTable) ->where(['user_guid' => (string) $userGuid]); $childrenList = $this->getChildrenList(); $result = []; foreach ($query->colum...
[ "protected", "function", "getInheritedPermissionsByUser", "(", "$", "userGuid", ")", "{", "$", "query", "=", "(", "new", "Query", ")", "->", "select", "(", "'item_name'", ")", "->", "from", "(", "$", "this", "->", "assignmentTable", ")", "->", "where", "("...
Returns all permissions that the user inherits from the roles assigned to him. @param string|User $userGuid the user GUID (see [[\rhosocial\user\User::guid]]) @return Permission[] all inherited permissions that the user has. The array is indexed by the permission names.
[ "Returns", "all", "permissions", "that", "the", "user", "inherits", "from", "the", "roles", "assigned", "to", "him", "." ]
train
https://github.com/rhosocial/yii2-user/blob/96737a9d8ca7e9c42cd2b7736d6c0a90ede6e5bc/rbac/DbManager.php#L196-L221
rhosocial/yii2-user
rbac/DbManager.php
DbManager.revokeFailedAssignment
protected function revokeFailedAssignment(Assignment $assignment) { if ($assignment->failedAt === null) { return false; } if (strtotime($assignment->failedAt) < strtotime(gmdate('Y-m-d H:i:s'))) { $role = $this->getRole($assignment->roleName); if (!$role) ...
php
protected function revokeFailedAssignment(Assignment $assignment) { if ($assignment->failedAt === null) { return false; } if (strtotime($assignment->failedAt) < strtotime(gmdate('Y-m-d H:i:s'))) { $role = $this->getRole($assignment->roleName); if (!$role) ...
[ "protected", "function", "revokeFailedAssignment", "(", "Assignment", "$", "assignment", ")", "{", "if", "(", "$", "assignment", "->", "failedAt", "===", "null", ")", "{", "return", "false", ";", "}", "if", "(", "strtotime", "(", "$", "assignment", "->", "...
Revoke failed assignment. If assignment's `failedAt` attribute is `null`, false will be given directly. @param Assignment $assignment @return boolean
[ "Revoke", "failed", "assignment", ".", "If", "assignment", "s", "failedAt", "attribute", "is", "null", "false", "will", "be", "given", "directly", "." ]
train
https://github.com/rhosocial/yii2-user/blob/96737a9d8ca7e9c42cd2b7736d6c0a90ede6e5bc/rbac/DbManager.php#L264-L278
rhosocial/yii2-user
rbac/DbManager.php
DbManager.getUserGuidsByRole
public function getUserGuidsByRole($roleName) { if (empty($roleName)) { return []; } return (new Query)->select('[[user_guid]]') ->from($this->assignmentTable) ->where(['item_name' => $roleName])->column($this->db); }
php
public function getUserGuidsByRole($roleName) { if (empty($roleName)) { return []; } return (new Query)->select('[[user_guid]]') ->from($this->assignmentTable) ->where(['item_name' => $roleName])->column($this->db); }
[ "public", "function", "getUserGuidsByRole", "(", "$", "roleName", ")", "{", "if", "(", "empty", "(", "$", "roleName", ")", ")", "{", "return", "[", "]", ";", "}", "return", "(", "new", "Query", ")", "->", "select", "(", "'[[user_guid]]'", ")", "->", ...
Returns all role assignment information for the specified role. @param string $roleName @return Assignment[] the assignments. An empty array will be returned if role is not assigned to any user. @since 2.0.7
[ "Returns", "all", "role", "assignment", "information", "for", "the", "specified", "role", "." ]
train
https://github.com/rhosocial/yii2-user/blob/96737a9d8ca7e9c42cd2b7736d6c0a90ede6e5bc/rbac/DbManager.php#L387-L396
PhrozenByte/pico-parse-pages-content
PicoParsePagesContent.php
PicoParsePagesContent.onSinglePageLoaded
public function onSinglePageLoaded(array &$pageData) { if (!isset($pageData['content'])) { $pageData['content'] = $this->prepareFileContent($pageData['raw_content'], $pageData['meta']); $pageData['content'] = $this->parseFileContent($pageData['content']); } }
php
public function onSinglePageLoaded(array &$pageData) { if (!isset($pageData['content'])) { $pageData['content'] = $this->prepareFileContent($pageData['raw_content'], $pageData['meta']); $pageData['content'] = $this->parseFileContent($pageData['content']); } }
[ "public", "function", "onSinglePageLoaded", "(", "array", "&", "$", "pageData", ")", "{", "if", "(", "!", "isset", "(", "$", "pageData", "[", "'content'", "]", ")", ")", "{", "$", "pageData", "[", "'content'", "]", "=", "$", "this", "->", "prepareFileC...
Parses the contents of all pages @see DummyPlugin::onSinglePageLoaded()
[ "Parses", "the", "contents", "of", "all", "pages" ]
train
https://github.com/PhrozenByte/pico-parse-pages-content/blob/fda8266f04d5bf523de1a07665a8d4c268099130/PicoParsePagesContent.php#L48-L54
php-lug/lug
src/Component/Grid/Column/Type/TextType.php
TextType.render
public function render($data, array $options) { $text = $this->getValue($data, $options); if ($text === null) { return; } if (!is_scalar($text)) { throw new InvalidTypeException(sprintf( 'The "%s" %s column type expects a scalar value, got "%...
php
public function render($data, array $options) { $text = $this->getValue($data, $options); if ($text === null) { return; } if (!is_scalar($text)) { throw new InvalidTypeException(sprintf( 'The "%s" %s column type expects a scalar value, got "%...
[ "public", "function", "render", "(", "$", "data", ",", "array", "$", "options", ")", "{", "$", "text", "=", "$", "this", "->", "getValue", "(", "$", "data", ",", "$", "options", ")", ";", "if", "(", "$", "text", "===", "null", ")", "{", "return",...
{@inheritdoc}
[ "{" ]
train
https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Grid/Column/Type/TextType.php#L24-L42
CodeSleeve/fixture-l4
src/Codesleeve/FixtureL4/FixtureL4ServiceProvider.php
FixtureL4ServiceProvider.register
public function register() { $this->app->singleton('driver', function() { $db = $this->app['db']->connection()->getPdo(); return new EloquentDriver($db, $this->app['Str']); }); $this->app->bind('fixture', function() { $fixture = Fixture::getInstance(); $fixture->setDriver($th...
php
public function register() { $this->app->singleton('driver', function() { $db = $this->app['db']->connection()->getPdo(); return new EloquentDriver($db, $this->app['Str']); }); $this->app->bind('fixture', function() { $fixture = Fixture::getInstance(); $fixture->setDriver($th...
[ "public", "function", "register", "(", ")", "{", "$", "this", "->", "app", "->", "singleton", "(", "'driver'", ",", "function", "(", ")", "{", "$", "db", "=", "$", "this", "->", "app", "[", "'db'", "]", "->", "connection", "(", ")", "->", "getPdo",...
Register the service provider. @return void
[ "Register", "the", "service", "provider", "." ]
train
https://github.com/CodeSleeve/fixture-l4/blob/23db25bce6756221119f21ce58d1a675d1db5c23/src/Codesleeve/FixtureL4/FixtureL4ServiceProvider.php#L31-L48
oroinc/OroLayoutComponent
LayoutItem.php
LayoutItem.initialize
public function initialize($id, $alias = null) { $this->id = $id; $this->alias = $alias; }
php
public function initialize($id, $alias = null) { $this->id = $id; $this->alias = $alias; }
[ "public", "function", "initialize", "(", "$", "id", ",", "$", "alias", "=", "null", ")", "{", "$", "this", "->", "id", "=", "$", "id", ";", "$", "this", "->", "alias", "=", "$", "alias", ";", "}" ]
Initializes the state of this object @param string $id The layout item id @param string|null $alias The layout item alias
[ "Initializes", "the", "state", "of", "this", "object" ]
train
https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/LayoutItem.php#L37-L41
trunda/SmfMenu
src/Smf/Menu/MenuExtension.php
MenuExtension.buildOptions
public function buildOptions(array $options) { $options = array_merge( array( 'link' => null, 'icon' => null, ), $options ); if (isset($options['link']) && $options['link'] !== null) { $options['extras']['link']...
php
public function buildOptions(array $options) { $options = array_merge( array( 'link' => null, 'icon' => null, ), $options ); if (isset($options['link']) && $options['link'] !== null) { $options['extras']['link']...
[ "public", "function", "buildOptions", "(", "array", "$", "options", ")", "{", "$", "options", "=", "array_merge", "(", "array", "(", "'link'", "=>", "null", ",", "'icon'", "=>", "null", ",", ")", ",", "$", "options", ")", ";", "if", "(", "isset", "("...
Builds the full option array used to configure the item. @param array $options The options processed by the previous extensions @return array
[ "Builds", "the", "full", "option", "array", "used", "to", "configure", "the", "item", "." ]
train
https://github.com/trunda/SmfMenu/blob/739e74fb664c1f018b4a74142bd28d20c004bac6/src/Smf/Menu/MenuExtension.php#L18-L33
novaway/open-graph
src/View/OpenGraphRenderer.php
OpenGraphRenderer.renderNamespaceAttributes
public function renderNamespaceAttributes(OpenGraphInterface $graph, $withTag = true) { $namespaces = $graph->getNamespaces(); if (empty($namespaces)) { return ''; } $attributes = ''; foreach ($namespaces as $prefix => $uri) { if (!empty($attributes))...
php
public function renderNamespaceAttributes(OpenGraphInterface $graph, $withTag = true) { $namespaces = $graph->getNamespaces(); if (empty($namespaces)) { return ''; } $attributes = ''; foreach ($namespaces as $prefix => $uri) { if (!empty($attributes))...
[ "public", "function", "renderNamespaceAttributes", "(", "OpenGraphInterface", "$", "graph", ",", "$", "withTag", "=", "true", ")", "{", "$", "namespaces", "=", "$", "graph", "->", "getNamespaces", "(", ")", ";", "if", "(", "empty", "(", "$", "namespaces", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/novaway/open-graph/blob/19817bee4b91cf26ca3fe44883ad58b32328e464/src/View/OpenGraphRenderer.php#L28-L49
novaway/open-graph
src/View/OpenGraphRenderer.php
OpenGraphRenderer.render
public function render(OpenGraphInterface $graph, $tagSeparator = '') { $html = ''; foreach ($graph->getTags() as $tag) { if (!empty($html)) { $html .= $tagSeparator; } $html .= $this->renderTag($tag); } return $html; }
php
public function render(OpenGraphInterface $graph, $tagSeparator = '') { $html = ''; foreach ($graph->getTags() as $tag) { if (!empty($html)) { $html .= $tagSeparator; } $html .= $this->renderTag($tag); } return $html; }
[ "public", "function", "render", "(", "OpenGraphInterface", "$", "graph", ",", "$", "tagSeparator", "=", "''", ")", "{", "$", "html", "=", "''", ";", "foreach", "(", "$", "graph", "->", "getTags", "(", ")", "as", "$", "tag", ")", "{", "if", "(", "!"...
{@inheritdoc}
[ "{" ]
train
https://github.com/novaway/open-graph/blob/19817bee4b91cf26ca3fe44883ad58b32328e464/src/View/OpenGraphRenderer.php#L54-L67
novaway/open-graph
src/View/OpenGraphRenderer.php
OpenGraphRenderer.renderTag
public function renderTag(OpenGraphTagInterface $tag) { return str_replace( ['#property#', '#content#'], [sprintf('%s:%s', $tag->getPrefix(), $tag->getProperty()), $tag->getContent()], self::$tagTemplate ); }
php
public function renderTag(OpenGraphTagInterface $tag) { return str_replace( ['#property#', '#content#'], [sprintf('%s:%s', $tag->getPrefix(), $tag->getProperty()), $tag->getContent()], self::$tagTemplate ); }
[ "public", "function", "renderTag", "(", "OpenGraphTagInterface", "$", "tag", ")", "{", "return", "str_replace", "(", "[", "'#property#'", ",", "'#content#'", "]", ",", "[", "sprintf", "(", "'%s:%s'", ",", "$", "tag", "->", "getPrefix", "(", ")", ",", "$", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/novaway/open-graph/blob/19817bee4b91cf26ca3fe44883ad58b32328e464/src/View/OpenGraphRenderer.php#L72-L79
oroinc/OroLayoutComponent
Loader/LayoutUpdateLoader.php
LayoutUpdateLoader.load
public function load($file) { $fileExt = pathinfo($file, PATHINFO_EXTENSION); if (!isset($this->drivers[$fileExt])) { return null; } $driver = $this->drivers[$fileExt]; return $driver->load($file); }
php
public function load($file) { $fileExt = pathinfo($file, PATHINFO_EXTENSION); if (!isset($this->drivers[$fileExt])) { return null; } $driver = $this->drivers[$fileExt]; return $driver->load($file); }
[ "public", "function", "load", "(", "$", "file", ")", "{", "$", "fileExt", "=", "pathinfo", "(", "$", "file", ",", "PATHINFO_EXTENSION", ")", ";", "if", "(", "!", "isset", "(", "$", "this", "->", "drivers", "[", "$", "fileExt", "]", ")", ")", "{", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/Loader/LayoutUpdateLoader.php#L28-L38
PHPPowertools/HTML5
src/PowerTools/HTML5/Parser/CharacterReference.php
HTML5_Parser_CharacterReference.lookupName
public static function lookupName($name) { // Do we really want to return NULL here? or FFFD return isset(HTML5_Entities::$byName[$name]) ? HTML5_Entities::$byName[$name] : null; }
php
public static function lookupName($name) { // Do we really want to return NULL here? or FFFD return isset(HTML5_Entities::$byName[$name]) ? HTML5_Entities::$byName[$name] : null; }
[ "public", "static", "function", "lookupName", "(", "$", "name", ")", "{", "// Do we really want to return NULL here? or FFFD", "return", "isset", "(", "HTML5_Entities", "::", "$", "byName", "[", "$", "name", "]", ")", "?", "HTML5_Entities", "::", "$", "byName", ...
Given a name (e.g. 'amp'), lookup the UTF-8 character ('&') @param string $name The name to look up. @return string The character sequence. In UTF-8 this may be more than one byte.
[ "Given", "a", "name", "(", "e", ".", "g", ".", "amp", ")", "lookup", "the", "UTF", "-", "8", "character", "(", "&", ")" ]
train
https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/CharacterReference.php#L111-L114
phPoirot/psr7
Uri.php
Uri.getPort
public function getPort() { return $this->_isNonStandardPort($this->scheme, $this->host, $this->port) ? $this->port : null; }
php
public function getPort() { return $this->_isNonStandardPort($this->scheme, $this->host, $this->port) ? $this->port : null; }
[ "public", "function", "getPort", "(", ")", "{", "return", "$", "this", "->", "_isNonStandardPort", "(", "$", "this", "->", "scheme", ",", "$", "this", "->", "host", ",", "$", "this", "->", "port", ")", "?", "$", "this", "->", "port", ":", "null", "...
Retrieve the port component of the URI. If a port is present, and it is non-standard for the current scheme, this method MUST return it as an integer. If the port is the standard port used with the current scheme, this method SHOULD return null. If no port is present, and no scheme is present, this method MUST return...
[ "Retrieve", "the", "port", "component", "of", "the", "URI", "." ]
train
https://github.com/phPoirot/psr7/blob/e90295e806dc2eb0cc422f315075f673c63a0780/Uri.php#L145-L150
phPoirot/psr7
Uri.php
Uri.withScheme
public function withScheme($scheme) { $scheme = (string) $scheme; if ($scheme === $this->scheme) // Do nothing if no change was made. return $this; $new = clone $this; $new->scheme = $scheme; return $new; }
php
public function withScheme($scheme) { $scheme = (string) $scheme; if ($scheme === $this->scheme) // Do nothing if no change was made. return $this; $new = clone $this; $new->scheme = $scheme; return $new; }
[ "public", "function", "withScheme", "(", "$", "scheme", ")", "{", "$", "scheme", "=", "(", "string", ")", "$", "scheme", ";", "if", "(", "$", "scheme", "===", "$", "this", "->", "scheme", ")", "// Do nothing if no change was made.", "return", "$", "this", ...
Return an instance with the specified scheme. This method MUST retain the state of the current instance, and return an instance that contains the specified scheme. Implementations MUST support the schemes "http" and "https" case insensitively, and MAY accommodate other schemes if required. An empty scheme is equival...
[ "Return", "an", "instance", "with", "the", "specified", "scheme", "." ]
train
https://github.com/phPoirot/psr7/blob/e90295e806dc2eb0cc422f315075f673c63a0780/Uri.php#L243-L254
phPoirot/psr7
Uri.php
Uri.withHost
public function withHost($host) { $host = $this->_filterHost((string) $host); if ($host === $this->host) // Do nothing if no change was made. return $this; $new = clone $this; $new->host = $host; return $new; }
php
public function withHost($host) { $host = $this->_filterHost((string) $host); if ($host === $this->host) // Do nothing if no change was made. return $this; $new = clone $this; $new->host = $host; return $new; }
[ "public", "function", "withHost", "(", "$", "host", ")", "{", "$", "host", "=", "$", "this", "->", "_filterHost", "(", "(", "string", ")", "$", "host", ")", ";", "if", "(", "$", "host", "===", "$", "this", "->", "host", ")", "// Do nothing if no chan...
Return an instance with the specified host. This method MUST retain the state of the current instance, and return an instance that contains the specified host. An empty host value is equivalent to removing the host. @param string $host The hostname to use with the new instance. @return self A new instance with the s...
[ "Return", "an", "instance", "with", "the", "specified", "host", "." ]
train
https://github.com/phPoirot/psr7/blob/e90295e806dc2eb0cc422f315075f673c63a0780/Uri.php#L297-L308
phPoirot/psr7
Uri.php
Uri.withPath
public function withPath($path) { $path = (string) $path; if (strpos($path, '?') !== false || strpos($path, '#') !== false) throw new \InvalidArgumentException( 'Invalid path provided; must not contain a query or fragment.' ); if ($path === $this->p...
php
public function withPath($path) { $path = (string) $path; if (strpos($path, '?') !== false || strpos($path, '#') !== false) throw new \InvalidArgumentException( 'Invalid path provided; must not contain a query or fragment.' ); if ($path === $this->p...
[ "public", "function", "withPath", "(", "$", "path", ")", "{", "$", "path", "=", "(", "string", ")", "$", "path", ";", "if", "(", "strpos", "(", "$", "path", ",", "'?'", ")", "!==", "false", "||", "strpos", "(", "$", "path", ",", "'#'", ")", "!=...
Return an instance with the specified path. This method MUST retain the state of the current instance, and return an instance that contains the specified path. The path can either be empty or absolute (starting with a slash) or rootless (not starting with a slash). Implementations MUST support all three syntaxes. If...
[ "Return", "an", "instance", "with", "the", "specified", "path", "." ]
train
https://github.com/phPoirot/psr7/blob/e90295e806dc2eb0cc422f315075f673c63a0780/Uri.php#L363-L380
phPoirot/psr7
Uri.php
Uri.withQuery
public function withQuery($query) { $query = (string) $query; if (strpos($query, '#') !== false) throw new \InvalidArgumentException( 'Query string must not include a URI fragment' ); if ($query === $this->query) // Do no...
php
public function withQuery($query) { $query = (string) $query; if (strpos($query, '#') !== false) throw new \InvalidArgumentException( 'Query string must not include a URI fragment' ); if ($query === $this->query) // Do no...
[ "public", "function", "withQuery", "(", "$", "query", ")", "{", "$", "query", "=", "(", "string", ")", "$", "query", ";", "if", "(", "strpos", "(", "$", "query", ",", "'#'", ")", "!==", "false", ")", "throw", "new", "\\", "InvalidArgumentException", ...
Return an instance with the specified query string. This method MUST retain the state of the current instance, and return an instance that contains the specified query string. Users can provide both encoded and decoded query characters. Implementations ensure the correct encoding as outlined in getQuery(). An empty ...
[ "Return", "an", "instance", "with", "the", "specified", "query", "string", "." ]
train
https://github.com/phPoirot/psr7/blob/e90295e806dc2eb0cc422f315075f673c63a0780/Uri.php#L397-L414
phPoirot/psr7
Uri.php
Uri.withFragment
public function withFragment($fragment) { $fragment = (string) $fragment; if (strlen($fragment) && $fragment[0] == '#') $fragment = substr($fragment, 1); if ($fragment === $this->fragment) // Do nothing if no change was made. return $this; $new ...
php
public function withFragment($fragment) { $fragment = (string) $fragment; if (strlen($fragment) && $fragment[0] == '#') $fragment = substr($fragment, 1); if ($fragment === $this->fragment) // Do nothing if no change was made. return $this; $new ...
[ "public", "function", "withFragment", "(", "$", "fragment", ")", "{", "$", "fragment", "=", "(", "string", ")", "$", "fragment", ";", "if", "(", "strlen", "(", "$", "fragment", ")", "&&", "$", "fragment", "[", "0", "]", "==", "'#'", ")", "$", "frag...
Return an instance with the specified URI fragment. This method MUST retain the state of the current instance, and return an instance that contains the specified URI fragment. Users can provide both encoded and decoded fragment characters. Implementations ensure the correct encoding as outlined in getFragment(). An ...
[ "Return", "an", "instance", "with", "the", "specified", "URI", "fragment", "." ]
train
https://github.com/phPoirot/psr7/blob/e90295e806dc2eb0cc422f315075f673c63a0780/Uri.php#L430-L444
phPoirot/psr7
Uri.php
Uri._parseFromString
protected function _parseFromString($uri) { if (false === $parts = parse_url($uri)) throw new \InvalidArgumentException(sprintf( 'Malformed uri (%s).' , $uri )); $this->scheme = isset($parts['scheme']) ? $parts['scheme'] : ''; $...
php
protected function _parseFromString($uri) { if (false === $parts = parse_url($uri)) throw new \InvalidArgumentException(sprintf( 'Malformed uri (%s).' , $uri )); $this->scheme = isset($parts['scheme']) ? $parts['scheme'] : ''; $...
[ "protected", "function", "_parseFromString", "(", "$", "uri", ")", "{", "if", "(", "false", "===", "$", "parts", "=", "parse_url", "(", "$", "uri", ")", ")", "throw", "new", "\\", "InvalidArgumentException", "(", "sprintf", "(", "'Malformed uri (%s).'", ",",...
Parse a URI into its parts, and set the properties @param string $uri
[ "Parse", "a", "URI", "into", "its", "parts", "and", "set", "the", "properties" ]
train
https://github.com/phPoirot/psr7/blob/e90295e806dc2eb0cc422f315075f673c63a0780/Uri.php#L503-L521
phPoirot/psr7
Uri.php
Uri._filterHost
function _filterHost($host) { if (strstr($host, ':') !== false) throw new \InvalidArgumentException('Host name can`t contains port number.'); $host = strtolower($host); return $host; }
php
function _filterHost($host) { if (strstr($host, ':') !== false) throw new \InvalidArgumentException('Host name can`t contains port number.'); $host = strtolower($host); return $host; }
[ "function", "_filterHost", "(", "$", "host", ")", "{", "if", "(", "strstr", "(", "$", "host", ",", "':'", ")", "!==", "false", ")", "throw", "new", "\\", "InvalidArgumentException", "(", "'Host name can`t contains port number.'", ")", ";", "$", "host", "=", ...
Validate and Filter host value @param string $host @return string normalized value
[ "Validate", "and", "Filter", "host", "value" ]
train
https://github.com/phPoirot/psr7/blob/e90295e806dc2eb0cc422f315075f673c63a0780/Uri.php#L550-L557
j-d/draggy
src/Draggy/Utils/Indenter/CPP/CPPLineIndenter.php
CPPLineIndenter.identifyLines
protected function identifyLines() { foreach ($this->indenterMachine->getLines() as $lineNumber => $line) { $this->lineTypes['commentBlock'][$lineNumber] = $this->isStartCommentBlock($lineNumber); $this->lineTypes['startBraces'][$lineNumber] = $this->isStartBracesBlock($lineNumber);...
php
protected function identifyLines() { foreach ($this->indenterMachine->getLines() as $lineNumber => $line) { $this->lineTypes['commentBlock'][$lineNumber] = $this->isStartCommentBlock($lineNumber); $this->lineTypes['startBraces'][$lineNumber] = $this->isStartBracesBlock($lineNumber);...
[ "protected", "function", "identifyLines", "(", ")", "{", "foreach", "(", "$", "this", "->", "indenterMachine", "->", "getLines", "(", ")", "as", "$", "lineNumber", "=>", "$", "line", ")", "{", "$", "this", "->", "lineTypes", "[", "'commentBlock'", "]", "...
{inheritdoc}
[ "{", "inheritdoc", "}" ]
train
https://github.com/j-d/draggy/blob/97ffc66e1aacb5f685d7aac5251c4abb8888d4bb/src/Draggy/Utils/Indenter/CPP/CPPLineIndenter.php#L24-L49
bavix/laravel-worker-command
src/Commands/WorkerCommand.php
WorkerCommand.fnUpdate
public function fnUpdate(\GearmanJob $job) { $this->config->cleanup(); /** * @var array $workload */ $workload = JSON::decode($job->workload()); foreach ($workload as $config) { $this->info('update config: ' . $config); \config([ ...
php
public function fnUpdate(\GearmanJob $job) { $this->config->cleanup(); /** * @var array $workload */ $workload = JSON::decode($job->workload()); foreach ($workload as $config) { $this->info('update config: ' . $config); \config([ ...
[ "public", "function", "fnUpdate", "(", "\\", "GearmanJob", "$", "job", ")", "{", "$", "this", "->", "config", "->", "cleanup", "(", ")", ";", "/**\n * @var array $workload\n */", "$", "workload", "=", "JSON", "::", "decode", "(", "$", "job", ...
@param \GearmanJob $job @throws PermissionDenied @throws Invalid @throws Path
[ "@param", "\\", "GearmanJob", "$job" ]
train
https://github.com/bavix/laravel-worker-command/blob/005d7f9d8fe13e4d992c5fbaf6ff2014753c46e6/src/Commands/WorkerCommand.php#L74-L93
bavix/laravel-worker-command
src/Commands/WorkerCommand.php
WorkerCommand.handle
public function handle() { if ($this->fnUpdate) { $this->worker->addFunction( $this->fnReload(), [$this, 'fnUpdate'] ); } foreach ($this->map as $name => $callable) { $this->worker->addFunction($name, $calla...
php
public function handle() { if ($this->fnUpdate) { $this->worker->addFunction( $this->fnReload(), [$this, 'fnUpdate'] ); } foreach ($this->map as $name => $callable) { $this->worker->addFunction($name, $calla...
[ "public", "function", "handle", "(", ")", "{", "if", "(", "$", "this", "->", "fnUpdate", ")", "{", "$", "this", "->", "worker", "->", "addFunction", "(", "$", "this", "->", "fnReload", "(", ")", ",", "[", "$", "this", ",", "'fnUpdate'", "]", ")", ...
Execute the console command. @return null
[ "Execute", "the", "console", "command", "." ]
train
https://github.com/bavix/laravel-worker-command/blob/005d7f9d8fe13e4d992c5fbaf6ff2014753c46e6/src/Commands/WorkerCommand.php#L100-L121
gregorybesson/PlaygroundCms
src/Mapper/BlockHydrator.php
BlockHydrator.extract
public function extract($object) { if (!$object instanceof BlockEntityInterface) { throw new Exception\InvalidArgumentException( '$object must be an instance of PlaygroundCms\Entity\BlockInterface' ); } /* @var $object BlockInterface*/ $data =...
php
public function extract($object) { if (!$object instanceof BlockEntityInterface) { throw new Exception\InvalidArgumentException( '$object must be an instance of PlaygroundCms\Entity\BlockInterface' ); } /* @var $object BlockInterface*/ $data =...
[ "public", "function", "extract", "(", "$", "object", ")", "{", "if", "(", "!", "$", "object", "instanceof", "BlockEntityInterface", ")", "{", "throw", "new", "Exception", "\\", "InvalidArgumentException", "(", "'$object must be an instance of PlaygroundCms\\Entity\\Bloc...
Extract values from an object @param object $object @return array @throws Exception\InvalidArgumentException
[ "Extract", "values", "from", "an", "object" ]
train
https://github.com/gregorybesson/PlaygroundCms/blob/e929a283f2a6e82d4f248c930f7aa454ce20cbc3/src/Mapper/BlockHydrator.php#L17-L29
gregorybesson/PlaygroundCms
src/Mapper/BlockHydrator.php
BlockHydrator.hydrate
public function hydrate(array $data, $object) { if (!$object instanceof BlockEntityInterface) { throw new Exception\InvalidArgumentException( '$object must be an instance of PlaygroundCms\Entity\BlockInterface' ); } //$data = $this->mapField('block_id'...
php
public function hydrate(array $data, $object) { if (!$object instanceof BlockEntityInterface) { throw new Exception\InvalidArgumentException( '$object must be an instance of PlaygroundCms\Entity\BlockInterface' ); } //$data = $this->mapField('block_id'...
[ "public", "function", "hydrate", "(", "array", "$", "data", ",", "$", "object", ")", "{", "if", "(", "!", "$", "object", "instanceof", "BlockEntityInterface", ")", "{", "throw", "new", "Exception", "\\", "InvalidArgumentException", "(", "'$object must be an inst...
Hydrate $object with the provided $data. @param array $data @param object $object @return BlockInterface @throws Exception\InvalidArgumentException
[ "Hydrate", "$object", "with", "the", "provided", "$data", "." ]
train
https://github.com/gregorybesson/PlaygroundCms/blob/e929a283f2a6e82d4f248c930f7aa454ce20cbc3/src/Mapper/BlockHydrator.php#L39-L48
WScore/Validation
src/Verify.php
Verify.is
public function is($value, $rules) { $valTO = $this->apply($value, $rules); if ($valTO->fails()) { return false; } return $valTO->getValue(); }
php
public function is($value, $rules) { $valTO = $this->apply($value, $rules); if ($valTO->fails()) { return false; } return $valTO->getValue(); }
[ "public", "function", "is", "(", "$", "value", ",", "$", "rules", ")", "{", "$", "valTO", "=", "$", "this", "->", "apply", "(", "$", "value", ",", "$", "rules", ")", ";", "if", "(", "$", "valTO", "->", "fails", "(", ")", ")", "{", "return", "...
validates a text value, or an array of text values. returns the filtered value, or false if validation fails. @param string|array $value @param array|Rules $rules @return bool|string
[ "validates", "a", "text", "value", "or", "an", "array", "of", "text", "values", ".", "returns", "the", "filtered", "value", "or", "false", "if", "validation", "fails", "." ]
train
https://github.com/WScore/Validation/blob/25c0dca37d624bb0bb22f8e79ba54db2f69e0950/src/Verify.php#L54-L62
WScore/Validation
src/Verify.php
Verify.applyFilters
public function applyFilters($value, $rules = array()) { $valueTO = $this->valueTO->forge($value); // loop through all the rules to validate $value. foreach ($rules as $rule => $parameter) { // skip rules with option as FALSE. if ($parameter === false) { ...
php
public function applyFilters($value, $rules = array()) { $valueTO = $this->valueTO->forge($value); // loop through all the rules to validate $value. foreach ($rules as $rule => $parameter) { // skip rules with option as FALSE. if ($parameter === false) { ...
[ "public", "function", "applyFilters", "(", "$", "value", ",", "$", "rules", "=", "array", "(", ")", ")", "{", "$", "valueTO", "=", "$", "this", "->", "valueTO", "->", "forge", "(", "$", "value", ")", ";", "// loop through all the rules to validate $value.", ...
apply filters on a single value. @param string $value @param array|Rules $rules @return ValueTO
[ "apply", "filters", "on", "a", "single", "value", "." ]
train
https://github.com/WScore/Validation/blob/25c0dca37d624bb0bb22f8e79ba54db2f69e0950/src/Verify.php#L94-L112
php-lug/lug
src/Component/Behat/Extension/Api/Context/ApiContext.php
ApiContext.setBaseUrl
public function setBaseUrl($baseUrl) { if (strrpos($baseUrl, '/') === strlen($baseUrl) - 1) { $baseUrl = substr($baseUrl, 0, -1); } $this->baseUrl = $baseUrl; }
php
public function setBaseUrl($baseUrl) { if (strrpos($baseUrl, '/') === strlen($baseUrl) - 1) { $baseUrl = substr($baseUrl, 0, -1); } $this->baseUrl = $baseUrl; }
[ "public", "function", "setBaseUrl", "(", "$", "baseUrl", ")", "{", "if", "(", "strrpos", "(", "$", "baseUrl", ",", "'/'", ")", "===", "strlen", "(", "$", "baseUrl", ")", "-", "1", ")", "{", "$", "baseUrl", "=", "substr", "(", "$", "baseUrl", ",", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Behat/Extension/Api/Context/ApiContext.php#L137-L144
php-lug/lug
src/Component/Behat/Extension/Api/Context/ApiContext.php
ApiContext.reset
public function reset() { $this->headers = []; $this->request = null; $this->response = null; $this->multipartStreamBuilder = null; foreach ($this->resources as $resource) { if (is_resource($resource)) { fclose($resource); } } ...
php
public function reset() { $this->headers = []; $this->request = null; $this->response = null; $this->multipartStreamBuilder = null; foreach ($this->resources as $resource) { if (is_resource($resource)) { fclose($resource); } } ...
[ "public", "function", "reset", "(", ")", "{", "$", "this", "->", "headers", "=", "[", "]", ";", "$", "this", "->", "request", "=", "null", ";", "$", "this", "->", "response", "=", "null", ";", "$", "this", "->", "multipartStreamBuilder", "=", "null",...
@BeforeScenario @Given I reset the API context
[ "@BeforeScenario" ]
train
https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Behat/Extension/Api/Context/ApiContext.php#L151-L165
php-lug/lug
src/Component/Behat/Extension/Api/Context/ApiContext.php
ApiContext.setFile
public function setFile($name, $file, $filename = null) { $path = $this->fileLocator->locate($file); $this->resources[] = $resource = fopen($path, 'r'); $this->getMultipartStreamBuilder()->addResource($name, $resource, ['filename' => $filename]); }
php
public function setFile($name, $file, $filename = null) { $path = $this->fileLocator->locate($file); $this->resources[] = $resource = fopen($path, 'r'); $this->getMultipartStreamBuilder()->addResource($name, $resource, ['filename' => $filename]); }
[ "public", "function", "setFile", "(", "$", "name", ",", "$", "file", ",", "$", "filename", "=", "null", ")", "{", "$", "path", "=", "$", "this", "->", "fileLocator", "->", "locate", "(", "$", "file", ")", ";", "$", "this", "->", "resources", "[", ...
@param string $name @param string $file @param string|null $filename @Given I set the field ":name" with file ":file" @Given I set the field ":name" with file ":file" and filename ":filename"
[ "@param", "string", "$name", "@param", "string", "$file", "@param", "string|null", "$filename" ]
train
https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Behat/Extension/Api/Context/ApiContext.php#L218-L223
php-lug/lug
src/Component/Behat/Extension/Api/Context/ApiContext.php
ApiContext.send
public function send($method, $url) { $this->request = $this->requestFactory->createRequest($method, $this->prepareUrl($url), $this->headers); $this->sendRequest(); }
php
public function send($method, $url) { $this->request = $this->requestFactory->createRequest($method, $this->prepareUrl($url), $this->headers); $this->sendRequest(); }
[ "public", "function", "send", "(", "$", "method", ",", "$", "url", ")", "{", "$", "this", "->", "request", "=", "$", "this", "->", "requestFactory", "->", "createRequest", "(", "$", "method", ",", "$", "this", "->", "prepareUrl", "(", "$", "url", ")"...
@param string $method @param string $url @When I send a ":method" request to ":url"
[ "@param", "string", "$method", "@param", "string", "$url" ]
train
https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Behat/Extension/Api/Context/ApiContext.php#L231-L236
php-lug/lug
src/Component/Behat/Extension/Api/Context/ApiContext.php
ApiContext.sendWith
public function sendWith($method, $url, PyStringNode $string) { $this->request = $this->requestFactory->createRequest( $method, $this->prepareUrl($url), $this->headers, trim($string->getRaw()) ); $this->sendRequest(); }
php
public function sendWith($method, $url, PyStringNode $string) { $this->request = $this->requestFactory->createRequest( $method, $this->prepareUrl($url), $this->headers, trim($string->getRaw()) ); $this->sendRequest(); }
[ "public", "function", "sendWith", "(", "$", "method", ",", "$", "url", ",", "PyStringNode", "$", "string", ")", "{", "$", "this", "->", "request", "=", "$", "this", "->", "requestFactory", "->", "createRequest", "(", "$", "method", ",", "$", "this", "-...
@param string $method @param string $url @param PyStringNode $string @When I send a ":method" request to ":url" with body:
[ "@param", "string", "$method", "@param", "string", "$url", "@param", "PyStringNode", "$string" ]
train
https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Behat/Extension/Api/Context/ApiContext.php#L245-L255
php-lug/lug
src/Component/Behat/Extension/Api/Context/ApiContext.php
ApiContext.assertResponseContains
public function assertResponseContains(PyStringNode $json) { $this->matcher->match((string) $this->response->getBody(), $json->getRaw()); \PHPUnit_Framework_Assert::assertNull($this->matcher->getError()); }
php
public function assertResponseContains(PyStringNode $json) { $this->matcher->match((string) $this->response->getBody(), $json->getRaw()); \PHPUnit_Framework_Assert::assertNull($this->matcher->getError()); }
[ "public", "function", "assertResponseContains", "(", "PyStringNode", "$", "json", ")", "{", "$", "this", "->", "matcher", "->", "match", "(", "(", "string", ")", "$", "this", "->", "response", "->", "getBody", "(", ")", ",", "$", "json", "->", "getRaw", ...
@param PyStringNode $json @Then the response should contain:
[ "@param", "PyStringNode", "$json" ]
train
https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Behat/Extension/Api/Context/ApiContext.php#L272-L277
JBZoo/Assets
src/Asset/LessFile.php
LessFile.load
public function load(array $filters = []) { $result = parent::load($filters); $compiled = null; if ($result[1]) { $options = $this->_manager->getParams(); $root = $this->_manager->getPath()->getRoot(); $less = new Less($options->get('less')); ...
php
public function load(array $filters = []) { $result = parent::load($filters); $compiled = null; if ($result[1]) { $options = $this->_manager->getParams(); $root = $this->_manager->getPath()->getRoot(); $less = new Less($options->get('less')); ...
[ "public", "function", "load", "(", "array", "$", "filters", "=", "[", "]", ")", "{", "$", "result", "=", "parent", "::", "load", "(", "$", "filters", ")", ";", "$", "compiled", "=", "null", ";", "if", "(", "$", "result", "[", "1", "]", ")", "{"...
{@inheritdoc}
[ "{" ]
train
https://github.com/JBZoo/Assets/blob/134a109378f5b5e955dfb15e6ed2821581564991/src/Asset/LessFile.php#L31-L44
php-lug/lug
src/Component/Resource/Domain/DomainManager.php
DomainManager.doFind
protected function doFind($action, $repositoryMethod, array $criteria, array $sorting) { return $this->repository->$repositoryMethod($criteria, $sorting); }
php
protected function doFind($action, $repositoryMethod, array $criteria, array $sorting) { return $this->repository->$repositoryMethod($criteria, $sorting); }
[ "protected", "function", "doFind", "(", "$", "action", ",", "$", "repositoryMethod", ",", "array", "$", "criteria", ",", "array", "$", "sorting", ")", "{", "return", "$", "this", "->", "repository", "->", "$", "repositoryMethod", "(", "$", "criteria", ",",...
{@inheritdoc}
[ "{" ]
train
https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Resource/Domain/DomainManager.php#L55-L58