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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
15,600 | phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/LogQuery.php | LogQuery.filterByClientAgent | public function filterByClientAgent($clientAgent = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($clientAgent)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $clientAgent)) {
$clientAgent = str_replace('*', '%', ... | php | public function filterByClientAgent($clientAgent = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($clientAgent)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $clientAgent)) {
$clientAgent = str_replace('*', '%', ... | [
"public",
"function",
"filterByClientAgent",
"(",
"$",
"clientAgent",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"clientAgent",
")",
")",
"{",
"$",... | Filter the query on the client_agent column
Example usage:
<code>
$query->filterByClientAgent('fooValue'); // WHERE client_agent = 'fooValue'
$query->filterByClientAgent('%fooValue%'); // WHERE client_agent LIKE '%fooValue%'
</code>
@param string $clientAgent The value to use as filter.
Accepts wildcards (* and... | [
"Filter",
"the",
"query",
"on",
"the",
"client_agent",
"column"
] | 3424a360c9bded71eb5b570bc114a7759cb23ec6 | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/LogQuery.php#L558-L570 |
15,601 | phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/LogQuery.php | LogQuery.filterByClientPlatform | public function filterByClientPlatform($clientPlatform = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($clientPlatform)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $clientPlatform)) {
$clientPlatform = str_rep... | php | public function filterByClientPlatform($clientPlatform = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($clientPlatform)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $clientPlatform)) {
$clientPlatform = str_rep... | [
"public",
"function",
"filterByClientPlatform",
"(",
"$",
"clientPlatform",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"clientPlatform",
")",
")",
"{... | Filter the query on the client_platform column
Example usage:
<code>
$query->filterByClientPlatform('fooValue'); // WHERE client_platform = 'fooValue'
$query->filterByClientPlatform('%fooValue%'); // WHERE client_platform LIKE '%fooValue%'
</code>
@param string $clientPlatform The value to use as filter.
Accept... | [
"Filter",
"the",
"query",
"on",
"the",
"client_platform",
"column"
] | 3424a360c9bded71eb5b570bc114a7759cb23ec6 | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/LogQuery.php#L587-L599 |
15,602 | datasift/datasift-php | lib/DataSift/Account.php | DataSift_Account.usage | public function usage($start = false, $end = false, $period = null)
{
$params = array();
if ($start) {
$params['start'] = $start;
}
if ($end) {
$params['end'] = $end;
}
if (isset($period)) {
$params['period'] = $period;
}
... | php | public function usage($start = false, $end = false, $period = null)
{
$params = array();
if ($start) {
$params['start'] = $start;
}
if ($end) {
$params['end'] = $end;
}
if (isset($period)) {
$params['period'] = $period;
}
... | [
"public",
"function",
"usage",
"(",
"$",
"start",
"=",
"false",
",",
"$",
"end",
"=",
"false",
",",
"$",
"period",
"=",
"null",
")",
"{",
"$",
"params",
"=",
"array",
"(",
")",
";",
"if",
"(",
"$",
"start",
")",
"{",
"$",
"params",
"[",
"'start... | Returns the user agent this library should use for all API calls.
@return string | [
"Returns",
"the",
"user",
"agent",
"this",
"library",
"should",
"use",
"for",
"all",
"API",
"calls",
"."
] | 35282461ad3e54880e5940bb5afce26c75dc4bb9 | https://github.com/datasift/datasift-php/blob/35282461ad3e54880e5940bb5afce26c75dc4bb9/lib/DataSift/Account.php#L57-L72 |
15,603 | crossjoin/Css | src/Crossjoin/Css/Format/Rule/TraitDeclarations.php | TraitDeclarations.setDeclarations | public function setDeclarations($declarations)
{
$this->declarations = [];
if (!is_array($declarations)) {
$declarations = [$declarations];
}
foreach ($declarations as $declaration) {
$this->addDeclaration($declaration);
}
return $this;
} | php | public function setDeclarations($declarations)
{
$this->declarations = [];
if (!is_array($declarations)) {
$declarations = [$declarations];
}
foreach ($declarations as $declaration) {
$this->addDeclaration($declaration);
}
return $this;
} | [
"public",
"function",
"setDeclarations",
"(",
"$",
"declarations",
")",
"{",
"$",
"this",
"->",
"declarations",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"is_array",
"(",
"$",
"declarations",
")",
")",
"{",
"$",
"declarations",
"=",
"[",
"$",
"declarations",
... | Sets the declarations.
@param DeclarationAbstract[]|DeclarationAbstract $declarations
@return $this | [
"Sets",
"the",
"declarations",
"."
] | 7b50ca94c4bdad60d01cfa327f00b7a600d6f9f3 | https://github.com/crossjoin/Css/blob/7b50ca94c4bdad60d01cfa327f00b7a600d6f9f3/src/Crossjoin/Css/Format/Rule/TraitDeclarations.php#L17-L28 |
15,604 | Atlantic18/CoralCoreBundle | Service/Request/Response.php | Response.parserHttpHeadersAsArray | protected function parserHttpHeadersAsArray($rawHeaders)
{
$headers = array();
foreach(explode("\n", $rawHeaders) as $i => $line)
{
if($i == 0)
{
$headers['HTTP_STATUS'] = substr($line, 9, 3);
}
else
{
... | php | protected function parserHttpHeadersAsArray($rawHeaders)
{
$headers = array();
foreach(explode("\n", $rawHeaders) as $i => $line)
{
if($i == 0)
{
$headers['HTTP_STATUS'] = substr($line, 9, 3);
}
else
{
... | [
"protected",
"function",
"parserHttpHeadersAsArray",
"(",
"$",
"rawHeaders",
")",
"{",
"$",
"headers",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"explode",
"(",
"\"\\n\"",
",",
"$",
"rawHeaders",
")",
"as",
"$",
"i",
"=>",
"$",
"line",
")",
"{",
"if... | Convert string headers into an array
@param string $rawHeaders
@return array HTTP Headers | [
"Convert",
"string",
"headers",
"into",
"an",
"array"
] | 7d74ffaf51046ad13cbfc2b0b69d656a499f38ab | https://github.com/Atlantic18/CoralCoreBundle/blob/7d74ffaf51046ad13cbfc2b0b69d656a499f38ab/Service/Request/Response.php#L51-L69 |
15,605 | opis/utils | lib/Mutex.php | Mutex.lock | public function lock()
{
if ($this->fp === null) {
$this->fp = fopen($this->file, 'r');
}
return flock($this->fp, LOCK_EX);
} | php | public function lock()
{
if ($this->fp === null) {
$this->fp = fopen($this->file, 'r');
}
return flock($this->fp, LOCK_EX);
} | [
"public",
"function",
"lock",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"fp",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"fp",
"=",
"fopen",
"(",
"$",
"this",
"->",
"file",
",",
"'r'",
")",
";",
"}",
"return",
"flock",
"(",
"$",
"this",
"... | Aquire the mutex
@return boolean | [
"Aquire",
"the",
"mutex"
] | 239cd3dc3760eb746838011e712592700fe5d58c | https://github.com/opis/utils/blob/239cd3dc3760eb746838011e712592700fe5d58c/lib/Mutex.php#L73-L80 |
15,606 | opis/utils | lib/Mutex.php | Mutex.unlock | public function unlock()
{
if ($this->fp !== null) {
flock($this->fp, LOCK_UN);
fclose($this->fp);
$this->fp = null;
}
return true;
} | php | public function unlock()
{
if ($this->fp !== null) {
flock($this->fp, LOCK_UN);
fclose($this->fp);
$this->fp = null;
}
return true;
} | [
"public",
"function",
"unlock",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"fp",
"!==",
"null",
")",
"{",
"flock",
"(",
"$",
"this",
"->",
"fp",
",",
"LOCK_UN",
")",
";",
"fclose",
"(",
"$",
"this",
"->",
"fp",
")",
";",
"$",
"this",
"->",
... | Realese the mutex
@return boolean | [
"Realese",
"the",
"mutex"
] | 239cd3dc3760eb746838011e712592700fe5d58c | https://github.com/opis/utils/blob/239cd3dc3760eb746838011e712592700fe5d58c/lib/Mutex.php#L87-L96 |
15,607 | harp-orm/query | src/Compiler/Update.php | Update.render | public static function render(Query\Update $query)
{
return Compiler::withDb($query->getDb(), function () use ($query) {
return Compiler::expression(array(
'UPDATE',
$query->getType(),
Aliased::combine($query->getTable()),
Join::com... | php | public static function render(Query\Update $query)
{
return Compiler::withDb($query->getDb(), function () use ($query) {
return Compiler::expression(array(
'UPDATE',
$query->getType(),
Aliased::combine($query->getTable()),
Join::com... | [
"public",
"static",
"function",
"render",
"(",
"Query",
"\\",
"Update",
"$",
"query",
")",
"{",
"return",
"Compiler",
"::",
"withDb",
"(",
"$",
"query",
"->",
"getDb",
"(",
")",
",",
"function",
"(",
")",
"use",
"(",
"$",
"query",
")",
"{",
"return",... | Render Update object
@param Query\Update $query
@return string | [
"Render",
"Update",
"object"
] | 98ce2468a0a31fe15ed3692bad32547bf6dbe41a | https://github.com/harp-orm/query/blob/98ce2468a0a31fe15ed3692bad32547bf6dbe41a/src/Compiler/Update.php#L19-L33 |
15,608 | tonicospinelli/class-generation | src/ClassGeneration/UseCollection.php | UseCollection.toString | public function toString()
{
$uses = $this->getIterator();
$string = '';
foreach ($uses as $use) {
$string .= $use->toString();
}
return $string;
} | php | public function toString()
{
$uses = $this->getIterator();
$string = '';
foreach ($uses as $use) {
$string .= $use->toString();
}
return $string;
} | [
"public",
"function",
"toString",
"(",
")",
"{",
"$",
"uses",
"=",
"$",
"this",
"->",
"getIterator",
"(",
")",
";",
"$",
"string",
"=",
"''",
";",
"foreach",
"(",
"$",
"uses",
"as",
"$",
"use",
")",
"{",
"$",
"string",
".=",
"$",
"use",
"->",
"... | Parse the Uses to string;
@return string | [
"Parse",
"the",
"Uses",
"to",
"string",
";"
] | eee63bdb68c066b25b885b57b23656e809381a76 | https://github.com/tonicospinelli/class-generation/blob/eee63bdb68c066b25b885b57b23656e809381a76/src/ClassGeneration/UseCollection.php#L67-L76 |
15,609 | harp-orm/query | src/Compiler/Values.php | Values.render | public static function render(SQL\Values $item)
{
$placeholders = array_fill(0, count($item->getParameters()), '?');
return '('.join(', ', $placeholders).')';
} | php | public static function render(SQL\Values $item)
{
$placeholders = array_fill(0, count($item->getParameters()), '?');
return '('.join(', ', $placeholders).')';
} | [
"public",
"static",
"function",
"render",
"(",
"SQL",
"\\",
"Values",
"$",
"item",
")",
"{",
"$",
"placeholders",
"=",
"array_fill",
"(",
"0",
",",
"count",
"(",
"$",
"item",
"->",
"getParameters",
"(",
")",
")",
",",
"'?'",
")",
";",
"return",
"'('"... | Render Values object
@param SQL\Values $item
@return string | [
"Render",
"Values",
"object"
] | 98ce2468a0a31fe15ed3692bad32547bf6dbe41a | https://github.com/harp-orm/query/blob/98ce2468a0a31fe15ed3692bad32547bf6dbe41a/src/Compiler/Values.php#L30-L35 |
15,610 | e0ipso/drupal-unit-autoload | src/Loader.php | Loader.autoloadPaths | protected function autoloadPaths($class) {
$class = static::unprefixClass($class);
// If the class that PHP is trying to find is not in the class map, built
// from the composer configuration, then bail.
if (!in_array($class, array_keys($this->classMap))) {
return FALSE;
}
try {
$res... | php | protected function autoloadPaths($class) {
$class = static::unprefixClass($class);
// If the class that PHP is trying to find is not in the class map, built
// from the composer configuration, then bail.
if (!in_array($class, array_keys($this->classMap))) {
return FALSE;
}
try {
$res... | [
"protected",
"function",
"autoloadPaths",
"(",
"$",
"class",
")",
"{",
"$",
"class",
"=",
"static",
"::",
"unprefixClass",
"(",
"$",
"class",
")",
";",
"// If the class that PHP is trying to find is not in the class map, built",
"// from the composer configuration, then bail.... | Helper function to autoload path based files.
@param string $class
The requested class.
@return bool
TRUE if the class was found. FALSE otherwise. | [
"Helper",
"function",
"to",
"autoload",
"path",
"based",
"files",
"."
] | 7ce147b269c7333eca31e2cd04b736d6274b9cbf | https://github.com/e0ipso/drupal-unit-autoload/blob/7ce147b269c7333eca31e2cd04b736d6274b9cbf/src/Loader.php#L129-L148 |
15,611 | czim/laravel-pxlcms | src/Generator/Writer/Model/ModelWriterContext.php | ModelWriterContext.getConfigNameForStandardModelType | protected function getConfigNameForStandardModelType($type)
{
switch ($type) {
case CmsModel::RELATION_TYPE_IMAGE:
return 'image';
case CmsModel::RELATION_TYPE_FILE:
return 'file';
case CmsModel::RELATION_TYPE_CATEGORY:
r... | php | protected function getConfigNameForStandardModelType($type)
{
switch ($type) {
case CmsModel::RELATION_TYPE_IMAGE:
return 'image';
case CmsModel::RELATION_TYPE_FILE:
return 'file';
case CmsModel::RELATION_TYPE_CATEGORY:
r... | [
"protected",
"function",
"getConfigNameForStandardModelType",
"(",
"$",
"type",
")",
"{",
"switch",
"(",
"$",
"type",
")",
"{",
"case",
"CmsModel",
"::",
"RELATION_TYPE_IMAGE",
":",
"return",
"'image'",
";",
"case",
"CmsModel",
"::",
"RELATION_TYPE_FILE",
":",
"... | Returns the special model type name used for config properties
based on CmsModel const values for RELATION_TYPEs
@param int $type
@return null|string | [
"Returns",
"the",
"special",
"model",
"type",
"name",
"used",
"for",
"config",
"properties",
"based",
"on",
"CmsModel",
"const",
"values",
"for",
"RELATION_TYPEs"
] | 910297d2a3f2db86dde51b0e10fe5aad45f1aa1a | https://github.com/czim/laravel-pxlcms/blob/910297d2a3f2db86dde51b0e10fe5aad45f1aa1a/src/Generator/Writer/Model/ModelWriterContext.php#L104-L124 |
15,612 | fuelphp/display | src/ViewManager.php | ViewManager.configure | protected function configure(array $config)
{
if (isset($config['parsers']))
{
$this->registerParsers($config['parsers']);
}
if (isset($config['cache']))
{
$this->cachePath = rtrim('cache', '\\/').DIRECTORY_SEPARATOR;
}
if (isset($config['auto_filter']))
{
$this->autoFilter = (bool) $config[... | php | protected function configure(array $config)
{
if (isset($config['parsers']))
{
$this->registerParsers($config['parsers']);
}
if (isset($config['cache']))
{
$this->cachePath = rtrim('cache', '\\/').DIRECTORY_SEPARATOR;
}
if (isset($config['auto_filter']))
{
$this->autoFilter = (bool) $config[... | [
"protected",
"function",
"configure",
"(",
"array",
"$",
"config",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"config",
"[",
"'parsers'",
"]",
")",
")",
"{",
"$",
"this",
"->",
"registerParsers",
"(",
"$",
"config",
"[",
"'parsers'",
"]",
")",
";",
"}",... | Configures the view manager
@param array $config | [
"Configures",
"the",
"view",
"manager"
] | d9a3eddbf80f0fd81beb40d9f4507600ac6611a4 | https://github.com/fuelphp/display/blob/d9a3eddbf80f0fd81beb40d9f4507600ac6611a4/src/ViewManager.php#L59-L85 |
15,613 | fuelphp/display | src/ViewManager.php | ViewManager.whitelist | public function whitelist($classes)
{
if ( ! is_array($classes))
{
$classes = func_get_args();
}
$this->whitelist = array_unique(array_merge($this->whitelist, $classes));
} | php | public function whitelist($classes)
{
if ( ! is_array($classes))
{
$classes = func_get_args();
}
$this->whitelist = array_unique(array_merge($this->whitelist, $classes));
} | [
"public",
"function",
"whitelist",
"(",
"$",
"classes",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"classes",
")",
")",
"{",
"$",
"classes",
"=",
"func_get_args",
"(",
")",
";",
"}",
"$",
"this",
"->",
"whitelist",
"=",
"array_unique",
"(",
"arr... | Adds the given classes to the whitelist.
@param string[] $classes | [
"Adds",
"the",
"given",
"classes",
"to",
"the",
"whitelist",
"."
] | d9a3eddbf80f0fd81beb40d9f4507600ac6611a4 | https://github.com/fuelphp/display/blob/d9a3eddbf80f0fd81beb40d9f4507600ac6611a4/src/ViewManager.php#L102-L110 |
15,614 | fuelphp/display | src/ViewManager.php | ViewManager.registerParser | public function registerParser($extension, Parser $parser)
{
if ($parser instanceof ViewManagerAware)
{
$parser->setViewManager($this);
}
$this->parsers[$extension] = $parser;
} | php | public function registerParser($extension, Parser $parser)
{
if ($parser instanceof ViewManagerAware)
{
$parser->setViewManager($this);
}
$this->parsers[$extension] = $parser;
} | [
"public",
"function",
"registerParser",
"(",
"$",
"extension",
",",
"Parser",
"$",
"parser",
")",
"{",
"if",
"(",
"$",
"parser",
"instanceof",
"ViewManagerAware",
")",
"{",
"$",
"parser",
"->",
"setViewManager",
"(",
"$",
"this",
")",
";",
"}",
"$",
"thi... | Registers a new parser for rendering a given file type
@param string $extension
@param Parser $parser | [
"Registers",
"a",
"new",
"parser",
"for",
"rendering",
"a",
"given",
"file",
"type"
] | d9a3eddbf80f0fd81beb40d9f4507600ac6611a4 | https://github.com/fuelphp/display/blob/d9a3eddbf80f0fd81beb40d9f4507600ac6611a4/src/ViewManager.php#L118-L126 |
15,615 | fuelphp/display | src/ViewManager.php | ViewManager.registerParsers | public function registerParsers(array $parsers)
{
foreach ($parsers as $extension => $parser)
{
$this->registerParser($extension, $parser);
}
} | php | public function registerParsers(array $parsers)
{
foreach ($parsers as $extension => $parser)
{
$this->registerParser($extension, $parser);
}
} | [
"public",
"function",
"registerParsers",
"(",
"array",
"$",
"parsers",
")",
"{",
"foreach",
"(",
"$",
"parsers",
"as",
"$",
"extension",
"=>",
"$",
"parser",
")",
"{",
"$",
"this",
"->",
"registerParser",
"(",
"$",
"extension",
",",
"$",
"parser",
")",
... | Registers multiple parsers at once
@param array $parsers Key as the file extension and value as the parser instance | [
"Registers",
"multiple",
"parsers",
"at",
"once"
] | d9a3eddbf80f0fd81beb40d9f4507600ac6611a4 | https://github.com/fuelphp/display/blob/d9a3eddbf80f0fd81beb40d9f4507600ac6611a4/src/ViewManager.php#L133-L139 |
15,616 | fuelphp/display | src/ViewManager.php | ViewManager.findView | public function findView($view)
{
$view = $this->viewFolder.DIRECTORY_SEPARATOR.ltrim($view, DIRECTORY_SEPARATOR);
return $this->finder->findFileReversed($view);
} | php | public function findView($view)
{
$view = $this->viewFolder.DIRECTORY_SEPARATOR.ltrim($view, DIRECTORY_SEPARATOR);
return $this->finder->findFileReversed($view);
} | [
"public",
"function",
"findView",
"(",
"$",
"view",
")",
"{",
"$",
"view",
"=",
"$",
"this",
"->",
"viewFolder",
".",
"DIRECTORY_SEPARATOR",
".",
"ltrim",
"(",
"$",
"view",
",",
"DIRECTORY_SEPARATOR",
")",
";",
"return",
"$",
"this",
"->",
"finder",
"->"... | Attempts to get the file name for the given view
@param $view
@return array|\Fuel\FileSystem\Directory|\Fuel\FileSystem\File|string | [
"Attempts",
"to",
"get",
"the",
"file",
"name",
"for",
"the",
"given",
"view"
] | d9a3eddbf80f0fd81beb40d9f4507600ac6611a4 | https://github.com/fuelphp/display/blob/d9a3eddbf80f0fd81beb40d9f4507600ac6611a4/src/ViewManager.php#L191-L196 |
15,617 | fuelphp/display | src/ViewManager.php | ViewManager.forge | public function forge($view, array $data = null, $filter = null)
{
if ( ! $file = $this->findView($view))
{
throw new Exception\ViewNotFound('Could not locate view: '.$view);
}
if ($filter === null)
{
$filter = $this->autoFilter;
}
$extension = pathinfo($file, PATHINFO_EXTENSION);
if ( ! isset... | php | public function forge($view, array $data = null, $filter = null)
{
if ( ! $file = $this->findView($view))
{
throw new Exception\ViewNotFound('Could not locate view: '.$view);
}
if ($filter === null)
{
$filter = $this->autoFilter;
}
$extension = pathinfo($file, PATHINFO_EXTENSION);
if ( ! isset... | [
"public",
"function",
"forge",
"(",
"$",
"view",
",",
"array",
"$",
"data",
"=",
"null",
",",
"$",
"filter",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"file",
"=",
"$",
"this",
"->",
"findView",
"(",
"$",
"view",
")",
")",
"{",
"throw",
"new"... | Attempts to find and load the given view
@param string $view
@param array $data
@param null|bool $filter
@return View
@throws Exception\ViewNotFound If the given view cannot be found
@throws \DomainException If a parser for the view cannot be found | [
"Attempts",
"to",
"find",
"and",
"load",
"the",
"given",
"view"
] | d9a3eddbf80f0fd81beb40d9f4507600ac6611a4 | https://github.com/fuelphp/display/blob/d9a3eddbf80f0fd81beb40d9f4507600ac6611a4/src/ViewManager.php#L210-L238 |
15,618 | czim/laravel-pxlcms | src/Models/CmsModel.php | CmsModel.getCmsReferenceKeyForRelation | public function getCmsReferenceKeyForRelation($relation, $reversed = false)
{
$isParent = ( array_key_exists($relation, $this->relationsConfig)
&& array_key_exists('parent', $this->relationsConfig[$relation])
&& (bool) $this->relationsConfig[$relation]['parent']
... | php | public function getCmsReferenceKeyForRelation($relation, $reversed = false)
{
$isParent = ( array_key_exists($relation, $this->relationsConfig)
&& array_key_exists('parent', $this->relationsConfig[$relation])
&& (bool) $this->relationsConfig[$relation]['parent']
... | [
"public",
"function",
"getCmsReferenceKeyForRelation",
"(",
"$",
"relation",
",",
"$",
"reversed",
"=",
"false",
")",
"{",
"$",
"isParent",
"=",
"(",
"array_key_exists",
"(",
"$",
"relation",
",",
"$",
"this",
"->",
"relationsConfig",
")",
"&&",
"array_key_exi... | Get standard belongsToMany reference key name for 'from' and 'to' models
Reversed gives the 'to' key
@param string $relation
@param bool $reversed (default: false)
@return string | [
"Get",
"standard",
"belongsToMany",
"reference",
"key",
"name",
"for",
"from",
"and",
"to",
"models",
"Reversed",
"gives",
"the",
"to",
"key"
] | 910297d2a3f2db86dde51b0e10fe5aad45f1aa1a | https://github.com/czim/laravel-pxlcms/blob/910297d2a3f2db86dde51b0e10fe5aad45f1aa1a/src/Models/CmsModel.php#L276-L290 |
15,619 | czim/laravel-pxlcms | src/Models/CmsModel.php | CmsModel.getCmsReferenceFieldId | public function getCmsReferenceFieldId($relation)
{
if ( ! array_key_exists($relation, $this->relationsConfig)
|| ! array_key_exists('field', $this->relationsConfig[$relation])
) {
return null;
}
return (int) $this->relationsConfig[ $relation ]['field'];
... | php | public function getCmsReferenceFieldId($relation)
{
if ( ! array_key_exists($relation, $this->relationsConfig)
|| ! array_key_exists('field', $this->relationsConfig[$relation])
) {
return null;
}
return (int) $this->relationsConfig[ $relation ]['field'];
... | [
"public",
"function",
"getCmsReferenceFieldId",
"(",
"$",
"relation",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"relation",
",",
"$",
"this",
"->",
"relationsConfig",
")",
"||",
"!",
"array_key_exists",
"(",
"'field'",
",",
"$",
"this",
"->",
... | Returns the configured 'from_field_id' field id value for the reference relation
@param string $relation
@return int|null | [
"Returns",
"the",
"configured",
"from_field_id",
"field",
"id",
"value",
"for",
"the",
"reference",
"relation"
] | 910297d2a3f2db86dde51b0e10fe5aad45f1aa1a | https://github.com/czim/laravel-pxlcms/blob/910297d2a3f2db86dde51b0e10fe5aad45f1aa1a/src/Models/CmsModel.php#L298-L307 |
15,620 | czim/laravel-pxlcms | src/Models/CmsModel.php | CmsModel.getCmsSpecialRelationType | public function getCmsSpecialRelationType($relation)
{
if ( ! array_key_exists($relation, $this->relationsConfig)
|| ! array_key_exists('type', $this->relationsConfig[$relation])
) {
return null;
}
return $this->relationsConfig[ $relation ]['type'];
} | php | public function getCmsSpecialRelationType($relation)
{
if ( ! array_key_exists($relation, $this->relationsConfig)
|| ! array_key_exists('type', $this->relationsConfig[$relation])
) {
return null;
}
return $this->relationsConfig[ $relation ]['type'];
} | [
"public",
"function",
"getCmsSpecialRelationType",
"(",
"$",
"relation",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"relation",
",",
"$",
"this",
"->",
"relationsConfig",
")",
"||",
"!",
"array_key_exists",
"(",
"'type'",
",",
"$",
"this",
"->",... | Returns the configured special standard model type for the reference relation
@param string $relation
@return string|null | [
"Returns",
"the",
"configured",
"special",
"standard",
"model",
"type",
"for",
"the",
"reference",
"relation"
] | 910297d2a3f2db86dde51b0e10fe5aad45f1aa1a | https://github.com/czim/laravel-pxlcms/blob/910297d2a3f2db86dde51b0e10fe5aad45f1aa1a/src/Models/CmsModel.php#L315-L324 |
15,621 | czim/laravel-pxlcms | src/Models/CmsModel.php | CmsModel.belongsTo | public function belongsTo($related, $foreignKey = null, $otherKey = null, $relation = null)
{
// If no relation name was given, we will use this debug backtrace to extract
// the calling method's name and use that as the relationship name as most
// of the time this will be what we desire to... | php | public function belongsTo($related, $foreignKey = null, $otherKey = null, $relation = null)
{
// If no relation name was given, we will use this debug backtrace to extract
// the calling method's name and use that as the relationship name as most
// of the time this will be what we desire to... | [
"public",
"function",
"belongsTo",
"(",
"$",
"related",
",",
"$",
"foreignKey",
"=",
"null",
",",
"$",
"otherKey",
"=",
"null",
",",
"$",
"relation",
"=",
"null",
")",
"{",
"// If no relation name was given, we will use this debug backtrace to extract",
"// the callin... | Override for different naming convention
@param string $related
@param string $foreignKey
@param string $otherKey
@param string $relation
@return \Illuminate\Database\Eloquent\Relations\BelongsTo | [
"Override",
"for",
"different",
"naming",
"convention"
] | 910297d2a3f2db86dde51b0e10fe5aad45f1aa1a | https://github.com/czim/laravel-pxlcms/blob/910297d2a3f2db86dde51b0e10fe5aad45f1aa1a/src/Models/CmsModel.php#L354-L400 |
15,622 | czim/laravel-pxlcms | src/Models/CmsModel.php | CmsModel.belongsToMany | public function belongsToMany($related, $table = null, $foreignKey = null, $otherKey = null, $relation = null)
{
// If no relationship name was passed, we will pull backtraces to get the
// name of the calling function. We will use that function name as the
// title of this relation since th... | php | public function belongsToMany($related, $table = null, $foreignKey = null, $otherKey = null, $relation = null)
{
// If no relationship name was passed, we will pull backtraces to get the
// name of the calling function. We will use that function name as the
// title of this relation since th... | [
"public",
"function",
"belongsToMany",
"(",
"$",
"related",
",",
"$",
"table",
"=",
"null",
",",
"$",
"foreignKey",
"=",
"null",
",",
"$",
"otherKey",
"=",
"null",
",",
"$",
"relation",
"=",
"null",
")",
"{",
"// If no relationship name was passed, we will pul... | Override for special cms_m_references 'pivot' table
@param string $related
@param string $table
@param string $foreignKey
@param string $otherKey
@param string $relation
@return \Illuminate\Database\Eloquent\Relations\BelongsToMany | [
"Override",
"for",
"special",
"cms_m_references",
"pivot",
"table"
] | 910297d2a3f2db86dde51b0e10fe5aad45f1aa1a | https://github.com/czim/laravel-pxlcms/blob/910297d2a3f2db86dde51b0e10fe5aad45f1aa1a/src/Models/CmsModel.php#L412-L449 |
15,623 | czim/laravel-pxlcms | src/Models/CmsModel.php | CmsModel.belongsToManyNormal | public function belongsToManyNormal($related, $table = null, $foreignKey = null, $otherKey = null, $relation = null)
{
return parent::belongsToMany($related, $table, $foreignKey, $otherKey, $relation);
} | php | public function belongsToManyNormal($related, $table = null, $foreignKey = null, $otherKey = null, $relation = null)
{
return parent::belongsToMany($related, $table, $foreignKey, $otherKey, $relation);
} | [
"public",
"function",
"belongsToManyNormal",
"(",
"$",
"related",
",",
"$",
"table",
"=",
"null",
",",
"$",
"foreignKey",
"=",
"null",
",",
"$",
"otherKey",
"=",
"null",
",",
"$",
"relation",
"=",
"null",
")",
"{",
"return",
"parent",
"::",
"belongsToMan... | For when you still want to use the 'normal' belongsToMany relationship in a CmsModel
that should be related to non-CmsModels in the laravel convention
@param string $related
@param string $table
@param string $foreignKey
@param string $otherKey
@param string $relation
@return \Illuminate\Database\Eloquent\Relatio... | [
"For",
"when",
"you",
"still",
"want",
"to",
"use",
"the",
"normal",
"belongsToMany",
"relationship",
"in",
"a",
"CmsModel",
"that",
"should",
"be",
"related",
"to",
"non",
"-",
"CmsModels",
"in",
"the",
"laravel",
"convention"
] | 910297d2a3f2db86dde51b0e10fe5aad45f1aa1a | https://github.com/czim/laravel-pxlcms/blob/910297d2a3f2db86dde51b0e10fe5aad45f1aa1a/src/Models/CmsModel.php#L462-L465 |
15,624 | czim/laravel-pxlcms | src/Models/CmsModel.php | CmsModel.hasOne | public function hasOne($related, $foreignKey = null, $localKey = null, $locale = null)
{
$relation = $this->getHasOneOrManyCaller();
if ( ! ($specialType = $this->getCmsSpecialRelationType($relation))) {
return parent::hasOne($related, $foreignKey, $localKey);
}
list($f... | php | public function hasOne($related, $foreignKey = null, $localKey = null, $locale = null)
{
$relation = $this->getHasOneOrManyCaller();
if ( ! ($specialType = $this->getCmsSpecialRelationType($relation))) {
return parent::hasOne($related, $foreignKey, $localKey);
}
list($f... | [
"public",
"function",
"hasOne",
"(",
"$",
"related",
",",
"$",
"foreignKey",
"=",
"null",
",",
"$",
"localKey",
"=",
"null",
",",
"$",
"locale",
"=",
"null",
")",
"{",
"$",
"relation",
"=",
"$",
"this",
"->",
"getHasOneOrManyCaller",
"(",
")",
";",
"... | Overridden to catch special relationships to standard CMS models
@param string $related
@param string $foreignKey
@param string $localKey
@param string $locale only used as an override, and only for ML images
@return \Illuminate\Database\Eloquent\Relations\HasOne | [
"Overridden",
"to",
"catch",
"special",
"relationships",
"to",
"standard",
"CMS",
"models"
] | 910297d2a3f2db86dde51b0e10fe5aad45f1aa1a | https://github.com/czim/laravel-pxlcms/blob/910297d2a3f2db86dde51b0e10fe5aad45f1aa1a/src/Models/CmsModel.php#L537-L589 |
15,625 | czim/laravel-pxlcms | src/Models/CmsModel.php | CmsModel.getKeysForSpecialRelation | protected function getKeysForSpecialRelation($specialType, $foreignKey = null)
{
switch ($specialType) {
case static::RELATION_TYPE_FILE:
$foreignKey = $foreignKey ?: config('pxlcms.relations.files.keys.entry');
$secondaryKey = config('pxlcms.relations.files.ke... | php | protected function getKeysForSpecialRelation($specialType, $foreignKey = null)
{
switch ($specialType) {
case static::RELATION_TYPE_FILE:
$foreignKey = $foreignKey ?: config('pxlcms.relations.files.keys.entry');
$secondaryKey = config('pxlcms.relations.files.ke... | [
"protected",
"function",
"getKeysForSpecialRelation",
"(",
"$",
"specialType",
",",
"$",
"foreignKey",
"=",
"null",
")",
"{",
"switch",
"(",
"$",
"specialType",
")",
"{",
"case",
"static",
"::",
"RELATION_TYPE_FILE",
":",
"$",
"foreignKey",
"=",
"$",
"foreignK... | Get the foreign and field keys for the special relation's standard CMS model
@param int $specialType
@param string $foreignKey
@return array [ foreignKey, secondaryKey ] | [
"Get",
"the",
"foreign",
"and",
"field",
"keys",
"for",
"the",
"special",
"relation",
"s",
"standard",
"CMS",
"model"
] | 910297d2a3f2db86dde51b0e10fe5aad45f1aa1a | https://github.com/czim/laravel-pxlcms/blob/910297d2a3f2db86dde51b0e10fe5aad45f1aa1a/src/Models/CmsModel.php#L616-L637 |
15,626 | czim/laravel-pxlcms | src/Models/CmsModel.php | CmsModel.getBelongsToRelationAttributeValue | public function getBelongsToRelationAttributeValue($key)
{
$relationKey = camel_case($key);
$attributeKey = snake_case($key);
if ($this->relationLoaded($relationKey)) {
// check to make sure we don't break eager loading and internal
// lookups for the foreign key
... | php | public function getBelongsToRelationAttributeValue($key)
{
$relationKey = camel_case($key);
$attributeKey = snake_case($key);
if ($this->relationLoaded($relationKey)) {
// check to make sure we don't break eager loading and internal
// lookups for the foreign key
... | [
"public",
"function",
"getBelongsToRelationAttributeValue",
"(",
"$",
"key",
")",
"{",
"$",
"relationKey",
"=",
"camel_case",
"(",
"$",
"key",
")",
";",
"$",
"attributeKey",
"=",
"snake_case",
"(",
"$",
"key",
")",
";",
"if",
"(",
"$",
"this",
"->",
"rel... | Returns value for either foreign key or eager loaded contents of relation,
depending on what is expected
This should not break calls to the belongsTo relation method, including after
using the load() method to eager load the relation's contents
@param string $key
@return mixed | [
"Returns",
"value",
"for",
"either",
"foreign",
"key",
"or",
"eager",
"loaded",
"contents",
"of",
"relation",
"depending",
"on",
"what",
"is",
"expected"
] | 910297d2a3f2db86dde51b0e10fe5aad45f1aa1a | https://github.com/czim/laravel-pxlcms/blob/910297d2a3f2db86dde51b0e10fe5aad45f1aa1a/src/Models/CmsModel.php#L649-L690 |
15,627 | czim/laravel-pxlcms | src/Models/CmsModel.php | CmsModel.getImagesWithResizes | protected function getImagesWithResizes()
{
// first get the images through the relation
$relation = $this->getRelationForImagesWithResizesCaller();
$images = $this->{$relation}()->get();
if (empty($images)) return $images;
// then get extra info and retrieve the resizes f... | php | protected function getImagesWithResizes()
{
// first get the images through the relation
$relation = $this->getRelationForImagesWithResizesCaller();
$images = $this->{$relation}()->get();
if (empty($images)) return $images;
// then get extra info and retrieve the resizes f... | [
"protected",
"function",
"getImagesWithResizes",
"(",
")",
"{",
"// first get the images through the relation",
"$",
"relation",
"=",
"$",
"this",
"->",
"getRelationForImagesWithResizesCaller",
"(",
")",
";",
"$",
"images",
"=",
"$",
"this",
"->",
"{",
"$",
"relatio... | Returns resize-enriched images for a special CMS model image relation
To be called from an accessor, so it can return images based on its name,
which should be get<relationname>Attribute().
@return Collection | [
"Returns",
"resize",
"-",
"enriched",
"images",
"for",
"a",
"special",
"CMS",
"model",
"image",
"relation"
] | 910297d2a3f2db86dde51b0e10fe5aad45f1aa1a | https://github.com/czim/laravel-pxlcms/blob/910297d2a3f2db86dde51b0e10fe5aad45f1aa1a/src/Models/CmsModel.php#L772-L811 |
15,628 | czim/laravel-pxlcms | src/Models/CmsModel.php | CmsModel.getRelationForImagesWithResizesCaller | protected function getRelationForImagesWithResizesCaller()
{
$self = __FUNCTION__;
$caller = Arr::first(debug_backtrace(false), function ($key, $trace) use ($self) {
$caller = $trace['function'];
return ! in_array($caller, ['getImagesWithResizes']) && $caller != $self;
... | php | protected function getRelationForImagesWithResizesCaller()
{
$self = __FUNCTION__;
$caller = Arr::first(debug_backtrace(false), function ($key, $trace) use ($self) {
$caller = $trace['function'];
return ! in_array($caller, ['getImagesWithResizes']) && $caller != $self;
... | [
"protected",
"function",
"getRelationForImagesWithResizesCaller",
"(",
")",
"{",
"$",
"self",
"=",
"__FUNCTION__",
";",
"$",
"caller",
"=",
"Arr",
"::",
"first",
"(",
"debug_backtrace",
"(",
"false",
")",
",",
"function",
"(",
"$",
"key",
",",
"$",
"trace",
... | Get the relationship name of the image accessor for which images are enriched
@return string | [
"Get",
"the",
"relationship",
"name",
"of",
"the",
"image",
"accessor",
"for",
"which",
"images",
"are",
"enriched"
] | 910297d2a3f2db86dde51b0e10fe5aad45f1aa1a | https://github.com/czim/laravel-pxlcms/blob/910297d2a3f2db86dde51b0e10fe5aad45f1aa1a/src/Models/CmsModel.php#L836-L850 |
15,629 | czim/laravel-pxlcms | src/Models/CmsModel.php | CmsModel.lookupLocaleForLanguageId | public function lookupLocaleForLanguageId($languageId)
{
/** @var Model $languageModel */
$languageModel = static::$cmsLanguageModel;
$language = $languageModel::where('id', $languageId)
->remember((config('pxlcms.cache.languages', 15)))
->first();
if (empty... | php | public function lookupLocaleForLanguageId($languageId)
{
/** @var Model $languageModel */
$languageModel = static::$cmsLanguageModel;
$language = $languageModel::where('id', $languageId)
->remember((config('pxlcms.cache.languages', 15)))
->first();
if (empty... | [
"public",
"function",
"lookupLocaleForLanguageId",
"(",
"$",
"languageId",
")",
"{",
"/** @var Model $languageModel */",
"$",
"languageModel",
"=",
"static",
"::",
"$",
"cmsLanguageModel",
";",
"$",
"language",
"=",
"$",
"languageModel",
"::",
"where",
"(",
"'id'",
... | Retrieves locale for a given language ID code
@param int $languageId
@return string|null of language for ID was not found | [
"Retrieves",
"locale",
"for",
"a",
"given",
"language",
"ID",
"code"
] | 910297d2a3f2db86dde51b0e10fe5aad45f1aa1a | https://github.com/czim/laravel-pxlcms/blob/910297d2a3f2db86dde51b0e10fe5aad45f1aa1a/src/Models/CmsModel.php#L885-L897 |
15,630 | harp-orm/query | src/DB.php | DB.execute | public function execute($sql, array $parameters = array())
{
$this->logger->info($sql, array('parameters' => $parameters));
try {
$statement = $this->getPdo()->prepare($sql);
$statement->execute($parameters);
} catch (PDOException $exception) {
$this->log... | php | public function execute($sql, array $parameters = array())
{
$this->logger->info($sql, array('parameters' => $parameters));
try {
$statement = $this->getPdo()->prepare($sql);
$statement->execute($parameters);
} catch (PDOException $exception) {
$this->log... | [
"public",
"function",
"execute",
"(",
"$",
"sql",
",",
"array",
"$",
"parameters",
"=",
"array",
"(",
")",
")",
"{",
"$",
"this",
"->",
"logger",
"->",
"info",
"(",
"$",
"sql",
",",
"array",
"(",
"'parameters'",
"=>",
"$",
"parameters",
")",
")",
"... | Run "prepare" a statement and then execute it
@param string $sql
@param array $parameters
@return \PDOStatement | [
"Run",
"prepare",
"a",
"statement",
"and",
"then",
"execute",
"it"
] | 98ce2468a0a31fe15ed3692bad32547bf6dbe41a | https://github.com/harp-orm/query/blob/98ce2468a0a31fe15ed3692bad32547bf6dbe41a/src/DB.php#L240-L254 |
15,631 | WellCommerce/OrderBundle | Form/Front/CartFormBuilder.php | CartFormBuilder.addShippingOptions | private function addShippingOptions(Order $order, FormInterface $form)
{
if ($order->getShippingMethod() instanceof ShippingMethod) {
$provider = $this->getOptionsProvider($order->getShippingMethod());
if ($provider instanceof ShippingMethodOptionsProviderInterface) {
... | php | private function addShippingOptions(Order $order, FormInterface $form)
{
if ($order->getShippingMethod() instanceof ShippingMethod) {
$provider = $this->getOptionsProvider($order->getShippingMethod());
if ($provider instanceof ShippingMethodOptionsProviderInterface) {
... | [
"private",
"function",
"addShippingOptions",
"(",
"Order",
"$",
"order",
",",
"FormInterface",
"$",
"form",
")",
"{",
"if",
"(",
"$",
"order",
"->",
"getShippingMethod",
"(",
")",
"instanceof",
"ShippingMethod",
")",
"{",
"$",
"provider",
"=",
"$",
"this",
... | Adds shipping options if available for order's shipping method
@param Order $order
@param FormInterface $form | [
"Adds",
"shipping",
"options",
"if",
"available",
"for",
"order",
"s",
"shipping",
"method"
] | d72cfb51eab7a1f66f186900d1e2d533a822c424 | https://github.com/WellCommerce/OrderBundle/blob/d72cfb51eab7a1f66f186900d1e2d533a822c424/Form/Front/CartFormBuilder.php#L85-L97 |
15,632 | drpdigital/json-api-parser | src/JsonApiParser.php | JsonApiParser.parse | public function parse(array $input)
{
$this->data = Arr::get($input, 'data');
if ($this->data === null) {
return null;
}
$this->included = Arr::get($input, 'included', []);
$this->start();
return $this->resolver->getResolved();
} | php | public function parse(array $input)
{
$this->data = Arr::get($input, 'data');
if ($this->data === null) {
return null;
}
$this->included = Arr::get($input, 'included', []);
$this->start();
return $this->resolver->getResolved();
} | [
"public",
"function",
"parse",
"(",
"array",
"$",
"input",
")",
"{",
"$",
"this",
"->",
"data",
"=",
"Arr",
"::",
"get",
"(",
"$",
"input",
",",
"'data'",
")",
";",
"if",
"(",
"$",
"this",
"->",
"data",
"===",
"null",
")",
"{",
"return",
"null",
... | Parse the data given
Returns all the models that were resolved.
@param array $input
@return \Drp\JsonApiParser\ResolvedCollection|null
@throws \ReflectionException
@throws \Drp\JsonApiParser\Exceptions\MissingResolverException | [
"Parse",
"the",
"data",
"given"
] | b1ceefc0c19ec326129126253114c121e97ca943 | https://github.com/drpdigital/json-api-parser/blob/b1ceefc0c19ec326129126253114c121e97ca943/src/JsonApiParser.php#L47-L59 |
15,633 | drpdigital/json-api-parser | src/JsonApiParser.php | JsonApiParser.resolver | public function resolver($resourceNames, $callback)
{
$resourceNames = Arr::wrap($resourceNames);
foreach ($resourceNames as $name) {
$this->resolver->bind($name, $callback);
}
return $this;
} | php | public function resolver($resourceNames, $callback)
{
$resourceNames = Arr::wrap($resourceNames);
foreach ($resourceNames as $name) {
$this->resolver->bind($name, $callback);
}
return $this;
} | [
"public",
"function",
"resolver",
"(",
"$",
"resourceNames",
",",
"$",
"callback",
")",
"{",
"$",
"resourceNames",
"=",
"Arr",
"::",
"wrap",
"(",
"$",
"resourceNames",
")",
";",
"foreach",
"(",
"$",
"resourceNames",
"as",
"$",
"name",
")",
"{",
"$",
"t... | Adds the callbacks for resolve the different objects in the response
@param array|string $resourceNames
@param callable|string $callback
@return JsonApiParser | [
"Adds",
"the",
"callbacks",
"for",
"resolve",
"the",
"different",
"objects",
"in",
"the",
"response"
] | b1ceefc0c19ec326129126253114c121e97ca943 | https://github.com/drpdigital/json-api-parser/blob/b1ceefc0c19ec326129126253114c121e97ca943/src/JsonApiParser.php#L68-L77 |
15,634 | drpdigital/json-api-parser | src/JsonApiParser.php | JsonApiParser.fetcher | public function fetcher($className, $relationshipName, $callback = null)
{
$this->resolver->bindFetcher($className, $relationshipName, $callback);
return $this;
} | php | public function fetcher($className, $relationshipName, $callback = null)
{
$this->resolver->bindFetcher($className, $relationshipName, $callback);
return $this;
} | [
"public",
"function",
"fetcher",
"(",
"$",
"className",
",",
"$",
"relationshipName",
",",
"$",
"callback",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"resolver",
"->",
"bindFetcher",
"(",
"$",
"className",
",",
"$",
"relationshipName",
",",
"$",
"callback"... | Add a callback for a class that when called will return an existing instance of
a relationship.
This callback will be called when trying to resolve a parameter dependency on
a resolver callback. The callback will only be given the id of the relationship it
needs to be fetched.
@param string|array $className
@param st... | [
"Add",
"a",
"callback",
"for",
"a",
"class",
"that",
"when",
"called",
"will",
"return",
"an",
"existing",
"instance",
"of",
"a",
"relationship",
"."
] | b1ceefc0c19ec326129126253114c121e97ca943 | https://github.com/drpdigital/json-api-parser/blob/b1ceefc0c19ec326129126253114c121e97ca943/src/JsonApiParser.php#L93-L98 |
15,635 | drpdigital/json-api-parser | src/JsonApiParser.php | JsonApiParser.start | private function start()
{
if (Arr::is_assoc($this->data)) {
$this->data = [$this->data];
}
foreach ($this->data as $data) {
$relationshipsToProcess = $this->resolveResource($data);
$this->resolveRelationships($relationshipsToProcess);
}
} | php | private function start()
{
if (Arr::is_assoc($this->data)) {
$this->data = [$this->data];
}
foreach ($this->data as $data) {
$relationshipsToProcess = $this->resolveResource($data);
$this->resolveRelationships($relationshipsToProcess);
}
} | [
"private",
"function",
"start",
"(",
")",
"{",
"if",
"(",
"Arr",
"::",
"is_assoc",
"(",
"$",
"this",
"->",
"data",
")",
")",
"{",
"$",
"this",
"->",
"data",
"=",
"[",
"$",
"this",
"->",
"data",
"]",
";",
"}",
"foreach",
"(",
"$",
"this",
"->",
... | Starts the parsing and creating of the relationships.
@return void
@throws \ReflectionException
@throws \Drp\JsonApiParser\Exceptions\MissingResolverException | [
"Starts",
"the",
"parsing",
"and",
"creating",
"of",
"the",
"relationships",
"."
] | b1ceefc0c19ec326129126253114c121e97ca943 | https://github.com/drpdigital/json-api-parser/blob/b1ceefc0c19ec326129126253114c121e97ca943/src/JsonApiParser.php#L107-L117 |
15,636 | drpdigital/json-api-parser | src/JsonApiParser.php | JsonApiParser.getIncludedResource | private function getIncludedResource($id, $type)
{
foreach ($this->included as $included) {
$includedId = Arr::get($included, 'id');
$includedType = Arr::get($included, 'type');
if ((string) $includedType === (string) $type && (string) $includedId === (string) $id) {
... | php | private function getIncludedResource($id, $type)
{
foreach ($this->included as $included) {
$includedId = Arr::get($included, 'id');
$includedType = Arr::get($included, 'type');
if ((string) $includedType === (string) $type && (string) $includedId === (string) $id) {
... | [
"private",
"function",
"getIncludedResource",
"(",
"$",
"id",
",",
"$",
"type",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"included",
"as",
"$",
"included",
")",
"{",
"$",
"includedId",
"=",
"Arr",
"::",
"get",
"(",
"$",
"included",
",",
"'id'",
"... | Get a resource that is in the included array
Returns default resource if it was not able to find a resource with
the given type and id.
@param integer $id
@param string $type
@return bool|mixed | [
"Get",
"a",
"resource",
"that",
"is",
"in",
"the",
"included",
"array"
] | b1ceefc0c19ec326129126253114c121e97ca943 | https://github.com/drpdigital/json-api-parser/blob/b1ceefc0c19ec326129126253114c121e97ca943/src/JsonApiParser.php#L226-L238 |
15,637 | dakalab/division-code | src/DivisionCode/DivisionCode.php | DivisionCode.get | public function get($code = null): string
{
if (!$this->validate($code)) {
throw new \InvalidArgumentException('Invalid code');
}
return isset(self::$codes[$code]) ? self::$codes[$code] : '';
} | php | public function get($code = null): string
{
if (!$this->validate($code)) {
throw new \InvalidArgumentException('Invalid code');
}
return isset(self::$codes[$code]) ? self::$codes[$code] : '';
} | [
"public",
"function",
"get",
"(",
"$",
"code",
"=",
"null",
")",
":",
"string",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"validate",
"(",
"$",
"code",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'Invalid code'",
")",
";",
"}... | Get local name by code
@param string|int $code
@throws \InvalidArgumentException
@return string | [
"Get",
"local",
"name",
"by",
"code"
] | f8b2c4c7981c49e1bf6f203425b89ae94087d99f | https://github.com/dakalab/division-code/blob/f8b2c4c7981c49e1bf6f203425b89ae94087d99f/src/DivisionCode/DivisionCode.php#L62-L69 |
15,638 | dakalab/division-code | src/DivisionCode/DivisionCode.php | DivisionCode.getCity | public function getCity($code): string
{
$provinceCode = substr($code, 0, 2) . '0000';
$cityCode = substr($code, 0, 4) . '00';
if ($provinceCode != $cityCode) {
return $this->get($cityCode);
}
return '';
} | php | public function getCity($code): string
{
$provinceCode = substr($code, 0, 2) . '0000';
$cityCode = substr($code, 0, 4) . '00';
if ($provinceCode != $cityCode) {
return $this->get($cityCode);
}
return '';
} | [
"public",
"function",
"getCity",
"(",
"$",
"code",
")",
":",
"string",
"{",
"$",
"provinceCode",
"=",
"substr",
"(",
"$",
"code",
",",
"0",
",",
"2",
")",
".",
"'0000'",
";",
"$",
"cityCode",
"=",
"substr",
"(",
"$",
"code",
",",
"0",
",",
"4",
... | Get the city by code
@param string|int $code
@return string | [
"Get",
"the",
"city",
"by",
"code"
] | f8b2c4c7981c49e1bf6f203425b89ae94087d99f | https://github.com/dakalab/division-code/blob/f8b2c4c7981c49e1bf6f203425b89ae94087d99f/src/DivisionCode/DivisionCode.php#L90-L99 |
15,639 | dakalab/division-code | src/DivisionCode/DivisionCode.php | DivisionCode.getAddress | public function getAddress($code): string
{
return $this->getProvince($code) . $this->getCity($code) . $this->getCounty($code);
} | php | public function getAddress($code): string
{
return $this->getProvince($code) . $this->getCity($code) . $this->getCounty($code);
} | [
"public",
"function",
"getAddress",
"(",
"$",
"code",
")",
":",
"string",
"{",
"return",
"$",
"this",
"->",
"getProvince",
"(",
"$",
"code",
")",
".",
"$",
"this",
"->",
"getCity",
"(",
"$",
"code",
")",
".",
"$",
"this",
"->",
"getCounty",
"(",
"$... | Get the address by code
@param string|int $code
@return string | [
"Get",
"the",
"address",
"by",
"code"
] | f8b2c4c7981c49e1bf6f203425b89ae94087d99f | https://github.com/dakalab/division-code/blob/f8b2c4c7981c49e1bf6f203425b89ae94087d99f/src/DivisionCode/DivisionCode.php#L122-L125 |
15,640 | nicoSWD/put.io-api-v2 | src/PutIO/Engines/PutIO/FilesEngine.php | FilesEngine.search | public function search($query, $page = 1)
{
return $this->get(sprintf(
'files/search/%s/page/%d',
rawurlencode(trim($query)),
$page
));
} | php | public function search($query, $page = 1)
{
return $this->get(sprintf(
'files/search/%s/page/%d',
rawurlencode(trim($query)),
$page
));
} | [
"public",
"function",
"search",
"(",
"$",
"query",
",",
"$",
"page",
"=",
"1",
")",
"{",
"return",
"$",
"this",
"->",
"get",
"(",
"sprintf",
"(",
"'files/search/%s/page/%d'",
",",
"rawurlencode",
"(",
"trim",
"(",
"$",
"query",
")",
")",
",",
"$",
"p... | Returns an array of files matching the given search query.
@param string $query Search query
@param integer $page Page number
@return array | [
"Returns",
"an",
"array",
"of",
"files",
"matching",
"the",
"given",
"search",
"query",
"."
] | d91bedd91ea75793512a921bfd9aa83e86a6f0a7 | https://github.com/nicoSWD/put.io-api-v2/blob/d91bedd91ea75793512a921bfd9aa83e86a6f0a7/src/PutIO/Engines/PutIO/FilesEngine.php#L46-L53 |
15,641 | nicoSWD/put.io-api-v2 | src/PutIO/Engines/PutIO/FilesEngine.php | FilesEngine.upload | public function upload($file, $parentID = 0)
{
if (!$file = realpath($file)) {
throw new \Exception('File not found');
}
return $this->uploadFile('files/upload', [
'parent_id' => $parentID,
'file' => "@{$file}"
]);
} | php | public function upload($file, $parentID = 0)
{
if (!$file = realpath($file)) {
throw new \Exception('File not found');
}
return $this->uploadFile('files/upload', [
'parent_id' => $parentID,
'file' => "@{$file}"
]);
} | [
"public",
"function",
"upload",
"(",
"$",
"file",
",",
"$",
"parentID",
"=",
"0",
")",
"{",
"if",
"(",
"!",
"$",
"file",
"=",
"realpath",
"(",
"$",
"file",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"'File not found'",
")",
";",
"}",
... | Uploads a local file to your account.
NOTE 1: The response differs based on the uploaded file. For regular
files, the array key containing the info is 'file', but for torrents it's
'transfer'.
@see https://api.put.io/v2/docs/#files-upload
NOTE 2: Files need to be read into the memory when using NATIVE
functions. Kee... | [
"Uploads",
"a",
"local",
"file",
"to",
"your",
"account",
"."
] | d91bedd91ea75793512a921bfd9aa83e86a6f0a7 | https://github.com/nicoSWD/put.io-api-v2/blob/d91bedd91ea75793512a921bfd9aa83e86a6f0a7/src/PutIO/Engines/PutIO/FilesEngine.php#L73-L83 |
15,642 | nicoSWD/put.io-api-v2 | src/PutIO/Engines/PutIO/FilesEngine.php | FilesEngine.makeDir | public function makeDir($name, $parentID = 0)
{
$data = [
'name' => $name,
'parent_id' => $parentID
];
return $this->post('files/create-folder', $data, \false, 'file');
} | php | public function makeDir($name, $parentID = 0)
{
$data = [
'name' => $name,
'parent_id' => $parentID
];
return $this->post('files/create-folder', $data, \false, 'file');
} | [
"public",
"function",
"makeDir",
"(",
"$",
"name",
",",
"$",
"parentID",
"=",
"0",
")",
"{",
"$",
"data",
"=",
"[",
"'name'",
"=>",
"$",
"name",
",",
"'parent_id'",
"=>",
"$",
"parentID",
"]",
";",
"return",
"$",
"this",
"->",
"post",
"(",
"'files/... | Creates a new folder. Returns folder info on success, false on error.
@param string $name Name of the new folder.
@param integer $parentID ID of the parent folder.
@return mixed | [
"Creates",
"a",
"new",
"folder",
".",
"Returns",
"folder",
"info",
"on",
"success",
"false",
"on",
"error",
"."
] | d91bedd91ea75793512a921bfd9aa83e86a6f0a7 | https://github.com/nicoSWD/put.io-api-v2/blob/d91bedd91ea75793512a921bfd9aa83e86a6f0a7/src/PutIO/Engines/PutIO/FilesEngine.php#L92-L100 |
15,643 | nicoSWD/put.io-api-v2 | src/PutIO/Engines/PutIO/FilesEngine.php | FilesEngine.delete | public function delete($fileIDs)
{
if (is_array($fileIDs)) {
$fileIDs = implode(',', $fileIDs);
}
$data = [
'file_ids' => $fileIDs
];
return $this->post('files/delete', $data, \true);
} | php | public function delete($fileIDs)
{
if (is_array($fileIDs)) {
$fileIDs = implode(',', $fileIDs);
}
$data = [
'file_ids' => $fileIDs
];
return $this->post('files/delete', $data, \true);
} | [
"public",
"function",
"delete",
"(",
"$",
"fileIDs",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"fileIDs",
")",
")",
"{",
"$",
"fileIDs",
"=",
"implode",
"(",
"','",
",",
"$",
"fileIDs",
")",
";",
"}",
"$",
"data",
"=",
"[",
"'file_ids'",
"=>",
"... | Deletes files from your account.
@param mixed $fileIDs IDs of files you want to delete. Array or integer.
@return boolean | [
"Deletes",
"files",
"from",
"your",
"account",
"."
] | d91bedd91ea75793512a921bfd9aa83e86a6f0a7 | https://github.com/nicoSWD/put.io-api-v2/blob/d91bedd91ea75793512a921bfd9aa83e86a6f0a7/src/PutIO/Engines/PutIO/FilesEngine.php#L119-L130 |
15,644 | nicoSWD/put.io-api-v2 | src/PutIO/Engines/PutIO/FilesEngine.php | FilesEngine.move | public function move($fileIDs, $parentID)
{
if (is_array($fileIDs)) {
$fileIDs = implode(',', $fileIDs);
}
$data = [
'file_ids' => $fileIDs,
'parent_id' => $parentID
];
return $this->post('files/move', $data, \true);
} | php | public function move($fileIDs, $parentID)
{
if (is_array($fileIDs)) {
$fileIDs = implode(',', $fileIDs);
}
$data = [
'file_ids' => $fileIDs,
'parent_id' => $parentID
];
return $this->post('files/move', $data, \true);
} | [
"public",
"function",
"move",
"(",
"$",
"fileIDs",
",",
"$",
"parentID",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"fileIDs",
")",
")",
"{",
"$",
"fileIDs",
"=",
"implode",
"(",
"','",
",",
"$",
"fileIDs",
")",
";",
"}",
"$",
"data",
"=",
"[",
... | Moves one of more files to a new directory.
@param mixed $fileIDs IDs of files you want to move. Array or integer.
@param integer $parentID ID of the folder you want to move the files to.
@return boolean | [
"Moves",
"one",
"of",
"more",
"files",
"to",
"a",
"new",
"directory",
"."
] | d91bedd91ea75793512a921bfd9aa83e86a6f0a7 | https://github.com/nicoSWD/put.io-api-v2/blob/d91bedd91ea75793512a921bfd9aa83e86a6f0a7/src/PutIO/Engines/PutIO/FilesEngine.php#L156-L168 |
15,645 | thecodingmachine/utils.graphics.mouf-imagine | src/Mouf/Utils/Graphics/MoufImagine/Controller/ImagePresetController.php | ImagePresetController.deletePreset | private function deletePreset ($imagePath) {
$finalPath = ROOT_PATH . $this->url . DIRECTORY_SEPARATOR . $imagePath;
if (file_exists($finalPath)){
unlink($finalPath);
}
} | php | private function deletePreset ($imagePath) {
$finalPath = ROOT_PATH . $this->url . DIRECTORY_SEPARATOR . $imagePath;
if (file_exists($finalPath)){
unlink($finalPath);
}
} | [
"private",
"function",
"deletePreset",
"(",
"$",
"imagePath",
")",
"{",
"$",
"finalPath",
"=",
"ROOT_PATH",
".",
"$",
"this",
"->",
"url",
".",
"DIRECTORY_SEPARATOR",
".",
"$",
"imagePath",
";",
"if",
"(",
"file_exists",
"(",
"$",
"finalPath",
")",
")",
... | Delete a preset of an image
@param $imagePath | [
"Delete",
"a",
"preset",
"of",
"an",
"image"
] | 54366dec4839569290bf79a4ffd41b032461779b | https://github.com/thecodingmachine/utils.graphics.mouf-imagine/blob/54366dec4839569290bf79a4ffd41b032461779b/src/Mouf/Utils/Graphics/MoufImagine/Controller/ImagePresetController.php#L174-L179 |
15,646 | thecodingmachine/utils.graphics.mouf-imagine | src/Mouf/Utils/Graphics/MoufImagine/Controller/ImagePresetController.php | ImagePresetController.createPresets | public static function createPresets($path = null, $callback = null) {
$moufManager = MoufManager::getMoufManager();
$instances = $moufManager->findInstances('Mouf\\Utils\\Graphics\\MoufImagine\\Controller\\ImagePresetController');
foreach ($instances as $instanceName) {
$instance = ... | php | public static function createPresets($path = null, $callback = null) {
$moufManager = MoufManager::getMoufManager();
$instances = $moufManager->findInstances('Mouf\\Utils\\Graphics\\MoufImagine\\Controller\\ImagePresetController');
foreach ($instances as $instanceName) {
$instance = ... | [
"public",
"static",
"function",
"createPresets",
"(",
"$",
"path",
"=",
"null",
",",
"$",
"callback",
"=",
"null",
")",
"{",
"$",
"moufManager",
"=",
"MoufManager",
"::",
"getMoufManager",
"(",
")",
";",
"$",
"instances",
"=",
"$",
"moufManager",
"->",
"... | Create presets of an image
@param string $path | [
"Create",
"presets",
"of",
"an",
"image"
] | 54366dec4839569290bf79a4ffd41b032461779b | https://github.com/thecodingmachine/utils.graphics.mouf-imagine/blob/54366dec4839569290bf79a4ffd41b032461779b/src/Mouf/Utils/Graphics/MoufImagine/Controller/ImagePresetController.php#L185-L200 |
15,647 | thecodingmachine/utils.graphics.mouf-imagine | src/Mouf/Utils/Graphics/MoufImagine/Controller/ImagePresetController.php | ImagePresetController.purgePresets | public static function purgePresets($path = null, $callback = null) {
$moufManager = MoufManager::getMoufManager();
$instances = $moufManager->findInstances('Mouf\\Utils\\Graphics\\MoufImagine\\Controller\\ImagePresetController');
foreach ($instances as $instanceName) {
$instance = $... | php | public static function purgePresets($path = null, $callback = null) {
$moufManager = MoufManager::getMoufManager();
$instances = $moufManager->findInstances('Mouf\\Utils\\Graphics\\MoufImagine\\Controller\\ImagePresetController');
foreach ($instances as $instanceName) {
$instance = $... | [
"public",
"static",
"function",
"purgePresets",
"(",
"$",
"path",
"=",
"null",
",",
"$",
"callback",
"=",
"null",
")",
"{",
"$",
"moufManager",
"=",
"MoufManager",
"::",
"getMoufManager",
"(",
")",
";",
"$",
"instances",
"=",
"$",
"moufManager",
"->",
"f... | Purge presets of an image
@param string $path | [
"Purge",
"presets",
"of",
"an",
"image"
] | 54366dec4839569290bf79a4ffd41b032461779b | https://github.com/thecodingmachine/utils.graphics.mouf-imagine/blob/54366dec4839569290bf79a4ffd41b032461779b/src/Mouf/Utils/Graphics/MoufImagine/Controller/ImagePresetController.php#L206-L221 |
15,648 | raoul2000/yii2-twbsmaxlength-widget | TwbsMaxlength.php | TwbsMaxlength.registerClientScript | public function registerClientScript()
{
$view = $this->getView();
TwbsMaxlengthAsset::register($view);
$options = empty($this->clientOptions) ? "{}" : Json::encode($this->clientOptions);
if( isset($this->selector)) {
$js = "jQuery(\"{$this->selector}\").maxlength(" . $options . ")";
} else {
$js = "j... | php | public function registerClientScript()
{
$view = $this->getView();
TwbsMaxlengthAsset::register($view);
$options = empty($this->clientOptions) ? "{}" : Json::encode($this->clientOptions);
if( isset($this->selector)) {
$js = "jQuery(\"{$this->selector}\").maxlength(" . $options . ")";
} else {
$js = "j... | [
"public",
"function",
"registerClientScript",
"(",
")",
"{",
"$",
"view",
"=",
"$",
"this",
"->",
"getView",
"(",
")",
";",
"TwbsMaxlengthAsset",
"::",
"register",
"(",
"$",
"view",
")",
";",
"$",
"options",
"=",
"empty",
"(",
"$",
"this",
"->",
"clien... | Generates and registers javascript to start the plugin. | [
"Generates",
"and",
"registers",
"javascript",
"to",
"start",
"the",
"plugin",
"."
] | 87ba6bf179a8db398bff0aaee6701a1e6dfc8b3b | https://github.com/raoul2000/yii2-twbsmaxlength-widget/blob/87ba6bf179a8db398bff0aaee6701a1e6dfc8b3b/TwbsMaxlength.php#L128-L140 |
15,649 | raoul2000/yii2-twbsmaxlength-widget | TwbsMaxlength.php | TwbsMaxlength.apply | public static function apply($field, $clientOptions, $render = true)
{
if ( isset($field->inputOptions['maxlength'])) {
$maxLength = $field->inputOptions['maxlength'];
} else {
$maxLength = static::getMaxLength($field->model, Html::getAttributeName($field->attribute));
}
if ( ! empty($maxLength) ) {
$... | php | public static function apply($field, $clientOptions, $render = true)
{
if ( isset($field->inputOptions['maxlength'])) {
$maxLength = $field->inputOptions['maxlength'];
} else {
$maxLength = static::getMaxLength($field->model, Html::getAttributeName($field->attribute));
}
if ( ! empty($maxLength) ) {
$... | [
"public",
"static",
"function",
"apply",
"(",
"$",
"field",
",",
"$",
"clientOptions",
",",
"$",
"render",
"=",
"true",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"field",
"->",
"inputOptions",
"[",
"'maxlength'",
"]",
")",
")",
"{",
"$",
"maxLength",
"... | Add the maxlength attribute to an ActiveField.
The plugin requires that the max number of characters is specified as the HTML5 attribute "maxlength". This
method adds this attribute if it is not already defined into the HTML attributes of an ActiveField. The
value is retrieved from the StringValidator settings that is... | [
"Add",
"the",
"maxlength",
"attribute",
"to",
"an",
"ActiveField",
"."
] | 87ba6bf179a8db398bff0aaee6701a1e6dfc8b3b | https://github.com/raoul2000/yii2-twbsmaxlength-widget/blob/87ba6bf179a8db398bff0aaee6701a1e6dfc8b3b/TwbsMaxlength.php#L161-L180 |
15,650 | raoul2000/yii2-twbsmaxlength-widget | TwbsMaxlength.php | TwbsMaxlength.getMaxLength | public static function getMaxLength($model, $attribute, $defaultValue = null)
{
$maxLength = null;
foreach ($model->getActiveValidators($attribute) as $validator) {
if ( $validator instanceof yii\validators\StringValidator) {
$maxLength = $validator->max;
break;
}
}
return $maxLength !== null ? $... | php | public static function getMaxLength($model, $attribute, $defaultValue = null)
{
$maxLength = null;
foreach ($model->getActiveValidators($attribute) as $validator) {
if ( $validator instanceof yii\validators\StringValidator) {
$maxLength = $validator->max;
break;
}
}
return $maxLength !== null ? $... | [
"public",
"static",
"function",
"getMaxLength",
"(",
"$",
"model",
",",
"$",
"attribute",
",",
"$",
"defaultValue",
"=",
"null",
")",
"{",
"$",
"maxLength",
"=",
"null",
";",
"foreach",
"(",
"$",
"model",
"->",
"getActiveValidators",
"(",
"$",
"attribute",... | Find the maxlength parameter for an attribute's model.
This method searches for a yii\validators\StringValidator among all the active validators (based on the current
model scenario). If it founds one, it returns the max length parameter value. If no such value can be found because it is not
defined or because no Stri... | [
"Find",
"the",
"maxlength",
"parameter",
"for",
"an",
"attribute",
"s",
"model",
"."
] | 87ba6bf179a8db398bff0aaee6701a1e6dfc8b3b | https://github.com/raoul2000/yii2-twbsmaxlength-widget/blob/87ba6bf179a8db398bff0aaee6701a1e6dfc8b3b/TwbsMaxlength.php#L194-L204 |
15,651 | drunomics/service-utils | src/Core/Entity/EntityTypeManagerTrait.php | EntityTypeManagerTrait.getEntityTypeManager | public function getEntityTypeManager() {
if (empty($this->entityTypeManager)) {
$this->entityTypeManager = \Drupal::entityTypeManager();
}
return $this->entityTypeManager;
} | php | public function getEntityTypeManager() {
if (empty($this->entityTypeManager)) {
$this->entityTypeManager = \Drupal::entityTypeManager();
}
return $this->entityTypeManager;
} | [
"public",
"function",
"getEntityTypeManager",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"entityTypeManager",
")",
")",
"{",
"$",
"this",
"->",
"entityTypeManager",
"=",
"\\",
"Drupal",
"::",
"entityTypeManager",
"(",
")",
";",
"}",
"return... | Gets the entity type manager.
@return \Drupal\Core\Entity\EntityTypeManagerInterface
The entity type manager. | [
"Gets",
"the",
"entity",
"type",
"manager",
"."
] | 56761750043132365ef4ae5d9e0cf4263459328f | https://github.com/drunomics/service-utils/blob/56761750043132365ef4ae5d9e0cf4263459328f/src/Core/Entity/EntityTypeManagerTrait.php#L38-L43 |
15,652 | axelitus/php-base | src/Num.php | Num.parse | public static function parse($value, $default = null)
{
if (!is_string($value) || !is_numeric($value)) {
return $default;
}
if(Int::extIs($value)){
return Int::parse($value);
} else {
return Float::parse($value);
}
} | php | public static function parse($value, $default = null)
{
if (!is_string($value) || !is_numeric($value)) {
return $default;
}
if(Int::extIs($value)){
return Int::parse($value);
} else {
return Float::parse($value);
}
} | [
"public",
"static",
"function",
"parse",
"(",
"$",
"value",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"value",
")",
"||",
"!",
"is_numeric",
"(",
"$",
"value",
")",
")",
"{",
"return",
"$",
"default",
";",
... | Parses a string numeric value into an integer or a float.
@param string $value The value to parse.
@param null $default The default return value if the given value is not a string or is not numeric.
@return mixed Returns the parsed value or the default value. | [
"Parses",
"a",
"string",
"numeric",
"value",
"into",
"an",
"integer",
"or",
"a",
"float",
"."
] | c2da680c1f0c3ee93ae6a8be5adaacd0caf7d075 | https://github.com/axelitus/php-base/blob/c2da680c1f0c3ee93ae6a8be5adaacd0caf7d075/src/Num.php#L68-L79 |
15,653 | axelitus/php-base | src/Num.php | Num.compare | public static function compare($num1, $num2)
{
if (!static::is($num1) || !static::is($num2)) {
throw new \InvalidArgumentException("The \$num1 and \$num2 parameters must be numeric.");
}
return ($num1 - $num2);
} | php | public static function compare($num1, $num2)
{
if (!static::is($num1) || !static::is($num2)) {
throw new \InvalidArgumentException("The \$num1 and \$num2 parameters must be numeric.");
}
return ($num1 - $num2);
} | [
"public",
"static",
"function",
"compare",
"(",
"$",
"num1",
",",
"$",
"num2",
")",
"{",
"if",
"(",
"!",
"static",
"::",
"is",
"(",
"$",
"num1",
")",
"||",
"!",
"static",
"::",
"is",
"(",
"$",
"num2",
")",
")",
"{",
"throw",
"new",
"\\",
"Inval... | Compares two numeric values.
The returning value contains the actual value difference.
@param int|float $num1 The left operand.
@param int|float $num2 The right operand.
@return int Returns <0 if $num1<$num2, =0 if $num1 == $num2, >0 if $num1>$num2
@throws \InvalidArgumentException | [
"Compares",
"two",
"numeric",
"values",
"."
] | c2da680c1f0c3ee93ae6a8be5adaacd0caf7d075 | https://github.com/axelitus/php-base/blob/c2da680c1f0c3ee93ae6a8be5adaacd0caf7d075/src/Num.php#L128-L135 |
15,654 | goblindegook/Syllables | src/Shortcode.php | Shortcode.output | final public function output( $atts, $content = null, $tag = null ) {
if ( empty( $tag ) ) {
$tag = $this->get_tag();
}
$output = $this->render( $atts, $content, $tag );
/**
* Filters the shortcode content.
*
* @param string $output This shortcode's rendered content.
* @param array $atts ... | php | final public function output( $atts, $content = null, $tag = null ) {
if ( empty( $tag ) ) {
$tag = $this->get_tag();
}
$output = $this->render( $atts, $content, $tag );
/**
* Filters the shortcode content.
*
* @param string $output This shortcode's rendered content.
* @param array $atts ... | [
"final",
"public",
"function",
"output",
"(",
"$",
"atts",
",",
"$",
"content",
"=",
"null",
",",
"$",
"tag",
"=",
"null",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"tag",
")",
")",
"{",
"$",
"tag",
"=",
"$",
"this",
"->",
"get_tag",
"(",
")",
... | Callback that outputs the shortcode.
@param array $atts The shortcode's attributes.
@param string|null $content (Optional) Content enclosed in shortcode.
@param string|null $tag (Optional) Shortcode tag.
@return string The rendered shortcode.
@uses \apply_filters() | [
"Callback",
"that",
"outputs",
"the",
"shortcode",
"."
] | 1a98cd15e37595a85b242242f88fee38c4e36acc | https://github.com/goblindegook/Syllables/blob/1a98cd15e37595a85b242242f88fee38c4e36acc/src/Shortcode.php#L91-L108 |
15,655 | goblindegook/Syllables | src/Shortcode.php | Shortcode.render | public function render( $atts, $content = null, $tag = null ) {
if ( is_callable( $this->callback ) ) {
$content = call_user_func( $this->callback, $atts, $content, $tag );
}
/**
* Filters the shortcode content.
*
* @param string $content This shortcode's rendered content.
* @param array $atts... | php | public function render( $atts, $content = null, $tag = null ) {
if ( is_callable( $this->callback ) ) {
$content = call_user_func( $this->callback, $atts, $content, $tag );
}
/**
* Filters the shortcode content.
*
* @param string $content This shortcode's rendered content.
* @param array $atts... | [
"public",
"function",
"render",
"(",
"$",
"atts",
",",
"$",
"content",
"=",
"null",
",",
"$",
"tag",
"=",
"null",
")",
"{",
"if",
"(",
"is_callable",
"(",
"$",
"this",
"->",
"callback",
")",
")",
"{",
"$",
"content",
"=",
"call_user_func",
"(",
"$"... | Renders the hooked shortcode.
@param array $atts The shortcode's attributes.
@param string|null $content (Optional) Content enclosed in shortcode.
@param string|null $tag (Optional) Shortcode tag.
@return string The rendered shortcode.
@uses \apply_filters() | [
"Renders",
"the",
"hooked",
"shortcode",
"."
] | 1a98cd15e37595a85b242242f88fee38c4e36acc | https://github.com/goblindegook/Syllables/blob/1a98cd15e37595a85b242242f88fee38c4e36acc/src/Shortcode.php#L120-L137 |
15,656 | contao-bootstrap/buttons | src/Netzmacht/Bootstrap/Buttons/Button.php | Button.generate | public function generate()
{
return sprintf(
'<%s %s>%s</%s>%s',
$this->tag,
parent::generate(),
$this->label,
$this->tag,
PHP_EOL
);
} | php | public function generate()
{
return sprintf(
'<%s %s>%s</%s>%s',
$this->tag,
parent::generate(),
$this->label,
$this->tag,
PHP_EOL
);
} | [
"public",
"function",
"generate",
"(",
")",
"{",
"return",
"sprintf",
"(",
"'<%s %s>%s</%s>%s'",
",",
"$",
"this",
"->",
"tag",
",",
"parent",
"::",
"generate",
"(",
")",
",",
"$",
"this",
"->",
"label",
",",
"$",
"this",
"->",
"tag",
",",
"PHP_EOL",
... | Generate the button.
@return string | [
"Generate",
"the",
"button",
"."
] | f573a24c19ec059aae528a12ba46dfc993844201 | https://github.com/contao-bootstrap/buttons/blob/f573a24c19ec059aae528a12ba46dfc993844201/src/Netzmacht/Bootstrap/Buttons/Button.php#L106-L116 |
15,657 | baleen/cli | src/CommandBus/Config/InitHandler.php | InitHandler.handle | public function handle(InitMessage $message)
{
$output = $message->getOutput();
$configStorage = $message->getConfigStorage();
if ($configStorage->isInitialized($message->getConfig())) {
$output->writeln(sprintf(
'%s is already initialised!',
$mes... | php | public function handle(InitMessage $message)
{
$output = $message->getOutput();
$configStorage = $message->getConfigStorage();
if ($configStorage->isInitialized($message->getConfig())) {
$output->writeln(sprintf(
'%s is already initialised!',
$mes... | [
"public",
"function",
"handle",
"(",
"InitMessage",
"$",
"message",
")",
"{",
"$",
"output",
"=",
"$",
"message",
"->",
"getOutput",
"(",
")",
";",
"$",
"configStorage",
"=",
"$",
"message",
"->",
"getConfigStorage",
"(",
")",
";",
"if",
"(",
"$",
"con... | Handle an InitMessage. Creates an end-user configuration file using default values. If the file already exists
it simply exists without doing anything.
@param InitMessage $message | [
"Handle",
"an",
"InitMessage",
".",
"Creates",
"an",
"end",
"-",
"user",
"configuration",
"file",
"using",
"default",
"values",
".",
"If",
"the",
"file",
"already",
"exists",
"it",
"simply",
"exists",
"without",
"doing",
"anything",
"."
] | 2ecbc7179c5800c9075fd93204ef25da375536ed | https://github.com/baleen/cli/blob/2ecbc7179c5800c9075fd93204ef25da375536ed/src/CommandBus/Config/InitHandler.php#L36-L62 |
15,658 | pageon/SlackWebhookMonolog | src/Slack/Payload.php | Payload.setIcon | private function setIcon()
{
if (!$this->slackConfig->getCustomUser()->hasIcon()) {
return;
}
$iconType = 'icon_' . $this->slackConfig->getCustomUser()->getIcon()->getType();
$this->payload[$iconType] = $this->slackConfig->getCustomUser()->getIcon();
} | php | private function setIcon()
{
if (!$this->slackConfig->getCustomUser()->hasIcon()) {
return;
}
$iconType = 'icon_' . $this->slackConfig->getCustomUser()->getIcon()->getType();
$this->payload[$iconType] = $this->slackConfig->getCustomUser()->getIcon();
} | [
"private",
"function",
"setIcon",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"slackConfig",
"->",
"getCustomUser",
"(",
")",
"->",
"hasIcon",
"(",
")",
")",
"{",
"return",
";",
"}",
"$",
"iconType",
"=",
"'icon_'",
".",
"$",
"this",
"->",
"s... | Set a custom icon if available. | [
"Set",
"a",
"custom",
"icon",
"if",
"available",
"."
] | 6755060ddd6429620fd4c7decbb95f05463fc36b | https://github.com/pageon/SlackWebhookMonolog/blob/6755060ddd6429620fd4c7decbb95f05463fc36b/src/Slack/Payload.php#L93-L101 |
15,659 | pageon/SlackWebhookMonolog | src/Slack/Payload.php | Payload.setUsername | private function setUsername()
{
if (!$this->slackConfig->getCustomUser()->hasUsername()) {
return;
}
$this->payload['username'] = $this->slackConfig->getCustomUser()->getUsername();
} | php | private function setUsername()
{
if (!$this->slackConfig->getCustomUser()->hasUsername()) {
return;
}
$this->payload['username'] = $this->slackConfig->getCustomUser()->getUsername();
} | [
"private",
"function",
"setUsername",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"slackConfig",
"->",
"getCustomUser",
"(",
")",
"->",
"hasUsername",
"(",
")",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"payload",
"[",
"'username'",
"]",
... | Set a custom username if available. | [
"Set",
"a",
"custom",
"username",
"if",
"available",
"."
] | 6755060ddd6429620fd4c7decbb95f05463fc36b | https://github.com/pageon/SlackWebhookMonolog/blob/6755060ddd6429620fd4c7decbb95f05463fc36b/src/Slack/Payload.php#L106-L113 |
15,660 | pageon/SlackWebhookMonolog | src/Slack/Payload.php | Payload.setChannel | private function setChannel()
{
if (!$this->slackConfig->getWebhook()->hasCustomChannel()) {
return;
}
$this->payload['channel'] = $this->slackConfig->getWebhook()->getCustomChannel();
} | php | private function setChannel()
{
if (!$this->slackConfig->getWebhook()->hasCustomChannel()) {
return;
}
$this->payload['channel'] = $this->slackConfig->getWebhook()->getCustomChannel();
} | [
"private",
"function",
"setChannel",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"slackConfig",
"->",
"getWebhook",
"(",
")",
"->",
"hasCustomChannel",
"(",
")",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"payload",
"[",
"'channel'",
"]",
... | Set a custom channel if available. | [
"Set",
"a",
"custom",
"channel",
"if",
"available",
"."
] | 6755060ddd6429620fd4c7decbb95f05463fc36b | https://github.com/pageon/SlackWebhookMonolog/blob/6755060ddd6429620fd4c7decbb95f05463fc36b/src/Slack/Payload.php#L118-L125 |
15,661 | pageon/SlackWebhookMonolog | src/Slack/Payload.php | Payload.setErrorData | private function setErrorData()
{
if (!isset($this->record['context']['error'])) {
return;
}
$this->errorData = $this->record['context']['error'];
// remove the error from the context so we can use it for for other things.
unset($this->record['context']['error']... | php | private function setErrorData()
{
if (!isset($this->record['context']['error'])) {
return;
}
$this->errorData = $this->record['context']['error'];
// remove the error from the context so we can use it for for other things.
unset($this->record['context']['error']... | [
"private",
"function",
"setErrorData",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"record",
"[",
"'context'",
"]",
"[",
"'error'",
"]",
")",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"errorData",
"=",
"$",
"this",
"->",
... | If available set the error data. | [
"If",
"available",
"set",
"the",
"error",
"data",
"."
] | 6755060ddd6429620fd4c7decbb95f05463fc36b | https://github.com/pageon/SlackWebhookMonolog/blob/6755060ddd6429620fd4c7decbb95f05463fc36b/src/Slack/Payload.php#L130-L140 |
15,662 | DeprecatedPackages/CodingStandard | src/ZenifyCodingStandard/Sniffs/Namespaces/UseDeclarationSniff.php | UseDeclarationSniff.shouldIgnoreUse | private function shouldIgnoreUse(PHP_CodeSniffer_File $file, $position) : bool
{
$tokens = $file->getTokens();
// Ignore USE keywords inside closures.
$next = $file->findNext(T_WHITESPACE, ($position + 1), NULL, TRUE);
if ($tokens[$next]['code'] === T_OPEN_PARENTHESIS) {
return TRUE;
}
// Ignore USE k... | php | private function shouldIgnoreUse(PHP_CodeSniffer_File $file, $position) : bool
{
$tokens = $file->getTokens();
// Ignore USE keywords inside closures.
$next = $file->findNext(T_WHITESPACE, ($position + 1), NULL, TRUE);
if ($tokens[$next]['code'] === T_OPEN_PARENTHESIS) {
return TRUE;
}
// Ignore USE k... | [
"private",
"function",
"shouldIgnoreUse",
"(",
"PHP_CodeSniffer_File",
"$",
"file",
",",
"$",
"position",
")",
":",
"bool",
"{",
"$",
"tokens",
"=",
"$",
"file",
"->",
"getTokens",
"(",
")",
";",
"// Ignore USE keywords inside closures.",
"$",
"next",
"=",
"$"... | Check if this use statement is part of the namespace block.
@param PHP_CodeSniffer_File $file
@param int|bool $position | [
"Check",
"if",
"this",
"use",
"statement",
"is",
"part",
"of",
"the",
"namespace",
"block",
"."
] | 071a296bca199c8b7341e7c9e2f20f33d81b230e | https://github.com/DeprecatedPackages/CodingStandard/blob/071a296bca199c8b7341e7c9e2f20f33d81b230e/src/ZenifyCodingStandard/Sniffs/Namespaces/UseDeclarationSniff.php#L84-L100 |
15,663 | phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/LoginLogQuery.php | LoginLogQuery.filterByClientAddress | public function filterByClientAddress($clientAddress = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($clientAddress)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $clientAddress)) {
$clientAddress = str_replace(... | php | public function filterByClientAddress($clientAddress = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($clientAddress)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $clientAddress)) {
$clientAddress = str_replace(... | [
"public",
"function",
"filterByClientAddress",
"(",
"$",
"clientAddress",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"clientAddress",
")",
")",
"{",
... | Filter the query on the client_address column
Example usage:
<code>
$query->filterByClientAddress('fooValue'); // WHERE client_address = 'fooValue'
$query->filterByClientAddress('%fooValue%'); // WHERE client_address LIKE '%fooValue%'
</code>
@param string $clientAddress The value to use as filter.
Accepts wild... | [
"Filter",
"the",
"query",
"on",
"the",
"client_address",
"column"
] | 3424a360c9bded71eb5b570bc114a7759cb23ec6 | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/LoginLogQuery.php#L467-L479 |
15,664 | phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/LoginLogQuery.php | LoginLogQuery.filterByClientIp | public function filterByClientIp($clientIp = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($clientIp)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $clientIp)) {
$clientIp = str_replace('*', '%', $clientIp);
... | php | public function filterByClientIp($clientIp = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($clientIp)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $clientIp)) {
$clientIp = str_replace('*', '%', $clientIp);
... | [
"public",
"function",
"filterByClientIp",
"(",
"$",
"clientIp",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"clientIp",
")",
")",
"{",
"$",
"compa... | Filter the query on the client_ip column
Example usage:
<code>
$query->filterByClientIp('fooValue'); // WHERE client_ip = 'fooValue'
$query->filterByClientIp('%fooValue%'); // WHERE client_ip LIKE '%fooValue%'
</code>
@param string $clientIp The value to use as filter.
Accepts wildcards (* and % trigger a LIKE)... | [
"Filter",
"the",
"query",
"on",
"the",
"client_ip",
"column"
] | 3424a360c9bded71eb5b570bc114a7759cb23ec6 | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/LoginLogQuery.php#L496-L508 |
15,665 | withfatpanda/illuminate-wordpress | src/WordPress/Models/PostBuilder.php | PostBuilder.with | function with($meta, $operator = null, $value = null)
{
list($value, $operator) = $this->prepareValueAndOperator(
$value, $operator, func_num_args() == 2
);
static $count;
if (empty($count)) {
$count = 0;
}
if (!is_array($meta)) {
$meta = [ $meta => $value ];
}
foreach($meta as $key =>... | php | function with($meta, $operator = null, $value = null)
{
list($value, $operator) = $this->prepareValueAndOperator(
$value, $operator, func_num_args() == 2
);
static $count;
if (empty($count)) {
$count = 0;
}
if (!is_array($meta)) {
$meta = [ $meta => $value ];
}
foreach($meta as $key =>... | [
"function",
"with",
"(",
"$",
"meta",
",",
"$",
"operator",
"=",
"null",
",",
"$",
"value",
"=",
"null",
")",
"{",
"list",
"(",
"$",
"value",
",",
"$",
"operator",
")",
"=",
"$",
"this",
"->",
"prepareValueAndOperator",
"(",
"$",
"value",
",",
"$",... | Add one or more meta data conditions to the query. | [
"Add",
"one",
"or",
"more",
"meta",
"data",
"conditions",
"to",
"the",
"query",
"."
] | b426ca81a55367459430c974932ee5a941d759d8 | https://github.com/withfatpanda/illuminate-wordpress/blob/b426ca81a55367459430c974932ee5a941d759d8/src/WordPress/Models/PostBuilder.php#L11-L35 |
15,666 | CalderaWP/magic-tags | src/magictag.php | magictag.do_magic_tag | public function do_magic_tag($content){
// check for magics
preg_match_all("/\{(.+?)\}/", (string) $content, $magics);
// on found tags
if(!empty($magics[1])){
foreach($magics[1] as $magic_key=>$magic_tag){
$params = explode(':', $magic_tag, 2 );
if( empty( $params[1] ) ){ continue; }
// filt... | php | public function do_magic_tag($content){
// check for magics
preg_match_all("/\{(.+?)\}/", (string) $content, $magics);
// on found tags
if(!empty($magics[1])){
foreach($magics[1] as $magic_key=>$magic_tag){
$params = explode(':', $magic_tag, 2 );
if( empty( $params[1] ) ){ continue; }
// filt... | [
"public",
"function",
"do_magic_tag",
"(",
"$",
"content",
")",
"{",
"// check for magics",
"preg_match_all",
"(",
"\"/\\{(.+?)\\}/\"",
",",
"(",
"string",
")",
"$",
"content",
",",
"$",
"magics",
")",
";",
"// on found tags",
"if",
"(",
"!",
"empty",
"(",
"... | Renders a magic tag
@return string converted string with matched tags replaced | [
"Renders",
"a",
"magic",
"tag"
] | 0e46a6d187bff87c027ed8a6a9e09446aa5f3bd9 | https://github.com/CalderaWP/magic-tags/blob/0e46a6d187bff87c027ed8a6a9e09446aa5f3bd9/src/magictag.php#L48-L71 |
15,667 | CalderaWP/magic-tags | src/magictag.php | magictag.get_post_value | private function get_post_value( $field, $in_params, $post ){
if( !is_object( $post ) ){
return $in_params;
}
if ( 'permalink' == $field || 'post_permalink' == $field ) {
return esc_url( get_permalink( $post->ID ) );
}
//handle auto-generated and <!--more--> tag excerpts @since 1.1.0
if ( 'post_... | php | private function get_post_value( $field, $in_params, $post ){
if( !is_object( $post ) ){
return $in_params;
}
if ( 'permalink' == $field || 'post_permalink' == $field ) {
return esc_url( get_permalink( $post->ID ) );
}
//handle auto-generated and <!--more--> tag excerpts @since 1.1.0
if ( 'post_... | [
"private",
"function",
"get_post_value",
"(",
"$",
"field",
",",
"$",
"in_params",
",",
"$",
"post",
")",
"{",
"if",
"(",
"!",
"is_object",
"(",
"$",
"post",
")",
")",
"{",
"return",
"$",
"in_params",
";",
"}",
"if",
"(",
"'permalink'",
"==",
"$",
... | Gets a posts meta value
@since 0.0.1
@return string post field value | [
"Gets",
"a",
"posts",
"meta",
"value"
] | 0e46a6d187bff87c027ed8a6a9e09446aa5f3bd9 | https://github.com/CalderaWP/magic-tags/blob/0e46a6d187bff87c027ed8a6a9e09446aa5f3bd9/src/magictag.php#L80-L123 |
15,668 | withfatpanda/illuminate-wordpress | src/WordPress/Models/FieldGroup.php | FieldGroup.buildConfig | function buildConfig(Plugin $plugin)
{
if (!empty($this->fields)) {
$this->config['fields'] = [];
foreach($this->fields as $field) {
$this->config['fields'][] = $field->buildConfig($plugin);
}
}
if (!is_null($this->id)) {
$this->config['id'] = $this->id;
}
return ... | php | function buildConfig(Plugin $plugin)
{
if (!empty($this->fields)) {
$this->config['fields'] = [];
foreach($this->fields as $field) {
$this->config['fields'][] = $field->buildConfig($plugin);
}
}
if (!is_null($this->id)) {
$this->config['id'] = $this->id;
}
return ... | [
"function",
"buildConfig",
"(",
"Plugin",
"$",
"plugin",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"fields",
")",
")",
"{",
"$",
"this",
"->",
"config",
"[",
"'fields'",
"]",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",... | Build field group config
@return array | [
"Build",
"field",
"group",
"config"
] | b426ca81a55367459430c974932ee5a941d759d8 | https://github.com/withfatpanda/illuminate-wordpress/blob/b426ca81a55367459430c974932ee5a941d759d8/src/WordPress/Models/FieldGroup.php#L196-L210 |
15,669 | phramework/jsonapi | src/Controller/GET.php | GET.handleGET | protected static function handleGET(
$parameters,
$modelClass,
$primaryDataParameters = [],
$relationshipParameters = []
) {
$page = $modelClass::parsePage($parameters);
$filter = $modelClass::parseFilter($parameters);
$sort = $modelClass::parseSort($param... | php | protected static function handleGET(
$parameters,
$modelClass,
$primaryDataParameters = [],
$relationshipParameters = []
) {
$page = $modelClass::parsePage($parameters);
$filter = $modelClass::parseFilter($parameters);
$sort = $modelClass::parseSort($param... | [
"protected",
"static",
"function",
"handleGET",
"(",
"$",
"parameters",
",",
"$",
"modelClass",
",",
"$",
"primaryDataParameters",
"=",
"[",
"]",
",",
"$",
"relationshipParameters",
"=",
"[",
"]",
")",
"{",
"$",
"page",
"=",
"$",
"modelClass",
"::",
"parse... | handles GET requests
@param object $parameters Request parameters
@param string $modelClass Resource's primary model class name
to be used
@param array $primaryDataParameters *[Optional]* Array with any
additional arguments that the primary data is requiring
@param array $relationshi... | [
"handles",
"GET",
"requests"
] | af20882a8b6f6e5be9c8e09e5b87f6c23a4b0726 | https://github.com/phramework/jsonapi/blob/af20882a8b6f6e5be9c8e09e5b87f6c23a4b0726/src/Controller/GET.php#L59-L104 |
15,670 | jan-dolata/crude-crud | src/Engine/CrudeSetupTrait/ColumnFormat.php | ColumnFormat.setColumnFormat | public function setColumnFormat($attr, $format = null)
{
$formats = is_array($attr)
? $attr
: [$attr => $format];
foreach ($formats as $a => $f)
$this->_setSingleColumnFormat($a, $f);
return $this;
} | php | public function setColumnFormat($attr, $format = null)
{
$formats = is_array($attr)
? $attr
: [$attr => $format];
foreach ($formats as $a => $f)
$this->_setSingleColumnFormat($a, $f);
return $this;
} | [
"public",
"function",
"setColumnFormat",
"(",
"$",
"attr",
",",
"$",
"format",
"=",
"null",
")",
"{",
"$",
"formats",
"=",
"is_array",
"(",
"$",
"attr",
")",
"?",
"$",
"attr",
":",
"[",
"$",
"attr",
"=>",
"$",
"format",
"]",
";",
"foreach",
"(",
... | Sets the Column cell format rules.
@param array $columnFormat the column format
@return self | [
"Sets",
"the",
"Column",
"cell",
"format",
"rules",
"."
] | 9129ea08278835cf5cecfd46a90369226ae6bdd7 | https://github.com/jan-dolata/crude-crud/blob/9129ea08278835cf5cecfd46a90369226ae6bdd7/src/Engine/CrudeSetupTrait/ColumnFormat.php#L31-L41 |
15,671 | comelyio/comely | src/Comely/IO/Mailer/Agents/SMTP.php | SMTP.authCredentials | public function authCredentials(string $username, string $password): self
{
$this->username = $username;
$this->password = $password;
return $this;
} | php | public function authCredentials(string $username, string $password): self
{
$this->username = $username;
$this->password = $password;
return $this;
} | [
"public",
"function",
"authCredentials",
"(",
"string",
"$",
"username",
",",
"string",
"$",
"password",
")",
":",
"self",
"{",
"$",
"this",
"->",
"username",
"=",
"$",
"username",
";",
"$",
"this",
"->",
"password",
"=",
"$",
"password",
";",
"return",
... | Set auth. credentials for AUTH LOGIN
@param string $username
@param string $password
@return SMTP | [
"Set",
"auth",
".",
"credentials",
"for",
"AUTH",
"LOGIN"
] | 561ea7aef36fea347a1a79d3ee5597d4057ddf82 | https://github.com/comelyio/comely/blob/561ea7aef36fea347a1a79d3ee5597d4057ddf82/src/Comely/IO/Mailer/Agents/SMTP.php#L112-L117 |
15,672 | comelyio/comely | src/Comely/IO/Mailer/Agents/SMTP.php | SMTP.connect | private function connect()
{
if (!$this->stream) {
$errorNum = 0;
$errorMsg = "";
$context = @stream_context_create($this->streamOptions);
$this->stream = @stream_socket_client(
sprintf('%1$s:%2$d', $this->host, $this->port),
$e... | php | private function connect()
{
if (!$this->stream) {
$errorNum = 0;
$errorMsg = "";
$context = @stream_context_create($this->streamOptions);
$this->stream = @stream_socket_client(
sprintf('%1$s:%2$d', $this->host, $this->port),
$e... | [
"private",
"function",
"connect",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"stream",
")",
"{",
"$",
"errorNum",
"=",
"0",
";",
"$",
"errorMsg",
"=",
"\"\"",
";",
"$",
"context",
"=",
"@",
"stream_context_create",
"(",
"$",
"this",
"->",
"s... | Establish connection to SMTP server or revive existing one | [
"Establish",
"connection",
"to",
"SMTP",
"server",
"or",
"revive",
"existing",
"one"
] | 561ea7aef36fea347a1a79d3ee5597d4057ddf82 | https://github.com/comelyio/comely/blob/561ea7aef36fea347a1a79d3ee5597d4057ddf82/src/Comely/IO/Mailer/Agents/SMTP.php#L157-L229 |
15,673 | comelyio/comely | src/Comely/IO/Mailer/Agents/SMTP.php | SMTP.command | public function command(string $command, string $args = null, int $expect = 0): string
{
$sendCommand = $args ? sprintf('%1$s %2$s', $command, $args) : $command;
$this->write($sendCommand);
$response = $this->read();
$responseCode = $this->lastResponseCode();
if ($expect > 0... | php | public function command(string $command, string $args = null, int $expect = 0): string
{
$sendCommand = $args ? sprintf('%1$s %2$s', $command, $args) : $command;
$this->write($sendCommand);
$response = $this->read();
$responseCode = $this->lastResponseCode();
if ($expect > 0... | [
"public",
"function",
"command",
"(",
"string",
"$",
"command",
",",
"string",
"$",
"args",
"=",
"null",
",",
"int",
"$",
"expect",
"=",
"0",
")",
":",
"string",
"{",
"$",
"sendCommand",
"=",
"$",
"args",
"?",
"sprintf",
"(",
"'%1$s %2$s'",
",",
"$",... | Send command to server, read response, and make sure response code matches expected code
@param string $command
@param string|null $args
@param int $expect
@return string
@throws SMTPException | [
"Send",
"command",
"to",
"server",
"read",
"response",
"and",
"make",
"sure",
"response",
"code",
"matches",
"expected",
"code"
] | 561ea7aef36fea347a1a79d3ee5597d4057ddf82 | https://github.com/comelyio/comely/blob/561ea7aef36fea347a1a79d3ee5597d4057ddf82/src/Comely/IO/Mailer/Agents/SMTP.php#L283-L297 |
15,674 | comelyio/comely | src/Comely/IO/Mailer/Agents/SMTP.php | SMTP.read | private function read(): string
{
$this->lastResponse = fread($this->stream, 1024); // Read up to 1KB
$this->lastResponseCode = intval(explode(" ", $this->lastResponse)[0]);
$this->lastResponseCode = $this->lastResponseCode > 0 ? $this->lastResponseCode : -1;
return $this->lastRespon... | php | private function read(): string
{
$this->lastResponse = fread($this->stream, 1024); // Read up to 1KB
$this->lastResponseCode = intval(explode(" ", $this->lastResponse)[0]);
$this->lastResponseCode = $this->lastResponseCode > 0 ? $this->lastResponseCode : -1;
return $this->lastRespon... | [
"private",
"function",
"read",
"(",
")",
":",
"string",
"{",
"$",
"this",
"->",
"lastResponse",
"=",
"fread",
"(",
"$",
"this",
"->",
"stream",
",",
"1024",
")",
";",
"// Read up to 1KB",
"$",
"this",
"->",
"lastResponseCode",
"=",
"intval",
"(",
"explod... | Read response from SMTP server
@return string | [
"Read",
"response",
"from",
"SMTP",
"server"
] | 561ea7aef36fea347a1a79d3ee5597d4057ddf82 | https://github.com/comelyio/comely/blob/561ea7aef36fea347a1a79d3ee5597d4057ddf82/src/Comely/IO/Mailer/Agents/SMTP.php#L314-L320 |
15,675 | stubbles/stubbles-webapp-core | src/main/php/routing/Interceptors.php | Interceptors.executePreInterceptor | private function executePreInterceptor($preInterceptor, Request $request, Response $response)
{
if (is_callable($preInterceptor)) {
return $preInterceptor($request, $response);
}
if ($preInterceptor instanceof PreInterceptor) {
return $preInterceptor->preProcess($req... | php | private function executePreInterceptor($preInterceptor, Request $request, Response $response)
{
if (is_callable($preInterceptor)) {
return $preInterceptor($request, $response);
}
if ($preInterceptor instanceof PreInterceptor) {
return $preInterceptor->preProcess($req... | [
"private",
"function",
"executePreInterceptor",
"(",
"$",
"preInterceptor",
",",
"Request",
"$",
"request",
",",
"Response",
"$",
"response",
")",
"{",
"if",
"(",
"is_callable",
"(",
"$",
"preInterceptor",
")",
")",
"{",
"return",
"$",
"preInterceptor",
"(",
... | executes pre interceptor
@param mixed $preInterceptor
@param \stubbles\webapp\Request $request current request
@param \stubbles\webapp\Response $response response to send
@return bool|null | [
"executes",
"pre",
"interceptor"
] | 7705f129011a81d5cc3c76b4b150fab3dadac6a3 | https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Interceptors.php#L83-L105 |
15,676 | stubbles/stubbles-webapp-core | src/main/php/routing/Interceptors.php | Interceptors.executePostInterceptor | private function executePostInterceptor($postInterceptor, Request $request, Response $response)
{
if (is_callable($postInterceptor)) {
return $postInterceptor($request, $response);
}
if ($postInterceptor instanceof PostInterceptor) {
return $postInterceptor->postProc... | php | private function executePostInterceptor($postInterceptor, Request $request, Response $response)
{
if (is_callable($postInterceptor)) {
return $postInterceptor($request, $response);
}
if ($postInterceptor instanceof PostInterceptor) {
return $postInterceptor->postProc... | [
"private",
"function",
"executePostInterceptor",
"(",
"$",
"postInterceptor",
",",
"Request",
"$",
"request",
",",
"Response",
"$",
"response",
")",
"{",
"if",
"(",
"is_callable",
"(",
"$",
"postInterceptor",
")",
")",
"{",
"return",
"$",
"postInterceptor",
"(... | executes post interceptor
@param mixed $postInterceptor
@param \stubbles\webapp\Request $request current request
@param \stubbles\webapp\Response $response response to send
@return bool|null | [
"executes",
"post",
"interceptor"
] | 7705f129011a81d5cc3c76b4b150fab3dadac6a3 | https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Interceptors.php#L133-L155 |
15,677 | ekyna/GlsUniBox | Renderer/LabelRenderer.php | LabelRenderer.text | private function text($text, $size, $x, $y, $color = 'black', $font = 'swiss_normal', $angle = 0)
{
imagettftext($this->image, $size, $angle, $x, $y, $this->colors[$color], $this->fonts[$font], $text);
} | php | private function text($text, $size, $x, $y, $color = 'black', $font = 'swiss_normal', $angle = 0)
{
imagettftext($this->image, $size, $angle, $x, $y, $this->colors[$color], $this->fonts[$font], $text);
} | [
"private",
"function",
"text",
"(",
"$",
"text",
",",
"$",
"size",
",",
"$",
"x",
",",
"$",
"y",
",",
"$",
"color",
"=",
"'black'",
",",
"$",
"font",
"=",
"'swiss_normal'",
",",
"$",
"angle",
"=",
"0",
")",
"{",
"imagettftext",
"(",
"$",
"this",
... | Writes the given text.
@param string $text
@param int $size
@param int $x
@param int $y
@param string $color
@param string $font
@param int $angle | [
"Writes",
"the",
"given",
"text",
"."
] | b474271ba355c3917074422306dc64abf09584d0 | https://github.com/ekyna/GlsUniBox/blob/b474271ba355c3917074422306dc64abf09584d0/Renderer/LabelRenderer.php#L204-L207 |
15,678 | ekyna/GlsUniBox | Renderer/LabelRenderer.php | LabelRenderer.getImageData | private function getImageData()
{
ob_start();
imagegif($this->image);
$output = ob_get_contents();
ob_end_clean();
imagedestroy($this->image);
return $output;
} | php | private function getImageData()
{
ob_start();
imagegif($this->image);
$output = ob_get_contents();
ob_end_clean();
imagedestroy($this->image);
return $output;
} | [
"private",
"function",
"getImageData",
"(",
")",
"{",
"ob_start",
"(",
")",
";",
"imagegif",
"(",
"$",
"this",
"->",
"image",
")",
";",
"$",
"output",
"=",
"ob_get_contents",
"(",
")",
";",
"ob_end_clean",
"(",
")",
";",
"imagedestroy",
"(",
"$",
"this... | Returns the image raw data.
@return string | [
"Returns",
"the",
"image",
"raw",
"data",
"."
] | b474271ba355c3917074422306dc64abf09584d0 | https://github.com/ekyna/GlsUniBox/blob/b474271ba355c3917074422306dc64abf09584d0/Renderer/LabelRenderer.php#L214-L223 |
15,679 | ekyna/GlsUniBox | Renderer/LabelRenderer.php | LabelRenderer.getBarcodeDatamatrix | public function getBarcodeDatamatrix($data)
{
$barcode = new Barcode();
$bobj = $barcode->getBarcodeObj(
'DATAMATRIX',
$data,
256,
256,
'black',
array(0, 0, 0, 0)
)->setBackgroundColor('white');
return $bobj->g... | php | public function getBarcodeDatamatrix($data)
{
$barcode = new Barcode();
$bobj = $barcode->getBarcodeObj(
'DATAMATRIX',
$data,
256,
256,
'black',
array(0, 0, 0, 0)
)->setBackgroundColor('white');
return $bobj->g... | [
"public",
"function",
"getBarcodeDatamatrix",
"(",
"$",
"data",
")",
"{",
"$",
"barcode",
"=",
"new",
"Barcode",
"(",
")",
";",
"$",
"bobj",
"=",
"$",
"barcode",
"->",
"getBarcodeObj",
"(",
"'DATAMATRIX'",
",",
"$",
"data",
",",
"256",
",",
"256",
",",... | Returns the datamatrix from the given data.
@param string $data
@return string | [
"Returns",
"the",
"datamatrix",
"from",
"the",
"given",
"data",
"."
] | b474271ba355c3917074422306dc64abf09584d0 | https://github.com/ekyna/GlsUniBox/blob/b474271ba355c3917074422306dc64abf09584d0/Renderer/LabelRenderer.php#L232-L246 |
15,680 | ekyna/GlsUniBox | Renderer/LabelRenderer.php | LabelRenderer.getBarcode128 | public function getBarcode128($data)
{
$barcode = new Barcode();
$bobj = $barcode->getBarcodeObj(
'C128',
$data,
380,
135,
'black',
array(0, 0, 0, 0)
)->setBackgroundColor('white');
return $bobj->getPngData();
... | php | public function getBarcode128($data)
{
$barcode = new Barcode();
$bobj = $barcode->getBarcodeObj(
'C128',
$data,
380,
135,
'black',
array(0, 0, 0, 0)
)->setBackgroundColor('white');
return $bobj->getPngData();
... | [
"public",
"function",
"getBarcode128",
"(",
"$",
"data",
")",
"{",
"$",
"barcode",
"=",
"new",
"Barcode",
"(",
")",
";",
"$",
"bobj",
"=",
"$",
"barcode",
"->",
"getBarcodeObj",
"(",
"'C128'",
",",
"$",
"data",
",",
"380",
",",
"135",
",",
"'black'",... | Returns the barcode from the given data.
@param string $data
@return string | [
"Returns",
"the",
"barcode",
"from",
"the",
"given",
"data",
"."
] | b474271ba355c3917074422306dc64abf09584d0 | https://github.com/ekyna/GlsUniBox/blob/b474271ba355c3917074422306dc64abf09584d0/Renderer/LabelRenderer.php#L255-L269 |
15,681 | ray-di/Ray.WebFormModule | src/AuraInputInterceptor.php | AuraInputInterceptor.getNamedArguments | private function getNamedArguments(MethodInvocation $invocation)
{
$submit = [];
$params = $invocation->getMethod()->getParameters();
$args = $invocation->getArguments()->getArrayCopy();
foreach ($params as $param) {
$arg = array_shift($args);
$submit[$param->... | php | private function getNamedArguments(MethodInvocation $invocation)
{
$submit = [];
$params = $invocation->getMethod()->getParameters();
$args = $invocation->getArguments()->getArrayCopy();
foreach ($params as $param) {
$arg = array_shift($args);
$submit[$param->... | [
"private",
"function",
"getNamedArguments",
"(",
"MethodInvocation",
"$",
"invocation",
")",
"{",
"$",
"submit",
"=",
"[",
"]",
";",
"$",
"params",
"=",
"$",
"invocation",
"->",
"getMethod",
"(",
")",
"->",
"getParameters",
"(",
")",
";",
"$",
"args",
"=... | Return arguments as named arguments.
@param MethodInvocation $invocation
@return array | [
"Return",
"arguments",
"as",
"named",
"arguments",
"."
] | 4b6d33adb4a5c285278a068f3e7a5afdc4e680d9 | https://github.com/ray-di/Ray.WebFormModule/blob/4b6d33adb4a5c285278a068f3e7a5afdc4e680d9/src/AuraInputInterceptor.php#L83-L98 |
15,682 | ray-di/Ray.WebFormModule | src/AuraInputInterceptor.php | AuraInputInterceptor.getFormProperty | private function getFormProperty(AbstractValidation $formValidation, $object)
{
if (! property_exists($object, $formValidation->form)) {
throw new InvalidFormPropertyException($formValidation->form);
}
$prop = (new \ReflectionClass($object))->getProperty($formValidation->form);
... | php | private function getFormProperty(AbstractValidation $formValidation, $object)
{
if (! property_exists($object, $formValidation->form)) {
throw new InvalidFormPropertyException($formValidation->form);
}
$prop = (new \ReflectionClass($object))->getProperty($formValidation->form);
... | [
"private",
"function",
"getFormProperty",
"(",
"AbstractValidation",
"$",
"formValidation",
",",
"$",
"object",
")",
"{",
"if",
"(",
"!",
"property_exists",
"(",
"$",
"object",
",",
"$",
"formValidation",
"->",
"form",
")",
")",
"{",
"throw",
"new",
"Invalid... | Return form property
@param AbstractValidation $formValidation
@param object $object
@return mixed | [
"Return",
"form",
"property"
] | 4b6d33adb4a5c285278a068f3e7a5afdc4e680d9 | https://github.com/ray-di/Ray.WebFormModule/blob/4b6d33adb4a5c285278a068f3e7a5afdc4e680d9/src/AuraInputInterceptor.php#L108-L121 |
15,683 | DevGroup-ru/yii2-intent-analytics | src/models/Visitor.php | Visitor.hasUserId | public function hasUserId()
{
if (Yii::$app->user->isGuest) {
return $this->user_id !== 0;
}
return $this->user_id == Yii::$app->user->identity->getId();
} | php | public function hasUserId()
{
if (Yii::$app->user->isGuest) {
return $this->user_id !== 0;
}
return $this->user_id == Yii::$app->user->identity->getId();
} | [
"public",
"function",
"hasUserId",
"(",
")",
"{",
"if",
"(",
"Yii",
"::",
"$",
"app",
"->",
"user",
"->",
"isGuest",
")",
"{",
"return",
"$",
"this",
"->",
"user_id",
"!==",
"0",
";",
"}",
"return",
"$",
"this",
"->",
"user_id",
"==",
"Yii",
"::",
... | Detect is visitor connected with User
@return bool | [
"Detect",
"is",
"visitor",
"connected",
"with",
"User"
] | 53937d44df8c73dca402cc7351b018e6758c3af6 | https://github.com/DevGroup-ru/yii2-intent-analytics/blob/53937d44df8c73dca402cc7351b018e6758c3af6/src/models/Visitor.php#L165-L171 |
15,684 | keiosweb/moneyright | src/Math.php | Math.bcRoundHalfUp | final private static function bcRoundHalfUp($number, $precision)
{
return self::truncate(bcadd($number, self::getHalfUpValue($number, $precision), $precision + 1), $precision);
} | php | final private static function bcRoundHalfUp($number, $precision)
{
return self::truncate(bcadd($number, self::getHalfUpValue($number, $precision), $precision + 1), $precision);
} | [
"final",
"private",
"static",
"function",
"bcRoundHalfUp",
"(",
"$",
"number",
",",
"$",
"precision",
")",
"{",
"return",
"self",
"::",
"truncate",
"(",
"bcadd",
"(",
"$",
"number",
",",
"self",
"::",
"getHalfUpValue",
"(",
"$",
"number",
",",
"$",
"prec... | Round decimals from 5 up, less than 5 down
@param $number
@param $precision
@return string | [
"Round",
"decimals",
"from",
"5",
"up",
"less",
"than",
"5",
"down"
] | 6c6d8ce34e37e42aa1eebbf45a949bbae6b44780 | https://github.com/keiosweb/moneyright/blob/6c6d8ce34e37e42aa1eebbf45a949bbae6b44780/src/Math.php#L216-L219 |
15,685 | ARCANEDEV/SpamBlocker | src/SpamBlockerServiceProvider.php | SpamBlockerServiceProvider.registerSpamBlocker | private function registerSpamBlocker()
{
$this->singleton(Contracts\SpamBlocker::class, function ($app) {
/** @var \Illuminate\Contracts\Config\Repository $config */
$config = $app['config'];
return new SpamBlocker(
$config->get('spam-blocker')
... | php | private function registerSpamBlocker()
{
$this->singleton(Contracts\SpamBlocker::class, function ($app) {
/** @var \Illuminate\Contracts\Config\Repository $config */
$config = $app['config'];
return new SpamBlocker(
$config->get('spam-blocker')
... | [
"private",
"function",
"registerSpamBlocker",
"(",
")",
"{",
"$",
"this",
"->",
"singleton",
"(",
"Contracts",
"\\",
"SpamBlocker",
"::",
"class",
",",
"function",
"(",
"$",
"app",
")",
"{",
"/** @var \\Illuminate\\Contracts\\Config\\Repository $config */",
"$",
"... | Register the spam blocker | [
"Register",
"the",
"spam",
"blocker"
] | 708c9d5363616e0b257451256c4ca9fb9a9ff55f | https://github.com/ARCANEDEV/SpamBlocker/blob/708c9d5363616e0b257451256c4ca9fb9a9ff55f/src/SpamBlockerServiceProvider.php#L72-L82 |
15,686 | tonicospinelli/class-generation | src/ClassGeneration/DocBlock/Tag.php | Tag.createFromArgument | public static function createFromArgument(ArgumentInterface $argument)
{
$tag = new self();
$tag
->setName(self::TAG_PARAM)
->setType($argument->getType())
->setVariable($argument->getName())
->setDescription($argument->getDescription())
->... | php | public static function createFromArgument(ArgumentInterface $argument)
{
$tag = new self();
$tag
->setName(self::TAG_PARAM)
->setType($argument->getType())
->setVariable($argument->getName())
->setDescription($argument->getDescription())
->... | [
"public",
"static",
"function",
"createFromArgument",
"(",
"ArgumentInterface",
"$",
"argument",
")",
"{",
"$",
"tag",
"=",
"new",
"self",
"(",
")",
";",
"$",
"tag",
"->",
"setName",
"(",
"self",
"::",
"TAG_PARAM",
")",
"->",
"setType",
"(",
"$",
"argume... | Creating a Tag from an Argument Object.
@param ArgumentInterface $argument
@return TagInterface | [
"Creating",
"a",
"Tag",
"from",
"an",
"Argument",
"Object",
"."
] | eee63bdb68c066b25b885b57b23656e809381a76 | https://github.com/tonicospinelli/class-generation/blob/eee63bdb68c066b25b885b57b23656e809381a76/src/ClassGeneration/DocBlock/Tag.php#L229-L240 |
15,687 | tonicospinelli/class-generation | src/ClassGeneration/DocBlock/Tag.php | Tag.createFromProperty | public static function createFromProperty(PropertyInterface $property)
{
$tag = new self();
$tag->setName(self::TAG_VAR);
$tag->setType($property->getType());
return $tag;
} | php | public static function createFromProperty(PropertyInterface $property)
{
$tag = new self();
$tag->setName(self::TAG_VAR);
$tag->setType($property->getType());
return $tag;
} | [
"public",
"static",
"function",
"createFromProperty",
"(",
"PropertyInterface",
"$",
"property",
")",
"{",
"$",
"tag",
"=",
"new",
"self",
"(",
")",
";",
"$",
"tag",
"->",
"setName",
"(",
"self",
"::",
"TAG_VAR",
")",
";",
"$",
"tag",
"->",
"setType",
... | Create var tag from property.
@param PropertyInterface $property
@return Tag | [
"Create",
"var",
"tag",
"from",
"property",
"."
] | eee63bdb68c066b25b885b57b23656e809381a76 | https://github.com/tonicospinelli/class-generation/blob/eee63bdb68c066b25b885b57b23656e809381a76/src/ClassGeneration/DocBlock/Tag.php#L249-L256 |
15,688 | FrenchFrogs/framework | src/Core/Configurator.php | Configurator.build | public function build($index, $default = null, $params = [])
{
$class = $this->get($index, $default);
if (!class_exists($class)) {
throw new \Exception('Class doesn\'t exist for the index : ' .$index);
}
$class = new \ReflectionClass($class);
return $class->newIn... | php | public function build($index, $default = null, $params = [])
{
$class = $this->get($index, $default);
if (!class_exists($class)) {
throw new \Exception('Class doesn\'t exist for the index : ' .$index);
}
$class = new \ReflectionClass($class);
return $class->newIn... | [
"public",
"function",
"build",
"(",
"$",
"index",
",",
"$",
"default",
"=",
"null",
",",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"$",
"class",
"=",
"$",
"this",
"->",
"get",
"(",
"$",
"index",
",",
"$",
"default",
")",
";",
"if",
"(",
"!",
"c... | Return an instantiated object
@param $index
@param null $default
@param array $params
@return object
@throws \Exception | [
"Return",
"an",
"instantiated",
"object"
] | a4838c698a5600437e87dac6d35ba8ebe32c4395 | https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Core/Configurator.php#L134-L143 |
15,689 | jenky/laravel-api-helper | src/Factory.php | Factory.parseBuilder | protected function parseBuilder($builder)
{
if ($builder instanceof EloquentBuilder) {
return $this->createHandler($builder->getQuery(), $builder);
}
if (is_subclass_of($builder, Model::class)) {
return $this->createHandler($builder->getQuery(), $builder->newQuery());... | php | protected function parseBuilder($builder)
{
if ($builder instanceof EloquentBuilder) {
return $this->createHandler($builder->getQuery(), $builder);
}
if (is_subclass_of($builder, Model::class)) {
return $this->createHandler($builder->getQuery(), $builder->newQuery());... | [
"protected",
"function",
"parseBuilder",
"(",
"$",
"builder",
")",
"{",
"if",
"(",
"$",
"builder",
"instanceof",
"EloquentBuilder",
")",
"{",
"return",
"$",
"this",
"->",
"createHandler",
"(",
"$",
"builder",
"->",
"getQuery",
"(",
")",
",",
"$",
"builder"... | Parse the builder.
@param mixed $builder | [
"Parse",
"the",
"builder",
"."
] | 9af8f4d99d96ed3ea1bee7eabcdb0472f1bfa367 | https://github.com/jenky/laravel-api-helper/blob/9af8f4d99d96ed3ea1bee7eabcdb0472f1bfa367/src/Factory.php#L47-L58 |
15,690 | jenky/laravel-api-helper | src/Factory.php | Factory.createHandler | protected function createHandler($query, $builder = null)
{
$handler = new Handler($this->request, $this->config);
$handler->setQuery($query);
if (! is_null($builder)) {
$handler->setBuilder($builder);
}
return $handler;
} | php | protected function createHandler($query, $builder = null)
{
$handler = new Handler($this->request, $this->config);
$handler->setQuery($query);
if (! is_null($builder)) {
$handler->setBuilder($builder);
}
return $handler;
} | [
"protected",
"function",
"createHandler",
"(",
"$",
"query",
",",
"$",
"builder",
"=",
"null",
")",
"{",
"$",
"handler",
"=",
"new",
"Handler",
"(",
"$",
"this",
"->",
"request",
",",
"$",
"this",
"->",
"config",
")",
";",
"$",
"handler",
"->",
"setQ... | Create the handler.
@param mixed $query
@param mixed $builder
@return \Jenky\LaravelApiHelper\Handler | [
"Create",
"the",
"handler",
"."
] | 9af8f4d99d96ed3ea1bee7eabcdb0472f1bfa367 | https://github.com/jenky/laravel-api-helper/blob/9af8f4d99d96ed3ea1bee7eabcdb0472f1bfa367/src/Factory.php#L68-L79 |
15,691 | heyday/heystack | src/Input/Handler.php | Handler.process | public function process($identifier, \SS_HTTPRequest $request)
{
if ($this->hasProcessor($identifier)) {
return $this->processors[$identifier]->process($request);
} else {
return false;
}
} | php | public function process($identifier, \SS_HTTPRequest $request)
{
if ($this->hasProcessor($identifier)) {
return $this->processors[$identifier]->process($request);
} else {
return false;
}
} | [
"public",
"function",
"process",
"(",
"$",
"identifier",
",",
"\\",
"SS_HTTPRequest",
"$",
"request",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasProcessor",
"(",
"$",
"identifier",
")",
")",
"{",
"return",
"$",
"this",
"->",
"processors",
"[",
"$",
"i... | Process an input processor by identifier if it exists
@param string $identifier The identifier of the input processor
@param \SS_HTTPRequest $request The request object to process from
@return mixed | [
"Process",
"an",
"input",
"processor",
"by",
"identifier",
"if",
"it",
"exists"
] | 2c051933f8c532d0a9a23be6ee1ff5c619e47dfe | https://github.com/heyday/heystack/blob/2c051933f8c532d0a9a23be6ee1ff5c619e47dfe/src/Input/Handler.php#L41-L48 |
15,692 | link0/profiler | src/Link0/Profiler/PersistenceHandler/ZendDbHandler.php | ZendDbHandler.getTableStructure | private function getTableStructure()
{
return array(
'columns' => array(
// Unique auto-incrementing primary key
new BigInteger('id', false, null, array('auto_increment' => true, 'unsigned' => true)),
// Identifier column
new Varch... | php | private function getTableStructure()
{
return array(
'columns' => array(
// Unique auto-incrementing primary key
new BigInteger('id', false, null, array('auto_increment' => true, 'unsigned' => true)),
// Identifier column
new Varch... | [
"private",
"function",
"getTableStructure",
"(",
")",
"{",
"return",
"array",
"(",
"'columns'",
"=>",
"array",
"(",
"// Unique auto-incrementing primary key",
"new",
"BigInteger",
"(",
"'id'",
",",
"false",
",",
"null",
",",
"array",
"(",
"'auto_increment'",
"=>",... | Returns the table structure in Zend\Db\Column objects
@return array | [
"Returns",
"the",
"table",
"structure",
"in",
"Zend",
"\\",
"Db",
"\\",
"Column",
"objects"
] | 0573073ff029743734de747619ab65ab2476052d | https://github.com/link0/profiler/blob/0573073ff029743734de747619ab65ab2476052d/src/Link0/Profiler/PersistenceHandler/ZendDbHandler.php#L227-L246 |
15,693 | link0/profiler | src/Link0/Profiler/PersistenceHandler/ZendDbHandler.php | ZendDbHandler.createTable | public function createTable()
{
$sql = $this->getSql();
$createTable = new CreateTable($this->getTableName());
$tableStructure = $this->getTableStructure();
foreach($tableStructure['columns'] as $column) {
$createTable->addColumn($column);
}
foreach($ta... | php | public function createTable()
{
$sql = $this->getSql();
$createTable = new CreateTable($this->getTableName());
$tableStructure = $this->getTableStructure();
foreach($tableStructure['columns'] as $column) {
$createTable->addColumn($column);
}
foreach($ta... | [
"public",
"function",
"createTable",
"(",
")",
"{",
"$",
"sql",
"=",
"$",
"this",
"->",
"getSql",
"(",
")",
";",
"$",
"createTable",
"=",
"new",
"CreateTable",
"(",
"$",
"this",
"->",
"getTableName",
"(",
")",
")",
";",
"$",
"tableStructure",
"=",
"$... | Creates the table structure for you
NOTE: This code should fully work when ZendFramework 2.4.0 is released, since then DDL supports auto_increment
@see https://github.com/zendframework/zf2/pull/6257
@return PersistenceHandlerInterface | [
"Creates",
"the",
"table",
"structure",
"for",
"you"
] | 0573073ff029743734de747619ab65ab2476052d | https://github.com/link0/profiler/blob/0573073ff029743734de747619ab65ab2476052d/src/Link0/Profiler/PersistenceHandler/ZendDbHandler.php#L256-L277 |
15,694 | link0/profiler | src/Link0/Profiler/PersistenceHandler/ZendDbHandler.php | ZendDbHandler.dropTable | public function dropTable()
{
$sql = $this->getSql();
$dropTable = new DropTable($this->getTableName());
$sql->getAdapter()->query($sql->getSqlStringForSqlObject($dropTable),
Adapter::QUERY_MODE_EXECUTE
);
return $this;
} | php | public function dropTable()
{
$sql = $this->getSql();
$dropTable = new DropTable($this->getTableName());
$sql->getAdapter()->query($sql->getSqlStringForSqlObject($dropTable),
Adapter::QUERY_MODE_EXECUTE
);
return $this;
} | [
"public",
"function",
"dropTable",
"(",
")",
"{",
"$",
"sql",
"=",
"$",
"this",
"->",
"getSql",
"(",
")",
";",
"$",
"dropTable",
"=",
"new",
"DropTable",
"(",
"$",
"this",
"->",
"getTableName",
"(",
")",
")",
";",
"$",
"sql",
"->",
"getAdapter",
"(... | Drops the table structure for you
@return PersistenceHandlerInterface | [
"Drops",
"the",
"table",
"structure",
"for",
"you"
] | 0573073ff029743734de747619ab65ab2476052d | https://github.com/link0/profiler/blob/0573073ff029743734de747619ab65ab2476052d/src/Link0/Profiler/PersistenceHandler/ZendDbHandler.php#L284-L295 |
15,695 | Teamsisu/contao-mm-frontendInput | src/Teamsisu/MetaModelsFrontendInput/Handler/Save/SaveHandler.php | SaveHandler.parseWidget | public function parseWidget($widget)
{
if(is_a($widget, 'Contao\FormTextArea') || is_a($widget, 'Contao\FormTextField')){
if($this->field->getEval('allowHtml')){
$value = strip_tags(\String::decodeEntities($widget->value), \Config::get('allowedTags'));
}else{
... | php | public function parseWidget($widget)
{
if(is_a($widget, 'Contao\FormTextArea') || is_a($widget, 'Contao\FormTextField')){
if($this->field->getEval('allowHtml')){
$value = strip_tags(\String::decodeEntities($widget->value), \Config::get('allowedTags'));
}else{
... | [
"public",
"function",
"parseWidget",
"(",
"$",
"widget",
")",
"{",
"if",
"(",
"is_a",
"(",
"$",
"widget",
",",
"'Contao\\FormTextArea'",
")",
"||",
"is_a",
"(",
"$",
"widget",
",",
"'Contao\\FormTextField'",
")",
")",
"{",
"if",
"(",
"$",
"this",
"->",
... | This function is for the manipulation of the attribute value
Must return the value in the format what is needed for MetaModels
@param $widget
@return mixed | [
"This",
"function",
"is",
"for",
"the",
"manipulation",
"of",
"the",
"attribute",
"value",
"Must",
"return",
"the",
"value",
"in",
"the",
"format",
"what",
"is",
"needed",
"for",
"MetaModels"
] | ab92e61c24644f1e61265304b6a35e505007d021 | https://github.com/Teamsisu/contao-mm-frontendInput/blob/ab92e61c24644f1e61265304b6a35e505007d021/src/Teamsisu/MetaModelsFrontendInput/Handler/Save/SaveHandler.php#L61-L80 |
15,696 | Teamsisu/contao-mm-frontendInput | src/Teamsisu/MetaModelsFrontendInput/Handler/Save/SaveHandler.php | SaveHandler.setValue | public function setValue($value)
{
$this->item->set($this->field->getColName(), $this->field->mmAttribute->widgetToValue($value, null));
} | php | public function setValue($value)
{
$this->item->set($this->field->getColName(), $this->field->mmAttribute->widgetToValue($value, null));
} | [
"public",
"function",
"setValue",
"(",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"item",
"->",
"set",
"(",
"$",
"this",
"->",
"field",
"->",
"getColName",
"(",
")",
",",
"$",
"this",
"->",
"field",
"->",
"mmAttribute",
"->",
"widgetToValue",
"(",
"$... | Set the value of the Attribute from given MetaModels Item | [
"Set",
"the",
"value",
"of",
"the",
"Attribute",
"from",
"given",
"MetaModels",
"Item"
] | ab92e61c24644f1e61265304b6a35e505007d021 | https://github.com/Teamsisu/contao-mm-frontendInput/blob/ab92e61c24644f1e61265304b6a35e505007d021/src/Teamsisu/MetaModelsFrontendInput/Handler/Save/SaveHandler.php#L85-L88 |
15,697 | verschoof/bunq-api | src/HttpClientFactory.php | HttpClientFactory.createInstallationClient | public static function createInstallationClient($url, CertificateStorage $certificateStorage)
{
$handlerStack = HandlerStack::create();
$handlerStack->push(
Middleware::mapRequest(new RequestIdMiddleware())
);
$handlerStack->push(
Middleware::mapRequest(new Re... | php | public static function createInstallationClient($url, CertificateStorage $certificateStorage)
{
$handlerStack = HandlerStack::create();
$handlerStack->push(
Middleware::mapRequest(new RequestIdMiddleware())
);
$handlerStack->push(
Middleware::mapRequest(new Re... | [
"public",
"static",
"function",
"createInstallationClient",
"(",
"$",
"url",
",",
"CertificateStorage",
"$",
"certificateStorage",
")",
"{",
"$",
"handlerStack",
"=",
"HandlerStack",
"::",
"create",
"(",
")",
";",
"$",
"handlerStack",
"->",
"push",
"(",
"Middlew... | Creates an installation client
@param string $url
@param CertificateStorage $certificateStorage
@return ClientInterface | [
"Creates",
"an",
"installation",
"client"
] | df9aa19f384275f4f0deb26de0cb5e5f8b45ffcd | https://github.com/verschoof/bunq-api/blob/df9aa19f384275f4f0deb26de0cb5e5f8b45ffcd/src/HttpClientFactory.php#L29-L40 |
15,698 | verschoof/bunq-api | src/HttpClientFactory.php | HttpClientFactory.create | public static function create(
$url,
TokenService $tokenService,
CertificateStorage $certificateStorage,
InstallationService $installationService,
TokenStorage $tokenStorage
) {
$sessionToken = $tokenService->sessionToken();
$publicServerKey = $certificateS... | php | public static function create(
$url,
TokenService $tokenService,
CertificateStorage $certificateStorage,
InstallationService $installationService,
TokenStorage $tokenStorage
) {
$sessionToken = $tokenService->sessionToken();
$publicServerKey = $certificateS... | [
"public",
"static",
"function",
"create",
"(",
"$",
"url",
",",
"TokenService",
"$",
"tokenService",
",",
"CertificateStorage",
"$",
"certificateStorage",
",",
"InstallationService",
"$",
"installationService",
",",
"TokenStorage",
"$",
"tokenStorage",
")",
"{",
"$"... | Creates the HttpClient with all handlers
@param string $url
@param TokenService $tokenService
@param CertificateStorage $certificateStorage
@param InstallationService $installationService
@param TokenStorage $tokenStorage
@return ClientInterface | [
"Creates",
"the",
"HttpClient",
"with",
"all",
"handlers"
] | df9aa19f384275f4f0deb26de0cb5e5f8b45ffcd | https://github.com/verschoof/bunq-api/blob/df9aa19f384275f4f0deb26de0cb5e5f8b45ffcd/src/HttpClientFactory.php#L53-L83 |
15,699 | verschoof/bunq-api | src/HttpClientFactory.php | HttpClientFactory.createBaseClient | private static function createBaseClient($url, HandlerStack $handlerStack = null)
{
$httpClient = new \GuzzleHttp\Client(
[
'base_uri' => $url,
'handler' => $handlerStack,
'headers' => [
'Content-Type' => 'application/json',
... | php | private static function createBaseClient($url, HandlerStack $handlerStack = null)
{
$httpClient = new \GuzzleHttp\Client(
[
'base_uri' => $url,
'handler' => $handlerStack,
'headers' => [
'Content-Type' => 'application/json',
... | [
"private",
"static",
"function",
"createBaseClient",
"(",
"$",
"url",
",",
"HandlerStack",
"$",
"handlerStack",
"=",
"null",
")",
"{",
"$",
"httpClient",
"=",
"new",
"\\",
"GuzzleHttp",
"\\",
"Client",
"(",
"[",
"'base_uri'",
"=>",
"$",
"url",
",",
"'handl... | Returns the standard used headers.
@param string $url
@param HandlerStack|null $handlerStack
@return ClientInterface | [
"Returns",
"the",
"standard",
"used",
"headers",
"."
] | df9aa19f384275f4f0deb26de0cb5e5f8b45ffcd | https://github.com/verschoof/bunq-api/blob/df9aa19f384275f4f0deb26de0cb5e5f8b45ffcd/src/HttpClientFactory.php#L93-L107 |
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.