repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/implementations/query_select_sqlite.php | ezcQuerySelectSqlite.buildRightJoins | private function buildRightJoins()
{
$resultArray = array();
foreach ( $this->rightJoins as $rJoinPart )
{
$oneItemResult = '';
if ( $rJoinPart === null )
{
break; // this is last empty entry so cancel adding.
}
/... | php | private function buildRightJoins()
{
$resultArray = array();
foreach ( $this->rightJoins as $rJoinPart )
{
$oneItemResult = '';
if ( $rJoinPart === null )
{
break; // this is last empty entry so cancel adding.
}
/... | [
"private",
"function",
"buildRightJoins",
"(",
")",
"{",
"$",
"resultArray",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"rightJoins",
"as",
"$",
"rJoinPart",
")",
"{",
"$",
"oneItemResult",
"=",
"''",
";",
"if",
"(",
"$",
"rJoinPar... | Returns SQL string with part of FROM clause that performs right join emulation.
SQLite don't support right joins directly but there is workaround.
identical result could be acheived using right joins for tables in reverce order.
String created from entries of $rightJoins.
One entry is a complete table_reference claus... | [
"Returns",
"SQL",
"string",
"with",
"part",
"of",
"FROM",
"clause",
"that",
"performs",
"right",
"join",
"emulation",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/implementations/query_select_sqlite.php#L141-L171 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/implementations/query_select_sqlite.php | ezcQuerySelectSqlite.rightJoin | public function rightJoin()
{
$args = func_get_args();
$passedArgsCount = func_num_args();
if ( $passedArgsCount < 2 || $passedArgsCount > 4 )
{
throw new ezcQueryInvalidException( 'SELECT', "Wrong argument count passed to {$type}Join(): {$passedArgsCount}" );
}
... | php | public function rightJoin()
{
$args = func_get_args();
$passedArgsCount = func_num_args();
if ( $passedArgsCount < 2 || $passedArgsCount > 4 )
{
throw new ezcQueryInvalidException( 'SELECT', "Wrong argument count passed to {$type}Join(): {$passedArgsCount}" );
}
... | [
"public",
"function",
"rightJoin",
"(",
")",
"{",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"$",
"passedArgsCount",
"=",
"func_num_args",
"(",
")",
";",
"if",
"(",
"$",
"passedArgsCount",
"<",
"2",
"||",
"$",
"passedArgsCount",
">",
"4",
")",
"... | Returns the SQL for a right join or prepares $fromString for a right join.
This method could be used in two forms:
<b>rightJoin( 't2', $joinCondition )</b>
Takes 2 string arguments and returns ezcQuery.
The first parameter is the name of the table to join with. The table to
which is joined should have been previous... | [
"Returns",
"the",
"SQL",
"for",
"a",
"right",
"join",
"or",
"prepares",
"$fromString",
"for",
"a",
"right",
"join",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/implementations/query_select_sqlite.php#L225-L305 |
Eresus/EresusCMS | src/core/Kernel.php | Eresus_Kernel.log | public static function log($sender, $priority, $message)
{
if ($priority > self::$logLevel)
{
return;
}
if (is_array($sender))
{
$sender = implode('/', $sender);
}
if (empty($sender))
{
$sender = 'unknown';
... | php | public static function log($sender, $priority, $message)
{
if ($priority > self::$logLevel)
{
return;
}
if (is_array($sender))
{
$sender = implode('/', $sender);
}
if (empty($sender))
{
$sender = 'unknown';
... | [
"public",
"static",
"function",
"log",
"(",
"$",
"sender",
",",
"$",
"priority",
",",
"$",
"message",
")",
"{",
"if",
"(",
"$",
"priority",
">",
"self",
"::",
"$",
"logLevel",
")",
"{",
"return",
";",
"}",
"if",
"(",
"is_array",
"(",
"$",
"sender",... | Записывает сообщение в журнал
@param string|array $sender отправитель (используйте \__METHOD\__ и \__FUNCTION\__)
@param int $priority уровень важности (используйте константы LOG_xxx)
@param string $message текст сообщение
@param mixed ... аргументы для вставки в $message через {@lin... | [
"Записывает",
"сообщение",
"в",
"журнал"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/Kernel.php#L84-L139 |
Eresus/EresusCMS | src/core/Kernel.php | Eresus_Kernel.logException | public static function logException($e)
{
$previous = $e->getPrevious();
$trace = $e->getTraceAsString();
$logMessage = sprintf(
"%s in %s at %s\n%s\nBacktrace:\n%s\n",
get_class($e),
$e->getFile(),
$e->getLine(),
$e->getMessage(),... | php | public static function logException($e)
{
$previous = $e->getPrevious();
$trace = $e->getTraceAsString();
$logMessage = sprintf(
"%s in %s at %s\n%s\nBacktrace:\n%s\n",
get_class($e),
$e->getFile(),
$e->getLine(),
$e->getMessage(),... | [
"public",
"static",
"function",
"logException",
"(",
"$",
"e",
")",
"{",
"$",
"previous",
"=",
"$",
"e",
"->",
"getPrevious",
"(",
")",
";",
"$",
"trace",
"=",
"$",
"e",
"->",
"getTraceAsString",
"(",
")",
";",
"$",
"logMessage",
"=",
"sprintf",
"(",... | Записывает сообщение об исключении в журнал
@param Exception $e
@since 3.01 | [
"Записывает",
"сообщение",
"об",
"исключении",
"в",
"журнал"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/Kernel.php#L148-L168 |
Eresus/EresusCMS | src/core/Kernel.php | Eresus_Kernel.init | public static function init()
{
/* Разрешаем только однократный вызов этого метода */
if (self::$inited)
{
return;
}
// Устанавливаем кодировку по умолчанию для операций mb_*
mb_internal_encoding('utf-8');
/* Предотвращает появление ошибок, связа... | php | public static function init()
{
/* Разрешаем только однократный вызов этого метода */
if (self::$inited)
{
return;
}
// Устанавливаем кодировку по умолчанию для операций mb_*
mb_internal_encoding('utf-8');
/* Предотвращает появление ошибок, связа... | [
"public",
"static",
"function",
"init",
"(",
")",
"{",
"/* Разрешаем только однократный вызов этого метода */",
"if",
"(",
"self",
"::",
"$",
"inited",
")",
"{",
"return",
";",
"}",
"// Устанавливаем кодировку по умолчанию для операций mb_*",
"mb_internal_encoding",
"(",
... | Инициализация ядра
Этот метод:
1. устанавливает временную зону;
2. регистрирует {@link initExceptionHandling() перехватчики ошибок}.
@return void
@since 3.00 | [
"Инициализация",
"ядра"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/Kernel.php#L181-L199 |
Eresus/EresusCMS | src/core/Kernel.php | Eresus_Kernel.errorHandler | public static function errorHandler($errno, $errstr, $errfile, $errline)
{
/* Нулевое значение 'error_reporting' означает что был использован оператор "@" */
if (error_reporting() == 0)
{
return true;
}
/*
* Примечание: На самом деле этот метод обрабаты... | php | public static function errorHandler($errno, $errstr, $errfile, $errline)
{
/* Нулевое значение 'error_reporting' означает что был использован оператор "@" */
if (error_reporting() == 0)
{
return true;
}
/*
* Примечание: На самом деле этот метод обрабаты... | [
"public",
"static",
"function",
"errorHandler",
"(",
"$",
"errno",
",",
"$",
"errstr",
",",
"$",
"errfile",
",",
"$",
"errline",
")",
"{",
"/* Нулевое значение 'error_reporting' означает что был использован оператор \"@\" */",
"if",
"(",
"error_reporting",
"(",
")",
"... | Обработчик ошибок
Обработчик ошибок, устанавливаемый через {@link set_error_handler() set_error_handler()} в
методе {@link initExceptionHandling()}. Все ошибки важнее E_NOTICE превращаются в исключения
{@link http://php.net/ErrorException ErrorException}.
@param int $errno тип ошибки
@param string $errstr опи... | [
"Обработчик",
"ошибок"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/Kernel.php#L219-L265 |
Eresus/EresusCMS | src/core/Kernel.php | Eresus_Kernel.fatalErrorHandler | public static function fatalErrorHandler($output)
{
// Освобождает резервный буфер
unset($GLOBALS['ERESUS_MEMORY_OVERFLOW_BUFFER']);
if (preg_match('/(parse|fatal) error:.*in .* on line/Ui', $output, $m))
{
$GLOBALS['ERESUS_CORE_FATAL_ERROR_HANDLER'] = true;
s... | php | public static function fatalErrorHandler($output)
{
// Освобождает резервный буфер
unset($GLOBALS['ERESUS_MEMORY_OVERFLOW_BUFFER']);
if (preg_match('/(parse|fatal) error:.*in .* on line/Ui', $output, $m))
{
$GLOBALS['ERESUS_CORE_FATAL_ERROR_HANDLER'] = true;
s... | [
"public",
"static",
"function",
"fatalErrorHandler",
"(",
"$",
"output",
")",
"{",
"// Освобождает резервный буфер",
"unset",
"(",
"$",
"GLOBALS",
"[",
"'ERESUS_MEMORY_OVERFLOW_BUFFER'",
"]",
")",
";",
"if",
"(",
"preg_match",
"(",
"'/(parse|fatal) error:.*in .* on line... | Обработчик фатальных ошибок
Этот обработчик пытается перехватывать сообщения о фатальных ошибках, недоступных при
использовании {@link set_error_handler() set_error_handler()}. Это делается через обработчик
{@link ob_start() ob_start()}, устанавливаемый в методе {@link initExceptionHandling()}.
<i>Замечание по произв... | [
"Обработчик",
"фатальных",
"ошибок"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/Kernel.php#L285-L318 |
Eresus/EresusCMS | src/core/Kernel.php | Eresus_Kernel.autoload | public static function autoload($className)
{
/*
* Классы Eresus
*/
if (stripos($className, 'Eresus_') === 0)
{
$fileName = dirname(__FILE__) . DIRECTORY_SEPARATOR .
str_replace('_', DIRECTORY_SEPARATOR, substr($className, 7)) . '.php';
... | php | public static function autoload($className)
{
/*
* Классы Eresus
*/
if (stripos($className, 'Eresus_') === 0)
{
$fileName = dirname(__FILE__) . DIRECTORY_SEPARATOR .
str_replace('_', DIRECTORY_SEPARATOR, substr($className, 7)) . '.php';
... | [
"public",
"static",
"function",
"autoload",
"(",
"$",
"className",
")",
"{",
"/*\n * Классы Eresus\n */",
"if",
"(",
"stripos",
"(",
"$",
"className",
",",
"'Eresus_'",
")",
"===",
"0",
")",
"{",
"$",
"fileName",
"=",
"dirname",
"(",
"__FILE__"... | Автозагрузчик классов
Работает только для классов «Eresus_*». Из имени класса удаляется префикс «Eresus_», все
символы в имени класса «_» заменяются на разделитель директорий, добавляется суффикс «.php».
Таким образом класс «Eresus_HTTP_Request» будет искаться в файле «core/HTTP/Request.php».
Устанавливается через {... | [
"Автозагрузчик",
"классов"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/Kernel.php#L340-L384 |
Eresus/EresusCMS | src/core/Kernel.php | Eresus_Kernel.exec | public static function exec($class)
{
if (!class_exists($class))
{
throw new LogicException('Application class "' . $class . '" does not exists');
}
self::$app = new $class();
if (!method_exists($class, 'main'))
{
self::$app = null;
... | php | public static function exec($class)
{
if (!class_exists($class))
{
throw new LogicException('Application class "' . $class . '" does not exists');
}
self::$app = new $class();
if (!method_exists($class, 'main'))
{
self::$app = null;
... | [
"public",
"static",
"function",
"exec",
"(",
"$",
"class",
")",
"{",
"if",
"(",
"!",
"class_exists",
"(",
"$",
"class",
")",
")",
"{",
"throw",
"new",
"LogicException",
"(",
"'Application class \"'",
".",
"$",
"class",
".",
"'\" does not exists'",
")",
";"... | Создаёт экземпляр приложения и выполняет его
Класс приложения должен содержать публичный метод main(), который будет вызван после создания
экземпляра класса.
@param string $class имя класса приложения
@throws LogicException если класс $class не найден или не содержит метода «main()»
@return int код завершения (0 ... | [
"Создаёт",
"экземпляр",
"приложения",
"и",
"выполняет",
"его"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/Kernel.php#L492-L524 |
Eresus/EresusCMS | src/core/Kernel.php | Eresus_Kernel.initExceptionHandling | private static function initExceptionHandling()
{
/* Резервируем буфер на случай переполнения памяти */
$GLOBALS['ERESUS_MEMORY_OVERFLOW_BUFFER'] =
str_repeat('x', self::MEMORY_OVERFLOW_BUFFER_SIZE * 1024);
/* Меняем значения php.ini */
ini_set('html_errors', 0); // Немн... | php | private static function initExceptionHandling()
{
/* Резервируем буфер на случай переполнения памяти */
$GLOBALS['ERESUS_MEMORY_OVERFLOW_BUFFER'] =
str_repeat('x', self::MEMORY_OVERFLOW_BUFFER_SIZE * 1024);
/* Меняем значения php.ini */
ini_set('html_errors', 0); // Немн... | [
"private",
"static",
"function",
"initExceptionHandling",
"(",
")",
"{",
"/* Резервируем буфер на случай переполнения памяти */",
"$",
"GLOBALS",
"[",
"'ERESUS_MEMORY_OVERFLOW_BUFFER'",
"]",
"=",
"str_repeat",
"(",
"'x'",
",",
"self",
"::",
"MEMORY_OVERFLOW_BUFFER_SIZE",
"*... | Инициализирует обработчики ошибок
Этот метод:
1. резервирует в памяти буфер, освобождаемый для обработки ошибок нехватки памяти;
2. отключает HTML-оформление стандартных сообщений об ошибках;
3. регистрирует {@link errorHandler()};
4. регистрирует {@link fatalErrorHandler()}.
@return void
@since 3.00
@uses Eresus_Lo... | [
"Инициализирует",
"обработчики",
"ошибок"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/Kernel.php#L559-L588 |
php-lug/lug | src/Bundle/GridBundle/Batch/Type/DeleteType.php | DeleteType.batch | public function batch($data, array $options)
{
if (!is_array($data) && !$data instanceof \Traversable) {
return;
}
$grid = $options['grid'];
$domainManager = $this->domainManagerRegistry[$grid->getResource()->getName()];
$api = $this->parameterResolver->resolveAp... | php | public function batch($data, array $options)
{
if (!is_array($data) && !$data instanceof \Traversable) {
return;
}
$grid = $options['grid'];
$domainManager = $this->domainManagerRegistry[$grid->getResource()->getName()];
$api = $this->parameterResolver->resolveAp... | [
"public",
"function",
"batch",
"(",
"$",
"data",
",",
"array",
"$",
"options",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"data",
")",
"&&",
"!",
"$",
"data",
"instanceof",
"\\",
"Traversable",
")",
"{",
"return",
";",
"}",
"$",
"grid",
"=",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/GridBundle/Batch/Type/DeleteType.php#L49-L72 |
geocoder-php/GeocoderServiceProvider | src/Geocoder/Provider/GeocoderServiceProvider.php | GeocoderServiceProvider.register | public function register(Container $app)
{
$this->injectServices($app);
if (isset($app['profiler'])) {
$this->injectDataCollector($app);
}
} | php | public function register(Container $app)
{
$this->injectServices($app);
if (isset($app['profiler'])) {
$this->injectDataCollector($app);
}
} | [
"public",
"function",
"register",
"(",
"Container",
"$",
"app",
")",
"{",
"$",
"this",
"->",
"injectServices",
"(",
"$",
"app",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"app",
"[",
"'profiler'",
"]",
")",
")",
"{",
"$",
"this",
"->",
"injectDataCollec... | {@inheritdoc} | [
"{"
] | train | https://github.com/geocoder-php/GeocoderServiceProvider/blob/9bb850f5ac881b4d317d569c87e0573faa69e4bb/src/Geocoder/Provider/GeocoderServiceProvider.php#L19-L26 |
geocoder-php/GeocoderServiceProvider | src/Geocoder/Provider/GeocoderServiceProvider.php | GeocoderServiceProvider.injectServices | protected function injectServices(Container $app)
{
if (isset($app['profiler'])) {
$app['geocoder.logger'] = function($app) {
return new \Geocoder\Logger\GeocoderLogger();
};
$app['geocoder'] = function($app) {
$geocoder = new \Geocoder\Lo... | php | protected function injectServices(Container $app)
{
if (isset($app['profiler'])) {
$app['geocoder.logger'] = function($app) {
return new \Geocoder\Logger\GeocoderLogger();
};
$app['geocoder'] = function($app) {
$geocoder = new \Geocoder\Lo... | [
"protected",
"function",
"injectServices",
"(",
"Container",
"$",
"app",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"app",
"[",
"'profiler'",
"]",
")",
")",
"{",
"$",
"app",
"[",
"'geocoder.logger'",
"]",
"=",
"function",
"(",
"$",
"app",
")",
"{",
"ret... | Injects Geocoder related services in the application. | [
"Injects",
"Geocoder",
"related",
"services",
"in",
"the",
"application",
"."
] | train | https://github.com/geocoder-php/GeocoderServiceProvider/blob/9bb850f5ac881b4d317d569c87e0573faa69e4bb/src/Geocoder/Provider/GeocoderServiceProvider.php#L31-L61 |
geocoder-php/GeocoderServiceProvider | src/Geocoder/Provider/GeocoderServiceProvider.php | GeocoderServiceProvider.injectDataCollector | protected function injectDataCollector(Container $app)
{
$app['data_collector.templates'] = $app->extend('data_collector.templates', function ($templates) {
$templates[] = ['geocoder', '@Geocoder/Collector/geocoder.html.twig'];
return $templates;
});
$app['data_coll... | php | protected function injectDataCollector(Container $app)
{
$app['data_collector.templates'] = $app->extend('data_collector.templates', function ($templates) {
$templates[] = ['geocoder', '@Geocoder/Collector/geocoder.html.twig'];
return $templates;
});
$app['data_coll... | [
"protected",
"function",
"injectDataCollector",
"(",
"Container",
"$",
"app",
")",
"{",
"$",
"app",
"[",
"'data_collector.templates'",
"]",
"=",
"$",
"app",
"->",
"extend",
"(",
"'data_collector.templates'",
",",
"function",
"(",
"$",
"templates",
")",
"{",
"$... | Injects Geocoder's data collector in the profiler | [
"Injects",
"Geocoder",
"s",
"data",
"collector",
"in",
"the",
"profiler"
] | train | https://github.com/geocoder-php/GeocoderServiceProvider/blob/9bb850f5ac881b4d317d569c87e0573faa69e4bb/src/Geocoder/Provider/GeocoderServiceProvider.php#L66-L91 |
ouropencode/dachi | src/Collections.php | Collections.asArray | public static function asArray($collection, $safe = false, $eager = false) {
$elements = array();
foreach($collection as $key => $element)
$elements[] = $element->asArray($safe, $eager);
return $elements;
} | php | public static function asArray($collection, $safe = false, $eager = false) {
$elements = array();
foreach($collection as $key => $element)
$elements[] = $element->asArray($safe, $eager);
return $elements;
} | [
"public",
"static",
"function",
"asArray",
"(",
"$",
"collection",
",",
"$",
"safe",
"=",
"false",
",",
"$",
"eager",
"=",
"false",
")",
"{",
"$",
"elements",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"collection",
"as",
"$",
"key",
"=>",
"... | Retrieve all the Collections's data in an array
Models should implement this method themselves and provide the required
data. Models can omit this, it just means you can't use it.
@param ArrayCollection $collection The collection to operate upon
@param bool $safe Should we return only data we consider "publicly expos... | [
"Retrieve",
"all",
"the",
"Collections",
"s",
"data",
"in",
"an",
"array"
] | train | https://github.com/ouropencode/dachi/blob/a0e1daf269d0345afbb859ce20ef9da6decd7efe/src/Collections.php#L26-L33 |
HedronDev/hedron | src/Command/CommandStack.php | CommandStack.execute | public function execute() {
$this->output->writeln('<info>' . shell_exec(implode('; ', $this->commands)) . '</info>');
$this->commands = [];
} | php | public function execute() {
$this->output->writeln('<info>' . shell_exec(implode('; ', $this->commands)) . '</info>');
$this->commands = [];
} | [
"public",
"function",
"execute",
"(",
")",
"{",
"$",
"this",
"->",
"output",
"->",
"writeln",
"(",
"'<info>'",
".",
"shell_exec",
"(",
"implode",
"(",
"'; '",
",",
"$",
"this",
"->",
"commands",
")",
")",
".",
"'</info>'",
")",
";",
"$",
"this",
"->"... | {@inheritdoc} | [
"{"
] | train | https://github.com/HedronDev/hedron/blob/3b4adec4912f2d7c0b7e7262dc36515fbc2e8e00/src/Command/CommandStack.php#L39-L42 |
webdevvie/pheanstalk-task-queue-bundle | Command/TaskCleanupCommand.php | TaskCleanupCommand.execute | protected function execute(InputInterface $input, OutputInterface $output)
{
$this->initialiseWorker($input, $output);
$timePeriod = $input->getOption('period');
$this->taskQueueService->cleanUpTasks($timePeriod);
} | php | protected function execute(InputInterface $input, OutputInterface $output)
{
$this->initialiseWorker($input, $output);
$timePeriod = $input->getOption('period');
$this->taskQueueService->cleanUpTasks($timePeriod);
} | [
"protected",
"function",
"execute",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"this",
"->",
"initialiseWorker",
"(",
"$",
"input",
",",
"$",
"output",
")",
";",
"$",
"timePeriod",
"=",
"$",
"input",
"->",
... | {@inheritDoc}
@param InputInterface $input
@param OutputInterface $output
@return void
@throws \InvalidArgumentException | [
"{",
"@inheritDoc",
"}"
] | train | https://github.com/webdevvie/pheanstalk-task-queue-bundle/blob/db5e63a8f844e345dc2e69ce8e94b32d851020eb/Command/TaskCleanupCommand.php#L46-L51 |
SporkCode/Spork | src/ServiceManager/ClassAbstractFactory.php | ClassAbstractFactory.canCreateServiceWithName | public function canCreateServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)
{
$config = $serviceLocator->get('config');
$class = $this->getClass($config, $requestedName);
return $class && class_exists($class);
} | php | public function canCreateServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)
{
$config = $serviceLocator->get('config');
$class = $this->getClass($config, $requestedName);
return $class && class_exists($class);
} | [
"public",
"function",
"canCreateServiceWithName",
"(",
"ServiceLocatorInterface",
"$",
"serviceLocator",
",",
"$",
"name",
",",
"$",
"requestedName",
")",
"{",
"$",
"config",
"=",
"$",
"serviceLocator",
"->",
"get",
"(",
"'config'",
")",
";",
"$",
"class",
"="... | Test if configuration exists and has class field
@see \Zend\ServiceManager\AbstractFactoryInterface::canCreateServiceWithName()
@param ServiceLocatorInterface $serviceLocator
@param string $name
@param string $requestedName
@return boolean | [
"Test",
"if",
"configuration",
"exists",
"and",
"has",
"class",
"field"
] | train | https://github.com/SporkCode/Spork/blob/7f569efdc0ceb4a9c1c7a8b648b6a7ed50d2088a/src/ServiceManager/ClassAbstractFactory.php#L29-L34 |
SporkCode/Spork | src/ServiceManager/ClassAbstractFactory.php | ClassAbstractFactory.createServiceWithName | public function createServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)
{
$config = $serviceLocator->get('config');
$class = $this->getClass($config, $requestedName);
return new $class($config[$requestedName]);
} | php | public function createServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)
{
$config = $serviceLocator->get('config');
$class = $this->getClass($config, $requestedName);
return new $class($config[$requestedName]);
} | [
"public",
"function",
"createServiceWithName",
"(",
"ServiceLocatorInterface",
"$",
"serviceLocator",
",",
"$",
"name",
",",
"$",
"requestedName",
")",
"{",
"$",
"config",
"=",
"$",
"serviceLocator",
"->",
"get",
"(",
"'config'",
")",
";",
"$",
"class",
"=",
... | Create and configure class by creating new instance of class from
configuration
@see \Zend\ServiceManager\AbstractFactoryInterface::createServiceWithName()
@param ServiceLocatorInterface $serviceLocator
@param string $name
@param string $requestedName
@return mixed | [
"Create",
"and",
"configure",
"class",
"by",
"creating",
"new",
"instance",
"of",
"class",
"from",
"configuration"
] | train | https://github.com/SporkCode/Spork/blob/7f569efdc0ceb4a9c1c7a8b648b6a7ed50d2088a/src/ServiceManager/ClassAbstractFactory.php#L46-L51 |
SporkCode/Spork | src/ServiceManager/ClassAbstractFactory.php | ClassAbstractFactory.getClass | protected function getClass($config, $name)
{
if (array_key_exists($name, $config)
&& is_array($config[$name])
&& array_key_exists('class', $config[$name])
&& is_scalar($config[$name]['class'])) {
return $config[$name]['class'];
}
... | php | protected function getClass($config, $name)
{
if (array_key_exists($name, $config)
&& is_array($config[$name])
&& array_key_exists('class', $config[$name])
&& is_scalar($config[$name]['class'])) {
return $config[$name]['class'];
}
... | [
"protected",
"function",
"getClass",
"(",
"$",
"config",
",",
"$",
"name",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"name",
",",
"$",
"config",
")",
"&&",
"is_array",
"(",
"$",
"config",
"[",
"$",
"name",
"]",
")",
"&&",
"array_key_exists",
... | Look for class name in configuration
@param array $config
@param string $name
@return boolean | [
"Look",
"for",
"class",
"name",
"in",
"configuration"
] | train | https://github.com/SporkCode/Spork/blob/7f569efdc0ceb4a9c1c7a8b648b6a7ed50d2088a/src/ServiceManager/ClassAbstractFactory.php#L60-L70 |
sciactive/nymph-server | src/Drivers/SQLite3Driver.php | SQLite3Driver.connect | public function connect() {
// Check that the SQLite3 extension is installed.
if (!class_exists('SQLite3')) {
throw new Exceptions\UnableToConnectException(
'SQLite3 PHP extension is not available. It probably has not '.
'been installed. Please install and configure it in order to use ... | php | public function connect() {
// Check that the SQLite3 extension is installed.
if (!class_exists('SQLite3')) {
throw new Exceptions\UnableToConnectException(
'SQLite3 PHP extension is not available. It probably has not '.
'been installed. Please install and configure it in order to use ... | [
"public",
"function",
"connect",
"(",
")",
"{",
"// Check that the SQLite3 extension is installed.",
"if",
"(",
"!",
"class_exists",
"(",
"'SQLite3'",
")",
")",
"{",
"throw",
"new",
"Exceptions",
"\\",
"UnableToConnectException",
"(",
"'SQLite3 PHP extension is not availa... | Connect to the SQLite3 database.
@return bool Whether this instance is connected to a SQLite3 database
after the method has run. | [
"Connect",
"to",
"the",
"SQLite3",
"database",
"."
] | train | https://github.com/sciactive/nymph-server/blob/3c18dbf45c2750d07c798e14534dba87387beeba/src/Drivers/SQLite3Driver.php#L47-L86 |
sciactive/nymph-server | src/Drivers/SQLite3Driver.php | SQLite3Driver.disconnect | public function disconnect() {
if ($this->connected) {
if (is_a($this->link, 'SQLite3')) {
$this->link->exec("PRAGMA optimize;");
$this->link->close();
}
$this->connected = false;
}
return $this->connected;
} | php | public function disconnect() {
if ($this->connected) {
if (is_a($this->link, 'SQLite3')) {
$this->link->exec("PRAGMA optimize;");
$this->link->close();
}
$this->connected = false;
}
return $this->connected;
} | [
"public",
"function",
"disconnect",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"connected",
")",
"{",
"if",
"(",
"is_a",
"(",
"$",
"this",
"->",
"link",
",",
"'SQLite3'",
")",
")",
"{",
"$",
"this",
"->",
"link",
"->",
"exec",
"(",
"\"PRAGMA opti... | Disconnect from the SQLite3 database.
@return bool Whether this instance is connected to a SQLite3 database
after the method has run. | [
"Disconnect",
"from",
"the",
"SQLite3",
"database",
"."
] | train | https://github.com/sciactive/nymph-server/blob/3c18dbf45c2750d07c798e14534dba87387beeba/src/Drivers/SQLite3Driver.php#L94-L103 |
sciactive/nymph-server | src/Drivers/SQLite3Driver.php | SQLite3Driver.createTables | private function createTables($etype = null) {
$this->checkReadOnlyMode();
$this->query("SAVEPOINT 'tablecreation';");
try {
if (isset($etype)) {
$etype = '_'.SQLite3::escapeString($etype);
// Create the entity table.
$this->query("CREATE TABLE IF NOT EXISTS \"{$this->prefix}e... | php | private function createTables($etype = null) {
$this->checkReadOnlyMode();
$this->query("SAVEPOINT 'tablecreation';");
try {
if (isset($etype)) {
$etype = '_'.SQLite3::escapeString($etype);
// Create the entity table.
$this->query("CREATE TABLE IF NOT EXISTS \"{$this->prefix}e... | [
"private",
"function",
"createTables",
"(",
"$",
"etype",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"checkReadOnlyMode",
"(",
")",
";",
"$",
"this",
"->",
"query",
"(",
"\"SAVEPOINT 'tablecreation';\"",
")",
";",
"try",
"{",
"if",
"(",
"isset",
"(",
"$",... | Create entity tables in the database.
@param string $etype The entity type to create a table for. If this is
blank, the default tables are created. | [
"Create",
"entity",
"tables",
"in",
"the",
"database",
"."
] | train | https://github.com/sciactive/nymph-server/blob/3c18dbf45c2750d07c798e14534dba87387beeba/src/Drivers/SQLite3Driver.php#L122-L167 |
sciactive/nymph-server | src/Drivers/SQLite3Driver.php | SQLite3Driver.makeEntityQuery | private function makeEntityQuery(
$options,
$selectors,
$etypeDirty,
$subquery = false
) {
$fullQueryCoverage = true;
$sort = $options['sort'] ?? 'cdate';
$etype = '_'.SQLite3::escapeString($etypeDirty);
$queryParts = $this->iterateSelectorsForQuery($selectors, function ($value... | php | private function makeEntityQuery(
$options,
$selectors,
$etypeDirty,
$subquery = false
) {
$fullQueryCoverage = true;
$sort = $options['sort'] ?? 'cdate';
$etype = '_'.SQLite3::escapeString($etypeDirty);
$queryParts = $this->iterateSelectorsForQuery($selectors, function ($value... | [
"private",
"function",
"makeEntityQuery",
"(",
"$",
"options",
",",
"$",
"selectors",
",",
"$",
"etypeDirty",
",",
"$",
"subquery",
"=",
"false",
")",
"{",
"$",
"fullQueryCoverage",
"=",
"true",
";",
"$",
"sort",
"=",
"$",
"options",
"[",
"'sort'",
"]",
... | Generate the SQLite3 query.
@param array $options The options array.
@param array $selectors The formatted selector array.
@param string $etypeDirty
@param bool $subquery Whether only a subquery should be returned.
@return string The SQL query. | [
"Generate",
"the",
"SQLite3",
"query",
"."
] | train | https://github.com/sciactive/nymph-server/blob/3c18dbf45c2750d07c798e14534dba87387beeba/src/Drivers/SQLite3Driver.php#L308-L901 |
spiral-modules/listing | source/Listing/StaticState.php | StaticState.getValue | public function getValue($filter, $default = null)
{
if (array_key_exists($filter, $this->filters)) {
return $this->filters[$filter];
}
return $default;
} | php | public function getValue($filter, $default = null)
{
if (array_key_exists($filter, $this->filters)) {
return $this->filters[$filter];
}
return $default;
} | [
"public",
"function",
"getValue",
"(",
"$",
"filter",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"filter",
",",
"$",
"this",
"->",
"filters",
")",
")",
"{",
"return",
"$",
"this",
"->",
"filters",
"[",
"$",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/spiral-modules/listing/blob/89abe8939ce91cbf61b51b99e93ce1e57c8af83c/source/Listing/StaticState.php#L107-L114 |
surebert/surebert-framework | src/sb/Email/Reader.php | Reader.log | public function log($message)
{
if (!empty($this->log_file)) {
//echo $message;
\file_put_contents($this->log_file, "\n" . $message, \FILE_APPEND);
}
} | php | public function log($message)
{
if (!empty($this->log_file)) {
//echo $message;
\file_put_contents($this->log_file, "\n" . $message, \FILE_APPEND);
}
} | [
"public",
"function",
"log",
"(",
"$",
"message",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"log_file",
")",
")",
"{",
"//echo $message;",
"\\",
"file_put_contents",
"(",
"$",
"this",
"->",
"log_file",
",",
"\"\\n\"",
".",
"$",
"messag... | Logs messages to a log file if it is set
@param string $message | [
"Logs",
"messages",
"to",
"a",
"log",
"file",
"if",
"it",
"is",
"set"
] | train | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Email/Reader.php#L160-L167 |
surebert/surebert-framework | src/sb/Email/Reader.php | Reader.open | public function open()
{
//check for mail
$host = "{" . $this->host . ":" . $this->port . "/" . $this->protocol . "/notls}INBOX";
//open the mail box for reading
$this->inbox = \imap_open($host, $this->address, $this->pass);
if (!$this->inbox) {
$this->connect... | php | public function open()
{
//check for mail
$host = "{" . $this->host . ":" . $this->port . "/" . $this->protocol . "/notls}INBOX";
//open the mail box for reading
$this->inbox = \imap_open($host, $this->address, $this->pass);
if (!$this->inbox) {
$this->connect... | [
"public",
"function",
"open",
"(",
")",
"{",
"//check for mail",
"$",
"host",
"=",
"\"{\"",
".",
"$",
"this",
"->",
"host",
".",
"\":\"",
".",
"$",
"this",
"->",
"port",
".",
"\"/\"",
".",
"$",
"this",
"->",
"protocol",
".",
"\"/notls}INBOX\"",
";",
... | Opens the inbox and returns the connection status | [
"Opens",
"the",
"inbox",
"and",
"returns",
"the",
"connection",
"status"
] | train | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Email/Reader.php#L173-L191 |
surebert/surebert-framework | src/sb/Email/Reader.php | Reader.close | public function close($expunge)
{
//expunge emails set to delete if delete_after_read is set
if ($expunge) {
\imap_close($this->inbox, CL_EXPUNGE);
} else {
\imap_close($this->inbox);
}
} | php | public function close($expunge)
{
//expunge emails set to delete if delete_after_read is set
if ($expunge) {
\imap_close($this->inbox, CL_EXPUNGE);
} else {
\imap_close($this->inbox);
}
} | [
"public",
"function",
"close",
"(",
"$",
"expunge",
")",
"{",
"//expunge emails set to delete if delete_after_read is set",
"if",
"(",
"$",
"expunge",
")",
"{",
"\\",
"imap_close",
"(",
"$",
"this",
"->",
"inbox",
",",
"CL_EXPUNGE",
")",
";",
"}",
"else",
"{",... | Closes the inbox and expunges deleted messages if expunge is true
@param boolean $expunge true expunges | [
"Closes",
"the",
"inbox",
"and",
"expunges",
"deleted",
"messages",
"if",
"expunge",
"is",
"true"
] | train | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Email/Reader.php#L198-L206 |
surebert/surebert-framework | src/sb/Email/Reader.php | Reader.parseHeaderInfo | public function parseHeaderInfo(Email &$email, $header)
{
//map the most useful header info to the email object itself
$email->all_headers = $header;
$email->subject = $header->subject;
$email->to = $header->to[0]->mailbox . '@' . $header->to[0]->host;
$email->from = $header... | php | public function parseHeaderInfo(Email &$email, $header)
{
//map the most useful header info to the email object itself
$email->all_headers = $header;
$email->subject = $header->subject;
$email->to = $header->to[0]->mailbox . '@' . $header->to[0]->host;
$email->from = $header... | [
"public",
"function",
"parseHeaderInfo",
"(",
"Email",
"&",
"$",
"email",
",",
"$",
"header",
")",
"{",
"//map the most useful header info to the email object itself",
"$",
"email",
"->",
"all_headers",
"=",
"$",
"header",
";",
"$",
"email",
"->",
"subject",
"=",
... | Parses header information from an email and returns it to as properties of the email object
@param sb_Email $email
@param object $header | [
"Parses",
"header",
"information",
"from",
"an",
"email",
"and",
"returns",
"it",
"to",
"as",
"properties",
"of",
"the",
"email",
"object"
] | train | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Email/Reader.php#L255-L275 |
surebert/surebert-framework | src/sb/Email/Reader.php | Reader.examinePart | private function examinePart(&$email, $part)
{
//echo '<br />'.$part->part_id.' '.$part->type.' '.$part->dparameters[0]->value;
//get subtype JPEG, WAV, HTML, PLAIN, etc
$subtype = \strtolower($part->subtype);
//get encoding 0 = 7bit, 1= 8bit, 2=binary, 3=base64, 4=quoted prinatble,... | php | private function examinePart(&$email, $part)
{
//echo '<br />'.$part->part_id.' '.$part->type.' '.$part->dparameters[0]->value;
//get subtype JPEG, WAV, HTML, PLAIN, etc
$subtype = \strtolower($part->subtype);
//get encoding 0 = 7bit, 1= 8bit, 2=binary, 3=base64, 4=quoted prinatble,... | [
"private",
"function",
"examinePart",
"(",
"&",
"$",
"email",
",",
"$",
"part",
")",
"{",
"//echo '<br />'.$part->part_id.' '.$part->type.' '.$part->dparameters[0]->value;",
"//get subtype JPEG, WAV, HTML, PLAIN, etc",
"$",
"subtype",
"=",
"\\",
"strtolower",
"(",
"$",
"par... | Check in an email part for attachments and data
@param \sb\Email $email The email being examined
@param object $part The current part
@param string $part_id The id of the part | [
"Check",
"in",
"an",
"email",
"part",
"for",
"attachments",
"and",
"data"
] | train | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Email/Reader.php#L284-L337 |
surebert/surebert-framework | src/sb/Email/Reader.php | Reader.fetchMessages | public function fetchMessages()
{
//count the messages
$this->countMessages();
//if there are zero emails report this to the user
if ($this->email_count == 0) {
$this->log('There are no emails to process!');
return false;
}
$this->log($thi... | php | public function fetchMessages()
{
//count the messages
$this->countMessages();
//if there are zero emails report this to the user
if ($this->email_count == 0) {
$this->log('There are no emails to process!');
return false;
}
$this->log($thi... | [
"public",
"function",
"fetchMessages",
"(",
")",
"{",
"//count the messages",
"$",
"this",
"->",
"countMessages",
"(",
")",
";",
"//if there are zero emails report this to the user",
"if",
"(",
"$",
"this",
"->",
"email_count",
"==",
"0",
")",
"{",
"$",
"this",
... | Fetches all the messages in an inbox and put them in the emails array
@return returns the array of all email objects found | [
"Fetches",
"all",
"the",
"messages",
"in",
"an",
"inbox",
"and",
"put",
"them",
"in",
"the",
"emails",
"array"
] | train | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Email/Reader.php#L344-L421 |
Litecms/Team | src/Http/Controllers/TeamResourceController.php | TeamResourceController.index | public function index(TeamRequest $request)
{
$view = $this->response->theme->listView();
if ($this->response->typeIs('json')) {
$function = camel_case('get-' . $view);
return $this->repository
->setPresenter(\Litecms\Team\Repositories\Presenter\TeamPresenter... | php | public function index(TeamRequest $request)
{
$view = $this->response->theme->listView();
if ($this->response->typeIs('json')) {
$function = camel_case('get-' . $view);
return $this->repository
->setPresenter(\Litecms\Team\Repositories\Presenter\TeamPresenter... | [
"public",
"function",
"index",
"(",
"TeamRequest",
"$",
"request",
")",
"{",
"$",
"view",
"=",
"$",
"this",
"->",
"response",
"->",
"theme",
"->",
"listView",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"response",
"->",
"typeIs",
"(",
"'json'",
")"... | Display a list of team.
@return Response | [
"Display",
"a",
"list",
"of",
"team",
"."
] | train | https://github.com/Litecms/Team/blob/a444a6a6604c969df138ac0eb57ed5f4696b0f00/src/Http/Controllers/TeamResourceController.php#L38-L55 |
Litecms/Team | src/Http/Controllers/TeamResourceController.php | TeamResourceController.show | public function show(TeamRequest $request, Team $team)
{
if ($team->exists) {
$view = 'team::team.show';
} else {
$view = 'team::team.new';
}
return $this->response->title(trans('app.view') . ' ' . trans('team::team.name'))
->data(compact('team')... | php | public function show(TeamRequest $request, Team $team)
{
if ($team->exists) {
$view = 'team::team.show';
} else {
$view = 'team::team.new';
}
return $this->response->title(trans('app.view') . ' ' . trans('team::team.name'))
->data(compact('team')... | [
"public",
"function",
"show",
"(",
"TeamRequest",
"$",
"request",
",",
"Team",
"$",
"team",
")",
"{",
"if",
"(",
"$",
"team",
"->",
"exists",
")",
"{",
"$",
"view",
"=",
"'team::team.show'",
";",
"}",
"else",
"{",
"$",
"view",
"=",
"'team::team.new'",
... | Display team.
@param Request $request
@param Model $team
@return Response | [
"Display",
"team",
"."
] | train | https://github.com/Litecms/Team/blob/a444a6a6604c969df138ac0eb57ed5f4696b0f00/src/Http/Controllers/TeamResourceController.php#L65-L78 |
Litecms/Team | src/Http/Controllers/TeamResourceController.php | TeamResourceController.edit | public function edit(TeamRequest $request, Team $team)
{
return $this->response->title(trans('app.edit') . ' ' . trans('team::team.name'))
->view('team::team.edit', true)
->data(compact('team'))
->output();
} | php | public function edit(TeamRequest $request, Team $team)
{
return $this->response->title(trans('app.edit') . ' ' . trans('team::team.name'))
->view('team::team.edit', true)
->data(compact('team'))
->output();
} | [
"public",
"function",
"edit",
"(",
"TeamRequest",
"$",
"request",
",",
"Team",
"$",
"team",
")",
"{",
"return",
"$",
"this",
"->",
"response",
"->",
"title",
"(",
"trans",
"(",
"'app.edit'",
")",
".",
"' '",
".",
"trans",
"(",
"'team::team.name'",
")",
... | Show team for editing.
@param Request $request
@param Model $team
@return Response | [
"Show",
"team",
"for",
"editing",
"."
] | train | https://github.com/Litecms/Team/blob/a444a6a6604c969df138ac0eb57ed5f4696b0f00/src/Http/Controllers/TeamResourceController.php#L135-L141 |
Litecms/Team | src/Http/Controllers/TeamResourceController.php | TeamResourceController.update | public function update(TeamRequest $request, Team $team)
{
try {
$attributes = $request->all();
$team->update($attributes);
return $this->response->message(trans('messages.success.updated', ['Module' => trans('team::team.name')]))
->code(204)
... | php | public function update(TeamRequest $request, Team $team)
{
try {
$attributes = $request->all();
$team->update($attributes);
return $this->response->message(trans('messages.success.updated', ['Module' => trans('team::team.name')]))
->code(204)
... | [
"public",
"function",
"update",
"(",
"TeamRequest",
"$",
"request",
",",
"Team",
"$",
"team",
")",
"{",
"try",
"{",
"$",
"attributes",
"=",
"$",
"request",
"->",
"all",
"(",
")",
";",
"$",
"team",
"->",
"update",
"(",
"$",
"attributes",
")",
";",
"... | Update the team.
@param Request $request
@param Model $team
@return Response | [
"Update",
"the",
"team",
"."
] | train | https://github.com/Litecms/Team/blob/a444a6a6604c969df138ac0eb57ed5f4696b0f00/src/Http/Controllers/TeamResourceController.php#L151-L170 |
Litecms/Team | src/Http/Controllers/TeamResourceController.php | TeamResourceController.destroy | public function destroy(TeamRequest $request, Team $team)
{
try {
$team->delete();
return $this->response->message(trans('messages.success.deleted', ['Module' => trans('team::team.name')]))
->code(202)
->status('success')
->url(guard_u... | php | public function destroy(TeamRequest $request, Team $team)
{
try {
$team->delete();
return $this->response->message(trans('messages.success.deleted', ['Module' => trans('team::team.name')]))
->code(202)
->status('success')
->url(guard_u... | [
"public",
"function",
"destroy",
"(",
"TeamRequest",
"$",
"request",
",",
"Team",
"$",
"team",
")",
"{",
"try",
"{",
"$",
"team",
"->",
"delete",
"(",
")",
";",
"return",
"$",
"this",
"->",
"response",
"->",
"message",
"(",
"trans",
"(",
"'messages.suc... | Remove the team.
@param Model $team
@return Response | [
"Remove",
"the",
"team",
"."
] | train | https://github.com/Litecms/Team/blob/a444a6a6604c969df138ac0eb57ed5f4696b0f00/src/Http/Controllers/TeamResourceController.php#L179-L199 |
chrometoasters/silverstripe-image-quality | src/Extensions/ImageQualityExtension.php | ImageQualityExtension.Quality | public function Quality($quality)
{
// Generate variant key
$variant = $this->owner->variantName(__FUNCTION__, $quality);
// Instruct the backend to search for an existing variant and use the callback to provide it if it does not exist.
return $this->owner->manipulateImage($variant,... | php | public function Quality($quality)
{
// Generate variant key
$variant = $this->owner->variantName(__FUNCTION__, $quality);
// Instruct the backend to search for an existing variant and use the callback to provide it if it does not exist.
return $this->owner->manipulateImage($variant,... | [
"public",
"function",
"Quality",
"(",
"$",
"quality",
")",
"{",
"// Generate variant key",
"$",
"variant",
"=",
"$",
"this",
"->",
"owner",
"->",
"variantName",
"(",
"__FUNCTION__",
",",
"$",
"quality",
")",
";",
"// Instruct the backend to search for an existing va... | This function adjusts the quality of of an image using SilverStripe 4 syntax.
@param $quality
@return mixed | [
"This",
"function",
"adjusts",
"the",
"quality",
"of",
"of",
"an",
"image",
"using",
"SilverStripe",
"4",
"syntax",
"."
] | train | https://github.com/chrometoasters/silverstripe-image-quality/blob/73947f9def3a596918059d5f472a212bc80d9fbc/src/Extensions/ImageQualityExtension.php#L19-L31 |
DevGroup-ru/yii2-users-module | src/widgets/ManageSocialNetworksWidget.php | ManageSocialNetworksWidget.renderMainContent | protected function renderMainContent()
{
echo Html::beginTag('div', ['class' => 'social-login']);
echo Html::tag('h2', Yii::t('users', 'Add social service'));
foreach ($this->getClients() as $externalService) {
if (!in_array(get_class($externalService), array_keys($this->servic... | php | protected function renderMainContent()
{
echo Html::beginTag('div', ['class' => 'social-login']);
echo Html::tag('h2', Yii::t('users', 'Add social service'));
foreach ($this->getClients() as $externalService) {
if (!in_array(get_class($externalService), array_keys($this->servic... | [
"protected",
"function",
"renderMainContent",
"(",
")",
"{",
"echo",
"Html",
"::",
"beginTag",
"(",
"'div'",
",",
"[",
"'class'",
"=>",
"'social-login'",
"]",
")",
";",
"echo",
"Html",
"::",
"tag",
"(",
"'h2'",
",",
"Yii",
"::",
"t",
"(",
"'users'",
",... | Renders the main content, which includes all external services links. | [
"Renders",
"the",
"main",
"content",
"which",
"includes",
"all",
"external",
"services",
"links",
"."
] | train | https://github.com/DevGroup-ru/yii2-users-module/blob/ff0103dc55c3462627ccc704c33e70c96053f750/src/widgets/ManageSocialNetworksWidget.php#L18-L42 |
zhouyl/mellivora | Mellivora/Database/DatabaseManager.php | DatabaseManager.configuration | protected function configuration($name)
{
$name = $name ?: $this->getDefaultConnection();
// To get the database connection configuration, we will just pull each of the
// connection configurations and get the configurations for the given name.
// If the configuration doesn't exist,... | php | protected function configuration($name)
{
$name = $name ?: $this->getDefaultConnection();
// To get the database connection configuration, we will just pull each of the
// connection configurations and get the configurations for the given name.
// If the configuration doesn't exist,... | [
"protected",
"function",
"configuration",
"(",
"$",
"name",
")",
"{",
"$",
"name",
"=",
"$",
"name",
"?",
":",
"$",
"this",
"->",
"getDefaultConnection",
"(",
")",
";",
"// To get the database connection configuration, we will just pull each of the",
"// connection conf... | Get the configuration for a connection.
@param string $name
@throws \InvalidArgumentException
@return array | [
"Get",
"the",
"configuration",
"for",
"a",
"connection",
"."
] | train | https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Database/DatabaseManager.php#L133-L147 |
zhouyl/mellivora | Mellivora/Database/DatabaseManager.php | DatabaseManager.configure | protected function configure(Connection $connection, $type)
{
$connection = $this->setPdoForType($connection, $type);
// First we'll set the fetch mode and a few other dependencies of the database
// connection. This method basically just configures and prepares it to get
// used by... | php | protected function configure(Connection $connection, $type)
{
$connection = $this->setPdoForType($connection, $type);
// First we'll set the fetch mode and a few other dependencies of the database
// connection. This method basically just configures and prepares it to get
// used by... | [
"protected",
"function",
"configure",
"(",
"Connection",
"$",
"connection",
",",
"$",
"type",
")",
"{",
"$",
"connection",
"=",
"$",
"this",
"->",
"setPdoForType",
"(",
"$",
"connection",
",",
"$",
"type",
")",
";",
"// First we'll set the fetch mode and a few o... | Prepare the database connection instance.
@param \Mellivora\Database\Connection $connection
@param string $type
@return \Mellivora\Database\Connection | [
"Prepare",
"the",
"database",
"connection",
"instance",
"."
] | train | https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Database/DatabaseManager.php#L157-L176 |
FriendsOfApi/phraseapp | src/Api/HttpApi.php | HttpApi.httpPatch | protected function httpPatch(string $path, $body, array $requestHeaders = []): ResponseInterface
{
$requestHeaders['Content-Type'] = 'application/json';
return $response = $this->httpClient->sendRequest(
$this->requestBuilder->create('PATCH', $path, $requestHeaders, json_encode($body))
... | php | protected function httpPatch(string $path, $body, array $requestHeaders = []): ResponseInterface
{
$requestHeaders['Content-Type'] = 'application/json';
return $response = $this->httpClient->sendRequest(
$this->requestBuilder->create('PATCH', $path, $requestHeaders, json_encode($body))
... | [
"protected",
"function",
"httpPatch",
"(",
"string",
"$",
"path",
",",
"$",
"body",
",",
"array",
"$",
"requestHeaders",
"=",
"[",
"]",
")",
":",
"ResponseInterface",
"{",
"$",
"requestHeaders",
"[",
"'Content-Type'",
"]",
"=",
"'application/json'",
";",
"re... | Send a PATCH request with json encoded data.
@param string $path Request path
@param array|string $body Request body
@param array $requestHeaders Request headers
@return ResponseInterface | [
"Send",
"a",
"PATCH",
"request",
"with",
"json",
"encoded",
"data",
"."
] | train | https://github.com/FriendsOfApi/phraseapp/blob/1553bf857eb0858f9a7eb905b085864d24f80886/src/Api/HttpApi.php#L151-L158 |
FriendsOfApi/phraseapp | src/Api/HttpApi.php | HttpApi.handleErrors | protected function handleErrors(ResponseInterface $response)
{
switch ($response->getStatusCode()) {
case 401:
throw new DomainExceptions\InvalidApiKeyException('Invalid API key');
break;
case 403:
throw new DomainExceptions\Insufficien... | php | protected function handleErrors(ResponseInterface $response)
{
switch ($response->getStatusCode()) {
case 401:
throw new DomainExceptions\InvalidApiKeyException('Invalid API key');
break;
case 403:
throw new DomainExceptions\Insufficien... | [
"protected",
"function",
"handleErrors",
"(",
"ResponseInterface",
"$",
"response",
")",
"{",
"switch",
"(",
"$",
"response",
"->",
"getStatusCode",
"(",
")",
")",
"{",
"case",
"401",
":",
"throw",
"new",
"DomainExceptions",
"\\",
"InvalidApiKeyException",
"(",
... | Handle HTTP errors.
Call is controlled by the specific API methods.
@param ResponseInterface $response
@throws DomainException | [
"Handle",
"HTTP",
"errors",
"."
] | train | https://github.com/FriendsOfApi/phraseapp/blob/1553bf857eb0858f9a7eb905b085864d24f80886/src/Api/HttpApi.php#L169-L189 |
impensavel/essence | src/XML.php | XML.getCurrentNode | protected function getCurrentNode()
{
// Clear the libXML error buffer
libxml_clear_errors();
$node = @$this->reader->expand();
$error = libxml_get_last_error();
if ($error instanceof LibXMLError) {
// Only throw exceptions when the level is ERROR or FATAL
... | php | protected function getCurrentNode()
{
// Clear the libXML error buffer
libxml_clear_errors();
$node = @$this->reader->expand();
$error = libxml_get_last_error();
if ($error instanceof LibXMLError) {
// Only throw exceptions when the level is ERROR or FATAL
... | [
"protected",
"function",
"getCurrentNode",
"(",
")",
"{",
"// Clear the libXML error buffer",
"libxml_clear_errors",
"(",
")",
";",
"$",
"node",
"=",
"@",
"$",
"this",
"->",
"reader",
"->",
"expand",
"(",
")",
";",
"$",
"error",
"=",
"libxml_get_last_error",
"... | Get the current node
@throws EssenceException
@return DOMNode | [
"Get",
"the",
"current",
"node"
] | train | https://github.com/impensavel/essence/blob/e74969e55ac889e8c2cab9a915f82e93a72e629e/src/XML.php#L118-L139 |
impensavel/essence | src/XML.php | XML.nextElement | protected function nextElement()
{
do {
if (! $this->reader->read()) {
return false;
}
// Pop previous levels from the stack
$this->stack = array_slice($this->stack, 0, $this->reader->depth, true);
// Push the current Element to t... | php | protected function nextElement()
{
do {
if (! $this->reader->read()) {
return false;
}
// Pop previous levels from the stack
$this->stack = array_slice($this->stack, 0, $this->reader->depth, true);
// Push the current Element to t... | [
"protected",
"function",
"nextElement",
"(",
")",
"{",
"do",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"reader",
"->",
"read",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"// Pop previous levels from the stack",
"$",
"this",
"->",
"stack",
"=",
"array... | Read the next Element and handle skipping
@return bool | [
"Read",
"the",
"next",
"Element",
"and",
"handle",
"skipping"
] | train | https://github.com/impensavel/essence/blob/e74969e55ac889e8c2cab9a915f82e93a72e629e/src/XML.php#L146-L167 |
impensavel/essence | src/XML.php | XML.getData | protected function getData($xpath)
{
$xpath = trim($xpath, '/');
if (isset($this->data[$xpath])) {
return $this->data[$xpath];
}
throw new EssenceException('Unregistered Element XPath: "/'.$xpath.'"');
} | php | protected function getData($xpath)
{
$xpath = trim($xpath, '/');
if (isset($this->data[$xpath])) {
return $this->data[$xpath];
}
throw new EssenceException('Unregistered Element XPath: "/'.$xpath.'"');
} | [
"protected",
"function",
"getData",
"(",
"$",
"xpath",
")",
"{",
"$",
"xpath",
"=",
"trim",
"(",
"$",
"xpath",
",",
"'/'",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"data",
"[",
"$",
"xpath",
"]",
")",
")",
"{",
"return",
"$",
"this... | Get registered Element data
@param string $xpath Element XPath
@throws EssenceException
@return mixed | [
"Get",
"registered",
"Element",
"data"
] | train | https://github.com/impensavel/essence/blob/e74969e55ac889e8c2cab9a915f82e93a72e629e/src/XML.php#L189-L198 |
impensavel/essence | src/XML.php | XML.prepare | protected function prepare($input, array $config)
{
if ($input instanceof SplFileInfo) {
if (@$this->reader->open($input->getPathname(), $config['encoding'], $config['options'])) {
return;
}
throw new EssenceException('Could not open "'.$input->getPathnam... | php | protected function prepare($input, array $config)
{
if ($input instanceof SplFileInfo) {
if (@$this->reader->open($input->getPathname(), $config['encoding'], $config['options'])) {
return;
}
throw new EssenceException('Could not open "'.$input->getPathnam... | [
"protected",
"function",
"prepare",
"(",
"$",
"input",
",",
"array",
"$",
"config",
")",
"{",
"if",
"(",
"$",
"input",
"instanceof",
"SplFileInfo",
")",
"{",
"if",
"(",
"@",
"$",
"this",
"->",
"reader",
"->",
"open",
"(",
"$",
"input",
"->",
"getPath... | Prepare data for extraction
@param mixed $input Input data
@param array $config Configuration settings
@throws EssenceException
@return void | [
"Prepare",
"data",
"for",
"extraction"
] | train | https://github.com/impensavel/essence/blob/e74969e55ac889e8c2cab9a915f82e93a72e629e/src/XML.php#L208-L245 |
impensavel/essence | src/XML.php | XML.DOMNodeChildCount | protected static function DOMNodeChildCount(DOMNode $node)
{
$count = 0;
if ($node->hasChildNodes()) {
foreach ($node->childNodes as $child) {
if ($child->nodeType == XML_ELEMENT_NODE) {
$count++;
}
}
}
ret... | php | protected static function DOMNodeChildCount(DOMNode $node)
{
$count = 0;
if ($node->hasChildNodes()) {
foreach ($node->childNodes as $child) {
if ($child->nodeType == XML_ELEMENT_NODE) {
$count++;
}
}
}
ret... | [
"protected",
"static",
"function",
"DOMNodeChildCount",
"(",
"DOMNode",
"$",
"node",
")",
"{",
"$",
"count",
"=",
"0",
";",
"if",
"(",
"$",
"node",
"->",
"hasChildNodes",
"(",
")",
")",
"{",
"foreach",
"(",
"$",
"node",
"->",
"childNodes",
"as",
"$",
... | Count the children of a DOMNode
@static
@param DOMNode $node
@return int | [
"Count",
"the",
"children",
"of",
"a",
"DOMNode"
] | train | https://github.com/impensavel/essence/blob/e74969e55ac889e8c2cab9a915f82e93a72e629e/src/XML.php#L254-L267 |
impensavel/essence | src/XML.php | XML.DOMNodeAttributes | protected static function DOMNodeAttributes(DOMNode $node)
{
$attributes = array();
foreach ($node->attributes as $attribute) {
$attributes[$attribute->name] = $attribute->value;
}
return $attributes;
} | php | protected static function DOMNodeAttributes(DOMNode $node)
{
$attributes = array();
foreach ($node->attributes as $attribute) {
$attributes[$attribute->name] = $attribute->value;
}
return $attributes;
} | [
"protected",
"static",
"function",
"DOMNodeAttributes",
"(",
"DOMNode",
"$",
"node",
")",
"{",
"$",
"attributes",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"node",
"->",
"attributes",
"as",
"$",
"attribute",
")",
"{",
"$",
"attributes",
"[",
"$",... | Get the DONNode attributes
@static
@param DOMNode $node
@return array | [
"Get",
"the",
"DONNode",
"attributes"
] | train | https://github.com/impensavel/essence/blob/e74969e55ac889e8c2cab9a915f82e93a72e629e/src/XML.php#L276-L285 |
impensavel/essence | src/XML.php | XML.DOMNodeValue | protected static function DOMNodeValue(DOMNode $node, $associative = false, $attributes = false)
{
// Return the value immediately when we're dealing with a leaf
// node without attributes or we simply don't want them included
if (static::DOMNodeChildCount($node) == 0 && ($node->hasAttribute... | php | protected static function DOMNodeValue(DOMNode $node, $associative = false, $attributes = false)
{
// Return the value immediately when we're dealing with a leaf
// node without attributes or we simply don't want them included
if (static::DOMNodeChildCount($node) == 0 && ($node->hasAttribute... | [
"protected",
"static",
"function",
"DOMNodeValue",
"(",
"DOMNode",
"$",
"node",
",",
"$",
"associative",
"=",
"false",
",",
"$",
"attributes",
"=",
"false",
")",
"{",
"// Return the value immediately when we're dealing with a leaf",
"// node without attributes or we simply ... | Get the DOMNode value
@static
@param DOMNode $node
@param bool $associative Return associative array?
@param bool $attributes Include node attributes?
@return mixed | [
"Get",
"the",
"DOMNode",
"value"
] | train | https://github.com/impensavel/essence/blob/e74969e55ac889e8c2cab9a915f82e93a72e629e/src/XML.php#L296-L330 |
impensavel/essence | src/XML.php | XML.DOMNodeListToArray | public static function DOMNodeListToArray(DOMNodeList $nodeList, $associative = false, $attributes = false)
{
$nodes = array();
foreach ($nodeList as $node) {
$nodes[] = static::DOMNodeValue($node, $associative, $attributes);
}
return $nodes;
} | php | public static function DOMNodeListToArray(DOMNodeList $nodeList, $associative = false, $attributes = false)
{
$nodes = array();
foreach ($nodeList as $node) {
$nodes[] = static::DOMNodeValue($node, $associative, $attributes);
}
return $nodes;
} | [
"public",
"static",
"function",
"DOMNodeListToArray",
"(",
"DOMNodeList",
"$",
"nodeList",
",",
"$",
"associative",
"=",
"false",
",",
"$",
"attributes",
"=",
"false",
")",
"{",
"$",
"nodes",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"nodeList",
... | Convert a DOMNodeList into an Array
@static
@param DOMNodeList $nodeList
@param bool $associative Return associative array?
@param bool $attributes Include node attributes?
@return array | [
"Convert",
"a",
"DOMNodeList",
"into",
"an",
"Array"
] | train | https://github.com/impensavel/essence/blob/e74969e55ac889e8c2cab9a915f82e93a72e629e/src/XML.php#L341-L350 |
impensavel/essence | src/XML.php | XML.extract | public function extract($input, array $config = array(), &$data = null)
{
$config = array_replace_recursive(array(
'encoding' => 'UTF-8',
'options' => LIBXML_PARSEHUGE,
), $config);
$this->prepare($input, $config);
while ($this->nextElement()) {
... | php | public function extract($input, array $config = array(), &$data = null)
{
$config = array_replace_recursive(array(
'encoding' => 'UTF-8',
'options' => LIBXML_PARSEHUGE,
), $config);
$this->prepare($input, $config);
while ($this->nextElement()) {
... | [
"public",
"function",
"extract",
"(",
"$",
"input",
",",
"array",
"$",
"config",
"=",
"array",
"(",
")",
",",
"&",
"$",
"data",
"=",
"null",
")",
"{",
"$",
"config",
"=",
"array_replace_recursive",
"(",
"array",
"(",
"'encoding'",
"=>",
"'UTF-8'",
",",... | {@inheritdoc} | [
"{"
] | train | https://github.com/impensavel/essence/blob/e74969e55ac889e8c2cab9a915f82e93a72e629e/src/XML.php#L355-L411 |
impensavel/essence | src/XML.php | XML.dump | public function dump($input, array $config = array())
{
$config = array_replace_recursive(array(
'encoding' => 'UTF-8',
'options' => LIBXML_PARSEHUGE,
), $config);
$this->prepare($input, $config);
$paths = array();
while ($this->nextElement()) {
... | php | public function dump($input, array $config = array())
{
$config = array_replace_recursive(array(
'encoding' => 'UTF-8',
'options' => LIBXML_PARSEHUGE,
), $config);
$this->prepare($input, $config);
$paths = array();
while ($this->nextElement()) {
... | [
"public",
"function",
"dump",
"(",
"$",
"input",
",",
"array",
"$",
"config",
"=",
"array",
"(",
")",
")",
"{",
"$",
"config",
"=",
"array_replace_recursive",
"(",
"array",
"(",
"'encoding'",
"=>",
"'UTF-8'",
",",
"'options'",
"=>",
"LIBXML_PARSEHUGE",
","... | Dump XPaths and all their occurrences
@param mixed $input Input data
@param array $config Configuration settings (optional)
@return array | [
"Dump",
"XPaths",
"and",
"all",
"their",
"occurrences"
] | train | https://github.com/impensavel/essence/blob/e74969e55ac889e8c2cab9a915f82e93a72e629e/src/XML.php#L420-L438 |
mridang/magazine | lib/magento/Validator.php | Mage_Connect_Validator.compareStabilities | public function compareStabilities($s1, $s2)
{
$list = $this->getStabilities();
$tmp = array_combine(array_values($list),array_keys($list));
if(!isset($tmp[$s1], $tmp[$s2])) {
throw new Exception("Invalid stability in compareStabilities argument");
}
// 'stable... | php | public function compareStabilities($s1, $s2)
{
$list = $this->getStabilities();
$tmp = array_combine(array_values($list),array_keys($list));
if(!isset($tmp[$s1], $tmp[$s2])) {
throw new Exception("Invalid stability in compareStabilities argument");
}
// 'stable... | [
"public",
"function",
"compareStabilities",
"(",
"$",
"s1",
",",
"$",
"s2",
")",
"{",
"$",
"list",
"=",
"$",
"this",
"->",
"getStabilities",
"(",
")",
";",
"$",
"tmp",
"=",
"array_combine",
"(",
"array_values",
"(",
"$",
"list",
")",
",",
"array_keys",... | Compare stabilities. Returns:
-1 if the first stability is lower than the second
0 if they are equal
1 if the second is lower.
@param $s1
@param $s2
@return int | [
"Compare",
"stabilities",
".",
"Returns",
":"
] | train | https://github.com/mridang/magazine/blob/5b3cfecc472c61fde6af63efe62690a30a267a04/lib/magento/Validator.php#L57-L78 |
mridang/magazine | lib/magento/Validator.php | Mage_Connect_Validator.validateLicenseUrl | public function validateLicenseUrl($str)
{
if ($str) {
return ( $this->validateUrl($str) || $this->validatePackageName($str));
}
return true;
} | php | public function validateLicenseUrl($str)
{
if ($str) {
return ( $this->validateUrl($str) || $this->validatePackageName($str));
}
return true;
} | [
"public",
"function",
"validateLicenseUrl",
"(",
"$",
"str",
")",
"{",
"if",
"(",
"$",
"str",
")",
"{",
"return",
"(",
"$",
"this",
"->",
"validateUrl",
"(",
"$",
"str",
")",
"||",
"$",
"this",
"->",
"validatePackageName",
"(",
"$",
"str",
")",
")",
... | Validate License url
@param mixed $str
@return boolean | [
"Validate",
"License",
"url"
] | train | https://github.com/mridang/magazine/blob/5b3cfecc472c61fde6af63efe62690a30a267a04/lib/magento/Validator.php#L116-L122 |
mridang/magazine | lib/magento/Validator.php | Mage_Connect_Validator.validateCompatible | public function validateCompatible(array $data)
{
if(!count($data)) {
/**
* Allow empty
*/
return true;
}
$count = 0;
foreach($data as $k=>$v) {
foreach(array('name','channel','min','max') as $fld) {
$$fld ... | php | public function validateCompatible(array $data)
{
if(!count($data)) {
/**
* Allow empty
*/
return true;
}
$count = 0;
foreach($data as $k=>$v) {
foreach(array('name','channel','min','max') as $fld) {
$$fld ... | [
"public",
"function",
"validateCompatible",
"(",
"array",
"$",
"data",
")",
"{",
"if",
"(",
"!",
"count",
"(",
"$",
"data",
")",
")",
"{",
"/**\n * Allow empty\n */",
"return",
"true",
";",
"}",
"$",
"count",
"=",
"0",
";",
"foreach",... | Validate compatible data
@param array $data
@return bool | [
"Validate",
"compatible",
"data"
] | train | https://github.com/mridang/magazine/blob/5b3cfecc472c61fde6af63efe62690a30a267a04/lib/magento/Validator.php#L129-L167 |
mridang/magazine | lib/magento/Validator.php | Mage_Connect_Validator.validateAuthors | public function validateAuthors(array $authors)
{
if(!count($authors)) {
$this->addError('Empty authors section');
return false;
}
$count = 0;
foreach($authors as $k=>$v) {
$count++;
array_map('trim', $v);
$name = $v['name']... | php | public function validateAuthors(array $authors)
{
if(!count($authors)) {
$this->addError('Empty authors section');
return false;
}
$count = 0;
foreach($authors as $k=>$v) {
$count++;
array_map('trim', $v);
$name = $v['name']... | [
"public",
"function",
"validateAuthors",
"(",
"array",
"$",
"authors",
")",
"{",
"if",
"(",
"!",
"count",
"(",
"$",
"authors",
")",
")",
"{",
"$",
"this",
"->",
"addError",
"(",
"'Empty authors section'",
")",
";",
"return",
"false",
";",
"}",
"$",
"co... | Validate authors of package
@param array $authors
@return bool | [
"Validate",
"authors",
"of",
"package"
] | train | https://github.com/mridang/magazine/blob/5b3cfecc472c61fde6af63efe62690a30a267a04/lib/magento/Validator.php#L174-L201 |
mridang/magazine | lib/magento/Validator.php | Mage_Connect_Validator.getErrors | public function getErrors($clear = true)
{
$out = $this->_errors;
if($clear) {
$this->clearErrors();
}
return $out;
} | php | public function getErrors($clear = true)
{
$out = $this->_errors;
if($clear) {
$this->clearErrors();
}
return $out;
} | [
"public",
"function",
"getErrors",
"(",
"$",
"clear",
"=",
"true",
")",
"{",
"$",
"out",
"=",
"$",
"this",
"->",
"_errors",
";",
"if",
"(",
"$",
"clear",
")",
"{",
"$",
"this",
"->",
"clearErrors",
"(",
")",
";",
"}",
"return",
"$",
"out",
";",
... | Get errors
@param bool $clear if true after this call erros will be cleared
@return array | [
"Get",
"errors"
] | train | https://github.com/mridang/magazine/blob/5b3cfecc472c61fde6af63efe62690a30a267a04/lib/magento/Validator.php#L255-L262 |
mridang/magazine | lib/magento/Validator.php | Mage_Connect_Validator.validateDate | public function validateDate($date)
{
$subs = null;
$check1 = preg_match("/^([\d]{4})-([\d]{2})-([\d]{2})$/i", $date, $subs);
if(!$check1) {
return false;
}
return checkdate($subs[2], $subs[3], $subs[1]);
} | php | public function validateDate($date)
{
$subs = null;
$check1 = preg_match("/^([\d]{4})-([\d]{2})-([\d]{2})$/i", $date, $subs);
if(!$check1) {
return false;
}
return checkdate($subs[2], $subs[3], $subs[1]);
} | [
"public",
"function",
"validateDate",
"(",
"$",
"date",
")",
"{",
"$",
"subs",
"=",
"null",
";",
"$",
"check1",
"=",
"preg_match",
"(",
"\"/^([\\d]{4})-([\\d]{2})-([\\d]{2})$/i\"",
",",
"$",
"date",
",",
"$",
"subs",
")",
";",
"if",
"(",
"!",
"$",
"check... | Validate date format
@param $date
@return bool | [
"Validate",
"date",
"format"
] | train | https://github.com/mridang/magazine/blob/5b3cfecc472c61fde6af63efe62690a30a267a04/lib/magento/Validator.php#L293-L301 |
juskiewicz/Geolocation | src/Http/AbstractHttp.php | AbstractHttp.getUrlContents | protected function getUrlContents(string $url) : string
{
$response = $this->getHttpClient()->get(
$url,
['future' => true]
);
$statusCode = $response->getStatusCode();
if (401 === $statusCode || 403 === $statusCode) {
throw new InvalidCredentials... | php | protected function getUrlContents(string $url) : string
{
$response = $this->getHttpClient()->get(
$url,
['future' => true]
);
$statusCode = $response->getStatusCode();
if (401 === $statusCode || 403 === $statusCode) {
throw new InvalidCredentials... | [
"protected",
"function",
"getUrlContents",
"(",
"string",
"$",
"url",
")",
":",
"string",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"getHttpClient",
"(",
")",
"->",
"get",
"(",
"$",
"url",
",",
"[",
"'future'",
"=>",
"true",
"]",
")",
";",
"$",
... | Get URL and return contents. If content is empty, an exception will be thrown.
@param string $url
@return string
@throws InvalidCredentials
@throws InvalidServerResponse
@throws QuotaExceeded | [
"Get",
"URL",
"and",
"return",
"contents",
".",
"If",
"content",
"is",
"empty",
"an",
"exception",
"will",
"be",
"thrown",
"."
] | train | https://github.com/juskiewicz/Geolocation/blob/5d3cd393961b92bdfbe2dfe631fbfb62c72dc36d/src/Http/AbstractHttp.php#L32-L54 |
digipolisgent/robo-digipolis-package | src/ThemeCompile.php | ThemeCompile.run | public function run()
{
// Print the output of the compile commands.
$this->printed();
if (file_exists($this->dir . '/Gemfile')) {
$bundle = $this->findExecutable('bundle');
$this->processes[] = new Process(
$this->receiveCommand($bundle . ' install --... | php | public function run()
{
// Print the output of the compile commands.
$this->printed();
if (file_exists($this->dir . '/Gemfile')) {
$bundle = $this->findExecutable('bundle');
$this->processes[] = new Process(
$this->receiveCommand($bundle . ' install --... | [
"public",
"function",
"run",
"(",
")",
"{",
"// Print the output of the compile commands.",
"$",
"this",
"->",
"printed",
"(",
")",
";",
"if",
"(",
"file_exists",
"(",
"$",
"this",
"->",
"dir",
".",
"'/Gemfile'",
")",
")",
"{",
"$",
"bundle",
"=",
"$",
"... | {@inheritdoc} | [
"{"
] | train | https://github.com/digipolisgent/robo-digipolis-package/blob/6f206f32d910992d27b2a1b4dda1c5e7d8259b75/src/ThemeCompile.php#L46-L112 |
nonzod/yii2-foundation | ActiveField.php | ActiveField.hint | public function hint($content, $options = []) {
$options = array_merge($this->hintOptions, $options, [
'id' => 'hint-' . Html::getInputId($this->model, $this->attribute)
]);
$tag = ArrayHelper::remove($options, 'tag', 'p');
$this->parts['{hint}'] = Html::tag($tag, $content, $options);
retu... | php | public function hint($content, $options = []) {
$options = array_merge($this->hintOptions, $options, [
'id' => 'hint-' . Html::getInputId($this->model, $this->attribute)
]);
$tag = ArrayHelper::remove($options, 'tag', 'p');
$this->parts['{hint}'] = Html::tag($tag, $content, $options);
retu... | [
"public",
"function",
"hint",
"(",
"$",
"content",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"options",
"=",
"array_merge",
"(",
"$",
"this",
"->",
"hintOptions",
",",
"$",
"options",
",",
"[",
"'id'",
"=>",
"'hint-'",
".",
"Html",
"::",
"... | Renders the hint tag.
@param string $content the hint content. It will NOT be HTML-encoded.
@param array $options the tag options in terms of name-value pairs. These will be rendered as
the attributes of the hint tag. The values will be HTML-encoded using [[Html::encode()]].
The following options are specially handled... | [
"Renders",
"the",
"hint",
"tag",
".",
"@param",
"string",
"$content",
"the",
"hint",
"content",
".",
"It",
"will",
"NOT",
"be",
"HTML",
"-",
"encoded",
".",
"@param",
"array",
"$options",
"the",
"tag",
"options",
"in",
"terms",
"of",
"name",
"-",
"value"... | train | https://github.com/nonzod/yii2-foundation/blob/5df93b8a39a73a7fade2f3189693fdb6625205d2/ActiveField.php#L76-L85 |
nonzod/yii2-foundation | ActiveField.php | ActiveField.input | public function input($type, $options = []) {
$options = array_merge($this->inputOptions, [
'class' => 'hint-' . Html::getInputId($this->model, $this->attribute)
]);
$this->adjustLabelFor($options);
$this->parts['{input}'] = Html::activeInput($type, $this->model, $this->attribute, $options);
... | php | public function input($type, $options = []) {
$options = array_merge($this->inputOptions, [
'class' => 'hint-' . Html::getInputId($this->model, $this->attribute)
]);
$this->adjustLabelFor($options);
$this->parts['{input}'] = Html::activeInput($type, $this->model, $this->attribute, $options);
... | [
"public",
"function",
"input",
"(",
"$",
"type",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"options",
"=",
"array_merge",
"(",
"$",
"this",
"->",
"inputOptions",
",",
"[",
"'class'",
"=>",
"'hint-'",
".",
"Html",
"::",
"getInputId",
"(",
"$"... | Renders an input tag.
@param string $type the input type (e.g. 'text', 'password')
@param array $options the tag options in terms of name-value pairs. These will be rendered as
the attributes of the resulting tag. The values will be HTML-encoded using [[Html::encode()]].
@return static the field object itself | [
"Renders",
"an",
"input",
"tag",
"."
] | train | https://github.com/nonzod/yii2-foundation/blob/5df93b8a39a73a7fade2f3189693fdb6625205d2/ActiveField.php#L94-L102 |
nonzod/yii2-foundation | ActiveField.php | ActiveField.textInput | public function textInput($options = []) {
$options = array_merge($this->inputOptions, $options, [
'aria-describedby' => 'hint-' . Html::getInputId($this->model, $this->attribute)
]);
$this->adjustLabelFor($options);
$this->parts['{input}'] = Html::activeTextInput($this->model, $this->attribute,... | php | public function textInput($options = []) {
$options = array_merge($this->inputOptions, $options, [
'aria-describedby' => 'hint-' . Html::getInputId($this->model, $this->attribute)
]);
$this->adjustLabelFor($options);
$this->parts['{input}'] = Html::activeTextInput($this->model, $this->attribute,... | [
"public",
"function",
"textInput",
"(",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"options",
"=",
"array_merge",
"(",
"$",
"this",
"->",
"inputOptions",
",",
"$",
"options",
",",
"[",
"'aria-describedby'",
"=>",
"'hint-'",
".",
"Html",
"::",
"getInpu... | Renders a text input.
This method will generate the "name" and "value" tag attributes automatically for the model attribute
unless they are explicitly specified in `$options`.
@param array $options the tag options in terms of name-value pairs. These will be rendered as
the attributes of the resulting tag. The values wi... | [
"Renders",
"a",
"text",
"input",
".",
"This",
"method",
"will",
"generate",
"the",
"name",
"and",
"value",
"tag",
"attributes",
"automatically",
"for",
"the",
"model",
"attribute",
"unless",
"they",
"are",
"explicitly",
"specified",
"in",
"$options",
"."
] | train | https://github.com/nonzod/yii2-foundation/blob/5df93b8a39a73a7fade2f3189693fdb6625205d2/ActiveField.php#L112-L120 |
ShaoZeMing/laravel-merchant | src/Grid/Filter/Presenter/Text.php | Text.inputmask | public function inputmask($options = [], $icon = 'pencil') : self
{
$options = json_encode($options);
Merchant::script("$('#filter-modal input.{$this->filter->getId()}').inputmask($options);");
$this->icon = $icon;
return $this;
} | php | public function inputmask($options = [], $icon = 'pencil') : self
{
$options = json_encode($options);
Merchant::script("$('#filter-modal input.{$this->filter->getId()}').inputmask($options);");
$this->icon = $icon;
return $this;
} | [
"public",
"function",
"inputmask",
"(",
"$",
"options",
"=",
"[",
"]",
",",
"$",
"icon",
"=",
"'pencil'",
")",
":",
"self",
"{",
"$",
"options",
"=",
"json_encode",
"(",
"$",
"options",
")",
";",
"Merchant",
"::",
"script",
"(",
"\"$('#filter-modal input... | @param array $options
@param string $icon
@return $this | [
"@param",
"array",
"$options",
"@param",
"string",
"$icon"
] | train | https://github.com/ShaoZeMing/laravel-merchant/blob/20801b1735e7832a6e58b37c2c391328f8d626fa/src/Grid/Filter/Presenter/Text.php#L160-L169 |
heidelpay/PhpDoc | src/phpDocumentor/Command/Helper/ConfigurationHelper.php | ConfigurationHelper.getOption | public function getOption(
InputInterface $input,
$name,
$configPath = null,
$default = null,
$commaSeparated = false
) {
$value = $input->getOption($name);
// find value in config
if ($this->valueIsEmpty($value) && $configPath !== null) {
... | php | public function getOption(
InputInterface $input,
$name,
$configPath = null,
$default = null,
$commaSeparated = false
) {
$value = $input->getOption($name);
// find value in config
if ($this->valueIsEmpty($value) && $configPath !== null) {
... | [
"public",
"function",
"getOption",
"(",
"InputInterface",
"$",
"input",
",",
"$",
"name",
",",
"$",
"configPath",
"=",
"null",
",",
"$",
"default",
"=",
"null",
",",
"$",
"commaSeparated",
"=",
"false",
")",
"{",
"$",
"value",
"=",
"$",
"input",
"->",
... | Returns the value of an option from the command-line parameters,
configuration or given default.
@param InputInterface $input Input interface to query for information
@param string $name Name of the option to retrieve from argv
@param string|null $configPath Path to the config eleme... | [
"Returns",
"the",
"value",
"of",
"an",
"option",
"from",
"the",
"command",
"-",
"line",
"parameters",
"configuration",
"or",
"given",
"default",
"."
] | train | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Command/Helper/ConfigurationHelper.php#L62-L84 |
heidelpay/PhpDoc | src/phpDocumentor/Command/Helper/ConfigurationHelper.php | ConfigurationHelper.splitCommaSeparatedValues | protected function splitCommaSeparatedValues($value)
{
if (!is_array($value) || (count($value) == 1) && is_string(current($value))) {
$value = (array) $value;
$value = explode(',', $value[0]);
}
return $value;
} | php | protected function splitCommaSeparatedValues($value)
{
if (!is_array($value) || (count($value) == 1) && is_string(current($value))) {
$value = (array) $value;
$value = explode(',', $value[0]);
}
return $value;
} | [
"protected",
"function",
"splitCommaSeparatedValues",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"value",
")",
"||",
"(",
"count",
"(",
"$",
"value",
")",
"==",
"1",
")",
"&&",
"is_string",
"(",
"current",
"(",
"$",
"value",
"... | Split comma separated values.
@param mixed $value
@return mixed | [
"Split",
"comma",
"separated",
"values",
"."
] | train | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Command/Helper/ConfigurationHelper.php#L93-L101 |
heidelpay/PhpDoc | src/phpDocumentor/Command/Helper/ConfigurationHelper.php | ConfigurationHelper.getConfigValueFromPath | public function getConfigValueFromPath($path)
{
/** @var Configuration $node */
$node = $this->configuration;
foreach (explode('/', $path) as $nodeName) {
if (!is_object($node)) {
return null;
}
$node = $node->{'get' . ucfirst($nodeName)}... | php | public function getConfigValueFromPath($path)
{
/** @var Configuration $node */
$node = $this->configuration;
foreach (explode('/', $path) as $nodeName) {
if (!is_object($node)) {
return null;
}
$node = $node->{'get' . ucfirst($nodeName)}... | [
"public",
"function",
"getConfigValueFromPath",
"(",
"$",
"path",
")",
"{",
"/** @var Configuration $node */",
"$",
"node",
"=",
"$",
"this",
"->",
"configuration",
";",
"foreach",
"(",
"explode",
"(",
"'/'",
",",
"$",
"path",
")",
"as",
"$",
"nodeName",
")"... | Returns a value by traversing the configuration tree as if it was a file
path.
@param string $path Path to the config value separated by '/'.
@return string|integer|boolean | [
"Returns",
"a",
"value",
"by",
"traversing",
"the",
"configuration",
"tree",
"as",
"if",
"it",
"was",
"a",
"file",
"path",
"."
] | train | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Command/Helper/ConfigurationHelper.php#L123-L137 |
xiewulong/yii2-fileupload | oss/libs/guzzle/http/Guzzle/Http/RedirectPlugin.php | RedirectPlugin.onRequestSent | public function onRequestSent(Event $event)
{
$response = $event['response'];
$request = $event['request'];
// Only act on redirect requests with Location headers
if (!$response || $request->getParams()->get(self::DISABLE)) {
return;
}
// Trace the origi... | php | public function onRequestSent(Event $event)
{
$response = $event['response'];
$request = $event['request'];
// Only act on redirect requests with Location headers
if (!$response || $request->getParams()->get(self::DISABLE)) {
return;
}
// Trace the origi... | [
"public",
"function",
"onRequestSent",
"(",
"Event",
"$",
"event",
")",
"{",
"$",
"response",
"=",
"$",
"event",
"[",
"'response'",
"]",
";",
"$",
"request",
"=",
"$",
"event",
"[",
"'request'",
"]",
";",
"// Only act on redirect requests with Location headers",... | Called when a request receives a redirect response
@param Event $event Event emitted | [
"Called",
"when",
"a",
"request",
"receives",
"a",
"redirect",
"response"
] | train | https://github.com/xiewulong/yii2-fileupload/blob/3e75b17a4a18dd8466e3f57c63136de03470ca82/oss/libs/guzzle/http/Guzzle/Http/RedirectPlugin.php#L58-L83 |
xiewulong/yii2-fileupload | oss/libs/guzzle/http/Guzzle/Http/RedirectPlugin.php | RedirectPlugin.createRedirectRequest | protected function createRedirectRequest(
RequestInterface $request,
$statusCode,
$location,
RequestInterface $original
) {
$redirectRequest = null;
$strict = $original->getParams()->get(self::STRICT_REDIRECTS);
// Use a GET request if this is an entity enclo... | php | protected function createRedirectRequest(
RequestInterface $request,
$statusCode,
$location,
RequestInterface $original
) {
$redirectRequest = null;
$strict = $original->getParams()->get(self::STRICT_REDIRECTS);
// Use a GET request if this is an entity enclo... | [
"protected",
"function",
"createRedirectRequest",
"(",
"RequestInterface",
"$",
"request",
",",
"$",
"statusCode",
",",
"$",
"location",
",",
"RequestInterface",
"$",
"original",
")",
"{",
"$",
"redirectRequest",
"=",
"null",
";",
"$",
"strict",
"=",
"$",
"ori... | Create a redirect request for a specific request object
Takes into account strict RFC compliant redirection (e.g. redirect POST with POST) vs doing what most clients do
(e.g. redirect POST with GET).
@param RequestInterface $request Request being redirected
@param RequestInterface $original Original request
@par... | [
"Create",
"a",
"redirect",
"request",
"for",
"a",
"specific",
"request",
"object"
] | train | https://github.com/xiewulong/yii2-fileupload/blob/3e75b17a4a18dd8466e3f57c63136de03470ca82/oss/libs/guzzle/http/Guzzle/Http/RedirectPlugin.php#L117-L172 |
Danzabar/config-builder | src/Files/Merger.php | Merger.load | public function load(ConfigFile $master, ConfigFile $slave)
{
$this->master = $master;
$this->slave = $slave;
return $this;
} | php | public function load(ConfigFile $master, ConfigFile $slave)
{
$this->master = $master;
$this->slave = $slave;
return $this;
} | [
"public",
"function",
"load",
"(",
"ConfigFile",
"$",
"master",
",",
"ConfigFile",
"$",
"slave",
")",
"{",
"$",
"this",
"->",
"master",
"=",
"$",
"master",
";",
"$",
"this",
"->",
"slave",
"=",
"$",
"slave",
";",
"return",
"$",
"this",
";",
"}"
] | Loads the master and slave files
@param \Danzabar\Config\Files\ConfigFile $master
@param \Danzabar\Config\Files\ConfigFile $slave
@return Merger
@author Dan Cox | [
"Loads",
"the",
"master",
"and",
"slave",
"files"
] | train | https://github.com/Danzabar/config-builder/blob/3b237be578172c32498bbcdfb360e69a6243739d/src/Files/Merger.php#L72-L78 |
Danzabar/config-builder | src/Files/Merger.php | Merger.merge | public function merge()
{
if($this->saveBackupBeforeMerge)
{
$this->saveBackup();
}
// Since the param bag has the merge functionality already, why not use it?
$this->master->params()->merge($this->slave->params()->all());
if($this->autoSaveMaster)
{
$this->master->save();
}
if($this->de... | php | public function merge()
{
if($this->saveBackupBeforeMerge)
{
$this->saveBackup();
}
// Since the param bag has the merge functionality already, why not use it?
$this->master->params()->merge($this->slave->params()->all());
if($this->autoSaveMaster)
{
$this->master->save();
}
if($this->de... | [
"public",
"function",
"merge",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"saveBackupBeforeMerge",
")",
"{",
"$",
"this",
"->",
"saveBackup",
"(",
")",
";",
"}",
"// Since the param bag has the merge functionality already, why not use it?",
"$",
"this",
"->",
"m... | Performs the merge action
@return void
@author Dan Cox | [
"Performs",
"the",
"merge",
"action"
] | train | https://github.com/Danzabar/config-builder/blob/3b237be578172c32498bbcdfb360e69a6243739d/src/Files/Merger.php#L86-L105 |
Danzabar/config-builder | src/Files/Merger.php | Merger.restore | public function restore()
{
$this->master->params()->rollback();
$this->slave->params()->rollback();
// We should also save these so we know any changes have been fully reversed
$this->master->save();
$this->slave->save();
} | php | public function restore()
{
$this->master->params()->rollback();
$this->slave->params()->rollback();
// We should also save these so we know any changes have been fully reversed
$this->master->save();
$this->slave->save();
} | [
"public",
"function",
"restore",
"(",
")",
"{",
"$",
"this",
"->",
"master",
"->",
"params",
"(",
")",
"->",
"rollback",
"(",
")",
";",
"$",
"this",
"->",
"slave",
"->",
"params",
"(",
")",
"->",
"rollback",
"(",
")",
";",
"// We should also save these... | Restores the files
@return void
@author Dan Cox | [
"Restores",
"the",
"files"
] | train | https://github.com/Danzabar/config-builder/blob/3b237be578172c32498bbcdfb360e69a6243739d/src/Files/Merger.php#L125-L133 |
highday/glitter | database/migrations/2016_12_14_000023_create_variants_table.php | CreateVariantsTable.up | public function up()
{
Schema::create('variants', function (Blueprint $table) {
$table->increments('id');
$table->integer('product_id')->unsigned();
$table->foreign('product_id')->references('id')->on('products')->onDelete('cascade');
$table->integer('image_id... | php | public function up()
{
Schema::create('variants', function (Blueprint $table) {
$table->increments('id');
$table->integer('product_id')->unsigned();
$table->foreign('product_id')->references('id')->on('products')->onDelete('cascade');
$table->integer('image_id... | [
"public",
"function",
"up",
"(",
")",
"{",
"Schema",
"::",
"create",
"(",
"'variants'",
",",
"function",
"(",
"Blueprint",
"$",
"table",
")",
"{",
"$",
"table",
"->",
"increments",
"(",
"'id'",
")",
";",
"$",
"table",
"->",
"integer",
"(",
"'product_id... | Run the migrations.
@return void | [
"Run",
"the",
"migrations",
"."
] | train | https://github.com/highday/glitter/blob/d1c7a227fd2343806bd3ec0314e621ced57dfe66/database/migrations/2016_12_14_000023_create_variants_table.php#L14-L38 |
Smile-SA/EzUICronBundle | Repository/SmileEzCronRepository.php | SmileEzCronRepository.updateCron | public function updateCron(SmileEzCron $cron, $type, $value)
{
switch ($type) {
case 'expression':
if (!CronExpression::isValidExpression($value)) {
throw new InvalidArgumentException(
'expression', 'cron.invalid.type'
... | php | public function updateCron(SmileEzCron $cron, $type, $value)
{
switch ($type) {
case 'expression':
if (!CronExpression::isValidExpression($value)) {
throw new InvalidArgumentException(
'expression', 'cron.invalid.type'
... | [
"public",
"function",
"updateCron",
"(",
"SmileEzCron",
"$",
"cron",
",",
"$",
"type",
",",
"$",
"value",
")",
"{",
"switch",
"(",
"$",
"type",
")",
"{",
"case",
"'expression'",
":",
"if",
"(",
"!",
"CronExpression",
"::",
"isValidExpression",
"(",
"$",
... | Edit cron definition
@param SmileEzCron $cron cron object
@param string $type cron property identifier
@param string $value cron property value
@throws InvalidArgumentException | [
"Edit",
"cron",
"definition"
] | train | https://github.com/Smile-SA/EzUICronBundle/blob/c62fc6a3ab0b39e3f911742d9affe4aade90cf66/Repository/SmileEzCronRepository.php#L39-L78 |
philiplb/Valdi | src/Valdi/Validator/Between.php | Between.isValidComparison | protected function isValidComparison($value, $parameters) {
return $this->isAllNumeric($value, $parameters[0], $parameters[1])
&& $value >= $parameters[0]
&& $value <= $parameters[1];
} | php | protected function isValidComparison($value, $parameters) {
return $this->isAllNumeric($value, $parameters[0], $parameters[1])
&& $value >= $parameters[0]
&& $value <= $parameters[1];
} | [
"protected",
"function",
"isValidComparison",
"(",
"$",
"value",
",",
"$",
"parameters",
")",
"{",
"return",
"$",
"this",
"->",
"isAllNumeric",
"(",
"$",
"value",
",",
"$",
"parameters",
"[",
"0",
"]",
",",
"$",
"parameters",
"[",
"1",
"]",
")",
"&&",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/philiplb/Valdi/blob/9927ec34a2cb00cec705e952d3c2374e2dc3c972/src/Valdi/Validator/Between.php#L32-L36 |
mvccore/ext-router-module | src/MvcCore/Ext/Routers/Modules/Route/PropsGettersSetters.php | PropsGettersSetters.& | public function & SetAllowedLocalizations (/* ...$allowedLocalizations */) {
/** @var $this \MvcCore\Ext\Routers\Modules\IRoute */
$allowedLocalizations = func_get_args();
if (count($allowedLocalizations) === 1 && is_array($allowedLocalizations[0]))
$allowedLocalizations = $allowedLocalizations[0];
$this->a... | php | public function & SetAllowedLocalizations (/* ...$allowedLocalizations */) {
/** @var $this \MvcCore\Ext\Routers\Modules\IRoute */
$allowedLocalizations = func_get_args();
if (count($allowedLocalizations) === 1 && is_array($allowedLocalizations[0]))
$allowedLocalizations = $allowedLocalizations[0];
$this->a... | [
"public",
"function",
"&",
"SetAllowedLocalizations",
"(",
"/* ...$allowedLocalizations */",
")",
"{",
"/** @var $this \\MvcCore\\Ext\\Routers\\Modules\\IRoute */",
"$",
"allowedLocalizations",
"=",
"func_get_args",
"(",
")",
";",
"if",
"(",
"count",
"(",
"$",
"allowedLocal... | Set allowed localizations for the routed module if there is used
any variant of module router with localization.
@var \string[] $allowedLocalizations..., International lower case language
code(s) (+ optionally dash character
+ upper case international locale code(s))
@return \MvcCore\Ext\Routers\Modules\Route|\MvcCore\... | [
"Set",
"allowed",
"localizations",
"for",
"the",
"routed",
"module",
"if",
"there",
"is",
"used",
"any",
"variant",
"of",
"module",
"router",
"with",
"localization",
"."
] | train | https://github.com/mvccore/ext-router-module/blob/7695784a451db86cca6a43c98d076803cd0a50a7/src/MvcCore/Ext/Routers/Modules/Route/PropsGettersSetters.php#L115-L122 |
mvccore/ext-router-module | src/MvcCore/Ext/Routers/Modules/Route/PropsGettersSetters.php | PropsGettersSetters.trriggerUnusedMethodError | protected function trriggerUnusedMethodError ($method) {
/** @var $this \MvcCore\Ext\Routers\Modules\IRoute */
$selfClass = version_compare(PHP_VERSION, '5.5', '>') ? self::class : __CLASS__;
trigger_error("[$selfClass] The method `$method` is not used in this extended class.", E_USER_WARNING);
return $this;
} | php | protected function trriggerUnusedMethodError ($method) {
/** @var $this \MvcCore\Ext\Routers\Modules\IRoute */
$selfClass = version_compare(PHP_VERSION, '5.5', '>') ? self::class : __CLASS__;
trigger_error("[$selfClass] The method `$method` is not used in this extended class.", E_USER_WARNING);
return $this;
} | [
"protected",
"function",
"trriggerUnusedMethodError",
"(",
"$",
"method",
")",
"{",
"/** @var $this \\MvcCore\\Ext\\Routers\\Modules\\IRoute */",
"$",
"selfClass",
"=",
"version_compare",
"(",
"PHP_VERSION",
",",
"'5.5'",
",",
"'>'",
")",
"?",
"self",
"::",
"class",
"... | Trigger `E_USER_WARNING` user error about not used method in this
extended module domain route.
@param string $method
@return \MvcCore\Ext\Routers\Modules\IRoute | [
"Trigger",
"E_USER_WARNING",
"user",
"error",
"about",
"not",
"used",
"method",
"in",
"this",
"extended",
"module",
"domain",
"route",
"."
] | train | https://github.com/mvccore/ext-router-module/blob/7695784a451db86cca6a43c98d076803cd0a50a7/src/MvcCore/Ext/Routers/Modules/Route/PropsGettersSetters.php#L308-L313 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/parser/interfaces/part_parser.php | ezcMailPartParser.createPartParserForHeaders | static public function createPartParserForHeaders( ezcMailHeadersHolder $headers )
{
// default as specified by RFC2045 - #5.2
$mainType = 'text';
$subType = 'plain';
// parse the Content-Type header
if ( isset( $headers['Content-Type'] ) )
{
$matches = a... | php | static public function createPartParserForHeaders( ezcMailHeadersHolder $headers )
{
// default as specified by RFC2045 - #5.2
$mainType = 'text';
$subType = 'plain';
// parse the Content-Type header
if ( isset( $headers['Content-Type'] ) )
{
$matches = a... | [
"static",
"public",
"function",
"createPartParserForHeaders",
"(",
"ezcMailHeadersHolder",
"$",
"headers",
")",
"{",
"// default as specified by RFC2045 - #5.2",
"$",
"mainType",
"=",
"'text'",
";",
"$",
"subType",
"=",
"'plain'",
";",
"// parse the Content-Type header",
... | Returns a part parser corresponding to the given $headers.
@throws ezcBaseFileNotFoundException
if a neccessary temporary file could not be openened.
@param ezcMailHeadersHolder $headers
@return ezcMailPartParser | [
"Returns",
"a",
"part",
"parser",
"corresponding",
"to",
"the",
"given",
"$headers",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/parser/interfaces/part_parser.php#L105-L197 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/parser/interfaces/part_parser.php | ezcMailPartParser.parseHeader | protected function parseHeader( $line, ezcMailHeadersHolder $headers )
{
$matches = array();
preg_match_all( "/^([\w-_]*):\s?(.*)/", $line, $matches, PREG_SET_ORDER );
if ( count( $matches ) > 0 )
{
if ( !in_array( strtolower( $matches[0][1] ), self::$uniqueHeaders ) )
... | php | protected function parseHeader( $line, ezcMailHeadersHolder $headers )
{
$matches = array();
preg_match_all( "/^([\w-_]*):\s?(.*)/", $line, $matches, PREG_SET_ORDER );
if ( count( $matches ) > 0 )
{
if ( !in_array( strtolower( $matches[0][1] ), self::$uniqueHeaders ) )
... | [
"protected",
"function",
"parseHeader",
"(",
"$",
"line",
",",
"ezcMailHeadersHolder",
"$",
"headers",
")",
"{",
"$",
"matches",
"=",
"array",
"(",
")",
";",
"preg_match_all",
"(",
"\"/^([\\w-_]*):\\s?(.*)/\"",
",",
"$",
"line",
",",
"$",
"matches",
",",
"PR... | Parses the header given by $line and adds to $headers.
This method is usually used to parse the headers for a subpart. The
only exception is RFC822 parts since you know the type in advance.
@todo deal with headers that are listed several times
@param string $line
@param ezcMailHeadersHolder $headers | [
"Parses",
"the",
"header",
"given",
"by",
"$line",
"and",
"adds",
"to",
"$headers",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/parser/interfaces/part_parser.php#L209-L241 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/parser/interfaces/part_parser.php | ezcMailPartParser.parsePartHeaders | static public function parsePartHeaders( ezcMailHeadersHolder $headers, ezcMailPart $part )
{
if ( isset( $headers['Content-Disposition'] ) )
{
$part->contentDisposition = ezcMailRfc2231Implementation::parseContentDisposition( $headers['Content-Disposition'] );
}
} | php | static public function parsePartHeaders( ezcMailHeadersHolder $headers, ezcMailPart $part )
{
if ( isset( $headers['Content-Disposition'] ) )
{
$part->contentDisposition = ezcMailRfc2231Implementation::parseContentDisposition( $headers['Content-Disposition'] );
}
} | [
"static",
"public",
"function",
"parsePartHeaders",
"(",
"ezcMailHeadersHolder",
"$",
"headers",
",",
"ezcMailPart",
"$",
"part",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"headers",
"[",
"'Content-Disposition'",
"]",
")",
")",
"{",
"$",
"part",
"->",
"content... | Scans through $headers and sets any specific header properties on $part.
Currently we only have Content-Disposition on the ezcMailPart level.
All parser parts must call this method once.
@param ezcMailHeadersHolder $headers
@param ezcMailPart $part | [
"Scans",
"through",
"$headers",
"and",
"sets",
"any",
"specific",
"header",
"properties",
"on",
"$part",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/parser/interfaces/part_parser.php#L252-L258 |
oroinc/OroLayoutComponent | LayoutContext.php | LayoutContext.getResolver | public function getResolver()
{
if ($this->resolver === null) {
$this->resolver = $this->createResolver();
}
return $this->resolver;
} | php | public function getResolver()
{
if ($this->resolver === null) {
$this->resolver = $this->createResolver();
}
return $this->resolver;
} | [
"public",
"function",
"getResolver",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"resolver",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"resolver",
"=",
"$",
"this",
"->",
"createResolver",
"(",
")",
";",
"}",
"return",
"$",
"this",
"->",
"resolver... | {@inheritdoc} | [
"{"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/LayoutContext.php#L46-L53 |
oroinc/OroLayoutComponent | LayoutContext.php | LayoutContext.resolve | public function resolve()
{
if ($this->resolved) {
throw new Exception\LogicException('The context variables are already resolved.');
}
try {
$this->items = $this->getResolver()->resolve($this->items);
// validate that all added objects implement Context... | php | public function resolve()
{
if ($this->resolved) {
throw new Exception\LogicException('The context variables are already resolved.');
}
try {
$this->items = $this->getResolver()->resolve($this->items);
// validate that all added objects implement Context... | [
"public",
"function",
"resolve",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"resolved",
")",
"{",
"throw",
"new",
"Exception",
"\\",
"LogicException",
"(",
"'The context variables are already resolved.'",
")",
";",
"}",
"try",
"{",
"$",
"this",
"->",
"item... | {@inheritdoc} | [
"{"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/LayoutContext.php#L58-L90 |
oroinc/OroLayoutComponent | LayoutContext.php | LayoutContext.has | public function has($name)
{
return isset($this->items[$name]) || array_key_exists($name, $this->items);
} | php | public function has($name)
{
return isset($this->items[$name]) || array_key_exists($name, $this->items);
} | [
"public",
"function",
"has",
"(",
"$",
"name",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"items",
"[",
"$",
"name",
"]",
")",
"||",
"array_key_exists",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"items",
")",
";",
"}"
] | {@inheritdoc} | [
"{"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/LayoutContext.php#L103-L106 |
oroinc/OroLayoutComponent | LayoutContext.php | LayoutContext.getOr | public function getOr($name, $default = null)
{
return isset($this->items[$name]) || array_key_exists($name, $this->items)
? $this->items[$name]
: $default;
} | php | public function getOr($name, $default = null)
{
return isset($this->items[$name]) || array_key_exists($name, $this->items)
? $this->items[$name]
: $default;
} | [
"public",
"function",
"getOr",
"(",
"$",
"name",
",",
"$",
"default",
"=",
"null",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"items",
"[",
"$",
"name",
"]",
")",
"||",
"array_key_exists",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"items"... | {@inheritdoc} | [
"{"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/LayoutContext.php#L123-L128 |
oroinc/OroLayoutComponent | LayoutContext.php | LayoutContext.set | public function set($name, $value)
{
if ($this->resolved && !$this->has($name)) {
throw new Exception\LogicException(
sprintf('The item "%s" cannot be added because the context variables are already resolved.', $name)
);
}
$this->items[$name] = $value... | php | public function set($name, $value)
{
if ($this->resolved && !$this->has($name)) {
throw new Exception\LogicException(
sprintf('The item "%s" cannot be added because the context variables are already resolved.', $name)
);
}
$this->items[$name] = $value... | [
"public",
"function",
"set",
"(",
"$",
"name",
",",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"resolved",
"&&",
"!",
"$",
"this",
"->",
"has",
"(",
"$",
"name",
")",
")",
"{",
"throw",
"new",
"Exception",
"\\",
"LogicException",
"(",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/LayoutContext.php#L133-L142 |
oroinc/OroLayoutComponent | LayoutContext.php | LayoutContext.remove | public function remove($name)
{
if ($this->resolved && $this->has($name)) {
throw new Exception\LogicException(
sprintf('The item "%s" cannot be removed because the context variables are already resolved.', $name)
);
}
unset($this->items[$name]);
... | php | public function remove($name)
{
if ($this->resolved && $this->has($name)) {
throw new Exception\LogicException(
sprintf('The item "%s" cannot be removed because the context variables are already resolved.', $name)
);
}
unset($this->items[$name]);
... | [
"public",
"function",
"remove",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"resolved",
"&&",
"$",
"this",
"->",
"has",
"(",
"$",
"name",
")",
")",
"{",
"throw",
"new",
"Exception",
"\\",
"LogicException",
"(",
"sprintf",
"(",
"'The ite... | {@inheritdoc} | [
"{"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/LayoutContext.php#L147-L156 |
oroinc/OroLayoutComponent | LayoutContext.php | LayoutContext.offsetExists | public function offsetExists($name)
{
return isset($this->items[$name]) || array_key_exists($name, $this->items);
} | php | public function offsetExists($name)
{
return isset($this->items[$name]) || array_key_exists($name, $this->items);
} | [
"public",
"function",
"offsetExists",
"(",
"$",
"name",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"items",
"[",
"$",
"name",
"]",
")",
"||",
"array_key_exists",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"items",
")",
";",
"}"
] | {@inheritdoc} | [
"{"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/LayoutContext.php#L169-L172 |
oroinc/OroLayoutComponent | LayoutContext.php | LayoutContext.offsetGet | public function offsetGet($name)
{
if (!isset($this->items[$name]) && !array_key_exists($name, $this->items)) {
throw new \OutOfBoundsException(sprintf('Undefined index: %s.', $name));
};
return $this->items[$name];
} | php | public function offsetGet($name)
{
if (!isset($this->items[$name]) && !array_key_exists($name, $this->items)) {
throw new \OutOfBoundsException(sprintf('Undefined index: %s.', $name));
};
return $this->items[$name];
} | [
"public",
"function",
"offsetGet",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"items",
"[",
"$",
"name",
"]",
")",
"&&",
"!",
"array_key_exists",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"items",
")",
")",
"{",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/LayoutContext.php#L177-L184 |
mothership-ec/composer | src/Composer/Repository/ComposerRepository.php | ComposerRepository.findPackage | public function findPackage($name, $version)
{
if (!$this->hasProviders()) {
return parent::findPackage($name, $version);
}
// normalize version & name
$versionParser = new VersionParser();
$version = $versionParser->normalize($version);
$name = strtolower... | php | public function findPackage($name, $version)
{
if (!$this->hasProviders()) {
return parent::findPackage($name, $version);
}
// normalize version & name
$versionParser = new VersionParser();
$version = $versionParser->normalize($version);
$name = strtolower... | [
"public",
"function",
"findPackage",
"(",
"$",
"name",
",",
"$",
"version",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasProviders",
"(",
")",
")",
"{",
"return",
"parent",
"::",
"findPackage",
"(",
"$",
"name",
",",
"$",
"version",
")",
";",
"... | {@inheritDoc} | [
"{"
] | train | https://github.com/mothership-ec/composer/blob/fa6ad031a939d8d33b211e428fdbdd28cfce238c/src/Composer/Repository/ComposerRepository.php#L102-L122 |
mothership-ec/composer | src/Composer/Repository/ComposerRepository.php | ComposerRepository.search | public function search($query, $mode = 0)
{
$this->loadRootServerFile();
if ($this->searchUrl && $mode === self::SEARCH_FULLTEXT) {
$url = str_replace('%query%', $query, $this->searchUrl);
$hostname = parse_url($url, PHP_URL_HOST) ?: $url;
$json = $this->rfs->ge... | php | public function search($query, $mode = 0)
{
$this->loadRootServerFile();
if ($this->searchUrl && $mode === self::SEARCH_FULLTEXT) {
$url = str_replace('%query%', $query, $this->searchUrl);
$hostname = parse_url($url, PHP_URL_HOST) ?: $url;
$json = $this->rfs->ge... | [
"public",
"function",
"search",
"(",
"$",
"query",
",",
"$",
"mode",
"=",
"0",
")",
"{",
"$",
"this",
"->",
"loadRootServerFile",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"searchUrl",
"&&",
"$",
"mode",
"===",
"self",
"::",
"SEARCH_FULLTEXT",
")"... | {@inheritDoc} | [
"{"
] | train | https://github.com/mothership-ec/composer/blob/fa6ad031a939d8d33b211e428fdbdd28cfce238c/src/Composer/Repository/ComposerRepository.php#L169-L197 |
ezsystems/ezcomments-ls-extension | classes/ezcomnotificationemailmanager.php | ezcomNotificationEmailManager.executeSending | public function executeSending( $subject, $body, $subscriber )
{
$email = $subscriber->attribute( 'email' );
$parameters = array();
$parameters['content_type'] = $this->emailContentType;
$parameters['from'] = $this->emailFrom;
$transport = eZNotificationTransport::instance( '... | php | public function executeSending( $subject, $body, $subscriber )
{
$email = $subscriber->attribute( 'email' );
$parameters = array();
$parameters['content_type'] = $this->emailContentType;
$parameters['from'] = $this->emailFrom;
$transport = eZNotificationTransport::instance( '... | [
"public",
"function",
"executeSending",
"(",
"$",
"subject",
",",
"$",
"body",
",",
"$",
"subscriber",
")",
"{",
"$",
"email",
"=",
"$",
"subscriber",
"->",
"attribute",
"(",
"'email'",
")",
";",
"$",
"parameters",
"=",
"array",
"(",
")",
";",
"$",
"... | Execute sending process in Email
@see extension/ezcomments/classes/ezcomNotificationManager#executeSending($subject, $body, $subscriber) | [
"Execute",
"sending",
"process",
"in",
"Email"
] | train | https://github.com/ezsystems/ezcomments-ls-extension/blob/2b4cd8c34d4a77813e4d6a9c5a0d317a274c63c5/classes/ezcomnotificationemailmanager.php#L34-L47 |
PayBreak/foundation | src/Decision/Condition/LessThanOrEqualCondition.php | LessThanOrEqualCondition.checkCondition | public function checkCondition(Value $value)
{
return (parent::checkCondition($value) || $value->getValue() == $this->getValue()->getValue());
} | php | public function checkCondition(Value $value)
{
return (parent::checkCondition($value) || $value->getValue() == $this->getValue()->getValue());
} | [
"public",
"function",
"checkCondition",
"(",
"Value",
"$",
"value",
")",
"{",
"return",
"(",
"parent",
"::",
"checkCondition",
"(",
"$",
"value",
")",
"||",
"$",
"value",
"->",
"getValue",
"(",
")",
"==",
"$",
"this",
"->",
"getValue",
"(",
")",
"->",
... | Test Value against Condition
@param Value $value
@return bool
@throws \PayBreak\Foundation\Decision\ProcessingException | [
"Test",
"Value",
"against",
"Condition"
] | train | https://github.com/PayBreak/foundation/blob/3dc5a5791e0c95abefa2a415a7f9fdb5abb62ca4/src/Decision/Condition/LessThanOrEqualCondition.php#L38-L41 |
caffeinated/beverage | src/Dotenv.php | Dotenv.normaliseEnvironmentVariable | private static function normaliseEnvironmentVariable($name, $value)
{
list($name, $value) = self::splitCompoundStringIntoParts($name, $value);
$name = self::sanitiseVariableName($name);
$value = self::sanitiseVariableValue($value);
$value = self::resolveNestedVariables($value);
... | php | private static function normaliseEnvironmentVariable($name, $value)
{
list($name, $value) = self::splitCompoundStringIntoParts($name, $value);
$name = self::sanitiseVariableName($name);
$value = self::sanitiseVariableValue($value);
$value = self::resolveNestedVariables($value);
... | [
"private",
"static",
"function",
"normaliseEnvironmentVariable",
"(",
"$",
"name",
",",
"$",
"value",
")",
"{",
"list",
"(",
"$",
"name",
",",
"$",
"value",
")",
"=",
"self",
"::",
"splitCompoundStringIntoParts",
"(",
"$",
"name",
",",
"$",
"value",
")",
... | Takes value as passed in by developer and:
- ensures we're dealing with a separate name and value, breaking apart the name string if needed
- cleaning the value of quotes
- cleaning the name of quotes
- resolving nested variables
@param $name
@param $value
@return array | [
"Takes",
"value",
"as",
"passed",
"in",
"by",
"developer",
"and",
":",
"-",
"ensures",
"we",
"re",
"dealing",
"with",
"a",
"separate",
"name",
"and",
"value",
"breaking",
"apart",
"the",
"name",
"string",
"if",
"needed",
"-",
"cleaning",
"the",
"value",
... | train | https://github.com/caffeinated/beverage/blob/c7d612a1d3bc1baddc97fec60ab17224550efaf3/src/Dotenv.php#L68-L76 |
gedex/php-janrain-api | lib/Janrain/Api/Engage/Engage.php | Engage.setAuthProviders | public function setAuthProviders(array $params = array())
{
if (!isset($params['providers'])) {
throw new MissingArgumentException('providers');
}
if (!is_array($params['providers'])) {
throw new InvalidArgumentException('Invalid Argument: providers must be passed as array');
}
$params['providers'] =... | php | public function setAuthProviders(array $params = array())
{
if (!isset($params['providers'])) {
throw new MissingArgumentException('providers');
}
if (!is_array($params['providers'])) {
throw new InvalidArgumentException('Invalid Argument: providers must be passed as array');
}
$params['providers'] =... | [
"public",
"function",
"setAuthProviders",
"(",
"array",
"$",
"params",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"params",
"[",
"'providers'",
"]",
")",
")",
"{",
"throw",
"new",
"MissingArgumentException",
"(",
"'providers'",
... | Defines the list of identity providers provided by the Engage server to
sign-in widgets. This is the same list that is managed by the dashboard.
@param array $params | [
"Defines",
"the",
"list",
"of",
"identity",
"providers",
"provided",
"by",
"the",
"Engage",
"server",
"to",
"sign",
"-",
"in",
"widgets",
".",
"This",
"is",
"the",
"same",
"list",
"that",
"is",
"managed",
"by",
"the",
"dashboard",
"."
] | train | https://github.com/gedex/php-janrain-api/blob/6283f68454e0ad5211ac620f1d337df38cd49597/lib/Janrain/Api/Engage/Engage.php#L112-L125 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/query_select.php | ezcQuerySelect.reset | public function reset()
{
$this->selectString = null;
$this->fromString = null;
$this->whereString = null;
$this->groupString = null;
$this->havingString = null;
$this->orderString = null;
$this->limitString = null;
$this->lastInvokedClauseMethod = nul... | php | public function reset()
{
$this->selectString = null;
$this->fromString = null;
$this->whereString = null;
$this->groupString = null;
$this->havingString = null;
$this->orderString = null;
$this->limitString = null;
$this->lastInvokedClauseMethod = nul... | [
"public",
"function",
"reset",
"(",
")",
"{",
"$",
"this",
"->",
"selectString",
"=",
"null",
";",
"$",
"this",
"->",
"fromString",
"=",
"null",
";",
"$",
"this",
"->",
"whereString",
"=",
"null",
";",
"$",
"this",
"->",
"groupString",
"=",
"null",
"... | Resets the query object for reuse.
@return void | [
"Resets",
"the",
"query",
"object",
"for",
"reuse",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/query_select.php#L136-L149 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/query_select.php | ezcQuerySelect.select | public function select()
{
if ( $this->selectString == null )
{
$this->selectString = 'SELECT ';
}
$args = func_get_args();
$cols = self::arrayFlatten( $args );
if ( count( $cols ) < 1 )
{
throw new ezcQueryVariableParameterException(... | php | public function select()
{
if ( $this->selectString == null )
{
$this->selectString = 'SELECT ';
}
$args = func_get_args();
$cols = self::arrayFlatten( $args );
if ( count( $cols ) < 1 )
{
throw new ezcQueryVariableParameterException(... | [
"public",
"function",
"select",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"selectString",
"==",
"null",
")",
"{",
"$",
"this",
"->",
"selectString",
"=",
"'SELECT '",
";",
"}",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"$",
"cols",
"=",
... | Opens the query and selects which columns you want to return with
the query.
select() accepts an arbitrary number of parameters. Each parameter
must contain either the name of a column or an array containing
the names of the columns.
Each call to select() appends columns to the list of columns that will be
used in the... | [
"Opens",
"the",
"query",
"and",
"selects",
"which",
"columns",
"you",
"want",
"to",
"return",
"with",
"the",
"query",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/query_select.php#L182-L208 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/query_select.php | ezcQuerySelect.selectDistinct | public function selectDistinct()
{
if ( $this->selectString == null )
{
$this->selectString = 'SELECT DISTINCT ';
}
elseif ( strpos ( $this->selectString, 'DISTINCT' ) === false )
{
throw new ezcQueryInvalidException(
'SELECT',
... | php | public function selectDistinct()
{
if ( $this->selectString == null )
{
$this->selectString = 'SELECT DISTINCT ';
}
elseif ( strpos ( $this->selectString, 'DISTINCT' ) === false )
{
throw new ezcQueryInvalidException(
'SELECT',
... | [
"public",
"function",
"selectDistinct",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"selectString",
"==",
"null",
")",
"{",
"$",
"this",
"->",
"selectString",
"=",
"'SELECT DISTINCT '",
";",
"}",
"elseif",
"(",
"strpos",
"(",
"$",
"this",
"->",
"selectS... | Opens the query and uses a distinct select on the columns you want to
return with the query.
selectDistinct() accepts an arbitrary number of parameters. Each
parameter must contain either the name of a column or an array
containing the names of the columns.
Each call to selectDistinct() appends columns to the list of... | [
"Opens",
"the",
"query",
"and",
"uses",
"a",
"distinct",
"select",
"on",
"the",
"columns",
"you",
"want",
"to",
"return",
"with",
"the",
"query",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/query_select.php#L270-L290 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/query_select.php | ezcQuerySelect.from | public function from()
{
if ( $this->fromString == '' )
{
$this->fromString = 'FROM ';
}
$args = func_get_args();
$tables = self::arrayFlatten( $args );
if ( count( $tables ) < 1 )
{
throw new ezcQueryVariableParameterException( 'from'... | php | public function from()
{
if ( $this->fromString == '' )
{
$this->fromString = 'FROM ';
}
$args = func_get_args();
$tables = self::arrayFlatten( $args );
if ( count( $tables ) < 1 )
{
throw new ezcQueryVariableParameterException( 'from'... | [
"public",
"function",
"from",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"fromString",
"==",
"''",
")",
"{",
"$",
"this",
"->",
"fromString",
"=",
"'FROM '",
";",
"}",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"$",
"tables",
"=",
"self",
... | Select which tables you want to select from.
from() accepts an arbitrary number of parameters. Each parameter
must contain either the name of a table or an array containing
the names of tables..
Each call to from() appends tables to the list of tables that will be
used in the query.
Example:
<code>
// the following c... | [
"Select",
"which",
"tables",
"you",
"want",
"to",
"select",
"from",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/query_select.php#L312-L337 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/query_select.php | ezcQuerySelect.doJoin | protected function doJoin( $type )
{
$args = func_get_args();
// Remove the first one, as that's the $type of join.
array_shift( $args );
$sqlType = strtoupper( $type );
$passedArgsCount = func_num_args() - 1;
if ( $passedArgsCount < 2 || $passedArgsCount > 4 )
... | php | protected function doJoin( $type )
{
$args = func_get_args();
// Remove the first one, as that's the $type of join.
array_shift( $args );
$sqlType = strtoupper( $type );
$passedArgsCount = func_num_args() - 1;
if ( $passedArgsCount < 2 || $passedArgsCount > 4 )
... | [
"protected",
"function",
"doJoin",
"(",
"$",
"type",
")",
"{",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"// Remove the first one, as that's the $type of join.",
"array_shift",
"(",
"$",
"args",
")",
";",
"$",
"sqlType",
"=",
"strtoupper",
"(",
"$",
"t... | Returns the SQL for a join or prepares $fromString for a join.
This method could be used in two forms:
<b>doJoin( $joinType, 't2', $joinCondition )</b>
Takes the join type and two string arguments and returns ezcQuery.
The second parameter is the name of the table to join with. The table to
which is joined should h... | [
"Returns",
"the",
"SQL",
"for",
"a",
"join",
"or",
"prepares",
"$fromString",
"for",
"a",
"join",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/query_select.php#L379-L442 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/query_select.php | ezcQuerySelect.limit | public function limit( $limit, $offset = '' )
{
if ( $offset === '' )
{
$this->limitString = "LIMIT {$limit}";
}
else
{
$this->limitString = "LIMIT {$limit} OFFSET {$offset}";
}
$this->lastInvokedMethod = 'limit';
return $this;... | php | public function limit( $limit, $offset = '' )
{
if ( $offset === '' )
{
$this->limitString = "LIMIT {$limit}";
}
else
{
$this->limitString = "LIMIT {$limit} OFFSET {$offset}";
}
$this->lastInvokedMethod = 'limit';
return $this;... | [
"public",
"function",
"limit",
"(",
"$",
"limit",
",",
"$",
"offset",
"=",
"''",
")",
"{",
"if",
"(",
"$",
"offset",
"===",
"''",
")",
"{",
"$",
"this",
"->",
"limitString",
"=",
"\"LIMIT {$limit}\"",
";",
"}",
"else",
"{",
"$",
"this",
"->",
"limi... | Returns SQL that limits the result set.
$limit controls the maximum number of rows that will be returned.
$offset controls which row that will be the first in the result
set from the total amount of matching rows.
Example:
<code>
$q->select( '*' )->from( 'table' )
->limit( 10, 0 );
</code>
LIMIT is not part of SQL92... | [
"Returns",
"SQL",
"that",
"limits",
"the",
"result",
"set",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/query_select.php#L691-L704 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.