id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
239,100 | unyx/console | output/formatting/Formatter.php | Formatter.apply | protected function apply(string $text, bool $decorated) : string
{
return $decorated && !empty($text) ? $this->stack->current()->apply($text) : $text;
} | php | protected function apply(string $text, bool $decorated) : string
{
return $decorated && !empty($text) ? $this->stack->current()->apply($text) : $text;
} | [
"protected",
"function",
"apply",
"(",
"string",
"$",
"text",
",",
"bool",
"$",
"decorated",
")",
":",
"string",
"{",
"return",
"$",
"decorated",
"&&",
"!",
"empty",
"(",
"$",
"text",
")",
"?",
"$",
"this",
"->",
"stack",
"->",
"current",
"(",
")",
... | Applies formatting to the given text.
@param string $text The text that should be formatted.
@param bool $decorated Whether decorations, like colors, should be applied to the text.
@return string The resulting text. | [
"Applies",
"formatting",
"to",
"the",
"given",
"text",
"."
] | b4a76e08bbb5428b0349c0ec4259a914f81a2957 | https://github.com/unyx/console/blob/b4a76e08bbb5428b0349c0ec4259a914f81a2957/output/formatting/Formatter.php#L172-L175 |
239,101 | crip-laravel/core | src/Data/Model.php | Model.scopeOrder | public function scopeOrder($query)
{
$order = Input::get('order', isset($this->order) ? $this->order : 'id') ?: 'id';
$direction = Input::get('direction', isset($this->direction) ? $this->direction : 'desc') ?: 'desc';
return $query->orderBy($order, $direction);
} | php | public function scopeOrder($query)
{
$order = Input::get('order', isset($this->order) ? $this->order : 'id') ?: 'id';
$direction = Input::get('direction', isset($this->direction) ? $this->direction : 'desc') ?: 'desc';
return $query->orderBy($order, $direction);
} | [
"public",
"function",
"scopeOrder",
"(",
"$",
"query",
")",
"{",
"$",
"order",
"=",
"Input",
"::",
"get",
"(",
"'order'",
",",
"isset",
"(",
"$",
"this",
"->",
"order",
")",
"?",
"$",
"this",
"->",
"order",
":",
"'id'",
")",
"?",
":",
"'id'",
";"... | Scope a query to order by query properties
@param $query
@return Builder | [
"Scope",
"a",
"query",
"to",
"order",
"by",
"query",
"properties"
] | d58cef97d97fba8b01bec33801452ecbd7c992de | https://github.com/crip-laravel/core/blob/d58cef97d97fba8b01bec33801452ecbd7c992de/src/Data/Model.php#L21-L27 |
239,102 | eloquent/schemer | src/Eloquent/Schemer/Uri/HttpUri.php | HttpUri.parseUserInfo | protected function parseUserInfo()
{
// No user information? we're done
if (null === $this->userInfo) {
return;
}
// If no ':' separator, we only have a username
if (false === strpos($this->userInfo, ':')) {
$this->setUser($this->userInfo);
... | php | protected function parseUserInfo()
{
// No user information? we're done
if (null === $this->userInfo) {
return;
}
// If no ':' separator, we only have a username
if (false === strpos($this->userInfo, ':')) {
$this->setUser($this->userInfo);
... | [
"protected",
"function",
"parseUserInfo",
"(",
")",
"{",
"// No user information? we're done",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"userInfo",
")",
"{",
"return",
";",
"}",
"// If no ':' separator, we only have a username",
"if",
"(",
"false",
"===",
"strpo... | Parse the user info into username and password segments
Parses the user information into username and password segments, and
then sets the appropriate values.
@return void | [
"Parse",
"the",
"user",
"info",
"into",
"username",
"and",
"password",
"segments"
] | 951fb321d1f50f5d2e905620fbe3b4a6f816b4b3 | https://github.com/eloquent/schemer/blob/951fb321d1f50f5d2e905620fbe3b4a6f816b4b3/src/Eloquent/Schemer/Uri/HttpUri.php#L144-L162 |
239,103 | eloquent/schemer | src/Eloquent/Schemer/Uri/HttpUri.php | HttpUri.getPort | public function getPort()
{
if (empty($this->port)) {
if (array_key_exists($this->scheme, static::$defaultPorts)) {
return static::$defaultPorts[$this->scheme];
}
}
return $this->port;
} | php | public function getPort()
{
if (empty($this->port)) {
if (array_key_exists($this->scheme, static::$defaultPorts)) {
return static::$defaultPorts[$this->scheme];
}
}
return $this->port;
} | [
"public",
"function",
"getPort",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"port",
")",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"this",
"->",
"scheme",
",",
"static",
"::",
"$",
"defaultPorts",
")",
")",
"{",
"return",
"... | Return the URI port
If no port is set, will return the default port according to the scheme
@return integer | [
"Return",
"the",
"URI",
"port"
] | 951fb321d1f50f5d2e905620fbe3b4a6f816b4b3 | https://github.com/eloquent/schemer/blob/951fb321d1f50f5d2e905620fbe3b4a6f816b4b3/src/Eloquent/Schemer/Uri/HttpUri.php#L171-L180 |
239,104 | eloquent/schemer | src/Eloquent/Schemer/Uri/HttpUri.php | HttpUri.parse | public function parse($uri)
{
parent::parse($uri);
if (empty($this->path)) {
$this->path = '/';
}
return $this;
} | php | public function parse($uri)
{
parent::parse($uri);
if (empty($this->path)) {
$this->path = '/';
}
return $this;
} | [
"public",
"function",
"parse",
"(",
"$",
"uri",
")",
"{",
"parent",
"::",
"parse",
"(",
"$",
"uri",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"path",
")",
")",
"{",
"$",
"this",
"->",
"path",
"=",
"'/'",
";",
"}",
"return",
"$",
"... | Parse a URI string
@param string $uri
@return Http | [
"Parse",
"a",
"URI",
"string"
] | 951fb321d1f50f5d2e905620fbe3b4a6f816b4b3 | https://github.com/eloquent/schemer/blob/951fb321d1f50f5d2e905620fbe3b4a6f816b4b3/src/Eloquent/Schemer/Uri/HttpUri.php#L188-L197 |
239,105 | asbsoft/yii2-common_2_170212 | helpers/EditorContentHelper.php | EditorContentHelper.beforeSaveBody | public static function beforeSaveBody($text)
{
static::correctParams();
$webfilesSubdir = static::$webfilesSubdir;
$webfilesSubdirOld = static::$webfilesSubdirOld;
$baseUrl = Yii::$app->urlManager->getBaseUrl();
$trTable = [
"src=\"{$baseUrl}/{$webfilesSubdirOld}... | php | public static function beforeSaveBody($text)
{
static::correctParams();
$webfilesSubdir = static::$webfilesSubdir;
$webfilesSubdirOld = static::$webfilesSubdirOld;
$baseUrl = Yii::$app->urlManager->getBaseUrl();
$trTable = [
"src=\"{$baseUrl}/{$webfilesSubdirOld}... | [
"public",
"static",
"function",
"beforeSaveBody",
"(",
"$",
"text",
")",
"{",
"static",
"::",
"correctParams",
"(",
")",
";",
"$",
"webfilesSubdir",
"=",
"static",
"::",
"$",
"webfilesSubdir",
";",
"$",
"webfilesSubdirOld",
"=",
"static",
"::",
"$",
"webfile... | Prepare text to save after visual editor.
@param string $text
@return string | [
"Prepare",
"text",
"to",
"save",
"after",
"visual",
"editor",
"."
] | 6c58012ff89225d7d4e42b200cf39e009e9d9dac | https://github.com/asbsoft/yii2-common_2_170212/blob/6c58012ff89225d7d4e42b200cf39e009e9d9dac/helpers/EditorContentHelper.php#L35-L51 |
239,106 | asbsoft/yii2-common_2_170212 | helpers/EditorContentHelper.php | EditorContentHelper.uploadUrl | public static function uploadUrl($path = '', $uploadsAlias = '@uploads', $webfilesurlAlias = 'uploads')
{
$path = str_replace('\\', '/', $path);
$webroot = str_replace('\\', '/', Yii::getAlias('@webroot'));
$uploads = str_replace('\\', '/', Yii::getAlias($uploadsAlias));
//$subdir =... | php | public static function uploadUrl($path = '', $uploadsAlias = '@uploads', $webfilesurlAlias = 'uploads')
{
$path = str_replace('\\', '/', $path);
$webroot = str_replace('\\', '/', Yii::getAlias('@webroot'));
$uploads = str_replace('\\', '/', Yii::getAlias($uploadsAlias));
//$subdir =... | [
"public",
"static",
"function",
"uploadUrl",
"(",
"$",
"path",
"=",
"''",
",",
"$",
"uploadsAlias",
"=",
"'@uploads'",
",",
"$",
"webfilesurlAlias",
"=",
"'uploads'",
")",
"{",
"$",
"path",
"=",
"str_replace",
"(",
"'\\\\'",
",",
"'/'",
",",
"$",
"path",... | Convert upload path to web URL.
Work only if alias @uploads is subdir of alias @webroot.
@param string $path
@param string $uploadsAlias alias for uploads path in filesystem (non-standard for Yii2)
@param string $webfilesurlAlias alias/subdir - path from webroot to uploads directory
@return string | [
"Convert",
"upload",
"path",
"to",
"web",
"URL",
".",
"Work",
"only",
"if",
"alias"
] | 6c58012ff89225d7d4e42b200cf39e009e9d9dac | https://github.com/asbsoft/yii2-common_2_170212/blob/6c58012ff89225d7d4e42b200cf39e009e9d9dac/helpers/EditorContentHelper.php#L84-L98 |
239,107 | kambo-1st/HttpMessage | src/Factories/Environment/Superglobal/UriFactory.php | UriFactory.create | public function create(Environment $environment)
{
$scheme = $environment->getRequestScheme();
$host = $environment->getHost();
$port = $environment->getPort();
$query = $environment->getQueryString();
$user = $environment->getAuthUser();
$pass = $environment... | php | public function create(Environment $environment)
{
$scheme = $environment->getRequestScheme();
$host = $environment->getHost();
$port = $environment->getPort();
$query = $environment->getQueryString();
$user = $environment->getAuthUser();
$pass = $environment... | [
"public",
"function",
"create",
"(",
"Environment",
"$",
"environment",
")",
"{",
"$",
"scheme",
"=",
"$",
"environment",
"->",
"getRequestScheme",
"(",
")",
";",
"$",
"host",
"=",
"$",
"environment",
"->",
"getHost",
"(",
")",
";",
"$",
"port",
"=",
"... | Create instances of Uri object from instance of Environment object
@param Environment $environment environment data
@return Uri Instance of Uri object created from environment | [
"Create",
"instances",
"of",
"Uri",
"object",
"from",
"instance",
"of",
"Environment",
"object"
] | 38877b9d895f279fdd5bdf957d8f23f9808a940a | https://github.com/kambo-1st/HttpMessage/blob/38877b9d895f279fdd5bdf957d8f23f9808a940a/src/Factories/Environment/Superglobal/UriFactory.php#L28-L44 |
239,108 | fabsgc/framework | Core/Orm/Entity/Entity.php | Entity._tableDefinition | final protected function _tableDefinition() {
$annotation = Annotation::getClass($this);
/** @var \ReflectionClass $fieldClass */
$fieldClass = new \ReflectionClass('\\Gcs\Framework\Core\\Orm\\Entity\\Field');
/** @var \ReflectionClass $foreignKeyClass */
$foreignKeyClass = new ... | php | final protected function _tableDefinition() {
$annotation = Annotation::getClass($this);
/** @var \ReflectionClass $fieldClass */
$fieldClass = new \ReflectionClass('\\Gcs\Framework\Core\\Orm\\Entity\\Field');
/** @var \ReflectionClass $foreignKeyClass */
$foreignKeyClass = new ... | [
"final",
"protected",
"function",
"_tableDefinition",
"(",
")",
"{",
"$",
"annotation",
"=",
"Annotation",
"::",
"getClass",
"(",
"$",
"this",
")",
";",
"/** @var \\ReflectionClass $fieldClass */",
"$",
"fieldClass",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"'\\\... | Creation of the table
@access public
@return void
@since 3.0
@package Gcs\Framework\Core\Orm\Entity | [
"Creation",
"of",
"the",
"table"
] | 45e58182aba6a3c6381970a1fd3c17662cff2168 | https://github.com/fabsgc/framework/blob/45e58182aba6a3c6381970a1fd3c17662cff2168/Core/Orm/Entity/Entity.php#L137-L185 |
239,109 | fabsgc/framework | Core/Orm/Entity/Entity.php | Entity.field | public function field($name) {
$this->_fields['' . $name . ''] = new Field($name, $this->_name);
return $this->_fields['' . $name . ''];
} | php | public function field($name) {
$this->_fields['' . $name . ''] = new Field($name, $this->_name);
return $this->_fields['' . $name . ''];
} | [
"public",
"function",
"field",
"(",
"$",
"name",
")",
"{",
"$",
"this",
"->",
"_fields",
"[",
"''",
".",
"$",
"name",
".",
"''",
"]",
"=",
"new",
"Field",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"_name",
")",
";",
"return",
"$",
"this",
"->",... | add a field
@access public
@param $name string
@return \Gcs\Framework\Core\Orm\Entity\Field
@since 3.0
@package Gcs\Framework\Core\Orm\Entity | [
"add",
"a",
"field"
] | 45e58182aba6a3c6381970a1fd3c17662cff2168 | https://github.com/fabsgc/framework/blob/45e58182aba6a3c6381970a1fd3c17662cff2168/Core/Orm/Entity/Entity.php#L229-L233 |
239,110 | fabsgc/framework | Core/Orm/Entity/Entity.php | Entity.getPrimary | public function getPrimary() {
foreach ($this->_fields as $key => $field) {
if ($field->primary == true) {
$this->_primary = $key;
break;
}
}
} | php | public function getPrimary() {
foreach ($this->_fields as $key => $field) {
if ($field->primary == true) {
$this->_primary = $key;
break;
}
}
} | [
"public",
"function",
"getPrimary",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"_fields",
"as",
"$",
"key",
"=>",
"$",
"field",
")",
"{",
"if",
"(",
"$",
"field",
"->",
"primary",
"==",
"true",
")",
"{",
"$",
"this",
"->",
"_primary",
"=",
... | Get primary key name
@access public
@return void
@since 3.0
@package Gcs\Framework\Core\Orm\Entity | [
"Get",
"primary",
"key",
"name"
] | 45e58182aba6a3c6381970a1fd3c17662cff2168 | https://github.com/fabsgc/framework/blob/45e58182aba6a3c6381970a1fd3c17662cff2168/Core/Orm/Entity/Entity.php#L270-L277 |
239,111 | fabsgc/framework | Core/Orm/Entity/Entity.php | Entity.get | public function get($key) {
if (array_key_exists($key, $this->_fields)) {
if (gettype($this->_fields['' . $key . '']) == 'object') {
return $this->_fields['' . $key . '']->value;
}
else {
return $this->_fields['' . $key . ''];
}
... | php | public function get($key) {
if (array_key_exists($key, $this->_fields)) {
if (gettype($this->_fields['' . $key . '']) == 'object') {
return $this->_fields['' . $key . '']->value;
}
else {
return $this->_fields['' . $key . ''];
}
... | [
"public",
"function",
"get",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"key",
",",
"$",
"this",
"->",
"_fields",
")",
")",
"{",
"if",
"(",
"gettype",
"(",
"$",
"this",
"->",
"_fields",
"[",
"''",
".",
"$",
"key",
".",
... | return a field value
@access public
@param $key string
@throws MissingEntityException
@return mixed integer,boolean,string,\Gcs\Framework\Core\Orm\Entity\Type\Type
@since 3.0
@package Gcs\Framework\Core\Orm\Entity | [
"return",
"a",
"field",
"value"
] | 45e58182aba6a3c6381970a1fd3c17662cff2168 | https://github.com/fabsgc/framework/blob/45e58182aba6a3c6381970a1fd3c17662cff2168/Core/Orm/Entity/Entity.php#L378-L390 |
239,112 | Opifer/ContentBundle | Controller/Backend/ContentController.php | ContentController.createAction | public function createAction(Request $request, $type = 0)
{
/** @var ContentManager $manager */
$manager = $this->get('opifer.content.content_manager');
if ($type) {
$contentType = $this->get('opifer.content.content_type_manager')->getRepository()->find($type);
$cont... | php | public function createAction(Request $request, $type = 0)
{
/** @var ContentManager $manager */
$manager = $this->get('opifer.content.content_manager');
if ($type) {
$contentType = $this->get('opifer.content.content_type_manager')->getRepository()->find($type);
$cont... | [
"public",
"function",
"createAction",
"(",
"Request",
"$",
"request",
",",
"$",
"type",
"=",
"0",
")",
"{",
"/** @var ContentManager $manager */",
"$",
"manager",
"=",
"$",
"this",
"->",
"get",
"(",
"'opifer.content.content_manager'",
")",
";",
"if",
"(",
"$",... | Select the type of content, the site and the language before actually
creating a new content item.
@param Request $request
@param integer $type
@return Response | [
"Select",
"the",
"type",
"of",
"content",
"the",
"site",
"and",
"the",
"language",
"before",
"actually",
"creating",
"a",
"new",
"content",
"item",
"."
] | df44ef36b81a839ce87ea9a92f7728618111541f | https://github.com/Opifer/ContentBundle/blob/df44ef36b81a839ce87ea9a92f7728618111541f/Controller/Backend/ContentController.php#L52-L88 |
239,113 | Opifer/ContentBundle | Controller/Backend/ContentController.php | ContentController.detailsAction | public function detailsAction(Request $request, $id)
{
$manager = $this->get('opifer.content.content_manager');
$content = $manager->getRepository()->find($id);
$form = $this->createForm(ContentType::class, $content);
$form->handleRequest($request);
if ($form->isValid()) {
... | php | public function detailsAction(Request $request, $id)
{
$manager = $this->get('opifer.content.content_manager');
$content = $manager->getRepository()->find($id);
$form = $this->createForm(ContentType::class, $content);
$form->handleRequest($request);
if ($form->isValid()) {
... | [
"public",
"function",
"detailsAction",
"(",
"Request",
"$",
"request",
",",
"$",
"id",
")",
"{",
"$",
"manager",
"=",
"$",
"this",
"->",
"get",
"(",
"'opifer.content.content_manager'",
")",
";",
"$",
"content",
"=",
"$",
"manager",
"->",
"getRepository",
"... | Details action.
@param Request $request
@param integer $directoryId
@return \Symfony\Component\HttpFoundation\Response | [
"Details",
"action",
"."
] | df44ef36b81a839ce87ea9a92f7728618111541f | https://github.com/Opifer/ContentBundle/blob/df44ef36b81a839ce87ea9a92f7728618111541f/Controller/Backend/ContentController.php#L98-L114 |
239,114 | staccatocode/listable | src/Repository/RepositoryFactory.php | RepositoryFactory.add | public function add(string $name, RepositoryFactoryInterface $factory): void
{
$this->factories[$name] = $factory;
} | php | public function add(string $name, RepositoryFactoryInterface $factory): void
{
$this->factories[$name] = $factory;
} | [
"public",
"function",
"add",
"(",
"string",
"$",
"name",
",",
"RepositoryFactoryInterface",
"$",
"factory",
")",
":",
"void",
"{",
"$",
"this",
"->",
"factories",
"[",
"$",
"name",
"]",
"=",
"$",
"factory",
";",
"}"
] | Add repository factory.
@param string $name factory name
@param RepositoryFactoryInterface $factory | [
"Add",
"repository",
"factory",
"."
] | 9e97ff44e7d2af59f5a46c8e0faa29880545a40b | https://github.com/staccatocode/listable/blob/9e97ff44e7d2af59f5a46c8e0faa29880545a40b/src/Repository/RepositoryFactory.php#L48-L51 |
239,115 | staccatocode/listable | src/Repository/RepositoryFactory.php | RepositoryFactory.remove | public function remove(string $name): void
{
if ($this->has($name)) {
unset($this->factories[$name]);
}
} | php | public function remove(string $name): void
{
if ($this->has($name)) {
unset($this->factories[$name]);
}
} | [
"public",
"function",
"remove",
"(",
"string",
"$",
"name",
")",
":",
"void",
"{",
"if",
"(",
"$",
"this",
"->",
"has",
"(",
"$",
"name",
")",
")",
"{",
"unset",
"(",
"$",
"this",
"->",
"factories",
"[",
"$",
"name",
"]",
")",
";",
"}",
"}"
] | Remove repository factory.
@param string $name factory name | [
"Remove",
"repository",
"factory",
"."
] | 9e97ff44e7d2af59f5a46c8e0faa29880545a40b | https://github.com/staccatocode/listable/blob/9e97ff44e7d2af59f5a46c8e0faa29880545a40b/src/Repository/RepositoryFactory.php#L70-L75 |
239,116 | parfumix/laravel-translator | src/TranslatorServiceProvider.php | TranslatorServiceProvider.publishDatabaseDriver | protected function publishDatabaseDriver() {
$this->publishes([
__DIR__.'/DriverAssets/Database/migrations' => database_path('migrations'),
]);
$this->publishes([
__DIR__.'/DriverAssets/Database/seeds' => database_path('seeds'),
]);
return $this;
} | php | protected function publishDatabaseDriver() {
$this->publishes([
__DIR__.'/DriverAssets/Database/migrations' => database_path('migrations'),
]);
$this->publishes([
__DIR__.'/DriverAssets/Database/seeds' => database_path('seeds'),
]);
return $this;
} | [
"protected",
"function",
"publishDatabaseDriver",
"(",
")",
"{",
"$",
"this",
"->",
"publishes",
"(",
"[",
"__DIR__",
".",
"'/DriverAssets/Database/migrations'",
"=>",
"database_path",
"(",
"'migrations'",
")",
",",
"]",
")",
";",
"$",
"this",
"->",
"publishes",... | Publish database driver assets .
@return $this | [
"Publish",
"database",
"driver",
"assets",
"."
] | b85f17cbfebd4f35d1bfb817fbf13bff2c3f487e | https://github.com/parfumix/laravel-translator/blob/b85f17cbfebd4f35d1bfb817fbf13bff2c3f487e/src/TranslatorServiceProvider.php#L65-L75 |
239,117 | digitalicagroup/slack-hook-framework | lib/SlackHookFramework/CmdHello.php | CmdHello.executeImpl | protected function executeImpl($params) {
/**
* Get a reference to the log.
*/
$log = $this->log;
/**
* Output some debug info to log file.
*/
$log->debug ( "CmdHello: Parameters received: " . implode ( ",", $params ) );
/**
* Preparing the result text and validating parameters.
*/
$... | php | protected function executeImpl($params) {
/**
* Get a reference to the log.
*/
$log = $this->log;
/**
* Output some debug info to log file.
*/
$log->debug ( "CmdHello: Parameters received: " . implode ( ",", $params ) );
/**
* Preparing the result text and validating parameters.
*/
$... | [
"protected",
"function",
"executeImpl",
"(",
"$",
"params",
")",
"{",
"/**\n\t\t * Get a reference to the log.\n\t\t */",
"$",
"log",
"=",
"$",
"this",
"->",
"log",
";",
"/**\n\t\t * Output some debug info to log file.\n\t\t */",
"$",
"log",
"->",
"debug",
"(",
"\"CmdHe... | Factory method to be implemented from \SlackHookFramework\AbstractCommand.
This method should execute your command's logic.
There are several ways to return information to Slack:
1) Simply use $this->setResultText("string here"); to return a single
line to slack.
2) Create an array with one or more instances of Sla... | [
"Factory",
"method",
"to",
"be",
"implemented",
"from",
"\\",
"SlackHookFramework",
"\\",
"AbstractCommand",
"."
] | b2357275d6042e49cb082e375716effd4c001ee0 | https://github.com/digitalicagroup/slack-hook-framework/blob/b2357275d6042e49cb082e375716effd4c001ee0/lib/SlackHookFramework/CmdHello.php#L43-L106 |
239,118 | jurchiks/commons | src/collections/ArrayMap.php | ArrayMap.toList | public function toList(bool $mutable): ArrayList
{
if ($mutable)
{
return new MutableList(array_values($this->data));
}
else
{
return new ImmutableList(array_values($this->data));
}
} | php | public function toList(bool $mutable): ArrayList
{
if ($mutable)
{
return new MutableList(array_values($this->data));
}
else
{
return new ImmutableList(array_values($this->data));
}
} | [
"public",
"function",
"toList",
"(",
"bool",
"$",
"mutable",
")",
":",
"ArrayList",
"{",
"if",
"(",
"$",
"mutable",
")",
"{",
"return",
"new",
"MutableList",
"(",
"array_values",
"(",
"$",
"this",
"->",
"data",
")",
")",
";",
"}",
"else",
"{",
"retur... | Copy the values of this collection into a list. Keys are not preserved.
@param bool $mutable : if true, will return a MutableList, otherwise an ImmutableList
@return ArrayList | [
"Copy",
"the",
"values",
"of",
"this",
"collection",
"into",
"a",
"list",
".",
"Keys",
"are",
"not",
"preserved",
"."
] | be9e1eca6a94380647160a882b8476bee3e4d8f8 | https://github.com/jurchiks/commons/blob/be9e1eca6a94380647160a882b8476bee3e4d8f8/src/collections/ArrayMap.php#L44-L54 |
239,119 | mtils/beetree | src/BeeTree/Eloquent/Relation/HasChildren.php | HasChildren.append | public function append(Node $node)
{
if (!is_array($this->_children)) {
$this->_children = [];
}
$this->_children[] = $node;
return $this;
} | php | public function append(Node $node)
{
if (!is_array($this->_children)) {
$this->_children = [];
}
$this->_children[] = $node;
return $this;
} | [
"public",
"function",
"append",
"(",
"Node",
"$",
"node",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"this",
"->",
"_children",
")",
")",
"{",
"$",
"this",
"->",
"_children",
"=",
"[",
"]",
";",
"}",
"$",
"this",
"->",
"_children",
"[",
"]",... | Append a node to the list
@param \BeeTree\Contracts\Node $node
@return self | [
"Append",
"a",
"node",
"to",
"the",
"list"
] | 4a68fc94ec14d5faef773b1628c9060db7bf1ce2 | https://github.com/mtils/beetree/blob/4a68fc94ec14d5faef773b1628c9060db7bf1ce2/src/BeeTree/Eloquent/Relation/HasChildren.php#L154-L163 |
239,120 | phPoirot/Http | Header/FactoryHttpHeader.php | FactoryHttpHeader.plugins | static function plugins()
{
if (! self::isEnabledPlugins() )
throw new \Exception('Using Plugins depends on Poirot/Ioc; that not exists currently.');
if (! self::$pluginManager )
self::$pluginManager = new PluginsHttpHeader;
return self::$pluginManager;
} | php | static function plugins()
{
if (! self::isEnabledPlugins() )
throw new \Exception('Using Plugins depends on Poirot/Ioc; that not exists currently.');
if (! self::$pluginManager )
self::$pluginManager = new PluginsHttpHeader;
return self::$pluginManager;
} | [
"static",
"function",
"plugins",
"(",
")",
"{",
"if",
"(",
"!",
"self",
"::",
"isEnabledPlugins",
"(",
")",
")",
"throw",
"new",
"\\",
"Exception",
"(",
"'Using Plugins depends on Poirot/Ioc; that not exists currently.'",
")",
";",
"if",
"(",
"!",
"self",
"::",
... | Headers Plugin Manager
@return PluginsHttpHeader
@throws \Exception | [
"Headers",
"Plugin",
"Manager"
] | 3230b3555abf0e74c3d593fc49c8978758969736 | https://github.com/phPoirot/Http/blob/3230b3555abf0e74c3d593fc49c8978758969736/Header/FactoryHttpHeader.php#L116-L126 |
239,121 | phPoirot/Http | Header/FactoryHttpHeader.php | FactoryHttpHeader.givePluginManager | static function givePluginManager(PluginsHttpHeader $pluginsManager)
{
if ( self::$pluginManager !== null )
throw new exImmutable('Header Factory Has Plugin Manager, and can`t be changed.');
self::$pluginManager = $pluginsManager;
} | php | static function givePluginManager(PluginsHttpHeader $pluginsManager)
{
if ( self::$pluginManager !== null )
throw new exImmutable('Header Factory Has Plugin Manager, and can`t be changed.');
self::$pluginManager = $pluginsManager;
} | [
"static",
"function",
"givePluginManager",
"(",
"PluginsHttpHeader",
"$",
"pluginsManager",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"pluginManager",
"!==",
"null",
")",
"throw",
"new",
"exImmutable",
"(",
"'Header Factory Has Plugin Manager, and can`t be changed.'",
")"... | Set Headers Plugin Manager
@param PluginsHttpHeader $pluginsManager | [
"Set",
"Headers",
"Plugin",
"Manager"
] | 3230b3555abf0e74c3d593fc49c8978758969736 | https://github.com/phPoirot/Http/blob/3230b3555abf0e74c3d593fc49c8978758969736/Header/FactoryHttpHeader.php#L133-L139 |
239,122 | Cheezykins/RestAPICore | lib/Cache/LocalCache.php | LocalCache.forget | public function forget(string $key): bool
{
$key = $this->hashKey($key);
if (\array_key_exists($key, $this->cache)) {
unset($this->cache[$key]);
return true;
}
return false;
} | php | public function forget(string $key): bool
{
$key = $this->hashKey($key);
if (\array_key_exists($key, $this->cache)) {
unset($this->cache[$key]);
return true;
}
return false;
} | [
"public",
"function",
"forget",
"(",
"string",
"$",
"key",
")",
":",
"bool",
"{",
"$",
"key",
"=",
"$",
"this",
"->",
"hashKey",
"(",
"$",
"key",
")",
";",
"if",
"(",
"\\",
"array_key_exists",
"(",
"$",
"key",
",",
"$",
"this",
"->",
"cache",
")"... | Clear the cache for the given key
Returns true on success or false on failure.
@param string $key
@return bool
@internal param string $url | [
"Clear",
"the",
"cache",
"for",
"the",
"given",
"key",
"Returns",
"true",
"on",
"success",
"or",
"false",
"on",
"failure",
"."
] | 35c0b40b9b71db93da1ff8ecd1849f18b616705a | https://github.com/Cheezykins/RestAPICore/blob/35c0b40b9b71db93da1ff8ecd1849f18b616705a/lib/Cache/LocalCache.php#L44-L52 |
239,123 | Cheezykins/RestAPICore | lib/Cache/LocalCache.php | LocalCache.remember | public function remember(string $key, callable $callBack)
{
$existing = $this->get($key);
if ($existing !== null) {
return $existing;
}
$result = $callBack();
return $this->put($key, $result);
} | php | public function remember(string $key, callable $callBack)
{
$existing = $this->get($key);
if ($existing !== null) {
return $existing;
}
$result = $callBack();
return $this->put($key, $result);
} | [
"public",
"function",
"remember",
"(",
"string",
"$",
"key",
",",
"callable",
"$",
"callBack",
")",
"{",
"$",
"existing",
"=",
"$",
"this",
"->",
"get",
"(",
"$",
"key",
")",
";",
"if",
"(",
"$",
"existing",
"!==",
"null",
")",
"{",
"return",
"$",
... | Remembers the return value of the callback and returns that
if available on next call.
@param $key string
@param callable $callBack
@return mixed | [
"Remembers",
"the",
"return",
"value",
"of",
"the",
"callback",
"and",
"returns",
"that",
"if",
"available",
"on",
"next",
"call",
"."
] | 35c0b40b9b71db93da1ff8ecd1849f18b616705a | https://github.com/Cheezykins/RestAPICore/blob/35c0b40b9b71db93da1ff8ecd1849f18b616705a/lib/Cache/LocalCache.php#L71-L80 |
239,124 | Cheezykins/RestAPICore | lib/Cache/LocalCache.php | LocalCache.get | public function get(string $key)
{
$key = $this->hashKey($key);
if (\array_key_exists($key, $this->cache)) {
$this->hits++;
return $this->cache[$key];
}
$this->misses++;
return null;
} | php | public function get(string $key)
{
$key = $this->hashKey($key);
if (\array_key_exists($key, $this->cache)) {
$this->hits++;
return $this->cache[$key];
}
$this->misses++;
return null;
} | [
"public",
"function",
"get",
"(",
"string",
"$",
"key",
")",
"{",
"$",
"key",
"=",
"$",
"this",
"->",
"hashKey",
"(",
"$",
"key",
")",
";",
"if",
"(",
"\\",
"array_key_exists",
"(",
"$",
"key",
",",
"$",
"this",
"->",
"cache",
")",
")",
"{",
"$... | Retrieve an item from the cache.
@param $key string
@return mixed | [
"Retrieve",
"an",
"item",
"from",
"the",
"cache",
"."
] | 35c0b40b9b71db93da1ff8ecd1849f18b616705a | https://github.com/Cheezykins/RestAPICore/blob/35c0b40b9b71db93da1ff8ecd1849f18b616705a/lib/Cache/LocalCache.php#L87-L96 |
239,125 | Cheezykins/RestAPICore | lib/Cache/LocalCache.php | LocalCache.put | public function put(string $key, $value)
{
$this->cache[$this->hashKey($key)] = $value;
return $value;
} | php | public function put(string $key, $value)
{
$this->cache[$this->hashKey($key)] = $value;
return $value;
} | [
"public",
"function",
"put",
"(",
"string",
"$",
"key",
",",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"cache",
"[",
"$",
"this",
"->",
"hashKey",
"(",
"$",
"key",
")",
"]",
"=",
"$",
"value",
";",
"return",
"$",
"value",
";",
"}"
] | Push an item into the cache for a given URL
Returns true on success or false on fail
@param $key string
@param $value mixed
@return mixed | [
"Push",
"an",
"item",
"into",
"the",
"cache",
"for",
"a",
"given",
"URL",
"Returns",
"true",
"on",
"success",
"or",
"false",
"on",
"fail"
] | 35c0b40b9b71db93da1ff8ecd1849f18b616705a | https://github.com/Cheezykins/RestAPICore/blob/35c0b40b9b71db93da1ff8ecd1849f18b616705a/lib/Cache/LocalCache.php#L105-L109 |
239,126 | weew/http-app-request-handler | src/Weew/HttpApp/RequestHandler/RequestHandlerProvider.php | RequestHandlerProvider.handleHandleHttpRequestEvent | public function handleHandleHttpRequestEvent(HandleHttpRequestEvent $event) {
$event->setResponse(
$this->requestHandler->handle($event->getRequest())
);
} | php | public function handleHandleHttpRequestEvent(HandleHttpRequestEvent $event) {
$event->setResponse(
$this->requestHandler->handle($event->getRequest())
);
} | [
"public",
"function",
"handleHandleHttpRequestEvent",
"(",
"HandleHttpRequestEvent",
"$",
"event",
")",
"{",
"$",
"event",
"->",
"setResponse",
"(",
"$",
"this",
"->",
"requestHandler",
"->",
"handle",
"(",
"$",
"event",
"->",
"getRequest",
"(",
")",
")",
")",... | Handle HandleHttpRequestEvent and create a response.
@param HandleHttpRequestEvent $event | [
"Handle",
"HandleHttpRequestEvent",
"and",
"create",
"a",
"response",
"."
] | d3227c52518dfb8c434d2db02583c05ae94fec4a | https://github.com/weew/http-app-request-handler/blob/d3227c52518dfb8c434d2db02583c05ae94fec4a/src/Weew/HttpApp/RequestHandler/RequestHandlerProvider.php#L87-L91 |
239,127 | weew/http-app-request-handler | src/Weew/HttpApp/RequestHandler/RequestHandlerProvider.php | RequestHandlerProvider.shareInstancesInContainer | protected function shareInstancesInContainer() {
$this->container->set([Router::class, IRouter::class], $this->router);
$this->container->set(
[RequestHandler::class, IRequestHandler::class], $this->requestHandler
);
} | php | protected function shareInstancesInContainer() {
$this->container->set([Router::class, IRouter::class], $this->router);
$this->container->set(
[RequestHandler::class, IRequestHandler::class], $this->requestHandler
);
} | [
"protected",
"function",
"shareInstancesInContainer",
"(",
")",
"{",
"$",
"this",
"->",
"container",
"->",
"set",
"(",
"[",
"Router",
"::",
"class",
",",
"IRouter",
"::",
"class",
"]",
",",
"$",
"this",
"->",
"router",
")",
";",
"$",
"this",
"->",
"con... | Share instances in the container. | [
"Share",
"instances",
"in",
"the",
"container",
"."
] | d3227c52518dfb8c434d2db02583c05ae94fec4a | https://github.com/weew/http-app-request-handler/blob/d3227c52518dfb8c434d2db02583c05ae94fec4a/src/Weew/HttpApp/RequestHandler/RequestHandlerProvider.php#L96-L101 |
239,128 | weew/http-app-request-handler | src/Weew/HttpApp/RequestHandler/RequestHandlerProvider.php | RequestHandlerProvider.loadRoutesFromConfig | protected function loadRoutesFromConfig() {
$config = $this->config->getRaw('routing', []);
$this->routerConfigurator->processConfig($this->router, $config);
} | php | protected function loadRoutesFromConfig() {
$config = $this->config->getRaw('routing', []);
$this->routerConfigurator->processConfig($this->router, $config);
} | [
"protected",
"function",
"loadRoutesFromConfig",
"(",
")",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"config",
"->",
"getRaw",
"(",
"'routing'",
",",
"[",
"]",
")",
";",
"$",
"this",
"->",
"routerConfigurator",
"->",
"processConfig",
"(",
"$",
"this",
... | Load routes from config. | [
"Load",
"routes",
"from",
"config",
"."
] | d3227c52518dfb8c434d2db02583c05ae94fec4a | https://github.com/weew/http-app-request-handler/blob/d3227c52518dfb8c434d2db02583c05ae94fec4a/src/Weew/HttpApp/RequestHandler/RequestHandlerProvider.php#L106-L109 |
239,129 | rocketphp/template | src/Template.php | Template.output | public function output()
{
if (!file_exists($this->_file))
throw new RuntimeException(
"Error loading template file: $this->_file.",
1
);
$output = file_get_contents($this->_file);
foreach ($this->_vars as $key => $value) {
... | php | public function output()
{
if (!file_exists($this->_file))
throw new RuntimeException(
"Error loading template file: $this->_file.",
1
);
$output = file_get_contents($this->_file);
foreach ($this->_vars as $key => $value) {
... | [
"public",
"function",
"output",
"(",
")",
"{",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"this",
"->",
"_file",
")",
")",
"throw",
"new",
"RuntimeException",
"(",
"\"Error loading template file: $this->_file.\"",
",",
"1",
")",
";",
"$",
"output",
"=",
"file_... | Outputs interpreted template content
@return string | [
"Outputs",
"interpreted",
"template",
"content"
] | cc870b5572df830cd6b3a83e5fbec59943deb2df | https://github.com/rocketphp/template/blob/cc870b5572df830cd6b3a83e5fbec59943deb2df/src/Template.php#L99-L115 |
239,130 | AnonymPHP/Anonym-Library | src/Anonym/Security/Validation.php | Validation.make | public function make(array $data = [],array $validationRules = [],array $filterRules = [])
{
$data = $this->sanitize($data);
$this->validation_rules($validationRules);
$this->filter_rules($filterRules);
return $this->run($data);
} | php | public function make(array $data = [],array $validationRules = [],array $filterRules = [])
{
$data = $this->sanitize($data);
$this->validation_rules($validationRules);
$this->filter_rules($filterRules);
return $this->run($data);
} | [
"public",
"function",
"make",
"(",
"array",
"$",
"data",
"=",
"[",
"]",
",",
"array",
"$",
"validationRules",
"=",
"[",
"]",
",",
"array",
"$",
"filterRules",
"=",
"[",
"]",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"sanitize",
"(",
"$",
"da... | validate datas with validation rules and filter rules
@param array $data
@param array $validationRules
@param array $filterRules
@return bool|array | [
"validate",
"datas",
"with",
"validation",
"rules",
"and",
"filter",
"rules"
] | c967ad804f84e8fb204593a0959cda2fed5ae075 | https://github.com/AnonymPHP/Anonym-Library/blob/c967ad804f84e8fb204593a0959cda2fed5ae075/src/Anonym/Security/Validation.php#L29-L36 |
239,131 | LordMonoxide/phi | src/Phi.php | Phi.make | public function make($alias, array $arguments = []) {
// Iterate over each resolver and see if they have a binding override
foreach($this->_resolvers as $resolver) {
// Ask the resolver for the alias' binding
$binding = $resolver->make($alias, $arguments);
// If it's not null, we got a ... | php | public function make($alias, array $arguments = []) {
// Iterate over each resolver and see if they have a binding override
foreach($this->_resolvers as $resolver) {
// Ask the resolver for the alias' binding
$binding = $resolver->make($alias, $arguments);
// If it's not null, we got a ... | [
"public",
"function",
"make",
"(",
"$",
"alias",
",",
"array",
"$",
"arguments",
"=",
"[",
"]",
")",
"{",
"// Iterate over each resolver and see if they have a binding override",
"foreach",
"(",
"$",
"this",
"->",
"_resolvers",
"as",
"$",
"resolver",
")",
"{",
"... | Gets or creates an instance of an alias
@param string $alias An alias (eg. `db.helper`), or a real class or interface name
@param array $arguments The arguments to pass to the binding
@returns object A new instance of `$alias`'s binding, or a shared instance in the case of singletons | [
"Gets",
"or",
"creates",
"an",
"instance",
"of",
"an",
"alias"
] | c542804d621c81b40de9b648fa6e2eb3ec3cbc50 | https://github.com/LordMonoxide/phi/blob/c542804d621c81b40de9b648fa6e2eb3ec3cbc50/src/Phi.php#L59-L199 |
239,132 | Cube-Solutions/PHPConsistent | Main.php | PHPConsistent_Main.start | public function start()
{
$this->_starttime = microtime(true);
if (extension_loaded('xdebug') === false) {
return false;
}
if (is_null($this->_traceFile) === true) {
$this->_traceFile = tempnam(sys_get_temp_dir(), 'PHPConsistent_');
}
ini_set('xdeb... | php | public function start()
{
$this->_starttime = microtime(true);
if (extension_loaded('xdebug') === false) {
return false;
}
if (is_null($this->_traceFile) === true) {
$this->_traceFile = tempnam(sys_get_temp_dir(), 'PHPConsistent_');
}
ini_set('xdeb... | [
"public",
"function",
"start",
"(",
")",
"{",
"$",
"this",
"->",
"_starttime",
"=",
"microtime",
"(",
"true",
")",
";",
"if",
"(",
"extension_loaded",
"(",
"'xdebug'",
")",
"===",
"false",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"is_null",
... | Start PHPConsistent run | [
"Start",
"PHPConsistent",
"run"
] | 3b294d05a3c781735b51358e97bf27c799973641 | https://github.com/Cube-Solutions/PHPConsistent/blob/3b294d05a3c781735b51358e97bf27c799973641/Main.php#L105-L134 |
239,133 | Cube-Solutions/PHPConsistent | Main.php | PHPConsistent_Main.analyze | public function analyze()
{
if (!file_exists($this->_traceFile)) {
return false;
}
$this->processFunctionCalls();
unlink($this->_traceFile);
if (file_exists($this->_traceFile . '.xt')) {
unlink($this->_traceFile . '.xt');
}
if (count($... | php | public function analyze()
{
if (!file_exists($this->_traceFile)) {
return false;
}
$this->processFunctionCalls();
unlink($this->_traceFile);
if (file_exists($this->_traceFile . '.xt')) {
unlink($this->_traceFile . '.xt');
}
if (count($... | [
"public",
"function",
"analyze",
"(",
")",
"{",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"this",
"->",
"_traceFile",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"this",
"->",
"processFunctionCalls",
"(",
")",
";",
"unlink",
"(",
"$",
"this",
"->... | Analyze PHPConsistent data from trace file | [
"Analyze",
"PHPConsistent",
"data",
"from",
"trace",
"file"
] | 3b294d05a3c781735b51358e97bf27c799973641 | https://github.com/Cube-Solutions/PHPConsistent/blob/3b294d05a3c781735b51358e97bf27c799973641/Main.php#L152-L168 |
239,134 | Cube-Solutions/PHPConsistent | Main.php | PHPConsistent_Main.addParamTypeFailure | protected function addParamTypeFailure($fileName, $fileLine, $calledFunction, $parameterNumber, $parameterName, $expectedType, $calledType)
{
$data = 'Invalid type calling ' . $calledFunction . ' : parameter ' . $parameterNumber . ' (' . $parameterName . ') should be of type ' . $expectedType . ' but got '... | php | protected function addParamTypeFailure($fileName, $fileLine, $calledFunction, $parameterNumber, $parameterName, $expectedType, $calledType)
{
$data = 'Invalid type calling ' . $calledFunction . ' : parameter ' . $parameterNumber . ' (' . $parameterName . ') should be of type ' . $expectedType . ' but got '... | [
"protected",
"function",
"addParamTypeFailure",
"(",
"$",
"fileName",
",",
"$",
"fileLine",
",",
"$",
"calledFunction",
",",
"$",
"parameterNumber",
",",
"$",
"parameterName",
",",
"$",
"expectedType",
",",
"$",
"calledType",
")",
"{",
"$",
"data",
"=",
"'In... | Add a failure about incorrect parameter type
@param string $fileName
@param int $fileLine
@param string $calledFunction
@param int $parameterNumber
@param string $parameterName
@param string $expectedType
@param string $calledType | [
"Add",
"a",
"failure",
"about",
"incorrect",
"parameter",
"type"
] | 3b294d05a3c781735b51358e97bf27c799973641 | https://github.com/Cube-Solutions/PHPConsistent/blob/3b294d05a3c781735b51358e97bf27c799973641/Main.php#L483-L487 |
239,135 | Cube-Solutions/PHPConsistent | Main.php | PHPConsistent_Main.addParamNameMismatchFailure | protected function addParamNameMismatchFailure($fileName, $fileLine, $calledFunction, $parameterNumber, $expectedName, $calledName)
{
$data = 'Parameter names in function definition and docblock don\'t match when calling ' . $calledFunction . ' : parameter ' . $parameterNumber . ' (' . $calledName . ') shou... | php | protected function addParamNameMismatchFailure($fileName, $fileLine, $calledFunction, $parameterNumber, $expectedName, $calledName)
{
$data = 'Parameter names in function definition and docblock don\'t match when calling ' . $calledFunction . ' : parameter ' . $parameterNumber . ' (' . $calledName . ') shou... | [
"protected",
"function",
"addParamNameMismatchFailure",
"(",
"$",
"fileName",
",",
"$",
"fileLine",
",",
"$",
"calledFunction",
",",
"$",
"parameterNumber",
",",
"$",
"expectedName",
",",
"$",
"calledName",
")",
"{",
"$",
"data",
"=",
"'Parameter names in function... | Add a failure about mismatching parameter names
@param string $fileName
@param int $fileLine
@param stirng $calledFunction
@param int $parameterNumber
@param string $expectedName
@param string $calledName | [
"Add",
"a",
"failure",
"about",
"mismatching",
"parameter",
"names"
] | 3b294d05a3c781735b51358e97bf27c799973641 | https://github.com/Cube-Solutions/PHPConsistent/blob/3b294d05a3c781735b51358e97bf27c799973641/Main.php#L512-L516 |
239,136 | Cube-Solutions/PHPConsistent | Main.php | PHPConsistent_Main.addParamCountMismatchFailure | protected function addParamCountMismatchFailure($fileName, $fileLine, $calledFunction, $expectedCount, $actualCount)
{
$data = 'Parameter count in function definition and docblock don\'t match when calling ' . $calledFunction . ' : function has ' . $actualCount . ' but should be ' . $expectedCount . ' accor... | php | protected function addParamCountMismatchFailure($fileName, $fileLine, $calledFunction, $expectedCount, $actualCount)
{
$data = 'Parameter count in function definition and docblock don\'t match when calling ' . $calledFunction . ' : function has ' . $actualCount . ' but should be ' . $expectedCount . ' accor... | [
"protected",
"function",
"addParamCountMismatchFailure",
"(",
"$",
"fileName",
",",
"$",
"fileLine",
",",
"$",
"calledFunction",
",",
"$",
"expectedCount",
",",
"$",
"actualCount",
")",
"{",
"$",
"data",
"=",
"'Parameter count in function definition and docblock don\\'t... | Add a failure about mismatching parameter count
@param string $fileName
@param int $fileLine
@param string $calledFunction
@param int $expectedCount
@param int $actualCount | [
"Add",
"a",
"failure",
"about",
"mismatching",
"parameter",
"count"
] | 3b294d05a3c781735b51358e97bf27c799973641 | https://github.com/Cube-Solutions/PHPConsistent/blob/3b294d05a3c781735b51358e97bf27c799973641/Main.php#L526-L530 |
239,137 | Cube-Solutions/PHPConsistent | Main.php | PHPConsistent_Main.reportFailure | protected function reportFailure($fileName, $fileLine, $data)
{
switch ($this->_log) {
case self::LOG_TO_FILE:
file_put_contents(
$this->_logLocation,
$data . ' - in ' . $fileName . ' (line ' . $fileLine . ')',
FILE_APPE... | php | protected function reportFailure($fileName, $fileLine, $data)
{
switch ($this->_log) {
case self::LOG_TO_FILE:
file_put_contents(
$this->_logLocation,
$data . ' - in ' . $fileName . ' (line ' . $fileLine . ')',
FILE_APPE... | [
"protected",
"function",
"reportFailure",
"(",
"$",
"fileName",
",",
"$",
"fileLine",
",",
"$",
"data",
")",
"{",
"switch",
"(",
"$",
"this",
"->",
"_log",
")",
"{",
"case",
"self",
"::",
"LOG_TO_FILE",
":",
"file_put_contents",
"(",
"$",
"this",
"->",
... | Output to the chosen reporting system
@param string $fileName
@param int $fileLine
@param string $data | [
"Output",
"to",
"the",
"chosen",
"reporting",
"system"
] | 3b294d05a3c781735b51358e97bf27c799973641 | https://github.com/Cube-Solutions/PHPConsistent/blob/3b294d05a3c781735b51358e97bf27c799973641/Main.php#L538-L561 |
239,138 | aberdnikov/meerkat-core | classes/Meerkat/Html/Kohana/Table/Row.php | Kohana_Table_Row.& | function &add_cell($name = null) {
if (!$name) {
$name = uniqid(microtime(true), true);
}
$this->cells[$name] = new KHtml_Table_Cell();
return $this->cells[$name];
} | php | function &add_cell($name = null) {
if (!$name) {
$name = uniqid(microtime(true), true);
}
$this->cells[$name] = new KHtml_Table_Cell();
return $this->cells[$name];
} | [
"function",
"&",
"add_cell",
"(",
"$",
"name",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"name",
")",
"{",
"$",
"name",
"=",
"uniqid",
"(",
"microtime",
"(",
"true",
")",
",",
"true",
")",
";",
"}",
"$",
"this",
"->",
"cells",
"[",
"$",
"na... | Add named cell to row of table
@param string $name
@return KHtml_Table_Cell | [
"Add",
"named",
"cell",
"to",
"row",
"of",
"table"
] | 9aab1555919d76f1920198c64e21fd3faf9b5f5d | https://github.com/aberdnikov/meerkat-core/blob/9aab1555919d76f1920198c64e21fd3faf9b5f5d/classes/Meerkat/Html/Kohana/Table/Row.php#L18-L24 |
239,139 | silinternational/ssp-utilities | src/DiscoUtils.php | DiscoUtils.getIdpsForSp | public static function getIdpsForSp(
$spEntityId,
$metadataPath
) {
$idpEntries = Metadata::getIdpMetadataEntries($metadataPath);
return self::getReducedIdpList(
$idpEntries,
$metadataPath,
$spEntityId);
} | php | public static function getIdpsForSp(
$spEntityId,
$metadataPath
) {
$idpEntries = Metadata::getIdpMetadataEntries($metadataPath);
return self::getReducedIdpList(
$idpEntries,
$metadataPath,
$spEntityId);
} | [
"public",
"static",
"function",
"getIdpsForSp",
"(",
"$",
"spEntityId",
",",
"$",
"metadataPath",
")",
"{",
"$",
"idpEntries",
"=",
"Metadata",
"::",
"getIdpMetadataEntries",
"(",
"$",
"metadataPath",
")",
";",
"return",
"self",
"::",
"getReducedIdpList",
"(",
... | Takes the original idp entries and reduces them down to the ones
the current SP is meant to see.
@param string $spEntityId
@param string $metadataPath, the path to the simplesamlphp/metadata folder
@returns array of strings of entity id's of IDP's that this SP
is allowed to use for authentication. | [
"Takes",
"the",
"original",
"idp",
"entries",
"and",
"reduces",
"them",
"down",
"to",
"the",
"ones",
"the",
"current",
"SP",
"is",
"meant",
"to",
"see",
"."
] | e8c05bd8e4688aea2960bca74b7d6aa5f9f34286 | https://github.com/silinternational/ssp-utilities/blob/e8c05bd8e4688aea2960bca74b7d6aa5f9f34286/src/DiscoUtils.php#L76-L86 |
239,140 | llwebsol/EasyDB | src/Core/DB.php | DB.prepareStatement | private function prepareStatement($query, $parameters) {
$stmt = $this->db_connection->prepare($query);
if (!empty($parameters)) {
foreach ($parameters as $key => $val) {
$stmt->bindValue($key, $val);
}
}
return $stmt;... | php | private function prepareStatement($query, $parameters) {
$stmt = $this->db_connection->prepare($query);
if (!empty($parameters)) {
foreach ($parameters as $key => $val) {
$stmt->bindValue($key, $val);
}
}
return $stmt;... | [
"private",
"function",
"prepareStatement",
"(",
"$",
"query",
",",
"$",
"parameters",
")",
"{",
"$",
"stmt",
"=",
"$",
"this",
"->",
"db_connection",
"->",
"prepare",
"(",
"$",
"query",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"parameters",
")",
... | Convert a string query and parameters
to a PDO Statement
@param $query
@param $parameters
@return PDOStatement | [
"Convert",
"a",
"string",
"query",
"and",
"parameters",
"to",
"a",
"PDO",
"Statement"
] | 7a37e926da4b6b62c3dc58c83b8addd1ab04c2d0 | https://github.com/llwebsol/EasyDB/blob/7a37e926da4b6b62c3dc58c83b8addd1ab04c2d0/src/Core/DB.php#L130-L140 |
239,141 | llwebsol/EasyDB | src/Core/DB.php | DB.deleteWhere | function deleteWhere($table_name, $where_with_placeholders, $named_parameters) {
if (empty($where_with_placeholders) || !$table_name) {
return false;
}
$sql_query = 'DELETE FROM ' . $table_name . ' WHERE ' . $where_with_placeholders;
Event::dispatch(Eve... | php | function deleteWhere($table_name, $where_with_placeholders, $named_parameters) {
if (empty($where_with_placeholders) || !$table_name) {
return false;
}
$sql_query = 'DELETE FROM ' . $table_name . ' WHERE ' . $where_with_placeholders;
Event::dispatch(Eve... | [
"function",
"deleteWhere",
"(",
"$",
"table_name",
",",
"$",
"where_with_placeholders",
",",
"$",
"named_parameters",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"where_with_placeholders",
")",
"||",
"!",
"$",
"table_name",
")",
"{",
"return",
"false",
";",
"}",... | Performs an SQL delete with a 'WHERE' clause
@param string $table_name
@param string $where_with_placeholders
@param array $named_parameters
@return bool|int rows_affected
@throws QueryException | [
"Performs",
"an",
"SQL",
"delete",
"with",
"a",
"WHERE",
"clause"
] | 7a37e926da4b6b62c3dc58c83b8addd1ab04c2d0 | https://github.com/llwebsol/EasyDB/blob/7a37e926da4b6b62c3dc58c83b8addd1ab04c2d0/src/Core/DB.php#L324-L354 |
239,142 | llwebsol/EasyDB | src/Core/DB.php | DB.getEnumeratedParameterList | private function getEnumeratedParameterList($parameter_name, $param_array) {
$result = [];
if ($param_array) {
foreach ($param_array as $k => $v) {
$result[ ':' . $parameter_name . '_' . $k ] = $v;
}
}
return $result;
... | php | private function getEnumeratedParameterList($parameter_name, $param_array) {
$result = [];
if ($param_array) {
foreach ($param_array as $k => $v) {
$result[ ':' . $parameter_name . '_' . $k ] = $v;
}
}
return $result;
... | [
"private",
"function",
"getEnumeratedParameterList",
"(",
"$",
"parameter_name",
",",
"$",
"param_array",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"param_array",
")",
"{",
"foreach",
"(",
"$",
"param_array",
"as",
"$",
"k",
"=>",
"$",... | Returns an array of named parameters
@param string $parameter_name
@param array $param_array
@return array
* ex. for $parameter_name = 'user', $param_array = [123,345,456]
returns: [':user_0' => 123, ':user_1' => 345, ':user_2' => 456] | [
"Returns",
"an",
"array",
"of",
"named",
"parameters"
] | 7a37e926da4b6b62c3dc58c83b8addd1ab04c2d0 | https://github.com/llwebsol/EasyDB/blob/7a37e926da4b6b62c3dc58c83b8addd1ab04c2d0/src/Core/DB.php#L386-L395 |
239,143 | llwebsol/EasyDB | src/Core/DB.php | DB.updateWhere | public function updateWhere($table_name, $update_values, $where_with_placeholders, $named_parameters = null) {
$all_params = empty($named_parameters) ? $update_values : array_merge($update_values, $named_parameters);
Event::dispatch(EventData::forBefore(Event::BEFORE_UPDATE, $table_name, $all_p... | php | public function updateWhere($table_name, $update_values, $where_with_placeholders, $named_parameters = null) {
$all_params = empty($named_parameters) ? $update_values : array_merge($update_values, $named_parameters);
Event::dispatch(EventData::forBefore(Event::BEFORE_UPDATE, $table_name, $all_p... | [
"public",
"function",
"updateWhere",
"(",
"$",
"table_name",
",",
"$",
"update_values",
",",
"$",
"where_with_placeholders",
",",
"$",
"named_parameters",
"=",
"null",
")",
"{",
"$",
"all_params",
"=",
"empty",
"(",
"$",
"named_parameters",
")",
"?",
"$",
"u... | Performs an SQL update with a 'WHERE' clause
@param string $table_name
@param array $update_values
array( $column_name => $new_value )
@param string $where_with_placeholders
@param null|array $named_parameters
@return bool|int $rows_affected | [
"Performs",
"an",
"SQL",
"update",
"with",
"a",
"WHERE",
"clause"
] | 7a37e926da4b6b62c3dc58c83b8addd1ab04c2d0 | https://github.com/llwebsol/EasyDB/blob/7a37e926da4b6b62c3dc58c83b8addd1ab04c2d0/src/Core/DB.php#L422-L479 |
239,144 | gintonicweb/menus | src/Menu/MenuWrapper.php | MenuWrapper.render | public function render($data)
{
if (isset($data['content'])) {
$this->config(['content' => $data['content']]);
$content = new MenuContent($this->config(), $this->_here);
$group = isset($data['group'])? $data['group'] : null;
$contents = $content->render($group... | php | public function render($data)
{
if (isset($data['content'])) {
$this->config(['content' => $data['content']]);
$content = new MenuContent($this->config(), $this->_here);
$group = isset($data['group'])? $data['group'] : null;
$contents = $content->render($group... | [
"public",
"function",
"render",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"data",
"[",
"'content'",
"]",
")",
")",
"{",
"$",
"this",
"->",
"config",
"(",
"[",
"'content'",
"=>",
"$",
"data",
"[",
"'content'",
"]",
"]",
")",
";",
... | Renders the menu wrapper and it's content.
@param array $data options and content of the wrapper
@return string rendered wrapper | [
"Renders",
"the",
"menu",
"wrapper",
"and",
"it",
"s",
"content",
"."
] | 79ccbef8a014339a7bed9c1886d1837a5ef084b8 | https://github.com/gintonicweb/menus/blob/79ccbef8a014339a7bed9c1886d1837a5ef084b8/src/Menu/MenuWrapper.php#L48-L65 |
239,145 | Archi-Strasbourg/archi-wiki | includes/framework/frameworkClasses/googleMap.class.php | GoogleMap.addAdresse | function addAdresse($params=array())
{
$index = count($this->coordonnees);
if (isset($params['adresse']) && $params['adresse']!='') {
$this->coordonnees[$index]['adresse'] = $params['adresse'];
} else {
$this->coordonnees[$index]['adresse'] = '';
}
i... | php | function addAdresse($params=array())
{
$index = count($this->coordonnees);
if (isset($params['adresse']) && $params['adresse']!='') {
$this->coordonnees[$index]['adresse'] = $params['adresse'];
} else {
$this->coordonnees[$index]['adresse'] = '';
}
i... | [
"function",
"addAdresse",
"(",
"$",
"params",
"=",
"array",
"(",
")",
")",
"{",
"$",
"index",
"=",
"count",
"(",
"$",
"this",
"->",
"coordonnees",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"params",
"[",
"'adresse'",
"]",
")",
"&&",
"$",
"params",
... | Ajouter une adresse ?
@param array $params Paramètres
@return void | [
"Ajouter",
"une",
"adresse",
"?"
] | b9fb39f43a78409890a7de96426c1f6c49d5c323 | https://github.com/Archi-Strasbourg/archi-wiki/blob/b9fb39f43a78409890a7de96426c1f6c49d5c323/includes/framework/frameworkClasses/googleMap.class.php#L165-L205 |
239,146 | Archi-Strasbourg/archi-wiki | includes/framework/frameworkClasses/googleMap.class.php | GoogleMap.getHTML | public function getHTML()
{
$html="<div id='".$this->googleMapNameId."' style='width: ".$this->googleMapWidth."px; height: ".$this->googleMapHeight."px; ".$this->divStyle."'>Veuilliez patienter pendant le chargement de la carte...</div>";
//$html.="<script >";
/*
if (count($th... | php | public function getHTML()
{
$html="<div id='".$this->googleMapNameId."' style='width: ".$this->googleMapWidth."px; height: ".$this->googleMapHeight."px; ".$this->divStyle."'>Veuilliez patienter pendant le chargement de la carte...</div>";
//$html.="<script >";
/*
if (count($th... | [
"public",
"function",
"getHTML",
"(",
")",
"{",
"$",
"html",
"=",
"\"<div id='\"",
".",
"$",
"this",
"->",
"googleMapNameId",
".",
"\"' style='width: \"",
".",
"$",
"this",
"->",
"googleMapWidth",
".",
"\"px; height: \"",
".",
"$",
"this",
"->",
"googleMapHeig... | Affiche la carte
Si l'on veut rajouter des evenements a cette carte , il faut ajouter le code des evenements apres l'appel a cette fonction, car c'est ici que l'on cree "map"
@return string HTML | [
"Affiche",
"la",
"carte",
"Si",
"l",
"on",
"veut",
"rajouter",
"des",
"evenements",
"a",
"cette",
"carte",
"il",
"faut",
"ajouter",
"le",
"code",
"des",
"evenements",
"apres",
"l",
"appel",
"a",
"cette",
"fonction",
"car",
"c",
"est",
"ici",
"que",
"l",
... | b9fb39f43a78409890a7de96426c1f6c49d5c323 | https://github.com/Archi-Strasbourg/archi-wiki/blob/b9fb39f43a78409890a7de96426c1f6c49d5c323/includes/framework/frameworkClasses/googleMap.class.php#L439-L593 |
239,147 | Archi-Strasbourg/archi-wiki | includes/framework/frameworkClasses/googleMap.class.php | GoogleMap.distance | public function distance($lat1=0, $lon1=0, $lat2=0, $lon2=0)
{
$theta = $lon1 - $lon2;
$dist = sin(_deg2rad($lat1)) * sin(_deg2rad($lat2)) + cos(_deg2rad($lat1)) * cos(_deg2rad($lat2)) * cos(_deg2rad($theta));
$dist = acos($dist);
$dist = _rad2deg($dist);
$dist = $... | php | public function distance($lat1=0, $lon1=0, $lat2=0, $lon2=0)
{
$theta = $lon1 - $lon2;
$dist = sin(_deg2rad($lat1)) * sin(_deg2rad($lat2)) + cos(_deg2rad($lat1)) * cos(_deg2rad($lat2)) * cos(_deg2rad($theta));
$dist = acos($dist);
$dist = _rad2deg($dist);
$dist = $... | [
"public",
"function",
"distance",
"(",
"$",
"lat1",
"=",
"0",
",",
"$",
"lon1",
"=",
"0",
",",
"$",
"lat2",
"=",
"0",
",",
"$",
"lon2",
"=",
"0",
")",
"{",
"$",
"theta",
"=",
"$",
"lon1",
"-",
"$",
"lon2",
";",
"$",
"dist",
"=",
"sin",
"(",... | Calcul de distance
@param int $lat1 Latitude 1
@param int $lon1 Longitude 1
@param int $lat2 Latitude 2
@param int $lon2 Longitude 2
@return int Distance | [
"Calcul",
"de",
"distance"
] | b9fb39f43a78409890a7de96426c1f6c49d5c323 | https://github.com/Archi-Strasbourg/archi-wiki/blob/b9fb39f43a78409890a7de96426c1f6c49d5c323/includes/framework/frameworkClasses/googleMap.class.php#L1984-L1994 |
239,148 | oroinc/OroChainProcessorComponent | Debug/ActionProcessorDataCollector.php | ActionProcessorDataCollector.getActions | public function getActions()
{
$actions = [];
foreach ($this->data['actions'] as $action) {
$name = $action['name'];
$time = isset($action['time'])
? $action['time']
: 0;
if (isset($actions[$name])) {
$actions[$name]... | php | public function getActions()
{
$actions = [];
foreach ($this->data['actions'] as $action) {
$name = $action['name'];
$time = isset($action['time'])
? $action['time']
: 0;
if (isset($actions[$name])) {
$actions[$name]... | [
"public",
"function",
"getActions",
"(",
")",
"{",
"$",
"actions",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"data",
"[",
"'actions'",
"]",
"as",
"$",
"action",
")",
"{",
"$",
"name",
"=",
"$",
"action",
"[",
"'name'",
"]",
";",
"$",... | Gets executed actions.
@return array | [
"Gets",
"executed",
"actions",
"."
] | 89c9bc60140292c9367a0c3178f760ecbcec6bd2 | https://github.com/oroinc/OroChainProcessorComponent/blob/89c9bc60140292c9367a0c3178f760ecbcec6bd2/Debug/ActionProcessorDataCollector.php#L60-L77 |
239,149 | oroinc/OroChainProcessorComponent | Debug/ActionProcessorDataCollector.php | ActionProcessorDataCollector.getProcessors | public function getProcessors()
{
$processors = [];
foreach ($this->data['actions'] as $action) {
if (isset($action['processors'])) {
foreach ($action['processors'] as $processor) {
$id = $processor['id'];
$time = isset($processor['... | php | public function getProcessors()
{
$processors = [];
foreach ($this->data['actions'] as $action) {
if (isset($action['processors'])) {
foreach ($action['processors'] as $processor) {
$id = $processor['id'];
$time = isset($processor['... | [
"public",
"function",
"getProcessors",
"(",
")",
"{",
"$",
"processors",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"data",
"[",
"'actions'",
"]",
"as",
"$",
"action",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"action",
"[",
"'processors'",... | Gets executed processors.
@return array | [
"Gets",
"executed",
"processors",
"."
] | 89c9bc60140292c9367a0c3178f760ecbcec6bd2 | https://github.com/oroinc/OroChainProcessorComponent/blob/89c9bc60140292c9367a0c3178f760ecbcec6bd2/Debug/ActionProcessorDataCollector.php#L94-L115 |
239,150 | oroinc/OroChainProcessorComponent | Debug/ActionProcessorDataCollector.php | ActionProcessorDataCollector.getProcessorCount | public function getProcessorCount()
{
$count = 0;
foreach ($this->data['actions'] as $action) {
if (isset($action['processors'])) {
$count += count($action['processors']);
}
}
return $count;
} | php | public function getProcessorCount()
{
$count = 0;
foreach ($this->data['actions'] as $action) {
if (isset($action['processors'])) {
$count += count($action['processors']);
}
}
return $count;
} | [
"public",
"function",
"getProcessorCount",
"(",
")",
"{",
"$",
"count",
"=",
"0",
";",
"foreach",
"(",
"$",
"this",
"->",
"data",
"[",
"'actions'",
"]",
"as",
"$",
"action",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"action",
"[",
"'processors'",
"]",
... | Gets the number of executed processors.
@return int | [
"Gets",
"the",
"number",
"of",
"executed",
"processors",
"."
] | 89c9bc60140292c9367a0c3178f760ecbcec6bd2 | https://github.com/oroinc/OroChainProcessorComponent/blob/89c9bc60140292c9367a0c3178f760ecbcec6bd2/Debug/ActionProcessorDataCollector.php#L122-L132 |
239,151 | oroinc/OroChainProcessorComponent | Debug/ActionProcessorDataCollector.php | ActionProcessorDataCollector.getTotalTime | public function getTotalTime()
{
if (null === $this->totalTime) {
$this->totalTime = 0;
foreach ($this->data['actions'] as $action) {
if (isset($action['time'])) {
$this->totalTime += $action['time'];
}
}
for... | php | public function getTotalTime()
{
if (null === $this->totalTime) {
$this->totalTime = 0;
foreach ($this->data['actions'] as $action) {
if (isset($action['time'])) {
$this->totalTime += $action['time'];
}
}
for... | [
"public",
"function",
"getTotalTime",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"totalTime",
")",
"{",
"$",
"this",
"->",
"totalTime",
"=",
"0",
";",
"foreach",
"(",
"$",
"this",
"->",
"data",
"[",
"'actions'",
"]",
"as",
"$",
"ac... | Gets the total time of all executed actions.
@return float | [
"Gets",
"the",
"total",
"time",
"of",
"all",
"executed",
"actions",
"."
] | 89c9bc60140292c9367a0c3178f760ecbcec6bd2 | https://github.com/oroinc/OroChainProcessorComponent/blob/89c9bc60140292c9367a0c3178f760ecbcec6bd2/Debug/ActionProcessorDataCollector.php#L149-L166 |
239,152 | agentmedia/phine-forms | src/Forms/Modules/Backend/FormForm.php | FormForm.SaveElement | protected function SaveElement()
{
$this->form->SetMethod($this->Value('Method'));
$this->form->SetSaveTo($this->Value('SaveTo'));
$this->form->SetSendFrom($this->Value('SendFrom'));
$this->form->SetSendTo($this->Value('SendTo'));
$this->form->SetRedirectUrl($this->selector->... | php | protected function SaveElement()
{
$this->form->SetMethod($this->Value('Method'));
$this->form->SetSaveTo($this->Value('SaveTo'));
$this->form->SetSendFrom($this->Value('SendFrom'));
$this->form->SetSendTo($this->Value('SendTo'));
$this->form->SetRedirectUrl($this->selector->... | [
"protected",
"function",
"SaveElement",
"(",
")",
"{",
"$",
"this",
"->",
"form",
"->",
"SetMethod",
"(",
"$",
"this",
"->",
"Value",
"(",
"'Method'",
")",
")",
";",
"$",
"this",
"->",
"form",
"->",
"SetSaveTo",
"(",
"$",
"this",
"->",
"Value",
"(",
... | Attaches properties and returns the form content
@return ContentForm | [
"Attaches",
"properties",
"and",
"returns",
"the",
"form",
"content"
] | cd7a92ea443756bef5885a9e8f59ad6b8d2771fc | https://github.com/agentmedia/phine-forms/blob/cd7a92ea443756bef5885a9e8f59ad6b8d2771fc/src/Forms/Modules/Backend/FormForm.php#L120-L128 |
239,153 | sios13/simox | src/Cache.php | Cache.exists | public function exists( $key, $lifetime )
{
if ( !$this->cache_dir )
{
$this->initializeCacheDir();
}
if ( !file_exists($this->cache_dir . $key . ".html") )
{
return false;
}
$file_lifetime = time() - filectime( $this->cache_dir . $ke... | php | public function exists( $key, $lifetime )
{
if ( !$this->cache_dir )
{
$this->initializeCacheDir();
}
if ( !file_exists($this->cache_dir . $key . ".html") )
{
return false;
}
$file_lifetime = time() - filectime( $this->cache_dir . $ke... | [
"public",
"function",
"exists",
"(",
"$",
"key",
",",
"$",
"lifetime",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"cache_dir",
")",
"{",
"$",
"this",
"->",
"initializeCacheDir",
"(",
")",
";",
"}",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"this",... | Returns true if cache with given key exists, otherwise false
If the cache has lived for longer than its life time, destroy the cache | [
"Returns",
"true",
"if",
"cache",
"with",
"given",
"key",
"exists",
"otherwise",
"false",
"If",
"the",
"cache",
"has",
"lived",
"for",
"longer",
"than",
"its",
"life",
"time",
"destroy",
"the",
"cache"
] | 8be964949ef179aba7eceb3fc6439815a1af2ad2 | https://github.com/sios13/simox/blob/8be964949ef179aba7eceb3fc6439815a1af2ad2/src/Cache.php#L40-L61 |
239,154 | anonymous-php/containers | src/RedisContainer.php | RedisContainer.prefill | protected function prefill()
{
if (!$this->prefill || $this->prefilled) {
return;
}
try {
$this->definitions = $this->getReadConnection()->hGetAll($this->hashName);
$this->prefilled = true;
} catch (\Exception $exception) {
throw new R... | php | protected function prefill()
{
if (!$this->prefill || $this->prefilled) {
return;
}
try {
$this->definitions = $this->getReadConnection()->hGetAll($this->hashName);
$this->prefilled = true;
} catch (\Exception $exception) {
throw new R... | [
"protected",
"function",
"prefill",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"prefill",
"||",
"$",
"this",
"->",
"prefilled",
")",
"{",
"return",
";",
"}",
"try",
"{",
"$",
"this",
"->",
"definitions",
"=",
"$",
"this",
"->",
"getReadConnect... | Loads all container data from Redis
@throws RedisException | [
"Loads",
"all",
"container",
"data",
"from",
"Redis"
] | c16275f05f14d188cf4d3043e7f037aea40aa7ba | https://github.com/anonymous-php/containers/blob/c16275f05f14d188cf4d3043e7f037aea40aa7ba/src/RedisContainer.php#L133-L145 |
239,155 | ddehart/dilmun | src/Nabu/LoggerHandler/System.php | System.write | public function write($message)
{
$written = false;
if ($this->output_allowed) {
$written = error_log($message);
}
return $written;
} | php | public function write($message)
{
$written = false;
if ($this->output_allowed) {
$written = error_log($message);
}
return $written;
} | [
"public",
"function",
"write",
"(",
"$",
"message",
")",
"{",
"$",
"written",
"=",
"false",
";",
"if",
"(",
"$",
"this",
"->",
"output_allowed",
")",
"{",
"$",
"written",
"=",
"error_log",
"(",
"$",
"message",
")",
";",
"}",
"return",
"$",
"written",... | Writes to the configured PHP error logger.
@see error_log()
@param string $message Message to be written to PHP's system log
@return bool Returns the status from the error_log function | [
"Writes",
"to",
"the",
"configured",
"PHP",
"error",
"logger",
"."
] | e2a294dbcd4c6754063c247be64930c5ee91378f | https://github.com/ddehart/dilmun/blob/e2a294dbcd4c6754063c247be64930c5ee91378f/src/Nabu/LoggerHandler/System.php#L34-L43 |
239,156 | slickframework/configuration | src/Configuration.php | Configuration.get | public static function get($fileName, $driverClass = null)
{
$configuration = new Configuration($fileName, $driverClass);
return $configuration->initialize();
} | php | public static function get($fileName, $driverClass = null)
{
$configuration = new Configuration($fileName, $driverClass);
return $configuration->initialize();
} | [
"public",
"static",
"function",
"get",
"(",
"$",
"fileName",
",",
"$",
"driverClass",
"=",
"null",
")",
"{",
"$",
"configuration",
"=",
"new",
"Configuration",
"(",
"$",
"fileName",
",",
"$",
"driverClass",
")",
";",
"return",
"$",
"configuration",
"->",
... | Creates a ConfigurationInterface with passed arguments
@param string|array $fileName
@param null $driverClass
@return ConfigurationInterface|PriorityConfigurationChain | [
"Creates",
"a",
"ConfigurationInterface",
"with",
"passed",
"arguments"
] | 9aa1edbddd007b4af4032a2b383c39f4db47d87e | https://github.com/slickframework/configuration/blob/9aa1edbddd007b4af4032a2b383c39f4db47d87e/src/Configuration.php#L72-L76 |
239,157 | slickframework/configuration | src/Configuration.php | Configuration.driverClass | private function driverClass()
{
if (null == $this->driverClass) {
$this->driverClass = $this->determineDriver($this->file);
}
return $this->driverClass;
} | php | private function driverClass()
{
if (null == $this->driverClass) {
$this->driverClass = $this->determineDriver($this->file);
}
return $this->driverClass;
} | [
"private",
"function",
"driverClass",
"(",
")",
"{",
"if",
"(",
"null",
"==",
"$",
"this",
"->",
"driverClass",
")",
"{",
"$",
"this",
"->",
"driverClass",
"=",
"$",
"this",
"->",
"determineDriver",
"(",
"$",
"this",
"->",
"file",
")",
";",
"}",
"ret... | Returns the driver class to be initialized
@return mixed|null|string | [
"Returns",
"the",
"driver",
"class",
"to",
"be",
"initialized"
] | 9aa1edbddd007b4af4032a2b383c39f4db47d87e | https://github.com/slickframework/configuration/blob/9aa1edbddd007b4af4032a2b383c39f4db47d87e/src/Configuration.php#L112-L118 |
239,158 | slickframework/configuration | src/Configuration.php | Configuration.determineDriver | private function determineDriver($file)
{
$exception = new InvalidArgumentException(
"Cannot initialize the configuration driver. I could not determine ".
"the correct driver class."
);
if (is_null($file) || !is_string($file)) {
throw $exception;
... | php | private function determineDriver($file)
{
$exception = new InvalidArgumentException(
"Cannot initialize the configuration driver. I could not determine ".
"the correct driver class."
);
if (is_null($file) || !is_string($file)) {
throw $exception;
... | [
"private",
"function",
"determineDriver",
"(",
"$",
"file",
")",
"{",
"$",
"exception",
"=",
"new",
"InvalidArgumentException",
"(",
"\"Cannot initialize the configuration driver. I could not determine \"",
".",
"\"the correct driver class.\"",
")",
";",
"if",
"(",
"is_null... | Tries to determine the driver class based on given file
@param string $file
@return mixed | [
"Tries",
"to",
"determine",
"the",
"driver",
"class",
"based",
"on",
"given",
"file"
] | 9aa1edbddd007b4af4032a2b383c39f4db47d87e | https://github.com/slickframework/configuration/blob/9aa1edbddd007b4af4032a2b383c39f4db47d87e/src/Configuration.php#L126-L145 |
239,159 | slickframework/configuration | src/Configuration.php | Configuration.composeFileName | private function composeFileName($name)
{
if (is_null($name)) {
return $name;
}
$ext = $this->determineExtension();
$withExtension = $this->createName($name, $ext);
list($found, $fileName) = $this->searchFor($name, $withExtension);
return $found ? $file... | php | private function composeFileName($name)
{
if (is_null($name)) {
return $name;
}
$ext = $this->determineExtension();
$withExtension = $this->createName($name, $ext);
list($found, $fileName) = $this->searchFor($name, $withExtension);
return $found ? $file... | [
"private",
"function",
"composeFileName",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"name",
")",
")",
"{",
"return",
"$",
"name",
";",
"}",
"$",
"ext",
"=",
"$",
"this",
"->",
"determineExtension",
"(",
")",
";",
"$",
"withExtension... | Compose the filename with existing paths and return when match
If no match is found the $name is returned as is;
If no extension is given it will add it from driver class map;
By default it will try to find <$name>.php file
@param string $name
@return string | [
"Compose",
"the",
"filename",
"with",
"existing",
"paths",
"and",
"return",
"when",
"match"
] | 9aa1edbddd007b4af4032a2b383c39f4db47d87e | https://github.com/slickframework/configuration/blob/9aa1edbddd007b4af4032a2b383c39f4db47d87e/src/Configuration.php#L158-L170 |
239,160 | slickframework/configuration | src/Configuration.php | Configuration.determineExtension | private function determineExtension()
{
$ext = 'php';
if (in_array($this->driverClass, $this->extensionToDriver)) {
$map = array_flip($this->extensionToDriver);
$ext = $map[$this->driverClass];
}
return $ext;
} | php | private function determineExtension()
{
$ext = 'php';
if (in_array($this->driverClass, $this->extensionToDriver)) {
$map = array_flip($this->extensionToDriver);
$ext = $map[$this->driverClass];
}
return $ext;
} | [
"private",
"function",
"determineExtension",
"(",
")",
"{",
"$",
"ext",
"=",
"'php'",
";",
"if",
"(",
"in_array",
"(",
"$",
"this",
"->",
"driverClass",
",",
"$",
"this",
"->",
"extensionToDriver",
")",
")",
"{",
"$",
"map",
"=",
"array_flip",
"(",
"$"... | Determine the extension based on the driver class
If there is no driver class given it will default to .php
@return string | [
"Determine",
"the",
"extension",
"based",
"on",
"the",
"driver",
"class"
] | 9aa1edbddd007b4af4032a2b383c39f4db47d87e | https://github.com/slickframework/configuration/blob/9aa1edbddd007b4af4032a2b383c39f4db47d87e/src/Configuration.php#L179-L187 |
239,161 | slickframework/configuration | src/Configuration.php | Configuration.searchFor | private function searchFor($name, $withExtension)
{
$found = false;
$fileName = $name;
foreach (self::$paths as $path) {
$fileName = "{$path}/$withExtension";
if (is_file($fileName)) {
$found = true;
break;
}
}
... | php | private function searchFor($name, $withExtension)
{
$found = false;
$fileName = $name;
foreach (self::$paths as $path) {
$fileName = "{$path}/$withExtension";
if (is_file($fileName)) {
$found = true;
break;
}
}
... | [
"private",
"function",
"searchFor",
"(",
"$",
"name",
",",
"$",
"withExtension",
")",
"{",
"$",
"found",
"=",
"false",
";",
"$",
"fileName",
"=",
"$",
"name",
";",
"foreach",
"(",
"self",
"::",
"$",
"paths",
"as",
"$",
"path",
")",
"{",
"$",
"fileN... | Search for name in the list of paths
@param string $name
@param string $withExtension
@return array | [
"Search",
"for",
"name",
"in",
"the",
"list",
"of",
"paths"
] | 9aa1edbddd007b4af4032a2b383c39f4db47d87e | https://github.com/slickframework/configuration/blob/9aa1edbddd007b4af4032a2b383c39f4db47d87e/src/Configuration.php#L214-L228 |
239,162 | slickframework/configuration | src/Configuration.php | Configuration.createConfigurationDriver | private function createConfigurationDriver()
{
$reflection = new \ReflectionClass($this->driverClass());
/** @var ConfigurationInterface $config */
$config = $reflection->hasMethod('__construct')
? $reflection->newInstanceArgs([$this->file])
: $reflection->newInstanc... | php | private function createConfigurationDriver()
{
$reflection = new \ReflectionClass($this->driverClass());
/** @var ConfigurationInterface $config */
$config = $reflection->hasMethod('__construct')
? $reflection->newInstanceArgs([$this->file])
: $reflection->newInstanc... | [
"private",
"function",
"createConfigurationDriver",
"(",
")",
"{",
"$",
"reflection",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"$",
"this",
"->",
"driverClass",
"(",
")",
")",
";",
"/** @var ConfigurationInterface $config */",
"$",
"config",
"=",
"$",
"reflection... | Creates the configuration driver from current properties
@return ConfigurationInterface | [
"Creates",
"the",
"configuration",
"driver",
"from",
"current",
"properties"
] | 9aa1edbddd007b4af4032a2b383c39f4db47d87e | https://github.com/slickframework/configuration/blob/9aa1edbddd007b4af4032a2b383c39f4db47d87e/src/Configuration.php#L235-L244 |
239,163 | slickframework/configuration | src/Configuration.php | Configuration.setProperties | private function setProperties($option)
{
$priority = isset($option[2]) ? $option[2] : 0;
$this->driverClass = isset($option[1]) ? $option[1] : null;
$this->file = isset($option[0]) ? $this->composeFileName($option[0]) : null;
return $priority;
} | php | private function setProperties($option)
{
$priority = isset($option[2]) ? $option[2] : 0;
$this->driverClass = isset($option[1]) ? $option[1] : null;
$this->file = isset($option[0]) ? $this->composeFileName($option[0]) : null;
return $priority;
} | [
"private",
"function",
"setProperties",
"(",
"$",
"option",
")",
"{",
"$",
"priority",
"=",
"isset",
"(",
"$",
"option",
"[",
"2",
"]",
")",
"?",
"$",
"option",
"[",
"2",
"]",
":",
"0",
";",
"$",
"this",
"->",
"driverClass",
"=",
"isset",
"(",
"$... | Sets the file and driver class
@param array $option
@return int | [
"Sets",
"the",
"file",
"and",
"driver",
"class"
] | 9aa1edbddd007b4af4032a2b383c39f4db47d87e | https://github.com/slickframework/configuration/blob/9aa1edbddd007b4af4032a2b383c39f4db47d87e/src/Configuration.php#L253-L259 |
239,164 | slickframework/configuration | src/Configuration.php | Configuration.fixOptions | private function fixOptions()
{
$options = (is_array($this->file))
? $this->file
: [[$this->file]];
return $options;
} | php | private function fixOptions()
{
$options = (is_array($this->file))
? $this->file
: [[$this->file]];
return $options;
} | [
"private",
"function",
"fixOptions",
"(",
")",
"{",
"$",
"options",
"=",
"(",
"is_array",
"(",
"$",
"this",
"->",
"file",
")",
")",
"?",
"$",
"this",
"->",
"file",
":",
"[",
"[",
"$",
"this",
"->",
"file",
"]",
"]",
";",
"return",
"$",
"options",... | Fixes the file for initialization
@return array | [
"Fixes",
"the",
"file",
"for",
"initialization"
] | 9aa1edbddd007b4af4032a2b383c39f4db47d87e | https://github.com/slickframework/configuration/blob/9aa1edbddd007b4af4032a2b383c39f4db47d87e/src/Configuration.php#L266-L272 |
239,165 | webriq/core | module/User/src/Grid/User/Controller/PasswordChangeRequestController.php | PasswordChangeRequestController.createAction | public function createAction()
{
$success = null;
$this->paragraphLayout();
/* @var $form \Zend\Form\Form */
$request = $this->getRequest();
$data = $request->getPost();
$service = $this->getServiceLocator();
$model = $service->get( 'Grid\Use... | php | public function createAction()
{
$success = null;
$this->paragraphLayout();
/* @var $form \Zend\Form\Form */
$request = $this->getRequest();
$data = $request->getPost();
$service = $this->getServiceLocator();
$model = $service->get( 'Grid\Use... | [
"public",
"function",
"createAction",
"(",
")",
"{",
"$",
"success",
"=",
"null",
";",
"$",
"this",
"->",
"paragraphLayout",
"(",
")",
";",
"/* @var $form \\Zend\\Form\\Form */",
"$",
"request",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
";",
"$",
"da... | Create a password-request | [
"Create",
"a",
"password",
"-",
"request"
] | cfeb6e8a4732561c2215ec94e736c07f9b8bc990 | https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/User/src/Grid/User/Controller/PasswordChangeRequestController.php#L21-L92 |
239,166 | webriq/core | module/User/src/Grid/User/Controller/PasswordChangeRequestController.php | PasswordChangeRequestController.resolveAction | public function resolveAction()
{
$success = null;
$failed = null;
$service = $this->getServiceLocator();
$userModel = $service->get( 'Grid\User\Model\User\Model' );
$confirm = $service->get( 'Grid\User\Model\ConfirmHash' );
$hash = $this->params()... | php | public function resolveAction()
{
$success = null;
$failed = null;
$service = $this->getServiceLocator();
$userModel = $service->get( 'Grid\User\Model\User\Model' );
$confirm = $service->get( 'Grid\User\Model\ConfirmHash' );
$hash = $this->params()... | [
"public",
"function",
"resolveAction",
"(",
")",
"{",
"$",
"success",
"=",
"null",
";",
"$",
"failed",
"=",
"null",
";",
"$",
"service",
"=",
"$",
"this",
"->",
"getServiceLocator",
"(",
")",
";",
"$",
"userModel",
"=",
"$",
"service",
"->",
"get",
"... | Resolve a password-request | [
"Resolve",
"a",
"password",
"-",
"request"
] | cfeb6e8a4732561c2215ec94e736c07f9b8bc990 | https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/User/src/Grid/User/Controller/PasswordChangeRequestController.php#L97-L192 |
239,167 | asbsoft/yii2-common_2_170212 | web/UrlManagerInModule.php | UrlManagerInModule.getSitetreeManager | public function getSitetreeManager()
{
if (empty(static::$_sitetreeManager)) {
$module = Yii::$app->getModule($this->sitetreeModuleUniqueId);
if (!empty($module) && $module instanceof UniModule) {
$mgr = $module->getDataModel($this->sitetreeManagerAlias);
... | php | public function getSitetreeManager()
{
if (empty(static::$_sitetreeManager)) {
$module = Yii::$app->getModule($this->sitetreeModuleUniqueId);
if (!empty($module) && $module instanceof UniModule) {
$mgr = $module->getDataModel($this->sitetreeManagerAlias);
... | [
"public",
"function",
"getSitetreeManager",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"static",
"::",
"$",
"_sitetreeManager",
")",
")",
"{",
"$",
"module",
"=",
"Yii",
"::",
"$",
"app",
"->",
"getModule",
"(",
"$",
"this",
"->",
"sitetreeModuleUniqueId",
... | Find Sitetree module from system loaded modules | [
"Find",
"Sitetree",
"module",
"from",
"system",
"loaded",
"modules"
] | 6c58012ff89225d7d4e42b200cf39e009e9d9dac | https://github.com/asbsoft/yii2-common_2_170212/blob/6c58012ff89225d7d4e42b200cf39e009e9d9dac/web/UrlManagerInModule.php#L37-L48 |
239,168 | uthando-cms/uthando-common | src/UthandoCommon/Form/Settings/AkismetFieldSet.php | AkismetFieldSet.getInputFilterSpecification | public function getInputFilterSpecification(): array
{
return [
'api_key' => [
'required' => false,
'filters' => [
['name' => StripTags::class],
['name' => StringTrim::class],
],
'validators' ... | php | public function getInputFilterSpecification(): array
{
return [
'api_key' => [
'required' => false,
'filters' => [
['name' => StripTags::class],
['name' => StringTrim::class],
],
'validators' ... | [
"public",
"function",
"getInputFilterSpecification",
"(",
")",
":",
"array",
"{",
"return",
"[",
"'api_key'",
"=>",
"[",
"'required'",
"=>",
"false",
",",
"'filters'",
"=>",
"[",
"[",
"'name'",
"=>",
"StripTags",
"::",
"class",
"]",
",",
"[",
"'name'",
"=>... | Get input filter for elements.
@return array | [
"Get",
"input",
"filter",
"for",
"elements",
"."
] | feb915da5d26b60f536282e1bc3ad5c22e53f485 | https://github.com/uthando-cms/uthando-common/blob/feb915da5d26b60f536282e1bc3ad5c22e53f485/src/UthandoCommon/Form/Settings/AkismetFieldSet.php#L85-L122 |
239,169 | KonstantinKuklin/doctrine-compressed-fields | src/KonstantinKuklin/DoctrineCompressedFields/EventListener/LoadClassMetadataListener.php | LoadClassMetadataListener.initDefaultAnnotationReader | private function initDefaultAnnotationReader()
{
if (null !== self::$defaultAnnotationReader) {
return;
}
$docParser = new DocParser();
$docParser->setImports([
'Bits' => 'KonstantinKuklin\\DoctrineCompressedFields\\Annotation',
]);
$docParser... | php | private function initDefaultAnnotationReader()
{
if (null !== self::$defaultAnnotationReader) {
return;
}
$docParser = new DocParser();
$docParser->setImports([
'Bits' => 'KonstantinKuklin\\DoctrineCompressedFields\\Annotation',
]);
$docParser... | [
"private",
"function",
"initDefaultAnnotationReader",
"(",
")",
"{",
"if",
"(",
"null",
"!==",
"self",
"::",
"$",
"defaultAnnotationReader",
")",
"{",
"return",
";",
"}",
"$",
"docParser",
"=",
"new",
"DocParser",
"(",
")",
";",
"$",
"docParser",
"->",
"se... | Create default annotation reader for extension
@throws \RuntimeException | [
"Create",
"default",
"annotation",
"reader",
"for",
"extension"
] | 277a62748806359d6e3ad6cc88f04a8d02ed68bd | https://github.com/KonstantinKuklin/doctrine-compressed-fields/blob/277a62748806359d6e3ad6cc88f04a8d02ed68bd/src/KonstantinKuklin/DoctrineCompressedFields/EventListener/LoadClassMetadataListener.php#L39-L58 |
239,170 | phlexible/phlexible | src/Phlexible/Bundle/MediaTemplateBundle/Controller/TemplatesController.php | TemplatesController.listAction | public function listAction()
{
$repository = $this->get('phlexible_media_template.template_manager');
$allTemplates = $repository->findAll();
$templates = [];
foreach ($allTemplates as $template) {
if (substr($template->getKey(), 0, 4) === '_mm_') {
cont... | php | public function listAction()
{
$repository = $this->get('phlexible_media_template.template_manager');
$allTemplates = $repository->findAll();
$templates = [];
foreach ($allTemplates as $template) {
if (substr($template->getKey(), 0, 4) === '_mm_') {
cont... | [
"public",
"function",
"listAction",
"(",
")",
"{",
"$",
"repository",
"=",
"$",
"this",
"->",
"get",
"(",
"'phlexible_media_template.template_manager'",
")",
";",
"$",
"allTemplates",
"=",
"$",
"repository",
"->",
"findAll",
"(",
")",
";",
"$",
"templates",
... | List mediatemplates.
@return JsonResponse
@Route("/list", name="mediatemplates_templates_list") | [
"List",
"mediatemplates",
"."
] | 132f24924c9bb0dbb6c1ea84db0a463f97fa3893 | https://github.com/phlexible/phlexible/blob/132f24924c9bb0dbb6c1ea84db0a463f97fa3893/src/Phlexible/Bundle/MediaTemplateBundle/Controller/TemplatesController.php#L40-L59 |
239,171 | phlexible/phlexible | src/Phlexible/Bundle/MediaTemplateBundle/Controller/TemplatesController.php | TemplatesController.createAction | public function createAction(Request $request)
{
$templateRepository = $this->get('phlexible_media_template.template_manager');
$type = $request->get('type');
$key = $request->get('key');
switch ($type) {
case 'image':
$template = new ImageTemplate();
... | php | public function createAction(Request $request)
{
$templateRepository = $this->get('phlexible_media_template.template_manager');
$type = $request->get('type');
$key = $request->get('key');
switch ($type) {
case 'image':
$template = new ImageTemplate();
... | [
"public",
"function",
"createAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"templateRepository",
"=",
"$",
"this",
"->",
"get",
"(",
"'phlexible_media_template.template_manager'",
")",
";",
"$",
"type",
"=",
"$",
"request",
"->",
"get",
"(",
"'type'"... | Create mediatemplate.
@param Request $request
@throws \InvalidArgumentException
@return ResultResponse
@Route("/create", name="mediatemplates_templates_create") | [
"Create",
"mediatemplate",
"."
] | 132f24924c9bb0dbb6c1ea84db0a463f97fa3893 | https://github.com/phlexible/phlexible/blob/132f24924c9bb0dbb6c1ea84db0a463f97fa3893/src/Phlexible/Bundle/MediaTemplateBundle/Controller/TemplatesController.php#L71-L100 |
239,172 | Opifer/ContentBundle | Repository/BlockLogEntryRepository.php | BlockLogEntryRepository.findDistinctByRootId | public function findDistinctByRootId($rootId)
{
$qb = $this->createQueryBuilder('l')
->andWhere('l.rootId = :rootId')
->groupBy('l.rootVersion')
->setParameter('rootId', $rootId);
return $qb->getQuery()->getResult();
} | php | public function findDistinctByRootId($rootId)
{
$qb = $this->createQueryBuilder('l')
->andWhere('l.rootId = :rootId')
->groupBy('l.rootVersion')
->setParameter('rootId', $rootId);
return $qb->getQuery()->getResult();
} | [
"public",
"function",
"findDistinctByRootId",
"(",
"$",
"rootId",
")",
"{",
"$",
"qb",
"=",
"$",
"this",
"->",
"createQueryBuilder",
"(",
"'l'",
")",
"->",
"andWhere",
"(",
"'l.rootId = :rootId'",
")",
"->",
"groupBy",
"(",
"'l.rootVersion'",
")",
"->",
"set... | Returns a list of BlockLogEntries distinct by rootId
@param integer $rootId
@return ArrayCollection | [
"Returns",
"a",
"list",
"of",
"BlockLogEntries",
"distinct",
"by",
"rootId"
] | df44ef36b81a839ce87ea9a92f7728618111541f | https://github.com/Opifer/ContentBundle/blob/df44ef36b81a839ce87ea9a92f7728618111541f/Repository/BlockLogEntryRepository.php#L39-L47 |
239,173 | Opifer/ContentBundle | Repository/BlockLogEntryRepository.php | BlockLogEntryRepository.getLogEntriesRoot | public function getLogEntriesRoot($entity, $rootVersion = null)
{
$q = $this->getLogEntriesQueryRoot($entity, $rootVersion);
return $q->getResult();
} | php | public function getLogEntriesRoot($entity, $rootVersion = null)
{
$q = $this->getLogEntriesQueryRoot($entity, $rootVersion);
return $q->getResult();
} | [
"public",
"function",
"getLogEntriesRoot",
"(",
"$",
"entity",
",",
"$",
"rootVersion",
"=",
"null",
")",
"{",
"$",
"q",
"=",
"$",
"this",
"->",
"getLogEntriesQueryRoot",
"(",
"$",
"entity",
",",
"$",
"rootVersion",
")",
";",
"return",
"$",
"q",
"->",
... | Loads all log entries for the given entity
@param object $entity
@param integer $rootVersion
@return array | [
"Loads",
"all",
"log",
"entries",
"for",
"the",
"given",
"entity"
] | df44ef36b81a839ce87ea9a92f7728618111541f | https://github.com/Opifer/ContentBundle/blob/df44ef36b81a839ce87ea9a92f7728618111541f/Repository/BlockLogEntryRepository.php#L57-L62 |
239,174 | Opifer/ContentBundle | Repository/BlockLogEntryRepository.php | BlockLogEntryRepository.getLogEntriesQueryRoot | public function getLogEntriesQueryRoot($entity, $rootVersion = null)
{
$wrapped = new EntityWrapper($entity, $this->_em);
$objectClass = $wrapped->getMetadata()->name;
$meta = $this->getClassMetadata();
$dql = "SELECT log FROM {$meta->name} log";
$dql .= " WHERE log.objectId ... | php | public function getLogEntriesQueryRoot($entity, $rootVersion = null)
{
$wrapped = new EntityWrapper($entity, $this->_em);
$objectClass = $wrapped->getMetadata()->name;
$meta = $this->getClassMetadata();
$dql = "SELECT log FROM {$meta->name} log";
$dql .= " WHERE log.objectId ... | [
"public",
"function",
"getLogEntriesQueryRoot",
"(",
"$",
"entity",
",",
"$",
"rootVersion",
"=",
"null",
")",
"{",
"$",
"wrapped",
"=",
"new",
"EntityWrapper",
"(",
"$",
"entity",
",",
"$",
"this",
"->",
"_em",
")",
";",
"$",
"objectClass",
"=",
"$",
... | Get the query for loading of log entries
@param object $entity
@param integer $rootVersion
@return Query | [
"Get",
"the",
"query",
"for",
"loading",
"of",
"log",
"entries"
] | df44ef36b81a839ce87ea9a92f7728618111541f | https://github.com/Opifer/ContentBundle/blob/df44ef36b81a839ce87ea9a92f7728618111541f/Repository/BlockLogEntryRepository.php#L72-L88 |
239,175 | ytubes/videos | controllers/ViewController.php | ViewController.actionIndex | public function actionIndex($slug)
{
$this->trigger(self::EVENT_BEFORE_VIEW_SHOW);
$data['slug'] = $slug;
$data['route'] = '/' . $this->getRoute();
$videoFinder = new VideoFinder();
$data['video'] = $videoFinder->findBySlug($slug);
if (empty($data['video'])) {
... | php | public function actionIndex($slug)
{
$this->trigger(self::EVENT_BEFORE_VIEW_SHOW);
$data['slug'] = $slug;
$data['route'] = '/' . $this->getRoute();
$videoFinder = new VideoFinder();
$data['video'] = $videoFinder->findBySlug($slug);
if (empty($data['video'])) {
... | [
"public",
"function",
"actionIndex",
"(",
"$",
"slug",
")",
"{",
"$",
"this",
"->",
"trigger",
"(",
"self",
"::",
"EVENT_BEFORE_VIEW_SHOW",
")",
";",
"$",
"data",
"[",
"'slug'",
"]",
"=",
"$",
"slug",
";",
"$",
"data",
"[",
"'route'",
"]",
"=",
"'/'"... | Displays a single Videos model.
@param integer $id
@return mixed | [
"Displays",
"a",
"single",
"Videos",
"model",
"."
] | a35ecb1f8e38381063fbd757683a13df3a8cbc48 | https://github.com/ytubes/videos/blob/a35ecb1f8e38381063fbd757683a13df3a8cbc48/controllers/ViewController.php#L51-L82 |
239,176 | mszewcz/php-light-framework | src/Variables/Specific/Cookie.php | Cookie.getExpireTime | private function getExpireTime(array $expires = ['m' => 1]): int
{
$expireTime = \time();
if (\is_array($expires)) {
if (isset($expires['y'])) {
$expireTime += \intval(0 + $expires['y']) * 60 * 60 * 24 * 365;
}
if (isset($expires['m'])) {
... | php | private function getExpireTime(array $expires = ['m' => 1]): int
{
$expireTime = \time();
if (\is_array($expires)) {
if (isset($expires['y'])) {
$expireTime += \intval(0 + $expires['y']) * 60 * 60 * 24 * 365;
}
if (isset($expires['m'])) {
... | [
"private",
"function",
"getExpireTime",
"(",
"array",
"$",
"expires",
"=",
"[",
"'m'",
"=>",
"1",
"]",
")",
":",
"int",
"{",
"$",
"expireTime",
"=",
"\\",
"time",
"(",
")",
";",
"if",
"(",
"\\",
"is_array",
"(",
"$",
"expires",
")",
")",
"{",
"if... | Calculates cookie expire time
@param array $expires
@return int | [
"Calculates",
"cookie",
"expire",
"time"
] | 4d3b46781c387202c2dfbdb8760151b3ae8ef49c | https://github.com/mszewcz/php-light-framework/blob/4d3b46781c387202c2dfbdb8760151b3ae8ef49c/src/Variables/Specific/Cookie.php#L78-L102 |
239,177 | mszewcz/php-light-framework | src/Variables/Specific/Cookie.php | Cookie.get | public function get(string $variableName = null, int $type = Variables::TYPE_STRING)
{
if ($variableName === null) {
throw new BadMethodCallException('Variable name must be specified');
}
if (isset($this->variables[$variableName])) {
return $this->cast($this->variable... | php | public function get(string $variableName = null, int $type = Variables::TYPE_STRING)
{
if ($variableName === null) {
throw new BadMethodCallException('Variable name must be specified');
}
if (isset($this->variables[$variableName])) {
return $this->cast($this->variable... | [
"public",
"function",
"get",
"(",
"string",
"$",
"variableName",
"=",
"null",
",",
"int",
"$",
"type",
"=",
"Variables",
"::",
"TYPE_STRING",
")",
"{",
"if",
"(",
"$",
"variableName",
"===",
"null",
")",
"{",
"throw",
"new",
"BadMethodCallException",
"(",
... | Returns COOKIE variable's value. If variable doesn't exist method returns default value for specified type.
@param string|null $variableName
@param int $type
@return array|float|int|mixed|null|string | [
"Returns",
"COOKIE",
"variable",
"s",
"value",
".",
"If",
"variable",
"doesn",
"t",
"exist",
"method",
"returns",
"default",
"value",
"for",
"specified",
"type",
"."
] | 4d3b46781c387202c2dfbdb8760151b3ae8ef49c | https://github.com/mszewcz/php-light-framework/blob/4d3b46781c387202c2dfbdb8760151b3ae8ef49c/src/Variables/Specific/Cookie.php#L111-L120 |
239,178 | mszewcz/php-light-framework | src/Variables/Specific/Cookie.php | Cookie.set | public function set(string $variableName = null, $variableValue = null, array $expires = ['m' => 1],
bool $encrypted = true): Cookie
{
if ($variableName === null) {
throw new BadMethodCallException('Variable name must be specified');
}
\setcookie(
... | php | public function set(string $variableName = null, $variableValue = null, array $expires = ['m' => 1],
bool $encrypted = true): Cookie
{
if ($variableName === null) {
throw new BadMethodCallException('Variable name must be specified');
}
\setcookie(
... | [
"public",
"function",
"set",
"(",
"string",
"$",
"variableName",
"=",
"null",
",",
"$",
"variableValue",
"=",
"null",
",",
"array",
"$",
"expires",
"=",
"[",
"'m'",
"=>",
"1",
"]",
",",
"bool",
"$",
"encrypted",
"=",
"true",
")",
":",
"Cookie",
"{",
... | Sets COOKIE variable.
@param string|null $variableName
@param null $variableValue
@param array $expires
@param bool $encrypted
@return Cookie | [
"Sets",
"COOKIE",
"variable",
"."
] | 4d3b46781c387202c2dfbdb8760151b3ae8ef49c | https://github.com/mszewcz/php-light-framework/blob/4d3b46781c387202c2dfbdb8760151b3ae8ef49c/src/Variables/Specific/Cookie.php#L131-L150 |
239,179 | ironedgesoftware/common-utils | src/System/SystemService.php | SystemService.executeCommand | public function executeCommand(string $cmd, array $arguments = [], array $options = [])
{
$options = array_replace(
[
'overrideExitCode' => null,
'exceptionMessage' => 'There was an error while executing the command.',
'returnString' => fals... | php | public function executeCommand(string $cmd, array $arguments = [], array $options = [])
{
$options = array_replace(
[
'overrideExitCode' => null,
'exceptionMessage' => 'There was an error while executing the command.',
'returnString' => fals... | [
"public",
"function",
"executeCommand",
"(",
"string",
"$",
"cmd",
",",
"array",
"$",
"arguments",
"=",
"[",
"]",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"options",
"=",
"array_replace",
"(",
"[",
"'overrideExitCode'",
"=>",
"null",
... | Executes a Command.
@param string $cmd - Command.
@param array $arguments - Arguments.
@param array $options - Options.
@throws CommandException
@return array|string | [
"Executes",
"a",
"Command",
"."
] | 1cbe4c77a4abeb17a45250b9b86353457ce6c2b4 | https://github.com/ironedgesoftware/common-utils/blob/1cbe4c77a4abeb17a45250b9b86353457ce6c2b4/src/System/SystemService.php#L101-L145 |
239,180 | ironedgesoftware/common-utils | src/System/SystemService.php | SystemService.mkdir | public function mkdir(string $dir, array $options = []): SystemService
{
$options = array_replace(
[
'mode' => 0777,
'recursive' => true,
'context' => null
],
$options
);
if (file_exists($... | php | public function mkdir(string $dir, array $options = []): SystemService
{
$options = array_replace(
[
'mode' => 0777,
'recursive' => true,
'context' => null
],
$options
);
if (file_exists($... | [
"public",
"function",
"mkdir",
"(",
"string",
"$",
"dir",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
":",
"SystemService",
"{",
"$",
"options",
"=",
"array_replace",
"(",
"[",
"'mode'",
"=>",
"0777",
",",
"'recursive'",
"=>",
"true",
",",
"'cont... | Creates a directory. If it already exists, it doesn't throw an exception.
Options:
- mode: Default 0777
- recursive: Create missing directories recursively.
- context: Stream context.
@param string $dir - Directory.
@param array $options - Options.
@throws IOException
@return SystemService | [
"Creates",
"a",
"directory",
".",
"If",
"it",
"already",
"exists",
"it",
"doesn",
"t",
"throw",
"an",
"exception",
"."
] | 1cbe4c77a4abeb17a45250b9b86353457ce6c2b4 | https://github.com/ironedgesoftware/common-utils/blob/1cbe4c77a4abeb17a45250b9b86353457ce6c2b4/src/System/SystemService.php#L163-L203 |
239,181 | ironedgesoftware/common-utils | src/System/SystemService.php | SystemService.rm | public function rm(string $fileOrDirectory, array $options = []): SystemService
{
$options = array_replace(
[
'force' => false,
'recursive' => false,
'context' => null,
'skipIfAlreadyRemoved... | php | public function rm(string $fileOrDirectory, array $options = []): SystemService
{
$options = array_replace(
[
'force' => false,
'recursive' => false,
'context' => null,
'skipIfAlreadyRemoved... | [
"public",
"function",
"rm",
"(",
"string",
"$",
"fileOrDirectory",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
":",
"SystemService",
"{",
"$",
"options",
"=",
"array_replace",
"(",
"[",
"'force'",
"=>",
"false",
",",
"'recursive'",
"=>",
"false",
"... | Removes a file, symlink or directory. It removes directories, if option "force" is true.
If it's a directory and option "force" is false, it throws an exception.
Also, it removes directories recursively. If file, symlink or directory already does not
exist, it does NOT throw an exception.
Options:
- force: If... | [
"Removes",
"a",
"file",
"symlink",
"or",
"directory",
".",
"It",
"removes",
"directories",
"if",
"option",
"force",
"is",
"true",
".",
"If",
"it",
"s",
"a",
"directory",
"and",
"option",
"force",
"is",
"false",
"it",
"throws",
"an",
"exception",
".",
"Al... | 1cbe4c77a4abeb17a45250b9b86353457ce6c2b4 | https://github.com/ironedgesoftware/common-utils/blob/1cbe4c77a4abeb17a45250b9b86353457ce6c2b4/src/System/SystemService.php#L226-L288 |
239,182 | ironedgesoftware/common-utils | src/System/SystemService.php | SystemService.scandir | public function scandir(string $dir, array $options = [])
{
$options = array_replace(
[
'sort' => SCANDIR_SORT_NONE,
'context' => null,
'recursive' => false,
'skipDots' => true,
'skipSymlinks'... | php | public function scandir(string $dir, array $options = [])
{
$options = array_replace(
[
'sort' => SCANDIR_SORT_NONE,
'context' => null,
'recursive' => false,
'skipDots' => true,
'skipSymlinks'... | [
"public",
"function",
"scandir",
"(",
"string",
"$",
"dir",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"options",
"=",
"array_replace",
"(",
"[",
"'sort'",
"=>",
"SCANDIR_SORT_NONE",
",",
"'context'",
"=>",
"null",
",",
"'recursive'",
"=... | Scans a directory and returns an array of files, symlinks and directories.
Options:
- sort: One of the SCANDIR_SORT_* constants. Defaults to SCANDIR_SORT_NONE.
- context: Context to use for the scandir function. Defaults to "null".
- recursive: If this option is "true", we'll call this ... | [
"Scans",
"a",
"directory",
"and",
"returns",
"an",
"array",
"of",
"files",
"symlinks",
"and",
"directories",
"."
] | 1cbe4c77a4abeb17a45250b9b86353457ce6c2b4 | https://github.com/ironedgesoftware/common-utils/blob/1cbe4c77a4abeb17a45250b9b86353457ce6c2b4/src/System/SystemService.php#L312-L371 |
239,183 | toadsuck/toadsuck-core | src/Dispatcher.php | Dispatcher.getRoutes | public function getRoutes()
{
$router_factory = new RouterFactory;
$router = $router_factory->newInstance();
$routes_file = $this->getAppResourcePath('config/routes.php');
if (file_exists($routes_file)) {
// Let the app specify it's own routes.
include_once($routes_file);
} else {
// Fall back on ... | php | public function getRoutes()
{
$router_factory = new RouterFactory;
$router = $router_factory->newInstance();
$routes_file = $this->getAppResourcePath('config/routes.php');
if (file_exists($routes_file)) {
// Let the app specify it's own routes.
include_once($routes_file);
} else {
// Fall back on ... | [
"public",
"function",
"getRoutes",
"(",
")",
"{",
"$",
"router_factory",
"=",
"new",
"RouterFactory",
";",
"$",
"router",
"=",
"$",
"router_factory",
"->",
"newInstance",
"(",
")",
";",
"$",
"routes_file",
"=",
"$",
"this",
"->",
"getAppResourcePath",
"(",
... | What routes have been configured for this app? | [
"What",
"routes",
"have",
"been",
"configured",
"for",
"this",
"app?"
] | 1c307b8410d43dcee42e215403ed905a70fc55de | https://github.com/toadsuck/toadsuck-core/blob/1c307b8410d43dcee42e215403ed905a70fc55de/src/Dispatcher.php#L99-L118 |
239,184 | vivait/symfony-console-promptable-options | src/Command/PromptableOptionsTrait.php | PromptableOptionsTrait.addPrompts | protected function addPrompts(array $options = [])
{
$resolver = $this->getConfigResolver();
$optionNames = [];
foreach ($options as $key => $value) {
if (is_string($value)) {
$optionNames[] = $value;
$this->promptConfig[$key] = $resolver->resolve... | php | protected function addPrompts(array $options = [])
{
$resolver = $this->getConfigResolver();
$optionNames = [];
foreach ($options as $key => $value) {
if (is_string($value)) {
$optionNames[] = $value;
$this->promptConfig[$key] = $resolver->resolve... | [
"protected",
"function",
"addPrompts",
"(",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"resolver",
"=",
"$",
"this",
"->",
"getConfigResolver",
"(",
")",
";",
"$",
"optionNames",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"options",
"as",
"... | Add prompts through a key value array of option names => their configuration.
The configuration is optional.
e.g.
[
'myOption' => ['type' => 'int'],
'myDefaultOption',
'myOtherOption' => ['description' => 'Hello!']
]
@param array $options
@return static | [
"Add",
"prompts",
"through",
"a",
"key",
"value",
"array",
"of",
"option",
"names",
"=",
">",
"their",
"configuration",
".",
"The",
"configuration",
"is",
"optional",
"."
] | 79fbaa835efcc5a0d28f3ede1e92d9f9ac7a2ba4 | https://github.com/vivait/symfony-console-promptable-options/blob/79fbaa835efcc5a0d28f3ede1e92d9f9ac7a2ba4/src/Command/PromptableOptionsTrait.php#L203-L241 |
239,185 | helsingborg-stad/easy-to-read-alternative | source/php/Posts/Content.php | Content.addAccessibility | public function addAccessibility($items): array
{
global $wp;
$current_url = home_url(add_query_arg(array(),$wp->request));
if (! isset($_GET['readable']) && get_field('easy_reading_select') == true) {
$items[] = '<a href="' . add_query_arg('readable', '1', $current_url) . '" class=""><i class="pricon pricon... | php | public function addAccessibility($items): array
{
global $wp;
$current_url = home_url(add_query_arg(array(),$wp->request));
if (! isset($_GET['readable']) && get_field('easy_reading_select') == true) {
$items[] = '<a href="' . add_query_arg('readable', '1', $current_url) . '" class=""><i class="pricon pricon... | [
"public",
"function",
"addAccessibility",
"(",
"$",
"items",
")",
":",
"array",
"{",
"global",
"$",
"wp",
";",
"$",
"current_url",
"=",
"home_url",
"(",
"add_query_arg",
"(",
"array",
"(",
")",
",",
"$",
"wp",
"->",
"request",
")",
")",
";",
"if",
"(... | Add easy to read link to accessibility nav
@param array $items Default items
@return array Modified items | [
"Add",
"easy",
"to",
"read",
"link",
"to",
"accessibility",
"nav"
] | 0dfd7ea9168cbbde145d8b9e58a69ded3fa82ae0 | https://github.com/helsingborg-stad/easy-to-read-alternative/blob/0dfd7ea9168cbbde145d8b9e58a69ded3fa82ae0/source/php/Posts/Content.php#L22-L34 |
239,186 | helsingborg-stad/easy-to-read-alternative | source/php/Posts/Content.php | Content.easyReadingLead | public function easyReadingLead($lead)
{
if (isset($_GET['readable']) && $_GET['readable'] == '1' && get_field('easy_reading_select') == true && in_the_loop() && is_main_query()) {
return '';
}
return $lead;
} | php | public function easyReadingLead($lead)
{
if (isset($_GET['readable']) && $_GET['readable'] == '1' && get_field('easy_reading_select') == true && in_the_loop() && is_main_query()) {
return '';
}
return $lead;
} | [
"public",
"function",
"easyReadingLead",
"(",
"$",
"lead",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"_GET",
"[",
"'readable'",
"]",
")",
"&&",
"$",
"_GET",
"[",
"'readable'",
"]",
"==",
"'1'",
"&&",
"get_field",
"(",
"'easy_reading_select'",
")",
"==",
... | Remove the lead
@param string $lead Default lead
@return string Modified lead | [
"Remove",
"the",
"lead"
] | 0dfd7ea9168cbbde145d8b9e58a69ded3fa82ae0 | https://github.com/helsingborg-stad/easy-to-read-alternative/blob/0dfd7ea9168cbbde145d8b9e58a69ded3fa82ae0/source/php/Posts/Content.php#L41-L48 |
239,187 | helsingborg-stad/easy-to-read-alternative | source/php/Posts/Content.php | Content.easyReadingContent | public function easyReadingContent($content)
{
global $post;
if (isset($_GET['readable']) && $_GET['readable'] == '1' && get_field('easy_reading_select') == true && is_object($post) && isset($post->post_content) && in_the_loop() && is_main_query()) {
$post_content = $post->post_content;
if (strpos($post_con... | php | public function easyReadingContent($content)
{
global $post;
if (isset($_GET['readable']) && $_GET['readable'] == '1' && get_field('easy_reading_select') == true && is_object($post) && isset($post->post_content) && in_the_loop() && is_main_query()) {
$post_content = $post->post_content;
if (strpos($post_con... | [
"public",
"function",
"easyReadingContent",
"(",
"$",
"content",
")",
"{",
"global",
"$",
"post",
";",
"if",
"(",
"isset",
"(",
"$",
"_GET",
"[",
"'readable'",
"]",
")",
"&&",
"$",
"_GET",
"[",
"'readable'",
"]",
"==",
"'1'",
"&&",
"get_field",
"(",
... | Switch content to alternate version
@param string $content Default content
@return string Modified content | [
"Switch",
"content",
"to",
"alternate",
"version"
] | 0dfd7ea9168cbbde145d8b9e58a69ded3fa82ae0 | https://github.com/helsingborg-stad/easy-to-read-alternative/blob/0dfd7ea9168cbbde145d8b9e58a69ded3fa82ae0/source/php/Posts/Content.php#L55-L78 |
239,188 | luxorphp/mysql | src/PreparedMYSQL.php | PreparedMYSQL.executeUpdate | public function executeUpdate(): bool {
$temp = false;
if ($this->build()) {
$this->conect->query($this->generate);
$this->generate = "";
$temp = true;
}
return $temp;
} | php | public function executeUpdate(): bool {
$temp = false;
if ($this->build()) {
$this->conect->query($this->generate);
$this->generate = "";
$temp = true;
}
return $temp;
} | [
"public",
"function",
"executeUpdate",
"(",
")",
":",
"bool",
"{",
"$",
"temp",
"=",
"false",
";",
"if",
"(",
"$",
"this",
"->",
"build",
"(",
")",
")",
"{",
"$",
"this",
"->",
"conect",
"->",
"query",
"(",
"$",
"this",
"->",
"generate",
")",
";"... | Permite haser una escritura de los datos.
@return boolean retorna un true si es todo correcto y false en caso de errores. | [
"Permite",
"haser",
"una",
"escritura",
"de",
"los",
"datos",
"."
] | ca6ad7a82edd776d4a703f45a01bcaaf297af344 | https://github.com/luxorphp/mysql/blob/ca6ad7a82edd776d4a703f45a01bcaaf297af344/src/PreparedMYSQL.php#L199-L208 |
239,189 | NitroXy/php-forms | src/lib/FormBuilder.php | FormBuilder.setContext | public function setContext(FormContext $context){
$old = $this->context;
$this->context = $context;
return $old;
} | php | public function setContext(FormContext $context){
$old = $this->context;
$this->context = $context;
return $old;
} | [
"public",
"function",
"setContext",
"(",
"FormContext",
"$",
"context",
")",
"{",
"$",
"old",
"=",
"$",
"this",
"->",
"context",
";",
"$",
"this",
"->",
"context",
"=",
"$",
"context",
";",
"return",
"$",
"old",
";",
"}"
] | Change context.
@internal
@return old context | [
"Change",
"context",
"."
] | 28970779c3b438372c83f4f651a9897a542c1e54 | https://github.com/NitroXy/php-forms/blob/28970779c3b438372c83f4f651a9897a542c1e54/src/lib/FormBuilder.php#L14-L18 |
239,190 | NitroXy/php-forms | src/lib/FormBuilder.php | FormBuilder.hiddenField | public function hiddenField($key, $value=null, array $attr=[]){
$this->context->hiddenField($key, $value, $attr);
} | php | public function hiddenField($key, $value=null, array $attr=[]){
$this->context->hiddenField($key, $value, $attr);
} | [
"public",
"function",
"hiddenField",
"(",
"$",
"key",
",",
"$",
"value",
"=",
"null",
",",
"array",
"$",
"attr",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"context",
"->",
"hiddenField",
"(",
"$",
"key",
",",
"$",
"value",
",",
"$",
"attr",
")"... | Add hidden field. All hiddens are placed at the beginning of the form no matter where used.
@param $value If set the value is used instead of reading from the resource. | [
"Add",
"hidden",
"field",
".",
"All",
"hiddens",
"are",
"placed",
"at",
"the",
"beginning",
"of",
"the",
"form",
"no",
"matter",
"where",
"used",
"."
] | 28970779c3b438372c83f4f651a9897a542c1e54 | https://github.com/NitroXy/php-forms/blob/28970779c3b438372c83f4f651a9897a542c1e54/src/lib/FormBuilder.php#L90-L92 |
239,191 | NitroXy/php-forms | src/lib/FormBuilder.php | FormBuilder.textField | public function textField($key, $label=null, array $attr=[]){
$field = $this->factory("text", $key, $label, $attr);
return $this->addField($field);
} | php | public function textField($key, $label=null, array $attr=[]){
$field = $this->factory("text", $key, $label, $attr);
return $this->addField($field);
} | [
"public",
"function",
"textField",
"(",
"$",
"key",
",",
"$",
"label",
"=",
"null",
",",
"array",
"$",
"attr",
"=",
"[",
"]",
")",
"{",
"$",
"field",
"=",
"$",
"this",
"->",
"factory",
"(",
"\"text\"",
",",
"$",
"key",
",",
"$",
"label",
",",
"... | Regular "text" input.
@option 'type' {string} HTML type attribute, e.g. <code>email</code> or <code>tel</code>. | [
"Regular",
"text",
"input",
"."
] | 28970779c3b438372c83f4f651a9897a542c1e54 | https://github.com/NitroXy/php-forms/blob/28970779c3b438372c83f4f651a9897a542c1e54/src/lib/FormBuilder.php#L99-L102 |
239,192 | NitroXy/php-forms | src/lib/FormBuilder.php | FormBuilder.hint | public function hint($text, $label=null, array $attr=[]) {
if ( $this->unbuffered() ){
trigger_error("Cannot use hint in unbuffered mode", E_USER_ERROR);
}
$field = $this->factory("hint", $text, $label, $attr);
return $this->addField($field);
} | php | public function hint($text, $label=null, array $attr=[]) {
if ( $this->unbuffered() ){
trigger_error("Cannot use hint in unbuffered mode", E_USER_ERROR);
}
$field = $this->factory("hint", $text, $label, $attr);
return $this->addField($field);
} | [
"public",
"function",
"hint",
"(",
"$",
"text",
",",
"$",
"label",
"=",
"null",
",",
"array",
"$",
"attr",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"unbuffered",
"(",
")",
")",
"{",
"trigger_error",
"(",
"\"Cannot use hint in unbuffered m... | Add a help text. | [
"Add",
"a",
"help",
"text",
"."
] | 28970779c3b438372c83f4f651a9897a542c1e54 | https://github.com/NitroXy/php-forms/blob/28970779c3b438372c83f4f651a9897a542c1e54/src/lib/FormBuilder.php#L137-L143 |
239,193 | NitroXy/php-forms | src/lib/FormBuilder.php | FormBuilder.manual | public function manual($key, $label, $content, $hint=false){
$field = new ManualField($key, $label, $content, $hint);
$this->addField($field);
if ( $this->unbuffered() ){
echo $field->getContent() . "\n";
}
return $field;
} | php | public function manual($key, $label, $content, $hint=false){
$field = new ManualField($key, $label, $content, $hint);
$this->addField($field);
if ( $this->unbuffered() ){
echo $field->getContent() . "\n";
}
return $field;
} | [
"public",
"function",
"manual",
"(",
"$",
"key",
",",
"$",
"label",
",",
"$",
"content",
",",
"$",
"hint",
"=",
"false",
")",
"{",
"$",
"field",
"=",
"new",
"ManualField",
"(",
"$",
"key",
",",
"$",
"label",
",",
"$",
"content",
",",
"$",
"hint",... | Create a manual field from HTML.
@param $content Any HTML. | [
"Create",
"a",
"manual",
"field",
"from",
"HTML",
"."
] | 28970779c3b438372c83f4f651a9897a542c1e54 | https://github.com/NitroXy/php-forms/blob/28970779c3b438372c83f4f651a9897a542c1e54/src/lib/FormBuilder.php#L150-L159 |
239,194 | NitroXy/php-forms | src/lib/FormBuilder.php | FormBuilder.uploadField | public function uploadField($key, $label=null, array $attr=[]) {
$remove = false;
$current = false;
if ( array_key_exists('remove', $attr) ){
$remove = $attr['remove'];
unset($attr['remove']);
}
if ( array_key_exists('current', $attr) ){
$current = $attr['current'];
unset($attr['current']);
}
... | php | public function uploadField($key, $label=null, array $attr=[]) {
$remove = false;
$current = false;
if ( array_key_exists('remove', $attr) ){
$remove = $attr['remove'];
unset($attr['remove']);
}
if ( array_key_exists('current', $attr) ){
$current = $attr['current'];
unset($attr['current']);
}
... | [
"public",
"function",
"uploadField",
"(",
"$",
"key",
",",
"$",
"label",
"=",
"null",
",",
"array",
"$",
"attr",
"=",
"[",
"]",
")",
"{",
"$",
"remove",
"=",
"false",
";",
"$",
"current",
"=",
"false",
";",
"if",
"(",
"array_key_exists",
"(",
"'rem... | File upload field.
@option remove {boolean} If true a checkbox to remove the current value will be added.
@option current {html} If set to non-false the content will be displayed as the
current value, e.g can be set to <img ..> to display the
current uploaded image. | [
"File",
"upload",
"field",
"."
] | 28970779c3b438372c83f4f651a9897a542c1e54 | https://github.com/NitroXy/php-forms/blob/28970779c3b438372c83f4f651a9897a542c1e54/src/lib/FormBuilder.php#L169-L203 |
239,195 | NitroXy/php-forms | src/lib/FormBuilder.php | FormBuilder.group | public function group($label, callable $callback, array $attr=[]){
if ( $this->unbuffered() ){
trigger_error("Cannot use Form groups in unbuffered mode", E_USER_ERROR);
}
$field = new FormGroup($this->context, $label, $callback, $attr);
return $this->addField($field);
} | php | public function group($label, callable $callback, array $attr=[]){
if ( $this->unbuffered() ){
trigger_error("Cannot use Form groups in unbuffered mode", E_USER_ERROR);
}
$field = new FormGroup($this->context, $label, $callback, $attr);
return $this->addField($field);
} | [
"public",
"function",
"group",
"(",
"$",
"label",
",",
"callable",
"$",
"callback",
",",
"array",
"$",
"attr",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"unbuffered",
"(",
")",
")",
"{",
"trigger_error",
"(",
"\"Cannot use Form groups in unb... | Create a field group where all fields is aligned horizontaly,
useful for buttons, checkboxes and radiobuttons.
@param $callback A new rendering context. | [
"Create",
"a",
"field",
"group",
"where",
"all",
"fields",
"is",
"aligned",
"horizontaly",
"useful",
"for",
"buttons",
"checkboxes",
"and",
"radiobuttons",
"."
] | 28970779c3b438372c83f4f651a9897a542c1e54 | https://github.com/NitroXy/php-forms/blob/28970779c3b438372c83f4f651a9897a542c1e54/src/lib/FormBuilder.php#L211-L217 |
239,196 | NitroXy/php-forms | src/lib/FormBuilder.php | FormBuilder.fieldset | public function fieldset($label, callable $callback){
if ( $this->unbuffered() ){
trigger_error("Cannot use Form fieldsets in unbuffered mode", E_USER_ERROR);
}
$field = new FormFieldset($this->context, $label, $callback);
return $this->addField($field);
} | php | public function fieldset($label, callable $callback){
if ( $this->unbuffered() ){
trigger_error("Cannot use Form fieldsets in unbuffered mode", E_USER_ERROR);
}
$field = new FormFieldset($this->context, $label, $callback);
return $this->addField($field);
} | [
"public",
"function",
"fieldset",
"(",
"$",
"label",
",",
"callable",
"$",
"callback",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"unbuffered",
"(",
")",
")",
"{",
"trigger_error",
"(",
"\"Cannot use Form fieldsets in unbuffered mode\"",
",",
"E_USER_ERROR",
")",
... | Form fieldset.
@param $callback A new rendering context. | [
"Form",
"fieldset",
"."
] | 28970779c3b438372c83f4f651a9897a542c1e54 | https://github.com/NitroXy/php-forms/blob/28970779c3b438372c83f4f651a9897a542c1e54/src/lib/FormBuilder.php#L224-L230 |
239,197 | NitroXy/php-forms | src/lib/FormBuilder.php | FormBuilder.staticValue | public function staticValue($key, $label=false, array $attr=[]){
$field = $this->factory('static', $key, $label, $attr);
return $this->addField($field);
} | php | public function staticValue($key, $label=false, array $attr=[]){
$field = $this->factory('static', $key, $label, $attr);
return $this->addField($field);
} | [
"public",
"function",
"staticValue",
"(",
"$",
"key",
",",
"$",
"label",
"=",
"false",
",",
"array",
"$",
"attr",
"=",
"[",
"]",
")",
"{",
"$",
"field",
"=",
"$",
"this",
"->",
"factory",
"(",
"'static'",
",",
"$",
"key",
",",
"$",
"label",
",",
... | Display a value from the resource but provides no editable field. | [
"Display",
"a",
"value",
"from",
"the",
"resource",
"but",
"provides",
"no",
"editable",
"field",
"."
] | 28970779c3b438372c83f4f651a9897a542c1e54 | https://github.com/NitroXy/php-forms/blob/28970779c3b438372c83f4f651a9897a542c1e54/src/lib/FormBuilder.php#L260-L263 |
239,198 | NitroXy/php-forms | src/lib/FormBuilder.php | FormBuilder.link | public function link($text, $href, $label=false, array $attr=[]){
$field = $this->factory('link', false, $label, array_merge(array('text' => $text, 'href' => $href), $attr));
return $this->addField($field);
} | php | public function link($text, $href, $label=false, array $attr=[]){
$field = $this->factory('link', false, $label, array_merge(array('text' => $text, 'href' => $href), $attr));
return $this->addField($field);
} | [
"public",
"function",
"link",
"(",
"$",
"text",
",",
"$",
"href",
",",
"$",
"label",
"=",
"false",
",",
"array",
"$",
"attr",
"=",
"[",
"]",
")",
"{",
"$",
"field",
"=",
"$",
"this",
"->",
"factory",
"(",
"'link'",
",",
"false",
",",
"$",
"labe... | Similar to static but provides a link as well. | [
"Similar",
"to",
"static",
"but",
"provides",
"a",
"link",
"as",
"well",
"."
] | 28970779c3b438372c83f4f651a9897a542c1e54 | https://github.com/NitroXy/php-forms/blob/28970779c3b438372c83f4f651a9897a542c1e54/src/lib/FormBuilder.php#L268-L271 |
239,199 | NitroXy/php-forms | src/lib/FormBuilder.php | FormBuilder.checkbox | public function checkbox($key, $text, $label=null, array $attr=[]) {
$this->hiddenField($key, '0');
$attr['text'] = $text;
$field = $this->factory('checkbox', $key, $label, $attr);
return $this->addField($field);
} | php | public function checkbox($key, $text, $label=null, array $attr=[]) {
$this->hiddenField($key, '0');
$attr['text'] = $text;
$field = $this->factory('checkbox', $key, $label, $attr);
return $this->addField($field);
} | [
"public",
"function",
"checkbox",
"(",
"$",
"key",
",",
"$",
"text",
",",
"$",
"label",
"=",
"null",
",",
"array",
"$",
"attr",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"hiddenField",
"(",
"$",
"key",
",",
"'0'",
")",
";",
"$",
"attr",
"[",
... | Checkbox field. | [
"Checkbox",
"field",
"."
] | 28970779c3b438372c83f4f651a9897a542c1e54 | https://github.com/NitroXy/php-forms/blob/28970779c3b438372c83f4f651a9897a542c1e54/src/lib/FormBuilder.php#L290-L295 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.