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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
226,700 | kevinkhill/FontAwesomePHP | src/FontAwesome.php | FontAwesome.css | public static function css($pro = false)
{
if($pro)
{
$url = 'pro.fontawesome.com';
$integrity = 'sha384-Bx4pytHkyTDy3aJKjGkGoHPt3tvv6zlwwjc3iqN7ktaiEMLDPqLSZYts2OjKcBx1';
}
else
{
$url = 'use.fontawesome.com';
$integrity = 'sha... | php | public static function css($pro = false)
{
if($pro)
{
$url = 'pro.fontawesome.com';
$integrity = 'sha384-Bx4pytHkyTDy3aJKjGkGoHPt3tvv6zlwwjc3iqN7ktaiEMLDPqLSZYts2OjKcBx1';
}
else
{
$url = 'use.fontawesome.com';
$integrity = 'sha... | [
"public",
"static",
"function",
"css",
"(",
"$",
"pro",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"pro",
")",
"{",
"$",
"url",
"=",
"'pro.fontawesome.com'",
";",
"$",
"integrity",
"=",
"'sha384-Bx4pytHkyTDy3aJKjGkGoHPt3tvv6zlwwjc3iqN7ktaiEMLDPqLSZYts2OjKcBx1'",
";",... | HTML link to the FontAwesome CSS file through the FontAwesome CDN
@see https://fontawesome.com/get-started/web-fonts-with-css
@return string HTML link element | [
"HTML",
"link",
"to",
"the",
"FontAwesome",
"CSS",
"file",
"through",
"the",
"FontAwesome",
"CDN"
] | e7d12d7422b23a5c3a09715d9ca3e24ff811c073 | https://github.com/kevinkhill/FontAwesomePHP/blob/e7d12d7422b23a5c3a09715d9ca3e24ff811c073/src/FontAwesome.php#L70-L85 |
226,701 | kevinkhill/FontAwesomePHP | src/FontAwesome.php | FontAwesome.js | public static function js($pro = false)
{
if($pro)
{
$url = 'pro.fontawesome.com';
$integrity = 'sha384-GBwm0s/0wYcqnK/JmrCoRqWYIWzFiGEucsfFqkB76Ouii5+d4R31vWHPQtfhv55b';
}
else
{
$url = 'use.fontawesome.com';
$integrity = 'sha3... | php | public static function js($pro = false)
{
if($pro)
{
$url = 'pro.fontawesome.com';
$integrity = 'sha384-GBwm0s/0wYcqnK/JmrCoRqWYIWzFiGEucsfFqkB76Ouii5+d4R31vWHPQtfhv55b';
}
else
{
$url = 'use.fontawesome.com';
$integrity = 'sha3... | [
"public",
"static",
"function",
"js",
"(",
"$",
"pro",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"pro",
")",
"{",
"$",
"url",
"=",
"'pro.fontawesome.com'",
";",
"$",
"integrity",
"=",
"'sha384-GBwm0s/0wYcqnK/JmrCoRqWYIWzFiGEucsfFqkB76Ouii5+d4R31vWHPQtfhv55b'",
";",
... | HTML link to the FontAwesome JS file through the FontAwesome CDN
@see https://fontawesome.com/get-started/svg-with-js
@return string HTML script tag | [
"HTML",
"link",
"to",
"the",
"FontAwesome",
"JS",
"file",
"through",
"the",
"FontAwesome",
"CDN"
] | e7d12d7422b23a5c3a09715d9ca3e24ff811c073 | https://github.com/kevinkhill/FontAwesomePHP/blob/e7d12d7422b23a5c3a09715d9ca3e24ff811c073/src/FontAwesome.php#L93-L108 |
226,702 | kevinkhill/FontAwesomePHP | src/FontAwesome.php | FontAwesome.output | protected function output()
{
$attrs = '';
$classes = $this->style . ' fa-' . $this->icon;
$transforms = '';
$mask = '';
if (!empty($this->classes) && count($this->classes) > 0) {
$classes .= ' ' . implode(' ', $this->classes);
}
if (!empty($th... | php | protected function output()
{
$attrs = '';
$classes = $this->style . ' fa-' . $this->icon;
$transforms = '';
$mask = '';
if (!empty($this->classes) && count($this->classes) > 0) {
$classes .= ' ' . implode(' ', $this->classes);
}
if (!empty($th... | [
"protected",
"function",
"output",
"(",
")",
"{",
"$",
"attrs",
"=",
"''",
";",
"$",
"classes",
"=",
"$",
"this",
"->",
"style",
".",
"' fa-'",
".",
"$",
"this",
"->",
"icon",
";",
"$",
"transforms",
"=",
"''",
";",
"$",
"mask",
"=",
"''",
";",
... | Builds the icon from the template
@access protected
@return string | [
"Builds",
"the",
"icon",
"from",
"the",
"template"
] | e7d12d7422b23a5c3a09715d9ca3e24ff811c073 | https://github.com/kevinkhill/FontAwesomePHP/blob/e7d12d7422b23a5c3a09715d9ca3e24ff811c073/src/FontAwesome.php#L141-L173 |
226,703 | kevinkhill/FontAwesomePHP | src/FontAwesome.php | FontAwesome.ul | public function ul($iconsOrItems, $listItems = array())
{
$has_string_keys = function (array $array) {
return count(array_filter(array_keys($array), 'is_string')) > 0;
};
if (is_string($iconsOrItems) === false && is_array($iconsOrItems) === false) {
throw new Incompl... | php | public function ul($iconsOrItems, $listItems = array())
{
$has_string_keys = function (array $array) {
return count(array_filter(array_keys($array), 'is_string')) > 0;
};
if (is_string($iconsOrItems) === false && is_array($iconsOrItems) === false) {
throw new Incompl... | [
"public",
"function",
"ul",
"(",
"$",
"iconsOrItems",
",",
"$",
"listItems",
"=",
"array",
"(",
")",
")",
"{",
"$",
"has_string_keys",
"=",
"function",
"(",
"array",
"$",
"array",
")",
"{",
"return",
"count",
"(",
"array_filter",
"(",
"array_keys",
"(",
... | Begins building an unordered list with icons
When given a single, string input, the list is started with that parameter
as the default icon for all items in the list. New items can be added with
the li() method or as an array in the second parameter.
If passed an array for the first parameter, then the list is create... | [
"Begins",
"building",
"an",
"unordered",
"list",
"with",
"icons"
] | e7d12d7422b23a5c3a09715d9ca3e24ff811c073 | https://github.com/kevinkhill/FontAwesomePHP/blob/e7d12d7422b23a5c3a09715d9ca3e24ff811c073/src/FontAwesome.php#L228-L251 |
226,704 | kevinkhill/FontAwesomePHP | src/FontAwesome.php | FontAwesome.stack | public function stack($icon, array $classes = array())
{
if (is_string($icon) === false) {
throw new \InvalidArgumentException(
'Icon label must be a string.'
);
}
return new FontAwesomeStack($icon, $classes);
} | php | public function stack($icon, array $classes = array())
{
if (is_string($icon) === false) {
throw new \InvalidArgumentException(
'Icon label must be a string.'
);
}
return new FontAwesomeStack($icon, $classes);
} | [
"public",
"function",
"stack",
"(",
"$",
"icon",
",",
"array",
"$",
"classes",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"icon",
")",
"===",
"false",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'Icon labe... | Sets the top icon to be used in a stack
@param string $icon Icon label, omitting the "fa-" prefix
@param array $classes
@return \Khill\FontAwesome\FontAwesomeStack | [
"Sets",
"the",
"top",
"icon",
"to",
"be",
"used",
"in",
"a",
"stack"
] | e7d12d7422b23a5c3a09715d9ca3e24ff811c073 | https://github.com/kevinkhill/FontAwesomePHP/blob/e7d12d7422b23a5c3a09715d9ca3e24ff811c073/src/FontAwesome.php#L260-L269 |
226,705 | kevinkhill/FontAwesomePHP | src/FontAwesome.php | FontAwesome.store | public function store($label)
{
if ($this->icon === null) {
throw new CollectionIconException(
'There was no icon defined to store.'
);
}
if (is_string($label) === false || empty($label) === true) {
throw new \InvalidArgumentException(
... | php | public function store($label)
{
if ($this->icon === null) {
throw new CollectionIconException(
'There was no icon defined to store.'
);
}
if (is_string($label) === false || empty($label) === true) {
throw new \InvalidArgumentException(
... | [
"public",
"function",
"store",
"(",
"$",
"label",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"icon",
"===",
"null",
")",
"{",
"throw",
"new",
"CollectionIconException",
"(",
"'There was no icon defined to store.'",
")",
";",
"}",
"if",
"(",
"is_string",
"(",
... | Stores icon to be rendered later and resets
@param string $label Label of icon to save in collection
@return self
@throws \InvalidArgumentException If $label anything but a non-empty \string
@throws \Khill\FontAwesome\Exceptions\CollectionIconException If store() method called without defining an icon | [
"Stores",
"icon",
"to",
"be",
"rendered",
"later",
"and",
"resets"
] | e7d12d7422b23a5c3a09715d9ca3e24ff811c073 | https://github.com/kevinkhill/FontAwesomePHP/blob/e7d12d7422b23a5c3a09715d9ca3e24ff811c073/src/FontAwesome.php#L290-L307 |
226,706 | kevinkhill/FontAwesomePHP | src/FontAwesome.php | FontAwesome.collection | public function collection($label)
{
if (is_string($label) === false) {
throw new \InvalidArgumentException(
'Collection icon label must be a string.'
);
}
if (isset($this->collection[$label]) === false) {
throw new CollectionIconException... | php | public function collection($label)
{
if (is_string($label) === false) {
throw new \InvalidArgumentException(
'Collection icon label must be a string.'
);
}
if (isset($this->collection[$label]) === false) {
throw new CollectionIconException... | [
"public",
"function",
"collection",
"(",
"$",
"label",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"label",
")",
"===",
"false",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'Collection icon label must be a string.'",
")",
";",
"}",
"if",
... | Retrieve icon from collection
@param string $label Icon label used in store method
@return string HTML icon string
@throws \InvalidArgumentException If $label anything but a non-empty \string
@throws CollectionIconException If icon $label is not set | [
"Retrieve",
"icon",
"from",
"collection"
] | e7d12d7422b23a5c3a09715d9ca3e24ff811c073 | https://github.com/kevinkhill/FontAwesomePHP/blob/e7d12d7422b23a5c3a09715d9ca3e24ff811c073/src/FontAwesome.php#L341-L356 |
226,707 | kevinkhill/FontAwesomePHP | src/FontAwesome.php | FontAwesome.resetAndOutput | private function resetAndOutput($htmlOutput)
{
$this->icon = null;
$this->classes = null;
$this->attributes = null;
$this->mask = null;
$this->style = self::DEFAULT_STYLE;
return (string) $htmlOutput;
} | php | private function resetAndOutput($htmlOutput)
{
$this->icon = null;
$this->classes = null;
$this->attributes = null;
$this->mask = null;
$this->style = self::DEFAULT_STYLE;
return (string) $htmlOutput;
} | [
"private",
"function",
"resetAndOutput",
"(",
"$",
"htmlOutput",
")",
"{",
"$",
"this",
"->",
"icon",
"=",
"null",
";",
"$",
"this",
"->",
"classes",
"=",
"null",
";",
"$",
"this",
"->",
"attributes",
"=",
"null",
";",
"$",
"this",
"->",
"mask",
"=",... | Outputs the current contents to the page.
@param string $htmlOutput
@return string | [
"Outputs",
"the",
"current",
"contents",
"to",
"the",
"page",
"."
] | e7d12d7422b23a5c3a09715d9ca3e24ff811c073 | https://github.com/kevinkhill/FontAwesomePHP/blob/e7d12d7422b23a5c3a09715d9ca3e24ff811c073/src/FontAwesome.php#L388-L397 |
226,708 | wapmorgan/Imagery | src/Imagery.php | Imagery.create | static public function create($width, $height) {
$image = imagecreatetruecolor($width, $height);
imagealphablending($image, false);
imagesavealpha($image, true);
return new self($image);
} | php | static public function create($width, $height) {
$image = imagecreatetruecolor($width, $height);
imagealphablending($image, false);
imagesavealpha($image, true);
return new self($image);
} | [
"static",
"public",
"function",
"create",
"(",
"$",
"width",
",",
"$",
"height",
")",
"{",
"$",
"image",
"=",
"imagecreatetruecolor",
"(",
"$",
"width",
",",
"$",
"height",
")",
";",
"imagealphablending",
"(",
"$",
"image",
",",
"false",
")",
";",
"ima... | Creates an instance with specified size
@param int $width Image width
@param int $height Image height | [
"Creates",
"an",
"instance",
"with",
"specified",
"size"
] | 9e2a1294bd235bded9f893ea530b1d86bfc2d07c | https://github.com/wapmorgan/Imagery/blob/9e2a1294bd235bded9f893ea530b1d86bfc2d07c/src/Imagery.php#L78-L83 |
226,709 | wapmorgan/Imagery | src/Imagery.php | Imagery.copyFrom | public function copyFrom(Imagery $source) {
imagecopyresampled($this->_image, $source->resource, 0, 0, 0, 0, $this->width, $this->height, $source->width, $source->height);
return $this;
} | php | public function copyFrom(Imagery $source) {
imagecopyresampled($this->_image, $source->resource, 0, 0, 0, 0, $this->width, $this->height, $source->width, $source->height);
return $this;
} | [
"public",
"function",
"copyFrom",
"(",
"Imagery",
"$",
"source",
")",
"{",
"imagecopyresampled",
"(",
"$",
"this",
"->",
"_image",
",",
"$",
"source",
"->",
"resource",
",",
"0",
",",
"0",
",",
"0",
",",
"0",
",",
"$",
"this",
"->",
"width",
",",
"... | Copies an image fron another instance with zoom
@param Imagery $source An image that will be source for resampling
@return Imagery this object | [
"Copies",
"an",
"image",
"fron",
"another",
"instance",
"with",
"zoom"
] | 9e2a1294bd235bded9f893ea530b1d86bfc2d07c | https://github.com/wapmorgan/Imagery/blob/9e2a1294bd235bded9f893ea530b1d86bfc2d07c/src/Imagery.php#L153-L156 |
226,710 | wapmorgan/Imagery | src/Imagery.php | Imagery.flip | public function flip($horizontal = true) {
if (function_exists('imageflip')) {
imageflip($this->_image, $horizontal ? IMG_FLIP_HORIZONTAL : IMG_FLIP_VERTICAL);
} else {
$image = imagecreatetruecolor($this->width, $this->height);
imagealphablending($image, false);
imagesavealpha($image, true);
if ($ho... | php | public function flip($horizontal = true) {
if (function_exists('imageflip')) {
imageflip($this->_image, $horizontal ? IMG_FLIP_HORIZONTAL : IMG_FLIP_VERTICAL);
} else {
$image = imagecreatetruecolor($this->width, $this->height);
imagealphablending($image, false);
imagesavealpha($image, true);
if ($ho... | [
"public",
"function",
"flip",
"(",
"$",
"horizontal",
"=",
"true",
")",
"{",
"if",
"(",
"function_exists",
"(",
"'imageflip'",
")",
")",
"{",
"imageflip",
"(",
"$",
"this",
"->",
"_image",
",",
"$",
"horizontal",
"?",
"IMG_FLIP_HORIZONTAL",
":",
"IMG_FLIP_... | Flips an image.
@return Imagery this object | [
"Flips",
"an",
"image",
"."
] | 9e2a1294bd235bded9f893ea530b1d86bfc2d07c | https://github.com/wapmorgan/Imagery/blob/9e2a1294bd235bded9f893ea530b1d86bfc2d07c/src/Imagery.php#L425-L455 |
226,711 | wapmorgan/Imagery | src/Imagery.php | Imagery.filter | public function filter($filter) {
if (!in_array($filter, array(self::FILTER_NEGATE, self::FILTER_GRAYSCALE)))
return false;
imagefilter($this->resource, $filter);
return $this;
} | php | public function filter($filter) {
if (!in_array($filter, array(self::FILTER_NEGATE, self::FILTER_GRAYSCALE)))
return false;
imagefilter($this->resource, $filter);
return $this;
} | [
"public",
"function",
"filter",
"(",
"$",
"filter",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"filter",
",",
"array",
"(",
"self",
"::",
"FILTER_NEGATE",
",",
"self",
"::",
"FILTER_GRAYSCALE",
")",
")",
")",
"return",
"false",
";",
"imagefilter",
... | Applies a filter to image
@param int One of FILTER_* constants
@return Imagery this object | [
"Applies",
"a",
"filter",
"to",
"image"
] | 9e2a1294bd235bded9f893ea530b1d86bfc2d07c | https://github.com/wapmorgan/Imagery/blob/9e2a1294bd235bded9f893ea530b1d86bfc2d07c/src/Imagery.php#L462-L467 |
226,712 | wapmorgan/Imagery | src/Imagery.php | Imagery.changeBrightness | public function changeBrightness($newValue) {
$newValue = max(-255, min(255, $newValue));
imagefilter($this->resource, IMG_FILTER_BRIGHTNESS, $newValue);
return $this;
} | php | public function changeBrightness($newValue) {
$newValue = max(-255, min(255, $newValue));
imagefilter($this->resource, IMG_FILTER_BRIGHTNESS, $newValue);
return $this;
} | [
"public",
"function",
"changeBrightness",
"(",
"$",
"newValue",
")",
"{",
"$",
"newValue",
"=",
"max",
"(",
"-",
"255",
",",
"min",
"(",
"255",
",",
"$",
"newValue",
")",
")",
";",
"imagefilter",
"(",
"$",
"this",
"->",
"resource",
",",
"IMG_FILTER_BRI... | Changes brightness of image
@param int $newValue Range from 255 (max brightness) to -255 (min brightness). 0 means no change
@return Imagery this object | [
"Changes",
"brightness",
"of",
"image"
] | 9e2a1294bd235bded9f893ea530b1d86bfc2d07c | https://github.com/wapmorgan/Imagery/blob/9e2a1294bd235bded9f893ea530b1d86bfc2d07c/src/Imagery.php#L486-L490 |
226,713 | wapmorgan/Imagery | src/Imagery.php | Imagery.colorize | public function colorize($red, $green, $blue, $alpha = 127) {
$normalizer = function ($value) { return max(-255, min(255, $value)); };
$red = $normalizer($red);
$green = $normalizer($green);
$blue = $normalizer($blue);
$alpha = min(127, max(0, $alpha));
imagefilter($this->resource, IMG_FILTER_COLORIZE, $red... | php | public function colorize($red, $green, $blue, $alpha = 127) {
$normalizer = function ($value) { return max(-255, min(255, $value)); };
$red = $normalizer($red);
$green = $normalizer($green);
$blue = $normalizer($blue);
$alpha = min(127, max(0, $alpha));
imagefilter($this->resource, IMG_FILTER_COLORIZE, $red... | [
"public",
"function",
"colorize",
"(",
"$",
"red",
",",
"$",
"green",
",",
"$",
"blue",
",",
"$",
"alpha",
"=",
"127",
")",
"{",
"$",
"normalizer",
"=",
"function",
"(",
"$",
"value",
")",
"{",
"return",
"max",
"(",
"-",
"255",
",",
"min",
"(",
... | Changes colors of image
@param int $red Range from 255 to -255
@param int $green Range from 255 to -255
@param int $blue Range from 255 to -255
@param int $alpha Range from 255 to -255
@return Imagery this object | [
"Changes",
"colors",
"of",
"image"
] | 9e2a1294bd235bded9f893ea530b1d86bfc2d07c | https://github.com/wapmorgan/Imagery/blob/9e2a1294bd235bded9f893ea530b1d86bfc2d07c/src/Imagery.php#L500-L508 |
226,714 | wapmorgan/Imagery | src/Imagery.php | Imagery.blur | public function blur($method = self::GAUSSIAN_BLUR) {
if (!in_array($method, array(self::GAUSSIAN_BLUR, self::SELECTIVE_BLUR)))
return false;
imagefilter($this->resource, $method);
return $this;
} | php | public function blur($method = self::GAUSSIAN_BLUR) {
if (!in_array($method, array(self::GAUSSIAN_BLUR, self::SELECTIVE_BLUR)))
return false;
imagefilter($this->resource, $method);
return $this;
} | [
"public",
"function",
"blur",
"(",
"$",
"method",
"=",
"self",
"::",
"GAUSSIAN_BLUR",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"method",
",",
"array",
"(",
"self",
"::",
"GAUSSIAN_BLUR",
",",
"self",
"::",
"SELECTIVE_BLUR",
")",
")",
")",
"retur... | Blurs an image
@param int $method One of blue methods: GAUSSIAN_BLUR or SELECTIVE_BLUR
@return Imagery this object | [
"Blurs",
"an",
"image"
] | 9e2a1294bd235bded9f893ea530b1d86bfc2d07c | https://github.com/wapmorgan/Imagery/blob/9e2a1294bd235bded9f893ea530b1d86bfc2d07c/src/Imagery.php#L515-L520 |
226,715 | wapmorgan/Imagery | src/Imagery.php | Imagery.smooth | public function smooth($level = 1) {
$level = max(1, min(8, $level));
if ($level == 8) $level = 9;
// inversion is needed. Do not delete.
imagefilter($this->resource, IMG_FILTER_SMOOTH, -$level);
return $this;
} | php | public function smooth($level = 1) {
$level = max(1, min(8, $level));
if ($level == 8) $level = 9;
// inversion is needed. Do not delete.
imagefilter($this->resource, IMG_FILTER_SMOOTH, -$level);
return $this;
} | [
"public",
"function",
"smooth",
"(",
"$",
"level",
"=",
"1",
")",
"{",
"$",
"level",
"=",
"max",
"(",
"1",
",",
"min",
"(",
"8",
",",
"$",
"level",
")",
")",
";",
"if",
"(",
"$",
"level",
"==",
"8",
")",
"$",
"level",
"=",
"9",
";",
"// inv... | Smooths an image
@param int $level Level of smoothness. Range from 0 to 8. 8 is un-smooth.
@return Imagery this object | [
"Smooths",
"an",
"image"
] | 9e2a1294bd235bded9f893ea530b1d86bfc2d07c | https://github.com/wapmorgan/Imagery/blob/9e2a1294bd235bded9f893ea530b1d86bfc2d07c/src/Imagery.php#L527-L533 |
226,716 | wapmorgan/Imagery | src/Imagery.php | Imagery.pixelate | public function pixelate($blockSize = 5, $useModernEffect = true) {
imagefilter($this->resource, IMG_FILTER_PIXELATE, $blockSize, $useModernEffect);
return $this;
} | php | public function pixelate($blockSize = 5, $useModernEffect = true) {
imagefilter($this->resource, IMG_FILTER_PIXELATE, $blockSize, $useModernEffect);
return $this;
} | [
"public",
"function",
"pixelate",
"(",
"$",
"blockSize",
"=",
"5",
",",
"$",
"useModernEffect",
"=",
"true",
")",
"{",
"imagefilter",
"(",
"$",
"this",
"->",
"resource",
",",
"IMG_FILTER_PIXELATE",
",",
"$",
"blockSize",
",",
"$",
"useModernEffect",
")",
"... | Pixelates an image
@param int $blockSize Size of pixel block
@param boolean $useModernEffect Use or not to use new pixelate effect
@return Imagery this object | [
"Pixelates",
"an",
"image"
] | 9e2a1294bd235bded9f893ea530b1d86bfc2d07c | https://github.com/wapmorgan/Imagery/blob/9e2a1294bd235bded9f893ea530b1d86bfc2d07c/src/Imagery.php#L541-L544 |
226,717 | gigaai/framework | src/Broadcast/Broadcast.php | Broadcast.send | public static function send(BroadcastModel $broadcast)
{
// Send message if people hit send button
$broadcastProperties = [
'message_creative_id' => $broadcast->message_creative_id,
'notification_type' => $broadcast->notification_type,
'tag' => $... | php | public static function send(BroadcastModel $broadcast)
{
// Send message if people hit send button
$broadcastProperties = [
'message_creative_id' => $broadcast->message_creative_id,
'notification_type' => $broadcast->notification_type,
'tag' => $... | [
"public",
"static",
"function",
"send",
"(",
"BroadcastModel",
"$",
"broadcast",
")",
"{",
"// Send message if people hit send button",
"$",
"broadcastProperties",
"=",
"[",
"'message_creative_id'",
"=>",
"$",
"broadcast",
"->",
"message_creative_id",
",",
"'notification_... | Send Broadcast to Facebook and let they do the rest
@param Broadcast $broadcast | [
"Send",
"Broadcast",
"to",
"Facebook",
"and",
"let",
"they",
"do",
"the",
"rest"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Broadcast/Broadcast.php#L24-L54 |
226,718 | gigaai/framework | src/Broadcast/Broadcast.php | Broadcast.createMessageCreative | public static function createMessageCreative(BroadcastModel $broadcast)
{
if (is_numeric($broadcast->content)) {
$template = Node::find($broadcast->content)->answers;
}
else {
$model = new Model;
$template = $model->parse(json_decode($... | php | public static function createMessageCreative(BroadcastModel $broadcast)
{
if (is_numeric($broadcast->content)) {
$template = Node::find($broadcast->content)->answers;
}
else {
$model = new Model;
$template = $model->parse(json_decode($... | [
"public",
"static",
"function",
"createMessageCreative",
"(",
"BroadcastModel",
"$",
"broadcast",
")",
"{",
"if",
"(",
"is_numeric",
"(",
"$",
"broadcast",
"->",
"content",
")",
")",
"{",
"$",
"template",
"=",
"Node",
"::",
"find",
"(",
"$",
"broadcast",
"... | Because each message creative can only attach to 1 broadcast so we'll create message creative each time we send
@param Broadcast $broadcast
@return Mixed | [
"Because",
"each",
"message",
"creative",
"can",
"only",
"attach",
"to",
"1",
"broadcast",
"so",
"we",
"ll",
"create",
"message",
"creative",
"each",
"time",
"we",
"send"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Broadcast/Broadcast.php#L63-L104 |
226,719 | loco/swizzle | src/Swizzle.php | Swizzle.verbose | public function verbose($resource)
{
$this->logger->pushHandler(new StreamHandler($resource, Logger::DEBUG));
return $this;
} | php | public function verbose($resource)
{
$this->logger->pushHandler(new StreamHandler($resource, Logger::DEBUG));
return $this;
} | [
"public",
"function",
"verbose",
"(",
"$",
"resource",
")",
"{",
"$",
"this",
"->",
"logger",
"->",
"pushHandler",
"(",
"new",
"StreamHandler",
"(",
"$",
"resource",
",",
"Logger",
"::",
"DEBUG",
")",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Enable debug logging to show build progress
@param string|resource
@return Swizzle
@throws \Exception | [
"Enable",
"debug",
"logging",
"to",
"show",
"build",
"progress"
] | 539db44bc2341f3da403582052b770686c86a516 | https://github.com/loco/swizzle/blob/539db44bc2341f3da403582052b770686c86a516/src/Swizzle.php#L111-L115 |
226,720 | loco/swizzle | src/Swizzle.php | Swizzle.setInitValue | private function setInitValue($key, $value)
{
if ($this->serviceDescription !== null) {
throw new \RuntimeException('Too late to set "'.$key.'"');
}
$this->init[$key] = $value;
return $this;
} | php | private function setInitValue($key, $value)
{
if ($this->serviceDescription !== null) {
throw new \RuntimeException('Too late to set "'.$key.'"');
}
$this->init[$key] = $value;
return $this;
} | [
"private",
"function",
"setInitValue",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"serviceDescription",
"!==",
"null",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"'Too late to set \"'",
".",
"$",
"key",
".",
... | Set an initial value to be passed to ServiceDescription constructor.
@param string $key
@param mixed $value
@return Swizzle
@throws \RuntimeException | [
"Set",
"an",
"initial",
"value",
"to",
"be",
"passed",
"to",
"ServiceDescription",
"constructor",
"."
] | 539db44bc2341f3da403582052b770686c86a516 | https://github.com/loco/swizzle/blob/539db44bc2341f3da403582052b770686c86a516/src/Swizzle.php#L153-L161 |
226,721 | loco/swizzle | src/Swizzle.php | Swizzle.getServiceDescription | public function getServiceDescription()
{
if ($this->serviceDescription === null) {
$this->serviceDescription = new Description($this->init);
}
return $this->serviceDescription;
} | php | public function getServiceDescription()
{
if ($this->serviceDescription === null) {
$this->serviceDescription = new Description($this->init);
}
return $this->serviceDescription;
} | [
"public",
"function",
"getServiceDescription",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"serviceDescription",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"serviceDescription",
"=",
"new",
"Description",
"(",
"$",
"this",
"->",
"init",
")",
";",
"}",
... | Get compiled Guzzle service description
@return Description
@throws \InvalidArgumentException | [
"Get",
"compiled",
"Guzzle",
"service",
"description"
] | 539db44bc2341f3da403582052b770686c86a516 | https://github.com/loco/swizzle/blob/539db44bc2341f3da403582052b770686c86a516/src/Swizzle.php#L198-L204 |
226,722 | loco/swizzle | src/Swizzle.php | Swizzle.registerResponseClass | public function registerResponseClass($name, $class)
{
$this->responseClasses[$name] = $class;
// set retrospectively if method already encountered
if ($this->serviceDescription !== null
&& $this->hasOperation($name) === true
) {
throw new \LogicException(
... | php | public function registerResponseClass($name, $class)
{
$this->responseClasses[$name] = $class;
// set retrospectively if method already encountered
if ($this->serviceDescription !== null
&& $this->hasOperation($name) === true
) {
throw new \LogicException(
... | [
"public",
"function",
"registerResponseClass",
"(",
"$",
"name",
",",
"$",
"class",
")",
"{",
"$",
"this",
"->",
"responseClasses",
"[",
"$",
"name",
"]",
"=",
"$",
"class",
";",
"// set retrospectively if method already encountered",
"if",
"(",
"$",
"this",
"... | Apply a bespoke responseClass to a given method
@param string name of command returning this response class
@param string full class name for responseClass field
@return Swizzle
@throws \LogicException
@throws \InvalidArgumentException | [
"Apply",
"a",
"bespoke",
"responseClass",
"to",
"a",
"given",
"method"
] | 539db44bc2341f3da403582052b770686c86a516 | https://github.com/loco/swizzle/blob/539db44bc2341f3da403582052b770686c86a516/src/Swizzle.php#L217-L231 |
226,723 | loco/swizzle | src/Swizzle.php | Swizzle.build | public function build($baseUri)
{
$this->serviceDescription = null;
$client = SwaggerClient::factory(['base_uri' => $baseUri]);
$this->debug('Fetching resource listing from %s', $baseUri);
$listing = $client->getResources();
// check this looks like a resource listing
... | php | public function build($baseUri)
{
$this->serviceDescription = null;
$client = SwaggerClient::factory(['base_uri' => $baseUri]);
$this->debug('Fetching resource listing from %s', $baseUri);
$listing = $client->getResources();
// check this looks like a resource listing
... | [
"public",
"function",
"build",
"(",
"$",
"baseUri",
")",
"{",
"$",
"this",
"->",
"serviceDescription",
"=",
"null",
";",
"$",
"client",
"=",
"SwaggerClient",
"::",
"factory",
"(",
"[",
"'base_uri'",
"=>",
"$",
"baseUri",
"]",
")",
";",
"$",
"this",
"->... | Build from a live endpoint
@param string Swagger compliant JSON endpoint for resource listing
@throws \Exception
@return Swizzle | [
"Build",
"from",
"a",
"live",
"endpoint"
] | 539db44bc2341f3da403582052b770686c86a516 | https://github.com/loco/swizzle/blob/539db44bc2341f3da403582052b770686c86a516/src/Swizzle.php#L254-L309 |
226,724 | loco/swizzle | src/Swizzle.php | Swizzle.createModel | private function createModel(array $model, $location)
{
$name = null;
if (isset($model['id']) === true) {
// if model id is set, us it as a name
$name = trim($model['id']);
} elseif (isset($model['nickname'], $this->responseClasses[$model['nickname']])) {
... | php | private function createModel(array $model, $location)
{
$name = null;
if (isset($model['id']) === true) {
// if model id is set, us it as a name
$name = trim($model['id']);
} elseif (isset($model['nickname'], $this->responseClasses[$model['nickname']])) {
... | [
"private",
"function",
"createModel",
"(",
"array",
"$",
"model",
",",
"$",
"location",
")",
"{",
"$",
"name",
"=",
"null",
";",
"if",
"(",
"isset",
"(",
"$",
"model",
"[",
"'id'",
"]",
")",
"===",
"true",
")",
"{",
"// if model id is set, us it as a nam... | Create a Swagger model definition
@param array $model
@param string location where parameters will be found in request or response
@return Parameter model resolved against service description but not added
@throws \Exception | [
"Create",
"a",
"Swagger",
"model",
"definition"
] | 539db44bc2341f3da403582052b770686c86a516 | https://github.com/loco/swizzle/blob/539db44bc2341f3da403582052b770686c86a516/src/Swizzle.php#L321-L385 |
226,725 | loco/swizzle | src/Swizzle.php | Swizzle.addModel | public function addModel(array $modelData)
{
// swagger only has locations for requests, so we can safely default to our response serializer.
$model = $this->createModel($modelData, $this->responseType);
$modelData = $model->toArray();
if ($modelData['type'] === 'array' && isset($mod... | php | public function addModel(array $modelData)
{
// swagger only has locations for requests, so we can safely default to our response serializer.
$model = $this->createModel($modelData, $this->responseType);
$modelData = $model->toArray();
if ($modelData['type'] === 'array' && isset($mod... | [
"public",
"function",
"addModel",
"(",
"array",
"$",
"modelData",
")",
"{",
"// swagger only has locations for requests, so we can safely default to our response serializer.",
"$",
"model",
"=",
"$",
"this",
"->",
"createModel",
"(",
"$",
"modelData",
",",
"$",
"this",
... | Add a response model
@param array model structure from Swagger
@return Parameter model added to service description
@throws \Exception | [
"Add",
"a",
"response",
"model"
] | 539db44bc2341f3da403582052b770686c86a516 | https://github.com/loco/swizzle/blob/539db44bc2341f3da403582052b770686c86a516/src/Swizzle.php#L396-L408 |
226,726 | loco/swizzle | src/Swizzle.php | Swizzle.transformParams | private function transformParams(array $params)
{
$locations = [];
$namespace = [];
foreach ($params as $name => $param) {
if (isset($param['name'])) {
$name = $param['name'];
} else {
$param['name'] = $name;
}
$... | php | private function transformParams(array $params)
{
$locations = [];
$namespace = [];
foreach ($params as $name => $param) {
if (isset($param['name'])) {
$name = $param['name'];
} else {
$param['name'] = $name;
}
$... | [
"private",
"function",
"transformParams",
"(",
"array",
"$",
"params",
")",
"{",
"$",
"locations",
"=",
"[",
"]",
";",
"$",
"namespace",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"params",
"as",
"$",
"name",
"=>",
"$",
"param",
")",
"{",
"if",
"(",
... | Transform a swagger parameter to a Guzzle one
@param array $params
@return array
@throws \Exception | [
"Transform",
"a",
"swagger",
"parameter",
"to",
"a",
"Guzzle",
"one"
] | 539db44bc2341f3da403582052b770686c86a516 | https://github.com/loco/swizzle/blob/539db44bc2341f3da403582052b770686c86a516/src/Swizzle.php#L513-L576 |
226,727 | loco/swizzle | src/Swizzle.php | Swizzle.transformLocation | private function transformLocation($paramType)
{
// Guzzle request locations: (statusCode|reasonPhrase|header|body|json|xml)
// Guzzle response locations: (uri|query|header|body|formParam|multipart|json|xml|responseBody)
static $valid = [
'uri' => 1,
'xml' => 1,
... | php | private function transformLocation($paramType)
{
// Guzzle request locations: (statusCode|reasonPhrase|header|body|json|xml)
// Guzzle response locations: (uri|query|header|body|formParam|multipart|json|xml|responseBody)
static $valid = [
'uri' => 1,
'xml' => 1,
... | [
"private",
"function",
"transformLocation",
"(",
"$",
"paramType",
")",
"{",
"// Guzzle request locations: (statusCode|reasonPhrase|header|body|json|xml)",
"// Guzzle response locations: (uri|query|header|body|formParam|multipart|json|xml|responseBody)",
"static",
"$",
"valid",
"=",
"[",... | Transform a Swagger request paramType to a Guzzle location.
Note that Guzzle has response locations too.
@param string Swagger paramType request field (path|query|body|header|form)
@return string Guzzle location field (uri|query|body|header|postField|xml|json) | [
"Transform",
"a",
"Swagger",
"request",
"paramType",
"to",
"a",
"Guzzle",
"location",
".",
"Note",
"that",
"Guzzle",
"has",
"response",
"locations",
"too",
"."
] | 539db44bc2341f3da403582052b770686c86a516 | https://github.com/loco/swizzle/blob/539db44bc2341f3da403582052b770686c86a516/src/Swizzle.php#L586-L612 |
226,728 | loco/swizzle | src/Swizzle.php | Swizzle.transformArray | private function transformArray(array $swagger, array $common, array $trans)
{
// initialize with common array keys
$guzzle = array_intersect_key($swagger, $common);
// translate other naming differences
foreach ($trans as $source => $target) {
if (isset($swagger[$source]... | php | private function transformArray(array $swagger, array $common, array $trans)
{
// initialize with common array keys
$guzzle = array_intersect_key($swagger, $common);
// translate other naming differences
foreach ($trans as $source => $target) {
if (isset($swagger[$source]... | [
"private",
"function",
"transformArray",
"(",
"array",
"$",
"swagger",
",",
"array",
"$",
"common",
",",
"array",
"$",
"trans",
")",
"{",
"// initialize with common array keys",
"$",
"guzzle",
"=",
"array_intersect_key",
"(",
"$",
"swagger",
",",
"$",
"common",
... | Utility transform an array based on similarities and differences between the two formats.
@param array $swagger source format (swagger)
@param array $common Keys common to both formats, { key: '', ... }
@param array $trans key translation mappings, { keya: keyb, ... }
@return array target format (guzzle) | [
"Utility",
"transform",
"an",
"array",
"based",
"on",
"similarities",
"and",
"differences",
"between",
"the",
"two",
"formats",
"."
] | 539db44bc2341f3da403582052b770686c86a516 | https://github.com/loco/swizzle/blob/539db44bc2341f3da403582052b770686c86a516/src/Swizzle.php#L833-L845 |
226,729 | loco/swizzle | src/Swizzle.php | Swizzle.mergeUrl | private static function mergeUrl($uri, $baseUrl)
{
$href = parse_url($uri);
$base = parse_url($baseUrl);
$full = $href + $base + parse_url('http://localhost/');
return $full['scheme'].'://'.$full['host'].$full['path'];
} | php | private static function mergeUrl($uri, $baseUrl)
{
$href = parse_url($uri);
$base = parse_url($baseUrl);
$full = $href + $base + parse_url('http://localhost/');
return $full['scheme'].'://'.$full['host'].$full['path'];
} | [
"private",
"static",
"function",
"mergeUrl",
"(",
"$",
"uri",
",",
"$",
"baseUrl",
")",
"{",
"$",
"href",
"=",
"parse_url",
"(",
"$",
"uri",
")",
";",
"$",
"base",
"=",
"parse_url",
"(",
"$",
"baseUrl",
")",
";",
"$",
"full",
"=",
"$",
"href",
"+... | Utility for merging any URI into a fully qualified one
@param string URI that may be a /path or http://address
@param string full base URL that may or may not be on same domain
@return string | [
"Utility",
"for",
"merging",
"any",
"URI",
"into",
"a",
"fully",
"qualified",
"one"
] | 539db44bc2341f3da403582052b770686c86a516 | https://github.com/loco/swizzle/blob/539db44bc2341f3da403582052b770686c86a516/src/Swizzle.php#L885-L891 |
226,730 | loco/swizzle | src/Swizzle.php | Swizzle.toArray | public function toArray()
{
$result = [
'name' => $this->init['name'],
'apiVersion' => $this->init['apiVersion'],
'baseUri' => isset($this->init['baseUri']) ? $this->init['baseUri'] : '',
'description' => $this->init['description'],
];
$result[... | php | public function toArray()
{
$result = [
'name' => $this->init['name'],
'apiVersion' => $this->init['apiVersion'],
'baseUri' => isset($this->init['baseUri']) ? $this->init['baseUri'] : '',
'description' => $this->init['description'],
];
$result[... | [
"public",
"function",
"toArray",
"(",
")",
"{",
"$",
"result",
"=",
"[",
"'name'",
"=>",
"$",
"this",
"->",
"init",
"[",
"'name'",
"]",
",",
"'apiVersion'",
"=>",
"$",
"this",
"->",
"init",
"[",
"'apiVersion'",
"]",
",",
"'baseUri'",
"=>",
"isset",
"... | Export service description to JSON
@return array | [
"Export",
"service",
"description",
"to",
"JSON"
] | 539db44bc2341f3da403582052b770686c86a516 | https://github.com/loco/swizzle/blob/539db44bc2341f3da403582052b770686c86a516/src/Swizzle.php#L908-L922 |
226,731 | gigaai/framework | src/Storage/Eloquent/Broadcast.php | Broadcast.leadsCount | public function leadsCount()
{
if (isset($this->to_lead) && is_array($this->to_lead)) {
return count($this->to_lead);
}
return count(Subscription::getSubscribers($this->to_channel));
} | php | public function leadsCount()
{
if (isset($this->to_lead) && is_array($this->to_lead)) {
return count($this->to_lead);
}
return count(Subscription::getSubscribers($this->to_channel));
} | [
"public",
"function",
"leadsCount",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"to_lead",
")",
"&&",
"is_array",
"(",
"$",
"this",
"->",
"to_lead",
")",
")",
"{",
"return",
"count",
"(",
"$",
"this",
"->",
"to_lead",
")",
";",
"}",
... | Get total leads of a channel
@return void | [
"Get",
"total",
"leads",
"of",
"a",
"channel"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Storage/Eloquent/Broadcast.php#L109-L116 |
226,732 | gigaai/framework | src/Storage/Eloquent/Broadcast.php | Broadcast.scopeStillActive | public function scopeStillActive($query)
{
$query->where(function ($query) {
return $query->where('start_at', '<=', Carbon::now())->orWhereNull('start_at');
})
->where(function ($query) {
return $query->where('end_at', '>=', Carbon::now())->orWhereNull('end_at');
... | php | public function scopeStillActive($query)
{
$query->where(function ($query) {
return $query->where('start_at', '<=', Carbon::now())->orWhereNull('start_at');
})
->where(function ($query) {
return $query->where('end_at', '>=', Carbon::now())->orWhereNull('end_at');
... | [
"public",
"function",
"scopeStillActive",
"(",
"$",
"query",
")",
"{",
"$",
"query",
"->",
"where",
"(",
"function",
"(",
"$",
"query",
")",
"{",
"return",
"$",
"query",
"->",
"where",
"(",
"'start_at'",
",",
"'<='",
",",
"Carbon",
"::",
"now",
"(",
... | Get active broadcast
@return $query | [
"Get",
"active",
"broadcast"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Storage/Eloquent/Broadcast.php#L142-L155 |
226,733 | gigaai/framework | src/Shared/CanLearn.php | CanLearn.answer | public function answer($ask, $answers = null, $attributes = [])
{
return $this->answers($ask, $answers, $attributes);
} | php | public function answer($ask, $answers = null, $attributes = [])
{
return $this->answers($ask, $answers, $attributes);
} | [
"public",
"function",
"answer",
"(",
"$",
"ask",
",",
"$",
"answers",
"=",
"null",
",",
"$",
"attributes",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"answers",
"(",
"$",
"ask",
",",
"$",
"answers",
",",
"$",
"attributes",
")",
";",
"}... | Response user question with answers
@param $ask
@param null $answers
@return $this | [
"Response",
"user",
"question",
"with",
"answers"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Shared/CanLearn.php#L19-L22 |
226,734 | gigaai/framework | src/Shared/CanLearn.php | CanLearn.answers | public function answers($asks, $answers = null, $attributes = [])
{
$this->model->addNode($asks, $answers, $attributes);
return $this;
} | php | public function answers($asks, $answers = null, $attributes = [])
{
$this->model->addNode($asks, $answers, $attributes);
return $this;
} | [
"public",
"function",
"answers",
"(",
"$",
"asks",
",",
"$",
"answers",
"=",
"null",
",",
"$",
"attributes",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"model",
"->",
"addNode",
"(",
"$",
"asks",
",",
"$",
"answers",
",",
"$",
"attributes",
")",
... | Format answer from short hand to proper form.
@param $asks
@param null $answers
@return $this For chaining method | [
"Format",
"answer",
"from",
"short",
"hand",
"to",
"proper",
"form",
"."
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Shared/CanLearn.php#L32-L37 |
226,735 | gigaai/framework | src/Shared/CanLearn.php | CanLearn.says | public function says($messages, $attributes = [], $lead_ids = null)
{
$messages = $this->model->parse($messages);
if ( ! is_null($lead_ids)) {
$lead_ids = (array) $lead_ids;
$leads = Lead::withTrashed()->whereIn('user_id', $lead_ids)->get();
if (empty($leads) ||... | php | public function says($messages, $attributes = [], $lead_ids = null)
{
$messages = $this->model->parse($messages);
if ( ! is_null($lead_ids)) {
$lead_ids = (array) $lead_ids;
$leads = Lead::withTrashed()->whereIn('user_id', $lead_ids)->get();
if (empty($leads) ||... | [
"public",
"function",
"says",
"(",
"$",
"messages",
",",
"$",
"attributes",
"=",
"[",
"]",
",",
"$",
"lead_ids",
"=",
"null",
")",
"{",
"$",
"messages",
"=",
"$",
"this",
"->",
"model",
"->",
"parse",
"(",
"$",
"messages",
")",
";",
"if",
"(",
"!... | Send message to user.
@param mixed $messages Message to send
@param array $attributes Message attributes
@param $lead_ids Lead ID to send, by default current lead
@return $this | [
"Send",
"message",
"to",
"user",
"."
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Shared/CanLearn.php#L62-L82 |
226,736 | gigaai/framework | src/Shared/CanLearn.php | CanLearn.wait | public function wait($action)
{
$lead = $this->conversation->get('lead');
// For chaining after $bot->say() method
if ($lead != null) {
$lead->data('_wait', $action);
} // For chaining after $bot->answer() method
else {
$this->model->addIntendedAction... | php | public function wait($action)
{
$lead = $this->conversation->get('lead');
// For chaining after $bot->say() method
if ($lead != null) {
$lead->data('_wait', $action);
} // For chaining after $bot->answer() method
else {
$this->model->addIntendedAction... | [
"public",
"function",
"wait",
"(",
"$",
"action",
")",
"{",
"$",
"lead",
"=",
"$",
"this",
"->",
"conversation",
"->",
"get",
"(",
"'lead'",
")",
";",
"// For chaining after $bot->say() method",
"if",
"(",
"$",
"lead",
"!=",
"null",
")",
"{",
"$",
"lead"... | Named Intended Action
@param $action | [
"Named",
"Intended",
"Action"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Shared/CanLearn.php#L89-L100 |
226,737 | gigaai/framework | src/Shared/CanLearn.php | CanLearn.keep | public function keep($messages)
{
$previous_intended_action = $this->conversation->get('previous_intended_action');
if ($previous_intended_action == null) {
return;
}
$this->says($messages)->wait($previous_intended_action);
} | php | public function keep($messages)
{
$previous_intended_action = $this->conversation->get('previous_intended_action');
if ($previous_intended_action == null) {
return;
}
$this->says($messages)->wait($previous_intended_action);
} | [
"public",
"function",
"keep",
"(",
"$",
"messages",
")",
"{",
"$",
"previous_intended_action",
"=",
"$",
"this",
"->",
"conversation",
"->",
"get",
"(",
"'previous_intended_action'",
")",
";",
"if",
"(",
"$",
"previous_intended_action",
"==",
"null",
")",
"{",... | Keep staying in current intended action.
@param $messages | [
"Keep",
"staying",
"in",
"current",
"intended",
"action",
"."
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Shared/CanLearn.php#L121-L130 |
226,738 | wells/l4-ldap-ntlm | src/Wells/L4LdapNtlm/L4LdapNtlmUserProvider.php | L4LdapNtlmUserProvider.clean | public function clean(array $entry)
{
$entry['id'] = $entry['dn'];
$entry['remember_token'] = $entry['dn'];
$entry['username'] = $entry['samaccountname'][0];
// Default user type (ACL: 0 = admin, 1 = user)
$entry['type'] = 1;
$entry['group'] = '';
// Group based view access check
if(count($this->conf... | php | public function clean(array $entry)
{
$entry['id'] = $entry['dn'];
$entry['remember_token'] = $entry['dn'];
$entry['username'] = $entry['samaccountname'][0];
// Default user type (ACL: 0 = admin, 1 = user)
$entry['type'] = 1;
$entry['group'] = '';
// Group based view access check
if(count($this->conf... | [
"public",
"function",
"clean",
"(",
"array",
"$",
"entry",
")",
"{",
"$",
"entry",
"[",
"'id'",
"]",
"=",
"$",
"entry",
"[",
"'dn'",
"]",
";",
"$",
"entry",
"[",
"'remember_token'",
"]",
"=",
"$",
"entry",
"[",
"'dn'",
"]",
";",
"$",
"entry",
"["... | Cleans the data for the LDAP model including some additional fields.
@param array $entry
@return void | [
"Cleans",
"the",
"data",
"for",
"the",
"LDAP",
"model",
"including",
"some",
"additional",
"fields",
"."
] | 325876bb202c8ad68cec992c4847713360b854e7 | https://github.com/wells/l4-ldap-ntlm/blob/325876bb202c8ad68cec992c4847713360b854e7/src/Wells/L4LdapNtlm/L4LdapNtlmUserProvider.php#L151-L208 |
226,739 | phergie/phergie-irc-bot-react | src/EventQueue.php | EventQueue.getPriority | protected function getPriority($command, array $params)
{
$priority = new EventQueuePriority;
$priority->value = $this->priorities[$command];
$priority->timestamp = (int) (microtime(true) * 10000);
if ($priority->timestamp <= $this->lastTimestamp) {
$priority->timestamp =... | php | protected function getPriority($command, array $params)
{
$priority = new EventQueuePriority;
$priority->value = $this->priorities[$command];
$priority->timestamp = (int) (microtime(true) * 10000);
if ($priority->timestamp <= $this->lastTimestamp) {
$priority->timestamp =... | [
"protected",
"function",
"getPriority",
"(",
"$",
"command",
",",
"array",
"$",
"params",
")",
"{",
"$",
"priority",
"=",
"new",
"EventQueuePriority",
";",
"$",
"priority",
"->",
"value",
"=",
"$",
"this",
"->",
"priorities",
"[",
"$",
"command",
"]",
";... | Returns the priority of a specified command.
@param string $command
@param array $params Unused, intended for use by subclasses
@return \Phergie\Irc\Bot\React\EventQueuePriority | [
"Returns",
"the",
"priority",
"of",
"a",
"specified",
"command",
"."
] | 17745ef6b846513258af3dbd86e5612d3deb19b7 | https://github.com/phergie/phergie-irc-bot-react/blob/17745ef6b846513258af3dbd86e5612d3deb19b7/src/EventQueue.php#L114-L124 |
226,740 | phergie/phergie-irc-bot-react | src/EventQueue.php | EventQueue.queueRequest | protected function queueRequest(UserEventInterface $event, $command, array $params)
{
$event->setPrefix($this->prefix);
$event->setCommand($command);
$event->setParams(array_filter($params, 'strlen'));
$this->queue->insert($event, $this->getPriority($command, $params));
} | php | protected function queueRequest(UserEventInterface $event, $command, array $params)
{
$event->setPrefix($this->prefix);
$event->setCommand($command);
$event->setParams(array_filter($params, 'strlen'));
$this->queue->insert($event, $this->getPriority($command, $params));
} | [
"protected",
"function",
"queueRequest",
"(",
"UserEventInterface",
"$",
"event",
",",
"$",
"command",
",",
"array",
"$",
"params",
")",
"{",
"$",
"event",
"->",
"setPrefix",
"(",
"$",
"this",
"->",
"prefix",
")",
";",
"$",
"event",
"->",
"setCommand",
"... | Enqueues a new event.
@param \Phergie\Irc\Event\UserEventInterface
@param string $command
@param array $params | [
"Enqueues",
"a",
"new",
"event",
"."
] | 17745ef6b846513258af3dbd86e5612d3deb19b7 | https://github.com/phergie/phergie-irc-bot-react/blob/17745ef6b846513258af3dbd86e5612d3deb19b7/src/EventQueue.php#L133-L139 |
226,741 | phergie/phergie-irc-bot-react | src/EventQueue.php | EventQueue.queueCtcpEvent | protected function queueCtcpEvent($command, $ctcpCommand, array $params = [])
{
$event = new CtcpEvent;
$event->setCtcpCommand($ctcpCommand);
$this->queueRequest($event, $command, $params);
} | php | protected function queueCtcpEvent($command, $ctcpCommand, array $params = [])
{
$event = new CtcpEvent;
$event->setCtcpCommand($ctcpCommand);
$this->queueRequest($event, $command, $params);
} | [
"protected",
"function",
"queueCtcpEvent",
"(",
"$",
"command",
",",
"$",
"ctcpCommand",
",",
"array",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"$",
"event",
"=",
"new",
"CtcpEvent",
";",
"$",
"event",
"->",
"setCtcpCommand",
"(",
"$",
"ctcpCommand",
")",... | Enqueues a new CTCP event.
@param string $command IRC command
@param string $ctcpCommand CTCP command
@param array $params Command parameters | [
"Enqueues",
"a",
"new",
"CTCP",
"event",
"."
] | 17745ef6b846513258af3dbd86e5612d3deb19b7 | https://github.com/phergie/phergie-irc-bot-react/blob/17745ef6b846513258af3dbd86e5612d3deb19b7/src/EventQueue.php#L159-L164 |
226,742 | kronostechnologies/encrypt | src/Kronos/Encrypt/Key/Provider/KMS.php | KMS.getKey | public function getKey() {
if(!$this->decrypted_key) {
$decoded_ciphertextblob = base64_decode($this->key_description->getCiphertextBlob(), true);
if(!$decoded_ciphertextblob) {
throw new FetchException('CiphertextBlob should be a valid base64 encoded string');
}
$options = [
'CiphertextBlob' =>... | php | public function getKey() {
if(!$this->decrypted_key) {
$decoded_ciphertextblob = base64_decode($this->key_description->getCiphertextBlob(), true);
if(!$decoded_ciphertextblob) {
throw new FetchException('CiphertextBlob should be a valid base64 encoded string');
}
$options = [
'CiphertextBlob' =>... | [
"public",
"function",
"getKey",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"decrypted_key",
")",
"{",
"$",
"decoded_ciphertextblob",
"=",
"base64_decode",
"(",
"$",
"this",
"->",
"key_description",
"->",
"getCiphertextBlob",
"(",
")",
",",
"true",
"... | Return KMS decrypted key
@return string
@throws FetchException | [
"Return",
"KMS",
"decrypted",
"key"
] | 1fbd4750cbcda2b1b76cf7caf54b0a5c53a67414 | https://github.com/kronostechnologies/encrypt/blob/1fbd4750cbcda2b1b76cf7caf54b0a5c53a67414/src/Kronos/Encrypt/Key/Provider/KMS.php#L38-L66 |
226,743 | kronostechnologies/encrypt | src/Kronos/Encrypt/Cipher/AES.php | AES.encrypt | public function encrypt($plaintext, $key) {
$crypt_aes = $this->setupAES256($key);
return $crypt_aes->encrypt($plaintext);
} | php | public function encrypt($plaintext, $key) {
$crypt_aes = $this->setupAES256($key);
return $crypt_aes->encrypt($plaintext);
} | [
"public",
"function",
"encrypt",
"(",
"$",
"plaintext",
",",
"$",
"key",
")",
"{",
"$",
"crypt_aes",
"=",
"$",
"this",
"->",
"setupAES256",
"(",
"$",
"key",
")",
";",
"return",
"$",
"crypt_aes",
"->",
"encrypt",
"(",
"$",
"plaintext",
")",
";",
"}"
] | Use \phpseclib\Crypt\AES to encrypt plaintext using given key
based on http://phpseclib.sourceforge.net/crypt/examples.html
@param string $plaintext
@param string $key
@return string Ciphertext | [
"Use",
"\\",
"phpseclib",
"\\",
"Crypt",
"\\",
"AES",
"to",
"encrypt",
"plaintext",
"using",
"given",
"key"
] | 1fbd4750cbcda2b1b76cf7caf54b0a5c53a67414 | https://github.com/kronostechnologies/encrypt/blob/1fbd4750cbcda2b1b76cf7caf54b0a5c53a67414/src/Kronos/Encrypt/Cipher/AES.php#L25-L29 |
226,744 | kronostechnologies/encrypt | src/Kronos/Encrypt/Encrypt.php | Encrypt.encrypt | public function encrypt($plaintext) {
$key = $this->provider->getKey();
return $this->cipher->encrypt($plaintext, $key);
} | php | public function encrypt($plaintext) {
$key = $this->provider->getKey();
return $this->cipher->encrypt($plaintext, $key);
} | [
"public",
"function",
"encrypt",
"(",
"$",
"plaintext",
")",
"{",
"$",
"key",
"=",
"$",
"this",
"->",
"provider",
"->",
"getKey",
"(",
")",
";",
"return",
"$",
"this",
"->",
"cipher",
"->",
"encrypt",
"(",
"$",
"plaintext",
",",
"$",
"key",
")",
";... | Encrypt plaintext using given cypher and provided key
@param $plaintext
@return string | [
"Encrypt",
"plaintext",
"using",
"given",
"cypher",
"and",
"provided",
"key"
] | 1fbd4750cbcda2b1b76cf7caf54b0a5c53a67414 | https://github.com/kronostechnologies/encrypt/blob/1fbd4750cbcda2b1b76cf7caf54b0a5c53a67414/src/Kronos/Encrypt/Encrypt.php#L31-L35 |
226,745 | CoopBelvedere/laravel-basecamp-api | src/Sections/Vaults.php | Vaults.show | public function show($id)
{
$vault = $this->client->get(
sprintf('buckets/%d/vaults/%d.json', $this->bucket, $id)
);
return new Vault($this->response($vault));
} | php | public function show($id)
{
$vault = $this->client->get(
sprintf('buckets/%d/vaults/%d.json', $this->bucket, $id)
);
return new Vault($this->response($vault));
} | [
"public",
"function",
"show",
"(",
"$",
"id",
")",
"{",
"$",
"vault",
"=",
"$",
"this",
"->",
"client",
"->",
"get",
"(",
"sprintf",
"(",
"'buckets/%d/vaults/%d.json'",
",",
"$",
"this",
"->",
"bucket",
",",
"$",
"id",
")",
")",
";",
"return",
"new",... | Get a vault.
@param int $id
@return \Illuminate\Support\Collection | [
"Get",
"a",
"vault",
"."
] | cc0d6f25dfcbbe5c611642694bb6e4cb84664a82 | https://github.com/CoopBelvedere/laravel-basecamp-api/blob/cc0d6f25dfcbbe5c611642694bb6e4cb84664a82/src/Sections/Vaults.php#L15-L22 |
226,746 | CoopBelvedere/laravel-basecamp-api | src/Sections/Inboxes.php | Inboxes.show | public function show($id)
{
$inbox = $this->client->get(
sprintf('buckets/%d/inboxes/%d.json', $this->bucket, $id)
);
return new Inbox($this->response($inbox));
} | php | public function show($id)
{
$inbox = $this->client->get(
sprintf('buckets/%d/inboxes/%d.json', $this->bucket, $id)
);
return new Inbox($this->response($inbox));
} | [
"public",
"function",
"show",
"(",
"$",
"id",
")",
"{",
"$",
"inbox",
"=",
"$",
"this",
"->",
"client",
"->",
"get",
"(",
"sprintf",
"(",
"'buckets/%d/inboxes/%d.json'",
",",
"$",
"this",
"->",
"bucket",
",",
"$",
"id",
")",
")",
";",
"return",
"new"... | Get an inbox.
@param int $id
@return \Illuminate\Support\Collection | [
"Get",
"an",
"inbox",
"."
] | cc0d6f25dfcbbe5c611642694bb6e4cb84664a82 | https://github.com/CoopBelvedere/laravel-basecamp-api/blob/cc0d6f25dfcbbe5c611642694bb6e4cb84664a82/src/Sections/Inboxes.php#L15-L22 |
226,747 | CoopBelvedere/laravel-basecamp-api | src/Models/TodoListGroup.php | TodoListGroup.reposition | public function reposition($position)
{
return Basecamp::todoListGroups($this->bucket->id)
->reposition($this->id, $position);
} | php | public function reposition($position)
{
return Basecamp::todoListGroups($this->bucket->id)
->reposition($this->id, $position);
} | [
"public",
"function",
"reposition",
"(",
"$",
"position",
")",
"{",
"return",
"Basecamp",
"::",
"todoListGroups",
"(",
"$",
"this",
"->",
"bucket",
"->",
"id",
")",
"->",
"reposition",
"(",
"$",
"this",
"->",
"id",
",",
"$",
"position",
")",
";",
"}"
] | Reposition the to-do list group.
@param int $position
@return string | [
"Reposition",
"the",
"to",
"-",
"do",
"list",
"group",
"."
] | cc0d6f25dfcbbe5c611642694bb6e4cb84664a82 | https://github.com/CoopBelvedere/laravel-basecamp-api/blob/cc0d6f25dfcbbe5c611642694bb6e4cb84664a82/src/Models/TodoListGroup.php#L15-L19 |
226,748 | platforg/adobe-connect | src/AdobeConnect/ExtraApiClient.php | ExtraApiClient.createOrUpdateUserByLoginEmail | public function createOrUpdateUserByLoginEmail($data)
{
if (! isset($data['login'])) {
throw new \Exception(sprintf('Have to specify $data[login].'));
}
$data['principal-id'] = $this->getUserByLoginEmail($data['login'], true);
return $this->createOrUpdateUser($data);
... | php | public function createOrUpdateUserByLoginEmail($data)
{
if (! isset($data['login'])) {
throw new \Exception(sprintf('Have to specify $data[login].'));
}
$data['principal-id'] = $this->getUserByLoginEmail($data['login'], true);
return $this->createOrUpdateUser($data);
... | [
"public",
"function",
"createOrUpdateUserByLoginEmail",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"data",
"[",
"'login'",
"]",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"sprintf",
"(",
"'Have to specify $data[login].'",
")",... | Update an user by email, or create it if not exist.
@param array $data
@return int User's principal-id
@throws \Exception If is not present the login data. | [
"Update",
"an",
"user",
"by",
"email",
"or",
"create",
"it",
"if",
"not",
"exist",
"."
] | 70f47a00e282ebc3b6491a2ec0e68a770dbfa549 | https://github.com/platforg/adobe-connect/blob/70f47a00e282ebc3b6491a2ec0e68a770dbfa549/src/AdobeConnect/ExtraApiClient.php#L46-L55 |
226,749 | platforg/adobe-connect | src/AdobeConnect/ExtraApiClient.php | ExtraApiClient.createOrUpdateUser | public function createOrUpdateUser($data)
{
if (! isset($data['login']) && isset($data['email'])) {
$data['login'] = $data['email'];
} elseif (! isset($data['email']) && isset($data['login'])) {
$data['email'] = $data['login'];
}
if (isset($data['principal-id... | php | public function createOrUpdateUser($data)
{
if (! isset($data['login']) && isset($data['email'])) {
$data['login'] = $data['email'];
} elseif (! isset($data['email']) && isset($data['login'])) {
$data['email'] = $data['login'];
}
if (isset($data['principal-id... | [
"public",
"function",
"createOrUpdateUser",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"data",
"[",
"'login'",
"]",
")",
"&&",
"isset",
"(",
"$",
"data",
"[",
"'email'",
"]",
")",
")",
"{",
"$",
"data",
"[",
"'login'",
"]",
"=... | Create or Update an user according if principal-id is present on the data
@param array $data
@return int User's principal-id | [
"Create",
"or",
"Update",
"an",
"user",
"according",
"if",
"principal",
"-",
"id",
"is",
"present",
"on",
"the",
"data"
] | 70f47a00e282ebc3b6491a2ec0e68a770dbfa549 | https://github.com/platforg/adobe-connect/blob/70f47a00e282ebc3b6491a2ec0e68a770dbfa549/src/AdobeConnect/ExtraApiClient.php#L64-L77 |
226,750 | cash/LRUCache | src/cash/LRUCache.php | LRUCache.put | public function put($key, $value) {
if (isset($this->data[$key])) {
$this->data[$key] = $value;
$this->recordAccess($key);
} else {
$this->data[$key] = $value;
if ($this->size() > $this->maximumSize) {
// remove least recently used element ... | php | public function put($key, $value) {
if (isset($this->data[$key])) {
$this->data[$key] = $value;
$this->recordAccess($key);
} else {
$this->data[$key] = $value;
if ($this->size() > $this->maximumSize) {
// remove least recently used element ... | [
"public",
"function",
"put",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"data",
"[",
"$",
"key",
"]",
")",
")",
"{",
"$",
"this",
"->",
"data",
"[",
"$",
"key",
"]",
"=",
"$",
"value",
";",
"$"... | Put something in the cache
@param int|string $key The key. Strings that are ints are cast to ints.
@param mixed $value The value to cache | [
"Put",
"something",
"in",
"the",
"cache"
] | 4fa4c6834cec59690b43526c4da41d6153026289 | https://github.com/cash/LRUCache/blob/4fa4c6834cec59690b43526c4da41d6153026289/src/cash/LRUCache.php#L58-L70 |
226,751 | cash/LRUCache | src/cash/LRUCache.php | LRUCache.remove | public function remove($key) {
if (isset($this->data[$key])) {
$value = $this->data[$key];
unset($this->data[$key]);
return $value;
} else {
return null;
}
} | php | public function remove($key) {
if (isset($this->data[$key])) {
$value = $this->data[$key];
unset($this->data[$key]);
return $value;
} else {
return null;
}
} | [
"public",
"function",
"remove",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"data",
"[",
"$",
"key",
"]",
")",
")",
"{",
"$",
"value",
"=",
"$",
"this",
"->",
"data",
"[",
"$",
"key",
"]",
";",
"unset",
"(",
"$",
... | Remove the element with this key.
@param int|string $key The key
@return mixed Value or null if not set | [
"Remove",
"the",
"element",
"with",
"this",
"key",
"."
] | 4fa4c6834cec59690b43526c4da41d6153026289 | https://github.com/cash/LRUCache/blob/4fa4c6834cec59690b43526c4da41d6153026289/src/cash/LRUCache.php#L97-L105 |
226,752 | cash/LRUCache | src/cash/LRUCache.php | LRUCache.recordAccess | protected function recordAccess($key) {
$value = $this->data[$key];
unset($this->data[$key]);
$this->data[$key] = $value;
} | php | protected function recordAccess($key) {
$value = $this->data[$key];
unset($this->data[$key]);
$this->data[$key] = $value;
} | [
"protected",
"function",
"recordAccess",
"(",
"$",
"key",
")",
"{",
"$",
"value",
"=",
"$",
"this",
"->",
"data",
"[",
"$",
"key",
"]",
";",
"unset",
"(",
"$",
"this",
"->",
"data",
"[",
"$",
"key",
"]",
")",
";",
"$",
"this",
"->",
"data",
"["... | Moves the element from current position to end of array
@param int|string $key The key | [
"Moves",
"the",
"element",
"from",
"current",
"position",
"to",
"end",
"of",
"array"
] | 4fa4c6834cec59690b43526c4da41d6153026289 | https://github.com/cash/LRUCache/blob/4fa4c6834cec59690b43526c4da41d6153026289/src/cash/LRUCache.php#L119-L123 |
226,753 | CoopBelvedere/laravel-basecamp-api | src/Sections/Messages.php | Messages.index | public function index($page = null)
{
$url = sprintf('buckets/%d/message_boards/%d/messages.json', $this->bucket, $this->parent);
$messages = $this->client->get($url, [
'query' => [
'page' => $page,
],
]);
return $this->indexResponse($message... | php | public function index($page = null)
{
$url = sprintf('buckets/%d/message_boards/%d/messages.json', $this->bucket, $this->parent);
$messages = $this->client->get($url, [
'query' => [
'page' => $page,
],
]);
return $this->indexResponse($message... | [
"public",
"function",
"index",
"(",
"$",
"page",
"=",
"null",
")",
"{",
"$",
"url",
"=",
"sprintf",
"(",
"'buckets/%d/message_boards/%d/messages.json'",
",",
"$",
"this",
"->",
"bucket",
",",
"$",
"this",
"->",
"parent",
")",
";",
"$",
"messages",
"=",
"... | Index all messages.
@param int $page
@return \Illuminate\Support\Collection | [
"Index",
"all",
"messages",
"."
] | cc0d6f25dfcbbe5c611642694bb6e4cb84664a82 | https://github.com/CoopBelvedere/laravel-basecamp-api/blob/cc0d6f25dfcbbe5c611642694bb6e4cb84664a82/src/Sections/Messages.php#L18-L29 |
226,754 | CoopBelvedere/laravel-basecamp-api | src/Sections/Messages.php | Messages.store | public function store($data)
{
$message = $this->client->post(
sprintf('buckets/%d/message_boards/%d/messages.json', $this->bucket, $this->parent),
[
'json' => $data,
]
);
return new Message($this->response($message));
} | php | public function store($data)
{
$message = $this->client->post(
sprintf('buckets/%d/message_boards/%d/messages.json', $this->bucket, $this->parent),
[
'json' => $data,
]
);
return new Message($this->response($message));
} | [
"public",
"function",
"store",
"(",
"$",
"data",
")",
"{",
"$",
"message",
"=",
"$",
"this",
"->",
"client",
"->",
"post",
"(",
"sprintf",
"(",
"'buckets/%d/message_boards/%d/messages.json'",
",",
"$",
"this",
"->",
"bucket",
",",
"$",
"this",
"->",
"paren... | Store a message.
@param array $data
@return \Illuminate\Support\Collection | [
"Store",
"a",
"message",
"."
] | cc0d6f25dfcbbe5c611642694bb6e4cb84664a82 | https://github.com/CoopBelvedere/laravel-basecamp-api/blob/cc0d6f25dfcbbe5c611642694bb6e4cb84664a82/src/Sections/Messages.php#L52-L62 |
226,755 | CoopBelvedere/laravel-basecamp-api | src/Sections/Messages.php | Messages.update | public function update($id, $data)
{
$message = $this->client->put(
sprintf('buckets/%d/messages/%d.json', $this->bucket, $id),
[
'json' => $data,
]
);
return new Message($this->response($message));
} | php | public function update($id, $data)
{
$message = $this->client->put(
sprintf('buckets/%d/messages/%d.json', $this->bucket, $id),
[
'json' => $data,
]
);
return new Message($this->response($message));
} | [
"public",
"function",
"update",
"(",
"$",
"id",
",",
"$",
"data",
")",
"{",
"$",
"message",
"=",
"$",
"this",
"->",
"client",
"->",
"put",
"(",
"sprintf",
"(",
"'buckets/%d/messages/%d.json'",
",",
"$",
"this",
"->",
"bucket",
",",
"$",
"id",
")",
",... | Update a message.
@param int $id
@param array $data
@return \Illuminate\Support\Collection | [
"Update",
"a",
"message",
"."
] | cc0d6f25dfcbbe5c611642694bb6e4cb84664a82 | https://github.com/CoopBelvedere/laravel-basecamp-api/blob/cc0d6f25dfcbbe5c611642694bb6e4cb84664a82/src/Sections/Messages.php#L71-L81 |
226,756 | THECALLR/sdk-php | src/CALLR/Realtime/Command/Params.php | Params.getParams | public function getParams()
{
$params = [];
foreach ($this as $key => $value) {
$pname = (string) ltrim(strtolower(preg_replace('/[A-Z]/', '_$0', $key)), '_');
$params[$pname] = $value;
}
return $params;
} | php | public function getParams()
{
$params = [];
foreach ($this as $key => $value) {
$pname = (string) ltrim(strtolower(preg_replace('/[A-Z]/', '_$0', $key)), '_');
$params[$pname] = $value;
}
return $params;
} | [
"public",
"function",
"getParams",
"(",
")",
"{",
"$",
"params",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"pname",
"=",
"(",
"string",
")",
"ltrim",
"(",
"strtolower",
"(",
"preg_replace"... | Convert properties to array with snake_case properties
@return array {
@var string Property name
@var mixed Property value
} | [
"Convert",
"properties",
"to",
"array",
"with",
"snake_case",
"properties"
] | 3b6ade63a515dcf993cd2c8812950e39737fd3b9 | https://github.com/THECALLR/sdk-php/blob/3b6ade63a515dcf993cd2c8812950e39737fd3b9/src/CALLR/Realtime/Command/Params.php#L14-L22 |
226,757 | CoopBelvedere/laravel-basecamp-api | src/Models/Todo.php | Todo.update | public function update(array $data)
{
$todo = Basecamp::todos($this->bucket->id)->update($this->id, $data);
$this->setAttributes($todo);
return $todo;
} | php | public function update(array $data)
{
$todo = Basecamp::todos($this->bucket->id)->update($this->id, $data);
$this->setAttributes($todo);
return $todo;
} | [
"public",
"function",
"update",
"(",
"array",
"$",
"data",
")",
"{",
"$",
"todo",
"=",
"Basecamp",
"::",
"todos",
"(",
"$",
"this",
"->",
"bucket",
"->",
"id",
")",
"->",
"update",
"(",
"$",
"this",
"->",
"id",
",",
"$",
"data",
")",
";",
"$",
... | Update the to-do.
@param array $data
@return \Illuminate\Http\Collection | [
"Update",
"the",
"to",
"-",
"do",
"."
] | cc0d6f25dfcbbe5c611642694bb6e4cb84664a82 | https://github.com/CoopBelvedere/laravel-basecamp-api/blob/cc0d6f25dfcbbe5c611642694bb6e4cb84664a82/src/Models/Todo.php#L18-L25 |
226,758 | CoopBelvedere/laravel-basecamp-api | src/Models/Todo.php | Todo.reposition | public function reposition($position)
{
return Basecamp::todos($this->bucket->id)
->reposition($this->id, $position);
} | php | public function reposition($position)
{
return Basecamp::todos($this->bucket->id)
->reposition($this->id, $position);
} | [
"public",
"function",
"reposition",
"(",
"$",
"position",
")",
"{",
"return",
"Basecamp",
"::",
"todos",
"(",
"$",
"this",
"->",
"bucket",
"->",
"id",
")",
"->",
"reposition",
"(",
"$",
"this",
"->",
"id",
",",
"$",
"position",
")",
";",
"}"
] | Reposition the to-do.
@param int $position
@return string | [
"Reposition",
"the",
"to",
"-",
"do",
"."
] | cc0d6f25dfcbbe5c611642694bb6e4cb84664a82 | https://github.com/CoopBelvedere/laravel-basecamp-api/blob/cc0d6f25dfcbbe5c611642694bb6e4cb84664a82/src/Models/Todo.php#L53-L57 |
226,759 | neilime/zf2-assets-bundle | src/AssetsBundle/AssetFile/AssetFilesManager.php | AssetFilesManager.cacheCssAssetFiles | protected function cacheCssAssetFiles()
{
// Cache media asset files
$this->cacheMediaAssetFiles();
if ($this->getOptions()->isProduction()) {
// Retrieve asset file filters manager
$oAssetFileFiltersManager = $this->getAssetFileFiltersManager();
// Ret... | php | protected function cacheCssAssetFiles()
{
// Cache media asset files
$this->cacheMediaAssetFiles();
if ($this->getOptions()->isProduction()) {
// Retrieve asset file filters manager
$oAssetFileFiltersManager = $this->getAssetFileFiltersManager();
// Ret... | [
"protected",
"function",
"cacheCssAssetFiles",
"(",
")",
"{",
"// Cache media asset files",
"$",
"this",
"->",
"cacheMediaAssetFiles",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"getOptions",
"(",
")",
"->",
"isProduction",
"(",
")",
")",
"{",
"// Retrieve a... | Cache Css asset files and retrieve cached asset files
@return array | [
"Cache",
"Css",
"asset",
"files",
"and",
"retrieve",
"cached",
"asset",
"files"
] | 6399912d05d37c91be330e7accf3291a2dbdfe49 | https://github.com/neilime/zf2-assets-bundle/blob/6399912d05d37c91be330e7accf3291a2dbdfe49/src/AssetsBundle/AssetFile/AssetFilesManager.php#L107-L167 |
226,760 | neilime/zf2-assets-bundle | src/AssetsBundle/AssetFile/AssetFilesManager.php | AssetFilesManager.cacheLessAssetFiles | protected function cacheLessAssetFiles()
{
// Create tmp asset file
$oTmpAssetFile = $this->createTmpAssetFile(\AssetsBundle\AssetFile\AssetFile::ASSET_LESS);
// Retrieve Asset file cache manager;
$oAssetFilesCacheManager = $this->getAssetFilesCacheManager();
// Production... | php | protected function cacheLessAssetFiles()
{
// Create tmp asset file
$oTmpAssetFile = $this->createTmpAssetFile(\AssetsBundle\AssetFile\AssetFile::ASSET_LESS);
// Retrieve Asset file cache manager;
$oAssetFilesCacheManager = $this->getAssetFilesCacheManager();
// Production... | [
"protected",
"function",
"cacheLessAssetFiles",
"(",
")",
"{",
"// Create tmp asset file",
"$",
"oTmpAssetFile",
"=",
"$",
"this",
"->",
"createTmpAssetFile",
"(",
"\\",
"AssetsBundle",
"\\",
"AssetFile",
"\\",
"AssetFile",
"::",
"ASSET_LESS",
")",
";",
"// Retrieve... | Cache Less asset files and retrieve cached asset files
@return array | [
"Cache",
"Less",
"asset",
"files",
"and",
"retrieve",
"cached",
"asset",
"files"
] | 6399912d05d37c91be330e7accf3291a2dbdfe49 | https://github.com/neilime/zf2-assets-bundle/blob/6399912d05d37c91be330e7accf3291a2dbdfe49/src/AssetsBundle/AssetFile/AssetFilesManager.php#L174-L235 |
226,761 | neilime/zf2-assets-bundle | src/AssetsBundle/AssetFile/AssetFilesManager.php | AssetFilesManager.cacheJsAssetFiles | protected function cacheJsAssetFiles()
{
if ($this->getOptions()->isProduction()) {
// Retrieve asset file filters manager
$oAssetFileFiltersManager = $this->getAssetFileFiltersManager();
// Retrieve Js asset file filter if available
$oJsFileFilter = $oAssetF... | php | protected function cacheJsAssetFiles()
{
if ($this->getOptions()->isProduction()) {
// Retrieve asset file filters manager
$oAssetFileFiltersManager = $this->getAssetFileFiltersManager();
// Retrieve Js asset file filter if available
$oJsFileFilter = $oAssetF... | [
"protected",
"function",
"cacheJsAssetFiles",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getOptions",
"(",
")",
"->",
"isProduction",
"(",
")",
")",
"{",
"// Retrieve asset file filters manager",
"$",
"oAssetFileFiltersManager",
"=",
"$",
"this",
"->",
"getAs... | Cache Js asset files and retrieve cached asset files
@return array | [
"Cache",
"Js",
"asset",
"files",
"and",
"retrieve",
"cached",
"asset",
"files"
] | 6399912d05d37c91be330e7accf3291a2dbdfe49 | https://github.com/neilime/zf2-assets-bundle/blob/6399912d05d37c91be330e7accf3291a2dbdfe49/src/AssetsBundle/AssetFile/AssetFilesManager.php#L242-L274 |
226,762 | neilime/zf2-assets-bundle | src/AssetsBundle/AssetFile/AssetFilesManager.php | AssetFilesManager.cacheMediaAssetFiles | protected function cacheMediaAssetFiles()
{
$aAssetFileFilters = array();
$aAssetFiles = array();
//Retrieve asset files cache manager
$oAssetFilesCacheManager = $this->getAssetFilesCacheManager();
// Retrieve asset file filters manager
$oAssetFileFiltersManager = $... | php | protected function cacheMediaAssetFiles()
{
$aAssetFileFilters = array();
$aAssetFiles = array();
//Retrieve asset files cache manager
$oAssetFilesCacheManager = $this->getAssetFilesCacheManager();
// Retrieve asset file filters manager
$oAssetFileFiltersManager = $... | [
"protected",
"function",
"cacheMediaAssetFiles",
"(",
")",
"{",
"$",
"aAssetFileFilters",
"=",
"array",
"(",
")",
";",
"$",
"aAssetFiles",
"=",
"array",
"(",
")",
";",
"//Retrieve asset files cache manager",
"$",
"oAssetFilesCacheManager",
"=",
"$",
"this",
"->",
... | Cache media asset files and retrieve cached asset files
@return array | [
"Cache",
"media",
"asset",
"files",
"and",
"retrieve",
"cached",
"asset",
"files"
] | 6399912d05d37c91be330e7accf3291a2dbdfe49 | https://github.com/neilime/zf2-assets-bundle/blob/6399912d05d37c91be330e7accf3291a2dbdfe49/src/AssetsBundle/AssetFile/AssetFilesManager.php#L281-L321 |
226,763 | neilime/zf2-assets-bundle | src/AssetsBundle/AssetFile/AssetFilesManager.php | AssetFilesManager.rewriteAssetFileUrls | public function rewriteAssetFileUrls($sAssetFileContent, \AssetsBundle\AssetFile\AssetFile $oAssetFile){
// Callback for url rewriting
$oRewriteUrlCallback = array($this, 'rewriteUrl');
return preg_replace_callback('/url\(([^\)]+)\)/', function ($aMatches) use ($oAssetFile, $oRewriteUrlCallback)... | php | public function rewriteAssetFileUrls($sAssetFileContent, \AssetsBundle\AssetFile\AssetFile $oAssetFile){
// Callback for url rewriting
$oRewriteUrlCallback = array($this, 'rewriteUrl');
return preg_replace_callback('/url\(([^\)]+)\)/', function ($aMatches) use ($oAssetFile, $oRewriteUrlCallback)... | [
"public",
"function",
"rewriteAssetFileUrls",
"(",
"$",
"sAssetFileContent",
",",
"\\",
"AssetsBundle",
"\\",
"AssetFile",
"\\",
"AssetFile",
"$",
"oAssetFile",
")",
"{",
"// Callback for url rewriting",
"$",
"oRewriteUrlCallback",
"=",
"array",
"(",
"$",
"this",
",... | Rewrite url of an asset file content to match with cache path if needed
@param string $sAssetFileContent
@param \AssetsBundle\AssetFile\AssetFile $oAssetFile
@return string | [
"Rewrite",
"url",
"of",
"an",
"asset",
"file",
"content",
"to",
"match",
"with",
"cache",
"path",
"if",
"needed"
] | 6399912d05d37c91be330e7accf3291a2dbdfe49 | https://github.com/neilime/zf2-assets-bundle/blob/6399912d05d37c91be330e7accf3291a2dbdfe49/src/AssetsBundle/AssetFile/AssetFilesManager.php#L329-L335 |
226,764 | neilime/zf2-assets-bundle | src/AssetsBundle/AssetFile/AssetFilesManager.php | AssetFilesManager.rewriteUrl | public function rewriteUrl(array $aMatches, \AssetsBundle\AssetFile\AssetFile $oAssetFile)
{
if (!isset($aMatches[1])) {
throw new \InvalidArgumentException('Url match is not valid');
}
// Remove quotes & double quotes from url
$aFirstCharMatches = null;
$sFirstC... | php | public function rewriteUrl(array $aMatches, \AssetsBundle\AssetFile\AssetFile $oAssetFile)
{
if (!isset($aMatches[1])) {
throw new \InvalidArgumentException('Url match is not valid');
}
// Remove quotes & double quotes from url
$aFirstCharMatches = null;
$sFirstC... | [
"public",
"function",
"rewriteUrl",
"(",
"array",
"$",
"aMatches",
",",
"\\",
"AssetsBundle",
"\\",
"AssetFile",
"\\",
"AssetFile",
"$",
"oAssetFile",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"aMatches",
"[",
"1",
"]",
")",
")",
"{",
"throw",
"new"... | Rewrite url to match with cache path if needed
@param array $aMatches
@param \AssetsBundle\AssetFile\AssetFile $oAssetFile
@return array
@throws \InvalidArgumentException
@throws \LogicException | [
"Rewrite",
"url",
"to",
"match",
"with",
"cache",
"path",
"if",
"needed"
] | 6399912d05d37c91be330e7accf3291a2dbdfe49 | https://github.com/neilime/zf2-assets-bundle/blob/6399912d05d37c91be330e7accf3291a2dbdfe49/src/AssetsBundle/AssetFile/AssetFilesManager.php#L346-L408 |
226,765 | neilime/zf2-assets-bundle | src/AssetsBundle/AssetFile/AssetFilesManager.php | AssetFilesManager.setAssetFilesConfiguration | public function setAssetFilesConfiguration(\AssetsBundle\AssetFile\AssetFilesConfiguration $oAssetFilesConfiguration)
{
$this->assetFilesConfiguration = $oAssetFilesConfiguration->setOptions($this->getOptions());
return $this;
} | php | public function setAssetFilesConfiguration(\AssetsBundle\AssetFile\AssetFilesConfiguration $oAssetFilesConfiguration)
{
$this->assetFilesConfiguration = $oAssetFilesConfiguration->setOptions($this->getOptions());
return $this;
} | [
"public",
"function",
"setAssetFilesConfiguration",
"(",
"\\",
"AssetsBundle",
"\\",
"AssetFile",
"\\",
"AssetFilesConfiguration",
"$",
"oAssetFilesConfiguration",
")",
"{",
"$",
"this",
"->",
"assetFilesConfiguration",
"=",
"$",
"oAssetFilesConfiguration",
"->",
"setOpti... | Set the asset files configuration
@param \AssetsBundle\AssetFile\AssetFilesConfiguration $oAssetFilesConfiguration
@return \AssetsBundle\AssetFile\AssetFilesManager | [
"Set",
"the",
"asset",
"files",
"configuration"
] | 6399912d05d37c91be330e7accf3291a2dbdfe49 | https://github.com/neilime/zf2-assets-bundle/blob/6399912d05d37c91be330e7accf3291a2dbdfe49/src/AssetsBundle/AssetFile/AssetFilesManager.php#L467-L471 |
226,766 | neilime/zf2-assets-bundle | src/AssetsBundle/AssetFile/AssetFilesManager.php | AssetFilesManager.getAssetFilesConfiguration | public function getAssetFilesConfiguration()
{
if (!$this->assetFilesConfiguration instanceof \AssetsBundle\AssetFile\AssetFilesConfiguration) {
$this->setAssetFilesConfiguration(new \AssetsBundle\AssetFile\AssetFilesConfiguration());
}
return $this->assetFilesConfiguration;
... | php | public function getAssetFilesConfiguration()
{
if (!$this->assetFilesConfiguration instanceof \AssetsBundle\AssetFile\AssetFilesConfiguration) {
$this->setAssetFilesConfiguration(new \AssetsBundle\AssetFile\AssetFilesConfiguration());
}
return $this->assetFilesConfiguration;
... | [
"public",
"function",
"getAssetFilesConfiguration",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"assetFilesConfiguration",
"instanceof",
"\\",
"AssetsBundle",
"\\",
"AssetFile",
"\\",
"AssetFilesConfiguration",
")",
"{",
"$",
"this",
"->",
"setAssetFilesConfig... | Retrieve the asset files configuration. Lazy loads an instance if none currently set.
@return \AssetsBundle\AssetFile\AssetFilesConfiguration | [
"Retrieve",
"the",
"asset",
"files",
"configuration",
".",
"Lazy",
"loads",
"an",
"instance",
"if",
"none",
"currently",
"set",
"."
] | 6399912d05d37c91be330e7accf3291a2dbdfe49 | https://github.com/neilime/zf2-assets-bundle/blob/6399912d05d37c91be330e7accf3291a2dbdfe49/src/AssetsBundle/AssetFile/AssetFilesManager.php#L478-L484 |
226,767 | neilime/zf2-assets-bundle | src/AssetsBundle/AssetFile/AssetFilesManager.php | AssetFilesManager.setAssetFileFiltersManager | public function setAssetFileFiltersManager(\AssetsBundle\AssetFile\AssetFileFiltersManager $oAssetFileFiltersManager)
{
$this->assetFileFiltersManager = $oAssetFileFiltersManager->setOptions($this->getOptions());
return $this;
} | php | public function setAssetFileFiltersManager(\AssetsBundle\AssetFile\AssetFileFiltersManager $oAssetFileFiltersManager)
{
$this->assetFileFiltersManager = $oAssetFileFiltersManager->setOptions($this->getOptions());
return $this;
} | [
"public",
"function",
"setAssetFileFiltersManager",
"(",
"\\",
"AssetsBundle",
"\\",
"AssetFile",
"\\",
"AssetFileFiltersManager",
"$",
"oAssetFileFiltersManager",
")",
"{",
"$",
"this",
"->",
"assetFileFiltersManager",
"=",
"$",
"oAssetFileFiltersManager",
"->",
"setOpti... | Set the asset file filters manager
@param \AssetsBundle\AssetFile\AssetFileFiltersManager $oAssetFileFiltersManager
@return \AssetsBundle\AssetFile\AssetFilesManager | [
"Set",
"the",
"asset",
"file",
"filters",
"manager"
] | 6399912d05d37c91be330e7accf3291a2dbdfe49 | https://github.com/neilime/zf2-assets-bundle/blob/6399912d05d37c91be330e7accf3291a2dbdfe49/src/AssetsBundle/AssetFile/AssetFilesManager.php#L492-L496 |
226,768 | neilime/zf2-assets-bundle | src/AssetsBundle/AssetFile/AssetFilesManager.php | AssetFilesManager.getAssetFileFiltersManager | public function getAssetFileFiltersManager()
{
if (!$this->assetFileFiltersManager instanceof \AssetsBundle\AssetFile\AssetFileFiltersManager) {
$this->setAssetFileFiltersManager(new \AssetsBundle\AssetFile\AssetFileFiltersManager());
}
return $this->assetFileFiltersManager;
... | php | public function getAssetFileFiltersManager()
{
if (!$this->assetFileFiltersManager instanceof \AssetsBundle\AssetFile\AssetFileFiltersManager) {
$this->setAssetFileFiltersManager(new \AssetsBundle\AssetFile\AssetFileFiltersManager());
}
return $this->assetFileFiltersManager;
... | [
"public",
"function",
"getAssetFileFiltersManager",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"assetFileFiltersManager",
"instanceof",
"\\",
"AssetsBundle",
"\\",
"AssetFile",
"\\",
"AssetFileFiltersManager",
")",
"{",
"$",
"this",
"->",
"setAssetFileFilters... | Retrieve the asset file filters manager. Lazy loads an instance if none currently set.
@return \AssetsBundle\AssetFile\AssetFileFiltersManager | [
"Retrieve",
"the",
"asset",
"file",
"filters",
"manager",
".",
"Lazy",
"loads",
"an",
"instance",
"if",
"none",
"currently",
"set",
"."
] | 6399912d05d37c91be330e7accf3291a2dbdfe49 | https://github.com/neilime/zf2-assets-bundle/blob/6399912d05d37c91be330e7accf3291a2dbdfe49/src/AssetsBundle/AssetFile/AssetFilesManager.php#L503-L509 |
226,769 | neilime/zf2-assets-bundle | src/AssetsBundle/AssetFile/AssetFilesManager.php | AssetFilesManager.setAssetFilesCacheManager | public function setAssetFilesCacheManager(\AssetsBundle\AssetFile\AssetFilesCacheManager $oAssetFilesCacheManager)
{
$this->assetFilesCacheManager = $oAssetFilesCacheManager->setOptions($this->getOptions());
return $this;
} | php | public function setAssetFilesCacheManager(\AssetsBundle\AssetFile\AssetFilesCacheManager $oAssetFilesCacheManager)
{
$this->assetFilesCacheManager = $oAssetFilesCacheManager->setOptions($this->getOptions());
return $this;
} | [
"public",
"function",
"setAssetFilesCacheManager",
"(",
"\\",
"AssetsBundle",
"\\",
"AssetFile",
"\\",
"AssetFilesCacheManager",
"$",
"oAssetFilesCacheManager",
")",
"{",
"$",
"this",
"->",
"assetFilesCacheManager",
"=",
"$",
"oAssetFilesCacheManager",
"->",
"setOptions",... | Set the asset files cache manager
@param \AssetsBundle\AssetFile\AssetFilesCacheManager $oAssetFilesCacheManager
@return \AssetsBundle\AssetFile\AssetFilesManager | [
"Set",
"the",
"asset",
"files",
"cache",
"manager"
] | 6399912d05d37c91be330e7accf3291a2dbdfe49 | https://github.com/neilime/zf2-assets-bundle/blob/6399912d05d37c91be330e7accf3291a2dbdfe49/src/AssetsBundle/AssetFile/AssetFilesManager.php#L517-L521 |
226,770 | neilime/zf2-assets-bundle | src/AssetsBundle/AssetFile/AssetFilesManager.php | AssetFilesManager.getAssetFilesCacheManager | public function getAssetFilesCacheManager()
{
if (!$this->assetFilesCacheManager instanceof \AssetsBundle\AssetFile\AssetFilesCacheManager) {
$this->setAssetFilesCacheManager(new \AssetsBundle\AssetFile\AssetFilesCacheManager());
}
return $this->assetFilesCacheManager;
} | php | public function getAssetFilesCacheManager()
{
if (!$this->assetFilesCacheManager instanceof \AssetsBundle\AssetFile\AssetFilesCacheManager) {
$this->setAssetFilesCacheManager(new \AssetsBundle\AssetFile\AssetFilesCacheManager());
}
return $this->assetFilesCacheManager;
} | [
"public",
"function",
"getAssetFilesCacheManager",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"assetFilesCacheManager",
"instanceof",
"\\",
"AssetsBundle",
"\\",
"AssetFile",
"\\",
"AssetFilesCacheManager",
")",
"{",
"$",
"this",
"->",
"setAssetFilesCacheMana... | Retrieve the asset files cache manager. Lazy loads an instance if none currently set.
@return \AssetsBundle\AssetFile\AssetFilesCacheManager | [
"Retrieve",
"the",
"asset",
"files",
"cache",
"manager",
".",
"Lazy",
"loads",
"an",
"instance",
"if",
"none",
"currently",
"set",
"."
] | 6399912d05d37c91be330e7accf3291a2dbdfe49 | https://github.com/neilime/zf2-assets-bundle/blob/6399912d05d37c91be330e7accf3291a2dbdfe49/src/AssetsBundle/AssetFile/AssetFilesManager.php#L528-L534 |
226,771 | CoopBelvedere/laravel-basecamp-api | src/Sections/People.php | People.index | public function index($page = null)
{
$url = 'people.json';
$people = $this->client->get($url, [
'query' => [
'page' => $page,
]
]);
return $this->indexResponse($people, Person::class);
} | php | public function index($page = null)
{
$url = 'people.json';
$people = $this->client->get($url, [
'query' => [
'page' => $page,
]
]);
return $this->indexResponse($people, Person::class);
} | [
"public",
"function",
"index",
"(",
"$",
"page",
"=",
"null",
")",
"{",
"$",
"url",
"=",
"'people.json'",
";",
"$",
"people",
"=",
"$",
"this",
"->",
"client",
"->",
"get",
"(",
"$",
"url",
",",
"[",
"'query'",
"=>",
"[",
"'page'",
"=>",
"$",
"pa... | Get people.
@param int $page
@return \Illuminate\Support\Collection | [
"Get",
"people",
"."
] | cc0d6f25dfcbbe5c611642694bb6e4cb84664a82 | https://github.com/CoopBelvedere/laravel-basecamp-api/blob/cc0d6f25dfcbbe5c611642694bb6e4cb84664a82/src/Sections/People.php#L15-L26 |
226,772 | CoopBelvedere/laravel-basecamp-api | src/Sections/People.php | People.inProject | public function inProject($bucket, $page = null)
{
$url = sprintf('projects/%d/people.json', $bucket);
$people = $this->client->get($url, [
'query' => [
'page' => $page,
],
]);
return $this->indexResponse($people, Person::class);
} | php | public function inProject($bucket, $page = null)
{
$url = sprintf('projects/%d/people.json', $bucket);
$people = $this->client->get($url, [
'query' => [
'page' => $page,
],
]);
return $this->indexResponse($people, Person::class);
} | [
"public",
"function",
"inProject",
"(",
"$",
"bucket",
",",
"$",
"page",
"=",
"null",
")",
"{",
"$",
"url",
"=",
"sprintf",
"(",
"'projects/%d/people.json'",
",",
"$",
"bucket",
")",
";",
"$",
"people",
"=",
"$",
"this",
"->",
"client",
"->",
"get",
... | Get people on a project.
@param int $bucket
@param int $page
@return \Illuminate\Support\Collection | [
"Get",
"people",
"on",
"a",
"project",
"."
] | cc0d6f25dfcbbe5c611642694bb6e4cb84664a82 | https://github.com/CoopBelvedere/laravel-basecamp-api/blob/cc0d6f25dfcbbe5c611642694bb6e4cb84664a82/src/Sections/People.php#L35-L46 |
226,773 | CoopBelvedere/laravel-basecamp-api | src/Sections/People.php | People.updateAccessToProject | public function updateAccessToProject($bucket, $data)
{
$access = $this->client->put(
sprintf('projects/%d/people/users.json', $bucket),
[
'json' => $data,
]
);
return $this->response($access);
} | php | public function updateAccessToProject($bucket, $data)
{
$access = $this->client->put(
sprintf('projects/%d/people/users.json', $bucket),
[
'json' => $data,
]
);
return $this->response($access);
} | [
"public",
"function",
"updateAccessToProject",
"(",
"$",
"bucket",
",",
"$",
"data",
")",
"{",
"$",
"access",
"=",
"$",
"this",
"->",
"client",
"->",
"put",
"(",
"sprintf",
"(",
"'projects/%d/people/users.json'",
",",
"$",
"bucket",
")",
",",
"[",
"'json'"... | Update an access to a project.
@param int $bucket
@param array $data
@return \Illuminate\Support\Collection | [
"Update",
"an",
"access",
"to",
"a",
"project",
"."
] | cc0d6f25dfcbbe5c611642694bb6e4cb84664a82 | https://github.com/CoopBelvedere/laravel-basecamp-api/blob/cc0d6f25dfcbbe5c611642694bb6e4cb84664a82/src/Sections/People.php#L55-L65 |
226,774 | CoopBelvedere/laravel-basecamp-api | src/Sections/People.php | People.show | public function show($id)
{
$person = $this->client->get(sprintf('people/%d.json', $id));
return new Person($this->response($person));
} | php | public function show($id)
{
$person = $this->client->get(sprintf('people/%d.json', $id));
return new Person($this->response($person));
} | [
"public",
"function",
"show",
"(",
"$",
"id",
")",
"{",
"$",
"person",
"=",
"$",
"this",
"->",
"client",
"->",
"get",
"(",
"sprintf",
"(",
"'people/%d.json'",
",",
"$",
"id",
")",
")",
";",
"return",
"new",
"Person",
"(",
"$",
"this",
"->",
"respon... | Get a person.
@param int $id
@return \Illuminate\Support\Collection | [
"Get",
"a",
"person",
"."
] | cc0d6f25dfcbbe5c611642694bb6e4cb84664a82 | https://github.com/CoopBelvedere/laravel-basecamp-api/blob/cc0d6f25dfcbbe5c611642694bb6e4cb84664a82/src/Sections/People.php#L92-L97 |
226,775 | stevenmaguire/laravel-middleware-csp | src/EnforceContentSecurity.php | EnforceContentSecurity.handle | public function handle($request, Closure $next)
{
$response = $next($request);
if ($response instanceof Response) {
$this->setProfiles($this->getProfileConfig());
$this->setProfilesWithParameters(func_get_args());
$psr7Response = $this->createPsr7Response($resp... | php | public function handle($request, Closure $next)
{
$response = $next($request);
if ($response instanceof Response) {
$this->setProfiles($this->getProfileConfig());
$this->setProfilesWithParameters(func_get_args());
$psr7Response = $this->createPsr7Response($resp... | [
"public",
"function",
"handle",
"(",
"$",
"request",
",",
"Closure",
"$",
"next",
")",
"{",
"$",
"response",
"=",
"$",
"next",
"(",
"$",
"request",
")",
";",
"if",
"(",
"$",
"response",
"instanceof",
"Response",
")",
"{",
"$",
"this",
"->",
"setProfi... | Handles an incoming request.
@param \Illuminate\Http\Request $request
@param \Closure $next
@return mixed | [
"Handles",
"an",
"incoming",
"request",
"."
] | 3427292659bcab5010230122626c1fd68b921ba6 | https://github.com/stevenmaguire/laravel-middleware-csp/blob/3427292659bcab5010230122626c1fd68b921ba6/src/EnforceContentSecurity.php#L41-L58 |
226,776 | stevenmaguire/laravel-middleware-csp | src/EnforceContentSecurity.php | EnforceContentSecurity.createLaravelResponse | protected function createLaravelResponse(ResponseInterface $response)
{
return new Response(
(string) $response->getBody(),
$response->getStatusCode(),
$response->getHeaders()
);
} | php | protected function createLaravelResponse(ResponseInterface $response)
{
return new Response(
(string) $response->getBody(),
$response->getStatusCode(),
$response->getHeaders()
);
} | [
"protected",
"function",
"createLaravelResponse",
"(",
"ResponseInterface",
"$",
"response",
")",
"{",
"return",
"new",
"Response",
"(",
"(",
"string",
")",
"$",
"response",
"->",
"getBody",
"(",
")",
",",
"$",
"response",
"->",
"getStatusCode",
"(",
")",
",... | Creates Laravel response object from PSR 7 response.
@param ResponseInterface $response
@return Response | [
"Creates",
"Laravel",
"response",
"object",
"from",
"PSR",
"7",
"response",
"."
] | 3427292659bcab5010230122626c1fd68b921ba6 | https://github.com/stevenmaguire/laravel-middleware-csp/blob/3427292659bcab5010230122626c1fd68b921ba6/src/EnforceContentSecurity.php#L67-L74 |
226,777 | stevenmaguire/laravel-middleware-csp | src/EnforceContentSecurity.php | EnforceContentSecurity.createPsr7Response | protected function createPsr7Response(Response $response)
{
return new PsrResponse(
$response->getStatusCode(),
$response->headers->all(),
$response->getContent(),
$response->getProtocolVersion()
);
} | php | protected function createPsr7Response(Response $response)
{
return new PsrResponse(
$response->getStatusCode(),
$response->headers->all(),
$response->getContent(),
$response->getProtocolVersion()
);
} | [
"protected",
"function",
"createPsr7Response",
"(",
"Response",
"$",
"response",
")",
"{",
"return",
"new",
"PsrResponse",
"(",
"$",
"response",
"->",
"getStatusCode",
"(",
")",
",",
"$",
"response",
"->",
"headers",
"->",
"all",
"(",
")",
",",
"$",
"respo... | Creates PSR 7 response object from Laravel response.
@param Response $response
@return ResponseInterface | [
"Creates",
"PSR",
"7",
"response",
"object",
"from",
"Laravel",
"response",
"."
] | 3427292659bcab5010230122626c1fd68b921ba6 | https://github.com/stevenmaguire/laravel-middleware-csp/blob/3427292659bcab5010230122626c1fd68b921ba6/src/EnforceContentSecurity.php#L83-L91 |
226,778 | stevenmaguire/laravel-middleware-csp | src/EnforceContentSecurity.php | EnforceContentSecurity.getProfileConfig | protected function getProfileConfig()
{
$configCallable = $this->config;
$config = $configCallable($this->getProfileConfigKey());
if (!is_array($config)) {
$config = [$config];
}
return array_filter($config);
} | php | protected function getProfileConfig()
{
$configCallable = $this->config;
$config = $configCallable($this->getProfileConfigKey());
if (!is_array($config)) {
$config = [$config];
}
return array_filter($config);
} | [
"protected",
"function",
"getProfileConfig",
"(",
")",
"{",
"$",
"configCallable",
"=",
"$",
"this",
"->",
"config",
";",
"$",
"config",
"=",
"$",
"configCallable",
"(",
"$",
"this",
"->",
"getProfileConfigKey",
"(",
")",
")",
";",
"if",
"(",
"!",
"is_ar... | Retrives profile configuration from Laravel config object.
@return array | [
"Retrives",
"profile",
"configuration",
"from",
"Laravel",
"config",
"object",
"."
] | 3427292659bcab5010230122626c1fd68b921ba6 | https://github.com/stevenmaguire/laravel-middleware-csp/blob/3427292659bcab5010230122626c1fd68b921ba6/src/EnforceContentSecurity.php#L98-L108 |
226,779 | stevenmaguire/laravel-middleware-csp | src/EnforceContentSecurity.php | EnforceContentSecurity.getProfilesFromArguments | protected function getProfilesFromArguments(array $arguments)
{
$profiles = [];
if (count($arguments) > 2) {
unset($arguments[0]);
unset($arguments[1]);
$profiles = $arguments;
}
return $profiles;
} | php | protected function getProfilesFromArguments(array $arguments)
{
$profiles = [];
if (count($arguments) > 2) {
unset($arguments[0]);
unset($arguments[1]);
$profiles = $arguments;
}
return $profiles;
} | [
"protected",
"function",
"getProfilesFromArguments",
"(",
"array",
"$",
"arguments",
")",
"{",
"$",
"profiles",
"=",
"[",
"]",
";",
"if",
"(",
"count",
"(",
"$",
"arguments",
")",
">",
"2",
")",
"{",
"unset",
"(",
"$",
"arguments",
"[",
"0",
"]",
")"... | Gets profiles from handle method arguments.
@param array $arguments
@return array | [
"Gets",
"profiles",
"from",
"handle",
"method",
"arguments",
"."
] | 3427292659bcab5010230122626c1fd68b921ba6 | https://github.com/stevenmaguire/laravel-middleware-csp/blob/3427292659bcab5010230122626c1fd68b921ba6/src/EnforceContentSecurity.php#L127-L136 |
226,780 | kossmoss/yii2-postgresql-array-field | src/PostgresqlArrayFieldBehavior.php | PostgresqlArrayFieldBehavior._loadArray | public function _loadArray()
{
$rawData = $this->getRawData();
$value = $this->_postgresqlArrayDecode($rawData);
$value = $value ?: [];
$this->getModel()->setAttribute($this->getArrayFieldName(), $value);
return $this;
} | php | public function _loadArray()
{
$rawData = $this->getRawData();
$value = $this->_postgresqlArrayDecode($rawData);
$value = $value ?: [];
$this->getModel()->setAttribute($this->getArrayFieldName(), $value);
return $this;
} | [
"public",
"function",
"_loadArray",
"(",
")",
"{",
"$",
"rawData",
"=",
"$",
"this",
"->",
"getRawData",
"(",
")",
";",
"$",
"value",
"=",
"$",
"this",
"->",
"_postgresqlArrayDecode",
"(",
"$",
"rawData",
")",
";",
"$",
"value",
"=",
"$",
"value",
"?... | Loads array field
@return $this | [
"Loads",
"array",
"field"
] | 9f27fa5dbd1bd2700a44d52de7213bf837749569 | https://github.com/kossmoss/yii2-postgresql-array-field/blob/9f27fa5dbd1bd2700a44d52de7213bf837749569/src/PostgresqlArrayFieldBehavior.php#L139-L147 |
226,781 | kossmoss/yii2-postgresql-array-field | src/PostgresqlArrayFieldBehavior.php | PostgresqlArrayFieldBehavior._postgresqlArrayDecode | protected function _postgresqlArrayDecode($data, $start = 0)
{
if (empty($data) || $data[0] != '{') {
return null;
}
$result = [];
$string = false;
$quote = '';
$len = strlen($data);
$v = '';
for ($i = $start + 1; $i < $len; $i++) {
$ch = $data[$i];
if (!$string && $ch == '}') {
if ($v... | php | protected function _postgresqlArrayDecode($data, $start = 0)
{
if (empty($data) || $data[0] != '{') {
return null;
}
$result = [];
$string = false;
$quote = '';
$len = strlen($data);
$v = '';
for ($i = $start + 1; $i < $len; $i++) {
$ch = $data[$i];
if (!$string && $ch == '}') {
if ($v... | [
"protected",
"function",
"_postgresqlArrayDecode",
"(",
"$",
"data",
",",
"$",
"start",
"=",
"0",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"data",
")",
"||",
"$",
"data",
"[",
"0",
"]",
"!=",
"'{'",
")",
"{",
"return",
"null",
";",
"}",
"$",
"resu... | Decodes PostgreSQL array data into PHP array
@link http://stackoverflow.com/questions/3068683/convert-postgresql-array-to-php-array/27964420#27964420
@param string $data PostgreSQL-encoded array
@param int $start start position for recursive inner arrays parsing
@return array | [
"Decodes",
"PostgreSQL",
"array",
"data",
"into",
"PHP",
"array"
] | 9f27fa5dbd1bd2700a44d52de7213bf837749569 | https://github.com/kossmoss/yii2-postgresql-array-field/blob/9f27fa5dbd1bd2700a44d52de7213bf837749569/src/PostgresqlArrayFieldBehavior.php#L159-L198 |
226,782 | kossmoss/yii2-postgresql-array-field | src/PostgresqlArrayFieldBehavior.php | PostgresqlArrayFieldBehavior._saveArray | public function _saveArray()
{
$value = $this->getModel()->getAttribute($this->getArrayFieldName());;
$value = $this->_postgresqlArrayEncode($value);
if($value === null && $this->onEmptySaveNull == false){
$value = '{}';
}
$this->getModel()->setAttribute($this->getArrayFieldName(), $value);
return $thi... | php | public function _saveArray()
{
$value = $this->getModel()->getAttribute($this->getArrayFieldName());;
$value = $this->_postgresqlArrayEncode($value);
if($value === null && $this->onEmptySaveNull == false){
$value = '{}';
}
$this->getModel()->setAttribute($this->getArrayFieldName(), $value);
return $thi... | [
"public",
"function",
"_saveArray",
"(",
")",
"{",
"$",
"value",
"=",
"$",
"this",
"->",
"getModel",
"(",
")",
"->",
"getAttribute",
"(",
"$",
"this",
"->",
"getArrayFieldName",
"(",
")",
")",
";",
";",
"$",
"value",
"=",
"$",
"this",
"->",
"_postgre... | Sets array field data into format suitable for save
@return $this | [
"Sets",
"array",
"field",
"data",
"into",
"format",
"suitable",
"for",
"save"
] | 9f27fa5dbd1bd2700a44d52de7213bf837749569 | https://github.com/kossmoss/yii2-postgresql-array-field/blob/9f27fa5dbd1bd2700a44d52de7213bf837749569/src/PostgresqlArrayFieldBehavior.php#L205-L215 |
226,783 | kossmoss/yii2-postgresql-array-field | src/PostgresqlArrayFieldBehavior.php | PostgresqlArrayFieldBehavior._postgresqlArrayEncode | protected function _postgresqlArrayEncode($value)
{
if (empty($value) || !is_array($value)) {
return null;
}
$result = '{';
$firstElem = true;
foreach($value as $elem) {
// add comma before element if it is not the first one
if(!$firstElem){
$result .= ',';
}
if(is_array($elem)){
$re... | php | protected function _postgresqlArrayEncode($value)
{
if (empty($value) || !is_array($value)) {
return null;
}
$result = '{';
$firstElem = true;
foreach($value as $elem) {
// add comma before element if it is not the first one
if(!$firstElem){
$result .= ',';
}
if(is_array($elem)){
$re... | [
"protected",
"function",
"_postgresqlArrayEncode",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"value",
")",
"||",
"!",
"is_array",
"(",
"$",
"value",
")",
")",
"{",
"return",
"null",
";",
"}",
"$",
"result",
"=",
"'{'",
";",
"$",
"f... | Encodes PHP array into PostgreSQL array data format
@param array $value
@return string PostgreSQL-encoded array
@throws \Exception | [
"Encodes",
"PHP",
"array",
"into",
"PostgreSQL",
"array",
"data",
"format"
] | 9f27fa5dbd1bd2700a44d52de7213bf837749569 | https://github.com/kossmoss/yii2-postgresql-array-field/blob/9f27fa5dbd1bd2700a44d52de7213bf837749569/src/PostgresqlArrayFieldBehavior.php#L224-L256 |
226,784 | THECALLR/sdk-php | src/CALLR/Realtime/Server.php | Server.start | public function start()
{
try {
/* raw input handler */
$raw = file_get_contents(php_sapi_name() === 'cli' ? 'php://stdin' : 'php://input');
if ($this->rawInputHandler !== null) {
call_user_func($this->rawInputHandler, $raw);
}
/* p... | php | public function start()
{
try {
/* raw input handler */
$raw = file_get_contents(php_sapi_name() === 'cli' ? 'php://stdin' : 'php://input');
if ($this->rawInputHandler !== null) {
call_user_func($this->rawInputHandler, $raw);
}
/* p... | [
"public",
"function",
"start",
"(",
")",
"{",
"try",
"{",
"/* raw input handler */",
"$",
"raw",
"=",
"file_get_contents",
"(",
"php_sapi_name",
"(",
")",
"===",
"'cli'",
"?",
"'php://stdin'",
":",
"'php://input'",
")",
";",
"if",
"(",
"$",
"this",
"->",
"... | Starts the server. | [
"Starts",
"the",
"server",
"."
] | 3b6ade63a515dcf993cd2c8812950e39737fd3b9 | https://github.com/THECALLR/sdk-php/blob/3b6ade63a515dcf993cd2c8812950e39737fd3b9/src/CALLR/Realtime/Server.php#L62-L100 |
226,785 | nstapelbroek/culpa-laravel-5 | src/Traits/Blameable.php | Blameable.getFields | protected function getFields()
{
// Abort if blameble has been disabled explicitly
if (false === $this->blameable) {
return false;
}
if (!isset($this->fields)) {
$this->fields = BlameableObserver::findBlameableFields($this, $this->blameable);
}
... | php | protected function getFields()
{
// Abort if blameble has been disabled explicitly
if (false === $this->blameable) {
return false;
}
if (!isset($this->fields)) {
$this->fields = BlameableObserver::findBlameableFields($this, $this->blameable);
}
... | [
"protected",
"function",
"getFields",
"(",
")",
"{",
"// Abort if blameble has been disabled explicitly",
"if",
"(",
"false",
"===",
"$",
"this",
"->",
"blameable",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"fiel... | Get blameable fields.
@return array | [
"Get",
"blameable",
"fields",
"."
] | 1a65af243fa52565c4a76c0446a80540bc5fded2 | https://github.com/nstapelbroek/culpa-laravel-5/blob/1a65af243fa52565c4a76c0446a80540bc5fded2/src/Traits/Blameable.php#L39-L51 |
226,786 | neilime/zf2-assets-bundle | src/AssetsBundle/View/Strategy/JsCustomStrategy.php | JsCustomStrategy.detach | public function detach(\Zend\EventManager\EventManagerInterface $oEvents) {
foreach ($this->listeners as $iIndex => $oListener) {
if ($oEvents->detach($oListener)) {
unset($this->listeners[$iIndex]);
}
}
} | php | public function detach(\Zend\EventManager\EventManagerInterface $oEvents) {
foreach ($this->listeners as $iIndex => $oListener) {
if ($oEvents->detach($oListener)) {
unset($this->listeners[$iIndex]);
}
}
} | [
"public",
"function",
"detach",
"(",
"\\",
"Zend",
"\\",
"EventManager",
"\\",
"EventManagerInterface",
"$",
"oEvents",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"listeners",
"as",
"$",
"iIndex",
"=>",
"$",
"oListener",
")",
"{",
"if",
"(",
"$",
"oEve... | Detach aggregate listeners from the specified event manager
@param \Zend\EventManager\EventManagerInterface $oEvents
@return void | [
"Detach",
"aggregate",
"listeners",
"from",
"the",
"specified",
"event",
"manager"
] | 6399912d05d37c91be330e7accf3291a2dbdfe49 | https://github.com/neilime/zf2-assets-bundle/blob/6399912d05d37c91be330e7accf3291a2dbdfe49/src/AssetsBundle/View/Strategy/JsCustomStrategy.php#L74-L80 |
226,787 | CoopBelvedere/laravel-basecamp-api | src/Sections/Questionnaires.php | Questionnaires.show | public function show($id)
{
$questionnaire = $this->client->get(
sprintf('buckets/%d/questionnaires/%d.json', $this->bucket, $id)
);
return new Questionnaire($this->response($questionnaire));
} | php | public function show($id)
{
$questionnaire = $this->client->get(
sprintf('buckets/%d/questionnaires/%d.json', $this->bucket, $id)
);
return new Questionnaire($this->response($questionnaire));
} | [
"public",
"function",
"show",
"(",
"$",
"id",
")",
"{",
"$",
"questionnaire",
"=",
"$",
"this",
"->",
"client",
"->",
"get",
"(",
"sprintf",
"(",
"'buckets/%d/questionnaires/%d.json'",
",",
"$",
"this",
"->",
"bucket",
",",
"$",
"id",
")",
")",
";",
"r... | Get a questionnaire.
@param int $id
@return \Illuminate\Support\Collection | [
"Get",
"a",
"questionnaire",
"."
] | cc0d6f25dfcbbe5c611642694bb6e4cb84664a82 | https://github.com/CoopBelvedere/laravel-basecamp-api/blob/cc0d6f25dfcbbe5c611642694bb6e4cb84664a82/src/Sections/Questionnaires.php#L15-L22 |
226,788 | CoopBelvedere/laravel-basecamp-api | src/Client.php | Client.getHttpClient | protected function getHttpClient()
{
if (is_null($this->httpClient)) {
$handlerStack = $this->createHandlerStack();
return new Guzzle([
'base_uri' => rtrim($this->api['href'],'/').'/',
'handler' => $handlerStack,
]);
}
re... | php | protected function getHttpClient()
{
if (is_null($this->httpClient)) {
$handlerStack = $this->createHandlerStack();
return new Guzzle([
'base_uri' => rtrim($this->api['href'],'/').'/',
'handler' => $handlerStack,
]);
}
re... | [
"protected",
"function",
"getHttpClient",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"httpClient",
")",
")",
"{",
"$",
"handlerStack",
"=",
"$",
"this",
"->",
"createHandlerStack",
"(",
")",
";",
"return",
"new",
"Guzzle",
"(",
"[",
"... | Get the Http Client.
@return \GuzzleHttp\Client | [
"Get",
"the",
"Http",
"Client",
"."
] | cc0d6f25dfcbbe5c611642694bb6e4cb84664a82 | https://github.com/CoopBelvedere/laravel-basecamp-api/blob/cc0d6f25dfcbbe5c611642694bb6e4cb84664a82/src/Client.php#L92-L105 |
226,789 | CoopBelvedere/laravel-basecamp-api | src/Client.php | Client.createHandlerStack | protected function createHandlerStack()
{
$stack = HandlerStack::create(new CurlHandler());
$stack->push(ClientMiddlewares::cache($this->cache));
$stack->push(
ClientMiddlewares::setBaseHeaders(
$this->api['token'], $this->config['basecamp.user-agent']
... | php | protected function createHandlerStack()
{
$stack = HandlerStack::create(new CurlHandler());
$stack->push(ClientMiddlewares::cache($this->cache));
$stack->push(
ClientMiddlewares::setBaseHeaders(
$this->api['token'], $this->config['basecamp.user-agent']
... | [
"protected",
"function",
"createHandlerStack",
"(",
")",
"{",
"$",
"stack",
"=",
"HandlerStack",
"::",
"create",
"(",
"new",
"CurlHandler",
"(",
")",
")",
";",
"$",
"stack",
"->",
"push",
"(",
"ClientMiddlewares",
"::",
"cache",
"(",
"$",
"this",
"->",
"... | Create an Handler Stack to pass Middlewares to Guzzle.
@return \GuzzleHttp\HandlerStack | [
"Create",
"an",
"Handler",
"Stack",
"to",
"pass",
"Middlewares",
"to",
"Guzzle",
"."
] | cc0d6f25dfcbbe5c611642694bb6e4cb84664a82 | https://github.com/CoopBelvedere/laravel-basecamp-api/blob/cc0d6f25dfcbbe5c611642694bb6e4cb84664a82/src/Client.php#L134-L154 |
226,790 | beheh/flaps | src/Flaps/Throttling/LeakyBucketStrategy.php | LeakyBucketStrategy.setRequestsPerTimeSpan | public function setRequestsPerTimeSpan($requests)
{
if (!is_numeric($requests)) {
throw new InvalidArgumentException('requests per timespan is not numeric');
}
$requests = (int) $requests;
if ($requests < 1) {
throw new InvalidArgumentException('requests per t... | php | public function setRequestsPerTimeSpan($requests)
{
if (!is_numeric($requests)) {
throw new InvalidArgumentException('requests per timespan is not numeric');
}
$requests = (int) $requests;
if ($requests < 1) {
throw new InvalidArgumentException('requests per t... | [
"public",
"function",
"setRequestsPerTimeSpan",
"(",
"$",
"requests",
")",
"{",
"if",
"(",
"!",
"is_numeric",
"(",
"$",
"requests",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"'requests per timespan is not numeric'",
")",
";",
"}",
"$",
"req... | Sets the maximum number of requests allowed per timespan for a single entity.
@param int $requests
@throws \InvalidArgumentException | [
"Sets",
"the",
"maximum",
"number",
"of",
"requests",
"allowed",
"per",
"timespan",
"for",
"a",
"single",
"entity",
"."
] | 327110f6c97a3a3e90bd39c47ebb9e2f02db9d61 | https://github.com/beheh/flaps/blob/327110f6c97a3a3e90bd39c47ebb9e2f02db9d61/src/Flaps/Throttling/LeakyBucketStrategy.php#L30-L40 |
226,791 | beheh/flaps | src/Flaps/Throttling/LeakyBucketStrategy.php | LeakyBucketStrategy.setTimeSpan | public function setTimeSpan($timeSpan)
{
if (is_string($timeSpan)) {
$timeSpan = self::parseTime($timeSpan);
}
if (!is_numeric($timeSpan)) {
throw new InvalidArgumentException('timespan is not numeric');
}
$timeSpan = floatval($timeSpan);
if ($... | php | public function setTimeSpan($timeSpan)
{
if (is_string($timeSpan)) {
$timeSpan = self::parseTime($timeSpan);
}
if (!is_numeric($timeSpan)) {
throw new InvalidArgumentException('timespan is not numeric');
}
$timeSpan = floatval($timeSpan);
if ($... | [
"public",
"function",
"setTimeSpan",
"(",
"$",
"timeSpan",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"timeSpan",
")",
")",
"{",
"$",
"timeSpan",
"=",
"self",
"::",
"parseTime",
"(",
"$",
"timeSpan",
")",
";",
"}",
"if",
"(",
"!",
"is_numeric",
"(",... | Sets the timespan in which the defined number of requests is allowed per single entity.
@param float|string $timeSpan
@throws InvalidArgumentException | [
"Sets",
"the",
"timespan",
"in",
"which",
"the",
"defined",
"number",
"of",
"requests",
"is",
"allowed",
"per",
"single",
"entity",
"."
] | 327110f6c97a3a3e90bd39c47ebb9e2f02db9d61 | https://github.com/beheh/flaps/blob/327110f6c97a3a3e90bd39c47ebb9e2f02db9d61/src/Flaps/Throttling/LeakyBucketStrategy.php#L61-L74 |
226,792 | beheh/flaps | src/Flaps/Throttling/LeakyBucketStrategy.php | LeakyBucketStrategy.parseTime | public static function parseTime($timeSpan)
{
$times = array('s' => 1, 'm' => 60, 'h' => 3600, 'd' => 86400, 'w' => 604800);
$matches = array();
if (is_numeric($timeSpan)) {
return $timeSpan;
}
if (preg_match('/^((\d+)?(\.\d+)?)('.implode('|', array_keys($times)).... | php | public static function parseTime($timeSpan)
{
$times = array('s' => 1, 'm' => 60, 'h' => 3600, 'd' => 86400, 'w' => 604800);
$matches = array();
if (is_numeric($timeSpan)) {
return $timeSpan;
}
if (preg_match('/^((\d+)?(\.\d+)?)('.implode('|', array_keys($times)).... | [
"public",
"static",
"function",
"parseTime",
"(",
"$",
"timeSpan",
")",
"{",
"$",
"times",
"=",
"array",
"(",
"'s'",
"=>",
"1",
",",
"'m'",
"=>",
"60",
",",
"'h'",
"=>",
"3600",
",",
"'d'",
"=>",
"86400",
",",
"'w'",
"=>",
"604800",
")",
";",
"$"... | Parses a timespan string such as "10s", "5m" or "1h" and returns the amount of seconds.
@param string $timeSpan the time span to parse to seconds
@return float|null the number of seconds or null, if $timeSpan couldn't be parsed | [
"Parses",
"a",
"timespan",
"string",
"such",
"as",
"10s",
"5m",
"or",
"1h",
"and",
"returns",
"the",
"amount",
"of",
"seconds",
"."
] | 327110f6c97a3a3e90bd39c47ebb9e2f02db9d61 | https://github.com/beheh/flaps/blob/327110f6c97a3a3e90bd39c47ebb9e2f02db9d61/src/Flaps/Throttling/LeakyBucketStrategy.php#L114-L126 |
226,793 | beheh/flaps | src/Flaps/Throttling/LeakyBucketStrategy.php | LeakyBucketStrategy.isViolator | public function isViolator($identifier)
{
if ($this->storage === null) {
throw new LogicException('no storage set');
}
$time = microtime(true);
$timestamp = $time;
$rate = (float) $this->requestsPerTimeSpan / $this->timeSpan;
$identifier = 'leaky:'.sha1(... | php | public function isViolator($identifier)
{
if ($this->storage === null) {
throw new LogicException('no storage set');
}
$time = microtime(true);
$timestamp = $time;
$rate = (float) $this->requestsPerTimeSpan / $this->timeSpan;
$identifier = 'leaky:'.sha1(... | [
"public",
"function",
"isViolator",
"(",
"$",
"identifier",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"storage",
"===",
"null",
")",
"{",
"throw",
"new",
"LogicException",
"(",
"'no storage set'",
")",
";",
"}",
"$",
"time",
"=",
"microtime",
"(",
"true",
... | Returns whether entity exceeds it's allowed request capacity with this request.
@param string $identifier the identifer of the entity to check
@return bool true if this requests exceeds the number of requests allowed
@throws LogicException if no storage has been set | [
"Returns",
"whether",
"entity",
"exceeds",
"it",
"s",
"allowed",
"request",
"capacity",
"with",
"this",
"request",
"."
] | 327110f6c97a3a3e90bd39c47ebb9e2f02db9d61 | https://github.com/beheh/flaps/blob/327110f6c97a3a3e90bd39c47ebb9e2f02db9d61/src/Flaps/Throttling/LeakyBucketStrategy.php#L134-L169 |
226,794 | platforg/adobe-connect | src/AdobeConnect/ApiClient.php | ApiClient.principalInfo | public function principalInfo($principal_id)
{
$response = $this->call('principal-info', array(
'principal-id' => $principal_id,
));
return array(
'contact' => current($response->xpath('/results/contact')),
'manager' => current($response->xpath('/results/... | php | public function principalInfo($principal_id)
{
$response = $this->call('principal-info', array(
'principal-id' => $principal_id,
));
return array(
'contact' => current($response->xpath('/results/contact')),
'manager' => current($response->xpath('/results/... | [
"public",
"function",
"principalInfo",
"(",
"$",
"principal_id",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"call",
"(",
"'principal-info'",
",",
"array",
"(",
"'principal-id'",
"=>",
"$",
"principal_id",
",",
")",
")",
";",
"return",
"array",
"(",... | Provides information about one principal, either a user or a group.
@param int $principal_id The ID of a user or group you want information about.
You can get the ID by calling principal-list.
@return array An array with the principal information. Each element is a \SimpleXMLElement
- contact: Information about th... | [
"Provides",
"information",
"about",
"one",
"principal",
"either",
"a",
"user",
"or",
"a",
"group",
"."
] | 70f47a00e282ebc3b6491a2ec0e68a770dbfa549 | https://github.com/platforg/adobe-connect/blob/70f47a00e282ebc3b6491a2ec0e68a770dbfa549/src/AdobeConnect/ApiClient.php#L164-L176 |
226,795 | platforg/adobe-connect | src/AdobeConnect/ApiClient.php | ApiClient.permissionsUpdate | public function permissionsUpdate($acl_id, $principal_id, $permission_id)
{
$this->call('permissions-update', array(
'acl-id' => $acl_id,
'principal-id' => $principal_id,
'permission-id' => $permission_id,
));
return true;
} | php | public function permissionsUpdate($acl_id, $principal_id, $permission_id)
{
$this->call('permissions-update', array(
'acl-id' => $acl_id,
'principal-id' => $principal_id,
'permission-id' => $permission_id,
));
return true;
} | [
"public",
"function",
"permissionsUpdate",
"(",
"$",
"acl_id",
",",
"$",
"principal_id",
",",
"$",
"permission_id",
")",
"{",
"$",
"this",
"->",
"call",
"(",
"'permissions-update'",
",",
"array",
"(",
"'acl-id'",
"=>",
"$",
"acl_id",
",",
"'principal-id'",
"... | Updates the permissions a principal has to access a SCO, using a trio of principal-id, acl-id, and permission-id.
@TODO: To update permissions for multiple principals or objects, specify multiple trios. You can update more than
200 permissions in a single call to permissions-update.
Call permissions-update to give a ... | [
"Updates",
"the",
"permissions",
"a",
"principal",
"has",
"to",
"access",
"a",
"SCO",
"using",
"a",
"trio",
"of",
"principal",
"-",
"id",
"acl",
"-",
"id",
"and",
"permission",
"-",
"id",
"."
] | 70f47a00e282ebc3b6491a2ec0e68a770dbfa549 | https://github.com/platforg/adobe-connect/blob/70f47a00e282ebc3b6491a2ec0e68a770dbfa549/src/AdobeConnect/ApiClient.php#L264-L273 |
226,796 | platforg/adobe-connect | src/AdobeConnect/ApiClient.php | ApiClient.meetingFeatureUpdate | public function meetingFeatureUpdate($account_id, $feature_id, $enable)
{
$response = $this->call('meeting-feature-update', array(
'account-id' => $account_id,
'feature-id' => $feature_id,
'enable' => $enable
));
return true;
} | php | public function meetingFeatureUpdate($account_id, $feature_id, $enable)
{
$response = $this->call('meeting-feature-update', array(
'account-id' => $account_id,
'feature-id' => $feature_id,
'enable' => $enable
));
return true;
} | [
"public",
"function",
"meetingFeatureUpdate",
"(",
"$",
"account_id",
",",
"$",
"feature_id",
",",
"$",
"enable",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"call",
"(",
"'meeting-feature-update'",
",",
"array",
"(",
"'account-id'",
"=>",
"$",
"accou... | Enables or disables features in a meeting.
This action is used to manage features such as recording of meetings and control of pods.
For more information on usage, see Configure compliance settings.
@param string $account_id The ID of your Adobe Connect hosted account.
For enterprise installations, the ID is 7.... | [
"Enables",
"or",
"disables",
"features",
"in",
"a",
"meeting",
".",
"This",
"action",
"is",
"used",
"to",
"manage",
"features",
"such",
"as",
"recording",
"of",
"meetings",
"and",
"control",
"of",
"pods",
".",
"For",
"more",
"information",
"on",
"usage",
"... | 70f47a00e282ebc3b6491a2ec0e68a770dbfa549 | https://github.com/platforg/adobe-connect/blob/70f47a00e282ebc3b6491a2ec0e68a770dbfa549/src/AdobeConnect/ApiClient.php#L290-L299 |
226,797 | platforg/adobe-connect | src/AdobeConnect/ApiClient.php | ApiClient.reportMeetingAttendance | public function reportMeetingAttendance($sco_id, $filters = array())
{
$response = $this->call('report-meeting-attendance', array_merge(
array('sco-id' => $sco_id,),
$filters
));
return $response->xpath('/results/report-meeting-attendance/row');
} | php | public function reportMeetingAttendance($sco_id, $filters = array())
{
$response = $this->call('report-meeting-attendance', array_merge(
array('sco-id' => $sco_id,),
$filters
));
return $response->xpath('/results/report-meeting-attendance/row');
} | [
"public",
"function",
"reportMeetingAttendance",
"(",
"$",
"sco_id",
",",
"$",
"filters",
"=",
"array",
"(",
")",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"call",
"(",
"'report-meeting-attendance'",
",",
"array_merge",
"(",
"array",
"(",
"'sco-id'"... | Returns a list of users who attended a Adobe Connect meeting. The data is returned in row elements, one for each
person who attended. If the meeting hasn't started or had no attendees, the response contains no rows.
The response does not include meeting hosts or users who were invited but did not attend.
@param int ... | [
"Returns",
"a",
"list",
"of",
"users",
"who",
"attended",
"a",
"Adobe",
"Connect",
"meeting",
".",
"The",
"data",
"is",
"returned",
"in",
"row",
"elements",
"one",
"for",
"each",
"person",
"who",
"attended",
".",
"If",
"the",
"meeting",
"hasn",
"t",
"sta... | 70f47a00e282ebc3b6491a2ec0e68a770dbfa549 | https://github.com/platforg/adobe-connect/blob/70f47a00e282ebc3b6491a2ec0e68a770dbfa549/src/AdobeConnect/ApiClient.php#L326-L334 |
226,798 | platforg/adobe-connect | src/AdobeConnect/ApiClient.php | ApiClient.reportMeetingSessions | public function reportMeetingSessions($sco_id, array $filters = array())
{
$response = $this->call('report-meeting-sessions', array_merge(
array('sco-id' => $sco_id,),
$filters
));
return $response->xpath('/results/report-meeting-sessions/row');
} | php | public function reportMeetingSessions($sco_id, array $filters = array())
{
$response = $this->call('report-meeting-sessions', array_merge(
array('sco-id' => $sco_id,),
$filters
));
return $response->xpath('/results/report-meeting-sessions/row');
} | [
"public",
"function",
"reportMeetingSessions",
"(",
"$",
"sco_id",
",",
"array",
"$",
"filters",
"=",
"array",
"(",
")",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"call",
"(",
"'report-meeting-sessions'",
",",
"array_merge",
"(",
"array",
"(",
"'s... | Provides information about all the sessions of a Adobe Connect meeting. A session is created when a participant
enters an empty meeting. As more participants join the meeting, they join the session. The session ends when all
attendees leave the meeting. When a new participant enters the now-empty meeting, a new session... | [
"Provides",
"information",
"about",
"all",
"the",
"sessions",
"of",
"a",
"Adobe",
"Connect",
"meeting",
".",
"A",
"session",
"is",
"created",
"when",
"a",
"participant",
"enters",
"an",
"empty",
"meeting",
".",
"As",
"more",
"participants",
"join",
"the",
"m... | 70f47a00e282ebc3b6491a2ec0e68a770dbfa549 | https://github.com/platforg/adobe-connect/blob/70f47a00e282ebc3b6491a2ec0e68a770dbfa549/src/AdobeConnect/ApiClient.php#L370-L378 |
226,799 | platforg/adobe-connect | src/AdobeConnect/ApiClient.php | ApiClient.scoContents | public function scoContents($sco_id, array $filters = array())
{
$response = $this->call('sco-contents', array_merge(array(
'sco-id' => $sco_id,
), $filters));
return $response->xpath('/results/scos/sco');
} | php | public function scoContents($sco_id, array $filters = array())
{
$response = $this->call('sco-contents', array_merge(array(
'sco-id' => $sco_id,
), $filters));
return $response->xpath('/results/scos/sco');
} | [
"public",
"function",
"scoContents",
"(",
"$",
"sco_id",
",",
"array",
"$",
"filters",
"=",
"array",
"(",
")",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"call",
"(",
"'sco-contents'",
",",
"array_merge",
"(",
"array",
"(",
"'sco-id'",
"=>",
"$... | Returns a list of SCOs within another SCO. The enclosing SCO can be a folder, meeting, or curriculum.
@param int $sco_id The unique ID of a folder for which you want to list contents.
You can get the sco-id by calling sco-shortcuts.
@param array $filters A filter to reduce the volume of the response.
@return array... | [
"Returns",
"a",
"list",
"of",
"SCOs",
"within",
"another",
"SCO",
".",
"The",
"enclosing",
"SCO",
"can",
"be",
"a",
"folder",
"meeting",
"or",
"curriculum",
"."
] | 70f47a00e282ebc3b6491a2ec0e68a770dbfa549 | https://github.com/platforg/adobe-connect/blob/70f47a00e282ebc3b6491a2ec0e68a770dbfa549/src/AdobeConnect/ApiClient.php#L479-L486 |
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.