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
nabab/bbn
src/bbn/user/preferences.php
preferences.move_bit
public function move_bit(string $id, string $id_parent = null): ?bool { if ( \bbn\str::is_uid($id) && ( (\bbn\str::is_uid($id_parent) && $this->get_bit($id_parent)) || \is_null($id_parent) ) && ($bit = $this->get_bit($id)) && ($cf = $this->get_class_cfg()) && ...
php
public function move_bit(string $id, string $id_parent = null): ?bool { if ( \bbn\str::is_uid($id) && ( (\bbn\str::is_uid($id_parent) && $this->get_bit($id_parent)) || \is_null($id_parent) ) && ($bit = $this->get_bit($id)) && ($cf = $this->get_class_cfg()) && ...
[ "public", "function", "move_bit", "(", "string", "$", "id", ",", "string", "$", "id_parent", "=", "null", ")", ":", "?", "bool", "{", "if", "(", "\\", "bbn", "\\", "str", "::", "is_uid", "(", "$", "id", ")", "&&", "(", "(", "\\", "bbn", "\\", "...
Moves a bit. @param string $id The bit's ID @param string|null The new parent's ID @return bool|null
[ "Moves", "a", "bit", "." ]
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/user/preferences.php#L1289-L1308
nabab/bbn
src/bbn/user/preferences.php
preferences.get_max_bit_num
public function get_max_bit_num(string $id_user_option, string $id_parent = null, bool $incr = false): int { if ( \bbn\str::is_uid($id_user_option) && (\bbn\str::is_uid($id_parent) || is_null($id_parent)) && ($cf = $this->get_class_cfg()) && ($cfg = $cf['arch']['user_options_bits']) ...
php
public function get_max_bit_num(string $id_user_option, string $id_parent = null, bool $incr = false): int { if ( \bbn\str::is_uid($id_user_option) && (\bbn\str::is_uid($id_parent) || is_null($id_parent)) && ($cf = $this->get_class_cfg()) && ($cfg = $cf['arch']['user_options_bits']) ...
[ "public", "function", "get_max_bit_num", "(", "string", "$", "id_user_option", ",", "string", "$", "id_parent", "=", "null", ",", "bool", "$", "incr", "=", "false", ")", ":", "int", "{", "if", "(", "\\", "bbn", "\\", "str", "::", "is_uid", "(", "$", ...
Gets the maximum num value of the user option's bits. @param string $id_user_option The user option's ID @param string|null $id_parent The parent's ID @param bool $incr Set it to true if you want the result increased by 1 @return int
[ "Gets", "the", "maximum", "num", "value", "of", "the", "user", "option", "s", "bits", "." ]
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/user/preferences.php#L1318-L1344
nabab/bbn
src/bbn/user/preferences.php
preferences.get_by_bit
public function get_by_bit(string $id): ?array { $t =& $this; if ( \bbn\str::is_uid($id) ){ return $this->db->rselect([ 'table' => $this->class_cfg['table'], 'fields' => array_map(function($v) use($t){ return $this->class_cfg['table'].'.'.$v; }, array_values($this->clas...
php
public function get_by_bit(string $id): ?array { $t =& $this; if ( \bbn\str::is_uid($id) ){ return $this->db->rselect([ 'table' => $this->class_cfg['table'], 'fields' => array_map(function($v) use($t){ return $this->class_cfg['table'].'.'.$v; }, array_values($this->clas...
[ "public", "function", "get_by_bit", "(", "string", "$", "id", ")", ":", "?", "array", "{", "$", "t", "=", "&", "$", "this", ";", "if", "(", "\\", "bbn", "\\", "str", "::", "is_uid", "(", "$", "id", ")", ")", "{", "return", "$", "this", "->", ...
Gets a preference row from a bit ID @param string $id The bit's ID @return array
[ "Gets", "a", "preference", "row", "from", "a", "bit", "ID" ]
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/user/preferences.php#L1355-L1378
nabab/bbn
src/bbn/user/preferences.php
preferences.get_id_by_bit
public function get_id_by_bit(string $id): ?string { if ( \bbn\str::is_uid($id) && ($p = $this->get_by_bit($id)) ){ return $p[$this->fields['id']]; } return null; }
php
public function get_id_by_bit(string $id): ?string { if ( \bbn\str::is_uid($id) && ($p = $this->get_by_bit($id)) ){ return $p[$this->fields['id']]; } return null; }
[ "public", "function", "get_id_by_bit", "(", "string", "$", "id", ")", ":", "?", "string", "{", "if", "(", "\\", "bbn", "\\", "str", "::", "is_uid", "(", "$", "id", ")", "&&", "(", "$", "p", "=", "$", "this", "->", "get_by_bit", "(", "$", "id", ...
Gets the preference's ID from a bit ID @param string $id The bit's ID @return string
[ "Gets", "the", "preference", "s", "ID", "from", "a", "bit", "ID" ]
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/user/preferences.php#L1386-L1392
mothership-ec/composer
src/Composer/Repository/Pear/ChannelReader.php
ChannelReader.selectRestVersion
private function selectRestVersion($channelXml, $supportedVersions) { $channelXml->registerXPathNamespace('ns', self::CHANNEL_NS); foreach ($supportedVersions as $version) { $xpathTest = "ns:servers/ns:primary/ns:rest/ns:baseurl[@type='{$version}']"; $testResult = $channelXm...
php
private function selectRestVersion($channelXml, $supportedVersions) { $channelXml->registerXPathNamespace('ns', self::CHANNEL_NS); foreach ($supportedVersions as $version) { $xpathTest = "ns:servers/ns:primary/ns:rest/ns:baseurl[@type='{$version}']"; $testResult = $channelXm...
[ "private", "function", "selectRestVersion", "(", "$", "channelXml", ",", "$", "supportedVersions", ")", "{", "$", "channelXml", "->", "registerXPathNamespace", "(", "'ns'", ",", "self", "::", "CHANNEL_NS", ")", ";", "foreach", "(", "$", "supportedVersions", "as"...
Reads channel supported REST interfaces and selects one of them @param $channelXml \SimpleXMLElement @param $supportedVersions string[] supported PEAR REST protocols @return array|null hash with selected version and baseUrl
[ "Reads", "channel", "supported", "REST", "interfaces", "and", "selects", "one", "of", "them" ]
train
https://github.com/mothership-ec/composer/blob/fa6ad031a939d8d33b211e428fdbdd28cfce238c/src/Composer/Repository/Pear/ChannelReader.php#L78-L91
vaibhavpandeyvpz/sandesh
src/CookieFactory.php
CookieFactory.createCookie
public function createCookie($header) { $parts = preg_split('~\\s*[;]\\s*~', $header); list($name, $value) = explode('=', array_shift($parts), 2); $cookie = new Cookie($name); if (is_string($value)) { $cookie = $cookie->withValue(urldecode($value)); } whil...
php
public function createCookie($header) { $parts = preg_split('~\\s*[;]\\s*~', $header); list($name, $value) = explode('=', array_shift($parts), 2); $cookie = new Cookie($name); if (is_string($value)) { $cookie = $cookie->withValue(urldecode($value)); } whil...
[ "public", "function", "createCookie", "(", "$", "header", ")", "{", "$", "parts", "=", "preg_split", "(", "'~\\\\s*[;]\\\\s*~'", ",", "$", "header", ")", ";", "list", "(", "$", "name", ",", "$", "value", ")", "=", "explode", "(", "'='", ",", "array_shi...
{@inheritdoc}
[ "{" ]
train
https://github.com/vaibhavpandeyvpz/sandesh/blob/bea2d06c7cac099ed82da973c922859de4158de0/src/CookieFactory.php#L23-L56
brick/di
src/DependencyInjectionException.php
DependencyInjectionException.keyNotRegistered
public static function keyNotRegistered(string $key) : DependencyInjectionException { if (class_exists($key)) { $message = 'The class "' . $key . '" is not marked as injected, and not registered with the container.'; } else { $message = 'The key "' . $key . '" is not register...
php
public static function keyNotRegistered(string $key) : DependencyInjectionException { if (class_exists($key)) { $message = 'The class "' . $key . '" is not marked as injected, and not registered with the container.'; } else { $message = 'The key "' . $key . '" is not register...
[ "public", "static", "function", "keyNotRegistered", "(", "string", "$", "key", ")", ":", "DependencyInjectionException", "{", "if", "(", "class_exists", "(", "$", "key", ")", ")", "{", "$", "message", "=", "'The class \"'", ".", "$", "key", ".", "'\" is not ...
@param string $key @return DependencyInjectionException
[ "@param", "string", "$key" ]
train
https://github.com/brick/di/blob/6ced82ab3623b8f1470317d38cbd2de855e7aa3d/src/DependencyInjectionException.php#L17-L26
odiaseo/pagebuilder
src/PageBuilder/Controller/TemplateSectionController.php
TemplateSectionController.get
public function get($id) { return $this->_sendPayload( $this->_getService($this->_pageServiceKey)->getActiveTemplateSections($id) ); }
php
public function get($id) { return $this->_sendPayload( $this->_getService($this->_pageServiceKey)->getActiveTemplateSections($id) ); }
[ "public", "function", "get", "(", "$", "id", ")", "{", "return", "$", "this", "->", "_sendPayload", "(", "$", "this", "->", "_getService", "(", "$", "this", "->", "_pageServiceKey", ")", "->", "getActiveTemplateSections", "(", "$", "id", ")", ")", ";", ...
Get template sections @param mixed $id @return mixed|\Zend\View\Model\ModelInterface
[ "Get", "template", "sections" ]
train
https://github.com/odiaseo/pagebuilder/blob/88ef7cccf305368561307efe4ca07fac8e5774f3/src/PageBuilder/Controller/TemplateSectionController.php#L18-L23
odiaseo/pagebuilder
src/PageBuilder/Controller/TemplateSectionController.php
TemplateSectionController.update
public function update($id, $data) { $sections = empty($data['sections']) ? [] : $data['sections']; return $this->_sendPayload( $this->_getService($this->_pageServiceKey)->updateTemplateSections($id, $sections) ); }
php
public function update($id, $data) { $sections = empty($data['sections']) ? [] : $data['sections']; return $this->_sendPayload( $this->_getService($this->_pageServiceKey)->updateTemplateSections($id, $sections) ); }
[ "public", "function", "update", "(", "$", "id", ",", "$", "data", ")", "{", "$", "sections", "=", "empty", "(", "$", "data", "[", "'sections'", "]", ")", "?", "[", "]", ":", "$", "data", "[", "'sections'", "]", ";", "return", "$", "this", "->", ...
Update section details @param mixed $id @param mixed $data @return mixed|\Zend\View\Model\ModelInterface
[ "Update", "section", "details" ]
train
https://github.com/odiaseo/pagebuilder/blob/88ef7cccf305368561307efe4ca07fac8e5774f3/src/PageBuilder/Controller/TemplateSectionController.php#L33-L40
Eresus/EresusCMS
src/core/admin.php
AdminUITheme.getTemplate
public function getTemplate($name) { $filename = $this->getResource($name); $template = new Eresus_Template($filename); return $template; }
php
public function getTemplate($name) { $filename = $this->getResource($name); $template = new Eresus_Template($filename); return $template; }
[ "public", "function", "getTemplate", "(", "$", "name", ")", "{", "$", "filename", "=", "$", "this", "->", "getResource", "(", "$", "name", ")", ";", "$", "template", "=", "new", "Eresus_Template", "(", "$", "filename", ")", ";", "return", "$", "templat...
Возвращает шаблон @param string $name @return Eresus_Template
[ "Возвращает", "шаблон" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/admin.php#L138-L143
Eresus/EresusCMS
src/core/admin.php
TAdminUI.replaceMacros
public function replaceMacros($text) { $result = str_replace( array( '$(httpHost)', '$(httpPath)', '$(httpRoot)', '$(styleRoot)', '$(dataRoot)', '$(siteName)', '$(siteTitle)', ...
php
public function replaceMacros($text) { $result = str_replace( array( '$(httpHost)', '$(httpPath)', '$(httpRoot)', '$(styleRoot)', '$(dataRoot)', '$(siteName)', '$(siteTitle)', ...
[ "public", "function", "replaceMacros", "(", "$", "text", ")", "{", "$", "result", "=", "str_replace", "(", "array", "(", "'$(httpHost)'", ",", "'$(httpPath)'", ",", "'$(httpRoot)'", ",", "'$(styleRoot)'", ",", "'$(dataRoot)'", ",", "'$(siteName)'", ",", "'$(site...
Подставляет значения макросов @param string $text @return string
[ "Подставляет", "значения", "макросов" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/admin.php#L286-L319
Eresus/EresusCMS
src/core/admin.php
TAdminUI.url
public function url($args = null, $clear = false) { $basics = array('mod','section','id','sort','desc','pg'); $result = ''; $arg = array(); if (count(Eresus_CMS::getLegacyKernel()->request['arg'])) { foreach (Eresus_CMS::getLegacyKernel()->request['arg'] as $key =...
php
public function url($args = null, $clear = false) { $basics = array('mod','section','id','sort','desc','pg'); $result = ''; $arg = array(); if (count(Eresus_CMS::getLegacyKernel()->request['arg'])) { foreach (Eresus_CMS::getLegacyKernel()->request['arg'] as $key =...
[ "public", "function", "url", "(", "$", "args", "=", "null", ",", "$", "clear", "=", "false", ")", "{", "$", "basics", "=", "array", "(", "'mod'", ",", "'section'", ",", "'id'", ",", "'sort'", ",", "'desc'", ",", "'pg'", ")", ";", "$", "result", "...
-----------------------------------------------------------------------------
[ "-----------------------------------------------------------------------------" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/admin.php#L322-L362
Eresus/EresusCMS
src/core/admin.php
TAdminUI.addMenuItem
public function addMenuItem($section, $item) { $item['link'] = 'ext-'.$item['link']; $ptr = null; for ($i=0; $i<count($this->extmenu); $i++) { if ($this->extmenu[$i]['caption'] == $section) { $ptr = &$this->extmenu[$i]; break; ...
php
public function addMenuItem($section, $item) { $item['link'] = 'ext-'.$item['link']; $ptr = null; for ($i=0; $i<count($this->extmenu); $i++) { if ($this->extmenu[$i]['caption'] == $section) { $ptr = &$this->extmenu[$i]; break; ...
[ "public", "function", "addMenuItem", "(", "$", "section", ",", "$", "item", ")", "{", "$", "item", "[", "'link'", "]", "=", "'ext-'", ".", "$", "item", "[", "'link'", "]", ";", "$", "ptr", "=", "null", ";", "for", "(", "$", "i", "=", "0", ";", ...
Добавляет пункт в меню "Расширения" Добавляет пункт в меню «Расширения», создавая, при необходимости, новое меню. Аргумент $section должен содержать заголовок меню к которому надо добавить пункт. Чтобы добавить пункт стандартному меню «Расширения», можно использовать константу admExtensions. В плагинах рекомендуется ...
[ "Добавляет", "пункт", "в", "меню", "Расширения" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/admin.php#L407-L434
Eresus/EresusCMS
src/core/admin.php
TAdminUI.box
function box($text, $class, $caption='') { $result = "<div".(empty($class)?'':' class="'.$class.'"').">\n".(empty($caption)?'': '<span class="'.$class.'Caption">'.$caption.'</span><br />').$text."</div>\n"; return $result; }
php
function box($text, $class, $caption='') { $result = "<div".(empty($class)?'':' class="'.$class.'"').">\n".(empty($caption)?'': '<span class="'.$class.'Caption">'.$caption.'</span><br />').$text."</div>\n"; return $result; }
[ "function", "box", "(", "$", "text", ",", "$", "class", ",", "$", "caption", "=", "''", ")", "{", "$", "result", "=", "\"<div\"", ".", "(", "empty", "(", "$", "class", ")", "?", "''", ":", "' class=\"'", ".", "$", "class", ".", "'\"'", ")", "."...
-----------------------------------------------------------------------------
[ "-----------------------------------------------------------------------------" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/admin.php#L438-L443
Eresus/EresusCMS
src/core/admin.php
TAdminUI.window
function window($wnd) { $result = "<table border=\"0\" class=\"admWindow\"".(empty($wnd['width'])?'':' style="width: '. $wnd['width'].';"').">\n". (empty($wnd['caption'])?'':"<tr><th>".$wnd['caption']."</th></tr>\n"). "<tr><td".(empty($wnd['style'])?'':' s...
php
function window($wnd) { $result = "<table border=\"0\" class=\"admWindow\"".(empty($wnd['width'])?'':' style="width: '. $wnd['width'].';"').">\n". (empty($wnd['caption'])?'':"<tr><th>".$wnd['caption']."</th></tr>\n"). "<tr><td".(empty($wnd['style'])?'':' s...
[ "function", "window", "(", "$", "wnd", ")", "{", "$", "result", "=", "\"<table border=\\\"0\\\" class=\\\"admWindow\\\"\"", ".", "(", "empty", "(", "$", "wnd", "[", "'width'", "]", ")", "?", "''", ":", "' style=\"width: '", ".", "$", "wnd", "[", "'width'", ...
-----------------------------------------------------------------------------
[ "-----------------------------------------------------------------------------" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/admin.php#L446-L455
Eresus/EresusCMS
src/core/admin.php
TAdminUI.control
public function control($type, $href, $custom = array()) { $s = ''; switch ($type) { case 'add': $control = array( 'image' => Eresus_CMS::getLegacyKernel()->root . 'admin/themes/default/img/medium/item-add.png', ...
php
public function control($type, $href, $custom = array()) { $s = ''; switch ($type) { case 'add': $control = array( 'image' => Eresus_CMS::getLegacyKernel()->root . 'admin/themes/default/img/medium/item-add.png', ...
[ "public", "function", "control", "(", "$", "type", ",", "$", "href", ",", "$", "custom", "=", "array", "(", ")", ")", "{", "$", "s", "=", "''", ";", "switch", "(", "$", "type", ")", "{", "case", "'add'", ":", "$", "control", "=", "array", "(", ...
Отрисовывает элемент управления @param string $type Тип ЭУ (delete,toggle,move,custom...) @param string $href Ссылка @param string $custom Индивидуальные настройки @return string HTML
[ "Отрисовывает", "элемент", "управления" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/admin.php#L467-L551
Eresus/EresusCMS
src/core/admin.php
TAdminUI.renderTabs
function renderTabs($tabs) { $result = ''; if (count($tabs)) { $result = '<div class="legacy-tabs ui-helper-clearfix">'; $width = empty($tabs['width']) ? '' : ' style="width: ' . $tabs['width'] . '"'; if ( is...
php
function renderTabs($tabs) { $result = ''; if (count($tabs)) { $result = '<div class="legacy-tabs ui-helper-clearfix">'; $width = empty($tabs['width']) ? '' : ' style="width: ' . $tabs['width'] . '"'; if ( is...
[ "function", "renderTabs", "(", "$", "tabs", ")", "{", "$", "result", "=", "''", ";", "if", "(", "count", "(", "$", "tabs", ")", ")", "{", "$", "result", "=", "'<div class=\"legacy-tabs ui-helper-clearfix\">'", ";", "$", "width", "=", "empty", "(", "$", ...
Отрисовывает кнопки-"вкладки" Отрисовывает вкладки-переключатели на основе параметров, заданных аргументом tabs. Вкладки представляют собой HTML-таблицу с классом admTabs, каждый таб выполнен в виде ячейки (td). Алгоритм построения URL вкладки: 1. Если для вкладки задан параметр url, то используется его значение. 2....
[ "Отрисовывает", "кнопки", "-", "вкладки" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/admin.php#L597-L641
Eresus/EresusCMS
src/core/admin.php
TAdminUI.renderPages
function renderPages($itemsCount, $itemsPerPage, $pageCount, $Descending = false, $sub_prefix='') { $prefix = empty($sub_prefix)?str_repeat('sub_', $this->sub):$sub_prefix; if ($itemsCount > $itemsPerPage) { $result = '<div class="admListPages">'.strPages; if ($Descen...
php
function renderPages($itemsCount, $itemsPerPage, $pageCount, $Descending = false, $sub_prefix='') { $prefix = empty($sub_prefix)?str_repeat('sub_', $this->sub):$sub_prefix; if ($itemsCount > $itemsPerPage) { $result = '<div class="admListPages">'.strPages; if ($Descen...
[ "function", "renderPages", "(", "$", "itemsCount", ",", "$", "itemsPerPage", ",", "$", "pageCount", ",", "$", "Descending", "=", "false", ",", "$", "sub_prefix", "=", "''", ")", "{", "$", "prefix", "=", "empty", "(", "$", "sub_prefix", ")", "?", "str_r...
-----------------------------------------------------------------------------
[ "-----------------------------------------------------------------------------" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/admin.php#L644-L681
Eresus/EresusCMS
src/core/admin.php
TAdminUI.renderTable
function renderTable($table, $values=null, $sub_prefix='') { $result = ''; $prefix = empty($sub_prefix) ? str_repeat('sub_', $this->sub) : $sub_prefix; $itemsPerPage = isset($table['itemsPerPage']) ? $table['itemsPerPage'] : (isset($this->module->settings['itemsPerPag...
php
function renderTable($table, $values=null, $sub_prefix='') { $result = ''; $prefix = empty($sub_prefix) ? str_repeat('sub_', $this->sub) : $sub_prefix; $itemsPerPage = isset($table['itemsPerPage']) ? $table['itemsPerPage'] : (isset($this->module->settings['itemsPerPag...
[ "function", "renderTable", "(", "$", "table", ",", "$", "values", "=", "null", ",", "$", "sub_prefix", "=", "''", ")", "{", "$", "result", "=", "''", ";", "$", "prefix", "=", "empty", "(", "$", "sub_prefix", ")", "?", "str_repeat", "(", "'sub_'", "...
Отрисовывает таблицу-список на основе описания $table Таблица заполняется данными из БД или из аргумента $values. Описание таблицы. Может включать в себя следующие элементы: - name (string) — Имя таблицы в БД, из которой следует брать данные. - key (string) — Имя ключевого поля таблицы, хранящего идентификатор запис...
[ "Отрисовывает", "таблицу", "-", "список", "на", "основе", "описания", "$table" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/admin.php#L712-L960
Eresus/EresusCMS
src/core/admin.php
TAdminUI.renderForm
public function renderForm($form, $values=array()) { $result = ''; if (isset($form['tabs'])) { $result .= $this->renderTabs($form['tabs']); } $wnd['caption'] = $form['caption']; $wnd['width'] = isset($form['width'])?$form['width']:''; $wnd['style']...
php
public function renderForm($form, $values=array()) { $result = ''; if (isset($form['tabs'])) { $result .= $this->renderTabs($form['tabs']); } $wnd['caption'] = $form['caption']; $wnd['width'] = isset($form['width'])?$form['width']:''; $wnd['style']...
[ "public", "function", "renderForm", "(", "$", "form", ",", "$", "values", "=", "array", "(", ")", ")", "{", "$", "result", "=", "''", ";", "if", "(", "isset", "(", "$", "form", "[", "'tabs'", "]", ")", ")", "{", "$", "result", ".=", "$", "this"...
-----------------------------------------------------------------------------
[ "-----------------------------------------------------------------------------" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/admin.php#L963-L978
Eresus/EresusCMS
src/core/admin.php
TAdminUI.renderContent
private function renderContent(Eresus_CMS_Request $request) { Eresus_Kernel::log(__METHOD__, LOG_DEBUG, '()'); $result = ''; if (arg('mod')) { $module = arg('mod', '/[^\w-]/'); if (substr($module, 0, 4) == 'ext-') { $name = substr(...
php
private function renderContent(Eresus_CMS_Request $request) { Eresus_Kernel::log(__METHOD__, LOG_DEBUG, '()'); $result = ''; if (arg('mod')) { $module = arg('mod', '/[^\w-]/'); if (substr($module, 0, 4) == 'ext-') { $name = substr(...
[ "private", "function", "renderContent", "(", "Eresus_CMS_Request", "$", "request", ")", "{", "Eresus_Kernel", "::", "log", "(", "__METHOD__", ",", "LOG_DEBUG", ",", "'()'", ")", ";", "$", "result", "=", "''", ";", "if", "(", "arg", "(", "'mod'", ")", ")"...
Отрисовывает область контента страницы @param Eresus_CMS_Request $request @throws Eresus_HTTP_Exception_NotFound @return string
[ "Отрисовывает", "область", "контента", "страницы" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/admin.php#L989-L1064
Eresus/EresusCMS
src/core/admin.php
TAdminUI.renderPagesMenu
private function renderPagesMenu(&$opened, $owner = 0, $level = 0) { $theme = $this->getUITheme(); $result = ''; $items = Eresus_CMS::getLegacyKernel()-> sections->children($owner, Eresus_CMS::getLegacyKernel()->user['access'], SECTIONS_ACTIVE); if (count($items)) ...
php
private function renderPagesMenu(&$opened, $owner = 0, $level = 0) { $theme = $this->getUITheme(); $result = ''; $items = Eresus_CMS::getLegacyKernel()-> sections->children($owner, Eresus_CMS::getLegacyKernel()->user['access'], SECTIONS_ACTIVE); if (count($items)) ...
[ "private", "function", "renderPagesMenu", "(", "&", "$", "opened", ",", "$", "owner", "=", "0", ",", "$", "level", "=", "0", ")", "{", "$", "theme", "=", "$", "this", "->", "getUITheme", "(", ")", ";", "$", "result", "=", "''", ";", "$", "items",...
Отрисовывает ветку меню @param $opened @param $owner @param $level
[ "Отрисовывает", "ветку", "меню" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/admin.php#L1073-L1159
Eresus/EresusCMS
src/core/admin.php
TAdminUI.renderControlMenu
private function renderControlMenu() { $menu = ''; for ($section = 0; $section < count($this->extmenu); $section++) { if (UserRights($this->extmenu[$section]['access'])) { $menu .= '<div class="header">' . $this->extmenu[$section]['caption'] . ...
php
private function renderControlMenu() { $menu = ''; for ($section = 0; $section < count($this->extmenu); $section++) { if (UserRights($this->extmenu[$section]['access'])) { $menu .= '<div class="header">' . $this->extmenu[$section]['caption'] . ...
[ "private", "function", "renderControlMenu", "(", ")", "{", "$", "menu", "=", "''", ";", "for", "(", "$", "section", "=", "0", ";", "$", "section", "<", "count", "(", "$", "this", "->", "extmenu", ")", ";", "$", "section", "++", ")", "{", "if", "(...
Отрисовывает меню плагинов и управления @return string HTML
[ "Отрисовывает", "меню", "плагинов", "и", "управления" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/admin.php#L1167-L1227
Eresus/EresusCMS
src/core/admin.php
TAdminUI.render
public function render(Eresus_CMS_Request $request) { Eresus_Kernel::log(__METHOD__, LOG_DEBUG, '()'); return $this->renderUI($request); }
php
public function render(Eresus_CMS_Request $request) { Eresus_Kernel::log(__METHOD__, LOG_DEBUG, '()'); return $this->renderUI($request); }
[ "public", "function", "render", "(", "Eresus_CMS_Request", "$", "request", ")", "{", "Eresus_Kernel", "::", "log", "(", "__METHOD__", ",", "LOG_DEBUG", ",", "'()'", ")", ";", "return", "$", "this", "->", "renderUI", "(", "$", "request", ")", ";", "}" ]
Отправляет созданную страницу пользователю @param Eresus_CMS_Request $request @return Eresus_HTTP_Response
[ "Отправляет", "созданную", "страницу", "пользователю" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/admin.php#L1236-L1240
Eresus/EresusCMS
src/core/admin.php
TAdminUI.renderUI
private function renderUI(Eresus_CMS_Request $request) { Eresus_Kernel::log(__METHOD__, LOG_DEBUG, '()'); $response = $this->renderContent($request); if (!($response instanceof Eresus_HTTP_Response)) { $data = array(); $data['page'] = $this; $data...
php
private function renderUI(Eresus_CMS_Request $request) { Eresus_Kernel::log(__METHOD__, LOG_DEBUG, '()'); $response = $this->renderContent($request); if (!($response instanceof Eresus_HTTP_Response)) { $data = array(); $data['page'] = $this; $data...
[ "private", "function", "renderUI", "(", "Eresus_CMS_Request", "$", "request", ")", "{", "Eresus_Kernel", "::", "log", "(", "__METHOD__", ",", "LOG_DEBUG", ",", "'()'", ")", ";", "$", "response", "=", "$", "this", "->", "renderContent", "(", "$", "request", ...
Отрисовка интерфейса @param Eresus_CMS_Request $request @return Eresus_HTTP_Response
[ "Отрисовка", "интерфейса" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/admin.php#L1249-L1271
vaibhavpandeyvpz/sandesh
src/Response.php
Response.withStatus
public function withStatus($code, $reasonPhrase = '') { MessageValidations::assertStatusCode($code); $clone = clone $this; $clone->statusCode = $code; $clone->reasonPhrase = $reasonPhrase; return $clone; }
php
public function withStatus($code, $reasonPhrase = '') { MessageValidations::assertStatusCode($code); $clone = clone $this; $clone->statusCode = $code; $clone->reasonPhrase = $reasonPhrase; return $clone; }
[ "public", "function", "withStatus", "(", "$", "code", ",", "$", "reasonPhrase", "=", "''", ")", "{", "MessageValidations", "::", "assertStatusCode", "(", "$", "code", ")", ";", "$", "clone", "=", "clone", "$", "this", ";", "$", "clone", "->", "statusCode...
{@inheritdoc}
[ "{" ]
train
https://github.com/vaibhavpandeyvpz/sandesh/blob/bea2d06c7cac099ed82da973c922859de4158de0/src/Response.php#L68-L75
php-lug/lug
src/Component/Grid/Sort/Type/ColumnType.php
ColumnType.sort
public function sort($data, array $options) { $builder = $options['builder']; $builder->orderBy($builder->getProperty($options['field']), $data); }
php
public function sort($data, array $options) { $builder = $options['builder']; $builder->orderBy($builder->getProperty($options['field']), $data); }
[ "public", "function", "sort", "(", "$", "data", ",", "array", "$", "options", ")", "{", "$", "builder", "=", "$", "options", "[", "'builder'", "]", ";", "$", "builder", "->", "orderBy", "(", "$", "builder", "->", "getProperty", "(", "$", "options", "...
{@inheritdoc}
[ "{" ]
train
https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Grid/Sort/Type/ColumnType.php#L22-L27
AOEpeople/Aoe_Layout
app/code/local/Aoe/Layout/Block/Widget/Grid.php
Aoe_Layout_Block_Widget_Grid.getRowUrl
public function getRowUrl($item) { if (!$item instanceof Varien_Object) { return parent::getRowUrl($item); } $rowUrlRoute = trim($this->getRowUrlRoute()); if (empty($rowUrlRoute)) { return parent::getRowUrl($item); } $params = []; $r...
php
public function getRowUrl($item) { if (!$item instanceof Varien_Object) { return parent::getRowUrl($item); } $rowUrlRoute = trim($this->getRowUrlRoute()); if (empty($rowUrlRoute)) { return parent::getRowUrl($item); } $params = []; $r...
[ "public", "function", "getRowUrl", "(", "$", "item", ")", "{", "if", "(", "!", "$", "item", "instanceof", "Varien_Object", ")", "{", "return", "parent", "::", "getRowUrl", "(", "$", "item", ")", ";", "}", "$", "rowUrlRoute", "=", "trim", "(", "$", "t...
Return row url for js event handlers @param Varien_Object @return string
[ "Return", "row", "url", "for", "js", "event", "handlers" ]
train
https://github.com/AOEpeople/Aoe_Layout/blob/d88ba3406cf12dbaf09548477133c3cb27d155ed/app/code/local/Aoe/Layout/Block/Widget/Grid.php#L49-L84
AOEpeople/Aoe_Layout
app/code/local/Aoe/Layout/Block/Widget/Grid.php
Aoe_Layout_Block_Widget_Grid.sortColumnsByOrder
public function sortColumnsByOrder() { $columns = $this->_columns; foreach ($this->getColumnsOrder() as $columnId => $after) { if ($after[0] === '-') { $before = substr($after, 1); $after = null; } else { $before = null; ...
php
public function sortColumnsByOrder() { $columns = $this->_columns; foreach ($this->getColumnsOrder() as $columnId => $after) { if ($after[0] === '-') { $before = substr($after, 1); $after = null; } else { $before = null; ...
[ "public", "function", "sortColumnsByOrder", "(", ")", "{", "$", "columns", "=", "$", "this", "->", "_columns", ";", "foreach", "(", "$", "this", "->", "getColumnsOrder", "(", ")", "as", "$", "columnId", "=>", "$", "after", ")", "{", "if", "(", "$", "...
Sort columns by predefined order @return Mage_Adminhtml_Block_Widget_Grid
[ "Sort", "columns", "by", "predefined", "order" ]
train
https://github.com/AOEpeople/Aoe_Layout/blob/d88ba3406cf12dbaf09548477133c3cb27d155ed/app/code/local/Aoe/Layout/Block/Widget/Grid.php#L97-L127
AOEpeople/Aoe_Layout
app/code/local/Aoe/Layout/Block/Widget/Grid.php
Aoe_Layout_Block_Widget_Grid.updateColumn
public function updateColumn($columnId, $key, $value) { if (isset($this->_columns[$columnId]) && $this->_columns[$columnId] instanceof Varien_Object) { $this->_columns[$columnId]->setData($key, $value); } return $this; }
php
public function updateColumn($columnId, $key, $value) { if (isset($this->_columns[$columnId]) && $this->_columns[$columnId] instanceof Varien_Object) { $this->_columns[$columnId]->setData($key, $value); } return $this; }
[ "public", "function", "updateColumn", "(", "$", "columnId", ",", "$", "key", ",", "$", "value", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "_columns", "[", "$", "columnId", "]", ")", "&&", "$", "this", "->", "_columns", "[", "$", "column...
Modify grid column @param $columnId @param $key @param $value @return $this
[ "Modify", "grid", "column" ]
train
https://github.com/AOEpeople/Aoe_Layout/blob/d88ba3406cf12dbaf09548477133c3cb27d155ed/app/code/local/Aoe/Layout/Block/Widget/Grid.php#L138-L145
nonzod/yii2-foundation
Button.php
Button.run
public function run() { if($this->tagName == 'a') { echo Html::a($this->encodeLabel ? Html::encode($this->label) : $this->label, $this->url, $this->options); } else { $this->options['tabindex'] = '0'; echo Html::tag($this->tagName, $this->encodeLabel ? Html::encode($this->label) : $this->label...
php
public function run() { if($this->tagName == 'a') { echo Html::a($this->encodeLabel ? Html::encode($this->label) : $this->label, $this->url, $this->options); } else { $this->options['tabindex'] = '0'; echo Html::tag($this->tagName, $this->encodeLabel ? Html::encode($this->label) : $this->label...
[ "public", "function", "run", "(", ")", "{", "if", "(", "$", "this", "->", "tagName", "==", "'a'", ")", "{", "echo", "Html", "::", "a", "(", "$", "this", "->", "encodeLabel", "?", "Html", "::", "encode", "(", "$", "this", "->", "label", ")", ":", ...
Renders the widget.
[ "Renders", "the", "widget", "." ]
train
https://github.com/nonzod/yii2-foundation/blob/5df93b8a39a73a7fade2f3189693fdb6625205d2/Button.php#L61-L68
HedronDev/hedron
src/ProjectTypeDictionary.php
ProjectTypeDictionary.getCurrentProject
public function getCurrentProject() { return $this->createInstance($this->environment->getProjectType(), $this->environment, $this->configuration, $this->fileSystem); }
php
public function getCurrentProject() { return $this->createInstance($this->environment->getProjectType(), $this->environment, $this->configuration, $this->fileSystem); }
[ "public", "function", "getCurrentProject", "(", ")", "{", "return", "$", "this", "->", "createInstance", "(", "$", "this", "->", "environment", "->", "getProjectType", "(", ")", ",", "$", "this", "->", "environment", ",", "$", "this", "->", "configuration", ...
Get a project plugin for the current environment settings. @return \Hedron\ProjectTypeInterface
[ "Get", "a", "project", "plugin", "for", "the", "current", "environment", "settings", "." ]
train
https://github.com/HedronDev/hedron/blob/3b4adec4912f2d7c0b7e7262dc36515fbc2e8e00/src/ProjectTypeDictionary.php#L55-L57
zhouyl/mellivora
Mellivora/Config/NativeArray.php
NativeArray.set
public function set($key, $value = null) { $data = is_array($key) ? $key : [$key => $value]; foreach ($data as $key => $value) { Arr::set($this->config, $key, is_array($value) ? new self($value) : $value); } return $this; }
php
public function set($key, $value = null) { $data = is_array($key) ? $key : [$key => $value]; foreach ($data as $key => $value) { Arr::set($this->config, $key, is_array($value) ? new self($value) : $value); } return $this; }
[ "public", "function", "set", "(", "$", "key", ",", "$", "value", "=", "null", ")", "{", "$", "data", "=", "is_array", "(", "$", "key", ")", "?", "$", "key", ":", "[", "$", "key", "=>", "$", "value", "]", ";", "foreach", "(", "$", "data", "as"...
设定配置数据 @param string $key @param mixed $value @return \Mellivora\Config\NativeArray
[ "设定配置数据" ]
train
https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Config/NativeArray.php#L43-L52
zhouyl/mellivora
Mellivora/Config/NativeArray.php
NativeArray.get
public function get($key, $default = null) { $data = Arr::get($this->config, $key); if ($data === null) { $data = is_array($default) ? new self($default) : $default; } return $data; }
php
public function get($key, $default = null) { $data = Arr::get($this->config, $key); if ($data === null) { $data = is_array($default) ? new self($default) : $default; } return $data; }
[ "public", "function", "get", "(", "$", "key", ",", "$", "default", "=", "null", ")", "{", "$", "data", "=", "Arr", "::", "get", "(", "$", "this", "->", "config", ",", "$", "key", ")", ";", "if", "(", "$", "data", "===", "null", ")", "{", "$",...
获取配置数据 @param string $key @param mixed $default @return mixed
[ "获取配置数据" ]
train
https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Config/NativeArray.php#L62-L71
zhouyl/mellivora
Mellivora/Config/NativeArray.php
NativeArray.toArray
public function toArray() { $data = []; foreach ($this->config as $key => $value) { if ($value instanceof self) { $value = $value->toArray(); } $data[$key] = $value; } return $data; }
php
public function toArray() { $data = []; foreach ($this->config as $key => $value) { if ($value instanceof self) { $value = $value->toArray(); } $data[$key] = $value; } return $data; }
[ "public", "function", "toArray", "(", ")", "{", "$", "data", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "config", "as", "$", "key", "=>", "$", "value", ")", "{", "if", "(", "$", "value", "instanceof", "self", ")", "{", "$", "value", ...
将配置数据转换为数组格式 @return array
[ "将配置数据转换为数组格式" ]
train
https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Config/NativeArray.php#L114-L127
inhere/php-librarys
src/Traits/TraitUseOption.php
TraitUseOption.getOption
public function getOption(string $name, $default = null, $strict = null) { if (array_key_exists($name, $this->options)) { $value = $this->options[$name]; // use strict, check value is empty ? if (true === $strict || (false !== $strict && $this->isStrict())) { ...
php
public function getOption(string $name, $default = null, $strict = null) { if (array_key_exists($name, $this->options)) { $value = $this->options[$name]; // use strict, check value is empty ? if (true === $strict || (false !== $strict && $this->isStrict())) { ...
[ "public", "function", "getOption", "(", "string", "$", "name", ",", "$", "default", "=", "null", ",", "$", "strict", "=", "null", ")", "{", "if", "(", "array_key_exists", "(", "$", "name", ",", "$", "this", "->", "options", ")", ")", "{", "$", "val...
Method to get property Options @param string $name @param mixed $default @param null|bool $strict @return mixed
[ "Method", "to", "get", "property", "Options" ]
train
https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/Traits/TraitUseOption.php#L56-L75
inhere/php-librarys
src/Traits/TraitUseOption.php
TraitUseOption.delOption
public function delOption($name) { $value = null; if ($this->hasOption($name)) { $value = $this->getOption($name); unset($this->options[$name]); } return $value; }
php
public function delOption($name) { $value = null; if ($this->hasOption($name)) { $value = $this->getOption($name); unset($this->options[$name]); } return $value; }
[ "public", "function", "delOption", "(", "$", "name", ")", "{", "$", "value", "=", "null", ";", "if", "(", "$", "this", "->", "hasOption", "(", "$", "name", ")", ")", "{", "$", "value", "=", "$", "this", "->", "getOption", "(", "$", "name", ")", ...
delete a option @param $name @return mixed|null
[ "delete", "a", "option" ]
train
https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/Traits/TraitUseOption.php#L95-L106
inhere/php-librarys
src/Traits/TraitUseOption.php
TraitUseOption.setOptions
public function setOptions(array $options, $merge = true) { $this->options = $merge ? ArrayHelper::merge($this->options, $options) : $options; return $this; }
php
public function setOptions(array $options, $merge = true) { $this->options = $merge ? ArrayHelper::merge($this->options, $options) : $options; return $this; }
[ "public", "function", "setOptions", "(", "array", "$", "options", ",", "$", "merge", "=", "true", ")", "{", "$", "this", "->", "options", "=", "$", "merge", "?", "ArrayHelper", "::", "merge", "(", "$", "this", "->", "options", ",", "$", "options", ")...
Method to set property options @param array $options @param bool $merge @return static Return self to support chaining.
[ "Method", "to", "set", "property", "options" ]
train
https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/Traits/TraitUseOption.php#L123-L128
vaibhavpandeyvpz/sandesh
src/Uri.php
Uri.getAuthority
public function getAuthority() { $authority = $this->host; $info = $this->getUserInfo(); if ($info) { $authority = "{$info}@{$authority}"; } if ($this->port) { $authority = "{$authority}:{$this->port}"; } return $authority; }
php
public function getAuthority() { $authority = $this->host; $info = $this->getUserInfo(); if ($info) { $authority = "{$info}@{$authority}"; } if ($this->port) { $authority = "{$authority}:{$this->port}"; } return $authority; }
[ "public", "function", "getAuthority", "(", ")", "{", "$", "authority", "=", "$", "this", "->", "host", ";", "$", "info", "=", "$", "this", "->", "getUserInfo", "(", ")", ";", "if", "(", "$", "info", ")", "{", "$", "authority", "=", "\"{$info}@{$autho...
{@inheritdoc}
[ "{" ]
train
https://github.com/vaibhavpandeyvpz/sandesh/blob/bea2d06c7cac099ed82da973c922859de4158de0/src/Uri.php#L65-L76
vaibhavpandeyvpz/sandesh
src/Uri.php
Uri.getUserInfo
public function getUserInfo() { $info = $this->user; if ($info && $this->password) { $info .= (':' . $this->password); } return $info; }
php
public function getUserInfo() { $info = $this->user; if ($info && $this->password) { $info .= (':' . $this->password); } return $info; }
[ "public", "function", "getUserInfo", "(", ")", "{", "$", "info", "=", "$", "this", "->", "user", ";", "if", "(", "$", "info", "&&", "$", "this", "->", "password", ")", "{", "$", "info", ".=", "(", "':'", ".", "$", "this", "->", "password", ")", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/vaibhavpandeyvpz/sandesh/blob/bea2d06c7cac099ed82da973c922859de4158de0/src/Uri.php#L129-L136
vaibhavpandeyvpz/sandesh
src/Uri.php
Uri.withPath
public function withPath($path) { MessageValidations::assertPath($path); $path = MessageValidations::normalizePath($path); $clone = clone $this; $clone->path = $path; return $clone; }
php
public function withPath($path) { MessageValidations::assertPath($path); $path = MessageValidations::normalizePath($path); $clone = clone $this; $clone->path = $path; return $clone; }
[ "public", "function", "withPath", "(", "$", "path", ")", "{", "MessageValidations", "::", "assertPath", "(", "$", "path", ")", ";", "$", "path", "=", "MessageValidations", "::", "normalizePath", "(", "$", "path", ")", ";", "$", "clone", "=", "clone", "$"...
{@inheritdoc}
[ "{" ]
train
https://github.com/vaibhavpandeyvpz/sandesh/blob/bea2d06c7cac099ed82da973c922859de4158de0/src/Uri.php#L163-L170
vaibhavpandeyvpz/sandesh
src/Uri.php
Uri.withPort
public function withPort($port) { if ($port !== null) { MessageValidations::assertTcpUdpPort($port = (int)$port); } $clone = clone $this; $clone->port = $port; return $clone; }
php
public function withPort($port) { if ($port !== null) { MessageValidations::assertTcpUdpPort($port = (int)$port); } $clone = clone $this; $clone->port = $port; return $clone; }
[ "public", "function", "withPort", "(", "$", "port", ")", "{", "if", "(", "$", "port", "!==", "null", ")", "{", "MessageValidations", "::", "assertTcpUdpPort", "(", "$", "port", "=", "(", "int", ")", "$", "port", ")", ";", "}", "$", "clone", "=", "c...
{@inheritdoc}
[ "{" ]
train
https://github.com/vaibhavpandeyvpz/sandesh/blob/bea2d06c7cac099ed82da973c922859de4158de0/src/Uri.php#L175-L183
vaibhavpandeyvpz/sandesh
src/Uri.php
Uri.withQuery
public function withQuery($query) { MessageValidations::assertQuery($query); $query = MessageValidations::normalizeQuery($query); $clone = clone $this; $clone->query = $query; return $clone; }
php
public function withQuery($query) { MessageValidations::assertQuery($query); $query = MessageValidations::normalizeQuery($query); $clone = clone $this; $clone->query = $query; return $clone; }
[ "public", "function", "withQuery", "(", "$", "query", ")", "{", "MessageValidations", "::", "assertQuery", "(", "$", "query", ")", ";", "$", "query", "=", "MessageValidations", "::", "normalizeQuery", "(", "$", "query", ")", ";", "$", "clone", "=", "clone"...
{@inheritdoc}
[ "{" ]
train
https://github.com/vaibhavpandeyvpz/sandesh/blob/bea2d06c7cac099ed82da973c922859de4158de0/src/Uri.php#L188-L195
ClementIV/yii-rest-rbac2.0
controllers/UserController.php
UserController.actionIndex
public function actionIndex() { $request = \Yii::$app->request; if ($request->getIsOptions()) { return $this->ResponseOptions($this->verbs()['index']); } try{ $searchModel = new UserSearch(); $dataProvider = $searchModel->search(Yii::$app->request-...
php
public function actionIndex() { $request = \Yii::$app->request; if ($request->getIsOptions()) { return $this->ResponseOptions($this->verbs()['index']); } try{ $searchModel = new UserSearch(); $dataProvider = $searchModel->search(Yii::$app->request-...
[ "public", "function", "actionIndex", "(", ")", "{", "$", "request", "=", "\\", "Yii", "::", "$", "app", "->", "request", ";", "if", "(", "$", "request", "->", "getIsOptions", "(", ")", ")", "{", "return", "$", "this", "->", "ResponseOptions", "(", "$...
Lists all User models. @return mixed
[ "Lists", "all", "User", "models", "." ]
train
https://github.com/ClementIV/yii-rest-rbac2.0/blob/435ffceca8d51b4d369182db3a06c20f336e9ac4/controllers/UserController.php#L84-L101
ClementIV/yii-rest-rbac2.0
controllers/UserController.php
UserController.actionDelete
public function actionDelete($id) { try{ return $this->findModel($id)->delete(); }catch(Exception $e){ throw new Exception($e); } }
php
public function actionDelete($id) { try{ return $this->findModel($id)->delete(); }catch(Exception $e){ throw new Exception($e); } }
[ "public", "function", "actionDelete", "(", "$", "id", ")", "{", "try", "{", "return", "$", "this", "->", "findModel", "(", "$", "id", ")", "->", "delete", "(", ")", ";", "}", "catch", "(", "Exception", "$", "e", ")", "{", "throw", "new", "Exception...
Deletes an existing User model. If deletion is successful, the browser will be redirected to the 'index' page. @param integer $id @return mixed
[ "Deletes", "an", "existing", "User", "model", ".", "If", "deletion", "is", "successful", "the", "browser", "will", "be", "redirected", "to", "the", "index", "page", "." ]
train
https://github.com/ClementIV/yii-rest-rbac2.0/blob/435ffceca8d51b4d369182db3a06c20f336e9ac4/controllers/UserController.php#L128-L136
ClementIV/yii-rest-rbac2.0
controllers/UserController.php
UserController.actionSignup
public function actionSignup() { $request = \Yii::$app->request; if ($request->getIsOptions()) { return $this->ResponseOptions($this->verbs()['signup']); } try{ $model = new SignupForm(); $model->setAttributes(Yii::$app->request->post()); ...
php
public function actionSignup() { $request = \Yii::$app->request; if ($request->getIsOptions()) { return $this->ResponseOptions($this->verbs()['signup']); } try{ $model = new SignupForm(); $model->setAttributes(Yii::$app->request->post()); ...
[ "public", "function", "actionSignup", "(", ")", "{", "$", "request", "=", "\\", "Yii", "::", "$", "app", "->", "request", ";", "if", "(", "$", "request", "->", "getIsOptions", "(", ")", ")", "{", "return", "$", "this", "->", "ResponseOptions", "(", "...
Signup new user @return string
[ "Signup", "new", "user" ]
train
https://github.com/ClementIV/yii-rest-rbac2.0/blob/435ffceca8d51b4d369182db3a06c20f336e9ac4/controllers/UserController.php#L147-L168
php-lug/lug
src/Bundle/GridBundle/Form/Type/GridType.php
GridType.buildForm
public function buildForm(FormBuilderInterface $builder, array $options) { $builder ->add('filters', GridFiltersType::class, ['grid' => $options['grid']]) ->add('sorting', GridSortingType::class, ['grid' => $options['grid']]) ->add('page', GridPageType::class) ...
php
public function buildForm(FormBuilderInterface $builder, array $options) { $builder ->add('filters', GridFiltersType::class, ['grid' => $options['grid']]) ->add('sorting', GridSortingType::class, ['grid' => $options['grid']]) ->add('page', GridPageType::class) ...
[ "public", "function", "buildForm", "(", "FormBuilderInterface", "$", "builder", ",", "array", "$", "options", ")", "{", "$", "builder", "->", "add", "(", "'filters'", ",", "GridFiltersType", "::", "class", ",", "[", "'grid'", "=>", "$", "options", "[", "'g...
{@inheritdoc}
[ "{" ]
train
https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/GridBundle/Form/Type/GridType.php#L51-L65
php-lug/lug
src/Bundle/GridBundle/Form/Type/GridType.php
GridType.configureOptions
public function configureOptions(OptionsResolver $resolver) { $resolver ->setDefaults([ 'persistent' => function (Options $options) { return $options['grid']->hasOption('persistent') && $options['grid']->getOption('persistent'); ...
php
public function configureOptions(OptionsResolver $resolver) { $resolver ->setDefaults([ 'persistent' => function (Options $options) { return $options['grid']->hasOption('persistent') && $options['grid']->getOption('persistent'); ...
[ "public", "function", "configureOptions", "(", "OptionsResolver", "$", "resolver", ")", "{", "$", "resolver", "->", "setDefaults", "(", "[", "'persistent'", "=>", "function", "(", "Options", "$", "options", ")", "{", "return", "$", "options", "[", "'grid'", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/GridBundle/Form/Type/GridType.php#L70-L88
nguyenanhung/security
src/Password.php
Password.passwordReHash
public static function passwordReHash($password = '', $hash = '') { if (self::verifyPassword($password, $hash)) { if (password_needs_rehash($hash, self::ALGORITHM_DEFAULT)) { return self::createPassword($password); } } return NULL; }
php
public static function passwordReHash($password = '', $hash = '') { if (self::verifyPassword($password, $hash)) { if (password_needs_rehash($hash, self::ALGORITHM_DEFAULT)) { return self::createPassword($password); } } return NULL; }
[ "public", "static", "function", "passwordReHash", "(", "$", "password", "=", "''", ",", "$", "hash", "=", "''", ")", "{", "if", "(", "self", "::", "verifyPassword", "(", "$", "password", ",", "$", "hash", ")", ")", "{", "if", "(", "password_needs_rehas...
Function passwordReHash @author: 713uk13m <dev@nguyenanhung.com> @time : 2018-12-03 16:09 @param string $password @param string $hash @return bool|false|string|null
[ "Function", "passwordReHash" ]
train
https://github.com/nguyenanhung/security/blob/a2c9bac66d3c2dad6d668ba6c2bd82ed04bffbd6/src/Password.php#L106-L115
Eresus/EresusCMS
src/core/framework/core/3rdparty/dwoo/Dwoo/Plugin.php
Dwoo_Plugin.paramsToAttributes
public static function paramsToAttributes(array $params, $delim = '\'') { if (isset($params['*'])) { $params = array_merge($params, $params['*']); unset($params['*']); } $out = ''; foreach ($params as $attr=>$val) { $out .= ' '.$attr.'='; if (trim($val, '"\'')=='' || $val=='null') { $out .= st...
php
public static function paramsToAttributes(array $params, $delim = '\'') { if (isset($params['*'])) { $params = array_merge($params, $params['*']); unset($params['*']); } $out = ''; foreach ($params as $attr=>$val) { $out .= ' '.$attr.'='; if (trim($val, '"\'')=='' || $val=='null') { $out .= st...
[ "public", "static", "function", "paramsToAttributes", "(", "array", "$", "params", ",", "$", "delim", "=", "'\\''", ")", "{", "if", "(", "isset", "(", "$", "params", "[", "'*'", "]", ")", ")", "{", "$", "params", "=", "array_merge", "(", "$", "params...
utility function that converts an array of compiled parameters (or rest array) to a string of xml/html tag attributes this is to be used in preProcessing or postProcessing functions, example : $p = $compiler->getCompiledParams($params); // get only the rest array as attributes $attributes = Dwoo_Plugin::paramsToAttrib...
[ "utility", "function", "that", "converts", "an", "array", "of", "compiled", "parameters", "(", "or", "rest", "array", ")", "to", "a", "string", "of", "xml", "/", "html", "tag", "attributes" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Plugin.php#L64-L84
Erdiko/core
src/Response.php
Response.getKeyValue
public function getKeyValue($key) { return empty($this->_data[$key]) ? null: $this->_data[$key]; }
php
public function getKeyValue($key) { return empty($this->_data[$key]) ? null: $this->_data[$key]; }
[ "public", "function", "getKeyValue", "(", "$", "key", ")", "{", "return", "empty", "(", "$", "this", "->", "_data", "[", "$", "key", "]", ")", "?", "null", ":", "$", "this", "->", "_data", "[", "$", "key", "]", ";", "}" ]
Get data value by key @param mixed $key @return mixed
[ "Get", "data", "value", "by", "key" ]
train
https://github.com/Erdiko/core/blob/c7947ee973b0ad2fd05a6d1d8ce45696618c8fa6/src/Response.php#L55-L58
Erdiko/core
src/Response.php
Response.addTypedKeyValue
public function addTypedKeyValue($type, $key, $value) { if(empty($this->_data[$type])) $this->_data[$type] = array(); $this->_data[$type][$key] = $value; }
php
public function addTypedKeyValue($type, $key, $value) { if(empty($this->_data[$type])) $this->_data[$type] = array(); $this->_data[$type][$key] = $value; }
[ "public", "function", "addTypedKeyValue", "(", "$", "type", ",", "$", "key", ",", "$", "value", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "_data", "[", "$", "type", "]", ")", ")", "$", "this", "->", "_data", "[", "$", "type", "]", "...
Add a pool of key/values segmented by type This is useful for js/css includes and other grouped data
[ "Add", "a", "pool", "of", "key", "/", "values", "segmented", "by", "type", "This", "is", "useful", "for", "js", "/", "css", "includes", "and", "other", "grouped", "data" ]
train
https://github.com/Erdiko/core/blob/c7947ee973b0ad2fd05a6d1d8ce45696618c8fa6/src/Response.php#L64-L69
Erdiko/core
src/Response.php
Response.getTheme
public function getTheme() { if($this->_theme === null) $this->_theme = new \erdiko\core\Theme($this->getThemeName(), null, $this->getThemeTemplate()); return $this->_theme; }
php
public function getTheme() { if($this->_theme === null) $this->_theme = new \erdiko\core\Theme($this->getThemeName(), null, $this->getThemeTemplate()); return $this->_theme; }
[ "public", "function", "getTheme", "(", ")", "{", "if", "(", "$", "this", "->", "_theme", "===", "null", ")", "$", "this", "->", "_theme", "=", "new", "\\", "erdiko", "\\", "core", "\\", "Theme", "(", "$", "this", "->", "getThemeName", "(", ")", ","...
Get theme @return Theme Object $theme
[ "Get", "theme" ]
train
https://github.com/Erdiko/core/blob/c7947ee973b0ad2fd05a6d1d8ce45696618c8fa6/src/Response.php#L86-L92
Erdiko/core
src/Response.php
Response.getThemeName
public function getThemeName() { if(!empty($this->_themeName)) $name = $this->_themeName; elseif(!empty($this->_theme)) $name = $this->_theme->getName(); else $name = Helper::getConfig()['theme']['name']; return $name; }
php
public function getThemeName() { if(!empty($this->_themeName)) $name = $this->_themeName; elseif(!empty($this->_theme)) $name = $this->_theme->getName(); else $name = Helper::getConfig()['theme']['name']; return $name; }
[ "public", "function", "getThemeName", "(", ")", "{", "if", "(", "!", "empty", "(", "$", "this", "->", "_themeName", ")", ")", "$", "name", "=", "$", "this", "->", "_themeName", ";", "elseif", "(", "!", "empty", "(", "$", "this", "->", "_theme", ")"...
Get the theme name Name pecking order: response, theme, config @return string $name
[ "Get", "the", "theme", "name", "Name", "pecking", "order", ":", "response", "theme", "config" ]
train
https://github.com/Erdiko/core/blob/c7947ee973b0ad2fd05a6d1d8ce45696618c8fa6/src/Response.php#L110-L120
Erdiko/core
src/Response.php
Response.setThemeTemplate
public function setThemeTemplate($template) { $this->_themeTemplate = $template; if ($this->getTheme() != null) { $this->getTheme()->setTemplate($this->_themeTemplate); } }
php
public function setThemeTemplate($template) { $this->_themeTemplate = $template; if ($this->getTheme() != null) { $this->getTheme()->setTemplate($this->_themeTemplate); } }
[ "public", "function", "setThemeTemplate", "(", "$", "template", ")", "{", "$", "this", "->", "_themeTemplate", "=", "$", "template", ";", "if", "(", "$", "this", "->", "getTheme", "(", ")", "!=", "null", ")", "{", "$", "this", "->", "getTheme", "(", ...
Set Theme Template @param string $tamplate
[ "Set", "Theme", "Template" ]
train
https://github.com/Erdiko/core/blob/c7947ee973b0ad2fd05a6d1d8ce45696618c8fa6/src/Response.php#L127-L133
Erdiko/core
src/Response.php
Response.render
public function render() { // Render all objects to html (string) $html = (string) $this->_content; if (!$this->_themeIgnore) { $theme = $this->getTheme(); $theme->setContent($html); // rendered html (body content) $html = (string) $theme; } ...
php
public function render() { // Render all objects to html (string) $html = (string) $this->_content; if (!$this->_themeIgnore) { $theme = $this->getTheme(); $theme->setContent($html); // rendered html (body content) $html = (string) $theme; } ...
[ "public", "function", "render", "(", ")", "{", "// Render all objects to html (string)", "$", "html", "=", "(", "string", ")", "$", "this", "->", "_content", ";", "if", "(", "!", "$", "this", "->", "_themeIgnore", ")", "{", "$", "theme", "=", "$", "this"...
Render @return string
[ "Render" ]
train
https://github.com/Erdiko/core/blob/c7947ee973b0ad2fd05a6d1d8ce45696618c8fa6/src/Response.php#L181-L193
GrupaZero/api
src/Gzero/Api/UrlParamsProcessor.php
UrlParamsProcessor.getProcessedFields
public function getProcessedFields() { return [ 'page' => $this->getPage(), 'perPage' => $this->getPerPage(), 'filter' => $this->filter, 'orderBy' => $this->orderBy, 'query' => $this->searchQuery ]; }
php
public function getProcessedFields() { return [ 'page' => $this->getPage(), 'perPage' => $this->getPerPage(), 'filter' => $this->filter, 'orderBy' => $this->orderBy, 'query' => $this->searchQuery ]; }
[ "public", "function", "getProcessedFields", "(", ")", "{", "return", "[", "'page'", "=>", "$", "this", "->", "getPage", "(", ")", ",", "'perPage'", "=>", "$", "this", "->", "getPerPage", "(", ")", ",", "'filter'", "=>", "$", "this", "->", "filter", ","...
Returns array with all processed fields @return array
[ "Returns", "array", "with", "all", "processed", "fields" ]
train
https://github.com/GrupaZero/api/blob/fc544bb6057274e9d5e7b617346c3f854ea5effd/src/Gzero/Api/UrlParamsProcessor.php#L100-L109
GrupaZero/api
src/Gzero/Api/UrlParamsProcessor.php
UrlParamsProcessor.process
public function process(array $input) { if (!empty($input['q'])) { $this->searchQuery = $input['q']; } if (!empty($input['sort'])) { foreach (explode(',', $input['sort']) as $sort) { $this->processOrderByParams($sort); } } $...
php
public function process(array $input) { if (!empty($input['q'])) { $this->searchQuery = $input['q']; } if (!empty($input['sort'])) { foreach (explode(',', $input['sort']) as $sort) { $this->processOrderByParams($sort); } } $...
[ "public", "function", "process", "(", "array", "$", "input", ")", "{", "if", "(", "!", "empty", "(", "$", "input", "[", "'q'", "]", ")", ")", "{", "$", "this", "->", "searchQuery", "=", "$", "input", "[", "'q'", "]", ";", "}", "if", "(", "!", ...
Process params @param array $input Array with parameters to process @return $this
[ "Process", "params" ]
train
https://github.com/GrupaZero/api/blob/fc544bb6057274e9d5e7b617346c3f854ea5effd/src/Gzero/Api/UrlParamsProcessor.php#L118-L135
GrupaZero/api
src/Gzero/Api/UrlParamsProcessor.php
UrlParamsProcessor.processOrderByParams
private function processOrderByParams($sort) { $direction = (substr($sort, 0, 1) == '-') ? 'DESC' : 'ASC'; $field = (substr($sort, 0, 1) == '-') ? substr($sort, 1) : $sort; $this->orderBy[] = [ snake_case($field), $direction ]; }
php
private function processOrderByParams($sort) { $direction = (substr($sort, 0, 1) == '-') ? 'DESC' : 'ASC'; $field = (substr($sort, 0, 1) == '-') ? substr($sort, 1) : $sort; $this->orderBy[] = [ snake_case($field), $direction ]; }
[ "private", "function", "processOrderByParams", "(", "$", "sort", ")", "{", "$", "direction", "=", "(", "substr", "(", "$", "sort", ",", "0", ",", "1", ")", "==", "'-'", ")", "?", "'DESC'", ":", "'ASC'", ";", "$", "field", "=", "(", "substr", "(", ...
Process order by params @param string $sort Sort parameter @return void
[ "Process", "order", "by", "params" ]
train
https://github.com/GrupaZero/api/blob/fc544bb6057274e9d5e7b617346c3f854ea5effd/src/Gzero/Api/UrlParamsProcessor.php#L144-L152
GrupaZero/api
src/Gzero/Api/UrlParamsProcessor.php
UrlParamsProcessor.processPageParams
private function processPageParams(array $input) { if (!empty($input['page']) && is_numeric($input['page'])) { $this->page = $input['page']; } if (!empty($input['per_page']) && is_numeric($input['per_page'])) { $this->perPage = $input['per_page']; } re...
php
private function processPageParams(array $input) { if (!empty($input['page']) && is_numeric($input['page'])) { $this->page = $input['page']; } if (!empty($input['per_page']) && is_numeric($input['per_page'])) { $this->perPage = $input['per_page']; } re...
[ "private", "function", "processPageParams", "(", "array", "$", "input", ")", "{", "if", "(", "!", "empty", "(", "$", "input", "[", "'page'", "]", ")", "&&", "is_numeric", "(", "$", "input", "[", "'page'", "]", ")", ")", "{", "$", "this", "->", "pag...
Process page params @param array $input Array of parameters @return mixed
[ "Process", "page", "params" ]
train
https://github.com/GrupaZero/api/blob/fc544bb6057274e9d5e7b617346c3f854ea5effd/src/Gzero/Api/UrlParamsProcessor.php#L161-L170
GrupaZero/api
src/Gzero/Api/UrlParamsProcessor.php
UrlParamsProcessor.processFilterParams
private function processFilterParams($key, $param) { $this->filter[] = [ $key, '=', (is_numeric($param)) ? (float) $param : $param ]; }
php
private function processFilterParams($key, $param) { $this->filter[] = [ $key, '=', (is_numeric($param)) ? (float) $param : $param ]; }
[ "private", "function", "processFilterParams", "(", "$", "key", ",", "$", "param", ")", "{", "$", "this", "->", "filter", "[", "]", "=", "[", "$", "key", ",", "'='", ",", "(", "is_numeric", "(", "$", "param", ")", ")", "?", "(", "float", ")", "$",...
Process filter params @param string $key Param name @param string $param Param value @return void
[ "Process", "filter", "params" ]
train
https://github.com/GrupaZero/api/blob/fc544bb6057274e9d5e7b617346c3f854ea5effd/src/Gzero/Api/UrlParamsProcessor.php#L180-L187
frdl/webfan
.ApplicationComposer/apps/frdl/webfan/ApplicationComposer/Command/html.php
html.item_accounts
protected function item_accounts(){ $html .= $this->item_login(); $html .= $this->item_icontem(); $html .= $this->item_webfan(); $html .= $this->item_api(); $this->result->js .= " mod.Tabs.delTabs(); mod.Tabs.addTab('#window_main_frdl-webfan-login', ...
php
protected function item_accounts(){ $html .= $this->item_login(); $html .= $this->item_icontem(); $html .= $this->item_webfan(); $html .= $this->item_api(); $this->result->js .= " mod.Tabs.delTabs(); mod.Tabs.addTab('#window_main_frdl-webfan-login', ...
[ "protected", "function", "item_accounts", "(", ")", "{", "$", "html", ".=", "$", "this", "->", "item_login", "(", ")", ";", "$", "html", ".=", "$", "this", "->", "item_icontem", "(", ")", ";", "$", "html", ".=", "$", "this", "->", "item_webfan", "(",...
/* protected function item_package(){ $tab = 'window_main_frdl-webfan-packages-package'; $html = ''; $this->_check_db(); if(true !== $this->check($html, $tab, true, true))return $html; $p = new \frdl\ApplicationComposer\Package\Man(true); $p -> run('package', $this->argtoks, $this->data['config'], $this); $html.= '<di...
[ "/", "*", "protected", "function", "item_package", "()", "{", "$tab", "=", "window_main_frdl", "-", "webfan", "-", "packages", "-", "package", ";", "$html", "=", ";", "$this", "-", ">", "_check_db", "()", ";", "if", "(", "true", "!", "==", "$this", "-"...
train
https://github.com/frdl/webfan/blob/84d270377685224e891cd9d571b103b36f05b845/.ApplicationComposer/apps/frdl/webfan/ApplicationComposer/Command/html.php#L324-L342
surebert/surebert-framework
src/sb/String/Image.php
Image.draw
public function draw($text, $size=12, $x=0, $y=0) { imagettftext($this->image, $size, $this->rotation, $x, $y, $this->text_color, $this->font, $text); return $this->image; }
php
public function draw($text, $size=12, $x=0, $y=0) { imagettftext($this->image, $size, $this->rotation, $x, $y, $this->text_color, $this->font, $text); return $this->image; }
[ "public", "function", "draw", "(", "$", "text", ",", "$", "size", "=", "12", ",", "$", "x", "=", "0", ",", "$", "y", "=", "0", ")", "{", "imagettftext", "(", "$", "this", "->", "image", ",", "$", "size", ",", "$", "this", "->", "rotation", ",...
Draws the text onto the image @param string $text The text to write on the image @param integer $size The font size to use @param integer $x The x position to start draiwng on the image @param integer $y The y position to start drawing on the image @return resource A png image resource that can be used by imagepn...
[ "Draws", "the", "text", "onto", "the", "image" ]
train
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/String/Image.php#L84-L91
hametuha/wpametu
src/WPametu/Pattern/Singleton.php
Singleton.get_instance
final public static function get_instance( array $setting = [] ) { $class_name = get_called_class(); if ( ! isset( self::$instances[ $class_name ] ) ) { self::$instances[ $class_name ] = new $class_name( $setting ); } return self::$instances[ $class_name ]; }
php
final public static function get_instance( array $setting = [] ) { $class_name = get_called_class(); if ( ! isset( self::$instances[ $class_name ] ) ) { self::$instances[ $class_name ] = new $class_name( $setting ); } return self::$instances[ $class_name ]; }
[ "final", "public", "static", "function", "get_instance", "(", "array", "$", "setting", "=", "[", "]", ")", "{", "$", "class_name", "=", "get_called_class", "(", ")", ";", "if", "(", "!", "isset", "(", "self", "::", "$", "instances", "[", "$", "class_na...
Singleton initialize method @param array $setting @return static
[ "Singleton", "initialize", "method" ]
train
https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/Pattern/Singleton.php#L32-L39
gdbots/iam-php
src/RevokeRolesFromUserHandler.php
RevokeRolesFromUserHandler.createUserRolesRevoked
protected function createUserRolesRevoked(RevokeRolesFromUser $command, Pbjx $pbjx): UserRolesRevoked { /** @var UserRolesRevoked $event */ $event = UserRolesRevokedV1Mixin::findOne()->createMessage(); return $event; }
php
protected function createUserRolesRevoked(RevokeRolesFromUser $command, Pbjx $pbjx): UserRolesRevoked { /** @var UserRolesRevoked $event */ $event = UserRolesRevokedV1Mixin::findOne()->createMessage(); return $event; }
[ "protected", "function", "createUserRolesRevoked", "(", "RevokeRolesFromUser", "$", "command", ",", "Pbjx", "$", "pbjx", ")", ":", "UserRolesRevoked", "{", "/** @var UserRolesRevoked $event */", "$", "event", "=", "UserRolesRevokedV1Mixin", "::", "findOne", "(", ")", ...
@param RevokeRolesFromUser $command @param Pbjx $pbjx @return UserRolesRevoked
[ "@param", "RevokeRolesFromUser", "$command", "@param", "Pbjx", "$pbjx" ]
train
https://github.com/gdbots/iam-php/blob/3dbfa602de183a7ac5fb5140304e8cf4c4b15ab3/src/RevokeRolesFromUserHandler.php#L75-L80
oroinc/OroLayoutComponent
ExpressionLanguage/ExpressionProcessor.php
ExpressionProcessor.checkStringValue
protected function checkStringValue($value) { if (is_string($value)) { $pos = strpos($value, '='); if ($pos === 0) { // expression return self::STRING_IS_EXPRESSION; } elseif ($pos === 1 && $value[0] === '\\') { // the backs...
php
protected function checkStringValue($value) { if (is_string($value)) { $pos = strpos($value, '='); if ($pos === 0) { // expression return self::STRING_IS_EXPRESSION; } elseif ($pos === 1 && $value[0] === '\\') { // the backs...
[ "protected", "function", "checkStringValue", "(", "$", "value", ")", "{", "if", "(", "is_string", "(", "$", "value", ")", ")", "{", "$", "pos", "=", "strpos", "(", "$", "value", ",", "'='", ")", ";", "if", "(", "$", "pos", "===", "0", ")", "{", ...
@param string $value @return int the checking result 0 - the value is regular string 1 - the value is an expression -1 - the value is string that starts with "\=" which should be replaces with "="
[ "@param", "string", "$value" ]
train
https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/ExpressionLanguage/ExpressionProcessor.php#L227-L242
ajant/SimpleArrayLibrary
src/Categories/Getters.php
Getters.getColumns
public static function getColumns(array $array, array $columns, $allRowsMustHaveAllColumns = false) { // validation foreach ($array as $key => $row) { if (!is_array($row)) { throw new UnexpectedValueException('Array element "' . $key . '" is not an array'); } ...
php
public static function getColumns(array $array, array $columns, $allRowsMustHaveAllColumns = false) { // validation foreach ($array as $key => $row) { if (!is_array($row)) { throw new UnexpectedValueException('Array element "' . $key . '" is not an array'); } ...
[ "public", "static", "function", "getColumns", "(", "array", "$", "array", ",", "array", "$", "columns", ",", "$", "allRowsMustHaveAllColumns", "=", "false", ")", "{", "// validation", "foreach", "(", "$", "array", "as", "$", "key", "=>", "$", "row", ")", ...
Extracts a column from an array @param array $array @param array $columns @param bool $allRowsMustHaveAllColumns @return array @throws UnexpectedValueException
[ "Extracts", "a", "column", "from", "an", "array" ]
train
https://github.com/ajant/SimpleArrayLibrary/blob/374877c0f20a22a914eb3680eb1cf39e424071be/src/Categories/Getters.php#L20-L49
ajant/SimpleArrayLibrary
src/Categories/Getters.php
Getters.getRectangularDimensions
public static function getRectangularDimensions(array $array) { $return = -1; $allArrays = array_map('is_array', $array); // all elements are arrays, iterate through them and call the static function recursively if (self::allElementsEqual($allArrays, true)) { $elementsPer...
php
public static function getRectangularDimensions(array $array) { $return = -1; $allArrays = array_map('is_array', $array); // all elements are arrays, iterate through them and call the static function recursively if (self::allElementsEqual($allArrays, true)) { $elementsPer...
[ "public", "static", "function", "getRectangularDimensions", "(", "array", "$", "array", ")", "{", "$", "return", "=", "-", "1", ";", "$", "allArrays", "=", "array_map", "(", "'is_array'", ",", "$", "array", ")", ";", "// all elements are arrays, iterate through ...
Checks if an array is rectangular array and returns dimensions or -1 if it's not rectangular @param array $array @return int|array
[ "Checks", "if", "an", "array", "is", "rectangular", "array", "and", "returns", "dimensions", "or", "-", "1", "if", "it", "s", "not", "rectangular" ]
train
https://github.com/ajant/SimpleArrayLibrary/blob/374877c0f20a22a914eb3680eb1cf39e424071be/src/Categories/Getters.php#L58-L84
ajant/SimpleArrayLibrary
src/Categories/Getters.php
Getters.selectRandomArrayElements
public static function selectRandomArrayElements(array $array, $numberOfRequiredElements) { // validation, must be positive int or 0 if (!self::isLogicallyCastableToInt($numberOfRequiredElements)) { throw new InvalidArgumentException('Number of requested elements parameter must be a posi...
php
public static function selectRandomArrayElements(array $array, $numberOfRequiredElements) { // validation, must be positive int or 0 if (!self::isLogicallyCastableToInt($numberOfRequiredElements)) { throw new InvalidArgumentException('Number of requested elements parameter must be a posi...
[ "public", "static", "function", "selectRandomArrayElements", "(", "array", "$", "array", ",", "$", "numberOfRequiredElements", ")", "{", "// validation, must be positive int or 0", "if", "(", "!", "self", "::", "isLogicallyCastableToInt", "(", "$", "numberOfRequiredElemen...
Selects random sub array @param array $array @param int $numberOfRequiredElements @return array @throws InvalidArgumentException
[ "Selects", "random", "sub", "array" ]
train
https://github.com/ajant/SimpleArrayLibrary/blob/374877c0f20a22a914eb3680eb1cf39e424071be/src/Categories/Getters.php#L95-L115
mothership-ec/composer
src/Composer/Command/ValidateCommand.php
ValidateCommand.execute
protected function execute(InputInterface $input, OutputInterface $output) { $file = $input->getArgument('file'); if (!file_exists($file)) { $this->getIO()->writeError('<error>' . $file . ' not found.</error>'); return 1; } if (!is_readable($file)) { ...
php
protected function execute(InputInterface $input, OutputInterface $output) { $file = $input->getArgument('file'); if (!file_exists($file)) { $this->getIO()->writeError('<error>' . $file . ' not found.</error>'); return 1; } if (!is_readable($file)) { ...
[ "protected", "function", "execute", "(", "InputInterface", "$", "input", ",", "OutputInterface", "$", "output", ")", "{", "$", "file", "=", "$", "input", "->", "getArgument", "(", "'file'", ")", ";", "if", "(", "!", "file_exists", "(", "$", "file", ")", ...
@param InputInterface $input @param OutputInterface $output @return int
[ "@param", "InputInterface", "$input", "@param", "OutputInterface", "$output" ]
train
https://github.com/mothership-ec/composer/blob/fa6ad031a939d8d33b211e428fdbdd28cfce238c/src/Composer/Command/ValidateCommand.php#L56-L109
lukasz-adamski/teamspeak3-framework
src/TeamSpeak3/Helper/Uri.php
Uri.parseUri
protected function parseUri($uriString = '') { $status = @preg_match("~^((//)([^/?#]*))([^?#]*)(\?([^#]*))?(#(.*))?$~", $uriString, $matches); if($status === FALSE) { throw new Exception("URI scheme-specific decomposition failed"); } if(!$status) return; $this->path = (isset($matches[...
php
protected function parseUri($uriString = '') { $status = @preg_match("~^((//)([^/?#]*))([^?#]*)(\?([^#]*))?(#(.*))?$~", $uriString, $matches); if($status === FALSE) { throw new Exception("URI scheme-specific decomposition failed"); } if(!$status) return; $this->path = (isset($matches[...
[ "protected", "function", "parseUri", "(", "$", "uriString", "=", "''", ")", "{", "$", "status", "=", "@", "preg_match", "(", "\"~^((//)([^/?#]*))([^?#]*)(\\?([^#]*))?(#(.*))?$~\"", ",", "$", "uriString", ",", "$", "matches", ")", ";", "if", "(", "$", "status",...
Parses the scheme-specific portion of the URI and place its parts into instance variables. @throws Exception @return void
[ "Parses", "the", "scheme", "-", "specific", "portion", "of", "the", "URI", "and", "place", "its", "parts", "into", "instance", "variables", "." ]
train
https://github.com/lukasz-adamski/teamspeak3-framework/blob/39a56eca608da6b56b6aa386a7b5b31dc576c41a/src/TeamSpeak3/Helper/Uri.php#L145-L173
lukasz-adamski/teamspeak3-framework
src/TeamSpeak3/Helper/Uri.php
Uri.check
public static function check($uri) { try { $uri = new self(strval($uri)); } catch(\Exception $e) { return FALSE; } return $uri->valid(); }
php
public static function check($uri) { try { $uri = new self(strval($uri)); } catch(\Exception $e) { return FALSE; } return $uri->valid(); }
[ "public", "static", "function", "check", "(", "$", "uri", ")", "{", "try", "{", "$", "uri", "=", "new", "self", "(", "strval", "(", "$", "uri", ")", ")", ";", "}", "catch", "(", "\\", "Exception", "$", "e", ")", "{", "return", "FALSE", ";", "}"...
Returns TRUE if a given URI is valid. @param string $uri @return boolean
[ "Returns", "TRUE", "if", "a", "given", "URI", "is", "valid", "." ]
train
https://github.com/lukasz-adamski/teamspeak3-framework/blob/39a56eca608da6b56b6aa386a7b5b31dc576c41a/src/TeamSpeak3/Helper/Uri.php#L191-L203
lukasz-adamski/teamspeak3-framework
src/TeamSpeak3/Helper/Uri.php
Uri.checkPath
public function checkPath($path = null) { if($path === null) { $path = $this->path; } if(strlen($path) == 0) { return TRUE; } $pattern = "/^" . $this->regex["path"] . "$/"; $status = @preg_match($pattern, $path); if($status === FALSE) { throw new Exception(...
php
public function checkPath($path = null) { if($path === null) { $path = $this->path; } if(strlen($path) == 0) { return TRUE; } $pattern = "/^" . $this->regex["path"] . "$/"; $status = @preg_match($pattern, $path); if($status === FALSE) { throw new Exception(...
[ "public", "function", "checkPath", "(", "$", "path", "=", "null", ")", "{", "if", "(", "$", "path", "===", "null", ")", "{", "$", "path", "=", "$", "this", "->", "path", ";", "}", "if", "(", "strlen", "(", "$", "path", ")", "==", "0", ")", "{...
Returns TRUE if the path is valid. @param string $path @throws Exception @return boolean
[ "Returns", "TRUE", "if", "the", "path", "is", "valid", "." ]
train
https://github.com/lukasz-adamski/teamspeak3-framework/blob/39a56eca608da6b56b6aa386a7b5b31dc576c41a/src/TeamSpeak3/Helper/Uri.php#L414-L435
lukasz-adamski/teamspeak3-framework
src/TeamSpeak3/Helper/Uri.php
Uri.getHostUri
public static function getHostUri() { $sheme = (self::getHostParam("HTTPS") == "on") ? "https" : "http"; $serverName = new Str(self::getHostParam("HTTP_HOST")); $serverPort = self::getHostParam("SERVER_PORT"); $serverPort = ($serverPort != 80 && $serverPort != 443) ? ":" . $serverPort : ""; if($...
php
public static function getHostUri() { $sheme = (self::getHostParam("HTTPS") == "on") ? "https" : "http"; $serverName = new Str(self::getHostParam("HTTP_HOST")); $serverPort = self::getHostParam("SERVER_PORT"); $serverPort = ($serverPort != 80 && $serverPort != 443) ? ":" . $serverPort : ""; if($...
[ "public", "static", "function", "getHostUri", "(", ")", "{", "$", "sheme", "=", "(", "self", "::", "getHostParam", "(", "\"HTTPS\"", ")", "==", "\"on\"", ")", "?", "\"https\"", ":", "\"http\"", ";", "$", "serverName", "=", "new", "Str", "(", "self", ":...
Returns the applications host address. @return Str
[ "Returns", "the", "applications", "host", "address", "." ]
train
https://github.com/lukasz-adamski/teamspeak3-framework/blob/39a56eca608da6b56b6aa386a7b5b31dc576c41a/src/TeamSpeak3/Helper/Uri.php#L677-L691
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Mail/src/parser/parts/text_parser.php
ezcMailTextParser.parseBody
public function parseBody( $line ) { $line = rtrim( $line, "\r\n" ); if ( $this->text === null ) { $this->text = $line; } else { $this->text .= "\n" . $line; } }
php
public function parseBody( $line ) { $line = rtrim( $line, "\r\n" ); if ( $this->text === null ) { $this->text = $line; } else { $this->text .= "\n" . $line; } }
[ "public", "function", "parseBody", "(", "$", "line", ")", "{", "$", "line", "=", "rtrim", "(", "$", "line", ",", "\"\\r\\n\"", ")", ";", "if", "(", "$", "this", "->", "text", "===", "null", ")", "{", "$", "this", "->", "text", "=", "$", "line", ...
Adds each line to the body of the text part. @param string $line
[ "Adds", "each", "line", "to", "the", "body", "of", "the", "text", "part", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/parser/parts/text_parser.php#L59-L70
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Mail/src/parser/parts/text_parser.php
ezcMailTextParser.finish
public function finish() { $charset = "us-ascii"; // RFC 2822 default if ( isset( $this->headers['Content-Type'] ) ) { preg_match( '/\s*charset\s?=\s?"?([^;"\s]*);?/', $this->headers['Content-Type'], $parameters ); ...
php
public function finish() { $charset = "us-ascii"; // RFC 2822 default if ( isset( $this->headers['Content-Type'] ) ) { preg_match( '/\s*charset\s?=\s?"?([^;"\s]*);?/', $this->headers['Content-Type'], $parameters ); ...
[ "public", "function", "finish", "(", ")", "{", "$", "charset", "=", "\"us-ascii\"", ";", "// RFC 2822 default", "if", "(", "isset", "(", "$", "this", "->", "headers", "[", "'Content-Type'", "]", ")", ")", "{", "preg_match", "(", "'/\\s*charset\\s?=\\s?\"?([^;\...
Returns the ezcMailText part corresponding to the parsed message. @return ezcMailText
[ "Returns", "the", "ezcMailText", "part", "corresponding", "to", "the", "parsed", "message", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/parser/parts/text_parser.php#L77-L109
qlake/framework
src/Qlake/Support/Autoload.php
Autoload.load
public static function load($class) { $file = static::normalizePath($class); if (file_exists($path = __DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.$file)) { require $path; return true; } foreach (static::$directories ...
php
public static function load($class) { $file = static::normalizePath($class); if (file_exists($path = __DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.$file)) { require $path; return true; } foreach (static::$directories ...
[ "public", "static", "function", "load", "(", "$", "class", ")", "{", "$", "file", "=", "static", "::", "normalizePath", "(", "$", "class", ")", ";", "if", "(", "file_exists", "(", "$", "path", "=", "__DIR__", ".", "DIRECTORY_SEPARATOR", ".", "'..'", "....
Search and Include a Class by class name like Qlake\Router\Route. @param string $class Like Qlake\Router\Route @return bool
[ "Search", "and", "Include", "a", "Class", "by", "class", "name", "like", "Qlake", "\\", "Router", "\\", "Route", "." ]
train
https://github.com/qlake/framework/blob/0b7bad459ae0721bc5cdd141344f9dfc1acee28a/src/Qlake/Support/Autoload.php#L41-L70
qlake/framework
src/Qlake/Support/Autoload.php
Autoload.removeDirectories
public static function removeDirectories($directories = null) { if (is_null($directories)) { static::$directories = []; } else { $directories = (array) $directories; static::$directories = array_filter(static::$directories, function($direc...
php
public static function removeDirectories($directories = null) { if (is_null($directories)) { static::$directories = []; } else { $directories = (array) $directories; static::$directories = array_filter(static::$directories, function($direc...
[ "public", "static", "function", "removeDirectories", "(", "$", "directories", "=", "null", ")", "{", "if", "(", "is_null", "(", "$", "directories", ")", ")", "{", "static", "::", "$", "directories", "=", "[", "]", ";", "}", "else", "{", "$", "directori...
Remove directory from directory list. If $directories parameter be null, all directories will be removed. @param string|null $directories @return void
[ "Remove", "directory", "from", "directory", "list", ".", "If", "$directories", "parameter", "be", "null", "all", "directories", "will", "be", "removed", "." ]
train
https://github.com/qlake/framework/blob/0b7bad459ae0721bc5cdd141344f9dfc1acee28a/src/Qlake/Support/Autoload.php#L124-L139
surebert/surebert-framework
src/sb/Web/Captcha.php
Captcha.createWord
private function createWord() { $this->word =''; for($x=0;$x<rand(5,7);$x++){ $this->word .=$this->allowed_characters[ rand(0, strlen($this->allowed_characters)-1)]; } return $this->word; }
php
private function createWord() { $this->word =''; for($x=0;$x<rand(5,7);$x++){ $this->word .=$this->allowed_characters[ rand(0, strlen($this->allowed_characters)-1)]; } return $this->word; }
[ "private", "function", "createWord", "(", ")", "{", "$", "this", "->", "word", "=", "''", ";", "for", "(", "$", "x", "=", "0", ";", "$", "x", "<", "rand", "(", "5", ",", "7", ")", ";", "$", "x", "++", ")", "{", "$", "this", "->", "word", ...
Creates the word from the allowed characters @return string
[ "Creates", "the", "word", "from", "the", "allowed", "characters" ]
train
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Web/Captcha.php#L107-L116
surebert/surebert-framework
src/sb/Web/Captcha.php
Captcha.addInterference
public function addInterference() { for($i=0;$i<20;$i++){ $radius = rand(0,150); imageellipse($this->image, rand(0,200), rand(0,200), $radius, $radius, $this->ink_color); } }
php
public function addInterference() { for($i=0;$i<20;$i++){ $radius = rand(0,150); imageellipse($this->image, rand(0,200), rand(0,200), $radius, $radius, $this->ink_color); } }
[ "public", "function", "addInterference", "(", ")", "{", "for", "(", "$", "i", "=", "0", ";", "$", "i", "<", "20", ";", "$", "i", "++", ")", "{", "$", "radius", "=", "rand", "(", "0", ",", "150", ")", ";", "imageellipse", "(", "$", "this", "->...
Adds interference as circles int he backgroun the make it more difficult to parse. This is optional
[ "Adds", "interference", "as", "circles", "int", "he", "backgroun", "the", "make", "it", "more", "difficult", "to", "parse", ".", "This", "is", "optional" ]
train
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Web/Captcha.php#L122-L129
surebert/surebert-framework
src/sb/Web/Captcha.php
Captcha.draw
public function draw($filters=Array()) { $word = $this->createWord(); for($j=0;$j<5;$j++){ if(file_exists($this->font)){ imagettftext($this->image, rand(8,18), rand(0,30), rand(0,200), rand(0,200), $this->ink_color, $this->font, 'not the code'); } else { ...
php
public function draw($filters=Array()) { $word = $this->createWord(); for($j=0;$j<5;$j++){ if(file_exists($this->font)){ imagettftext($this->image, rand(8,18), rand(0,30), rand(0,200), rand(0,200), $this->ink_color, $this->font, 'not the code'); } else { ...
[ "public", "function", "draw", "(", "$", "filters", "=", "Array", "(", ")", ")", "{", "$", "word", "=", "$", "this", "->", "createWord", "(", ")", ";", "for", "(", "$", "j", "=", "0", ";", "$", "j", "<", "5", ";", "$", "j", "++", ")", "{", ...
Draws the wor text on the image using the true type font specified. If no font is specified than @param arary $filters AN array of GD filter constants to run on the image @return resource THe image is returned and can be used with imagepng to display or export to file
[ "Draws", "the", "wor", "text", "on", "the", "image", "using", "the", "true", "type", "font", "specified", ".", "If", "no", "font", "is", "specified", "than" ]
train
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Web/Captcha.php#L137-L164
windwork/wf-logger
lib/LoggerAbstract.php
LoggerAbstract.checkLevel
protected function checkLevel($level) { switch ($this->logLevel) { case self::LEVEL_EMERGENCY: if ($level != 'emergency') { return false; } break; case self::LEVEL_ALTER: if ...
php
protected function checkLevel($level) { switch ($this->logLevel) { case self::LEVEL_EMERGENCY: if ($level != 'emergency') { return false; } break; case self::LEVEL_ALTER: if ...
[ "protected", "function", "checkLevel", "(", "$", "level", ")", "{", "switch", "(", "$", "this", "->", "logLevel", ")", "{", "case", "self", "::", "LEVEL_EMERGENCY", ":", "if", "(", "$", "level", "!=", "'emergency'", ")", "{", "return", "false", ";", "}...
检查是否启用该级别日志 @param string $level @return bool
[ "检查是否启用该级别日志" ]
train
https://github.com/windwork/wf-logger/blob/60cd331d4106296610ef0b827fce38f357231958/lib/LoggerAbstract.php#L91-L141
windwork/wf-logger
lib/LoggerAbstract.php
LoggerAbstract.setLogDir
public function setLogDir($dir) { $dir = str_replace("\\", "/", $dir); $dir = rtrim($dir, '/'); $this->logDir = $dir; }
php
public function setLogDir($dir) { $dir = str_replace("\\", "/", $dir); $dir = rtrim($dir, '/'); $this->logDir = $dir; }
[ "public", "function", "setLogDir", "(", "$", "dir", ")", "{", "$", "dir", "=", "str_replace", "(", "\"\\\\\"", ",", "\"/\"", ",", "$", "dir", ")", ";", "$", "dir", "=", "rtrim", "(", "$", "dir", ",", "'/'", ")", ";", "$", "this", "->", "logDir", ...
设置日志目录,支持wrapper @param string $dir
[ "设置日志目录,支持wrapper" ]
train
https://github.com/windwork/wf-logger/blob/60cd331d4106296610ef0b827fce38f357231958/lib/LoggerAbstract.php#L154-L160
hametuha/wpametu
src/WPametu/API/Controller.php
Controller.nonce_field
public function nonce_field($key = '_wpnonce', $referrer = false, $echo = true){ return wp_nonce_field($this->action, $key, $referrer, $echo); }
php
public function nonce_field($key = '_wpnonce', $referrer = false, $echo = true){ return wp_nonce_field($this->action, $key, $referrer, $echo); }
[ "public", "function", "nonce_field", "(", "$", "key", "=", "'_wpnonce'", ",", "$", "referrer", "=", "false", ",", "$", "echo", "=", "true", ")", "{", "return", "wp_nonce_field", "(", "$", "this", "->", "action", ",", "$", "key", ",", "$", "referrer", ...
Echo nonce field @param string $key Default _wpnonce @param bool $referrer Default false. @param bool $echo Default true @return string
[ "Echo", "nonce", "field" ]
train
https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/API/Controller.php#L152-L154
hametuha/wpametu
src/WPametu/API/Controller.php
Controller.load_template
public function load_template($slug, $name = '', array $args = []){ $base_path = $slug.'.php'; $original_path = $slug.( !empty($name) ? '-'.$name : '' ).'.php'; $found_path = ''; foreach( [$original_path, $base_path] as $file ){ foreach( [get_stylesheet_directory(), get_templ...
php
public function load_template($slug, $name = '', array $args = []){ $base_path = $slug.'.php'; $original_path = $slug.( !empty($name) ? '-'.$name : '' ).'.php'; $found_path = ''; foreach( [$original_path, $base_path] as $file ){ foreach( [get_stylesheet_directory(), get_templ...
[ "public", "function", "load_template", "(", "$", "slug", ",", "$", "name", "=", "''", ",", "array", "$", "args", "=", "[", "]", ")", "{", "$", "base_path", "=", "$", "slug", ".", "'.php'", ";", "$", "original_path", "=", "$", "slug", ".", "(", "!...
Load template @param string $slug @param string $name @param array $args This array will be extract
[ "Load", "template" ]
train
https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/API/Controller.php#L163-L184
hametuha/wpametu
src/WPametu/API/Controller.php
Controller.view
public static function view($slug, $name = '', array $args = []){ $class_name = get_called_class(); /** @var Controller $instance */ $instance = $class_name::get_instance(); $instance->lazy_scripts(); $instance->load_template($slug, $name, $args); }
php
public static function view($slug, $name = '', array $args = []){ $class_name = get_called_class(); /** @var Controller $instance */ $instance = $class_name::get_instance(); $instance->lazy_scripts(); $instance->load_template($slug, $name, $args); }
[ "public", "static", "function", "view", "(", "$", "slug", ",", "$", "name", "=", "''", ",", "array", "$", "args", "=", "[", "]", ")", "{", "$", "class_name", "=", "get_called_class", "(", ")", ";", "/** @var Controller $instance */", "$", "instance", "="...
Load view template with arguments @param string $slug @param string $name @param array $args
[ "Load", "view", "template", "with", "arguments" ]
train
https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/API/Controller.php#L193-L199
ekuiter/feature-php
FeaturePhp/Generator/ExtendGenerator.php
ExtendGenerator.getExtendableFile
private function getExtendableFile($specification) { $target = $specification->getTarget(); if (!array_key_exists($target, $this->extendableFiles)) { if (!$specification->mayCreate()) return null; $this->extendableFiles[$target] = $this->getExtendableFileFromSpeci...
php
private function getExtendableFile($specification) { $target = $specification->getTarget(); if (!array_key_exists($target, $this->extendableFiles)) { if (!$specification->mayCreate()) return null; $this->extendableFiles[$target] = $this->getExtendableFileFromSpeci...
[ "private", "function", "getExtendableFile", "(", "$", "specification", ")", "{", "$", "target", "=", "$", "specification", "->", "getTarget", "(", ")", ";", "if", "(", "!", "array_key_exists", "(", "$", "target", ",", "$", "this", "->", "extendableFiles", ...
Creates an extendable file from a specification. If the extendable file was already created, returns the cached extendable file. If the extendable file does not yet exist, create it if it may be created from this specification. @param \FeaturePhp\Specification\Specification $specification @return \FeaturePhp\File\Exten...
[ "Creates", "an", "extendable", "file", "from", "a", "specification", ".", "If", "the", "extendable", "file", "was", "already", "created", "returns", "the", "cached", "extendable", "file", ".", "If", "the", "extendable", "file", "does", "not", "yet", "exist", ...
train
https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Generator/ExtendGenerator.php#L41-L50
ekuiter/feature-php
FeaturePhp/Generator/ExtendGenerator.php
ExtendGenerator.generateFilesForArtifacts
private function generateFilesForArtifacts($artifacts, $fileSettingsGetter, $extend) { foreach ($artifacts as $artifact) { $settings = $artifact->getGeneratorSettings(static::getKey()); foreach (call_user_func(array($this, $fileSettingsGetter), $settings) as $file) { $sp...
php
private function generateFilesForArtifacts($artifacts, $fileSettingsGetter, $extend) { foreach ($artifacts as $artifact) { $settings = $artifact->getGeneratorSettings(static::getKey()); foreach (call_user_func(array($this, $fileSettingsGetter), $settings) as $file) { $sp...
[ "private", "function", "generateFilesForArtifacts", "(", "$", "artifacts", ",", "$", "fileSettingsGetter", ",", "$", "extend", ")", "{", "foreach", "(", "$", "artifacts", "as", "$", "artifact", ")", "{", "$", "settings", "=", "$", "artifact", "->", "getGener...
Generates the extendable files for a set of artifacts and file settings. @param \FeaturePhp\Artifact\Artifact[] $artifacts @param callable $fileSettingsGetter @param bool $extend
[ "Generates", "the", "extendable", "files", "for", "a", "set", "of", "artifacts", "and", "file", "settings", "." ]
train
https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Generator/ExtendGenerator.php#L58-L77
ekuiter/feature-php
FeaturePhp/Generator/ExtendGenerator.php
ExtendGenerator._generateFiles
protected function _generateFiles() { $this->generateFilesForArtifacts($this->selectedArtifacts, "getFileSettingsForSelected", false); $this->generateFilesForArtifacts($this->deselectedArtifacts, "getFileSettingsForDeselected", false); $this->generateFilesForArtifacts($this->selectedArt...
php
protected function _generateFiles() { $this->generateFilesForArtifacts($this->selectedArtifacts, "getFileSettingsForSelected", false); $this->generateFilesForArtifacts($this->deselectedArtifacts, "getFileSettingsForDeselected", false); $this->generateFilesForArtifacts($this->selectedArt...
[ "protected", "function", "_generateFiles", "(", ")", "{", "$", "this", "->", "generateFilesForArtifacts", "(", "$", "this", "->", "selectedArtifacts", ",", "\"getFileSettingsForSelected\"", ",", "false", ")", ";", "$", "this", "->", "generateFilesForArtifacts", "(",...
Generates the extendable files.
[ "Generates", "the", "extendable", "files", "." ]
train
https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Generator/ExtendGenerator.php#L82-L91
zicht/z
src/Zicht/Tool/Packager/Node/Stub.php
Stub.compile
final public function compile(Buffer $buffer) { $buffer ->writeln("Phar::mapPhar('z.phar');") ->writeln("define('ZPREFIX', 'phar://z.phar/');") ->writeln("require_once 'phar://z.phar/vendor/autoload.php';") ; $this->compileInitialization($buffer); ...
php
final public function compile(Buffer $buffer) { $buffer ->writeln("Phar::mapPhar('z.phar');") ->writeln("define('ZPREFIX', 'phar://z.phar/');") ->writeln("require_once 'phar://z.phar/vendor/autoload.php';") ; $this->compileInitialization($buffer); ...
[ "final", "public", "function", "compile", "(", "Buffer", "$", "buffer", ")", "{", "$", "buffer", "->", "writeln", "(", "\"Phar::mapPhar('z.phar');\"", ")", "->", "writeln", "(", "\"define('ZPREFIX', 'phar://z.phar/');\"", ")", "->", "writeln", "(", "\"require_once '...
Compiles into the specified buffer. @param \Zicht\Tool\Script\Buffer $buffer @return void
[ "Compiles", "into", "the", "specified", "buffer", "." ]
train
https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Packager/Node/Stub.php#L43-L56
gdbots/iam-php
src/GetAllAppsRequestHandler.php
GetAllAppsRequestHandler.handle
protected function handle(GetAllAppsRequest $request, Pbjx $pbjx): GetAllAppsResponse { $apps = []; /** @var Schema $schema */ foreach (AppV1Mixin::findAll() as $schema) { $this->ncr->pipeNodes($schema->getQName(), function (Node $node) use (&$apps) { $apps[] = $n...
php
protected function handle(GetAllAppsRequest $request, Pbjx $pbjx): GetAllAppsResponse { $apps = []; /** @var Schema $schema */ foreach (AppV1Mixin::findAll() as $schema) { $this->ncr->pipeNodes($schema->getQName(), function (Node $node) use (&$apps) { $apps[] = $n...
[ "protected", "function", "handle", "(", "GetAllAppsRequest", "$", "request", ",", "Pbjx", "$", "pbjx", ")", ":", "GetAllAppsResponse", "{", "$", "apps", "=", "[", "]", ";", "/** @var Schema $schema */", "foreach", "(", "AppV1Mixin", "::", "findAll", "(", ")", ...
@param GetAllAppsRequest $request @param Pbjx $pbjx @return GetAllAppsResponse
[ "@param", "GetAllAppsRequest", "$request", "@param", "Pbjx", "$pbjx" ]
train
https://github.com/gdbots/iam-php/blob/3dbfa602de183a7ac5fb5140304e8cf4c4b15ab3/src/GetAllAppsRequestHandler.php#L35-L46
gdbots/iam-php
src/GetAllAppsRequestHandler.php
GetAllAppsRequestHandler.createGetAllAppsResponse
protected function createGetAllAppsResponse(GetAllAppsRequest $request, Pbjx $pbjx): GetAllAppsResponse { /** @var GetAllAppsResponse $response */ $response = $this->createResponseFromRequest($request, $pbjx); return $response; }
php
protected function createGetAllAppsResponse(GetAllAppsRequest $request, Pbjx $pbjx): GetAllAppsResponse { /** @var GetAllAppsResponse $response */ $response = $this->createResponseFromRequest($request, $pbjx); return $response; }
[ "protected", "function", "createGetAllAppsResponse", "(", "GetAllAppsRequest", "$", "request", ",", "Pbjx", "$", "pbjx", ")", ":", "GetAllAppsResponse", "{", "/** @var GetAllAppsResponse $response */", "$", "response", "=", "$", "this", "->", "createResponseFromRequest", ...
@param GetAllAppsRequest $request @param Pbjx $pbjx @return GetAllAppsResponse
[ "@param", "GetAllAppsRequest", "$request", "@param", "Pbjx", "$pbjx" ]
train
https://github.com/gdbots/iam-php/blob/3dbfa602de183a7ac5fb5140304e8cf4c4b15ab3/src/GetAllAppsRequestHandler.php#L54-L59
ahmetertem/query_builder
src/qb.php
qb.set
public function set($field, $value, $type = 0) { $this->_write_fields[] = $field; $this->_write_values[] = $value; $this->_write_field_types[] = $type; return $this; }
php
public function set($field, $value, $type = 0) { $this->_write_fields[] = $field; $this->_write_values[] = $value; $this->_write_field_types[] = $type; return $this; }
[ "public", "function", "set", "(", "$", "field", ",", "$", "value", ",", "$", "type", "=", "0", ")", "{", "$", "this", "->", "_write_fields", "[", "]", "=", "$", "field", ";", "$", "this", "->", "_write_values", "[", "]", "=", "$", "value", ";", ...
$type : - 0 = string - 1 = integer - 2 = raw.
[ "$type", ":", "-", "0", "=", "string", "-", "1", "=", "integer", "-", "2", "=", "raw", "." ]
train
https://github.com/ahmetertem/query_builder/blob/aefd8c9ce1d872f7de82f51d3d9507d492a89c3b/src/qb.php#L77-L84
surebert/surebert-framework
src/sb/RSS/Feed.php
Feed.display
public function display() { //add feed properties $this->channelPropertiesToDOM(); //add items foreach($this->items as $item){ $this->appendItem($item); } return $this->saveXML(); }
php
public function display() { //add feed properties $this->channelPropertiesToDOM(); //add items foreach($this->items as $item){ $this->appendItem($item); } return $this->saveXML(); }
[ "public", "function", "display", "(", ")", "{", "//add feed properties", "$", "this", "->", "channelPropertiesToDOM", "(", ")", ";", "//add items", "foreach", "(", "$", "this", "->", "items", "as", "$", "item", ")", "{", "$", "this", "->", "appendItem", "(...
Converts the \sb\RSSFeed instance into XML for display <code> echo $myFeed->display(); </code> @return string
[ "Converts", "the", "\\", "sb", "\\", "RSSFeed", "instance", "into", "XML", "for", "display", "<code", ">", "echo", "$myFeed", "-", ">", "display", "()", ";", "<", "/", "code", ">" ]
train
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/RSS/Feed.php#L260-L273
surebert/surebert-framework
src/sb/RSS/Feed.php
Feed.createNode
private function createNode($nodeName, $nodeValue, $cdata = false) { $node = $this->createElement($nodeName); if($cdata){ $text = $this->createCDATASection($nodeValue); } else { $text = $this->createTextNode($nodeValue); } $node->appendChild($text); ...
php
private function createNode($nodeName, $nodeValue, $cdata = false) { $node = $this->createElement($nodeName); if($cdata){ $text = $this->createCDATASection($nodeValue); } else { $text = $this->createTextNode($nodeValue); } $node->appendChild($text); ...
[ "private", "function", "createNode", "(", "$", "nodeName", ",", "$", "nodeValue", ",", "$", "cdata", "=", "false", ")", "{", "$", "node", "=", "$", "this", "->", "createElement", "(", "$", "nodeName", ")", ";", "if", "(", "$", "cdata", ")", "{", "$...
Creates and returns a new node with textNode, ready for appending @param string $nodeName @param string $nodeValue @return object DOM node
[ "Creates", "and", "returns", "a", "new", "node", "with", "textNode", "ready", "for", "appending" ]
train
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/RSS/Feed.php#L282-L294
surebert/surebert-framework
src/sb/RSS/Feed.php
Feed.appendItem
private function appendItem(\sb\RSS\Item $item) { $new_item = $this->createElement("item"); foreach(get_object_vars($item) as $key=>$val){ if($item->{$key} instanceof \sb\RSS\ItemEnclosure){ $enclosure = $this->createElement('enclosure'); foreach($item->...
php
private function appendItem(\sb\RSS\Item $item) { $new_item = $this->createElement("item"); foreach(get_object_vars($item) as $key=>$val){ if($item->{$key} instanceof \sb\RSS\ItemEnclosure){ $enclosure = $this->createElement('enclosure'); foreach($item->...
[ "private", "function", "appendItem", "(", "\\", "sb", "\\", "RSS", "\\", "Item", "$", "item", ")", "{", "$", "new_item", "=", "$", "this", "->", "createElement", "(", "\"item\"", ")", ";", "foreach", "(", "get_object_vars", "(", "$", "item", ")", "as",...
Takes an \sb\RSS\Item and converts it into a DOMM node followed by inserting it into the feed DOM @param \sb\RSS\Item $item
[ "Takes", "an", "\\", "sb", "\\", "RSS", "\\", "Item", "and", "converts", "it", "into", "a", "DOMM", "node", "followed", "by", "inserting", "it", "into", "the", "feed", "DOM" ]
train
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/RSS/Feed.php#L301-L334
surebert/surebert-framework
src/sb/RSS/Feed.php
Feed.channelPropertiesToDOM
private function channelPropertiesToDOM() { foreach(get_object_vars($this) as $key=>$val){ //parse string based key value pairs if (is_string($val) && !empty($val)){ $this->channel->appendChild($this->createNode($key, $val, $key == 'description')); //pa...
php
private function channelPropertiesToDOM() { foreach(get_object_vars($this) as $key=>$val){ //parse string based key value pairs if (is_string($val) && !empty($val)){ $this->channel->appendChild($this->createNode($key, $val, $key == 'description')); //pa...
[ "private", "function", "channelPropertiesToDOM", "(", ")", "{", "foreach", "(", "get_object_vars", "(", "$", "this", ")", "as", "$", "key", "=>", "$", "val", ")", "{", "//parse string based key value pairs", "if", "(", "is_string", "(", "$", "val", ")", "&&"...
Converts all the feed object properties into RSS DOM nodes and adds them to the channel node
[ "Converts", "all", "the", "feed", "object", "properties", "into", "RSS", "DOM", "nodes", "and", "adds", "them", "to", "the", "channel", "node" ]
train
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/RSS/Feed.php#L340-L393
rikby/crypter
src/Crypter.php
Crypter.encrypt
public function encrypt($text, $key = null) { if (null === $key) { $key = $this->getEncryptKey(); } $ivSize = $this->getMsCryptIvSize(); $iv = mcrypt_create_iv($ivSize, MCRYPT_DEV_RANDOM); $cipherText = mcrypt_encrypt( $this->getMcryptCipher(), ...
php
public function encrypt($text, $key = null) { if (null === $key) { $key = $this->getEncryptKey(); } $ivSize = $this->getMsCryptIvSize(); $iv = mcrypt_create_iv($ivSize, MCRYPT_DEV_RANDOM); $cipherText = mcrypt_encrypt( $this->getMcryptCipher(), ...
[ "public", "function", "encrypt", "(", "$", "text", ",", "$", "key", "=", "null", ")", "{", "if", "(", "null", "===", "$", "key", ")", "{", "$", "key", "=", "$", "this", "->", "getEncryptKey", "(", ")", ";", "}", "$", "ivSize", "=", "$", "this",...
Encrypt password @param string $text Text to encrypt @param null|string $key Encrypt key @return string @link http://php.net/manual/ru/function.mcrypt-encrypt.php#refsect1-function.mcrypt-encrypt-examples
[ "Encrypt", "password" ]
train
https://github.com/rikby/crypter/blob/a34f05f37189a181633c8c848906c80c85a7894b/src/Crypter.php#L31-L51
rikby/crypter
src/Crypter.php
Crypter.decrypt
public function decrypt($string, $key = null) { if (null === $key) { $key = $this->getEncryptKey(); } $cipherText = base64_decode($string); $ivSize = $this->getMsCryptIvSize(); $ivDec = substr($cipherText, 0, $ivSize); $cipherText = substr($cipherTe...
php
public function decrypt($string, $key = null) { if (null === $key) { $key = $this->getEncryptKey(); } $cipherText = base64_decode($string); $ivSize = $this->getMsCryptIvSize(); $ivDec = substr($cipherText, 0, $ivSize); $cipherText = substr($cipherTe...
[ "public", "function", "decrypt", "(", "$", "string", ",", "$", "key", "=", "null", ")", "{", "if", "(", "null", "===", "$", "key", ")", "{", "$", "key", "=", "$", "this", "->", "getEncryptKey", "(", ")", ";", "}", "$", "cipherText", "=", "base64_...
Decrypt string @param string $string String to decrypt @param null|string $key Encrypt key @return string
[ "Decrypt", "string" ]
train
https://github.com/rikby/crypter/blob/a34f05f37189a181633c8c848906c80c85a7894b/src/Crypter.php#L60-L80
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Base/src/metadata/tarball.php
ezcBaseMetaDataTarballReader.isComponentInstalled
public function isComponentInstalled( $componentName ) { $root = $this->xml->deps->packages->package; foreach ( $root as $package ) { if ( (string) $package['name'] == $componentName ) { return true; } } return false; }
php
public function isComponentInstalled( $componentName ) { $root = $this->xml->deps->packages->package; foreach ( $root as $package ) { if ( (string) $package['name'] == $componentName ) { return true; } } return false; }
[ "public", "function", "isComponentInstalled", "(", "$", "componentName", ")", "{", "$", "root", "=", "$", "this", "->", "xml", "->", "deps", "->", "packages", "->", "package", ";", "foreach", "(", "$", "root", "as", "$", "package", ")", "{", "if", "(",...
Returns whether $componentName is installed Returns true for every component that exists (because all of them are then available). @return bool
[ "Returns", "whether", "$componentName", "is", "installed" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Base/src/metadata/tarball.php#L66-L78