repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
PHPPowertools/HTML5 | src/PowerTools/HTML5/Parser/UTF8Utils.php | HTML5_Parser_UTF8Utils.countChars | public static function countChars($string) {
// Get the length for the string we need.
if (function_exists('iconv_strlen')) {
return iconv_strlen($string, 'utf-8');
} elseif (function_exists('mb_strlen')) {
return mb_strlen($string, 'utf-8');
} elseif (function_ex... | php | public static function countChars($string) {
// Get the length for the string we need.
if (function_exists('iconv_strlen')) {
return iconv_strlen($string, 'utf-8');
} elseif (function_exists('mb_strlen')) {
return mb_strlen($string, 'utf-8');
} elseif (function_ex... | [
"public",
"static",
"function",
"countChars",
"(",
"$",
"string",
")",
"{",
"// Get the length for the string we need.",
"if",
"(",
"function_exists",
"(",
"'iconv_strlen'",
")",
")",
"{",
"return",
"iconv_strlen",
"(",
"$",
"string",
",",
"'utf-8'",
")",
";",
"... | Count the number of characters in a string.
UTF-8 aware. This will try (in order) iconv,
MB, libxml, and finally a custom counter.
@todo Move this to a general utility class. | [
"Count",
"the",
"number",
"of",
"characters",
"in",
"a",
"string",
"."
] | train | https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/UTF8Utils.php#L133-L148 |
PHPPowertools/HTML5 | src/PowerTools/HTML5/Parser/UTF8Utils.php | HTML5_Parser_UTF8Utils.convertToUTF8 | public static function convertToUTF8($data, $encoding = 'UTF-8') {
/*
* From the HTML5 spec: Given an encoding, the bytes in the input stream must be converted to Unicode characters for the tokeniser, as described by the rules for that encoding, except that the leading U+FEFF BYTE ORDER MARK character,... | php | public static function convertToUTF8($data, $encoding = 'UTF-8') {
/*
* From the HTML5 spec: Given an encoding, the bytes in the input stream must be converted to Unicode characters for the tokeniser, as described by the rules for that encoding, except that the leading U+FEFF BYTE ORDER MARK character,... | [
"public",
"static",
"function",
"convertToUTF8",
"(",
"$",
"data",
",",
"$",
"encoding",
"=",
"'UTF-8'",
")",
"{",
"/*\n * From the HTML5 spec: Given an encoding, the bytes in the input stream must be converted to Unicode characters for the tokeniser, as described by the rules fo... | Convert data from the given encoding to UTF-8.
This has not yet been tested with charactersets other than UTF-8.
It should work with ISO-8859-1/-13 and standard Latin Win charsets.
@param string $data
The data to convert.
@param string $encoding
A valid encoding. Examples: http://www.php.net/manual/en/mbstring.suppor... | [
"Convert",
"data",
"from",
"the",
"given",
"encoding",
"to",
"UTF",
"-",
"8",
"."
] | train | https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/UTF8Utils.php#L161-L204 |
PHPPowertools/HTML5 | src/PowerTools/HTML5/Parser/UTF8Utils.php | HTML5_Parser_UTF8Utils.checkForIllegalCodepoints | public static function checkForIllegalCodepoints($data) {
if (!function_exists('preg_match_all')) {
throw HTML5_Exception('The PCRE library is not loaded or is not available.');
}
// Vestigal error handling.
$errors = array();
/*
* All U+0000 null character... | php | public static function checkForIllegalCodepoints($data) {
if (!function_exists('preg_match_all')) {
throw HTML5_Exception('The PCRE library is not loaded or is not available.');
}
// Vestigal error handling.
$errors = array();
/*
* All U+0000 null character... | [
"public",
"static",
"function",
"checkForIllegalCodepoints",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"!",
"function_exists",
"(",
"'preg_match_all'",
")",
")",
"{",
"throw",
"HTML5_Exception",
"(",
"'The PCRE library is not loaded or is not available.'",
")",
";",
"}",... | Checks for Unicode code points that are not valid in a document.
@param string $data
A string to analyze.
@return array An array of (string) error messages produced by the scanning. | [
"Checks",
"for",
"Unicode",
"code",
"points",
"that",
"are",
"not",
"valid",
"in",
"a",
"document",
"."
] | train | https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/UTF8Utils.php#L213-L251 |
wplibs/rules | src/Rule.php | Rule.apply | public function apply( $context ) {
if ( ! $context instanceof RContext ) {
$context = new Context( $context );
}
return $this->evaluate( $context );
} | php | public function apply( $context ) {
if ( ! $context instanceof RContext ) {
$context = new Context( $context );
}
return $this->evaluate( $context );
} | [
"public",
"function",
"apply",
"(",
"$",
"context",
")",
"{",
"if",
"(",
"!",
"$",
"context",
"instanceof",
"RContext",
")",
"{",
"$",
"context",
"=",
"new",
"Context",
"(",
"$",
"context",
")",
";",
"}",
"return",
"$",
"this",
"->",
"evaluate",
"(",... | Evaluate the Rule with the given Context.
@param \Ruler\Context|array $context Context with which to evaluate this Rule.
@return boolean | [
"Evaluate",
"the",
"Rule",
"with",
"the",
"given",
"Context",
"."
] | train | https://github.com/wplibs/rules/blob/29b4495e2ae87349fd64fcd844f3ba96cc268e3d/src/Rule.php#L31-L37 |
Eresus/EresusCMS | src/core/classes/WebPage.php | HtmlElement.getAttribute | public function getAttribute($name)
{
if (!isset($this->attrs[$name]))
{
return null;
}
return $this->attrs[$name];
} | php | public function getAttribute($name)
{
if (!isset($this->attrs[$name]))
{
return null;
}
return $this->attrs[$name];
} | [
"public",
"function",
"getAttribute",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"attrs",
"[",
"$",
"name",
"]",
")",
")",
"{",
"return",
"null",
";",
"}",
"return",
"$",
"this",
"->",
"attrs",
"[",
"$",
"name",
... | Возвращает значение атрибута
@param string $name имя атрибута
@return mixed
@since 2.15 | [
"Возвращает",
"значение",
"атрибута"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/classes/WebPage.php#L97-L105 |
Eresus/EresusCMS | src/core/classes/WebPage.php | HtmlElement.getHTML | public function getHTML()
{
// Открывающий тег
$html = '<' . $this->tagName;
/* Добавляем атрибуты */
foreach ($this->attrs as $name => $value)
{
$html .= ' ' . $name;
if ($value !== true)
{
$html .= '="' . $value . '"';
... | php | public function getHTML()
{
// Открывающий тег
$html = '<' . $this->tagName;
/* Добавляем атрибуты */
foreach ($this->attrs as $name => $value)
{
$html .= ' ' . $name;
if ($value !== true)
{
$html .= '="' . $value . '"';
... | [
"public",
"function",
"getHTML",
"(",
")",
"{",
"// Открывающий тег",
"$",
"html",
"=",
"'<'",
".",
"$",
"this",
"->",
"tagName",
";",
"/* Добавляем атрибуты */",
"foreach",
"(",
"$",
"this",
"->",
"attrs",
"as",
"$",
"name",
"=>",
"$",
"value",
")",
"{"... | Возвращает разметку элемента
@return string разметка HTML
@since 2.15 | [
"Возвращает",
"разметку",
"элемента"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/classes/WebPage.php#L130-L155 |
Eresus/EresusCMS | src/core/classes/WebPage.php | WebPage.url | public function url($args = array())
{
global $Eresus;
/* Объединяем аргументы метода и аргументы текущего запроса */
$args = array_merge($Eresus->request['arg'], $args);
/* Превращаем значения-массивы в строки, соединяя элементы запятой */
foreach ($args as $key => $value)... | php | public function url($args = array())
{
global $Eresus;
/* Объединяем аргументы метода и аргументы текущего запроса */
$args = array_merge($Eresus->request['arg'], $args);
/* Превращаем значения-массивы в строки, соединяя элементы запятой */
foreach ($args as $key => $value)... | [
"public",
"function",
"url",
"(",
"$",
"args",
"=",
"array",
"(",
")",
")",
"{",
"global",
"$",
"Eresus",
";",
"/* Объединяем аргументы метода и аргументы текущего запроса */",
"$",
"args",
"=",
"array_merge",
"(",
"$",
"Eresus",
"->",
"request",
"[",
"'arg'",
... | Строит URL GET-запроса на основе переданных аргументов
URL будет состоять из двух частей:
1. Адрес текущего раздела ($Eresus->request['path'])
2. key=value аргументы
Список аргументов составляется объединением списка аргументов текущего запроса
и элементов массива $args. Элементы $args имеют приоритет над аргументами... | [
"Строит",
"URL",
"GET",
"-",
"запроса",
"на",
"основе",
"переданных",
"аргументов"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/classes/WebPage.php#L307-L335 |
Eresus/EresusCMS | src/core/classes/WebPage.php | WebPage.clientURL | public function clientURL($id)
{
$parents = Eresus_CMS::getLegacyKernel()->sections->parents($id);
if (is_null($parents))
{
return null;
}
array_push($parents, $id);
$items = Eresus_CMS::getLegacyKernel()->sections->get( $parents);
$list = array... | php | public function clientURL($id)
{
$parents = Eresus_CMS::getLegacyKernel()->sections->parents($id);
if (is_null($parents))
{
return null;
}
array_push($parents, $id);
$items = Eresus_CMS::getLegacyKernel()->sections->get( $parents);
$list = array... | [
"public",
"function",
"clientURL",
"(",
"$",
"id",
")",
"{",
"$",
"parents",
"=",
"Eresus_CMS",
"::",
"getLegacyKernel",
"(",
")",
"->",
"sections",
"->",
"parents",
"(",
"$",
"id",
")",
";",
"if",
"(",
"is_null",
"(",
"$",
"parents",
")",
")",
"{",
... | Возвращает клиентский URL страницы с идентификатором $id
@param int $id Идентификатор страницы
@return string URL страницы или NULL если раздела $id не существует
@since 2.10 | [
"Возвращает",
"клиентский",
"URL",
"страницы",
"с",
"идентификатором",
"$id"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/classes/WebPage.php#L346-L370 |
Eresus/EresusCMS | src/core/classes/WebPage.php | WebPage.pageSelector | public function pageSelector($total, $current, $url = null, $templates = null)
{
# Загрузка шаблонов
if (!is_array($templates))
{
$templates = array();
}
for ($i=0; $i < 5; $i++)
{
if (!isset($templates[$i]))
{
$temp... | php | public function pageSelector($total, $current, $url = null, $templates = null)
{
# Загрузка шаблонов
if (!is_array($templates))
{
$templates = array();
}
for ($i=0; $i < 5; $i++)
{
if (!isset($templates[$i]))
{
$temp... | [
"public",
"function",
"pageSelector",
"(",
"$",
"total",
",",
"$",
"current",
",",
"$",
"url",
"=",
"null",
",",
"$",
"templates",
"=",
"null",
")",
"{",
"# Загрузка шаблонов",
"if",
"(",
"!",
"is_array",
"(",
"$",
"templates",
")",
")",
"{",
"$",
"t... | Отрисовка переключателя страниц
@param int $total Общее количество страниц
@param int $current Номер текущей страницы
@param string $url Шаблон адреса для перехода к подстранице
@param array $templates Шаблоны оформления
@return string
@since 2.10
@deprecated с 3.01 используйте {@link Pagi... | [
"Отрисовка",
"переключателя",
"страниц"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/classes/WebPage.php#L385-L449 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/tools.php | ezcMailTools.composeEmailAddress | public static function composeEmailAddress( ezcMailAddress $item )
{
$name = trim( $item->name );
if ( $name !== '' )
{
// remove the quotes around the name part if they are already there
if ( $name{0} === '"' && $name{strlen( $name ) - 1} === '"' )
{
... | php | public static function composeEmailAddress( ezcMailAddress $item )
{
$name = trim( $item->name );
if ( $name !== '' )
{
// remove the quotes around the name part if they are already there
if ( $name{0} === '"' && $name{strlen( $name ) - 1} === '"' )
{
... | [
"public",
"static",
"function",
"composeEmailAddress",
"(",
"ezcMailAddress",
"$",
"item",
")",
"{",
"$",
"name",
"=",
"trim",
"(",
"$",
"item",
"->",
"name",
")",
";",
"if",
"(",
"$",
"name",
"!==",
"''",
")",
"{",
"// remove the quotes around the name part... | Returns ezcMailAddress $item as a RFC822 compliant address string.
Example:
<code>
composeEmailAddress( new ezcMailAddress( 'sender@example.com', 'John Doe' ) );
</code>
Returns:
<pre>
John Doe <sender@example.com>
</pre>
The name part of $item will be surrounded by quotes if it contains any of
these characters: , @... | [
"Returns",
"ezcMailAddress",
"$item",
"as",
"a",
"RFC822",
"compliant",
"address",
"string",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/tools.php#L86-L143 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/tools.php | ezcMailTools.composeEmailAddresses | public static function composeEmailAddresses( array $items, $foldLength = null )
{
$textElements = array();
foreach ( $items as $item )
{
$textElements[] = ezcMailTools::composeEmailAddress( $item );
}
if ( $foldLength === null ) // quick version
{
... | php | public static function composeEmailAddresses( array $items, $foldLength = null )
{
$textElements = array();
foreach ( $items as $item )
{
$textElements[] = ezcMailTools::composeEmailAddress( $item );
}
if ( $foldLength === null ) // quick version
{
... | [
"public",
"static",
"function",
"composeEmailAddresses",
"(",
"array",
"$",
"items",
",",
"$",
"foldLength",
"=",
"null",
")",
"{",
"$",
"textElements",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"items",
"as",
"$",
"item",
")",
"{",
"$",
"textE... | Returns the array $items consisting of ezcMailAddress objects
as one RFC822 compliant address string.
Set foldLength to control how many characters each line can have before a line
break is inserted according to the folding rules specified in RFC2822.
@param array(ezcMailAddress) $items
@param int $foldLength
@return... | [
"Returns",
"the",
"array",
"$items",
"consisting",
"of",
"ezcMailAddress",
"objects",
"as",
"one",
"RFC822",
"compliant",
"address",
"string",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/tools.php#L156-L198 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/tools.php | ezcMailTools.parseEmailAddress | public static function parseEmailAddress( $address, $encoding = "mime" )
{
// we don't care about the "group" part of the address since this is not used anywhere
$matches = array();
$pattern = '/<?\"?[a-zA-Z0-9!#\$\%\&\'\*\+\-\/=\?\^_`{\|}~\.]+\"?@[a-zA-Z0-9!#\$\%\&\'\*\+\-\/=\?\^_`{\|}~\.]... | php | public static function parseEmailAddress( $address, $encoding = "mime" )
{
// we don't care about the "group" part of the address since this is not used anywhere
$matches = array();
$pattern = '/<?\"?[a-zA-Z0-9!#\$\%\&\'\*\+\-\/=\?\^_`{\|}~\.]+\"?@[a-zA-Z0-9!#\$\%\&\'\*\+\-\/=\?\^_`{\|}~\.]... | [
"public",
"static",
"function",
"parseEmailAddress",
"(",
"$",
"address",
",",
"$",
"encoding",
"=",
"\"mime\"",
")",
"{",
"// we don't care about the \"group\" part of the address since this is not used anywhere",
"$",
"matches",
"=",
"array",
"(",
")",
";",
"$",
"patt... | Returns an ezcMailAddress object parsed from the address string $address.
You can set the encoding of the name part with the $encoding parameter.
If $encoding is omitted or set to "mime" parseEmailAddress will asume that
the name part is mime encoded.
This method does not perform validation. It will also accept sligh... | [
"Returns",
"an",
"ezcMailAddress",
"object",
"parsed",
"from",
"the",
"address",
"string",
"$address",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/tools.php#L221-L251 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/tools.php | ezcMailTools.parseEmailAddresses | public static function parseEmailAddresses( $addresses, $encoding = "mime" )
{
$addressesArray = array();
$inQuote = false;
$last = 0; // last hit
$length = strlen( $addresses );
for ( $i = 0; $i < $length; $i++ )
{
if ( $addresses[$i] == '"' )
... | php | public static function parseEmailAddresses( $addresses, $encoding = "mime" )
{
$addressesArray = array();
$inQuote = false;
$last = 0; // last hit
$length = strlen( $addresses );
for ( $i = 0; $i < $length; $i++ )
{
if ( $addresses[$i] == '"' )
... | [
"public",
"static",
"function",
"parseEmailAddresses",
"(",
"$",
"addresses",
",",
"$",
"encoding",
"=",
"\"mime\"",
")",
"{",
"$",
"addressesArray",
"=",
"array",
"(",
")",
";",
"$",
"inQuote",
"=",
"false",
";",
"$",
"last",
"=",
"0",
";",
"// last hit... | Returns an array of ezcMailAddress objects parsed from the address string $addresses.
You can set the encoding of the name parts with the $encoding parameter.
If $encoding is omitted or set to "mime" parseEmailAddresses will asume that
the name parts are mime encoded.
Example:
<code>
ezcMailTools::parseEmailAddresses... | [
"Returns",
"an",
"array",
"of",
"ezcMailAddress",
"objects",
"parsed",
"from",
"the",
"address",
"string",
"$addresses",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/tools.php#L269-L302 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/tools.php | ezcMailTools.validateEmailAddress | public static function validateEmailAddress( $address, $checkMxRecords = false )
{
$pattern = '/^((\"[^\"\f\n\r\t\v\b]+\")|([A-Za-z0-9_\!\#\$\%\&\'\*\+\-\~\/\^\`\|\{\}]+(\.[A-Za-z0-9_\!\#\$\%\&\'\*\+\-\~\/\^\`\|\{\}]+)*))@((\[(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0... | php | public static function validateEmailAddress( $address, $checkMxRecords = false )
{
$pattern = '/^((\"[^\"\f\n\r\t\v\b]+\")|([A-Za-z0-9_\!\#\$\%\&\'\*\+\-\~\/\^\`\|\{\}]+(\.[A-Za-z0-9_\!\#\$\%\&\'\*\+\-\~\/\^\`\|\{\}]+)*))@((\[(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0... | [
"public",
"static",
"function",
"validateEmailAddress",
"(",
"$",
"address",
",",
"$",
"checkMxRecords",
"=",
"false",
")",
"{",
"$",
"pattern",
"=",
"'/^((\\\"[^\\\"\\f\\n\\r\\t\\v\\b]+\\\")|([A-Za-z0-9_\\!\\#\\$\\%\\&\\'\\*\\+\\-\\~\\/\\^\\`\\|\\{\\}]+(\\.[A-Za-z0-9_\\!\\#\\$\\%\... | Returns true if $address is a valid email address, false otherwise.
By default it will only validate against the same regular expression
used in ext/filter. It follows
{@link http://www.faqs.org/rfcs/rfc822.html RFC822} and
{@link http://www.faqs.org/rfcs/rfc2822.html RFC2822}.
If $checkMxRecords is true, then an MX ... | [
"Returns",
"true",
"if",
"$address",
"is",
"a",
"valid",
"email",
"address",
"false",
"otherwise",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/tools.php#L362-L383 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/tools.php | ezcMailTools.validateEmailAddressMx | protected static function validateEmailAddressMx( $address )
{
if ( !ezcBaseFeatures::hasFunction( 'getmxrr' ) || !ezcBaseFeatures::hasFunction( 'checkdnsrr' ) )
{
throw new ezcBaseFunctionalityNotSupportedException( 'Checking DNS records', 'getmxrr() or checkdnsrr() missing' );
... | php | protected static function validateEmailAddressMx( $address )
{
if ( !ezcBaseFeatures::hasFunction( 'getmxrr' ) || !ezcBaseFeatures::hasFunction( 'checkdnsrr' ) )
{
throw new ezcBaseFunctionalityNotSupportedException( 'Checking DNS records', 'getmxrr() or checkdnsrr() missing' );
... | [
"protected",
"static",
"function",
"validateEmailAddressMx",
"(",
"$",
"address",
")",
"{",
"if",
"(",
"!",
"ezcBaseFeatures",
"::",
"hasFunction",
"(",
"'getmxrr'",
")",
"||",
"!",
"ezcBaseFeatures",
"::",
"hasFunction",
"(",
"'checkdnsrr'",
")",
")",
"{",
"t... | Checks if the email address $address is valid based on its MX records.
Steps:
- the MX records are fetched for the domain part of $address, along with
their weights
- the MX records are sorted based on the weights
- for each MX record a connection is open
- a test mail (RCPT TO) is tried to be sent to $address
- if on... | [
"Checks",
"if",
"the",
"email",
"address",
"$address",
"is",
"valid",
"based",
"on",
"its",
"MX",
"records",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/tools.php#L412-L489 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/tools.php | ezcMailTools.generateMessageId | public static function generateMessageId( $hostname )
{
if ( strpos( $hostname, '@' ) !== false )
{
$hostname = strstr( $hostname, '@' );
}
else
{
$hostname = '@' . $hostname;
}
return date( 'YmdGHjs' ) . '.' . getmypid() . '.' . self::... | php | public static function generateMessageId( $hostname )
{
if ( strpos( $hostname, '@' ) !== false )
{
$hostname = strstr( $hostname, '@' );
}
else
{
$hostname = '@' . $hostname;
}
return date( 'YmdGHjs' ) . '.' . getmypid() . '.' . self::... | [
"public",
"static",
"function",
"generateMessageId",
"(",
"$",
"hostname",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"hostname",
",",
"'@'",
")",
"!==",
"false",
")",
"{",
"$",
"hostname",
"=",
"strstr",
"(",
"$",
"hostname",
",",
"'@'",
")",
";",
"}"... | Returns an unique message ID to be used for a mail message.
The hostname $hostname will be added to the unique ID as required by RFC822.
If an e-mail address is provided instead, the hostname is extracted and used.
The formula to generate the message ID is: [time_and_date].[process_id].[counter]
@param string $hostn... | [
"Returns",
"an",
"unique",
"message",
"ID",
"to",
"be",
"used",
"for",
"a",
"mail",
"message",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/tools.php#L502-L513 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/tools.php | ezcMailTools.mimeDecode | public static function mimeDecode( $text, $charset = 'utf-8' )
{
$origtext = $text;
$text = @iconv_mime_decode( $text, 0, $charset );
if ( $text !== false )
{
return $text;
}
// something went wrong while decoding, let's see if we can fix it
// Tr... | php | public static function mimeDecode( $text, $charset = 'utf-8' )
{
$origtext = $text;
$text = @iconv_mime_decode( $text, 0, $charset );
if ( $text !== false )
{
return $text;
}
// something went wrong while decoding, let's see if we can fix it
// Tr... | [
"public",
"static",
"function",
"mimeDecode",
"(",
"$",
"text",
",",
"$",
"charset",
"=",
"'utf-8'",
")",
"{",
"$",
"origtext",
"=",
"$",
"text",
";",
"$",
"text",
"=",
"@",
"iconv_mime_decode",
"(",
"$",
"text",
",",
"0",
",",
"$",
"charset",
")",
... | Decodes mime encoded fields and tries to recover from errors.
Decodes the $text encoded as a MIME string to the $charset. In case the
strict conversion fails this method tries to workaround the issues by
trying to "fix" the original $text before trying to convert it.
@param string $text
@param string $charset
@return... | [
"Decodes",
"mime",
"encoded",
"fields",
"and",
"tries",
"to",
"recover",
"from",
"errors",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/tools.php#L568-L604 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/tools.php | ezcMailTools.replyToMail | static public function replyToMail( ezcMail $mail, ezcMailAddress $from,
$type = self::REPLY_SENDER, $subjectPrefix = "Re: ",
$mailClass = "ezcMail" )
{
$reply = new $mailClass();
$reply->from = $from;
// To = R... | php | static public function replyToMail( ezcMail $mail, ezcMailAddress $from,
$type = self::REPLY_SENDER, $subjectPrefix = "Re: ",
$mailClass = "ezcMail" )
{
$reply = new $mailClass();
$reply->from = $from;
// To = R... | [
"static",
"public",
"function",
"replyToMail",
"(",
"ezcMail",
"$",
"mail",
",",
"ezcMailAddress",
"$",
"from",
",",
"$",
"type",
"=",
"self",
"::",
"REPLY_SENDER",
",",
"$",
"subjectPrefix",
"=",
"\"Re: \"",
",",
"$",
"mailClass",
"=",
"\"ezcMail\"",
")",
... | Returns a new mail object that is a reply to the current object.
The new mail will have the correct to, cc, bcc and reference headers set.
It will not have any body set.
By default the reply will only be sent to the sender of the original mail.
If $type is set to REPLY_ALL, all the original recipients will be include... | [
"Returns",
"a",
"new",
"mail",
"object",
"that",
"is",
"a",
"reply",
"to",
"the",
"current",
"object",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/tools.php#L626-L689 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/tools.php | ezcMailTools.guessContentType | static public function guessContentType( $fileName, &$contentType, &$mimeType )
{
$extension = strtolower( pathinfo( $fileName, PATHINFO_EXTENSION ) );
switch ( $extension )
{
case 'gif':
$contentType = 'image';
$mimeType = 'gif';
b... | php | static public function guessContentType( $fileName, &$contentType, &$mimeType )
{
$extension = strtolower( pathinfo( $fileName, PATHINFO_EXTENSION ) );
switch ( $extension )
{
case 'gif':
$contentType = 'image';
$mimeType = 'gif';
b... | [
"static",
"public",
"function",
"guessContentType",
"(",
"$",
"fileName",
",",
"&",
"$",
"contentType",
",",
"&",
"$",
"mimeType",
")",
"{",
"$",
"extension",
"=",
"strtolower",
"(",
"pathinfo",
"(",
"$",
"fileName",
",",
"PATHINFO_EXTENSION",
")",
")",
";... | Guesses the content and mime type by using the file extension.
The content and mime types are returned through the $contentType
and $mimeType arguments.
For the moment only for image files.
@param string $fileName
@param string $contentType
@param string $mimeType | [
"Guesses",
"the",
"content",
"and",
"mime",
"type",
"by",
"using",
"the",
"file",
"extension",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/tools.php#L702-L739 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/tools.php | ezcMailTools.replaceContentIdRefs | static function replaceContentIdRefs( $htmlText, $contentIdArray )
{
preg_match_all( '@src=[\'"](cid:(.*?))[\'"]@', $htmlText, $matches );
for ( $i = 0; $i < count( $matches[0] ); $i++ )
{
if ( isset( $contentIdArray[$matches[2][$i]] ) )
{
$htmlText = ... | php | static function replaceContentIdRefs( $htmlText, $contentIdArray )
{
preg_match_all( '@src=[\'"](cid:(.*?))[\'"]@', $htmlText, $matches );
for ( $i = 0; $i < count( $matches[0] ); $i++ )
{
if ( isset( $contentIdArray[$matches[2][$i]] ) )
{
$htmlText = ... | [
"static",
"function",
"replaceContentIdRefs",
"(",
"$",
"htmlText",
",",
"$",
"contentIdArray",
")",
"{",
"preg_match_all",
"(",
"'@src=[\\'\"](cid:(.*?))[\\'\"]@'",
",",
"$",
"htmlText",
",",
"$",
"matches",
")",
";",
"for",
"(",
"$",
"i",
"=",
"0",
";",
"$... | Replaces HTML embedded "cid:" references with replacements from $contentIdArray.
The method matches all "cid:" references in the $htmlText and then loops
over each match. For each match the found content ID is looked-up as key
in the $contentIdArray and the value is then inserted as replacement for
the "cid:" referenc... | [
"Replaces",
"HTML",
"embedded",
"cid",
":",
"references",
"with",
"replacements",
"from",
"$contentIdArray",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/tools.php#L770-L781 |
robrogers3/laraldap-auth | src/LdapUserProvider.php | LdapUserProvider.retrieveByToken | public function retrieveByToken($identifier, $token)
{
$model = $this->createModel();
return $model->newQuery()
->where($model->getAuthIdentifierName(), $identifier)
->where($model->getRememberTokenName(), $token)
->first();
} | php | public function retrieveByToken($identifier, $token)
{
$model = $this->createModel();
return $model->newQuery()
->where($model->getAuthIdentifierName(), $identifier)
->where($model->getRememberTokenName(), $token)
->first();
} | [
"public",
"function",
"retrieveByToken",
"(",
"$",
"identifier",
",",
"$",
"token",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"createModel",
"(",
")",
";",
"return",
"$",
"model",
"->",
"newQuery",
"(",
")",
"->",
"where",
"(",
"$",
"model",
"-... | Retrieve a user by their unique identifier and "remember me" token.
@param mixed $identifier
@param string $token
@return \Illuminate\Contracts\Auth\Authenticatable|null | [
"Retrieve",
"a",
"user",
"by",
"their",
"unique",
"identifier",
"and",
"remember",
"me",
"token",
"."
] | train | https://github.com/robrogers3/laraldap-auth/blob/f1b8d001f8b230389c7fbc5fdd59e39663d8ad36/src/LdapUserProvider.php#L99-L107 |
robrogers3/laraldap-auth | src/LdapUserProvider.php | LdapUserProvider.retrieveByCredentials | public function retrieveByCredentials(array $credentials)
{
if (empty($credentials)) {
return null;
}
$query = $this->createModel()->newQuery();
// Append the domain name to user's credentials if not set
// stores the email in the DB for potential usage like no... | php | public function retrieveByCredentials(array $credentials)
{
if (empty($credentials)) {
return null;
}
$query = $this->createModel()->newQuery();
// Append the domain name to user's credentials if not set
// stores the email in the DB for potential usage like no... | [
"public",
"function",
"retrieveByCredentials",
"(",
"array",
"$",
"credentials",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"credentials",
")",
")",
"{",
"return",
"null",
";",
"}",
"$",
"query",
"=",
"$",
"this",
"->",
"createModel",
"(",
")",
"->",
"new... | Retrieve a user by the given credentials.
@param array $credentials
@return \Illuminate\Contracts\Auth\Authenticatable|null | [
"Retrieve",
"a",
"user",
"by",
"the",
"given",
"credentials",
"."
] | train | https://github.com/robrogers3/laraldap-auth/blob/f1b8d001f8b230389c7fbc5fdd59e39663d8ad36/src/LdapUserProvider.php#L129-L155 |
robrogers3/laraldap-auth | src/LdapUserProvider.php | LdapUserProvider.validateCredentials | public function validateCredentials(Authenticatable $user, array $credentials)
{
//TODO determine if we even want to store the passowrd.
if (! $this->authenticate($user, $credentials)) {
$plain = $credentials['password'];
return $this->hasher->check($plain, $user->getAuthPa... | php | public function validateCredentials(Authenticatable $user, array $credentials)
{
//TODO determine if we even want to store the passowrd.
if (! $this->authenticate($user, $credentials)) {
$plain = $credentials['password'];
return $this->hasher->check($plain, $user->getAuthPa... | [
"public",
"function",
"validateCredentials",
"(",
"Authenticatable",
"$",
"user",
",",
"array",
"$",
"credentials",
")",
"{",
"//TODO determine if we even want to store the passowrd.",
"if",
"(",
"!",
"$",
"this",
"->",
"authenticate",
"(",
"$",
"user",
",",
"$",
... | Validate a user against the given credentials.
@param \Illuminate\Contracts\Auth\Authenticatable $user
@param array $credentials
@return bool | [
"Validate",
"a",
"user",
"against",
"the",
"given",
"credentials",
"."
] | train | https://github.com/robrogers3/laraldap-auth/blob/f1b8d001f8b230389c7fbc5fdd59e39663d8ad36/src/LdapUserProvider.php#L164-L174 |
robrogers3/laraldap-auth | src/LdapUserProvider.php | LdapUserProvider.authenticate | public function authenticate(Authenticatable $user, array $credentials)
{
$handler = ldap_connect($this->host);
if (! $handler) {
throw new RuntimeException("Connection fail! Check your server address: '{$this->host}'.");
}
try {
ldap_set_option($handler, L... | php | public function authenticate(Authenticatable $user, array $credentials)
{
$handler = ldap_connect($this->host);
if (! $handler) {
throw new RuntimeException("Connection fail! Check your server address: '{$this->host}'.");
}
try {
ldap_set_option($handler, L... | [
"public",
"function",
"authenticate",
"(",
"Authenticatable",
"$",
"user",
",",
"array",
"$",
"credentials",
")",
"{",
"$",
"handler",
"=",
"ldap_connect",
"(",
"$",
"this",
"->",
"host",
")",
";",
"if",
"(",
"!",
"$",
"handler",
")",
"{",
"throw",
"ne... | Check user's credentials against LDAP server.
@param Authenticatable $user
@param array $credentials
@return bool | [
"Check",
"user",
"s",
"credentials",
"against",
"LDAP",
"server",
"."
] | train | https://github.com/robrogers3/laraldap-auth/blob/f1b8d001f8b230389c7fbc5fdd59e39663d8ad36/src/LdapUserProvider.php#L183-L219 |
phpnfe/tools | src/Certificado/Oids.php | Oids.getOid | public static function getOid($key)
{
if (isset(self::$oidsTable[$key])) {
return self::$oidsTable[$key];
}
return false;
} | php | public static function getOid($key)
{
if (isset(self::$oidsTable[$key])) {
return self::$oidsTable[$key];
}
return false;
} | [
"public",
"static",
"function",
"getOid",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"isset",
"(",
"self",
"::",
"$",
"oidsTable",
"[",
"$",
"key",
"]",
")",
")",
"{",
"return",
"self",
"::",
"$",
"oidsTable",
"[",
"$",
"key",
"]",
";",
"}",
"return",... | getOid.
@param type $key
@return mixed | [
"getOid",
"."
] | train | https://github.com/phpnfe/tools/blob/303ca311989e0b345071f61b71d2b3bf7ee80454/src/Certificado/Oids.php#L878-L885 |
willhoffmann/domuserp-php | src/Resources/Companies/Companies.php | Companies.getList | public function getList(array $query = [])
{
$list = $this->execute(self::HTTP_GET, self::DOMUSERP_API_PEDIDOVENDA . '/empresas');
return $list;
} | php | public function getList(array $query = [])
{
$list = $this->execute(self::HTTP_GET, self::DOMUSERP_API_PEDIDOVENDA . '/empresas');
return $list;
} | [
"public",
"function",
"getList",
"(",
"array",
"$",
"query",
"=",
"[",
"]",
")",
"{",
"$",
"list",
"=",
"$",
"this",
"->",
"execute",
"(",
"self",
"::",
"HTTP_GET",
",",
"self",
"::",
"DOMUSERP_API_PEDIDOVENDA",
".",
"'/empresas'",
")",
";",
"return",
... | List of companies
@param array $query
@return array|string
@throws \GuzzleHttp\Exception\GuzzleException | [
"List",
"of",
"companies"
] | train | https://github.com/willhoffmann/domuserp-php/blob/44e77a4f02b0252bc26cae4c0e6b2b7d578f10a6/src/Resources/Companies/Companies.php#L18-L23 |
wilgucki/php-csv | src/Writer.php | Writer.flush | public function flush()
{
rewind($this->handle);
$out = stream_get_contents($this->handle);
fseek($this->handle, 0, SEEK_END);
return $out;
} | php | public function flush()
{
rewind($this->handle);
$out = stream_get_contents($this->handle);
fseek($this->handle, 0, SEEK_END);
return $out;
} | [
"public",
"function",
"flush",
"(",
")",
"{",
"rewind",
"(",
"$",
"this",
"->",
"handle",
")",
";",
"$",
"out",
"=",
"stream_get_contents",
"(",
"$",
"this",
"->",
"handle",
")",
";",
"fseek",
"(",
"$",
"this",
"->",
"handle",
",",
"0",
",",
"SEEK_... | Output all written data as string.
@return string | [
"Output",
"all",
"written",
"data",
"as",
"string",
"."
] | train | https://github.com/wilgucki/php-csv/blob/a6759ecc2ee42348f989dce0688f6c9dd02b1b96/src/Writer.php#L60-L66 |
wilgucki/php-csv | src/Writer.php | Writer.write | private function write(array $row)
{
if ($this->encodingFrom !== null && $this->encodingTo !== null) {
foreach ($row as $k => $v) {
$row[$k] = iconv($this->encodingFrom, $this->encodingTo, $v);
}
}
return fputcsv($this->handle, $row, $this->delimiter,... | php | private function write(array $row)
{
if ($this->encodingFrom !== null && $this->encodingTo !== null) {
foreach ($row as $k => $v) {
$row[$k] = iconv($this->encodingFrom, $this->encodingTo, $v);
}
}
return fputcsv($this->handle, $row, $this->delimiter,... | [
"private",
"function",
"write",
"(",
"array",
"$",
"row",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"encodingFrom",
"!==",
"null",
"&&",
"$",
"this",
"->",
"encodingTo",
"!==",
"null",
")",
"{",
"foreach",
"(",
"$",
"row",
"as",
"$",
"k",
"=>",
"$",
... | Wrapper for fputcsv function
@param array $row
@return bool|int | [
"Wrapper",
"for",
"fputcsv",
"function"
] | train | https://github.com/wilgucki/php-csv/blob/a6759ecc2ee42348f989dce0688f6c9dd02b1b96/src/Writer.php#L74-L83 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/utilities.php | ezcDbUtilities.createTemporaryTable | public function createTemporaryTable( $tableName, $tableDefinition )
{
$tableName = str_replace( '%', '', $tableName );
$tableName = $this->getPrefixedTableNames($tableName);
$this->db->exec( "CREATE TEMPORARY TABLE $tableName ($tableDefinition)" );
return $tableName;
} | php | public function createTemporaryTable( $tableName, $tableDefinition )
{
$tableName = str_replace( '%', '', $tableName );
$tableName = $this->getPrefixedTableNames($tableName);
$this->db->exec( "CREATE TEMPORARY TABLE $tableName ($tableDefinition)" );
return $tableName;
} | [
"public",
"function",
"createTemporaryTable",
"(",
"$",
"tableName",
",",
"$",
"tableDefinition",
")",
"{",
"$",
"tableName",
"=",
"str_replace",
"(",
"'%'",
",",
"''",
",",
"$",
"tableName",
")",
";",
"$",
"tableName",
"=",
"$",
"this",
"->",
"getPrefixed... | Create temporary table.
Developers should use this method rather than creating temporary
tables by hand, executing the appropriate SQL queries.
If the specified table name contains percent character (%)
then it might be substituted with a unique number by some handlers.
For example, Oracle handler does this to guaran... | [
"Create",
"temporary",
"table",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/utilities.php#L69-L75 |
AOEpeople/Aoe_Layout | app/code/local/Aoe/Layout/Helper/AbstractModelManager.php | Aoe_Layout_Helper_AbstractModelManager.getEditUrl | public function getEditUrl($model = null)
{
if (!$model instanceof Mage_Core_Model_Abstract) {
$model = $this->getCurrentRecord();
} else {
$expectedClass = get_class($this->getModel());
if (!is_a($model, $expectedClass)) {
throw new RuntimeExcepti... | php | public function getEditUrl($model = null)
{
if (!$model instanceof Mage_Core_Model_Abstract) {
$model = $this->getCurrentRecord();
} else {
$expectedClass = get_class($this->getModel());
if (!is_a($model, $expectedClass)) {
throw new RuntimeExcepti... | [
"public",
"function",
"getEditUrl",
"(",
"$",
"model",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"model",
"instanceof",
"Mage_Core_Model_Abstract",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"getCurrentRecord",
"(",
")",
";",
"}",
"else",
"{",
"... | @param Mage_Core_Model_Abstract $model
@return string
@throws RuntimeException | [
"@param",
"Mage_Core_Model_Abstract",
"$model"
] | train | https://github.com/AOEpeople/Aoe_Layout/blob/d88ba3406cf12dbaf09548477133c3cb27d155ed/app/code/local/Aoe/Layout/Helper/AbstractModelManager.php#L44-L60 |
AOEpeople/Aoe_Layout | app/code/local/Aoe/Layout/Helper/AbstractModelManager.php | Aoe_Layout_Helper_AbstractModelManager.getDeleteUrl | public function getDeleteUrl($model = null)
{
if (!$model instanceof Mage_Core_Model_Abstract) {
$model = $this->getCurrentRecord();
} else {
$expectedClass = get_class($this->getModel());
if (!is_a($model, $expectedClass)) {
throw new RuntimeExcep... | php | public function getDeleteUrl($model = null)
{
if (!$model instanceof Mage_Core_Model_Abstract) {
$model = $this->getCurrentRecord();
} else {
$expectedClass = get_class($this->getModel());
if (!is_a($model, $expectedClass)) {
throw new RuntimeExcep... | [
"public",
"function",
"getDeleteUrl",
"(",
"$",
"model",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"model",
"instanceof",
"Mage_Core_Model_Abstract",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"getCurrentRecord",
"(",
")",
";",
"}",
"else",
"{",
... | @param Mage_Core_Model_Abstract $model
@return string
@throws RuntimeException | [
"@param",
"Mage_Core_Model_Abstract",
"$model"
] | train | https://github.com/AOEpeople/Aoe_Layout/blob/d88ba3406cf12dbaf09548477133c3cb27d155ed/app/code/local/Aoe/Layout/Helper/AbstractModelManager.php#L77-L89 |
lukasz-adamski/teamspeak3-framework | src/TeamSpeak3/Transport.php | Transport.getAdapterType | public function getAdapterType()
{
if($this->adapter instanceof Adapter)
{
$string = Str::factory(get_class($this->adapter));
return $string->substr($string->findLast("_"))->replace(array("_", " "), "")->toString();
}
return "Unknown";
} | php | public function getAdapterType()
{
if($this->adapter instanceof Adapter)
{
$string = Str::factory(get_class($this->adapter));
return $string->substr($string->findLast("_"))->replace(array("_", " "), "")->toString();
}
return "Unknown";
} | [
"public",
"function",
"getAdapterType",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"adapter",
"instanceof",
"Adapter",
")",
"{",
"$",
"string",
"=",
"Str",
"::",
"factory",
"(",
"get_class",
"(",
"$",
"this",
"->",
"adapter",
")",
")",
";",
"return",... | Returns the adapter type.
@return string | [
"Returns",
"the",
"adapter",
"type",
"."
] | train | https://github.com/lukasz-adamski/teamspeak3-framework/blob/39a56eca608da6b56b6aa386a7b5b31dc576c41a/src/TeamSpeak3/Transport.php#L211-L221 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Adapters/ZendFramework/PluginProxy.php | Dwoo_Adapters_ZendFramework_PluginProxy.handles | public function handles($name) {
try {
$this->view->getHelper($name);
} catch (Zend_Loader_PluginLoader_Exception $e) {
return false;
}
return true;
} | php | public function handles($name) {
try {
$this->view->getHelper($name);
} catch (Zend_Loader_PluginLoader_Exception $e) {
return false;
}
return true;
} | [
"public",
"function",
"handles",
"(",
"$",
"name",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"view",
"->",
"getHelper",
"(",
"$",
"name",
")",
";",
"}",
"catch",
"(",
"Zend_Loader_PluginLoader_Exception",
"$",
"e",
")",
"{",
"return",
"false",
";",
"}",... | Called from Dwoo_Compiler to check if the requested plugin is available
@param string $name
@return bool | [
"Called",
"from",
"Dwoo_Compiler",
"to",
"check",
"if",
"the",
"requested",
"plugin",
"is",
"available"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Adapters/ZendFramework/PluginProxy.php#L43-L51 |
antaresproject/notifications | src/Decorator/SidebarItemDecorator.php | SidebarItemDecorator.decorate | public function decorate(Collection $items, $type = 'notification')
{
$view = config('antares/notifications::templates.' . $type);
if (is_null($view)) {
throw new RuntimeException('Unable to resolve notification partial view.');
}
$return = [];
foreach ($items as ... | php | public function decorate(Collection $items, $type = 'notification')
{
$view = config('antares/notifications::templates.' . $type);
if (is_null($view)) {
throw new RuntimeException('Unable to resolve notification partial view.');
}
$return = [];
foreach ($items as ... | [
"public",
"function",
"decorate",
"(",
"Collection",
"$",
"items",
",",
"$",
"type",
"=",
"'notification'",
")",
"{",
"$",
"view",
"=",
"config",
"(",
"'antares/notifications::templates.'",
".",
"$",
"type",
")",
";",
"if",
"(",
"is_null",
"(",
"$",
"view"... | Decorates notifications of alerts
@param Collection $items
@param String $type
@return array
@throws RuntimeException | [
"Decorates",
"notifications",
"of",
"alerts"
] | train | https://github.com/antaresproject/notifications/blob/60de743477b7e9cbb51de66da5fd9461adc9dd8a/src/Decorator/SidebarItemDecorator.php#L39-L50 |
antaresproject/notifications | src/Decorator/SidebarItemDecorator.php | SidebarItemDecorator.item | public function item(Model $item, $view)
{
$content = $this->getVariablesAdapter()->get($item->content[0]->content, (array) $item->variables);
return view($view, [
'id' => $item->id,
'author' => $item->author,
'title' => $item->content[0]->title,... | php | public function item(Model $item, $view)
{
$content = $this->getVariablesAdapter()->get($item->content[0]->content, (array) $item->variables);
return view($view, [
'id' => $item->id,
'author' => $item->author,
'title' => $item->content[0]->title,... | [
"public",
"function",
"item",
"(",
"Model",
"$",
"item",
",",
"$",
"view",
")",
"{",
"$",
"content",
"=",
"$",
"this",
"->",
"getVariablesAdapter",
"(",
")",
"->",
"get",
"(",
"$",
"item",
"->",
"content",
"[",
"0",
"]",
"->",
"content",
",",
"(",
... | Decorates single item
@param Model $item
@param String $view
@return String | [
"Decorates",
"single",
"item"
] | train | https://github.com/antaresproject/notifications/blob/60de743477b7e9cbb51de66da5fd9461adc9dd8a/src/Decorator/SidebarItemDecorator.php#L59-L71 |
odiaseo/pagebuilder | src/PageBuilder/Model/PageModel.php | PageModel.getActivePages | public function getActivePages($mode = AbstractQuery::HYDRATE_OBJECT)
{
$qb = $this->getEntityManager()->createQueryBuilder();
/** @var $query \Doctrine\ORM\Query */
$query = $qb->select('e')
->from($this->getEntity(), 'e')
->where('e.isVisible = 1')
... | php | public function getActivePages($mode = AbstractQuery::HYDRATE_OBJECT)
{
$qb = $this->getEntityManager()->createQueryBuilder();
/** @var $query \Doctrine\ORM\Query */
$query = $qb->select('e')
->from($this->getEntity(), 'e')
->where('e.isVisible = 1')
... | [
"public",
"function",
"getActivePages",
"(",
"$",
"mode",
"=",
"AbstractQuery",
"::",
"HYDRATE_OBJECT",
")",
"{",
"$",
"qb",
"=",
"$",
"this",
"->",
"getEntityManager",
"(",
")",
"->",
"createQueryBuilder",
"(",
")",
";",
"/** @var $query \\Doctrine\\ORM\\Query */... | @param int $mode
@return array | [
"@param",
"int",
"$mode"
] | train | https://github.com/odiaseo/pagebuilder/blob/88ef7cccf305368561307efe4ca07fac8e5774f3/src/PageBuilder/Model/PageModel.php#L187-L202 |
odiaseo/pagebuilder | src/PageBuilder/Model/PageModel.php | PageModel.getMainPageById | public function getMainPageById($id, $mode = AbstractQuery::HYDRATE_ARRAY)
{
$qb = $this->getEntityManager()->createQueryBuilder();
$qb->select('e.id, t.layout', 'p.id as parentId', 't.id as templateId')
->from($this->getEntity(), 'e')
->leftJoin('e.template', 't')
... | php | public function getMainPageById($id, $mode = AbstractQuery::HYDRATE_ARRAY)
{
$qb = $this->getEntityManager()->createQueryBuilder();
$qb->select('e.id, t.layout', 'p.id as parentId', 't.id as templateId')
->from($this->getEntity(), 'e')
->leftJoin('e.template', 't')
... | [
"public",
"function",
"getMainPageById",
"(",
"$",
"id",
",",
"$",
"mode",
"=",
"AbstractQuery",
"::",
"HYDRATE_ARRAY",
")",
"{",
"$",
"qb",
"=",
"$",
"this",
"->",
"getEntityManager",
"(",
")",
"->",
"createQueryBuilder",
"(",
")",
";",
"$",
"qb",
"->",... | @param $id
@param int $mode
@return mixed
@throws \Doctrine\ORM\NonUniqueResultException | [
"@param",
"$id",
"@param",
"int",
"$mode"
] | train | https://github.com/odiaseo/pagebuilder/blob/88ef7cccf305368561307efe4ca07fac8e5774f3/src/PageBuilder/Model/PageModel.php#L211-L229 |
odiaseo/pagebuilder | src/PageBuilder/Model/PageModel.php | PageModel.getEntityNavigation | public function getEntityNavigation($rootPage = null, $mode = AbstractQuery::HYDRATE_ARRAY, $cacheKey = null)
{
/** @var $repo PageRepository */
$this->setCacheKey($cacheKey);
$repo = $this->getRepository();
$query = $this->addHints($repo->getNodesHierarchyQuery($rootPage));
... | php | public function getEntityNavigation($rootPage = null, $mode = AbstractQuery::HYDRATE_ARRAY, $cacheKey = null)
{
/** @var $repo PageRepository */
$this->setCacheKey($cacheKey);
$repo = $this->getRepository();
$query = $this->addHints($repo->getNodesHierarchyQuery($rootPage));
... | [
"public",
"function",
"getEntityNavigation",
"(",
"$",
"rootPage",
"=",
"null",
",",
"$",
"mode",
"=",
"AbstractQuery",
"::",
"HYDRATE_ARRAY",
",",
"$",
"cacheKey",
"=",
"null",
")",
"{",
"/** @var $repo PageRepository */",
"$",
"this",
"->",
"setCacheKey",
"("... | @param null $rootPage
@param int $mode
@param null $cacheKey
@return mixed | [
"@param",
"null",
"$rootPage",
"@param",
"int",
"$mode",
"@param",
"null",
"$cacheKey"
] | train | https://github.com/odiaseo/pagebuilder/blob/88ef7cccf305368561307efe4ca07fac8e5774f3/src/PageBuilder/Model/PageModel.php#L254-L263 |
old-town/workflow-designer-server | src/View/WorkflowDescriptorApiRenderer.php | WorkflowDescriptorApiRenderer.render | public function render($nameOrModel, $values = null)
{
/** @var WorkflowDescriptor $data */
$data = $this->getRendererData($nameOrModel);
$output = $data->writeXml()->saveXML();
return $output;
} | php | public function render($nameOrModel, $values = null)
{
/** @var WorkflowDescriptor $data */
$data = $this->getRendererData($nameOrModel);
$output = $data->writeXml()->saveXML();
return $output;
} | [
"public",
"function",
"render",
"(",
"$",
"nameOrModel",
",",
"$",
"values",
"=",
"null",
")",
"{",
"/** @var WorkflowDescriptor $data */",
"$",
"data",
"=",
"$",
"this",
"->",
"getRendererData",
"(",
"$",
"nameOrModel",
")",
";",
"$",
"output",
"=",
"$",
... | @param string|\Zend\View\Model\ModelInterface $nameOrModel
@param null $values
@return string
@throws \OldTown\Workflow\Exception\InternalWorkflowException
@throws \OldTown\Workflow\Exception\InvalidDescriptorException
@throws \OldTown\Workflow\Exception\InvalidWriteWorkflowException... | [
"@param",
"string|",
"\\",
"Zend",
"\\",
"View",
"\\",
"Model",
"\\",
"ModelInterface",
"$nameOrModel",
"@param",
"null",
"$values"
] | train | https://github.com/old-town/workflow-designer-server/blob/6389c5a515861cc8e0b769f1ca7be12c6b78c611/src/View/WorkflowDescriptorApiRenderer.php#L87-L96 |
old-town/workflow-designer-server | src/View/WorkflowDescriptorApiRenderer.php | WorkflowDescriptorApiRenderer.getRendererData | protected function getRendererData($nameOrModel)
{
if (!$nameOrModel instanceof WorkflowDescriptorApiModel) {
$errMsg = sprintf('Рендерер поддерживает только %s', WorkflowDescriptorApiModel::class);
throw new Exception\RuntimeException($errMsg);
}
if ($nameOrModel->i... | php | protected function getRendererData($nameOrModel)
{
if (!$nameOrModel instanceof WorkflowDescriptorApiModel) {
$errMsg = sprintf('Рендерер поддерживает только %s', WorkflowDescriptorApiModel::class);
throw new Exception\RuntimeException($errMsg);
}
if ($nameOrModel->i... | [
"protected",
"function",
"getRendererData",
"(",
"$",
"nameOrModel",
")",
"{",
"if",
"(",
"!",
"$",
"nameOrModel",
"instanceof",
"WorkflowDescriptorApiModel",
")",
"{",
"$",
"errMsg",
"=",
"sprintf",
"(",
"'Рендерер поддерживает только %s', WorkflowDescriptorApiMod",
"e... | @param $nameOrModel
@return array|string|ApiProblem
@throws Exception\RuntimeException | [
"@param",
"$nameOrModel"
] | train | https://github.com/old-town/workflow-designer-server/blob/6389c5a515861cc8e0b769f1ca7be12c6b78c611/src/View/WorkflowDescriptorApiRenderer.php#L105-L124 |
endroid/import-bundle | src/DependencyInjection/Compiler/ImporterCompilerPass.php | ImporterCompilerPass.process | public function process(ContainerBuilder $container)
{
$taggedServices = $container->findTaggedServiceIds('endroid.import.importer');
foreach ($taggedServices as $id => $tags) {
foreach ($tags as $attributes) {
$name = $attributes['importer'];
$commandDef... | php | public function process(ContainerBuilder $container)
{
$taggedServices = $container->findTaggedServiceIds('endroid.import.importer');
foreach ($taggedServices as $id => $tags) {
foreach ($tags as $attributes) {
$name = $attributes['importer'];
$commandDef... | [
"public",
"function",
"process",
"(",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"taggedServices",
"=",
"$",
"container",
"->",
"findTaggedServiceIds",
"(",
"'endroid.import.importer'",
")",
";",
"foreach",
"(",
"$",
"taggedServices",
"as",
"$",
"id",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/endroid/import-bundle/blob/637f29720822432192efad6993f505adc9dd4af4/src/DependencyInjection/Compiler/ImporterCompilerPass.php#L25-L38 |
WellCommerce/AppBundle | Controller/Front/CurrencyController.php | CurrencyController.switchAction | public function switchAction(Request $request, string $currency) : RedirectResponse
{
$result = $this->get('currency.repository')->findOneBy(['code' => $currency]);
if (null !== $result) {
$request->getSession()->set('_currency', $currency);
}
return new RedirectResponse... | php | public function switchAction(Request $request, string $currency) : RedirectResponse
{
$result = $this->get('currency.repository')->findOneBy(['code' => $currency]);
if (null !== $result) {
$request->getSession()->set('_currency', $currency);
}
return new RedirectResponse... | [
"public",
"function",
"switchAction",
"(",
"Request",
"$",
"request",
",",
"string",
"$",
"currency",
")",
":",
"RedirectResponse",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"get",
"(",
"'currency.repository'",
")",
"->",
"findOneBy",
"(",
"[",
"'code'",
... | Sets new session currency
@param Request $request
@param string $currency
@return RedirectResponse | [
"Sets",
"new",
"session",
"currency"
] | train | https://github.com/WellCommerce/AppBundle/blob/2add687d1c898dd0b24afd611d896e3811a0eac3/Controller/Front/CurrencyController.php#L34-L42 |
romainbessugesmeusy/php-datagrid | library/RBM/Datagrid/DataGrid.php | DataGrid.addColumn | public function addColumn($name, $accessor = null)
{
$col = new\RBM\Datagrid\Column($this, $name, count($this->_columns), $accessor);
$this->_columns[$name] = $col;
$this->_columnsPositions[] = $name;
return $col;
} | php | public function addColumn($name, $accessor = null)
{
$col = new\RBM\Datagrid\Column($this, $name, count($this->_columns), $accessor);
$this->_columns[$name] = $col;
$this->_columnsPositions[] = $name;
return $col;
} | [
"public",
"function",
"addColumn",
"(",
"$",
"name",
",",
"$",
"accessor",
"=",
"null",
")",
"{",
"$",
"col",
"=",
"new",
"\\",
"RBM",
"\\",
"Datagrid",
"\\",
"Column",
"(",
"$",
"this",
",",
"$",
"name",
",",
"count",
"(",
"$",
"this",
"->",
"_c... | Ajoute une colonne au tableau. Crée un objet de type\RBM\Datagrid\Column et le retourne.
La colonne est par défaut visible.
@assert (null, null) throws InvalidArgumentException
@param $name
@param $accessor
@return\RBM\Datagrid\Column | [
"Ajoute",
"une",
"colonne",
"au",
"tableau",
".",
"Crée",
"un",
"objet",
"de",
"type",
"\\",
"RBM",
"\\",
"Datagrid",
"\\",
"Column",
"et",
"le",
"retourne",
".",
"La",
"colonne",
"est",
"par",
"défaut",
"visible",
"."
] | train | https://github.com/romainbessugesmeusy/php-datagrid/blob/18f7ae15845fcf61520bbfc946771242bf1091c9/library/RBM/Datagrid/DataGrid.php#L88-L94 |
romainbessugesmeusy/php-datagrid | library/RBM/Datagrid/DataGrid.php | DataGrid.getColumn | public function getColumn($columnName)
{
return isset($this->_columns[$columnName]) ? $this->_columns[$columnName] : null;
} | php | public function getColumn($columnName)
{
return isset($this->_columns[$columnName]) ? $this->_columns[$columnName] : null;
} | [
"public",
"function",
"getColumn",
"(",
"$",
"columnName",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"_columns",
"[",
"$",
"columnName",
"]",
")",
"?",
"$",
"this",
"->",
"_columns",
"[",
"$",
"columnName",
"]",
":",
"null",
";",
"}"
] | Récupère un\RBM\Datagrid\Column en fonction de sa position
@assert (null) throws InvalidArgumentException
@assert (true) throws InvalidArgumentException
@assert (-1) throws OutOfRangeException
@param $columnName
@return\RBM\Datagrid\Column|null | [
"Récupère",
"un",
"\\",
"RBM",
"\\",
"Datagrid",
"\\",
"Column",
"en",
"fonction",
"de",
"sa",
"position"
] | train | https://github.com/romainbessugesmeusy/php-datagrid/blob/18f7ae15845fcf61520bbfc946771242bf1091c9/library/RBM/Datagrid/DataGrid.php#L104-L107 |
php-lug/lug | src/Component/Resource/Repository/Doctrine/ORM/RepositoryFactory.php | RepositoryFactory.getRepository | public function getRepository(EntityManagerInterface $entityManager, $entityName)
{
$metadata = $entityManager->getClassMetadata($entityName);
$hash = $metadata->getName().spl_object_hash($entityManager);
if (isset($this->cache[$hash])) {
return $this->cache[$hash];
}
... | php | public function getRepository(EntityManagerInterface $entityManager, $entityName)
{
$metadata = $entityManager->getClassMetadata($entityName);
$hash = $metadata->getName().spl_object_hash($entityManager);
if (isset($this->cache[$hash])) {
return $this->cache[$hash];
}
... | [
"public",
"function",
"getRepository",
"(",
"EntityManagerInterface",
"$",
"entityManager",
",",
"$",
"entityName",
")",
"{",
"$",
"metadata",
"=",
"$",
"entityManager",
"->",
"getClassMetadata",
"(",
"$",
"entityName",
")",
";",
"$",
"hash",
"=",
"$",
"metada... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Resource/Repository/Doctrine/ORM/RepositoryFactory.php#L48-L58 |
php-lug/lug | src/Component/Resource/Repository/Doctrine/ORM/RepositoryFactory.php | RepositoryFactory.createRepository | protected function createRepository(EntityManagerInterface $entityManager, $entityName)
{
$metadata = $entityManager->getClassMetadata($entityName);
$repository = $metadata->customRepositoryClassName;
if ($repository === null) {
$repository = $entityManager->getConfiguration()->... | php | protected function createRepository(EntityManagerInterface $entityManager, $entityName)
{
$metadata = $entityManager->getClassMetadata($entityName);
$repository = $metadata->customRepositoryClassName;
if ($repository === null) {
$repository = $entityManager->getConfiguration()->... | [
"protected",
"function",
"createRepository",
"(",
"EntityManagerInterface",
"$",
"entityManager",
",",
"$",
"entityName",
")",
"{",
"$",
"metadata",
"=",
"$",
"entityManager",
"->",
"getClassMetadata",
"(",
"$",
"entityName",
")",
";",
"$",
"repository",
"=",
"$... | @param EntityManagerInterface $entityManager
@param string $entityName
@return ObjectRepository | [
"@param",
"EntityManagerInterface",
"$entityManager",
"@param",
"string",
"$entityName"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Resource/Repository/Doctrine/ORM/RepositoryFactory.php#L66-L81 |
php-lug/lug | src/Component/Resource/Repository/Doctrine/ORM/RepositoryFactory.php | RepositoryFactory.createResourceRepository | protected function createResourceRepository(
$class,
EntityManagerInterface $entityManager,
ClassMetadata $metadata,
ResourceInterface $resource = null
) {
if ($resource !== null && is_a($class, BaseRepositoryInterface::class, true)) {
return new $class($entityMan... | php | protected function createResourceRepository(
$class,
EntityManagerInterface $entityManager,
ClassMetadata $metadata,
ResourceInterface $resource = null
) {
if ($resource !== null && is_a($class, BaseRepositoryInterface::class, true)) {
return new $class($entityMan... | [
"protected",
"function",
"createResourceRepository",
"(",
"$",
"class",
",",
"EntityManagerInterface",
"$",
"entityManager",
",",
"ClassMetadata",
"$",
"metadata",
",",
"ResourceInterface",
"$",
"resource",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"resource",
"!==",... | @param string $class
@param EntityManagerInterface $entityManager
@param ClassMetadata $metadata
@param ResourceInterface|null $resource
@return ObjectRepository | [
"@param",
"string",
"$class",
"@param",
"EntityManagerInterface",
"$entityManager",
"@param",
"ClassMetadata",
"$metadata",
"@param",
"ResourceInterface|null",
"$resource"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Resource/Repository/Doctrine/ORM/RepositoryFactory.php#L91-L102 |
nabab/bbn | src/bbn/api/cloudmin.php | cloudmin.sanitize | private function sanitize($st){
$st = trim((string)$st);
if ( strpos($st, ';') !== false ){
return '';
}
if ( strpos($st, '<') !== false ){
return '';
}
if ( strpos($st, '"') !== false ){
return '';
}
if ( strpos($st, "'") !== false ){
return '';
}
return ... | php | private function sanitize($st){
$st = trim((string)$st);
if ( strpos($st, ';') !== false ){
return '';
}
if ( strpos($st, '<') !== false ){
return '';
}
if ( strpos($st, '"') !== false ){
return '';
}
if ( strpos($st, "'") !== false ){
return '';
}
return ... | [
"private",
"function",
"sanitize",
"(",
"$",
"st",
")",
"{",
"$",
"st",
"=",
"trim",
"(",
"(",
"string",
")",
"$",
"st",
")",
";",
"if",
"(",
"strpos",
"(",
"$",
"st",
",",
"';'",
")",
"!==",
"false",
")",
"{",
"return",
"''",
";",
"}",
"if",... | This function is used to sanitize the strings which are given as parameters
@param string $st
@return string The the header url part to be executed | [
"This",
"function",
"is",
"used",
"to",
"sanitize",
"the",
"strings",
"which",
"are",
"given",
"as",
"parameters"
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/api/cloudmin.php#L222-L237 |
nabab/bbn | src/bbn/api/cloudmin.php | cloudmin.call_shell_exec | private function call_shell_exec($request){
//Executing the shell_exec
//die(var_dump($this->mode, $request));
if ( $result = shell_exec($request) ){
//Decoding the json result into an array
$result_array = json_decode($result, TRUE);
if ( isset($result_array['error']) ){
$this->er... | php | private function call_shell_exec($request){
//Executing the shell_exec
//die(var_dump($this->mode, $request));
if ( $result = shell_exec($request) ){
//Decoding the json result into an array
$result_array = json_decode($result, TRUE);
if ( isset($result_array['error']) ){
$this->er... | [
"private",
"function",
"call_shell_exec",
"(",
"$",
"request",
")",
"{",
"//Executing the shell_exec",
"//die(var_dump($this->mode, $request));",
"if",
"(",
"$",
"result",
"=",
"shell_exec",
"(",
"$",
"request",
")",
")",
"{",
"//Decoding the json result into an array",
... | Executes the $request using shell_exec
@param string $request the command to be excecuted
@return array an array with the execution status and message | [
"Executes",
"the",
"$request",
"using",
"shell_exec"
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/api/cloudmin.php#L261-L284 |
nabab/bbn | src/bbn/api/cloudmin.php | cloudmin.process_parameters | private function process_parameters($param){
foreach ($param as $key => $val){
//$val is an array
if (\is_array($val)){
$param[$key] = $this->process_parameters($val);
}
else {
$param[$key] = $this->sanitize($val);
}
}
//Return the processed parameters
retur... | php | private function process_parameters($param){
foreach ($param as $key => $val){
//$val is an array
if (\is_array($val)){
$param[$key] = $this->process_parameters($val);
}
else {
$param[$key] = $this->sanitize($val);
}
}
//Return the processed parameters
retur... | [
"private",
"function",
"process_parameters",
"(",
"$",
"param",
")",
"{",
"foreach",
"(",
"$",
"param",
"as",
"$",
"key",
"=>",
"$",
"val",
")",
"{",
"//$val is an array",
"if",
"(",
"\\",
"is_array",
"(",
"$",
"val",
")",
")",
"{",
"$",
"param",
"["... | Sanitize each parameter
@param array $param the raw parameters
@return array the processed parameters | [
"Sanitize",
"each",
"parameter"
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/api/cloudmin.php#L291-L303 |
nabab/bbn | src/bbn/api/cloudmin.php | cloudmin.get_args | public function get_args($name){
if ( $this->checked ){
$cmd_name = str_replace('_', '-', $name);
return isset($this->commands[$cmd_name], $this->commands[$cmd_name]['args']) ? $this->commands[$cmd_name]['args'] : [];
}
} | php | public function get_args($name){
if ( $this->checked ){
$cmd_name = str_replace('_', '-', $name);
return isset($this->commands[$cmd_name], $this->commands[$cmd_name]['args']) ? $this->commands[$cmd_name]['args'] : [];
}
} | [
"public",
"function",
"get_args",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"checked",
")",
"{",
"$",
"cmd_name",
"=",
"str_replace",
"(",
"'_'",
",",
"'-'",
",",
"$",
"name",
")",
";",
"return",
"isset",
"(",
"$",
"this",
"->",
"... | Returns the arguments description of a given command
@param $name The command name
@return array | [
"Returns",
"the",
"arguments",
"description",
"of",
"a",
"given",
"command"
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/api/cloudmin.php#L310-L315 |
nabab/bbn | src/bbn/api/cloudmin.php | cloudmin.list_commands | public function list_commands($param = []){
//Prepping, processing and validating the create user parameters
$param = $this->process_parameters($param);
//Setting the last action performed
$this->last_action = "list-commands";
//Defining the $url_part and the command to be executed
$url_part =... | php | public function list_commands($param = []){
//Prepping, processing and validating the create user parameters
$param = $this->process_parameters($param);
//Setting the last action performed
$this->last_action = "list-commands";
//Defining the $url_part and the command to be executed
$url_part =... | [
"public",
"function",
"list_commands",
"(",
"$",
"param",
"=",
"[",
"]",
")",
"{",
"//Prepping, processing and validating the create user parameters",
"$",
"param",
"=",
"$",
"this",
"->",
"process_parameters",
"(",
"$",
"param",
")",
";",
"//Setting the last action p... | Gets all the commands directly from the API
@param array $param
@return array | [
"Gets",
"all",
"the",
"commands",
"directly",
"from",
"the",
"API"
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/api/cloudmin.php#L333-L354 |
nabab/bbn | src/bbn/api/cloudmin.php | cloudmin.generate | public function generate($command){
$perl_cmd = str_replace('_', '-', $command);
if ( isset($this->commands[$perl_cmd]) ){
$cmd = $this->commands[$perl_cmd];
$st = '$vm->'.$command.'(['.PHP_EOL;
foreach ( $cmd['args'] as $k => $v ){
$st .= "'$k' => ".($v['binary'] ? '0' : "''").PHP_EOL... | php | public function generate($command){
$perl_cmd = str_replace('_', '-', $command);
if ( isset($this->commands[$perl_cmd]) ){
$cmd = $this->commands[$perl_cmd];
$st = '$vm->'.$command.'(['.PHP_EOL;
foreach ( $cmd['args'] as $k => $v ){
$st .= "'$k' => ".($v['binary'] ? '0' : "''").PHP_EOL... | [
"public",
"function",
"generate",
"(",
"$",
"command",
")",
"{",
"$",
"perl_cmd",
"=",
"str_replace",
"(",
"'_'",
",",
"'-'",
",",
"$",
"command",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"commands",
"[",
"$",
"perl_cmd",
"]",
")",
")"... | Returns a string of PHP code for executing a given command with all its possible parameters pre-populated
@param $command
@return bool|string | [
"Returns",
"a",
"string",
"of",
"PHP",
"code",
"for",
"executing",
"a",
"given",
"command",
"with",
"all",
"its",
"possible",
"parameters",
"pre",
"-",
"populated"
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/api/cloudmin.php#L380-L392 |
alevilar/ristorantino-vendor | Printers/Lib/DriverView/Helper/Hasar441FiscalHelper.php | Hasar441FiscalHelper.openFiscalReceipt | public function openFiscalReceipt( $tipo_ticket ){
$tipo_ticket = $this->arrayMapTipoTicket[$tipo_ticket];
return "@".$this->cm('FS').$tipo_ticket.$this->cm('FS')."T";
} | php | public function openFiscalReceipt( $tipo_ticket ){
$tipo_ticket = $this->arrayMapTipoTicket[$tipo_ticket];
return "@".$this->cm('FS').$tipo_ticket.$this->cm('FS')."T";
} | [
"public",
"function",
"openFiscalReceipt",
"(",
"$",
"tipo_ticket",
")",
"{",
"$",
"tipo_ticket",
"=",
"$",
"this",
"->",
"arrayMapTipoTicket",
"[",
"$",
"tipo_ticket",
"]",
";",
"return",
"\"@\"",
".",
"$",
"this",
"->",
"cm",
"(",
"'FS'",
")",
".",
"$"... | Me abre un documento fiscal
@param $tipo_ticket el topo de ticket que quiero abrir
las psobilidades son:
"T": abre un ticket
"A": abre ticket factura 'A'
"B": abre ticket factura 'B' o 'C'
"a": abre recibo 'A'
"b": abre recibo 'B'
"D": Nota de Débito 'A'
"E": Nota de Débito B/C | [
"Me",
"abre",
"un",
"documento",
"fiscal"
] | train | https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Printers/Lib/DriverView/Helper/Hasar441FiscalHelper.php#L47-L51 |
alevilar/ristorantino-vendor | Printers/Lib/DriverView/Helper/Hasar441FiscalHelper.php | Hasar441FiscalHelper.printFiscalText | public function printFiscalText($texto, $doble_ancho = false ,$display = 0){
$texto = substr($texto,0,30);
if($doble_ancho){
$texto = $this->cm('DOBLE_ANCHO').$texto;
}
return "A".$this->cm('FS').$texto.$this->cm('FS').$display;
} | php | public function printFiscalText($texto, $doble_ancho = false ,$display = 0){
$texto = substr($texto,0,30);
if($doble_ancho){
$texto = $this->cm('DOBLE_ANCHO').$texto;
}
return "A".$this->cm('FS').$texto.$this->cm('FS').$display;
} | [
"public",
"function",
"printFiscalText",
"(",
"$",
"texto",
",",
"$",
"doble_ancho",
"=",
"false",
",",
"$",
"display",
"=",
"0",
")",
"{",
"$",
"texto",
"=",
"substr",
"(",
"$",
"texto",
",",
"0",
",",
"30",
")",
";",
"if",
"(",
"$",
"doble_ancho"... | Imprime texto fiscal que se muestra por lo general antes de los articulos.
No puede contener la palabra TOTAL, porque se puede bloquear la impresora | [
"Imprime",
"texto",
"fiscal",
"que",
"se",
"muestra",
"por",
"lo",
"general",
"antes",
"de",
"los",
"articulos",
".",
"No",
"puede",
"contener",
"la",
"palabra",
"TOTAL",
"porque",
"se",
"puede",
"bloquear",
"la",
"impresora"
] | train | https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Printers/Lib/DriverView/Helper/Hasar441FiscalHelper.php#L57-L63 |
alevilar/ristorantino-vendor | Printers/Lib/DriverView/Helper/Hasar441FiscalHelper.php | Hasar441FiscalHelper.printLineItem | public function printLineItem($descripcion_articulo, $cantidad, $monto, $porcentaje_iva = null, $suma = true, $impuesto_interno = 0, $display = 0, $precio_total = true){
$defaultPorcentajeIva = Configure::read('Afip.default_iva_porcentaje');
if ( empty($porcentaje_iva) && $defaultPorcentajeIva ){
$porcentaje_iva... | php | public function printLineItem($descripcion_articulo, $cantidad, $monto, $porcentaje_iva = null, $suma = true, $impuesto_interno = 0, $display = 0, $precio_total = true){
$defaultPorcentajeIva = Configure::read('Afip.default_iva_porcentaje');
if ( empty($porcentaje_iva) && $defaultPorcentajeIva ){
$porcentaje_iva... | [
"public",
"function",
"printLineItem",
"(",
"$",
"descripcion_articulo",
",",
"$",
"cantidad",
",",
"$",
"monto",
",",
"$",
"porcentaje_iva",
"=",
"null",
",",
"$",
"suma",
"=",
"true",
",",
"$",
"impuesto_interno",
"=",
"0",
",",
"$",
"display",
"=",
"0... | Imprime un articulo, o sea una linea del articulo con su description y su precio, cantidad, etc
@param string $descripcion_articulo descripcion del articulo EJ: Coca-Cola hasta 23 caracteres
@param number $cantidad puede ser un entero o un float depende de la impresora
@param number $monto float o integer depende de l... | [
"Imprime",
"un",
"articulo",
"o",
"sea",
"una",
"linea",
"del",
"articulo",
"con",
"su",
"description",
"y",
"su",
"precio",
"cantidad",
"etc"
] | train | https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Printers/Lib/DriverView/Helper/Hasar441FiscalHelper.php#L78-L93 |
alevilar/ristorantino-vendor | Printers/Lib/DriverView/Helper/Hasar441FiscalHelper.php | Hasar441FiscalHelper.totalTender | public function totalTender($texto, $monto_pagado, $operacion = "T", $display = 0){
$texto = substr($texto,0,28);
$operacion = strtoupper($operacion);
if( is_numeric($monto_pagado) &&
($operacion == 'C' || $operacion == 'T' || $operacion == 'R'))
{
$comando = "D".$this->cm('FS').$texto.$this->cm('FS')... | php | public function totalTender($texto, $monto_pagado, $operacion = "T", $display = 0){
$texto = substr($texto,0,28);
$operacion = strtoupper($operacion);
if( is_numeric($monto_pagado) &&
($operacion == 'C' || $operacion == 'T' || $operacion == 'R'))
{
$comando = "D".$this->cm('FS').$texto.$this->cm('FS')... | [
"public",
"function",
"totalTender",
"(",
"$",
"texto",
",",
"$",
"monto_pagado",
",",
"$",
"operacion",
"=",
"\"T\"",
",",
"$",
"display",
"=",
"0",
")",
"{",
"$",
"texto",
"=",
"substr",
"(",
"$",
"texto",
",",
"0",
",",
"28",
")",
";",
"$",
"o... | TotalPago
@param string $texto Ejemplo: "Pago en efectivo"
@param number $monto_pagado integer o float dependiendo de la impresora
@param $operacion las piopsibilidades son:
'C': Cancela el ticket
'T': pago parcial o total
'R': devolucion de pago
@param $display para las impresoras que tengan display | [
"TotalPago"
] | train | https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Printers/Lib/DriverView/Helper/Hasar441FiscalHelper.php#L107-L121 |
alevilar/ristorantino-vendor | Printers/Lib/DriverView/Helper/Hasar441FiscalHelper.php | Hasar441FiscalHelper.generalDiscount | public function generalDiscount($importe_descuento = 0){
$comando = "T".$this->cm('FS').
'Descuento'.$this->cm('FS').
$importe_descuento.$this->cm('FS').
'm'.$this->cm('FS').
'0'.$this->cm('FS').
... | php | public function generalDiscount($importe_descuento = 0){
$comando = "T".$this->cm('FS').
'Descuento'.$this->cm('FS').
$importe_descuento.$this->cm('FS').
'm'.$this->cm('FS').
'0'.$this->cm('FS').
... | [
"public",
"function",
"generalDiscount",
"(",
"$",
"importe_descuento",
"=",
"0",
")",
"{",
"$",
"comando",
"=",
"\"T\"",
".",
"$",
"this",
"->",
"cm",
"(",
"'FS'",
")",
".",
"'Descuento'",
".",
"$",
"this",
"->",
"cm",
"(",
"'FS'",
")",
".",
"$",
... | Responde:
a. Imprimiendo una línea donde se muestra: descripción del descuento (o recargo), impuestos y monto del
descuento (o recargo) -con posterioridad a la impresión de la línea con la leyenda “Descuento (o Recargo)
general”-;
b. Restando
@param float $importe_descuento
@return string comando | [
"Responde",
":",
"a",
".",
"Imprimiendo",
"una",
"línea",
"donde",
"se",
"muestra",
":",
"descripción",
"del",
"descuento",
"(",
"o",
"recargo",
")",
"impuestos",
"y",
"monto",
"del",
"descuento",
"(",
"o",
"recargo",
")",
"-",
"con",
"posterioridad",
"a",... | train | https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Printers/Lib/DriverView/Helper/Hasar441FiscalHelper.php#L133-L141 |
alevilar/ristorantino-vendor | Printers/Lib/DriverView/Helper/Hasar441FiscalHelper.php | Hasar441FiscalHelper.setDateTime | public function setDateTime($fecha = 'now', $hora = 'now'){
$ymd = date("ymd",strtotime($fecha)) ;
$his = date("His",strtotime($hora)) ;
return "X".$this->cm('FS').$ymd.$this->cm('FS').$his;
} | php | public function setDateTime($fecha = 'now', $hora = 'now'){
$ymd = date("ymd",strtotime($fecha)) ;
$his = date("His",strtotime($hora)) ;
return "X".$this->cm('FS').$ymd.$this->cm('FS').$his;
} | [
"public",
"function",
"setDateTime",
"(",
"$",
"fecha",
"=",
"'now'",
",",
"$",
"hora",
"=",
"'now'",
")",
"{",
"$",
"ymd",
"=",
"date",
"(",
"\"ymd\"",
",",
"strtotime",
"(",
"$",
"fecha",
")",
")",
";",
"$",
"his",
"=",
"date",
"(",
"\"His\"",
... | Setea fecha y hora | [
"Setea",
"fecha",
"y",
"hora"
] | train | https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Printers/Lib/DriverView/Helper/Hasar441FiscalHelper.php#L189-L193 |
alevilar/ristorantino-vendor | Printers/Lib/DriverView/Helper/Hasar441FiscalHelper.php | Hasar441FiscalHelper.setHeaderTrailer | public function setHeaderTrailer($numero_de_linea,$texto = "-",$doble_ancho = false){
$texto = substr($texto,0,45);
if ($numero_de_linea > -3 && $numero_de_linea <= 0){
$comando = "]".$this->cm('FS').$numero_de_linea;
}
if ($numero_de_linea > 0 && $numero_de_linea < 21){
if($doble_ancho){
$texto = $th... | php | public function setHeaderTrailer($numero_de_linea,$texto = "-",$doble_ancho = false){
$texto = substr($texto,0,45);
if ($numero_de_linea > -3 && $numero_de_linea <= 0){
$comando = "]".$this->cm('FS').$numero_de_linea;
}
if ($numero_de_linea > 0 && $numero_de_linea < 21){
if($doble_ancho){
$texto = $th... | [
"public",
"function",
"setHeaderTrailer",
"(",
"$",
"numero_de_linea",
",",
"$",
"texto",
"=",
"\"-\"",
",",
"$",
"doble_ancho",
"=",
"false",
")",
"{",
"$",
"texto",
"=",
"substr",
"(",
"$",
"texto",
",",
"0",
",",
"45",
")",
";",
"if",
"(",
"$",
... | Setea el encabezado y el pie de pagina
@param integer $numero_de_linea
ENCABEZADO: linea 1 - 10
COLA: linea 11 - 20
BORRA ENCABEZADO Y COLA: linea = 0
BORRA ENCABEZADO: numero linea = -1
BORRA COLA: numero linea = -2
@param $texto 45 caracteres maximo | [
"Setea",
"el",
"encabezado",
"y",
"el",
"pie",
"de",
"pagina"
] | train | https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Printers/Lib/DriverView/Helper/Hasar441FiscalHelper.php#L208-L223 |
alevilar/ristorantino-vendor | Printers/Lib/DriverView/Helper/Hasar441FiscalHelper.php | Hasar441FiscalHelper.setTrailer | public function setTrailer($linea ,$texto,$doble_ancho = false){
//COLA: linea 11 - 20
$texto = substr($texto,0,45);
$comando = '';
if ($linea > -1 && $linea < 10){
if($doble_ancho){
$texto = $this->cm('DOBLE_ANCHO').$texto;
}
$numero_de_linea = 11+$linea;
$comando = "]" . $this-... | php | public function setTrailer($linea ,$texto,$doble_ancho = false){
//COLA: linea 11 - 20
$texto = substr($texto,0,45);
$comando = '';
if ($linea > -1 && $linea < 10){
if($doble_ancho){
$texto = $this->cm('DOBLE_ANCHO').$texto;
}
$numero_de_linea = 11+$linea;
$comando = "]" . $this-... | [
"public",
"function",
"setTrailer",
"(",
"$",
"linea",
",",
"$",
"texto",
",",
"$",
"doble_ancho",
"=",
"false",
")",
"{",
"//COLA: \t\tlinea 11 - 20",
"$",
"texto",
"=",
"substr",
"(",
"$",
"texto",
",",
"0",
",",
"45",
")",
";",
"$",
"comando",
"=",
... | Setea el pie de pagina
@param integer $linea de 0 a 9
@param string $texto 45 caracteres maximo | [
"Setea",
"el",
"pie",
"de",
"pagina"
] | train | https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Printers/Lib/DriverView/Helper/Hasar441FiscalHelper.php#L285-L297 |
alevilar/ristorantino-vendor | Printers/Lib/DriverView/Helper/Hasar441FiscalHelper.php | Hasar441FiscalHelper.setEmbarkNumber | public function setEmbarkNumber($numeroTicket, $nlinea = 1){
return chr(147).$this->cm('FS') . $nlinea . $this->cm('FS') . trim($numeroTicket);
} | php | public function setEmbarkNumber($numeroTicket, $nlinea = 1){
return chr(147).$this->cm('FS') . $nlinea . $this->cm('FS') . trim($numeroTicket);
} | [
"public",
"function",
"setEmbarkNumber",
"(",
"$",
"numeroTicket",
",",
"$",
"nlinea",
"=",
"1",
")",
"{",
"return",
"chr",
"(",
"147",
")",
".",
"$",
"this",
"->",
"cm",
"(",
"'FS'",
")",
".",
"$",
"nlinea",
".",
"$",
"this",
"->",
"cm",
"(",
"'... | Longitud
ô (93H - ASCII 147)
FS
No de línea de comprobante original (1-2)
0: borra ambas líneas (sólo modelos SMH/P-PR5F -versión 2.01-, SMH/P-715F
-versiones 3.02 y posteriores-, y SMH/P-441F)
FS
Texto de hasta 20 caracteres
Ejemplo: ô∟1∟00000118 | [
"Longitud",
"ô",
"(",
"93H",
"-",
"ASCII",
"147",
")",
"FS",
"No",
"de",
"línea",
"de",
"comprobante",
"original",
"(",
"1",
"-",
"2",
")",
"0",
":",
"borra",
"ambas",
"líneas",
"(",
"sólo",
"modelos",
"SMH",
"/",
"P",
"-",
"PR5F",
"-",
"versión",
... | train | https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Printers/Lib/DriverView/Helper/Hasar441FiscalHelper.php#L365-L367 |
alevilar/ristorantino-vendor | Printers/Lib/DriverView/Helper/Hasar441FiscalHelper.php | Hasar441FiscalHelper.openDNFH | public function openDNFH($tipoDocumento, $identificacion = 0){
$comando = chr(128). $this->cm('FS') .$tipoDocumento . $this->cm('FS') ."T";
if (!empty ($identificacion)){
$comando .= $this->cm('FS') .$identificacion;
}
return $comando;
} | php | public function openDNFH($tipoDocumento, $identificacion = 0){
$comando = chr(128). $this->cm('FS') .$tipoDocumento . $this->cm('FS') ."T";
if (!empty ($identificacion)){
$comando .= $this->cm('FS') .$identificacion;
}
return $comando;
} | [
"public",
"function",
"openDNFH",
"(",
"$",
"tipoDocumento",
",",
"$",
"identificacion",
"=",
"0",
")",
"{",
"$",
"comando",
"=",
"chr",
"(",
"128",
")",
".",
"$",
"this",
"->",
"cm",
"(",
"'FS'",
")",
".",
"$",
"tipoDocumento",
".",
"$",
"this",
"... | Tipo de documento
R: Nota de crédito ‘A’
S: Nota de crédito ‘B/C’
x: Tique recibo ‘X’
<: Tique pagaré
,: Tique presupuesto
-: Comp. de entrega
.: Talón Estacionamiento
/: Cobro de Servicios
0: Ingreso de Dinero
1: Retiro de Dinero
2: Talón de Cambio
3: Talón de reparto
4: Talón de regalo
5: Cuenta Corriente
6: Avisode ... | [
"Tipo",
"de",
"documento",
"R",
":",
"Nota",
"de",
"crédito",
"‘A’",
"S",
":",
"Nota",
"de",
"crédito",
"‘B",
"/",
"C’",
"x",
":",
"Tique",
"recibo",
"‘X’",
"<",
":",
"Tique",
"pagaré",
":",
"Tique",
"presupuesto",
"-",
":",
"Comp",
".",
"de",
"ent... | train | https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Printers/Lib/DriverView/Helper/Hasar441FiscalHelper.php#L394-L400 |
songshenzong/log | src/DataCollector/ViewCollector.php | ViewCollector.addView | public function addView(View $view)
{
$name = $view->getName();
$path = $view->getPath();
if (!is_object($path)) {
if ($path) {
$path = ltrim(str_replace(base_path(), '', realpath($path)), '/');
}
if (substr($path, -10) == '.blade.php') {... | php | public function addView(View $view)
{
$name = $view->getName();
$path = $view->getPath();
if (!is_object($path)) {
if ($path) {
$path = ltrim(str_replace(base_path(), '', realpath($path)), '/');
}
if (substr($path, -10) == '.blade.php') {... | [
"public",
"function",
"addView",
"(",
"View",
"$",
"view",
")",
"{",
"$",
"name",
"=",
"$",
"view",
"->",
"getName",
"(",
")",
";",
"$",
"path",
"=",
"$",
"view",
"->",
"getPath",
"(",
")",
";",
"if",
"(",
"!",
"is_object",
"(",
"$",
"path",
")... | Add a View instance to the Collector
@param \Illuminate\View\View $view | [
"Add",
"a",
"View",
"instance",
"to",
"the",
"Collector"
] | train | https://github.com/songshenzong/log/blob/b1e01f7994da47737866eabf82367490eab17c46/src/DataCollector/ViewCollector.php#L52-L88 |
RhubarbPHP/Module.RestApi | src/Resources/ModelRestResource.php | ModelRestResource.transformModelToArray | protected function transformModelToArray($columns)
{
$model = $this->getModel();
$extract = [];
$relationships = null;
foreach ($columns as $label => $column) {
$columnModel = $model;
$modifier = "";
$urlSuffix = false;
$apiLabel ... | php | protected function transformModelToArray($columns)
{
$model = $this->getModel();
$extract = [];
$relationships = null;
foreach ($columns as $label => $column) {
$columnModel = $model;
$modifier = "";
$urlSuffix = false;
$apiLabel ... | [
"protected",
"function",
"transformModelToArray",
"(",
"$",
"columns",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"getModel",
"(",
")",
";",
"$",
"extract",
"=",
"[",
"]",
";",
"$",
"relationships",
"=",
"null",
";",
"foreach",
"(",
"$",
"columns"... | Turns a model into a flat array structure ready for returning as a resource response.
@param string[] $columns The columns to extract
@return array A key/value pairing of columns and values
@throws RestImplementationException | [
"Turns",
"a",
"model",
"into",
"a",
"flat",
"array",
"structure",
"ready",
"for",
"returning",
"as",
"a",
"resource",
"response",
"."
] | train | https://github.com/RhubarbPHP/Module.RestApi/blob/825d2b920caed13811971c5eb2784a94417787bd/src/Resources/ModelRestResource.php#L80-L203 |
RhubarbPHP/Module.RestApi | src/Resources/ModelRestResource.php | ModelRestResource.getSummaryColumns | protected function getSummaryColumns()
{
$columns = [];
$model = $this->getSampleModel();
$columnName = $model->getLabelColumnName();
if ($columnName != "") {
$columns[] = $columnName;
}
return $columns;
} | php | protected function getSummaryColumns()
{
$columns = [];
$model = $this->getSampleModel();
$columnName = $model->getLabelColumnName();
if ($columnName != "") {
$columns[] = $columnName;
}
return $columns;
} | [
"protected",
"function",
"getSummaryColumns",
"(",
")",
"{",
"$",
"columns",
"=",
"[",
"]",
";",
"$",
"model",
"=",
"$",
"this",
"->",
"getSampleModel",
"(",
")",
";",
"$",
"columnName",
"=",
"$",
"model",
"->",
"getLabelColumnName",
"(",
")",
";",
"if... | Override to control the columns returned in HEAD requests
@return string[] | [
"Override",
"to",
"control",
"the",
"columns",
"returned",
"in",
"HEAD",
"requests"
] | train | https://github.com/RhubarbPHP/Module.RestApi/blob/825d2b920caed13811971c5eb2784a94417787bd/src/Resources/ModelRestResource.php#L210-L222 |
RhubarbPHP/Module.RestApi | src/Resources/ModelRestResource.php | ModelRestResource.createItemResource | public function createItemResource($resourceIdentifier)
{
try {
$model = SolutionSchema::getModel($this->getModelName(), $resourceIdentifier);
} catch (RecordNotFoundException $er) {
throw new RestResourceNotFoundException(self::class, $resourceIdentifier);
}
... | php | public function createItemResource($resourceIdentifier)
{
try {
$model = SolutionSchema::getModel($this->getModelName(), $resourceIdentifier);
} catch (RecordNotFoundException $er) {
throw new RestResourceNotFoundException(self::class, $resourceIdentifier);
}
... | [
"public",
"function",
"createItemResource",
"(",
"$",
"resourceIdentifier",
")",
"{",
"try",
"{",
"$",
"model",
"=",
"SolutionSchema",
"::",
"getModel",
"(",
"$",
"this",
"->",
"getModelName",
"(",
")",
",",
"$",
"resourceIdentifier",
")",
";",
"}",
"catch",... | Returns the ItemRestResource for the $resourceIdentifier contained in this collection.
@param $resourceIdentifier
@return ItemRestResource
@throws RestImplementationException Thrown if the item could not be found. | [
"Returns",
"the",
"ItemRestResource",
"for",
"the",
"$resourceIdentifier",
"contained",
"in",
"this",
"collection",
"."
] | train | https://github.com/RhubarbPHP/Module.RestApi/blob/825d2b920caed13811971c5eb2784a94417787bd/src/Resources/ModelRestResource.php#L671-L680 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/validators/auto_increment_index.php | ezcDbSchemaAutoIncrementIndexValidator.validate | static public function validate( ezcDbSchema $schema )
{
$errors = array();
/* For each table we check all auto increment fields. */
foreach ( $schema->getSchema() as $tableName => $table )
{
foreach ( $table->fields as $fieldName => $field )
{
... | php | static public function validate( ezcDbSchema $schema )
{
$errors = array();
/* For each table we check all auto increment fields. */
foreach ( $schema->getSchema() as $tableName => $table )
{
foreach ( $table->fields as $fieldName => $field )
{
... | [
"static",
"public",
"function",
"validate",
"(",
"ezcDbSchema",
"$",
"schema",
")",
"{",
"$",
"errors",
"=",
"array",
"(",
")",
";",
"/* For each table we check all auto increment fields. */",
"foreach",
"(",
"$",
"schema",
"->",
"getSchema",
"(",
")",
"as",
"$"... | Validates if all the types used in the $schema are supported.
This method loops over all the fields in a table and checks whether the
type that is used for each field is supported. It will return an array
containing error strings for each non-supported type that it finds.
@param ezcDbSchema $schema
@return array(stri... | [
"Validates",
"if",
"all",
"the",
"types",
"used",
"in",
"the",
"$schema",
"are",
"supported",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/validators/auto_increment_index.php#L30-L62 |
hametuha/wpametu | src/WPametu/UI/Field/GeoPoint.php | GeoPoint.get_field | protected function get_field( \WP_Post $post ){
$field = parent::get_field($post);
$automatic = $this->original_callback ? ' original' : '';
$geocder = $this->show_geocoder ? $this->geocoder() : '';
return <<<HTML
{$field}
<div id="{$this->name}-map" class="wpamet... | php | protected function get_field( \WP_Post $post ){
$field = parent::get_field($post);
$automatic = $this->original_callback ? ' original' : '';
$geocder = $this->show_geocoder ? $this->geocoder() : '';
return <<<HTML
{$field}
<div id="{$this->name}-map" class="wpamet... | [
"protected",
"function",
"get_field",
"(",
"\\",
"WP_Post",
"$",
"post",
")",
"{",
"$",
"field",
"=",
"parent",
"::",
"get_field",
"(",
"$",
"post",
")",
";",
"$",
"automatic",
"=",
"$",
"this",
"->",
"original_callback",
"?",
"' original'",
":",
"''",
... | Add map canvas
@param \WP_Post $post
@return string | [
"Add",
"map",
"canvas"
] | train | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/UI/Field/GeoPoint.php#L51-L61 |
hametuha/wpametu | src/WPametu/UI/Field/GeoPoint.php | GeoPoint.geocoder | protected function geocoder(){
$helper = $this->__('Input address');
$btn = $this->__('Move point');
$fail = esc_attr($this->__('Sorry, but nothing found with input address'));
return <<<HTML
<p>
<input type="text" class="gmap-geocoder regular-text" placeholder="{$hel... | php | protected function geocoder(){
$helper = $this->__('Input address');
$btn = $this->__('Move point');
$fail = esc_attr($this->__('Sorry, but nothing found with input address'));
return <<<HTML
<p>
<input type="text" class="gmap-geocoder regular-text" placeholder="{$hel... | [
"protected",
"function",
"geocoder",
"(",
")",
"{",
"$",
"helper",
"=",
"$",
"this",
"->",
"__",
"(",
"'Input address'",
")",
";",
"$",
"btn",
"=",
"$",
"this",
"->",
"__",
"(",
"'Move point'",
")",
";",
"$",
"fail",
"=",
"esc_attr",
"(",
"$",
"thi... | Get GeoCoder input
@return string | [
"Get",
"GeoCoder",
"input"
] | train | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/UI/Field/GeoPoint.php#L103-L114 |
WellCommerce/StandardEditionBundle | DataFixtures/ORM/LoadProductStatusData.php | LoadProductStatusData.load | public function load(ObjectManager $manager)
{
if (!$this->isEnabled()) {
return;
}
$bestseller = new ProductStatus();
$bestseller->setSymbol('bestseller');
foreach ($this->getLocales() as $locale) {
$bestseller->translate($locale->getCode())-... | php | public function load(ObjectManager $manager)
{
if (!$this->isEnabled()) {
return;
}
$bestseller = new ProductStatus();
$bestseller->setSymbol('bestseller');
foreach ($this->getLocales() as $locale) {
$bestseller->translate($locale->getCode())-... | [
"public",
"function",
"load",
"(",
"ObjectManager",
"$",
"manager",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isEnabled",
"(",
")",
")",
"{",
"return",
";",
"}",
"$",
"bestseller",
"=",
"new",
"ProductStatus",
"(",
")",
";",
"$",
"bestseller",
"-... | {@inheritDoc} | [
"{"
] | train | https://github.com/WellCommerce/StandardEditionBundle/blob/6367bd20bbb6bde37c710a6ba87ae72b5f05f61e/DataFixtures/ORM/LoadProductStatusData.php#L29-L124 |
skmetaly/laravel-twitch-restful-api | src/API/Channels.php | Channels.channel | public function channel($channel)
{
$channel = $this->client->get(config('twitch-api.api_url') . '/kraken/channels/' . $channel);
return $channel->json();
} | php | public function channel($channel)
{
$channel = $this->client->get(config('twitch-api.api_url') . '/kraken/channels/' . $channel);
return $channel->json();
} | [
"public",
"function",
"channel",
"(",
"$",
"channel",
")",
"{",
"$",
"channel",
"=",
"$",
"this",
"->",
"client",
"->",
"get",
"(",
"config",
"(",
"'twitch-api.api_url'",
")",
".",
"'/kraken/channels/'",
".",
"$",
"channel",
")",
";",
"return",
"$",
"cha... | Returns a channel object.
@param $channel
@return mixed | [
"Returns",
"a",
"channel",
"object",
"."
] | train | https://github.com/skmetaly/laravel-twitch-restful-api/blob/70c83e441deb411ade2e343ad5cb0339c90dc6c2/src/API/Channels.php#L25-L30 |
skmetaly/laravel-twitch-restful-api | src/API/Channels.php | Channels.authenticatedChannel | public function authenticatedChannel($token = null)
{
$token = $this->getToken();
$request = $this->createRequest('GET', config('twitch-api.api_url') . '/kraken/channel', $token);
$channelInfo = $this->client->send($request);
return $channelInfo->json();
} | php | public function authenticatedChannel($token = null)
{
$token = $this->getToken();
$request = $this->createRequest('GET', config('twitch-api.api_url') . '/kraken/channel', $token);
$channelInfo = $this->client->send($request);
return $channelInfo->json();
} | [
"public",
"function",
"authenticatedChannel",
"(",
"$",
"token",
"=",
"null",
")",
"{",
"$",
"token",
"=",
"$",
"this",
"->",
"getToken",
"(",
")",
";",
"$",
"request",
"=",
"$",
"this",
"->",
"createRequest",
"(",
"'GET'",
",",
"config",
"(",
"'twitch... | Returns a channel object of authenticated user. Channel object includes stream key.
Authenticated, required scope: channel_read
@param null $token
@return mixed
@throws \Skmetaly\TwitchApi\Exceptions\RequestRequiresAuthenticationException | [
"Returns",
"a",
"channel",
"object",
"of",
"authenticated",
"user",
".",
"Channel",
"object",
"includes",
"stream",
"key",
"."
] | train | https://github.com/skmetaly/laravel-twitch-restful-api/blob/70c83e441deb411ade2e343ad5cb0339c90dc6c2/src/API/Channels.php#L42-L51 |
skmetaly/laravel-twitch-restful-api | src/API/Channels.php | Channels.deleteStreamKey | public function deleteStreamKey($channel, $token = null)
{
$token = $this->getToken($token);
$url = config('twitch-api.api_url') . '/kraken/channels/' . $channel . '/stream_key';
$request = $this->createRequest('DELETE', $url, $token);
$response = $this->client->send($request);
... | php | public function deleteStreamKey($channel, $token = null)
{
$token = $this->getToken($token);
$url = config('twitch-api.api_url') . '/kraken/channels/' . $channel . '/stream_key';
$request = $this->createRequest('DELETE', $url, $token);
$response = $this->client->send($request);
... | [
"public",
"function",
"deleteStreamKey",
"(",
"$",
"channel",
",",
"$",
"token",
"=",
"null",
")",
"{",
"$",
"token",
"=",
"$",
"this",
"->",
"getToken",
"(",
"$",
"token",
")",
";",
"$",
"url",
"=",
"config",
"(",
"'twitch-api.api_url'",
")",
".",
"... | Resets channel's stream key.
Authenticated, required scope: channel_stream
@param $channel
@param null $token
@return json | [
"Resets",
"channel",
"s",
"stream",
"key",
".",
"Authenticated",
"required",
"scope",
":",
"channel_stream"
] | train | https://github.com/skmetaly/laravel-twitch-restful-api/blob/70c83e441deb411ade2e343ad5cb0339c90dc6c2/src/API/Channels.php#L113-L124 |
skmetaly/laravel-twitch-restful-api | src/API/Channels.php | Channels.postCommercial | public function postCommercial($channel, $length = 30, $token = null)
{
$token = $this->getToken($token);
$url = config('twitch-api.api_url') . '/channels/' . $channel . '/commercial';
$options = $this->getDefaultHeaders($token);
$options[ 'body' ] = ['length' => $length];
... | php | public function postCommercial($channel, $length = 30, $token = null)
{
$token = $this->getToken($token);
$url = config('twitch-api.api_url') . '/channels/' . $channel . '/commercial';
$options = $this->getDefaultHeaders($token);
$options[ 'body' ] = ['length' => $length];
... | [
"public",
"function",
"postCommercial",
"(",
"$",
"channel",
",",
"$",
"length",
"=",
"30",
",",
"$",
"token",
"=",
"null",
")",
"{",
"$",
"token",
"=",
"$",
"this",
"->",
"getToken",
"(",
"$",
"token",
")",
";",
"$",
"url",
"=",
"config",
"(",
"... | Start commercial on channel.
Authenticated, required scope: channel_commercial
@param $channel
@param int $length
@param null $token | [
"Start",
"commercial",
"on",
"channel",
".",
"Authenticated",
"required",
"scope",
":",
"channel_commercial"
] | train | https://github.com/skmetaly/laravel-twitch-restful-api/blob/70c83e441deb411ade2e343ad5cb0339c90dc6c2/src/API/Channels.php#L134-L149 |
ekuiter/feature-php | FeaturePhp/ProductLine/ProductLine.php | ProductLine.getGeneratorSettings | public function getGeneratorSettings($generator) {
return $this->settings->getOptional("generators", $generator, fphp\Generator\Settings::emptyInstance());
} | php | public function getGeneratorSettings($generator) {
return $this->settings->getOptional("generators", $generator, fphp\Generator\Settings::emptyInstance());
} | [
"public",
"function",
"getGeneratorSettings",
"(",
"$",
"generator",
")",
"{",
"return",
"$",
"this",
"->",
"settings",
"->",
"getOptional",
"(",
"\"generators\"",
",",
"$",
"generator",
",",
"fphp",
"\\",
"Generator",
"\\",
"Settings",
"::",
"emptyInstance",
... | Returns the product line's settings for a generator.
@param string $generator
@return \FeaturePhp\Generator\Settings | [
"Returns",
"the",
"product",
"line",
"s",
"settings",
"for",
"a",
"generator",
"."
] | train | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/ProductLine/ProductLine.php#L88-L90 |
ekuiter/feature-php | FeaturePhp/ProductLine/ProductLine.php | ProductLine.getProduct | public function getProduct($configuration = null) {
if (!$configuration)
$configuration = $this->getDefaultConfiguration();
return new Product($this, $configuration);
} | php | public function getProduct($configuration = null) {
if (!$configuration)
$configuration = $this->getDefaultConfiguration();
return new Product($this, $configuration);
} | [
"public",
"function",
"getProduct",
"(",
"$",
"configuration",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"configuration",
")",
"$",
"configuration",
"=",
"$",
"this",
"->",
"getDefaultConfiguration",
"(",
")",
";",
"return",
"new",
"Product",
"(",
"$",
... | Returns a product of the product line for a configuration.
If the configuration is omitted, the default configuration is used.
@param \FeaturePhp\Model\Configuration $configuration
@return Product | [
"Returns",
"a",
"product",
"of",
"the",
"product",
"line",
"for",
"a",
"configuration",
".",
"If",
"the",
"configuration",
"is",
"omitted",
"the",
"default",
"configuration",
"is",
"used",
"."
] | train | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/ProductLine/ProductLine.php#L98-L102 |
ekuiter/feature-php | FeaturePhp/ProductLine/ProductLine.php | ProductLine.trace | public function trace($artifact) {
$featureName = str_replace("\"", """, $artifact->getFeature()->getName());
$xmlConfiguration = fphp\Model\XmlConfiguration::fromString(
'<configuration><feature name="' . $featureName . '" automatic="undefined" manual="selected"/></configuration>');
... | php | public function trace($artifact) {
$featureName = str_replace("\"", """, $artifact->getFeature()->getName());
$xmlConfiguration = fphp\Model\XmlConfiguration::fromString(
'<configuration><feature name="' . $featureName . '" automatic="undefined" manual="selected"/></configuration>');
... | [
"public",
"function",
"trace",
"(",
"$",
"artifact",
")",
"{",
"$",
"featureName",
"=",
"str_replace",
"(",
"\"\\\"\"",
",",
"\""\"",
",",
"$",
"artifact",
"->",
"getFeature",
"(",
")",
"->",
"getName",
"(",
")",
")",
";",
"$",
"xmlConfiguration",
"... | Returns tracing links for an artifact.
@param \FeaturePhp\Artifact\Artifact $artifact
@return \FeaturePhp\Artifact\TracingLink[] | [
"Returns",
"tracing",
"links",
"for",
"an",
"artifact",
"."
] | train | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/ProductLine/ProductLine.php#L109-L116 |
ekuiter/feature-php | FeaturePhp/ProductLine/ProductLine.php | ProductLine.renderTracingLinkAnalysis | public function renderTracingLinkAnalysis($artifact, $textOnly = false) {
return (new fphp\Artifact\TracingLinkRenderer($this->trace($artifact)))->render($textOnly);
} | php | public function renderTracingLinkAnalysis($artifact, $textOnly = false) {
return (new fphp\Artifact\TracingLinkRenderer($this->trace($artifact)))->render($textOnly);
} | [
"public",
"function",
"renderTracingLinkAnalysis",
"(",
"$",
"artifact",
",",
"$",
"textOnly",
"=",
"false",
")",
"{",
"return",
"(",
"new",
"fphp",
"\\",
"Artifact",
"\\",
"TracingLinkRenderer",
"(",
"$",
"this",
"->",
"trace",
"(",
"$",
"artifact",
")",
... | Analyzes an artifact's tracing links by returning a web page.
@param \FeaturePhp\Artifact\Artifact $artifact
@param bool $textOnly whether to render text or HTML
@return string | [
"Analyzes",
"an",
"artifact",
"s",
"tracing",
"links",
"by",
"returning",
"a",
"web",
"page",
"."
] | train | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/ProductLine/ProductLine.php#L124-L126 |
accompli/chrono | src/Adapter/GitAdapter.php | GitAdapter.supportsRepository | public function supportsRepository()
{
$result = $this->processExecutor->execute('git --version');
if ($result->isSuccessful() === false) {
return false;
}
if (preg_match('#(^git://|\.git$|git(?:olite)?@|//git\.|//github.com/)#i', $this->repositoryUrl) === 1) {
... | php | public function supportsRepository()
{
$result = $this->processExecutor->execute('git --version');
if ($result->isSuccessful() === false) {
return false;
}
if (preg_match('#(^git://|\.git$|git(?:olite)?@|//git\.|//github.com/)#i', $this->repositoryUrl) === 1) {
... | [
"public",
"function",
"supportsRepository",
"(",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"processExecutor",
"->",
"execute",
"(",
"'git --version'",
")",
";",
"if",
"(",
"$",
"result",
"->",
"isSuccessful",
"(",
")",
"===",
"false",
")",
"{",
"r... | {@inheritdoc} | [
"{"
] | train | https://github.com/accompli/chrono/blob/5f3201ee1e3fdc519fabac92bc9bfb7d9bebdebc/src/Adapter/GitAdapter.php#L17-L34 |
accompli/chrono | src/Adapter/GitAdapter.php | GitAdapter.getBranches | public function getBranches()
{
$branches = array();
$result = $this->processExecutor->execute(sprintf('git ls-remote --heads %s', ProcessUtils::escapeArgument($this->repositoryUrl)), null, $this->getEnvironmentVariables());
if ($result->isSuccessful()) {
foreach ($result->getOu... | php | public function getBranches()
{
$branches = array();
$result = $this->processExecutor->execute(sprintf('git ls-remote --heads %s', ProcessUtils::escapeArgument($this->repositoryUrl)), null, $this->getEnvironmentVariables());
if ($result->isSuccessful()) {
foreach ($result->getOu... | [
"public",
"function",
"getBranches",
"(",
")",
"{",
"$",
"branches",
"=",
"array",
"(",
")",
";",
"$",
"result",
"=",
"$",
"this",
"->",
"processExecutor",
"->",
"execute",
"(",
"sprintf",
"(",
"'git ls-remote --heads %s'",
",",
"ProcessUtils",
"::",
"escape... | {@inheritdoc} | [
"{"
] | train | https://github.com/accompli/chrono/blob/5f3201ee1e3fdc519fabac92bc9bfb7d9bebdebc/src/Adapter/GitAdapter.php#L39-L54 |
accompli/chrono | src/Adapter/GitAdapter.php | GitAdapter.getTags | public function getTags()
{
$tags = array();
$result = $this->processExecutor->execute(sprintf('git ls-remote --tags %s', ProcessUtils::escapeArgument($this->repositoryUrl)), null, $this->getEnvironmentVariables());
if ($result->isSuccessful()) {
foreach ($result->getOutputAsArr... | php | public function getTags()
{
$tags = array();
$result = $this->processExecutor->execute(sprintf('git ls-remote --tags %s', ProcessUtils::escapeArgument($this->repositoryUrl)), null, $this->getEnvironmentVariables());
if ($result->isSuccessful()) {
foreach ($result->getOutputAsArr... | [
"public",
"function",
"getTags",
"(",
")",
"{",
"$",
"tags",
"=",
"array",
"(",
")",
";",
"$",
"result",
"=",
"$",
"this",
"->",
"processExecutor",
"->",
"execute",
"(",
"sprintf",
"(",
"'git ls-remote --tags %s'",
",",
"ProcessUtils",
"::",
"escapeArgument"... | {@inheritdoc} | [
"{"
] | train | https://github.com/accompli/chrono/blob/5f3201ee1e3fdc519fabac92bc9bfb7d9bebdebc/src/Adapter/GitAdapter.php#L59-L74 |
accompli/chrono | src/Adapter/GitAdapter.php | GitAdapter.checkout | public function checkout($version)
{
$checkoutSuccesful = false;
$escapedVersion = ProcessUtils::escapeArgument($version);
if ($this->processExecutor->isDirectory($this->repositoryDirectory) && $this->processExecutor->execute('git rev-parse --is-inside-work-tree', $this->repositoryDirectory... | php | public function checkout($version)
{
$checkoutSuccesful = false;
$escapedVersion = ProcessUtils::escapeArgument($version);
if ($this->processExecutor->isDirectory($this->repositoryDirectory) && $this->processExecutor->execute('git rev-parse --is-inside-work-tree', $this->repositoryDirectory... | [
"public",
"function",
"checkout",
"(",
"$",
"version",
")",
"{",
"$",
"checkoutSuccesful",
"=",
"false",
";",
"$",
"escapedVersion",
"=",
"ProcessUtils",
"::",
"escapeArgument",
"(",
"$",
"version",
")",
";",
"if",
"(",
"$",
"this",
"->",
"processExecutor",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/accompli/chrono/blob/5f3201ee1e3fdc519fabac92bc9bfb7d9bebdebc/src/Adapter/GitAdapter.php#L79-L115 |
eghojansu/moe | src/tools/Basket.php | Basket.copyfrom | function copyfrom($var) {
if (is_string($var))
$var=Base::instance()->get($var);
foreach ($var as $key=>$val)
$this->item[$key]=$val;
} | php | function copyfrom($var) {
if (is_string($var))
$var=Base::instance()->get($var);
foreach ($var as $key=>$val)
$this->item[$key]=$val;
} | [
"function",
"copyfrom",
"(",
"$",
"var",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"var",
")",
")",
"$",
"var",
"=",
"Base",
"::",
"instance",
"(",
")",
"->",
"get",
"(",
"$",
"var",
")",
";",
"foreach",
"(",
"$",
"var",
"as",
"$",
"key",
"... | Hydrate item using hive array variable
@return NULL
@param $var array|string | [
"Hydrate",
"item",
"using",
"hive",
"array",
"variable"
] | train | https://github.com/eghojansu/moe/blob/f58ec75a3116d1a572782256e2b38bb9aab95e3c/src/tools/Basket.php#L185-L190 |
php-lug/lug | src/Bundle/GridBundle/Form/Type/GridFiltersType.php | GridFiltersType.buildForm | public function buildForm(FormBuilderInterface $builder, array $options)
{
foreach ($options['grid']->getFilters() as $filter) {
$builder->add(
$filter->getName(),
$filter->getForm(),
array_merge(['filter' => $filter], $filter->getFormOptions())
... | php | public function buildForm(FormBuilderInterface $builder, array $options)
{
foreach ($options['grid']->getFilters() as $filter) {
$builder->add(
$filter->getName(),
$filter->getForm(),
array_merge(['filter' => $filter], $filter->getFormOptions())
... | [
"public",
"function",
"buildForm",
"(",
"FormBuilderInterface",
"$",
"builder",
",",
"array",
"$",
"options",
")",
"{",
"foreach",
"(",
"$",
"options",
"[",
"'grid'",
"]",
"->",
"getFilters",
"(",
")",
"as",
"$",
"filter",
")",
"{",
"$",
"builder",
"->",... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/GridBundle/Form/Type/GridFiltersType.php#L27-L36 |
giftcards/Encryption | Doctrine/Configuration/Metadata/Driver/AnnotationDriver.php | AnnotationDriver.loadMetadataForClass | public function loadMetadataForClass($className, ClassMetadata $metadata)
{
/* @var $metadata \Doctrine\ORM\Mapping\ClassMetadataInfo */
$metadata->hasEncryptedProperties = false;
$metadata->encryptedProperties = array();
$class = $metadata->getReflectionClass();
for... | php | public function loadMetadataForClass($className, ClassMetadata $metadata)
{
/* @var $metadata \Doctrine\ORM\Mapping\ClassMetadataInfo */
$metadata->hasEncryptedProperties = false;
$metadata->encryptedProperties = array();
$class = $metadata->getReflectionClass();
for... | [
"public",
"function",
"loadMetadataForClass",
"(",
"$",
"className",
",",
"ClassMetadata",
"$",
"metadata",
")",
"{",
"/* @var $metadata \\Doctrine\\ORM\\Mapping\\ClassMetadataInfo */",
"$",
"metadata",
"->",
"hasEncryptedProperties",
"=",
"false",
";",
"$",
"metadata",
"... | Loads the metadata for the specified class into the provided container.
@param string $className
@param ClassMetadata $metadata
@return void | [
"Loads",
"the",
"metadata",
"for",
"the",
"specified",
"class",
"into",
"the",
"provided",
"container",
"."
] | train | https://github.com/giftcards/Encryption/blob/a48f92408538e2ffe1c8603f168d57803aad7100/Doctrine/Configuration/Metadata/Driver/AnnotationDriver.php#L24-L47 |
windwork/wf-logger | lib/adapter/File.php | File.log | public function log($level, $message, array $context = array())
{
if (!$this->checkLevel($level)) {
return;
}
if (!is_scalar($message)) {
$message = var_export($message, 1);
}
$time = time();
$yearMonth = date('Y-m', $time);
... | php | public function log($level, $message, array $context = array())
{
if (!$this->checkLevel($level)) {
return;
}
if (!is_scalar($message)) {
$message = var_export($message, 1);
}
$time = time();
$yearMonth = date('Y-m', $time);
... | [
"public",
"function",
"log",
"(",
"$",
"level",
",",
"$",
"message",
",",
"array",
"$",
"context",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"checkLevel",
"(",
"$",
"level",
")",
")",
"{",
"return",
";",
"}",
"if",
"(... | {@inheritDoc}
@see \wf\logger\LoggerAbstract::log() | [
"{"
] | train | https://github.com/windwork/wf-logger/blob/60cd331d4106296610ef0b827fce38f357231958/lib/adapter/File.php#L32-L64 |
php-lug/lug | src/Component/Grid/Sort/Type/AbstractType.php | AbstractType.configureOptions | public function configureOptions(OptionsResolver $resolver)
{
$resolver
->setDefault('field', function (Options $options, $field) {
return $field ?: $options['sort']->getName();
})
->setAllowedTypes('field', 'string');
} | php | public function configureOptions(OptionsResolver $resolver)
{
$resolver
->setDefault('field', function (Options $options, $field) {
return $field ?: $options['sort']->getName();
})
->setAllowedTypes('field', 'string');
} | [
"public",
"function",
"configureOptions",
"(",
"OptionsResolver",
"$",
"resolver",
")",
"{",
"$",
"resolver",
"->",
"setDefault",
"(",
"'field'",
",",
"function",
"(",
"Options",
"$",
"options",
",",
"$",
"field",
")",
"{",
"return",
"$",
"field",
"?",
":"... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Grid/Sort/Type/AbstractType.php#L25-L32 |
thecodingmachine/mvc.splash-common | src/Mouf/Mvc/Splash/Services/MoufExplorerUrlProvider.php | MoufExplorerUrlProvider.getUrlsList | public function getUrlsList($instanceName)
{
$moufManager = MoufManager::getMoufManager();
$instanceNames = $moufManager->findInstances(UrlProviderInterface::class);
$urls = array();
foreach ($instanceNames as $instanceName) {
$urlProvider = $moufManager->getInstance($i... | php | public function getUrlsList($instanceName)
{
$moufManager = MoufManager::getMoufManager();
$instanceNames = $moufManager->findInstances(UrlProviderInterface::class);
$urls = array();
foreach ($instanceNames as $instanceName) {
$urlProvider = $moufManager->getInstance($i... | [
"public",
"function",
"getUrlsList",
"(",
"$",
"instanceName",
")",
"{",
"$",
"moufManager",
"=",
"MoufManager",
"::",
"getMoufManager",
"(",
")",
";",
"$",
"instanceNames",
"=",
"$",
"moufManager",
"->",
"findInstances",
"(",
"UrlProviderInterface",
"::",
"clas... | Returns the list of URLs that can be accessed, and the function/method that should be called when the URL is called.
@param string $instanceName The identifier for this object in the container.
@return SplashRoute[] | [
"Returns",
"the",
"list",
"of",
"URLs",
"that",
"can",
"be",
"accessed",
"and",
"the",
"function",
"/",
"method",
"that",
"should",
"be",
"called",
"when",
"the",
"URL",
"is",
"called",
"."
] | train | https://github.com/thecodingmachine/mvc.splash-common/blob/eed0269ceda4d7d090a330a220490906a7aa60bd/src/Mouf/Mvc/Splash/Services/MoufExplorerUrlProvider.php#L22-L40 |
martin-helmich/flow-eventbroker | Classes/Helmich/EventBroker/Broker/Broker.php | Broker.initializeObject | public function initializeObject()
{
$this->queue = new \SplQueue();
$this->synchronousEventMap = $this->cache->get('DispatcherConfiguration_Synchronous');
$this->asynchronousEventMap = $this->cache->get('DispatcherConfiguration_Asynchronous');
if (FALSE === ($this->synchronousEve... | php | public function initializeObject()
{
$this->queue = new \SplQueue();
$this->synchronousEventMap = $this->cache->get('DispatcherConfiguration_Synchronous');
$this->asynchronousEventMap = $this->cache->get('DispatcherConfiguration_Asynchronous');
if (FALSE === ($this->synchronousEve... | [
"public",
"function",
"initializeObject",
"(",
")",
"{",
"$",
"this",
"->",
"queue",
"=",
"new",
"\\",
"SplQueue",
"(",
")",
";",
"$",
"this",
"->",
"synchronousEventMap",
"=",
"$",
"this",
"->",
"cache",
"->",
"get",
"(",
"'DispatcherConfiguration_Synchrono... | Initializes the broker. Loads the dispatching configuration from cache or builds it. | [
"Initializes",
"the",
"broker",
".",
"Loads",
"the",
"dispatching",
"configuration",
"from",
"cache",
"or",
"builds",
"it",
"."
] | train | https://github.com/martin-helmich/flow-eventbroker/blob/a08dc966cfddbee4f8ea75d1c682320ac196352d/Classes/Helmich/EventBroker/Broker/Broker.php#L75-L89 |
martin-helmich/flow-eventbroker | Classes/Helmich/EventBroker/Broker/Broker.php | Broker.queueEvent | public function queueEvent($event)
{
$this->queue->enqueue($event);
$class = get_class($event);
foreach ($this->synchronousEventMap->getListenersForEvent($class) as $listener)
{
$this->invokeListener($listener, $event);
}
} | php | public function queueEvent($event)
{
$this->queue->enqueue($event);
$class = get_class($event);
foreach ($this->synchronousEventMap->getListenersForEvent($class) as $listener)
{
$this->invokeListener($listener, $event);
}
} | [
"public",
"function",
"queueEvent",
"(",
"$",
"event",
")",
"{",
"$",
"this",
"->",
"queue",
"->",
"enqueue",
"(",
"$",
"event",
")",
";",
"$",
"class",
"=",
"get_class",
"(",
"$",
"event",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"synchronousEve... | Enqueues an arbitrary event.
@param mixed $event The event object to publish.
@return void | [
"Enqueues",
"an",
"arbitrary",
"event",
"."
] | train | https://github.com/martin-helmich/flow-eventbroker/blob/a08dc966cfddbee4f8ea75d1c682320ac196352d/Classes/Helmich/EventBroker/Broker/Broker.php#L99-L108 |
martin-helmich/flow-eventbroker | Classes/Helmich/EventBroker/Broker/Broker.php | Broker.flush | public function flush()
{
$this->queue->setIteratorMode(\SplQueue::IT_MODE_DELETE);
foreach ($this->queue as $event)
{
$class = get_class($event);
foreach ($this->asynchronousEventMap->getListenersForEvent($class) as $listener)
{
$this->i... | php | public function flush()
{
$this->queue->setIteratorMode(\SplQueue::IT_MODE_DELETE);
foreach ($this->queue as $event)
{
$class = get_class($event);
foreach ($this->asynchronousEventMap->getListenersForEvent($class) as $listener)
{
$this->i... | [
"public",
"function",
"flush",
"(",
")",
"{",
"$",
"this",
"->",
"queue",
"->",
"setIteratorMode",
"(",
"\\",
"SplQueue",
"::",
"IT_MODE_DELETE",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"queue",
"as",
"$",
"event",
")",
"{",
"$",
"class",
"=",
"... | Publishes queued events.
@return void | [
"Publishes",
"queued",
"events",
"."
] | train | https://github.com/martin-helmich/flow-eventbroker/blob/a08dc966cfddbee4f8ea75d1c682320ac196352d/Classes/Helmich/EventBroker/Broker/Broker.php#L117-L130 |
martin-helmich/flow-eventbroker | Classes/Helmich/EventBroker/Broker/Broker.php | Broker.invokeListener | private function invokeListener($listener, $event)
{
if (is_array($listener))
{
list($listenerClass, $method) = $listener;
$listenerInstance = $this->objectManager->get($listenerClass);
$listenerInstance->{$method}($event);
}
else
{
... | php | private function invokeListener($listener, $event)
{
if (is_array($listener))
{
list($listenerClass, $method) = $listener;
$listenerInstance = $this->objectManager->get($listenerClass);
$listenerInstance->{$method}($event);
}
else
{
... | [
"private",
"function",
"invokeListener",
"(",
"$",
"listener",
",",
"$",
"event",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"listener",
")",
")",
"{",
"list",
"(",
"$",
"listenerClass",
",",
"$",
"method",
")",
"=",
"$",
"listener",
";",
"$",
"liste... | Invokes a listener for an event.
@param callable $listener Any type of callable.
@param object $event The event object.
@return void
@throws UnknownObjectException May be thrown when the listener class cannot be instantiated. | [
"Invokes",
"a",
"listener",
"for",
"an",
"event",
"."
] | train | https://github.com/martin-helmich/flow-eventbroker/blob/a08dc966cfddbee4f8ea75d1c682320ac196352d/Classes/Helmich/EventBroker/Broker/Broker.php#L143-L156 |
martin-helmich/flow-eventbroker | Classes/Helmich/EventBroker/Broker/Broker.php | Broker.buildEventMap | private function buildEventMap()
{
$this->synchronousEventMap = new EventMapping();
$this->asynchronousEventMap = new EventMapping();
$eventMap = NULL;
$annotationName = 'Helmich\\EventBroker\\Annotations\\Listener';
$classes = $this->reflectionService->getClassesCon... | php | private function buildEventMap()
{
$this->synchronousEventMap = new EventMapping();
$this->asynchronousEventMap = new EventMapping();
$eventMap = NULL;
$annotationName = 'Helmich\\EventBroker\\Annotations\\Listener';
$classes = $this->reflectionService->getClassesCon... | [
"private",
"function",
"buildEventMap",
"(",
")",
"{",
"$",
"this",
"->",
"synchronousEventMap",
"=",
"new",
"EventMapping",
"(",
")",
";",
"$",
"this",
"->",
"asynchronousEventMap",
"=",
"new",
"EventMapping",
"(",
")",
";",
"$",
"eventMap",
"=",
"NULL",
... | Builds the event dispatching configuration. | [
"Builds",
"the",
"event",
"dispatching",
"configuration",
"."
] | train | https://github.com/martin-helmich/flow-eventbroker/blob/a08dc966cfddbee4f8ea75d1c682320ac196352d/Classes/Helmich/EventBroker/Broker/Broker.php#L163-L194 |
j-d/draggy | src/Draggy/Autocode/Templates/Base/TemplateBase.php | TemplateBase.setIndentation | public function setIndentation($indentation)
{
if (!is_string($indentation)) {
throw new \InvalidArgumentException('The attribute indentation on the class Template has to be string (' . gettype($indentation) . ('object' === gettype($indentation) ? ' ' . get_class($indentation) : '') . ' given).'... | php | public function setIndentation($indentation)
{
if (!is_string($indentation)) {
throw new \InvalidArgumentException('The attribute indentation on the class Template has to be string (' . gettype($indentation) . ('object' === gettype($indentation) ? ' ' . get_class($indentation) : '') . ' given).'... | [
"public",
"function",
"setIndentation",
"(",
"$",
"indentation",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"indentation",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'The attribute indentation on the class Template has to be string ('",... | Set indentation
@param string $indentation
@return Template
@throws \InvalidArgumentException | [
"Set",
"indentation"
] | train | https://github.com/j-d/draggy/blob/97ffc66e1aacb5f685d7aac5251c4abb8888d4bb/src/Draggy/Autocode/Templates/Base/TemplateBase.php#L54-L63 |
j-d/draggy | src/Draggy/Autocode/Templates/Base/TemplateBase.php | TemplateBase.setIndentationCount | public function setIndentationCount($indentationCount)
{
if (!is_int($indentationCount)) {
throw new \InvalidArgumentException('The attribute indentationCount on the class Template has to be integer (' . gettype($indentationCount) . ('object' === gettype($indentationCount) ? ' ' . get_class($ind... | php | public function setIndentationCount($indentationCount)
{
if (!is_int($indentationCount)) {
throw new \InvalidArgumentException('The attribute indentationCount on the class Template has to be integer (' . gettype($indentationCount) . ('object' === gettype($indentationCount) ? ' ' . get_class($ind... | [
"public",
"function",
"setIndentationCount",
"(",
"$",
"indentationCount",
")",
"{",
"if",
"(",
"!",
"is_int",
"(",
"$",
"indentationCount",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'The attribute indentationCount on the class Template has ... | Set indentationCount
@param integer $indentationCount
@return Template
@throws \InvalidArgumentException | [
"Set",
"indentationCount"
] | train | https://github.com/j-d/draggy/blob/97ffc66e1aacb5f685d7aac5251c4abb8888d4bb/src/Draggy/Autocode/Templates/Base/TemplateBase.php#L84-L93 |
j-d/draggy | src/Draggy/Autocode/Templates/Base/TemplateBase.php | TemplateBase.setEol | public function setEol($eol)
{
if (!is_string($eol)) {
throw new \InvalidArgumentException('The attribute eol on the class Template has to be string (' . gettype($eol) . ('object' === gettype($eol) ? ' ' . get_class($eol) : '') . ' given).');
}
$this->eol = $eol;
return... | php | public function setEol($eol)
{
if (!is_string($eol)) {
throw new \InvalidArgumentException('The attribute eol on the class Template has to be string (' . gettype($eol) . ('object' === gettype($eol) ? ' ' . get_class($eol) : '') . ' given).');
}
$this->eol = $eol;
return... | [
"public",
"function",
"setEol",
"(",
"$",
"eol",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"eol",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'The attribute eol on the class Template has to be string ('",
".",
"gettype",
"(",
"$... | Set eol
@param string $eol
@return Template
@throws \InvalidArgumentException | [
"Set",
"eol"
] | train | https://github.com/j-d/draggy/blob/97ffc66e1aacb5f685d7aac5251c4abb8888d4bb/src/Draggy/Autocode/Templates/Base/TemplateBase.php#L114-L123 |
fccn/oai-pmh-core | src/schemas/ands_lom.php | ANDS_LOM.create_regObjects | protected function create_regObjects()
{
$this->working_node = $this->oai_pmh->addChild($this->working_node, 'lom:lom');
$this->working_node->setAttribute('xmlns:lom', "http://ltsc.ieee.org/xsd/LOM");
$this->working_node->setAttribute('xmlns:dc', "http://purl.org/dc/elements/1.1/");
} | php | protected function create_regObjects()
{
$this->working_node = $this->oai_pmh->addChild($this->working_node, 'lom:lom');
$this->working_node->setAttribute('xmlns:lom', "http://ltsc.ieee.org/xsd/LOM");
$this->working_node->setAttribute('xmlns:dc', "http://purl.org/dc/elements/1.1/");
} | [
"protected",
"function",
"create_regObjects",
"(",
")",
"{",
"$",
"this",
"->",
"working_node",
"=",
"$",
"this",
"->",
"oai_pmh",
"->",
"addChild",
"(",
"$",
"this",
"->",
"working_node",
",",
"'lom:lom'",
")",
";",
"$",
"this",
"->",
"working_node",
"->"... | Override create registry objects to use oai_lom as holder | [
"Override",
"create",
"registry",
"objects",
"to",
"use",
"oai_lom",
"as",
"holder"
] | train | https://github.com/fccn/oai-pmh-core/blob/a9c6852482c7bd7c48911a2165120325ecc27ea2/src/schemas/ands_lom.php#L92-L97 |
fccn/oai-pmh-core | src/schemas/ands_lom.php | ANDS_LOM.generate_metadata | public function generate_metadata($lom_identifier, $res)
{
debug_message('****** In '.__FILE__.' function '.__FUNCTION__.' was called.');
$lom_data = new LOM_DataHolder();
$lom_data->setIdentifiers($lom_identifier, $this->def_catalog);
//debug_var_dump('lom_data->lomdata', $lom_data-... | php | public function generate_metadata($lom_identifier, $res)
{
debug_message('****** In '.__FILE__.' function '.__FUNCTION__.' was called.');
$lom_data = new LOM_DataHolder();
$lom_data->setIdentifiers($lom_identifier, $this->def_catalog);
//debug_var_dump('lom_data->lomdata', $lom_data-... | [
"public",
"function",
"generate_metadata",
"(",
"$",
"lom_identifier",
",",
"$",
"res",
")",
"{",
"debug_message",
"(",
"'****** In '",
".",
"__FILE__",
".",
"' function '",
".",
"__FUNCTION__",
".",
"' was called.'",
")",
";",
"$",
"lom_data",
"=",
"new",
"LO... | Generates metadata xml | [
"Generates",
"metadata",
"xml"
] | train | https://github.com/fccn/oai-pmh-core/blob/a9c6852482c7bd7c48911a2165120325ecc27ea2/src/schemas/ands_lom.php#L102-L120 |
fccn/oai-pmh-core | src/schemas/ands_lom.php | ANDS_LOM.create_lom_node | protected function create_lom_node($top_node, $tag, $value = '')
{
$tag_atts = explode('?', $tag);
$name = array_shift($tag_atts);
$node = '';
if (empty($value)) {
debug_message('tag ::'.$name.':: no value');
$node = $this->addChild($top_node, "lom:".$name);
... | php | protected function create_lom_node($top_node, $tag, $value = '')
{
$tag_atts = explode('?', $tag);
$name = array_shift($tag_atts);
$node = '';
if (empty($value)) {
debug_message('tag ::'.$name.':: no value');
$node = $this->addChild($top_node, "lom:".$name);
... | [
"protected",
"function",
"create_lom_node",
"(",
"$",
"top_node",
",",
"$",
"tag",
",",
"$",
"value",
"=",
"''",
")",
"{",
"$",
"tag_atts",
"=",
"explode",
"(",
"'?'",
",",
"$",
"tag",
")",
";",
"$",
"name",
"=",
"array_shift",
"(",
"$",
"tag_atts",
... | Creates a generic lom:element node | [
"Creates",
"a",
"generic",
"lom",
":",
"element",
"node"
] | train | https://github.com/fccn/oai-pmh-core/blob/a9c6852482c7bd7c48911a2165120325ecc27ea2/src/schemas/ands_lom.php#L125-L145 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.