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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
194,800 | sil-project/VarietyBundle | src/Entity/Variety.php | Variety.removePlantDescription | public function removePlantDescription(\Librinfo\VarietiesBundle\Entity\VarietyDescriptionPlant $plantDescription)
{
return $this->plant_descriptions->removeElement($plantDescription);
} | php | public function removePlantDescription(\Librinfo\VarietiesBundle\Entity\VarietyDescriptionPlant $plantDescription)
{
return $this->plant_descriptions->removeElement($plantDescription);
} | [
"public",
"function",
"removePlantDescription",
"(",
"\\",
"Librinfo",
"\\",
"VarietiesBundle",
"\\",
"Entity",
"\\",
"VarietyDescriptionPlant",
"$",
"plantDescription",
")",
"{",
"return",
"$",
"this",
"->",
"plant_descriptions",
"->",
"removeElement",
"(",
"$",
"p... | Remove plantDescription.
@param \Librinfo\VarietiesBundle\Entity\VarietyDescriptionPlant $plantDescription
@return bool tRUE if this collection contained the specified element, FALSE otherwise | [
"Remove",
"plantDescription",
"."
] | e9508ce13a4bb277d10bdcd925fdb84bc01f453f | https://github.com/sil-project/VarietyBundle/blob/e9508ce13a4bb277d10bdcd925fdb84bc01f453f/src/Entity/Variety.php#L1445-L1448 |
194,801 | sil-project/VarietyBundle | src/Entity/Variety.php | Variety.setPlantDescriptions | public function setPlantDescriptions($descriptions)
{
foreach ($descriptions as $description) {
$description->setVariety($this);
}
$this->plant_descriptions = $descriptions;
return $this;
} | php | public function setPlantDescriptions($descriptions)
{
foreach ($descriptions as $description) {
$description->setVariety($this);
}
$this->plant_descriptions = $descriptions;
return $this;
} | [
"public",
"function",
"setPlantDescriptions",
"(",
"$",
"descriptions",
")",
"{",
"foreach",
"(",
"$",
"descriptions",
"as",
"$",
"description",
")",
"{",
"$",
"description",
"->",
"setVariety",
"(",
"$",
"this",
")",
";",
"}",
"$",
"this",
"->",
"plant_de... | Set plant descriptions.
@param \Doctrine\Common\Collections\Collection $descriptions
@return Variety | [
"Set",
"plant",
"descriptions",
"."
] | e9508ce13a4bb277d10bdcd925fdb84bc01f453f | https://github.com/sil-project/VarietyBundle/blob/e9508ce13a4bb277d10bdcd925fdb84bc01f453f/src/Entity/Variety.php#L1477-L1485 |
194,802 | sil-project/VarietyBundle | src/Entity/Variety.php | Variety.addCultureDescription | public function addCultureDescription(\Librinfo\VarietiesBundle\Entity\VarietyDescriptionCulture $cultureDescription)
{
$this->culture_descriptions[] = $cultureDescription;
return $this;
} | php | public function addCultureDescription(\Librinfo\VarietiesBundle\Entity\VarietyDescriptionCulture $cultureDescription)
{
$this->culture_descriptions[] = $cultureDescription;
return $this;
} | [
"public",
"function",
"addCultureDescription",
"(",
"\\",
"Librinfo",
"\\",
"VarietiesBundle",
"\\",
"Entity",
"\\",
"VarietyDescriptionCulture",
"$",
"cultureDescription",
")",
"{",
"$",
"this",
"->",
"culture_descriptions",
"[",
"]",
"=",
"$",
"cultureDescription",
... | Add cultureDescription.
@param \Librinfo\VarietiesBundle\Entity\VarietyDescriptionCulture $cultureDescription
@return Variety | [
"Add",
"cultureDescription",
"."
] | e9508ce13a4bb277d10bdcd925fdb84bc01f453f | https://github.com/sil-project/VarietyBundle/blob/e9508ce13a4bb277d10bdcd925fdb84bc01f453f/src/Entity/Variety.php#L1494-L1499 |
194,803 | sil-project/VarietyBundle | src/Entity/Variety.php | Variety.removeCultureDescription | public function removeCultureDescription(\Librinfo\VarietiesBundle\Entity\VarietyDescriptionCulture $cultureDescription)
{
return $this->culture_descriptions->removeElement($cultureDescription);
} | php | public function removeCultureDescription(\Librinfo\VarietiesBundle\Entity\VarietyDescriptionCulture $cultureDescription)
{
return $this->culture_descriptions->removeElement($cultureDescription);
} | [
"public",
"function",
"removeCultureDescription",
"(",
"\\",
"Librinfo",
"\\",
"VarietiesBundle",
"\\",
"Entity",
"\\",
"VarietyDescriptionCulture",
"$",
"cultureDescription",
")",
"{",
"return",
"$",
"this",
"->",
"culture_descriptions",
"->",
"removeElement",
"(",
"... | Remove cultureDescription.
@param \Librinfo\VarietiesBundle\Entity\VarietyDescriptionCulture $cultureDescription
@return bool tRUE if this collection contained the specified element, FALSE otherwise | [
"Remove",
"cultureDescription",
"."
] | e9508ce13a4bb277d10bdcd925fdb84bc01f453f | https://github.com/sil-project/VarietyBundle/blob/e9508ce13a4bb277d10bdcd925fdb84bc01f453f/src/Entity/Variety.php#L1508-L1511 |
194,804 | sil-project/VarietyBundle | src/Entity/Variety.php | Variety.setCultureDescriptions | public function setCultureDescriptions($descriptions)
{
foreach ($descriptions as $description) {
$description->setVariety($this);
}
$this->culture_descriptions = $descriptions;
return $this;
} | php | public function setCultureDescriptions($descriptions)
{
foreach ($descriptions as $description) {
$description->setVariety($this);
}
$this->culture_descriptions = $descriptions;
return $this;
} | [
"public",
"function",
"setCultureDescriptions",
"(",
"$",
"descriptions",
")",
"{",
"foreach",
"(",
"$",
"descriptions",
"as",
"$",
"description",
")",
"{",
"$",
"description",
"->",
"setVariety",
"(",
"$",
"this",
")",
";",
"}",
"$",
"this",
"->",
"cultur... | Set culture descriptions.
@param \Doctrine\Common\Collections\Collection $descriptions
@return Variety | [
"Set",
"culture",
"descriptions",
"."
] | e9508ce13a4bb277d10bdcd925fdb84bc01f453f | https://github.com/sil-project/VarietyBundle/blob/e9508ce13a4bb277d10bdcd925fdb84bc01f453f/src/Entity/Variety.php#L1540-L1548 |
194,805 | sil-project/VarietyBundle | src/Entity/Variety.php | Variety.addInnerDescription | public function addInnerDescription(\Librinfo\VarietiesBundle\Entity\VarietyDescriptionInner $innerDescription)
{
$this->inner_descriptions[] = $innerDescription;
return $this;
} | php | public function addInnerDescription(\Librinfo\VarietiesBundle\Entity\VarietyDescriptionInner $innerDescription)
{
$this->inner_descriptions[] = $innerDescription;
return $this;
} | [
"public",
"function",
"addInnerDescription",
"(",
"\\",
"Librinfo",
"\\",
"VarietiesBundle",
"\\",
"Entity",
"\\",
"VarietyDescriptionInner",
"$",
"innerDescription",
")",
"{",
"$",
"this",
"->",
"inner_descriptions",
"[",
"]",
"=",
"$",
"innerDescription",
";",
"... | Add innerDescription.
@param \Librinfo\VarietiesBundle\Entity\VarietyDescriptionInner $innerDescription
@return Variety | [
"Add",
"innerDescription",
"."
] | e9508ce13a4bb277d10bdcd925fdb84bc01f453f | https://github.com/sil-project/VarietyBundle/blob/e9508ce13a4bb277d10bdcd925fdb84bc01f453f/src/Entity/Variety.php#L1557-L1562 |
194,806 | sil-project/VarietyBundle | src/Entity/Variety.php | Variety.removeInnerDescription | public function removeInnerDescription(\Librinfo\VarietiesBundle\Entity\VarietyDescriptionInner $innerDescription)
{
return $this->inner_descriptions->removeElement($innerDescription);
} | php | public function removeInnerDescription(\Librinfo\VarietiesBundle\Entity\VarietyDescriptionInner $innerDescription)
{
return $this->inner_descriptions->removeElement($innerDescription);
} | [
"public",
"function",
"removeInnerDescription",
"(",
"\\",
"Librinfo",
"\\",
"VarietiesBundle",
"\\",
"Entity",
"\\",
"VarietyDescriptionInner",
"$",
"innerDescription",
")",
"{",
"return",
"$",
"this",
"->",
"inner_descriptions",
"->",
"removeElement",
"(",
"$",
"i... | Remove innerDescription.
@param \Librinfo\VarietiesBundle\Entity\VarietyDescriptionInner $innerDescription
@return bool tRUE if this collection contained the specified element, FALSE otherwise | [
"Remove",
"innerDescription",
"."
] | e9508ce13a4bb277d10bdcd925fdb84bc01f453f | https://github.com/sil-project/VarietyBundle/blob/e9508ce13a4bb277d10bdcd925fdb84bc01f453f/src/Entity/Variety.php#L1571-L1574 |
194,807 | modulusphp/http | Controller.php | Controller.search | public function search(string $model, array $fields) : ?array
{
$response = array();
foreach($fields as $param => $value) {
$check = $model::where($param, $value)->first();
if ($check != null) {
$response = array_merge($response, array($param => "The $param has already been taken."));
... | php | public function search(string $model, array $fields) : ?array
{
$response = array();
foreach($fields as $param => $value) {
$check = $model::where($param, $value)->first();
if ($check != null) {
$response = array_merge($response, array($param => "The $param has already been taken."));
... | [
"public",
"function",
"search",
"(",
"string",
"$",
"model",
",",
"array",
"$",
"fields",
")",
":",
"?",
"array",
"{",
"$",
"response",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"fields",
"as",
"$",
"param",
"=>",
"$",
"value",
")",
"{",
... | Check if a model value has already been used or not
@param Eloquent $model
@param array $fields
@return array $response | [
"Check",
"if",
"a",
"model",
"value",
"has",
"already",
"been",
"used",
"or",
"not"
] | fc5c0f2b582a04de1685578d3fb790686a0a240c | https://github.com/modulusphp/http/blob/fc5c0f2b582a04de1685578d3fb790686a0a240c/Controller.php#L49-L61 |
194,808 | lwiesel/FeatureChecker | src/FeatureChecker.php | FeatureChecker.isFeatureEnabled | public function isFeatureEnabled($featureName)
{
try {
$path = preg_split('/\./', $featureName);
$foundValue = $this->findValueInMultiArray($path, $this->features);
if (is_array($foundValue)) {
return $this->checkEveryChild($foundValue);
} el... | php | public function isFeatureEnabled($featureName)
{
try {
$path = preg_split('/\./', $featureName);
$foundValue = $this->findValueInMultiArray($path, $this->features);
if (is_array($foundValue)) {
return $this->checkEveryChild($foundValue);
} el... | [
"public",
"function",
"isFeatureEnabled",
"(",
"$",
"featureName",
")",
"{",
"try",
"{",
"$",
"path",
"=",
"preg_split",
"(",
"'/\\./'",
",",
"$",
"featureName",
")",
";",
"$",
"foundValue",
"=",
"$",
"this",
"->",
"findValueInMultiArray",
"(",
"$",
"path"... | Tests if given feature is enabled
@param string $featureName
@return bool
@throws FeatureNotDefinedException | [
"Tests",
"if",
"given",
"feature",
"is",
"enabled"
] | 90aec8f267417922e452759ca5dbf5ceb6ab6898 | https://github.com/lwiesel/FeatureChecker/blob/90aec8f267417922e452759ca5dbf5ceb6ab6898/src/FeatureChecker.php#L33-L48 |
194,809 | lwiesel/FeatureChecker | src/FeatureChecker.php | FeatureChecker.findValueInMultiArray | protected function findValueInMultiArray(array $path, array $reference)
{
// Checks path existence
if (
count($path) == 0
|| !isset($reference[$path[0]])
) {
throw new \OutOfRangeException();
}
$currentElement = $reference[$path[0]];
... | php | protected function findValueInMultiArray(array $path, array $reference)
{
// Checks path existence
if (
count($path) == 0
|| !isset($reference[$path[0]])
) {
throw new \OutOfRangeException();
}
$currentElement = $reference[$path[0]];
... | [
"protected",
"function",
"findValueInMultiArray",
"(",
"array",
"$",
"path",
",",
"array",
"$",
"reference",
")",
"{",
"// Checks path existence",
"if",
"(",
"count",
"(",
"$",
"path",
")",
"==",
"0",
"||",
"!",
"isset",
"(",
"$",
"reference",
"[",
"$",
... | Find value in a multi-array
Recursively find a value in a multi-array, successively
following the different keys defined in a path.
@param array $path
@param array $reference
@return bool
@throws \OutOfRangeException | [
"Find",
"value",
"in",
"a",
"multi",
"-",
"array"
] | 90aec8f267417922e452759ca5dbf5ceb6ab6898 | https://github.com/lwiesel/FeatureChecker/blob/90aec8f267417922e452759ca5dbf5ceb6ab6898/src/FeatureChecker.php#L96-L115 |
194,810 | lwiesel/FeatureChecker | src/FeatureChecker.php | FeatureChecker.checkEveryChild | protected function checkEveryChild(array $features)
{
foreach ($features as $feature) {
$result = is_array($feature) ? $this->checkEveryChild($feature) : $feature;
if (!$result) {
return false;
}
}
return true;
} | php | protected function checkEveryChild(array $features)
{
foreach ($features as $feature) {
$result = is_array($feature) ? $this->checkEveryChild($feature) : $feature;
if (!$result) {
return false;
}
}
return true;
} | [
"protected",
"function",
"checkEveryChild",
"(",
"array",
"$",
"features",
")",
"{",
"foreach",
"(",
"$",
"features",
"as",
"$",
"feature",
")",
"{",
"$",
"result",
"=",
"is_array",
"(",
"$",
"feature",
")",
"?",
"$",
"this",
"->",
"checkEveryChild",
"("... | Checks every child of the array
Returns true if every child and sub-child is true
@param array $features
@return bool | [
"Checks",
"every",
"child",
"of",
"the",
"array"
] | 90aec8f267417922e452759ca5dbf5ceb6ab6898 | https://github.com/lwiesel/FeatureChecker/blob/90aec8f267417922e452759ca5dbf5ceb6ab6898/src/FeatureChecker.php#L125-L136 |
194,811 | jabernardo/lollipop-php | Library/DOM/Tag.php | Tag.add | public function add($key, $val) {
if (!isset($this->_attrs[$key])) {
$this->_attrs[$key] = [];
}
if (!strcasecmp($key, 'id')) {
// value for `id` should be one only
$this->_attrs[$key] = $val;
} else {
// else append it
... | php | public function add($key, $val) {
if (!isset($this->_attrs[$key])) {
$this->_attrs[$key] = [];
}
if (!strcasecmp($key, 'id')) {
// value for `id` should be one only
$this->_attrs[$key] = $val;
} else {
// else append it
... | [
"public",
"function",
"add",
"(",
"$",
"key",
",",
"$",
"val",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"_attrs",
"[",
"$",
"key",
"]",
")",
")",
"{",
"$",
"this",
"->",
"_attrs",
"[",
"$",
"key",
"]",
"=",
"[",
"]",
";",
... | Add attribute to tag
@access public
@param string $key Attribute
@param string $val Attribute value
@return object Tag instance | [
"Add",
"attribute",
"to",
"tag"
] | 004d80b21f7246bb3e08c7b9f74a165b0d3ca0f5 | https://github.com/jabernardo/lollipop-php/blob/004d80b21f7246bb3e08c7b9f74a165b0d3ca0f5/Library/DOM/Tag.php#L70-L84 |
194,812 | jabernardo/lollipop-php | Library/DOM/Tag.php | Tag.remove | public function remove($key) {
if (isset($this->_attrs[$key])) {
unset($this->_attrs[$key]);
}
return $this;
} | php | public function remove($key) {
if (isset($this->_attrs[$key])) {
unset($this->_attrs[$key]);
}
return $this;
} | [
"public",
"function",
"remove",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_attrs",
"[",
"$",
"key",
"]",
")",
")",
"{",
"unset",
"(",
"$",
"this",
"->",
"_attrs",
"[",
"$",
"key",
"]",
")",
";",
"}",
"return",
"$... | Remove tag attribute
@access public
@param string $key
@return object Tag instance | [
"Remove",
"tag",
"attribute"
] | 004d80b21f7246bb3e08c7b9f74a165b0d3ca0f5 | https://github.com/jabernardo/lollipop-php/blob/004d80b21f7246bb3e08c7b9f74a165b0d3ca0f5/Library/DOM/Tag.php#L94-L100 |
194,813 | jabernardo/lollipop-php | Library/DOM/Tag.php | Tag.contains | public function contains($data, $append = true) {
$this->_content = $append ? $this->_content . $data : $data;
return $this;
} | php | public function contains($data, $append = true) {
$this->_content = $append ? $this->_content . $data : $data;
return $this;
} | [
"public",
"function",
"contains",
"(",
"$",
"data",
",",
"$",
"append",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"_content",
"=",
"$",
"append",
"?",
"$",
"this",
"->",
"_content",
".",
"$",
"data",
":",
"$",
"data",
";",
"return",
"$",
"this",
... | Set contents of tag
@access public
@param string $data Contents
@param bool $append Append or set tag content. (default true)
@return object Tag instance | [
"Set",
"contents",
"of",
"tag"
] | 004d80b21f7246bb3e08c7b9f74a165b0d3ca0f5 | https://github.com/jabernardo/lollipop-php/blob/004d80b21f7246bb3e08c7b9f74a165b0d3ca0f5/Library/DOM/Tag.php#L111-L115 |
194,814 | jabernardo/lollipop-php | Library/HTTP/Response.php | Response._format | private function _format($data) {
$output_callback_function = '';
// If data is in array format then set content-type
// to application/json
if (is_array($data) || is_object($data)) {
$this->header('Content-type: application/json');
// Convert to json
... | php | private function _format($data) {
$output_callback_function = '';
// If data is in array format then set content-type
// to application/json
if (is_array($data) || is_object($data)) {
$this->header('Content-type: application/json');
// Convert to json
... | [
"private",
"function",
"_format",
"(",
"$",
"data",
")",
"{",
"$",
"output_callback_function",
"=",
"''",
";",
"// If data is in array format then set content-type",
"// to application/json",
"if",
"(",
"is_array",
"(",
"$",
"data",
")",
"||",
"is_object",
"(",
"$",... | Return string value for data
@access private
@param object $data Data to convert
@return string | [
"Return",
"string",
"value",
"for",
"data"
] | 004d80b21f7246bb3e08c7b9f74a165b0d3ca0f5 | https://github.com/jabernardo/lollipop-php/blob/004d80b21f7246bb3e08c7b9f74a165b0d3ca0f5/Library/HTTP/Response.php#L64-L91 |
194,815 | jabernardo/lollipop-php | Library/HTTP/Response.php | Response.get | public function get($raw = false) {
return $raw
? $this->_data
: $this->_format($this->_data);
} | php | public function get($raw = false) {
return $raw
? $this->_data
: $this->_format($this->_data);
} | [
"public",
"function",
"get",
"(",
"$",
"raw",
"=",
"false",
")",
"{",
"return",
"$",
"raw",
"?",
"$",
"this",
"->",
"_data",
":",
"$",
"this",
"->",
"_format",
"(",
"$",
"this",
"->",
"_data",
")",
";",
"}"
] | Get formatted responsed data
@access public
@return string | [
"Get",
"formatted",
"responsed",
"data"
] | 004d80b21f7246bb3e08c7b9f74a165b0d3ca0f5 | https://github.com/jabernardo/lollipop-php/blob/004d80b21f7246bb3e08c7b9f74a165b0d3ca0f5/Library/HTTP/Response.php#L142-L146 |
194,816 | jabernardo/lollipop-php | Library/HTTP/Response.php | Response.render | public function render() {
// Parse contents
$res = $this->get();
// Set HTTP Headers
foreach ($this->_headers as $header) {
header($header);
}
// Set cookies
foreach($this->_cookies as $k => $v) {
Cookie::set($k, $v);
... | php | public function render() {
// Parse contents
$res = $this->get();
// Set HTTP Headers
foreach ($this->_headers as $header) {
header($header);
}
// Set cookies
foreach($this->_cookies as $k => $v) {
Cookie::set($k, $v);
... | [
"public",
"function",
"render",
"(",
")",
"{",
"// Parse contents",
"$",
"res",
"=",
"$",
"this",
"->",
"get",
"(",
")",
";",
"// Set HTTP Headers",
"foreach",
"(",
"$",
"this",
"->",
"_headers",
"as",
"$",
"header",
")",
"{",
"header",
"(",
"$",
"head... | Set response headers and print response text
@access public
@return object | [
"Set",
"response",
"headers",
"and",
"print",
"response",
"text"
] | 004d80b21f7246bb3e08c7b9f74a165b0d3ca0f5 | https://github.com/jabernardo/lollipop-php/blob/004d80b21f7246bb3e08c7b9f74a165b0d3ca0f5/Library/HTTP/Response.php#L197-L212 |
194,817 | vukbgit/PHPCraft.Subject | src/Traits/Upload.php | Upload.execUpload | protected function execUpload()
{
$this->loadTranslations('form', sprintf('private/global/locales/%s/form.ini', LANGUAGE));
//fields instances
foreach($this->uploadFieldsDefinitions as $fieldName => $definition) {
$validations = isset($definition['validations']) ? $definition['v... | php | protected function execUpload()
{
$this->loadTranslations('form', sprintf('private/global/locales/%s/form.ini', LANGUAGE));
//fields instances
foreach($this->uploadFieldsDefinitions as $fieldName => $definition) {
$validations = isset($definition['validations']) ? $definition['v... | [
"protected",
"function",
"execUpload",
"(",
")",
"{",
"$",
"this",
"->",
"loadTranslations",
"(",
"'form'",
",",
"sprintf",
"(",
"'private/global/locales/%s/form.ini'",
",",
"LANGUAGE",
")",
")",
";",
"//fields instances",
"foreach",
"(",
"$",
"this",
"->",
"up... | Execs upload action | [
"Execs",
"upload",
"action"
] | a43ad7868098ff1e7bda6819547ea64f9a853732 | https://github.com/vukbgit/PHPCraft.Subject/blob/a43ad7868098ff1e7bda6819547ea64f9a853732/src/Traits/Upload.php#L112-L126 |
194,818 | vukbgit/PHPCraft.Subject | src/Traits/Upload.php | Upload.checkUpload | protected function checkUpload()
{
//no upload field defined for uploaded field
if(!isset($this->uploadFields[$this->uploadedField])) {
$this->uploadMessages[] = sprintf('No definition set for POST uploadField field "%s"', $this->uploadedField);
return false;
}
... | php | protected function checkUpload()
{
//no upload field defined for uploaded field
if(!isset($this->uploadFields[$this->uploadedField])) {
$this->uploadMessages[] = sprintf('No definition set for POST uploadField field "%s"', $this->uploadedField);
return false;
}
... | [
"protected",
"function",
"checkUpload",
"(",
")",
"{",
"//no upload field defined for uploaded field",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"uploadFields",
"[",
"$",
"this",
"->",
"uploadedField",
"]",
")",
")",
"{",
"$",
"this",
"->",
"uploadMessa... | Checks whether an upload has been tried
@return boolean, true on success false on failure | [
"Checks",
"whether",
"an",
"upload",
"has",
"been",
"tried"
] | a43ad7868098ff1e7bda6819547ea64f9a853732 | https://github.com/vukbgit/PHPCraft.Subject/blob/a43ad7868098ff1e7bda6819547ea64f9a853732/src/Traits/Upload.php#L132-L149 |
194,819 | vukbgit/PHPCraft.Subject | src/Traits/Upload.php | Upload.handleUpload | protected function handleUpload()
{
$this->uploadedField = array_keys($_FILES)[0];
//check if any uploaded file for a defined field
$this->uploadOk = $this->checkUpload();
if(!$this->uploadOk) {
return;
}
//exec upload
$this->uploadOk = $this->uplo... | php | protected function handleUpload()
{
$this->uploadedField = array_keys($_FILES)[0];
//check if any uploaded file for a defined field
$this->uploadOk = $this->checkUpload();
if(!$this->uploadOk) {
return;
}
//exec upload
$this->uploadOk = $this->uplo... | [
"protected",
"function",
"handleUpload",
"(",
")",
"{",
"$",
"this",
"->",
"uploadedField",
"=",
"array_keys",
"(",
"$",
"_FILES",
")",
"[",
"0",
"]",
";",
"//check if any uploaded file for a defined field",
"$",
"this",
"->",
"uploadOk",
"=",
"$",
"this",
"->... | Executes the upload action | [
"Executes",
"the",
"upload",
"action"
] | a43ad7868098ff1e7bda6819547ea64f9a853732 | https://github.com/vukbgit/PHPCraft.Subject/blob/a43ad7868098ff1e7bda6819547ea64f9a853732/src/Traits/Upload.php#L154-L174 |
194,820 | vukbgit/PHPCraft.Subject | src/Traits/Upload.php | Upload.outputUploadOutcome | protected function outputUploadOutcome()
{
$json = new \stdClass();
// errors
if(!$this->uploadOk) {
if($this->uploader->getMessages()) {
$this->uploadMessages[] = implode('\n', $this->uploader->getMessages());
}
$json->error = implode('\n'... | php | protected function outputUploadOutcome()
{
$json = new \stdClass();
// errors
if(!$this->uploadOk) {
if($this->uploader->getMessages()) {
$this->uploadMessages[] = implode('\n', $this->uploader->getMessages());
}
$json->error = implode('\n'... | [
"protected",
"function",
"outputUploadOutcome",
"(",
")",
"{",
"$",
"json",
"=",
"new",
"\\",
"stdClass",
"(",
")",
";",
"// errors",
"if",
"(",
"!",
"$",
"this",
"->",
"uploadOk",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"uploader",
"->",
"getMessages"... | Outputs to browser upload outcome in json format for ajax calls benefit
@return string json code | [
"Outputs",
"to",
"browser",
"upload",
"outcome",
"in",
"json",
"format",
"for",
"ajax",
"calls",
"benefit"
] | a43ad7868098ff1e7bda6819547ea64f9a853732 | https://github.com/vukbgit/PHPCraft.Subject/blob/a43ad7868098ff1e7bda6819547ea64f9a853732/src/Traits/Upload.php#L180-L200 |
194,821 | vukbgit/PHPCraft.Subject | src/Traits/Upload.php | Upload.purgeFiles | protected function purgeFiles()
{
//get record
//validate and extract input
$input = $this->processSaveInput(filter_input_array(INPUT_POST, $this->configuration['subjects'][$this->name]['CRUD']['inputFields']));
//extract primary key value
$primaryKeyValue = $this->extractPri... | php | protected function purgeFiles()
{
//get record
//validate and extract input
$input = $this->processSaveInput(filter_input_array(INPUT_POST, $this->configuration['subjects'][$this->name]['CRUD']['inputFields']));
//extract primary key value
$primaryKeyValue = $this->extractPri... | [
"protected",
"function",
"purgeFiles",
"(",
")",
"{",
"//get record",
"//validate and extract input",
"$",
"input",
"=",
"$",
"this",
"->",
"processSaveInput",
"(",
"filter_input_array",
"(",
"INPUT_POST",
",",
"$",
"this",
"->",
"configuration",
"[",
"'subjects'",
... | Checks in case of CRUD update or delete if any file is to be deleted | [
"Checks",
"in",
"case",
"of",
"CRUD",
"update",
"or",
"delete",
"if",
"any",
"file",
"is",
"to",
"be",
"deleted"
] | a43ad7868098ff1e7bda6819547ea64f9a853732 | https://github.com/vukbgit/PHPCraft.Subject/blob/a43ad7868098ff1e7bda6819547ea64f9a853732/src/Traits/Upload.php#L205-L248 |
194,822 | vukbgit/PHPCraft.Subject | src/Traits/Upload.php | Upload.extractFieldsOutputs | public function extractFieldsOutputs(&$record, $fieldsOutputs, $propertyName = '_files')
{
foreach($fieldsOutputs as $field => $outputs) {
$this->extractFieldOutputs($record, $field, $outputs, $propertyName);
}
} | php | public function extractFieldsOutputs(&$record, $fieldsOutputs, $propertyName = '_files')
{
foreach($fieldsOutputs as $field => $outputs) {
$this->extractFieldOutputs($record, $field, $outputs, $propertyName);
}
} | [
"public",
"function",
"extractFieldsOutputs",
"(",
"&",
"$",
"record",
",",
"$",
"fieldsOutputs",
",",
"$",
"propertyName",
"=",
"'_files'",
")",
"{",
"foreach",
"(",
"$",
"fieldsOutputs",
"as",
"$",
"field",
"=>",
"$",
"outputs",
")",
"{",
"$",
"this",
... | extracts for a record, for one or more upload fields, one or more outputs paths
@param object $record
@param array $fieldsOutputs: indexes are fields names, elements are arrays of outputs names
@param string $propertyName name of property with files paths that is added to record | [
"extracts",
"for",
"a",
"record",
"for",
"one",
"or",
"more",
"upload",
"fields",
"one",
"or",
"more",
"outputs",
"paths"
] | a43ad7868098ff1e7bda6819547ea64f9a853732 | https://github.com/vukbgit/PHPCraft.Subject/blob/a43ad7868098ff1e7bda6819547ea64f9a853732/src/Traits/Upload.php#L295-L300 |
194,823 | vukbgit/PHPCraft.Subject | src/Traits/Upload.php | Upload.extractFieldsOutputsList | public function extractFieldsOutputsList(&$records, $fieldsOutputs, $propertyName = '_files')
{
foreach($records as $record) {
$this->extractFieldsOutputs($record, $fieldsOutputs, $propertyName);
}
} | php | public function extractFieldsOutputsList(&$records, $fieldsOutputs, $propertyName = '_files')
{
foreach($records as $record) {
$this->extractFieldsOutputs($record, $fieldsOutputs, $propertyName);
}
} | [
"public",
"function",
"extractFieldsOutputsList",
"(",
"&",
"$",
"records",
",",
"$",
"fieldsOutputs",
",",
"$",
"propertyName",
"=",
"'_files'",
")",
"{",
"foreach",
"(",
"$",
"records",
"as",
"$",
"record",
")",
"{",
"$",
"this",
"->",
"extractFieldsOutput... | extracts for a list of records, for one or more upload fields, one or more outputs paths
@param object $record
@param array $fieldsOutputs: indexes are fields names, elements are arrays of outputs names
@param string $propertyName name of property with files paths that is added to record | [
"extracts",
"for",
"a",
"list",
"of",
"records",
"for",
"one",
"or",
"more",
"upload",
"fields",
"one",
"or",
"more",
"outputs",
"paths"
] | a43ad7868098ff1e7bda6819547ea64f9a853732 | https://github.com/vukbgit/PHPCraft.Subject/blob/a43ad7868098ff1e7bda6819547ea64f9a853732/src/Traits/Upload.php#L308-L313 |
194,824 | Wedeto/DB | src/Query/Operator.php | Operator.toSQL | public function toSQL(Parameters $params, bool $inner_clause)
{
$drv = $params->getDriver();
$lhs = $this->getLHS() === null ? null : $drv->toSQL($params, $this->getLHS(), true);
$rhs = $drv->toSQL($params, $this->getRHS(), true);
$op = $this->getOperator();
if ($lhs !== nu... | php | public function toSQL(Parameters $params, bool $inner_clause)
{
$drv = $params->getDriver();
$lhs = $this->getLHS() === null ? null : $drv->toSQL($params, $this->getLHS(), true);
$rhs = $drv->toSQL($params, $this->getRHS(), true);
$op = $this->getOperator();
if ($lhs !== nu... | [
"public",
"function",
"toSQL",
"(",
"Parameters",
"$",
"params",
",",
"bool",
"$",
"inner_clause",
")",
"{",
"$",
"drv",
"=",
"$",
"params",
"->",
"getDriver",
"(",
")",
";",
"$",
"lhs",
"=",
"$",
"this",
"->",
"getLHS",
"(",
")",
"===",
"null",
"?... | Write an operator expression as SQL query syntax
@param Parameters $params The query parameters: tables and placeholder values
@param bool $inner_clause Whether this is a inner or outer clause. An
inner clause will be wrapped in braces when
it's a binary operator.
@return string The generated SQL | [
"Write",
"an",
"operator",
"expression",
"as",
"SQL",
"query",
"syntax"
] | 715f8f2e3ae6b53c511c40b620921cb9c87e6f62 | https://github.com/Wedeto/DB/blob/715f8f2e3ae6b53c511c40b620921cb9c87e6f62/src/Query/Operator.php#L73-L90 |
194,825 | RocketPropelledTortoise/Core | src/Entities/Fields/Date.php | Date.prepareValue | protected function prepareValue($value)
{
$value = $this->asDateTime($value)->startOfDay();
return $value->format($this->getDateFormat());
} | php | protected function prepareValue($value)
{
$value = $this->asDateTime($value)->startOfDay();
return $value->format($this->getDateFormat());
} | [
"protected",
"function",
"prepareValue",
"(",
"$",
"value",
")",
"{",
"$",
"value",
"=",
"$",
"this",
"->",
"asDateTime",
"(",
"$",
"value",
")",
"->",
"startOfDay",
"(",
")",
";",
"return",
"$",
"value",
"->",
"format",
"(",
"$",
"this",
"->",
"getD... | Prepare the value to be stored.
@param mixed $value The value to prepare
@return string | [
"Prepare",
"the",
"value",
"to",
"be",
"stored",
"."
] | 78b65663fc463e21e494257140ddbed0a9ccb3c3 | https://github.com/RocketPropelledTortoise/Core/blob/78b65663fc463e21e494257140ddbed0a9ccb3c3/src/Entities/Fields/Date.php#L35-L40 |
194,826 | ChristianGaertner/DaContainer | src/DaGardner/DaContainer/Container.php | Container.bind | public function bind($id, $concrete, $singleton = false)
{
$concrete = $concrete ?: $id;
if (!$concrete instanceof Closure) {
// If the factory (resolver) is NOT a closure we assume,
// that it is a classname and wrap it into a closure so it' s
// e... | php | public function bind($id, $concrete, $singleton = false)
{
$concrete = $concrete ?: $id;
if (!$concrete instanceof Closure) {
// If the factory (resolver) is NOT a closure we assume,
// that it is a classname and wrap it into a closure so it' s
// e... | [
"public",
"function",
"bind",
"(",
"$",
"id",
",",
"$",
"concrete",
",",
"$",
"singleton",
"=",
"false",
")",
"{",
"$",
"concrete",
"=",
"$",
"concrete",
"?",
":",
"$",
"id",
";",
"if",
"(",
"!",
"$",
"concrete",
"instanceof",
"Closure",
")",
"{",
... | Register a binding
@param string $id The id (needed for resolving)
@param Closure|string|null $concrete The factory
@param boolean $singleton Whether the binding should be a singelton | [
"Register",
"a",
"binding"
] | 2fbb2062f000f26af05cafee1148b892155008d5 | https://github.com/ChristianGaertner/DaContainer/blob/2fbb2062f000f26af05cafee1148b892155008d5/src/DaGardner/DaContainer/Container.php#L72-L93 |
194,827 | ChristianGaertner/DaContainer | src/DaGardner/DaContainer/Container.php | Container.enableInjecterDetection | public function enableInjecterDetection(array $blacklist = array(), $version = PHP_VERSION)
{
if (version_compare($version, '5.4.0') <= 0) {
throw new RunTimeException('This feature requires PHP 5.4 or higher');
}
if ($this->detector === null) {
$this->setDetector(... | php | public function enableInjecterDetection(array $blacklist = array(), $version = PHP_VERSION)
{
if (version_compare($version, '5.4.0') <= 0) {
throw new RunTimeException('This feature requires PHP 5.4 or higher');
}
if ($this->detector === null) {
$this->setDetector(... | [
"public",
"function",
"enableInjecterDetection",
"(",
"array",
"$",
"blacklist",
"=",
"array",
"(",
")",
",",
"$",
"version",
"=",
"PHP_VERSION",
")",
"{",
"if",
"(",
"version_compare",
"(",
"$",
"version",
",",
"'5.4.0'",
")",
"<=",
"0",
")",
"{",
"thro... | Enable the powerful injector method detection.
Example blacklist array:
[
'setString',
'setArray',
'_CLASSES_' => [
SomeClass' => [
'setMailer'
]
]
]
Strings in the main array are consired to be global and are ignored everytime.
The class specific blacklist is only checked if the object is an instance of this class
... | [
"Enable",
"the",
"powerful",
"injector",
"method",
"detection",
"."
] | 2fbb2062f000f26af05cafee1148b892155008d5 | https://github.com/ChristianGaertner/DaContainer/blob/2fbb2062f000f26af05cafee1148b892155008d5/src/DaGardner/DaContainer/Container.php#L257-L318 |
194,828 | ChristianGaertner/DaContainer | src/DaGardner/DaContainer/Container.php | Container.onResolving | public function onResolving(Closure $callback, $priority = 0)
{
if (!isset($this->callbacks[$priority])) {
$this->callbacks[$priority] = array();
}
$this->callbacks[$priority][] = $callback;
} | php | public function onResolving(Closure $callback, $priority = 0)
{
if (!isset($this->callbacks[$priority])) {
$this->callbacks[$priority] = array();
}
$this->callbacks[$priority][] = $callback;
} | [
"public",
"function",
"onResolving",
"(",
"Closure",
"$",
"callback",
",",
"$",
"priority",
"=",
"0",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"callbacks",
"[",
"$",
"priority",
"]",
")",
")",
"{",
"$",
"this",
"->",
"callbacks",
... | Register a listener for the resolving event.
This is only fired on the main resolve, not internal dependency resolves.
NOTE: The high priorities are getting fired LAST, while negative (lower)
are getting fired FIRST.
<strong>Reserved priorities</strong>
- -255 Injector Method Detection (this should fire as the first ... | [
"Register",
"a",
"listener",
"for",
"the",
"resolving",
"event",
".",
"This",
"is",
"only",
"fired",
"on",
"the",
"main",
"resolve",
"not",
"internal",
"dependency",
"resolves",
"."
] | 2fbb2062f000f26af05cafee1148b892155008d5 | https://github.com/ChristianGaertner/DaContainer/blob/2fbb2062f000f26af05cafee1148b892155008d5/src/DaGardner/DaContainer/Container.php#L338-L346 |
194,829 | ChristianGaertner/DaContainer | src/DaGardner/DaContainer/Container.php | Container.isSingelton | protected function isSingelton($id)
{
return (isset($this->binds[$id]['singleton']) && $this->binds[$id]['singleton'] === true);
} | php | protected function isSingelton($id)
{
return (isset($this->binds[$id]['singleton']) && $this->binds[$id]['singleton'] === true);
} | [
"protected",
"function",
"isSingelton",
"(",
"$",
"id",
")",
"{",
"return",
"(",
"isset",
"(",
"$",
"this",
"->",
"binds",
"[",
"$",
"id",
"]",
"[",
"'singleton'",
"]",
")",
"&&",
"$",
"this",
"->",
"binds",
"[",
"$",
"id",
"]",
"[",
"'singleton'",... | Checks whether the binding is a singelton
@param string $id The id
@return boolean Whether the binding is a singelton | [
"Checks",
"whether",
"the",
"binding",
"is",
"a",
"singelton"
] | 2fbb2062f000f26af05cafee1148b892155008d5 | https://github.com/ChristianGaertner/DaContainer/blob/2fbb2062f000f26af05cafee1148b892155008d5/src/DaGardner/DaContainer/Container.php#L383-L386 |
194,830 | ChristianGaertner/DaContainer | src/DaGardner/DaContainer/Container.php | Container.buildDimdBlacklist | protected function buildDimdBlacklist(array $blacklist)
{
if (!empty($blacklist)) {
return $blacklist;
} elseif (!empty($this->dimbBlacklist)) {
return $this->dimbBlacklist;
} else {
return array();
}
} | php | protected function buildDimdBlacklist(array $blacklist)
{
if (!empty($blacklist)) {
return $blacklist;
} elseif (!empty($this->dimbBlacklist)) {
return $this->dimbBlacklist;
} else {
return array();
}
} | [
"protected",
"function",
"buildDimdBlacklist",
"(",
"array",
"$",
"blacklist",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"blacklist",
")",
")",
"{",
"return",
"$",
"blacklist",
";",
"}",
"elseif",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"dimbBlac... | Just a wrapper for some basic control structured
@param array $blacklist The blacklist
@return array The newly builded blacklist | [
"Just",
"a",
"wrapper",
"for",
"some",
"basic",
"control",
"structured"
] | 2fbb2062f000f26af05cafee1148b892155008d5 | https://github.com/ChristianGaertner/DaContainer/blob/2fbb2062f000f26af05cafee1148b892155008d5/src/DaGardner/DaContainer/Container.php#L444-L459 |
194,831 | helsingborg-stad/multisite-role-propagation | source/php/Profile.php | Profile.loadSitesList | public function loadSitesList($user)
{
if (!is_super_admin()) {
return;
}
if (!is_network_admin()) {
return;
}
if (file_exists(MSROLEPROPAGINATION_TEMPLATE_PATH . 'profile.php')) {
//Get data for view
$data = array(
... | php | public function loadSitesList($user)
{
if (!is_super_admin()) {
return;
}
if (!is_network_admin()) {
return;
}
if (file_exists(MSROLEPROPAGINATION_TEMPLATE_PATH . 'profile.php')) {
//Get data for view
$data = array(
... | [
"public",
"function",
"loadSitesList",
"(",
"$",
"user",
")",
"{",
"if",
"(",
"!",
"is_super_admin",
"(",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"is_network_admin",
"(",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"file_exists",
"(",
... | Fetch the view
@return void | [
"Fetch",
"the",
"view"
] | 16d4992b8d32b3e3d8ef99ed51d37ac54bf917cc | https://github.com/helsingborg-stad/multisite-role-propagation/blob/16d4992b8d32b3e3d8ef99ed51d37ac54bf917cc/source/php/Profile.php#L29-L52 |
194,832 | helsingborg-stad/multisite-role-propagation | source/php/Profile.php | Profile.saveUserPofile | public function saveUserPofile($user_id)
{
//Authentication check
if (!is_super_admin()) {
return;
}
if (!is_network_admin()) {
return;
}
if (isset($_POST['userEnabled']) && is_array($_POST['userEnabled']) && !empty($_POST['userEnabled'])) {
... | php | public function saveUserPofile($user_id)
{
//Authentication check
if (!is_super_admin()) {
return;
}
if (!is_network_admin()) {
return;
}
if (isset($_POST['userEnabled']) && is_array($_POST['userEnabled']) && !empty($_POST['userEnabled'])) {
... | [
"public",
"function",
"saveUserPofile",
"(",
"$",
"user_id",
")",
"{",
"//Authentication check",
"if",
"(",
"!",
"is_super_admin",
"(",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"is_network_admin",
"(",
")",
")",
"{",
"return",
";",
"}",
"if",
... | Handle save data
@return void | [
"Handle",
"save",
"data"
] | 16d4992b8d32b3e3d8ef99ed51d37ac54bf917cc | https://github.com/helsingborg-stad/multisite-role-propagation/blob/16d4992b8d32b3e3d8ef99ed51d37ac54bf917cc/source/php/Profile.php#L58-L86 |
194,833 | helsingborg-stad/multisite-role-propagation | source/php/Profile.php | Profile.getUserRoles | public function getUserRoles($user_id)
{
$roles = array();
foreach ((array) get_sites() as $site) {
//Get user role
if ($site->blog_id != 1) {
$userSettings = get_user_meta($user_id, $this->db->prefix . $site->blog_id . '_capabilities', true);
} ... | php | public function getUserRoles($user_id)
{
$roles = array();
foreach ((array) get_sites() as $site) {
//Get user role
if ($site->blog_id != 1) {
$userSettings = get_user_meta($user_id, $this->db->prefix . $site->blog_id . '_capabilities', true);
} ... | [
"public",
"function",
"getUserRoles",
"(",
"$",
"user_id",
")",
"{",
"$",
"roles",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"(",
"array",
")",
"get_sites",
"(",
")",
"as",
"$",
"site",
")",
"{",
"//Get user role",
"if",
"(",
"$",
"site",
"->",
... | Get roles that are defined at each site
@return array | [
"Get",
"roles",
"that",
"are",
"defined",
"at",
"each",
"site"
] | 16d4992b8d32b3e3d8ef99ed51d37ac54bf917cc | https://github.com/helsingborg-stad/multisite-role-propagation/blob/16d4992b8d32b3e3d8ef99ed51d37ac54bf917cc/source/php/Profile.php#L92-L114 |
194,834 | Hnto/nuki | src/Handlers/Http/Output/Renderers/JsonRenderer.php | JsonRenderer.isValidJson | public function isValidJson(string $data) : bool {
json_decode($data);
if (json_last_error() !== JSON_ERROR_NONE) {
return false;
}
return true;
} | php | public function isValidJson(string $data) : bool {
json_decode($data);
if (json_last_error() !== JSON_ERROR_NONE) {
return false;
}
return true;
} | [
"public",
"function",
"isValidJson",
"(",
"string",
"$",
"data",
")",
":",
"bool",
"{",
"json_decode",
"(",
"$",
"data",
")",
";",
"if",
"(",
"json_last_error",
"(",
")",
"!==",
"JSON_ERROR_NONE",
")",
"{",
"return",
"false",
";",
"}",
"return",
"true",
... | Check if json is valid
@param string $data
@return bool | [
"Check",
"if",
"json",
"is",
"valid"
] | c3fb16244e8d611c335a88e3b9c9ee7d81fafc0c | https://github.com/Hnto/nuki/blob/c3fb16244e8d611c335a88e3b9c9ee7d81fafc0c/src/Handlers/Http/Output/Renderers/JsonRenderer.php#L57-L65 |
194,835 | Hnto/nuki | src/Handlers/Http/Output/Renderers/JsonRenderer.php | JsonRenderer.createJson | private function createJson() {
$content = $this->getContent()->get();
$json = json_encode(
$content,
JSON_PRESERVE_ZERO_FRACTION |
JSON_BIGINT_AS_STRING |
JSON_NUMERIC_CHECK |
JSON_PRETTY_PRINT |
JSON_UNESCAPED_SLASHES
);
if (!$this->isValidJson($json)) {
thro... | php | private function createJson() {
$content = $this->getContent()->get();
$json = json_encode(
$content,
JSON_PRESERVE_ZERO_FRACTION |
JSON_BIGINT_AS_STRING |
JSON_NUMERIC_CHECK |
JSON_PRETTY_PRINT |
JSON_UNESCAPED_SLASHES
);
if (!$this->isValidJson($json)) {
thro... | [
"private",
"function",
"createJson",
"(",
")",
"{",
"$",
"content",
"=",
"$",
"this",
"->",
"getContent",
"(",
")",
"->",
"get",
"(",
")",
";",
"$",
"json",
"=",
"json_encode",
"(",
"$",
"content",
",",
"JSON_PRESERVE_ZERO_FRACTION",
"|",
"JSON_BIGINT_AS_S... | Create json object
@return string
@throws \Nuki\Exceptions\Base | [
"Create",
"json",
"object"
] | c3fb16244e8d611c335a88e3b9c9ee7d81fafc0c | https://github.com/Hnto/nuki/blob/c3fb16244e8d611c335a88e3b9c9ee7d81fafc0c/src/Handlers/Http/Output/Renderers/JsonRenderer.php#L73-L89 |
194,836 | Moro4125/team-migrations-common | sources/MigrationManager.php | MigrationManager.doCreate | public function doCreate(callable $callbackAskNameAndService)
{
assert($this->_dispatcher);
assert($this->_container);
$this->_clearStatProperties();
$this->_dispatcher->dispatch(self::EVENT_INIT_SERVICE, OnInitService::create());
try
{
$this->notify(self::STATE_FIRED);
$modulesAndFiles = $this->_... | php | public function doCreate(callable $callbackAskNameAndService)
{
assert($this->_dispatcher);
assert($this->_container);
$this->_clearStatProperties();
$this->_dispatcher->dispatch(self::EVENT_INIT_SERVICE, OnInitService::create());
try
{
$this->notify(self::STATE_FIRED);
$modulesAndFiles = $this->_... | [
"public",
"function",
"doCreate",
"(",
"callable",
"$",
"callbackAskNameAndService",
")",
"{",
"assert",
"(",
"$",
"this",
"->",
"_dispatcher",
")",
";",
"assert",
"(",
"$",
"this",
"->",
"_container",
")",
";",
"$",
"this",
"->",
"_clearStatProperties",
"("... | Create INI file template for new migration.
@param callable $callbackAskNameAndService | [
"Create",
"INI",
"file",
"template",
"for",
"new",
"migration",
"."
] | 0f3ec5d61fce9df3cfc4102e0fa42ad856bda460 | https://github.com/Moro4125/team-migrations-common/blob/0f3ec5d61fce9df3cfc4102e0fa42ad856bda460/sources/MigrationManager.php#L409-L471 |
194,837 | Moro4125/team-migrations-common | sources/MigrationManager.php | MigrationManager.doStatus | public function doStatus()
{
assert($this->_dispatcher);
assert($this->_container);
$this->_clearStatProperties();
$this->_dispatcher->dispatch(self::EVENT_INIT_SERVICE, OnInitService::create());
try
{
$this->notify(self::STATE_FIRED);
$modulesAndFiles = $this->_findModulesAndMigrationFiles();
... | php | public function doStatus()
{
assert($this->_dispatcher);
assert($this->_container);
$this->_clearStatProperties();
$this->_dispatcher->dispatch(self::EVENT_INIT_SERVICE, OnInitService::create());
try
{
$this->notify(self::STATE_FIRED);
$modulesAndFiles = $this->_findModulesAndMigrationFiles();
... | [
"public",
"function",
"doStatus",
"(",
")",
"{",
"assert",
"(",
"$",
"this",
"->",
"_dispatcher",
")",
";",
"assert",
"(",
"$",
"this",
"->",
"_container",
")",
";",
"$",
"this",
"->",
"_clearStatProperties",
"(",
")",
";",
"$",
"this",
"->",
"_dispatc... | Execute status command. | [
"Execute",
"status",
"command",
"."
] | 0f3ec5d61fce9df3cfc4102e0fa42ad856bda460 | https://github.com/Moro4125/team-migrations-common/blob/0f3ec5d61fce9df3cfc4102e0fa42ad856bda460/sources/MigrationManager.php#L488-L534 |
194,838 | Moro4125/team-migrations-common | sources/MigrationManager.php | MigrationManager.notify | public function notify($state = null)
{
assert($state === null || is_int($state));
$this->_state = intval($state) ?: $this->_state;
/** @var \SplObserver $observer */
foreach ($this->_observers as $observer)
{
$observer->update($this);
}
} | php | public function notify($state = null)
{
assert($state === null || is_int($state));
$this->_state = intval($state) ?: $this->_state;
/** @var \SplObserver $observer */
foreach ($this->_observers as $observer)
{
$observer->update($this);
}
} | [
"public",
"function",
"notify",
"(",
"$",
"state",
"=",
"null",
")",
"{",
"assert",
"(",
"$",
"state",
"===",
"null",
"||",
"is_int",
"(",
"$",
"state",
")",
")",
";",
"$",
"this",
"->",
"_state",
"=",
"intval",
"(",
"$",
"state",
")",
"?",
":",
... | Notify any observers about state change.
@param null|int $state | [
"Notify",
"any",
"observers",
"about",
"state",
"change",
"."
] | 0f3ec5d61fce9df3cfc4102e0fa42ad856bda460 | https://github.com/Moro4125/team-migrations-common/blob/0f3ec5d61fce9df3cfc4102e0fa42ad856bda460/sources/MigrationManager.php#L630-L640 |
194,839 | Moro4125/team-migrations-common | sources/MigrationManager.php | MigrationManager._clearStatProperties | protected function _clearStatProperties()
{
$this->_statErrors = 0;
$this->_statMigrationsTotal = 0;
$this->_statMigrationForCommit = 0;
$this->_statMigrationForRollback = 0;
$this->_statMigrationRejected = 0;
$this->_statMigrationApplied = 0;
} | php | protected function _clearStatProperties()
{
$this->_statErrors = 0;
$this->_statMigrationsTotal = 0;
$this->_statMigrationForCommit = 0;
$this->_statMigrationForRollback = 0;
$this->_statMigrationRejected = 0;
$this->_statMigrationApplied = 0;
} | [
"protected",
"function",
"_clearStatProperties",
"(",
")",
"{",
"$",
"this",
"->",
"_statErrors",
"=",
"0",
";",
"$",
"this",
"->",
"_statMigrationsTotal",
"=",
"0",
";",
"$",
"this",
"->",
"_statMigrationForCommit",
"=",
"0",
";",
"$",
"this",
"->",
"_sta... | Reset properties with statistic information. | [
"Reset",
"properties",
"with",
"statistic",
"information",
"."
] | 0f3ec5d61fce9df3cfc4102e0fa42ad856bda460 | https://github.com/Moro4125/team-migrations-common/blob/0f3ec5d61fce9df3cfc4102e0fa42ad856bda460/sources/MigrationManager.php#L645-L653 |
194,840 | SandratraRM/mora-core | src/Control/Controller.php | Controller.doAction | public function doAction($action,$params){
if(method_exists($this,$action)){
$this->$action($params);
}
else{
$this->ActionNotFound($action,$params);
}
} | php | public function doAction($action,$params){
if(method_exists($this,$action)){
$this->$action($params);
}
else{
$this->ActionNotFound($action,$params);
}
} | [
"public",
"function",
"doAction",
"(",
"$",
"action",
",",
"$",
"params",
")",
"{",
"if",
"(",
"method_exists",
"(",
"$",
"this",
",",
"$",
"action",
")",
")",
"{",
"$",
"this",
"->",
"$",
"action",
"(",
"$",
"params",
")",
";",
"}",
"else",
"{",... | Execute the action if it exists, else calling ActionNotFound method
@param string $action The action name
@param array $params An array that olds the arguments part of the request | [
"Execute",
"the",
"action",
"if",
"it",
"exists",
"else",
"calling",
"ActionNotFound",
"method"
] | 9cd8e16e4b619798a51dc2ac66ddd8d22caf7baa | https://github.com/SandratraRM/mora-core/blob/9cd8e16e4b619798a51dc2ac66ddd8d22caf7baa/src/Control/Controller.php#L16-L23 |
194,841 | translationexchange/tml-php-clientsdk | library/Tr8n/Tokens/DecorationTokenizer.php | DecorationTokenizer.fragmentize | public function fragmentize() {
$re = implode('|', array(
self::RE_SHORT_TOKEN_START, self::RE_SHORT_TOKEN_END,
self::RE_LONG_TOKEN_START, self::RE_LONG_TOKEN_END,
self::RE_TEXT
));
preg_match_all('/'.$re.'/', $this->text, $matches);
$this->fragments ... | php | public function fragmentize() {
$re = implode('|', array(
self::RE_SHORT_TOKEN_START, self::RE_SHORT_TOKEN_END,
self::RE_LONG_TOKEN_START, self::RE_LONG_TOKEN_END,
self::RE_TEXT
));
preg_match_all('/'.$re.'/', $this->text, $matches);
$this->fragments ... | [
"public",
"function",
"fragmentize",
"(",
")",
"{",
"$",
"re",
"=",
"implode",
"(",
"'|'",
",",
"array",
"(",
"self",
"::",
"RE_SHORT_TOKEN_START",
",",
"self",
"::",
"RE_SHORT_TOKEN_END",
",",
"self",
"::",
"RE_LONG_TOKEN_START",
",",
"self",
"::",
"RE_LONG... | Splits texts into fragments, where some fragments are tokens, others are text | [
"Splits",
"texts",
"into",
"fragments",
"where",
"some",
"fragments",
"are",
"tokens",
"others",
"are",
"text"
] | fe51473824e62cfd883c6aa0c6a3783a16ce8425 | https://github.com/translationexchange/tml-php-clientsdk/blob/fe51473824e62cfd883c6aa0c6a3783a16ce8425/library/Tr8n/Tokens/DecorationTokenizer.php#L105-L115 |
194,842 | PenoaksDev/Milky-Framework | src/Milky/Facades/View.php | View.escape | public static function escape( $value )
{
if ( $value instanceof Htmlable )
return $value->toHtml();
return htmlentities( $value, ENT_QUOTES, 'UTF-8', false );
} | php | public static function escape( $value )
{
if ( $value instanceof Htmlable )
return $value->toHtml();
return htmlentities( $value, ENT_QUOTES, 'UTF-8', false );
} | [
"public",
"static",
"function",
"escape",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"instanceof",
"Htmlable",
")",
"return",
"$",
"value",
"->",
"toHtml",
"(",
")",
";",
"return",
"htmlentities",
"(",
"$",
"value",
",",
"ENT_QUOTES",
",",
"... | Escape HTML entities in a string.
@param Htmlable|string $value
@return string | [
"Escape",
"HTML",
"entities",
"in",
"a",
"string",
"."
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Facades/View.php#L489-L495 |
194,843 | marando/Units | src/Marando/Units/Angle.php | Angle.dms | public static function dms($d, $m = 0, $s = 0, $f = 0)
{
$asec = static::dmsf2asec($d, $m, $s, $f);
return static::mas($asec * 1000);
} | php | public static function dms($d, $m = 0, $s = 0, $f = 0)
{
$asec = static::dmsf2asec($d, $m, $s, $f);
return static::mas($asec * 1000);
} | [
"public",
"static",
"function",
"dms",
"(",
"$",
"d",
",",
"$",
"m",
"=",
"0",
",",
"$",
"s",
"=",
"0",
",",
"$",
"f",
"=",
"0",
")",
"{",
"$",
"asec",
"=",
"static",
"::",
"dmsf2asec",
"(",
"$",
"d",
",",
"$",
"m",
",",
"$",
"s",
",",
... | Creates a new angle from degree, arcminute and arcsecond components.
@param int $d Degree component
@param int $m Arcminute component
@param int|double $s Arcsecond component
@param int|double $f Fractional arcsecond component
@return static | [
"Creates",
"a",
"new",
"angle",
"from",
"degree",
"arcminute",
"and",
"arcsecond",
"components",
"."
] | 1721f16a2fdbd3fd8acb9061d393ce9ef1ce6e70 | https://github.com/marando/Units/blob/1721f16a2fdbd3fd8acb9061d393ce9ef1ce6e70/src/Marando/Units/Angle.php#L122-L127 |
194,844 | marando/Units | src/Marando/Units/Angle.php | Angle.time | public static function time(Time $time, Time $interval = null)
{
$secInDay = Time::days(1)->sec;
$interval = $interval ? $interval->sec : $secInDay;
return static::deg($time->sec / $interval * 360);
} | php | public static function time(Time $time, Time $interval = null)
{
$secInDay = Time::days(1)->sec;
$interval = $interval ? $interval->sec : $secInDay;
return static::deg($time->sec / $interval * 360);
} | [
"public",
"static",
"function",
"time",
"(",
"Time",
"$",
"time",
",",
"Time",
"$",
"interval",
"=",
"null",
")",
"{",
"$",
"secInDay",
"=",
"Time",
"::",
"days",
"(",
"1",
")",
"->",
"sec",
";",
"$",
"interval",
"=",
"$",
"interval",
"?",
"$",
"... | Creates a new angle equal to the number of revolutions of a duration of
time within a specified time interval.
@param Time $time
@param Time $interval
@return Angle | [
"Creates",
"a",
"new",
"angle",
"equal",
"to",
"the",
"number",
"of",
"revolutions",
"of",
"a",
"duration",
"of",
"time",
"within",
"a",
"specified",
"time",
"interval",
"."
] | 1721f16a2fdbd3fd8acb9061d393ce9ef1ce6e70 | https://github.com/marando/Units/blob/1721f16a2fdbd3fd8acb9061d393ce9ef1ce6e70/src/Marando/Units/Angle.php#L174-L180 |
194,845 | marando/Units | src/Marando/Units/Angle.php | Angle.atan2 | public static function atan2($y, $x)
{
$y = $y instanceof Angle ? $y->rad : $y;
$x = $x instanceof Angle ? $x->rad : $x;
return static::rad(atan2($y, $x));
} | php | public static function atan2($y, $x)
{
$y = $y instanceof Angle ? $y->rad : $y;
$x = $x instanceof Angle ? $x->rad : $x;
return static::rad(atan2($y, $x));
} | [
"public",
"static",
"function",
"atan2",
"(",
"$",
"y",
",",
"$",
"x",
")",
"{",
"$",
"y",
"=",
"$",
"y",
"instanceof",
"Angle",
"?",
"$",
"y",
"->",
"rad",
":",
"$",
"y",
";",
"$",
"x",
"=",
"$",
"x",
"instanceof",
"Angle",
"?",
"$",
"x",
... | Creates a new angle from the arc tangent of two Angle instances or float
values expressed in radians.
@param float|Angle $y Dividend
@param float|Angle $x Divisor
@return static | [
"Creates",
"a",
"new",
"angle",
"from",
"the",
"arc",
"tangent",
"of",
"two",
"Angle",
"instances",
"or",
"float",
"values",
"expressed",
"in",
"radians",
"."
] | 1721f16a2fdbd3fd8acb9061d393ce9ef1ce6e70 | https://github.com/marando/Units/blob/1721f16a2fdbd3fd8acb9061d393ce9ef1ce6e70/src/Marando/Units/Angle.php#L201-L207 |
194,846 | marando/Units | src/Marando/Units/Angle.php | Angle.toTime | public function toTime(Time $interval = null)
{
$secInDay = Time::days(1)->sec;
$interval = $interval ? $interval->sec : $secInDay;
return Time::sec(($this->deg / 360) * $interval);
} | php | public function toTime(Time $interval = null)
{
$secInDay = Time::days(1)->sec;
$interval = $interval ? $interval->sec : $secInDay;
return Time::sec(($this->deg / 360) * $interval);
} | [
"public",
"function",
"toTime",
"(",
"Time",
"$",
"interval",
"=",
"null",
")",
"{",
"$",
"secInDay",
"=",
"Time",
"::",
"days",
"(",
"1",
")",
"->",
"sec",
";",
"$",
"interval",
"=",
"$",
"interval",
"?",
"$",
"interval",
"->",
"sec",
":",
"$",
... | Converts this instance to a proportion of time passed within a specified
time interval where 360 degrees is equal to the interval.
@param Time $interval
@return Time | [
"Converts",
"this",
"instance",
"to",
"a",
"proportion",
"of",
"time",
"passed",
"within",
"a",
"specified",
"time",
"interval",
"where",
"360",
"degrees",
"is",
"equal",
"to",
"the",
"interval",
"."
] | 1721f16a2fdbd3fd8acb9061d393ce9ef1ce6e70 | https://github.com/marando/Units/blob/1721f16a2fdbd3fd8acb9061d393ce9ef1ce6e70/src/Marando/Units/Angle.php#L339-L345 |
194,847 | modulusphp/support | Mix.php | Mix.make | public static function make(string $path, string $manifestDirectory) : string
{
static $manifest;
if ($manifestDirectory && strpos($manifestDirectory, DIRECTORY_SEPARATOR) !== 0) {
$manifestDirectory = DIRECTORY_SEPARATOR . "{$manifestDirectory}";
}
if (!$manifest) {
if (!file_exists($man... | php | public static function make(string $path, string $manifestDirectory) : string
{
static $manifest;
if ($manifestDirectory && strpos($manifestDirectory, DIRECTORY_SEPARATOR) !== 0) {
$manifestDirectory = DIRECTORY_SEPARATOR . "{$manifestDirectory}";
}
if (!$manifest) {
if (!file_exists($man... | [
"public",
"static",
"function",
"make",
"(",
"string",
"$",
"path",
",",
"string",
"$",
"manifestDirectory",
")",
":",
"string",
"{",
"static",
"$",
"manifest",
";",
"if",
"(",
"$",
"manifestDirectory",
"&&",
"strpos",
"(",
"$",
"manifestDirectory",
",",
"... | Get mix file
@param string $path
@param string $manifestDirectory
@return string $manifest[$path] | [
"Get",
"mix",
"file"
] | b5c5b48dcbeb379e6cd1f29159dc8cdacef3adab | https://github.com/modulusphp/support/blob/b5c5b48dcbeb379e6cd1f29159dc8cdacef3adab/Mix.php#L17-L43 |
194,848 | indigoram89/laravel-fields | src/HasFields.php | HasFields.field | public function field(string $key, $value = null, $description = null)
{
if ( ! $field = $this->fields->where('key', $key)->first()) {
$this->fields->push(
$field = $this->fields()->firstOrNew(compact('key'))
);
}
$field->setDefaultValue($value);
... | php | public function field(string $key, $value = null, $description = null)
{
if ( ! $field = $this->fields->where('key', $key)->first()) {
$this->fields->push(
$field = $this->fields()->firstOrNew(compact('key'))
);
}
$field->setDefaultValue($value);
... | [
"public",
"function",
"field",
"(",
"string",
"$",
"key",
",",
"$",
"value",
"=",
"null",
",",
"$",
"description",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"field",
"=",
"$",
"this",
"->",
"fields",
"->",
"where",
"(",
"'key'",
",",
"$",
"key"... | Get or create a field.
@param string $key
@param string|array|null $value
@param string|array|null $description
@return \Indigoram89\Fields\Field | [
"Get",
"or",
"create",
"a",
"field",
"."
] | 1cb34eb4e653b82577531951ed94bd73a1009112 | https://github.com/indigoram89/laravel-fields/blob/1cb34eb4e653b82577531951ed94bd73a1009112/src/HasFields.php#L27-L41 |
194,849 | vukbgit/PHPCraft.Subject | src/Traits/CRUD.php | CRUD.extractPrimaryKeyValue | protected function extractPrimaryKeyValue($record, $returnAs)
{
$record = (object) $record;
$values = [];
foreach((array) $this->ORMParameters['primaryKey'] as $field) {
$values[$field] = $record->$field;
}
switch($returnAs) {
case 's':
... | php | protected function extractPrimaryKeyValue($record, $returnAs)
{
$record = (object) $record;
$values = [];
foreach((array) $this->ORMParameters['primaryKey'] as $field) {
$values[$field] = $record->$field;
}
switch($returnAs) {
case 's':
... | [
"protected",
"function",
"extractPrimaryKeyValue",
"(",
"$",
"record",
",",
"$",
"returnAs",
")",
"{",
"$",
"record",
"=",
"(",
"object",
")",
"$",
"record",
";",
"$",
"values",
"=",
"[",
"]",
";",
"foreach",
"(",
"(",
"array",
")",
"$",
"this",
"->"... | Builds primary key value for a record
@param mixed $record array or object with record data;
@param string $returnAs s = string (imploded by | in case of composite key) | a = array | [
"Builds",
"primary",
"key",
"value",
"for",
"a",
"record"
] | a43ad7868098ff1e7bda6819547ea64f9a853732 | https://github.com/vukbgit/PHPCraft.Subject/blob/a43ad7868098ff1e7bda6819547ea64f9a853732/src/Traits/CRUD.php#L93-L108 |
194,850 | vukbgit/PHPCraft.Subject | src/Traits/CRUD.php | CRUD.purgePrimaryKeyValue | protected function purgePrimaryKeyValue(&$record)
{
foreach((array) $this->ORMParameters['primaryKey'] as $field) {
if(is_array($record) && (isset($record[$field]) || $record[$field] === null)) {
unset($record[$field]);
} elseif(is_object($record) && isset($record->$f... | php | protected function purgePrimaryKeyValue(&$record)
{
foreach((array) $this->ORMParameters['primaryKey'] as $field) {
if(is_array($record) && (isset($record[$field]) || $record[$field] === null)) {
unset($record[$field]);
} elseif(is_object($record) && isset($record->$f... | [
"protected",
"function",
"purgePrimaryKeyValue",
"(",
"&",
"$",
"record",
")",
"{",
"foreach",
"(",
"(",
"array",
")",
"$",
"this",
"->",
"ORMParameters",
"[",
"'primaryKey'",
"]",
"as",
"$",
"field",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"record",
... | Purges primary key value for a record
@param mixed $record array or object with record data | [
"Purges",
"primary",
"key",
"value",
"for",
"a",
"record"
] | a43ad7868098ff1e7bda6819547ea64f9a853732 | https://github.com/vukbgit/PHPCraft.Subject/blob/a43ad7868098ff1e7bda6819547ea64f9a853732/src/Traits/CRUD.php#L114-L123 |
194,851 | vukbgit/PHPCraft.Subject | src/Traits/CRUD.php | CRUD.execList | protected function execList()
{
//check if parent primary key is into route
if(!empty($this->ancestors)) {
end($this->ancestors);
$parentPrimaryKey = current($this->ancestors);
} else {
$parentPrimaryKey = [];
}
//get records
$this-... | php | protected function execList()
{
//check if parent primary key is into route
if(!empty($this->ancestors)) {
end($this->ancestors);
$parentPrimaryKey = current($this->ancestors);
} else {
$parentPrimaryKey = [];
}
//get records
$this-... | [
"protected",
"function",
"execList",
"(",
")",
"{",
"//check if parent primary key is into route",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"ancestors",
")",
")",
"{",
"end",
"(",
"$",
"this",
"->",
"ancestors",
")",
";",
"$",
"parentPrimaryKey",
"="... | Displays list table | [
"Displays",
"list",
"table"
] | a43ad7868098ff1e7bda6819547ea64f9a853732 | https://github.com/vukbgit/PHPCraft.Subject/blob/a43ad7868098ff1e7bda6819547ea64f9a853732/src/Traits/CRUD.php#L128-L147 |
194,852 | vukbgit/PHPCraft.Subject | src/Traits/CRUD.php | CRUD.execInsertForm | protected function execInsertForm()
{
// form translations
$this->loadTranslations('form', sprintf('private/global/locales/%s/form.ini', LANGUAGE));
// render template
$this->renderTemplate(sprintf('%s/%s/save-form', AREA, $this->name));
} | php | protected function execInsertForm()
{
// form translations
$this->loadTranslations('form', sprintf('private/global/locales/%s/form.ini', LANGUAGE));
// render template
$this->renderTemplate(sprintf('%s/%s/save-form', AREA, $this->name));
} | [
"protected",
"function",
"execInsertForm",
"(",
")",
"{",
"// form translations",
"$",
"this",
"->",
"loadTranslations",
"(",
"'form'",
",",
"sprintf",
"(",
"'private/global/locales/%s/form.ini'",
",",
"LANGUAGE",
")",
")",
";",
"// render template",
"$",
"this",
"-... | Displays insert form | [
"Displays",
"insert",
"form"
] | a43ad7868098ff1e7bda6819547ea64f9a853732 | https://github.com/vukbgit/PHPCraft.Subject/blob/a43ad7868098ff1e7bda6819547ea64f9a853732/src/Traits/CRUD.php#L152-L158 |
194,853 | vukbgit/PHPCraft.Subject | src/Traits/CRUD.php | CRUD.execUpdateForm | protected function execUpdateForm()
{
// form translations
$this->loadTranslations('form', sprintf('private/global/locales/%s/form.ini', LANGUAGE));
// get record
$this->templateParameters['record'] = $this->getByPrimaryKey($this->primaryKeyValue);
// render template
... | php | protected function execUpdateForm()
{
// form translations
$this->loadTranslations('form', sprintf('private/global/locales/%s/form.ini', LANGUAGE));
// get record
$this->templateParameters['record'] = $this->getByPrimaryKey($this->primaryKeyValue);
// render template
... | [
"protected",
"function",
"execUpdateForm",
"(",
")",
"{",
"// form translations",
"$",
"this",
"->",
"loadTranslations",
"(",
"'form'",
",",
"sprintf",
"(",
"'private/global/locales/%s/form.ini'",
",",
"LANGUAGE",
")",
")",
";",
"// get record",
"$",
"this",
"->",
... | Displays update form | [
"Displays",
"update",
"form"
] | a43ad7868098ff1e7bda6819547ea64f9a853732 | https://github.com/vukbgit/PHPCraft.Subject/blob/a43ad7868098ff1e7bda6819547ea64f9a853732/src/Traits/CRUD.php#L163-L171 |
194,854 | vukbgit/PHPCraft.Subject | src/Traits/CRUD.php | CRUD.execInsert | public function execInsert($redirectAction = false)
{
// database translations
$this->loadTranslations('database', sprintf('private/global/locales/%s/database.ini', LANGUAGE));
//validate and extract input
$input = $this->processSaveInput(filter_input_array(INPUT_POST, $this->configu... | php | public function execInsert($redirectAction = false)
{
// database translations
$this->loadTranslations('database', sprintf('private/global/locales/%s/database.ini', LANGUAGE));
//validate and extract input
$input = $this->processSaveInput(filter_input_array(INPUT_POST, $this->configu... | [
"public",
"function",
"execInsert",
"(",
"$",
"redirectAction",
"=",
"false",
")",
"{",
"// database translations",
"$",
"this",
"->",
"loadTranslations",
"(",
"'database'",
",",
"sprintf",
"(",
"'private/global/locales/%s/database.ini'",
",",
"LANGUAGE",
")",
")",
... | Insert record action
@param string $redirectAction | [
"Insert",
"record",
"action"
] | a43ad7868098ff1e7bda6819547ea64f9a853732 | https://github.com/vukbgit/PHPCraft.Subject/blob/a43ad7868098ff1e7bda6819547ea64f9a853732/src/Traits/CRUD.php#L198-L221 |
194,855 | vukbgit/PHPCraft.Subject | src/Traits/CRUD.php | CRUD.execUpdate | public function execUpdate($redirectAction = false)
{
// database translations
$this->loadTranslations('database', sprintf('private/global/locales/%s/database.ini', LANGUAGE));
//validate and extract input
$input = $this->processSaveInput(filter_input_array(INPUT_POST, $this->configu... | php | public function execUpdate($redirectAction = false)
{
// database translations
$this->loadTranslations('database', sprintf('private/global/locales/%s/database.ini', LANGUAGE));
//validate and extract input
$input = $this->processSaveInput(filter_input_array(INPUT_POST, $this->configu... | [
"public",
"function",
"execUpdate",
"(",
"$",
"redirectAction",
"=",
"false",
")",
"{",
"// database translations",
"$",
"this",
"->",
"loadTranslations",
"(",
"'database'",
",",
"sprintf",
"(",
"'private/global/locales/%s/database.ini'",
",",
"LANGUAGE",
")",
")",
... | Update record action
@param string $redirectAction | [
"Update",
"record",
"action"
] | a43ad7868098ff1e7bda6819547ea64f9a853732 | https://github.com/vukbgit/PHPCraft.Subject/blob/a43ad7868098ff1e7bda6819547ea64f9a853732/src/Traits/CRUD.php#L227-L252 |
194,856 | vukbgit/PHPCraft.Subject | src/Traits/CRUD.php | CRUD.execDelete | public function execDelete($redirectAction = false)
{
// database translations
$this->loadTranslations('database', sprintf('private/global/locales/%s/database.ini', LANGUAGE));
//validate and extract input
$input = $this->processSaveInput(filter_input_array(INPUT_POST, $this->configu... | php | public function execDelete($redirectAction = false)
{
// database translations
$this->loadTranslations('database', sprintf('private/global/locales/%s/database.ini', LANGUAGE));
//validate and extract input
$input = $this->processSaveInput(filter_input_array(INPUT_POST, $this->configu... | [
"public",
"function",
"execDelete",
"(",
"$",
"redirectAction",
"=",
"false",
")",
"{",
"// database translations",
"$",
"this",
"->",
"loadTranslations",
"(",
"'database'",
",",
"sprintf",
"(",
"'private/global/locales/%s/database.ini'",
",",
"LANGUAGE",
")",
")",
... | Delete record action
@param string $redirectAction | [
"Delete",
"record",
"action"
] | a43ad7868098ff1e7bda6819547ea64f9a853732 | https://github.com/vukbgit/PHPCraft.Subject/blob/a43ad7868098ff1e7bda6819547ea64f9a853732/src/Traits/CRUD.php#L258-L279 |
194,857 | vukbgit/PHPCraft.Subject | src/Traits/CRUD.php | CRUD.execDeleteBulk | protected function execDeleteBulk()
{
//get values
$primaryKeyValues = $_POST['primaryKeyValues'];
// database translations
$this->loadTranslations('database', sprintf('private/global/locales/%s/database.ini', LANGUAGE));
$deletedNumber = 0;
foreach($primaryKeyValues ... | php | protected function execDeleteBulk()
{
//get values
$primaryKeyValues = $_POST['primaryKeyValues'];
// database translations
$this->loadTranslations('database', sprintf('private/global/locales/%s/database.ini', LANGUAGE));
$deletedNumber = 0;
foreach($primaryKeyValues ... | [
"protected",
"function",
"execDeleteBulk",
"(",
")",
"{",
"//get values",
"$",
"primaryKeyValues",
"=",
"$",
"_POST",
"[",
"'primaryKeyValues'",
"]",
";",
"// database translations",
"$",
"this",
"->",
"loadTranslations",
"(",
"'database'",
",",
"sprintf",
"(",
"'... | deletes multiple record | [
"deletes",
"multiple",
"record"
] | a43ad7868098ff1e7bda6819547ea64f9a853732 | https://github.com/vukbgit/PHPCraft.Subject/blob/a43ad7868098ff1e7bda6819547ea64f9a853732/src/Traits/CRUD.php#L284-L304 |
194,858 | as3io/As3ModlrBundle | DependencyInjection/ServiceLoader/SearchClients.php | SearchClients.createElasticClient | private function createElasticClient($clientName, ContainerBuilder $container)
{
// Storage metadata
$smfName = sprintf('%s.metadata', $clientName);
$definition = new Definition(
Utility::getLibraryClass('Search\Elastic\StorageMetadataFactory')
);
$definition->set... | php | private function createElasticClient($clientName, ContainerBuilder $container)
{
// Storage metadata
$smfName = sprintf('%s.metadata', $clientName);
$definition = new Definition(
Utility::getLibraryClass('Search\Elastic\StorageMetadataFactory')
);
$definition->set... | [
"private",
"function",
"createElasticClient",
"(",
"$",
"clientName",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"// Storage metadata",
"$",
"smfName",
"=",
"sprintf",
"(",
"'%s.metadata'",
",",
"$",
"clientName",
")",
";",
"$",
"definition",
"=",
"new... | Creates the Elastic search client service definition.
Will also load support services.
@param string $clientName
@param ContainerBuilder $container
@return Definition | [
"Creates",
"the",
"Elastic",
"search",
"client",
"service",
"definition",
".",
"Will",
"also",
"load",
"support",
"services",
"."
] | 7ce2abb7390c7eaf4081c5b7e00b96e7001774a4 | https://github.com/as3io/As3ModlrBundle/blob/7ce2abb7390c7eaf4081c5b7e00b96e7001774a4/DependencyInjection/ServiceLoader/SearchClients.php#L25-L40 |
194,859 | humplus/template | src/Template.php | Template.compiled | protected function compiled($template)
{
$template = ltrim($template, '/');
if (strrchr($template, '.') == $this->extension)
$template = substr($template, 0, -strlen($this->extension));
$file = $this->dir . DIRECTORY_SEPARATOR . $template . $this->extension;
if (!is_file(... | php | protected function compiled($template)
{
$template = ltrim($template, '/');
if (strrchr($template, '.') == $this->extension)
$template = substr($template, 0, -strlen($this->extension));
$file = $this->dir . DIRECTORY_SEPARATOR . $template . $this->extension;
if (!is_file(... | [
"protected",
"function",
"compiled",
"(",
"$",
"template",
")",
"{",
"$",
"template",
"=",
"ltrim",
"(",
"$",
"template",
",",
"'/'",
")",
";",
"if",
"(",
"strrchr",
"(",
"$",
"template",
",",
"'.'",
")",
"==",
"$",
"this",
"->",
"extension",
")",
... | Fetch Compiled Template
@param $template
@return string
@throws \Exception | [
"Fetch",
"Compiled",
"Template"
] | f94a7f3f2ee0fc874a233c9a2526f26728d40833 | https://github.com/humplus/template/blob/f94a7f3f2ee0fc874a233c9a2526f26728d40833/src/Template.php#L145-L163 |
194,860 | humplus/template | src/Template.php | Template.initWidgetParameters | protected static function initWidgetParameters($widget, array $parameters)
{
$param = var_export($parameters, true);
$param = preg_replace("/'\\$(.*)',/isU", "\$\\1,", $param);
$param = str_replace('\\\'', '\'', $param);
return "<?php \$this->widget->setParameters($param);?>\n";
... | php | protected static function initWidgetParameters($widget, array $parameters)
{
$param = var_export($parameters, true);
$param = preg_replace("/'\\$(.*)',/isU", "\$\\1,", $param);
$param = str_replace('\\\'', '\'', $param);
return "<?php \$this->widget->setParameters($param);?>\n";
... | [
"protected",
"static",
"function",
"initWidgetParameters",
"(",
"$",
"widget",
",",
"array",
"$",
"parameters",
")",
"{",
"$",
"param",
"=",
"var_export",
"(",
"$",
"parameters",
",",
"true",
")",
";",
"$",
"param",
"=",
"preg_replace",
"(",
"\"/'\\\\$(.*)',... | Set Widget Parameters
@param string $widget
@param array $parameters
@return string | [
"Set",
"Widget",
"Parameters"
] | f94a7f3f2ee0fc874a233c9a2526f26728d40833 | https://github.com/humplus/template/blob/f94a7f3f2ee0fc874a233c9a2526f26728d40833/src/Template.php#L345-L352 |
194,861 | humplus/template | src/Template.php | Template.writeFile | protected static function writeFile($target, $content, $tmp)
{
$dir = dirname($target);
if (!is_dir($dir))
mkdir($dir, 644, true);
$file = tempnam($tmp, 'hum');
if (!($fd = fopen($file, 'w')))
throw new \RuntimeException("create template tmp file failed:$file!... | php | protected static function writeFile($target, $content, $tmp)
{
$dir = dirname($target);
if (!is_dir($dir))
mkdir($dir, 644, true);
$file = tempnam($tmp, 'hum');
if (!($fd = fopen($file, 'w')))
throw new \RuntimeException("create template tmp file failed:$file!... | [
"protected",
"static",
"function",
"writeFile",
"(",
"$",
"target",
",",
"$",
"content",
",",
"$",
"tmp",
")",
"{",
"$",
"dir",
"=",
"dirname",
"(",
"$",
"target",
")",
";",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"dir",
")",
")",
"mkdir",
"(",
"$",
... | Write Compiled File
@param string $target
@param string $content
@param string $tmp
@return string bool | [
"Write",
"Compiled",
"File"
] | f94a7f3f2ee0fc874a233c9a2526f26728d40833 | https://github.com/humplus/template/blob/f94a7f3f2ee0fc874a233c9a2526f26728d40833/src/Template.php#L387-L406 |
194,862 | enikeishik/ufoframework | src/Ufo/Core/App.php | App.execute | public function execute(): void
{
$path = '';
try {
$path = $this->getPath();
if ($this->config->cache) {
try {
$this->setCache();
} catch (StorageNotSupportedException $e) {
$this->... | php | public function execute(): void
{
$path = '';
try {
$path = $this->getPath();
if ($this->config->cache) {
try {
$this->setCache();
} catch (StorageNotSupportedException $e) {
$this->... | [
"public",
"function",
"execute",
"(",
")",
":",
"void",
"{",
"$",
"path",
"=",
"''",
";",
"try",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"getPath",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"config",
"->",
"cache",
")",
"{",
"try",
"{",
... | Application main workflow.
@return void | [
"Application",
"main",
"workflow",
"."
] | fb44461bcb0506dbc3257724a2281f756594f62f | https://github.com/enikeishik/ufoframework/blob/fb44461bcb0506dbc3257724a2281f756594f62f/src/Ufo/Core/App.php#L86-L155 |
194,863 | black-lamp/blcms-payment | backend/controllers/DefaultController.php | DefaultController.actionSave | public function actionSave($id = null, $languageId = null)
{
if (empty($languageId)) {
$languageId = Language::getCurrent()->id;
}
if (!empty($id)) {
$model = PaymentMethod::findOne($id);
if (empty($model)) throw new NotFoundHttpException();
$... | php | public function actionSave($id = null, $languageId = null)
{
if (empty($languageId)) {
$languageId = Language::getCurrent()->id;
}
if (!empty($id)) {
$model = PaymentMethod::findOne($id);
if (empty($model)) throw new NotFoundHttpException();
$... | [
"public",
"function",
"actionSave",
"(",
"$",
"id",
"=",
"null",
",",
"$",
"languageId",
"=",
"null",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"languageId",
")",
")",
"{",
"$",
"languageId",
"=",
"Language",
"::",
"getCurrent",
"(",
")",
"->",
"id",
... | Creates a new PaymentMethod model.
If creation is successful, the browser will be redirected to the 'view' page.
@param integer $id
@param integer $languageId
@return mixed
@throws Exception | [
"Creates",
"a",
"new",
"PaymentMethod",
"model",
".",
"If",
"creation",
"is",
"successful",
"the",
"browser",
"will",
"be",
"redirected",
"to",
"the",
"view",
"page",
"."
] | 6d139e0bb5a4e7733382cc6fe083173551905b92 | https://github.com/black-lamp/blcms-payment/blob/6d139e0bb5a4e7733382cc6fe083173551905b92/backend/controllers/DefaultController.php#L74-L122 |
194,864 | black-lamp/blcms-payment | backend/controllers/DefaultController.php | DefaultController.actionDelete | public function actionDelete($id)
{
if (($model = PaymentMethod::findOne($id)) !== null) {
$model->delete();
return $this->redirect(['index']);
} else {
throw new NotFoundHttpException('The requested page does not exist.');
}
} | php | public function actionDelete($id)
{
if (($model = PaymentMethod::findOne($id)) !== null) {
$model->delete();
return $this->redirect(['index']);
} else {
throw new NotFoundHttpException('The requested page does not exist.');
}
} | [
"public",
"function",
"actionDelete",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"(",
"$",
"model",
"=",
"PaymentMethod",
"::",
"findOne",
"(",
"$",
"id",
")",
")",
"!==",
"null",
")",
"{",
"$",
"model",
"->",
"delete",
"(",
")",
";",
"return",
"$",
"t... | Deletes an existing PaymentMethod model.
If deletion is successful, the browser will be redirected to the 'index' page.
@param integer $id
@return mixed
@throws NotFoundHttpException | [
"Deletes",
"an",
"existing",
"PaymentMethod",
"model",
".",
"If",
"deletion",
"is",
"successful",
"the",
"browser",
"will",
"be",
"redirected",
"to",
"the",
"index",
"page",
"."
] | 6d139e0bb5a4e7733382cc6fe083173551905b92 | https://github.com/black-lamp/blcms-payment/blob/6d139e0bb5a4e7733382cc6fe083173551905b92/backend/controllers/DefaultController.php#L131-L139 |
194,865 | black-lamp/blcms-payment | backend/controllers/DefaultController.php | DefaultController.actionDeleteImage | public function actionDeleteImage($id) {
if (!empty($id)) {
$paymentMethod = PaymentMethod::findOne($id);
$isDeleted = \Yii::$app->shop_imagable->delete('payment', $paymentMethod->image);
if ($isDeleted) {
$paymentMethod->image = NULL;
$payme... | php | public function actionDeleteImage($id) {
if (!empty($id)) {
$paymentMethod = PaymentMethod::findOne($id);
$isDeleted = \Yii::$app->shop_imagable->delete('payment', $paymentMethod->image);
if ($isDeleted) {
$paymentMethod->image = NULL;
$payme... | [
"public",
"function",
"actionDeleteImage",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"id",
")",
")",
"{",
"$",
"paymentMethod",
"=",
"PaymentMethod",
"::",
"findOne",
"(",
"$",
"id",
")",
";",
"$",
"isDeleted",
"=",
"\\",
"Yii",
... | Deletes image from Payment method model.
@param integer $id
@return mixed
@throws NotFoundHttpException
@throws Exception | [
"Deletes",
"image",
"from",
"Payment",
"method",
"model",
"."
] | 6d139e0bb5a4e7733382cc6fe083173551905b92 | https://github.com/black-lamp/blcms-payment/blob/6d139e0bb5a4e7733382cc6fe083173551905b92/backend/controllers/DefaultController.php#L149-L163 |
194,866 | rzajac/phptools | src/Helper/Obj.php | Obj.get | public static function get($obj, $propName, $default = null)
{
if (!is_object($obj)) {
return $default;
}
try {
return $obj->$propName;
} catch (\Exception $e) {
}
return $default;
} | php | public static function get($obj, $propName, $default = null)
{
if (!is_object($obj)) {
return $default;
}
try {
return $obj->$propName;
} catch (\Exception $e) {
}
return $default;
} | [
"public",
"static",
"function",
"get",
"(",
"$",
"obj",
",",
"$",
"propName",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_object",
"(",
"$",
"obj",
")",
")",
"{",
"return",
"$",
"default",
";",
"}",
"try",
"{",
"return",
"$",
... | Get object property value or default if it does not exist.
This handles only public properties.
@param object $obj The object.
@param string $propName The public property name.
@param mixed $default The default value to return if property name doesn't exist.
@return mixed | [
"Get",
"object",
"property",
"value",
"or",
"default",
"if",
"it",
"does",
"not",
"exist",
"."
] | 3cbece7645942d244603c14ba897d8a676ee3088 | https://github.com/rzajac/phptools/blob/3cbece7645942d244603c14ba897d8a676ee3088/src/Helper/Obj.php#L38-L50 |
194,867 | rzajac/phptools | src/Helper/Obj.php | Obj.getRfl | public static function getRfl($obj, $propName, $default = null)
{
if (!is_object($obj)) {
return $default;
}
try {
$prop = new \ReflectionProperty($obj, $propName);
} catch (\Exception $e) {
return $default;
}
if ($prop->isPublic(... | php | public static function getRfl($obj, $propName, $default = null)
{
if (!is_object($obj)) {
return $default;
}
try {
$prop = new \ReflectionProperty($obj, $propName);
} catch (\Exception $e) {
return $default;
}
if ($prop->isPublic(... | [
"public",
"static",
"function",
"getRfl",
"(",
"$",
"obj",
",",
"$",
"propName",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_object",
"(",
"$",
"obj",
")",
")",
"{",
"return",
"$",
"default",
";",
"}",
"try",
"{",
"$",
"prop",... | Get object property value using reflection.
This method is slower then Obj::get.
@param object $obj The object.
@param string $propName The property name.
@param mixed $default The default value to return if property name doesn't exist.
@return mixed|null | [
"Get",
"object",
"property",
"value",
"using",
"reflection",
"."
] | 3cbece7645942d244603c14ba897d8a676ee3088 | https://github.com/rzajac/phptools/blob/3cbece7645942d244603c14ba897d8a676ee3088/src/Helper/Obj.php#L63-L82 |
194,868 | prolic/HumusMvc | src/HumusMvc/Db/MultiDbManager.php | MultiDbManager.getDefaultDb | public function getDefaultDb($justPickOne = true)
{
if (null !== $this->defaultDb) {
return $this->defaultDb;
}
if ($justPickOne) {
return reset($this->dbs); // Return first db in db pool
}
return null;
} | php | public function getDefaultDb($justPickOne = true)
{
if (null !== $this->defaultDb) {
return $this->defaultDb;
}
if ($justPickOne) {
return reset($this->dbs); // Return first db in db pool
}
return null;
} | [
"public",
"function",
"getDefaultDb",
"(",
"$",
"justPickOne",
"=",
"true",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"defaultDb",
")",
"{",
"return",
"$",
"this",
"->",
"defaultDb",
";",
"}",
"if",
"(",
"$",
"justPickOne",
")",
"{",
"re... | Get the default db connection
@param boolean $justPickOne If true, a random (the first one in the stack)
connection is returned if no default was set.
If false, null is returned if no default was set.
@return null|Zend_Db_Adapter_Abstract | [
"Get",
"the",
"default",
"db",
"connection"
] | 09e8c6422d84b57745cc643047e10761be2a21a7 | https://github.com/prolic/HumusMvc/blob/09e8c6422d84b57745cc643047e10761be2a21a7/src/HumusMvc/Db/MultiDbManager.php#L60-L71 |
194,869 | prolic/HumusMvc | src/HumusMvc/Db/MultiDbManager.php | MultiDbManager.getDb | public function getDb($db = null)
{
if ($db === null) {
return $this->getDefaultDb();
}
if (isset($this->dbs[$db])) {
return $this->dbs[$db];
}
throw new Exception\InvalidArgumentException(
'A DB adapter was tried to retrieve, but was not... | php | public function getDb($db = null)
{
if ($db === null) {
return $this->getDefaultDb();
}
if (isset($this->dbs[$db])) {
return $this->dbs[$db];
}
throw new Exception\InvalidArgumentException(
'A DB adapter was tried to retrieve, but was not... | [
"public",
"function",
"getDb",
"(",
"$",
"db",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"db",
"===",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"getDefaultDb",
"(",
")",
";",
"}",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"dbs",
"[",
"$",
... | Retrieve the specified database connection
@param null|string|Zend_Db_Adapter_Abstract $db The adapter to retrieve.
Null to retrieve the default connection
@return Zend_Db_Adapter_Abstract
@throws Exception\InvalidArgumentException if the given parameter could not be found | [
"Retrieve",
"the",
"specified",
"database",
"connection"
] | 09e8c6422d84b57745cc643047e10761be2a21a7 | https://github.com/prolic/HumusMvc/blob/09e8c6422d84b57745cc643047e10761be2a21a7/src/HumusMvc/Db/MultiDbManager.php#L81-L94 |
194,870 | beMang/phpgone | core/Helpers/Session.php | Session.updateAttr | public function updateAttr($key, $value)
{
if (isset($_SESSION[$key])) {
$_SESSION[$key] = $value;
return true;
} else {
return false;
}
} | php | public function updateAttr($key, $value)
{
if (isset($_SESSION[$key])) {
$_SESSION[$key] = $value;
return true;
} else {
return false;
}
} | [
"public",
"function",
"updateAttr",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"_SESSION",
"[",
"$",
"key",
"]",
")",
")",
"{",
"$",
"_SESSION",
"[",
"$",
"key",
"]",
"=",
"$",
"value",
";",
"return",
"true",
";... | Modifie un attribut de la session
@param string $key Clé de l'attribut à modifier
@param string $value Valeur de l'attribut à modifier
@return bool succès de l'opération | [
"Modifie",
"un",
"attribut",
"de",
"la",
"session"
] | 6da468283880b7f5b28dc3735f8f13c97382710b | https://github.com/beMang/phpgone/blob/6da468283880b7f5b28dc3735f8f13c97382710b/core/Helpers/Session.php#L30-L38 |
194,871 | balintsera/evista-perform | src/ValueObject/SpecialFormFieldValidatorFactory.php | SpecialFormFieldValidatorFactory.create | public static function create(FormField $field, $submittedData)
{
switch ($field->getType()) {
case 'email':
$object = new SpecialEmailValidator($field, $submittedData);
break;
default:
throw FormFieldException::noSuchType($field->getTy... | php | public static function create(FormField $field, $submittedData)
{
switch ($field->getType()) {
case 'email':
$object = new SpecialEmailValidator($field, $submittedData);
break;
default:
throw FormFieldException::noSuchType($field->getTy... | [
"public",
"static",
"function",
"create",
"(",
"FormField",
"$",
"field",
",",
"$",
"submittedData",
")",
"{",
"switch",
"(",
"$",
"field",
"->",
"getType",
"(",
")",
")",
"{",
"case",
"'email'",
":",
"$",
"object",
"=",
"new",
"SpecialEmailValidator",
"... | Factory method to create an appropriate type
@param FormField $field
@param $submittedData
@return SpecialEmailValidator
@throws FormFieldException | [
"Factory",
"method",
"to",
"create",
"an",
"appropriate",
"type"
] | 2b8723852ebe824ed721f30293e1e0d2c14f4b21 | https://github.com/balintsera/evista-perform/blob/2b8723852ebe824ed721f30293e1e0d2c14f4b21/src/ValueObject/SpecialFormFieldValidatorFactory.php#L24-L36 |
194,872 | lasallecms/lasallecms-l5-mailgun-pkg | src/Processing/MapMailgunPostVariables.php | MapMailgunPostVariables.mapInboundPostVarsToEmail_messagesFields | public function mapInboundPostVarsToEmail_messagesFields() {
$data = [];
$data['user_id'] = $this->getUserIdByMappedEmailAddress();
$data['from_email_address'] = trim($this->request->input('sender'));
$data['from_name'] = $this->genericWashText($this->request ->inp... | php | public function mapInboundPostVarsToEmail_messagesFields() {
$data = [];
$data['user_id'] = $this->getUserIdByMappedEmailAddress();
$data['from_email_address'] = trim($this->request->input('sender'));
$data['from_name'] = $this->genericWashText($this->request ->inp... | [
"public",
"function",
"mapInboundPostVarsToEmail_messagesFields",
"(",
")",
"{",
"$",
"data",
"=",
"[",
"]",
";",
"$",
"data",
"[",
"'user_id'",
"]",
"=",
"$",
"this",
"->",
"getUserIdByMappedEmailAddress",
"(",
")",
";",
"$",
"data",
"[",
"'from_email_address... | Map the non-attachment vars from the inbound email webhook to the email_messages fields
@return array | [
"Map",
"the",
"non",
"-",
"attachment",
"vars",
"from",
"the",
"inbound",
"email",
"webhook",
"to",
"the",
"email_messages",
"fields"
] | f6c1fb92211b2537db87a1f03c126dc46691ee5e | https://github.com/lasallecms/lasallecms-l5-mailgun-pkg/blob/f6c1fb92211b2537db87a1f03c126dc46691ee5e/src/Processing/MapMailgunPostVariables.php#L106-L122 |
194,873 | lasallecms/lasallecms-l5-mailgun-pkg | src/Processing/MapMailgunPostVariables.php | MapMailgunPostVariables.setBodyField | public function setBodyField() {
if ($this->request->input('stripped-html')) {
return $this->request->input('stripped-html');
}
return $this->request->input('body-plain');
} | php | public function setBodyField() {
if ($this->request->input('stripped-html')) {
return $this->request->input('stripped-html');
}
return $this->request->input('body-plain');
} | [
"public",
"function",
"setBodyField",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"request",
"->",
"input",
"(",
"'stripped-html'",
")",
")",
"{",
"return",
"$",
"this",
"->",
"request",
"->",
"input",
"(",
"'stripped-html'",
")",
";",
"}",
"return",
... | Set the email's body field
@return mixed | [
"Set",
"the",
"email",
"s",
"body",
"field"
] | f6c1fb92211b2537db87a1f03c126dc46691ee5e | https://github.com/lasallecms/lasallecms-l5-mailgun-pkg/blob/f6c1fb92211b2537db87a1f03c126dc46691ee5e/src/Processing/MapMailgunPostVariables.php#L190-L197 |
194,874 | ScaraMVC/Framework | src/Scara/Http/Request.php | Request.cast | public function cast($request)
{
if (is_array($request) || is_object($request)) {
foreach ($request as $key => $value) {
if (is_array($value)) {
$this->cast($value);
} else {
$this->$key = $value;
}
... | php | public function cast($request)
{
if (is_array($request) || is_object($request)) {
foreach ($request as $key => $value) {
if (is_array($value)) {
$this->cast($value);
} else {
$this->$key = $value;
}
... | [
"public",
"function",
"cast",
"(",
"$",
"request",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"request",
")",
"||",
"is_object",
"(",
"$",
"request",
")",
")",
"{",
"foreach",
"(",
"$",
"request",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"... | Casts the request array into new Request object.
@param array $request - The request object | [
"Casts",
"the",
"request",
"array",
"into",
"new",
"Request",
"object",
"."
] | 199b08b45fadf5dae14ac4732af03b36e15bbef2 | https://github.com/ScaraMVC/Framework/blob/199b08b45fadf5dae14ac4732af03b36e15bbef2/src/Scara/Http/Request.php#L46-L57 |
194,875 | ScaraMVC/Framework | src/Scara/Http/Request.php | Request.setRequest | public function setRequest($request = [])
{
if (!empty($request)) {
if (is_array($request)) {
foreach ((array) $request as $item) {
foreach ($item as $key => $value) {
if (empty($value)) {
$request['empty'] =... | php | public function setRequest($request = [])
{
if (!empty($request)) {
if (is_array($request)) {
foreach ((array) $request as $item) {
foreach ($item as $key => $value) {
if (empty($value)) {
$request['empty'] =... | [
"public",
"function",
"setRequest",
"(",
"$",
"request",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"request",
")",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"request",
")",
")",
"{",
"foreach",
"(",
"(",
"array",
")",
"$",
"r... | Sets the request.
@param array $request - The request object
@throws \Exception
@return Request | [
"Sets",
"the",
"request",
"."
] | 199b08b45fadf5dae14ac4732af03b36e15bbef2 | https://github.com/ScaraMVC/Framework/blob/199b08b45fadf5dae14ac4732af03b36e15bbef2/src/Scara/Http/Request.php#L78-L101 |
194,876 | cubicmushroom/valueobjects | src/DateTime/DateTime.php | DateTime.sameValueAs | public function sameValueAs(ValueObjectInterface $date_time)
{
if (false === Util::classEquals($this, $date_time)) {
return false;
}
return $this->getDate()->sameValueAs($date_time->getDate()) && $this->getTime()->sameValueAs($date_time->getTime());
} | php | public function sameValueAs(ValueObjectInterface $date_time)
{
if (false === Util::classEquals($this, $date_time)) {
return false;
}
return $this->getDate()->sameValueAs($date_time->getDate()) && $this->getTime()->sameValueAs($date_time->getTime());
} | [
"public",
"function",
"sameValueAs",
"(",
"ValueObjectInterface",
"$",
"date_time",
")",
"{",
"if",
"(",
"false",
"===",
"Util",
"::",
"classEquals",
"(",
"$",
"this",
",",
"$",
"date_time",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"$",
"thi... | Tells whether two DateTime are equal by comparing their values
@param ValueObjectInterface $date_time
@return bool | [
"Tells",
"whether",
"two",
"DateTime",
"are",
"equal",
"by",
"comparing",
"their",
"values"
] | 4554239ab75d65eeb9773219aa5b07e9fbfabb92 | https://github.com/cubicmushroom/valueobjects/blob/4554239ab75d65eeb9773219aa5b07e9fbfabb92/src/DateTime/DateTime.php#L86-L93 |
194,877 | cubicmushroom/valueobjects | src/DateTime/DateTime.php | DateTime.toNativeDateTime | public function toNativeDateTime()
{
$year = $this->getDate()->getYear()->toNative();
$month = $this->getDate()->getMonth()->getNumericValue();
$day = $this->getDate()->getDay()->toNative();
$hour = $this->getTime()->getHour()->toNative();
$minute = $this->getTime()->... | php | public function toNativeDateTime()
{
$year = $this->getDate()->getYear()->toNative();
$month = $this->getDate()->getMonth()->getNumericValue();
$day = $this->getDate()->getDay()->toNative();
$hour = $this->getTime()->getHour()->toNative();
$minute = $this->getTime()->... | [
"public",
"function",
"toNativeDateTime",
"(",
")",
"{",
"$",
"year",
"=",
"$",
"this",
"->",
"getDate",
"(",
")",
"->",
"getYear",
"(",
")",
"->",
"toNative",
"(",
")",
";",
"$",
"month",
"=",
"$",
"this",
"->",
"getDate",
"(",
")",
"->",
"getMont... | Returns a native PHP \DateTime version of the current DateTime.
@return \DateTime | [
"Returns",
"a",
"native",
"PHP",
"\\",
"DateTime",
"version",
"of",
"the",
"current",
"DateTime",
"."
] | 4554239ab75d65eeb9773219aa5b07e9fbfabb92 | https://github.com/cubicmushroom/valueobjects/blob/4554239ab75d65eeb9773219aa5b07e9fbfabb92/src/DateTime/DateTime.php#L120-L134 |
194,878 | KeyboardCowboy/drush-denver | Denver.class.php | Denver.setEnvironments | public function setEnvironments($env) {
$envs = (explode('+', $env));
while (!empty($envs)) {
$_env = array_shift($envs);
if (!$this->setEnvironment($_env)) {
$msg = dt("Unable to locate an environment definition for '@env'.", ['@env' => $_env]);
if (empty($envs)) {
drush_l... | php | public function setEnvironments($env) {
$envs = (explode('+', $env));
while (!empty($envs)) {
$_env = array_shift($envs);
if (!$this->setEnvironment($_env)) {
$msg = dt("Unable to locate an environment definition for '@env'.", ['@env' => $_env]);
if (empty($envs)) {
drush_l... | [
"public",
"function",
"setEnvironments",
"(",
"$",
"env",
")",
"{",
"$",
"envs",
"=",
"(",
"explode",
"(",
"'+'",
",",
"$",
"env",
")",
")",
";",
"while",
"(",
"!",
"empty",
"(",
"$",
"envs",
")",
")",
"{",
"$",
"_env",
"=",
"array_shift",
"(",
... | Load the desired environments.
@param string $env
The environment argument. May be composite (env1+env2).
@return bool
Whether the environments were loaded. | [
"Load",
"the",
"desired",
"environments",
"."
] | 37608c6bda0d1ad59a99e0ea007dc164995b2669 | https://github.com/KeyboardCowboy/drush-denver/blob/37608c6bda0d1ad59a99e0ea007dc164995b2669/Denver.class.php#L99-L119 |
194,879 | KeyboardCowboy/drush-denver | Denver.class.php | Denver.setEnvironment | private function setEnvironment($env) {
if (isset($this->environments[$env])) {
$this->loadEnvironment($env);
return TRUE;
}
else {
return FALSE;
}
} | php | private function setEnvironment($env) {
if (isset($this->environments[$env])) {
$this->loadEnvironment($env);
return TRUE;
}
else {
return FALSE;
}
} | [
"private",
"function",
"setEnvironment",
"(",
"$",
"env",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"environments",
"[",
"$",
"env",
"]",
")",
")",
"{",
"$",
"this",
"->",
"loadEnvironment",
"(",
"$",
"env",
")",
";",
"return",
"TRUE",
... | Load an individual environment definition.
@param string $env
The single env def name.
@return bool
Whether the environment was loaded. | [
"Load",
"an",
"individual",
"environment",
"definition",
"."
] | 37608c6bda0d1ad59a99e0ea007dc164995b2669 | https://github.com/KeyboardCowboy/drush-denver/blob/37608c6bda0d1ad59a99e0ea007dc164995b2669/Denver.class.php#L130-L138 |
194,880 | KeyboardCowboy/drush-denver | Denver.class.php | Denver.exec | public function exec($groups = '') {
$_groups = !empty($groups) ? explode(',', $groups) : array();
// Print a message that the build is starting.
$names = implode('+', array_keys($this->loadedEnvs));
drush_print();
drush_print($this->formatHeading(dt("--- CONFIGURING @name ENVIRONMENT ---", array('... | php | public function exec($groups = '') {
$_groups = !empty($groups) ? explode(',', $groups) : array();
// Print a message that the build is starting.
$names = implode('+', array_keys($this->loadedEnvs));
drush_print();
drush_print($this->formatHeading(dt("--- CONFIGURING @name ENVIRONMENT ---", array('... | [
"public",
"function",
"exec",
"(",
"$",
"groups",
"=",
"''",
")",
"{",
"$",
"_groups",
"=",
"!",
"empty",
"(",
"$",
"groups",
")",
"?",
"explode",
"(",
"','",
",",
"$",
"groups",
")",
":",
"array",
"(",
")",
";",
"// Print a message that the build is s... | Apply the settings.
@param string $groups
The groups option as passed in from drush_get_option(). | [
"Apply",
"the",
"settings",
"."
] | 37608c6bda0d1ad59a99e0ea007dc164995b2669 | https://github.com/KeyboardCowboy/drush-denver/blob/37608c6bda0d1ad59a99e0ea007dc164995b2669/Denver.class.php#L156-L203 |
194,881 | KeyboardCowboy/drush-denver | Denver.class.php | Denver.printSummary | public function printSummary() {
drush_print();
// Print env files used for this definition.
drush_print($this->formatHeading('Environment Definitions Found'));
foreach ($this->loadedEnvs as $filename) {
drush_print("{$filename}", 1);
}
drush_print();
drush_print($this->formatHeading... | php | public function printSummary() {
drush_print();
// Print env files used for this definition.
drush_print($this->formatHeading('Environment Definitions Found'));
foreach ($this->loadedEnvs as $filename) {
drush_print("{$filename}", 1);
}
drush_print();
drush_print($this->formatHeading... | [
"public",
"function",
"printSummary",
"(",
")",
"{",
"drush_print",
"(",
")",
";",
"// Print env files used for this definition.",
"drush_print",
"(",
"$",
"this",
"->",
"formatHeading",
"(",
"'Environment Definitions Found'",
")",
")",
";",
"foreach",
"(",
"$",
"th... | Print a summary of the environment definitions. | [
"Print",
"a",
"summary",
"of",
"the",
"environment",
"definitions",
"."
] | 37608c6bda0d1ad59a99e0ea007dc164995b2669 | https://github.com/KeyboardCowboy/drush-denver/blob/37608c6bda0d1ad59a99e0ea007dc164995b2669/Denver.class.php#L208-L248 |
194,882 | KeyboardCowboy/drush-denver | Denver.class.php | Denver.printModuleSummary | private function printModuleSummary($options, $heading = '') {
// Print module info.
if (!empty($options)) {
drush_print("{$heading}");
$values = [];
foreach ($options as $status => $modules) {
$key = dt("!action", ['!action' => ucwords($status)]);
$value = implode(', ', $modu... | php | private function printModuleSummary($options, $heading = '') {
// Print module info.
if (!empty($options)) {
drush_print("{$heading}");
$values = [];
foreach ($options as $status => $modules) {
$key = dt("!action", ['!action' => ucwords($status)]);
$value = implode(', ', $modu... | [
"private",
"function",
"printModuleSummary",
"(",
"$",
"options",
",",
"$",
"heading",
"=",
"''",
")",
"{",
"// Print module info.",
"if",
"(",
"!",
"empty",
"(",
"$",
"options",
")",
")",
"{",
"drush_print",
"(",
"\"{$heading}\"",
")",
";",
"$",
"values",... | Print a summary of the module section.
@param array $options
The array of module information from the yaml file. | [
"Print",
"a",
"summary",
"of",
"the",
"module",
"section",
"."
] | 37608c6bda0d1ad59a99e0ea007dc164995b2669 | https://github.com/KeyboardCowboy/drush-denver/blob/37608c6bda0d1ad59a99e0ea007dc164995b2669/Denver.class.php#L256-L270 |
194,883 | KeyboardCowboy/drush-denver | Denver.class.php | Denver.printPermissionSummary | private function printPermissionSummary($options, $heading = '') {
// Print permission info.
if (!empty($options)) {
drush_print("{$heading}");
foreach ($options as $role => $perms) {
foreach ($options[$role] as &$grant) {
$grant = ($grant == 0) ? dt('revoke') : dt('grant');
... | php | private function printPermissionSummary($options, $heading = '') {
// Print permission info.
if (!empty($options)) {
drush_print("{$heading}");
foreach ($options as $role => $perms) {
foreach ($options[$role] as &$grant) {
$grant = ($grant == 0) ? dt('revoke') : dt('grant');
... | [
"private",
"function",
"printPermissionSummary",
"(",
"$",
"options",
",",
"$",
"heading",
"=",
"''",
")",
"{",
"// Print permission info.",
"if",
"(",
"!",
"empty",
"(",
"$",
"options",
")",
")",
"{",
"drush_print",
"(",
"\"{$heading}\"",
")",
";",
"foreach... | Print a summary of the permission section.
@param array $options
The array of permission information from the yaml file. | [
"Print",
"a",
"summary",
"of",
"the",
"permission",
"section",
"."
] | 37608c6bda0d1ad59a99e0ea007dc164995b2669 | https://github.com/KeyboardCowboy/drush-denver/blob/37608c6bda0d1ad59a99e0ea007dc164995b2669/Denver.class.php#L293-L307 |
194,884 | KeyboardCowboy/drush-denver | Denver.class.php | Denver.printCommandSummary | private function printCommandSummary($options, $heading = '') {
// Print command info.
if (!empty($options)) {
drush_print("{$heading}");
foreach ($options as $command => $info) {
drush_print($this->formatCommand($info), 1);
}
drush_print();
}
} | php | private function printCommandSummary($options, $heading = '') {
// Print command info.
if (!empty($options)) {
drush_print("{$heading}");
foreach ($options as $command => $info) {
drush_print($this->formatCommand($info), 1);
}
drush_print();
}
} | [
"private",
"function",
"printCommandSummary",
"(",
"$",
"options",
",",
"$",
"heading",
"=",
"''",
")",
"{",
"// Print command info.",
"if",
"(",
"!",
"empty",
"(",
"$",
"options",
")",
")",
"{",
"drush_print",
"(",
"\"{$heading}\"",
")",
";",
"foreach",
"... | Print a summary of the command section.
@param array $options
The array of command information from the yaml file. | [
"Print",
"a",
"summary",
"of",
"the",
"command",
"section",
"."
] | 37608c6bda0d1ad59a99e0ea007dc164995b2669 | https://github.com/KeyboardCowboy/drush-denver/blob/37608c6bda0d1ad59a99e0ea007dc164995b2669/Denver.class.php#L315-L325 |
194,885 | KeyboardCowboy/drush-denver | Denver.class.php | Denver.execVariables | private function execVariables(array $options) {
foreach ($options as $variable => $value) {
if ($value === '[DELETE]') {
variable_del($variable);
drush_print(dt("'@var' was deleted.", ['@var' => $variable]));
}
else {
variable_set($variable, $value);
if (is_scalar... | php | private function execVariables(array $options) {
foreach ($options as $variable => $value) {
if ($value === '[DELETE]') {
variable_del($variable);
drush_print(dt("'@var' was deleted.", ['@var' => $variable]));
}
else {
variable_set($variable, $value);
if (is_scalar... | [
"private",
"function",
"execVariables",
"(",
"array",
"$",
"options",
")",
"{",
"foreach",
"(",
"$",
"options",
"as",
"$",
"variable",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"===",
"'[DELETE]'",
")",
"{",
"variable_del",
"(",
"$",
"vari... | Set system variables.
@todo How does this work in Drupal 8?
@param array $options
The variables and their values. | [
"Set",
"system",
"variables",
"."
] | 37608c6bda0d1ad59a99e0ea007dc164995b2669 | https://github.com/KeyboardCowboy/drush-denver/blob/37608c6bda0d1ad59a99e0ea007dc164995b2669/Denver.class.php#L371-L391 |
194,886 | KeyboardCowboy/drush-denver | Denver.class.php | Denver.formatHeading | public function formatHeading($text, $line_ending = ":") {
$green = "\033[1;32;40m\033[1m%s{$line_ending}\033[0m";
$heading = sprintf($green, ucwords($text));
return $heading;
} | php | public function formatHeading($text, $line_ending = ":") {
$green = "\033[1;32;40m\033[1m%s{$line_ending}\033[0m";
$heading = sprintf($green, ucwords($text));
return $heading;
} | [
"public",
"function",
"formatHeading",
"(",
"$",
"text",
",",
"$",
"line_ending",
"=",
"\":\"",
")",
"{",
"$",
"green",
"=",
"\"\\033[1;32;40m\\033[1m%s{$line_ending}\\033[0m\"",
";",
"$",
"heading",
"=",
"sprintf",
"(",
"$",
"green",
",",
"ucwords",
"(",
"$",... | Format a nice, readable heading for the user.
@param string $text
The raw heading text.
@param string $line_ending
A string to end the heading with.
@return string
The formatted heading text. | [
"Format",
"a",
"nice",
"readable",
"heading",
"for",
"the",
"user",
"."
] | 37608c6bda0d1ad59a99e0ea007dc164995b2669 | https://github.com/KeyboardCowboy/drush-denver/blob/37608c6bda0d1ad59a99e0ea007dc164995b2669/Denver.class.php#L484-L488 |
194,887 | KeyboardCowboy/drush-denver | Denver.class.php | Denver.formatCommand | public function formatCommand($info) {
// Create the base.
$parts = ["drush"];
$parts[] = $info['alias'];
// Check for a '--yes' options and set it early for common formatting.
if (isset($info['options']['yes'])) {
$parts[] = '-y';
unset($info['options']['yes']);
}
// Add the c... | php | public function formatCommand($info) {
// Create the base.
$parts = ["drush"];
$parts[] = $info['alias'];
// Check for a '--yes' options and set it early for common formatting.
if (isset($info['options']['yes'])) {
$parts[] = '-y';
unset($info['options']['yes']);
}
// Add the c... | [
"public",
"function",
"formatCommand",
"(",
"$",
"info",
")",
"{",
"// Create the base.",
"$",
"parts",
"=",
"[",
"\"drush\"",
"]",
";",
"$",
"parts",
"[",
"]",
"=",
"$",
"info",
"[",
"'alias'",
"]",
";",
"// Check for a '--yes' options and set it early for comm... | Format a command as a single line.
@param array|null $info
The command settings.
@return string
The formatted command. | [
"Format",
"a",
"command",
"as",
"a",
"single",
"line",
"."
] | 37608c6bda0d1ad59a99e0ea007dc164995b2669 | https://github.com/KeyboardCowboy/drush-denver/blob/37608c6bda0d1ad59a99e0ea007dc164995b2669/Denver.class.php#L499-L534 |
194,888 | KeyboardCowboy/drush-denver | Denver.class.php | Denver.loadEnvironment | private function loadEnvironment($env) {
$this->exec = array_merge_recursive_distinct($this->exec, $this->environments[$env]);
$this->loadedEnvs[$env] = $this->exec['filename'];
unset($this->exec['filename']);
} | php | private function loadEnvironment($env) {
$this->exec = array_merge_recursive_distinct($this->exec, $this->environments[$env]);
$this->loadedEnvs[$env] = $this->exec['filename'];
unset($this->exec['filename']);
} | [
"private",
"function",
"loadEnvironment",
"(",
"$",
"env",
")",
"{",
"$",
"this",
"->",
"exec",
"=",
"array_merge_recursive_distinct",
"(",
"$",
"this",
"->",
"exec",
",",
"$",
"this",
"->",
"environments",
"[",
"$",
"env",
"]",
")",
";",
"$",
"this",
... | Load in an environment definition.
@param string $env
An environment name. | [
"Load",
"in",
"an",
"environment",
"definition",
"."
] | 37608c6bda0d1ad59a99e0ea007dc164995b2669 | https://github.com/KeyboardCowboy/drush-denver/blob/37608c6bda0d1ad59a99e0ea007dc164995b2669/Denver.class.php#L542-L546 |
194,889 | KeyboardCowboy/drush-denver | Denver.class.php | Denver.loadConfig | private function loadConfig() {
drush_log(dt('Loading config paths.'), 'debug');
$config_paths = [$this->getSiteDir()];
// Find directories to scan for environment config files.
// system, 'home.drush', 'drupal', 'custom'
foreach ($this->contexts as $context) {
if ($files = _drush_config_file... | php | private function loadConfig() {
drush_log(dt('Loading config paths.'), 'debug');
$config_paths = [$this->getSiteDir()];
// Find directories to scan for environment config files.
// system, 'home.drush', 'drupal', 'custom'
foreach ($this->contexts as $context) {
if ($files = _drush_config_file... | [
"private",
"function",
"loadConfig",
"(",
")",
"{",
"drush_log",
"(",
"dt",
"(",
"'Loading config paths.'",
")",
",",
"'debug'",
")",
";",
"$",
"config_paths",
"=",
"[",
"$",
"this",
"->",
"getSiteDir",
"(",
")",
"]",
";",
"// Find directories to scan for envi... | Find the config paths to search for env definitions. | [
"Find",
"the",
"config",
"paths",
"to",
"search",
"for",
"env",
"definitions",
"."
] | 37608c6bda0d1ad59a99e0ea007dc164995b2669 | https://github.com/KeyboardCowboy/drush-denver/blob/37608c6bda0d1ad59a99e0ea007dc164995b2669/Denver.class.php#L551-L576 |
194,890 | KeyboardCowboy/drush-denver | Denver.class.php | Denver.getSiteDir | public function getSiteDir() {
if (!drush_has_boostrapped(DRUSH_BOOTSTRAP_DRUPAL_SITE)) {
return FALSE;
}
// Check for aliases.
$site_name = drush_sitealias_bootstrapped_site_name();
$alias = drush_sitealias_get_record("@{$site_name}");
if (floatval(DRUSH_VERSION) > 6.2) {
$site_pa... | php | public function getSiteDir() {
if (!drush_has_boostrapped(DRUSH_BOOTSTRAP_DRUPAL_SITE)) {
return FALSE;
}
// Check for aliases.
$site_name = drush_sitealias_bootstrapped_site_name();
$alias = drush_sitealias_get_record("@{$site_name}");
if (floatval(DRUSH_VERSION) > 6.2) {
$site_pa... | [
"public",
"function",
"getSiteDir",
"(",
")",
"{",
"if",
"(",
"!",
"drush_has_boostrapped",
"(",
"DRUSH_BOOTSTRAP_DRUPAL_SITE",
")",
")",
"{",
"return",
"FALSE",
";",
"}",
"// Check for aliases.",
"$",
"site_name",
"=",
"drush_sitealias_bootstrapped_site_name",
"(",
... | Get this site's appropriate drush directory for env vars.
Optionally, the directory can be created by passing in the --make option.
@return string
The directory path. | [
"Get",
"this",
"site",
"s",
"appropriate",
"drush",
"directory",
"for",
"env",
"vars",
"."
] | 37608c6bda0d1ad59a99e0ea007dc164995b2669 | https://github.com/KeyboardCowboy/drush-denver/blob/37608c6bda0d1ad59a99e0ea007dc164995b2669/Denver.class.php#L586-L628 |
194,891 | KeyboardCowboy/drush-denver | Denver.class.php | Denver.findEnvironments | private function findEnvironments() {
drush_log(dt('Loading environment files.'), 'debug');
foreach ($this->configPaths as $path) {
drush_log(dt("Scanning !path.", ['!path' => $path]), 'debug');
foreach (drush_scan_directory($path, '/env\.drushrc\.y(a)?ml/') as $file) {
$this->loadEnvFile($... | php | private function findEnvironments() {
drush_log(dt('Loading environment files.'), 'debug');
foreach ($this->configPaths as $path) {
drush_log(dt("Scanning !path.", ['!path' => $path]), 'debug');
foreach (drush_scan_directory($path, '/env\.drushrc\.y(a)?ml/') as $file) {
$this->loadEnvFile($... | [
"private",
"function",
"findEnvironments",
"(",
")",
"{",
"drush_log",
"(",
"dt",
"(",
"'Loading environment files.'",
")",
",",
"'debug'",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"configPaths",
"as",
"$",
"path",
")",
"{",
"drush_log",
"(",
"dt",
"("... | Find and load environment definitions. | [
"Find",
"and",
"load",
"environment",
"definitions",
"."
] | 37608c6bda0d1ad59a99e0ea007dc164995b2669 | https://github.com/KeyboardCowboy/drush-denver/blob/37608c6bda0d1ad59a99e0ea007dc164995b2669/Denver.class.php#L633-L644 |
194,892 | KeyboardCowboy/drush-denver | Denver.class.php | Denver.loadEnvFile | protected function loadEnvFile($file) {
list($name, ,) = explode('.', $file->name);
$this->environments[$name] = $this->extractEnv($file->filename);
$this->environments[$name]['filename'] = $this->parseFilename($file->filename);
} | php | protected function loadEnvFile($file) {
list($name, ,) = explode('.', $file->name);
$this->environments[$name] = $this->extractEnv($file->filename);
$this->environments[$name]['filename'] = $this->parseFilename($file->filename);
} | [
"protected",
"function",
"loadEnvFile",
"(",
"$",
"file",
")",
"{",
"list",
"(",
"$",
"name",
",",
",",
")",
"=",
"explode",
"(",
"'.'",
",",
"$",
"file",
"->",
"name",
")",
";",
"$",
"this",
"->",
"environments",
"[",
"$",
"name",
"]",
"=",
"$",... | Extract the contents of an environment definition file.
@param object $file
A file object. | [
"Extract",
"the",
"contents",
"of",
"an",
"environment",
"definition",
"file",
"."
] | 37608c6bda0d1ad59a99e0ea007dc164995b2669 | https://github.com/KeyboardCowboy/drush-denver/blob/37608c6bda0d1ad59a99e0ea007dc164995b2669/Denver.class.php#L652-L656 |
194,893 | KeyboardCowboy/drush-denver | Denver.class.php | Denver.parseFilename | private function parseFilename($filename) {
if (defined('DRUPAL_ROOT') && stripos($filename, DRUPAL_ROOT) === 0) {
return substr($filename, strpos($filename, DRUPAL_ROOT) + strlen(DRUPAL_ROOT) + 1);
}
else {
return $filename;
}
} | php | private function parseFilename($filename) {
if (defined('DRUPAL_ROOT') && stripos($filename, DRUPAL_ROOT) === 0) {
return substr($filename, strpos($filename, DRUPAL_ROOT) + strlen(DRUPAL_ROOT) + 1);
}
else {
return $filename;
}
} | [
"private",
"function",
"parseFilename",
"(",
"$",
"filename",
")",
"{",
"if",
"(",
"defined",
"(",
"'DRUPAL_ROOT'",
")",
"&&",
"stripos",
"(",
"$",
"filename",
",",
"DRUPAL_ROOT",
")",
"===",
"0",
")",
"{",
"return",
"substr",
"(",
"$",
"filename",
",",
... | Resolve the proper filename for an environment file.
@param string $filename
The filename.
@return string
The resolved filename. | [
"Resolve",
"the",
"proper",
"filename",
"for",
"an",
"environment",
"file",
"."
] | 37608c6bda0d1ad59a99e0ea007dc164995b2669 | https://github.com/KeyboardCowboy/drush-denver/blob/37608c6bda0d1ad59a99e0ea007dc164995b2669/Denver.class.php#L778-L785 |
194,894 | PageBoost/hipchat-php-v2 | src/PageBoost/HipChatV2/Resources/Users.php | Users.update | public function update($name, $email, $mention_name, $timezone = 'UTC', $is_group_admin = false, $title = '', $password = null)
{
$queryParams = array(
'name' => $name,
'title' => $title,
'mention_name' => $mention_name,
'is_group_admin' => $is_group_admin,
... | php | public function update($name, $email, $mention_name, $timezone = 'UTC', $is_group_admin = false, $title = '', $password = null)
{
$queryParams = array(
'name' => $name,
'title' => $title,
'mention_name' => $mention_name,
'is_group_admin' => $is_group_admin,
... | [
"public",
"function",
"update",
"(",
"$",
"name",
",",
"$",
"email",
",",
"$",
"mention_name",
",",
"$",
"timezone",
"=",
"'UTC'",
",",
"$",
"is_group_admin",
"=",
"false",
",",
"$",
"title",
"=",
"''",
",",
"$",
"password",
"=",
"null",
")",
"{",
... | Update user
All values are required except password one which is optional!
@param string $name
@param string $email
@param string $mention_name
@param string $timezone
@param bool $is_group_admin
@param string $title
@param null $password
@return | [
"Update",
"user",
"All",
"values",
"are",
"required",
"except",
"password",
"one",
"which",
"is",
"optional!"
] | 47625e17fba273b7cc916268d972b4ca8cc48c0c | https://github.com/PageBoost/hipchat-php-v2/blob/47625e17fba273b7cc916268d972b4ca8cc48c0c/src/PageBoost/HipChatV2/Resources/Users.php#L103-L121 |
194,895 | Retentio/Boomgo | src/Boomgo/Builder/MapBuilder.php | MapBuilder.buildMap | protected function buildMap(array $metadata)
{
$className = $this->getMapClassName();
$map = new $className($metadata['class']);
foreach ($metadata['definitions'] as $metadataDefinition) {
$definition = $this->buildDefinition($metadataDefinition);
$map->addDefinition... | php | protected function buildMap(array $metadata)
{
$className = $this->getMapClassName();
$map = new $className($metadata['class']);
foreach ($metadata['definitions'] as $metadataDefinition) {
$definition = $this->buildDefinition($metadataDefinition);
$map->addDefinition... | [
"protected",
"function",
"buildMap",
"(",
"array",
"$",
"metadata",
")",
"{",
"$",
"className",
"=",
"$",
"this",
"->",
"getMapClassName",
"(",
")",
";",
"$",
"map",
"=",
"new",
"$",
"className",
"(",
"$",
"metadata",
"[",
"'class'",
"]",
")",
";",
"... | Build a Map
@param array $metadata
@return Map | [
"Build",
"a",
"Map"
] | 95cc53777425dd76cd0034046fa4f9e72c04d73a | https://github.com/Retentio/Boomgo/blob/95cc53777425dd76cd0034046fa4f9e72c04d73a/src/Boomgo/Builder/MapBuilder.php#L172-L183 |
194,896 | Retentio/Boomgo | src/Boomgo/Builder/MapBuilder.php | MapBuilder.buildDefinition | protected function buildDefinition(array $metadata)
{
if (!isset($metadata['attribute']) && !isset($metadata['key'])) {
throw new \RuntimeException('Invalid metadata should provide an attribute or a key');
}
// @TODO Rethink this hacky method cause I hate annotation ?
if... | php | protected function buildDefinition(array $metadata)
{
if (!isset($metadata['attribute']) && !isset($metadata['key'])) {
throw new \RuntimeException('Invalid metadata should provide an attribute or a key');
}
// @TODO Rethink this hacky method cause I hate annotation ?
if... | [
"protected",
"function",
"buildDefinition",
"(",
"array",
"$",
"metadata",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"metadata",
"[",
"'attribute'",
"]",
")",
"&&",
"!",
"isset",
"(",
"$",
"metadata",
"[",
"'key'",
"]",
")",
")",
"{",
"throw",
"ne... | Build a Definition
@param array $metadata
@return Definition | [
"Build",
"a",
"Definition"
] | 95cc53777425dd76cd0034046fa4f9e72c04d73a | https://github.com/Retentio/Boomgo/blob/95cc53777425dd76cd0034046fa4f9e72c04d73a/src/Boomgo/Builder/MapBuilder.php#L192-L212 |
194,897 | eureka-framework/component-cache | src/Cache/CacheWrapperFile.php | CacheWrapperFile.clearExpired | protected function clearExpired()
{
if (empty($this->cache)) {
$file = $this->directory . 'Cache.dat';
//~ Retrieve Cache information.
if (file_exists($file)) {
$content = file_get_contents($file);
if (!empty($content)) {
... | php | protected function clearExpired()
{
if (empty($this->cache)) {
$file = $this->directory . 'Cache.dat';
//~ Retrieve Cache information.
if (file_exists($file)) {
$content = file_get_contents($file);
if (!empty($content)) {
... | [
"protected",
"function",
"clearExpired",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"cache",
")",
")",
"{",
"$",
"file",
"=",
"$",
"this",
"->",
"directory",
".",
"'Cache.dat'",
";",
"//~ Retrieve Cache information.",
"if",
"(",
"file_exist... | Clean Cache have expired.
@return boolean | [
"Clean",
"Cache",
"have",
"expired",
"."
] | c110441ac7bb20edd2ecd8162f4302596d875785 | https://github.com/eureka-framework/component-cache/blob/c110441ac7bb20edd2ecd8162f4302596d875785/src/Cache/CacheWrapperFile.php#L63-L87 |
194,898 | eureka-framework/component-cache | src/Cache/CacheWrapperFile.php | CacheWrapperFile.get | public function get($key)
{
if (!$this->has($key)) {
return null;
}
$file = $this->directory . substr(md5($this->prefix() . $key), 0, 10) . '.dat';
return unserialize(file_get_contents($file));
} | php | public function get($key)
{
if (!$this->has($key)) {
return null;
}
$file = $this->directory . substr(md5($this->prefix() . $key), 0, 10) . '.dat';
return unserialize(file_get_contents($file));
} | [
"public",
"function",
"get",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"has",
"(",
"$",
"key",
")",
")",
"{",
"return",
"null",
";",
"}",
"$",
"file",
"=",
"$",
"this",
"->",
"directory",
".",
"substr",
"(",
"md5",
"(",
"$... | Gets a value in the Cache for the specified key.
@param string $key The key name
@return mixed Cache content (null if the key does not exist). | [
"Gets",
"a",
"value",
"in",
"the",
"Cache",
"for",
"the",
"specified",
"key",
"."
] | c110441ac7bb20edd2ecd8162f4302596d875785 | https://github.com/eureka-framework/component-cache/blob/c110441ac7bb20edd2ecd8162f4302596d875785/src/Cache/CacheWrapperFile.php#L95-L104 |
194,899 | eureka-framework/component-cache | src/Cache/CacheWrapperFile.php | CacheWrapperFile.set | public function set($key, $value, $lifeTime = 900)
{
//~ Check if enabled
if (!$this->isEnabled()) {
return false;
}
//~ Clear expired Cache files
$this->clearExpired();
$pKey = $this->prefix() . $key;
$file = $this->directory . substr(md5($pKey)... | php | public function set($key, $value, $lifeTime = 900)
{
//~ Check if enabled
if (!$this->isEnabled()) {
return false;
}
//~ Clear expired Cache files
$this->clearExpired();
$pKey = $this->prefix() . $key;
$file = $this->directory . substr(md5($pKey)... | [
"public",
"function",
"set",
"(",
"$",
"key",
",",
"$",
"value",
",",
"$",
"lifeTime",
"=",
"900",
")",
"{",
"//~ Check if enabled",
"if",
"(",
"!",
"$",
"this",
"->",
"isEnabled",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"//~ Clear expired Cac... | Sets a value in the Cache for the specified key.
@param string $key The key name
@param mixed $value The content to put in Cache
@param integer $lifeTime Time to keep the content in Cache in seconds
@return boolean | [
"Sets",
"a",
"value",
"in",
"the",
"Cache",
"for",
"the",
"specified",
"key",
"."
] | c110441ac7bb20edd2ecd8162f4302596d875785 | https://github.com/eureka-framework/component-cache/blob/c110441ac7bb20edd2ecd8162f4302596d875785/src/Cache/CacheWrapperFile.php#L171-L191 |
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.