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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
189,800 | dudapiotr/ZfTable | src/ZfTable/Header.php | Header.render | public function render()
{
$this->initRendering();
$render = $this->getTitle();
foreach ($this->decorators as $decorator) {
$render = $decorator->render($render);
}
return sprintf('<th %s >%s</th>', $this->getAttributes(), $render);
} | php | public function render()
{
$this->initRendering();
$render = $this->getTitle();
foreach ($this->decorators as $decorator) {
$render = $decorator->render($render);
}
return sprintf('<th %s >%s</th>', $this->getAttributes(), $render);
} | [
"public",
"function",
"render",
"(",
")",
"{",
"$",
"this",
"->",
"initRendering",
"(",
")",
";",
"$",
"render",
"=",
"$",
"this",
"->",
"getTitle",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"decorators",
"as",
"$",
"decorator",
")",
"{",
"... | Rendering header element
@return string | [
"Rendering",
"header",
"element"
] | 8c7750c10d16137208d055345ca81c7d845e59d2 | https://github.com/dudapiotr/ZfTable/blob/8c7750c10d16137208d055345ca81c7d845e59d2/src/ZfTable/Header.php#L347-L356 |
189,801 | joomla/joomla-framework | src/Joomla/Form/Form.php | Form.filter | public function filter($data, $group = null)
{
// Make sure there is a valid Form XML document.
if (!($this->xml instanceof \SimpleXMLElement))
{
return false;
}
$input = new Registry($data);
$output = new Registry;
// Get the fields for which to filter the data.
$fields = $this->findFieldsByGroup... | php | public function filter($data, $group = null)
{
// Make sure there is a valid Form XML document.
if (!($this->xml instanceof \SimpleXMLElement))
{
return false;
}
$input = new Registry($data);
$output = new Registry;
// Get the fields for which to filter the data.
$fields = $this->findFieldsByGroup... | [
"public",
"function",
"filter",
"(",
"$",
"data",
",",
"$",
"group",
"=",
"null",
")",
"{",
"// Make sure there is a valid Form XML document.",
"if",
"(",
"!",
"(",
"$",
"this",
"->",
"xml",
"instanceof",
"\\",
"SimpleXMLElement",
")",
")",
"{",
"return",
"f... | Method to filter the form data.
@param array $data An array of field values to filter.
@param string $group The dot-separated form group path on which to filter the fields.
@return mixed Array or false.
@since 1.0 | [
"Method",
"to",
"filter",
"the",
"form",
"data",
"."
] | 7f2f8e43c44a93f908aef8abd5ff5d9cfdf0f9d7 | https://github.com/joomla/joomla-framework/blob/7f2f8e43c44a93f908aef8abd5ff5d9cfdf0f9d7/src/Joomla/Form/Form.php#L192-L242 |
189,802 | joomla/joomla-framework | src/Joomla/Form/Form.php | Form.getField | public function getField($name, $group = null, $value = null)
{
// Make sure there is a valid Form XML document.
if (!($this->xml instanceof \SimpleXMLElement))
{
return false;
}
// Attempt to find the field by name and group.
$element = $this->findField($name, $group);
// If the field element was n... | php | public function getField($name, $group = null, $value = null)
{
// Make sure there is a valid Form XML document.
if (!($this->xml instanceof \SimpleXMLElement))
{
return false;
}
// Attempt to find the field by name and group.
$element = $this->findField($name, $group);
// If the field element was n... | [
"public",
"function",
"getField",
"(",
"$",
"name",
",",
"$",
"group",
"=",
"null",
",",
"$",
"value",
"=",
"null",
")",
"{",
"// Make sure there is a valid Form XML document.",
"if",
"(",
"!",
"(",
"$",
"this",
"->",
"xml",
"instanceof",
"\\",
"SimpleXMLEle... | Method to get a form field represented as a Field object.
@param string $name The name of the form field.
@param string $group The optional dot-separated form group path on which to find the field.
@param mixed $value The optional value to use as the default for the field.
@return mixed The Field obje... | [
"Method",
"to",
"get",
"a",
"form",
"field",
"represented",
"as",
"a",
"Field",
"object",
"."
] | 7f2f8e43c44a93f908aef8abd5ff5d9cfdf0f9d7 | https://github.com/joomla/joomla-framework/blob/7f2f8e43c44a93f908aef8abd5ff5d9cfdf0f9d7/src/Joomla/Form/Form.php#L267-L285 |
189,803 | joomla/joomla-framework | src/Joomla/Form/Form.php | Form.getFieldsets | public function getFieldsets($group = null)
{
$fieldsets = array();
$sets = array();
// Make sure there is a valid Form XML document.
if (!($this->xml instanceof \SimpleXMLElement))
{
return $fieldsets;
}
if ($group)
{
// Get the fields elements for a given group.
$elements = &$this->findGro... | php | public function getFieldsets($group = null)
{
$fieldsets = array();
$sets = array();
// Make sure there is a valid Form XML document.
if (!($this->xml instanceof \SimpleXMLElement))
{
return $fieldsets;
}
if ($group)
{
// Get the fields elements for a given group.
$elements = &$this->findGro... | [
"public",
"function",
"getFieldsets",
"(",
"$",
"group",
"=",
"null",
")",
"{",
"$",
"fieldsets",
"=",
"array",
"(",
")",
";",
"$",
"sets",
"=",
"array",
"(",
")",
";",
"// Make sure there is a valid Form XML document.",
"if",
"(",
"!",
"(",
"$",
"this",
... | Method to get an array of fieldset objects optionally filtered over a given field group.
@param string $group The dot-separated form group path on which to filter the fieldsets.
@return array The array of fieldset objects.
@since 1.0 | [
"Method",
"to",
"get",
"an",
"array",
"of",
"fieldset",
"objects",
"optionally",
"filtered",
"over",
"a",
"given",
"field",
"group",
"."
] | 7f2f8e43c44a93f908aef8abd5ff5d9cfdf0f9d7 | https://github.com/joomla/joomla-framework/blob/7f2f8e43c44a93f908aef8abd5ff5d9cfdf0f9d7/src/Joomla/Form/Form.php#L382-L472 |
189,804 | joomla/joomla-framework | src/Joomla/Form/Form.php | Form.load | public function load($data, $replace = true, $xpath = false)
{
// If the data to load isn't already an XML element or string return false.
if ((!($data instanceof \SimpleXMLElement)) && (!is_string($data)))
{
return false;
}
// Attempt to load the XML if a string.
if (is_string($data))
{
try
{
... | php | public function load($data, $replace = true, $xpath = false)
{
// If the data to load isn't already an XML element or string return false.
if ((!($data instanceof \SimpleXMLElement)) && (!is_string($data)))
{
return false;
}
// Attempt to load the XML if a string.
if (is_string($data))
{
try
{
... | [
"public",
"function",
"load",
"(",
"$",
"data",
",",
"$",
"replace",
"=",
"true",
",",
"$",
"xpath",
"=",
"false",
")",
"{",
"// If the data to load isn't already an XML element or string return false.",
"if",
"(",
"(",
"!",
"(",
"$",
"data",
"instanceof",
"\\",... | Method to load the form description from an XML string or object.
The replace option works per field. If a field being loaded already exists in the current
form definition then the behavior or load will vary depending upon the replace flag. If it
is set to true, then the existing field will be replaced in its exact ... | [
"Method",
"to",
"load",
"the",
"form",
"description",
"from",
"an",
"XML",
"string",
"or",
"object",
"."
] | 7f2f8e43c44a93f908aef8abd5ff5d9cfdf0f9d7 | https://github.com/joomla/joomla-framework/blob/7f2f8e43c44a93f908aef8abd5ff5d9cfdf0f9d7/src/Joomla/Form/Form.php#L631-L735 |
189,805 | joomla/joomla-framework | src/Joomla/Form/Form.php | Form.addNode | protected static function addNode(\SimpleXMLElement $source, \SimpleXMLElement $new)
{
// Add the new child node.
$node = $source->addChild($new->getName(), trim($new));
// Add the attributes of the child node.
foreach ($new->attributes() as $name => $value)
{
$node->addAttribute($name, $value);
}
/... | php | protected static function addNode(\SimpleXMLElement $source, \SimpleXMLElement $new)
{
// Add the new child node.
$node = $source->addChild($new->getName(), trim($new));
// Add the attributes of the child node.
foreach ($new->attributes() as $name => $value)
{
$node->addAttribute($name, $value);
}
/... | [
"protected",
"static",
"function",
"addNode",
"(",
"\\",
"SimpleXMLElement",
"$",
"source",
",",
"\\",
"SimpleXMLElement",
"$",
"new",
")",
"{",
"// Add the new child node.",
"$",
"node",
"=",
"$",
"source",
"->",
"addChild",
"(",
"$",
"new",
"->",
"getName",
... | Adds a new child SimpleXMLElement node to the source.
@param \SimpleXMLElement $source The source element on which to append.
@param \SimpleXMLElement $new The new element to append.
@return void
@since 1.0 | [
"Adds",
"a",
"new",
"child",
"SimpleXMLElement",
"node",
"to",
"the",
"source",
"."
] | 7f2f8e43c44a93f908aef8abd5ff5d9cfdf0f9d7 | https://github.com/joomla/joomla-framework/blob/7f2f8e43c44a93f908aef8abd5ff5d9cfdf0f9d7/src/Joomla/Form/Form.php#L1881-L1897 |
189,806 | joomla/joomla-framework | src/Joomla/Form/Form.php | Form.mergeNode | protected static function mergeNode(\SimpleXMLElement $source, \SimpleXMLElement $new)
{
// Update the attributes of the child node.
foreach ($new->attributes() as $name => $value)
{
if (isset($source[$name]))
{
$source[$name] = (string) $value;
}
else
{
$source->addAttribute($name, $value... | php | protected static function mergeNode(\SimpleXMLElement $source, \SimpleXMLElement $new)
{
// Update the attributes of the child node.
foreach ($new->attributes() as $name => $value)
{
if (isset($source[$name]))
{
$source[$name] = (string) $value;
}
else
{
$source->addAttribute($name, $value... | [
"protected",
"static",
"function",
"mergeNode",
"(",
"\\",
"SimpleXMLElement",
"$",
"source",
",",
"\\",
"SimpleXMLElement",
"$",
"new",
")",
"{",
"// Update the attributes of the child node.",
"foreach",
"(",
"$",
"new",
"->",
"attributes",
"(",
")",
"as",
"$",
... | Update the attributes of a child node
@param \SimpleXMLElement $source The source element on which to append the attributes
@param \SimpleXMLElement $new The new element to append
@return void
@since 1.0 | [
"Update",
"the",
"attributes",
"of",
"a",
"child",
"node"
] | 7f2f8e43c44a93f908aef8abd5ff5d9cfdf0f9d7 | https://github.com/joomla/joomla-framework/blob/7f2f8e43c44a93f908aef8abd5ff5d9cfdf0f9d7/src/Joomla/Form/Form.php#L1909-L1923 |
189,807 | joomla/joomla-framework | src/Joomla/Github/Package/Repositories/Collaborators.php | Collaborators.get | public function get($owner, $repo, $user)
{
// Build the request path.
$path = '/repos/' . $owner . '/' . $repo . '/collaborators/' . $user;
$response = $this->client->get($this->fetchUrl($path));
switch ($response->code)
{
case '204';
return true;
break;
case '404';
return false;
b... | php | public function get($owner, $repo, $user)
{
// Build the request path.
$path = '/repos/' . $owner . '/' . $repo . '/collaborators/' . $user;
$response = $this->client->get($this->fetchUrl($path));
switch ($response->code)
{
case '204';
return true;
break;
case '404';
return false;
b... | [
"public",
"function",
"get",
"(",
"$",
"owner",
",",
"$",
"repo",
",",
"$",
"user",
")",
"{",
"// Build the request path.",
"$",
"path",
"=",
"'/repos/'",
".",
"$",
"owner",
".",
"'/'",
".",
"$",
"repo",
".",
"'/collaborators/'",
".",
"$",
"user",
";",... | Test if a user is a collaborator.
@param string $owner The name of the owner of the GitHub repository.
@param string $repo The name of the GitHub repository.
@param string $user The name of the GitHub user.
@throws \UnexpectedValueException
@since 1.0
@return boolean | [
"Test",
"if",
"a",
"user",
"is",
"a",
"collaborator",
"."
] | 7f2f8e43c44a93f908aef8abd5ff5d9cfdf0f9d7 | https://github.com/joomla/joomla-framework/blob/7f2f8e43c44a93f908aef8abd5ff5d9cfdf0f9d7/src/Joomla/Github/Package/Repositories/Collaborators.php#L58-L79 |
189,808 | joomla/joomla-framework | src/Joomla/Github/Package/Repositories/Collaborators.php | Collaborators.add | public function add($owner, $repo, $user)
{
// Build the request path.
$path = '/repos/' . $owner . '/' . $repo . '/collaborators/' . $user;
return $this->processResponse(
$this->client->put($this->fetchUrl($path), ''),
204
);
} | php | public function add($owner, $repo, $user)
{
// Build the request path.
$path = '/repos/' . $owner . '/' . $repo . '/collaborators/' . $user;
return $this->processResponse(
$this->client->put($this->fetchUrl($path), ''),
204
);
} | [
"public",
"function",
"add",
"(",
"$",
"owner",
",",
"$",
"repo",
",",
"$",
"user",
")",
"{",
"// Build the request path.",
"$",
"path",
"=",
"'/repos/'",
".",
"$",
"owner",
".",
"'/'",
".",
"$",
"repo",
".",
"'/collaborators/'",
".",
"$",
"user",
";",... | Add collaborator.
@param string $owner The name of the owner of the GitHub repository.
@param string $repo The name of the GitHub repository.
@param string $user The name of the GitHub user.
@since 1.0
@return object | [
"Add",
"collaborator",
"."
] | 7f2f8e43c44a93f908aef8abd5ff5d9cfdf0f9d7 | https://github.com/joomla/joomla-framework/blob/7f2f8e43c44a93f908aef8abd5ff5d9cfdf0f9d7/src/Joomla/Github/Package/Repositories/Collaborators.php#L92-L101 |
189,809 | unicodeveloper/mvrd | src/Mvrd.php | Mvrd.getData | public function getData()
{
$this->performGetRequest('/search.php?vpn=' . $this->plateNumber);
$html = (string) $this->response->getBody();
$crawler = new Crawler($html);
$rawVehicleData = [];
$nodeValues = $crawler->filter('table > tbody > tr')->each( function( $node, $i)... | php | public function getData()
{
$this->performGetRequest('/search.php?vpn=' . $this->plateNumber);
$html = (string) $this->response->getBody();
$crawler = new Crawler($html);
$rawVehicleData = [];
$nodeValues = $crawler->filter('table > tbody > tr')->each( function( $node, $i)... | [
"public",
"function",
"getData",
"(",
")",
"{",
"$",
"this",
"->",
"performGetRequest",
"(",
"'/search.php?vpn='",
".",
"$",
"this",
"->",
"plateNumber",
")",
";",
"$",
"html",
"=",
"(",
"string",
")",
"$",
"this",
"->",
"response",
"->",
"getBody",
"(",... | Get Raw Data
@param none
@return array | [
"Get",
"Raw",
"Data"
] | b490144e30f8ff68a5573f4e40237a80e5150a23 | https://github.com/unicodeveloper/mvrd/blob/b490144e30f8ff68a5573f4e40237a80e5150a23/src/Mvrd.php#L76-L102 |
189,810 | unicodeveloper/mvrd | src/Mvrd.php | Mvrd.processData | public function processData($data)
{
// Prepare data to be stored as key=>value pairs
$string = explode(' ', $data, 3);
// Use the number of spaces in the string as a requisite to determine how to handle them.
// e.g Color field(1 space) contains l... | php | public function processData($data)
{
// Prepare data to be stored as key=>value pairs
$string = explode(' ', $data, 3);
// Use the number of spaces in the string as a requisite to determine how to handle them.
// e.g Color field(1 space) contains l... | [
"public",
"function",
"processData",
"(",
"$",
"data",
")",
"{",
"// Prepare data to be stored as key=>value pairs",
"$",
"string",
"=",
"explode",
"(",
"' '",
",",
"$",
"data",
",",
"3",
")",
";",
"// Use the number of spaces in the string as a requisite to determine how... | Process vehicle data to make it possible to store them as key-value pairs in an array.
@param $data (string to be processed)
@return array | [
"Process",
"vehicle",
"data",
"to",
"make",
"it",
"possible",
"to",
"store",
"them",
"as",
"key",
"-",
"value",
"pairs",
"in",
"an",
"array",
"."
] | b490144e30f8ff68a5573f4e40237a80e5150a23 | https://github.com/unicodeveloper/mvrd/blob/b490144e30f8ff68a5573f4e40237a80e5150a23/src/Mvrd.php#L110-L137 |
189,811 | XiaoLer/blade | src/Concerns/ManagesLayouts.php | ManagesLayouts.getSection | public function getSection($name, $default = null)
{
return isset($this->getSections()[$name]) ? $this->getSections()[$name] : $default;
} | php | public function getSection($name, $default = null)
{
return isset($this->getSections()[$name]) ? $this->getSections()[$name] : $default;
} | [
"public",
"function",
"getSection",
"(",
"$",
"name",
",",
"$",
"default",
"=",
"null",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"getSections",
"(",
")",
"[",
"$",
"name",
"]",
")",
"?",
"$",
"this",
"->",
"getSections",
"(",
")",
"[",
... | Get the contents of a section.
@param string $name
@param string $default
@return mixed | [
"Get",
"the",
"contents",
"of",
"a",
"section",
"."
] | b3a71e2e589e31956209e7f3d5ce6f9473e63a45 | https://github.com/XiaoLer/blade/blob/b3a71e2e589e31956209e7f3d5ce6f9473e63a45/src/Concerns/ManagesLayouts.php#L192-L195 |
189,812 | demisang/yii2-image-uploader | ImageUploaderBehavior.php | ImageUploaderBehavior.deleteImage | public function deleteImage($updateDb = false)
{
$owner = $this->owner;
$DS = DIRECTORY_SEPARATOR;
$image = str_replace('/', $DS, $this->_oldImage);
if (!empty($image)) {
$dirName = Yii::getAlias($this->_savePathAlias);
// Remove all resized images
... | php | public function deleteImage($updateDb = false)
{
$owner = $this->owner;
$DS = DIRECTORY_SEPARATOR;
$image = str_replace('/', $DS, $this->_oldImage);
if (!empty($image)) {
$dirName = Yii::getAlias($this->_savePathAlias);
// Remove all resized images
... | [
"public",
"function",
"deleteImage",
"(",
"$",
"updateDb",
"=",
"false",
")",
"{",
"$",
"owner",
"=",
"$",
"this",
"->",
"owner",
";",
"$",
"DS",
"=",
"DIRECTORY_SEPARATOR",
";",
"$",
"image",
"=",
"str_replace",
"(",
"'/'",
",",
"$",
"DS",
",",
"$",... | Delete image file and set|save model image field to null
@param bool $updateDb need to update image field in DB | [
"Delete",
"image",
"file",
"and",
"set|save",
"model",
"image",
"field",
"to",
"null"
] | f25d23041eabe3277e9f9ad927abe40c2fca1417 | https://github.com/demisang/yii2-image-uploader/blob/f25d23041eabe3277e9f9ad927abe40c2fca1417/ImageUploaderBehavior.php#L243-L268 |
189,813 | demisang/yii2-image-uploader | ImageUploaderBehavior.php | ImageUploaderBehavior.getImageSizes | protected function getImageSizes()
{
if (is_callable($this->_imageSizes)) {
return call_user_func($this->_imageSizes, $this->owner);
} else {
return $this->_imageSizes;
}
} | php | protected function getImageSizes()
{
if (is_callable($this->_imageSizes)) {
return call_user_func($this->_imageSizes, $this->owner);
} else {
return $this->_imageSizes;
}
} | [
"protected",
"function",
"getImageSizes",
"(",
")",
"{",
"if",
"(",
"is_callable",
"(",
"$",
"this",
"->",
"_imageSizes",
")",
")",
"{",
"return",
"call_user_func",
"(",
"$",
"this",
"->",
"_imageSizes",
",",
"$",
"this",
"->",
"owner",
")",
";",
"}",
... | Get image sizes
@return array | [
"Get",
"image",
"sizes"
] | f25d23041eabe3277e9f9ad927abe40c2fca1417 | https://github.com/demisang/yii2-image-uploader/blob/f25d23041eabe3277e9f9ad927abe40c2fca1417/ImageUploaderBehavior.php#L275-L282 |
189,814 | demisang/yii2-image-uploader | ImageUploaderBehavior.php | ImageUploaderBehavior.uploadImage | protected function uploadImage(UploadedFile $image)
{
$DS = DIRECTORY_SEPARATOR;
// Max width for uploaded original image
$maxWidth = 1500;
$namePart = uniqid();
$name = $namePart . '.' . $image->extension; // New filename
$imageFolder = Yii::getAlias($this->_savePath... | php | protected function uploadImage(UploadedFile $image)
{
$DS = DIRECTORY_SEPARATOR;
// Max width for uploaded original image
$maxWidth = 1500;
$namePart = uniqid();
$name = $namePart . '.' . $image->extension; // New filename
$imageFolder = Yii::getAlias($this->_savePath... | [
"protected",
"function",
"uploadImage",
"(",
"UploadedFile",
"$",
"image",
")",
"{",
"$",
"DS",
"=",
"DIRECTORY_SEPARATOR",
";",
"// Max width for uploaded original image",
"$",
"maxWidth",
"=",
"1500",
";",
"$",
"namePart",
"=",
"uniqid",
"(",
")",
";",
"$",
... | Save uploaded image
@param UploadedFile $image
@return string Image field value or NULL if error | [
"Save",
"uploaded",
"image"
] | f25d23041eabe3277e9f9ad927abe40c2fca1417 | https://github.com/demisang/yii2-image-uploader/blob/f25d23041eabe3277e9f9ad927abe40c2fca1417/ImageUploaderBehavior.php#L291-L363 |
189,815 | demisang/yii2-image-uploader | ImageUploaderBehavior.php | ImageUploaderBehavior.getImageSrc | public function getImageSrc($size = null)
{
$owner = $this->owner;
$prefix = '';
if (Yii::$app->request instanceof \yii\web\Request) {
$prefix = Yii::$app->request->baseUrl;
$host = Yii::$app->request->hostInfo;
// If current application is backend - retu... | php | public function getImageSrc($size = null)
{
$owner = $this->owner;
$prefix = '';
if (Yii::$app->request instanceof \yii\web\Request) {
$prefix = Yii::$app->request->baseUrl;
$host = Yii::$app->request->hostInfo;
// If current application is backend - retu... | [
"public",
"function",
"getImageSrc",
"(",
"$",
"size",
"=",
"null",
")",
"{",
"$",
"owner",
"=",
"$",
"this",
"->",
"owner",
";",
"$",
"prefix",
"=",
"''",
";",
"if",
"(",
"Yii",
"::",
"$",
"app",
"->",
"request",
"instanceof",
"\\",
"yii",
"\\",
... | Return image path for web
@param string $size Size prefix
@return string Image src path, can be value for Html::image() | [
"Return",
"image",
"path",
"for",
"web"
] | f25d23041eabe3277e9f9ad927abe40c2fca1417 | https://github.com/demisang/yii2-image-uploader/blob/f25d23041eabe3277e9f9ad927abe40c2fca1417/ImageUploaderBehavior.php#L421-L458 |
189,816 | demisang/yii2-image-uploader | ImageUploaderBehavior.php | ImageUploaderBehavior.resizeAndSave | public static function resizeAndSave($dir, $fileName, $resizeWidth)
{
$DS = DIRECTORY_SEPARATOR;
// Full original image path
$fullPath = $dir . $DS . $fileName;
if (!@file_exists($fullPath)) {
// if original file doesn't exists - breack
return false;
... | php | public static function resizeAndSave($dir, $fileName, $resizeWidth)
{
$DS = DIRECTORY_SEPARATOR;
// Full original image path
$fullPath = $dir . $DS . $fileName;
if (!@file_exists($fullPath)) {
// if original file doesn't exists - breack
return false;
... | [
"public",
"static",
"function",
"resizeAndSave",
"(",
"$",
"dir",
",",
"$",
"fileName",
",",
"$",
"resizeWidth",
")",
"{",
"$",
"DS",
"=",
"DIRECTORY_SEPARATOR",
";",
"// Full original image path",
"$",
"fullPath",
"=",
"$",
"dir",
".",
"$",
"DS",
".",
"$"... | Make resized images
@param string $dir Random directory path
@param string $fileName Primary filename
@param mixed $resizeWidth integer(wide): one resize - rewrite primary file.<br />
array: resize for each item.<br />
array format:
<pre>
array('prefix1'=>sizeWidth1, 'prefix2'=>sizeWidth2)
</pre>
@return boo... | [
"Make",
"resized",
"images"
] | f25d23041eabe3277e9f9ad927abe40c2fca1417 | https://github.com/demisang/yii2-image-uploader/blob/f25d23041eabe3277e9f9ad927abe40c2fca1417/ImageUploaderBehavior.php#L510-L540 |
189,817 | demisang/yii2-image-uploader | ImageUploaderBehavior.php | ImageUploaderBehavior.getImageComponent | public static function getImageComponent()
{
// Get image component
if (is_object(static::$_imageComponent)) {
$imageComponent = static::$_imageComponent;
} else {
$imageComponent = Yii::createObject([
'class' => 'yii\image\ImageDriver',
])... | php | public static function getImageComponent()
{
// Get image component
if (is_object(static::$_imageComponent)) {
$imageComponent = static::$_imageComponent;
} else {
$imageComponent = Yii::createObject([
'class' => 'yii\image\ImageDriver',
])... | [
"public",
"static",
"function",
"getImageComponent",
"(",
")",
"{",
"// Get image component",
"if",
"(",
"is_object",
"(",
"static",
"::",
"$",
"_imageComponent",
")",
")",
"{",
"$",
"imageComponent",
"=",
"static",
"::",
"$",
"_imageComponent",
";",
"}",
"els... | Get image component
@return \yii\image\ImageDriver | [
"Get",
"image",
"component"
] | f25d23041eabe3277e9f9ad927abe40c2fca1417 | https://github.com/demisang/yii2-image-uploader/blob/f25d23041eabe3277e9f9ad927abe40c2fca1417/ImageUploaderBehavior.php#L547-L561 |
189,818 | demisang/yii2-image-uploader | ImageUploaderBehavior.php | ImageUploaderBehavior.getOriginalImagePath | public function getOriginalImagePath()
{
$savePath = Yii::getAlias($this->_savePathAlias);
$image = $this->_oldImage;
return static::addPostfixToFile($savePath . DIRECTORY_SEPARATOR . $image, '_original');
} | php | public function getOriginalImagePath()
{
$savePath = Yii::getAlias($this->_savePathAlias);
$image = $this->_oldImage;
return static::addPostfixToFile($savePath . DIRECTORY_SEPARATOR . $image, '_original');
} | [
"public",
"function",
"getOriginalImagePath",
"(",
")",
"{",
"$",
"savePath",
"=",
"Yii",
"::",
"getAlias",
"(",
"$",
"this",
"->",
"_savePathAlias",
")",
";",
"$",
"image",
"=",
"$",
"this",
"->",
"_oldImage",
";",
"return",
"static",
"::",
"addPostfixToF... | Return server path to original image src
@return string | [
"Return",
"server",
"path",
"to",
"original",
"image",
"src"
] | f25d23041eabe3277e9f9ad927abe40c2fca1417 | https://github.com/demisang/yii2-image-uploader/blob/f25d23041eabe3277e9f9ad927abe40c2fca1417/ImageUploaderBehavior.php#L590-L596 |
189,819 | demisang/yii2-image-uploader | ImageUploaderBehavior.php | ImageUploaderBehavior.cropImage | public function cropImage($x, $y, $width, $height, $rotate)
{
$DS = DIRECTORY_SEPARATOR;
$savePath = Yii::getAlias($this->_savePathAlias);
$imageSrc = $this->owner->{$this->_imageAttribute};
$fullImagePath = $savePath . $DS . $imageSrc;
$imageComponent = static::getImageComp... | php | public function cropImage($x, $y, $width, $height, $rotate)
{
$DS = DIRECTORY_SEPARATOR;
$savePath = Yii::getAlias($this->_savePathAlias);
$imageSrc = $this->owner->{$this->_imageAttribute};
$fullImagePath = $savePath . $DS . $imageSrc;
$imageComponent = static::getImageComp... | [
"public",
"function",
"cropImage",
"(",
"$",
"x",
",",
"$",
"y",
",",
"$",
"width",
",",
"$",
"height",
",",
"$",
"rotate",
")",
"{",
"$",
"DS",
"=",
"DIRECTORY_SEPARATOR",
";",
"$",
"savePath",
"=",
"Yii",
"::",
"getAlias",
"(",
"$",
"this",
"->",... | Crop original image and resave resized images
@param int $x
@param int $y
@param int $width
@param int $height
@param int $rotate
@return bool | [
"Crop",
"original",
"image",
"and",
"resave",
"resized",
"images"
] | f25d23041eabe3277e9f9ad927abe40c2fca1417 | https://github.com/demisang/yii2-image-uploader/blob/f25d23041eabe3277e9f9ad927abe40c2fca1417/ImageUploaderBehavior.php#L609-L633 |
189,820 | loic-sharma/profiler | src/Profiler/Profiler.php | Profiler.startTimer | public function startTimer($timer, $startTime = null)
{
$this->timers[$timer] = new Timer($startTime);
return $this;
} | php | public function startTimer($timer, $startTime = null)
{
$this->timers[$timer] = new Timer($startTime);
return $this;
} | [
"public",
"function",
"startTimer",
"(",
"$",
"timer",
",",
"$",
"startTime",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"timers",
"[",
"$",
"timer",
"]",
"=",
"new",
"Timer",
"(",
"$",
"startTime",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Start a timer.
@param string $timer
@param mixed $startTime
@return \Profiler\Profiler | [
"Start",
"a",
"timer",
"."
] | 956e1e1fdb788ebdfcd9d9765ea56d39043c6a7c | https://github.com/loic-sharma/profiler/blob/956e1e1fdb788ebdfcd9d9765ea56d39043c6a7c/src/Profiler/Profiler.php#L100-L105 |
189,821 | loic-sharma/profiler | src/Profiler/Profiler.php | Profiler.endTimer | public function endTimer($timer, $endTime = null)
{
$this->timers[$timer]->end($endTime);
return $this;
} | php | public function endTimer($timer, $endTime = null)
{
$this->timers[$timer]->end($endTime);
return $this;
} | [
"public",
"function",
"endTimer",
"(",
"$",
"timer",
",",
"$",
"endTime",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"timers",
"[",
"$",
"timer",
"]",
"->",
"end",
"(",
"$",
"endTime",
")",
";",
"return",
"$",
"this",
";",
"}"
] | End a timer.
@param string $timer
@param mixed $endTime
@return \Profiler\Profiler | [
"End",
"a",
"timer",
"."
] | 956e1e1fdb788ebdfcd9d9765ea56d39043c6a7c | https://github.com/loic-sharma/profiler/blob/956e1e1fdb788ebdfcd9d9765ea56d39043c6a7c/src/Profiler/Profiler.php#L114-L119 |
189,822 | loic-sharma/profiler | src/Profiler/Profiler.php | Profiler.getIncludedFiles | public function getIncludedFiles()
{
// We'll cache this internally to avoid running this
// multiple times.
if(empty($this->includedFiles))
{
$files = get_included_files();
foreach($files as $filePath)
{
$size = $this->readableSize(filesize($filePath));
$this->includedFiles[] = compact('fil... | php | public function getIncludedFiles()
{
// We'll cache this internally to avoid running this
// multiple times.
if(empty($this->includedFiles))
{
$files = get_included_files();
foreach($files as $filePath)
{
$size = $this->readableSize(filesize($filePath));
$this->includedFiles[] = compact('fil... | [
"public",
"function",
"getIncludedFiles",
"(",
")",
"{",
"// We'll cache this internally to avoid running this",
"// multiple times.",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"includedFiles",
")",
")",
"{",
"$",
"files",
"=",
"get_included_files",
"(",
")",
";",... | Get all of the files that have been included.
@return array | [
"Get",
"all",
"of",
"the",
"files",
"that",
"have",
"been",
"included",
"."
] | 956e1e1fdb788ebdfcd9d9765ea56d39043c6a7c | https://github.com/loic-sharma/profiler/blob/956e1e1fdb788ebdfcd9d9765ea56d39043c6a7c/src/Profiler/Profiler.php#L188-L205 |
189,823 | loic-sharma/profiler | src/Profiler/Profiler.php | Profiler.readableSize | protected function readableSize($size, $format = null)
{
// adapted from code at http://aidanlister.com/repos/v/function.size_readable.php
$sizes = array('bytes', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');
if(is_null($format))
{
$format = '%01.2f %s';
}
$lastsizestring = end($sizes);
foreach ... | php | protected function readableSize($size, $format = null)
{
// adapted from code at http://aidanlister.com/repos/v/function.size_readable.php
$sizes = array('bytes', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');
if(is_null($format))
{
$format = '%01.2f %s';
}
$lastsizestring = end($sizes);
foreach ... | [
"protected",
"function",
"readableSize",
"(",
"$",
"size",
",",
"$",
"format",
"=",
"null",
")",
"{",
"// adapted from code at http://aidanlister.com/repos/v/function.size_readable.php",
"$",
"sizes",
"=",
"array",
"(",
"'bytes'",
",",
"'kB'",
",",
"'MB'",
",",
"'GB... | A helper to convert a size into a readable format
@param int $size
@param string $format
@return string | [
"A",
"helper",
"to",
"convert",
"a",
"size",
"into",
"a",
"readable",
"format"
] | 956e1e1fdb788ebdfcd9d9765ea56d39043c6a7c | https://github.com/loic-sharma/profiler/blob/956e1e1fdb788ebdfcd9d9765ea56d39043c6a7c/src/Profiler/Profiler.php#L214-L246 |
189,824 | loic-sharma/profiler | src/Profiler/Logger/Logger.php | Logger.getLogs | public function getLogs($level = null)
{
// If no level was given, return all logs.
if(is_null($level))
{
return $this->logs;
}
else
{
if(isset($this->logs[$level]))
{
return $this->logs[$level];
}
}
// If the level doesn't exist, just return an empty array.
//
// @todo: check tha... | php | public function getLogs($level = null)
{
// If no level was given, return all logs.
if(is_null($level))
{
return $this->logs;
}
else
{
if(isset($this->logs[$level]))
{
return $this->logs[$level];
}
}
// If the level doesn't exist, just return an empty array.
//
// @todo: check tha... | [
"public",
"function",
"getLogs",
"(",
"$",
"level",
"=",
"null",
")",
"{",
"// If no level was given, return all logs.",
"if",
"(",
"is_null",
"(",
"$",
"level",
")",
")",
"{",
"return",
"$",
"this",
"->",
"logs",
";",
"}",
"else",
"{",
"if",
"(",
"isset... | Retrieve the logs for the matching level.
@param string $level
@return array | [
"Retrieve",
"the",
"logs",
"for",
"the",
"matching",
"level",
"."
] | 956e1e1fdb788ebdfcd9d9765ea56d39043c6a7c | https://github.com/loic-sharma/profiler/blob/956e1e1fdb788ebdfcd9d9765ea56d39043c6a7c/src/Profiler/Logger/Logger.php#L83-L103 |
189,825 | loic-sharma/profiler | src/Profiler/ProfilerServiceProvider.php | ProfilerServiceProvider.registerProfiler | public function registerProfiler()
{
$sessionHash = static::SESSION_HASH;
$this->app['profiler'] = $this->app->share(function($app) use ($sessionHash)
{
$startTime = null;
$enabled = false;
// Let's use the Laravel start time if it is defined.
if(defined('LARAVEL_START'))
{
$startTime = LARA... | php | public function registerProfiler()
{
$sessionHash = static::SESSION_HASH;
$this->app['profiler'] = $this->app->share(function($app) use ($sessionHash)
{
$startTime = null;
$enabled = false;
// Let's use the Laravel start time if it is defined.
if(defined('LARAVEL_START'))
{
$startTime = LARA... | [
"public",
"function",
"registerProfiler",
"(",
")",
"{",
"$",
"sessionHash",
"=",
"static",
"::",
"SESSION_HASH",
";",
"$",
"this",
"->",
"app",
"[",
"'profiler'",
"]",
"=",
"$",
"this",
"->",
"app",
"->",
"share",
"(",
"function",
"(",
"$",
"app",
")"... | Register the profiler.
@return void | [
"Register",
"the",
"profiler",
"."
] | 956e1e1fdb788ebdfcd9d9765ea56d39043c6a7c | https://github.com/loic-sharma/profiler/blob/956e1e1fdb788ebdfcd9d9765ea56d39043c6a7c/src/Profiler/ProfilerServiceProvider.php#L33-L72 |
189,826 | loic-sharma/profiler | src/Profiler/ProfilerServiceProvider.php | ProfilerServiceProvider.registerProfilerLoggerEvent | public function registerProfilerLoggerEvent()
{
$app = $this->app;
$app['events']->listen('illuminate.log', function($level, $message, $context) use ($app)
{
if($app['profiler']->isEnabled())
{
$app['profiler']->log->log($level, $message, $context);
}
});
} | php | public function registerProfilerLoggerEvent()
{
$app = $this->app;
$app['events']->listen('illuminate.log', function($level, $message, $context) use ($app)
{
if($app['profiler']->isEnabled())
{
$app['profiler']->log->log($level, $message, $context);
}
});
} | [
"public",
"function",
"registerProfilerLoggerEvent",
"(",
")",
"{",
"$",
"app",
"=",
"$",
"this",
"->",
"app",
";",
"$",
"app",
"[",
"'events'",
"]",
"->",
"listen",
"(",
"'illuminate.log'",
",",
"function",
"(",
"$",
"level",
",",
"$",
"message",
",",
... | Register an event to automatically fetch Laravel's logs.
@return void | [
"Register",
"an",
"event",
"to",
"automatically",
"fetch",
"Laravel",
"s",
"logs",
"."
] | 956e1e1fdb788ebdfcd9d9765ea56d39043c6a7c | https://github.com/loic-sharma/profiler/blob/956e1e1fdb788ebdfcd9d9765ea56d39043c6a7c/src/Profiler/ProfilerServiceProvider.php#L79-L90 |
189,827 | loic-sharma/profiler | src/Profiler/ProfilerServiceProvider.php | ProfilerServiceProvider.registerProfilerQueryEvent | public function registerProfilerQueryEvent()
{
$app = $this->app;
$app['events']->listen('illuminate.query', function($query, $bindings, $time, $connectionName) use ($app)
{
// Don't log the query if the profiler is disabled.
if($app['profiler']->isEnabled())
{
// If the query had some bindings we'... | php | public function registerProfilerQueryEvent()
{
$app = $this->app;
$app['events']->listen('illuminate.query', function($query, $bindings, $time, $connectionName) use ($app)
{
// Don't log the query if the profiler is disabled.
if($app['profiler']->isEnabled())
{
// If the query had some bindings we'... | [
"public",
"function",
"registerProfilerQueryEvent",
"(",
")",
"{",
"$",
"app",
"=",
"$",
"this",
"->",
"app",
";",
"$",
"app",
"[",
"'events'",
"]",
"->",
"listen",
"(",
"'illuminate.query'",
",",
"function",
"(",
"$",
"query",
",",
"$",
"bindings",
",",... | Register an event to automatically log database queries.
@return void | [
"Register",
"an",
"event",
"to",
"automatically",
"log",
"database",
"queries",
"."
] | 956e1e1fdb788ebdfcd9d9765ea56d39043c6a7c | https://github.com/loic-sharma/profiler/blob/956e1e1fdb788ebdfcd9d9765ea56d39043c6a7c/src/Profiler/ProfilerServiceProvider.php#L97-L128 |
189,828 | loic-sharma/profiler | src/Profiler/ProfilerServiceProvider.php | ProfilerServiceProvider.registerProfilerRouting | public function registerProfilerRouting()
{
$provider = $this;
$this->app->booting(function($app) use ($provider)
{
$app['router']->get('/_profiler/enable/{password?}', function($password = null) use ($app, $provider)
{
$config = $app['config'];
$passwordRequired = in_array($app['env'], $config->g... | php | public function registerProfilerRouting()
{
$provider = $this;
$this->app->booting(function($app) use ($provider)
{
$app['router']->get('/_profiler/enable/{password?}', function($password = null) use ($app, $provider)
{
$config = $app['config'];
$passwordRequired = in_array($app['env'], $config->g... | [
"public",
"function",
"registerProfilerRouting",
"(",
")",
"{",
"$",
"provider",
"=",
"$",
"this",
";",
"$",
"this",
"->",
"app",
"->",
"booting",
"(",
"function",
"(",
"$",
"app",
")",
"use",
"(",
"$",
"provider",
")",
"{",
"$",
"app",
"[",
"'router... | Register routes to enable or disable the profiler.
@return void | [
"Register",
"routes",
"to",
"enable",
"or",
"disable",
"the",
"profiler",
"."
] | 956e1e1fdb788ebdfcd9d9765ea56d39043c6a7c | https://github.com/loic-sharma/profiler/blob/956e1e1fdb788ebdfcd9d9765ea56d39043c6a7c/src/Profiler/ProfilerServiceProvider.php#L135-L168 |
189,829 | loic-sharma/profiler | src/Profiler/ProfilerServiceProvider.php | ProfilerServiceProvider.registerProfilerToOutput | public function registerProfilerToOutput()
{
$app = $this->app;
$sessionHash = static::SESSION_HASH;
$app['router']->after(function($request, $response) use ($app, $sessionHash)
{
$profiler = $app['profiler'];
$session = $app['session'];
if($session->has($sessionHash))
{
$profiler->enable($se... | php | public function registerProfilerToOutput()
{
$app = $this->app;
$sessionHash = static::SESSION_HASH;
$app['router']->after(function($request, $response) use ($app, $sessionHash)
{
$profiler = $app['profiler'];
$session = $app['session'];
if($session->has($sessionHash))
{
$profiler->enable($se... | [
"public",
"function",
"registerProfilerToOutput",
"(",
")",
"{",
"$",
"app",
"=",
"$",
"this",
"->",
"app",
";",
"$",
"sessionHash",
"=",
"static",
"::",
"SESSION_HASH",
";",
"$",
"app",
"[",
"'router'",
"]",
"->",
"after",
"(",
"function",
"(",
"$",
"... | Register an after filter to automatically display the profiler.
@return void | [
"Register",
"an",
"after",
"filter",
"to",
"automatically",
"display",
"the",
"profiler",
"."
] | 956e1e1fdb788ebdfcd9d9765ea56d39043c6a7c | https://github.com/loic-sharma/profiler/blob/956e1e1fdb788ebdfcd9d9765ea56d39043c6a7c/src/Profiler/ProfilerServiceProvider.php#L185-L232 |
189,830 | mnabialek/laravel-eloquent-filter | src/Filters/QueryFilter.php | QueryFilter.applySimpleFilter | protected function applySimpleFilter(Filter $filter)
{
$value = (array) $filter->getValue();
if (count($value) > 1) {
$this->query->whereIn($filter->getField(), $value);
} else {
$this->query->where($filter->getField(),
$filter->getOperator(), $value[0... | php | protected function applySimpleFilter(Filter $filter)
{
$value = (array) $filter->getValue();
if (count($value) > 1) {
$this->query->whereIn($filter->getField(), $value);
} else {
$this->query->where($filter->getField(),
$filter->getOperator(), $value[0... | [
"protected",
"function",
"applySimpleFilter",
"(",
"Filter",
"$",
"filter",
")",
"{",
"$",
"value",
"=",
"(",
"array",
")",
"$",
"filter",
"->",
"getValue",
"(",
")",
";",
"if",
"(",
"count",
"(",
"$",
"value",
")",
">",
"1",
")",
"{",
"$",
"this",... | Apply simple filter.
@param Filter $filter | [
"Apply",
"simple",
"filter",
"."
] | e8fdb90a42dbb90befd5500adcff2348c6c10fdc | https://github.com/mnabialek/laravel-eloquent-filter/blob/e8fdb90a42dbb90befd5500adcff2348c6c10fdc/src/Filters/QueryFilter.php#L200-L209 |
189,831 | mnabialek/laravel-eloquent-filter | src/Filters/QueryFilter.php | QueryFilter.applySimpleSort | protected function applySimpleSort(Sort $sort)
{
$this->query->orderBy($sort->getField(), $sort->getOrder());
} | php | protected function applySimpleSort(Sort $sort)
{
$this->query->orderBy($sort->getField(), $sort->getOrder());
} | [
"protected",
"function",
"applySimpleSort",
"(",
"Sort",
"$",
"sort",
")",
"{",
"$",
"this",
"->",
"query",
"->",
"orderBy",
"(",
"$",
"sort",
"->",
"getField",
"(",
")",
",",
"$",
"sort",
"->",
"getOrder",
"(",
")",
")",
";",
"}"
] | Apply simple sort.
@param Sort $sort | [
"Apply",
"simple",
"sort",
"."
] | e8fdb90a42dbb90befd5500adcff2348c6c10fdc | https://github.com/mnabialek/laravel-eloquent-filter/blob/e8fdb90a42dbb90befd5500adcff2348c6c10fdc/src/Filters/QueryFilter.php#L216-L219 |
189,832 | softark/yii2-dual-listbox | DualListbox.php | DualListbox.registerClientScript | public function registerClientScript()
{
$view = $this->getView();
DualListboxAsset::register($view);
$id = (array_key_exists('id', $this->options)) ? $this->options['id'] : Html::getInputId($this->model, $this->attribute);
$options = empty($this->clientOptions) ? '' : Json::encode(... | php | public function registerClientScript()
{
$view = $this->getView();
DualListboxAsset::register($view);
$id = (array_key_exists('id', $this->options)) ? $this->options['id'] : Html::getInputId($this->model, $this->attribute);
$options = empty($this->clientOptions) ? '' : Json::encode(... | [
"public",
"function",
"registerClientScript",
"(",
")",
"{",
"$",
"view",
"=",
"$",
"this",
"->",
"getView",
"(",
")",
";",
"DualListboxAsset",
"::",
"register",
"(",
"$",
"view",
")",
";",
"$",
"id",
"=",
"(",
"array_key_exists",
"(",
"'id'",
",",
"$"... | Registers the required JavaScript. | [
"Registers",
"the",
"required",
"JavaScript",
"."
] | 9f594ebdacb3bda4483479848a449ac22ebd7505 | https://github.com/softark/yii2-dual-listbox/blob/9f594ebdacb3bda4483479848a449ac22ebd7505/DualListbox.php#L57-L65 |
189,833 | redooor/redminportal | src/App/Http/Traits/MediaUploaderController.php | MediaUploaderController.uploadChunk | protected function uploadChunk($model)
{
$result = [
"code" => 0,
"message" => "Unknown error."
];
$sid = $model->id;
$model_subfolder = $model->category_id . '/' . $sid;
$model_tmp_folder = public_path() . '/assets/medias/tmp/' . $model_subfo... | php | protected function uploadChunk($model)
{
$result = [
"code" => 0,
"message" => "Unknown error."
];
$sid = $model->id;
$model_subfolder = $model->category_id . '/' . $sid;
$model_tmp_folder = public_path() . '/assets/medias/tmp/' . $model_subfo... | [
"protected",
"function",
"uploadChunk",
"(",
"$",
"model",
")",
"{",
"$",
"result",
"=",
"[",
"\"code\"",
"=>",
"0",
",",
"\"message\"",
"=>",
"\"Unknown error.\"",
"]",
";",
"$",
"sid",
"=",
"$",
"model",
"->",
"id",
";",
"$",
"model_subfolder",
"=",
... | Upload file chunk
@param object Media | [
"Upload",
"file",
"chunk"
] | 3c166cfa0574d0b2439a6e0db5513407066bd0f6 | https://github.com/redooor/redminportal/blob/3c166cfa0574d0b2439a6e0db5513407066bd0f6/src/App/Http/Traits/MediaUploaderController.php#L63-L132 |
189,834 | redooor/redminportal | src/App/Http/Traits/MediaUploaderController.php | MediaUploaderController.checkRequest | protected function checkRequest($name, $default = 0)
{
if ($name == 'name') {
return (isset($_REQUEST[$name]) ? ($_REQUEST[$name]) : $default);
} else {
return (isset($_REQUEST[$name]) ? intval($_REQUEST[$name]) : $default);
}
} | php | protected function checkRequest($name, $default = 0)
{
if ($name == 'name') {
return (isset($_REQUEST[$name]) ? ($_REQUEST[$name]) : $default);
} else {
return (isset($_REQUEST[$name]) ? intval($_REQUEST[$name]) : $default);
}
} | [
"protected",
"function",
"checkRequest",
"(",
"$",
"name",
",",
"$",
"default",
"=",
"0",
")",
"{",
"if",
"(",
"$",
"name",
"==",
"'name'",
")",
"{",
"return",
"(",
"isset",
"(",
"$",
"_REQUEST",
"[",
"$",
"name",
"]",
")",
"?",
"(",
"$",
"_REQUE... | Get value by request name or return default
@param string Request Name
@param string Default value (optional)
@return Request|default | [
"Get",
"value",
"by",
"request",
"name",
"or",
"return",
"default"
] | 3c166cfa0574d0b2439a6e0db5513407066bd0f6 | https://github.com/redooor/redminportal/blob/3c166cfa0574d0b2439a6e0db5513407066bd0f6/src/App/Http/Traits/MediaUploaderController.php#L157-L164 |
189,835 | redooor/redminportal | src/App/Http/Traits/MediaUploaderController.php | MediaUploaderController.saveMedia | protected function saveMedia($model, $filePath)
{
$file = new FileInfo($filePath);
// Save the media link
$model->path = $file->getFilename();
// Get mime type of the file
$model->mimetype = $file->getMimeType();
// Get playtime of the file
... | php | protected function saveMedia($model, $filePath)
{
$file = new FileInfo($filePath);
// Save the media link
$model->path = $file->getFilename();
// Get mime type of the file
$model->mimetype = $file->getMimeType();
// Get playtime of the file
... | [
"protected",
"function",
"saveMedia",
"(",
"$",
"model",
",",
"$",
"filePath",
")",
"{",
"$",
"file",
"=",
"new",
"FileInfo",
"(",
"$",
"filePath",
")",
";",
"// Save the media link",
"$",
"model",
"->",
"path",
"=",
"$",
"file",
"->",
"getFilename",
"("... | Save Media info into database
@param object Media
@param string File path
@return bool True if successful | [
"Save",
"Media",
"info",
"into",
"database"
] | 3c166cfa0574d0b2439a6e0db5513407066bd0f6 | https://github.com/redooor/redminportal/blob/3c166cfa0574d0b2439a6e0db5513407066bd0f6/src/App/Http/Traits/MediaUploaderController.php#L174-L201 |
189,836 | redooor/redminportal | src/App/Http/Traits/PermissibleController.php | PermissibleController.populatePermission | protected function populatePermission($permission_inherit, $permission_allow, $permission_deny)
{
$permissions = [];
// Add Deny permission
$permissions = $this->retreivePermission($permissions, $permission_deny, -1);
// Add Allow permission
$permissions = $... | php | protected function populatePermission($permission_inherit, $permission_allow, $permission_deny)
{
$permissions = [];
// Add Deny permission
$permissions = $this->retreivePermission($permissions, $permission_deny, -1);
// Add Allow permission
$permissions = $... | [
"protected",
"function",
"populatePermission",
"(",
"$",
"permission_inherit",
",",
"$",
"permission_allow",
",",
"$",
"permission_deny",
")",
"{",
"$",
"permissions",
"=",
"[",
"]",
";",
"// Add Deny permission",
"$",
"permissions",
"=",
"$",
"this",
"->",
"ret... | Returns an array of permissions based on given inherit, allow and deny list
@param array Inherit Permission
@param array Allow Permission
@param array Deny Permission
@return array Permission list | [
"Returns",
"an",
"array",
"of",
"permissions",
"based",
"on",
"given",
"inherit",
"allow",
"and",
"deny",
"list"
] | 3c166cfa0574d0b2439a6e0db5513407066bd0f6 | https://github.com/redooor/redminportal/blob/3c166cfa0574d0b2439a6e0db5513407066bd0f6/src/App/Http/Traits/PermissibleController.php#L16-L30 |
189,837 | redooor/redminportal | src/App/Http/Traits/PermissibleController.php | PermissibleController.retreivePermission | protected function retreivePermission($permissions, $check_permissions, $level)
{
$sorted_permissions = explode(',', $check_permissions);
ksort($sorted_permissions);
foreach ($sorted_permissions as $item) {
$item = trim($item);
if (! array_key_exists($item, $... | php | protected function retreivePermission($permissions, $check_permissions, $level)
{
$sorted_permissions = explode(',', $check_permissions);
ksort($sorted_permissions);
foreach ($sorted_permissions as $item) {
$item = trim($item);
if (! array_key_exists($item, $... | [
"protected",
"function",
"retreivePermission",
"(",
"$",
"permissions",
",",
"$",
"check_permissions",
",",
"$",
"level",
")",
"{",
"$",
"sorted_permissions",
"=",
"explode",
"(",
"','",
",",
"$",
"check_permissions",
")",
";",
"ksort",
"(",
"$",
"sorted_permi... | Appends to an array of permissions based on given permission list and level
@param array Permission array to be appended
@param array Permission list to check through
@param int Level of permission
@return array Permission | [
"Appends",
"to",
"an",
"array",
"of",
"permissions",
"based",
"on",
"given",
"permission",
"list",
"and",
"level"
] | 3c166cfa0574d0b2439a6e0db5513407066bd0f6 | https://github.com/redooor/redminportal/blob/3c166cfa0574d0b2439a6e0db5513407066bd0f6/src/App/Http/Traits/PermissibleController.php#L39-L52 |
189,838 | redooor/redminportal | src/App/Models/Revision.php | Revision.showAttribute | public function showAttribute()
{
$present_attribute = $this->attribute;
// Replace underscore and dots with space
$to_be_replaced = array("_", ".");
$present_attribute = str_replace($to_be_replaced, ' ', $present_attribute);
return ucwords($present_attribut... | php | public function showAttribute()
{
$present_attribute = $this->attribute;
// Replace underscore and dots with space
$to_be_replaced = array("_", ".");
$present_attribute = str_replace($to_be_replaced, ' ', $present_attribute);
return ucwords($present_attribut... | [
"public",
"function",
"showAttribute",
"(",
")",
"{",
"$",
"present_attribute",
"=",
"$",
"this",
"->",
"attribute",
";",
"// Replace underscore and dots with space",
"$",
"to_be_replaced",
"=",
"array",
"(",
"\"_\"",
",",
"\".\"",
")",
";",
"$",
"present_attribut... | Present attribute in a User friendly string | [
"Present",
"attribute",
"in",
"a",
"User",
"friendly",
"string"
] | 3c166cfa0574d0b2439a6e0db5513407066bd0f6 | https://github.com/redooor/redminportal/blob/3c166cfa0574d0b2439a6e0db5513407066bd0f6/src/App/Models/Revision.php#L42-L51 |
189,839 | AgencyPMG/Queue | src/DefaultConsumer.php | DefaultConsumer.doOnce | protected function doOnce(string $queueName, Envelope $envelope) : array
{
$result = false;
$message = $envelope->unwrap();
$this->getLogger()->debug('Handling message {msg}', ['msg' => self::nameOf($message)]);
try {
$result = $this->handleMessage($message);
} c... | php | protected function doOnce(string $queueName, Envelope $envelope) : array
{
$result = false;
$message = $envelope->unwrap();
$this->getLogger()->debug('Handling message {msg}', ['msg' => self::nameOf($message)]);
try {
$result = $this->handleMessage($message);
} c... | [
"protected",
"function",
"doOnce",
"(",
"string",
"$",
"queueName",
",",
"Envelope",
"$",
"envelope",
")",
":",
"array",
"{",
"$",
"result",
"=",
"false",
";",
"$",
"message",
"=",
"$",
"envelope",
"->",
"unwrap",
"(",
")",
";",
"$",
"this",
"->",
"g... | Do the actual work for processing a single message.
@param $queueName The queue to which the message belongs
@param $envelope The envelope containing the message to process
@return An array if [$messageSucceeded, $willRetry] | [
"Do",
"the",
"actual",
"work",
"for",
"processing",
"a",
"single",
"message",
"."
] | f198d5c0bad98f9bfaea14fe43cbd2dcb252c32b | https://github.com/AgencyPMG/Queue/blob/f198d5c0bad98f9bfaea14fe43cbd2dcb252c32b/src/DefaultConsumer.php#L114-L157 |
189,840 | AgencyPMG/Queue | src/DefaultConsumer.php | DefaultConsumer.failed | protected function failed(string $queueName, Envelope $env) : bool
{
$retry = $this->retries->canRetry($env);
if ($retry) {
$delay = $this->retries->retryDelay($env);
$this->getDriver()->retry($queueName, $env->retry($delay));
} else {
$this->getDriver()->... | php | protected function failed(string $queueName, Envelope $env) : bool
{
$retry = $this->retries->canRetry($env);
if ($retry) {
$delay = $this->retries->retryDelay($env);
$this->getDriver()->retry($queueName, $env->retry($delay));
} else {
$this->getDriver()->... | [
"protected",
"function",
"failed",
"(",
"string",
"$",
"queueName",
",",
"Envelope",
"$",
"env",
")",
":",
"bool",
"{",
"$",
"retry",
"=",
"$",
"this",
"->",
"retries",
"->",
"canRetry",
"(",
"$",
"env",
")",
";",
"if",
"(",
"$",
"retry",
")",
"{",... | Fail the message. This will retry it if possible.
@param $queueName the queue from which the message originated
@param $env The envelope containing the message
@return bool True if the message will be retried. | [
"Fail",
"the",
"message",
".",
"This",
"will",
"retry",
"it",
"if",
"possible",
"."
] | f198d5c0bad98f9bfaea14fe43cbd2dcb252c32b | https://github.com/AgencyPMG/Queue/blob/f198d5c0bad98f9bfaea14fe43cbd2dcb252c32b/src/DefaultConsumer.php#L166-L177 |
189,841 | redooor/redminportal | src/App/Classes/Imagine.php | Imagine.thumb | public function thumb($url, $width, $height = null)
{
return $this->resize($url, $width, $height, true);
} | php | public function thumb($url, $width, $height = null)
{
return $this->resize($url, $width, $height, true);
} | [
"public",
"function",
"thumb",
"(",
"$",
"url",
",",
"$",
"width",
",",
"$",
"height",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"resize",
"(",
"$",
"url",
",",
"$",
"width",
",",
"$",
"height",
",",
"true",
")",
";",
"}"
] | Helper for creating thumbs
@param string $url
@param integer $width
@param integer $height
@return string | [
"Helper",
"for",
"creating",
"thumbs"
] | 3c166cfa0574d0b2439a6e0db5513407066bd0f6 | https://github.com/redooor/redminportal/blob/3c166cfa0574d0b2439a6e0db5513407066bd0f6/src/App/Classes/Imagine.php#L115-L118 |
189,842 | redooor/redminportal | src/App/Classes/Imagine.php | Imagine.upload | public function upload($file, $dir = null, $createDimensions = false, $autonumber = true)
{
if ($file) {
// Generate random dir
if (! $dir) {
$dir = str_random(8);
}
// Get file info and try to move
$destination = Config::get(... | php | public function upload($file, $dir = null, $createDimensions = false, $autonumber = true)
{
if ($file) {
// Generate random dir
if (! $dir) {
$dir = str_random(8);
}
// Get file info and try to move
$destination = Config::get(... | [
"public",
"function",
"upload",
"(",
"$",
"file",
",",
"$",
"dir",
"=",
"null",
",",
"$",
"createDimensions",
"=",
"false",
",",
"$",
"autonumber",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"file",
")",
"{",
"// Generate random dir",
"if",
"(",
"!",
"$"... | Upload an image to the public storage
@param File $file
@param string Directory (optional, defaults to null)
@param bool Whether to create all dimensions (optional, defaults to false)
@param bool Automatically appends number if file already exists (optional, defaults to true)
@return string | [
"Upload",
"an",
"image",
"to",
"the",
"public",
"storage"
] | 3c166cfa0574d0b2439a6e0db5513407066bd0f6 | https://github.com/redooor/redminportal/blob/3c166cfa0574d0b2439a6e0db5513407066bd0f6/src/App/Classes/Imagine.php#L128-L156 |
189,843 | redooor/redminportal | src/App/Classes/Imagine.php | Imagine.autoNumberFile | private function autoNumberFile($path, $file)
{
$extension = $file->getClientOriginalExtension();
$original_name = $file->getClientOriginalName();
$filename = $original_name; // Set to original name
$counter = 1;
while (file_exists($path . '/' . $filename)) ... | php | private function autoNumberFile($path, $file)
{
$extension = $file->getClientOriginalExtension();
$original_name = $file->getClientOriginalName();
$filename = $original_name; // Set to original name
$counter = 1;
while (file_exists($path . '/' . $filename)) ... | [
"private",
"function",
"autoNumberFile",
"(",
"$",
"path",
",",
"$",
"file",
")",
"{",
"$",
"extension",
"=",
"$",
"file",
"->",
"getClientOriginalExtension",
"(",
")",
";",
"$",
"original_name",
"=",
"$",
"file",
"->",
"getClientOriginalName",
"(",
")",
"... | Automatically appends number if file already exists
@param string $path
@param string $filename
@return string New Filename | [
"Automatically",
"appends",
"number",
"if",
"file",
"already",
"exists"
] | 3c166cfa0574d0b2439a6e0db5513407066bd0f6 | https://github.com/redooor/redminportal/blob/3c166cfa0574d0b2439a6e0db5513407066bd0f6/src/App/Classes/Imagine.php#L164-L178 |
189,844 | redooor/redminportal | src/App/Classes/Imagine.php | Imagine.createDimensions | public function createDimensions($url, $dimensions = array())
{
// Get default dimensions
$defaultDimensions = Config::get('redminportal::image.dimensions');
if (is_array($defaultDimensions)) {
$dimensions = array_merge($defaultDimensions, $dimensions);
}
... | php | public function createDimensions($url, $dimensions = array())
{
// Get default dimensions
$defaultDimensions = Config::get('redminportal::image.dimensions');
if (is_array($defaultDimensions)) {
$dimensions = array_merge($defaultDimensions, $dimensions);
}
... | [
"public",
"function",
"createDimensions",
"(",
"$",
"url",
",",
"$",
"dimensions",
"=",
"array",
"(",
")",
")",
"{",
"// Get default dimensions",
"$",
"defaultDimensions",
"=",
"Config",
"::",
"get",
"(",
"'redminportal::image.dimensions'",
")",
";",
"if",
"(",
... | Creates image dimensions based on a configuration
@param string $url
@param array $dimensions
@return void | [
"Creates",
"image",
"dimensions",
"based",
"on",
"a",
"configuration"
] | 3c166cfa0574d0b2439a6e0db5513407066bd0f6 | https://github.com/redooor/redminportal/blob/3c166cfa0574d0b2439a6e0db5513407066bd0f6/src/App/Classes/Imagine.php#L186-L205 |
189,845 | redooor/redminportal | src/App/Classes/Imagine.php | Imagine.getUrl | public function getUrl($url, $size = "thumb", $fullUrl = false)
{
// Get default dimensions
$defaultDimensions = Config::get('redminportal::image.dimensions');
// Get upload path
$upload_path = Config::get('redminportal::image.upload_path');
$dimension = $defaultDim... | php | public function getUrl($url, $size = "thumb", $fullUrl = false)
{
// Get default dimensions
$defaultDimensions = Config::get('redminportal::image.dimensions');
// Get upload path
$upload_path = Config::get('redminportal::image.upload_path');
$dimension = $defaultDim... | [
"public",
"function",
"getUrl",
"(",
"$",
"url",
",",
"$",
"size",
"=",
"\"thumb\"",
",",
"$",
"fullUrl",
"=",
"false",
")",
"{",
"// Get default dimensions",
"$",
"defaultDimensions",
"=",
"Config",
"::",
"get",
"(",
"'redminportal::image.dimensions'",
")",
"... | Get URL of specified size
@param string $url
@param string $size
@return string $url | [
"Get",
"URL",
"of",
"specified",
"size"
] | 3c166cfa0574d0b2439a6e0db5513407066bd0f6 | https://github.com/redooor/redminportal/blob/3c166cfa0574d0b2439a6e0db5513407066bd0f6/src/App/Classes/Imagine.php#L213-L243 |
189,846 | redooor/redminportal | src/App/Models/Traits/Permissable.php | Permissable.checkRouteAccess | private function checkRouteAccess($route, $permissions)
{
$permission_level = 0;
if (array_key_exists($route, $permissions)) {
$permission_level = $permissions->$route;
// Check if type is bool, convert to int
if (gettype($permission_level) =... | php | private function checkRouteAccess($route, $permissions)
{
$permission_level = 0;
if (array_key_exists($route, $permissions)) {
$permission_level = $permissions->$route;
// Check if type is bool, convert to int
if (gettype($permission_level) =... | [
"private",
"function",
"checkRouteAccess",
"(",
"$",
"route",
",",
"$",
"permissions",
")",
"{",
"$",
"permission_level",
"=",
"0",
";",
"if",
"(",
"array_key_exists",
"(",
"$",
"route",
",",
"$",
"permissions",
")",
")",
"{",
"$",
"permission_level",
"=",... | Check this route for permission
@param string path
@param object Permissions
@return bool True if user has access rights | [
"Check",
"this",
"route",
"for",
"permission"
] | 3c166cfa0574d0b2439a6e0db5513407066bd0f6 | https://github.com/redooor/redminportal/blob/3c166cfa0574d0b2439a6e0db5513407066bd0f6/src/App/Models/Traits/Permissable.php#L138-L152 |
189,847 | mnabialek/laravel-eloquent-filter | src/Parsers/SimpleQueryParser.php | SimpleQueryParser.getSorts | public function getSorts()
{
$sortInput = $this->request->input($this->sortName, '');
$sortFields = $this->collection->make(
is_array($sortInput) ? $sortInput :
explode($this->sortFieldsSeparator, $sortInput));
$sorts = $this->collection->make();
$sortF... | php | public function getSorts()
{
$sortInput = $this->request->input($this->sortName, '');
$sortFields = $this->collection->make(
is_array($sortInput) ? $sortInput :
explode($this->sortFieldsSeparator, $sortInput));
$sorts = $this->collection->make();
$sortF... | [
"public",
"function",
"getSorts",
"(",
")",
"{",
"$",
"sortInput",
"=",
"$",
"this",
"->",
"request",
"->",
"input",
"(",
"$",
"this",
"->",
"sortName",
",",
"''",
")",
";",
"$",
"sortFields",
"=",
"$",
"this",
"->",
"collection",
"->",
"make",
"(",
... | Get parameters for sorting.
@return Collection | [
"Get",
"parameters",
"for",
"sorting",
"."
] | e8fdb90a42dbb90befd5500adcff2348c6c10fdc | https://github.com/mnabialek/laravel-eloquent-filter/blob/e8fdb90a42dbb90befd5500adcff2348c6c10fdc/src/Parsers/SimpleQueryParser.php#L98-L125 |
189,848 | bizley/Yii2-AjaxDropDown | src/AjaxDropdown.php | AjaxDropdown.htmlOptionsExtraButton | protected function htmlOptionsExtraButton()
{
return array_merge(
['type' => 'button'],
!empty($this->extraButtonOptions) && is_array($this->extraButtonOptions) ? $this->extraButtonOptions : []
);
} | php | protected function htmlOptionsExtraButton()
{
return array_merge(
['type' => 'button'],
!empty($this->extraButtonOptions) && is_array($this->extraButtonOptions) ? $this->extraButtonOptions : []
);
} | [
"protected",
"function",
"htmlOptionsExtraButton",
"(",
")",
"{",
"return",
"array_merge",
"(",
"[",
"'type'",
"=>",
"'button'",
"]",
",",
"!",
"empty",
"(",
"$",
"this",
"->",
"extraButtonOptions",
")",
"&&",
"is_array",
"(",
"$",
"this",
"->",
"extraButton... | Sets extra button HTML options.
@return array | [
"Sets",
"extra",
"button",
"HTML",
"options",
"."
] | 2643d1c81c4d1b10ac04ebe61e49930be4dfc591 | https://github.com/bizley/Yii2-AjaxDropDown/blob/2643d1c81c4d1b10ac04ebe61e49930be4dfc591/src/AjaxDropdown.php#L585-L591 |
189,849 | bizley/Yii2-AjaxDropDown | src/AjaxDropdown.php | AjaxDropdown.htmlOptionsGroup | protected function htmlOptionsGroup()
{
$class = !empty($this->defaults['groupClass']) ? $this->defaults['groupClass'] : '';
$style = !empty($this->defaults['groupStyle']) ? $this->defaults['groupStyle'] : '';
if (!empty($this->bootstrapDefaults['groupClass'])) {
$class .= $this... | php | protected function htmlOptionsGroup()
{
$class = !empty($this->defaults['groupClass']) ? $this->defaults['groupClass'] : '';
$style = !empty($this->defaults['groupStyle']) ? $this->defaults['groupStyle'] : '';
if (!empty($this->bootstrapDefaults['groupClass'])) {
$class .= $this... | [
"protected",
"function",
"htmlOptionsGroup",
"(",
")",
"{",
"$",
"class",
"=",
"!",
"empty",
"(",
"$",
"this",
"->",
"defaults",
"[",
"'groupClass'",
"]",
")",
"?",
"$",
"this",
"->",
"defaults",
"[",
"'groupClass'",
"]",
":",
"''",
";",
"$",
"style",
... | Sets div container for input text field and buttons with dropdown menu
HTML options.
@return array | [
"Sets",
"div",
"container",
"for",
"input",
"text",
"field",
"and",
"buttons",
"with",
"dropdown",
"menu",
"HTML",
"options",
"."
] | 2643d1c81c4d1b10ac04ebe61e49930be4dfc591 | https://github.com/bizley/Yii2-AjaxDropDown/blob/2643d1c81c4d1b10ac04ebe61e49930be4dfc591/src/AjaxDropdown.php#L598-L623 |
189,850 | bizley/Yii2-AjaxDropDown | src/AjaxDropdown.php | AjaxDropdown.htmlOptionsInput | protected function htmlOptionsInput($disabled = false)
{
$options = ['id' => false];
if (!empty($this->inputOptions) && is_array($this->inputOptions)) {
$options = $this->inputOptions;
}
if ($disabled) {
$options['disabled'] = true;
}
return $t... | php | protected function htmlOptionsInput($disabled = false)
{
$options = ['id' => false];
if (!empty($this->inputOptions) && is_array($this->inputOptions)) {
$options = $this->inputOptions;
}
if ($disabled) {
$options['disabled'] = true;
}
return $t... | [
"protected",
"function",
"htmlOptionsInput",
"(",
"$",
"disabled",
"=",
"false",
")",
"{",
"$",
"options",
"=",
"[",
"'id'",
"=>",
"false",
"]",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"inputOptions",
")",
"&&",
"is_array",
"(",
"$",
"t... | Sets input text field HTML options.
@param boolean $disabled Whether this field should be disabled
@return array | [
"Sets",
"input",
"text",
"field",
"HTML",
"options",
"."
] | 2643d1c81c4d1b10ac04ebe61e49930be4dfc591 | https://github.com/bizley/Yii2-AjaxDropDown/blob/2643d1c81c4d1b10ac04ebe61e49930be4dfc591/src/AjaxDropdown.php#L630-L640 |
189,851 | bizley/Yii2-AjaxDropDown | src/AjaxDropdown.php | AjaxDropdown.htmlOptionsResult | protected function htmlOptionsResult($value = '')
{
$class = !empty($this->defaults['resultClass']) ? $this->defaults['resultClass'] . $value : '';
$style = !empty($this->defaults['resultStyle']) ? $this->defaults['resultStyle'] : '';
if (!empty($this->bootstrapDefaults['resultClass'])) {
... | php | protected function htmlOptionsResult($value = '')
{
$class = !empty($this->defaults['resultClass']) ? $this->defaults['resultClass'] . $value : '';
$style = !empty($this->defaults['resultStyle']) ? $this->defaults['resultStyle'] : '';
if (!empty($this->bootstrapDefaults['resultClass'])) {
... | [
"protected",
"function",
"htmlOptionsResult",
"(",
"$",
"value",
"=",
"''",
")",
"{",
"$",
"class",
"=",
"!",
"empty",
"(",
"$",
"this",
"->",
"defaults",
"[",
"'resultClass'",
"]",
")",
"?",
"$",
"this",
"->",
"defaults",
"[",
"'resultClass'",
"]",
".... | Sets preselected value HTML options.
@param string $value Identificator of the result row
@return array | [
"Sets",
"preselected",
"value",
"HTML",
"options",
"."
] | 2643d1c81c4d1b10ac04ebe61e49930be4dfc591 | https://github.com/bizley/Yii2-AjaxDropDown/blob/2643d1c81c4d1b10ac04ebe61e49930be4dfc591/src/AjaxDropdown.php#L682-L704 |
189,852 | bizley/Yii2-AjaxDropDown | src/AjaxDropdown.php | AjaxDropdown.htmlOptionsSet | protected function htmlOptionsSet($name, $additional = [], $appendStyle = '')
{
$class = !empty($this->defaults[$name . 'Class']) ? $this->defaults[$name . 'Class'] : '';
$style = !empty($this->defaults[$name . 'Style']) ? $this->defaults[$name . 'Style'] : '';
if (!empty($this->bootstrapDe... | php | protected function htmlOptionsSet($name, $additional = [], $appendStyle = '')
{
$class = !empty($this->defaults[$name . 'Class']) ? $this->defaults[$name . 'Class'] : '';
$style = !empty($this->defaults[$name . 'Style']) ? $this->defaults[$name . 'Style'] : '';
if (!empty($this->bootstrapDe... | [
"protected",
"function",
"htmlOptionsSet",
"(",
"$",
"name",
",",
"$",
"additional",
"=",
"[",
"]",
",",
"$",
"appendStyle",
"=",
"''",
")",
"{",
"$",
"class",
"=",
"!",
"empty",
"(",
"$",
"this",
"->",
"defaults",
"[",
"$",
"name",
".",
"'Class'",
... | Sets HTML options for chosen element.
@param string $name Name of the element
@param array $additional Additional HTML options
@param string $appendStyle Additional CSS style
@return array | [
"Sets",
"HTML",
"options",
"for",
"chosen",
"element",
"."
] | 2643d1c81c4d1b10ac04ebe61e49930be4dfc591 | https://github.com/bizley/Yii2-AjaxDropDown/blob/2643d1c81c4d1b10ac04ebe61e49930be4dfc591/src/AjaxDropdown.php#L731-L766 |
189,853 | bizley/Yii2-AjaxDropDown | src/AjaxDropdown.php | AjaxDropdown.prepareOption | protected function prepareOption($name)
{
if (!empty($this->$name) && is_string($this->$name)) {
return $this->$name;
}
return !empty($this->bootstrapDefaults[$name]) ? $this->bootstrapDefaults[$name] : '';
} | php | protected function prepareOption($name)
{
if (!empty($this->$name) && is_string($this->$name)) {
return $this->$name;
}
return !empty($this->bootstrapDefaults[$name]) ? $this->bootstrapDefaults[$name] : '';
} | [
"protected",
"function",
"prepareOption",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"$",
"name",
")",
"&&",
"is_string",
"(",
"$",
"this",
"->",
"$",
"name",
")",
")",
"{",
"return",
"$",
"this",
"->",
"$",
"nam... | Sets JS option for chosen element.
@param string $name Name of the option
@return string | [
"Sets",
"JS",
"option",
"for",
"chosen",
"element",
"."
] | 2643d1c81c4d1b10ac04ebe61e49930be4dfc591 | https://github.com/bizley/Yii2-AjaxDropDown/blob/2643d1c81c4d1b10ac04ebe61e49930be4dfc591/src/AjaxDropdown.php#L773-L779 |
189,854 | bizley/Yii2-AjaxDropDown | src/AjaxDropdown.php | AjaxDropdown.prepareOptionDelay | protected function prepareOptionDelay()
{
$value = 0;
if (is_numeric($this->delay) && $this->delay > 0) {
$value = (int)$this->delay;
}
return $value;
} | php | protected function prepareOptionDelay()
{
$value = 0;
if (is_numeric($this->delay) && $this->delay > 0) {
$value = (int)$this->delay;
}
return $value;
} | [
"protected",
"function",
"prepareOptionDelay",
"(",
")",
"{",
"$",
"value",
"=",
"0",
";",
"if",
"(",
"is_numeric",
"(",
"$",
"this",
"->",
"delay",
")",
"&&",
"$",
"this",
"->",
"delay",
">",
"0",
")",
"{",
"$",
"value",
"=",
"(",
"int",
")",
"$... | Sets delay JS option.
@return integer | [
"Sets",
"delay",
"JS",
"option",
"."
] | 2643d1c81c4d1b10ac04ebe61e49930be4dfc591 | https://github.com/bizley/Yii2-AjaxDropDown/blob/2643d1c81c4d1b10ac04ebe61e49930be4dfc591/src/AjaxDropdown.php#L796-L803 |
189,855 | bizley/Yii2-AjaxDropDown | src/AjaxDropdown.php | AjaxDropdown.prepareOptionLocal | protected function prepareOptionLocal()
{
$local = $this->defaultLocal;
foreach ($local as $key => $value) {
if (!empty($this->local[$key]) && is_string($this->local[$key])) {
$value = $this->local[$key];
}
$local[$key] = Yii::t($this->translateCat... | php | protected function prepareOptionLocal()
{
$local = $this->defaultLocal;
foreach ($local as $key => $value) {
if (!empty($this->local[$key]) && is_string($this->local[$key])) {
$value = $this->local[$key];
}
$local[$key] = Yii::t($this->translateCat... | [
"protected",
"function",
"prepareOptionLocal",
"(",
")",
"{",
"$",
"local",
"=",
"$",
"this",
"->",
"defaultLocal",
";",
"foreach",
"(",
"$",
"local",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
... | Sets translations JS option.
@return string | [
"Sets",
"translations",
"JS",
"option",
"."
] | 2643d1c81c4d1b10ac04ebe61e49930be4dfc591 | https://github.com/bizley/Yii2-AjaxDropDown/blob/2643d1c81c4d1b10ac04ebe61e49930be4dfc591/src/AjaxDropdown.php#L809-L838 |
189,856 | bizley/Yii2-AjaxDropDown | src/AjaxDropdown.php | AjaxDropdown.prepareOptionProgressBar | protected function prepareOptionProgressBar()
{
if (!empty($this->progressBar) && is_string($this->progressBar)) {
return strtr($this->progressBar, ['{LOADING}' => Yii::t($this->translateCategory, 'Loading')]);
}
return !empty($this->bootstrapDefaults['progressBar']) ? strtr($thi... | php | protected function prepareOptionProgressBar()
{
if (!empty($this->progressBar) && is_string($this->progressBar)) {
return strtr($this->progressBar, ['{LOADING}' => Yii::t($this->translateCategory, 'Loading')]);
}
return !empty($this->bootstrapDefaults['progressBar']) ? strtr($thi... | [
"protected",
"function",
"prepareOptionProgressBar",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"progressBar",
")",
"&&",
"is_string",
"(",
"$",
"this",
"->",
"progressBar",
")",
")",
"{",
"return",
"strtr",
"(",
"$",
"this",
"->",
... | Sets progress bar JS option.
@return string | [
"Sets",
"progress",
"bar",
"JS",
"option",
"."
] | 2643d1c81c4d1b10ac04ebe61e49930be4dfc591 | https://github.com/bizley/Yii2-AjaxDropDown/blob/2643d1c81c4d1b10ac04ebe61e49930be4dfc591/src/AjaxDropdown.php#L853-L859 |
189,857 | bizley/Yii2-AjaxDropDown | src/AjaxDropdown.php | AjaxDropdown.prepareOptions | protected function prepareOptions($name)
{
return [
'addc' => $this->additionalCode,
'dely' => $this->prepareOptionDelay(),
'ercl' => $this->prepareOption('errorClass'),
'erst' => $this->prepareOption('errorStyle'),
'hecl' => $this->prepareOption('... | php | protected function prepareOptions($name)
{
return [
'addc' => $this->additionalCode,
'dely' => $this->prepareOptionDelay(),
'ercl' => $this->prepareOption('errorClass'),
'erst' => $this->prepareOption('errorStyle'),
'hecl' => $this->prepareOption('... | [
"protected",
"function",
"prepareOptions",
"(",
"$",
"name",
")",
"{",
"return",
"[",
"'addc'",
"=>",
"$",
"this",
"->",
"additionalCode",
",",
"'dely'",
"=>",
"$",
"this",
"->",
"prepareOptionDelay",
"(",
")",
",",
"'ercl'",
"=>",
"$",
"this",
"->",
"pr... | Sets JS options.
@param string $name Name of the widget
@return array | [
"Sets",
"JS",
"options",
"."
] | 2643d1c81c4d1b10ac04ebe61e49930be4dfc591 | https://github.com/bizley/Yii2-AjaxDropDown/blob/2643d1c81c4d1b10ac04ebe61e49930be4dfc591/src/AjaxDropdown.php#L866-L912 |
189,858 | bizley/Yii2-AjaxDropDown | src/AjaxDropdown.php | AjaxDropdown.registerScript | public function registerScript($id, $name)
{
$view = $this->getView();
AjaxDropdownAsset::register($view);
$options = Json::encode($this->prepareOptions($name));
$view->registerJs("jQuery('#$id').ajaxDropDown($options);");
} | php | public function registerScript($id, $name)
{
$view = $this->getView();
AjaxDropdownAsset::register($view);
$options = Json::encode($this->prepareOptions($name));
$view->registerJs("jQuery('#$id').ajaxDropDown($options);");
} | [
"public",
"function",
"registerScript",
"(",
"$",
"id",
",",
"$",
"name",
")",
"{",
"$",
"view",
"=",
"$",
"this",
"->",
"getView",
"(",
")",
";",
"AjaxDropdownAsset",
"::",
"register",
"(",
"$",
"view",
")",
";",
"$",
"options",
"=",
"Json",
"::",
... | Registers assets and calls JS plugin.
@param string $id ID of the widget
@param string $name Name of the widget | [
"Registers",
"assets",
"and",
"calls",
"JS",
"plugin",
"."
] | 2643d1c81c4d1b10ac04ebe61e49930be4dfc591 | https://github.com/bizley/Yii2-AjaxDropDown/blob/2643d1c81c4d1b10ac04ebe61e49930be4dfc591/src/AjaxDropdown.php#L919-L925 |
189,859 | bizley/Yii2-AjaxDropDown | src/AjaxDropdown.php | AjaxDropdown.resolveNameID | protected function resolveNameID()
{
if ($this->name !== null) {
$name = $this->name;
$id = $this->name;
} elseif ($this->hasModel()) {
$name = Html::getInputName($this->model, $this->attribute);
$id = Html::getInputId($this->model, $this->attribut... | php | protected function resolveNameID()
{
if ($this->name !== null) {
$name = $this->name;
$id = $this->name;
} elseif ($this->hasModel()) {
$name = Html::getInputName($this->model, $this->attribute);
$id = Html::getInputId($this->model, $this->attribut... | [
"protected",
"function",
"resolveNameID",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"name",
"!==",
"null",
")",
"{",
"$",
"name",
"=",
"$",
"this",
"->",
"name",
";",
"$",
"id",
"=",
"$",
"this",
"->",
"name",
";",
"}",
"elseif",
"(",
"$",
"... | Resolves name and ID.
@return array
@throws \yii\base\Exception | [
"Resolves",
"name",
"and",
"ID",
"."
] | 2643d1c81c4d1b10ac04ebe61e49930be4dfc591 | https://github.com/bizley/Yii2-AjaxDropDown/blob/2643d1c81c4d1b10ac04ebe61e49930be4dfc591/src/AjaxDropdown.php#L945-L957 |
189,860 | bizley/Yii2-AjaxDropDown | src/AjaxDropdown.php | AjaxDropdown.results | protected function results()
{
$results = [];
if (is_array($this->data)) {
if ($this->singleMode) {
if ($this->singleModeBottom) {
if (isset($this->data[0])) {
return [$this->singleResult($this->data[0], $this->singleMo... | php | protected function results()
{
$results = [];
if (is_array($this->data)) {
if ($this->singleMode) {
if ($this->singleModeBottom) {
if (isset($this->data[0])) {
return [$this->singleResult($this->data[0], $this->singleMo... | [
"protected",
"function",
"results",
"(",
")",
"{",
"$",
"results",
"=",
"[",
"]",
";",
"if",
"(",
"is_array",
"(",
"$",
"this",
"->",
"data",
")",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"singleMode",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"si... | Renders the preselected data values.
@return array | [
"Renders",
"the",
"preselected",
"data",
"values",
"."
] | 2643d1c81c4d1b10ac04ebe61e49930be4dfc591 | https://github.com/bizley/Yii2-AjaxDropDown/blob/2643d1c81c4d1b10ac04ebe61e49930be4dfc591/src/AjaxDropdown.php#L963-L982 |
189,861 | bizley/Yii2-AjaxDropDown | src/AjaxDropdown.php | AjaxDropdown.singleResult | protected function singleResult($data = [], $singleMode = false)
{
$result = $data;
if (empty($result['id'])) {
$result['id'] = uniqid();
}
if (empty($result['mark']) || !in_array($result['mark'], [0, 1])) {
$result['mark'] = 0;
}
if (empty($re... | php | protected function singleResult($data = [], $singleMode = false)
{
$result = $data;
if (empty($result['id'])) {
$result['id'] = uniqid();
}
if (empty($result['mark']) || !in_array($result['mark'], [0, 1])) {
$result['mark'] = 0;
}
if (empty($re... | [
"protected",
"function",
"singleResult",
"(",
"$",
"data",
"=",
"[",
"]",
",",
"$",
"singleMode",
"=",
"false",
")",
"{",
"$",
"result",
"=",
"$",
"data",
";",
"if",
"(",
"empty",
"(",
"$",
"result",
"[",
"'id'",
"]",
")",
")",
"{",
"$",
"result"... | Renders single preselected value result.
@param array $data Preselected value data array
@param boolean $singleMode Whether to render hidden output field as
single one or as part of tabular data collection
@return array | [
"Renders",
"single",
"preselected",
"value",
"result",
"."
] | 2643d1c81c4d1b10ac04ebe61e49930be4dfc591 | https://github.com/bizley/Yii2-AjaxDropDown/blob/2643d1c81c4d1b10ac04ebe61e49930be4dfc591/src/AjaxDropdown.php#L1033-L1074 |
189,862 | redooor/redminportal | src/App/Http/Controllers/OrderController.php | OrderController.addModelToArray | private function addModelToArray($models, $model)
{
$apply_to_models = array();
if (count($models) > 0) {
foreach ($models as $item_json) {
$item = json_decode($item_json);
$object = $model->find($item->id);
if ($object != null) {
... | php | private function addModelToArray($models, $model)
{
$apply_to_models = array();
if (count($models) > 0) {
foreach ($models as $item_json) {
$item = json_decode($item_json);
$object = $model->find($item->id);
if ($object != null) {
... | [
"private",
"function",
"addModelToArray",
"(",
"$",
"models",
",",
"$",
"model",
")",
"{",
"$",
"apply_to_models",
"=",
"array",
"(",
")",
";",
"if",
"(",
"count",
"(",
"$",
"models",
")",
">",
"0",
")",
"{",
"foreach",
"(",
"$",
"models",
"as",
"$... | Add model to array, content is JSON string
@param array $models
@param object $model Model
@return array | [
"Add",
"model",
"to",
"array",
"content",
"is",
"JSON",
"string"
] | 3c166cfa0574d0b2439a6e0db5513407066bd0f6 | https://github.com/redooor/redminportal/blob/3c166cfa0574d0b2439a6e0db5513407066bd0f6/src/App/Http/Controllers/OrderController.php#L183-L200 |
189,863 | redooor/redminportal | src/App/Http/Controllers/OrderController.php | OrderController.addModelToArraySimpleMode | private function addModelToArraySimpleMode($models, $model)
{
$apply_to_models = array();
if (count($models) > 0) {
foreach ($models as $item) {
$object = $model->find($item);
if ($object != null) {
$apply_to_models[] = $object... | php | private function addModelToArraySimpleMode($models, $model)
{
$apply_to_models = array();
if (count($models) > 0) {
foreach ($models as $item) {
$object = $model->find($item);
if ($object != null) {
$apply_to_models[] = $object... | [
"private",
"function",
"addModelToArraySimpleMode",
"(",
"$",
"models",
",",
"$",
"model",
")",
"{",
"$",
"apply_to_models",
"=",
"array",
"(",
")",
";",
"if",
"(",
"count",
"(",
"$",
"models",
")",
">",
"0",
")",
"{",
"foreach",
"(",
"$",
"models",
... | Add model to array, simple mode, content is NOT JSON string
@param array $models
@param object $model Model
@return array | [
"Add",
"model",
"to",
"array",
"simple",
"mode",
"content",
"is",
"NOT",
"JSON",
"string"
] | 3c166cfa0574d0b2439a6e0db5513407066bd0f6 | https://github.com/redooor/redminportal/blob/3c166cfa0574d0b2439a6e0db5513407066bd0f6/src/App/Http/Controllers/OrderController.php#L210-L224 |
189,864 | redooor/redminportal | src/App/Http/Controllers/OrderController.php | OrderController.addCouponToOrder | private function addCouponToOrder($coupons, $new_order)
{
$errors = new \Illuminate\Support\MessageBag;
if (count($coupons) > 0) {
foreach ($coupons as $item) {
$model = Coupon::find($item);
if ($model != null) {
try {
... | php | private function addCouponToOrder($coupons, $new_order)
{
$errors = new \Illuminate\Support\MessageBag;
if (count($coupons) > 0) {
foreach ($coupons as $item) {
$model = Coupon::find($item);
if ($model != null) {
try {
... | [
"private",
"function",
"addCouponToOrder",
"(",
"$",
"coupons",
",",
"$",
"new_order",
")",
"{",
"$",
"errors",
"=",
"new",
"\\",
"Illuminate",
"\\",
"Support",
"\\",
"MessageBag",
";",
"if",
"(",
"count",
"(",
"$",
"coupons",
")",
">",
"0",
")",
"{",
... | Add coupons to order
@param array $coupons
@param object $new_order Order
@return array | [
"Add",
"coupons",
"to",
"order"
] | 3c166cfa0574d0b2439a6e0db5513407066bd0f6 | https://github.com/redooor/redminportal/blob/3c166cfa0574d0b2439a6e0db5513407066bd0f6/src/App/Http/Controllers/OrderController.php#L234-L259 |
189,865 | redooor/redminportal | src/App/Http/Controllers/OrderController.php | OrderController.validateStoreInputs | private function validateStoreInputs($inputs)
{
$rules = array(
'selected_products' => 'required_without_all:selected_bundles,pricelist_id',
'selected_bundles' => 'required_without_all:selected_products,pricelist_id',
'pricelist_id' => 'required_without_all:selected... | php | private function validateStoreInputs($inputs)
{
$rules = array(
'selected_products' => 'required_without_all:selected_bundles,pricelist_id',
'selected_bundles' => 'required_without_all:selected_products,pricelist_id',
'pricelist_id' => 'required_without_all:selected... | [
"private",
"function",
"validateStoreInputs",
"(",
"$",
"inputs",
")",
"{",
"$",
"rules",
"=",
"array",
"(",
"'selected_products'",
"=>",
"'required_without_all:selected_bundles,pricelist_id'",
",",
"'selected_bundles'",
"=>",
"'required_without_all:selected_products,pricelist_... | Validates inputs before storing data
@param array $inputs
@return object Validator | [
"Validates",
"inputs",
"before",
"storing",
"data"
] | 3c166cfa0574d0b2439a6e0db5513407066bd0f6 | https://github.com/redooor/redminportal/blob/3c166cfa0574d0b2439a6e0db5513407066bd0f6/src/App/Http/Controllers/OrderController.php#L268-L290 |
189,866 | redooor/redminportal | src/database/upgrades/2015_05_21_000000_upgrade_innodb_table.php | UpgradeInnodbTable.up | public function up()
{
// CAUTION: only works and tested on MySQL
// Legacy support, default type MyISAM doesn't support foreign key
// Convert table to InnoDB
if (Schema::hasTable('products')) {
DB::statement('ALTER TABLE products ENGINE = InnoDB');
}
... | php | public function up()
{
// CAUTION: only works and tested on MySQL
// Legacy support, default type MyISAM doesn't support foreign key
// Convert table to InnoDB
if (Schema::hasTable('products')) {
DB::statement('ALTER TABLE products ENGINE = InnoDB');
}
... | [
"public",
"function",
"up",
"(",
")",
"{",
"// CAUTION: only works and tested on MySQL",
"// Legacy support, default type MyISAM doesn't support foreign key",
"// Convert table to InnoDB",
"if",
"(",
"Schema",
"::",
"hasTable",
"(",
"'products'",
")",
")",
"{",
"DB",
"::",
... | Run the migrations.
Upgrade tables with foreign keys to InnoDB type
@return void | [
"Run",
"the",
"migrations",
".",
"Upgrade",
"tables",
"with",
"foreign",
"keys",
"to",
"InnoDB",
"type"
] | 3c166cfa0574d0b2439a6e0db5513407066bd0f6 | https://github.com/redooor/redminportal/blob/3c166cfa0574d0b2439a6e0db5513407066bd0f6/src/database/upgrades/2015_05_21_000000_upgrade_innodb_table.php#L14-L46 |
189,867 | redooor/redminportal | src/App/Http/Controllers/ImageController.php | ImageController.getDelete | public function getDelete($sid)
{
$image = Image::find($sid);
if ($image == null) {
$errors = new MessageBag;
$errors->add('deleteError', trans('redminportal::messages.error_delete_image'));
return redirect()->back()->withErrors($errors);
}
... | php | public function getDelete($sid)
{
$image = Image::find($sid);
if ($image == null) {
$errors = new MessageBag;
$errors->add('deleteError', trans('redminportal::messages.error_delete_image'));
return redirect()->back()->withErrors($errors);
}
... | [
"public",
"function",
"getDelete",
"(",
"$",
"sid",
")",
"{",
"$",
"image",
"=",
"Image",
"::",
"find",
"(",
"$",
"sid",
")",
";",
"if",
"(",
"$",
"image",
"==",
"null",
")",
"{",
"$",
"errors",
"=",
"new",
"MessageBag",
";",
"$",
"errors",
"->",... | Delete Image by ID
@param integer Image ID to be removed | [
"Delete",
"Image",
"by",
"ID"
] | 3c166cfa0574d0b2439a6e0db5513407066bd0f6 | https://github.com/redooor/redminportal/blob/3c166cfa0574d0b2439a6e0db5513407066bd0f6/src/App/Http/Controllers/ImageController.php#L21-L34 |
189,868 | redooor/redminportal | src/App/Classes/File.php | File.getPlaytime | public function getPlaytime()
{
if (file_exists($this)) {
$ThisFileInfo = $this->getID3Info->analyze($this);
$len = @$ThisFileInfo['playtime_string'];
if ($len != null) {
return $len;
}
}
return null;
... | php | public function getPlaytime()
{
if (file_exists($this)) {
$ThisFileInfo = $this->getID3Info->analyze($this);
$len = @$ThisFileInfo['playtime_string'];
if ($len != null) {
return $len;
}
}
return null;
... | [
"public",
"function",
"getPlaytime",
"(",
")",
"{",
"if",
"(",
"file_exists",
"(",
"$",
"this",
")",
")",
"{",
"$",
"ThisFileInfo",
"=",
"$",
"this",
"->",
"getID3Info",
"->",
"analyze",
"(",
"$",
"this",
")",
";",
"$",
"len",
"=",
"@",
"$",
"ThisF... | Returns the playtime of the media.
The media playtime meta is retrieved using GetId3.
Refer to http://www.getid3.org/
@return string|null Retrieved playtime info | [
"Returns",
"the",
"playtime",
"of",
"the",
"media",
"."
] | 3c166cfa0574d0b2439a6e0db5513407066bd0f6 | https://github.com/redooor/redminportal/blob/3c166cfa0574d0b2439a6e0db5513407066bd0f6/src/App/Classes/File.php#L54-L67 |
189,869 | welpdev/mailchimp-bundle | src/Provider/ProviderFactory.php | ProviderFactory.create | public function create($providerServiceKey)
{
try {
$provider = $this->container->get($providerServiceKey);
} catch (ServiceNotFoundException $e) {
throw new \InvalidArgumentException(sprintf('Provider "%s" should be defined as a service.', $providerServiceKey), $e->getCode(... | php | public function create($providerServiceKey)
{
try {
$provider = $this->container->get($providerServiceKey);
} catch (ServiceNotFoundException $e) {
throw new \InvalidArgumentException(sprintf('Provider "%s" should be defined as a service.', $providerServiceKey), $e->getCode(... | [
"public",
"function",
"create",
"(",
"$",
"providerServiceKey",
")",
"{",
"try",
"{",
"$",
"provider",
"=",
"$",
"this",
"->",
"container",
"->",
"get",
"(",
"$",
"providerServiceKey",
")",
";",
"}",
"catch",
"(",
"ServiceNotFoundException",
"$",
"e",
")",... | Get subscriber provider
@param string $providerServiceKey
@return ProviderInterface $provider | [
"Get",
"subscriber",
"provider"
] | b12e65c208fe47b4cac5d4a4394a0ba649e5fc44 | https://github.com/welpdev/mailchimp-bundle/blob/b12e65c208fe47b4cac5d4a4394a0ba649e5fc44/src/Provider/ProviderFactory.php#L22-L35 |
189,870 | welpdev/mailchimp-bundle | src/Subscriber/ListSynchronizer.php | ListSynchronizer.synchronize | public function synchronize(SubscriberListInterface $list)
{
$listData = $this->listRepository->findById($list->getListId());
// get Subscribers from the provider
$subscribers = $list->getProvider()->getSubscribers();
// unsubscribe difference
$this->unsubscribeDifference($... | php | public function synchronize(SubscriberListInterface $list)
{
$listData = $this->listRepository->findById($list->getListId());
// get Subscribers from the provider
$subscribers = $list->getProvider()->getSubscribers();
// unsubscribe difference
$this->unsubscribeDifference($... | [
"public",
"function",
"synchronize",
"(",
"SubscriberListInterface",
"$",
"list",
")",
"{",
"$",
"listData",
"=",
"$",
"this",
"->",
"listRepository",
"->",
"findById",
"(",
"$",
"list",
"->",
"getListId",
"(",
")",
")",
";",
"// get Subscribers from the provide... | Synchronise user from provider with MailChimp List
@param SubscriberListInterface $list
@return void | [
"Synchronise",
"user",
"from",
"provider",
"with",
"MailChimp",
"List"
] | b12e65c208fe47b4cac5d4a4394a0ba649e5fc44 | https://github.com/welpdev/mailchimp-bundle/blob/b12e65c208fe47b4cac5d4a4394a0ba649e5fc44/src/Subscriber/ListSynchronizer.php#L28-L39 |
189,871 | welpdev/mailchimp-bundle | src/Subscriber/ListSynchronizer.php | ListSynchronizer.unsubscribeDifference | protected function unsubscribeDifference($listId, array $subscribers)
{
$mailchimpEmails = $this->listRepository->getSubscriberEmails($listId);
$internalEmails = array_map(function (Subscriber $subscriber) {
return $subscriber->getEmail();
}, $subscribers);
// emails tha... | php | protected function unsubscribeDifference($listId, array $subscribers)
{
$mailchimpEmails = $this->listRepository->getSubscriberEmails($listId);
$internalEmails = array_map(function (Subscriber $subscriber) {
return $subscriber->getEmail();
}, $subscribers);
// emails tha... | [
"protected",
"function",
"unsubscribeDifference",
"(",
"$",
"listId",
",",
"array",
"$",
"subscribers",
")",
"{",
"$",
"mailchimpEmails",
"=",
"$",
"this",
"->",
"listRepository",
"->",
"getSubscriberEmails",
"(",
"$",
"listId",
")",
";",
"$",
"internalEmails",
... | Unsubscribe the difference between the array subscriber an user
@param string $listId
@param array $subscribers
@return void | [
"Unsubscribe",
"the",
"difference",
"between",
"the",
"array",
"subscriber",
"an",
"user"
] | b12e65c208fe47b4cac5d4a4394a0ba649e5fc44 | https://github.com/welpdev/mailchimp-bundle/blob/b12e65c208fe47b4cac5d4a4394a0ba649e5fc44/src/Subscriber/ListSynchronizer.php#L58-L72 |
189,872 | welpdev/mailchimp-bundle | src/Subscriber/ListSynchronizer.php | ListSynchronizer.tagExists | protected function tagExists($tagName, array $tags)
{
foreach ($tags as $tag) {
if ($tag['tag'] == $tagName) {
if (array_key_exists('merge_id', $tag)) {
return $tag['merge_id'];
}
return true;
}
}
ret... | php | protected function tagExists($tagName, array $tags)
{
foreach ($tags as $tag) {
if ($tag['tag'] == $tagName) {
if (array_key_exists('merge_id', $tag)) {
return $tag['merge_id'];
}
return true;
}
}
ret... | [
"protected",
"function",
"tagExists",
"(",
"$",
"tagName",
",",
"array",
"$",
"tags",
")",
"{",
"foreach",
"(",
"$",
"tags",
"as",
"$",
"tag",
")",
"{",
"if",
"(",
"$",
"tag",
"[",
"'tag'",
"]",
"==",
"$",
"tagName",
")",
"{",
"if",
"(",
"array_k... | Test if the merge field Tag exists in an array
@param string $tagName
@param array $tags
@return mixed (Boolean true|false) or $tag['merge_id'] | [
"Test",
"if",
"the",
"merge",
"field",
"Tag",
"exists",
"in",
"an",
"array"
] | b12e65c208fe47b4cac5d4a4394a0ba649e5fc44 | https://github.com/welpdev/mailchimp-bundle/blob/b12e65c208fe47b4cac5d4a4394a0ba649e5fc44/src/Subscriber/ListSynchronizer.php#L107-L118 |
189,873 | gitllermopalafox/Laravel-OWM | src/Http/Controllers/LaravelOWMController.php | LaravelOWMController.parseData | private function parseData($obj)
{
$data = [
'temperature' => [
'now' => [
'value' => $obj->temperature->now->getValue(),
'unit' => $obj->temperature->now->getUnit()
],
'min' => [
'value' ... | php | private function parseData($obj)
{
$data = [
'temperature' => [
'now' => [
'value' => $obj->temperature->now->getValue(),
'unit' => $obj->temperature->now->getUnit()
],
'min' => [
'value' ... | [
"private",
"function",
"parseData",
"(",
"$",
"obj",
")",
"{",
"$",
"data",
"=",
"[",
"'temperature'",
"=>",
"[",
"'now'",
"=>",
"[",
"'value'",
"=>",
"$",
"obj",
"->",
"temperature",
"->",
"now",
"->",
"getValue",
"(",
")",
",",
"'unit'",
"=>",
"$",... | Helper function to parse data.
@param $obj
@return array | [
"Helper",
"function",
"to",
"parse",
"data",
"."
] | dae518c92d0c64218c696ec03778ef7ac831e61b | https://github.com/gitllermopalafox/Laravel-OWM/blob/dae518c92d0c64218c696ec03778ef7ac831e61b/src/Http/Controllers/LaravelOWMController.php#L183-L243 |
189,874 | welpdev/mailchimp-bundle | src/Event/SubscriberListener.php | SubscriberListener.onSubscribe | public function onSubscribe(SubscriberEvent $event)
{
$this->listRepository->subscribe(
$event->getListId(),
$event->getSubscriber()
);
} | php | public function onSubscribe(SubscriberEvent $event)
{
$this->listRepository->subscribe(
$event->getListId(),
$event->getSubscriber()
);
} | [
"public",
"function",
"onSubscribe",
"(",
"SubscriberEvent",
"$",
"event",
")",
"{",
"$",
"this",
"->",
"listRepository",
"->",
"subscribe",
"(",
"$",
"event",
"->",
"getListId",
"(",
")",
",",
"$",
"event",
"->",
"getSubscriber",
"(",
")",
")",
";",
"}"... | Action when a User subscribe
@param SubscriberEvent $event
@return void | [
"Action",
"when",
"a",
"User",
"subscribe"
] | b12e65c208fe47b4cac5d4a4394a0ba649e5fc44 | https://github.com/welpdev/mailchimp-bundle/blob/b12e65c208fe47b4cac5d4a4394a0ba649e5fc44/src/Event/SubscriberListener.php#L31-L37 |
189,875 | welpdev/mailchimp-bundle | src/Event/SubscriberListener.php | SubscriberListener.onUnsubscribe | public function onUnsubscribe(SubscriberEvent $event)
{
$this->listRepository->unsubscribe(
$event->getListId(),
$event->getSubscriber()
);
} | php | public function onUnsubscribe(SubscriberEvent $event)
{
$this->listRepository->unsubscribe(
$event->getListId(),
$event->getSubscriber()
);
} | [
"public",
"function",
"onUnsubscribe",
"(",
"SubscriberEvent",
"$",
"event",
")",
"{",
"$",
"this",
"->",
"listRepository",
"->",
"unsubscribe",
"(",
"$",
"event",
"->",
"getListId",
"(",
")",
",",
"$",
"event",
"->",
"getSubscriber",
"(",
")",
")",
";",
... | Action when a User unsubscribe
@param SubscriberEvent $event
@return void | [
"Action",
"when",
"a",
"User",
"unsubscribe"
] | b12e65c208fe47b4cac5d4a4394a0ba649e5fc44 | https://github.com/welpdev/mailchimp-bundle/blob/b12e65c208fe47b4cac5d4a4394a0ba649e5fc44/src/Event/SubscriberListener.php#L44-L50 |
189,876 | welpdev/mailchimp-bundle | src/Event/SubscriberListener.php | SubscriberListener.onPending | public function onPending(SubscriberEvent $event)
{
$this->listRepository->pending(
$event->getListId(),
$event->getSubscriber()
);
} | php | public function onPending(SubscriberEvent $event)
{
$this->listRepository->pending(
$event->getListId(),
$event->getSubscriber()
);
} | [
"public",
"function",
"onPending",
"(",
"SubscriberEvent",
"$",
"event",
")",
"{",
"$",
"this",
"->",
"listRepository",
"->",
"pending",
"(",
"$",
"event",
"->",
"getListId",
"(",
")",
",",
"$",
"event",
"->",
"getSubscriber",
"(",
")",
")",
";",
"}"
] | Action when a User is pending
@param SubscriberEvent $event
@return void | [
"Action",
"when",
"a",
"User",
"is",
"pending"
] | b12e65c208fe47b4cac5d4a4394a0ba649e5fc44 | https://github.com/welpdev/mailchimp-bundle/blob/b12e65c208fe47b4cac5d4a4394a0ba649e5fc44/src/Event/SubscriberListener.php#L57-L63 |
189,877 | welpdev/mailchimp-bundle | src/Event/SubscriberListener.php | SubscriberListener.onClean | public function onClean(SubscriberEvent $event)
{
$this->listRepository->clean(
$event->getListId(),
$event->getSubscriber()
);
} | php | public function onClean(SubscriberEvent $event)
{
$this->listRepository->clean(
$event->getListId(),
$event->getSubscriber()
);
} | [
"public",
"function",
"onClean",
"(",
"SubscriberEvent",
"$",
"event",
")",
"{",
"$",
"this",
"->",
"listRepository",
"->",
"clean",
"(",
"$",
"event",
"->",
"getListId",
"(",
")",
",",
"$",
"event",
"->",
"getSubscriber",
"(",
")",
")",
";",
"}"
] | Action when a User is cleaned
@param SubscriberEvent $event
@return void | [
"Action",
"when",
"a",
"User",
"is",
"cleaned"
] | b12e65c208fe47b4cac5d4a4394a0ba649e5fc44 | https://github.com/welpdev/mailchimp-bundle/blob/b12e65c208fe47b4cac5d4a4394a0ba649e5fc44/src/Event/SubscriberListener.php#L70-L76 |
189,878 | welpdev/mailchimp-bundle | src/Event/SubscriberListener.php | SubscriberListener.onUpdate | public function onUpdate(SubscriberEvent $event)
{
$this->listRepository->update(
$event->getListId(),
$event->getSubscriber()
);
} | php | public function onUpdate(SubscriberEvent $event)
{
$this->listRepository->update(
$event->getListId(),
$event->getSubscriber()
);
} | [
"public",
"function",
"onUpdate",
"(",
"SubscriberEvent",
"$",
"event",
")",
"{",
"$",
"this",
"->",
"listRepository",
"->",
"update",
"(",
"$",
"event",
"->",
"getListId",
"(",
")",
",",
"$",
"event",
"->",
"getSubscriber",
"(",
")",
")",
";",
"}"
] | Action when a User update its info
@param SubscriberEvent $event
@return void | [
"Action",
"when",
"a",
"User",
"update",
"its",
"info"
] | b12e65c208fe47b4cac5d4a4394a0ba649e5fc44 | https://github.com/welpdev/mailchimp-bundle/blob/b12e65c208fe47b4cac5d4a4394a0ba649e5fc44/src/Event/SubscriberListener.php#L83-L89 |
189,879 | welpdev/mailchimp-bundle | src/Event/SubscriberListener.php | SubscriberListener.onChangeEmail | public function onChangeEmail(SubscriberEvent $event)
{
$this->listRepository->changeEmailAddress(
$event->getListId(),
$event->getSubscriber(),
$event->getOldEmail()
);
} | php | public function onChangeEmail(SubscriberEvent $event)
{
$this->listRepository->changeEmailAddress(
$event->getListId(),
$event->getSubscriber(),
$event->getOldEmail()
);
} | [
"public",
"function",
"onChangeEmail",
"(",
"SubscriberEvent",
"$",
"event",
")",
"{",
"$",
"this",
"->",
"listRepository",
"->",
"changeEmailAddress",
"(",
"$",
"event",
"->",
"getListId",
"(",
")",
",",
"$",
"event",
"->",
"getSubscriber",
"(",
")",
",",
... | Action when a User change its email address
@param SubscriberEvent $event
@return void | [
"Action",
"when",
"a",
"User",
"change",
"its",
"email",
"address"
] | b12e65c208fe47b4cac5d4a4394a0ba649e5fc44 | https://github.com/welpdev/mailchimp-bundle/blob/b12e65c208fe47b4cac5d4a4394a0ba649e5fc44/src/Event/SubscriberListener.php#L96-L103 |
189,880 | welpdev/mailchimp-bundle | src/Event/SubscriberListener.php | SubscriberListener.onDelete | public function onDelete(SubscriberEvent $event)
{
$this->listRepository->delete(
$event->getListId(),
$event->getSubscriber()
);
} | php | public function onDelete(SubscriberEvent $event)
{
$this->listRepository->delete(
$event->getListId(),
$event->getSubscriber()
);
} | [
"public",
"function",
"onDelete",
"(",
"SubscriberEvent",
"$",
"event",
")",
"{",
"$",
"this",
"->",
"listRepository",
"->",
"delete",
"(",
"$",
"event",
"->",
"getListId",
"(",
")",
",",
"$",
"event",
"->",
"getSubscriber",
"(",
")",
")",
";",
"}"
] | Action when a User is deleted
@param SubscriberEvent $event
@return void | [
"Action",
"when",
"a",
"User",
"is",
"deleted"
] | b12e65c208fe47b4cac5d4a4394a0ba649e5fc44 | https://github.com/welpdev/mailchimp-bundle/blob/b12e65c208fe47b4cac5d4a4394a0ba649e5fc44/src/Event/SubscriberListener.php#L110-L116 |
189,881 | welpdev/mailchimp-bundle | src/Subscriber/ListRepository.php | ListRepository.findById | public function findById($listId)
{
$listData = $this->mailchimp->get("lists/$listId");
if (!$this->mailchimp->success()) {
$this->throwMailchimpError($this->mailchimp->getLastResponse());
}
return $listData;
} | php | public function findById($listId)
{
$listData = $this->mailchimp->get("lists/$listId");
if (!$this->mailchimp->success()) {
$this->throwMailchimpError($this->mailchimp->getLastResponse());
}
return $listData;
} | [
"public",
"function",
"findById",
"(",
"$",
"listId",
")",
"{",
"$",
"listData",
"=",
"$",
"this",
"->",
"mailchimp",
"->",
"get",
"(",
"\"lists/$listId\"",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"mailchimp",
"->",
"success",
"(",
")",
")",
"{"... | Find MailChimp List by list Id
@param string $listId
@return array list http://developer.mailchimp.com/documentation/mailchimp/reference/lists/#read-get_lists_list_id | [
"Find",
"MailChimp",
"List",
"by",
"list",
"Id"
] | b12e65c208fe47b4cac5d4a4394a0ba649e5fc44 | https://github.com/welpdev/mailchimp-bundle/blob/b12e65c208fe47b4cac5d4a4394a0ba649e5fc44/src/Subscriber/ListRepository.php#L54-L62 |
189,882 | welpdev/mailchimp-bundle | src/Subscriber/ListRepository.php | ListRepository.delete | public function delete($listId, Subscriber $subscriber)
{
$subscriberHash = $this->mailchimp->subscriberHash($subscriber->getEmail());
$result = $this->mailchimp->delete("lists/$listId/members/$subscriberHash");
if (!$this->mailchimp->success()) {
$this->throwMailchimpError($thi... | php | public function delete($listId, Subscriber $subscriber)
{
$subscriberHash = $this->mailchimp->subscriberHash($subscriber->getEmail());
$result = $this->mailchimp->delete("lists/$listId/members/$subscriberHash");
if (!$this->mailchimp->success()) {
$this->throwMailchimpError($thi... | [
"public",
"function",
"delete",
"(",
"$",
"listId",
",",
"Subscriber",
"$",
"subscriber",
")",
"{",
"$",
"subscriberHash",
"=",
"$",
"this",
"->",
"mailchimp",
"->",
"subscriberHash",
"(",
"$",
"subscriber",
"->",
"getEmail",
"(",
")",
")",
";",
"$",
"re... | Delete a Subscriber to a list
@param string $listId
@param Subscriber $subscriber | [
"Delete",
"a",
"Subscriber",
"to",
"a",
"list"
] | b12e65c208fe47b4cac5d4a4394a0ba649e5fc44 | https://github.com/welpdev/mailchimp-bundle/blob/b12e65c208fe47b4cac5d4a4394a0ba649e5fc44/src/Subscriber/ListRepository.php#L221-L231 |
189,883 | welpdev/mailchimp-bundle | src/Subscriber/ListRepository.php | ListRepository.batchSubscribe | public function batchSubscribe($listId, array $subscribers)
{
$batchResults = [];
// as suggested in MailChimp API docs, we send multiple smaller requests instead of a bigger one
$subscriberChunks = array_chunk($subscribers, self::SUBSCRIBER_BATCH_SIZE);
foreach ($subscriberChunks as... | php | public function batchSubscribe($listId, array $subscribers)
{
$batchResults = [];
// as suggested in MailChimp API docs, we send multiple smaller requests instead of a bigger one
$subscriberChunks = array_chunk($subscribers, self::SUBSCRIBER_BATCH_SIZE);
foreach ($subscriberChunks as... | [
"public",
"function",
"batchSubscribe",
"(",
"$",
"listId",
",",
"array",
"$",
"subscribers",
")",
"{",
"$",
"batchResults",
"=",
"[",
"]",
";",
"// as suggested in MailChimp API docs, we send multiple smaller requests instead of a bigger one",
"$",
"subscriberChunks",
"=",... | Subscribe a batch of Subscriber to a list
@param string $listId
@param array $subscribers
@return array $batchIds | [
"Subscribe",
"a",
"batch",
"of",
"Subscriber",
"to",
"a",
"list"
] | b12e65c208fe47b4cac5d4a4394a0ba649e5fc44 | https://github.com/welpdev/mailchimp-bundle/blob/b12e65c208fe47b4cac5d4a4394a0ba649e5fc44/src/Subscriber/ListRepository.php#L239-L258 |
189,884 | welpdev/mailchimp-bundle | src/Subscriber/ListRepository.php | ListRepository.batchDelete | public function batchDelete($listId, array $emails)
{
$batchIds = [];
// as suggested in MailChimp API docs, we send multiple smaller requests instead of a bigger one
$emailsChunks = array_chunk($emails, self::SUBSCRIBER_BATCH_SIZE);
foreach ($emailsChunks as $emailsChunk) {
... | php | public function batchDelete($listId, array $emails)
{
$batchIds = [];
// as suggested in MailChimp API docs, we send multiple smaller requests instead of a bigger one
$emailsChunks = array_chunk($emails, self::SUBSCRIBER_BATCH_SIZE);
foreach ($emailsChunks as $emailsChunk) {
... | [
"public",
"function",
"batchDelete",
"(",
"$",
"listId",
",",
"array",
"$",
"emails",
")",
"{",
"$",
"batchIds",
"=",
"[",
"]",
";",
"// as suggested in MailChimp API docs, we send multiple smaller requests instead of a bigger one",
"$",
"emailsChunks",
"=",
"array_chunk"... | Delete a batch of Subscriber to a list
@param string $listId
@param array $emails
@return array $batchIds | [
"Delete",
"a",
"batch",
"of",
"Subscriber",
"to",
"a",
"list"
] | b12e65c208fe47b4cac5d4a4394a0ba649e5fc44 | https://github.com/welpdev/mailchimp-bundle/blob/b12e65c208fe47b4cac5d4a4394a0ba649e5fc44/src/Subscriber/ListRepository.php#L292-L308 |
189,885 | welpdev/mailchimp-bundle | src/Subscriber/ListRepository.php | ListRepository.getMembers | public function getMembers($listId)
{
$emails = [];
$result = $this->mailchimp->get("lists/$listId/members");
if (!$this->mailchimp->success()) {
$this->throwMailchimpError($this->mailchimp->getLastResponse());
}
return $result;
} | php | public function getMembers($listId)
{
$emails = [];
$result = $this->mailchimp->get("lists/$listId/members");
if (!$this->mailchimp->success()) {
$this->throwMailchimpError($this->mailchimp->getLastResponse());
}
return $result;
} | [
"public",
"function",
"getMembers",
"(",
"$",
"listId",
")",
"{",
"$",
"emails",
"=",
"[",
"]",
";",
"$",
"result",
"=",
"$",
"this",
"->",
"mailchimp",
"->",
"get",
"(",
"\"lists/$listId/members\"",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"mail... | Get Members of a list
@param string $listId
@return array | [
"Get",
"Members",
"of",
"a",
"list"
] | b12e65c208fe47b4cac5d4a4394a0ba649e5fc44 | https://github.com/welpdev/mailchimp-bundle/blob/b12e65c208fe47b4cac5d4a4394a0ba649e5fc44/src/Subscriber/ListRepository.php#L315-L325 |
189,886 | welpdev/mailchimp-bundle | src/Subscriber/ListRepository.php | ListRepository.getSubscriberEmails | public function getSubscriberEmails($listId)
{
$emails = [];
$members = [];
$offset=0;
$maxresult = 200;
$result = $this->mailchimp->get("lists/$listId/members", ['count'=> $maxresult]);
if (!$this->mailchimp->success()) {
$this->throwMailchimpError($this... | php | public function getSubscriberEmails($listId)
{
$emails = [];
$members = [];
$offset=0;
$maxresult = 200;
$result = $this->mailchimp->get("lists/$listId/members", ['count'=> $maxresult]);
if (!$this->mailchimp->success()) {
$this->throwMailchimpError($this... | [
"public",
"function",
"getSubscriberEmails",
"(",
"$",
"listId",
")",
"{",
"$",
"emails",
"=",
"[",
"]",
";",
"$",
"members",
"=",
"[",
"]",
";",
"$",
"offset",
"=",
"0",
";",
"$",
"maxresult",
"=",
"200",
";",
"$",
"result",
"=",
"$",
"this",
"-... | Get an array of subscribers emails from a list
@param string $listId
@return array | [
"Get",
"an",
"array",
"of",
"subscribers",
"emails",
"from",
"a",
"list"
] | b12e65c208fe47b4cac5d4a4394a0ba649e5fc44 | https://github.com/welpdev/mailchimp-bundle/blob/b12e65c208fe47b4cac5d4a4394a0ba649e5fc44/src/Subscriber/ListRepository.php#L332-L365 |
189,887 | welpdev/mailchimp-bundle | src/Subscriber/ListRepository.php | ListRepository.registerMainWebhook | public function registerMainWebhook($listId, $webhookurl)
{
// Configure webhook
$subscribeWebhook = [
'url' => $webhookurl,
'events' => [
'subscribe' => true,
'unsubscribe' => true,
'profile' => true,
'cle... | php | public function registerMainWebhook($listId, $webhookurl)
{
// Configure webhook
$subscribeWebhook = [
'url' => $webhookurl,
'events' => [
'subscribe' => true,
'unsubscribe' => true,
'profile' => true,
'cle... | [
"public",
"function",
"registerMainWebhook",
"(",
"$",
"listId",
",",
"$",
"webhookurl",
")",
"{",
"// Configure webhook",
"$",
"subscribeWebhook",
"=",
"[",
"'url'",
"=>",
"$",
"webhookurl",
",",
"'events'",
"=>",
"[",
"'subscribe'",
"=>",
"true",
",",
"'unsu... | Automatically configure Webhook for a list
@param string $listId
@param string $webhookurl
@return array | [
"Automatically",
"configure",
"Webhook",
"for",
"a",
"list"
] | b12e65c208fe47b4cac5d4a4394a0ba649e5fc44 | https://github.com/welpdev/mailchimp-bundle/blob/b12e65c208fe47b4cac5d4a4394a0ba649e5fc44/src/Subscriber/ListRepository.php#L450-L471 |
189,888 | welpdev/mailchimp-bundle | src/Subscriber/Subscriber.php | Subscriber.formatMailChimp | public function formatMailChimp()
{
$options = $this->options;
if (!empty($this->getMergeFields())) {
$options = array_merge([
'merge_fields' => $this->getMergeFields()
], $options);
}
return array_merge([
'email_address' => $this-... | php | public function formatMailChimp()
{
$options = $this->options;
if (!empty($this->getMergeFields())) {
$options = array_merge([
'merge_fields' => $this->getMergeFields()
], $options);
}
return array_merge([
'email_address' => $this-... | [
"public",
"function",
"formatMailChimp",
"(",
")",
"{",
"$",
"options",
"=",
"$",
"this",
"->",
"options",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"getMergeFields",
"(",
")",
")",
")",
"{",
"$",
"options",
"=",
"array_merge",
"(",
"[",
... | Formate Subscriber for MailChimp API request
@return array | [
"Formate",
"Subscriber",
"for",
"MailChimp",
"API",
"request"
] | b12e65c208fe47b4cac5d4a4394a0ba649e5fc44 | https://github.com/welpdev/mailchimp-bundle/blob/b12e65c208fe47b4cac5d4a4394a0ba649e5fc44/src/Subscriber/Subscriber.php#L46-L58 |
189,889 | welpdev/mailchimp-bundle | src/Subscriber/Subscriber.php | Subscriber.getMergeFields | public function getMergeFields()
{
// since fev2017, MailChimp API doesn't handle null value en throw 400
// errors when you try to add subscriber with a mergefields value to null
foreach ($this->mergeFields as $key => $value) {
if ($value === null) {
unset($this-... | php | public function getMergeFields()
{
// since fev2017, MailChimp API doesn't handle null value en throw 400
// errors when you try to add subscriber with a mergefields value to null
foreach ($this->mergeFields as $key => $value) {
if ($value === null) {
unset($this-... | [
"public",
"function",
"getMergeFields",
"(",
")",
"{",
"// since fev2017, MailChimp API doesn't handle null value en throw 400",
"// errors when you try to add subscriber with a mergefields value to null",
"foreach",
"(",
"$",
"this",
"->",
"mergeFields",
"as",
"$",
"key",
"=>",
... | Correspond to merge_fields in MailChimp request
@return array ['TAGKEY' => value, ...] | [
"Correspond",
"to",
"merge_fields",
"in",
"MailChimp",
"request"
] | b12e65c208fe47b4cac5d4a4394a0ba649e5fc44 | https://github.com/welpdev/mailchimp-bundle/blob/b12e65c208fe47b4cac5d4a4394a0ba649e5fc44/src/Subscriber/Subscriber.php#L92-L102 |
189,890 | php-edifact/edifact-mapping | src/Mapping/MappingProvider.php | MappingProvider.getMessage | public function getMessage($message = "codeco")
{
$folder = $this->_path.SEPARATOR.$this->_directory.SEPARATOR."messages";
return $folder.SEPARATOR.strtolower($message).".xml";
} | php | public function getMessage($message = "codeco")
{
$folder = $this->_path.SEPARATOR.$this->_directory.SEPARATOR."messages";
return $folder.SEPARATOR.strtolower($message).".xml";
} | [
"public",
"function",
"getMessage",
"(",
"$",
"message",
"=",
"\"codeco\"",
")",
"{",
"$",
"folder",
"=",
"$",
"this",
"->",
"_path",
".",
"SEPARATOR",
".",
"$",
"this",
"->",
"_directory",
".",
"SEPARATOR",
".",
"\"messages\"",
";",
"return",
"$",
"fold... | Get path to xml message
@param string $message Message name
@return string | [
"Get",
"path",
"to",
"xml",
"message"
] | f1c150fc8de7056a25d3b48f52baee24fd57ddc7 | https://github.com/php-edifact/edifact-mapping/blob/f1c150fc8de7056a25d3b48f52baee24fd57ddc7/src/Mapping/MappingProvider.php#L116-L120 |
189,891 | php-edifact/edifact-mapping | src/Mapping/MappingProvider.php | MappingProvider.getServiceMessages | public function getServiceMessages($version = '3', $message = 'contrl')
{
$folder = $this->_path.SEPARATOR."Service_V".$version.SEPARATOR."messages";
return $folder.SEPARATOR.strtolower($message).".xml";
} | php | public function getServiceMessages($version = '3', $message = 'contrl')
{
$folder = $this->_path.SEPARATOR."Service_V".$version.SEPARATOR."messages";
return $folder.SEPARATOR.strtolower($message).".xml";
} | [
"public",
"function",
"getServiceMessages",
"(",
"$",
"version",
"=",
"'3'",
",",
"$",
"message",
"=",
"'contrl'",
")",
"{",
"$",
"folder",
"=",
"$",
"this",
"->",
"_path",
".",
"SEPARATOR",
".",
"\"Service_V\"",
".",
"$",
"version",
".",
"SEPARATOR",
".... | Get path to service messages xml
@param string $version
@param string $message
@return string | [
"Get",
"path",
"to",
"service",
"messages",
"xml"
] | f1c150fc8de7056a25d3b48f52baee24fd57ddc7 | https://github.com/php-edifact/edifact-mapping/blob/f1c150fc8de7056a25d3b48f52baee24fd57ddc7/src/Mapping/MappingProvider.php#L152-L156 |
189,892 | php-edifact/edifact-mapping | src/Mapping/MappingProvider.php | MappingProvider.listMessages | public function listMessages()
{
$folder = $this->_path.SEPARATOR.$this->_directory.SEPARATOR."messages";
$messages = array_slice(scandir($folder), 2);
foreach ($messages as &$msg) {
$msg = str_replace('.xml', '', $msg);
}
return $messages;
} | php | public function listMessages()
{
$folder = $this->_path.SEPARATOR.$this->_directory.SEPARATOR."messages";
$messages = array_slice(scandir($folder), 2);
foreach ($messages as &$msg) {
$msg = str_replace('.xml', '', $msg);
}
return $messages;
} | [
"public",
"function",
"listMessages",
"(",
")",
"{",
"$",
"folder",
"=",
"$",
"this",
"->",
"_path",
".",
"SEPARATOR",
".",
"$",
"this",
"->",
"_directory",
".",
"SEPARATOR",
".",
"\"messages\"",
";",
"$",
"messages",
"=",
"array_slice",
"(",
"scandir",
... | Get message names from folder in this directory
@return array | [
"Get",
"message",
"names",
"from",
"folder",
"in",
"this",
"directory"
] | f1c150fc8de7056a25d3b48f52baee24fd57ddc7 | https://github.com/php-edifact/edifact-mapping/blob/f1c150fc8de7056a25d3b48f52baee24fd57ddc7/src/Mapping/MappingProvider.php#L163-L171 |
189,893 | welpdev/mailchimp-bundle | src/Provider/ConfigListProvider.php | ConfigListProvider.createList | private function createList($listId, $listParameters)
{
$providerServiceKey = $listParameters['subscriber_provider'];
$provider = $this->providerFactory->create($providerServiceKey);
$subscriberList = new SubscriberList($listId, $provider, $listParameters['merge_fields']);
$subscribe... | php | private function createList($listId, $listParameters)
{
$providerServiceKey = $listParameters['subscriber_provider'];
$provider = $this->providerFactory->create($providerServiceKey);
$subscriberList = new SubscriberList($listId, $provider, $listParameters['merge_fields']);
$subscribe... | [
"private",
"function",
"createList",
"(",
"$",
"listId",
",",
"$",
"listParameters",
")",
"{",
"$",
"providerServiceKey",
"=",
"$",
"listParameters",
"[",
"'subscriber_provider'",
"]",
";",
"$",
"provider",
"=",
"$",
"this",
"->",
"providerFactory",
"->",
"cre... | create one SubscriberList
@param string $listId
@param string $listParameters
@return SubscriberList | [
"create",
"one",
"SubscriberList"
] | b12e65c208fe47b4cac5d4a4394a0ba649e5fc44 | https://github.com/welpdev/mailchimp-bundle/blob/b12e65c208fe47b4cac5d4a4394a0ba649e5fc44/src/Provider/ConfigListProvider.php#L57-L66 |
189,894 | welpdev/mailchimp-bundle | src/Command/SynchronizeSubscribersCommand.php | SynchronizeSubscribersCommand.refreshBatchesResult | private function refreshBatchesResult($batchesResult)
{
$refreshedBatchsResults = [];
$mailchimp = $this->getContainer()->get('welp_mailchimp.mailchimp_master');
foreach ($batchesResult as $key => $batch) {
$batch = $mailchimp->get("batches/".$batch['id']);
array_push... | php | private function refreshBatchesResult($batchesResult)
{
$refreshedBatchsResults = [];
$mailchimp = $this->getContainer()->get('welp_mailchimp.mailchimp_master');
foreach ($batchesResult as $key => $batch) {
$batch = $mailchimp->get("batches/".$batch['id']);
array_push... | [
"private",
"function",
"refreshBatchesResult",
"(",
"$",
"batchesResult",
")",
"{",
"$",
"refreshedBatchsResults",
"=",
"[",
"]",
";",
"$",
"mailchimp",
"=",
"$",
"this",
"->",
"getContainer",
"(",
")",
"->",
"get",
"(",
"'welp_mailchimp.mailchimp_master'",
")",... | Refresh all batch from MailChimp API
@param array $batchesResult
@return array | [
"Refresh",
"all",
"batch",
"from",
"MailChimp",
"API"
] | b12e65c208fe47b4cac5d4a4394a0ba649e5fc44 | https://github.com/welpdev/mailchimp-bundle/blob/b12e65c208fe47b4cac5d4a4394a0ba649e5fc44/src/Command/SynchronizeSubscribersCommand.php#L72-L81 |
189,895 | kalfheim/critical-css | src/CssGenerators/CriticalGenerator.php | CriticalGenerator.setOptions | public function setOptions($width = 900, $height = 1300, array $ignore = [], $timeout = null)
{
$this->width = $width;
$this->height = $height;
$this->ignore = $ignore;
$this->timeout = $timeout;
} | php | public function setOptions($width = 900, $height = 1300, array $ignore = [], $timeout = null)
{
$this->width = $width;
$this->height = $height;
$this->ignore = $ignore;
$this->timeout = $timeout;
} | [
"public",
"function",
"setOptions",
"(",
"$",
"width",
"=",
"900",
",",
"$",
"height",
"=",
"1300",
",",
"array",
"$",
"ignore",
"=",
"[",
"]",
",",
"$",
"timeout",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"width",
"=",
"$",
"width",
";",
"$",
... | Set optional options for Critical.
@param int $width
@param int $height
@param array $ignore
@param int|null $timeout
@return void | [
"Set",
"optional",
"options",
"for",
"Critical",
"."
] | a9e9e065fc3611e9c723735e879fa0f6b1ad4d5c | https://github.com/kalfheim/critical-css/blob/a9e9e065fc3611e9c723735e879fa0f6b1ad4d5c/src/CssGenerators/CriticalGenerator.php#L74-L80 |
189,896 | kalfheim/critical-css | src/CriticalCssServiceProvider.php | CriticalCssServiceProvider.shouldRegisterBladeDirective | protected function shouldRegisterBladeDirective()
{
if (!$this->app['config']->get('criticalcss.blade_directive')) {
return false;
}
if ($this->app->runningInConsole()) {
return false;
}
return true;
} | php | protected function shouldRegisterBladeDirective()
{
if (!$this->app['config']->get('criticalcss.blade_directive')) {
return false;
}
if ($this->app->runningInConsole()) {
return false;
}
return true;
} | [
"protected",
"function",
"shouldRegisterBladeDirective",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"app",
"[",
"'config'",
"]",
"->",
"get",
"(",
"'criticalcss.blade_directive'",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"$",
"this",
... | Should the Blade directive be registered?
Fixes compatibility issues with Laravel 5.0.
@return bool | [
"Should",
"the",
"Blade",
"directive",
"be",
"registered?",
"Fixes",
"compatibility",
"issues",
"with",
"Laravel",
"5",
".",
"0",
"."
] | a9e9e065fc3611e9c723735e879fa0f6b1ad4d5c | https://github.com/kalfheim/critical-css/blob/a9e9e065fc3611e9c723735e879fa0f6b1ad4d5c/src/CriticalCssServiceProvider.php#L42-L53 |
189,897 | kalfheim/critical-css | src/CriticalCssServiceProvider.php | CriticalCssServiceProvider.setupConfig | protected function setupConfig()
{
$src = realpath(__DIR__.'/config/criticalcss.php');
if ($this->app->runningInConsole()) {
$this->publishes([
$src => config_path('criticalcss.php'),
]);
}
$this->mergeConfigFrom($src, 'criticalcss');
} | php | protected function setupConfig()
{
$src = realpath(__DIR__.'/config/criticalcss.php');
if ($this->app->runningInConsole()) {
$this->publishes([
$src => config_path('criticalcss.php'),
]);
}
$this->mergeConfigFrom($src, 'criticalcss');
} | [
"protected",
"function",
"setupConfig",
"(",
")",
"{",
"$",
"src",
"=",
"realpath",
"(",
"__DIR__",
".",
"'/config/criticalcss.php'",
")",
";",
"if",
"(",
"$",
"this",
"->",
"app",
"->",
"runningInConsole",
"(",
")",
")",
"{",
"$",
"this",
"->",
"publish... | Set up the config.
@return void | [
"Set",
"up",
"the",
"config",
"."
] | a9e9e065fc3611e9c723735e879fa0f6b1ad4d5c | https://github.com/kalfheim/critical-css/blob/a9e9e065fc3611e9c723735e879fa0f6b1ad4d5c/src/CriticalCssServiceProvider.php#L60-L71 |
189,898 | kalfheim/critical-css | src/CriticalCssServiceProvider.php | CriticalCssServiceProvider.registerAppBindings | protected function registerAppBindings()
{
$this->app->singleton('criticalcss.storage', function ($app) {
return new LaravelStorage(
$app['config']->get('criticalcss.storage'),
$app->make('filesystem')->disk($app['config']->get('filesystems.default')),
... | php | protected function registerAppBindings()
{
$this->app->singleton('criticalcss.storage', function ($app) {
return new LaravelStorage(
$app['config']->get('criticalcss.storage'),
$app->make('filesystem')->disk($app['config']->get('filesystems.default')),
... | [
"protected",
"function",
"registerAppBindings",
"(",
")",
"{",
"$",
"this",
"->",
"app",
"->",
"singleton",
"(",
"'criticalcss.storage'",
",",
"function",
"(",
"$",
"app",
")",
"{",
"return",
"new",
"LaravelStorage",
"(",
"$",
"app",
"[",
"'config'",
"]",
... | Register Application bindings.
@return void | [
"Register",
"Application",
"bindings",
"."
] | a9e9e065fc3611e9c723735e879fa0f6b1ad4d5c | https://github.com/kalfheim/critical-css/blob/a9e9e065fc3611e9c723735e879fa0f6b1ad4d5c/src/CriticalCssServiceProvider.php#L78-L114 |
189,899 | kalfheim/critical-css | src/Console/CriticalCssMake.php | CriticalCssMake.getUris | protected function getUris()
{
$uris = $this->laravel['config']->get('criticalcss.routes');
// If null, return all 'GET' routes.
if (is_null($uris)) {
$uris = [];
$router = $this->laravel['router'];
foreach ($router->getRoutes() as $route) {
... | php | protected function getUris()
{
$uris = $this->laravel['config']->get('criticalcss.routes');
// If null, return all 'GET' routes.
if (is_null($uris)) {
$uris = [];
$router = $this->laravel['router'];
foreach ($router->getRoutes() as $route) {
... | [
"protected",
"function",
"getUris",
"(",
")",
"{",
"$",
"uris",
"=",
"$",
"this",
"->",
"laravel",
"[",
"'config'",
"]",
"->",
"get",
"(",
"'criticalcss.routes'",
")",
";",
"// If null, return all 'GET' routes.",
"if",
"(",
"is_null",
"(",
"$",
"uris",
")",
... | Returns a list of URIs to generate critical-path CSS for.
@return array | [
"Returns",
"a",
"list",
"of",
"URIs",
"to",
"generate",
"critical",
"-",
"path",
"CSS",
"for",
"."
] | a9e9e065fc3611e9c723735e879fa0f6b1ad4d5c | https://github.com/kalfheim/critical-css/blob/a9e9e065fc3611e9c723735e879fa0f6b1ad4d5c/src/Console/CriticalCssMake.php#L62-L79 |
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.