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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
203,200 | mullanaphy/variable | src/PHY/Variable/AVar.php | AVar.complete | public function complete()
{
$chain = $this->chain;
$this->chaining = false;
$this->chain = null;
return $chain;
} | php | public function complete()
{
$chain = $this->chain;
$this->chaining = false;
$this->chain = null;
return $chain;
} | [
"public",
"function",
"complete",
"(",
")",
"{",
"$",
"chain",
"=",
"$",
"this",
"->",
"chain",
";",
"$",
"this",
"->",
"chaining",
"=",
"false",
";",
"$",
"this",
"->",
"chain",
"=",
"null",
";",
"return",
"$",
"chain",
";",
"}"
] | Complete a chain and return it's result.
@return mixed | [
"Complete",
"a",
"chain",
"and",
"return",
"it",
"s",
"result",
"."
] | e4eb274a1799a25e33e5e21cd260603c74628031 | https://github.com/mullanaphy/variable/blob/e4eb274a1799a25e33e5e21cd260603c74628031/src/PHY/Variable/AVar.php#L84-L90 |
203,201 | mullanaphy/variable | src/PHY/Variable/AVar.php | AVar.update | public function update($value)
{
$this->validate($value);
if ($this->chaining) {
$this->chain = $value;
} else {
$this->current = $value;
}
return $this;
} | php | public function update($value)
{
$this->validate($value);
if ($this->chaining) {
$this->chain = $value;
} else {
$this->current = $value;
}
return $this;
} | [
"public",
"function",
"update",
"(",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"validate",
"(",
"$",
"value",
")",
";",
"if",
"(",
"$",
"this",
"->",
"chaining",
")",
"{",
"$",
"this",
"->",
"chain",
"=",
"$",
"value",
";",
"}",
"else",
"{",
"... | Update a value.
@param mixed $value
@return \PHY\Variable\AVar | [
"Update",
"a",
"value",
"."
] | e4eb274a1799a25e33e5e21cd260603c74628031 | https://github.com/mullanaphy/variable/blob/e4eb274a1799a25e33e5e21cd260603c74628031/src/PHY/Variable/AVar.php#L98-L107 |
203,202 | mullanaphy/variable | src/PHY/Variable/AVar.php | AVar.reset | public function reset()
{
$this->current = $this->original;
$this->chaining = false;
$this->chain = null;
return $this;
} | php | public function reset()
{
$this->current = $this->original;
$this->chaining = false;
$this->chain = null;
return $this;
} | [
"public",
"function",
"reset",
"(",
")",
"{",
"$",
"this",
"->",
"current",
"=",
"$",
"this",
"->",
"original",
";",
"$",
"this",
"->",
"chaining",
"=",
"false",
";",
"$",
"this",
"->",
"chain",
"=",
"null",
";",
"return",
"$",
"this",
";",
"}"
] | Reset the variable back to it's original value.
@return \PHY\Variable\AVar | [
"Reset",
"the",
"variable",
"back",
"to",
"it",
"s",
"original",
"value",
"."
] | e4eb274a1799a25e33e5e21cd260603c74628031 | https://github.com/mullanaphy/variable/blob/e4eb274a1799a25e33e5e21cd260603c74628031/src/PHY/Variable/AVar.php#L157-L163 |
203,203 | mullanaphy/variable | src/PHY/Variable/AVar.php | AVar.validate | public function validate($value)
{
if (!in_array(gettype($value), $this->types)) {
throw new Exception('Type of value "'.gettype($value)."' is not compatible with ".get_class($this));
}
} | php | public function validate($value)
{
if (!in_array(gettype($value), $this->types)) {
throw new Exception('Type of value "'.gettype($value)."' is not compatible with ".get_class($this));
}
} | [
"public",
"function",
"validate",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"gettype",
"(",
"$",
"value",
")",
",",
"$",
"this",
"->",
"types",
")",
")",
"{",
"throw",
"new",
"Exception",
"(",
"'Type of value \"'",
".",
"gettype",
... | Validate a variables type to make sure our class can use it.
@param string $value
@throws Exception | [
"Validate",
"a",
"variables",
"type",
"to",
"make",
"sure",
"our",
"class",
"can",
"use",
"it",
"."
] | e4eb274a1799a25e33e5e21cd260603c74628031 | https://github.com/mullanaphy/variable/blob/e4eb274a1799a25e33e5e21cd260603c74628031/src/PHY/Variable/AVar.php#L171-L176 |
203,204 | OpenConext/Stepup-bundle | src/Value/GssfConfig.php | GssfConfig.getLoaMap | public function getLoaMap()
{
$loaMap = [];
foreach ($this->config as $key => $config) {
if (array_key_exists('loa', $config)) {
$loaMap[$key] = $config['loa'];
}
}
return $loaMap;
} | php | public function getLoaMap()
{
$loaMap = [];
foreach ($this->config as $key => $config) {
if (array_key_exists('loa', $config)) {
$loaMap[$key] = $config['loa'];
}
}
return $loaMap;
} | [
"public",
"function",
"getLoaMap",
"(",
")",
"{",
"$",
"loaMap",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"config",
"as",
"$",
"key",
"=>",
"$",
"config",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"'loa'",
",",
"$",
"config",
")",... | Flattens the config and returns key value pairs where the key is the SF type and the value is the LOA level | [
"Flattens",
"the",
"config",
"and",
"returns",
"key",
"value",
"pairs",
"where",
"the",
"key",
"is",
"the",
"SF",
"type",
"and",
"the",
"value",
"is",
"the",
"LOA",
"level"
] | 94178ddb421889df9e068109293a8da880793ed2 | https://github.com/OpenConext/Stepup-bundle/blob/94178ddb421889df9e068109293a8da880793ed2/src/Value/GssfConfig.php#L48-L57 |
203,205 | PenoaksDev/Milky-Framework | src/Milky/Database/Eloquent/Nested/Generators/ModelGenerator.php | ModelGenerator.create | public function create( $name, $path )
{
$path = $this->getPath( $name, $path );
$stub = $this->getStub( 'model' );
$this->files->put( $path, $this->parseStub( $stub, [
'table' => $this->tableize( $name ),
'class' => $this->classify( $name )
] ) );
return $path;
} | php | public function create( $name, $path )
{
$path = $this->getPath( $name, $path );
$stub = $this->getStub( 'model' );
$this->files->put( $path, $this->parseStub( $stub, [
'table' => $this->tableize( $name ),
'class' => $this->classify( $name )
] ) );
return $path;
} | [
"public",
"function",
"create",
"(",
"$",
"name",
",",
"$",
"path",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"getPath",
"(",
"$",
"name",
",",
"$",
"path",
")",
";",
"$",
"stub",
"=",
"$",
"this",
"->",
"getStub",
"(",
"'model'",
")",
";"... | Create a new model at the given path.
@param string $name
@param string $path
@return string | [
"Create",
"a",
"new",
"model",
"at",
"the",
"given",
"path",
"."
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Database/Eloquent/Nested/Generators/ModelGenerator.php#L12-L24 |
203,206 | ScaraMVC/Framework | src/Scara/Validation/Errors.php | Errors.get | public function get($key)
{
$res = $this->_errors[$key];
if (!is_array($res)) {
return [$res];
}
return $res;
} | php | public function get($key)
{
$res = $this->_errors[$key];
if (!is_array($res)) {
return [$res];
}
return $res;
} | [
"public",
"function",
"get",
"(",
"$",
"key",
")",
"{",
"$",
"res",
"=",
"$",
"this",
"->",
"_errors",
"[",
"$",
"key",
"]",
";",
"if",
"(",
"!",
"is_array",
"(",
"$",
"res",
")",
")",
"{",
"return",
"[",
"$",
"res",
"]",
";",
"}",
"return",
... | Gets a specific error.
@param string $key - The error we're looking for
@return string - The error message | [
"Gets",
"a",
"specific",
"error",
"."
] | 199b08b45fadf5dae14ac4732af03b36e15bbef2 | https://github.com/ScaraMVC/Framework/blob/199b08b45fadf5dae14ac4732af03b36e15bbef2/src/Scara/Validation/Errors.php#L36-L44 |
203,207 | ScaraMVC/Framework | src/Scara/Validation/Errors.php | Errors.first | public function first($key)
{
if ($this->has($key)) {
$err = $this->_errors[$key];
if (is_array($err)) {
for ($i = 0; $i < count($err); $i++) {
if (!empty($err[$i])) {
return $err[$i];
}
}... | php | public function first($key)
{
if ($this->has($key)) {
$err = $this->_errors[$key];
if (is_array($err)) {
for ($i = 0; $i < count($err); $i++) {
if (!empty($err[$i])) {
return $err[$i];
}
}... | [
"public",
"function",
"first",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"has",
"(",
"$",
"key",
")",
")",
"{",
"$",
"err",
"=",
"$",
"this",
"->",
"_errors",
"[",
"$",
"key",
"]",
";",
"if",
"(",
"is_array",
"(",
"$",
"err",
... | Gets the first message for a specific error.
@param string $key - The error we're looking for
@return string - The error message | [
"Gets",
"the",
"first",
"message",
"for",
"a",
"specific",
"error",
"."
] | 199b08b45fadf5dae14ac4732af03b36e15bbef2 | https://github.com/ScaraMVC/Framework/blob/199b08b45fadf5dae14ac4732af03b36e15bbef2/src/Scara/Validation/Errors.php#L53-L69 |
203,208 | ScaraMVC/Framework | src/Scara/Validation/Errors.php | Errors.add | public function add($data)
{
$ea = (array) $data;
foreach ($ea as $key => $value) {
if (is_array($value)) {
foreach ($value as $k => $v) {
if (is_null($v)) {
unset($value[$k]);
}
}
... | php | public function add($data)
{
$ea = (array) $data;
foreach ($ea as $key => $value) {
if (is_array($value)) {
foreach ($value as $k => $v) {
if (is_null($v)) {
unset($value[$k]);
}
}
... | [
"public",
"function",
"add",
"(",
"$",
"data",
")",
"{",
"$",
"ea",
"=",
"(",
"array",
")",
"$",
"data",
";",
"foreach",
"(",
"$",
"ea",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"value",
")",
")",
"{",
... | Adds all error data. Also clears out any null values.
@param array $data - The error data to load into | [
"Adds",
"all",
"error",
"data",
".",
"Also",
"clears",
"out",
"any",
"null",
"values",
"."
] | 199b08b45fadf5dae14ac4732af03b36e15bbef2 | https://github.com/ScaraMVC/Framework/blob/199b08b45fadf5dae14ac4732af03b36e15bbef2/src/Scara/Validation/Errors.php#L76-L92 |
203,209 | WellCommerce/LayoutBundle | Renderer/LayoutBoxRenderer.php | LayoutBoxRenderer.resolveControllerAction | private function resolveControllerAction(BoxControllerInterface $controller)
{
$currentAction = $this->routerHelper->getCurrentAction();
if ($this->routerHelper->hasControllerAction($controller, $currentAction)) {
return $currentAction;
}
return 'indexAc... | php | private function resolveControllerAction(BoxControllerInterface $controller)
{
$currentAction = $this->routerHelper->getCurrentAction();
if ($this->routerHelper->hasControllerAction($controller, $currentAction)) {
return $currentAction;
}
return 'indexAc... | [
"private",
"function",
"resolveControllerAction",
"(",
"BoxControllerInterface",
"$",
"controller",
")",
"{",
"$",
"currentAction",
"=",
"$",
"this",
"->",
"routerHelper",
"->",
"getCurrentAction",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"routerHelper",
"->... | Resolves action which can be used in controller method call
@param BoxControllerInterface $controller
@return string | [
"Resolves",
"action",
"which",
"can",
"be",
"used",
"in",
"controller",
"method",
"call"
] | 470efd187d19827058f88317221cb875b4c9ced3 | https://github.com/WellCommerce/LayoutBundle/blob/470efd187d19827058f88317221cb875b4c9ced3/Renderer/LayoutBoxRenderer.php#L111-L120 |
203,210 | WellBloud/sovacore-core | src/model/FrontModule/repository/BaseRepository.php | BaseRepository.findPublishedItems | public function findPublishedItems(
array $where,
$orderBy = null,
$limit = null
)
{
return $this->repository->findBy(array_merge($where, ['published' => true]), $orderBy, $limit);
} | php | public function findPublishedItems(
array $where,
$orderBy = null,
$limit = null
)
{
return $this->repository->findBy(array_merge($where, ['published' => true]), $orderBy, $limit);
} | [
"public",
"function",
"findPublishedItems",
"(",
"array",
"$",
"where",
",",
"$",
"orderBy",
"=",
"null",
",",
"$",
"limit",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"repository",
"->",
"findBy",
"(",
"array_merge",
"(",
"$",
"where",
",",
"... | Method which finds published items in the repository according to the where clause
@param array $where
@param array $orderBy
@param int $limit
@return array | [
"Method",
"which",
"finds",
"published",
"items",
"in",
"the",
"repository",
"according",
"to",
"the",
"where",
"clause"
] | 1816a0d7cd3ec4a90d64e301fc2469d171ad217f | https://github.com/WellBloud/sovacore-core/blob/1816a0d7cd3ec4a90d64e301fc2469d171ad217f/src/model/FrontModule/repository/BaseRepository.php#L26-L33 |
203,211 | agentmedia/phine-core | src/Core/Logic/Module/FrontendModule.php | FrontendModule.TemplateFile | public function TemplateFile()
{
if (!$this->AllowCustomTemplates() ||
!$this->content || !$this->content->GetTemplate())
{
return $this->BuiltInTemplateFile();
}
$file = Path::Combine(PathUtil::ModuleCustomTemplatesFolder($this), $this->content->GetTempla... | php | public function TemplateFile()
{
if (!$this->AllowCustomTemplates() ||
!$this->content || !$this->content->GetTemplate())
{
return $this->BuiltInTemplateFile();
}
$file = Path::Combine(PathUtil::ModuleCustomTemplatesFolder($this), $this->content->GetTempla... | [
"public",
"function",
"TemplateFile",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"AllowCustomTemplates",
"(",
")",
"||",
"!",
"$",
"this",
"->",
"content",
"||",
"!",
"$",
"this",
"->",
"content",
"->",
"GetTemplate",
"(",
")",
")",
"{",
"retu... | The template file
@return string | [
"The",
"template",
"file"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Module/FrontendModule.php#L47-L56 |
203,212 | agentmedia/phine-core | src/Core/Logic/Module/FrontendModule.php | FrontendModule.SetTreeItem | public function SetTreeItem(IContentTreeProvider $tree, $item)
{
$this->tree = $tree;
$this->item = $item;
$this->content = $this->tree->ContentByItem($item);
} | php | public function SetTreeItem(IContentTreeProvider $tree, $item)
{
$this->tree = $tree;
$this->item = $item;
$this->content = $this->tree->ContentByItem($item);
} | [
"public",
"function",
"SetTreeItem",
"(",
"IContentTreeProvider",
"$",
"tree",
",",
"$",
"item",
")",
"{",
"$",
"this",
"->",
"tree",
"=",
"$",
"tree",
";",
"$",
"this",
"->",
"item",
"=",
"$",
"item",
";",
"$",
"this",
"->",
"content",
"=",
"$",
"... | Sets tree and tree item
@param IContentTreeProvider $tree
@param mixed $item The tree item containing the render content | [
"Sets",
"tree",
"and",
"tree",
"item"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Module/FrontendModule.php#L81-L86 |
203,213 | agentmedia/phine-core | src/Core/Logic/Module/FrontendModule.php | FrontendModule.BackendName | public function BackendName()
{
if ($this->ContentForm())
{
$this->ContentForm()->ReadTranslations();
}
return Trans($this->MyBundle() . '.' . $this->MyName() . '.BackendName');
} | php | public function BackendName()
{
if ($this->ContentForm())
{
$this->ContentForm()->ReadTranslations();
}
return Trans($this->MyBundle() . '.' . $this->MyName() . '.BackendName');
} | [
"public",
"function",
"BackendName",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"ContentForm",
"(",
")",
")",
"{",
"$",
"this",
"->",
"ContentForm",
"(",
")",
"->",
"ReadTranslations",
"(",
")",
";",
"}",
"return",
"Trans",
"(",
"$",
"this",
"->",
... | Gets a display name for backend issues, can be overridden
@return string The display name | [
"Gets",
"a",
"display",
"name",
"for",
"backend",
"issues",
"can",
"be",
"overridden"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Module/FrontendModule.php#L92-L99 |
203,214 | agentmedia/phine-core | src/Core/Logic/Module/FrontendModule.php | FrontendModule.BeforeInit | protected function BeforeInit()
{
//todo: check access rights
$cacheFile = PathUtil::ContentCacheFile($this);
$this->fileCacher = new FileCacher($cacheFile, $this->content->GetCacheLifetime());
if ($this->fileCacher->MustUseCache())
{
$this->output = $this->fileCa... | php | protected function BeforeInit()
{
//todo: check access rights
$cacheFile = PathUtil::ContentCacheFile($this);
$this->fileCacher = new FileCacher($cacheFile, $this->content->GetCacheLifetime());
if ($this->fileCacher->MustUseCache())
{
$this->output = $this->fileCa... | [
"protected",
"function",
"BeforeInit",
"(",
")",
"{",
"//todo: check access rights",
"$",
"cacheFile",
"=",
"PathUtil",
"::",
"ContentCacheFile",
"(",
"$",
"this",
")",
";",
"$",
"this",
"->",
"fileCacher",
"=",
"new",
"FileCacher",
"(",
"$",
"cacheFile",
",",... | Gets cache content if necessary
@return boolean | [
"Gets",
"cache",
"content",
"if",
"necessary"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Module/FrontendModule.php#L197-L208 |
203,215 | agentmedia/phine-core | src/Core/Logic/Module/FrontendModule.php | FrontendModule.AfterGather | protected function AfterGather()
{
if ($this->fileCacher->MustStoreToCache())
{
$this->fileCacher->StoreToCache($this->output);
}
parent::AfterGather();
} | php | protected function AfterGather()
{
if ($this->fileCacher->MustStoreToCache())
{
$this->fileCacher->StoreToCache($this->output);
}
parent::AfterGather();
} | [
"protected",
"function",
"AfterGather",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"fileCacher",
"->",
"MustStoreToCache",
"(",
")",
")",
"{",
"$",
"this",
"->",
"fileCacher",
"->",
"StoreToCache",
"(",
"$",
"this",
"->",
"output",
")",
";",
"}",
"pa... | Stores to cache if necessary | [
"Stores",
"to",
"cache",
"if",
"necessary"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Module/FrontendModule.php#L212-L219 |
203,216 | CalderaWP/caldera-interop | src/Collections/Attributes.php | Attributes.addAttribute | public function addAttribute(Attribute$attribute) : Attributes
{
$this->getItems();//max sure is array
$this->attributes[$attribute->getName()] = $attribute;
return $this;
} | php | public function addAttribute(Attribute$attribute) : Attributes
{
$this->getItems();//max sure is array
$this->attributes[$attribute->getName()] = $attribute;
return $this;
} | [
"public",
"function",
"addAttribute",
"(",
"Attribute",
"$",
"attribute",
")",
":",
"Attributes",
"{",
"$",
"this",
"->",
"getItems",
"(",
")",
";",
"//max sure is array",
"$",
"this",
"->",
"attributes",
"[",
"$",
"attribute",
"->",
"getName",
"(",
")",
"... | Add attribute to collection
@param Attribute $attribute
@return Attributes | [
"Add",
"attribute",
"to",
"collection"
] | d25c4bc930200b314fbd42d084080b5d85261c94 | https://github.com/CalderaWP/caldera-interop/blob/d25c4bc930200b314fbd42d084080b5d85261c94/src/Collections/Attributes.php#L36-L41 |
203,217 | PenoaksDev/Milky-Framework | src/Milky/Facades/Log.php | Log.log | public static function log( $level, $message, array $context = [] )
{
return static::__do( __FUNCTION__, args_with_keys( func_get_args(), __CLASS__, __FUNCTION__ ) );
} | php | public static function log( $level, $message, array $context = [] )
{
return static::__do( __FUNCTION__, args_with_keys( func_get_args(), __CLASS__, __FUNCTION__ ) );
} | [
"public",
"static",
"function",
"log",
"(",
"$",
"level",
",",
"$",
"message",
",",
"array",
"$",
"context",
"=",
"[",
"]",
")",
"{",
"return",
"static",
"::",
"__do",
"(",
"__FUNCTION__",
",",
"args_with_keys",
"(",
"func_get_args",
"(",
")",
",",
"__... | Logging a message to the logs.
@param string $level
@param string $message
@param array $context | [
"Logging",
"a",
"message",
"to",
"the",
"logs",
"."
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Facades/Log.php#L115-L118 |
203,218 | internetofvoice/vsms-core | src/Controller/AbstractSkillController.php | AbstractSkillController.createAlexaRequest | protected function createAlexaRequest($request) {
$this->voiceInterface = 'Alexa';
// Create AlexaRequest from HTTP request
$this->alexaRequest = new AlexaRequest(
$request->getBody()->getContents(),
$this->askApplicationIds,
$request->getHeaderLine('Signaturecertc... | php | protected function createAlexaRequest($request) {
$this->voiceInterface = 'Alexa';
// Create AlexaRequest from HTTP request
$this->alexaRequest = new AlexaRequest(
$request->getBody()->getContents(),
$this->askApplicationIds,
$request->getHeaderLine('Signaturecertc... | [
"protected",
"function",
"createAlexaRequest",
"(",
"$",
"request",
")",
"{",
"$",
"this",
"->",
"voiceInterface",
"=",
"'Alexa'",
";",
"// Create AlexaRequest from HTTP request",
"$",
"this",
"->",
"alexaRequest",
"=",
"new",
"AlexaRequest",
"(",
"$",
"request",
... | Create Alexa Request from Slim Request
@param \Slim\Http\Request $request Slim request
@access protected
@author a.schmidt@internet-of-voice.de | [
"Create",
"Alexa",
"Request",
"from",
"Slim",
"Request"
] | bd1eb6ca90a55f4928c35b9f0742a5cc922298ef | https://github.com/internetofvoice/vsms-core/blob/bd1eb6ca90a55f4928c35b9f0742a5cc922298ef/src/Controller/AbstractSkillController.php#L60-L80 |
203,219 | zhaoxianfang/tools | src/Symfony/Component/DependencyInjection/Dumper/GraphvizDumper.php | GraphvizDumper.dump | public function dump(array $options = array())
{
foreach (array('graph', 'node', 'edge', 'node.instance', 'node.definition', 'node.missing') as $key) {
if (isset($options[$key])) {
$this->options[$key] = array_merge($this->options[$key], $options[$key]);
}
}
... | php | public function dump(array $options = array())
{
foreach (array('graph', 'node', 'edge', 'node.instance', 'node.definition', 'node.missing') as $key) {
if (isset($options[$key])) {
$this->options[$key] = array_merge($this->options[$key], $options[$key]);
}
}
... | [
"public",
"function",
"dump",
"(",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"foreach",
"(",
"array",
"(",
"'graph'",
",",
"'node'",
",",
"'edge'",
",",
"'node.instance'",
",",
"'node.definition'",
",",
"'node.missing'",
")",
"as",
"$",
... | Dumps the service container as a graphviz graph.
Available options:
* graph: The default options for the whole graph
* node: The default options for nodes
* edge: The default options for edges
* node.instance: The default options for services that are defined directly by object instances
* node.definition: The defaul... | [
"Dumps",
"the",
"service",
"container",
"as",
"a",
"graphviz",
"graph",
"."
] | d8fc8a9ecd75b5ce4236f0a2e9fdc055108573e7 | https://github.com/zhaoxianfang/tools/blob/d8fc8a9ecd75b5ce4236f0a2e9fdc055108573e7/src/Symfony/Component/DependencyInjection/Dumper/GraphvizDumper.php#L58-L84 |
203,220 | zhaoxianfang/tools | src/Symfony/Component/DependencyInjection/Dumper/GraphvizDumper.php | GraphvizDumper.startDot | private function startDot()
{
return sprintf("digraph sc {\n %s\n node [%s];\n edge [%s];\n\n",
$this->addOptions($this->options['graph']),
$this->addOptions($this->options['node']),
$this->addOptions($this->options['edge'])
);
} | php | private function startDot()
{
return sprintf("digraph sc {\n %s\n node [%s];\n edge [%s];\n\n",
$this->addOptions($this->options['graph']),
$this->addOptions($this->options['node']),
$this->addOptions($this->options['edge'])
);
} | [
"private",
"function",
"startDot",
"(",
")",
"{",
"return",
"sprintf",
"(",
"\"digraph sc {\\n %s\\n node [%s];\\n edge [%s];\\n\\n\"",
",",
"$",
"this",
"->",
"addOptions",
"(",
"$",
"this",
"->",
"options",
"[",
"'graph'",
"]",
")",
",",
"$",
"this",
"->",
... | Returns the start dot.
@return string The string representation of a start dot | [
"Returns",
"the",
"start",
"dot",
"."
] | d8fc8a9ecd75b5ce4236f0a2e9fdc055108573e7 | https://github.com/zhaoxianfang/tools/blob/d8fc8a9ecd75b5ce4236f0a2e9fdc055108573e7/src/Symfony/Component/DependencyInjection/Dumper/GraphvizDumper.php#L220-L227 |
203,221 | gplcart/cli | controllers/commands/Status.php | Status.cmdStatusStatus | public function cmdStatusStatus()
{
$result = $this->report->getStatus();
$this->outputFormat($result);
$this->outputFormatTableStatus($result);
$this->output();
} | php | public function cmdStatusStatus()
{
$result = $this->report->getStatus();
$this->outputFormat($result);
$this->outputFormatTableStatus($result);
$this->output();
} | [
"public",
"function",
"cmdStatusStatus",
"(",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"report",
"->",
"getStatus",
"(",
")",
";",
"$",
"this",
"->",
"outputFormat",
"(",
"$",
"result",
")",
";",
"$",
"this",
"->",
"outputFormatTableStatus",
"(",... | Callback for "status" command | [
"Callback",
"for",
"status",
"command"
] | e57dba53e291a225b4bff0c0d9b23d685dd1c125 | https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Status.php#L40-L46 |
203,222 | ekyna/Resource | Doctrine/ORM/Util/ResourceRepositoryTrait.php | ResourceRepositoryTrait.find | public function find($id)
{
return $this
->getQueryBuilder()
->andWhere($this->getAlias().'.id = '.intval($id))
->getQuery()
->getOneOrNullResult()
;
} | php | public function find($id)
{
return $this
->getQueryBuilder()
->andWhere($this->getAlias().'.id = '.intval($id))
->getQuery()
->getOneOrNullResult()
;
} | [
"public",
"function",
"find",
"(",
"$",
"id",
")",
"{",
"return",
"$",
"this",
"->",
"getQueryBuilder",
"(",
")",
"->",
"andWhere",
"(",
"$",
"this",
"->",
"getAlias",
"(",
")",
".",
"'.id = '",
".",
"intval",
"(",
"$",
"id",
")",
")",
"->",
"getQu... | Finds the resource by his ID.
@param int $id
@return null|object | [
"Finds",
"the",
"resource",
"by",
"his",
"ID",
"."
] | 96ee3d28e02bd9513705408e3bb7f88a76e52f56 | https://github.com/ekyna/Resource/blob/96ee3d28e02bd9513705408e3bb7f88a76e52f56/Doctrine/ORM/Util/ResourceRepositoryTrait.php#L44-L52 |
203,223 | ekyna/Resource | Doctrine/ORM/Util/ResourceRepositoryTrait.php | ResourceRepositoryTrait.findBy | public function findBy(array $criteria, array $sorting = null, $limit = null, $offset = null)
{
$queryBuilder = $this->getCollectionQueryBuilder();
$this->applyCriteria($queryBuilder, $criteria);
$this->applySorting($queryBuilder, (array) $sorting);
if (null !== $limit) {
... | php | public function findBy(array $criteria, array $sorting = null, $limit = null, $offset = null)
{
$queryBuilder = $this->getCollectionQueryBuilder();
$this->applyCriteria($queryBuilder, $criteria);
$this->applySorting($queryBuilder, (array) $sorting);
if (null !== $limit) {
... | [
"public",
"function",
"findBy",
"(",
"array",
"$",
"criteria",
",",
"array",
"$",
"sorting",
"=",
"null",
",",
"$",
"limit",
"=",
"null",
",",
"$",
"offset",
"=",
"null",
")",
"{",
"$",
"queryBuilder",
"=",
"$",
"this",
"->",
"getCollectionQueryBuilder",... | Finds resources by criteria, sorting, limit and offset.
@param array $criteria
@param array $sorting
@param int $limit
@param int $offset
@return array|\Doctrine\ORM\Tools\Pagination\Paginator | [
"Finds",
"resources",
"by",
"criteria",
"sorting",
"limit",
"and",
"offset",
"."
] | 96ee3d28e02bd9513705408e3bb7f88a76e52f56 | https://github.com/ekyna/Resource/blob/96ee3d28e02bd9513705408e3bb7f88a76e52f56/Doctrine/ORM/Util/ResourceRepositoryTrait.php#L97-L119 |
203,224 | ekyna/Resource | Doctrine/ORM/Util/ResourceRepositoryTrait.php | ResourceRepositoryTrait.findRandomOneBy | public function findRandomOneBy(array $criteria)
{
$queryBuilder = $this->getQueryBuilder();
$this->applyCriteria($queryBuilder, $criteria);
return $queryBuilder
->addSelect('RAND() as HIDDEN rand')
->orderBy('rand')
->setMaxResults(1)
->getQ... | php | public function findRandomOneBy(array $criteria)
{
$queryBuilder = $this->getQueryBuilder();
$this->applyCriteria($queryBuilder, $criteria);
return $queryBuilder
->addSelect('RAND() as HIDDEN rand')
->orderBy('rand')
->setMaxResults(1)
->getQ... | [
"public",
"function",
"findRandomOneBy",
"(",
"array",
"$",
"criteria",
")",
"{",
"$",
"queryBuilder",
"=",
"$",
"this",
"->",
"getQueryBuilder",
"(",
")",
";",
"$",
"this",
"->",
"applyCriteria",
"(",
"$",
"queryBuilder",
",",
"$",
"criteria",
")",
";",
... | Finds a random resource by criteria.
@param array $criteria
@return null|object | [
"Finds",
"a",
"random",
"resource",
"by",
"criteria",
"."
] | 96ee3d28e02bd9513705408e3bb7f88a76e52f56 | https://github.com/ekyna/Resource/blob/96ee3d28e02bd9513705408e3bb7f88a76e52f56/Doctrine/ORM/Util/ResourceRepositoryTrait.php#L128-L141 |
203,225 | ekyna/Resource | Doctrine/ORM/Util/ResourceRepositoryTrait.php | ResourceRepositoryTrait.findRandomBy | public function findRandomBy(array $criteria, $limit)
{
$limit = intval($limit);
if ($limit <= 1) {
throw new \InvalidArgumentException('Please use `findRandomOneBy()` for single result.');
}
$queryBuilder = $this->getCollectionQueryBuilder();
$this->applyCriter... | php | public function findRandomBy(array $criteria, $limit)
{
$limit = intval($limit);
if ($limit <= 1) {
throw new \InvalidArgumentException('Please use `findRandomOneBy()` for single result.');
}
$queryBuilder = $this->getCollectionQueryBuilder();
$this->applyCriter... | [
"public",
"function",
"findRandomBy",
"(",
"array",
"$",
"criteria",
",",
"$",
"limit",
")",
"{",
"$",
"limit",
"=",
"intval",
"(",
"$",
"limit",
")",
";",
"if",
"(",
"$",
"limit",
"<=",
"1",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
... | Finds random resource by criteria and limit.
@param array $criteria
@param int $limit
@return array|\Doctrine\ORM\Tools\Pagination\Paginator | [
"Finds",
"random",
"resource",
"by",
"criteria",
"and",
"limit",
"."
] | 96ee3d28e02bd9513705408e3bb7f88a76e52f56 | https://github.com/ekyna/Resource/blob/96ee3d28e02bd9513705408e3bb7f88a76e52f56/Doctrine/ORM/Util/ResourceRepositoryTrait.php#L151-L170 |
203,226 | ekyna/Resource | Doctrine/ORM/Util/ResourceRepositoryTrait.php | ResourceRepositoryTrait.createPager | public function createPager(array $criteria = [], array $sorting = [])
{
$queryBuilder = $this->getCollectionQueryBuilder();
$this->applyCriteria($queryBuilder, $criteria);
$this->applySorting($queryBuilder, $sorting);
return $this->getPager($queryBuilder);
} | php | public function createPager(array $criteria = [], array $sorting = [])
{
$queryBuilder = $this->getCollectionQueryBuilder();
$this->applyCriteria($queryBuilder, $criteria);
$this->applySorting($queryBuilder, $sorting);
return $this->getPager($queryBuilder);
} | [
"public",
"function",
"createPager",
"(",
"array",
"$",
"criteria",
"=",
"[",
"]",
",",
"array",
"$",
"sorting",
"=",
"[",
"]",
")",
"{",
"$",
"queryBuilder",
"=",
"$",
"this",
"->",
"getCollectionQueryBuilder",
"(",
")",
";",
"$",
"this",
"->",
"apply... | Creates a pager.
@param array $criteria
@param array $sorting
@return Pagerfanta | [
"Creates",
"a",
"pager",
"."
] | 96ee3d28e02bd9513705408e3bb7f88a76e52f56 | https://github.com/ekyna/Resource/blob/96ee3d28e02bd9513705408e3bb7f88a76e52f56/Doctrine/ORM/Util/ResourceRepositoryTrait.php#L180-L188 |
203,227 | ekyna/Resource | Doctrine/ORM/Util/ResourceRepositoryTrait.php | ResourceRepositoryTrait.applyCriteria | protected function applyCriteria(QueryBuilder $queryBuilder, array $criteria = [])
{
foreach ($criteria as $property => $value) {
$name = $this->getPropertyName($property);
if (null === $value) {
$queryBuilder->andWhere($queryBuilder->expr()->isNull($name));
... | php | protected function applyCriteria(QueryBuilder $queryBuilder, array $criteria = [])
{
foreach ($criteria as $property => $value) {
$name = $this->getPropertyName($property);
if (null === $value) {
$queryBuilder->andWhere($queryBuilder->expr()->isNull($name));
... | [
"protected",
"function",
"applyCriteria",
"(",
"QueryBuilder",
"$",
"queryBuilder",
",",
"array",
"$",
"criteria",
"=",
"[",
"]",
")",
"{",
"foreach",
"(",
"$",
"criteria",
"as",
"$",
"property",
"=>",
"$",
"value",
")",
"{",
"$",
"name",
"=",
"$",
"th... | Applies the criteria to the query builder.
@param QueryBuilder $queryBuilder
@param array $criteria | [
"Applies",
"the",
"criteria",
"to",
"the",
"query",
"builder",
"."
] | 96ee3d28e02bd9513705408e3bb7f88a76e52f56 | https://github.com/ekyna/Resource/blob/96ee3d28e02bd9513705408e3bb7f88a76e52f56/Doctrine/ORM/Util/ResourceRepositoryTrait.php#L265-L281 |
203,228 | ekyna/Resource | Doctrine/ORM/Util/ResourceRepositoryTrait.php | ResourceRepositoryTrait.getCachePrefix | public function getCachePrefix()
{
if ($this->cachePrefix) {
return $this->cachePrefix;
}
$class = $this->getClassName();
if (!in_array(TaggedEntityInterface::class, class_implements($class))) {
throw new \RuntimeException(sprintf(
'The entit... | php | public function getCachePrefix()
{
if ($this->cachePrefix) {
return $this->cachePrefix;
}
$class = $this->getClassName();
if (!in_array(TaggedEntityInterface::class, class_implements($class))) {
throw new \RuntimeException(sprintf(
'The entit... | [
"public",
"function",
"getCachePrefix",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"cachePrefix",
")",
"{",
"return",
"$",
"this",
"->",
"cachePrefix",
";",
"}",
"$",
"class",
"=",
"$",
"this",
"->",
"getClassName",
"(",
")",
";",
"if",
"(",
"!",
... | Returns the cache prefix.
@return string | [
"Returns",
"the",
"cache",
"prefix",
"."
] | 96ee3d28e02bd9513705408e3bb7f88a76e52f56 | https://github.com/ekyna/Resource/blob/96ee3d28e02bd9513705408e3bb7f88a76e52f56/Doctrine/ORM/Util/ResourceRepositoryTrait.php#L330-L346 |
203,229 | itkg/core | src/Itkg/Core/Cache/Factory.php | Factory.create | public function create($adapterType, array $config)
{
if (!array_key_exists($adapterType, $this->adapters)) {
throw new \InvalidArgumentException(
sprintf('Cache Adapter\'s key %s does not exist', $adapterType)
);
}
/**
* @fixme : Active this... | php | public function create($adapterType, array $config)
{
if (!array_key_exists($adapterType, $this->adapters)) {
throw new \InvalidArgumentException(
sprintf('Cache Adapter\'s key %s does not exist', $adapterType)
);
}
/**
* @fixme : Active this... | [
"public",
"function",
"create",
"(",
"$",
"adapterType",
",",
"array",
"$",
"config",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"adapterType",
",",
"$",
"this",
"->",
"adapters",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException"... | Create an adapter
@param string $adapterType
@return AdapterInterface
@throws \InvalidArgumentException | [
"Create",
"an",
"adapter"
] | e5e4efb05feb4d23b0df41f2b21fd095103e593b | https://github.com/itkg/core/blob/e5e4efb05feb4d23b0df41f2b21fd095103e593b/src/Itkg/Core/Cache/Factory.php#L41-L59 |
203,230 | Dhii/regex-abstract | src/QuoteRegexCapablePcreTrait.php | QuoteRegexCapablePcreTrait._quoteRegex | protected function _quoteRegex($string, $delimiter = null)
{
$string = $this->_normalizeString($string);
$delimiter = is_null($delimiter) ? null : $this->_normalizeString($delimiter);
return preg_quote($string, $delimiter);
} | php | protected function _quoteRegex($string, $delimiter = null)
{
$string = $this->_normalizeString($string);
$delimiter = is_null($delimiter) ? null : $this->_normalizeString($delimiter);
return preg_quote($string, $delimiter);
} | [
"protected",
"function",
"_quoteRegex",
"(",
"$",
"string",
",",
"$",
"delimiter",
"=",
"null",
")",
"{",
"$",
"string",
"=",
"$",
"this",
"->",
"_normalizeString",
"(",
"$",
"string",
")",
";",
"$",
"delimiter",
"=",
"is_null",
"(",
"$",
"delimiter",
... | Escapes special characters in a string such that it is interpreted literally by a PCRE parser.
@since [*next-version*]
@param string|Stringable $string The string to quote.
@param string|Stringable|null $delimiter The delimiter that will be used in the expression, if any.
If specified, this delimiter will be ... | [
"Escapes",
"special",
"characters",
"in",
"a",
"string",
"such",
"that",
"it",
"is",
"interpreted",
"literally",
"by",
"a",
"PCRE",
"parser",
"."
] | 0751f9c91a6f86d5f901b6b7f3613dc80bb69a8a | https://github.com/Dhii/regex-abstract/blob/0751f9c91a6f86d5f901b6b7f3613dc80bb69a8a/src/QuoteRegexCapablePcreTrait.php#L28-L34 |
203,231 | SahilDude89ss/PyntaxFramework | src/Pyntax/DAO/Bean/Column/Column.php | Column.getValueFromDefinition | protected function getValueFromDefinition($key)
{
return (isset($this->definition) && !empty($this->definition[$key])) ? $this->definition[$key] : false;
} | php | protected function getValueFromDefinition($key)
{
return (isset($this->definition) && !empty($this->definition[$key])) ? $this->definition[$key] : false;
} | [
"protected",
"function",
"getValueFromDefinition",
"(",
"$",
"key",
")",
"{",
"return",
"(",
"isset",
"(",
"$",
"this",
"->",
"definition",
")",
"&&",
"!",
"empty",
"(",
"$",
"this",
"->",
"definition",
"[",
"$",
"key",
"]",
")",
")",
"?",
"$",
"this... | This function returns the value of the key from the column definitions.
@param $key
@return bool|string | [
"This",
"function",
"returns",
"the",
"value",
"of",
"the",
"key",
"from",
"the",
"column",
"definitions",
"."
] | 045cca87d24eb2b6405734966c64344e00224c7b | https://github.com/SahilDude89ss/PyntaxFramework/blob/045cca87d24eb2b6405734966c64344e00224c7b/src/Pyntax/DAO/Bean/Column/Column.php#L121-L124 |
203,232 | Wedeto/Util | src/Cache/Item.php | Item.serialize | public function serialize()
{
return serialize([
'key' => $this->key,
'value' => $this->value,
'expires' => $this->expires,
'hit' => $this->hit
]);
} | php | public function serialize()
{
return serialize([
'key' => $this->key,
'value' => $this->value,
'expires' => $this->expires,
'hit' => $this->hit
]);
} | [
"public",
"function",
"serialize",
"(",
")",
"{",
"return",
"serialize",
"(",
"[",
"'key'",
"=>",
"$",
"this",
"->",
"key",
",",
"'value'",
"=>",
"$",
"this",
"->",
"value",
",",
"'expires'",
"=>",
"$",
"this",
"->",
"expires",
",",
"'hit'",
"=>",
"$... | Serialize the item. Required for storing in the containing cache | [
"Serialize",
"the",
"item",
".",
"Required",
"for",
"storing",
"in",
"the",
"containing",
"cache"
] | 0e080251bbaa8e7d91ae8d02eb79c029c976744a | https://github.com/Wedeto/Util/blob/0e080251bbaa8e7d91ae8d02eb79c029c976744a/src/Cache/Item.php#L190-L198 |
203,233 | Wedeto/Util | src/Cache/Item.php | Item.unserialize | public function unserialize($data)
{
$data = unserialize($data);
$this->key = $data['key'];
$this->value = $data['value'];
$this->expires = $data['expires'];
$this->hit = $data['hit'];
} | php | public function unserialize($data)
{
$data = unserialize($data);
$this->key = $data['key'];
$this->value = $data['value'];
$this->expires = $data['expires'];
$this->hit = $data['hit'];
} | [
"public",
"function",
"unserialize",
"(",
"$",
"data",
")",
"{",
"$",
"data",
"=",
"unserialize",
"(",
"$",
"data",
")",
";",
"$",
"this",
"->",
"key",
"=",
"$",
"data",
"[",
"'key'",
"]",
";",
"$",
"this",
"->",
"value",
"=",
"$",
"data",
"[",
... | Unserialize the item. Required for storing in the containing cache
@param string $data The data to unserialize | [
"Unserialize",
"the",
"item",
".",
"Required",
"for",
"storing",
"in",
"the",
"containing",
"cache"
] | 0e080251bbaa8e7d91ae8d02eb79c029c976744a | https://github.com/Wedeto/Util/blob/0e080251bbaa8e7d91ae8d02eb79c029c976744a/src/Cache/Item.php#L204-L211 |
203,234 | ekyna/Table | Extension/Core/Source/ArrayAdapter.php | ArrayAdapter.buildSortClosure | public function buildSortClosure($propertyPath, $direction)
{
$value = function ($data) use ($propertyPath) {
return $this->propertyAccessor->getValue($data, $propertyPath);
};
if ($direction === Util\ColumnSort::ASC) {
return function ($rowA, $rowB) use ($value) {
... | php | public function buildSortClosure($propertyPath, $direction)
{
$value = function ($data) use ($propertyPath) {
return $this->propertyAccessor->getValue($data, $propertyPath);
};
if ($direction === Util\ColumnSort::ASC) {
return function ($rowA, $rowB) use ($value) {
... | [
"public",
"function",
"buildSortClosure",
"(",
"$",
"propertyPath",
",",
"$",
"direction",
")",
"{",
"$",
"value",
"=",
"function",
"(",
"$",
"data",
")",
"use",
"(",
"$",
"propertyPath",
")",
"{",
"return",
"$",
"this",
"->",
"propertyAccessor",
"->",
"... | Builds the sort closure.
@param string $propertyPath
@param string $direction
@return \Closure | [
"Builds",
"the",
"sort",
"closure",
"."
] | 6f06e8fd8a3248d52f3a91f10508471344db311a | https://github.com/ekyna/Table/blob/6f06e8fd8a3248d52f3a91f10508471344db311a/Extension/Core/Source/ArrayAdapter.php#L161-L192 |
203,235 | ekyna/Table | Extension/Core/Source/ArrayAdapter.php | ArrayAdapter.applyClosures | private function applyClosures($data)
{
if (!empty($this->filterClosures)) {
$data = array_filter($data, function ($datum) {
foreach ($this->filterClosures as $closure) {
if (!$closure($datum)) {
return false;
}
... | php | private function applyClosures($data)
{
if (!empty($this->filterClosures)) {
$data = array_filter($data, function ($datum) {
foreach ($this->filterClosures as $closure) {
if (!$closure($datum)) {
return false;
}
... | [
"private",
"function",
"applyClosures",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"filterClosures",
")",
")",
"{",
"$",
"data",
"=",
"array_filter",
"(",
"$",
"data",
",",
"function",
"(",
"$",
"datum",
")",
"{",
... | Applies the filters and sort closures.
@param array $data
@return array | [
"Applies",
"the",
"filters",
"and",
"sort",
"closures",
"."
] | 6f06e8fd8a3248d52f3a91f10508471344db311a | https://github.com/ekyna/Table/blob/6f06e8fd8a3248d52f3a91f10508471344db311a/Extension/Core/Source/ArrayAdapter.php#L280-L311 |
203,236 | rednose-public/RednoseComboHandlerBundle | Controller/MinifyController.php | MinifyController.rewriteUris | public static function rewriteUris($css, $options = array())
{
// Prepend the base URL and symlink schema so the proper root path gets prepended.
$symlinks = array();
if (is_link($_SERVER['DOCUMENT_ROOT'])) {
$symlinks = array(
'/'.$options['baseUrl'] => readlink... | php | public static function rewriteUris($css, $options = array())
{
// Prepend the base URL and symlink schema so the proper root path gets prepended.
$symlinks = array();
if (is_link($_SERVER['DOCUMENT_ROOT'])) {
$symlinks = array(
'/'.$options['baseUrl'] => readlink... | [
"public",
"static",
"function",
"rewriteUris",
"(",
"$",
"css",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"// Prepend the base URL and symlink schema so the proper root path gets prepended.",
"$",
"symlinks",
"=",
"array",
"(",
")",
";",
"if",
"(",
"i... | Rewrite CSS URIs.
@param string $css
@param array $options
@return string | [
"Rewrite",
"CSS",
"URIs",
"."
] | 44b55dbd6653cebcf280822156cff8b850bdae00 | https://github.com/rednose-public/RednoseComboHandlerBundle/blob/44b55dbd6653cebcf280822156cff8b850bdae00/Controller/MinifyController.php#L76-L88 |
203,237 | rednose-public/RednoseComboHandlerBundle | Controller/MinifyController.php | MinifyController.getBaseUrl | protected function getBaseUrl()
{
$baseUrl = $this->container->get('router')->getContext()->getBaseUrl();
if ($baseUrl === '/') {
return '';
}
return rtrim(str_replace('app_dev.php', '', $this->container->get('router')->getContext()->getBaseUrl()), '/').'/';
} | php | protected function getBaseUrl()
{
$baseUrl = $this->container->get('router')->getContext()->getBaseUrl();
if ($baseUrl === '/') {
return '';
}
return rtrim(str_replace('app_dev.php', '', $this->container->get('router')->getContext()->getBaseUrl()), '/').'/';
} | [
"protected",
"function",
"getBaseUrl",
"(",
")",
"{",
"$",
"baseUrl",
"=",
"$",
"this",
"->",
"container",
"->",
"get",
"(",
"'router'",
")",
"->",
"getContext",
"(",
")",
"->",
"getBaseUrl",
"(",
")",
";",
"if",
"(",
"$",
"baseUrl",
"===",
"'/'",
")... | Returns the normalized base URL.
@return string | [
"Returns",
"the",
"normalized",
"base",
"URL",
"."
] | 44b55dbd6653cebcf280822156cff8b850bdae00 | https://github.com/rednose-public/RednoseComboHandlerBundle/blob/44b55dbd6653cebcf280822156cff8b850bdae00/Controller/MinifyController.php#L133-L142 |
203,238 | polusphp/polus-middleware | src/UserAgent.php | UserAgent.determineClientUserAgent | protected function determineClientUserAgent($request)
{
$userAgent = null;
$serverParams = $request->getServerParams();
$userAgent = $serverParams['HTTP_USER_AGENT'];
$checkProxyHeaders = $this->checkProxyHeaders;
if ($checkProxyHeaders && !empty($this->trustedProxies)) {
... | php | protected function determineClientUserAgent($request)
{
$userAgent = null;
$serverParams = $request->getServerParams();
$userAgent = $serverParams['HTTP_USER_AGENT'];
$checkProxyHeaders = $this->checkProxyHeaders;
if ($checkProxyHeaders && !empty($this->trustedProxies)) {
... | [
"protected",
"function",
"determineClientUserAgent",
"(",
"$",
"request",
")",
"{",
"$",
"userAgent",
"=",
"null",
";",
"$",
"serverParams",
"=",
"$",
"request",
"->",
"getServerParams",
"(",
")",
";",
"$",
"userAgent",
"=",
"$",
"serverParams",
"[",
"'HTTP_... | Find out the client's UserAgent from the headers available to us
@param ServerRequestInterface $request PSR-7 Request
@return string | [
"Find",
"out",
"the",
"client",
"s",
"UserAgent",
"from",
"the",
"headers",
"available",
"to",
"us"
] | c265c51fbdf6b2c5ed85686415b47a1fbf720c57 | https://github.com/polusphp/polus-middleware/blob/c265c51fbdf6b2c5ed85686415b47a1fbf720c57/src/UserAgent.php#L85-L107 |
203,239 | horntell/php-sdk | lib/guzzle/GuzzleHttp/Event/ErrorEvent.php | ErrorEvent.intercept | public function intercept(ResponseInterface $response)
{
$this->stopPropagation();
$this->getTransaction()->setResponse($response);
$this->exception->setThrowImmediately(false);
RequestEvents::emitComplete($this->getTransaction());
} | php | public function intercept(ResponseInterface $response)
{
$this->stopPropagation();
$this->getTransaction()->setResponse($response);
$this->exception->setThrowImmediately(false);
RequestEvents::emitComplete($this->getTransaction());
} | [
"public",
"function",
"intercept",
"(",
"ResponseInterface",
"$",
"response",
")",
"{",
"$",
"this",
"->",
"stopPropagation",
"(",
")",
";",
"$",
"this",
"->",
"getTransaction",
"(",
")",
"->",
"setResponse",
"(",
"$",
"response",
")",
";",
"$",
"this",
... | Intercept the exception and inject a response
@param ResponseInterface $response Response to set | [
"Intercept",
"the",
"exception",
"and",
"inject",
"a",
"response"
] | e5205e9396a21b754d5651a8aa5898da5922a1b7 | https://github.com/horntell/php-sdk/blob/e5205e9396a21b754d5651a8aa5898da5922a1b7/lib/guzzle/GuzzleHttp/Event/ErrorEvent.php#L39-L45 |
203,240 | ARCANESOFT/SEO | src/Http/Requests/Admin/Footers/FooterFormRequest.php | FooterFormRequest.getPageRule | protected function getPageRule()
{
$existsRule = Rule::exists($this->getTablePrefix().'pages', 'id')->using(function ($query) {
if ($this->has('locale'))
$query->where('locale', $this->get('locale', config('app.locale')));
});
return ['required', 'integer', $exis... | php | protected function getPageRule()
{
$existsRule = Rule::exists($this->getTablePrefix().'pages', 'id')->using(function ($query) {
if ($this->has('locale'))
$query->where('locale', $this->get('locale', config('app.locale')));
});
return ['required', 'integer', $exis... | [
"protected",
"function",
"getPageRule",
"(",
")",
"{",
"$",
"existsRule",
"=",
"Rule",
"::",
"exists",
"(",
"$",
"this",
"->",
"getTablePrefix",
"(",
")",
".",
"'pages'",
",",
"'id'",
")",
"->",
"using",
"(",
"function",
"(",
"$",
"query",
")",
"{",
... | Get the page validation rule.
@return array | [
"Get",
"the",
"page",
"validation",
"rule",
"."
] | ce6d6135d55e8b2fd43cf7923839b4791b7c7ad2 | https://github.com/ARCANESOFT/SEO/blob/ce6d6135d55e8b2fd43cf7923839b4791b7c7ad2/src/Http/Requests/Admin/Footers/FooterFormRequest.php#L39-L47 |
203,241 | helsingborg-stad/better-post-UI | source/php/Components/InternalLinks.php | InternalLinks.updateLinkInfo | public function updateLinkInfo($results, $query)
{
$results = array_map(function ($result) {
// Get post type
$post_type = get_post_type($result['ID']);
$obj = get_post_type_object($post_type);
// Add post type to result info
$result['info'] = '<st... | php | public function updateLinkInfo($results, $query)
{
$results = array_map(function ($result) {
// Get post type
$post_type = get_post_type($result['ID']);
$obj = get_post_type_object($post_type);
// Add post type to result info
$result['info'] = '<st... | [
"public",
"function",
"updateLinkInfo",
"(",
"$",
"results",
",",
"$",
"query",
")",
"{",
"$",
"results",
"=",
"array_map",
"(",
"function",
"(",
"$",
"result",
")",
"{",
"// Get post type",
"$",
"post_type",
"=",
"get_post_type",
"(",
"$",
"result",
"[",
... | Get the post type and its parents
@param array $results An associative array of query results
@param array $query An array of WP_Query arguments
@return array | [
"Get",
"the",
"post",
"type",
"and",
"its",
"parents"
] | 0454e8d6f42787244d02f0e976825ed8dca579f0 | https://github.com/helsingborg-stad/better-post-UI/blob/0454e8d6f42787244d02f0e976825ed8dca579f0/source/php/Components/InternalLinks.php#L34-L59 |
203,242 | helsingborg-stad/better-post-UI | source/php/Components/InternalLinks.php | InternalLinks.limitLinkSearch | public function limitLinkSearch($search, $wp_query)
{
global $wpdb;
if (empty($search)) {
return $search;
}
$query_vars = $wp_query->query_vars;
$search = '';
$and = '';
foreach((array)$query_vars['search_terms'] as $term) {
$search ... | php | public function limitLinkSearch($search, $wp_query)
{
global $wpdb;
if (empty($search)) {
return $search;
}
$query_vars = $wp_query->query_vars;
$search = '';
$and = '';
foreach((array)$query_vars['search_terms'] as $term) {
$search ... | [
"public",
"function",
"limitLinkSearch",
"(",
"$",
"search",
",",
"$",
"wp_query",
")",
"{",
"global",
"$",
"wpdb",
";",
"if",
"(",
"empty",
"(",
"$",
"search",
")",
")",
"{",
"return",
"$",
"search",
";",
"}",
"$",
"query_vars",
"=",
"$",
"wp_query"... | Limits internal link search to "post title" field
@param string $search Search SQL for WHERE clause
@param obj $wp_query The current WP_Query object
@return string Modified search string | [
"Limits",
"internal",
"link",
"search",
"to",
"post",
"title",
"field"
] | 0454e8d6f42787244d02f0e976825ed8dca579f0 | https://github.com/helsingborg-stad/better-post-UI/blob/0454e8d6f42787244d02f0e976825ed8dca579f0/source/php/Components/InternalLinks.php#L67-L87 |
203,243 | Linkvalue-Interne/MajoraFrameworkExtraBundle | src/Majora/Framework/Model/TranslatableTrait.php | TranslatableTrait.getTranslation | protected function getTranslation(array $translationData, $default = '')
{
// undefined locale
if (empty($translationData)) {
return $default;
}
// current locale matched
if ($this->locale && isset($translationData[$this->locale])) {
return $translati... | php | protected function getTranslation(array $translationData, $default = '')
{
// undefined locale
if (empty($translationData)) {
return $default;
}
// current locale matched
if ($this->locale && isset($translationData[$this->locale])) {
return $translati... | [
"protected",
"function",
"getTranslation",
"(",
"array",
"$",
"translationData",
",",
"$",
"default",
"=",
"''",
")",
"{",
"// undefined locale",
"if",
"(",
"empty",
"(",
"$",
"translationData",
")",
")",
"{",
"return",
"$",
"default",
";",
"}",
"// current ... | return translation matching current locale from given translation data
@param array $translationData
@param string $default
@return string | [
"return",
"translation",
"matching",
"current",
"locale",
"from",
"given",
"translation",
"data"
] | 6f368380cfc39d27fafb0844e9a53b4d86d7c034 | https://github.com/Linkvalue-Interne/MajoraFrameworkExtraBundle/blob/6f368380cfc39d27fafb0844e9a53b4d86d7c034/src/Majora/Framework/Model/TranslatableTrait.php#L48-L65 |
203,244 | NukaCode/html | src/NukaCode/Html/BBCode.php | BBCode.parse | public function parse($data)
{
$this->table();
$this->images();
$this->text();
$this->html();
// Replace everything that has been found
foreach ($this->matches as $key => $val) {
$data = preg_replace_callback($key, $val, $data);
}
// Repl... | php | public function parse($data)
{
$this->table();
$this->images();
$this->text();
$this->html();
// Replace everything that has been found
foreach ($this->matches as $key => $val) {
$data = preg_replace_callback($key, $val, $data);
}
// Repl... | [
"public",
"function",
"parse",
"(",
"$",
"data",
")",
"{",
"$",
"this",
"->",
"table",
"(",
")",
";",
"$",
"this",
"->",
"images",
"(",
")",
";",
"$",
"this",
"->",
"text",
"(",
")",
";",
"$",
"this",
"->",
"html",
"(",
")",
";",
"// Replace ev... | Parse a text and replace the BBCodes
@access public
@param string $data
@return string | [
"Parse",
"a",
"text",
"and",
"replace",
"the",
"BBCodes"
] | 7288161fb6711b1f9889e31bacb32d0d14b46e85 | https://github.com/NukaCode/html/blob/7288161fb6711b1f9889e31bacb32d0d14b46e85/src/NukaCode/Html/BBCode.php#L31-L48 |
203,245 | aegis-security/JSON | src/Encoder.php | Encoder._encodeConstants | private static function _encodeConstants(\ReflectionClass $cls)
{
$result = "constants : {";
$constants = $cls->getConstants();
$tmpArray = array();
if (!empty($constants)) {
foreach ($constants as $key => $value) {
$tmpArray[] = "$key: " . self::encod... | php | private static function _encodeConstants(\ReflectionClass $cls)
{
$result = "constants : {";
$constants = $cls->getConstants();
$tmpArray = array();
if (!empty($constants)) {
foreach ($constants as $key => $value) {
$tmpArray[] = "$key: " . self::encod... | [
"private",
"static",
"function",
"_encodeConstants",
"(",
"\\",
"ReflectionClass",
"$",
"cls",
")",
"{",
"$",
"result",
"=",
"\"constants : {\"",
";",
"$",
"constants",
"=",
"$",
"cls",
"->",
"getConstants",
"(",
")",
";",
"$",
"tmpArray",
"=",
"array",
"(... | Encode the constants associated with the \ReflectionClass
parameter. The encoding format is based on the class2 format
@param \ReflectionClass $cls
@return string Encoded constant block in class2 format | [
"Encode",
"the",
"constants",
"associated",
"with",
"the",
"\\",
"ReflectionClass",
"parameter",
".",
"The",
"encoding",
"format",
"is",
"based",
"on",
"the",
"class2",
"format"
] | 7bc8e442e9e570ecbc480053d9aaa42a52910fbc | https://github.com/aegis-security/JSON/blob/7bc8e442e9e570ecbc480053d9aaa42a52910fbc/src/Encoder.php#L262-L277 |
203,246 | rollerworks-graveyard/metadata | src/NullClassMetadata.php | NullClassMetadata.merge | public function merge(ClassMetadata $object)
{
$createdAt = $this->createdAt;
if (($otherCreatedAt = $object->getCreatedAt()) > $createdAt) {
$createdAt = $otherCreatedAt;
}
return new self($this->className, $createdAt);
} | php | public function merge(ClassMetadata $object)
{
$createdAt = $this->createdAt;
if (($otherCreatedAt = $object->getCreatedAt()) > $createdAt) {
$createdAt = $otherCreatedAt;
}
return new self($this->className, $createdAt);
} | [
"public",
"function",
"merge",
"(",
"ClassMetadata",
"$",
"object",
")",
"{",
"$",
"createdAt",
"=",
"$",
"this",
"->",
"createdAt",
";",
"if",
"(",
"(",
"$",
"otherCreatedAt",
"=",
"$",
"object",
"->",
"getCreatedAt",
"(",
")",
")",
">",
"$",
"created... | Returns a new NullClassMetadata with the highest createdAt.
No actual merging is performed as NullClassMetadata can't hold
any data and it's not possible to determine which ClassMetadata
implementation must be used.
Only the createdAt of the object is used if it's higher then
the current createdAt value.
@param Clas... | [
"Returns",
"a",
"new",
"NullClassMetadata",
"with",
"the",
"highest",
"createdAt",
"."
] | 5b07f564aad87709ca0d0b3e140e4dc4edf9d375 | https://github.com/rollerworks-graveyard/metadata/blob/5b07f564aad87709ca0d0b3e140e4dc4edf9d375/src/NullClassMetadata.php#L131-L140 |
203,247 | ezra-obiwale/dSCore | src/Stdlib/Email.php | Email.addAttachment | public function addAttachment($filePath) {
if (!$file = fopen($filePath, 'r')) {
throw new Exception('Cannot open file "' . $filePath . '"');
}
$this->attachments[$filePath] = chunk_split(base64_encode(fread($file, filesize($filePath))));
return $this;
} | php | public function addAttachment($filePath) {
if (!$file = fopen($filePath, 'r')) {
throw new Exception('Cannot open file "' . $filePath . '"');
}
$this->attachments[$filePath] = chunk_split(base64_encode(fread($file, filesize($filePath))));
return $this;
} | [
"public",
"function",
"addAttachment",
"(",
"$",
"filePath",
")",
"{",
"if",
"(",
"!",
"$",
"file",
"=",
"fopen",
"(",
"$",
"filePath",
",",
"'r'",
")",
")",
"{",
"throw",
"new",
"Exception",
"(",
"'Cannot open file \"'",
".",
"$",
"filePath",
".",
"'\... | Attach a file to the email
@param string $filePath Path to the file
@return \Email
@throws Exception | [
"Attach",
"a",
"file",
"to",
"the",
"email"
] | dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d | https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/Stdlib/Email.php#L46-L53 |
203,248 | ezra-obiwale/dSCore | src/Stdlib/Email.php | Email.setHTML | public function setHTML($content, array $options = array()) {
$this->html = $content;
$this->htmlCharset = (isset($options['charset'])) ? $options['charset'] : 'utf-8';
if (@$options['autoSetText']) {
$this->setText(strip_tags($this->html), $this->htmlCharset);
}
retu... | php | public function setHTML($content, array $options = array()) {
$this->html = $content;
$this->htmlCharset = (isset($options['charset'])) ? $options['charset'] : 'utf-8';
if (@$options['autoSetText']) {
$this->setText(strip_tags($this->html), $this->htmlCharset);
}
retu... | [
"public",
"function",
"setHTML",
"(",
"$",
"content",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"this",
"->",
"html",
"=",
"$",
"content",
";",
"$",
"this",
"->",
"htmlCharset",
"=",
"(",
"isset",
"(",
"$",
"options",
"["... | Set html content
@param string $content
@param array $options Keys may include [(string) charset [= "utf-8"], (boolean) autoSetText]
@return \Email | [
"Set",
"html",
"content"
] | dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d | https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/Stdlib/Email.php#L74-L81 |
203,249 | ezra-obiwale/dSCore | src/Stdlib/Email.php | Email.setText | public function setText($content, $charset = 'utf-8') {
$this->text = $content;
$this->textCharset = $charset;
return $this;
} | php | public function setText($content, $charset = 'utf-8') {
$this->text = $content;
$this->textCharset = $charset;
return $this;
} | [
"public",
"function",
"setText",
"(",
"$",
"content",
",",
"$",
"charset",
"=",
"'utf-8'",
")",
"{",
"$",
"this",
"->",
"text",
"=",
"$",
"content",
";",
"$",
"this",
"->",
"textCharset",
"=",
"$",
"charset",
";",
"return",
"$",
"this",
";",
"}"
] | Set text content
@param string $content
@return \Email | [
"Set",
"text",
"content"
] | dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d | https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/Stdlib/Email.php#L88-L92 |
203,250 | ezra-obiwale/dSCore | src/Stdlib/Email.php | Email.addBcc | public function addBcc($bcc) {
$this->bcc = (!empty($this->bcc)) ? $this->bcc . ',' . $bcc : $bcc;
return $this;
} | php | public function addBcc($bcc) {
$this->bcc = (!empty($this->bcc)) ? $this->bcc . ',' . $bcc : $bcc;
return $this;
} | [
"public",
"function",
"addBcc",
"(",
"$",
"bcc",
")",
"{",
"$",
"this",
"->",
"bcc",
"=",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"bcc",
")",
")",
"?",
"$",
"this",
"->",
"bcc",
".",
"','",
".",
"$",
"bcc",
":",
"$",
"bcc",
";",
"return",
... | Adds a best carbon copy
@param string $bcc Email address to send to
@return \Email | [
"Adds",
"a",
"best",
"carbon",
"copy"
] | dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d | https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/Stdlib/Email.php#L200-L203 |
203,251 | wearenolte/wp-acf | src/Acf.php | Acf.get_post_field | public static function get_post_field( $post_id = 0, $include_wp_fields = true, $field = '' ) {
if ( $include_wp_fields && ! $field ) {
$wp_fields = [
'post_id' => $post_id,
'permalink' => get_permalink( $post_id ),
'title' => get_the_title( $post_id ),
'content' => apply_filters( 'the_content', ge... | php | public static function get_post_field( $post_id = 0, $include_wp_fields = true, $field = '' ) {
if ( $include_wp_fields && ! $field ) {
$wp_fields = [
'post_id' => $post_id,
'permalink' => get_permalink( $post_id ),
'title' => get_the_title( $post_id ),
'content' => apply_filters( 'the_content', ge... | [
"public",
"static",
"function",
"get_post_field",
"(",
"$",
"post_id",
"=",
"0",
",",
"$",
"include_wp_fields",
"=",
"true",
",",
"$",
"field",
"=",
"''",
")",
"{",
"if",
"(",
"$",
"include_wp_fields",
"&&",
"!",
"$",
"field",
")",
"{",
"$",
"wp_fields... | Get the field value for a post.
@param int $post_id The target post's id. Or leave blank for he current post if in the loop.
@param bool $include_wp_fields Whether or not to include the default WP fields.
@param string $field The ACF field id or name. Return all fields if blank.
@return array | [
"Get",
"the",
"field",
"value",
"for",
"a",
"post",
"."
] | 2f5093438d637fa0eca42ad6d10f6b433ec078b2 | https://github.com/wearenolte/wp-acf/blob/2f5093438d637fa0eca42ad6d10f6b433ec078b2/src/Acf.php#L26-L37 |
203,252 | wearenolte/wp-acf | src/Acf.php | Acf.get_taxonomy_field | public static function get_taxonomy_field( $taxonomy_term, $field = '' ) {
if ( is_a( $taxonomy_term, 'WP_Term' ) ) {
return self::get_field( $taxonomy_term, $field );
} elseif ( is_array( $taxonomy_term ) && count( $taxonomy_term ) >= 2 ) {
return self::get_field( "{$taxonomy_term[0]}_{$taxonomy_term[1]}", $... | php | public static function get_taxonomy_field( $taxonomy_term, $field = '' ) {
if ( is_a( $taxonomy_term, 'WP_Term' ) ) {
return self::get_field( $taxonomy_term, $field );
} elseif ( is_array( $taxonomy_term ) && count( $taxonomy_term ) >= 2 ) {
return self::get_field( "{$taxonomy_term[0]}_{$taxonomy_term[1]}", $... | [
"public",
"static",
"function",
"get_taxonomy_field",
"(",
"$",
"taxonomy_term",
",",
"$",
"field",
"=",
"''",
")",
"{",
"if",
"(",
"is_a",
"(",
"$",
"taxonomy_term",
",",
"'WP_Term'",
")",
")",
"{",
"return",
"self",
"::",
"get_field",
"(",
"$",
"taxono... | Get the fields for a taxonomy term.
@param array|\WP_Term $taxonomy_term The target term's [taxonomy, $term_id] or term object.
@param string $field The ACF field id or name. Return all fields if blank.
@return mixed
@throws \Exception | [
"Get",
"the",
"fields",
"for",
"a",
"taxonomy",
"term",
"."
] | 2f5093438d637fa0eca42ad6d10f6b433ec078b2 | https://github.com/wearenolte/wp-acf/blob/2f5093438d637fa0eca42ad6d10f6b433ec078b2/src/Acf.php#L69-L76 |
203,253 | wearenolte/wp-acf | src/Acf.php | Acf.get_field | private static function get_field( $target_id = 0, $field = '' ) {
if ( self::is_active() ) {
if ( $field ) {
return self::get_single_field( $target_id, $field );
} else {
return self::get_all_fields( $target_id );
}
}
return $field ? null : [];
} | php | private static function get_field( $target_id = 0, $field = '' ) {
if ( self::is_active() ) {
if ( $field ) {
return self::get_single_field( $target_id, $field );
} else {
return self::get_all_fields( $target_id );
}
}
return $field ? null : [];
} | [
"private",
"static",
"function",
"get_field",
"(",
"$",
"target_id",
"=",
"0",
",",
"$",
"field",
"=",
"''",
")",
"{",
"if",
"(",
"self",
"::",
"is_active",
"(",
")",
")",
"{",
"if",
"(",
"$",
"field",
")",
"{",
"return",
"self",
"::",
"get_single_... | Get all field values.
@param int $target_id The target object's id.
@param string $field The ACF field id or name. Return all fields if blank.
@return array | [
"Get",
"all",
"field",
"values",
"."
] | 2f5093438d637fa0eca42ad6d10f6b433ec078b2 | https://github.com/wearenolte/wp-acf/blob/2f5093438d637fa0eca42ad6d10f6b433ec078b2/src/Acf.php#L117-L126 |
203,254 | wearenolte/wp-acf | src/Acf.php | Acf.get_all_fields | private static function get_all_fields( $target_id = 0 ) {
$data = [];
$field_objs = get_field_objects( $target_id );
if ( $field_objs ) {
foreach ( $field_objs as $field_name => $field_obj ) {
$value = self::get_single_field( $target_id, $field_obj );
$group_slug = self::get_group_slug( $field_obj[... | php | private static function get_all_fields( $target_id = 0 ) {
$data = [];
$field_objs = get_field_objects( $target_id );
if ( $field_objs ) {
foreach ( $field_objs as $field_name => $field_obj ) {
$value = self::get_single_field( $target_id, $field_obj );
$group_slug = self::get_group_slug( $field_obj[... | [
"private",
"static",
"function",
"get_all_fields",
"(",
"$",
"target_id",
"=",
"0",
")",
"{",
"$",
"data",
"=",
"[",
"]",
";",
"$",
"field_objs",
"=",
"get_field_objects",
"(",
"$",
"target_id",
")",
";",
"if",
"(",
"$",
"field_objs",
")",
"{",
"foreac... | Get all the fields for the target object.
@param int $target_id The id of the target object.
@return array | [
"Get",
"all",
"the",
"fields",
"for",
"the",
"target",
"object",
"."
] | 2f5093438d637fa0eca42ad6d10f6b433ec078b2 | https://github.com/wearenolte/wp-acf/blob/2f5093438d637fa0eca42ad6d10f6b433ec078b2/src/Acf.php#L134-L154 |
203,255 | wearenolte/wp-acf | src/Acf.php | Acf.get_single_field | private static function get_single_field( $target_id = 0, $field = '' ) {
$field_obj = is_array( $field ) ? $field : get_field_object( $field, $target_id );
$field_key = isset( $field_obj['key'] ) ? $field_obj['key'] : '';
$filter_name = Filter::create_name( Filter::DEFAULT_TRANSFORMS, $field_key );
$apply_d... | php | private static function get_single_field( $target_id = 0, $field = '' ) {
$field_obj = is_array( $field ) ? $field : get_field_object( $field, $target_id );
$field_key = isset( $field_obj['key'] ) ? $field_obj['key'] : '';
$filter_name = Filter::create_name( Filter::DEFAULT_TRANSFORMS, $field_key );
$apply_d... | [
"private",
"static",
"function",
"get_single_field",
"(",
"$",
"target_id",
"=",
"0",
",",
"$",
"field",
"=",
"''",
")",
"{",
"$",
"field_obj",
"=",
"is_array",
"(",
"$",
"field",
")",
"?",
"$",
"field",
":",
"get_field_object",
"(",
"$",
"field",
",",... | Gat a single field value for a target object.
@param int $target_id The id of the target object.
@param string $field The field id or name.
@return mixed | [
"Gat",
"a",
"single",
"field",
"value",
"for",
"a",
"target",
"object",
"."
] | 2f5093438d637fa0eca42ad6d10f6b433ec078b2 | https://github.com/wearenolte/wp-acf/blob/2f5093438d637fa0eca42ad6d10f6b433ec078b2/src/Acf.php#L163-L175 |
203,256 | wearenolte/wp-acf | src/Acf.php | Acf.get_group_slug | private static function get_group_slug( $group_id ) {
global $acf_local;
if ( isset( $acf_local->groups[ $group_id ] ) ) {
// First try the local groups (added by PHP).
$title = $acf_local->groups[ $group_id ]['title'];
} else {
$title = '';
if ( is_numeric( $group_id ) ) {
$args = [
'post_... | php | private static function get_group_slug( $group_id ) {
global $acf_local;
if ( isset( $acf_local->groups[ $group_id ] ) ) {
// First try the local groups (added by PHP).
$title = $acf_local->groups[ $group_id ]['title'];
} else {
$title = '';
if ( is_numeric( $group_id ) ) {
$args = [
'post_... | [
"private",
"static",
"function",
"get_group_slug",
"(",
"$",
"group_id",
")",
"{",
"global",
"$",
"acf_local",
";",
"if",
"(",
"isset",
"(",
"$",
"acf_local",
"->",
"groups",
"[",
"$",
"group_id",
"]",
")",
")",
"{",
"// First try the local groups (added by PH... | Get an ACF group slug
@param $group_id
@return string|bool | [
"Get",
"an",
"ACF",
"group",
"slug"
] | 2f5093438d637fa0eca42ad6d10f6b433ec078b2 | https://github.com/wearenolte/wp-acf/blob/2f5093438d637fa0eca42ad6d10f6b433ec078b2/src/Acf.php#L211-L250 |
203,257 | Vectrex/vxPHP | src/Form/FormElement/FileInputElement.php | FileInputElement.getValue | public function getValue()
{
$file = $this->getFile();
if($file instanceof UploadedFile) {
return $file->getOriginalName();
}
if(is_array($file) && $file[0] instanceof UploadedFile) {
return $file[0]->getOriginalName();
}
return null;
} | php | public function getValue()
{
$file = $this->getFile();
if($file instanceof UploadedFile) {
return $file->getOriginalName();
}
if(is_array($file) && $file[0] instanceof UploadedFile) {
return $file[0]->getOriginalName();
}
return null;
} | [
"public",
"function",
"getValue",
"(",
")",
"{",
"$",
"file",
"=",
"$",
"this",
"->",
"getFile",
"(",
")",
";",
"if",
"(",
"$",
"file",
"instanceof",
"UploadedFile",
")",
"{",
"return",
"$",
"file",
"->",
"getOriginalName",
"(",
")",
";",
"}",
"if",
... | get original name of an uploaded file associated with this element
if attribute multiple is set the name of the first file is returned
@return string | [
"get",
"original",
"name",
"of",
"an",
"uploaded",
"file",
"associated",
"with",
"this",
"element",
"if",
"attribute",
"multiple",
"is",
"set",
"the",
"name",
"of",
"the",
"first",
"file",
"is",
"returned"
] | 295c21b00e7ef6085efcdf5b64fabb28d499b5a6 | https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Form/FormElement/FileInputElement.php#L44-L57 |
203,258 | wb-crowdfusion/crowdfusion | system/core/classes/mvc/filters/NonceFilterer.php | NonceFilterer.nonce | protected function nonce()
{
$action = ($this->getParameter('action') == null) ?
$this->RequestContext->getControls()->getControl('action')
: $this->getParameter('action');
return $this->Nonces->create($action);
} | php | protected function nonce()
{
$action = ($this->getParameter('action') == null) ?
$this->RequestContext->getControls()->getControl('action')
: $this->getParameter('action');
return $this->Nonces->create($action);
} | [
"protected",
"function",
"nonce",
"(",
")",
"{",
"$",
"action",
"=",
"(",
"$",
"this",
"->",
"getParameter",
"(",
"'action'",
")",
"==",
"null",
")",
"?",
"$",
"this",
"->",
"RequestContext",
"->",
"getControls",
"(",
")",
"->",
"getControl",
"(",
"'ac... | Creates a nonce for the current or specified action
Expected Param:
action string (optional) The action that the nonce will be valid for.
If not specified, the current action will be used
@return string | [
"Creates",
"a",
"nonce",
"for",
"the",
"current",
"or",
"specified",
"action"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/mvc/filters/NonceFilterer.php#L50-L57 |
203,259 | flipbox/spark | src/services/traits/ElementByString.php | ElementByString.findCacheByString | public function findCacheByString(string $string, int $siteId = null)
{
// Check if already in cache
if ($this->isCachedByString($string, $siteId)) {
return $this->cacheByString[$siteId][$string];
}
return null;
} | php | public function findCacheByString(string $string, int $siteId = null)
{
// Check if already in cache
if ($this->isCachedByString($string, $siteId)) {
return $this->cacheByString[$siteId][$string];
}
return null;
} | [
"public",
"function",
"findCacheByString",
"(",
"string",
"$",
"string",
",",
"int",
"$",
"siteId",
"=",
"null",
")",
"{",
"// Check if already in cache",
"if",
"(",
"$",
"this",
"->",
"isCachedByString",
"(",
"$",
"string",
",",
"$",
"siteId",
")",
")",
"... | Find an existing cache by Handle
@param string $string
@param int|null $siteId
@return BaseElement|ElementInterface|null | [
"Find",
"an",
"existing",
"cache",
"by",
"Handle"
] | 9d75fd3d95744b9c9187921c4f3b9eea42c035d4 | https://github.com/flipbox/spark/blob/9d75fd3d95744b9c9187921c4f3b9eea42c035d4/src/services/traits/ElementByString.php#L125-L134 |
203,260 | flipbox/spark | src/services/traits/ElementByString.php | ElementByString.isCachedByString | protected function isCachedByString($string, int $siteId = null)
{
// Resolve siteId
$siteId = SiteHelper::resolveSiteId($siteId);
if (!isset($this->cacheByString[$siteId])) {
$this->cacheByString[$siteId] = [];
}
return array_key_exists($string, $this->cacheBy... | php | protected function isCachedByString($string, int $siteId = null)
{
// Resolve siteId
$siteId = SiteHelper::resolveSiteId($siteId);
if (!isset($this->cacheByString[$siteId])) {
$this->cacheByString[$siteId] = [];
}
return array_key_exists($string, $this->cacheBy... | [
"protected",
"function",
"isCachedByString",
"(",
"$",
"string",
",",
"int",
"$",
"siteId",
"=",
"null",
")",
"{",
"// Resolve siteId",
"$",
"siteId",
"=",
"SiteHelper",
"::",
"resolveSiteId",
"(",
"$",
"siteId",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"... | Identify whether in cached by string
@param $string
@param int|null $siteId
@return bool | [
"Identify",
"whether",
"in",
"cached",
"by",
"string"
] | 9d75fd3d95744b9c9187921c4f3b9eea42c035d4 | https://github.com/flipbox/spark/blob/9d75fd3d95744b9c9187921c4f3b9eea42c035d4/src/services/traits/ElementByString.php#L143-L154 |
203,261 | maddoger/yii2-datetime-behavior | DateTimeAttribute.php | DateTimeAttribute.parseDateValue | protected static function parseDateValue($value, $format, $timeZone)
{
$date = DateTime::createFromFormat($format, $value, new DateTimeZone($timeZone));
$errors = DateTime::getLastErrors();
if ($date === false || $errors['error_count'] || $errors['warning_count']) {
return false;... | php | protected static function parseDateValue($value, $format, $timeZone)
{
$date = DateTime::createFromFormat($format, $value, new DateTimeZone($timeZone));
$errors = DateTime::getLastErrors();
if ($date === false || $errors['error_count'] || $errors['warning_count']) {
return false;... | [
"protected",
"static",
"function",
"parseDateValue",
"(",
"$",
"value",
",",
"$",
"format",
",",
"$",
"timeZone",
")",
"{",
"$",
"date",
"=",
"DateTime",
"::",
"createFromFormat",
"(",
"$",
"format",
",",
"$",
"value",
",",
"new",
"DateTimeZone",
"(",
"$... | Parses date string into DateTime object
@param string $value string representing date
@param string $format string representing date
@param string $timeZone string representing date
@return boolean|DateTime DateTime object or false on failure | [
"Parses",
"date",
"string",
"into",
"DateTime",
"object"
] | 3fd04ab1b2c3b10e620ae4c7971e3d9ef8084db3 | https://github.com/maddoger/yii2-datetime-behavior/blob/3fd04ab1b2c3b10e620ae4c7971e3d9ef8084db3/DateTimeAttribute.php#L145-L158 |
203,262 | Eden-PHP/Registry | src/Index.php | Index.remove | public function remove()
{
$args = func_get_args();
if (count($args) == 0) {
return $this;
}
$last = array_pop($args);
$pointer = &$this->data;
foreach ($args as $i => $step) {
if (!isset($pointer[$step])
... | php | public function remove()
{
$args = func_get_args();
if (count($args) == 0) {
return $this;
}
$last = array_pop($args);
$pointer = &$this->data;
foreach ($args as $i => $step) {
if (!isset($pointer[$step])
... | [
"public",
"function",
"remove",
"(",
")",
"{",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"if",
"(",
"count",
"(",
"$",
"args",
")",
"==",
"0",
")",
"{",
"return",
"$",
"this",
";",
"}",
"$",
"last",
"=",
"array_pop",
"(",
"$",
"args",
"... | Removes a key and everything associated with it
@return Eden\Registry\Index | [
"Removes",
"a",
"key",
"and",
"everything",
"associated",
"with",
"it"
] | 4ec72e314a65372fdf30b6dff772db6ff21dd11a | https://github.com/Eden-PHP/Registry/blob/4ec72e314a65372fdf30b6dff772db6ff21dd11a/src/Index.php#L158-L182 |
203,263 | zodream/database | src/Model/Model.php | Model.findOrDefault | public static function findOrDefault($param, array $attributes) {
$model = self::findOrNew($param);
if ($model->isNewRecord) {
$model->set($attributes);
}
return $model;
} | php | public static function findOrDefault($param, array $attributes) {
$model = self::findOrNew($param);
if ($model->isNewRecord) {
$model->set($attributes);
}
return $model;
} | [
"public",
"static",
"function",
"findOrDefault",
"(",
"$",
"param",
",",
"array",
"$",
"attributes",
")",
"{",
"$",
"model",
"=",
"self",
"::",
"findOrNew",
"(",
"$",
"param",
")",
";",
"if",
"(",
"$",
"model",
"->",
"isNewRecord",
")",
"{",
"$",
"mo... | Set not found default data
@param $param
@param array $attributes
@return bool|Model
@throws \Exception | [
"Set",
"not",
"found",
"default",
"data"
] | 03712219c057799d07350a3a2650c55bcc92c28e | https://github.com/zodream/database/blob/03712219c057799d07350a3a2650c55bcc92c28e/src/Model/Model.php#L195-L201 |
203,264 | zodream/database | src/Model/Model.php | Model.findWithReplace | public static function findWithReplace($param, array $attributes) {
$model = self::findOrNew($param);
$model->set($attributes);
return $model;
} | php | public static function findWithReplace($param, array $attributes) {
$model = self::findOrNew($param);
$model->set($attributes);
return $model;
} | [
"public",
"static",
"function",
"findWithReplace",
"(",
"$",
"param",
",",
"array",
"$",
"attributes",
")",
"{",
"$",
"model",
"=",
"self",
"::",
"findOrNew",
"(",
"$",
"param",
")",
";",
"$",
"model",
"->",
"set",
"(",
"$",
"attributes",
")",
";",
"... | Set new attr
@param $param
@param array $attributes
@return bool|Model
@throws \Exception | [
"Set",
"new",
"attr"
] | 03712219c057799d07350a3a2650c55bcc92c28e | https://github.com/zodream/database/blob/03712219c057799d07350a3a2650c55bcc92c28e/src/Model/Model.php#L210-L214 |
203,265 | stubbles/stubbles-peer | src/main/php/Stream.php | Stream.setTimeout | public function setTimeout(int $seconds, int $microseconds = 0): self
{
$this->timeout = (float) ($seconds . '.' . $microseconds);
stream_set_timeout($this->resource, $seconds, $microseconds);
return $this;
} | php | public function setTimeout(int $seconds, int $microseconds = 0): self
{
$this->timeout = (float) ($seconds . '.' . $microseconds);
stream_set_timeout($this->resource, $seconds, $microseconds);
return $this;
} | [
"public",
"function",
"setTimeout",
"(",
"int",
"$",
"seconds",
",",
"int",
"$",
"microseconds",
"=",
"0",
")",
":",
"self",
"{",
"$",
"this",
"->",
"timeout",
"=",
"(",
"float",
")",
"(",
"$",
"seconds",
".",
"'.'",
".",
"$",
"microseconds",
")",
... | set timeout for connections
@param int $seconds timeout for connection in seconds
@param int $microseconds optional timeout for connection in microseconds
@return $this | [
"set",
"timeout",
"for",
"connections"
] | dc8b0a517dc4c84b615cc3c88f0d64a2b742f9cc | https://github.com/stubbles/stubbles-peer/blob/dc8b0a517dc4c84b615cc3c88f0d64a2b742f9cc/src/main/php/Stream.php#L96-L101 |
203,266 | stubbles/stubbles-peer | src/main/php/Stream.php | Stream.read | public function read(int $length = null): string
{
// can not call fgets with null when not specified
$data = null === $length ? fgets($this->resource) : fgets($this->resource, $length);
if (false === $data) {
// fgets() returns false on eof while feof() returned false before
... | php | public function read(int $length = null): string
{
// can not call fgets with null when not specified
$data = null === $length ? fgets($this->resource) : fgets($this->resource, $length);
if (false === $data) {
// fgets() returns false on eof while feof() returned false before
... | [
"public",
"function",
"read",
"(",
"int",
"$",
"length",
"=",
"null",
")",
":",
"string",
"{",
"// can not call fgets with null when not specified",
"$",
"data",
"=",
"null",
"===",
"$",
"length",
"?",
"fgets",
"(",
"$",
"this",
"->",
"resource",
")",
":",
... | read from socket
@param int $length optional length of data to read
@return string data read from socket
@throws \stubbles\peer\ConnectionFailure
@throws \stubbles\peer\Timeout | [
"read",
"from",
"socket"
] | dc8b0a517dc4c84b615cc3c88f0d64a2b742f9cc | https://github.com/stubbles/stubbles-peer/blob/dc8b0a517dc4c84b615cc3c88f0d64a2b742f9cc/src/main/php/Stream.php#L121-L145 |
203,267 | stubbles/stubbles-peer | src/main/php/Stream.php | Stream.readBinary | public function readBinary(int $length = 1024): string
{
$data = fread($this->resource, $length);
if (false === $data) {
if (stream_get_meta_data($this->resource)['timed_out']) {
throw new Timeout(
'Reading of ' . $length . ' bytes failed: timeout ... | php | public function readBinary(int $length = 1024): string
{
$data = fread($this->resource, $length);
if (false === $data) {
if (stream_get_meta_data($this->resource)['timed_out']) {
throw new Timeout(
'Reading of ' . $length . ' bytes failed: timeout ... | [
"public",
"function",
"readBinary",
"(",
"int",
"$",
"length",
"=",
"1024",
")",
":",
"string",
"{",
"$",
"data",
"=",
"fread",
"(",
"$",
"this",
"->",
"resource",
",",
"$",
"length",
")",
";",
"if",
"(",
"false",
"===",
"$",
"data",
")",
"{",
"i... | read binary data from socket
@param int $length length of data to read
@return string data read from socket
@throws \stubbles\peer\ConnectionFailure
@throws \stubbles\peer\Timeout | [
"read",
"binary",
"data",
"from",
"socket"
] | dc8b0a517dc4c84b615cc3c88f0d64a2b742f9cc | https://github.com/stubbles/stubbles-peer/blob/dc8b0a517dc4c84b615cc3c88f0d64a2b742f9cc/src/main/php/Stream.php#L165-L182 |
203,268 | stubbles/stubbles-peer | src/main/php/Stream.php | Stream.write | public function write(string $data): int
{
$length = fputs($this->resource, $data, strlen($data));
if (false === $length) {
if (stream_get_meta_data($this->resource)['timed_out']) {
throw new Timeout(
'Writing of ' . strlen($data) . ' bytes failed:... | php | public function write(string $data): int
{
$length = fputs($this->resource, $data, strlen($data));
if (false === $length) {
if (stream_get_meta_data($this->resource)['timed_out']) {
throw new Timeout(
'Writing of ' . strlen($data) . ' bytes failed:... | [
"public",
"function",
"write",
"(",
"string",
"$",
"data",
")",
":",
"int",
"{",
"$",
"length",
"=",
"fputs",
"(",
"$",
"this",
"->",
"resource",
",",
"$",
"data",
",",
"strlen",
"(",
"$",
"data",
")",
")",
";",
"if",
"(",
"false",
"===",
"$",
... | write data to socket
@param string $data data to write
@return int amount of bytes written to socket
@throws \stubbles\peer\ConnectionFailure
@throws \stubbles\peer\Timeout | [
"write",
"data",
"to",
"socket"
] | dc8b0a517dc4c84b615cc3c88f0d64a2b742f9cc | https://github.com/stubbles/stubbles-peer/blob/dc8b0a517dc4c84b615cc3c88f0d64a2b742f9cc/src/main/php/Stream.php#L192-L209 |
203,269 | sil-project/VarietyBundle | src/Controller/VarietyCRUDController.php | VarietyCRUDController.strainAction | public function strainAction()
{
$id = $this->getRequest()->get($this->admin->getIdParameter());
$object = $this->admin->getObject($id);
$strain = clone $object;
$strain->setIsStrain(true);
$strain->setParent($object);
$fieldSets = ['Professional', 'Amateur', 'Produ... | php | public function strainAction()
{
$id = $this->getRequest()->get($this->admin->getIdParameter());
$object = $this->admin->getObject($id);
$strain = clone $object;
$strain->setIsStrain(true);
$strain->setParent($object);
$fieldSets = ['Professional', 'Amateur', 'Produ... | [
"public",
"function",
"strainAction",
"(",
")",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
"->",
"get",
"(",
"$",
"this",
"->",
"admin",
"->",
"getIdParameter",
"(",
")",
")",
";",
"$",
"object",
"=",
"$",
"this",
"->",
"admin"... | Creates a strain from a variety and passes it to create action.
@return Response | [
"Creates",
"a",
"strain",
"from",
"a",
"variety",
"and",
"passes",
"it",
"to",
"create",
"action",
"."
] | e9508ce13a4bb277d10bdcd925fdb84bc01f453f | https://github.com/sil-project/VarietyBundle/blob/e9508ce13a4bb277d10bdcd925fdb84bc01f453f/src/Controller/VarietyCRUDController.php#L52-L82 |
203,270 | sil-project/VarietyBundle | src/Controller/VarietyCRUDController.php | VarietyCRUDController.getFilterWidgetAction | public function getFilterWidgetAction(Request $request)
{
$translator = $this->get('translator');
$fieldSet = $request->get('fieldset');
$field = $request->get('field');
$config = $this->admin->getConfigurationPool()->getContainer()->getParameter('librinfo_varieties');
$fiel... | php | public function getFilterWidgetAction(Request $request)
{
$translator = $this->get('translator');
$fieldSet = $request->get('fieldset');
$field = $request->get('field');
$config = $this->admin->getConfigurationPool()->getContainer()->getParameter('librinfo_varieties');
$fiel... | [
"public",
"function",
"getFilterWidgetAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"translator",
"=",
"$",
"this",
"->",
"get",
"(",
"'translator'",
")",
";",
"$",
"fieldSet",
"=",
"$",
"request",
"->",
"get",
"(",
"'fieldset'",
")",
";",
"$",... | Get field widget for filter form.
@param string $fieldName the name of the field to get the form widget for
@return JsonResponse | [
"Get",
"field",
"widget",
"for",
"filter",
"form",
"."
] | e9508ce13a4bb277d10bdcd925fdb84bc01f453f | https://github.com/sil-project/VarietyBundle/blob/e9508ce13a4bb277d10bdcd925fdb84bc01f453f/src/Controller/VarietyCRUDController.php#L91-L155 |
203,271 | wb-crowdfusion/crowdfusion | system/core/classes/libraries/errors/ErrorHandler.php | ErrorHandler.handleErrors | public function handleErrors($severity, $message, $filepath, $line)
{
if (error_reporting() == 0 || $severity == E_STRICT)
return;
if (false !== strpos($filepath, '/')) {
$x = explode('/', $filepath);
$filepath = $x[count($x)-3].'/'.$x[count($x)-2].'/'.end($x);
... | php | public function handleErrors($severity, $message, $filepath, $line)
{
if (error_reporting() == 0 || $severity == E_STRICT)
return;
if (false !== strpos($filepath, '/')) {
$x = explode('/', $filepath);
$filepath = $x[count($x)-3].'/'.$x[count($x)-2].'/'.end($x);
... | [
"public",
"function",
"handleErrors",
"(",
"$",
"severity",
",",
"$",
"message",
",",
"$",
"filepath",
",",
"$",
"line",
")",
"{",
"if",
"(",
"error_reporting",
"(",
")",
"==",
"0",
"||",
"$",
"severity",
"==",
"E_STRICT",
")",
"return",
";",
"if",
"... | Defines the error handler that will be used when this class is created.
Using error_log, this function will record the error.
@param string $severity The severity of the error
@param string $message The error message
@param string $filepath The file where the error was encountered
@param string $line The line nu... | [
"Defines",
"the",
"error",
"handler",
"that",
"will",
"be",
"used",
"when",
"this",
"class",
"is",
"created",
"."
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/errors/ErrorHandler.php#L140-L179 |
203,272 | wb-crowdfusion/crowdfusion | system/core/classes/libraries/errors/ErrorHandler.php | ErrorHandler.handleExceptions | public function handleExceptions($exception)
{
$this->displayError($exception);
$this->sendErrorNotification($exception);
if(isset($this->ApplicationContext) && ($this->ApplicationContext->isOneOffRedeploy() || $this->redeployOnError))
$this->ApplicationContext->clearContextFile... | php | public function handleExceptions($exception)
{
$this->displayError($exception);
$this->sendErrorNotification($exception);
if(isset($this->ApplicationContext) && ($this->ApplicationContext->isOneOffRedeploy() || $this->redeployOnError))
$this->ApplicationContext->clearContextFile... | [
"public",
"function",
"handleExceptions",
"(",
"$",
"exception",
")",
"{",
"$",
"this",
"->",
"displayError",
"(",
"$",
"exception",
")",
";",
"$",
"this",
"->",
"sendErrorNotification",
"(",
"$",
"exception",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"thi... | Defines the exception handler to use.
@param Exception $exception The exception to handle
@return void | [
"Defines",
"the",
"exception",
"handler",
"to",
"use",
"."
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/errors/ErrorHandler.php#L234-L241 |
203,273 | translationexchange/tml-php-clientsdk | library/Tr8n/Utils/BrowserUtils.php | BrowserUtils.matchLanguage | public static function matchLanguage($a, $b) {
$a = explode('-', $a);
$b = explode('-', $b);
for ($i=0, $n=min(count($a), count($b)); $i<$n; $i++) {
if ($a[$i] !== $b[$i]) break;
}
return $i === 0 ? 0 : (float) $i / count($a);
} | php | public static function matchLanguage($a, $b) {
$a = explode('-', $a);
$b = explode('-', $b);
for ($i=0, $n=min(count($a), count($b)); $i<$n; $i++) {
if ($a[$i] !== $b[$i]) break;
}
return $i === 0 ? 0 : (float) $i / count($a);
} | [
"public",
"static",
"function",
"matchLanguage",
"(",
"$",
"a",
",",
"$",
"b",
")",
"{",
"$",
"a",
"=",
"explode",
"(",
"'-'",
",",
"$",
"a",
")",
";",
"$",
"b",
"=",
"explode",
"(",
"'-'",
",",
"$",
"b",
")",
";",
"for",
"(",
"$",
"i",
"="... | compare two language tags and distinguish the degree of matching | [
"compare",
"two",
"language",
"tags",
"and",
"distinguish",
"the",
"degree",
"of",
"matching"
] | fe51473824e62cfd883c6aa0c6a3783a16ce8425 | https://github.com/translationexchange/tml-php-clientsdk/blob/fe51473824e62cfd883c6aa0c6a3783a16ce8425/library/Tr8n/Utils/BrowserUtils.php#L69-L76 |
203,274 | Beotie/Beotie-PSR7-stream | src/Stream/Factory/FileInfoStreamFactory.php | FileInfoStreamFactory.paramHasContent | protected function paramHasContent(array $params, string $method = 'getStream') : bool
{
if (!array_key_exists(self::ARRAY_KEY, $params)) {
throw new \RuntimeException(
sprintf(
'The "%s::%s" expect a file array key to build an instance of FileInfoStreamAdapte... | php | protected function paramHasContent(array $params, string $method = 'getStream') : bool
{
if (!array_key_exists(self::ARRAY_KEY, $params)) {
throw new \RuntimeException(
sprintf(
'The "%s::%s" expect a file array key to build an instance of FileInfoStreamAdapte... | [
"protected",
"function",
"paramHasContent",
"(",
"array",
"$",
"params",
",",
"string",
"$",
"method",
"=",
"'getStream'",
")",
":",
"bool",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"self",
"::",
"ARRAY_KEY",
",",
"$",
"params",
")",
")",
"{",
"thro... | Param has content
This method aim to validate the existance of a 'inner_content' key into the parameters array.
@param array $params The original method parameters validated by the function
@param string $method The original method name. This parameter is used to build the exception message
@throws \RuntimeExceptio... | [
"Param",
"has",
"content"
] | 8f4f4bfb8252e392fc17eed2a2b0682c4e9d08ca | https://github.com/Beotie/Beotie-PSR7-stream/blob/8f4f4bfb8252e392fc17eed2a2b0682c4e9d08ca/src/Stream/Factory/FileInfoStreamFactory.php#L92-L105 |
203,275 | Beotie/Beotie-PSR7-stream | src/Stream/Factory/FileInfoStreamFactory.php | FileInfoStreamFactory.contentIsFileInfo | protected function contentIsFileInfo($file, string $method = 'getStream') : bool
{
if (! $file instanceof \SplFileInfo) {
$message = 'The "%s::%s" expect the file array key to be an instance of "%s". "%s" given';
$givenType = (is_object($file) ? get_class($file) : gettype($file));
... | php | protected function contentIsFileInfo($file, string $method = 'getStream') : bool
{
if (! $file instanceof \SplFileInfo) {
$message = 'The "%s::%s" expect the file array key to be an instance of "%s". "%s" given';
$givenType = (is_object($file) ? get_class($file) : gettype($file));
... | [
"protected",
"function",
"contentIsFileInfo",
"(",
"$",
"file",
",",
"string",
"$",
"method",
"=",
"'getStream'",
")",
":",
"bool",
"{",
"if",
"(",
"!",
"$",
"file",
"instanceof",
"\\",
"SplFileInfo",
")",
"{",
"$",
"message",
"=",
"'The \"%s::%s\" expect th... | Content is FileInfo
This method validate the instance of the given content parameter. This type is expected to be SplFileInfo.
@param mixed $file The file which the method aim to validate the type
@param string $method The original method name. This parameter is used to define the exception message
@throws \Runti... | [
"Content",
"is",
"FileInfo"
] | 8f4f4bfb8252e392fc17eed2a2b0682c4e9d08ca | https://github.com/Beotie/Beotie-PSR7-stream/blob/8f4f4bfb8252e392fc17eed2a2b0682c4e9d08ca/src/Stream/Factory/FileInfoStreamFactory.php#L118-L128 |
203,276 | itcreator/custom-cmf | Module/Data/src/Cmf/Data/Filter/StripTags.php | StripTags._filterTag | protected function _filterTag($tag)
{
// Parse the tag into:
// 1. a starting delimiter (mandatory)
// 2. a tag name (if available)
// 3. a string of attributes (if available)
// 4. an ending delimiter (if available)
$isMatch = preg_match('~(</?)(\w*)((/(?!>)|[^/>])*)... | php | protected function _filterTag($tag)
{
// Parse the tag into:
// 1. a starting delimiter (mandatory)
// 2. a tag name (if available)
// 3. a string of attributes (if available)
// 4. an ending delimiter (if available)
$isMatch = preg_match('~(</?)(\w*)((/(?!>)|[^/>])*)... | [
"protected",
"function",
"_filterTag",
"(",
"$",
"tag",
")",
"{",
"// Parse the tag into:",
"// 1. a starting delimiter (mandatory)",
"// 2. a tag name (if available)",
"// 3. a string of attributes (if available)",
"// 4. an ending delimiter (if available)",
"$",
"isMatch",
"=",
"pr... | Filters a single tag against the current option settings
@param string $tag
@return string | [
"Filters",
"a",
"single",
"tag",
"against",
"the",
"current",
"option",
"settings"
] | 42fc0535dfa0f641856f06673f6ab596b2020c40 | https://github.com/itcreator/custom-cmf/blob/42fc0535dfa0f641856f06673f6ab596b2020c40/Module/Data/src/Cmf/Data/Filter/StripTags.php#L237-L295 |
203,277 | phpguard/listen | src/PhpGuard/Listen/Adapter/BasicAdapter.php | BasicAdapter.initialize | public function initialize(Listener $listener)
{
$this->listener = $listener;
$this->topDirs = array_merge($this->topDirs,$listener->getPaths());
$this->tracker->initialize($listener);
} | php | public function initialize(Listener $listener)
{
$this->listener = $listener;
$this->topDirs = array_merge($this->topDirs,$listener->getPaths());
$this->tracker->initialize($listener);
} | [
"public",
"function",
"initialize",
"(",
"Listener",
"$",
"listener",
")",
"{",
"$",
"this",
"->",
"listener",
"=",
"$",
"listener",
";",
"$",
"this",
"->",
"topDirs",
"=",
"array_merge",
"(",
"$",
"this",
"->",
"topDirs",
",",
"$",
"listener",
"->",
"... | Initialize a listener
@param Listener $listener
@return void | [
"Initialize",
"a",
"listener"
] | cd0cda150858d6d85deb025a72996873d2af3532 | https://github.com/phpguard/listen/blob/cd0cda150858d6d85deb025a72996873d2af3532/src/PhpGuard/Listen/Adapter/BasicAdapter.php#L46-L51 |
203,278 | phpguard/listen | src/PhpGuard/Listen/Adapter/BasicAdapter.php | BasicAdapter.doCleanup | private function doCleanup($unchecked)
{
$tracker = $this->tracker;
/* @var \PhpGuard\Listen\Resource\TrackedObject $tracked */
foreach($unchecked as $id=>$tracked){
$origin = $tracked->getResource();
if(!$origin->isExists()){
$tracker->addChangeSet($t... | php | private function doCleanup($unchecked)
{
$tracker = $this->tracker;
/* @var \PhpGuard\Listen\Resource\TrackedObject $tracked */
foreach($unchecked as $id=>$tracked){
$origin = $tracked->getResource();
if(!$origin->isExists()){
$tracker->addChangeSet($t... | [
"private",
"function",
"doCleanup",
"(",
"$",
"unchecked",
")",
"{",
"$",
"tracker",
"=",
"$",
"this",
"->",
"tracker",
";",
"/* @var \\PhpGuard\\Listen\\Resource\\TrackedObject $tracked */",
"foreach",
"(",
"$",
"unchecked",
"as",
"$",
"id",
"=>",
"$",
"tracked",... | Track any undetected changes
such as recursive directory delete | [
"Track",
"any",
"undetected",
"changes",
"such",
"as",
"recursive",
"directory",
"delete"
] | cd0cda150858d6d85deb025a72996873d2af3532 | https://github.com/phpguard/listen/blob/cd0cda150858d6d85deb025a72996873d2af3532/src/PhpGuard/Listen/Adapter/BasicAdapter.php#L89-L101 |
203,279 | shgysk8zer0/core_api | traits/http_auth.php | HTTP_Auth.authenticateBasic | final public function authenticateBasic($realm = null)
{
if (! (
array_key_exists('PHP_AUTH_USER', $_SERVER)
and array_key_exists('PHP_AUTH_PW', $_SERVER))
and ! empty($_SERVER['PHP_AUTH_USER'])
and ! empty($_SERER['PHP_AUTH_PW'])
) {
$this->HTTPAuthenticate('Basic', array('realm' => $realm));
re... | php | final public function authenticateBasic($realm = null)
{
if (! (
array_key_exists('PHP_AUTH_USER', $_SERVER)
and array_key_exists('PHP_AUTH_PW', $_SERVER))
and ! empty($_SERVER['PHP_AUTH_USER'])
and ! empty($_SERER['PHP_AUTH_PW'])
) {
$this->HTTPAuthenticate('Basic', array('realm' => $realm));
re... | [
"final",
"public",
"function",
"authenticateBasic",
"(",
"$",
"realm",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"(",
"array_key_exists",
"(",
"'PHP_AUTH_USER'",
",",
"$",
"_SERVER",
")",
"and",
"array_key_exists",
"(",
"'PHP_AUTH_PW'",
",",
"$",
"_SERVER",
")"... | Checks for credentials in HTTP headers for "Basic" authentication
@param string $realm
@return bool | [
"Checks",
"for",
"credentials",
"in",
"HTTP",
"headers",
"for",
"Basic",
"authentication"
] | 9e9b8baf761af874b95256ad2462e55fbb2b2e58 | https://github.com/shgysk8zer0/core_api/blob/9e9b8baf761af874b95256ad2462e55fbb2b2e58/traits/http_auth.php#L48-L63 |
203,280 | ThomasSquall/PHPMagicAnnotations | src/Reflection/ReflectionBase.php | ReflectionBase.hasAnnotation | public function hasAnnotation($name)
{
$result = false;
if (!string_ends_with($name, 'Annotation')) $name .= 'Annotation';
foreach ($this->annotations as $annotation)
{
$class = get_class($annotation);
if (string_starts_with($class, "\\") && !string_starts_... | php | public function hasAnnotation($name)
{
$result = false;
if (!string_ends_with($name, 'Annotation')) $name .= 'Annotation';
foreach ($this->annotations as $annotation)
{
$class = get_class($annotation);
if (string_starts_with($class, "\\") && !string_starts_... | [
"public",
"function",
"hasAnnotation",
"(",
"$",
"name",
")",
"{",
"$",
"result",
"=",
"false",
";",
"if",
"(",
"!",
"string_ends_with",
"(",
"$",
"name",
",",
"'Annotation'",
")",
")",
"$",
"name",
".=",
"'Annotation'",
";",
"foreach",
"(",
"$",
"this... | Tells if the reflection object has the given annotation or not.
@param string $name
@return bool | [
"Tells",
"if",
"the",
"reflection",
"object",
"has",
"the",
"given",
"annotation",
"or",
"not",
"."
] | 3a733fa6e1ca9ebdfdfb7250f67e7aceb6a4c001 | https://github.com/ThomasSquall/PHPMagicAnnotations/blob/3a733fa6e1ca9ebdfdfb7250f67e7aceb6a4c001/src/Reflection/ReflectionBase.php#L20-L43 |
203,281 | ThomasSquall/PHPMagicAnnotations | src/Reflection/ReflectionBase.php | ReflectionBase.getAnnotation | public function getAnnotation($name)
{
$result = null;
if ($this->hasAnnotationAndReturn($name))
{
if (!string_ends_with($name, 'Annotation')) $name .= 'Annotation';
$result = isset($this->annotations[$name]) ? $this->annotations[$name] : null;
if ($res... | php | public function getAnnotation($name)
{
$result = null;
if ($this->hasAnnotationAndReturn($name))
{
if (!string_ends_with($name, 'Annotation')) $name .= 'Annotation';
$result = isset($this->annotations[$name]) ? $this->annotations[$name] : null;
if ($res... | [
"public",
"function",
"getAnnotation",
"(",
"$",
"name",
")",
"{",
"$",
"result",
"=",
"null",
";",
"if",
"(",
"$",
"this",
"->",
"hasAnnotationAndReturn",
"(",
"$",
"name",
")",
")",
"{",
"if",
"(",
"!",
"string_ends_with",
"(",
"$",
"name",
",",
"'... | Returns the requested annotation.
@param string $name
@return Annotation|null | [
"Returns",
"the",
"requested",
"annotation",
"."
] | 3a733fa6e1ca9ebdfdfb7250f67e7aceb6a4c001 | https://github.com/ThomasSquall/PHPMagicAnnotations/blob/3a733fa6e1ca9ebdfdfb7250f67e7aceb6a4c001/src/Reflection/ReflectionBase.php#L76-L100 |
203,282 | native5/native5-sdk-client-php | src/Native5/Sessions/WebSessionManager.php | WebSessionManager.isActiveSession | public function isActiveSession()
{
// Check if session timeout is defined in application settings
$sessionConfig = $GLOBALS['app']->getConfiguration()->getRawConfiguration('session');
if (!empty($sessionConfig) && isset($sessionConfig['timeout']) && !empty($sessionConfig['timeout'])) {
... | php | public function isActiveSession()
{
// Check if session timeout is defined in application settings
$sessionConfig = $GLOBALS['app']->getConfiguration()->getRawConfiguration('session');
if (!empty($sessionConfig) && isset($sessionConfig['timeout']) && !empty($sessionConfig['timeout'])) {
... | [
"public",
"function",
"isActiveSession",
"(",
")",
"{",
"// Check if session timeout is defined in application settings",
"$",
"sessionConfig",
"=",
"$",
"GLOBALS",
"[",
"'app'",
"]",
"->",
"getConfiguration",
"(",
")",
"->",
"getRawConfiguration",
"(",
"'session'",
")"... | Checks if session is currently active.
@access public
@return boolean | [
"Checks",
"if",
"session",
"is",
"currently",
"active",
"."
] | e1f598cf27654d81bb5facace1990b737242a2f9 | https://github.com/native5/native5-sdk-client-php/blob/e1f598cf27654d81bb5facace1990b737242a2f9/src/Native5/Sessions/WebSessionManager.php#L175-L193 |
203,283 | native5/native5-sdk-client-php | src/Native5/Sessions/WebSessionManager.php | WebSessionManager.resetActiveSession | public static function resetActiveSession()
{
// Strip '.'
$appContext = rtrim($GLOBALS['app']->getConfiguration()->getApplicationContext(), '.');
if (empty($appContext)) {
$appContext = "/";
} else {
$appContext = "/".$appContext."/";
}
$cate... | php | public static function resetActiveSession()
{
// Strip '.'
$appContext = rtrim($GLOBALS['app']->getConfiguration()->getApplicationContext(), '.');
if (empty($appContext)) {
$appContext = "/";
} else {
$appContext = "/".$appContext."/";
}
$cate... | [
"public",
"static",
"function",
"resetActiveSession",
"(",
")",
"{",
"// Strip '.'",
"$",
"appContext",
"=",
"rtrim",
"(",
"$",
"GLOBALS",
"[",
"'app'",
"]",
"->",
"getConfiguration",
"(",
")",
"->",
"getApplicationContext",
"(",
")",
",",
"'.'",
")",
";",
... | Resets currently active session.
@access public
@return void | [
"Resets",
"currently",
"active",
"session",
"."
] | e1f598cf27654d81bb5facace1990b737242a2f9 | https://github.com/native5/native5-sdk-client-php/blob/e1f598cf27654d81bb5facace1990b737242a2f9/src/Native5/Sessions/WebSessionManager.php#L202-L225 |
203,284 | MindyPHP/QueryBuilder | Database/Pgsql/Adapter.php | Adapter.sqlCheckIntegrity | public function sqlCheckIntegrity($check = true, $schema = '', $table = '')
{
if (empty($schema) && empty($table)) {
return 'SET CONSTRAINTS ALL '.($check ? 'IMMEDIATE' : 'DEFERRED');
}
return sprintf(
'ALTER TABLE %s.%s %s TRIGGER ALL',
$this->ge... | php | public function sqlCheckIntegrity($check = true, $schema = '', $table = '')
{
if (empty($schema) && empty($table)) {
return 'SET CONSTRAINTS ALL '.($check ? 'IMMEDIATE' : 'DEFERRED');
}
return sprintf(
'ALTER TABLE %s.%s %s TRIGGER ALL',
$this->ge... | [
"public",
"function",
"sqlCheckIntegrity",
"(",
"$",
"check",
"=",
"true",
",",
"$",
"schema",
"=",
"''",
",",
"$",
"table",
"=",
"''",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"schema",
")",
"&&",
"empty",
"(",
"$",
"table",
")",
")",
"{",
"retur... | Builds a SQL statement for enabling or disabling integrity check.
@param bool $check whether to turn on or off the integrity check
@param string $schema the schema of the tables
@param string $table the table name
@return string the SQL statement for checking integrity | [
"Builds",
"a",
"SQL",
"statement",
"for",
"enabling",
"or",
"disabling",
"integrity",
"check",
"."
] | fc486454786f3d38887dd7246802ea11e2954e54 | https://github.com/MindyPHP/QueryBuilder/blob/fc486454786f3d38887dd7246802ea11e2954e54/Database/Pgsql/Adapter.php#L28-L40 |
203,285 | linpax/microphp-framework | src/web/Identity.php | Identity.addCookie | public function addCookie(
$name,
$value,
$expire = 0,
$path = '/',
$domain = '',
$secure = false,
$httpOnly = true
) {
return (new CookieInjector)->build()->set($name, $value, $expire, $path, $domain, $secure, $httpOnly);
} | php | public function addCookie(
$name,
$value,
$expire = 0,
$path = '/',
$domain = '',
$secure = false,
$httpOnly = true
) {
return (new CookieInjector)->build()->set($name, $value, $expire, $path, $domain, $secure, $httpOnly);
} | [
"public",
"function",
"addCookie",
"(",
"$",
"name",
",",
"$",
"value",
",",
"$",
"expire",
"=",
"0",
",",
"$",
"path",
"=",
"'/'",
",",
"$",
"domain",
"=",
"''",
",",
"$",
"secure",
"=",
"false",
",",
"$",
"httpOnly",
"=",
"true",
")",
"{",
"r... | Add data into cookie
@access public
@param string $name cookie name
@param mixed $value data value
@param int $expire life time
@param string $path path access cookie
@param string $domain domain access cookie
@param bool $secure use SSL?
@param bool $httpOnly disable on JS?
@return mixed
@throws Exception | [
"Add",
"data",
"into",
"cookie"
] | 11f3370f3f64c516cce9b84ecd8276c6e9ae8df9 | https://github.com/linpax/microphp-framework/blob/11f3370f3f64c516cce9b84ecd8276c6e9ae8df9/src/web/Identity.php#L89-L99 |
203,286 | pryley/castor-framework | src/Forms/Fields/Base.php | Base.generateDescription | public function generateDescription( $paragraph = true )
{
if( !isset( $this->args['desc'] ) || !$this->args['desc'] )return;
$tag = ( !!$paragraph || $paragraph == 'p' ) ? 'p' : 'span';
return sprintf( '<%1$s class="description">%2$s</%1$s>', $tag, $this->args['desc'] );
} | php | public function generateDescription( $paragraph = true )
{
if( !isset( $this->args['desc'] ) || !$this->args['desc'] )return;
$tag = ( !!$paragraph || $paragraph == 'p' ) ? 'p' : 'span';
return sprintf( '<%1$s class="description">%2$s</%1$s>', $tag, $this->args['desc'] );
} | [
"public",
"function",
"generateDescription",
"(",
"$",
"paragraph",
"=",
"true",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"args",
"[",
"'desc'",
"]",
")",
"||",
"!",
"$",
"this",
"->",
"args",
"[",
"'desc'",
"]",
")",
"return",
";... | Generate the field description
@param bool $paragraph
@return null|string | [
"Generate",
"the",
"field",
"description"
] | cbc137d02625cd05f4cc96414d6f70e451cb821f | https://github.com/pryley/castor-framework/blob/cbc137d02625cd05f4cc96414d6f70e451cb821f/src/Forms/Fields/Base.php#L72-L79 |
203,287 | pryley/castor-framework | src/Forms/Fields/Base.php | Base.implodeOptions | protected function implodeOptions( $method = 'select_option', $default = null )
{
$this->args['default'] ?: $this->args['default'] = $default;
$method = $this->camelCase( $method );
$method = method_exists( $this, $method )
? $method
: 'selectOption';
$i = 0;
if( $method === 'singleInput' ) {
i... | php | protected function implodeOptions( $method = 'select_option', $default = null )
{
$this->args['default'] ?: $this->args['default'] = $default;
$method = $this->camelCase( $method );
$method = method_exists( $this, $method )
? $method
: 'selectOption';
$i = 0;
if( $method === 'singleInput' ) {
i... | [
"protected",
"function",
"implodeOptions",
"(",
"$",
"method",
"=",
"'select_option'",
",",
"$",
"default",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"args",
"[",
"'default'",
"]",
"?",
":",
"$",
"this",
"->",
"args",
"[",
"'default'",
"]",
"=",
"$",
... | Implode multi-field items
@return null|string | [
"Implode",
"multi",
"-",
"field",
"items"
] | cbc137d02625cd05f4cc96414d6f70e451cb821f | https://github.com/pryley/castor-framework/blob/cbc137d02625cd05f4cc96414d6f70e451cb821f/src/Forms/Fields/Base.php#L133-L161 |
203,288 | pryley/castor-framework | src/Forms/Fields/Base.php | Base.normalize | protected function normalize( array $defaults = [], $implode = false )
{
$args = $this->mergeAttributesWith( $defaults );
$normalize = new Normalizer;
return ( $this->element && method_exists( $normalize, $this->element ))
? $normalize->{$this->element}( $args, $implode )
: ( !!$implode ? '' : [] );
} | php | protected function normalize( array $defaults = [], $implode = false )
{
$args = $this->mergeAttributesWith( $defaults );
$normalize = new Normalizer;
return ( $this->element && method_exists( $normalize, $this->element ))
? $normalize->{$this->element}( $args, $implode )
: ( !!$implode ? '' : [] );
} | [
"protected",
"function",
"normalize",
"(",
"array",
"$",
"defaults",
"=",
"[",
"]",
",",
"$",
"implode",
"=",
"false",
")",
"{",
"$",
"args",
"=",
"$",
"this",
"->",
"mergeAttributesWith",
"(",
"$",
"defaults",
")",
";",
"$",
"normalize",
"=",
"new",
... | Normalize attributes for this specific field type
@param bool|string $implode
@return array|string | [
"Normalize",
"attributes",
"for",
"this",
"specific",
"field",
"type"
] | cbc137d02625cd05f4cc96414d6f70e451cb821f | https://github.com/pryley/castor-framework/blob/cbc137d02625cd05f4cc96414d6f70e451cb821f/src/Forms/Fields/Base.php#L170-L179 |
203,289 | pryley/castor-framework | src/Forms/Fields/Base.php | Base.multiInput | protected function multiInput( $optionKey, $number, $type = 'radio' )
{
$args = $this->multiInputArgs( $type, $optionKey, $number );
if( !$args )return;
$attributes = '';
foreach( $args['attributes'] as $key => $val ) {
$attributes .= sprintf( '%s="%s" ', $key, $val );
}
return sprintf( '<li><label ... | php | protected function multiInput( $optionKey, $number, $type = 'radio' )
{
$args = $this->multiInputArgs( $type, $optionKey, $number );
if( !$args )return;
$attributes = '';
foreach( $args['attributes'] as $key => $val ) {
$attributes .= sprintf( '%s="%s" ', $key, $val );
}
return sprintf( '<li><label ... | [
"protected",
"function",
"multiInput",
"(",
"$",
"optionKey",
",",
"$",
"number",
",",
"$",
"type",
"=",
"'radio'",
")",
"{",
"$",
"args",
"=",
"$",
"this",
"->",
"multiInputArgs",
"(",
"$",
"type",
",",
"$",
"optionKey",
",",
"$",
"number",
")",
";"... | Generate checkboxes and radios
@param string $optionKey
@param string $number
@param string $type
@return null|string | [
"Generate",
"checkboxes",
"and",
"radios"
] | cbc137d02625cd05f4cc96414d6f70e451cb821f | https://github.com/pryley/castor-framework/blob/cbc137d02625cd05f4cc96414d6f70e451cb821f/src/Forms/Fields/Base.php#L209-L227 |
203,290 | pryley/castor-framework | src/Forms/Fields/Base.php | Base.selectOption | protected function selectOption( $optionKey )
{
return sprintf( '<option value="%s"%s>%s</option>',
$optionKey,
selected( $this->args['value'], $optionKey, false ),
$this->args['options'][ $optionKey ]
);
} | php | protected function selectOption( $optionKey )
{
return sprintf( '<option value="%s"%s>%s</option>',
$optionKey,
selected( $this->args['value'], $optionKey, false ),
$this->args['options'][ $optionKey ]
);
} | [
"protected",
"function",
"selectOption",
"(",
"$",
"optionKey",
")",
"{",
"return",
"sprintf",
"(",
"'<option value=\"%s\"%s>%s</option>'",
",",
"$",
"optionKey",
",",
"selected",
"(",
"$",
"this",
"->",
"args",
"[",
"'value'",
"]",
",",
"$",
"optionKey",
",",... | Generate select options
@param string $optionKey
@return string | [
"Generate",
"select",
"options"
] | cbc137d02625cd05f4cc96414d6f70e451cb821f | https://github.com/pryley/castor-framework/blob/cbc137d02625cd05f4cc96414d6f70e451cb821f/src/Forms/Fields/Base.php#L312-L319 |
203,291 | pryley/castor-framework | src/Forms/Fields/Base.php | Base.singleInput | protected function singleInput( $type = 'checkbox' )
{
$optionKey = key( $this->args['options'] );
$args = $this->multiInputArgs( $type, $optionKey, 1 );
if( !$args )return;
$atts = $this->normalize();
$atts = wp_parse_args( $args['attributes'], $atts );
$attributes = '';
foreach( $atts as $key => $... | php | protected function singleInput( $type = 'checkbox' )
{
$optionKey = key( $this->args['options'] );
$args = $this->multiInputArgs( $type, $optionKey, 1 );
if( !$args )return;
$atts = $this->normalize();
$atts = wp_parse_args( $args['attributes'], $atts );
$attributes = '';
foreach( $atts as $key => $... | [
"protected",
"function",
"singleInput",
"(",
"$",
"type",
"=",
"'checkbox'",
")",
"{",
"$",
"optionKey",
"=",
"key",
"(",
"$",
"this",
"->",
"args",
"[",
"'options'",
"]",
")",
";",
"$",
"args",
"=",
"$",
"this",
"->",
"multiInputArgs",
"(",
"$",
"ty... | Generate a single checkbox
@param string $type
@return null|string | [
"Generate",
"a",
"single",
"checkbox"
] | cbc137d02625cd05f4cc96414d6f70e451cb821f | https://github.com/pryley/castor-framework/blob/cbc137d02625cd05f4cc96414d6f70e451cb821f/src/Forms/Fields/Base.php#L328-L351 |
203,292 | erenmustafaozdal/laravel-modules-base | src/Controllers/DataTableTrait.php | DataTableTrait.setColumns | public function setColumns(array $columns)
{
// add columns
foreach($columns['add'] as $key => $value) {
$this->dataTables->addColumn($key, $value);
}
// edit columns
foreach($columns['edit'] as $key => $value) {
$this->dataTables->editColumn($key, $v... | php | public function setColumns(array $columns)
{
// add columns
foreach($columns['add'] as $key => $value) {
$this->dataTables->addColumn($key, $value);
}
// edit columns
foreach($columns['edit'] as $key => $value) {
$this->dataTables->editColumn($key, $v... | [
"public",
"function",
"setColumns",
"(",
"array",
"$",
"columns",
")",
"{",
"// add columns",
"foreach",
"(",
"$",
"columns",
"[",
"'add'",
"]",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"dataTables",
"->",
"addColumn",
"(",
"$... | set data table columns
@param array $columns [array('add' => ..., 'edit' => ...,'remove' => ...)]
@return void | [
"set",
"data",
"table",
"columns"
] | c26600543817642926bcf16ada84009e00d784e0 | https://github.com/erenmustafaozdal/laravel-modules-base/blob/c26600543817642926bcf16ada84009e00d784e0/src/Controllers/DataTableTrait.php#L56-L72 |
203,293 | erenmustafaozdal/laravel-modules-base | src/Controllers/DataTableTrait.php | DataTableTrait.getDefaultUrls | private function getDefaultUrls($model)
{
$slug = getModelSlug($model);
return [
'details' => lmbRoute("api.{$slug}.detail", ['id' => $model->id]),
'fast_edit' => lmbRoute("api.{$slug}.fastEdit", ['id' => $model->id]),
'edit' => lmbRoute("api.{$slug}.update... | php | private function getDefaultUrls($model)
{
$slug = getModelSlug($model);
return [
'details' => lmbRoute("api.{$slug}.detail", ['id' => $model->id]),
'fast_edit' => lmbRoute("api.{$slug}.fastEdit", ['id' => $model->id]),
'edit' => lmbRoute("api.{$slug}.update... | [
"private",
"function",
"getDefaultUrls",
"(",
"$",
"model",
")",
"{",
"$",
"slug",
"=",
"getModelSlug",
"(",
"$",
"model",
")",
";",
"return",
"[",
"'details'",
"=>",
"lmbRoute",
"(",
"\"api.{$slug}.detail\"",
",",
"[",
"'id'",
"=>",
"$",
"model",
"->",
... | get default urls for Datatables
@param \Illuminate\Database\Eloquent\Model $model
@return array | [
"get",
"default",
"urls",
"for",
"Datatables"
] | c26600543817642926bcf16ada84009e00d784e0 | https://github.com/erenmustafaozdal/laravel-modules-base/blob/c26600543817642926bcf16ada84009e00d784e0/src/Controllers/DataTableTrait.php#L99-L109 |
203,294 | Eden-PHP/Block | Component/Pagination.php | Pagination.setShow | public function setShow($show)
{
Argument::i()->test(1, 'int');
if($show < 1) {
$show = 1;
}
$this->show = $show;
return $this;
} | php | public function setShow($show)
{
Argument::i()->test(1, 'int');
if($show < 1) {
$show = 1;
}
$this->show = $show;
return $this;
} | [
"public",
"function",
"setShow",
"(",
"$",
"show",
")",
"{",
"Argument",
"::",
"i",
"(",
")",
"->",
"test",
"(",
"1",
",",
"'int'",
")",
";",
"if",
"(",
"$",
"show",
"<",
"1",
")",
"{",
"$",
"show",
"=",
"1",
";",
"}",
"$",
"this",
"->",
"s... | Sets pages to show left and right of the current page
@param int
@return Eden\Block\Component\Pagination | [
"Sets",
"pages",
"to",
"show",
"left",
"and",
"right",
"of",
"the",
"current",
"page"
] | 681b9f01dd118612d0fced84d2f702167b52109b | https://github.com/Eden-PHP/Block/blob/681b9f01dd118612d0fced84d2f702167b52109b/Component/Pagination.php#L146-L156 |
203,295 | Wedeto/DB | src/Query/ConstantArray.php | ConstantArray.toSQL | public function toSQL(Parameters $params, bool $inner_clause)
{
if ($key = $this->getKey())
{
try
{
$params->get($key);
}
catch (\OutOfRangeException $e)
{
// Not a valid key, replace
$key = n... | php | public function toSQL(Parameters $params, bool $inner_clause)
{
if ($key = $this->getKey())
{
try
{
$params->get($key);
}
catch (\OutOfRangeException $e)
{
// Not a valid key, replace
$key = n... | [
"public",
"function",
"toSQL",
"(",
"Parameters",
"$",
"params",
",",
"bool",
"$",
"inner_clause",
")",
"{",
"if",
"(",
"$",
"key",
"=",
"$",
"this",
"->",
"getKey",
"(",
")",
")",
"{",
"try",
"{",
"$",
"params",
"->",
"get",
"(",
"$",
"key",
")"... | Write a constant array clause as SQL query syntax
@param Parameters $params The query parameters: tables and placeholder values
@return string The generated SQL | [
"Write",
"a",
"constant",
"array",
"clause",
"as",
"SQL",
"query",
"syntax"
] | 715f8f2e3ae6b53c511c40b620921cb9c87e6f62 | https://github.com/Wedeto/DB/blob/715f8f2e3ae6b53c511c40b620921cb9c87e6f62/src/Query/ConstantArray.php#L63-L84 |
203,296 | sndsgd/form | src/form/field/FieldAbstract.php | FieldAbstract.getName | public function getName(array $keys = [], string $delimiter = "."): string
{
if (empty($keys)) {
return $this->name;
}
$keys[] = $this->name;
return implode($delimiter, $keys);
} | php | public function getName(array $keys = [], string $delimiter = "."): string
{
if (empty($keys)) {
return $this->name;
}
$keys[] = $this->name;
return implode($delimiter, $keys);
} | [
"public",
"function",
"getName",
"(",
"array",
"$",
"keys",
"=",
"[",
"]",
",",
"string",
"$",
"delimiter",
"=",
"\".\"",
")",
":",
"string",
"{",
"if",
"(",
"empty",
"(",
"$",
"keys",
")",
")",
"{",
"return",
"$",
"this",
"->",
"name",
";",
"}",... | Get the name of the field
@param array<string> $keys The nested names of parents
@param string $delimiter A string to use when joining the name
@return string | [
"Get",
"the",
"name",
"of",
"the",
"field"
] | 56b5b9572a8942aea34c97c7c838b871e198e34f | https://github.com/sndsgd/form/blob/56b5b9572a8942aea34c97c7c838b871e198e34f/src/form/field/FieldAbstract.php#L67-L75 |
203,297 | sndsgd/form | src/form/field/FieldAbstract.php | FieldAbstract.getNestedName | public function getNestedName(
string $delimiter = ".",
string $name = ""
): string
{
$keys = array_filter([$this->name, $name], "strlen");
$parent = $this;
while ($parent = $parent->getParent()) {
$name = $parent->getName();
if ($name) {
... | php | public function getNestedName(
string $delimiter = ".",
string $name = ""
): string
{
$keys = array_filter([$this->name, $name], "strlen");
$parent = $this;
while ($parent = $parent->getParent()) {
$name = $parent->getName();
if ($name) {
... | [
"public",
"function",
"getNestedName",
"(",
"string",
"$",
"delimiter",
"=",
"\".\"",
",",
"string",
"$",
"name",
"=",
"\"\"",
")",
":",
"string",
"{",
"$",
"keys",
"=",
"array_filter",
"(",
"[",
"$",
"this",
"->",
"name",
",",
"$",
"name",
"]",
",",... | Get a field's nested name
@param string $delimiter
@param string $name A name to append to the result
@return string | [
"Get",
"a",
"field",
"s",
"nested",
"name"
] | 56b5b9572a8942aea34c97c7c838b871e198e34f | https://github.com/sndsgd/form/blob/56b5b9572a8942aea34c97c7c838b871e198e34f/src/form/field/FieldAbstract.php#L84-L98 |
203,298 | sokil/NotificationBundle | src/TransportProvider.php | TransportProvider.getTransport | public function getTransport($transportName)
{
if (empty($this->transport[$transportName])) {
throw new InvalidArgumentException(sprintf('Transport %s not found', $transportName));
}
return $this->transport[$transportName];
} | php | public function getTransport($transportName)
{
if (empty($this->transport[$transportName])) {
throw new InvalidArgumentException(sprintf('Transport %s not found', $transportName));
}
return $this->transport[$transportName];
} | [
"public",
"function",
"getTransport",
"(",
"$",
"transportName",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"transport",
"[",
"$",
"transportName",
"]",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'Transport %s... | Get transport by name
@param $transportName
@return TransportInterface
@throws InvalidArgumentException | [
"Get",
"transport",
"by",
"name"
] | bf8d793b6b5a13827b2db4f0b3c588cf6a03c66b | https://github.com/sokil/NotificationBundle/blob/bf8d793b6b5a13827b2db4f0b3c588cf6a03c66b/src/TransportProvider.php#L35-L42 |
203,299 | tonis-io-legacy/tonis | src/Router/RouteMap.php | RouteMap.add | public function add($path, $handler)
{
$route = new Route($path, $handler);
$this->routes[] = $route;
$this->nameCache = [];
$this->routeParser = new RouteParser;
return $route;
} | php | public function add($path, $handler)
{
$route = new Route($path, $handler);
$this->routes[] = $route;
$this->nameCache = [];
$this->routeParser = new RouteParser;
return $route;
} | [
"public",
"function",
"add",
"(",
"$",
"path",
",",
"$",
"handler",
")",
"{",
"$",
"route",
"=",
"new",
"Route",
"(",
"$",
"path",
",",
"$",
"handler",
")",
";",
"$",
"this",
"->",
"routes",
"[",
"]",
"=",
"$",
"route",
";",
"$",
"this",
"->",
... | Adds a route to the map and resets the name cache.
@param string $path
@param callable $handler
@return Route | [
"Adds",
"a",
"route",
"to",
"the",
"map",
"and",
"resets",
"the",
"name",
"cache",
"."
] | 8371a277a94232433d882aaf37a85cd469daf501 | https://github.com/tonis-io-legacy/tonis/blob/8371a277a94232433d882aaf37a85cd469daf501/src/Router/RouteMap.php#L25-L33 |
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.