repository_name
stringlengths
5
67
func_path_in_repository
stringlengths
4
234
func_name
stringlengths
0
314
whole_func_string
stringlengths
52
3.87M
language
stringclasses
6 values
func_code_string
stringlengths
52
3.87M
func_code_tokens
listlengths
15
672k
func_documentation_string
stringlengths
1
47.2k
func_documentation_tokens
listlengths
1
3.92k
split_name
stringclasses
1 value
func_code_url
stringlengths
85
339
Eresus/EresusCMS
src/core/Feed/Writer.php
Eresus_Feed_Writer.generateFeed
public function generateFeed() { // TODO Вынести возврат заголовков в отдельный метод //header("Content-type: text/xml"); $feed = $this->generateHead() . $this->generateChannels() . $this->generateItems() . $this->generateTale(); return $feed; }
php
public function generateFeed() { // TODO Вынести возврат заголовков в отдельный метод //header("Content-type: text/xml"); $feed = $this->generateHead() . $this->generateChannels() . $this->generateItems() . $this->generateTale(); return $feed; }
[ "public", "function", "generateFeed", "(", ")", "{", "// TODO Вынести возврат заголовков в отдельный метод", "//header(\"Content-type: text/xml\");", "$", "feed", "=", "$", "this", "->", "generateHead", "(", ")", ".", "$", "this", "->", "generateChannels", "(", ")", "...
Возвращает разметку RSS/ATOM @return string RSS/ATOM
[ "Возвращает", "разметку", "RSS", "/", "ATOM" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/Feed/Writer.php#L133-L145
Eresus/EresusCMS
src/core/Feed/Writer.php
Eresus_Feed_Writer.generateHead
private function generateHead() { $out = '<?xml version="1.0" encoding="utf-8"?>' . "\n"; if ($this->version == self::RSS2) { $out .= '<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" >' . PHP_EOL; } elseif ($thi...
php
private function generateHead() { $out = '<?xml version="1.0" encoding="utf-8"?>' . "\n"; if ($this->version == self::RSS2) { $out .= '<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" >' . PHP_EOL; } elseif ($thi...
[ "private", "function", "generateHead", "(", ")", "{", "$", "out", "=", "'<?xml version=\"1.0\" encoding=\"utf-8\"?>'", ".", "\"\\n\"", ";", "if", "(", "$", "this", "->", "version", "==", "self", "::", "RSS2", ")", "{", "$", "out", ".=", "'<rss version=\"2.0\"\...
Prints the xml and rss namespace @return string
[ "Prints", "the", "xml", "and", "rss", "namespace" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/Feed/Writer.php#L254-L278
Eresus/EresusCMS
src/core/Feed/Writer.php
Eresus_Feed_Writer.makeNode
private function makeNode($tagName, $tagContent, $attributes = null) { $nodeText = ''; $attrText = ''; if (is_array($attributes)) { foreach ($attributes as $key => $value) { $attrText .= " $key=\"$value\" "; } } if (is_array($tagContent) && $this->version == self::RSS1) { $attrText = ' ...
php
private function makeNode($tagName, $tagContent, $attributes = null) { $nodeText = ''; $attrText = ''; if (is_array($attributes)) { foreach ($attributes as $key => $value) { $attrText .= " $key=\"$value\" "; } } if (is_array($tagContent) && $this->version == self::RSS1) { $attrText = ' ...
[ "private", "function", "makeNode", "(", "$", "tagName", ",", "$", "tagContent", ",", "$", "attributes", "=", "null", ")", "{", "$", "nodeText", "=", "''", ";", "$", "attrText", "=", "''", ";", "if", "(", "is_array", "(", "$", "attributes", ")", ")", ...
Creates a single node as xml format @param string $tagName name of the tag @param mixed $tagContent tag value as string or array of nested tags in 'tagName' => 'tagValue' format @param array $attributes Attributes (if any) in 'attrName' => 'attrValue' format @return string formatted xml tag
[ "Creates", "a", "single", "node", "as", "xml", "format" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/Feed/Writer.php#L316-L357
Eresus/EresusCMS
src/core/Feed/Writer.php
Eresus_Feed_Writer.generateChannels
private function generateChannels() { $out = ''; //Start channel tag switch ($this->version) { case self::RSS2: $out .= '<channel>' . PHP_EOL; break; case self::RSS1: $out .= (isset($this->data['ChannelAbout']))? "<channel rdf:about=\"{$this->data['ChannelAbout']}\">" : "<channel rd...
php
private function generateChannels() { $out = ''; //Start channel tag switch ($this->version) { case self::RSS2: $out .= '<channel>' . PHP_EOL; break; case self::RSS1: $out .= (isset($this->data['ChannelAbout']))? "<channel rdf:about=\"{$this->data['ChannelAbout']}\">" : "<channel rd...
[ "private", "function", "generateChannels", "(", ")", "{", "$", "out", "=", "''", ";", "//Start channel tag", "switch", "(", "$", "this", "->", "version", ")", "{", "case", "self", "::", "RSS2", ":", "$", "out", ".=", "'<channel>'", ".", "PHP_EOL", ";", ...
Print channels @return string
[ "Print", "channels" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/Feed/Writer.php#L365-L411
Eresus/EresusCMS
src/core/Feed/Writer.php
Eresus_Feed_Writer.generateItems
private function generateItems() { $out = ''; foreach ($this->items as $item) { $thisItems = $item->getElements(); //the argument is printed as rdf:about attribute of item in rss 1.0 $out .= $this->startItem($thisItems['link']['content']); foreach ($thisItems as $feedItem ) { $out .= $this->...
php
private function generateItems() { $out = ''; foreach ($this->items as $item) { $thisItems = $item->getElements(); //the argument is printed as rdf:about attribute of item in rss 1.0 $out .= $this->startItem($thisItems['link']['content']); foreach ($thisItems as $feedItem ) { $out .= $this->...
[ "private", "function", "generateItems", "(", ")", "{", "$", "out", "=", "''", ";", "foreach", "(", "$", "this", "->", "items", "as", "$", "item", ")", "{", "$", "thisItems", "=", "$", "item", "->", "getElements", "(", ")", ";", "//the argument is print...
Prints formatted feed items @return string
[ "Prints", "formatted", "feed", "items" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/Feed/Writer.php#L419-L436
Eresus/EresusCMS
src/core/Feed/Writer.php
Eresus_Feed_Writer.startItem
private function startItem($about = false) { $out = ''; if ($this->version == self::RSS2) { $out .= '<item>' . PHP_EOL; } elseif ($this->version == self::RSS1) { if ($about) { $out .= "<item rdf:about=\"$about\">" . PHP_EOL; } else { throw new LogicException('link element is not s...
php
private function startItem($about = false) { $out = ''; if ($this->version == self::RSS2) { $out .= '<item>' . PHP_EOL; } elseif ($this->version == self::RSS1) { if ($about) { $out .= "<item rdf:about=\"$about\">" . PHP_EOL; } else { throw new LogicException('link element is not s...
[ "private", "function", "startItem", "(", "$", "about", "=", "false", ")", "{", "$", "out", "=", "''", ";", "if", "(", "$", "this", "->", "version", "==", "self", "::", "RSS2", ")", "{", "$", "out", ".=", "'<item>'", ".", "PHP_EOL", ";", "}", "els...
Make the starting tag of channels @param bool|string $about The value of about tag which is used for only RSS 1.0 @throws LogicException @return string
[ "Make", "the", "starting", "tag", "of", "channels" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/Feed/Writer.php#L446-L470
texthtml/oauth2-provider
src/OAuth2AuthenticationListener.php
OAuth2AuthenticationListener.handle
public function handle(GetResponseEvent $event) { $request = BridgeRequest::createFromRequest($event->getRequest()); $response = new BridgeResponse; if (!$this->oauth2Server->verifyResourceRequest($request, $response)) { return; } try { $token = $thi...
php
public function handle(GetResponseEvent $event) { $request = BridgeRequest::createFromRequest($event->getRequest()); $response = new BridgeResponse; if (!$this->oauth2Server->verifyResourceRequest($request, $response)) { return; } try { $token = $thi...
[ "public", "function", "handle", "(", "GetResponseEvent", "$", "event", ")", "{", "$", "request", "=", "BridgeRequest", "::", "createFromRequest", "(", "$", "event", "->", "getRequest", "(", ")", ")", ";", "$", "response", "=", "new", "BridgeResponse", ";", ...
Handles basic authentication. @param GetResponseEvent $event A GetResponseEvent instance
[ "Handles", "basic", "authentication", "." ]
train
https://github.com/texthtml/oauth2-provider/blob/a216205b8466ae16e0b8e17249ce89b90db1f5d4/src/OAuth2AuthenticationListener.php#L52-L77
inhere/php-librarys
src/Utils/DataCategory.php
DataCategory.getDataArray
public function getDataArray(array $need = []) { $arrData = $this->getData(); if ($need) { $arrList = []; foreach ($arrData as $item) { $needArr = array(); foreach ($need as $val) { if (isset($item[$val])) { ...
php
public function getDataArray(array $need = []) { $arrData = $this->getData(); if ($need) { $arrList = []; foreach ($arrData as $item) { $needArr = array(); foreach ($need as $val) { if (isset($item[$val])) { ...
[ "public", "function", "getDataArray", "(", "array", "$", "need", "=", "[", "]", ")", "{", "$", "arrData", "=", "$", "this", "->", "getData", "(", ")", ";", "if", "(", "$", "need", ")", "{", "$", "arrList", "=", "[", "]", ";", "foreach", "(", "$...
getDataArray 初始数据转换成的数组 @param array $need | 'all' [需要获取哪些字段值] 1. 'all' 全部字段 2. array('chName','enName') --> 获取数组仅含有 chName enName 字段 @return array
[ "getDataArray", "初始数据转换成的数组" ]
train
https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/Utils/DataCategory.php#L80-L105
inhere/php-librarys
src/Utils/DataCategory.php
DataCategory.getCategoryArr
public function getCategoryArr($rootId = '0', array $need = [], $setKey = 'id') { $allDataArr = $this->getDataArray(); if ($rootId === '0' || $rootId === '') { return $allDataArr; } $arr_result = $needArr = array(); $id = $this->pkColumn; $parentId = $th...
php
public function getCategoryArr($rootId = '0', array $need = [], $setKey = 'id') { $allDataArr = $this->getDataArray(); if ($rootId === '0' || $rootId === '') { return $allDataArr; } $arr_result = $needArr = array(); $id = $this->pkColumn; $parentId = $th...
[ "public", "function", "getCategoryArr", "(", "$", "rootId", "=", "'0'", ",", "array", "$", "need", "=", "[", "]", ",", "$", "setKey", "=", "'id'", ")", "{", "$", "allDataArr", "=", "$", "this", "->", "getDataArray", "(", ")", ";", "if", "(", "$", ...
[getCategoryArr 指定层级父id(parentId),获取其下面的子级初始数据数组] @param string $rootId [ 当等于0时,等同于 调用 getDataArray() ] @param array $need @see getDataArray() @param string $setKey @return array @throws \RuntimeException
[ "[", "getCategoryArr", "指定层级父id", "(", "parentId", ")", ",获取其下面的子级初始数据数组", "]" ]
train
https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/Utils/DataCategory.php#L115-L154
inhere/php-librarys
src/Utils/DataCategory.php
DataCategory.getCategoryTree
public function getCategoryTree($rootId = 0, array $need = [], $setKey = 'id') { if (!$rootId) { $rootId = 0; } if ($need) { $need = array_merge([$this->pkColumn, $this->pidColumn], $need); } $arrList = $this->getDataArray($need); return $th...
php
public function getCategoryTree($rootId = 0, array $need = [], $setKey = 'id') { if (!$rootId) { $rootId = 0; } if ($need) { $need = array_merge([$this->pkColumn, $this->pidColumn], $need); } $arrList = $this->getDataArray($need); return $th...
[ "public", "function", "getCategoryTree", "(", "$", "rootId", "=", "0", ",", "array", "$", "need", "=", "[", "]", ",", "$", "setKey", "=", "'id'", ")", "{", "if", "(", "!", "$", "rootId", ")", "{", "$", "rootId", "=", "0", ";", "}", "if", "(", ...
getCategory 递归获取树形图 @param string|int $rootId [开始层父级id 默认 0,顶级] @param array|string $need 需要获取哪些字段值,id pid默认含有 1. [] 全部字段 2. array('chName','enName') --> 获取含有 id pid chName enName 字段 @param string $setKey 需要什么作为 树形数组的 键名,默认:主键id值为键,留空为自增的数字. e.g. id | enName @return array
[ "getCategory", "递归获取树形图" ]
train
https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/Utils/DataCategory.php#L165-L178
inhere/php-librarys
src/Utils/DataCategory.php
DataCategory.arrTree
public function arrTree(array $tree, $rootId = 0, $setKey = 'id') { $result = []; $id = $this->pkColumn; $parentId = $this->pidColumn; $childKey = $this->childKeyName; foreach ($tree as $leaf) { if ($leaf[$parentId] === $rootId) { foreach ($tree a...
php
public function arrTree(array $tree, $rootId = 0, $setKey = 'id') { $result = []; $id = $this->pkColumn; $parentId = $this->pidColumn; $childKey = $this->childKeyName; foreach ($tree as $leaf) { if ($leaf[$parentId] === $rootId) { foreach ($tree a...
[ "public", "function", "arrTree", "(", "array", "$", "tree", ",", "$", "rootId", "=", "0", ",", "$", "setKey", "=", "'id'", ")", "{", "$", "result", "=", "[", "]", ";", "$", "id", "=", "$", "this", "->", "pkColumn", ";", "$", "parentId", "=", "$...
arrTree 树形数组递归 @param array $tree 需要处理的原始数组 @param integer $rootId 开始层父级id 默认 0,顶级 @param string $setKey 需要什么作为 树形数组的 键名,默认:主键id值为键,留空为自增的数字. e.g. id | enName @return array
[ "arrTree", "树形数组递归" ]
train
https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/Utils/DataCategory.php#L187-L212
Eresus/EresusCMS
src/core/framework/core/3rdparty/dwoo/Dwoo/Block/Plugin.php
Dwoo_Block_Plugin.preProcessing
public static function preProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $type) { return Dwoo_Compiler::PHP_OPEN.$prepend.'$this->addStack("'.$type.'", array('.Dwoo_Compiler::implode_r($compiler->getCompiledParams($params)).'));'.$append.Dwoo_Compiler::PHP_CLOSE; }
php
public static function preProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $type) { return Dwoo_Compiler::PHP_OPEN.$prepend.'$this->addStack("'.$type.'", array('.Dwoo_Compiler::implode_r($compiler->getCompiledParams($params)).'));'.$append.Dwoo_Compiler::PHP_CLOSE; }
[ "public", "static", "function", "preProcessing", "(", "Dwoo_Compiler", "$", "compiler", ",", "array", "$", "params", ",", "$", "prepend", ",", "$", "append", ",", "$", "type", ")", "{", "return", "Dwoo_Compiler", "::", "PHP_OPEN", ".", "$", "prepend", ".",...
called at compile time to define what the block should output in the compiled template code, happens when the block is declared basically this will replace the {block arg arg arg} tag in the template @param Dwoo_Compiler $compiler the compiler instance that calls this function @param array $params an array containing...
[ "called", "at", "compile", "time", "to", "define", "what", "the", "block", "should", "output", "in", "the", "compiled", "template", "code", "happens", "when", "the", "block", "is", "declared" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Block/Plugin.php#L78-L81
ekuiter/feature-php
FeaturePhp/Exporter/DownloadZipExporter.php
DownloadZipExporter.download
private function download($productLineName) { $productLineName = str_replace("\"", "", $productLineName); if (headers_sent()) throw new DownloadZipExporterException("could download zip archive"); header("Content-Type: application/zip"); header("Content-Disposition: attachment...
php
private function download($productLineName) { $productLineName = str_replace("\"", "", $productLineName); if (headers_sent()) throw new DownloadZipExporterException("could download zip archive"); header("Content-Type: application/zip"); header("Content-Disposition: attachment...
[ "private", "function", "download", "(", "$", "productLineName", ")", "{", "$", "productLineName", "=", "str_replace", "(", "\"\\\"\"", ",", "\"\"", ",", "$", "productLineName", ")", ";", "if", "(", "headers_sent", "(", ")", ")", "throw", "new", "DownloadZipE...
Downloads the temporary ZIP archive. This only works when no headers and no output have been sent yet, otherwise users receive corrupted ZIP files. @param string $productLineName the name of the product line, used as the ZIP archive file name
[ "Downloads", "the", "temporary", "ZIP", "archive", ".", "This", "only", "works", "when", "no", "headers", "and", "no", "output", "have", "been", "sent", "yet", "otherwise", "users", "receive", "corrupted", "ZIP", "files", "." ]
train
https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Exporter/DownloadZipExporter.php#L55-L68
ekuiter/feature-php
FeaturePhp/Exporter/DownloadZipExporter.php
DownloadZipExporter.export
public function export($product) { try { parent::export($product); $this->download($product->getProductLine()->getName()); } catch (\Exception $e) {} try { $this->remove(); } catch (\Exception $e) {} }
php
public function export($product) { try { parent::export($product); $this->download($product->getProductLine()->getName()); } catch (\Exception $e) {} try { $this->remove(); } catch (\Exception $e) {} }
[ "public", "function", "export", "(", "$", "product", ")", "{", "try", "{", "parent", "::", "export", "(", "$", "product", ")", ";", "$", "this", "->", "download", "(", "$", "product", "->", "getProductLine", "(", ")", "->", "getName", "(", ")", ")", ...
Exports a product as a ZIP archive and offers it for downloading. This only works when no headers and no output have been sent yet. Note that any occurring errors are ignored so that the downloaded archive will not be corrupted. There is currently no way to obtain error information in this case because feature-php does...
[ "Exports", "a", "product", "as", "a", "ZIP", "archive", "and", "offers", "it", "for", "downloading", ".", "This", "only", "works", "when", "no", "headers", "and", "no", "output", "have", "been", "sent", "yet", ".", "Note", "that", "any", "occurring", "er...
train
https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Exporter/DownloadZipExporter.php#L78-L87
php-lug/lug
src/Bundle/AdminBundle/DependencyInjection/LugAdminExtension.php
LugAdminExtension.prepend
public function prepend(ContainerBuilder $container) { $bundles = $container->getParameter('kernel.bundles'); if (isset($bundles['LugGridBundle'])) { $resources = [ 'body', 'column_action', 'column_sorting', 'column_sorting...
php
public function prepend(ContainerBuilder $container) { $bundles = $container->getParameter('kernel.bundles'); if (isset($bundles['LugGridBundle'])) { $resources = [ 'body', 'column_action', 'column_sorting', 'column_sorting...
[ "public", "function", "prepend", "(", "ContainerBuilder", "$", "container", ")", "{", "$", "bundles", "=", "$", "container", "->", "getParameter", "(", "'kernel.bundles'", ")", ";", "if", "(", "isset", "(", "$", "bundles", "[", "'LugGridBundle'", "]", ")", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/AdminBundle/DependencyInjection/LugAdminExtension.php#L40-L62
VincentChalnot/SidusDataGridBundle
DependencyInjection/SidusDataGridExtension.php
SidusDataGridExtension.load
public function load(array $configs, ContainerBuilder $container) { parent::load($configs, $container); $configuration = $this->createConfigurationParser(); $this->globalConfiguration = $this->processConfiguration($configuration, $configs); $dataGridRegistry = $container->getDefini...
php
public function load(array $configs, ContainerBuilder $container) { parent::load($configs, $container); $configuration = $this->createConfigurationParser(); $this->globalConfiguration = $this->processConfiguration($configuration, $configs); $dataGridRegistry = $container->getDefini...
[ "public", "function", "load", "(", "array", "$", "configs", ",", "ContainerBuilder", "$", "container", ")", "{", "parent", "::", "load", "(", "$", "configs", ",", "$", "container", ")", ";", "$", "configuration", "=", "$", "this", "->", "createConfiguratio...
{@inheritdoc} @throws \Exception
[ "{", "@inheritdoc", "}" ]
train
https://github.com/VincentChalnot/SidusDataGridBundle/blob/aa929113e2208ed335f514d2891affaf7fddf3f6/DependencyInjection/SidusDataGridExtension.php#L38-L50
VincentChalnot/SidusDataGridBundle
DependencyInjection/SidusDataGridExtension.php
SidusDataGridExtension.finalizeConfiguration
protected function finalizeConfiguration( string $code, array $dataGridConfiguration ): array { // Handle possible parent configuration @todo find a better way to do this if (isset($dataGridConfiguration['parent'])) { $parent = $dataGridConfiguration['parent']; ...
php
protected function finalizeConfiguration( string $code, array $dataGridConfiguration ): array { // Handle possible parent configuration @todo find a better way to do this if (isset($dataGridConfiguration['parent'])) { $parent = $dataGridConfiguration['parent']; ...
[ "protected", "function", "finalizeConfiguration", "(", "string", "$", "code", ",", "array", "$", "dataGridConfiguration", ")", ":", "array", "{", "// Handle possible parent configuration @todo find a better way to do this", "if", "(", "isset", "(", "$", "dataGridConfigurati...
Handle configuration parsing logic not handled by the semantic configuration definition @param string $code @param array $dataGridConfiguration @throws \Exception @return array
[ "Handle", "configuration", "parsing", "logic", "not", "handled", "by", "the", "semantic", "configuration", "definition" ]
train
https://github.com/VincentChalnot/SidusDataGridBundle/blob/aa929113e2208ed335f514d2891affaf7fddf3f6/DependencyInjection/SidusDataGridExtension.php#L62-L110
VincentChalnot/SidusDataGridBundle
DependencyInjection/SidusDataGridExtension.php
SidusDataGridExtension.finalizeFilterConfiguration
protected function finalizeFilterConfiguration(string $code, array $queryHandlerConfig): array { // Parse configuration using Configuration parser from FilterBundle $configuration = $this->createFilterConfigurationParser(); $parsedFilterConfig = $this->processConfiguration( $conf...
php
protected function finalizeFilterConfiguration(string $code, array $queryHandlerConfig): array { // Parse configuration using Configuration parser from FilterBundle $configuration = $this->createFilterConfigurationParser(); $parsedFilterConfig = $this->processConfiguration( $conf...
[ "protected", "function", "finalizeFilterConfiguration", "(", "string", "$", "code", ",", "array", "$", "queryHandlerConfig", ")", ":", "array", "{", "// Parse configuration using Configuration parser from FilterBundle", "$", "configuration", "=", "$", "this", "->", "creat...
@param string $code @param array $queryHandlerConfig @return array
[ "@param", "string", "$code", "@param", "array", "$queryHandlerConfig" ]
train
https://github.com/VincentChalnot/SidusDataGridBundle/blob/aa929113e2208ed335f514d2891affaf7fddf3f6/DependencyInjection/SidusDataGridExtension.php#L118-L134
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Mail/src/parser/rfc2231_implementation.php
ezcMailRfc2231Implementation.parseHeader
public static function parseHeader( $header ) { $result = array(); // argument if ( preg_match( '/^\s*([^;]*);?/i', $header, $matches ) ) { $result[0] = $matches[1]; } // We must go through all parameters and store this data because // parameters ...
php
public static function parseHeader( $header ) { $result = array(); // argument if ( preg_match( '/^\s*([^;]*);?/i', $header, $matches ) ) { $result[0] = $matches[1]; } // We must go through all parameters and store this data because // parameters ...
[ "public", "static", "function", "parseHeader", "(", "$", "header", ")", "{", "$", "result", "=", "array", "(", ")", ";", "// argument", "if", "(", "preg_match", "(", "'/^\\s*([^;]*);?/i'", ",", "$", "header", ",", "$", "matches", ")", ")", "{", "$", "r...
Returns the parsed header $header according to RFC 2231. This method returns the parsed header as a structured array and is intended for internal usage. Use parseContentDisposition and parseContentType to retrieve the correct header structs directly. @param string $header @return array( 'argument', array( 'paramName'...
[ "Returns", "the", "parsed", "header", "$header", "according", "to", "RFC", "2231", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/parser/rfc2231_implementation.php#L34-L115
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Mail/src/parser/rfc2231_implementation.php
ezcMailRfc2231Implementation.parseContentDisposition
public static function parseContentDisposition( $header, ezcMailContentDispositionHeader $cd = null ) { if ( $cd === null ) { $cd = new ezcMailContentDispositionHeader(); } $parsedHeader = self::parseHeader( $header ); $cd->disposition = $parsedHeader[0]; ...
php
public static function parseContentDisposition( $header, ezcMailContentDispositionHeader $cd = null ) { if ( $cd === null ) { $cd = new ezcMailContentDispositionHeader(); } $parsedHeader = self::parseHeader( $header ); $cd->disposition = $parsedHeader[0]; ...
[ "public", "static", "function", "parseContentDisposition", "(", "$", "header", ",", "ezcMailContentDispositionHeader", "$", "cd", "=", "null", ")", "{", "if", "(", "$", "cd", "===", "null", ")", "{", "$", "cd", "=", "new", "ezcMailContentDispositionHeader", "(...
Returns the a ezcMailContentDispositionHeader for the parsed $header. If $cd is provided this object will be used to fill in the blanks. This function will not clear out any old values in the object. @param string $header @param ezcMailContentDispositionHeader $cd @return ezcMailContentDispositionHeader
[ "Returns", "the", "a", "ezcMailContentDispositionHeader", "for", "the", "parsed", "$header", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/parser/rfc2231_implementation.php#L127-L190
SachaMorard/phalcon-model-annotations
Library/Phalcon/Annotations/ModelListener.php
ModelListener.afterInitialize
public function afterInitialize(Event $event, ModelsManager $manager, $model) { //Reflector /** @var \Phalcon\Annotations\Reflection $reflector */ $reflector = $this->annotations->get($model); /** * Read the annotations in the class' docblock */ $annotations...
php
public function afterInitialize(Event $event, ModelsManager $manager, $model) { //Reflector /** @var \Phalcon\Annotations\Reflection $reflector */ $reflector = $this->annotations->get($model); /** * Read the annotations in the class' docblock */ $annotations...
[ "public", "function", "afterInitialize", "(", "Event", "$", "event", ",", "ModelsManager", "$", "manager", ",", "$", "model", ")", "{", "//Reflector", "/** @var \\Phalcon\\Annotations\\Reflection $reflector */", "$", "reflector", "=", "$", "this", "->", "annotations",...
This is called after initialize the model @param Event $event @param ModelsManager $manager @param $model
[ "This", "is", "called", "after", "initialize", "the", "model" ]
train
https://github.com/SachaMorard/phalcon-model-annotations/blob/64cb04903f101c1fd85e8067c0dcdfc6ca133fb5/Library/Phalcon/Annotations/ModelListener.php#L25-L91
zhouyl/mellivora
Mellivora/Database/Eloquent/Relations/BelongsTo.php
BelongsTo.getEagerModelKeys
protected function getEagerModelKeys(array $models) { // First we need to gather all of the keys from the parent models so we know what // to query for via the eager loading query. We will add them to an array then // execute a "where in" statement to gather up all of those related records. ...
php
protected function getEagerModelKeys(array $models) { // First we need to gather all of the keys from the parent models so we know what // to query for via the eager loading query. We will add them to an array then // execute a "where in" statement to gather up all of those related records. ...
[ "protected", "function", "getEagerModelKeys", "(", "array", "$", "models", ")", "{", "// First we need to gather all of the keys from the parent models so we know what", "// to query for via the eager loading query. We will add them to an array then", "// execute a \"where in\" statement to ga...
Gather the keys from an array of related models. @param array $models @return array
[ "Gather", "the", "keys", "from", "an", "array", "of", "related", "models", "." ]
train
https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Database/Eloquent/Relations/BelongsTo.php#L120-L137
zhouyl/mellivora
Mellivora/Database/Eloquent/Relations/BelongsTo.php
BelongsTo.associate
public function associate($model) { $ownerKey = $model instanceof Model ? $model->getAttribute($this->ownerKey) : $model; $this->child->setAttribute($this->foreignKey, $ownerKey); if ($model instanceof Model) { $this->child->setRelation($this->relation, $model); } ...
php
public function associate($model) { $ownerKey = $model instanceof Model ? $model->getAttribute($this->ownerKey) : $model; $this->child->setAttribute($this->foreignKey, $ownerKey); if ($model instanceof Model) { $this->child->setRelation($this->relation, $model); } ...
[ "public", "function", "associate", "(", "$", "model", ")", "{", "$", "ownerKey", "=", "$", "model", "instanceof", "Model", "?", "$", "model", "->", "getAttribute", "(", "$", "this", "->", "ownerKey", ")", ":", "$", "model", ";", "$", "this", "->", "c...
Associate the model instance to the given parent. @param int|\Mellivora\Database\Eloquent\Model $model @return \Mellivora\Database\Eloquent\Model
[ "Associate", "the", "model", "instance", "to", "the", "given", "parent", "." ]
train
https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Database/Eloquent/Relations/BelongsTo.php#L211-L222
zhouyl/mellivora
Mellivora/Database/Eloquent/Relations/BelongsTo.php
BelongsTo.getRelationExistenceQuery
public function getRelationExistenceQuery(Builder $query, Builder $parentQuery, $columns = ['*']) { if ($parentQuery->getQuery()->from === $query->getQuery()->from) { return $this->getRelationExistenceQueryForSelfRelation($query, $parentQuery, $columns); } return $query->select(...
php
public function getRelationExistenceQuery(Builder $query, Builder $parentQuery, $columns = ['*']) { if ($parentQuery->getQuery()->from === $query->getQuery()->from) { return $this->getRelationExistenceQueryForSelfRelation($query, $parentQuery, $columns); } return $query->select(...
[ "public", "function", "getRelationExistenceQuery", "(", "Builder", "$", "query", ",", "Builder", "$", "parentQuery", ",", "$", "columns", "=", "[", "'*'", "]", ")", "{", "if", "(", "$", "parentQuery", "->", "getQuery", "(", ")", "->", "from", "===", "$",...
Add the constraints for a relationship query. @param \Mellivora\Database\Eloquent\Builder $query @param \Mellivora\Database\Eloquent\Builder $parentQuery @param array|mixed $columns @return \Mellivora\Database\Eloquent\Builder
[ "Add", "the", "constraints", "for", "a", "relationship", "query", "." ]
train
https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Database/Eloquent/Relations/BelongsTo.php#L245-L256
krakphp/job
src/Queue/Doctrine/DoctrineQueue.php
DoctrineQueue.enqueue
public function enqueue(Job\WrappedJob $job) { $this->repo->addJob($job, $this->name); }
php
public function enqueue(Job\WrappedJob $job) { $this->repo->addJob($job, $this->name); }
[ "public", "function", "enqueue", "(", "Job", "\\", "WrappedJob", "$", "job", ")", "{", "$", "this", "->", "repo", "->", "addJob", "(", "$", "job", ",", "$", "this", "->", "name", ")", ";", "}" ]
push a job onto the queue
[ "push", "a", "job", "onto", "the", "queue" ]
train
https://github.com/krakphp/job/blob/0c16020c1baa13d91f819ecba8334861ba7c4d6c/src/Queue/Doctrine/DoctrineQueue.php#L19-L21
krakphp/job
src/Queue/Doctrine/DoctrineQueue.php
DoctrineQueue.dequeue
public function dequeue() { if (!count($this->cached_jobs)) { $this->cached_jobs = $this->repo->getAvailableJobs($this->name); } if (!count($this->cached_jobs)) { return; } $job_row = array_shift($this->cached_jobs); $job = Job\WrappedJob::fromStr...
php
public function dequeue() { if (!count($this->cached_jobs)) { $this->cached_jobs = $this->repo->getAvailableJobs($this->name); } if (!count($this->cached_jobs)) { return; } $job_row = array_shift($this->cached_jobs); $job = Job\WrappedJob::fromStr...
[ "public", "function", "dequeue", "(", ")", "{", "if", "(", "!", "count", "(", "$", "this", "->", "cached_jobs", ")", ")", "{", "$", "this", "->", "cached_jobs", "=", "$", "this", "->", "repo", "->", "getAvailableJobs", "(", "$", "this", "->", "name",...
take a job off of the queue
[ "take", "a", "job", "off", "of", "the", "queue" ]
train
https://github.com/krakphp/job/blob/0c16020c1baa13d91f819ecba8334861ba7c4d6c/src/Queue/Doctrine/DoctrineQueue.php#L24-L38
shabbyrobe/amiss
src/Filter.php
Filter.getChildren
public function getChildren($objects, $path) { $array = array(); if (!is_array($path)) { $path = explode('/', $path); } if (!is_array($objects)) { $objects = array($objects); } $ret = $objects; foreach ($path as $child) { ...
php
public function getChildren($objects, $path) { $array = array(); if (!is_array($path)) { $path = explode('/', $path); } if (!is_array($objects)) { $objects = array($objects); } $ret = $objects; foreach ($path as $child) { ...
[ "public", "function", "getChildren", "(", "$", "objects", ",", "$", "path", ")", "{", "$", "array", "=", "array", "(", ")", ";", "if", "(", "!", "is_array", "(", "$", "path", ")", ")", "{", "$", "path", "=", "explode", "(", "'/'", ",", "$", "pa...
Retrieve all object child values through a property path. Path can be an array: ['prop', 'childProp', 'veryChildProp'] Or a '/' delimited string: prop/childProp/veryChildProp @param object[] $objects @param string|array $path @return array
[ "Retrieve", "all", "object", "child", "values", "through", "a", "property", "path", "." ]
train
https://github.com/shabbyrobe/amiss/blob/ba261f0d1f985ed36e9fd2903ac0df86c5b9498d/src/Filter.php#L23-L68
shabbyrobe/amiss
src/Filter.php
Filter.indexBy
public function indexBy($list, $property, $meta=null, $allowDupes=null, $ignoreNulls=null) { $allowDupes = $allowDupes !== null ? $allowDupes : false; $ignoreNulls = $ignoreNulls !== null ? $ignoreNulls : true; if (!$list) { return []; } if ($meta) { ...
php
public function indexBy($list, $property, $meta=null, $allowDupes=null, $ignoreNulls=null) { $allowDupes = $allowDupes !== null ? $allowDupes : false; $ignoreNulls = $ignoreNulls !== null ? $ignoreNulls : true; if (!$list) { return []; } if ($meta) { ...
[ "public", "function", "indexBy", "(", "$", "list", ",", "$", "property", ",", "$", "meta", "=", "null", ",", "$", "allowDupes", "=", "null", ",", "$", "ignoreNulls", "=", "null", ")", "{", "$", "allowDupes", "=", "$", "allowDupes", "!==", "null", "?"...
Iterate over an array of objects and returns an array of objects indexed by a property @return array
[ "Iterate", "over", "an", "array", "of", "objects", "and", "returns", "an", "array", "of", "objects", "indexed", "by", "a", "property" ]
train
https://github.com/shabbyrobe/amiss/blob/ba261f0d1f985ed36e9fd2903ac0df86c5b9498d/src/Filter.php#L76-L113
shabbyrobe/amiss
src/Filter.php
Filter.groupBy
public function groupBy($list, $property, $meta=null) { if (!$list) { return []; } if (!$meta) { if (!($first = current($list))) { throw new \UnexpectedValueException(); } $meta = $this->mapper->getMeta(get_class($first)); ...
php
public function groupBy($list, $property, $meta=null) { if (!$list) { return []; } if (!$meta) { if (!($first = current($list))) { throw new \UnexpectedValueException(); } $meta = $this->mapper->getMeta(get_class($first)); ...
[ "public", "function", "groupBy", "(", "$", "list", ",", "$", "property", ",", "$", "meta", "=", "null", ")", "{", "if", "(", "!", "$", "list", ")", "{", "return", "[", "]", ";", "}", "if", "(", "!", "$", "meta", ")", "{", "if", "(", "!", "(...
Iterate over an array of objects and group them by the value of a property @return array[group] = class[]
[ "Iterate", "over", "an", "array", "of", "objects", "and", "group", "them", "by", "the", "value", "of", "a", "property" ]
train
https://github.com/shabbyrobe/amiss/blob/ba261f0d1f985ed36e9fd2903ac0df86c5b9498d/src/Filter.php#L120-L144
mridang/magazine
lib/magento/Archive/Helper/File/Bz.php
Mage_Archive_Helper_File_Bz._open
protected function _open($mode) { $this->_fileHandler = @bzopen($this->_filePath, $mode); if (false === $this->_fileHandler) { throw new Mage_Exception('Failed to open file ' . $this->_filePath); } }
php
protected function _open($mode) { $this->_fileHandler = @bzopen($this->_filePath, $mode); if (false === $this->_fileHandler) { throw new Mage_Exception('Failed to open file ' . $this->_filePath); } }
[ "protected", "function", "_open", "(", "$", "mode", ")", "{", "$", "this", "->", "_fileHandler", "=", "@", "bzopen", "(", "$", "this", "->", "_filePath", ",", "$", "mode", ")", ";", "if", "(", "false", "===", "$", "this", "->", "_fileHandler", ")", ...
Open bz archive file @throws Mage_Exception @param string $mode
[ "Open", "bz", "archive", "file" ]
train
https://github.com/mridang/magazine/blob/5b3cfecc472c61fde6af63efe62690a30a267a04/lib/magento/Archive/Helper/File/Bz.php#L42-L49
mridang/magazine
lib/magento/Archive/Helper/File/Bz.php
Mage_Archive_Helper_File_Bz._read
protected function _read($length) { $data = bzread($this->_fileHandler, $length); if (false === $data) { throw new Mage_Exception('Failed to read data from ' . $this->_filePath); } return $data; }
php
protected function _read($length) { $data = bzread($this->_fileHandler, $length); if (false === $data) { throw new Mage_Exception('Failed to read data from ' . $this->_filePath); } return $data; }
[ "protected", "function", "_read", "(", "$", "length", ")", "{", "$", "data", "=", "bzread", "(", "$", "this", "->", "_fileHandler", ",", "$", "length", ")", ";", "if", "(", "false", "===", "$", "data", ")", "{", "throw", "new", "Mage_Exception", "(",...
Read data from bz archive @throws Mage_Exception @param int $length @return string
[ "Read", "data", "from", "bz", "archive" ]
train
https://github.com/mridang/magazine/blob/5b3cfecc472c61fde6af63efe62690a30a267a04/lib/magento/Archive/Helper/File/Bz.php#L73-L82
oroinc/OroLayoutComponent
OptionValueBag.php
OptionValueBag.buildValue
public function buildValue() { $actions = [ 'add' => [], 'replace' => [], 'remove' => [], ]; foreach ($this->actions as $action) { switch ($action->getName()) { case 'add': $actions['add'][] = [$action->getA...
php
public function buildValue() { $actions = [ 'add' => [], 'replace' => [], 'remove' => [], ]; foreach ($this->actions as $action) { switch ($action->getName()) { case 'add': $actions['add'][] = [$action->getA...
[ "public", "function", "buildValue", "(", ")", "{", "$", "actions", "=", "[", "'add'", "=>", "[", "]", ",", "'replace'", "=>", "[", "]", ",", "'remove'", "=>", "[", "]", ",", "]", ";", "foreach", "(", "$", "this", "->", "actions", "as", "$", "acti...
Builds a block option value using the given builder @return mixed The built value
[ "Builds", "a", "block", "option", "value", "using", "the", "given", "builder" ]
train
https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/OptionValueBag.php#L59-L90
oroinc/OroLayoutComponent
OptionValueBag.php
OptionValueBag.getBuilder
protected function getBuilder() { $isArray = false; // guess builder type based on arguments if ($this->actions) { /** @var Action $action */ $action = reset($this->actions); $arguments = $action->getArguments(); if ($arguments) { ...
php
protected function getBuilder() { $isArray = false; // guess builder type based on arguments if ($this->actions) { /** @var Action $action */ $action = reset($this->actions); $arguments = $action->getArguments(); if ($arguments) { ...
[ "protected", "function", "getBuilder", "(", ")", "{", "$", "isArray", "=", "false", ";", "// guess builder type based on arguments", "if", "(", "$", "this", "->", "actions", ")", "{", "/** @var Action $action */", "$", "action", "=", "reset", "(", "$", "this", ...
Returns options builder based on values in value bag @return OptionValueBuilderInterface
[ "Returns", "options", "builder", "based", "on", "values", "in", "value", "bag" ]
train
https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/OptionValueBag.php#L97-L119
InfiniteSoftware/ISEcommpayPayum
EcommpayGatewayFactory.php
EcommpayGatewayFactory.populateConfig
protected function populateConfig(ArrayObject $config) { $config->defaults([ 'payum.factory_name' => 'ecommpay', 'payum.factory_title' => 'ecommpay', 'payum.action.capture' => new CaptureAction(), 'payum.action.authorize' => new AuthorizeAction(), ...
php
protected function populateConfig(ArrayObject $config) { $config->defaults([ 'payum.factory_name' => 'ecommpay', 'payum.factory_title' => 'ecommpay', 'payum.action.capture' => new CaptureAction(), 'payum.action.authorize' => new AuthorizeAction(), ...
[ "protected", "function", "populateConfig", "(", "ArrayObject", "$", "config", ")", "{", "$", "config", "->", "defaults", "(", "[", "'payum.factory_name'", "=>", "'ecommpay'", ",", "'payum.factory_title'", "=>", "'ecommpay'", ",", "'payum.action.capture'", "=>", "new...
{@inheritDoc}
[ "{" ]
train
https://github.com/InfiniteSoftware/ISEcommpayPayum/blob/44a073e3d885d9007aa54d6ff13aea93a9e52e7c/EcommpayGatewayFactory.php#L20-L51
Eresus/EresusCMS
src/core/classes/backward/TListContentPlugin.php
TListContentPlugin.clientRenderContent
public function clientRenderContent() { $result = ''; if (!isset($this->settings['itemsPerPage'])) { $this->settings['itemsPerPage'] = 0; } /** @var TClientUI $page */ $page = Eresus_Kernel::app()->getPage(); if ($page->topic) { ...
php
public function clientRenderContent() { $result = ''; if (!isset($this->settings['itemsPerPage'])) { $this->settings['itemsPerPage'] = 0; } /** @var TClientUI $page */ $page = Eresus_Kernel::app()->getPage(); if ($page->topic) { ...
[ "public", "function", "clientRenderContent", "(", ")", "{", "$", "result", "=", "''", ";", "if", "(", "!", "isset", "(", "$", "this", "->", "settings", "[", "'itemsPerPage'", "]", ")", ")", "{", "$", "this", "->", "settings", "[", "'itemsPerPage'", "]"...
Отрисовка клиентской части @throws Eresus_CMS_Exception_NotFound @return string|Eresus_HTTP_Response
[ "Отрисовка", "клиентской", "части" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/classes/backward/TListContentPlugin.php#L266-L305
Eresus/EresusCMS
src/core/classes/backward/TListContentPlugin.php
TListContentPlugin.clientRenderPages
protected function clientRenderPages() { /** @var TClientUI $page */ $page = Eresus_Kernel::app()->getPage(); $result = $page->pages($this->pagesCount, $this->settings['itemsPerPage'], $this->table['sortDesc']); return $result; }
php
protected function clientRenderPages() { /** @var TClientUI $page */ $page = Eresus_Kernel::app()->getPage(); $result = $page->pages($this->pagesCount, $this->settings['itemsPerPage'], $this->table['sortDesc']); return $result; }
[ "protected", "function", "clientRenderPages", "(", ")", "{", "/** @var TClientUI $page */", "$", "page", "=", "Eresus_Kernel", "::", "app", "(", ")", "->", "getPage", "(", ")", ";", "$", "result", "=", "$", "page", "->", "pages", "(", "$", "this", "->", ...
Возвращает разметку переключателя страниц @return string
[ "Возвращает", "разметку", "переключателя", "страниц" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/classes/backward/TListContentPlugin.php#L377-L384
phpnfe/tools
src/Certificado/Dom.php
Dom.getNodeValue
public function getNodeValue($nodeName, $itemNum = 0, $extraTextBefore = '', $extraTextAfter = '') { $node = $this->getElementsByTagName($nodeName)->item($itemNum); if (isset($node)) { $texto = html_entity_decode(trim($node->nodeValue), ENT_QUOTES, 'UTF-8'); return $extraTex...
php
public function getNodeValue($nodeName, $itemNum = 0, $extraTextBefore = '', $extraTextAfter = '') { $node = $this->getElementsByTagName($nodeName)->item($itemNum); if (isset($node)) { $texto = html_entity_decode(trim($node->nodeValue), ENT_QUOTES, 'UTF-8'); return $extraTex...
[ "public", "function", "getNodeValue", "(", "$", "nodeName", ",", "$", "itemNum", "=", "0", ",", "$", "extraTextBefore", "=", "''", ",", "$", "extraTextAfter", "=", "''", ")", "{", "$", "node", "=", "$", "this", "->", "getElementsByTagName", "(", "$", "...
getNodeValue. Extrai o valor do node DOM. @param string $nodeName identificador da TAG do xml @param int $itemNum numero do item a ser retornado @param string $extraTextBefore prefixo do retorno @param string $extraTextAfter sufixo do retorno @return string
[ "getNodeValue", ".", "Extrai", "o", "valor", "do", "node", "DOM", "." ]
train
https://github.com/phpnfe/tools/blob/303ca311989e0b345071f61b71d2b3bf7ee80454/src/Certificado/Dom.php#L53-L63
phpnfe/tools
src/Certificado/Dom.php
Dom.getValue
public function getValue($node, $name) { if (empty($node)) { return ''; } $texto = ! empty($node->getElementsByTagName($name)->item(0)->nodeValue) ? $node->getElementsByTagName($name)->item(0)->nodeValue : ''; return html_entity_decode($texto, ENT_QUOTES, 'UT...
php
public function getValue($node, $name) { if (empty($node)) { return ''; } $texto = ! empty($node->getElementsByTagName($name)->item(0)->nodeValue) ? $node->getElementsByTagName($name)->item(0)->nodeValue : ''; return html_entity_decode($texto, ENT_QUOTES, 'UT...
[ "public", "function", "getValue", "(", "$", "node", ",", "$", "name", ")", "{", "if", "(", "empty", "(", "$", "node", ")", ")", "{", "return", "''", ";", "}", "$", "texto", "=", "!", "empty", "(", "$", "node", "->", "getElementsByTagName", "(", "...
getValue. @param DOMElement $node @param string $name @return string
[ "getValue", "." ]
train
https://github.com/phpnfe/tools/blob/303ca311989e0b345071f61b71d2b3bf7ee80454/src/Certificado/Dom.php#L71-L80
phpnfe/tools
src/Certificado/Dom.php
Dom.getNode
public function getNode($nodeName, $itemNum = 0) { $node = $this->getElementsByTagName($nodeName)->item($itemNum); if (isset($node)) { return $node; } return ''; }
php
public function getNode($nodeName, $itemNum = 0) { $node = $this->getElementsByTagName($nodeName)->item($itemNum); if (isset($node)) { return $node; } return ''; }
[ "public", "function", "getNode", "(", "$", "nodeName", ",", "$", "itemNum", "=", "0", ")", "{", "$", "node", "=", "$", "this", "->", "getElementsByTagName", "(", "$", "nodeName", ")", "->", "item", "(", "$", "itemNum", ")", ";", "if", "(", "isset", ...
getNode Retorna o node solicitado. @param string $nodeName @param int $itemNum @return DOMElement se existir ou string vazia se não
[ "getNode", "Retorna", "o", "node", "solicitado", "." ]
train
https://github.com/phpnfe/tools/blob/303ca311989e0b345071f61b71d2b3bf7ee80454/src/Certificado/Dom.php#L89-L97
phpnfe/tools
src/Certificado/Dom.php
Dom.addChild
public function addChild(&$parent, $name, $content = '', $obrigatorio = false, $descricao = '', $force = false) { if ($obrigatorio && $content === '' && ! $force) { $this->erros[] = [ 'tag' => $name, 'desc' => $descricao, 'erro' => 'Preenchimento O...
php
public function addChild(&$parent, $name, $content = '', $obrigatorio = false, $descricao = '', $force = false) { if ($obrigatorio && $content === '' && ! $force) { $this->erros[] = [ 'tag' => $name, 'desc' => $descricao, 'erro' => 'Preenchimento O...
[ "public", "function", "addChild", "(", "&", "$", "parent", ",", "$", "name", ",", "$", "content", "=", "''", ",", "$", "obrigatorio", "=", "false", ",", "$", "descricao", "=", "''", ",", "$", "force", "=", "false", ")", "{", "if", "(", "$", "obri...
addChild Adiciona um elemento ao node xml passado como referencia Serão inclusos erros na array $erros[] sempre que a tag for obrigatória e nenhum parâmetro for passado na variável $content e $force for false. @param \DOMElement $parent @param string $name @param string $content @param bool $obrigatorio @param string $...
[ "addChild", "Adiciona", "um", "elemento", "ao", "node", "xml", "passado", "como", "referencia", "Serão", "inclusos", "erros", "na", "array", "$erros", "[]", "sempre", "que", "a", "tag", "for", "obrigatória", "e", "nenhum", "parâmetro", "for", "passado", "na", ...
train
https://github.com/phpnfe/tools/blob/303ca311989e0b345071f61b71d2b3bf7ee80454/src/Certificado/Dom.php#L112-L127
phpnfe/tools
src/Certificado/Dom.php
Dom.getChave
public function getChave($nodeName = 'infNFe') { $node = $this->getElementsByTagName($nodeName)->item(0); if (! empty($node)) { $chaveId = $node->getAttribute('Id'); $chave = preg_replace('/[^0-9]/', '', $chaveId); return $chave; } return ''; ...
php
public function getChave($nodeName = 'infNFe') { $node = $this->getElementsByTagName($nodeName)->item(0); if (! empty($node)) { $chaveId = $node->getAttribute('Id'); $chave = preg_replace('/[^0-9]/', '', $chaveId); return $chave; } return ''; ...
[ "public", "function", "getChave", "(", "$", "nodeName", "=", "'infNFe'", ")", "{", "$", "node", "=", "$", "this", "->", "getElementsByTagName", "(", "$", "nodeName", ")", "->", "item", "(", "0", ")", ";", "if", "(", "!", "empty", "(", "$", "node", ...
getChave. @param string $nodeName @return string
[ "getChave", "." ]
train
https://github.com/phpnfe/tools/blob/303ca311989e0b345071f61b71d2b3bf7ee80454/src/Certificado/Dom.php#L134-L145
phpnfe/tools
src/Certificado/Dom.php
Dom.appChild
public function appChild(&$parent, $child, $msg = '') { if (empty($parent)) { throw new Exception($msg); } if (! empty($child)) { $parent->appendChild($child); } }
php
public function appChild(&$parent, $child, $msg = '') { if (empty($parent)) { throw new Exception($msg); } if (! empty($child)) { $parent->appendChild($child); } }
[ "public", "function", "appChild", "(", "&", "$", "parent", ",", "$", "child", ",", "$", "msg", "=", "''", ")", "{", "if", "(", "empty", "(", "$", "parent", ")", ")", "{", "throw", "new", "Exception", "(", "$", "msg", ")", ";", "}", "if", "(", ...
appChild Acrescenta DOMElement a pai DOMElement Caso o pai esteja vazio retorna uma exception com a mensagem O parametro "child" pode ser vazio. @param \DOMNode $parent @param \DOMNode $child @param string $msg @return void @throws Exception
[ "appChild", "Acrescenta", "DOMElement", "a", "pai", "DOMElement", "Caso", "o", "pai", "esteja", "vazio", "retorna", "uma", "exception", "com", "a", "mensagem", "O", "parametro", "child", "pode", "ser", "vazio", "." ]
train
https://github.com/phpnfe/tools/blob/303ca311989e0b345071f61b71d2b3bf7ee80454/src/Certificado/Dom.php#L158-L166
phpnfe/tools
src/Certificado/Dom.php
Dom.addArrayChild
public function addArrayChild(&$parent, $arr) { $num = 0; if (! empty($arr) && ! empty($parent)) { foreach ($arr as $node) { $this->appChild($parent, $node, ''); $num++; } } return $num; }
php
public function addArrayChild(&$parent, $arr) { $num = 0; if (! empty($arr) && ! empty($parent)) { foreach ($arr as $node) { $this->appChild($parent, $node, ''); $num++; } } return $num; }
[ "public", "function", "addArrayChild", "(", "&", "$", "parent", ",", "$", "arr", ")", "{", "$", "num", "=", "0", ";", "if", "(", "!", "empty", "(", "$", "arr", ")", "&&", "!", "empty", "(", "$", "parent", ")", ")", "{", "foreach", "(", "$", "...
addArrayChild Adiciona a um DOMNode parent, outros elementos passados em um array de DOMElements. @param DOMElement $parent @param array $arr @return int
[ "addArrayChild", "Adiciona", "a", "um", "DOMNode", "parent", "outros", "elementos", "passados", "em", "um", "array", "de", "DOMElements", "." ]
train
https://github.com/phpnfe/tools/blob/303ca311989e0b345071f61b71d2b3bf7ee80454/src/Certificado/Dom.php#L175-L186
zicht/z
src/Zicht/Tool/Configuration/Configuration.php
Configuration.getConfigTreeBuilder
public function getConfigTreeBuilder() { $treeBuilder = new TreeBuilder(); $zConfig = $treeBuilder->root('z'); $toArray = function ($s) { return array($s); }; $zConfig ->children() ->scalarNode('SHELL')->end() ->scalar...
php
public function getConfigTreeBuilder() { $treeBuilder = new TreeBuilder(); $zConfig = $treeBuilder->root('z'); $toArray = function ($s) { return array($s); }; $zConfig ->children() ->scalarNode('SHELL')->end() ->scalar...
[ "public", "function", "getConfigTreeBuilder", "(", ")", "{", "$", "treeBuilder", "=", "new", "TreeBuilder", "(", ")", ";", "$", "zConfig", "=", "$", "treeBuilder", "->", "root", "(", "'z'", ")", ";", "$", "toArray", "=", "function", "(", "$", "s", ")",...
Generates the configuration tree builder. @return \Symfony\Component\Config\Definition\Builder\TreeBuilder The tree builder
[ "Generates", "the", "configuration", "tree", "builder", "." ]
train
https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Configuration/Configuration.php#L38-L134
bzarzuela/modelfilter
src/ModelFilter.php
ModelFilter.setKey
public function setKey($key) { $this->key = $key; // Initialize if we're the first instance. if (! session()->has('bzarzuela.filters')) { session(['bzarzuela.filters' => [$key => []]]); } return $this; }
php
public function setKey($key) { $this->key = $key; // Initialize if we're the first instance. if (! session()->has('bzarzuela.filters')) { session(['bzarzuela.filters' => [$key => []]]); } return $this; }
[ "public", "function", "setKey", "(", "$", "key", ")", "{", "$", "this", "->", "key", "=", "$", "key", ";", "// Initialize if we're the first instance.", "if", "(", "!", "session", "(", ")", "->", "has", "(", "'bzarzuela.filters'", ")", ")", "{", "session",...
Sets a unique key to hold the filter form data in the session. @param string $key Key name. Usually the model's table name
[ "Sets", "a", "unique", "key", "to", "hold", "the", "filter", "form", "data", "in", "the", "session", "." ]
train
https://github.com/bzarzuela/modelfilter/blob/2ca04409934245b8bf5a0a9684da2f45b234dfa7/src/ModelFilter.php#L31-L41
bzarzuela/modelfilter
src/ModelFilter.php
ModelFilter.getFormData
public function getFormData($field = null) { $filters = session('bzarzuela.filters'); if (isset($filters[$this->key]['form_data'])) { if (! is_null($field)) { if (! isset($filters[$this->key]['form_data'][$field])) { return null; } ...
php
public function getFormData($field = null) { $filters = session('bzarzuela.filters'); if (isset($filters[$this->key]['form_data'])) { if (! is_null($field)) { if (! isset($filters[$this->key]['form_data'][$field])) { return null; } ...
[ "public", "function", "getFormData", "(", "$", "field", "=", "null", ")", "{", "$", "filters", "=", "session", "(", "'bzarzuela.filters'", ")", ";", "if", "(", "isset", "(", "$", "filters", "[", "$", "this", "->", "key", "]", "[", "'form_data'", "]", ...
Gets either the whole form data or just a field inside. @param null $field @return array|null
[ "Gets", "either", "the", "whole", "form", "data", "or", "just", "a", "field", "inside", "." ]
train
https://github.com/bzarzuela/modelfilter/blob/2ca04409934245b8bf5a0a9684da2f45b234dfa7/src/ModelFilter.php#L87-L110
bzarzuela/modelfilter
src/ModelFilter.php
ModelFilter.filter
public function filter($query) { foreach ($this->getRules() as $name => $rule) { if ($this->getFormData($name) == '') { continue; } $type = $rule[0]; switch ($type) { case 'primary': $query->where($name, '...
php
public function filter($query) { foreach ($this->getRules() as $name => $rule) { if ($this->getFormData($name) == '') { continue; } $type = $rule[0]; switch ($type) { case 'primary': $query->where($name, '...
[ "public", "function", "filter", "(", "$", "query", ")", "{", "foreach", "(", "$", "this", "->", "getRules", "(", ")", "as", "$", "name", "=>", "$", "rule", ")", "{", "if", "(", "$", "this", "->", "getFormData", "(", "$", "name", ")", "==", "''", ...
Applies the form data according to the different rules that were initially configured. For example: $tickets = $this->filter(Ticket::query())->paginate(30); @param $query @return mixed
[ "Applies", "the", "form", "data", "according", "to", "the", "different", "rules", "that", "were", "initially", "configured", ".", "For", "example", ":", "$tickets", "=", "$this", "-", ">", "filter", "(", "Ticket", "::", "query", "()", ")", "-", ">", "pag...
train
https://github.com/bzarzuela/modelfilter/blob/2ca04409934245b8bf5a0a9684da2f45b234dfa7/src/ModelFilter.php#L120-L174
caffeinated/beverage
src/Path.php
Path.join
public static function join() { $arguments = func_get_args(); if (func_get_args() === 1 and is_array($arguments[ 0 ])) { $arguments = $arguments[ 0 ]; } foreach ($arguments as $key => $argument) { $arguments[ $key ] = Str::removeRight($arguments[ $key ], '/'...
php
public static function join() { $arguments = func_get_args(); if (func_get_args() === 1 and is_array($arguments[ 0 ])) { $arguments = $arguments[ 0 ]; } foreach ($arguments as $key => $argument) { $arguments[ $key ] = Str::removeRight($arguments[ $key ], '/'...
[ "public", "static", "function", "join", "(", ")", "{", "$", "arguments", "=", "func_get_args", "(", ")", ";", "if", "(", "func_get_args", "(", ")", "===", "1", "and", "is_array", "(", "$", "arguments", "[", "0", "]", ")", ")", "{", "$", "arguments", ...
Joins a split file system path. @param array|string $path @return string
[ "Joins", "a", "split", "file", "system", "path", "." ]
train
https://github.com/caffeinated/beverage/blob/c7d612a1d3bc1baddc97fec60ab17224550efaf3/src/Path.php#L27-L44
alexandresalome/journal-extension
src/Behat/JournalExtension/Formatter/JournalFormatter.php
JournalFormatter.printSummary
protected function printSummary(LoggerDataCollector $logger) { $results = $logger->getScenariosStatuses(); $result = $results['failed'] > 0 ? 'failed' : 'passed'; parent::printSummary($logger); $this->writeln('<div class="summary ' . $result . '">'); $this->writeln(<<<'HTML' <d...
php
protected function printSummary(LoggerDataCollector $logger) { $results = $logger->getScenariosStatuses(); $result = $results['failed'] > 0 ? 'failed' : 'passed'; parent::printSummary($logger); $this->writeln('<div class="summary ' . $result . '">'); $this->writeln(<<<'HTML' <d...
[ "protected", "function", "printSummary", "(", "LoggerDataCollector", "$", "logger", ")", "{", "$", "results", "=", "$", "logger", "->", "getScenariosStatuses", "(", ")", ";", "$", "result", "=", "$", "results", "[", "'failed'", "]", ">", "0", "?", "'failed...
{@inheritdoc}
[ "{" ]
train
https://github.com/alexandresalome/journal-extension/blob/de87304abb52abfa6905f1b83d2e35cc7bc52c0d/src/Behat/JournalExtension/Formatter/JournalFormatter.php#L42-L59
alexandresalome/journal-extension
src/Behat/JournalExtension/Formatter/JournalFormatter.php
JournalFormatter.afterStep
public function afterStep(StepEvent $event) { $color = $this->getResultColorCode($event->getResult()); $capture = $this->captureAll || $color == 'failed'; if ($capture) { try { $screenshot = $this->driver->getScreenshot(); if ($screenshot) { ...
php
public function afterStep(StepEvent $event) { $color = $this->getResultColorCode($event->getResult()); $capture = $this->captureAll || $color == 'failed'; if ($capture) { try { $screenshot = $this->driver->getScreenshot(); if ($screenshot) { ...
[ "public", "function", "afterStep", "(", "StepEvent", "$", "event", ")", "{", "$", "color", "=", "$", "this", "->", "getResultColorCode", "(", "$", "event", "->", "getResult", "(", ")", ")", ";", "$", "capture", "=", "$", "this", "->", "captureAll", "||...
Listens to "step.after" event. @param StepEvent $event @uses printStep()
[ "Listens", "to", "step", ".", "after", "event", "." ]
train
https://github.com/alexandresalome/journal-extension/blob/de87304abb52abfa6905f1b83d2e35cc7bc52c0d/src/Behat/JournalExtension/Formatter/JournalFormatter.php#L68-L110
alexandresalome/journal-extension
src/Behat/JournalExtension/Formatter/JournalFormatter.php
JournalFormatter.printOutlineExampleResult
protected function printOutlineExampleResult(TableNode $examples, $iteration, $result, $isSkipped) { if (!$this->getParameter('expand')) { $color = $this->getResultColorCode($result); $this->printColorizedTableRow($examples->getRow($iteration + 1), $color); $this->printOutli...
php
protected function printOutlineExampleResult(TableNode $examples, $iteration, $result, $isSkipped) { if (!$this->getParameter('expand')) { $color = $this->getResultColorCode($result); $this->printColorizedTableRow($examples->getRow($iteration + 1), $color); $this->printOutli...
[ "protected", "function", "printOutlineExampleResult", "(", "TableNode", "$", "examples", ",", "$", "iteration", ",", "$", "result", ",", "$", "isSkipped", ")", "{", "if", "(", "!", "$", "this", "->", "getParameter", "(", "'expand'", ")", ")", "{", "$", "...
{@inheritdoc} @param TableNode $examples @param int $iteration @param int $result @param bool $isSkipped
[ "{" ]
train
https://github.com/alexandresalome/journal-extension/blob/de87304abb52abfa6905f1b83d2e35cc7bc52c0d/src/Behat/JournalExtension/Formatter/JournalFormatter.php#L120-L155
maestroprog/saw-php
src/Service/Executor.php
Executor.exec
public function exec($cmd): ProcessStatus { $cmd = sprintf('%s %s', $this->phpBinaryPath, $cmd . ' &'); if (PHP_OS === 'WINNT') { $cmd = str_replace('/', '\\', $cmd); $cmd = str_replace('\\', '\\\\', $cmd); } if (PHP_SAPI !== 'cli') { // define('STD...
php
public function exec($cmd): ProcessStatus { $cmd = sprintf('%s %s', $this->phpBinaryPath, $cmd . ' &'); if (PHP_OS === 'WINNT') { $cmd = str_replace('/', '\\', $cmd); $cmd = str_replace('\\', '\\\\', $cmd); } if (PHP_SAPI !== 'cli') { // define('STD...
[ "public", "function", "exec", "(", "$", "cmd", ")", ":", "ProcessStatus", "{", "$", "cmd", "=", "sprintf", "(", "'%s %s'", ",", "$", "this", "->", "phpBinaryPath", ",", "$", "cmd", ".", "' &'", ")", ";", "if", "(", "PHP_OS", "===", "'WINNT'", ")", ...
Выполняет команду, и возвращает ID запущенного процесса. @param $cmd @return ProcessStatus
[ "Выполняет", "команду", "и", "возвращает", "ID", "запущенного", "процесса", "." ]
train
https://github.com/maestroprog/saw-php/blob/159215a4d7a951cca2a9c2eed3e1aa4f5b624cfb/src/Service/Executor.php#L28-L48
old-town/workflow-designer-server
src/Api/V1/Rest/WorkflowDescriptor/WorkflowDescriptorEntityResource.php
WorkflowDescriptorEntityResource.fetch
public function fetch($id) { $routeMath = $this->getEvent()->getRouteMatch(); $workflowManager = $routeMath->getParam('workflowManager', null); if (null === $workflowManager || '' === trim($workflowManager)) { return new ApiProblemResponse( new ApiProblem(400, 'I...
php
public function fetch($id) { $routeMath = $this->getEvent()->getRouteMatch(); $workflowManager = $routeMath->getParam('workflowManager', null); if (null === $workflowManager || '' === trim($workflowManager)) { return new ApiProblemResponse( new ApiProblem(400, 'I...
[ "public", "function", "fetch", "(", "$", "id", ")", "{", "$", "routeMath", "=", "$", "this", "->", "getEvent", "(", ")", "->", "getRouteMatch", "(", ")", ";", "$", "workflowManager", "=", "$", "routeMath", "->", "getParam", "(", "'workflowManager'", ",",...
@param mixed $id @return \OldTown\Workflow\Loader\WorkflowDescriptor @throws \Zend\ServiceManager\Exception\ServiceNotFoundException
[ "@param", "mixed", "$id" ]
train
https://github.com/old-town/workflow-designer-server/blob/6389c5a515861cc8e0b769f1ca7be12c6b78c611/src/Api/V1/Rest/WorkflowDescriptor/WorkflowDescriptorEntityResource.php#L33-L71
JimmDiGrizli/phalcon-config-loader
src/ConfigLoader.php
ConfigLoader.create
public function create($path, $import = true) { $extension = $this->extractExtension($path); $path = str_replace(self::ENVIRONMENT, $this->environment, $path); if ($extension === null) { throw new ExtensionNotFoundException("Extension not found ($path)"); } if ...
php
public function create($path, $import = true) { $extension = $this->extractExtension($path); $path = str_replace(self::ENVIRONMENT, $this->environment, $path); if ($extension === null) { throw new ExtensionNotFoundException("Extension not found ($path)"); } if ...
[ "public", "function", "create", "(", "$", "path", ",", "$", "import", "=", "true", ")", "{", "$", "extension", "=", "$", "this", "->", "extractExtension", "(", "$", "path", ")", ";", "$", "path", "=", "str_replace", "(", "self", "::", "ENVIRONMENT", ...
Create config @param string $path Path to the config file @param bool $import Import encountered config files @return BaseConfig @throws ExtensionNotFoundException @throws AdapterNotFoundException
[ "Create", "config" ]
train
https://github.com/JimmDiGrizli/phalcon-config-loader/blob/9a68dc02057f16aa2431681675ca0bb876a7d571/src/ConfigLoader.php#L67-L82
JimmDiGrizli/phalcon-config-loader
src/ConfigLoader.php
ConfigLoader.importResource
protected function importResource(BaseConfig $baseConfig) { foreach ($baseConfig as $key => $value) { if ($value instanceof BaseConfig) { $this->importResource($value); } elseif (is_string($value)) { if ($key === self::RESOURCES_KEY) { ...
php
protected function importResource(BaseConfig $baseConfig) { foreach ($baseConfig as $key => $value) { if ($value instanceof BaseConfig) { $this->importResource($value); } elseif (is_string($value)) { if ($key === self::RESOURCES_KEY) { ...
[ "protected", "function", "importResource", "(", "BaseConfig", "$", "baseConfig", ")", "{", "foreach", "(", "$", "baseConfig", "as", "$", "key", "=>", "$", "value", ")", "{", "if", "(", "$", "value", "instanceof", "BaseConfig", ")", "{", "$", "this", "->"...
Import encountered files in the configuration @param Config $baseConfig @throws AdapterNotFoundException @throws ConstantDirNotFoundException @throws ExtensionNotFoundException
[ "Import", "encountered", "files", "in", "the", "configuration" ]
train
https://github.com/JimmDiGrizli/phalcon-config-loader/blob/9a68dc02057f16aa2431681675ca0bb876a7d571/src/ConfigLoader.php#L156-L204
JimmDiGrizli/phalcon-config-loader
src/ConfigLoader.php
ConfigLoader.clear
public function clear(Config $means, Config $target) { foreach ($target as $key => $value) { if ($value instanceof BaseConfig && isset($means[$key])) { $this->clear($means[$key], $value); } else { if (isset($means[$key])) { $target-...
php
public function clear(Config $means, Config $target) { foreach ($target as $key => $value) { if ($value instanceof BaseConfig && isset($means[$key])) { $this->clear($means[$key], $value); } else { if (isset($means[$key])) { $target-...
[ "public", "function", "clear", "(", "Config", "$", "means", ",", "Config", "$", "target", ")", "{", "foreach", "(", "$", "target", "as", "$", "key", "=>", "$", "value", ")", "{", "if", "(", "$", "value", "instanceof", "BaseConfig", "&&", "isset", "("...
Delete variables that are already defined in the main configuration file @param Config $means Main configuration file @param Config $target Imported configuration file @return Config
[ "Delete", "variables", "that", "are", "already", "defined", "in", "the", "main", "configuration", "file" ]
train
https://github.com/JimmDiGrizli/phalcon-config-loader/blob/9a68dc02057f16aa2431681675ca0bb876a7d571/src/ConfigLoader.php#L213-L226
JimmDiGrizli/phalcon-config-loader
src/ConfigLoader.php
ConfigLoader.moduleConfigCreate
protected function moduleConfigCreate($path) { $value = explode('::', $path); $ref = new ReflectionClass($value[0]); if ($ref->hasConstant('DIR') === false) { throw new ConstantDirNotFoundException( 'Not found constant DIR in class ' . $value[0] ); ...
php
protected function moduleConfigCreate($path) { $value = explode('::', $path); $ref = new ReflectionClass($value[0]); if ($ref->hasConstant('DIR') === false) { throw new ConstantDirNotFoundException( 'Not found constant DIR in class ' . $value[0] ); ...
[ "protected", "function", "moduleConfigCreate", "(", "$", "path", ")", "{", "$", "value", "=", "explode", "(", "'::'", ",", "$", "path", ")", ";", "$", "ref", "=", "new", "ReflectionClass", "(", "$", "value", "[", "0", "]", ")", ";", "if", "(", "$",...
Create a configuration of the module for further imports @param $path @return Config @throws AdapterNotFoundException @throws ConstantDirNotFoundException @throws ExtensionNotFoundException
[ "Create", "a", "configuration", "of", "the", "module", "for", "further", "imports" ]
train
https://github.com/JimmDiGrizli/phalcon-config-loader/blob/9a68dc02057f16aa2431681675ca0bb876a7d571/src/ConfigLoader.php#L237-L250
JimmDiGrizli/phalcon-config-loader
src/ConfigLoader.php
ConfigLoader.add
public function add($name, $class) { $ref = new ReflectionClass($class); if ($ref->isSubclassOf('Phalcon\Config') === false) { throw new NotFoundTrueParentClassException( $class . ' is\'t subclass of Phalcon/Config' ); } $this->adapters[$name] ...
php
public function add($name, $class) { $ref = new ReflectionClass($class); if ($ref->isSubclassOf('Phalcon\Config') === false) { throw new NotFoundTrueParentClassException( $class . ' is\'t subclass of Phalcon/Config' ); } $this->adapters[$name] ...
[ "public", "function", "add", "(", "$", "name", ",", "$", "class", ")", "{", "$", "ref", "=", "new", "ReflectionClass", "(", "$", "class", ")", ";", "if", "(", "$", "ref", "->", "isSubclassOf", "(", "'Phalcon\\Config'", ")", "===", "false", ")", "{", ...
Adds adapter $class with extension $name @param string $name @param string $class @throws NotFoundTrueParentClassException
[ "Adds", "adapter", "$class", "with", "extension", "$name" ]
train
https://github.com/JimmDiGrizli/phalcon-config-loader/blob/9a68dc02057f16aa2431681675ca0bb876a7d571/src/ConfigLoader.php#L259-L268
webdevvie/pheanstalk-task-queue-bundle
Service/PheanstalkConnection.php
PheanstalkConnection.put
public function put( $data, $priority = \Pheanstalk_PheanstalkInterface::DEFAULT_PRIORITY, $delay = \Pheanstalk_PheanstalkInterface::DEFAULT_DELAY, $timeToRun = \Pheanstalk_PheanstalkInterface::DEFAULT_TTR ) { $this->pheanstalk->put($data, $priority, $delay, $timeToRun); ...
php
public function put( $data, $priority = \Pheanstalk_PheanstalkInterface::DEFAULT_PRIORITY, $delay = \Pheanstalk_PheanstalkInterface::DEFAULT_DELAY, $timeToRun = \Pheanstalk_PheanstalkInterface::DEFAULT_TTR ) { $this->pheanstalk->put($data, $priority, $delay, $timeToRun); ...
[ "public", "function", "put", "(", "$", "data", ",", "$", "priority", "=", "\\", "Pheanstalk_PheanstalkInterface", "::", "DEFAULT_PRIORITY", ",", "$", "delay", "=", "\\", "Pheanstalk_PheanstalkInterface", "::", "DEFAULT_DELAY", ",", "$", "timeToRun", "=", "\\", "...
Puts a task string into the current @param $data @param int $priority @param int $delay @param int $timeToRun @return $this
[ "Puts", "a", "task", "string", "into", "the", "current" ]
train
https://github.com/webdevvie/pheanstalk-task-queue-bundle/blob/db5e63a8f844e345dc2e69ce8e94b32d851020eb/Service/PheanstalkConnection.php#L40-L48
expectation-php/expect
src/matcher/strategy/StringInclusionStrategy.php
StringInclusionStrategy.match
public function match(array $expectValues) { $matchResults = []; $unmatchResults = []; foreach ($expectValues as $expectValue) { $position = strpos($this->actualValue, $expectValue); if ($position !== false) { $matchResults[] = $expectValue; ...
php
public function match(array $expectValues) { $matchResults = []; $unmatchResults = []; foreach ($expectValues as $expectValue) { $position = strpos($this->actualValue, $expectValue); if ($position !== false) { $matchResults[] = $expectValue; ...
[ "public", "function", "match", "(", "array", "$", "expectValues", ")", "{", "$", "matchResults", "=", "[", "]", ";", "$", "unmatchResults", "=", "[", "]", ";", "foreach", "(", "$", "expectValues", "as", "$", "expectValue", ")", "{", "$", "position", "=...
<code> <?php $strategy = new StringInclusionStrategy('foo'); $result = $strategy->match([ 'foo', 'bar' ]);. var_dump($result->isMatched()) // true var_dump($result->getMatchResults()); // ['foo'] var_dump($result->getUnmatchResults()); // ['bar'] ?> </code> @param array expectValues
[ "<code", ">", "<?php", "$strategy", "=", "new", "StringInclusionStrategy", "(", "foo", ")", ";", "$result", "=", "$strategy", "-", ">", "match", "(", "[", "foo", "bar", "]", ")", ";", "." ]
train
https://github.com/expectation-php/expect/blob/1a32c5af37f3dc8dabe4e8eedeeb21aea16ce139/src/matcher/strategy/StringInclusionStrategy.php#L42-L57
andromeda-framework/doctrine
src/Doctrine/Tracy/Panel.php
Panel.getTab
public function getTab(): string { return '<span title="Doctrine 2">' . '<svg viewBox="0 0 2048 2048"><path fill="#aaa" d="M1024 896q237 0 443-43t325-127v170q0 69-103 128t-280 93.5-385 34.5-385-34.5-280' . '-93.5-103-128v-170q119 84 325 127t443 43zm0 768q237 0 443-43t325-127v170q0 69-103 128t-280 93.5-385 34.5...
php
public function getTab(): string { return '<span title="Doctrine 2">' . '<svg viewBox="0 0 2048 2048"><path fill="#aaa" d="M1024 896q237 0 443-43t325-127v170q0 69-103 128t-280 93.5-385 34.5-385-34.5-280' . '-93.5-103-128v-170q119 84 325 127t443 43zm0 768q237 0 443-43t325-127v170q0 69-103 128t-280 93.5-385 34.5...
[ "public", "function", "getTab", "(", ")", ":", "string", "{", "return", "'<span title=\"Doctrine 2\">'", ".", "'<svg viewBox=\"0 0 2048 2048\"><path fill=\"#aaa\" d=\"M1024 896q237 0 443-43t325-127v170q0 69-103 128t-280 93.5-385 34.5-385-34.5-280'", ".", "'-93.5-103-128v-170q119 84 325 127...
Renders tab for Tracy Debug Bar. @return string
[ "Renders", "tab", "for", "Tracy", "Debug", "Bar", "." ]
train
https://github.com/andromeda-framework/doctrine/blob/46924d91c09e0b9fbe5764518cbad70e467ffad4/src/Doctrine/Tracy/Panel.php#L73-L85
andromeda-framework/doctrine
src/Doctrine/Tracy/Panel.php
Panel.getPanel
public function getPanel(): string { if (empty($this->queries)) { return ''; } $params = $this->connection->getParams(); $host = ($params['driver'] === 'pdo_sqlite' && isset($params['path'])) ? 'path: ' . basename($params['path']) : sprintf('host: %s%s/%s', $this->connection->getHost(), (($p = $t...
php
public function getPanel(): string { if (empty($this->queries)) { return ''; } $params = $this->connection->getParams(); $host = ($params['driver'] === 'pdo_sqlite' && isset($params['path'])) ? 'path: ' . basename($params['path']) : sprintf('host: %s%s/%s', $this->connection->getHost(), (($p = $t...
[ "public", "function", "getPanel", "(", ")", ":", "string", "{", "if", "(", "empty", "(", "$", "this", "->", "queries", ")", ")", "{", "return", "''", ";", "}", "$", "params", "=", "$", "this", "->", "connection", "->", "getParams", "(", ")", ";", ...
Renders panel for Tracy Debug Bar. @return string
[ "Renders", "panel", "for", "Tracy", "Debug", "Bar", "." ]
train
https://github.com/andromeda-framework/doctrine/blob/46924d91c09e0b9fbe5764518cbad70e467ffad4/src/Doctrine/Tracy/Panel.php#L93-L119
andromeda-framework/doctrine
src/Doctrine/Tracy/Panel.php
Panel.renderPanelCacheStatistics
private function renderPanelCacheStatistics(): string { if (empty($this->entityManager)) { return ''; } $config = $this->entityManager->getConfiguration(); if (!$config->isSecondLevelCacheEnabled()) { return ''; } $loggerChain = $config->getSecondLevelCacheConfiguration()->getCacheLogger(); if (...
php
private function renderPanelCacheStatistics(): string { if (empty($this->entityManager)) { return ''; } $config = $this->entityManager->getConfiguration(); if (!$config->isSecondLevelCacheEnabled()) { return ''; } $loggerChain = $config->getSecondLevelCacheConfiguration()->getCacheLogger(); if (...
[ "private", "function", "renderPanelCacheStatistics", "(", ")", ":", "string", "{", "if", "(", "empty", "(", "$", "this", "->", "entityManager", ")", ")", "{", "return", "''", ";", "}", "$", "config", "=", "$", "this", "->", "entityManager", "->", "getCon...
Renders cache statistics. @return string
[ "Renders", "cache", "statistics", "." ]
train
https://github.com/andromeda-framework/doctrine/blob/46924d91c09e0b9fbe5764518cbad70e467ffad4/src/Doctrine/Tracy/Panel.php#L127-L149
andromeda-framework/doctrine
src/Doctrine/Tracy/Panel.php
Panel.renderPanelQueries
private function renderPanelQueries(): string { if (empty($this->queries)) { return ''; } $s = ''; foreach ($this->queries as $query) { [$sql, $params, $time, $types, $source] = $query; $q = SqlDumper::dump($sql, $params); $q .= $source ? Helpers::editorLink($source[0], $source[1]) : ''; $s .= ...
php
private function renderPanelQueries(): string { if (empty($this->queries)) { return ''; } $s = ''; foreach ($this->queries as $query) { [$sql, $params, $time, $types, $source] = $query; $q = SqlDumper::dump($sql, $params); $q .= $source ? Helpers::editorLink($source[0], $source[1]) : ''; $s .= ...
[ "private", "function", "renderPanelQueries", "(", ")", ":", "string", "{", "if", "(", "empty", "(", "$", "this", "->", "queries", ")", ")", "{", "return", "''", ";", "}", "$", "s", "=", "''", ";", "foreach", "(", "$", "this", "->", "queries", "as",...
Renders SQL queries. @return string
[ "Renders", "SQL", "queries", "." ]
train
https://github.com/andromeda-framework/doctrine/blob/46924d91c09e0b9fbe5764518cbad70e467ffad4/src/Doctrine/Tracy/Panel.php#L157-L172
andromeda-framework/doctrine
src/Doctrine/Tracy/Panel.php
Panel.startQuery
public function startQuery($sql, array $params = NULL, array $types = NULL) { Debugger::timer('doctrine'); $source = NULL; foreach (debug_backtrace() as $row) { if (isset($row['file']) && $this->filterTracePaths(realpath($row['file']))) { if (isset($row['class']) && stripos($row['class'], '\\' . Proxy::M...
php
public function startQuery($sql, array $params = NULL, array $types = NULL) { Debugger::timer('doctrine'); $source = NULL; foreach (debug_backtrace() as $row) { if (isset($row['file']) && $this->filterTracePaths(realpath($row['file']))) { if (isset($row['class']) && stripos($row['class'], '\\' . Proxy::M...
[ "public", "function", "startQuery", "(", "$", "sql", ",", "array", "$", "params", "=", "NULL", ",", "array", "$", "types", "=", "NULL", ")", "{", "Debugger", "::", "timer", "(", "'doctrine'", ")", ";", "$", "source", "=", "NULL", ";", "foreach", "(",...
Logs a SQL statement somewhere. @param string $sql the SQL to be executed @param mixed[]|NULL $params the SQL parameters @param string[]|NULL $types the SQL parameter types @return void
[ "Logs", "a", "SQL", "statement", "somewhere", "." ]
train
https://github.com/andromeda-framework/doctrine/blob/46924d91c09e0b9fbe5764518cbad70e467ffad4/src/Doctrine/Tracy/Panel.php#L187-L209
andromeda-framework/doctrine
src/Doctrine/Tracy/Panel.php
Panel.stopQuery
public function stopQuery() { $keys = array_keys($this->queries); $key = end($keys); $this->queries[$key][2] = $time = Debugger::timer('doctrine'); $this->totalTime += $time; return $this->queries[$key] + array_fill_keys(range(0, 4), NULL); }
php
public function stopQuery() { $keys = array_keys($this->queries); $key = end($keys); $this->queries[$key][2] = $time = Debugger::timer('doctrine'); $this->totalTime += $time; return $this->queries[$key] + array_fill_keys(range(0, 4), NULL); }
[ "public", "function", "stopQuery", "(", ")", "{", "$", "keys", "=", "array_keys", "(", "$", "this", "->", "queries", ")", ";", "$", "key", "=", "end", "(", "$", "keys", ")", ";", "$", "this", "->", "queries", "[", "$", "key", "]", "[", "2", "]"...
Marks the last started query as stopped. This can be used for timing of queries. @return array
[ "Marks", "the", "last", "started", "query", "as", "stopped", ".", "This", "can", "be", "used", "for", "timing", "of", "queries", "." ]
train
https://github.com/andromeda-framework/doctrine/blob/46924d91c09e0b9fbe5764518cbad70e467ffad4/src/Doctrine/Tracy/Panel.php#L217-L225
andromeda-framework/doctrine
src/Doctrine/Tracy/Panel.php
Panel.setEntityManager
public function setEntityManager(EntityManager $entityManager) { $this->entityManager = $entityManager; $this->connection = $entityManager->getConnection(); $bar = Debugger::getBar(); $bar->addPanel($this); $config = $this->connection->getConfiguration(); $logger = $config->getSQLLogger(); if ($logger ...
php
public function setEntityManager(EntityManager $entityManager) { $this->entityManager = $entityManager; $this->connection = $entityManager->getConnection(); $bar = Debugger::getBar(); $bar->addPanel($this); $config = $this->connection->getConfiguration(); $logger = $config->getSQLLogger(); if ($logger ...
[ "public", "function", "setEntityManager", "(", "EntityManager", "$", "entityManager", ")", "{", "$", "this", "->", "entityManager", "=", "$", "entityManager", ";", "$", "this", "->", "connection", "=", "$", "entityManager", "->", "getConnection", "(", ")", ";"...
Sets entity manager. @param EntityManager $entityManager The Doctrine Entity Manager
[ "Sets", "entity", "manager", "." ]
train
https://github.com/andromeda-framework/doctrine/blob/46924d91c09e0b9fbe5764518cbad70e467ffad4/src/Doctrine/Tracy/Panel.php#L236-L251
andromeda-framework/doctrine
src/Doctrine/Tracy/Panel.php
Panel.filterTracePaths
private function filterTracePaths($file) { $file = str_replace(DIRECTORY_SEPARATOR, '/', $file); $return = is_file($file); foreach ($this->skipPaths as $path) { if (!$return) { break; } $return = $return && strpos($file, '/' . trim($path, '/') . '/') === FALSE; } return $return; }
php
private function filterTracePaths($file) { $file = str_replace(DIRECTORY_SEPARATOR, '/', $file); $return = is_file($file); foreach ($this->skipPaths as $path) { if (!$return) { break; } $return = $return && strpos($file, '/' . trim($path, '/') . '/') === FALSE; } return $return; }
[ "private", "function", "filterTracePaths", "(", "$", "file", ")", "{", "$", "file", "=", "str_replace", "(", "DIRECTORY_SEPARATOR", ",", "'/'", ",", "$", "file", ")", ";", "$", "return", "=", "is_file", "(", "$", "file", ")", ";", "foreach", "(", "$", ...
@param string $file @return bool
[ "@param", "string", "$file" ]
train
https://github.com/andromeda-framework/doctrine/blob/46924d91c09e0b9fbe5764518cbad70e467ffad4/src/Doctrine/Tracy/Panel.php#L259-L270
GrupaZero/api
src/Gzero/Api/Controller/Admin/OptionController.php
OptionController.index
public function index() { $this->authorize('read', Option::class); return $this->respondWithSuccess($this->optionRepo->getCategories(), new OptionCategoryTransformer); }
php
public function index() { $this->authorize('read', Option::class); return $this->respondWithSuccess($this->optionRepo->getCategories(), new OptionCategoryTransformer); }
[ "public", "function", "index", "(", ")", "{", "$", "this", "->", "authorize", "(", "'read'", ",", "Option", "::", "class", ")", ";", "return", "$", "this", "->", "respondWithSuccess", "(", "$", "this", "->", "optionRepo", "->", "getCategories", "(", ")",...
Display a listing of the resource. @return \Illuminate\Http\JsonResponse
[ "Display", "a", "listing", "of", "the", "resource", "." ]
train
https://github.com/GrupaZero/api/blob/fc544bb6057274e9d5e7b617346c3f854ea5effd/src/Gzero/Api/Controller/Admin/OptionController.php#L54-L58
GrupaZero/api
src/Gzero/Api/Controller/Admin/OptionController.php
OptionController.show
public function show($key) { $this->authorize('read', Option::class); try { $option = $this->optionRepo->getOptions($key); return $this->respondWithSuccess($option, new OptionTransformer); } catch (RepositoryValidationException $e) { return $this->respondW...
php
public function show($key) { $this->authorize('read', Option::class); try { $option = $this->optionRepo->getOptions($key); return $this->respondWithSuccess($option, new OptionTransformer); } catch (RepositoryValidationException $e) { return $this->respondW...
[ "public", "function", "show", "(", "$", "key", ")", "{", "$", "this", "->", "authorize", "(", "'read'", ",", "Option", "::", "class", ")", ";", "try", "{", "$", "option", "=", "$", "this", "->", "optionRepo", "->", "getOptions", "(", "$", "key", ")...
Display all options from selected category. @param string $key option category key @return \Illuminate\Http\JsonResponse
[ "Display", "all", "options", "from", "selected", "category", "." ]
train
https://github.com/GrupaZero/api/blob/fc544bb6057274e9d5e7b617346c3f854ea5effd/src/Gzero/Api/Controller/Admin/OptionController.php#L67-L76
GrupaZero/api
src/Gzero/Api/Controller/Admin/OptionController.php
OptionController.update
public function update($categoryKey) { $input = $this->validator->validate('update'); $this->authorize('update', [Option::class, $categoryKey]); try { $this->optionRepo->updateOrCreateOption($categoryKey, $input['key'], $input['value']); return $this->respondWithSucce...
php
public function update($categoryKey) { $input = $this->validator->validate('update'); $this->authorize('update', [Option::class, $categoryKey]); try { $this->optionRepo->updateOrCreateOption($categoryKey, $input['key'], $input['value']); return $this->respondWithSucce...
[ "public", "function", "update", "(", "$", "categoryKey", ")", "{", "$", "input", "=", "$", "this", "->", "validator", "->", "validate", "(", "'update'", ")", ";", "$", "this", "->", "authorize", "(", "'update'", ",", "[", "Option", "::", "class", ",", ...
Updates the specified resource in the database. @param string $categoryKey option category key @return \Illuminate\Http\JsonResponse @throws \Gzero\Validator\ValidationException
[ "Updates", "the", "specified", "resource", "in", "the", "database", "." ]
train
https://github.com/GrupaZero/api/blob/fc544bb6057274e9d5e7b617346c3f854ea5effd/src/Gzero/Api/Controller/Admin/OptionController.php#L87-L97
php-lug/lug
src/Bundle/GridBundle/Form/Type/Batch/GridBatchValueType.php
GridBatchValueType.configureOptions
public function configureOptions(OptionsResolver $resolver) { $idPropertyPath = function (Options $options) { $propertyPath = $options['grid']->getDefinition()->getResource()->getIdPropertyPath(); return function ($choice) use ($propertyPath) { return $this->property...
php
public function configureOptions(OptionsResolver $resolver) { $idPropertyPath = function (Options $options) { $propertyPath = $options['grid']->getDefinition()->getResource()->getIdPropertyPath(); return function ($choice) use ($propertyPath) { return $this->property...
[ "public", "function", "configureOptions", "(", "OptionsResolver", "$", "resolver", ")", "{", "$", "idPropertyPath", "=", "function", "(", "Options", "$", "options", ")", "{", "$", "propertyPath", "=", "$", "options", "[", "'grid'", "]", "->", "getDefinition", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/GridBundle/Form/Type/Batch/GridBatchValueType.php#L53-L97
DevGroup-ru/yii2-users-module
src/widgets/SocialNetworksWidget.php
SocialNetworksWidget.renderMainContent
protected function renderMainContent() { echo Html::beginTag('div', ['class' => 'social-login']); foreach ($this->getClients() as $externalService) { $socialServiceId = SocialService::classNameToId(get_class($externalService)); $i18n = SocialService::i18nNameById($socialServi...
php
protected function renderMainContent() { echo Html::beginTag('div', ['class' => 'social-login']); foreach ($this->getClients() as $externalService) { $socialServiceId = SocialService::classNameToId(get_class($externalService)); $i18n = SocialService::i18nNameById($socialServi...
[ "protected", "function", "renderMainContent", "(", ")", "{", "echo", "Html", "::", "beginTag", "(", "'div'", ",", "[", "'class'", "=>", "'social-login'", "]", ")", ";", "foreach", "(", "$", "this", "->", "getClients", "(", ")", "as", "$", "externalService"...
Renders the main content, which includes all external services links.
[ "Renders", "the", "main", "content", "which", "includes", "all", "external", "services", "links", "." ]
train
https://github.com/DevGroup-ru/yii2-users-module/blob/ff0103dc55c3462627ccc704c33e70c96053f750/src/widgets/SocialNetworksWidget.php#L16-L33
phPoirot/psr7
HttpMessage.php
HttpMessage.withProtocolVersion
function withProtocolVersion($version) { $version = (string) $version; if ($version === $this->getProtocolVersion()) return $this; $new = clone $this; $new->version = $version; return $new; }
php
function withProtocolVersion($version) { $version = (string) $version; if ($version === $this->getProtocolVersion()) return $this; $new = clone $this; $new->version = $version; return $new; }
[ "function", "withProtocolVersion", "(", "$", "version", ")", "{", "$", "version", "=", "(", "string", ")", "$", "version", ";", "if", "(", "$", "version", "===", "$", "this", "->", "getProtocolVersion", "(", ")", ")", "return", "$", "this", ";", "$", ...
Return an instance with the specified HTTP protocol version. The version string MUST contain only the HTTP version number (e.g., "1.1", "1.0"). This method MUST be implemented in such a way as to retain the immutability of the message, and MUST return an instance that has the new protocol version. @param string $ver...
[ "Return", "an", "instance", "with", "the", "specified", "HTTP", "protocol", "version", "." ]
train
https://github.com/phPoirot/psr7/blob/e90295e806dc2eb0cc422f315075f673c63a0780/HttpMessage.php#L47-L57
phPoirot/psr7
HttpMessage.php
HttpMessage.getHeader
function getHeader($name) { if (! $this->hasHeader($name)) return array(); $header = $this->_c_headerNormalized[strtolower($name)]; $value = $this->headers[$header]; $value = is_array($value) ? $value : array($value); return $value; }
php
function getHeader($name) { if (! $this->hasHeader($name)) return array(); $header = $this->_c_headerNormalized[strtolower($name)]; $value = $this->headers[$header]; $value = is_array($value) ? $value : array($value); return $value; }
[ "function", "getHeader", "(", "$", "name", ")", "{", "if", "(", "!", "$", "this", "->", "hasHeader", "(", "$", "name", ")", ")", "return", "array", "(", ")", ";", "$", "header", "=", "$", "this", "->", "_c_headerNormalized", "[", "strtolower", "(", ...
Retrieves a message header value by the given case-insensitive name. This method returns an array of all the header values of the given case-insensitive header name. If the header does not appear in the message, this method MUST return an empty array. @param string $name Case-insensitive header field name. @return s...
[ "Retrieves", "a", "message", "header", "value", "by", "the", "given", "case", "-", "insensitive", "name", "." ]
train
https://github.com/phPoirot/psr7/blob/e90295e806dc2eb0cc422f315075f673c63a0780/HttpMessage.php#L116-L125
phPoirot/psr7
HttpMessage.php
HttpMessage.withHeader
function withHeader($name, $value) { if (is_string($value)) $value = array($value); if (! is_array($value) ) throw new \InvalidArgumentException( 'Invalid header value; must be a string or array of strings' ); if (! preg_match('/^[a-zA-Z0...
php
function withHeader($name, $value) { if (is_string($value)) $value = array($value); if (! is_array($value) ) throw new \InvalidArgumentException( 'Invalid header value; must be a string or array of strings' ); if (! preg_match('/^[a-zA-Z0...
[ "function", "withHeader", "(", "$", "name", ",", "$", "value", ")", "{", "if", "(", "is_string", "(", "$", "value", ")", ")", "$", "value", "=", "array", "(", "$", "value", ")", ";", "if", "(", "!", "is_array", "(", "$", "value", ")", ")", "thr...
Return an instance with the provided value replacing the specified header. While header names are case-insensitive, the casing of the header will be preserved by this function, and returned from getHeaders(). This method MUST be implemented in such a way as to retain the immutability of the message, and MUST return a...
[ "Return", "an", "instance", "with", "the", "provided", "value", "replacing", "the", "specified", "header", "." ]
train
https://github.com/phPoirot/psr7/blob/e90295e806dc2eb0cc422f315075f673c63a0780/HttpMessage.php#L170-L200
phPoirot/psr7
HttpMessage.php
HttpMessage.withAddedHeader
function withAddedHeader($name, $value) { if (is_string($value)) $value = array($value); if (! is_array($value) ) throw new \InvalidArgumentException( 'Invalid header value; must be a string or array of strings' ); if (! preg_match('/^[a-...
php
function withAddedHeader($name, $value) { if (is_string($value)) $value = array($value); if (! is_array($value) ) throw new \InvalidArgumentException( 'Invalid header value; must be a string or array of strings' ); if (! preg_match('/^[a-...
[ "function", "withAddedHeader", "(", "$", "name", ",", "$", "value", ")", "{", "if", "(", "is_string", "(", "$", "value", ")", ")", "$", "value", "=", "array", "(", "$", "value", ")", ";", "if", "(", "!", "is_array", "(", "$", "value", ")", ")", ...
Return an instance with the specified header appended with the given value. Existing values for the specified header will be maintained. The new value(s) will be appended to the existing list. If the header did not exist previously, it will be added. This method MUST be implemented in such a way as to retain the immu...
[ "Return", "an", "instance", "with", "the", "specified", "header", "appended", "with", "the", "given", "value", "." ]
train
https://github.com/phPoirot/psr7/blob/e90295e806dc2eb0cc422f315075f673c63a0780/HttpMessage.php#L218-L250
phPoirot/psr7
HttpMessage.php
HttpMessage.isValid
static function isValid($value) { if (!\Poirot\Std\isStringify($value)) throw new \InvalidArgumentException(sprintf( 'Header value must be string; given: (%s).' , \Poirot\Std\flatten($value) )); $value = (string) $value; // Look for:...
php
static function isValid($value) { if (!\Poirot\Std\isStringify($value)) throw new \InvalidArgumentException(sprintf( 'Header value must be string; given: (%s).' , \Poirot\Std\flatten($value) )); $value = (string) $value; // Look for:...
[ "static", "function", "isValid", "(", "$", "value", ")", "{", "if", "(", "!", "\\", "Poirot", "\\", "Std", "\\", "isStringify", "(", "$", "value", ")", ")", "throw", "new", "\\", "InvalidArgumentException", "(", "sprintf", "(", "'Header value must be string;...
Validate a header value. Per RFC 7230, only VISIBLE ASCII characters, spaces, and horizontal tabs are allowed in values; header continuations MUST consist of a single CRLF sequence followed by a space or horizontal tab. @see http://en.wikipedia.org/wiki/HTTP_response_splitting @param string $value @return bool
[ "Validate", "a", "header", "value", "." ]
train
https://github.com/phPoirot/psr7/blob/e90295e806dc2eb0cc422f315075f673c63a0780/HttpMessage.php#L320-L350
phPoirot/psr7
HttpMessage.php
HttpMessage._filterHeaders
protected function _filterHeaders(array $originalHeaders) { $headerNames = $headers = array(); foreach ($originalHeaders as $header => $value) { if (! is_string($header)) { throw new \InvalidArgumentException(sprintf( 'Invalid header name; expected non...
php
protected function _filterHeaders(array $originalHeaders) { $headerNames = $headers = array(); foreach ($originalHeaders as $header => $value) { if (! is_string($header)) { throw new \InvalidArgumentException(sprintf( 'Invalid header name; expected non...
[ "protected", "function", "_filterHeaders", "(", "array", "$", "originalHeaders", ")", "{", "$", "headerNames", "=", "$", "headers", "=", "array", "(", ")", ";", "foreach", "(", "$", "originalHeaders", "as", "$", "header", "=>", "$", "value", ")", "{", "i...
Filter a set of headers to ensure they are in the correct internal format. Used by message constructors to allow setting all initial headers at once. @param array $originalHeaders Headers to filter. @return array Filtered headers and names.
[ "Filter", "a", "set", "of", "headers", "to", "ensure", "they", "are", "in", "the", "correct", "internal", "format", "." ]
train
https://github.com/phPoirot/psr7/blob/e90295e806dc2eb0cc422f315075f673c63a0780/HttpMessage.php#L360-L398
xiewulong/yii2-fileupload
oss/libs/guzzle/http/Guzzle/Http/Url.php
Url.setPath
public function setPath($path) { if (is_array($path)) { $this->path = '/' . implode('/', $path); } else { $this->path = (string) $path; } return $this; }
php
public function setPath($path) { if (is_array($path)) { $this->path = '/' . implode('/', $path); } else { $this->path = (string) $path; } return $this; }
[ "public", "function", "setPath", "(", "$", "path", ")", "{", "if", "(", "is_array", "(", "$", "path", ")", ")", "{", "$", "this", "->", "path", "=", "'/'", ".", "implode", "(", "'/'", ",", "$", "path", ")", ";", "}", "else", "{", "$", "this", ...
Set the path part of the URL @param array|string $path Path string or array of path segments @return Url
[ "Set", "the", "path", "part", "of", "the", "URL" ]
train
https://github.com/xiewulong/yii2-fileupload/blob/3e75b17a4a18dd8466e3f57c63136de03470ca82/oss/libs/guzzle/http/Guzzle/Http/Url.php#L269-L278
xiewulong/yii2-fileupload
oss/libs/guzzle/http/Guzzle/Http/Url.php
Url.normalizePath
public function normalizePath() { if (!$this->path || $this->path == '/' || $this->path == '*') { return $this; } // Replace // and /./ with / $this->path = str_replace(array('/./', '//'), '/', $this->path); // Remove dot segments if (strpos($this->path,...
php
public function normalizePath() { if (!$this->path || $this->path == '/' || $this->path == '*') { return $this; } // Replace // and /./ with / $this->path = str_replace(array('/./', '//'), '/', $this->path); // Remove dot segments if (strpos($this->path,...
[ "public", "function", "normalizePath", "(", ")", "{", "if", "(", "!", "$", "this", "->", "path", "||", "$", "this", "->", "path", "==", "'/'", "||", "$", "this", "->", "path", "==", "'*'", ")", "{", "return", "$", "this", ";", "}", "// Replace // a...
Normalize the URL so that double slashes and relative paths are removed @return Url
[ "Normalize", "the", "URL", "so", "that", "double", "slashes", "and", "relative", "paths", "are", "removed" ]
train
https://github.com/xiewulong/yii2-fileupload/blob/3e75b17a4a18dd8466e3f57c63136de03470ca82/oss/libs/guzzle/http/Guzzle/Http/Url.php#L285-L323
xiewulong/yii2-fileupload
oss/libs/guzzle/http/Guzzle/Http/Url.php
Url.addPath
public function addPath($relativePath) { if (!$relativePath || $relativePath == '/') { return $this; } // Add a leading slash if needed if ($relativePath[0] != '/') { $relativePath = '/' . $relativePath; } return $this->setPath(str_replace('/...
php
public function addPath($relativePath) { if (!$relativePath || $relativePath == '/') { return $this; } // Add a leading slash if needed if ($relativePath[0] != '/') { $relativePath = '/' . $relativePath; } return $this->setPath(str_replace('/...
[ "public", "function", "addPath", "(", "$", "relativePath", ")", "{", "if", "(", "!", "$", "relativePath", "||", "$", "relativePath", "==", "'/'", ")", "{", "return", "$", "this", ";", "}", "// Add a leading slash if needed", "if", "(", "$", "relativePath", ...
Add a relative path to the currently set path @param string $relativePath Relative path to add @return Url
[ "Add", "a", "relative", "path", "to", "the", "currently", "set", "path" ]
train
https://github.com/xiewulong/yii2-fileupload/blob/3e75b17a4a18dd8466e3f57c63136de03470ca82/oss/libs/guzzle/http/Guzzle/Http/Url.php#L332-L344
philiplb/Valdi
src/Valdi/Validator/AbstractParametrizedValidator.php
AbstractParametrizedValidator.validateParameterCount
protected function validateParameterCount($name, $parameterAmount, array $parameters) { if (count($parameters) !== $parameterAmount) { throw new ValidationException('"'.$name.'" expects '.$parameterAmount.' parameter.'); } }
php
protected function validateParameterCount($name, $parameterAmount, array $parameters) { if (count($parameters) !== $parameterAmount) { throw new ValidationException('"'.$name.'" expects '.$parameterAmount.' parameter.'); } }
[ "protected", "function", "validateParameterCount", "(", "$", "name", ",", "$", "parameterAmount", ",", "array", "$", "parameters", ")", "{", "if", "(", "count", "(", "$", "parameters", ")", "!==", "$", "parameterAmount", ")", "{", "throw", "new", "Validation...
Throws an exception if the parameters don't fulfill the expected parameter count. @param string $name the name of the validator @param integer $parameterAmount the amount of expected parameters @param string[] $parameters the parameters @throws ValidationException thrown if the amount of parameters isn't the expected...
[ "Throws", "an", "exception", "if", "the", "parameters", "don", "t", "fulfill", "the", "expected", "parameter", "count", "." ]
train
https://github.com/philiplb/Valdi/blob/9927ec34a2cb00cec705e952d3c2374e2dc3c972/src/Valdi/Validator/AbstractParametrizedValidator.php#L35-L39
interactivesolutions/honeycomb-core
src/errors/HCLog.php
HCLog.emergency
public function emergency(string $id, string $message, int $status = 400) { Log::error($id . ' : ' . $message); return response ()->json (['success' => false, 'id' => $id, 'message' => $message], $status); }
php
public function emergency(string $id, string $message, int $status = 400) { Log::error($id . ' : ' . $message); return response ()->json (['success' => false, 'id' => $id, 'message' => $message], $status); }
[ "public", "function", "emergency", "(", "string", "$", "id", ",", "string", "$", "message", ",", "int", "$", "status", "=", "400", ")", "{", "Log", "::", "error", "(", "$", "id", ".", "' : '", ".", "$", "message", ")", ";", "return", "response", "(...
Create emergency response @param string $id @param string $message @param int $status @return \Illuminate\Http\JsonResponse
[ "Create", "emergency", "response" ]
train
https://github.com/interactivesolutions/honeycomb-core/blob/06b8d88bb285e73a1a286e60411ca5f41863f39f/src/errors/HCLog.php#L17-L22
interactivesolutions/honeycomb-core
src/errors/HCLog.php
HCLog.notice
public function notice(string $id, string $message, int $status = 400) { Log::info($id . ' : ' . $message); return response ()->json (['success' => false, 'id' => $id, 'message' => $message], $status); }
php
public function notice(string $id, string $message, int $status = 400) { Log::info($id . ' : ' . $message); return response ()->json (['success' => false, 'id' => $id, 'message' => $message], $status); }
[ "public", "function", "notice", "(", "string", "$", "id", ",", "string", "$", "message", ",", "int", "$", "status", "=", "400", ")", "{", "Log", "::", "info", "(", "$", "id", ".", "' : '", ".", "$", "message", ")", ";", "return", "response", "(", ...
Create notice response @param string $id @param string $message @param int $status @return \Illuminate\Http\JsonResponse
[ "Create", "notice", "response" ]
train
https://github.com/interactivesolutions/honeycomb-core/blob/06b8d88bb285e73a1a286e60411ca5f41863f39f/src/errors/HCLog.php#L92-L97
interactivesolutions/honeycomb-core
src/errors/HCLog.php
HCLog.success
public function success(string $id, string $message, int $status = 200) { Log::info($id . ' : ' . $message); return response ()->json (['success' => true, 'id' => $id, 'message' => $message], $status); }
php
public function success(string $id, string $message, int $status = 200) { Log::info($id . ' : ' . $message); return response ()->json (['success' => true, 'id' => $id, 'message' => $message], $status); }
[ "public", "function", "success", "(", "string", "$", "id", ",", "string", "$", "message", ",", "int", "$", "status", "=", "200", ")", "{", "Log", "::", "info", "(", "$", "id", ".", "' : '", ".", "$", "message", ")", ";", "return", "response", "(", ...
Create success response @param string $id @param string $message @param int $status @return \Illuminate\Http\JsonResponse
[ "Create", "success", "response" ]
train
https://github.com/interactivesolutions/honeycomb-core/blob/06b8d88bb285e73a1a286e60411ca5f41863f39f/src/errors/HCLog.php#L135-L140
academic/VipaBibTexBundle
Helper/Bibtex.php
Bibtex.Structures_Bibtex
function Structures_Bibtex($options = array()) { $this->_delimiters = array('"' => '"', '{' => '}'); $this->data = array(); $this->content = ''; //$this->_stripDelimiter = $stripDel; //$this->_validate = $val; $this->warnings = array(); $this...
php
function Structures_Bibtex($options = array()) { $this->_delimiters = array('"' => '"', '{' => '}'); $this->data = array(); $this->content = ''; //$this->_stripDelimiter = $stripDel; //$this->_validate = $val; $this->warnings = array(); $this...
[ "function", "Structures_Bibtex", "(", "$", "options", "=", "array", "(", ")", ")", "{", "$", "this", "->", "_delimiters", "=", "array", "(", "'\"'", "=>", "'\"'", ",", "'{'", "=>", "'}'", ")", ";", "$", "this", "->", "data", "=", "array", "(", ")",...
Constructor @access public @return void
[ "Constructor" ]
train
https://github.com/academic/VipaBibTexBundle/blob/1cd82b0961e1a9fee804a85fd774d1384c3e089b/Helper/Bibtex.php#L145-L186
academic/VipaBibTexBundle
Helper/Bibtex.php
Bibtex.setOption
function setOption($option, $value) { $ret = true; if (array_key_exists($option, $this->_options)) { $this->_options[$option] = $value; } else { throw new InvalidArgumentException('Unknown option ' . $option); } }
php
function setOption($option, $value) { $ret = true; if (array_key_exists($option, $this->_options)) { $this->_options[$option] = $value; } else { throw new InvalidArgumentException('Unknown option ' . $option); } }
[ "function", "setOption", "(", "$", "option", ",", "$", "value", ")", "{", "$", "ret", "=", "true", ";", "if", "(", "array_key_exists", "(", "$", "option", ",", "$", "this", "->", "_options", ")", ")", "{", "$", "this", "->", "_options", "[", "$", ...
Sets run-time configuration options @access public @param string $option option name @param mixed $value value for the option @return mixed true on success @throws InvalidArgumentException
[ "Sets", "run", "-", "time", "configuration", "options" ]
train
https://github.com/academic/VipaBibTexBundle/blob/1cd82b0961e1a9fee804a85fd774d1384c3e089b/Helper/Bibtex.php#L197-L205
academic/VipaBibTexBundle
Helper/Bibtex.php
Bibtex.loadFile
function loadFile($filename) { if (file_exists($filename)) { if (($this->content = @file_get_contents($filename)) === false) { throw new BibtexException('Could not open file ' . $filename); } else { $this->_pos = 0; $this->_oldpos = 0; ...
php
function loadFile($filename) { if (file_exists($filename)) { if (($this->content = @file_get_contents($filename)) === false) { throw new BibtexException('Could not open file ' . $filename); } else { $this->_pos = 0; $this->_oldpos = 0; ...
[ "function", "loadFile", "(", "$", "filename", ")", "{", "if", "(", "file_exists", "(", "$", "filename", ")", ")", "{", "if", "(", "(", "$", "this", "->", "content", "=", "@", "file_get_contents", "(", "$", "filename", ")", ")", "===", "false", ")", ...
Reads a give BibTex File @access public @param string $filename Name of the file @return mixed true on success @throws BibtexException
[ "Reads", "a", "give", "BibTex", "File" ]
train
https://github.com/academic/VipaBibTexBundle/blob/1cd82b0961e1a9fee804a85fd774d1384c3e089b/Helper/Bibtex.php#L215-L228
academic/VipaBibTexBundle
Helper/Bibtex.php
Bibtex.parse
function parse() { //The amount of opening braces is compared to the amount of closing braces //Braces inside comments are ignored $this->warnings = array(); $this->data = array(); $valid = true; $open = 0; $entry = false; $char = ''; $lastchar...
php
function parse() { //The amount of opening braces is compared to the amount of closing braces //Braces inside comments are ignored $this->warnings = array(); $this->data = array(); $valid = true; $open = 0; $entry = false; $char = ''; $lastchar...
[ "function", "parse", "(", ")", "{", "//The amount of opening braces is compared to the amount of closing braces", "//Braces inside comments are ignored", "$", "this", "->", "warnings", "=", "array", "(", ")", ";", "$", "this", "->", "data", "=", "array", "(", ")", ";"...
Parses what is stored in content and clears the content if the parsing is successfull. @access public @return boolean true on success @throws BibtexException
[ "Parses", "what", "is", "stored", "in", "content", "and", "clears", "the", "content", "if", "the", "parsing", "is", "successfull", "." ]
train
https://github.com/academic/VipaBibTexBundle/blob/1cd82b0961e1a9fee804a85fd774d1384c3e089b/Helper/Bibtex.php#L237-L327
academic/VipaBibTexBundle
Helper/Bibtex.php
Bibtex._parseEntry
function _parseEntry($entry) { $entrycopy = ''; if ($this->_options['validate']) { $entrycopy = $entry; //We need a copy for printing the warnings } $ret = array(); if ('@string' == strtolower(substr($entry, 0, 7))) { //String are not yet supported! ...
php
function _parseEntry($entry) { $entrycopy = ''; if ($this->_options['validate']) { $entrycopy = $entry; //We need a copy for printing the warnings } $ret = array(); if ('@string' == strtolower(substr($entry, 0, 7))) { //String are not yet supported! ...
[ "function", "_parseEntry", "(", "$", "entry", ")", "{", "$", "entrycopy", "=", "''", ";", "if", "(", "$", "this", "->", "_options", "[", "'validate'", "]", ")", "{", "$", "entrycopy", "=", "$", "entry", ";", "//We need a copy for printing the warnings", "}...
Extracting the data of one content The parse function splits the content into its entries. Then every entry is parsed by this function. It parses the entry backwards. First the last '=' is searched and the value extracted from that. A copy is made of the entry if warnings should be generated. This takes quite some mem...
[ "Extracting", "the", "data", "of", "one", "content" ]
train
https://github.com/academic/VipaBibTexBundle/blob/1cd82b0961e1a9fee804a85fd774d1384c3e089b/Helper/Bibtex.php#L349-L431
academic/VipaBibTexBundle
Helper/Bibtex.php
Bibtex._checkEqualSign
function _checkEqualSign($entry, $position) { $ret = true; //This is getting tricky //We check the string backwards until the position and count the closing an opening braces //If we reach the position the amount of opening and closing braces should be equal $length = strlen(...
php
function _checkEqualSign($entry, $position) { $ret = true; //This is getting tricky //We check the string backwards until the position and count the closing an opening braces //If we reach the position the amount of opening and closing braces should be equal $length = strlen(...
[ "function", "_checkEqualSign", "(", "$", "entry", ",", "$", "position", ")", "{", "$", "ret", "=", "true", ";", "//This is getting tricky", "//We check the string backwards until the position and count the closing an opening braces", "//If we reach the position the amount of openin...
Checking whether the position of the '=' is correct Sometimes there is a problem if a '=' is used inside an entry (for example abstract). This method checks if the '=' is outside braces then the '=' is correct and true is returned. If the '=' is inside braces it contains to a equation and therefore false is returned. ...
[ "Checking", "whether", "the", "position", "of", "the", "=", "is", "correct" ]
train
https://github.com/academic/VipaBibTexBundle/blob/1cd82b0961e1a9fee804a85fd774d1384c3e089b/Helper/Bibtex.php#L445-L494
academic/VipaBibTexBundle
Helper/Bibtex.php
Bibtex._checkAt
function _checkAt($entry) { $ret = false; $opening = array_keys($this->_delimiters); $closing = array_values($this->_delimiters); //Getting the value (at is only allowd in values) if (strrpos($entry, '=') !== false) { $position = strrpos($entry, '='); ...
php
function _checkAt($entry) { $ret = false; $opening = array_keys($this->_delimiters); $closing = array_values($this->_delimiters); //Getting the value (at is only allowd in values) if (strrpos($entry, '=') !== false) { $position = strrpos($entry, '='); ...
[ "function", "_checkAt", "(", "$", "entry", ")", "{", "$", "ret", "=", "false", ";", "$", "opening", "=", "array_keys", "(", "$", "this", "->", "_delimiters", ")", ";", "$", "closing", "=", "array_values", "(", "$", "this", "->", "_delimiters", ")", "...
Checking whether an at is outside an entry Sometimes an entry misses an entry brace. Then the at of the next entry seems to be inside an entry. This is checked here. When it is most likely that the at is an opening at of the next entry this method returns true. @access private @param string $entry The text of the ent...
[ "Checking", "whether", "an", "at", "is", "outside", "an", "entry" ]
train
https://github.com/academic/VipaBibTexBundle/blob/1cd82b0961e1a9fee804a85fd774d1384c3e089b/Helper/Bibtex.php#L519-L558
academic/VipaBibTexBundle
Helper/Bibtex.php
Bibtex._stripDelimiter
function _stripDelimiter($entry) { $beginningdels = array_keys($this->_delimiters); $length = strlen($entry); $firstchar = substr($entry, 0, 1); $lastchar = substr($entry, -1, 1); while (in_array($firstchar, $beginningdels)) { //The first character is an opening delimiter ...
php
function _stripDelimiter($entry) { $beginningdels = array_keys($this->_delimiters); $length = strlen($entry); $firstchar = substr($entry, 0, 1); $lastchar = substr($entry, -1, 1); while (in_array($firstchar, $beginningdels)) { //The first character is an opening delimiter ...
[ "function", "_stripDelimiter", "(", "$", "entry", ")", "{", "$", "beginningdels", "=", "array_keys", "(", "$", "this", "->", "_delimiters", ")", ";", "$", "length", "=", "strlen", "(", "$", "entry", ")", ";", "$", "firstchar", "=", "substr", "(", "$", ...
Stripping Delimiter @access private @param string $entry The entry where the Delimiter should be stripped from @return string Stripped entry
[ "Stripping", "Delimiter" ]
train
https://github.com/academic/VipaBibTexBundle/blob/1cd82b0961e1a9fee804a85fd774d1384c3e089b/Helper/Bibtex.php#L567-L583
academic/VipaBibTexBundle
Helper/Bibtex.php
Bibtex._wordwrap
function _wordwrap($entry) { if (('' != $entry) && (is_string($entry))) { $entry = wordwrap($entry, $this->_options['wordWrapWidth'], $this->_options['wordWrapBreak'], $this->_options['wordWrapCut']); } return $entry; }
php
function _wordwrap($entry) { if (('' != $entry) && (is_string($entry))) { $entry = wordwrap($entry, $this->_options['wordWrapWidth'], $this->_options['wordWrapBreak'], $this->_options['wordWrapCut']); } return $entry; }
[ "function", "_wordwrap", "(", "$", "entry", ")", "{", "if", "(", "(", "''", "!=", "$", "entry", ")", "&&", "(", "is_string", "(", "$", "entry", ")", ")", ")", "{", "$", "entry", "=", "wordwrap", "(", "$", "entry", ",", "$", "this", "->", "_opti...
Wordwrap an entry @access private @param string $entry The entry to wrap @return string wrapped entry
[ "Wordwrap", "an", "entry" ]
train
https://github.com/academic/VipaBibTexBundle/blob/1cd82b0961e1a9fee804a85fd774d1384c3e089b/Helper/Bibtex.php#L605-L611
academic/VipaBibTexBundle
Helper/Bibtex.php
Bibtex._extractAuthors
function _extractAuthors($entry) { $entry = $this->_unwrap($entry); $authorarray = array(); $authorarray = explode(' and ', $entry); for ($i = 0; $i < sizeof($authorarray); $i++) { $author = trim($authorarray[$i]); /*The first version of how an author could be...
php
function _extractAuthors($entry) { $entry = $this->_unwrap($entry); $authorarray = array(); $authorarray = explode(' and ', $entry); for ($i = 0; $i < sizeof($authorarray); $i++) { $author = trim($authorarray[$i]); /*The first version of how an author could be...
[ "function", "_extractAuthors", "(", "$", "entry", ")", "{", "$", "entry", "=", "$", "this", "->", "_unwrap", "(", "$", "entry", ")", ";", "$", "authorarray", "=", "array", "(", ")", ";", "$", "authorarray", "=", "explode", "(", "' and '", ",", "$", ...
Extracting the authors @access private @param string $entry The entry with the authors @return array the extracted authors
[ "Extracting", "the", "authors" ]
train
https://github.com/academic/VipaBibTexBundle/blob/1cd82b0961e1a9fee804a85fd774d1384c3e089b/Helper/Bibtex.php#L620-L753
academic/VipaBibTexBundle
Helper/Bibtex.php
Bibtex._determineCase
function _determineCase($word) { $ret = -1; $trimmedword = trim($word); /*We need this variable. Without the next of would not work (trim changes the variable automatically to a string!)*/ if (is_string($word) && (strlen($trimmedword) > 0)) { $i = 0; ...
php
function _determineCase($word) { $ret = -1; $trimmedword = trim($word); /*We need this variable. Without the next of would not work (trim changes the variable automatically to a string!)*/ if (is_string($word) && (strlen($trimmedword) > 0)) { $i = 0; ...
[ "function", "_determineCase", "(", "$", "word", ")", "{", "$", "ret", "=", "-", "1", ";", "$", "trimmedword", "=", "trim", "(", "$", "word", ")", ";", "/*We need this variable. Without the next of would not work\n (trim changes the variable automatically to a stri...
Case Determination according to the needs of BibTex To parse the Author(s) correctly a determination is needed to get the Case of a word. There are three possible values: - Upper Case (return value 1) - Lower Case (return value 0) - Caseless (return value -1) @access private @param string $word @return int The Case...
[ "Case", "Determination", "according", "to", "the", "needs", "of", "BibTex" ]
train
https://github.com/academic/VipaBibTexBundle/blob/1cd82b0961e1a9fee804a85fd774d1384c3e089b/Helper/Bibtex.php#L769-L802
academic/VipaBibTexBundle
Helper/Bibtex.php
Bibtex._validateValue
function _validateValue($entry, $wholeentry) { //There is no @ allowed if the entry is enclosed by braces if (preg_match('/^{.*@.*}$/', $entry)) { $this->_generateWarning('WARNING_AT_IN_BRACES', $entry, $wholeentry); } //No escaped " allowed if the entry is enclosed by do...
php
function _validateValue($entry, $wholeentry) { //There is no @ allowed if the entry is enclosed by braces if (preg_match('/^{.*@.*}$/', $entry)) { $this->_generateWarning('WARNING_AT_IN_BRACES', $entry, $wholeentry); } //No escaped " allowed if the entry is enclosed by do...
[ "function", "_validateValue", "(", "$", "entry", ",", "$", "wholeentry", ")", "{", "//There is no @ allowed if the entry is enclosed by braces", "if", "(", "preg_match", "(", "'/^{.*@.*}$/'", ",", "$", "entry", ")", ")", "{", "$", "this", "->", "_generateWarning", ...
Validation of a value There may be several problems with the value of a field. These problems exist but do not break the parsing. If a problem is detected a warning is appended to the array warnings. @access private @param string $entry The entry aka one line which which should be validated @param string $wholeentry ...
[ "Validation", "of", "a", "value" ]
train
https://github.com/academic/VipaBibTexBundle/blob/1cd82b0961e1a9fee804a85fd774d1384c3e089b/Helper/Bibtex.php#L816-L843
academic/VipaBibTexBundle
Helper/Bibtex.php
Bibtex._removeCurlyBraces
function _removeCurlyBraces($value) { //First we save the delimiters $beginningdels = array_keys($this->_delimiters); $firstchar = substr($value, 0, 1); $lastchar = substr($value, -1, 1); $begin = ''; $end = ''; while (in_array($firstchar, $beginningdels)) { /...
php
function _removeCurlyBraces($value) { //First we save the delimiters $beginningdels = array_keys($this->_delimiters); $firstchar = substr($value, 0, 1); $lastchar = substr($value, -1, 1); $begin = ''; $end = ''; while (in_array($firstchar, $beginningdels)) { /...
[ "function", "_removeCurlyBraces", "(", "$", "value", ")", "{", "//First we save the delimiters", "$", "beginningdels", "=", "array_keys", "(", "$", "this", "->", "_delimiters", ")", ";", "$", "firstchar", "=", "substr", "(", "$", "value", ",", "0", ",", "1",...
Remove curly braces from entry @access private @param string $value The value in which curly braces to be removed @param string Value with removed curly braces
[ "Remove", "curly", "braces", "from", "entry" ]
train
https://github.com/academic/VipaBibTexBundle/blob/1cd82b0961e1a9fee804a85fd774d1384c3e089b/Helper/Bibtex.php#L852-L878
academic/VipaBibTexBundle
Helper/Bibtex.php
Bibtex._generateWarning
function _generateWarning($type, $entry, $wholeentry = '') { $warning['warning'] = $type; $warning['entry'] = $entry; $warning['wholeentry'] = $wholeentry; $this->warnings[] = $warning; }
php
function _generateWarning($type, $entry, $wholeentry = '') { $warning['warning'] = $type; $warning['entry'] = $entry; $warning['wholeentry'] = $wholeentry; $this->warnings[] = $warning; }
[ "function", "_generateWarning", "(", "$", "type", ",", "$", "entry", ",", "$", "wholeentry", "=", "''", ")", "{", "$", "warning", "[", "'warning'", "]", "=", "$", "type", ";", "$", "warning", "[", "'entry'", "]", "=", "$", "entry", ";", "$", "warni...
Generates a warning @access private @param string $type The type of the warning @param string $entry The line of the entry where the warning occurred @param string $wholeentry OPTIONAL The whole entry where the warning occurred
[ "Generates", "a", "warning" ]
train
https://github.com/academic/VipaBibTexBundle/blob/1cd82b0961e1a9fee804a85fd774d1384c3e089b/Helper/Bibtex.php#L888-L894