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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
200,600 | mtils/cmsable | src/Cmsable/Resource/ResourceValidator.php | ResourceValidator.validateOrFail | public function validateOrFail(array $data, $model=null)
{
$this->publish('validating', [$this, $data, $model]);
$rules = $this->rules();
$parsedRules = $this->parseRules($rules, $data, $model);
$this->publish('validation-rules.parsed', [&$parsedRules]);
$validator = $th... | php | public function validateOrFail(array $data, $model=null)
{
$this->publish('validating', [$this, $data, $model]);
$rules = $this->rules();
$parsedRules = $this->parseRules($rules, $data, $model);
$this->publish('validation-rules.parsed', [&$parsedRules]);
$validator = $th... | [
"public",
"function",
"validateOrFail",
"(",
"array",
"$",
"data",
",",
"$",
"model",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"publish",
"(",
"'validating'",
",",
"[",
"$",
"this",
",",
"$",
"data",
",",
"$",
"model",
"]",
")",
";",
"$",
"rules",... | Validate the data. If validation failes, throw a exception
If a model is passed as the second parameter, parse the rules
to match the model. If no model is passed, considerate it as
a new model
@param array $data The (request) data
@param mixed $model (optional)
@return bool
@throw \Illuminate\Contracts\Validation\Val... | [
"Validate",
"the",
"data",
".",
"If",
"validation",
"failes",
"throw",
"a",
"exception",
"If",
"a",
"model",
"is",
"passed",
"as",
"the",
"second",
"parameter",
"parse",
"the",
"rules",
"to",
"match",
"the",
"model",
".",
"If",
"no",
"model",
"is",
"pass... | 03ae84ee3c7d46146f2a1cf687e5c29d6de4286d | https://github.com/mtils/cmsable/blob/03ae84ee3c7d46146f2a1cf687e5c29d6de4286d/src/Cmsable/Resource/ResourceValidator.php#L52-L72 |
200,601 | mtils/cmsable | src/Cmsable/Resource/ResourceValidator.php | ResourceValidator.getValidatorInstance | protected function getValidatorInstance($rules, $data, $model=null)
{
$factory = $this->container->make('Illuminate\Validation\Factory');
if (method_exists($this, 'validatorInstance'))
{
return $this->container->call(
[$this, 'validatorInstance'],
... | php | protected function getValidatorInstance($rules, $data, $model=null)
{
$factory = $this->container->make('Illuminate\Validation\Factory');
if (method_exists($this, 'validatorInstance'))
{
return $this->container->call(
[$this, 'validatorInstance'],
... | [
"protected",
"function",
"getValidatorInstance",
"(",
"$",
"rules",
",",
"$",
"data",
",",
"$",
"model",
"=",
"null",
")",
"{",
"$",
"factory",
"=",
"$",
"this",
"->",
"container",
"->",
"make",
"(",
"'Illuminate\\Validation\\Factory'",
")",
";",
"if",
"("... | Get the validator instance to perform the actual validation
@return \Illuminate\Validation\Validator | [
"Get",
"the",
"validator",
"instance",
"to",
"perform",
"the",
"actual",
"validation"
] | 03ae84ee3c7d46146f2a1cf687e5c29d6de4286d | https://github.com/mtils/cmsable/blob/03ae84ee3c7d46146f2a1cf687e5c29d6de4286d/src/Cmsable/Resource/ResourceValidator.php#L89-L104 |
200,602 | mtils/cmsable | src/Cmsable/Resource/ResourceValidator.php | ResourceValidator.customAttributes | public function customAttributes()
{
if (!$form = $this->distributor->form(null, $this->resourceName())){
return [];
}
return $form->getValidator()->buildAttributeNames($form);
} | php | public function customAttributes()
{
if (!$form = $this->distributor->form(null, $this->resourceName())){
return [];
}
return $form->getValidator()->buildAttributeNames($form);
} | [
"public",
"function",
"customAttributes",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"form",
"=",
"$",
"this",
"->",
"distributor",
"->",
"form",
"(",
"null",
",",
"$",
"this",
"->",
"resourceName",
"(",
")",
")",
")",
"{",
"return",
"[",
"]",
";",
"}",
... | Set custom attributes for validator errors.
@return array | [
"Set",
"custom",
"attributes",
"for",
"validator",
"errors",
"."
] | 03ae84ee3c7d46146f2a1cf687e5c29d6de4286d | https://github.com/mtils/cmsable/blob/03ae84ee3c7d46146f2a1cf687e5c29d6de4286d/src/Cmsable/Resource/ResourceValidator.php#L121-L128 |
200,603 | rollerworks/search-core | Extension/Core/ChoiceList/ArrayChoiceList.php | ArrayChoiceList.flatten | private function flatten(array $choices, callable $value, &$choicesByValues, &$keysByValues, &$structuredValues): void
{
if (null === $choicesByValues) {
$choicesByValues = [];
$keysByValues = [];
$structuredValues = [];
}
foreach ($choices as $key => $ch... | php | private function flatten(array $choices, callable $value, &$choicesByValues, &$keysByValues, &$structuredValues): void
{
if (null === $choicesByValues) {
$choicesByValues = [];
$keysByValues = [];
$structuredValues = [];
}
foreach ($choices as $key => $ch... | [
"private",
"function",
"flatten",
"(",
"array",
"$",
"choices",
",",
"callable",
"$",
"value",
",",
"&",
"$",
"choicesByValues",
",",
"&",
"$",
"keysByValues",
",",
"&",
"$",
"structuredValues",
")",
":",
"void",
"{",
"if",
"(",
"null",
"===",
"$",
"ch... | Flattens an array into the given output variables.
@param array $choices The array to flatten
@param callable $value The callable for generating choice values
@param array|null $choicesByValues The flattened choices indexed by the
corresponding values
@param array|null $keysByValues The... | [
"Flattens",
"an",
"array",
"into",
"the",
"given",
"output",
"variables",
"."
] | 6b5671b8c4d6298906ded768261b0a59845140fb | https://github.com/rollerworks/search-core/blob/6b5671b8c4d6298906ded768261b0a59845140fb/Extension/Core/ChoiceList/ArrayChoiceList.php#L180-L200 |
200,604 | kambalabs/KmbPuppetDb | src/KmbPuppetDb/Proxy/NodeProxy.php | NodeProxy.getFacts | public function getFacts()
{
if ($this->facts === null) {
$this->setFacts($this->nodeService->getNodeFacts($this->getName()));
}
return $this->facts;
} | php | public function getFacts()
{
if ($this->facts === null) {
$this->setFacts($this->nodeService->getNodeFacts($this->getName()));
}
return $this->facts;
} | [
"public",
"function",
"getFacts",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"facts",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"setFacts",
"(",
"$",
"this",
"->",
"nodeService",
"->",
"getNodeFacts",
"(",
"$",
"this",
"->",
"getName",
"(",
")",
... | Get facts.
@return array | [
"Get",
"facts",
"."
] | df56a275cf00f4402cf121a2e99149168f1f8b2d | https://github.com/kambalabs/KmbPuppetDb/blob/df56a275cf00f4402cf121a2e99149168f1f8b2d/src/KmbPuppetDb/Proxy/NodeProxy.php#L164-L170 |
200,605 | kambalabs/KmbPuppetDb | src/KmbPuppetDb/Proxy/NodeProxy.php | NodeProxy.hasFact | public function hasFact($name)
{
if ($this->hasFacts() && array_key_exists($name, $this->facts)) {
return true;
}
return false;
} | php | public function hasFact($name)
{
if ($this->hasFacts() && array_key_exists($name, $this->facts)) {
return true;
}
return false;
} | [
"public",
"function",
"hasFact",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasFacts",
"(",
")",
"&&",
"array_key_exists",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"facts",
")",
")",
"{",
"return",
"true",
";",
"}",
"return",
"fals... | Determine if the node has the specified fact.
@param string $name
@return bool | [
"Determine",
"if",
"the",
"node",
"has",
"the",
"specified",
"fact",
"."
] | df56a275cf00f4402cf121a2e99149168f1f8b2d | https://github.com/kambalabs/KmbPuppetDb/blob/df56a275cf00f4402cf121a2e99149168f1f8b2d/src/KmbPuppetDb/Proxy/NodeProxy.php#L186-L192 |
200,606 | covex-nn/JooS_Stream | src/JooS/Stream/Wrapper/FS/Changes.php | Wrapper_FS_Changes.get | public function get($path)
{
$entity = null;
$name = null;
$subtree = $this->subtree($path, $name);
if (!is_null($subtree) && isset($subtree->_ownData[$name])) {
$entity = $subtree->_ownData[$name];
}
return $entity;
} | php | public function get($path)
{
$entity = null;
$name = null;
$subtree = $this->subtree($path, $name);
if (!is_null($subtree) && isset($subtree->_ownData[$name])) {
$entity = $subtree->_ownData[$name];
}
return $entity;
} | [
"public",
"function",
"get",
"(",
"$",
"path",
")",
"{",
"$",
"entity",
"=",
"null",
";",
"$",
"name",
"=",
"null",
";",
"$",
"subtree",
"=",
"$",
"this",
"->",
"subtree",
"(",
"$",
"path",
",",
"$",
"name",
")",
";",
"if",
"(",
"!",
"is_null",... | Return stream entiry
@param string $path Path
@return Entity_Interface | [
"Return",
"stream",
"entiry"
] | e9841b804190a9f624b9e44caa0af7a18f3816d1 | https://github.com/covex-nn/JooS_Stream/blob/e9841b804190a9f624b9e44caa0af7a18f3816d1/src/JooS/Stream/Wrapper/FS/Changes.php#L43-L54 |
200,607 | covex-nn/JooS_Stream | src/JooS/Stream/Wrapper/FS/Changes.php | Wrapper_FS_Changes.add | public function add($path, Entity_Interface $entity)
{
$result = false;
if (strlen($path)) {
$name = null;
$subtree = $this->subtree($path, $name, true);
$subtree->_ownData[$name] = $entity;
$result = true;
}
return $result;
} | php | public function add($path, Entity_Interface $entity)
{
$result = false;
if (strlen($path)) {
$name = null;
$subtree = $this->subtree($path, $name, true);
$subtree->_ownData[$name] = $entity;
$result = true;
}
return $result;
} | [
"public",
"function",
"add",
"(",
"$",
"path",
",",
"Entity_Interface",
"$",
"entity",
")",
"{",
"$",
"result",
"=",
"false",
";",
"if",
"(",
"strlen",
"(",
"$",
"path",
")",
")",
"{",
"$",
"name",
"=",
"null",
";",
"$",
"subtree",
"=",
"$",
"thi... | Add stream entity to changes array
@param string $path Path
@param Entity_Interface $entity Stream entity
@return boolean | [
"Add",
"stream",
"entity",
"to",
"changes",
"array"
] | e9841b804190a9f624b9e44caa0af7a18f3816d1 | https://github.com/covex-nn/JooS_Stream/blob/e9841b804190a9f624b9e44caa0af7a18f3816d1/src/JooS/Stream/Wrapper/FS/Changes.php#L64-L77 |
200,608 | covex-nn/JooS_Stream | src/JooS/Stream/Wrapper/FS/Changes.php | Wrapper_FS_Changes.delete | public function delete($path)
{
$result = false;
$parts = $this->split($path);
$name = array_shift($parts);
if (!sizeof($parts)) {
if (isset($this->_ownData[$name])) {
unset($this->_ownData[$name]);
$result = true;
}
} elseif (isset($this->_subTrees[$name])) {
$s... | php | public function delete($path)
{
$result = false;
$parts = $this->split($path);
$name = array_shift($parts);
if (!sizeof($parts)) {
if (isset($this->_ownData[$name])) {
unset($this->_ownData[$name]);
$result = true;
}
} elseif (isset($this->_subTrees[$name])) {
$s... | [
"public",
"function",
"delete",
"(",
"$",
"path",
")",
"{",
"$",
"result",
"=",
"false",
";",
"$",
"parts",
"=",
"$",
"this",
"->",
"split",
"(",
"$",
"path",
")",
";",
"$",
"name",
"=",
"array_shift",
"(",
"$",
"parts",
")",
";",
"if",
"(",
"!... | Delete stream entity from array
@param string $path Path
@return boolean | [
"Delete",
"stream",
"entity",
"from",
"array"
] | e9841b804190a9f624b9e44caa0af7a18f3816d1 | https://github.com/covex-nn/JooS_Stream/blob/e9841b804190a9f624b9e44caa0af7a18f3816d1/src/JooS/Stream/Wrapper/FS/Changes.php#L86-L108 |
200,609 | covex-nn/JooS_Stream | src/JooS/Stream/Wrapper/FS/Changes.php | Wrapper_FS_Changes.own | public function own($path = "")
{
if ($path) {
$parts = $this->split($path);
$name = array_shift($parts);
$own = array();
if (isset($this->_subTrees[$name])) {
$subtree = $this->_subTrees[$name];
/* @var $subtree Wrapper_FS_Changes */
$this->_appendChildren(
... | php | public function own($path = "")
{
if ($path) {
$parts = $this->split($path);
$name = array_shift($parts);
$own = array();
if (isset($this->_subTrees[$name])) {
$subtree = $this->_subTrees[$name];
/* @var $subtree Wrapper_FS_Changes */
$this->_appendChildren(
... | [
"public",
"function",
"own",
"(",
"$",
"path",
"=",
"\"\"",
")",
"{",
"if",
"(",
"$",
"path",
")",
"{",
"$",
"parts",
"=",
"$",
"this",
"->",
"split",
"(",
"$",
"path",
")",
";",
"$",
"name",
"=",
"array_shift",
"(",
"$",
"parts",
")",
";",
"... | Return subtree's own changes
@param string $path Path
@return array | [
"Return",
"subtree",
"s",
"own",
"changes"
] | e9841b804190a9f624b9e44caa0af7a18f3816d1 | https://github.com/covex-nn/JooS_Stream/blob/e9841b804190a9f624b9e44caa0af7a18f3816d1/src/JooS/Stream/Wrapper/FS/Changes.php#L142-L160 |
200,610 | covex-nn/JooS_Stream | src/JooS/Stream/Wrapper/FS/Changes.php | Wrapper_FS_Changes._appendChildren | private function _appendChildren(array &$children, $name, array $_children)
{
foreach ($_children as $key => $value) {
$children[$name . "/" . $key] = $value;
}
} | php | private function _appendChildren(array &$children, $name, array $_children)
{
foreach ($_children as $key => $value) {
$children[$name . "/" . $key] = $value;
}
} | [
"private",
"function",
"_appendChildren",
"(",
"array",
"&",
"$",
"children",
",",
"$",
"name",
",",
"array",
"$",
"_children",
")",
"{",
"foreach",
"(",
"$",
"_children",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"children",
"[",
"$",
"na... | Add new children to array
@param array &$children Children array
@param string $name Current name
@param array $_children Children of subtrees
@return null | [
"Add",
"new",
"children",
"to",
"array"
] | e9841b804190a9f624b9e44caa0af7a18f3816d1 | https://github.com/covex-nn/JooS_Stream/blob/e9841b804190a9f624b9e44caa0af7a18f3816d1/src/JooS/Stream/Wrapper/FS/Changes.php#L205-L210 |
200,611 | covex-nn/JooS_Stream | src/JooS/Stream/Wrapper/FS/Changes.php | Wrapper_FS_Changes.subtree | public function subtree($path, &$name, $create = false)
{
$parts = $this->split($path);
$_name = array_shift($parts);
if (!sizeof($parts)) {
$name = $_name;
$subtree = $this;
} else {
$exists = isset($this->_subTrees[$_name]);
if (!$exists && !$create) {
$subtree = nu... | php | public function subtree($path, &$name, $create = false)
{
$parts = $this->split($path);
$_name = array_shift($parts);
if (!sizeof($parts)) {
$name = $_name;
$subtree = $this;
} else {
$exists = isset($this->_subTrees[$_name]);
if (!$exists && !$create) {
$subtree = nu... | [
"public",
"function",
"subtree",
"(",
"$",
"path",
",",
"&",
"$",
"name",
",",
"$",
"create",
"=",
"false",
")",
"{",
"$",
"parts",
"=",
"$",
"this",
"->",
"split",
"(",
"$",
"path",
")",
";",
"$",
"_name",
"=",
"array_shift",
"(",
"$",
"parts",
... | Return subtree by path
@param string $path Path
@param string &$name Name of new element
@param boolean $create Auto create subtree ?
@return Wrapper_FS_Changes | [
"Return",
"subtree",
"by",
"path"
] | e9841b804190a9f624b9e44caa0af7a18f3816d1 | https://github.com/covex-nn/JooS_Stream/blob/e9841b804190a9f624b9e44caa0af7a18f3816d1/src/JooS/Stream/Wrapper/FS/Changes.php#L221-L244 |
200,612 | covex-nn/JooS_Stream | src/JooS/Stream/Wrapper/FS/Changes.php | Wrapper_FS_Changes.split | protected function split($path)
{
if (is_array($path)) {
$parts = $path;
} else {
$parts = explode("/", $path);
}
return $parts;
} | php | protected function split($path)
{
if (is_array($path)) {
$parts = $path;
} else {
$parts = explode("/", $path);
}
return $parts;
} | [
"protected",
"function",
"split",
"(",
"$",
"path",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"path",
")",
")",
"{",
"$",
"parts",
"=",
"$",
"path",
";",
"}",
"else",
"{",
"$",
"parts",
"=",
"explode",
"(",
"\"/\"",
",",
"$",
"path",
")",
";",... | Split path into dir names
@param string $path Path
@return array | [
"Split",
"path",
"into",
"dir",
"names"
] | e9841b804190a9f624b9e44caa0af7a18f3816d1 | https://github.com/covex-nn/JooS_Stream/blob/e9841b804190a9f624b9e44caa0af7a18f3816d1/src/JooS/Stream/Wrapper/FS/Changes.php#L263-L271 |
200,613 | eureka-framework/component-orm | src/Orm/DataMapper/DataAbstract.php | DataAbstract.isUpdated | public function isUpdated($property = null)
{
if (null === $property) {
return (count($this->updated) > 0);
}
return (isset($this->updated[$property]) && $this->updated[$property] === true);
} | php | public function isUpdated($property = null)
{
if (null === $property) {
return (count($this->updated) > 0);
}
return (isset($this->updated[$property]) && $this->updated[$property] === true);
} | [
"public",
"function",
"isUpdated",
"(",
"$",
"property",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"property",
")",
"{",
"return",
"(",
"count",
"(",
"$",
"this",
"->",
"updated",
")",
">",
"0",
")",
";",
"}",
"return",
"(",
"isset",
... | If at least one data has been updated.
If property name is specified, check only property.
@param string $property
@return bool | [
"If",
"at",
"least",
"one",
"data",
"has",
"been",
"updated",
".",
"If",
"property",
"name",
"is",
"specified",
"check",
"only",
"property",
"."
] | bce48121d26c4e923534f9dc70da597634184316 | https://github.com/eureka-framework/component-orm/blob/bce48121d26c4e923534f9dc70da597634184316/src/Orm/DataMapper/DataAbstract.php#L116-L123 |
200,614 | eureka-framework/component-orm | src/Orm/DataMapper/DataAbstract.php | DataAbstract.initDependencyContainer | public function initDependencyContainer(Dependency\ContainerInterface $container = null)
{
if (null === $container) {
$container = Dependency\Container::getInstance();
}
$this->dependencyContainer = $container;
return $this;
} | php | public function initDependencyContainer(Dependency\ContainerInterface $container = null)
{
if (null === $container) {
$container = Dependency\Container::getInstance();
}
$this->dependencyContainer = $container;
return $this;
} | [
"public",
"function",
"initDependencyContainer",
"(",
"Dependency",
"\\",
"ContainerInterface",
"$",
"container",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"container",
")",
"{",
"$",
"container",
"=",
"Dependency",
"\\",
"Container",
"::",
"getIns... | Initialize dependency container.
@param Dependency\ContainerInterface $container
@return self | [
"Initialize",
"dependency",
"container",
"."
] | bce48121d26c4e923534f9dc70da597634184316 | https://github.com/eureka-framework/component-orm/blob/bce48121d26c4e923534f9dc70da597634184316/src/Orm/DataMapper/DataAbstract.php#L143-L152 |
200,615 | mtils/cmsable | src/Cmsable/Mail/Mailer.php | Mailer.overwrite | public function overwrite($key, $value=null)
{
if (!is_array($key)) {
$this->overwrittenData[$key] = $value;
return $this;
}
foreach ($key as $k=>$v) {
$this->overwrite($k, $v);
}
return $this;
} | php | public function overwrite($key, $value=null)
{
if (!is_array($key)) {
$this->overwrittenData[$key] = $value;
return $this;
}
foreach ($key as $k=>$v) {
$this->overwrite($k, $v);
}
return $this;
} | [
"public",
"function",
"overwrite",
"(",
"$",
"key",
",",
"$",
"value",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"key",
")",
")",
"{",
"$",
"this",
"->",
"overwrittenData",
"[",
"$",
"key",
"]",
"=",
"$",
"value",
";",
"return"... | Overwrite one or more view variables
@param string|array $key
@param mixed $value (optional)
@return self | [
"Overwrite",
"one",
"or",
"more",
"view",
"variables"
] | 03ae84ee3c7d46146f2a1cf687e5c29d6de4286d | https://github.com/mtils/cmsable/blob/03ae84ee3c7d46146f2a1cf687e5c29d6de4286d/src/Cmsable/Mail/Mailer.php#L195-L207 |
200,616 | mtils/cmsable | src/Cmsable/Mail/Mailer.php | Mailer.finalRecipients | protected function finalRecipients($passedTo)
{
if (!$this->overwrittenTo) {
return $passedTo;
}
$overwrittenTo = $this->overwrittenTo;
$this->overwrittenTo = [];
return $overwrittenTo;
} | php | protected function finalRecipients($passedTo)
{
if (!$this->overwrittenTo) {
return $passedTo;
}
$overwrittenTo = $this->overwrittenTo;
$this->overwrittenTo = [];
return $overwrittenTo;
} | [
"protected",
"function",
"finalRecipients",
"(",
"$",
"passedTo",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"overwrittenTo",
")",
"{",
"return",
"$",
"passedTo",
";",
"}",
"$",
"overwrittenTo",
"=",
"$",
"this",
"->",
"overwrittenTo",
";",
"$",
"this"... | Returns only the overwritten recipients or if non set the passed ones
@param array $passedTo
@return array | [
"Returns",
"only",
"the",
"overwritten",
"recipients",
"or",
"if",
"non",
"set",
"the",
"passed",
"ones"
] | 03ae84ee3c7d46146f2a1cf687e5c29d6de4286d | https://github.com/mtils/cmsable/blob/03ae84ee3c7d46146f2a1cf687e5c29d6de4286d/src/Cmsable/Mail/Mailer.php#L254-L263 |
200,617 | mtils/cmsable | src/Cmsable/Mail/Mailer.php | Mailer.finalView | protected function finalView($passedView)
{
if (!$this->overwrittenView ) {
return $passedView;
}
$overwrittenView = $this->overwrittenView;
$this->overwrittenView = '';
if (!is_array($overwrittenView) && !is_array($passedView)) {
return $overwritte... | php | protected function finalView($passedView)
{
if (!$this->overwrittenView ) {
return $passedView;
}
$overwrittenView = $this->overwrittenView;
$this->overwrittenView = '';
if (!is_array($overwrittenView) && !is_array($passedView)) {
return $overwritte... | [
"protected",
"function",
"finalView",
"(",
"$",
"passedView",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"overwrittenView",
")",
"{",
"return",
"$",
"passedView",
";",
"}",
"$",
"overwrittenView",
"=",
"$",
"this",
"->",
"overwrittenView",
";",
"$",
"t... | Returns the overwritten view if one set, otherwise the passed one
@param string|array $passedView
@return string|array | [
"Returns",
"the",
"overwritten",
"view",
"if",
"one",
"set",
"otherwise",
"the",
"passed",
"one"
] | 03ae84ee3c7d46146f2a1cf687e5c29d6de4286d | https://github.com/mtils/cmsable/blob/03ae84ee3c7d46146f2a1cf687e5c29d6de4286d/src/Cmsable/Mail/Mailer.php#L271-L295 |
200,618 | mtils/cmsable | src/Cmsable/Mail/Mailer.php | Mailer.finalData | protected function finalData($passedData)
{
$overwrittenData = $this->overwrittenData;
$this->overwrittenData = [];
foreach ($overwrittenData as $key=>$value) {
$passedData[$key] = $value;
}
return $passedData;
} | php | protected function finalData($passedData)
{
$overwrittenData = $this->overwrittenData;
$this->overwrittenData = [];
foreach ($overwrittenData as $key=>$value) {
$passedData[$key] = $value;
}
return $passedData;
} | [
"protected",
"function",
"finalData",
"(",
"$",
"passedData",
")",
"{",
"$",
"overwrittenData",
"=",
"$",
"this",
"->",
"overwrittenData",
";",
"$",
"this",
"->",
"overwrittenData",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"overwrittenData",
"as",
"$",
"ke... | Merges the passed view data with the assigned one
@param array $passedData
@return array | [
"Merges",
"the",
"passed",
"view",
"data",
"with",
"the",
"assigned",
"one"
] | 03ae84ee3c7d46146f2a1cf687e5c29d6de4286d | https://github.com/mtils/cmsable/blob/03ae84ee3c7d46146f2a1cf687e5c29d6de4286d/src/Cmsable/Mail/Mailer.php#L303-L315 |
200,619 | mtils/cmsable | src/Cmsable/Mail/Mailer.php | Mailer.flushRecipients | protected function flushRecipients($closure)
{
$recipients = (array)$this->temporaryTo;
$this->temporaryTo = null;
if(!$recipients && !is_callable($closure)){
throw new BadMethodCallException('Recipient not determinable: Neither a recipient was set by to() nor a callable was pas... | php | protected function flushRecipients($closure)
{
$recipients = (array)$this->temporaryTo;
$this->temporaryTo = null;
if(!$recipients && !is_callable($closure)){
throw new BadMethodCallException('Recipient not determinable: Neither a recipient was set by to() nor a callable was pas... | [
"protected",
"function",
"flushRecipients",
"(",
"$",
"closure",
")",
"{",
"$",
"recipients",
"=",
"(",
"array",
")",
"$",
"this",
"->",
"temporaryTo",
";",
"$",
"this",
"->",
"temporaryTo",
"=",
"null",
";",
"if",
"(",
"!",
"$",
"recipients",
"&&",
"!... | Returns the recipients and clears em
@param callable $closure
@return array | [
"Returns",
"the",
"recipients",
"and",
"clears",
"em"
] | 03ae84ee3c7d46146f2a1cf687e5c29d6de4286d | https://github.com/mtils/cmsable/blob/03ae84ee3c7d46146f2a1cf687e5c29d6de4286d/src/Cmsable/Mail/Mailer.php#L323-L333 |
200,620 | mtils/cmsable | src/Cmsable/Mail/Mailer.php | Mailer.createBuilder | protected function createBuilder(array $recipients, $data, $callback)
{
$messageBuilder = new MessageBuilder($recipients, $data, $callback);
if ($developerTo = $this->config->get('mail.overwrite_to')) {
$messageBuilder->setOverwriteTo($developerTo);
}
return $messageBui... | php | protected function createBuilder(array $recipients, $data, $callback)
{
$messageBuilder = new MessageBuilder($recipients, $data, $callback);
if ($developerTo = $this->config->get('mail.overwrite_to')) {
$messageBuilder->setOverwriteTo($developerTo);
}
return $messageBui... | [
"protected",
"function",
"createBuilder",
"(",
"array",
"$",
"recipients",
",",
"$",
"data",
",",
"$",
"callback",
")",
"{",
"$",
"messageBuilder",
"=",
"new",
"MessageBuilder",
"(",
"$",
"recipients",
",",
"$",
"data",
",",
"$",
"callback",
")",
";",
"i... | Create the pseudo closure creator
@param array $recipients
@param array $data
@param callable|null $callback
@return \Cmsable\Mail\MessageBuilder | [
"Create",
"the",
"pseudo",
"closure",
"creator"
] | 03ae84ee3c7d46146f2a1cf687e5c29d6de4286d | https://github.com/mtils/cmsable/blob/03ae84ee3c7d46146f2a1cf687e5c29d6de4286d/src/Cmsable/Mail/Mailer.php#L343-L352 |
200,621 | mtils/cmsable | src/Cmsable/Mail/Mailer.php | Mailer.parseTexts | protected function parseTexts(array $data)
{
foreach ($this->parseKeys as $key) {
if (!isset($data[$key]) || !is_string($data[$key])) {
continue;
}
$data[$key] = $this->textParser->parse($data[$key], $data);
}
return $data;
} | php | protected function parseTexts(array $data)
{
foreach ($this->parseKeys as $key) {
if (!isset($data[$key]) || !is_string($data[$key])) {
continue;
}
$data[$key] = $this->textParser->parse($data[$key], $data);
}
return $data;
} | [
"protected",
"function",
"parseTexts",
"(",
"array",
"$",
"data",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"parseKeys",
"as",
"$",
"key",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"data",
"[",
"$",
"key",
"]",
")",
"||",
"!",
"is_string",
... | Parse all keys that have to be parsed by text parser
@param array $data
@return array | [
"Parse",
"all",
"keys",
"that",
"have",
"to",
"be",
"parsed",
"by",
"text",
"parser"
] | 03ae84ee3c7d46146f2a1cf687e5c29d6de4286d | https://github.com/mtils/cmsable/blob/03ae84ee3c7d46146f2a1cf687e5c29d6de4286d/src/Cmsable/Mail/Mailer.php#L360-L373 |
200,622 | wb-crowdfusion/crowdfusion | system/core/classes/libraries/caching/stores/MemcacheCacheStore.php | MemcacheCacheStore.getConnection | protected function getConnection()
{
if (empty($this->memcache)) {
//ini_set('memcache.chunk_size', 32768);
//ini_set('memcache.allow_failover', false); // default is usually true
//ini_set('memcache.hash_strategy', 'consistent');
$this->memcache = new Memca... | php | protected function getConnection()
{
if (empty($this->memcache)) {
//ini_set('memcache.chunk_size', 32768);
//ini_set('memcache.allow_failover', false); // default is usually true
//ini_set('memcache.hash_strategy', 'consistent');
$this->memcache = new Memca... | [
"protected",
"function",
"getConnection",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"memcache",
")",
")",
"{",
"//ini_set('memcache.chunk_size', 32768);",
"//ini_set('memcache.allow_failover', false); // default is usually true",
"//ini_set('memcache.hash_strat... | Returns a connection to the memcached server
@return Memcache an active Memcache object | [
"Returns",
"a",
"connection",
"to",
"the",
"memcached",
"server"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/caching/stores/MemcacheCacheStore.php#L143-L182 |
200,623 | wb-crowdfusion/crowdfusion | system/core/classes/libraries/caching/stores/MemcacheCacheStore.php | MemcacheCacheStore.getStats | public function getStats()
{
if (!$this->enabled)
return array();
$stats = @$this->getConnection()->getStats();
$this->Logger->debug('Retrieved Stats');
$this->Logger->debug($stats);
return $stats;
} | php | public function getStats()
{
if (!$this->enabled)
return array();
$stats = @$this->getConnection()->getStats();
$this->Logger->debug('Retrieved Stats');
$this->Logger->debug($stats);
return $stats;
} | [
"public",
"function",
"getStats",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"enabled",
")",
"return",
"array",
"(",
")",
";",
"$",
"stats",
"=",
"@",
"$",
"this",
"->",
"getConnection",
"(",
")",
"->",
"getStats",
"(",
")",
";",
"$",
"thi... | Implementation specific array of statistics
@return array An associative array of statistics, determined by the
implementation | [
"Implementation",
"specific",
"array",
"of",
"statistics"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/caching/stores/MemcacheCacheStore.php#L434-L445 |
200,624 | wb-crowdfusion/crowdfusion | system/core/classes/libraries/caching/stores/MemcacheCacheStore.php | MemcacheCacheStore.increment | public function increment($key, $step = 1)
{
if (!$this->enabled)
return false;
$has_replaced = $has_set = false;
try {
// Store the cache object
$nKey = $this->key($key);
$has_replaced = @$this->getConnection()->add($nKey, $step, 0);
... | php | public function increment($key, $step = 1)
{
if (!$this->enabled)
return false;
$has_replaced = $has_set = false;
try {
// Store the cache object
$nKey = $this->key($key);
$has_replaced = @$this->getConnection()->add($nKey, $step, 0);
... | [
"public",
"function",
"increment",
"(",
"$",
"key",
",",
"$",
"step",
"=",
"1",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"enabled",
")",
"return",
"false",
";",
"$",
"has_replaced",
"=",
"$",
"has_set",
"=",
"false",
";",
"try",
"{",
"// Store ... | Increment a value in the cache store
@param string $key Cache key associated to the data
@param int $step Number to increment by
@return int New value on success or FALSE on failure
@throws CacheException | [
"Increment",
"a",
"value",
"in",
"the",
"cache",
"store"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/caching/stores/MemcacheCacheStore.php#L494-L516 |
200,625 | wb-crowdfusion/crowdfusion | system/core/classes/libraries/caching/stores/MemcacheCacheStore.php | MemcacheCacheStore.decrement | public function decrement($key, $step = 1)
{
if (!$this->enabled)
return false;
$has_replaced = $has_set = false;
try {
// Store the cache object
$nKey = $this->key($key);
$has_set = @$this->getConnection()->decrement($nKey, $step);
}... | php | public function decrement($key, $step = 1)
{
if (!$this->enabled)
return false;
$has_replaced = $has_set = false;
try {
// Store the cache object
$nKey = $this->key($key);
$has_set = @$this->getConnection()->decrement($nKey, $step);
}... | [
"public",
"function",
"decrement",
"(",
"$",
"key",
",",
"$",
"step",
"=",
"1",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"enabled",
")",
"return",
"false",
";",
"$",
"has_replaced",
"=",
"$",
"has_set",
"=",
"false",
";",
"try",
"{",
"// Store ... | Decrement a value in the cache store
@param string $key Cache key associated to the data
@param int $step Number to decrement by
@return int New value on success or FALSE on failure
@throws CacheException | [
"Decrement",
"a",
"value",
"in",
"the",
"cache",
"store"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/caching/stores/MemcacheCacheStore.php#L527-L547 |
200,626 | wb-crowdfusion/crowdfusion | system/core/classes/libraries/caching/stores/MemcacheCacheStore.php | MemcacheCacheStore.getIncrement | public function getIncrement($key)
{
if (!$this->enabled)
return false;
return @$this->getConnection()->get($this->key($key));
} | php | public function getIncrement($key)
{
if (!$this->enabled)
return false;
return @$this->getConnection()->get($this->key($key));
} | [
"public",
"function",
"getIncrement",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"enabled",
")",
"return",
"false",
";",
"return",
"@",
"$",
"this",
"->",
"getConnection",
"(",
")",
"->",
"get",
"(",
"$",
"this",
"->",
"key",
"("... | Get incremented value in the cache store
@param string $key Cache key associated to the data
@return int Stored value on success or FALSE on failure
@throws CacheException | [
"Get",
"incremented",
"value",
"in",
"the",
"cache",
"store"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/caching/stores/MemcacheCacheStore.php#L558-L565 |
200,627 | wb-crowdfusion/crowdfusion | system/core/classes/libraries/caching/stores/MemcacheCacheStore.php | MemcacheCacheStore.add | public function add($key, $data, $ttl)
{
if (!$this->enabled)
return true;
try {
$data = $this->storageFormat($key, $data, $ttl);
$nKey = $this->key($key);
// Store the cache object
$ret = @$this->getConnection()->add($nKey, $data, $this-... | php | public function add($key, $data, $ttl)
{
if (!$this->enabled)
return true;
try {
$data = $this->storageFormat($key, $data, $ttl);
$nKey = $this->key($key);
// Store the cache object
$ret = @$this->getConnection()->add($nKey, $data, $this-... | [
"public",
"function",
"add",
"(",
"$",
"key",
",",
"$",
"data",
",",
"$",
"ttl",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"enabled",
")",
"return",
"true",
";",
"try",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"storageFormat",
"(",
"$",
"ke... | Stores data into the cache store by key, with a given timeout in seconds
UNLESS an entry already exists under that key.
The implementation must support native serialization of objects and arrays
so that the caller does not need to serialize manually.
@param string $key Cache key associated to the data
@param mixed $... | [
"Stores",
"data",
"into",
"the",
"cache",
"store",
"by",
"key",
"with",
"a",
"given",
"timeout",
"in",
"seconds",
"UNLESS",
"an",
"entry",
"already",
"exists",
"under",
"that",
"key",
".",
"The",
"implementation",
"must",
"support",
"native",
"serialization",
... | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/caching/stores/MemcacheCacheStore.php#L582-L601 |
200,628 | wb-crowdfusion/crowdfusion | system/core/classes/mvc/router/Router.php | Router.route | public function route()
{
$this->Logger->debug("Request: {$this->Request->getFullURL()}");
$uri = $this->Request->getAdjustedRequestURI();
// $uri = $this->sanitizeURI($uri);
$this->Logger->debug("Routing URI: {$uri}");
$result = array();
$qs = array_merge($_POST... | php | public function route()
{
$this->Logger->debug("Request: {$this->Request->getFullURL()}");
$uri = $this->Request->getAdjustedRequestURI();
// $uri = $this->sanitizeURI($uri);
$this->Logger->debug("Routing URI: {$uri}");
$result = array();
$qs = array_merge($_POST... | [
"public",
"function",
"route",
"(",
")",
"{",
"$",
"this",
"->",
"Logger",
"->",
"debug",
"(",
"\"Request: {$this->Request->getFullURL()}\"",
")",
";",
"$",
"uri",
"=",
"$",
"this",
"->",
"Request",
"->",
"getAdjustedRequestURI",
"(",
")",
";",
"// $uri... | Returns an array that describes the result of the current route.
The resultant array will contain keys like 'view', and 'paging', etc.
For full details, see the routes file as the array is built from that.
@return array | [
"Returns",
"an",
"array",
"that",
"describes",
"the",
"result",
"of",
"the",
"current",
"route",
"."
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/mvc/router/Router.php#L119-L198 |
200,629 | wb-crowdfusion/crowdfusion | system/core/classes/mvc/router/Router.php | Router.checkRedirects | public function checkRedirects()
{
// remove trailing slash and lowercase so there aren't multiple copies to cache
$uri = strtolower(rtrim($this->Request->getAdjustedRequestURI(), '/'));
$qs = $this->Request->getQueryString();
if (($previousRedirect = $this->TemplateCache->get('redi... | php | public function checkRedirects()
{
// remove trailing slash and lowercase so there aren't multiple copies to cache
$uri = strtolower(rtrim($this->Request->getAdjustedRequestURI(), '/'));
$qs = $this->Request->getQueryString();
if (($previousRedirect = $this->TemplateCache->get('redi... | [
"public",
"function",
"checkRedirects",
"(",
")",
"{",
"// remove trailing slash and lowercase so there aren't multiple copies to cache",
"$",
"uri",
"=",
"strtolower",
"(",
"rtrim",
"(",
"$",
"this",
"->",
"Request",
"->",
"getAdjustedRequestURI",
"(",
")",
",",
"'/'",... | Checks the redirects against the current URI and redirects the user's browser
if they've hit a redirect URL
@return void | [
"Checks",
"the",
"redirects",
"against",
"the",
"current",
"URI",
"and",
"redirects",
"the",
"user",
"s",
"browser",
"if",
"they",
"ve",
"hit",
"a",
"redirect",
"URL"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/mvc/router/Router.php#L220-L270 |
200,630 | horntell/php-sdk | lib/guzzle/GuzzleHttp/Message/Response.php | Response.handleOptions | protected function handleOptions(array &$options = [])
{
parent::handleOptions($options);
if (isset($options['reason_phrase'])) {
$this->reasonPhrase = $options['reason_phrase'];
}
} | php | protected function handleOptions(array &$options = [])
{
parent::handleOptions($options);
if (isset($options['reason_phrase'])) {
$this->reasonPhrase = $options['reason_phrase'];
}
} | [
"protected",
"function",
"handleOptions",
"(",
"array",
"&",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"parent",
"::",
"handleOptions",
"(",
"$",
"options",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"options",
"[",
"'reason_phrase'",
"]",
")",
")",
"{",
... | Accepts and modifies the options provided to the response in the
constructor.
@param array $options Options array passed by reference. | [
"Accepts",
"and",
"modifies",
"the",
"options",
"provided",
"to",
"the",
"response",
"in",
"the",
"constructor",
"."
] | e5205e9396a21b754d5651a8aa5898da5922a1b7 | https://github.com/horntell/php-sdk/blob/e5205e9396a21b754d5651a8aa5898da5922a1b7/lib/guzzle/GuzzleHttp/Message/Response.php#L193-L199 |
200,631 | phossa/phossa-event | src/Phossa/Event/Interfaces/EventManagerTrait.php | EventManagerTrait.runEventQueue | protected function runEventQueue(
EventInterface $event,
EventQueueInterface $queue,
callable $callback = null
)/*# : EventManagerInterface */ {
try {
foreach ($queue as $data) {
// execute each callable from the queue
$res = call_user_func... | php | protected function runEventQueue(
EventInterface $event,
EventQueueInterface $queue,
callable $callback = null
)/*# : EventManagerInterface */ {
try {
foreach ($queue as $data) {
// execute each callable from the queue
$res = call_user_func... | [
"protected",
"function",
"runEventQueue",
"(",
"EventInterface",
"$",
"event",
",",
"EventQueueInterface",
"$",
"queue",
",",
"callable",
"$",
"callback",
"=",
"null",
")",
"/*# : EventManagerInterface */",
"{",
"try",
"{",
"foreach",
"(",
"$",
"queue",
"as",
"$... | Run an event with the provided queue
The $callback defined as `function($event, $response) {}`, where
$reponse is the return value from previous event handler.
@param EventInterface $event
@param EventQueueInterface $queue
@param callable $callback (optional) a callback returns bool
@return EventManagerInterface t... | [
"Run",
"an",
"event",
"with",
"the",
"provided",
"queue"
] | 0044888fcc9b21584233c73cf20fc160e1b1f295 | https://github.com/phossa/phossa-event/blob/0044888fcc9b21584233c73cf20fc160e1b1f295/src/Phossa/Event/Interfaces/EventManagerTrait.php#L197-L237 |
200,632 | phossa/phossa-event | src/Phossa/Event/Interfaces/EventManagerTrait.php | EventManagerTrait.isListener | protected function isListener($listener)/*# : bool */
{
// object
if (is_object($listener) &&
$listener instanceof EventListenerInterface) {
return true;
}
// static class name
if (is_string($listener) &&
is_a(
$listener,
... | php | protected function isListener($listener)/*# : bool */
{
// object
if (is_object($listener) &&
$listener instanceof EventListenerInterface) {
return true;
}
// static class name
if (is_string($listener) &&
is_a(
$listener,
... | [
"protected",
"function",
"isListener",
"(",
"$",
"listener",
")",
"/*# : bool */",
"{",
"// object",
"if",
"(",
"is_object",
"(",
"$",
"listener",
")",
"&&",
"$",
"listener",
"instanceof",
"EventListenerInterface",
")",
"{",
"return",
"true",
";",
"}",
"// sta... | Test if it is a valid listener
@param EventListenerInterface|string $listener object/static class name
@return bool
@access protected | [
"Test",
"if",
"it",
"is",
"a",
"valid",
"listener"
] | 0044888fcc9b21584233c73cf20fc160e1b1f295 | https://github.com/phossa/phossa-event/blob/0044888fcc9b21584233c73cf20fc160e1b1f295/src/Phossa/Event/Interfaces/EventManagerTrait.php#L246-L265 |
200,633 | phossa/phossa-event | src/Phossa/Event/Interfaces/EventManagerTrait.php | EventManagerTrait.getListenerEvents | protected function getListenerEvents(
$listener,
/*# string */ $eventName = ''
)/*# : array */ {
// check listener
if (!$this->isListener($listener)) {
throw new Exception\InvalidArgumentException(
Message::get(
Message::INVALID_EVENT_L... | php | protected function getListenerEvents(
$listener,
/*# string */ $eventName = ''
)/*# : array */ {
// check listener
if (!$this->isListener($listener)) {
throw new Exception\InvalidArgumentException(
Message::get(
Message::INVALID_EVENT_L... | [
"protected",
"function",
"getListenerEvents",
"(",
"$",
"listener",
",",
"/*# string */",
"$",
"eventName",
"=",
"''",
")",
"/*# : array */",
"{",
"// check listener",
"if",
"(",
"!",
"$",
"this",
"->",
"isListener",
"(",
"$",
"listener",
")",
")",
"{",
"thr... | Get listener events array
@param EventListenerInterface|string $listener object/static class name
@param string $eventName event name or '' for all events
@return array
@throws Exception\InvalidArgumentException
if $listener not a valid listener
@access protected | [
"Get",
"listener",
"events",
"array"
] | 0044888fcc9b21584233c73cf20fc160e1b1f295 | https://github.com/phossa/phossa-event/blob/0044888fcc9b21584233c73cf20fc160e1b1f295/src/Phossa/Event/Interfaces/EventManagerTrait.php#L277-L312 |
200,634 | phossa/phossa-event | src/Phossa/Event/Interfaces/EventManagerTrait.php | EventManagerTrait.makeCallables | protected function makeCallables(
$listener,
$callable,
/*# int */ $priority
)/*# : array */ {
$result = [];
if (is_array($callable)) {
if (isset($callable[1]) && is_int($callable[1])) {
$priority = $callable[1];
$xc = $callable[0];... | php | protected function makeCallables(
$listener,
$callable,
/*# int */ $priority
)/*# : array */ {
$result = [];
if (is_array($callable)) {
if (isset($callable[1]) && is_int($callable[1])) {
$priority = $callable[1];
$xc = $callable[0];... | [
"protected",
"function",
"makeCallables",
"(",
"$",
"listener",
",",
"$",
"callable",
",",
"/*# int */",
"$",
"priority",
")",
"/*# : array */",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"if",
"(",
"is_array",
"(",
"$",
"callable",
")",
")",
"{",
"if",
"... | Returns an array of callables
@param EventListenerInterface|string $listener object/static class name
@param mixed $callable user defined callables
@param int $priority priority
@return array
@access protected | [
"Returns",
"an",
"array",
"of",
"callables"
] | 0044888fcc9b21584233c73cf20fc160e1b1f295 | https://github.com/phossa/phossa-event/blob/0044888fcc9b21584233c73cf20fc160e1b1f295/src/Phossa/Event/Interfaces/EventManagerTrait.php#L323-L355 |
200,635 | phossa/phossa-event | src/Phossa/Event/Interfaces/EventManagerTrait.php | EventManagerTrait.attachIt | protected function attachIt(
/*# string */ $eventName,
$listener,
$callable,
/*# int */ $priority
) {
// get named event queue
if ($this->hasEventQueue($eventName)) {
$q = $this->getEventQueue($eventName);
} else {
$q = new EventQueue()... | php | protected function attachIt(
/*# string */ $eventName,
$listener,
$callable,
/*# int */ $priority
) {
// get named event queue
if ($this->hasEventQueue($eventName)) {
$q = $this->getEventQueue($eventName);
} else {
$q = new EventQueue()... | [
"protected",
"function",
"attachIt",
"(",
"/*# string */",
"$",
"eventName",
",",
"$",
"listener",
",",
"$",
"callable",
",",
"/*# int */",
"$",
"priority",
")",
"{",
"// get named event queue",
"if",
"(",
"$",
"this",
"->",
"hasEventQueue",
"(",
"$",
"eventNa... | Attach callable to event queque
@param string $eventName event name
@param EventListenerInterface|string|null $listener
object/static class name or a callable
@param mixed $callable string | array
@param int $priority priority integer
@return void
@throws Exception\InvalidArgumentException
if callable is the wrong... | [
"Attach",
"callable",
"to",
"event",
"queque"
] | 0044888fcc9b21584233c73cf20fc160e1b1f295 | https://github.com/phossa/phossa-event/blob/0044888fcc9b21584233c73cf20fc160e1b1f295/src/Phossa/Event/Interfaces/EventManagerTrait.php#L370-L411 |
200,636 | phossa/phossa-event | src/Phossa/Event/Interfaces/EventManagerTrait.php | EventManagerTrait.detachIt | protected function detachIt(
/*# string */ $eventName,
$listener,
$callable
) {
// queue not found
if ($eventName != '' && !$this->hasEventQueue($eventName)) {
return;
}
// detach callable directly
if (is_null($listener)) {
$xc... | php | protected function detachIt(
/*# string */ $eventName,
$listener,
$callable
) {
// queue not found
if ($eventName != '' && !$this->hasEventQueue($eventName)) {
return;
}
// detach callable directly
if (is_null($listener)) {
$xc... | [
"protected",
"function",
"detachIt",
"(",
"/*# string */",
"$",
"eventName",
",",
"$",
"listener",
",",
"$",
"callable",
")",
"{",
"// queue not found",
"if",
"(",
"$",
"eventName",
"!=",
"''",
"&&",
"!",
"$",
"this",
"->",
"hasEventQueue",
"(",
"$",
"even... | Detach callable to event queque
@param string $eventName event name
@param EventListenerInterface|string|null $listener
object/static class name or a callable
@param mixed $callable string | array
@return void
@throws Exception\InvalidArgumentException
if callable is the wrong format
@access protected | [
"Detach",
"callable",
"to",
"event",
"queque"
] | 0044888fcc9b21584233c73cf20fc160e1b1f295 | https://github.com/phossa/phossa-event/blob/0044888fcc9b21584233c73cf20fc160e1b1f295/src/Phossa/Event/Interfaces/EventManagerTrait.php#L425-L472 |
200,637 | phossa/phossa-event | src/Phossa/Event/Interfaces/EventManagerTrait.php | EventManagerTrait.matchEventQueue | protected function matchEventQueue(
/*# string */ $eventName,
EventManagerInterface $manager
)/*# : EventQueueInterface */ {
$names = $this->globNames($eventName, $manager->getEventNames());
// combine all globbing queue
$queue = new EventQueue();
foreach ($names as ... | php | protected function matchEventQueue(
/*# string */ $eventName,
EventManagerInterface $manager
)/*# : EventQueueInterface */ {
$names = $this->globNames($eventName, $manager->getEventNames());
// combine all globbing queue
$queue = new EventQueue();
foreach ($names as ... | [
"protected",
"function",
"matchEventQueue",
"(",
"/*# string */",
"$",
"eventName",
",",
"EventManagerInterface",
"$",
"manager",
")",
"/*# : EventQueueInterface */",
"{",
"$",
"names",
"=",
"$",
"this",
"->",
"globNames",
"(",
"$",
"eventName",
",",
"$",
"manager... | Match proper event queue with globbing support
Including queues with globbing event names
@param string $eventName event name to match
@param EventManagerInterface $manager which manager to look at
@return EventQueueInterface
@access protected | [
"Match",
"proper",
"event",
"queue",
"with",
"globbing",
"support"
] | 0044888fcc9b21584233c73cf20fc160e1b1f295 | https://github.com/phossa/phossa-event/blob/0044888fcc9b21584233c73cf20fc160e1b1f295/src/Phossa/Event/Interfaces/EventManagerTrait.php#L484-L499 |
200,638 | phossa/phossa-event | src/Phossa/Event/Interfaces/EventManagerTrait.php | EventManagerTrait.globNames | protected function globNames(
/*# string */ $eventName,
array $names
)/*# : array */ {
$result = [];
foreach ($names as $n) {
if ($n === '*' || $n === $eventName || $eventName === '') {
$result[] = $n;
} elseif (strpos($n, '*') !== false) {
... | php | protected function globNames(
/*# string */ $eventName,
array $names
)/*# : array */ {
$result = [];
foreach ($names as $n) {
if ($n === '*' || $n === $eventName || $eventName === '') {
$result[] = $n;
} elseif (strpos($n, '*') !== false) {
... | [
"protected",
"function",
"globNames",
"(",
"/*# string */",
"$",
"eventName",
",",
"array",
"$",
"names",
")",
"/*# : array */",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"names",
"as",
"$",
"n",
")",
"{",
"if",
"(",
"$",
"n",
"===... | Return those globbing event names based on the given one
e.g.
Matching specific name 'login.MobileFail' with those '*',
'login.*', 'login.*Fail'
@param string $eventName specific event name
@param string[] $names name array to search thru
@return string[]
@access protected | [
"Return",
"those",
"globbing",
"event",
"names",
"based",
"on",
"the",
"given",
"one"
] | 0044888fcc9b21584233c73cf20fc160e1b1f295 | https://github.com/phossa/phossa-event/blob/0044888fcc9b21584233c73cf20fc160e1b1f295/src/Phossa/Event/Interfaces/EventManagerTrait.php#L513-L529 |
200,639 | Finesse/QueryScribe | src/QueryBricks/SelectTrait.php | SelectTrait.from | public function from($table, string $alias = null): self
{
return $this->table($table, $alias);
} | php | public function from($table, string $alias = null): self
{
return $this->table($table, $alias);
} | [
"public",
"function",
"from",
"(",
"$",
"table",
",",
"string",
"$",
"alias",
"=",
"null",
")",
":",
"self",
"{",
"return",
"$",
"this",
"->",
"table",
"(",
"$",
"table",
",",
"$",
"alias",
")",
";",
"}"
] | Table method alias
@see Query::table For reference
@param string|\Closure|Query|StatementInterface $table
@param string|null $alias
@return $this
@throws InvalidArgumentException
@throws InvalidReturnValueException | [
"Table",
"method",
"alias"
] | 4edba721e37693780d142229b3ecb0cd4004c7a5 | https://github.com/Finesse/QueryScribe/blob/4edba721e37693780d142229b3ecb0cd4004c7a5/src/QueryBricks/SelectTrait.php#L34-L37 |
200,640 | Finesse/QueryScribe | src/QueryBricks/SelectTrait.php | SelectTrait.addSelect | public function addSelect($columns, string $alias = null): self
{
if (!is_array($columns)) {
if ($alias === null) {
$columns = [$columns];
} else {
$columns = [$alias => $columns];
}
}
foreach ($columns as $alias => $column... | php | public function addSelect($columns, string $alias = null): self
{
if (!is_array($columns)) {
if ($alias === null) {
$columns = [$columns];
} else {
$columns = [$alias => $columns];
}
}
foreach ($columns as $alias => $column... | [
"public",
"function",
"addSelect",
"(",
"$",
"columns",
",",
"string",
"$",
"alias",
"=",
"null",
")",
":",
"self",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"columns",
")",
")",
"{",
"if",
"(",
"$",
"alias",
"===",
"null",
")",
"{",
"$",
"colum... | Adds column or columns to the SELECT section.
@param string|\Closure|Query|StatementInterface|string[]|\Closure[]|Query[]|StatementInterface[] $columns Columns
to add. If string or raw, one column is added. If array, many columns are added and string indexes are
treated as aliases.
@param string|null $alias Column ali... | [
"Adds",
"column",
"or",
"columns",
"to",
"the",
"SELECT",
"section",
"."
] | 4edba721e37693780d142229b3ecb0cd4004c7a5 | https://github.com/Finesse/QueryScribe/blob/4edba721e37693780d142229b3ecb0cd4004c7a5/src/QueryBricks/SelectTrait.php#L50-L71 |
200,641 | Finesse/QueryScribe | src/QueryBricks/SelectTrait.php | SelectTrait.addCount | public function addCount($column = '*', string $alias = null): self
{
return $this->addAggregate('COUNT', $column, $alias);
} | php | public function addCount($column = '*', string $alias = null): self
{
return $this->addAggregate('COUNT', $column, $alias);
} | [
"public",
"function",
"addCount",
"(",
"$",
"column",
"=",
"'*'",
",",
"string",
"$",
"alias",
"=",
"null",
")",
":",
"self",
"{",
"return",
"$",
"this",
"->",
"addAggregate",
"(",
"'COUNT'",
",",
"$",
"column",
",",
"$",
"alias",
")",
";",
"}"
] | Adds a COUNT aggregate to the SELECT section.
@param string|\Closure|Query|StatementInterface $column Column to count
@param string|null $alias Aggregate alias name
@return $this
@throws InvalidArgumentException
@throws InvalidReturnValueException | [
"Adds",
"a",
"COUNT",
"aggregate",
"to",
"the",
"SELECT",
"section",
"."
] | 4edba721e37693780d142229b3ecb0cd4004c7a5 | https://github.com/Finesse/QueryScribe/blob/4edba721e37693780d142229b3ecb0cd4004c7a5/src/QueryBricks/SelectTrait.php#L82-L85 |
200,642 | Finesse/QueryScribe | src/QueryBricks/SelectTrait.php | SelectTrait.addAvg | public function addAvg($column, string $alias = null): self
{
return $this->addAggregate('AVG', $column, $alias);
} | php | public function addAvg($column, string $alias = null): self
{
return $this->addAggregate('AVG', $column, $alias);
} | [
"public",
"function",
"addAvg",
"(",
"$",
"column",
",",
"string",
"$",
"alias",
"=",
"null",
")",
":",
"self",
"{",
"return",
"$",
"this",
"->",
"addAggregate",
"(",
"'AVG'",
",",
"$",
"column",
",",
"$",
"alias",
")",
";",
"}"
] | Adds a AVG aggregate to the SELECT section.
@param string|\Closure|Query|StatementInterface $column Column to get average
@param string|null $alias Aggregate alias name
@return $this
@throws InvalidArgumentException
@throws InvalidReturnValueException | [
"Adds",
"a",
"AVG",
"aggregate",
"to",
"the",
"SELECT",
"section",
"."
] | 4edba721e37693780d142229b3ecb0cd4004c7a5 | https://github.com/Finesse/QueryScribe/blob/4edba721e37693780d142229b3ecb0cd4004c7a5/src/QueryBricks/SelectTrait.php#L96-L99 |
200,643 | Finesse/QueryScribe | src/QueryBricks/SelectTrait.php | SelectTrait.addSum | public function addSum($column, string $alias = null): self
{
return $this->addAggregate('SUM', $column, $alias);
} | php | public function addSum($column, string $alias = null): self
{
return $this->addAggregate('SUM', $column, $alias);
} | [
"public",
"function",
"addSum",
"(",
"$",
"column",
",",
"string",
"$",
"alias",
"=",
"null",
")",
":",
"self",
"{",
"return",
"$",
"this",
"->",
"addAggregate",
"(",
"'SUM'",
",",
"$",
"column",
",",
"$",
"alias",
")",
";",
"}"
] | Adds a SUM aggregate to the SELECT section.
@param string|\Closure|Query|StatementInterface $column Column to get sum
@param string|null $alias Aggregate alias name
@return $this
@throws InvalidArgumentException
@throws InvalidReturnValueException | [
"Adds",
"a",
"SUM",
"aggregate",
"to",
"the",
"SELECT",
"section",
"."
] | 4edba721e37693780d142229b3ecb0cd4004c7a5 | https://github.com/Finesse/QueryScribe/blob/4edba721e37693780d142229b3ecb0cd4004c7a5/src/QueryBricks/SelectTrait.php#L110-L113 |
200,644 | Finesse/QueryScribe | src/QueryBricks/SelectTrait.php | SelectTrait.addMin | public function addMin($column, string $alias = null): self
{
return $this->addAggregate('MIN', $column, $alias);
} | php | public function addMin($column, string $alias = null): self
{
return $this->addAggregate('MIN', $column, $alias);
} | [
"public",
"function",
"addMin",
"(",
"$",
"column",
",",
"string",
"$",
"alias",
"=",
"null",
")",
":",
"self",
"{",
"return",
"$",
"this",
"->",
"addAggregate",
"(",
"'MIN'",
",",
"$",
"column",
",",
"$",
"alias",
")",
";",
"}"
] | Adds a MIN aggregate to the SELECT section.
@param string|\Closure|Query|StatementInterface $column Column to get min
@param string|null $alias Aggregate alias name
@return $this
@throws InvalidArgumentException
@throws InvalidReturnValueException | [
"Adds",
"a",
"MIN",
"aggregate",
"to",
"the",
"SELECT",
"section",
"."
] | 4edba721e37693780d142229b3ecb0cd4004c7a5 | https://github.com/Finesse/QueryScribe/blob/4edba721e37693780d142229b3ecb0cd4004c7a5/src/QueryBricks/SelectTrait.php#L124-L127 |
200,645 | Finesse/QueryScribe | src/QueryBricks/SelectTrait.php | SelectTrait.addMax | public function addMax($column, string $alias = null): self
{
return $this->addAggregate('MAX', $column, $alias);
} | php | public function addMax($column, string $alias = null): self
{
return $this->addAggregate('MAX', $column, $alias);
} | [
"public",
"function",
"addMax",
"(",
"$",
"column",
",",
"string",
"$",
"alias",
"=",
"null",
")",
":",
"self",
"{",
"return",
"$",
"this",
"->",
"addAggregate",
"(",
"'MAX'",
",",
"$",
"column",
",",
"$",
"alias",
")",
";",
"}"
] | Adds a MAX aggregate to the SELECT section.
@param string|\Closure|Query|StatementInterface $column Column to get max
@param string|null $alias Aggregate alias name
@return $this
@throws InvalidArgumentException
@throws InvalidReturnValueException | [
"Adds",
"a",
"MAX",
"aggregate",
"to",
"the",
"SELECT",
"section",
"."
] | 4edba721e37693780d142229b3ecb0cd4004c7a5 | https://github.com/Finesse/QueryScribe/blob/4edba721e37693780d142229b3ecb0cd4004c7a5/src/QueryBricks/SelectTrait.php#L138-L141 |
200,646 | Finesse/QueryScribe | src/QueryBricks/SelectTrait.php | SelectTrait.addAggregate | protected function addAggregate(string $function, $column, string $alias = null): self
{
$column = $this->checkStringValue('Argument $column', $column);
$aggregate = new Aggregate($function, $column);
if ($alias === null) {
$this->select[] = $aggregate;
} else {
... | php | protected function addAggregate(string $function, $column, string $alias = null): self
{
$column = $this->checkStringValue('Argument $column', $column);
$aggregate = new Aggregate($function, $column);
if ($alias === null) {
$this->select[] = $aggregate;
} else {
... | [
"protected",
"function",
"addAggregate",
"(",
"string",
"$",
"function",
",",
"$",
"column",
",",
"string",
"$",
"alias",
"=",
"null",
")",
":",
"self",
"{",
"$",
"column",
"=",
"$",
"this",
"->",
"checkStringValue",
"(",
"'Argument $column'",
",",
"$",
... | Adds an arbitrary aggregate to the SELECT section.
@param string $function Aggregate function name
@param string|\Closure|Query|StatementInterface $column Column to count (not prefixed)
@param string|null $alias Aggregate alias name
@return $this
@throws InvalidArgumentException
@throws InvalidReturnValueException | [
"Adds",
"an",
"arbitrary",
"aggregate",
"to",
"the",
"SELECT",
"section",
"."
] | 4edba721e37693780d142229b3ecb0cd4004c7a5 | https://github.com/Finesse/QueryScribe/blob/4edba721e37693780d142229b3ecb0cd4004c7a5/src/QueryBricks/SelectTrait.php#L153-L165 |
200,647 | itkg/core | src/Itkg/Core/Command/DatabaseUpdate/Runner.php | Runner.run | public function run(Migration $migration, $executeQueries = false, $forcedRollback = false)
{
$this->migration = $migration;
try {
$this->playQueries($executeQueries);
if ($forcedRollback) {
$this->playRollbackQueries($executeQueries);
}
}... | php | public function run(Migration $migration, $executeQueries = false, $forcedRollback = false)
{
$this->migration = $migration;
try {
$this->playQueries($executeQueries);
if ($forcedRollback) {
$this->playRollbackQueries($executeQueries);
}
}... | [
"public",
"function",
"run",
"(",
"Migration",
"$",
"migration",
",",
"$",
"executeQueries",
"=",
"false",
",",
"$",
"forcedRollback",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"migration",
"=",
"$",
"migration",
";",
"try",
"{",
"$",
"this",
"->",
"p... | Run a migration
@param Migration $migration
@param bool $executeQueries
@param bool $forcedRollback
@throws \Exception
@throws Migration\Exception
@return void | [
"Run",
"a",
"migration"
] | e5e4efb05feb4d23b0df41f2b21fd095103e593b | https://github.com/itkg/core/blob/e5e4efb05feb4d23b0df41f2b21fd095103e593b/src/Itkg/Core/Command/DatabaseUpdate/Runner.php#L65-L79 |
200,648 | itkg/core | src/Itkg/Core/Command/DatabaseUpdate/Runner.php | Runner.playQueries | private function playQueries($executeQueries = false)
{
foreach ($this->migration->getQueries() as $idx => $query) {
try {
$this->runQuery($query, $executeQueries);
} catch (\Exception $e) {
// Only throw if more than one query is played
... | php | private function playQueries($executeQueries = false)
{
foreach ($this->migration->getQueries() as $idx => $query) {
try {
$this->runQuery($query, $executeQueries);
} catch (\Exception $e) {
// Only throw if more than one query is played
... | [
"private",
"function",
"playQueries",
"(",
"$",
"executeQueries",
"=",
"false",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"migration",
"->",
"getQueries",
"(",
")",
"as",
"$",
"idx",
"=>",
"$",
"query",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"ru... | Play Script queries
@param bool $executeQueries
@throws Migration\Exception
@throws \Exception
@return void | [
"Play",
"Script",
"queries"
] | e5e4efb05feb4d23b0df41f2b21fd095103e593b | https://github.com/itkg/core/blob/e5e4efb05feb4d23b0df41f2b21fd095103e593b/src/Itkg/Core/Command/DatabaseUpdate/Runner.php#L89-L103 |
200,649 | itkg/core | src/Itkg/Core/Command/DatabaseUpdate/Runner.php | Runner.playRollbackQueries | private function playRollbackQueries($executeQueries = false)
{
foreach ($this->migration->getRollbackQueries() as $query) {
$this->runQuery($query, $executeQueries);
}
} | php | private function playRollbackQueries($executeQueries = false)
{
foreach ($this->migration->getRollbackQueries() as $query) {
$this->runQuery($query, $executeQueries);
}
} | [
"private",
"function",
"playRollbackQueries",
"(",
"$",
"executeQueries",
"=",
"false",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"migration",
"->",
"getRollbackQueries",
"(",
")",
"as",
"$",
"query",
")",
"{",
"$",
"this",
"->",
"runQuery",
"(",
"$",
... | Play rollback queries
@param bool $executeQueries
@return void | [
"Play",
"rollback",
"queries"
] | e5e4efb05feb4d23b0df41f2b21fd095103e593b | https://github.com/itkg/core/blob/e5e4efb05feb4d23b0df41f2b21fd095103e593b/src/Itkg/Core/Command/DatabaseUpdate/Runner.php#L111-L116 |
200,650 | itkg/core | src/Itkg/Core/Command/DatabaseUpdate/Runner.php | Runner.runQuery | private function runQuery(Query $query, $executeQueries = false)
{
$this->playedQueries[] = $query;
if ($executeQueries) {
$this->connection->executeQuery((string)$query);
}
} | php | private function runQuery(Query $query, $executeQueries = false)
{
$this->playedQueries[] = $query;
if ($executeQueries) {
$this->connection->executeQuery((string)$query);
}
} | [
"private",
"function",
"runQuery",
"(",
"Query",
"$",
"query",
",",
"$",
"executeQueries",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"playedQueries",
"[",
"]",
"=",
"$",
"query",
";",
"if",
"(",
"$",
"executeQueries",
")",
"{",
"$",
"this",
"->",
"c... | Run a query if execute query is true
else simply add query to played queries stack
@param Query $query
@param bool $executeQueries | [
"Run",
"a",
"query",
"if",
"execute",
"query",
"is",
"true",
"else",
"simply",
"add",
"query",
"to",
"played",
"queries",
"stack"
] | e5e4efb05feb4d23b0df41f2b21fd095103e593b | https://github.com/itkg/core/blob/e5e4efb05feb4d23b0df41f2b21fd095103e593b/src/Itkg/Core/Command/DatabaseUpdate/Runner.php#L125-L131 |
200,651 | Wedeto/IO | src/DirReader.php | DirReader.rewind | public function rewind()
{
$this->dir->rewind();
$this->iter = 0;
$this->hasNext();
$this->cur_entry = $this->next_entry;
$this->next_entry = null;
} | php | public function rewind()
{
$this->dir->rewind();
$this->iter = 0;
$this->hasNext();
$this->cur_entry = $this->next_entry;
$this->next_entry = null;
} | [
"public",
"function",
"rewind",
"(",
")",
"{",
"$",
"this",
"->",
"dir",
"->",
"rewind",
"(",
")",
";",
"$",
"this",
"->",
"iter",
"=",
"0",
";",
"$",
"this",
"->",
"hasNext",
"(",
")",
";",
"$",
"this",
"->",
"cur_entry",
"=",
"$",
"this",
"->... | Rewind the directory reader to the start | [
"Rewind",
"the",
"directory",
"reader",
"to",
"the",
"start"
] | 4cfeaedd1bd9bda3097d18cb12233a4afecb2e85 | https://github.com/Wedeto/IO/blob/4cfeaedd1bd9bda3097d18cb12233a4afecb2e85/src/DirReader.php#L106-L113 |
200,652 | ZhukV/AppleModel | src/Apple/Model/Software.php | Software.setPlatform | public function setPlatform($platform)
{
if (!in_array($platform, array(Software::PLATFORM_MAC, Software::PLATFORM_IOS), true)) {
throw new \InvalidArgumentException(sprintf('Undefined software platform "%s".', $platform));
}
$this->platform = $platform;
return $this;
... | php | public function setPlatform($platform)
{
if (!in_array($platform, array(Software::PLATFORM_MAC, Software::PLATFORM_IOS), true)) {
throw new \InvalidArgumentException(sprintf('Undefined software platform "%s".', $platform));
}
$this->platform = $platform;
return $this;
... | [
"public",
"function",
"setPlatform",
"(",
"$",
"platform",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"platform",
",",
"array",
"(",
"Software",
"::",
"PLATFORM_MAC",
",",
"Software",
"::",
"PLATFORM_IOS",
")",
",",
"true",
")",
")",
"{",
"throw",
... | Set software platform
@param integer $platform
@return Software
@throws \InvalidArgumentException | [
"Set",
"software",
"platform"
] | 3ab06d560b7c442b8ebafdd95d1d2523b40ef903 | https://github.com/ZhukV/AppleModel/blob/3ab06d560b7c442b8ebafdd95d1d2523b40ef903/src/Apple/Model/Software.php#L235-L244 |
200,653 | ZhukV/AppleModel | src/Apple/Model/Software.php | Software.setUserRatingCount | public function setUserRatingCount($userRatingCount)
{
$userRatingCount = (int) $userRatingCount;
if ($userRatingCount < 0) {
throw new \InvalidArgumentException(sprintf(
'User rating can\'t be less than "0", "%s" given.',
$userRatingCount
));... | php | public function setUserRatingCount($userRatingCount)
{
$userRatingCount = (int) $userRatingCount;
if ($userRatingCount < 0) {
throw new \InvalidArgumentException(sprintf(
'User rating can\'t be less than "0", "%s" given.',
$userRatingCount
));... | [
"public",
"function",
"setUserRatingCount",
"(",
"$",
"userRatingCount",
")",
"{",
"$",
"userRatingCount",
"=",
"(",
"int",
")",
"$",
"userRatingCount",
";",
"if",
"(",
"$",
"userRatingCount",
"<",
"0",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException... | Set user rating count
@param integer $userRatingCount
@return Software
@throws \InvalidArgumentException | [
"Set",
"user",
"rating",
"count"
] | 3ab06d560b7c442b8ebafdd95d1d2523b40ef903 | https://github.com/ZhukV/AppleModel/blob/3ab06d560b7c442b8ebafdd95d1d2523b40ef903/src/Apple/Model/Software.php#L712-L726 |
200,654 | ZhukV/AppleModel | src/Apple/Model/Software.php | Software.setAverageUserRating | public function setAverageUserRating($averageUserRating)
{
$averageUserRating = (float) $averageUserRating;
if ($averageUserRating < 0 || $averageUserRating > 5) {
throw new \InvalidArgumentException(sprintf(
'Average user rating must be between 0 and 5, "%s" given.',
... | php | public function setAverageUserRating($averageUserRating)
{
$averageUserRating = (float) $averageUserRating;
if ($averageUserRating < 0 || $averageUserRating > 5) {
throw new \InvalidArgumentException(sprintf(
'Average user rating must be between 0 and 5, "%s" given.',
... | [
"public",
"function",
"setAverageUserRating",
"(",
"$",
"averageUserRating",
")",
"{",
"$",
"averageUserRating",
"=",
"(",
"float",
")",
"$",
"averageUserRating",
";",
"if",
"(",
"$",
"averageUserRating",
"<",
"0",
"||",
"$",
"averageUserRating",
">",
"5",
")"... | Set user average rating
@param float $averageUserRating
@return Software
@throws \InvalidArgumentException | [
"Set",
"user",
"average",
"rating"
] | 3ab06d560b7c442b8ebafdd95d1d2523b40ef903 | https://github.com/ZhukV/AppleModel/blob/3ab06d560b7c442b8ebafdd95d1d2523b40ef903/src/Apple/Model/Software.php#L747-L768 |
200,655 | ZhukV/AppleModel | src/Apple/Model/Software.php | Software.setUserRatingCountCurrent | public function setUserRatingCountCurrent($userRatingCountCurrent)
{
$userRatingCountCurrent = (int) $userRatingCountCurrent;
if ($userRatingCountCurrent < 0) {
throw new \InvalidArgumentException(sprintf(
'User rating can\'t be less than "0", "%s" given.',
... | php | public function setUserRatingCountCurrent($userRatingCountCurrent)
{
$userRatingCountCurrent = (int) $userRatingCountCurrent;
if ($userRatingCountCurrent < 0) {
throw new \InvalidArgumentException(sprintf(
'User rating can\'t be less than "0", "%s" given.',
... | [
"public",
"function",
"setUserRatingCountCurrent",
"(",
"$",
"userRatingCountCurrent",
")",
"{",
"$",
"userRatingCountCurrent",
"=",
"(",
"int",
")",
"$",
"userRatingCountCurrent",
";",
"if",
"(",
"$",
"userRatingCountCurrent",
"<",
"0",
")",
"{",
"throw",
"new",
... | Set user rating count for current version
@param integer $userRatingCountCurrent
@return Software
@throws \InvalidArgumentException | [
"Set",
"user",
"rating",
"count",
"for",
"current",
"version"
] | 3ab06d560b7c442b8ebafdd95d1d2523b40ef903 | https://github.com/ZhukV/AppleModel/blob/3ab06d560b7c442b8ebafdd95d1d2523b40ef903/src/Apple/Model/Software.php#L789-L803 |
200,656 | ZhukV/AppleModel | src/Apple/Model/Software.php | Software.setAverageUserRatingCurrent | public function setAverageUserRatingCurrent($averageUserRatingCurrent)
{
$averageUserRatingCurrent = (float) $averageUserRatingCurrent;
if ($averageUserRatingCurrent < 0 || $averageUserRatingCurrent > 5) {
throw new \InvalidArgumentException(sprintf(
'Average user rating... | php | public function setAverageUserRatingCurrent($averageUserRatingCurrent)
{
$averageUserRatingCurrent = (float) $averageUserRatingCurrent;
if ($averageUserRatingCurrent < 0 || $averageUserRatingCurrent > 5) {
throw new \InvalidArgumentException(sprintf(
'Average user rating... | [
"public",
"function",
"setAverageUserRatingCurrent",
"(",
"$",
"averageUserRatingCurrent",
")",
"{",
"$",
"averageUserRatingCurrent",
"=",
"(",
"float",
")",
"$",
"averageUserRatingCurrent",
";",
"if",
"(",
"$",
"averageUserRatingCurrent",
"<",
"0",
"||",
"$",
"aver... | Set average user rating for current version
@param float $averageUserRatingCurrent
@return Software
@throws \InvalidArgumentException | [
"Set",
"average",
"user",
"rating",
"for",
"current",
"version"
] | 3ab06d560b7c442b8ebafdd95d1d2523b40ef903 | https://github.com/ZhukV/AppleModel/blob/3ab06d560b7c442b8ebafdd95d1d2523b40ef903/src/Apple/Model/Software.php#L824-L845 |
200,657 | ciims/ciims-modules-api | controllers/EventController.php | EventController.actionIndex | public function actionIndex()
{
$model = new Events('search');
$model->unsetAttributes();
if (isset($_GET['Event']))
$model->attributes = $_GET['Event'];
$dataProvider = $model->search();
$dataProvider->pagination = array(
'pageVar' => 'page'
);
// Throw a 404 if we exceed the numbe... | php | public function actionIndex()
{
$model = new Events('search');
$model->unsetAttributes();
if (isset($_GET['Event']))
$model->attributes = $_GET['Event'];
$dataProvider = $model->search();
$dataProvider->pagination = array(
'pageVar' => 'page'
);
// Throw a 404 if we exceed the numbe... | [
"public",
"function",
"actionIndex",
"(",
")",
"{",
"$",
"model",
"=",
"new",
"Events",
"(",
"'search'",
")",
";",
"$",
"model",
"->",
"unsetAttributes",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"_GET",
"[",
"'Event'",
"]",
")",
")",
"$",
"mode... | Provides functionality to search through events | [
"Provides",
"functionality",
"to",
"search",
"through",
"events"
] | 4351855328da0b112ac27bde7e7e07e212be8689 | https://github.com/ciims/ciims-modules-api/blob/4351855328da0b112ac27bde7e7e07e212be8689/controllers/EventController.php#L25-L51 |
200,658 | ciims/ciims-modules-api | controllers/EventController.php | EventController.actionPageviews | public function actionPageviews()
{
$models = Events::model()->groupByUrl()->findAll();
$response = array();
foreach ($models as $model)
$response[] = array(
'uri' => $model->uri,
'count' => $model->id
);
return $response;
} | php | public function actionPageviews()
{
$models = Events::model()->groupByUrl()->findAll();
$response = array();
foreach ($models as $model)
$response[] = array(
'uri' => $model->uri,
'count' => $model->id
);
return $response;
} | [
"public",
"function",
"actionPageviews",
"(",
")",
"{",
"$",
"models",
"=",
"Events",
"::",
"model",
"(",
")",
"->",
"groupByUrl",
"(",
")",
"->",
"findAll",
"(",
")",
";",
"$",
"response",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"models",
... | Shows pageview results
@return array | [
"Shows",
"pageview",
"results"
] | 4351855328da0b112ac27bde7e7e07e212be8689 | https://github.com/ciims/ciims-modules-api/blob/4351855328da0b112ac27bde7e7e07e212be8689/controllers/EventController.php#L57-L69 |
200,659 | fridge-project/dbal | src/Fridge/DBAL/Schema/PrimaryKey.php | PrimaryKey.setColumnNames | public function setColumnNames(array $columnNames)
{
$this->columnNames = array();
foreach ($columnNames as $columnName) {
$this->addColumnName($columnName);
}
} | php | public function setColumnNames(array $columnNames)
{
$this->columnNames = array();
foreach ($columnNames as $columnName) {
$this->addColumnName($columnName);
}
} | [
"public",
"function",
"setColumnNames",
"(",
"array",
"$",
"columnNames",
")",
"{",
"$",
"this",
"->",
"columnNames",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"columnNames",
"as",
"$",
"columnName",
")",
"{",
"$",
"this",
"->",
"addColumnName",
... | Sets the column names.
@param array $columnNames The column names. | [
"Sets",
"the",
"column",
"names",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/PrimaryKey.php#L56-L63 |
200,660 | black-lamp/blcms-cart | frontend/controllers/OrderController.php | OrderController.actionShowOrderList | public function actionShowOrderList() {
if (!\Yii::$app->user->isGuest) {
$userOrders = \Yii::$app->cart->getAllUserOrders();
$filterModel = new OrderSearch();
$dataProvider = $filterModel->search(Yii::$app->request->get());
return $this->render('order-list', [
... | php | public function actionShowOrderList() {
if (!\Yii::$app->user->isGuest) {
$userOrders = \Yii::$app->cart->getAllUserOrders();
$filterModel = new OrderSearch();
$dataProvider = $filterModel->search(Yii::$app->request->get());
return $this->render('order-list', [
... | [
"public",
"function",
"actionShowOrderList",
"(",
")",
"{",
"if",
"(",
"!",
"\\",
"Yii",
"::",
"$",
"app",
"->",
"user",
"->",
"isGuest",
")",
"{",
"$",
"userOrders",
"=",
"\\",
"Yii",
"::",
"$",
"app",
"->",
"cart",
"->",
"getAllUserOrders",
"(",
")... | Return list of user orders.
@return array Order
@throws NotFoundHttpException | [
"Return",
"list",
"of",
"user",
"orders",
"."
] | 314796eecae3ca4ed5fecfdc0231a738af50eba7 | https://github.com/black-lamp/blcms-cart/blob/314796eecae3ca4ed5fecfdc0231a738af50eba7/frontend/controllers/OrderController.php#L24-L37 |
200,661 | wobblecode/WobbleCodeUserBundle | Manager/RoleManager.php | RoleManager.switchOrganization | public function switchOrganization(User $user, OrganizationInterface $organization)
{
$role = $this->getOrganizationRole($user, $organization);
if ($role == false && !$this->authorizationChecker->isGranted('ROLE_SUPER_ADMIN')) {
throw new NotFoundHttpException('Roles in organization not... | php | public function switchOrganization(User $user, OrganizationInterface $organization)
{
$role = $this->getOrganizationRole($user, $organization);
if ($role == false && !$this->authorizationChecker->isGranted('ROLE_SUPER_ADMIN')) {
throw new NotFoundHttpException('Roles in organization not... | [
"public",
"function",
"switchOrganization",
"(",
"User",
"$",
"user",
",",
"OrganizationInterface",
"$",
"organization",
")",
"{",
"$",
"role",
"=",
"$",
"this",
"->",
"getOrganizationRole",
"(",
"$",
"user",
",",
"$",
"organization",
")",
";",
"if",
"(",
... | Switch the working organization of logged user
@todo update security context calls. Deprecated since version 2.6, to be
removed in 3.0. Use AuthorizationCheckerInterface::isGranted() instead.
http://symfony.com/blog/new-in-symfony-2-6-security-component-improvements
@param User $user
@param OrganizationInterf... | [
"Switch",
"the",
"working",
"organization",
"of",
"logged",
"user"
] | 7b8206f8b4a50fbc61f7bfe4f83eb466cad96440 | https://github.com/wobblecode/WobbleCodeUserBundle/blob/7b8206f8b4a50fbc61f7bfe4f83eb466cad96440/Manager/RoleManager.php#L89-L115 |
200,662 | wobblecode/WobbleCodeUserBundle | Manager/RoleManager.php | RoleManager.getOrganizationRole | public function getOrganizationRole($user, $organization)
{
return $this->dm->getRepository('WobbleCodeUserBundle:Role')->findOneBy(
[
'organization.$id' => new \MongoId($organization->getId()),
'user.$id' => new \MongoId($user->getId())
]
);
... | php | public function getOrganizationRole($user, $organization)
{
return $this->dm->getRepository('WobbleCodeUserBundle:Role')->findOneBy(
[
'organization.$id' => new \MongoId($organization->getId()),
'user.$id' => new \MongoId($user->getId())
]
);
... | [
"public",
"function",
"getOrganizationRole",
"(",
"$",
"user",
",",
"$",
"organization",
")",
"{",
"return",
"$",
"this",
"->",
"dm",
"->",
"getRepository",
"(",
"'WobbleCodeUserBundle:Role'",
")",
"->",
"findOneBy",
"(",
"[",
"'organization.$id'",
"=>",
"new",
... | Get user role definition within an organization
@param User $user
@param OrganizationInterface $organizatgion
@return (Role|false) | [
"Get",
"user",
"role",
"definition",
"within",
"an",
"organization"
] | 7b8206f8b4a50fbc61f7bfe4f83eb466cad96440 | https://github.com/wobblecode/WobbleCodeUserBundle/blob/7b8206f8b4a50fbc61f7bfe4f83eb466cad96440/Manager/RoleManager.php#L141-L149 |
200,663 | Dhii/config | src/DereferencingConfigMapFactory.php | DereferencingConfigMapFactory._createProduct | protected function _createProduct($config, $data)
{
$className = static::PRODUCT_CLASS_NAME;
$referenceContainer = $this->_getReferenceContainer($config);
return new $className($data, $referenceContainer);
} | php | protected function _createProduct($config, $data)
{
$className = static::PRODUCT_CLASS_NAME;
$referenceContainer = $this->_getReferenceContainer($config);
return new $className($data, $referenceContainer);
} | [
"protected",
"function",
"_createProduct",
"(",
"$",
"config",
",",
"$",
"data",
")",
"{",
"$",
"className",
"=",
"static",
"::",
"PRODUCT_CLASS_NAME",
";",
"$",
"referenceContainer",
"=",
"$",
"this",
"->",
"_getReferenceContainer",
"(",
"$",
"config",
")",
... | Creates a new factory product.
@since [*next-version*]
@param array|ArrayAccess|BaseContainerInterface|stdClass|null $config The data for the new product instance.
@param array|stdClass|ArrayObject $data The data for the new product instance.
@throws InvalidArgumentException If the data... | [
"Creates",
"a",
"new",
"factory",
"product",
"."
] | 1ab9a7ccf9c0ebd7c6fcbce600b4c00b52b2fdcf | https://github.com/Dhii/config/blob/1ab9a7ccf9c0ebd7c6fcbce600b4c00b52b2fdcf/src/DereferencingConfigMapFactory.php#L124-L130 |
200,664 | Dhii/config | src/DereferencingConfigMapFactory.php | DereferencingConfigMapFactory._getReferenceContainer | protected function _getReferenceContainer($config)
{
try {
$container = $this->_containerHas($config, static::K_REFERENCE_CONTAINER)
? $this->_containerGet($config, static::K_REFERENCE_CONTAINER)
: $this->_getContainer();
} catch (RootException $e) {
... | php | protected function _getReferenceContainer($config)
{
try {
$container = $this->_containerHas($config, static::K_REFERENCE_CONTAINER)
? $this->_containerGet($config, static::K_REFERENCE_CONTAINER)
: $this->_getContainer();
} catch (RootException $e) {
... | [
"protected",
"function",
"_getReferenceContainer",
"(",
"$",
"config",
")",
"{",
"try",
"{",
"$",
"container",
"=",
"$",
"this",
"->",
"_containerHas",
"(",
"$",
"config",
",",
"static",
"::",
"K_REFERENCE_CONTAINER",
")",
"?",
"$",
"this",
"->",
"_container... | Retrieves the reference container to create the child with.
@since [*next-version*]
@param array|ArrayAccess|BaseContainerInterface|stdClass|null $config The config of the product, the child of which to get the container for.
@throws RuntimeException If the reference container could not be retrieved.
@return BaseCo... | [
"Retrieves",
"the",
"reference",
"container",
"to",
"create",
"the",
"child",
"with",
"."
] | 1ab9a7ccf9c0ebd7c6fcbce600b4c00b52b2fdcf | https://github.com/Dhii/config/blob/1ab9a7ccf9c0ebd7c6fcbce600b4c00b52b2fdcf/src/DereferencingConfigMapFactory.php#L153-L164 |
200,665 | bytic/orm | src/Traits/ActiveRecord/ActiveRecordsTrait.php | ActiveRecordsTrait.insert | public function insert($model, $onDuplicate = false)
{
$query = $this->insertQuery($model, $onDuplicate);
$query->execute();
return $this->getDB()->lastInsertID();
} | php | public function insert($model, $onDuplicate = false)
{
$query = $this->insertQuery($model, $onDuplicate);
$query->execute();
return $this->getDB()->lastInsertID();
} | [
"public",
"function",
"insert",
"(",
"$",
"model",
",",
"$",
"onDuplicate",
"=",
"false",
")",
"{",
"$",
"query",
"=",
"$",
"this",
"->",
"insertQuery",
"(",
"$",
"model",
",",
"$",
"onDuplicate",
")",
";",
"$",
"query",
"->",
"execute",
"(",
")",
... | Inserts a Record into the database
@param Record $model
@param array|bool $onDuplicate
@return integer | [
"Inserts",
"a",
"Record",
"into",
"the",
"database"
] | 8d9a79b47761af0bfd9b8d1d28c83221dcac0de0 | https://github.com/bytic/orm/blob/8d9a79b47761af0bfd9b8d1d28c83221dcac0de0/src/Traits/ActiveRecord/ActiveRecordsTrait.php#L110-L116 |
200,666 | bytic/orm | src/Traits/ActiveRecord/ActiveRecordsTrait.php | ActiveRecordsTrait.update | public function update(Record $model)
{
$query = $this->updateQuery($model);
if ($query) {
return $query->execute();
}
return false;
} | php | public function update(Record $model)
{
$query = $this->updateQuery($model);
if ($query) {
return $query->execute();
}
return false;
} | [
"public",
"function",
"update",
"(",
"Record",
"$",
"model",
")",
"{",
"$",
"query",
"=",
"$",
"this",
"->",
"updateQuery",
"(",
"$",
"model",
")",
";",
"if",
"(",
"$",
"query",
")",
"{",
"return",
"$",
"query",
"->",
"execute",
"(",
")",
";",
"}... | Updates a Record's database entry
@param Record $model
@return bool|Result | [
"Updates",
"a",
"Record",
"s",
"database",
"entry"
] | 8d9a79b47761af0bfd9b8d1d28c83221dcac0de0 | https://github.com/bytic/orm/blob/8d9a79b47761af0bfd9b8d1d28c83221dcac0de0/src/Traits/ActiveRecord/ActiveRecordsTrait.php#L150-L159 |
200,667 | bytic/orm | src/Traits/ActiveRecord/ActiveRecordsTrait.php | ActiveRecordsTrait.save | public function save(Record $model)
{
$pk = $this->getPrimaryKey();
if (isset($model->{$pk})) {
$model->update();
return $model->{$pk};
} else {
/** @var Record $previous */
$previous = $model->exists();
if ($previous) {
... | php | public function save(Record $model)
{
$pk = $this->getPrimaryKey();
if (isset($model->{$pk})) {
$model->update();
return $model->{$pk};
} else {
/** @var Record $previous */
$previous = $model->exists();
if ($previous) {
... | [
"public",
"function",
"save",
"(",
"Record",
"$",
"model",
")",
"{",
"$",
"pk",
"=",
"$",
"this",
"->",
"getPrimaryKey",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"model",
"->",
"{",
"$",
"pk",
"}",
")",
")",
"{",
"$",
"model",
"->",
"update... | Saves a Record's database entry
@param Record $model
@return mixed | [
"Saves",
"a",
"Record",
"s",
"database",
"entry"
] | 8d9a79b47761af0bfd9b8d1d28c83221dcac0de0 | https://github.com/bytic/orm/blob/8d9a79b47761af0bfd9b8d1d28c83221dcac0de0/src/Traits/ActiveRecord/ActiveRecordsTrait.php#L203-L232 |
200,668 | sil-project/SeedBatchBundle | src/Entity/OuterExtension/HasSeedBatches.php | HasSeedBatches.addSeedBatch | public function addSeedBatch($seedBatch)
{
$this->seedBatches[] = $seedBatch;
if (method_exists(get_class($this), 'setProducer')) {
$seedBatch->setProducer($this);
}
return $this;
} | php | public function addSeedBatch($seedBatch)
{
$this->seedBatches[] = $seedBatch;
if (method_exists(get_class($this), 'setProducer')) {
$seedBatch->setProducer($this);
}
return $this;
} | [
"public",
"function",
"addSeedBatch",
"(",
"$",
"seedBatch",
")",
"{",
"$",
"this",
"->",
"seedBatches",
"[",
"]",
"=",
"$",
"seedBatch",
";",
"if",
"(",
"method_exists",
"(",
"get_class",
"(",
"$",
"this",
")",
",",
"'setProducer'",
")",
")",
"{",
"$"... | Add seed batch.
@param SeedBatch $seedBatch
@return self | [
"Add",
"seed",
"batch",
"."
] | a2640b5359fe31d3bdb9c9fa2f72141ac841729c | https://github.com/sil-project/SeedBatchBundle/blob/a2640b5359fe31d3bdb9c9fa2f72141ac841729c/src/Entity/OuterExtension/HasSeedBatches.php#L32-L41 |
200,669 | itkg/core | src/Itkg/Core/Cache/Listener/CacheListener.php | CacheListener.fetchEntityFromCache | public function fetchEntityFromCache(EntityLoadEvent $event)
{
$entity = $event->getEntity();
// Check cache
if (false !== $data = $this->cache->get($entity)) {
// Set data from cache to entity object
$entity->setDataFromCache($data);
$entity->setIsLoaded... | php | public function fetchEntityFromCache(EntityLoadEvent $event)
{
$entity = $event->getEntity();
// Check cache
if (false !== $data = $this->cache->get($entity)) {
// Set data from cache to entity object
$entity->setDataFromCache($data);
$entity->setIsLoaded... | [
"public",
"function",
"fetchEntityFromCache",
"(",
"EntityLoadEvent",
"$",
"event",
")",
"{",
"$",
"entity",
"=",
"$",
"event",
"->",
"getEntity",
"(",
")",
";",
"// Check cache",
"if",
"(",
"false",
"!==",
"$",
"data",
"=",
"$",
"this",
"->",
"cache",
"... | Load data from cache
@param EntityLoadEvent $event
@return void | [
"Load",
"data",
"from",
"cache"
] | e5e4efb05feb4d23b0df41f2b21fd095103e593b | https://github.com/itkg/core/blob/e5e4efb05feb4d23b0df41f2b21fd095103e593b/src/Itkg/Core/Cache/Listener/CacheListener.php#L52-L64 |
200,670 | guni12/comment | src/Comments/HTMLForm/UpdateCommForm.php | UpdateCommForm.decode | public function decode($fromjson)
{
$textfilter = $this->di->get("textfilter");
$toparse = json_decode($fromjson);
$comt = $textfilter->parse($toparse->text, ["yamlfrontmatter", "shortcode", "markdown", "titlefromheader"]);
$comt = strip_tags($comt->text);
return $comt;
} | php | public function decode($fromjson)
{
$textfilter = $this->di->get("textfilter");
$toparse = json_decode($fromjson);
$comt = $textfilter->parse($toparse->text, ["yamlfrontmatter", "shortcode", "markdown", "titlefromheader"]);
$comt = strip_tags($comt->text);
return $comt;
} | [
"public",
"function",
"decode",
"(",
"$",
"fromjson",
")",
"{",
"$",
"textfilter",
"=",
"$",
"this",
"->",
"di",
"->",
"get",
"(",
"\"textfilter\"",
")",
";",
"$",
"toparse",
"=",
"json_decode",
"(",
"$",
"fromjson",
")",
";",
"$",
"comt",
"=",
"$",
... | Converts json-string back to variables
@param string $fromjson the jsoncode
@return the extracted comment-text | [
"Converts",
"json",
"-",
"string",
"back",
"to",
"variables"
] | f9c2f3e2093fea414867f548c5f5e07f96c55bfd | https://github.com/guni12/comment/blob/f9c2f3e2093fea414867f548c5f5e07f96c55bfd/src/Comments/HTMLForm/UpdateCommForm.php#L36-L43 |
200,671 | Wedeto/HTTP | src/Forms/Form.php | Form.isSubmitted | public function isSubmitted(Request $request)
{
$arguments = $this->method === "GET" ? $request->get : $request->post;
// Check if the form has been submitted at all
return $this->method === $request->method && $arguments['_form_name'] === $this->name;
} | php | public function isSubmitted(Request $request)
{
$arguments = $this->method === "GET" ? $request->get : $request->post;
// Check if the form has been submitted at all
return $this->method === $request->method && $arguments['_form_name'] === $this->name;
} | [
"public",
"function",
"isSubmitted",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"arguments",
"=",
"$",
"this",
"->",
"method",
"===",
"\"GET\"",
"?",
"$",
"request",
"->",
"get",
":",
"$",
"request",
"->",
"post",
";",
"// Check if the form has been subm... | Check if the form has been submitted
@return bool True if the form was submitted, false if not | [
"Check",
"if",
"the",
"form",
"has",
"been",
"submitted"
] | 7318eff1b81a3c103c4263466d09b7f3593b70b9 | https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/Forms/Form.php#L203-L209 |
200,672 | Wedeto/HTTP | src/Forms/Form.php | Form.isValid | public function isValid(Request $request)
{
$arguments = $this->method === "GET" ? $request->get : $request->post;
$files = $request->files;
if (!$this->validate($arguments, $files))
return false;
$params = ['form' => $this, 'request' => $request, 'valid' => true, 'argu... | php | public function isValid(Request $request)
{
$arguments = $this->method === "GET" ? $request->get : $request->post;
$files = $request->files;
if (!$this->validate($arguments, $files))
return false;
$params = ['form' => $this, 'request' => $request, 'valid' => true, 'argu... | [
"public",
"function",
"isValid",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"arguments",
"=",
"$",
"this",
"->",
"method",
"===",
"\"GET\"",
"?",
"$",
"request",
"->",
"get",
":",
"$",
"request",
"->",
"post",
";",
"$",
"files",
"=",
"$",
"reques... | Check if the form submission is valid
@param Request $request The request containing the submitted data
@return bool True when the submission is valid, false otherwise | [
"Check",
"if",
"the",
"form",
"submission",
"is",
"valid"
] | 7318eff1b81a3c103c4263466d09b7f3593b70b9 | https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/Forms/Form.php#L216-L243 |
200,673 | Wedeto/HTTP | src/Forms/Form.php | Form.validate | public function validate(Dictionary $arguments, Dictionary $files)
{
// Check all submitted values
$complete = true;
$this->errors = [];
$this->value = [];
foreach ($this->form_elements as $name => $element)
{
if ($element instanceof Form)
{
... | php | public function validate(Dictionary $arguments, Dictionary $files)
{
// Check all submitted values
$complete = true;
$this->errors = [];
$this->value = [];
foreach ($this->form_elements as $name => $element)
{
if ($element instanceof Form)
{
... | [
"public",
"function",
"validate",
"(",
"Dictionary",
"$",
"arguments",
",",
"Dictionary",
"$",
"files",
")",
"{",
"// Check all submitted values",
"$",
"complete",
"=",
"true",
";",
"$",
"this",
"->",
"errors",
"=",
"[",
"]",
";",
"$",
"this",
"->",
"value... | Make sure the form was submitted correctly. When errors occur,
these can be obtained using getErrors.
@param Dictionary $arguments The submitted arguments
@param Dictionary $files The submitted files
@return bool True if all fields validate, false if not. | [
"Make",
"sure",
"the",
"form",
"was",
"submitted",
"correctly",
".",
"When",
"errors",
"occur",
"these",
"can",
"be",
"obtained",
"using",
"getErrors",
"."
] | 7318eff1b81a3c103c4263466d09b7f3593b70b9 | https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/Forms/Form.php#L291-L328 |
200,674 | Wedeto/HTTP | src/Forms/Form.php | Form.validateAsSubForm | public function validateAsSubForm(Dictionary $arguments, Dictionary $files)
{
$name = $this->name;
if (!$arguments->has($name, Type::ARRAY))
{
$this->errors = [];
if ($this->isRequired())
{
$this->errors = ['' => ['msg' => "{name} is requir... | php | public function validateAsSubForm(Dictionary $arguments, Dictionary $files)
{
$name = $this->name;
if (!$arguments->has($name, Type::ARRAY))
{
$this->errors = [];
if ($this->isRequired())
{
$this->errors = ['' => ['msg' => "{name} is requir... | [
"public",
"function",
"validateAsSubForm",
"(",
"Dictionary",
"$",
"arguments",
",",
"Dictionary",
"$",
"files",
")",
"{",
"$",
"name",
"=",
"$",
"this",
"->",
"name",
";",
"if",
"(",
"!",
"$",
"arguments",
"->",
"has",
"(",
"$",
"name",
",",
"Type",
... | Validate the form as a sub form
@param Dictionary $arguments The submitted data
@param Dictionary $files The submitted files
@return True if the form valides, false if not. | [
"Validate",
"the",
"form",
"as",
"a",
"sub",
"form"
] | 7318eff1b81a3c103c4263466d09b7f3593b70b9 | https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/Forms/Form.php#L345-L396 |
200,675 | Wedeto/HTTP | src/Forms/Form.php | Form.prepare | public function prepare(Session $session = null, bool $is_root_form = true)
{
foreach ($this->form_elements as $field)
{
if ($field instanceof Form)
$field->prepare(null, false);
}
$params = ['form' => $this, 'session' => $session, 'is_root_form' => $is_r... | php | public function prepare(Session $session = null, bool $is_root_form = true)
{
foreach ($this->form_elements as $field)
{
if ($field instanceof Form)
$field->prepare(null, false);
}
$params = ['form' => $this, 'session' => $session, 'is_root_form' => $is_r... | [
"public",
"function",
"prepare",
"(",
"Session",
"$",
"session",
"=",
"null",
",",
"bool",
"$",
"is_root_form",
"=",
"true",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"form_elements",
"as",
"$",
"field",
")",
"{",
"if",
"(",
"$",
"field",
"instanceo... | Prepare the form for rendering. This will generate the nonce and add the form name
@param Session $session The session used to generate the nonce. Omit to skip adding a nonce
@param bool $is_root_form Whether this is the root form or not. When
false, the _form_name element is not added
@return Form Provides fluent inte... | [
"Prepare",
"the",
"form",
"for",
"rendering",
".",
"This",
"will",
"generate",
"the",
"nonce",
"and",
"add",
"the",
"form",
"name"
] | 7318eff1b81a3c103c4263466d09b7f3593b70b9 | https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/Forms/Form.php#L405-L421 |
200,676 | Wedeto/HTTP | src/Forms/Form.php | Form.offsetSet | public function offsetSet($offset, $value)
{
if (!($value instanceof FormField))
throw new InvalidArgumentException("Value must be a FormField");
$this->form_elements[$offset] = $value;
} | php | public function offsetSet($offset, $value)
{
if (!($value instanceof FormField))
throw new InvalidArgumentException("Value must be a FormField");
$this->form_elements[$offset] = $value;
} | [
"public",
"function",
"offsetSet",
"(",
"$",
"offset",
",",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"value",
"instanceof",
"FormField",
")",
")",
"throw",
"new",
"InvalidArgumentException",
"(",
"\"Value must be a FormField\"",
")",
";",
"$",
"this... | Add or replace a form element
@param string $offset The name of the element
@param FormElement $element The element to set | [
"Add",
"or",
"replace",
"a",
"form",
"element"
] | 7318eff1b81a3c103c4263466d09b7f3593b70b9 | https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/Forms/Form.php#L493-L499 |
200,677 | shrink0r/php-schema | src/Factory.php | Factory.verifyClassMap | protected function verifyClassMap(array $classMap)
{
foreach ($classMap as $type => $class) {
if (!class_exists($class)) {
throw new Exception("Class '$class' that has been registered for type '$type' does not exist");
}
if (!in_array(PropertyInterface::cl... | php | protected function verifyClassMap(array $classMap)
{
foreach ($classMap as $type => $class) {
if (!class_exists($class)) {
throw new Exception("Class '$class' that has been registered for type '$type' does not exist");
}
if (!in_array(PropertyInterface::cl... | [
"protected",
"function",
"verifyClassMap",
"(",
"array",
"$",
"classMap",
")",
"{",
"foreach",
"(",
"$",
"classMap",
"as",
"$",
"type",
"=>",
"$",
"class",
")",
"{",
"if",
"(",
"!",
"class_exists",
"(",
"$",
"class",
")",
")",
"{",
"throw",
"new",
"E... | Ensures that the given class map contains valid values.
@param string[] $classMap
@return string[] Returns the verified class map. | [
"Ensures",
"that",
"the",
"given",
"class",
"map",
"contains",
"valid",
"values",
"."
] | 94293fe897af376dd9d05962e2c516079409dd29 | https://github.com/shrink0r/php-schema/blob/94293fe897af376dd9d05962e2c516079409dd29/src/Factory.php#L99-L111 |
200,678 | erenmustafaozdal/laravel-modules-base | src/Controllers/BaseNodeController.php | BaseNodeController.setRelation | protected function setRelation($request)
{
$this->changeRelationModel();
$relation = [];
if ($request->has('group-thumbnail')) {
$this->relations['thumbnails']['datas'] = collect($request->get('group-thumbnail'))->reject(function($item)
{
return ! $ite... | php | protected function setRelation($request)
{
$this->changeRelationModel();
$relation = [];
if ($request->has('group-thumbnail')) {
$this->relations['thumbnails']['datas'] = collect($request->get('group-thumbnail'))->reject(function($item)
{
return ! $ite... | [
"protected",
"function",
"setRelation",
"(",
"$",
"request",
")",
"{",
"$",
"this",
"->",
"changeRelationModel",
"(",
")",
";",
"$",
"relation",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"request",
"->",
"has",
"(",
"'group-thumbnail'",
")",
")",
"{",
"$",
... | set the relations
@param $request
@return void | [
"set",
"the",
"relations"
] | c26600543817642926bcf16ada84009e00d784e0 | https://github.com/erenmustafaozdal/laravel-modules-base/blob/c26600543817642926bcf16ada84009e00d784e0/src/Controllers/BaseNodeController.php#L37-L72 |
200,679 | erenmustafaozdal/laravel-modules-base | src/Controllers/BaseNodeController.php | BaseNodeController.setRelationDefine | protected function setRelationDefine($parent)
{
$this->changeRelationModel();
$this->setDefineValues($this->defineValues);
$this->relations['thumbnails']['datas'] = $parent->thumbnails()->get(['slug','photo_width','photo_height'])->toArray();
$this->relations['extras']['datas'] = $pa... | php | protected function setRelationDefine($parent)
{
$this->changeRelationModel();
$this->setDefineValues($this->defineValues);
$this->relations['thumbnails']['datas'] = $parent->thumbnails()->get(['slug','photo_width','photo_height'])->toArray();
$this->relations['extras']['datas'] = $pa... | [
"protected",
"function",
"setRelationDefine",
"(",
"$",
"parent",
")",
"{",
"$",
"this",
"->",
"changeRelationModel",
"(",
")",
";",
"$",
"this",
"->",
"setDefineValues",
"(",
"$",
"this",
"->",
"defineValues",
")",
";",
"$",
"this",
"->",
"relations",
"["... | set relation define datas
@param $parent
@return void | [
"set",
"relation",
"define",
"datas"
] | c26600543817642926bcf16ada84009e00d784e0 | https://github.com/erenmustafaozdal/laravel-modules-base/blob/c26600543817642926bcf16ada84009e00d784e0/src/Controllers/BaseNodeController.php#L80-L87 |
200,680 | erenmustafaozdal/laravel-modules-base | src/Controllers/BaseNodeController.php | BaseNodeController.changeRelationModel | protected function changeRelationModel()
{
$module = getModule(get_called_class());
$module = explode('-',$module);
$module = ucfirst_tr($module[1]);
$this->relations['thumbnails']['relation_model'] = "\\App\\{$module}Thumbnail";
$this->relations['extras']['relation_model'] =... | php | protected function changeRelationModel()
{
$module = getModule(get_called_class());
$module = explode('-',$module);
$module = ucfirst_tr($module[1]);
$this->relations['thumbnails']['relation_model'] = "\\App\\{$module}Thumbnail";
$this->relations['extras']['relation_model'] =... | [
"protected",
"function",
"changeRelationModel",
"(",
")",
"{",
"$",
"module",
"=",
"getModule",
"(",
"get_called_class",
"(",
")",
")",
";",
"$",
"module",
"=",
"explode",
"(",
"'-'",
",",
"$",
"module",
")",
";",
"$",
"module",
"=",
"ucfirst_tr",
"(",
... | change relation model | [
"change",
"relation",
"model"
] | c26600543817642926bcf16ada84009e00d784e0 | https://github.com/erenmustafaozdal/laravel-modules-base/blob/c26600543817642926bcf16ada84009e00d784e0/src/Controllers/BaseNodeController.php#L92-L99 |
200,681 | XetaIO/Xetaravel-IpTraceable | src/Traits/IpTraceable.php | IpTraceable.updateFields | public function updateFields(Guard $auth, $ip = null): bool
{
$ip = $this->setIpValue($ip);
$user = $auth->user();
if (!$user instanceof Model) {
return false;
}
$user->last_login_ip = $ip;
$lastLoginDate = config('iptraceable.fields.last_login_date');
... | php | public function updateFields(Guard $auth, $ip = null): bool
{
$ip = $this->setIpValue($ip);
$user = $auth->user();
if (!$user instanceof Model) {
return false;
}
$user->last_login_ip = $ip;
$lastLoginDate = config('iptraceable.fields.last_login_date');
... | [
"public",
"function",
"updateFields",
"(",
"Guard",
"$",
"auth",
",",
"$",
"ip",
"=",
"null",
")",
":",
"bool",
"{",
"$",
"ip",
"=",
"$",
"this",
"->",
"setIpValue",
"(",
"$",
"ip",
")",
";",
"$",
"user",
"=",
"$",
"auth",
"->",
"user",
"(",
")... | Update the fields for the user.
@param \Illuminate\Contracts\Auth\Guard $auth
@param null|string $ip The IP to set.
@return bool | [
"Update",
"the",
"fields",
"for",
"the",
"user",
"."
] | e1c57592d45f240c55e827fd6b756e5143c892b5 | https://github.com/XetaIO/Xetaravel-IpTraceable/blob/e1c57592d45f240c55e827fd6b756e5143c892b5/src/Traits/IpTraceable.php#L19-L37 |
200,682 | squareproton/Bond | src/Bond/Entity/Types/DateRange.php | DateRange.contains | public function contains( DateTime $datetime )
{
$lower = $this->lower->toUnixTimestamp();
$upper = $this->upper->toUnixTimestamp();
$working = $datetime->toUnixTimestamp();
$lowerCompare = bccomp( $lower, $working );
$upperCompare = bccomp( $upper, $working );
// e... | php | public function contains( DateTime $datetime )
{
$lower = $this->lower->toUnixTimestamp();
$upper = $this->upper->toUnixTimestamp();
$working = $datetime->toUnixTimestamp();
$lowerCompare = bccomp( $lower, $working );
$upperCompare = bccomp( $upper, $working );
// e... | [
"public",
"function",
"contains",
"(",
"DateTime",
"$",
"datetime",
")",
"{",
"$",
"lower",
"=",
"$",
"this",
"->",
"lower",
"->",
"toUnixTimestamp",
"(",
")",
";",
"$",
"upper",
"=",
"$",
"this",
"->",
"upper",
"->",
"toUnixTimestamp",
"(",
")",
";",
... | Does this interval contain our time
@return Bond\Entity\T | [
"Does",
"this",
"interval",
"contain",
"our",
"time"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Entity/Types/DateRange.php#L87-L110 |
200,683 | danielgp/common-lib | source/MySQLiAdvancedOutput.php | MySQLiAdvancedOutput.getFieldOutputEnumSet | private function getFieldOutputEnumSet($tblSrc, $fldType, $val, $iar = [])
{
$adnlThings = $this->establishDefaultEnumSet($fldType);
if (array_key_exists('readonly', $val)) {
return $this->getFieldOutputEnumSetReadOnly($val, $adnlThings);
}
$inAdtnl = $adnlThings['additio... | php | private function getFieldOutputEnumSet($tblSrc, $fldType, $val, $iar = [])
{
$adnlThings = $this->establishDefaultEnumSet($fldType);
if (array_key_exists('readonly', $val)) {
return $this->getFieldOutputEnumSetReadOnly($val, $adnlThings);
}
$inAdtnl = $adnlThings['additio... | [
"private",
"function",
"getFieldOutputEnumSet",
"(",
"$",
"tblSrc",
",",
"$",
"fldType",
",",
"$",
"val",
",",
"$",
"iar",
"=",
"[",
"]",
")",
"{",
"$",
"adnlThings",
"=",
"$",
"this",
"->",
"establishDefaultEnumSet",
"(",
"$",
"fldType",
")",
";",
"if... | Returns a Enum or Set field to use in form
@param string $tblSrc
@param string $fldType
@param array $val
@param array $iar
@return string | [
"Returns",
"a",
"Enum",
"or",
"Set",
"field",
"to",
"use",
"in",
"form"
] | 627b99b4408414c7cd21a6c8016f6468dc9216b2 | https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/MySQLiAdvancedOutput.php#L50-L63 |
200,684 | danielgp/common-lib | source/MySQLiAdvancedOutput.php | MySQLiAdvancedOutput.getFieldOutputText | private function getFieldOutputText($tbl, $fieldType, $value, $iar = [])
{
if (!in_array($fieldType, ['char', 'tinytext', 'varchar'])) {
return '';
}
$foreignKeysArray = $this->getFieldOutputTextPrerequisites($tbl, $value);
if ($foreignKeysArray !== []) {
retu... | php | private function getFieldOutputText($tbl, $fieldType, $value, $iar = [])
{
if (!in_array($fieldType, ['char', 'tinytext', 'varchar'])) {
return '';
}
$foreignKeysArray = $this->getFieldOutputTextPrerequisites($tbl, $value);
if ($foreignKeysArray !== []) {
retu... | [
"private",
"function",
"getFieldOutputText",
"(",
"$",
"tbl",
",",
"$",
"fieldType",
",",
"$",
"value",
",",
"$",
"iar",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"fieldType",
",",
"[",
"'char'",
",",
"'tinytext'",
",",
"'varchar... | Returns a Char field 2 use in a form
@param string $tbl
@param string $fieldType
@param array $value
@param array $iar
@return string | [
"Returns",
"a",
"Char",
"field",
"2",
"use",
"in",
"a",
"form"
] | 627b99b4408414c7cd21a6c8016f6468dc9216b2 | https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/MySQLiAdvancedOutput.php#L74-L84 |
200,685 | danielgp/common-lib | source/MySQLiAdvancedOutput.php | MySQLiAdvancedOutput.getFieldOutputTextLarge | protected function getFieldOutputTextLarge($fieldType, $value, $iar = [])
{
if (!in_array($fieldType, ['blob', 'text'])) {
return '';
}
$inAdtnl = [
'name' => $value['COLUMN_NAME'],
'id' => $value['COLUMN_NAME'],
'rows' => 4,
'col... | php | protected function getFieldOutputTextLarge($fieldType, $value, $iar = [])
{
if (!in_array($fieldType, ['blob', 'text'])) {
return '';
}
$inAdtnl = [
'name' => $value['COLUMN_NAME'],
'id' => $value['COLUMN_NAME'],
'rows' => 4,
'col... | [
"protected",
"function",
"getFieldOutputTextLarge",
"(",
"$",
"fieldType",
",",
"$",
"value",
",",
"$",
"iar",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"fieldType",
",",
"[",
"'blob'",
",",
"'text'",
"]",
")",
")",
"{",
"return"... | Returns a Text field 2 use in a form
@param string $fieldType
@param array $value
@param array $iar
@return string | [
"Returns",
"a",
"Text",
"field",
"2",
"use",
"in",
"a",
"form"
] | 627b99b4408414c7cd21a6c8016f6468dc9216b2 | https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/MySQLiAdvancedOutput.php#L94-L109 |
200,686 | danielgp/common-lib | source/MySQLiAdvancedOutput.php | MySQLiAdvancedOutput.getFieldOutputTimestamp | private function getFieldOutputTimestamp($dtl, $iar = [])
{
if (($dtl['COLUMN_DEFAULT'] == 'CURRENT_TIMESTAMP') || ($dtl['EXTRA'] == 'on update CURRENT_TIMESTAMP')) {
return $this->getTimestamping($dtl)['input'];
}
$input = $this->getFieldOutputTT($dtl, 19, $iar);
if (!ar... | php | private function getFieldOutputTimestamp($dtl, $iar = [])
{
if (($dtl['COLUMN_DEFAULT'] == 'CURRENT_TIMESTAMP') || ($dtl['EXTRA'] == 'on update CURRENT_TIMESTAMP')) {
return $this->getTimestamping($dtl)['input'];
}
$input = $this->getFieldOutputTT($dtl, 19, $iar);
if (!ar... | [
"private",
"function",
"getFieldOutputTimestamp",
"(",
"$",
"dtl",
",",
"$",
"iar",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"(",
"$",
"dtl",
"[",
"'COLUMN_DEFAULT'",
"]",
"==",
"'CURRENT_TIMESTAMP'",
")",
"||",
"(",
"$",
"dtl",
"[",
"'EXTRA'",
"]",
"==",
... | Returns a Timestamp field 2 use in a form
@param array $dtl
@param array $iar
@return string | [
"Returns",
"a",
"Timestamp",
"field",
"2",
"use",
"in",
"a",
"form"
] | 627b99b4408414c7cd21a6c8016f6468dc9216b2 | https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/MySQLiAdvancedOutput.php#L118-L128 |
200,687 | danielgp/common-lib | source/MySQLiAdvancedOutput.php | MySQLiAdvancedOutput.getFieldOutputYear | private function getFieldOutputYear($tblName, $details, $iar)
{
$listOfValues = [];
for ($cntr = 1901; $cntr <= 2155; $cntr++) {
$listOfValues[$cntr] = $cntr;
}
if ($iar == []) {
$slDflt = $this->getFieldValue($details);
return $this->setArrayToSel... | php | private function getFieldOutputYear($tblName, $details, $iar)
{
$listOfValues = [];
for ($cntr = 1901; $cntr <= 2155; $cntr++) {
$listOfValues[$cntr] = $cntr;
}
if ($iar == []) {
$slDflt = $this->getFieldValue($details);
return $this->setArrayToSel... | [
"private",
"function",
"getFieldOutputYear",
"(",
"$",
"tblName",
",",
"$",
"details",
",",
"$",
"iar",
")",
"{",
"$",
"listOfValues",
"=",
"[",
"]",
";",
"for",
"(",
"$",
"cntr",
"=",
"1901",
";",
"$",
"cntr",
"<=",
"2155",
";",
"$",
"cntr",
"++",... | Returns a Year field 2 use in a form
@param array $details
@param array $iar
@return string | [
"Returns",
"a",
"Year",
"field",
"2",
"use",
"in",
"a",
"form"
] | 627b99b4408414c7cd21a6c8016f6468dc9216b2 | https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/MySQLiAdvancedOutput.php#L137-L148 |
200,688 | danielgp/common-lib | source/MySQLiAdvancedOutput.php | MySQLiAdvancedOutput.getSetOrEnum2Array | protected function getSetOrEnum2Array($refTbl, $refCol)
{
$dat = $this->establishDatabaseAndTable($refTbl);
foreach ($this->advCache['tableStructureCache'][$dat[0]][$dat[1]] as $vle) {
if ($vle['COLUMN_NAME'] == $refCol) {
$kVl = explode('\',\'', substr($vle['COLUMN_TYPE'... | php | protected function getSetOrEnum2Array($refTbl, $refCol)
{
$dat = $this->establishDatabaseAndTable($refTbl);
foreach ($this->advCache['tableStructureCache'][$dat[0]][$dat[1]] as $vle) {
if ($vle['COLUMN_NAME'] == $refCol) {
$kVl = explode('\',\'', substr($vle['COLUMN_TYPE'... | [
"protected",
"function",
"getSetOrEnum2Array",
"(",
"$",
"refTbl",
",",
"$",
"refCol",
")",
"{",
"$",
"dat",
"=",
"$",
"this",
"->",
"establishDatabaseAndTable",
"(",
"$",
"refTbl",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"advCache",
"[",
"'tableStruc... | Returns an array with possible values of a SET or ENUM column
@param string $refTbl
@param string $refCol
@return array | [
"Returns",
"an",
"array",
"with",
"possible",
"values",
"of",
"a",
"SET",
"or",
"ENUM",
"column"
] | 627b99b4408414c7cd21a6c8016f6468dc9216b2 | https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/MySQLiAdvancedOutput.php#L157-L171 |
200,689 | danielgp/common-lib | source/MySQLiAdvancedOutput.php | MySQLiAdvancedOutput.getTimestamping | private function getTimestamping($dtl)
{
$fieldValue = $this->getFieldValue($dtl);
$inM = $this->setStringIntoTag($fieldValue, 'span');
if (in_array($fieldValue, ['', 'CURRENT_TIMESTAMP', 'NULL'])) {
$mCN = [
'InsertDateTime' => 'data/timpul ad. info... | php | private function getTimestamping($dtl)
{
$fieldValue = $this->getFieldValue($dtl);
$inM = $this->setStringIntoTag($fieldValue, 'span');
if (in_array($fieldValue, ['', 'CURRENT_TIMESTAMP', 'NULL'])) {
$mCN = [
'InsertDateTime' => 'data/timpul ad. info... | [
"private",
"function",
"getTimestamping",
"(",
"$",
"dtl",
")",
"{",
"$",
"fieldValue",
"=",
"$",
"this",
"->",
"getFieldValue",
"(",
"$",
"dtl",
")",
";",
"$",
"inM",
"=",
"$",
"this",
"->",
"setStringIntoTag",
"(",
"$",
"fieldValue",
",",
"'span'",
"... | Returns a timestamp field value
@param array $dtl
@return array | [
"Returns",
"a",
"timestamp",
"field",
"value"
] | 627b99b4408414c7cd21a6c8016f6468dc9216b2 | https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/MySQLiAdvancedOutput.php#L179-L195 |
200,690 | anime-db/catalog-bundle | src/Controller/NoticeController.php | NoticeController.indexAction | public function indexAction(Request $request)
{
$response = $this->getCacheTimeKeeper()->getResponse('AnimeDbAppBundle:Notice');
// response was not modified for this request
if ($response->isNotModified($request)) {
return $response;
}
$rep = $this->getRepositor... | php | public function indexAction(Request $request)
{
$response = $this->getCacheTimeKeeper()->getResponse('AnimeDbAppBundle:Notice');
// response was not modified for this request
if ($response->isNotModified($request)) {
return $response;
}
$rep = $this->getRepositor... | [
"public",
"function",
"indexAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"getCacheTimeKeeper",
"(",
")",
"->",
"getResponse",
"(",
"'AnimeDbAppBundle:Notice'",
")",
";",
"// response was not modified for this request",
... | Edit list notices.
@param Request $request
@return Response | [
"Edit",
"list",
"notices",
"."
] | 631b6f92a654e91bee84f46218c52cf42bdb8606 | https://github.com/anime-db/catalog-bundle/blob/631b6f92a654e91bee84f46218c52cf42bdb8606/src/Controller/NoticeController.php#L39-L67 |
200,691 | anime-db/catalog-bundle | src/Controller/NoticeController.php | NoticeController.listAction | public function listAction(Request $request)
{
$current_page = $request->get('page', 1);
$current_page = $current_page > 1 ? $current_page : 1;
$rep = $this->getRepository();
// filter list notice
$filter = $this->createForm('notices_filter')->handleRequest($request);
... | php | public function listAction(Request $request)
{
$current_page = $request->get('page', 1);
$current_page = $current_page > 1 ? $current_page : 1;
$rep = $this->getRepository();
// filter list notice
$filter = $this->createForm('notices_filter')->handleRequest($request);
... | [
"public",
"function",
"listAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"current_page",
"=",
"$",
"request",
"->",
"get",
"(",
"'page'",
",",
"1",
")",
";",
"$",
"current_page",
"=",
"$",
"current_page",
">",
"1",
"?",
"$",
"current_page",
"... | Get notice list.
@param Request $request
@return Response | [
"Get",
"notice",
"list",
"."
] | 631b6f92a654e91bee84f46218c52cf42bdb8606 | https://github.com/anime-db/catalog-bundle/blob/631b6f92a654e91bee84f46218c52cf42bdb8606/src/Controller/NoticeController.php#L76-L120 |
200,692 | WellBloud/sovacore-core | src/model/CoreFacade.php | CoreFacade.getAllPublished | public function getAllPublished(
$orderBy = null,
$limit = null
)
{
return $this->repository->findAllPublished($orderBy, $limit);
} | php | public function getAllPublished(
$orderBy = null,
$limit = null
)
{
return $this->repository->findAllPublished($orderBy, $limit);
} | [
"public",
"function",
"getAllPublished",
"(",
"$",
"orderBy",
"=",
"null",
",",
"$",
"limit",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"repository",
"->",
"findAllPublished",
"(",
"$",
"orderBy",
",",
"$",
"limit",
")",
";",
"}"
] | Method which finds all published items in the repository
@param array $orderBy
@param int $limit
@return array | [
"Method",
"which",
"finds",
"all",
"published",
"items",
"in",
"the",
"repository"
] | 1816a0d7cd3ec4a90d64e301fc2469d171ad217f | https://github.com/WellBloud/sovacore-core/blob/1816a0d7cd3ec4a90d64e301fc2469d171ad217f/src/model/CoreFacade.php#L35-L41 |
200,693 | WellBloud/sovacore-core | src/model/CoreFacade.php | CoreFacade.getById | public function getById($id = null)
{
if ($id === null) {
throw new ItemNotSelectedException;
}
$entity = $this->repository->findById($id);
if (!$entity) {
throw new NonexistingItemException;
}
return $entity;
} | php | public function getById($id = null)
{
if ($id === null) {
throw new ItemNotSelectedException;
}
$entity = $this->repository->findById($id);
if (!$entity) {
throw new NonexistingItemException;
}
return $entity;
} | [
"public",
"function",
"getById",
"(",
"$",
"id",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"id",
"===",
"null",
")",
"{",
"throw",
"new",
"ItemNotSelectedException",
";",
"}",
"$",
"entity",
"=",
"$",
"this",
"->",
"repository",
"->",
"findById",
"(",
"... | Method which finds one item in the repository
@param type $id
@return type entity
@throws ItemNotSelectedException | [
"Method",
"which",
"finds",
"one",
"item",
"in",
"the",
"repository"
] | 1816a0d7cd3ec4a90d64e301fc2469d171ad217f | https://github.com/WellBloud/sovacore-core/blob/1816a0d7cd3ec4a90d64e301fc2469d171ad217f/src/model/CoreFacade.php#L68-L78 |
200,694 | horntell/php-sdk | lib/guzzle/GuzzleHttp/Message/AbstractMessage.php | AbstractMessage.parseHeader | public static function parseHeader(MessageInterface $message, $header)
{
static $trimmed = "\"' \n\t\r";
$params = $matches = [];
foreach (self::normalizeHeader($message, $header) as $val) {
$part = [];
foreach (preg_split('/;(?=([^"]*"[^"]*")*[^"]*$)/', $val) as $k... | php | public static function parseHeader(MessageInterface $message, $header)
{
static $trimmed = "\"' \n\t\r";
$params = $matches = [];
foreach (self::normalizeHeader($message, $header) as $val) {
$part = [];
foreach (preg_split('/;(?=([^"]*"[^"]*")*[^"]*$)/', $val) as $k... | [
"public",
"static",
"function",
"parseHeader",
"(",
"MessageInterface",
"$",
"message",
",",
"$",
"header",
")",
"{",
"static",
"$",
"trimmed",
"=",
"\"\\\"' \\n\\t\\r\"",
";",
"$",
"params",
"=",
"$",
"matches",
"=",
"[",
"]",
";",
"foreach",
"(",
"self"... | Parse an array of header values containing ";" separated data into an
array of associative arrays representing the header key value pair
data of the header. When a parameter does not contain a value, but just
contains a key, this function will inject a key with a '' string value.
@param MessageInterface $message That ... | [
"Parse",
"an",
"array",
"of",
"header",
"values",
"containing",
";",
"separated",
"data",
"into",
"an",
"array",
"of",
"associative",
"arrays",
"representing",
"the",
"header",
"key",
"value",
"pair",
"data",
"of",
"the",
"header",
".",
"When",
"a",
"paramet... | e5205e9396a21b754d5651a8aa5898da5922a1b7 | https://github.com/horntell/php-sdk/blob/e5205e9396a21b754d5651a8aa5898da5922a1b7/lib/guzzle/GuzzleHttp/Message/AbstractMessage.php#L161-L184 |
200,695 | horntell/php-sdk | lib/guzzle/GuzzleHttp/Message/AbstractMessage.php | AbstractMessage.getHeadersAsString | public static function getHeadersAsString(MessageInterface $message)
{
$result = '';
foreach ($message->getHeaders() as $name => $values) {
$result .= "\r\n{$name}: " . implode(', ', $values);
}
return $result;
} | php | public static function getHeadersAsString(MessageInterface $message)
{
$result = '';
foreach ($message->getHeaders() as $name => $values) {
$result .= "\r\n{$name}: " . implode(', ', $values);
}
return $result;
} | [
"public",
"static",
"function",
"getHeadersAsString",
"(",
"MessageInterface",
"$",
"message",
")",
"{",
"$",
"result",
"=",
"''",
";",
"foreach",
"(",
"$",
"message",
"->",
"getHeaders",
"(",
")",
"as",
"$",
"name",
"=>",
"$",
"values",
")",
"{",
"$",
... | Gets the headers of a message as a string
@param MessageInterface $message
@return string | [
"Gets",
"the",
"headers",
"of",
"a",
"message",
"as",
"a",
"string"
] | e5205e9396a21b754d5651a8aa5898da5922a1b7 | https://github.com/horntell/php-sdk/blob/e5205e9396a21b754d5651a8aa5898da5922a1b7/lib/guzzle/GuzzleHttp/Message/AbstractMessage.php#L231-L239 |
200,696 | horntell/php-sdk | lib/guzzle/GuzzleHttp/Message/AbstractMessage.php | AbstractMessage.getStartLine | public static function getStartLine(MessageInterface $message)
{
if ($message instanceof RequestInterface) {
return trim($message->getMethod() . ' '
. $message->getResource())
. ' HTTP/' . $message->getProtocolVersion();
} elseif ($message instanceof Respo... | php | public static function getStartLine(MessageInterface $message)
{
if ($message instanceof RequestInterface) {
return trim($message->getMethod() . ' '
. $message->getResource())
. ' HTTP/' . $message->getProtocolVersion();
} elseif ($message instanceof Respo... | [
"public",
"static",
"function",
"getStartLine",
"(",
"MessageInterface",
"$",
"message",
")",
"{",
"if",
"(",
"$",
"message",
"instanceof",
"RequestInterface",
")",
"{",
"return",
"trim",
"(",
"$",
"message",
"->",
"getMethod",
"(",
")",
".",
"' '",
".",
"... | Gets the start line of a message
@param MessageInterface $message
@return string
@throws \InvalidArgumentException | [
"Gets",
"the",
"start",
"line",
"of",
"a",
"message"
] | e5205e9396a21b754d5651a8aa5898da5922a1b7 | https://github.com/horntell/php-sdk/blob/e5205e9396a21b754d5651a8aa5898da5922a1b7/lib/guzzle/GuzzleHttp/Message/AbstractMessage.php#L249-L262 |
200,697 | DeimosProject/Request | src/Request/URL.php | URL.url | public function url($withParams = false)
{
$url = $this->scheme() . '://';
$url .= $this->domain();
return $url . $this->urlPath($withParams);
} | php | public function url($withParams = false)
{
$url = $this->scheme() . '://';
$url .= $this->domain();
return $url . $this->urlPath($withParams);
} | [
"public",
"function",
"url",
"(",
"$",
"withParams",
"=",
"false",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"scheme",
"(",
")",
".",
"'://'",
";",
"$",
"url",
".=",
"$",
"this",
"->",
"domain",
"(",
")",
";",
"return",
"$",
"url",
".",
"$"... | Gets request URL
@param bool $withParams Whether to preserve URL parameters
@return string URL of this request | [
"Gets",
"request",
"URL"
] | 3e45af0fdbfc3c47c27de27a98e8980ba42c3737 | https://github.com/DeimosProject/Request/blob/3e45af0fdbfc3c47c27de27a98e8980ba42c3737/src/Request/URL.php#L74-L80 |
200,698 | DeimosProject/Request | src/Request/URL.php | URL.urlPath | public function urlPath($withParams = false)
{
$path = $this->server('request_uri');
if (!$withParams)
{
$position = mb_strpos($path, '?');
if ($position !== false)
{
$path = mb_substr($path, 0, $position);
}
}
... | php | public function urlPath($withParams = false)
{
$path = $this->server('request_uri');
if (!$withParams)
{
$position = mb_strpos($path, '?');
if ($position !== false)
{
$path = mb_substr($path, 0, $position);
}
}
... | [
"public",
"function",
"urlPath",
"(",
"$",
"withParams",
"=",
"false",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"server",
"(",
"'request_uri'",
")",
";",
"if",
"(",
"!",
"$",
"withParams",
")",
"{",
"$",
"position",
"=",
"mb_strpos",
"(",
"$",
... | without host & schema
@param bool $withParams
@return string | [
"without",
"host",
"&",
"schema"
] | 3e45af0fdbfc3c47c27de27a98e8980ba42c3737 | https://github.com/DeimosProject/Request/blob/3e45af0fdbfc3c47c27de27a98e8980ba42c3737/src/Request/URL.php#L89-L103 |
200,699 | offworks/laraquent | src/Blueprint.php | Blueprint.addColumn | public function addColumn($type, $column, array $parameters = array())
{
// check against existing
if(!$this->builder->hasColumn($this->table, $column))
return parent::addColumn($type, $column, $parameters);
// else probably compare and do some alteration
} | php | public function addColumn($type, $column, array $parameters = array())
{
// check against existing
if(!$this->builder->hasColumn($this->table, $column))
return parent::addColumn($type, $column, $parameters);
// else probably compare and do some alteration
} | [
"public",
"function",
"addColumn",
"(",
"$",
"type",
",",
"$",
"column",
",",
"array",
"$",
"parameters",
"=",
"array",
"(",
")",
")",
"{",
"// check against existing",
"if",
"(",
"!",
"$",
"this",
"->",
"builder",
"->",
"hasColumn",
"(",
"$",
"this",
... | Add column only if there isn't one.
So it will not throw if there already exists. | [
"Add",
"column",
"only",
"if",
"there",
"isn",
"t",
"one",
".",
"So",
"it",
"will",
"not",
"throw",
"if",
"there",
"already",
"exists",
"."
] | 74cbc6258acfda8f7213c701887a7b223aff954f | https://github.com/offworks/laraquent/blob/74cbc6258acfda8f7213c701887a7b223aff954f/src/Blueprint.php#L19-L26 |
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.