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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
21,300 | eghojansu/moe | src/tools/Markdown.php | Markdown._code | protected function _code($str) {
$self=$this;
return preg_replace_callback(
'/`` (.+?) ``|(?<!\\\\)`(.+?)(?!\\\\)`/',
function($expr) use($self) {
return '<code>'.
$self->esc(empty($expr[1])?$expr[2]:$expr[1]).'</code>';
},
$str
);
} | php | protected function _code($str) {
$self=$this;
return preg_replace_callback(
'/`` (.+?) ``|(?<!\\\\)`(.+?)(?!\\\\)`/',
function($expr) use($self) {
return '<code>'.
$self->esc(empty($expr[1])?$expr[2]:$expr[1]).'</code>';
},
$str
);
} | [
"protected",
"function",
"_code",
"(",
"$",
"str",
")",
"{",
"$",
"self",
"=",
"$",
"this",
";",
"return",
"preg_replace_callback",
"(",
"'/`` (.+?) ``|(?<!\\\\\\\\)`(.+?)(?!\\\\\\\\)`/'",
",",
"function",
"(",
"$",
"expr",
")",
"use",
"(",
"$",
"self",
")",
... | Process code span
@return string
@param $str string | [
"Process",
"code",
"span"
] | f58ec75a3116d1a572782256e2b38bb9aab95e3c | https://github.com/eghojansu/moe/blob/f58ec75a3116d1a572782256e2b38bb9aab95e3c/src/tools/Markdown.php#L396-L406 |
21,301 | eghojansu/moe | src/tools/Markdown.php | Markdown.esc | function esc($str) {
if (!$this->special)
$this->special=array(
'...'=>'…',
'(tm)'=>'™',
'(r)'=>'®',
'(c)'=>'©'
);
foreach ($this->special as $key=>$val)
$str=preg_replace('/'.preg_quote($key,'/').'/i',$val,$str);
return htmlspecialchars($str,ENT_COMPAT,
Base::ins... | php | function esc($str) {
if (!$this->special)
$this->special=array(
'...'=>'…',
'(tm)'=>'™',
'(r)'=>'®',
'(c)'=>'©'
);
foreach ($this->special as $key=>$val)
$str=preg_replace('/'.preg_quote($key,'/').'/i',$val,$str);
return htmlspecialchars($str,ENT_COMPAT,
Base::ins... | [
"function",
"esc",
"(",
"$",
"str",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"special",
")",
"$",
"this",
"->",
"special",
"=",
"array",
"(",
"'...'",
"=>",
"'…'",
",",
"'(tm)'",
"=>",
"'™'",
",",
"'(r)'",
"=>",
"'®'",
",",
"'(... | Convert characters to HTML entities
@return string
@param $str string | [
"Convert",
"characters",
"to",
"HTML",
"entities"
] | f58ec75a3116d1a572782256e2b38bb9aab95e3c | https://github.com/eghojansu/moe/blob/f58ec75a3116d1a572782256e2b38bb9aab95e3c/src/tools/Markdown.php#L413-L425 |
21,302 | old-town/workflow-designer-server | src/View/ApiProblemInjectResponse.php | ApiProblemInjectResponse.getStatusCodeFromApiProblem | protected function getStatusCodeFromApiProblem(ApiProblem $problem)
{
$problemData = $problem->toArray();
$status = array_key_exists('status', $problemData) ? $problemData['status'] : 0;
if ($status < 100 || $status >= 600) {
return 500;
}
return $status;
} | php | protected function getStatusCodeFromApiProblem(ApiProblem $problem)
{
$problemData = $problem->toArray();
$status = array_key_exists('status', $problemData) ? $problemData['status'] : 0;
if ($status < 100 || $status >= 600) {
return 500;
}
return $status;
} | [
"protected",
"function",
"getStatusCodeFromApiProblem",
"(",
"ApiProblem",
"$",
"problem",
")",
"{",
"$",
"problemData",
"=",
"$",
"problem",
"->",
"toArray",
"(",
")",
";",
"$",
"status",
"=",
"array_key_exists",
"(",
"'status'",
",",
"$",
"problemData",
")",... | Retrieve the HTTP status from an ApiProblem object
Ensures that the status falls within the acceptable range (100 - 599).
@param ApiProblem $problem
@return int | [
"Retrieve",
"the",
"HTTP",
"status",
"from",
"an",
"ApiProblem",
"object"
] | 6389c5a515861cc8e0b769f1ca7be12c6b78c611 | https://github.com/old-town/workflow-designer-server/blob/6389c5a515861cc8e0b769f1ca7be12c6b78c611/src/View/ApiProblemInjectResponse.php#L87-L97 |
21,303 | arndtteunissen/column-layout | Classes/Utility/ColumnLayoutUtility.php | ColumnLayoutUtility.getSizesFor | public static function getSizesFor(string $size, string $type, int $pageUid): array
{
$settings = ColumnLayoutUtility::getColumnLayoutSettings($pageUid);
if (!array_key_exists($size . '.', $settings['sizes.'])) {
throw new Exception(sprintf('The given size "%s" is not defined in the gri... | php | public static function getSizesFor(string $size, string $type, int $pageUid): array
{
$settings = ColumnLayoutUtility::getColumnLayoutSettings($pageUid);
if (!array_key_exists($size . '.', $settings['sizes.'])) {
throw new Exception(sprintf('The given size "%s" is not defined in the gri... | [
"public",
"static",
"function",
"getSizesFor",
"(",
"string",
"$",
"size",
",",
"string",
"$",
"type",
",",
"int",
"$",
"pageUid",
")",
":",
"array",
"{",
"$",
"settings",
"=",
"ColumnLayoutUtility",
"::",
"getColumnLayoutSettings",
"(",
"$",
"pageUid",
")",... | Calculates the column sizes for the given size and the given size type
@param string $size name of the sizes identifier (e.g. large, medium)
@param string $type size type (e.g. columns, offset, order)
@param int $pageUid the page which's TSConfig should be used
@return array of column sizes
@throws Exception when the ... | [
"Calculates",
"the",
"column",
"sizes",
"for",
"the",
"given",
"size",
"and",
"the",
"given",
"size",
"type"
] | ad737068eef3b084d4d0e3a48e6a3d8277af9560 | https://github.com/arndtteunissen/column-layout/blob/ad737068eef3b084d4d0e3a48e6a3d8277af9560/Classes/Utility/ColumnLayoutUtility.php#L31-L44 |
21,304 | arndtteunissen/column-layout | Classes/Utility/ColumnLayoutUtility.php | ColumnLayoutUtility.getColumnLayoutSettings | public static function getColumnLayoutSettings(int $page): array
{
$pageTSConfig = BackendUtility::getPagesTSconfig($page);
if (!array_key_exists('column_layout.', $pageTSConfig['mod.'])) {
throw new Exception(sprintf('No column layout found for page "%d". Please define the column_layou... | php | public static function getColumnLayoutSettings(int $page): array
{
$pageTSConfig = BackendUtility::getPagesTSconfig($page);
if (!array_key_exists('column_layout.', $pageTSConfig['mod.'])) {
throw new Exception(sprintf('No column layout found for page "%d". Please define the column_layou... | [
"public",
"static",
"function",
"getColumnLayoutSettings",
"(",
"int",
"$",
"page",
")",
":",
"array",
"{",
"$",
"pageTSConfig",
"=",
"BackendUtility",
"::",
"getPagesTSconfig",
"(",
"$",
"page",
")",
";",
"if",
"(",
"!",
"array_key_exists",
"(",
"'column_layo... | Returns the column layout configuration from page TSConfig.
@param int $page uid of the page
@return array column layout settings
@throws Exception when the column_layout setting hasn't been defined | [
"Returns",
"the",
"column",
"layout",
"configuration",
"from",
"page",
"TSConfig",
"."
] | ad737068eef3b084d4d0e3a48e6a3d8277af9560 | https://github.com/arndtteunissen/column-layout/blob/ad737068eef3b084d4d0e3a48e6a3d8277af9560/Classes/Utility/ColumnLayoutUtility.php#L81-L90 |
21,305 | arndtteunissen/column-layout | Classes/Utility/ColumnLayoutUtility.php | ColumnLayoutUtility.hydrateLayoutConfigFlexFormData | public static function hydrateLayoutConfigFlexFormData($flexFormData): array
{
$dataStructure = $flexFormData;
if (is_string($flexFormData)) {
$dataStructure = GeneralUtility::xml2array($flexFormData);
}
// Level: FlexForm Sheets
return array_map(function ($sheet... | php | public static function hydrateLayoutConfigFlexFormData($flexFormData): array
{
$dataStructure = $flexFormData;
if (is_string($flexFormData)) {
$dataStructure = GeneralUtility::xml2array($flexFormData);
}
// Level: FlexForm Sheets
return array_map(function ($sheet... | [
"public",
"static",
"function",
"hydrateLayoutConfigFlexFormData",
"(",
"$",
"flexFormData",
")",
":",
"array",
"{",
"$",
"dataStructure",
"=",
"$",
"flexFormData",
";",
"if",
"(",
"is_string",
"(",
"$",
"flexFormData",
")",
")",
"{",
"$",
"dataStructure",
"="... | Simplify a FlexForm DataStructure array.
Removes all unnecessary sheet, field or value identifiers.
@param string|array $flexFormData either a converted FlexForm array or the raw FlexForm string
@return array simplified FlexForm data structure | [
"Simplify",
"a",
"FlexForm",
"DataStructure",
"array",
".",
"Removes",
"all",
"unnecessary",
"sheet",
"field",
"or",
"value",
"identifiers",
"."
] | ad737068eef3b084d4d0e3a48e6a3d8277af9560 | https://github.com/arndtteunissen/column-layout/blob/ad737068eef3b084d4d0e3a48e6a3d8277af9560/Classes/Utility/ColumnLayoutUtility.php#L99-L114 |
21,306 | thelia-modules/CustomerGroup | Model/Base/CustomerGroupI18n.php | CustomerGroupI18n.getCustomerGroup | public function getCustomerGroup(ConnectionInterface $con = null)
{
if ($this->aCustomerGroup === null && ($this->id !== null)) {
$this->aCustomerGroup = ChildCustomerGroupQuery::create()->findPk($this->id, $con);
/* The following can be used additionally to
guarantee... | php | public function getCustomerGroup(ConnectionInterface $con = null)
{
if ($this->aCustomerGroup === null && ($this->id !== null)) {
$this->aCustomerGroup = ChildCustomerGroupQuery::create()->findPk($this->id, $con);
/* The following can be used additionally to
guarantee... | [
"public",
"function",
"getCustomerGroup",
"(",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"aCustomerGroup",
"===",
"null",
"&&",
"(",
"$",
"this",
"->",
"id",
"!==",
"null",
")",
")",
"{",
"$",
"this",
"->",... | Get the associated ChildCustomerGroup object
@param ConnectionInterface $con Optional Connection object.
@return ChildCustomerGroup The associated ChildCustomerGroup object.
@throws PropelException | [
"Get",
"the",
"associated",
"ChildCustomerGroup",
"object"
] | 672cc64c686812f6a95cf0d702111f93d8c0e850 | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroupI18n.php#L1148-L1162 |
21,307 | 99designs/ergo-http | src/Url.php | Url.getHostWithPort | public function getHostWithPort()
{
if ($this->hasPort() && (!$this->hasDefaultPort() || !$this->isPortDefault())) {
return $this->getHost() . ':' . $this->getPort();
} else {
return $this->getHost();
}
} | php | public function getHostWithPort()
{
if ($this->hasPort() && (!$this->hasDefaultPort() || !$this->isPortDefault())) {
return $this->getHost() . ':' . $this->getPort();
} else {
return $this->getHost();
}
} | [
"public",
"function",
"getHostWithPort",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasPort",
"(",
")",
"&&",
"(",
"!",
"$",
"this",
"->",
"hasDefaultPort",
"(",
")",
"||",
"!",
"$",
"this",
"->",
"isPortDefault",
"(",
")",
")",
")",
"{",
"retur... | Host, including port unless it is the default port for the scheme.
@return string | [
"Host",
"including",
"port",
"unless",
"it",
"is",
"the",
"default",
"port",
"for",
"the",
"scheme",
"."
] | 979b789f2e011a1cb70a00161e6b7bcd0d2e9c71 | https://github.com/99designs/ergo-http/blob/979b789f2e011a1cb70a00161e6b7bcd0d2e9c71/src/Url.php#L89-L96 |
21,308 | 99designs/ergo-http | src/Url.php | Url.getDefaultPort | public function getDefaultPort()
{
if (!$this->hasDefaultPort()) throw new UrlException(sprintf(
"No default port for URL '%s'",
$this->_inputString
));
$scheme = $this->getScheme();
if ($scheme == 'http') return 80;
elseif ($scheme == 'https') return... | php | public function getDefaultPort()
{
if (!$this->hasDefaultPort()) throw new UrlException(sprintf(
"No default port for URL '%s'",
$this->_inputString
));
$scheme = $this->getScheme();
if ($scheme == 'http') return 80;
elseif ($scheme == 'https') return... | [
"public",
"function",
"getDefaultPort",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasDefaultPort",
"(",
")",
")",
"throw",
"new",
"UrlException",
"(",
"sprintf",
"(",
"\"No default port for URL '%s'\"",
",",
"$",
"this",
"->",
"_inputString",
")",
"... | The default TCP port for the scheme of the URL
@return int or null | [
"The",
"default",
"TCP",
"port",
"for",
"the",
"scheme",
"of",
"the",
"URL"
] | 979b789f2e011a1cb70a00161e6b7bcd0d2e9c71 | https://github.com/99designs/ergo-http/blob/979b789f2e011a1cb70a00161e6b7bcd0d2e9c71/src/Url.php#L176-L187 |
21,309 | 99designs/ergo-http | src/Url.php | Url.getHostRelativeUrl | public function getHostRelativeUrl()
{
$url = $this->getPath();
if ($this->hasQueryString()) $url .= '?' . $this->getQueryString();
if ($this->hasFragmentString()) $url .= '#' . $this->getFragmentString();
return $url;
} | php | public function getHostRelativeUrl()
{
$url = $this->getPath();
if ($this->hasQueryString()) $url .= '?' . $this->getQueryString();
if ($this->hasFragmentString()) $url .= '#' . $this->getFragmentString();
return $url;
} | [
"public",
"function",
"getHostRelativeUrl",
"(",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"getPath",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"hasQueryString",
"(",
")",
")",
"$",
"url",
".=",
"'?'",
".",
"$",
"this",
"->",
"getQueryString",... | The URL components after the host.
@return string | [
"The",
"URL",
"components",
"after",
"the",
"host",
"."
] | 979b789f2e011a1cb70a00161e6b7bcd0d2e9c71 | https://github.com/99designs/ergo-http/blob/979b789f2e011a1cb70a00161e6b7bcd0d2e9c71/src/Url.php#L210-L216 |
21,310 | 99designs/ergo-http | src/Url.php | Url.getUrlForPath | public function getUrlForPath($path)
{
$fragments = parse_url($path);
if (!isset($fragments['path']))
throw new UrlException("URL is not a valid path: '$path'");
$newUrl = clone $this;
$newUrl->_fragments['path'] = $fragments['path'];
// overwrite RHS component... | php | public function getUrlForPath($path)
{
$fragments = parse_url($path);
if (!isset($fragments['path']))
throw new UrlException("URL is not a valid path: '$path'");
$newUrl = clone $this;
$newUrl->_fragments['path'] = $fragments['path'];
// overwrite RHS component... | [
"public",
"function",
"getUrlForPath",
"(",
"$",
"path",
")",
"{",
"$",
"fragments",
"=",
"parse_url",
"(",
"$",
"path",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"fragments",
"[",
"'path'",
"]",
")",
")",
"throw",
"new",
"UrlException",
"(",
"\"U... | Builds a URL with a different path component
@return Url | [
"Builds",
"a",
"URL",
"with",
"a",
"different",
"path",
"component"
] | 979b789f2e011a1cb70a00161e6b7bcd0d2e9c71 | https://github.com/99designs/ergo-http/blob/979b789f2e011a1cb70a00161e6b7bcd0d2e9c71/src/Url.php#L235-L257 |
21,311 | 99designs/ergo-http | src/Url.php | Url.getUrlForHost | public function getUrlForHost($host)
{
$newUrl = clone $this;
$newUrl->_fragments['host'] = $host;
$newUrl->_inputString = $newUrl->__toString();
return $newUrl;
} | php | public function getUrlForHost($host)
{
$newUrl = clone $this;
$newUrl->_fragments['host'] = $host;
$newUrl->_inputString = $newUrl->__toString();
return $newUrl;
} | [
"public",
"function",
"getUrlForHost",
"(",
"$",
"host",
")",
"{",
"$",
"newUrl",
"=",
"clone",
"$",
"this",
";",
"$",
"newUrl",
"->",
"_fragments",
"[",
"'host'",
"]",
"=",
"$",
"host",
";",
"$",
"newUrl",
"->",
"_inputString",
"=",
"$",
"newUrl",
"... | Builds a URL with a different host
@return Url | [
"Builds",
"a",
"URL",
"with",
"a",
"different",
"host"
] | 979b789f2e011a1cb70a00161e6b7bcd0d2e9c71 | https://github.com/99designs/ergo-http/blob/979b789f2e011a1cb70a00161e6b7bcd0d2e9c71/src/Url.php#L263-L270 |
21,312 | 99designs/ergo-http | src/Url.php | Url.getUrlForScheme | public function getUrlForScheme($scheme)
{
$newUrl = clone $this;
$wasDefaultPort = ($newUrl->hasScheme() && $newUrl->isPortDefault());
$newUrl->_fragments['scheme'] = $scheme;
if ($wasDefaultPort) {
$newUrl->_fragments['port'] = $newUrl->getDefaultPort();
}
... | php | public function getUrlForScheme($scheme)
{
$newUrl = clone $this;
$wasDefaultPort = ($newUrl->hasScheme() && $newUrl->isPortDefault());
$newUrl->_fragments['scheme'] = $scheme;
if ($wasDefaultPort) {
$newUrl->_fragments['port'] = $newUrl->getDefaultPort();
}
... | [
"public",
"function",
"getUrlForScheme",
"(",
"$",
"scheme",
")",
"{",
"$",
"newUrl",
"=",
"clone",
"$",
"this",
";",
"$",
"wasDefaultPort",
"=",
"(",
"$",
"newUrl",
"->",
"hasScheme",
"(",
")",
"&&",
"$",
"newUrl",
"->",
"isPortDefault",
"(",
")",
")"... | Builds a URL with a different scheme
@return Url | [
"Builds",
"a",
"URL",
"with",
"a",
"different",
"scheme"
] | 979b789f2e011a1cb70a00161e6b7bcd0d2e9c71 | https://github.com/99designs/ergo-http/blob/979b789f2e011a1cb70a00161e6b7bcd0d2e9c71/src/Url.php#L276-L290 |
21,313 | 99designs/ergo-http | src/Url.php | Url.getUrlForRelativePath | public function getUrlForRelativePath($path)
{
return $this->getUrlForPath(
$this->_joinPathComponents($this->getPath(), ltrim($path, '/')));
} | php | public function getUrlForRelativePath($path)
{
return $this->getUrlForPath(
$this->_joinPathComponents($this->getPath(), ltrim($path, '/')));
} | [
"public",
"function",
"getUrlForRelativePath",
"(",
"$",
"path",
")",
"{",
"return",
"$",
"this",
"->",
"getUrlForPath",
"(",
"$",
"this",
"->",
"_joinPathComponents",
"(",
"$",
"this",
"->",
"getPath",
"(",
")",
",",
"ltrim",
"(",
"$",
"path",
",",
"'/'... | Builds a URL with a path component that is relative to the current one
@return Url | [
"Builds",
"a",
"URL",
"with",
"a",
"path",
"component",
"that",
"is",
"relative",
"to",
"the",
"current",
"one"
] | 979b789f2e011a1cb70a00161e6b7bcd0d2e9c71 | https://github.com/99designs/ergo-http/blob/979b789f2e011a1cb70a00161e6b7bcd0d2e9c71/src/Url.php#L327-L331 |
21,314 | DotZecker/Larafeed | src/Larafeed.php | Larafeed.addAuthor | public function addAuthor($author)
{
if (!is_array($author)) {
$author = ['name' => $author];
}
$this->authors->add((object) $author);
} | php | public function addAuthor($author)
{
if (!is_array($author)) {
$author = ['name' => $author];
}
$this->authors->add((object) $author);
} | [
"public",
"function",
"addAuthor",
"(",
"$",
"author",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"author",
")",
")",
"{",
"$",
"author",
"=",
"[",
"'name'",
"=>",
"$",
"author",
"]",
";",
"}",
"$",
"this",
"->",
"authors",
"->",
"add",
"(",... | Add an Author to the feed
@param mixed $author It can be an array with name, email and uri,
or just and string with the name. | [
"Add",
"an",
"Author",
"to",
"the",
"feed"
] | d696e2f97b584ed690fe7ba4ac5d739e266c75dd | https://github.com/DotZecker/Larafeed/blob/d696e2f97b584ed690fe7ba4ac5d739e266c75dd/src/Larafeed.php#L108-L115 |
21,315 | DotZecker/Larafeed | src/Larafeed.php | Larafeed.render | public function render()
{
$this->prepare();
$view = $this->twig->render(sprintf('%s.twig.html', $this->format), ['feed' => $this]);
return Response::create(
$view,
200,
[
'Content-Type' => "{$this->getContentType()}; charset={$this->char... | php | public function render()
{
$this->prepare();
$view = $this->twig->render(sprintf('%s.twig.html', $this->format), ['feed' => $this]);
return Response::create(
$view,
200,
[
'Content-Type' => "{$this->getContentType()}; charset={$this->char... | [
"public",
"function",
"render",
"(",
")",
"{",
"$",
"this",
"->",
"prepare",
"(",
")",
";",
"$",
"view",
"=",
"$",
"this",
"->",
"twig",
"->",
"render",
"(",
"sprintf",
"(",
"'%s.twig.html'",
",",
"$",
"this",
"->",
"format",
")",
",",
"[",
"'feed'... | Prepare the feed and if it's valid, renders it
@return Response | [
"Prepare",
"the",
"feed",
"and",
"if",
"it",
"s",
"valid",
"renders",
"it"
] | d696e2f97b584ed690fe7ba4ac5d739e266c75dd | https://github.com/DotZecker/Larafeed/blob/d696e2f97b584ed690fe7ba4ac5d739e266c75dd/src/Larafeed.php#L122-L135 |
21,316 | surebert/surebert-framework | src/sb/Excel/Writer.php | Writer.setCell | public function setCell($cell, $value, $type = "auto")
{
if ($type == "auto") {
$type = \gettype($value);
}
if (\is_array($cell)) {
$parts["row"] = $cell[0];
$parts["col"] = $cell[1];
} else {
$parts = $this->refToArray($cell);
... | php | public function setCell($cell, $value, $type = "auto")
{
if ($type == "auto") {
$type = \gettype($value);
}
if (\is_array($cell)) {
$parts["row"] = $cell[0];
$parts["col"] = $cell[1];
} else {
$parts = $this->refToArray($cell);
... | [
"public",
"function",
"setCell",
"(",
"$",
"cell",
",",
"$",
"value",
",",
"$",
"type",
"=",
"\"auto\"",
")",
"{",
"if",
"(",
"$",
"type",
"==",
"\"auto\"",
")",
"{",
"$",
"type",
"=",
"\\",
"gettype",
"(",
"$",
"value",
")",
";",
"}",
"if",
"(... | Set the value of an individual cell
@param mixed An excel cell reference such as A1, or an array in the
format of ($row, $col) usign zero-based integers
@param mixed the value to put in this cell
@param the type of value (string|integer). Autodetects by default
@return boolean Success | [
"Set",
"the",
"value",
"of",
"an",
"individual",
"cell"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Excel/Writer.php#L60-L111 |
21,317 | surebert/surebert-framework | src/sb/Excel/Writer.php | Writer.setRow | public function setRow($row, $values)
{
if (!\is_array($values)) {
\trigger_error("Values must be an array.", E_USER_ERROR);
return false;
}
if (intval($row) < 1) {
\trigger_error("Row number must be an integer greater than 1.", E_USER_ERROR);
... | php | public function setRow($row, $values)
{
if (!\is_array($values)) {
\trigger_error("Values must be an array.", E_USER_ERROR);
return false;
}
if (intval($row) < 1) {
\trigger_error("Row number must be an integer greater than 1.", E_USER_ERROR);
... | [
"public",
"function",
"setRow",
"(",
"$",
"row",
",",
"$",
"values",
")",
"{",
"if",
"(",
"!",
"\\",
"is_array",
"(",
"$",
"values",
")",
")",
"{",
"\\",
"trigger_error",
"(",
"\"Values must be an array.\"",
",",
"E_USER_ERROR",
")",
";",
"return",
"fals... | Set the values for a row
@param integer The Excel row number to place these values
@param array An array of values
@return boolean Success | [
"Set",
"the",
"values",
"for",
"a",
"row"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Excel/Writer.php#L120-L139 |
21,318 | surebert/surebert-framework | src/sb/Excel/Writer.php | Writer.outputWithHeaders | public function outputWithHeaders($filename = 'output.xls')
{
\header("Expires: " . date("r", 0));
\header("Last-Modified: " . gmdate("r") . " GMT");
\header("Content-Type: application/x-msexcel");
\header("Content-Disposition: attachment; filename=" . $filename);
echo $this-... | php | public function outputWithHeaders($filename = 'output.xls')
{
\header("Expires: " . date("r", 0));
\header("Last-Modified: " . gmdate("r") . " GMT");
\header("Content-Type: application/x-msexcel");
\header("Content-Disposition: attachment; filename=" . $filename);
echo $this-... | [
"public",
"function",
"outputWithHeaders",
"(",
"$",
"filename",
"=",
"'output.xls'",
")",
"{",
"\\",
"header",
"(",
"\"Expires: \"",
".",
"date",
"(",
"\"r\"",
",",
"0",
")",
")",
";",
"\\",
"header",
"(",
"\"Last-Modified: \"",
".",
"gmdate",
"(",
"\"r\"... | Stream this file over HTTP
@return void | [
"Stream",
"this",
"file",
"over",
"HTTP"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Excel/Writer.php#L174-L181 |
21,319 | romainbessugesmeusy/php-datagrid | library/RBM/Datagrid/Data/Processor/ArrayProcessor.php | ArrayProcessor._sort | protected function _sort()
{
if (!isset($this->_sorts) || count($this->_sorts) === 0) {
return;
}
$columns = $this->_dataGrid->getActiveColumnsOrdered();
$sorts = $this->_sorts;
$sortPosition = $this->_sortPositions;
usort($this->_output, fun... | php | protected function _sort()
{
if (!isset($this->_sorts) || count($this->_sorts) === 0) {
return;
}
$columns = $this->_dataGrid->getActiveColumnsOrdered();
$sorts = $this->_sorts;
$sortPosition = $this->_sortPositions;
usort($this->_output, fun... | [
"protected",
"function",
"_sort",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"_sorts",
")",
"||",
"count",
"(",
"$",
"this",
"->",
"_sorts",
")",
"===",
"0",
")",
"{",
"return",
";",
"}",
"$",
"columns",
"=",
"$",
"this",
"... | Performs an array_multisort, based on the sorts defined | [
"Performs",
"an",
"array_multisort",
"based",
"on",
"the",
"sorts",
"defined"
] | 18f7ae15845fcf61520bbfc946771242bf1091c9 | https://github.com/romainbessugesmeusy/php-datagrid/blob/18f7ae15845fcf61520bbfc946771242bf1091c9/library/RBM/Datagrid/Data/Processor/ArrayProcessor.php#L72-L104 |
21,320 | romainbessugesmeusy/php-datagrid | library/RBM/Datagrid/Data/Processor/ArrayProcessor.php | ArrayProcessor._truncate | protected function _truncate()
{
if (!$this->getLimit()->isNull()) {
if (is_null($this->getLimit()->getCount())) {
$this->_output = array_splice($this->_output, $this->getLimit()->getStart());
} else {
$this->_output = array_splice($this->_output, $thi... | php | protected function _truncate()
{
if (!$this->getLimit()->isNull()) {
if (is_null($this->getLimit()->getCount())) {
$this->_output = array_splice($this->_output, $this->getLimit()->getStart());
} else {
$this->_output = array_splice($this->_output, $thi... | [
"protected",
"function",
"_truncate",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"getLimit",
"(",
")",
"->",
"isNull",
"(",
")",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"getLimit",
"(",
")",
"->",
"getCount",
"(",
")",
")",... | Simply splice the array | [
"Simply",
"splice",
"the",
"array"
] | 18f7ae15845fcf61520bbfc946771242bf1091c9 | https://github.com/romainbessugesmeusy/php-datagrid/blob/18f7ae15845fcf61520bbfc946771242bf1091c9/library/RBM/Datagrid/Data/Processor/ArrayProcessor.php#L109-L118 |
21,321 | ekuiter/feature-php | FeaturePhp/Model/ConstraintSolver.php | ConstraintSolver.mandatory | private static function mandatory($feature) {
if ($feature->getParent() && $feature->getMandatory())
return Logic::equiv(Logic::is($feature), Logic::is($feature->getParent()));
} | php | private static function mandatory($feature) {
if ($feature->getParent() && $feature->getMandatory())
return Logic::equiv(Logic::is($feature), Logic::is($feature->getParent()));
} | [
"private",
"static",
"function",
"mandatory",
"(",
"$",
"feature",
")",
"{",
"if",
"(",
"$",
"feature",
"->",
"getParent",
"(",
")",
"&&",
"$",
"feature",
"->",
"getMandatory",
"(",
")",
")",
"return",
"Logic",
"::",
"equiv",
"(",
"Logic",
"::",
"is",
... | Semantics for a mandatory feature.
A mandatory feature is selected iff its parent is selected.
@param Feature $feature
@return callable | [
"Semantics",
"for",
"a",
"mandatory",
"feature",
".",
"A",
"mandatory",
"feature",
"is",
"selected",
"iff",
"its",
"parent",
"is",
"selected",
"."
] | daf4a59098802fedcfd1f1a1d07847fcf2fea7bf | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Model/ConstraintSolver.php#L117-L120 |
21,322 | ekuiter/feature-php | FeaturePhp/Model/ConstraintSolver.php | ConstraintSolver.optional | private static function optional($feature) {
if ($feature->getParent())
return Logic::implies(Logic::is($feature), Logic::is($feature->getParent()));
} | php | private static function optional($feature) {
if ($feature->getParent())
return Logic::implies(Logic::is($feature), Logic::is($feature->getParent()));
} | [
"private",
"static",
"function",
"optional",
"(",
"$",
"feature",
")",
"{",
"if",
"(",
"$",
"feature",
"->",
"getParent",
"(",
")",
")",
"return",
"Logic",
"::",
"implies",
"(",
"Logic",
"::",
"is",
"(",
"$",
"feature",
")",
",",
"Logic",
"::",
"is",... | Semantics for an optional feature.
If an optional feature is selected, its parent is selected.
@param Feature $feature
@return callable | [
"Semantics",
"for",
"an",
"optional",
"feature",
".",
"If",
"an",
"optional",
"feature",
"is",
"selected",
"its",
"parent",
"is",
"selected",
"."
] | daf4a59098802fedcfd1f1a1d07847fcf2fea7bf | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Model/ConstraintSolver.php#L128-L131 |
21,323 | ekuiter/feature-php | FeaturePhp/Model/ConstraintSolver.php | ConstraintSolver.alternative | private static function alternative($feature) {
if ($feature->getAlternative()) {
$children = array();
foreach ($feature->getChildren() as $child)
$children[] = Logic::is($child);
$alternativeConstraints = array();
for ($i = 0; $i < count($childre... | php | private static function alternative($feature) {
if ($feature->getAlternative()) {
$children = array();
foreach ($feature->getChildren() as $child)
$children[] = Logic::is($child);
$alternativeConstraints = array();
for ($i = 0; $i < count($childre... | [
"private",
"static",
"function",
"alternative",
"(",
"$",
"feature",
")",
"{",
"if",
"(",
"$",
"feature",
"->",
"getAlternative",
"(",
")",
")",
"{",
"$",
"children",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"feature",
"->",
"getChildren",
"("... | Semantics for a feature that provides an alternative choice.
Exactly one child of such a feature is selected.
@param Feature $feature
@return callable | [
"Semantics",
"for",
"a",
"feature",
"that",
"provides",
"an",
"alternative",
"choice",
".",
"Exactly",
"one",
"child",
"of",
"such",
"a",
"feature",
"is",
"selected",
"."
] | daf4a59098802fedcfd1f1a1d07847fcf2fea7bf | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Model/ConstraintSolver.php#L139-L154 |
21,324 | ekuiter/feature-php | FeaturePhp/Model/ConstraintSolver.php | ConstraintSolver._or | private static function _or($feature) {
if ($feature->getOr()) {
$children = array();
foreach ($feature->getChildren() as $child)
$children[] = Logic::is($child);
return Logic::equiv(Logic::is($feature),
call_user_func_array("\F... | php | private static function _or($feature) {
if ($feature->getOr()) {
$children = array();
foreach ($feature->getChildren() as $child)
$children[] = Logic::is($child);
return Logic::equiv(Logic::is($feature),
call_user_func_array("\F... | [
"private",
"static",
"function",
"_or",
"(",
"$",
"feature",
")",
"{",
"if",
"(",
"$",
"feature",
"->",
"getOr",
"(",
")",
")",
"{",
"$",
"children",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"feature",
"->",
"getChildren",
"(",
")",
"as",
... | Semantics for a feature that provides a choice using an inclusive or.
At least one child of such a feature is selected.
@param Feature $feature
@return callable | [
"Semantics",
"for",
"a",
"feature",
"that",
"provides",
"a",
"choice",
"using",
"an",
"inclusive",
"or",
".",
"At",
"least",
"one",
"child",
"of",
"such",
"a",
"feature",
"is",
"selected",
"."
] | daf4a59098802fedcfd1f1a1d07847fcf2fea7bf | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Model/ConstraintSolver.php#L162-L170 |
21,325 | ekuiter/feature-php | FeaturePhp/Model/ConstraintSolver.php | ConstraintSolver.crossTreeConstraint | private function crossTreeConstraint($rule) {
$op = $rule->getName();
$num = $rule->count();
if ($op === "eq" && $num === 2)
return Logic::equiv($this->crossTreeConstraint($rule->children()[0]),
$this->crossTreeConstraint($rule->children()[1]));
... | php | private function crossTreeConstraint($rule) {
$op = $rule->getName();
$num = $rule->count();
if ($op === "eq" && $num === 2)
return Logic::equiv($this->crossTreeConstraint($rule->children()[0]),
$this->crossTreeConstraint($rule->children()[1]));
... | [
"private",
"function",
"crossTreeConstraint",
"(",
"$",
"rule",
")",
"{",
"$",
"op",
"=",
"$",
"rule",
"->",
"getName",
"(",
")",
";",
"$",
"num",
"=",
"$",
"rule",
"->",
"count",
"(",
")",
";",
"if",
"(",
"$",
"op",
"===",
"\"eq\"",
"&&",
"$",
... | Transforms a cross-tree constraint from an XML rule to a formula.
@param \SimpleXMLElement $rule
@return callable | [
"Transforms",
"a",
"cross",
"-",
"tree",
"constraint",
"from",
"an",
"XML",
"rule",
"to",
"a",
"formula",
"."
] | daf4a59098802fedcfd1f1a1d07847fcf2fea7bf | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Model/ConstraintSolver.php#L177-L199 |
21,326 | heidelpay/PhpDoc | src/phpDocumentor/Plugin/Core/Descriptor/Validator/ValidatorAbstract.php | ValidatorAbstract.dispatch | public function dispatch($name, $event)
{
if (!$this->event_dispatcher) {
return null;
}
if (!$this->event_dispatcher instanceof Dispatcher) {
throw new \Exception(
'Expected the event dispatcher to be an instance of phpDocumentor\Event\Dispatcher'
... | php | public function dispatch($name, $event)
{
if (!$this->event_dispatcher) {
return null;
}
if (!$this->event_dispatcher instanceof Dispatcher) {
throw new \Exception(
'Expected the event dispatcher to be an instance of phpDocumentor\Event\Dispatcher'
... | [
"public",
"function",
"dispatch",
"(",
"$",
"name",
",",
"$",
"event",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"event_dispatcher",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"!",
"$",
"this",
"->",
"event_dispatcher",
"instanceof",
"Dispatch... | Dispatches an event to the Event Dispatcher.
This method tries to dispatch an event; if no Event Dispatcher has been
set than this method will explicitly not fail and return null.
By not failing we make the Event Dispatcher optional and is it easier
for people to re-use this component in their own application.
@para... | [
"Dispatches",
"an",
"event",
"to",
"the",
"Event",
"Dispatcher",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Plugin/Core/Descriptor/Validator/ValidatorAbstract.php#L115-L128 |
21,327 | heidelpay/PhpDoc | src/phpDocumentor/Plugin/Core/Descriptor/Validator/ValidatorAbstract.php | ValidatorAbstract.logParserError | public function logParserError($type, $code, $line, $variables = array())
{
$message = $this->__($code, $variables);
$this->log($message, LogLevel::ERROR);
$this->dispatch(
'parser.log',
LogEvent::createInstance($this)
->setMessage($message)
... | php | public function logParserError($type, $code, $line, $variables = array())
{
$message = $this->__($code, $variables);
$this->log($message, LogLevel::ERROR);
$this->dispatch(
'parser.log',
LogEvent::createInstance($this)
->setMessage($message)
... | [
"public",
"function",
"logParserError",
"(",
"$",
"type",
",",
"$",
"code",
",",
"$",
"line",
",",
"$",
"variables",
"=",
"array",
"(",
")",
")",
"{",
"$",
"message",
"=",
"$",
"this",
"->",
"__",
"(",
"$",
"code",
",",
"$",
"variables",
")",
";"... | Dispatches a parser error to be logged.
@param string $type The logging priority as string
@param string $code The message to log.
@param string $line The line number where the error occurred..
@param string[] $variables an array with message substitution variables.
@return void | [
"Dispatches",
"a",
"parser",
"error",
"to",
"be",
"logged",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Plugin/Core/Descriptor/Validator/ValidatorAbstract.php#L158-L170 |
21,328 | heidelpay/PhpDoc | src/phpDocumentor/Plugin/Core/Descriptor/Validator/ValidatorAbstract.php | ValidatorAbstract.__ | public function __($message, $variables = array())
{
if (!$this->translate) {
return vsprintf($message, $variables);
}
$translator = $this->translate;
return vsprintf($translator->translate($message), $variables);
} | php | public function __($message, $variables = array())
{
if (!$this->translate) {
return vsprintf($message, $variables);
}
$translator = $this->translate;
return vsprintf($translator->translate($message), $variables);
} | [
"public",
"function",
"__",
"(",
"$",
"message",
",",
"$",
"variables",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"translate",
")",
"{",
"return",
"vsprintf",
"(",
"$",
"message",
",",
"$",
"variables",
")",
";",
"}",
"... | Translates the ID or message in the given language.
Translation messages may contain any formatting as used by the php
vsprintf function.
@param string $message ID or message to translate.
@param array $variables Variables to use for substitution.
@codingStandardsIgnoreStart
@return string | [
"Translates",
"the",
"ID",
"or",
"message",
"in",
"the",
"given",
"language",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Plugin/Core/Descriptor/Validator/ValidatorAbstract.php#L196-L205 |
21,329 | MASNathan/Parser | src/Data/Content.php | Content.from | public function from($type)
{
switch ($type) {
case 'ini':
$this->data = Ini::decode($this->string);
break;
case 'json':
$this->data = Json::decode($this->string);
break;
case 'php':
$this->... | php | public function from($type)
{
switch ($type) {
case 'ini':
$this->data = Ini::decode($this->string);
break;
case 'json':
$this->data = Json::decode($this->string);
break;
case 'php':
$this->... | [
"public",
"function",
"from",
"(",
"$",
"type",
")",
"{",
"switch",
"(",
"$",
"type",
")",
"{",
"case",
"'ini'",
":",
"$",
"this",
"->",
"data",
"=",
"Ini",
"::",
"decode",
"(",
"$",
"this",
"->",
"string",
")",
";",
"break",
";",
"case",
"'json'... | Specifies the structure type which the content will be parsed from
@param string $type Type [ini, json, php, xml or yaml]
@return Content | [
"Specifies",
"the",
"structure",
"type",
"which",
"the",
"content",
"will",
"be",
"parsed",
"from"
] | 0f55402b99b1e071bdcd6277b9268f783ca25e34 | https://github.com/MASNathan/Parser/blob/0f55402b99b1e071bdcd6277b9268f783ca25e34/src/Data/Content.php#L82-L111 |
21,330 | MASNathan/Parser | src/Data/Content.php | Content.to | public function to($type)
{
switch ($type) {
case 'ini':
$this->string = Ini::encode($this->data);
break;
case 'json':
$this->string = Json::encode($this->data, $this->prettyOutput);
break;
case 'php':
... | php | public function to($type)
{
switch ($type) {
case 'ini':
$this->string = Ini::encode($this->data);
break;
case 'json':
$this->string = Json::encode($this->data, $this->prettyOutput);
break;
case 'php':
... | [
"public",
"function",
"to",
"(",
"$",
"type",
")",
"{",
"switch",
"(",
"$",
"type",
")",
"{",
"case",
"'ini'",
":",
"$",
"this",
"->",
"string",
"=",
"Ini",
"::",
"encode",
"(",
"$",
"this",
"->",
"data",
")",
";",
"break",
";",
"case",
"'json'",... | Specifies the format you want to encode the data to
@param string $type Type [ini, json, php, xml or yaml]
@return string | [
"Specifies",
"the",
"format",
"you",
"want",
"to",
"encode",
"the",
"data",
"to"
] | 0f55402b99b1e071bdcd6277b9268f783ca25e34 | https://github.com/MASNathan/Parser/blob/0f55402b99b1e071bdcd6277b9268f783ca25e34/src/Data/Content.php#L118-L147 |
21,331 | kouks/laravel-filters | src/Filters/Filter.php | Filter.apply | public function apply(Builder $builder)
{
$this->builder = $builder;
// We need to select all columns from the original
// table, since many joins can mess up the selected fields
$this->builder->select("{$this->getTableName()}.*");
foreach ($this->filters() as $name => $val... | php | public function apply(Builder $builder)
{
$this->builder = $builder;
// We need to select all columns from the original
// table, since many joins can mess up the selected fields
$this->builder->select("{$this->getTableName()}.*");
foreach ($this->filters() as $name => $val... | [
"public",
"function",
"apply",
"(",
"Builder",
"$",
"builder",
")",
"{",
"$",
"this",
"->",
"builder",
"=",
"$",
"builder",
";",
"// We need to select all columns from the original",
"// table, since many joins can mess up the selected fields",
"$",
"this",
"->",
"builder... | Applies all available filters.
@param \Illuminate\Database\Eloquent\Builder $builder
@return \Illuminate\Database\Eloquent\Builder | [
"Applies",
"all",
"available",
"filters",
"."
] | c1a594fd40173dcbb454ea7ec59818a919fff6bd | https://github.com/kouks/laravel-filters/blob/c1a594fd40173dcbb454ea7ec59818a919fff6bd/src/Filters/Filter.php#L66-L79 |
21,332 | kouks/laravel-filters | src/Filters/Filter.php | Filter.resolve | protected function resolve($column, $key, $last, callable $callback)
{
if (! strpos($column, '.')) {
return $callback("{$last}.{$column}", $key);
}
$scope = strstr($column, '.', true);
$singular = str_singular($scope);
$next = substr(strstr($column, '.'), 1);
... | php | protected function resolve($column, $key, $last, callable $callback)
{
if (! strpos($column, '.')) {
return $callback("{$last}.{$column}", $key);
}
$scope = strstr($column, '.', true);
$singular = str_singular($scope);
$next = substr(strstr($column, '.'), 1);
... | [
"protected",
"function",
"resolve",
"(",
"$",
"column",
",",
"$",
"key",
",",
"$",
"last",
",",
"callable",
"$",
"callback",
")",
"{",
"if",
"(",
"!",
"strpos",
"(",
"$",
"column",
",",
"'.'",
")",
")",
"{",
"return",
"$",
"callback",
"(",
"\"{$las... | Recursively build up the query.
@param string $column
@param string $key
@param string $last
@param callable $callback
@return void | [
"Recursively",
"build",
"up",
"the",
"query",
"."
] | c1a594fd40173dcbb454ea7ec59818a919fff6bd | https://github.com/kouks/laravel-filters/blob/c1a594fd40173dcbb454ea7ec59818a919fff6bd/src/Filters/Filter.php#L121-L138 |
21,333 | ekuiter/feature-php | FeaturePhp/ProductLine/ProductRenderer.php | ProductRenderer._render | public function _render($textOnly) {
$featureNum = count($this->product->getConfiguration()->getSelectedFeatures());
$fileNum = count($this->files);
$str = "";
$maxLen = fphp\Helper\_String::getMaxLength($this->files, "getTarget");
if ($textOnly)
$str .= "\nProduct ... | php | public function _render($textOnly) {
$featureNum = count($this->product->getConfiguration()->getSelectedFeatures());
$fileNum = count($this->files);
$str = "";
$maxLen = fphp\Helper\_String::getMaxLength($this->files, "getTarget");
if ($textOnly)
$str .= "\nProduct ... | [
"public",
"function",
"_render",
"(",
"$",
"textOnly",
")",
"{",
"$",
"featureNum",
"=",
"count",
"(",
"$",
"this",
"->",
"product",
"->",
"getConfiguration",
"(",
")",
"->",
"getSelectedFeatures",
"(",
")",
")",
";",
"$",
"fileNum",
"=",
"count",
"(",
... | Returns the product analysis.
@param bool $textOnly whether to render text or HTML
@return string | [
"Returns",
"the",
"product",
"analysis",
"."
] | daf4a59098802fedcfd1f1a1d07847fcf2fea7bf | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/ProductLine/ProductRenderer.php#L47-L85 |
21,334 | eghojansu/moe | src/AbstractModel.php | AbstractModel.table | public function table()
{
if (!$this->_properties['table_name']) {
$class = explode('\\', get_called_class());
$this->_properties['table_name'] = Instance::snakecase(lcfirst(end($class)));
}
return $this->_properties['table_name'];
} | php | public function table()
{
if (!$this->_properties['table_name']) {
$class = explode('\\', get_called_class());
$this->_properties['table_name'] = Instance::snakecase(lcfirst(end($class)));
}
return $this->_properties['table_name'];
} | [
"public",
"function",
"table",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_properties",
"[",
"'table_name'",
"]",
")",
"{",
"$",
"class",
"=",
"explode",
"(",
"'\\\\'",
",",
"get_called_class",
"(",
")",
")",
";",
"$",
"this",
"->",
"_propert... | Return table name | [
"Return",
"table",
"name"
] | f58ec75a3116d1a572782256e2b38bb9aab95e3c | https://github.com/eghojansu/moe/blob/f58ec75a3116d1a572782256e2b38bb9aab95e3c/src/AbstractModel.php#L160-L168 |
21,335 | eghojansu/moe | src/AbstractModel.php | AbstractModel.field | public function field($name)
{
return isset($this->_properties['fields'][$name])?
$this->_properties['fields'][$name]:null;
} | php | public function field($name)
{
return isset($this->_properties['fields'][$name])?
$this->_properties['fields'][$name]:null;
} | [
"public",
"function",
"field",
"(",
"$",
"name",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"_properties",
"[",
"'fields'",
"]",
"[",
"$",
"name",
"]",
")",
"?",
"$",
"this",
"->",
"_properties",
"[",
"'fields'",
"]",
"[",
"$",
"name",
"]... | return field alias | [
"return",
"field",
"alias"
] | f58ec75a3116d1a572782256e2b38bb9aab95e3c | https://github.com/eghojansu/moe/blob/f58ec75a3116d1a572782256e2b38bb9aab95e3c/src/AbstractModel.php#L278-L282 |
21,336 | eghojansu/moe | src/AbstractModel.php | AbstractModel.get | public function get($var)
{
return isset($this->_schema['values'][$var])?
$this->_schema['values'][$var]:(
isset($this->_schema['others'][$var])?
$this->_schema['others'][$var]:null);
} | php | public function get($var)
{
return isset($this->_schema['values'][$var])?
$this->_schema['values'][$var]:(
isset($this->_schema['others'][$var])?
$this->_schema['others'][$var]:null);
} | [
"public",
"function",
"get",
"(",
"$",
"var",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"_schema",
"[",
"'values'",
"]",
"[",
"$",
"var",
"]",
")",
"?",
"$",
"this",
"->",
"_schema",
"[",
"'values'",
"]",
"[",
"$",
"var",
"]",
":",
"... | Get fields value | [
"Get",
"fields",
"value"
] | f58ec75a3116d1a572782256e2b38bb9aab95e3c | https://github.com/eghojansu/moe/blob/f58ec75a3116d1a572782256e2b38bb9aab95e3c/src/AbstractModel.php#L351-L357 |
21,337 | eghojansu/moe | src/AbstractModel.php | AbstractModel.findByPK | public function findByPK()
{
$pk = func_get_args();
if (!$this->_properties['primary_key'] || !$pk)
throw new Exception(sprintf(self::E_PrimaryKey, get_called_class()), 1);
!is_array(reset($pk)) || $pk = array_shift($pk);
$criteria = $values = array();
foreach ($... | php | public function findByPK()
{
$pk = func_get_args();
if (!$this->_properties['primary_key'] || !$pk)
throw new Exception(sprintf(self::E_PrimaryKey, get_called_class()), 1);
!is_array(reset($pk)) || $pk = array_shift($pk);
$criteria = $values = array();
foreach ($... | [
"public",
"function",
"findByPK",
"(",
")",
"{",
"$",
"pk",
"=",
"func_get_args",
"(",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"_properties",
"[",
"'primary_key'",
"]",
"||",
"!",
"$",
"pk",
")",
"throw",
"new",
"Exception",
"(",
"sprintf",
"(",... | Find by PK | [
"Find",
"by",
"PK"
] | f58ec75a3116d1a572782256e2b38bb9aab95e3c | https://github.com/eghojansu/moe/blob/f58ec75a3116d1a572782256e2b38bb9aab95e3c/src/AbstractModel.php#L476-L491 |
21,338 | eghojansu/moe | src/AbstractModel.php | AbstractModel.pkValue | public function pkValue()
{
if ($args = func_get_args()) {
!is_array($args[0]) || $args = array_shift($args);
$args = array_values($args);
foreach ($args as $key=>$arg)
$this->{$this->_properties['primary_key'][$key]} = $arg;
return $this;
... | php | public function pkValue()
{
if ($args = func_get_args()) {
!is_array($args[0]) || $args = array_shift($args);
$args = array_values($args);
foreach ($args as $key=>$arg)
$this->{$this->_properties['primary_key'][$key]} = $arg;
return $this;
... | [
"public",
"function",
"pkValue",
"(",
")",
"{",
"if",
"(",
"$",
"args",
"=",
"func_get_args",
"(",
")",
")",
"{",
"!",
"is_array",
"(",
"$",
"args",
"[",
"0",
"]",
")",
"||",
"$",
"args",
"=",
"array_shift",
"(",
"$",
"args",
")",
";",
"$",
"ar... | Get PK Value
@return mixed pk value | [
"Get",
"PK",
"Value"
] | f58ec75a3116d1a572782256e2b38bb9aab95e3c | https://github.com/eghojansu/moe/blob/f58ec75a3116d1a572782256e2b38bb9aab95e3c/src/AbstractModel.php#L497-L512 |
21,339 | eghojansu/moe | src/AbstractModel.php | AbstractModel.generatePK | public function generatePK()
{
$format = $this->pkFormat;
$pk = $this->_properties['primary_key'];
if (isset($pk[1]))
throw new Exception(sprintf(self::E_Composit, get_called_class(), __FUNCTION__), 1);
$pk = array_shift($pk);
if (!$pk)
throw ... | php | public function generatePK()
{
$format = $this->pkFormat;
$pk = $this->_properties['primary_key'];
if (isset($pk[1]))
throw new Exception(sprintf(self::E_Composit, get_called_class(), __FUNCTION__), 1);
$pk = array_shift($pk);
if (!$pk)
throw ... | [
"public",
"function",
"generatePK",
"(",
")",
"{",
"$",
"format",
"=",
"$",
"this",
"->",
"pkFormat",
";",
"$",
"pk",
"=",
"$",
"this",
"->",
"_properties",
"[",
"'primary_key'",
"]",
";",
"if",
"(",
"isset",
"(",
"$",
"pk",
"[",
"1",
"]",
")",
"... | Generate PK only if pk count = 1
@return string Next PK | [
"Generate",
"PK",
"only",
"if",
"pk",
"count",
"=",
"1"
] | f58ec75a3116d1a572782256e2b38bb9aab95e3c | https://github.com/eghojansu/moe/blob/f58ec75a3116d1a572782256e2b38bb9aab95e3c/src/AbstractModel.php#L548-L576 |
21,340 | eghojansu/moe | src/AbstractModel.php | AbstractModel.unique | public function unique($criteria = null, array $values = array())
{
if (!$this->_properties['primary_key'] || (!$values && !$criteria))
throw new Exception(sprintf(self::E_PrimaryKey, get_called_class()), 1);
$that = clone $this;
$values ? $that->find($criteria, $values) : $that... | php | public function unique($criteria = null, array $values = array())
{
if (!$this->_properties['primary_key'] || (!$values && !$criteria))
throw new Exception(sprintf(self::E_PrimaryKey, get_called_class()), 1);
$that = clone $this;
$values ? $that->find($criteria, $values) : $that... | [
"public",
"function",
"unique",
"(",
"$",
"criteria",
"=",
"null",
",",
"array",
"$",
"values",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_properties",
"[",
"'primary_key'",
"]",
"||",
"(",
"!",
"$",
"values",
"&&",
"!",... | Check not existance | [
"Check",
"not",
"existance"
] | f58ec75a3116d1a572782256e2b38bb9aab95e3c | https://github.com/eghojansu/moe/blob/f58ec75a3116d1a572782256e2b38bb9aab95e3c/src/AbstractModel.php#L595-L604 |
21,341 | eghojansu/moe | src/AbstractModel.php | AbstractModel.next | public function next()
{
if (!$this->hasError()) {
$row = $this->_stmt->fetch($this->_schema['fetch']);
$this->assign($row?:array_fill_keys(array_keys(
$this->_properties['fields']), null));
}
return $this;
} | php | public function next()
{
if (!$this->hasError()) {
$row = $this->_stmt->fetch($this->_schema['fetch']);
$this->assign($row?:array_fill_keys(array_keys(
$this->_properties['fields']), null));
}
return $this;
} | [
"public",
"function",
"next",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasError",
"(",
")",
")",
"{",
"$",
"row",
"=",
"$",
"this",
"->",
"_stmt",
"->",
"fetch",
"(",
"$",
"this",
"->",
"_schema",
"[",
"'fetch'",
"]",
")",
";",
"$",
... | get next row and assign row to schema values | [
"get",
"next",
"row",
"and",
"assign",
"row",
"to",
"schema",
"values"
] | f58ec75a3116d1a572782256e2b38bb9aab95e3c | https://github.com/eghojansu/moe/blob/f58ec75a3116d1a572782256e2b38bb9aab95e3c/src/AbstractModel.php#L655-L664 |
21,342 | eghojansu/moe | src/AbstractModel.php | AbstractModel.read | public function read($limit = 0)
{
$this->limit($limit);
$query = $this->buildSelect();
$this->run($query['query'], $query['param']);
return $this->next();
} | php | public function read($limit = 0)
{
$this->limit($limit);
$query = $this->buildSelect();
$this->run($query['query'], $query['param']);
return $this->next();
} | [
"public",
"function",
"read",
"(",
"$",
"limit",
"=",
"0",
")",
"{",
"$",
"this",
"->",
"limit",
"(",
"$",
"limit",
")",
";",
"$",
"query",
"=",
"$",
"this",
"->",
"buildSelect",
"(",
")",
";",
"$",
"this",
"->",
"run",
"(",
"$",
"query",
"[",
... | perform select query | [
"perform",
"select",
"query"
] | f58ec75a3116d1a572782256e2b38bb9aab95e3c | https://github.com/eghojansu/moe/blob/f58ec75a3116d1a572782256e2b38bb9aab95e3c/src/AbstractModel.php#L669-L676 |
21,343 | eghojansu/moe | src/AbstractModel.php | AbstractModel.insert | public function insert(array $data = array(), $update = false)
{
$this->viewCheck(__FUNCTION__);
$data = array_merge($this->_schema['init'],
array_filter($this->_schema['values'], array($this, 'filterRule')),
array_filter($this->_schema['others'], array($this, 'filterRule'))... | php | public function insert(array $data = array(), $update = false)
{
$this->viewCheck(__FUNCTION__);
$data = array_merge($this->_schema['init'],
array_filter($this->_schema['values'], array($this, 'filterRule')),
array_filter($this->_schema['others'], array($this, 'filterRule'))... | [
"public",
"function",
"insert",
"(",
"array",
"$",
"data",
"=",
"array",
"(",
")",
",",
"$",
"update",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"viewCheck",
"(",
"__FUNCTION__",
")",
";",
"$",
"data",
"=",
"array_merge",
"(",
"$",
"this",
"->",
"... | Insert, on duplicate key update | [
"Insert",
"on",
"duplicate",
"key",
"update"
] | f58ec75a3116d1a572782256e2b38bb9aab95e3c | https://github.com/eghojansu/moe/blob/f58ec75a3116d1a572782256e2b38bb9aab95e3c/src/AbstractModel.php#L716-L753 |
21,344 | eghojansu/moe | src/AbstractModel.php | AbstractModel.update | public function update(array $data = array(), array $criteria = array())
{
$this->viewCheck(__FUNCTION__);
$data = array_merge(
array_filter($this->_schema['others'], array($this, 'filterRule')),
$data);
$params = array();
$values = array_filter($this->_sche... | php | public function update(array $data = array(), array $criteria = array())
{
$this->viewCheck(__FUNCTION__);
$data = array_merge(
array_filter($this->_schema['others'], array($this, 'filterRule')),
$data);
$params = array();
$values = array_filter($this->_sche... | [
"public",
"function",
"update",
"(",
"array",
"$",
"data",
"=",
"array",
"(",
")",
",",
"array",
"$",
"criteria",
"=",
"array",
"(",
")",
")",
"{",
"$",
"this",
"->",
"viewCheck",
"(",
"__FUNCTION__",
")",
";",
"$",
"data",
"=",
"array_merge",
"(",
... | Update, only when there is primary key | [
"Update",
"only",
"when",
"there",
"is",
"primary",
"key"
] | f58ec75a3116d1a572782256e2b38bb9aab95e3c | https://github.com/eghojansu/moe/blob/f58ec75a3116d1a572782256e2b38bb9aab95e3c/src/AbstractModel.php#L758-L799 |
21,345 | eghojansu/moe | src/AbstractModel.php | AbstractModel.delete | public function delete(array $criteria = [])
{
$this->viewCheck(__FUNCTION__);
$query = $this->buildDelete($criteria);
$old = clone $this;
if (!$this->beforeDelete($criteria))
return false;
if ($result = $this->run($query, $criteria))
$this->next();... | php | public function delete(array $criteria = [])
{
$this->viewCheck(__FUNCTION__);
$query = $this->buildDelete($criteria);
$old = clone $this;
if (!$this->beforeDelete($criteria))
return false;
if ($result = $this->run($query, $criteria))
$this->next();... | [
"public",
"function",
"delete",
"(",
"array",
"$",
"criteria",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"viewCheck",
"(",
"__FUNCTION__",
")",
";",
"$",
"query",
"=",
"$",
"this",
"->",
"buildDelete",
"(",
"$",
"criteria",
")",
";",
"$",
"old",
... | delete, only when there is primary key | [
"delete",
"only",
"when",
"there",
"is",
"primary",
"key"
] | f58ec75a3116d1a572782256e2b38bb9aab95e3c | https://github.com/eghojansu/moe/blob/f58ec75a3116d1a572782256e2b38bb9aab95e3c/src/AbstractModel.php#L804-L821 |
21,346 | eghojansu/moe | src/AbstractModel.php | AbstractModel.performValidate | protected function performValidate($key, &$value)
{
if (!$filter = $this->_schema['filter'][$key])
return true;
$validation = Validation::instance();
$moe = Base::instance();
$field = $this->_properties['fields'][$key];
foreach ($filter as $func => $param) {
... | php | protected function performValidate($key, &$value)
{
if (!$filter = $this->_schema['filter'][$key])
return true;
$validation = Validation::instance();
$moe = Base::instance();
$field = $this->_properties['fields'][$key];
foreach ($filter as $func => $param) {
... | [
"protected",
"function",
"performValidate",
"(",
"$",
"key",
",",
"&",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"$",
"filter",
"=",
"$",
"this",
"->",
"_schema",
"[",
"'filter'",
"]",
"[",
"$",
"key",
"]",
")",
"return",
"true",
";",
"$",
"validatio... | Perform validation
We can use method in Base class or any method with full name call but
you need to define a message to override default message
Be aware when use a method | [
"Perform",
"validation",
"We",
"can",
"use",
"method",
"in",
"Base",
"class",
"or",
"any",
"method",
"with",
"full",
"name",
"call",
"but",
"you",
"need",
"to",
"define",
"a",
"message",
"to",
"override",
"default",
"message",
"Be",
"aware",
"when",
"use",... | f58ec75a3116d1a572782256e2b38bb9aab95e3c | https://github.com/eghojansu/moe/blob/f58ec75a3116d1a572782256e2b38bb9aab95e3c/src/AbstractModel.php#L972-L1005 |
21,347 | chippyash/Assembly-Builder | src/chippyash/Assembler/Traits/ParameterGrabable.php | ParameterGrabable.grabFunctionParameters | static function grabFunctionParameters($class, $function, array $paramValues)
{
$declaredParams = (new \ReflectionMethod($class, $function))->getParameters();
$paramNames = array_map(function(\ReflectionParameter $v) {
return $v->getName();
},
$declaredParams
... | php | static function grabFunctionParameters($class, $function, array $paramValues)
{
$declaredParams = (new \ReflectionMethod($class, $function))->getParameters();
$paramNames = array_map(function(\ReflectionParameter $v) {
return $v->getName();
},
$declaredParams
... | [
"static",
"function",
"grabFunctionParameters",
"(",
"$",
"class",
",",
"$",
"function",
",",
"array",
"$",
"paramValues",
")",
"{",
"$",
"declaredParams",
"=",
"(",
"new",
"\\",
"ReflectionMethod",
"(",
"$",
"class",
",",
"$",
"function",
")",
")",
"->",
... | Return array keyed by parameter name of values passed into a class static function
@param string $class Name of class that has the method usually via __CLASS__
@param string $function Name of function to inspect usually via __FUNCTION__
@param array $paramValues array of actual values usually via func_get_args
@retur... | [
"Return",
"array",
"keyed",
"by",
"parameter",
"name",
"of",
"values",
"passed",
"into",
"a",
"class",
"static",
"function"
] | be477306b7a1c09b48ce9e100f9f6680035d0df3 | https://github.com/chippyash/Assembly-Builder/blob/be477306b7a1c09b48ce9e100f9f6680035d0df3/src/chippyash/Assembler/Traits/ParameterGrabable.php#L45-L60 |
21,348 | glynnforrest/blockade | src/Blockade/EventListener/FirewallListener.php | FirewallListener.onKernelRequest | public function onKernelRequest(GetResponseEvent $event)
{
$request = $event->getRequest();
foreach ($this->firewalls as $firewall) {
//firewalls returns true for an exemption, so skip others
if (true === $firewall->check($request)) {
return;
}
... | php | public function onKernelRequest(GetResponseEvent $event)
{
$request = $event->getRequest();
foreach ($this->firewalls as $firewall) {
//firewalls returns true for an exemption, so skip others
if (true === $firewall->check($request)) {
return;
}
... | [
"public",
"function",
"onKernelRequest",
"(",
"GetResponseEvent",
"$",
"event",
")",
"{",
"$",
"request",
"=",
"$",
"event",
"->",
"getRequest",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"firewalls",
"as",
"$",
"firewall",
")",
"{",
"//firewalls re... | Respond to a REQUEST KernelEvent by validating the request
against the registered firewalls. | [
"Respond",
"to",
"a",
"REQUEST",
"KernelEvent",
"by",
"validating",
"the",
"request",
"against",
"the",
"registered",
"firewalls",
"."
] | 5dfc8b2fa7b9f7029a1bdaa7c50e32ee8665ab3b | https://github.com/glynnforrest/blockade/blob/5dfc8b2fa7b9f7029a1bdaa7c50e32ee8665ab3b/src/Blockade/EventListener/FirewallListener.php#L61-L70 |
21,349 | ekuiter/feature-php | FeaturePhp/Aspect/Aspect.php | Aspect.getRelativeFileTarget | public function getRelativeFileTarget($aspectKernelTarget) {
return fphp\Helper\Path::join(fphp\Helper\Path::rootPath(dirname($aspectKernelTarget)),
$this->fileSpecification->getTarget());
} | php | public function getRelativeFileTarget($aspectKernelTarget) {
return fphp\Helper\Path::join(fphp\Helper\Path::rootPath(dirname($aspectKernelTarget)),
$this->fileSpecification->getTarget());
} | [
"public",
"function",
"getRelativeFileTarget",
"(",
"$",
"aspectKernelTarget",
")",
"{",
"return",
"fphp",
"\\",
"Helper",
"\\",
"Path",
"::",
"join",
"(",
"fphp",
"\\",
"Helper",
"\\",
"Path",
"::",
"rootPath",
"(",
"dirname",
"(",
"$",
"aspectKernelTarget",
... | Returns the path of the aspect's target file relative to the aspect kernel's target file.
@param string $aspectKernelTarget
@return string | [
"Returns",
"the",
"path",
"of",
"the",
"aspect",
"s",
"target",
"file",
"relative",
"to",
"the",
"aspect",
"kernel",
"s",
"target",
"file",
"."
] | daf4a59098802fedcfd1f1a1d07847fcf2fea7bf | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Aspect/Aspect.php#L68-L71 |
21,350 | ekuiter/feature-php | FeaturePhp/Aspect/Aspect.php | Aspect.getClassName | public function getClassName() {
$fileSource = $this->fileSpecification->getSource();
return (new fphp\Helper\PhpParser())->parseFile($fileSource)->getExactlyOneClass($fileSource)->name;
} | php | public function getClassName() {
$fileSource = $this->fileSpecification->getSource();
return (new fphp\Helper\PhpParser())->parseFile($fileSource)->getExactlyOneClass($fileSource)->name;
} | [
"public",
"function",
"getClassName",
"(",
")",
"{",
"$",
"fileSource",
"=",
"$",
"this",
"->",
"fileSpecification",
"->",
"getSource",
"(",
")",
";",
"return",
"(",
"new",
"fphp",
"\\",
"Helper",
"\\",
"PhpParser",
"(",
")",
")",
"->",
"parseFile",
"(",... | Returns the aspect's class name.
For this, the aspect's file has to be parsed.
@return string | [
"Returns",
"the",
"aspect",
"s",
"class",
"name",
".",
"For",
"this",
"the",
"aspect",
"s",
"file",
"has",
"to",
"be",
"parsed",
"."
] | daf4a59098802fedcfd1f1a1d07847fcf2fea7bf | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Aspect/Aspect.php#L78-L81 |
21,351 | technote-space/wordpress-plugin-base | src/classes/models/lib/loader/controller/api.php | Api.register_ajax_script | private function register_ajax_script() {
return $this->register_script_common( function () {
return [
'endpoint' => $this->apply_filters( 'admin_ajax', admin_url( 'admin-ajax.php' ) ),
'nonce_key' => $this->get_nonce_key(),
'nonce_value' => $this->create_nonce(),
'is_admin_ajax' => true... | php | private function register_ajax_script() {
return $this->register_script_common( function () {
return [
'endpoint' => $this->apply_filters( 'admin_ajax', admin_url( 'admin-ajax.php' ) ),
'nonce_key' => $this->get_nonce_key(),
'nonce_value' => $this->create_nonce(),
'is_admin_ajax' => true... | [
"private",
"function",
"register_ajax_script",
"(",
")",
"{",
"return",
"$",
"this",
"->",
"register_script_common",
"(",
"function",
"(",
")",
"{",
"return",
"[",
"'endpoint'",
"=>",
"$",
"this",
"->",
"apply_filters",
"(",
"'admin_ajax'",
",",
"admin_url",
"... | register script for admin-ajax.php | [
"register",
"script",
"for",
"admin",
"-",
"ajax",
".",
"php"
] | 02cfcba358432a2539af07a69d9db00ff7c14eac | https://github.com/technote-space/wordpress-plugin-base/blob/02cfcba358432a2539af07a69d9db00ff7c14eac/src/classes/models/lib/loader/controller/api.php#L177-L186 |
21,352 | Eresus/EresusCMS | src/core/framework/core/Template/Template.php | TemplateSettings.getGlobalValue | public static function getGlobalValue($name)
{
return array_key_exists($name, self::$globalValues) ? self::$globalValues[$name] : null;
} | php | public static function getGlobalValue($name)
{
return array_key_exists($name, self::$globalValues) ? self::$globalValues[$name] : null;
} | [
"public",
"static",
"function",
"getGlobalValue",
"(",
"$",
"name",
")",
"{",
"return",
"array_key_exists",
"(",
"$",
"name",
",",
"self",
"::",
"$",
"globalValues",
")",
"?",
"self",
"::",
"$",
"globalValues",
"[",
"$",
"name",
"]",
":",
"null",
";",
... | Get global substitution value
@param string $name
@return null|mixed Null will be returned if value not set | [
"Get",
"global",
"substitution",
"value"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/Template/Template.php#L61-L64 |
21,353 | hametuha/wpametu | src/WPametu/API/RewriteParser.php | RewriteParser.invoke | protected function invoke($method_name, $request_method, array $arguments = []){
$method_name = strtolower($request_method).'_'.$this->str->to_snake_case($method_name);
// Check if method exists
if( !is_callable([$this, $method_name]) ){
return false;
}
// Check acce... | php | protected function invoke($method_name, $request_method, array $arguments = []){
$method_name = strtolower($request_method).'_'.$this->str->to_snake_case($method_name);
// Check if method exists
if( !is_callable([$this, $method_name]) ){
return false;
}
// Check acce... | [
"protected",
"function",
"invoke",
"(",
"$",
"method_name",
",",
"$",
"request_method",
",",
"array",
"$",
"arguments",
"=",
"[",
"]",
")",
"{",
"$",
"method_name",
"=",
"strtolower",
"(",
"$",
"request_method",
")",
".",
"'_'",
".",
"$",
"this",
"->",
... | Search method and execute if exists.
@param string $method_name
@param string $request_method
@param array $arguments
@return bool | [
"Search",
"method",
"and",
"execute",
"if",
"exists",
"."
] | 0939373800815a8396291143d2a57967340da5aa | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/API/RewriteParser.php#L61-L79 |
21,354 | OpenBuildings/monetary | src/OpenBuildings/Monetary/Source/ECB.php | Source_ECB.convert_to_array | public function convert_to_array($raw_data)
{
$xml = new \SimpleXMLElement($raw_data);
$xml->registerXPathNamespace(
self::XML_NAMESPACE,
self::XML_NAMESPACE_URL
);
$data = $xml->xpath(self::XPATH_CURRENCY);
$currencies = array();
foreach ($data as $currency)
{
$currencies[ (string) $currency-... | php | public function convert_to_array($raw_data)
{
$xml = new \SimpleXMLElement($raw_data);
$xml->registerXPathNamespace(
self::XML_NAMESPACE,
self::XML_NAMESPACE_URL
);
$data = $xml->xpath(self::XPATH_CURRENCY);
$currencies = array();
foreach ($data as $currency)
{
$currencies[ (string) $currency-... | [
"public",
"function",
"convert_to_array",
"(",
"$",
"raw_data",
")",
"{",
"$",
"xml",
"=",
"new",
"\\",
"SimpleXMLElement",
"(",
"$",
"raw_data",
")",
";",
"$",
"xml",
"->",
"registerXPathNamespace",
"(",
"self",
"::",
"XML_NAMESPACE",
",",
"self",
"::",
"... | Convert raw currency data to array of currencies
@param string $raw_data currency data in XML format
@return array currencies | [
"Convert",
"raw",
"currency",
"data",
"to",
"array",
"of",
"currencies"
] | f7831ab055eaba7105f3f3530506b96de7fedd29 | https://github.com/OpenBuildings/monetary/blob/f7831ab055eaba7105f3f3530506b96de7fedd29/src/OpenBuildings/Monetary/Source/ECB.php#L30-L47 |
21,355 | FriendsOfApi/phraseapp | src/Api/Translation.php | Translation.indexLocale | public function indexLocale(string $projectKey, string $localeId, array $params = [])
{
if (isset($params['tags'])) {
$params['q'] = 'tags:'.$params['tags'];
unset($params['tags']);
}
$response = $this->httpGet(sprintf('/api/v2/projects/%s/locales/%s/translations', $... | php | public function indexLocale(string $projectKey, string $localeId, array $params = [])
{
if (isset($params['tags'])) {
$params['q'] = 'tags:'.$params['tags'];
unset($params['tags']);
}
$response = $this->httpGet(sprintf('/api/v2/projects/%s/locales/%s/translations', $... | [
"public",
"function",
"indexLocale",
"(",
"string",
"$",
"projectKey",
",",
"string",
"$",
"localeId",
",",
"array",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"params",
"[",
"'tags'",
"]",
")",
")",
"{",
"$",
"params",
"... | Index a locale.
@param string $projectKey
@param string $localeId
@param array $params
@return Index|ResponseInterface | [
"Index",
"a",
"locale",
"."
] | 1553bf857eb0858f9a7eb905b085864d24f80886 | https://github.com/FriendsOfApi/phraseapp/blob/1553bf857eb0858f9a7eb905b085864d24f80886/src/Api/Translation.php#L31-L49 |
21,356 | FriendsOfApi/phraseapp | src/Api/Translation.php | Translation.create | public function create(string $projectKey, string $localeId, string $keyId, string $content, array $params = [])
{
$params['locale_id'] = $localeId;
$params['key_id'] = $keyId;
$params['content'] = $content;
$response = $this->httpPost(sprintf('/api/v2/projects/%s/translations', $pr... | php | public function create(string $projectKey, string $localeId, string $keyId, string $content, array $params = [])
{
$params['locale_id'] = $localeId;
$params['key_id'] = $keyId;
$params['content'] = $content;
$response = $this->httpPost(sprintf('/api/v2/projects/%s/translations', $pr... | [
"public",
"function",
"create",
"(",
"string",
"$",
"projectKey",
",",
"string",
"$",
"localeId",
",",
"string",
"$",
"keyId",
",",
"string",
"$",
"content",
",",
"array",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"$",
"params",
"[",
"'locale_id'",
"]",
... | Create a translation.
@param string $projectKey
@param string $keyId
@param string $content
@param array $params
@return TranslationCreated|ResponseInterface | [
"Create",
"a",
"translation",
"."
] | 1553bf857eb0858f9a7eb905b085864d24f80886 | https://github.com/FriendsOfApi/phraseapp/blob/1553bf857eb0858f9a7eb905b085864d24f80886/src/Api/Translation.php#L61-L78 |
21,357 | FriendsOfApi/phraseapp | src/Api/Translation.php | Translation.update | public function update(string $projectKey, string $translationId, string $content, array $params = [])
{
$params['content'] = $content;
$response = $this->httpPatch(sprintf('/api/v2/projects/%s/translations/%s', $projectKey, $translationId), $params);
if (!$this->hydrator) {
re... | php | public function update(string $projectKey, string $translationId, string $content, array $params = [])
{
$params['content'] = $content;
$response = $this->httpPatch(sprintf('/api/v2/projects/%s/translations/%s', $projectKey, $translationId), $params);
if (!$this->hydrator) {
re... | [
"public",
"function",
"update",
"(",
"string",
"$",
"projectKey",
",",
"string",
"$",
"translationId",
",",
"string",
"$",
"content",
",",
"array",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"$",
"params",
"[",
"'content'",
"]",
"=",
"$",
"content",
";",
... | Update a translation.
@param string $projectKey
@param string $translationId
@param string $content
@param array $params
@return TranslationUpdated|ResponseInterface | [
"Update",
"a",
"translation",
"."
] | 1553bf857eb0858f9a7eb905b085864d24f80886 | https://github.com/FriendsOfApi/phraseapp/blob/1553bf857eb0858f9a7eb905b085864d24f80886/src/Api/Translation.php#L90-L105 |
21,358 | FriendsOfApi/phraseapp | src/Api/Translation.php | Translation.indexKey | public function indexKey(string $projectKey, string $keyId, array $params = [])
{
if (isset($params['tags'])) {
$params['q'] = 'tags:'.$params['tags'];
unset($params['tags']);
}
$response = $this->httpGet(sprintf('/api/v2/projects/%s/keys/%s/translations', $projectKe... | php | public function indexKey(string $projectKey, string $keyId, array $params = [])
{
if (isset($params['tags'])) {
$params['q'] = 'tags:'.$params['tags'];
unset($params['tags']);
}
$response = $this->httpGet(sprintf('/api/v2/projects/%s/keys/%s/translations', $projectKe... | [
"public",
"function",
"indexKey",
"(",
"string",
"$",
"projectKey",
",",
"string",
"$",
"keyId",
",",
"array",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"params",
"[",
"'tags'",
"]",
")",
")",
"{",
"$",
"params",
"[",
... | List translations for a specific key.
@param string $projectKey
@param string $keyId
@param array $params
@return Index|ResponseInterface | [
"List",
"translations",
"for",
"a",
"specific",
"key",
"."
] | 1553bf857eb0858f9a7eb905b085864d24f80886 | https://github.com/FriendsOfApi/phraseapp/blob/1553bf857eb0858f9a7eb905b085864d24f80886/src/Api/Translation.php#L116-L134 |
21,359 | WellCommerce/AppBundle | Form/DataTransformer/TranslationTransformer.php | TranslationTransformer.transformTranslation | protected function transformTranslation(LocaleAwareInterface $translation, $fields, &$values)
{
foreach ($fields as $field) {
$values[$translation->getLocale()][$field] = $this->propertyAccessor->getValue($translation, $field);
}
} | php | protected function transformTranslation(LocaleAwareInterface $translation, $fields, &$values)
{
foreach ($fields as $field) {
$values[$translation->getLocale()][$field] = $this->propertyAccessor->getValue($translation, $field);
}
} | [
"protected",
"function",
"transformTranslation",
"(",
"LocaleAwareInterface",
"$",
"translation",
",",
"$",
"fields",
",",
"&",
"$",
"values",
")",
"{",
"foreach",
"(",
"$",
"fields",
"as",
"$",
"field",
")",
"{",
"$",
"values",
"[",
"$",
"translation",
"-... | Transforms single translation
@param LocaleAwareInterface $translation
@param array $fields
@param array $values | [
"Transforms",
"single",
"translation"
] | 2add687d1c898dd0b24afd611d896e3811a0eac3 | https://github.com/WellCommerce/AppBundle/blob/2add687d1c898dd0b24afd611d896e3811a0eac3/Form/DataTransformer/TranslationTransformer.php#L55-L60 |
21,360 | platformsh/platformsh-oauth2-php | src/GuzzleMiddleware.php | GuzzleMiddleware.isOAuth2 | private function isOAuth2(RequestInterface $request, array $options)
{
// The 'auth' option must be set to 'oauth2'.
if (!isset($options['auth']) || $options['auth'] !== 'oauth2') {
return false;
}
// The request must be not for an access token endpoint.
if ($thi... | php | private function isOAuth2(RequestInterface $request, array $options)
{
// The 'auth' option must be set to 'oauth2'.
if (!isset($options['auth']) || $options['auth'] !== 'oauth2') {
return false;
}
// The request must be not for an access token endpoint.
if ($thi... | [
"private",
"function",
"isOAuth2",
"(",
"RequestInterface",
"$",
"request",
",",
"array",
"$",
"options",
")",
"{",
"// The 'auth' option must be set to 'oauth2'.",
"if",
"(",
"!",
"isset",
"(",
"$",
"options",
"[",
"'auth'",
"]",
")",
"||",
"$",
"options",
"[... | Check if a request is configured to use OAuth2.
@param RequestInterface $request
@param array $options
@return bool | [
"Check",
"if",
"a",
"request",
"is",
"configured",
"to",
"use",
"OAuth2",
"."
] | c5056b818f326e8ee358521224ac7f803d1e9d6b | https://github.com/platformsh/platformsh-oauth2-php/blob/c5056b818f326e8ee358521224ac7f803d1e9d6b/src/GuzzleMiddleware.php#L101-L114 |
21,361 | platformsh/platformsh-oauth2-php | src/GuzzleMiddleware.php | GuzzleMiddleware.authenticateRequest | private function authenticateRequest(RequestInterface $request, AccessToken $token)
{
foreach ($this->provider->getHeaders($token->getToken()) as $name => $value) {
$request = $request->withHeader($name, $value);
}
return $request;
} | php | private function authenticateRequest(RequestInterface $request, AccessToken $token)
{
foreach ($this->provider->getHeaders($token->getToken()) as $name => $value) {
$request = $request->withHeader($name, $value);
}
return $request;
} | [
"private",
"function",
"authenticateRequest",
"(",
"RequestInterface",
"$",
"request",
",",
"AccessToken",
"$",
"token",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"provider",
"->",
"getHeaders",
"(",
"$",
"token",
"->",
"getToken",
"(",
")",
")",
"as",
... | Add authentication to an HTTP request.
@param \Psr\Http\Message\RequestInterface $request
@param \League\OAuth2\Client\Token\AccessToken $token
@return \Psr\Http\Message\RequestInterface | [
"Add",
"authentication",
"to",
"an",
"HTTP",
"request",
"."
] | c5056b818f326e8ee358521224ac7f803d1e9d6b | https://github.com/platformsh/platformsh-oauth2-php/blob/c5056b818f326e8ee358521224ac7f803d1e9d6b/src/GuzzleMiddleware.php#L124-L131 |
21,362 | platformsh/platformsh-oauth2-php | src/GuzzleMiddleware.php | GuzzleMiddleware.getAccessToken | private function getAccessToken(AccessToken $invalid = null)
{
if (!isset($this->accessToken) || $this->accessToken->hasExpired() || ($invalid && $this->accessToken === $invalid)) {
$this->accessToken = $this->acquireAccessToken();
if (is_callable($this->tokenSave)) {
... | php | private function getAccessToken(AccessToken $invalid = null)
{
if (!isset($this->accessToken) || $this->accessToken->hasExpired() || ($invalid && $this->accessToken === $invalid)) {
$this->accessToken = $this->acquireAccessToken();
if (is_callable($this->tokenSave)) {
... | [
"private",
"function",
"getAccessToken",
"(",
"AccessToken",
"$",
"invalid",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"accessToken",
")",
"||",
"$",
"this",
"->",
"accessToken",
"->",
"hasExpired",
"(",
")",
"||",
"(",
"$... | Get the current access token.
@param AccessToken|null $invalid
A token to consider invalid.
@return \League\OAuth2\Client\Token\AccessToken
The OAuth2 access token. | [
"Get",
"the",
"current",
"access",
"token",
"."
] | c5056b818f326e8ee358521224ac7f803d1e9d6b | https://github.com/platformsh/platformsh-oauth2-php/blob/c5056b818f326e8ee358521224ac7f803d1e9d6b/src/GuzzleMiddleware.php#L142-L152 |
21,363 | platformsh/platformsh-oauth2-php | src/GuzzleMiddleware.php | GuzzleMiddleware.acquireAccessToken | private function acquireAccessToken()
{
if (isset($this->accessToken) && $this->accessToken->getRefreshToken()) {
return $this->provider->getAccessToken(new RefreshToken(), ['refresh_token' => $this->accessToken->getRefreshToken()]);
}
return $this->provider->getAccessToken($thi... | php | private function acquireAccessToken()
{
if (isset($this->accessToken) && $this->accessToken->getRefreshToken()) {
return $this->provider->getAccessToken(new RefreshToken(), ['refresh_token' => $this->accessToken->getRefreshToken()]);
}
return $this->provider->getAccessToken($thi... | [
"private",
"function",
"acquireAccessToken",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"accessToken",
")",
"&&",
"$",
"this",
"->",
"accessToken",
"->",
"getRefreshToken",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"provider",
"->"... | Acquire a new access token using a refresh token or the configured grant.
@return AccessToken | [
"Acquire",
"a",
"new",
"access",
"token",
"using",
"a",
"refresh",
"token",
"or",
"the",
"configured",
"grant",
"."
] | c5056b818f326e8ee358521224ac7f803d1e9d6b | https://github.com/platformsh/platformsh-oauth2-php/blob/c5056b818f326e8ee358521224ac7f803d1e9d6b/src/GuzzleMiddleware.php#L159-L166 |
21,364 | Innmind/neo4j-dbal | src/Query/Cypher.php | Cypher.withParameters | public function withParameters(array $parameters): self
{
$query = $this;
foreach ($parameters as $key => $parameter) {
$query = $query->withParameter($key, $parameter);
}
return $query;
} | php | public function withParameters(array $parameters): self
{
$query = $this;
foreach ($parameters as $key => $parameter) {
$query = $query->withParameter($key, $parameter);
}
return $query;
} | [
"public",
"function",
"withParameters",
"(",
"array",
"$",
"parameters",
")",
":",
"self",
"{",
"$",
"query",
"=",
"$",
"this",
";",
"foreach",
"(",
"$",
"parameters",
"as",
"$",
"key",
"=>",
"$",
"parameter",
")",
"{",
"$",
"query",
"=",
"$",
"query... | Attach parameters to this query
@param array $parameters
@throws NonParametrableClause
@return self | [
"Attach",
"parameters",
"to",
"this",
"query"
] | 12cb71e698cc0f4d55b7f2eb40f7b353c778a20b | https://github.com/Innmind/neo4j-dbal/blob/12cb71e698cc0f4d55b7f2eb40f7b353c778a20b/src/Query/Cypher.php#L72-L81 |
21,365 | Innmind/neo4j-dbal | src/Query/Cypher.php | Cypher.withParameter | public function withParameter(string $key, $parameter): self
{
if (Str::of($key)->empty()) {
throw new DomainException;
}
$query = new self($this->cypher);
$query->parameters = $this->parameters->put(
$key,
new Parameter($key, $parameter)
... | php | public function withParameter(string $key, $parameter): self
{
if (Str::of($key)->empty()) {
throw new DomainException;
}
$query = new self($this->cypher);
$query->parameters = $this->parameters->put(
$key,
new Parameter($key, $parameter)
... | [
"public",
"function",
"withParameter",
"(",
"string",
"$",
"key",
",",
"$",
"parameter",
")",
":",
"self",
"{",
"if",
"(",
"Str",
"::",
"of",
"(",
"$",
"key",
")",
"->",
"empty",
"(",
")",
")",
"{",
"throw",
"new",
"DomainException",
";",
"}",
"$",... | Attach the given parameter to this query
@param string $key
@param mixed $parameter
@throws NonParametrableClause
@return self | [
"Attach",
"the",
"given",
"parameter",
"to",
"this",
"query"
] | 12cb71e698cc0f4d55b7f2eb40f7b353c778a20b | https://github.com/Innmind/neo4j-dbal/blob/12cb71e698cc0f4d55b7f2eb40f7b353c778a20b/src/Query/Cypher.php#L93-L106 |
21,366 | inhere/php-librarys | src/Files/FileFinder.php | FileFinder.filterResult | public function filterResult(callable $filter)
{
$result = [];
foreach ($this->files as $file) {
if ($filter($file)) {
$result[] = $file;
}
}
return $result;
} | php | public function filterResult(callable $filter)
{
$result = [];
foreach ($this->files as $file) {
if ($filter($file)) {
$result[] = $file;
}
}
return $result;
} | [
"public",
"function",
"filterResult",
"(",
"callable",
"$",
"filter",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"files",
"as",
"$",
"file",
")",
"{",
"if",
"(",
"$",
"filter",
"(",
"$",
"file",
")",
")",
"{",... | Further filtering the find result set
@param callable $filter
e.g:
$filter = function($file) {
if (false !== strpos($file, 'jqu') ) {
return true;
}
return false;
};
@return array | [
"Further",
"filtering",
"the",
"find",
"result",
"set"
] | e6ca598685469794f310e3ab0e2bc19519cd0ae6 | https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/Files/FileFinder.php#L207-L218 |
21,367 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/parts/file.php | ezcMailFilePart.setHeaderContentType | private function setHeaderContentType()
{
$fileName = basename( $this->fileName );
if ( $this->contentDisposition !== null && $this->contentDisposition->fileName !== null )
{
$fileName = $this->contentDisposition->fileName;
}
$this->setHeader( 'Content-Type',
... | php | private function setHeaderContentType()
{
$fileName = basename( $this->fileName );
if ( $this->contentDisposition !== null && $this->contentDisposition->fileName !== null )
{
$fileName = $this->contentDisposition->fileName;
}
$this->setHeader( 'Content-Type',
... | [
"private",
"function",
"setHeaderContentType",
"(",
")",
"{",
"$",
"fileName",
"=",
"basename",
"(",
"$",
"this",
"->",
"fileName",
")",
";",
"if",
"(",
"$",
"this",
"->",
"contentDisposition",
"!==",
"null",
"&&",
"$",
"this",
"->",
"contentDisposition",
... | Sets the Content-Type header.
Based on the contentType, mimeType and fileName. | [
"Sets",
"the",
"Content",
"-",
"Type",
"header",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/parts/file.php#L184-L194 |
21,368 | robbertkl/simplepdf | classes/SimplePdf/Page.php | Page.setMargins | public function setMargins($marginLeft, $marginRight, $marginTop, $marginBottom)
{
$this->setLeftMargin($marginLeft);
$this->setRightMargin($marginRight);
$this->setTopMargin($marginTop);
$this->setBottomMargin($marginBottom);
return $this;
} | php | public function setMargins($marginLeft, $marginRight, $marginTop, $marginBottom)
{
$this->setLeftMargin($marginLeft);
$this->setRightMargin($marginRight);
$this->setTopMargin($marginTop);
$this->setBottomMargin($marginBottom);
return $this;
} | [
"public",
"function",
"setMargins",
"(",
"$",
"marginLeft",
",",
"$",
"marginRight",
",",
"$",
"marginTop",
",",
"$",
"marginBottom",
")",
"{",
"$",
"this",
"->",
"setLeftMargin",
"(",
"$",
"marginLeft",
")",
";",
"$",
"this",
"->",
"setRightMargin",
"(",
... | Set new margin, in the given units
@param float $marginLeft new left margin, in the given units
@param float $marginRight new right margin, in the given units
@param float $marginTop new top margin, in the given units
@param float $marginBottom new bottom margin, in the given units
@return \SimplePdf\Page this page | [
"Set",
"new",
"margin",
"in",
"the",
"given",
"units"
] | f19cea8d4e52fe76d4fa447b411514dee688adbc | https://github.com/robbertkl/simplepdf/blob/f19cea8d4e52fe76d4fa447b411514dee688adbc/classes/SimplePdf/Page.php#L326-L333 |
21,369 | robbertkl/simplepdf | classes/SimplePdf/Page.php | Page.setFont | public function setFont(\ZendPdf\Resource\Font\AbstractFont $font, $fontSize = null)
{
if (is_null($fontSize)) {
$fontSize = $this->getFontSize();
}
return parent::setFont($font, $fontSize);
} | php | public function setFont(\ZendPdf\Resource\Font\AbstractFont $font, $fontSize = null)
{
if (is_null($fontSize)) {
$fontSize = $this->getFontSize();
}
return parent::setFont($font, $fontSize);
} | [
"public",
"function",
"setFont",
"(",
"\\",
"ZendPdf",
"\\",
"Resource",
"\\",
"Font",
"\\",
"AbstractFont",
"$",
"font",
",",
"$",
"fontSize",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"fontSize",
")",
")",
"{",
"$",
"fontSize",
"=",
"$... | Sets a new font family and, optionally, a new font size as well
@param \ZendPdf\Resource\Font\AbstractFont $font font object to use
@param float $fontSize new font size, leave it out to keep the current font size | [
"Sets",
"a",
"new",
"font",
"family",
"and",
"optionally",
"a",
"new",
"font",
"size",
"as",
"well"
] | f19cea8d4e52fe76d4fa447b411514dee688adbc | https://github.com/robbertkl/simplepdf/blob/f19cea8d4e52fe76d4fa447b411514dee688adbc/classes/SimplePdf/Page.php#L373-L380 |
21,370 | robbertkl/simplepdf | classes/SimplePdf/Page.php | Page.wordWrapText | public function wordWrapText($text, $wrapWidth)
{
$wrappedText = '';
foreach (explode(PHP_EOL, $text) as $line) {
$words = explode(' ', $line);
$currentLine = array_shift($words);
while (count($words) > 0) {
$word = array_shift($words);
... | php | public function wordWrapText($text, $wrapWidth)
{
$wrappedText = '';
foreach (explode(PHP_EOL, $text) as $line) {
$words = explode(' ', $line);
$currentLine = array_shift($words);
while (count($words) > 0) {
$word = array_shift($words);
... | [
"public",
"function",
"wordWrapText",
"(",
"$",
"text",
",",
"$",
"wrapWidth",
")",
"{",
"$",
"wrappedText",
"=",
"''",
";",
"foreach",
"(",
"explode",
"(",
"PHP_EOL",
",",
"$",
"text",
")",
"as",
"$",
"line",
")",
"{",
"$",
"words",
"=",
"explode",
... | Word-wrap a text to a certain width, using the current font properties
@param string $text text to wrap (can already contain some newlines)
@param string $wrapWidth width (in the given units) to wrap the text to
@return string the same text but with newlines inserted at the specified $wrapWidth | [
"Word",
"-",
"wrap",
"a",
"text",
"to",
"a",
"certain",
"width",
"using",
"the",
"current",
"font",
"properties"
] | f19cea8d4e52fe76d4fa447b411514dee688adbc | https://github.com/robbertkl/simplepdf/blob/f19cea8d4e52fe76d4fa447b411514dee688adbc/classes/SimplePdf/Page.php#L433-L451 |
21,371 | heidelpay/PhpDoc | src/phpDocumentor/Plugin/Core/Transformer/Writer/Sourcecode.php | Sourcecode.transform | public function transform(ProjectDescriptor $project, Transformation $transformation)
{
$artifact = $transformation->getTransformer()->getTarget()
. DIRECTORY_SEPARATOR
. ($transformation->getArtifact()
? $transformation->getArtifact()
: 'source');
... | php | public function transform(ProjectDescriptor $project, Transformation $transformation)
{
$artifact = $transformation->getTransformer()->getTarget()
. DIRECTORY_SEPARATOR
. ($transformation->getArtifact()
? $transformation->getArtifact()
: 'source');
... | [
"public",
"function",
"transform",
"(",
"ProjectDescriptor",
"$",
"project",
",",
"Transformation",
"$",
"transformation",
")",
"{",
"$",
"artifact",
"=",
"$",
"transformation",
"->",
"getTransformer",
"(",
")",
"->",
"getTarget",
"(",
")",
".",
"DIRECTORY_SEPAR... | This method writes every source code entry in the structure file to a highlighted file.
@param ProjectDescriptor $project Document containing the structure.
@param Transformation $transformation Transformation to execute.
@return void | [
"This",
"method",
"writes",
"every",
"source",
"code",
"entry",
"in",
"the",
"structure",
"file",
"to",
"a",
"highlighted",
"file",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Plugin/Core/Transformer/Writer/Sourcecode.php#L32-L103 |
21,372 | david-mk/mail-map | src/MailMap/Mail.php | Mail.setHeaderAttributes | private function setHeaderAttributes(array $mailHeader)
{
$mailHeader = array_filter($mailHeader, function ($property) {
return property_exists($this, $property);
}, ARRAY_FILTER_USE_KEY);
foreach ($mailHeader as $property => $header) {
$this->{$property} = $header;
... | php | private function setHeaderAttributes(array $mailHeader)
{
$mailHeader = array_filter($mailHeader, function ($property) {
return property_exists($this, $property);
}, ARRAY_FILTER_USE_KEY);
foreach ($mailHeader as $property => $header) {
$this->{$property} = $header;
... | [
"private",
"function",
"setHeaderAttributes",
"(",
"array",
"$",
"mailHeader",
")",
"{",
"$",
"mailHeader",
"=",
"array_filter",
"(",
"$",
"mailHeader",
",",
"function",
"(",
"$",
"property",
")",
"{",
"return",
"property_exists",
"(",
"$",
"this",
",",
"$",... | Set attributes on email from header
@param array $mailHeader
@return void | [
"Set",
"attributes",
"on",
"email",
"from",
"header"
] | 4eea346ece9fa35c0d309b5a909f657ad83e1e6a | https://github.com/david-mk/mail-map/blob/4eea346ece9fa35c0d309b5a909f657ad83e1e6a/src/MailMap/Mail.php#L173-L182 |
21,373 | david-mk/mail-map | src/MailMap/Mail.php | Mail.header | public function header($key, $default = null)
{
if (array_key_exists($key, $this->headers)) {
return $this->headers[$key];
}
return $default;
} | php | public function header($key, $default = null)
{
if (array_key_exists($key, $this->headers)) {
return $this->headers[$key];
}
return $default;
} | [
"public",
"function",
"header",
"(",
"$",
"key",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"key",
",",
"$",
"this",
"->",
"headers",
")",
")",
"{",
"return",
"$",
"this",
"->",
"headers",
"[",
"$",
"key",
... | Get a header value. Return given default if none found
@param string $key
@param mixed $default
@return mixed | [
"Get",
"a",
"header",
"value",
".",
"Return",
"given",
"default",
"if",
"none",
"found"
] | 4eea346ece9fa35c0d309b5a909f657ad83e1e6a | https://github.com/david-mk/mail-map/blob/4eea346ece9fa35c0d309b5a909f657ad83e1e6a/src/MailMap/Mail.php#L201-L208 |
21,374 | david-mk/mail-map | src/MailMap/Mail.php | Mail.body | public function body($mimeType = 'html')
{
$body = [];
foreach ($this->body as $part) {
if ($part->mime_type === $mimeType) {
$body[] = $part->body;
}
}
return implode(static::partSeparator($mimeType), $body);
} | php | public function body($mimeType = 'html')
{
$body = [];
foreach ($this->body as $part) {
if ($part->mime_type === $mimeType) {
$body[] = $part->body;
}
}
return implode(static::partSeparator($mimeType), $body);
} | [
"public",
"function",
"body",
"(",
"$",
"mimeType",
"=",
"'html'",
")",
"{",
"$",
"body",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"body",
"as",
"$",
"part",
")",
"{",
"if",
"(",
"$",
"part",
"->",
"mime_type",
"===",
"$",
"mimeType... | Render the email body as the given mime-type
@param string $mimeType
@return string | [
"Render",
"the",
"email",
"body",
"as",
"the",
"given",
"mime",
"-",
"type"
] | 4eea346ece9fa35c0d309b5a909f657ad83e1e6a | https://github.com/david-mk/mail-map/blob/4eea346ece9fa35c0d309b5a909f657ad83e1e6a/src/MailMap/Mail.php#L216-L227 |
21,375 | ekuiter/feature-php | FeaturePhp/Artifact/TracingLinkRenderer.php | TracingLinkRenderer._render | public function _render($textOnly) {
$tracingLinkNum = count($this->tracingLinks);
$str = "";
if ($textOnly) {
$str .= "\nFeature Traceability\n====================\n" .
"The following $tracingLinkNum tracing links were found:\n\n";
$maxLen = fphp\Helper... | php | public function _render($textOnly) {
$tracingLinkNum = count($this->tracingLinks);
$str = "";
if ($textOnly) {
$str .= "\nFeature Traceability\n====================\n" .
"The following $tracingLinkNum tracing links were found:\n\n";
$maxLen = fphp\Helper... | [
"public",
"function",
"_render",
"(",
"$",
"textOnly",
")",
"{",
"$",
"tracingLinkNum",
"=",
"count",
"(",
"$",
"this",
"->",
"tracingLinks",
")",
";",
"$",
"str",
"=",
"\"\"",
";",
"if",
"(",
"$",
"textOnly",
")",
"{",
"$",
"str",
".=",
"\"\\nFeatur... | Returns the tracing link analysis.
@param bool $textOnly whether to render text or HTML
@return string | [
"Returns",
"the",
"tracing",
"link",
"analysis",
"."
] | daf4a59098802fedcfd1f1a1d07847fcf2fea7bf | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Artifact/TracingLinkRenderer.php#L33-L55 |
21,376 | ekuiter/feature-php | FeaturePhp/Artifact/TracingLinkRenderer.php | TracingLinkRenderer.analyzeTracingLink | private function analyzeTracingLink($tracingLink, $textOnly = false, $maxLen = 0) {
$maxLen += strlen($this->defaultColor);
if ($textOnly)
return sprintf("$this->accentColor%-{$maxLen}s %s\n%{$maxLen}s %s\n",
$tracingLink->getFeatureName() . "$this->defaul... | php | private function analyzeTracingLink($tracingLink, $textOnly = false, $maxLen = 0) {
$maxLen += strlen($this->defaultColor);
if ($textOnly)
return sprintf("$this->accentColor%-{$maxLen}s %s\n%{$maxLen}s %s\n",
$tracingLink->getFeatureName() . "$this->defaul... | [
"private",
"function",
"analyzeTracingLink",
"(",
"$",
"tracingLink",
",",
"$",
"textOnly",
"=",
"false",
",",
"$",
"maxLen",
"=",
"0",
")",
"{",
"$",
"maxLen",
"+=",
"strlen",
"(",
"$",
"this",
"->",
"defaultColor",
")",
";",
"if",
"(",
"$",
"textOnly... | Analyzes a single tracing link.
@param TracingLink $tracingLink
@param bool $textOnly whether to render text or HTML
@param int $maxLen
@return string | [
"Analyzes",
"a",
"single",
"tracing",
"link",
"."
] | daf4a59098802fedcfd1f1a1d07847fcf2fea7bf | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Artifact/TracingLinkRenderer.php#L64-L78 |
21,377 | shabbyrobe/amiss | bin/commands/migrate-notes.php | LegacyParser.parse | public function parse($string)
{
global $matchedNotes;
$keyPrefixLen = $this->keyPrefix ? strlen($this->keyPrefix) : 0;
$data = array();
$toDelete = [];
$lines = preg_split('@\n@', $string, null, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_OFFSET_CAPTURE);
foreach ($l... | php | public function parse($string)
{
global $matchedNotes;
$keyPrefixLen = $this->keyPrefix ? strlen($this->keyPrefix) : 0;
$data = array();
$toDelete = [];
$lines = preg_split('@\n@', $string, null, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_OFFSET_CAPTURE);
foreach ($l... | [
"public",
"function",
"parse",
"(",
"$",
"string",
")",
"{",
"global",
"$",
"matchedNotes",
";",
"$",
"keyPrefixLen",
"=",
"$",
"this",
"->",
"keyPrefix",
"?",
"strlen",
"(",
"$",
"this",
"->",
"keyPrefix",
")",
":",
"0",
";",
"$",
"data",
"=",
"arra... | will do for now, but it's definitely one to revisit. | [
"will",
"do",
"for",
"now",
"but",
"it",
"s",
"definitely",
"one",
"to",
"revisit",
"."
] | ba261f0d1f985ed36e9fd2903ac0df86c5b9498d | https://github.com/shabbyrobe/amiss/blob/ba261f0d1f985ed36e9fd2903ac0df86c5b9498d/bin/commands/migrate-notes.php#L504-L583 |
21,378 | NuclearCMS/Hierarchy | src/NodeType.php | NodeType.addField | public function addField(array $attributes)
{
$field = $this->fields()->create($attributes);
$this->save();
return $field;
} | php | public function addField(array $attributes)
{
$field = $this->fields()->create($attributes);
$this->save();
return $field;
} | [
"public",
"function",
"addField",
"(",
"array",
"$",
"attributes",
")",
"{",
"$",
"field",
"=",
"$",
"this",
"->",
"fields",
"(",
")",
"->",
"create",
"(",
"$",
"attributes",
")",
";",
"$",
"this",
"->",
"save",
"(",
")",
";",
"return",
"$",
"field... | Add a field to the node type
@param array $attributes
@return Eloquent | [
"Add",
"a",
"field",
"to",
"the",
"node",
"type"
] | 535171c5e2db72265313fd2110aec8456e46f459 | https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/NodeType.php#L120-L127 |
21,379 | wplibs/rules | src/Builder.php | Builder.offsetGet | public function offsetGet( $name ) {
if ( ! array_key_exists( $name, $this->variables ) ) {
$this->variables[ $name ] = new Variable( $name );
}
return $this->variables[ $name ];
} | php | public function offsetGet( $name ) {
if ( ! array_key_exists( $name, $this->variables ) ) {
$this->variables[ $name ] = new Variable( $name );
}
return $this->variables[ $name ];
} | [
"public",
"function",
"offsetGet",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"variables",
")",
")",
"{",
"$",
"this",
"->",
"variables",
"[",
"$",
"name",
"]",
"=",
"new",
"Variable",
... | Retrieve a variable by name.
@param string $name
@return Variable | [
"Retrieve",
"a",
"variable",
"by",
"name",
"."
] | 29b4495e2ae87349fd64fcd844f3ba96cc268e3d | https://github.com/wplibs/rules/blob/29b4495e2ae87349fd64fcd844f3ba96cc268e3d/src/Builder.php#L72-L78 |
21,380 | heidelpay/PhpDoc | src/phpDocumentor/Descriptor/Cache/ProjectDescriptorMapper.php | ProjectDescriptorMapper.garbageCollect | public function garbageCollect(Collection $collection)
{
$projectRoot = $collection->getProjectRoot();
$filenames = $collection->getFilenames();
foreach ($filenames as &$name) {
// the cache key contains a path relative to the project root; here we expect absolute paths.
... | php | public function garbageCollect(Collection $collection)
{
$projectRoot = $collection->getProjectRoot();
$filenames = $collection->getFilenames();
foreach ($filenames as &$name) {
// the cache key contains a path relative to the project root; here we expect absolute paths.
... | [
"public",
"function",
"garbageCollect",
"(",
"Collection",
"$",
"collection",
")",
"{",
"$",
"projectRoot",
"=",
"$",
"collection",
"->",
"getProjectRoot",
"(",
")",
";",
"$",
"filenames",
"=",
"$",
"collection",
"->",
"getFilenames",
"(",
")",
";",
"foreach... | Removes all files in cache that do not occur in the given FileSet Collection.
@param Collection $collection
@return void | [
"Removes",
"all",
"files",
"in",
"cache",
"that",
"do",
"not",
"occur",
"in",
"the",
"given",
"FileSet",
"Collection",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Descriptor/Cache/ProjectDescriptorMapper.php#L163-L184 |
21,381 | qlake/framework | src/Qlake/Routing/Router.php | Router.addRoute | protected function addRoute($methods, $uri, $action)
{
$route = $this->createRoute($methods, $uri, $action);
$route->setPrefixUri($this->processGroupsUri());
$this->routes->addRoute($route);
return $route;
} | php | protected function addRoute($methods, $uri, $action)
{
$route = $this->createRoute($methods, $uri, $action);
$route->setPrefixUri($this->processGroupsUri());
$this->routes->addRoute($route);
return $route;
} | [
"protected",
"function",
"addRoute",
"(",
"$",
"methods",
",",
"$",
"uri",
",",
"$",
"action",
")",
"{",
"$",
"route",
"=",
"$",
"this",
"->",
"createRoute",
"(",
"$",
"methods",
",",
"$",
"uri",
",",
"$",
"action",
")",
";",
"$",
"route",
"->",
... | Create and register a route
@param array $methods
@param string $uri
@param Closure|string $action
@return Qlake\Routing\Route | [
"Create",
"and",
"register",
"a",
"route"
] | 0b7bad459ae0721bc5cdd141344f9dfc1acee28a | https://github.com/qlake/framework/blob/0b7bad459ae0721bc5cdd141344f9dfc1acee28a/src/Qlake/Routing/Router.php#L231-L240 |
21,382 | qlake/framework | src/Qlake/Routing/Router.php | Router.match | public function match(Request $request)
{
foreach ($this->routes->filterByMethod($request->getMethod()) as $route)
{
if ($route->isMatch($request->getPathInfo()))
{
return $route;
}
}
return null;
} | php | public function match(Request $request)
{
foreach ($this->routes->filterByMethod($request->getMethod()) as $route)
{
if ($route->isMatch($request->getPathInfo()))
{
return $route;
}
}
return null;
} | [
"public",
"function",
"match",
"(",
"Request",
"$",
"request",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"routes",
"->",
"filterByMethod",
"(",
"$",
"request",
"->",
"getMethod",
"(",
")",
")",
"as",
"$",
"route",
")",
"{",
"if",
"(",
"$",
"route"... | Chack matching requested uri by registered routes.
@param Qlake\Http\Request $request
@return Qlake\Routing\Route|null | [
"Chack",
"matching",
"requested",
"uri",
"by",
"registered",
"routes",
"."
] | 0b7bad459ae0721bc5cdd141344f9dfc1acee28a | https://github.com/qlake/framework/blob/0b7bad459ae0721bc5cdd141344f9dfc1acee28a/src/Qlake/Routing/Router.php#L287-L298 |
21,383 | thelia-modules/CustomerGroup | Model/Map/CustomerGroupI18nTableMap.php | CustomerGroupI18nTableMap.doDelete | public static function doDelete($values, ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(CustomerGroupI18nTableMap::DATABASE_NAME);
}
if ($values instanceof Criteria) {
// rename for clarity
... | php | public static function doDelete($values, ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(CustomerGroupI18nTableMap::DATABASE_NAME);
}
if ($values instanceof Criteria) {
// rename for clarity
... | [
"public",
"static",
"function",
"doDelete",
"(",
"$",
"values",
",",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"con",
")",
"{",
"$",
"con",
"=",
"Propel",
"::",
"getServiceContainer",
"(",
")",
"->",
"getW... | Performs a DELETE on the database, given a CustomerGroupI18n or Criteria object OR a primary key value.
@param mixed $values Criteria or CustomerGroupI18n object or primary key or array of primary keys
which is used to create the DELETE statement
@param ConnectionInterface $con the connection to use
@ret... | [
"Performs",
"a",
"DELETE",
"on",
"the",
"database",
"given",
"a",
"CustomerGroupI18n",
"or",
"Criteria",
"object",
"OR",
"a",
"primary",
"key",
"value",
"."
] | 672cc64c686812f6a95cf0d702111f93d8c0e850 | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Map/CustomerGroupI18nTableMap.php#L391-L427 |
21,384 | mustardandrew/muan-laravel-acl | src/Models/UserObserver.php | UserObserver.created | public function created($user)
{
if (! $baseName = $user->baseRole) {
return;
}
// Attach base role
if (method_exists($user, 'attachRole')) {
$user->attachRole($baseName);
}
} | php | public function created($user)
{
if (! $baseName = $user->baseRole) {
return;
}
// Attach base role
if (method_exists($user, 'attachRole')) {
$user->attachRole($baseName);
}
} | [
"public",
"function",
"created",
"(",
"$",
"user",
")",
"{",
"if",
"(",
"!",
"$",
"baseName",
"=",
"$",
"user",
"->",
"baseRole",
")",
"{",
"return",
";",
"}",
"// Attach base role",
"if",
"(",
"method_exists",
"(",
"$",
"user",
",",
"'attachRole'",
")... | Listen to the User created event.
@param object $user
@return void | [
"Listen",
"to",
"the",
"User",
"created",
"event",
"."
] | b5f23340b5536babb98d9fd0d727a7a3371c97d5 | https://github.com/mustardandrew/muan-laravel-acl/blob/b5f23340b5536babb98d9fd0d727a7a3371c97d5/src/Models/UserObserver.php#L19-L29 |
21,385 | Rxnet/rabbitmq | Queue.php | Queue.get | public function get($queue, $noAck = false): Observable
{
$promise = $this->channel->get($queue, $noAck);
return Observable::fromPromise($promise)
->map(function (BaseMessage $message) {
return new Message($this->channel, $message);
});
} | php | public function get($queue, $noAck = false): Observable
{
$promise = $this->channel->get($queue, $noAck);
return Observable::fromPromise($promise)
->map(function (BaseMessage $message) {
return new Message($this->channel, $message);
});
} | [
"public",
"function",
"get",
"(",
"$",
"queue",
",",
"$",
"noAck",
"=",
"false",
")",
":",
"Observable",
"{",
"$",
"promise",
"=",
"$",
"this",
"->",
"channel",
"->",
"get",
"(",
"$",
"queue",
",",
"$",
"noAck",
")",
";",
"return",
"Observable",
":... | Pop one element from the queue. | [
"Pop",
"one",
"element",
"from",
"the",
"queue",
"."
] | 16e2fa39daddb6cca70716b8895470c4691a6f9e | https://github.com/Rxnet/rabbitmq/blob/16e2fa39daddb6cca70716b8895470c4691a6f9e/Queue.php#L118-L126 |
21,386 | oroinc/OroLayoutComponent | Loader/Driver/AbstractDriver.php | AbstractDriver.getCacheFilename | protected function getCacheFilename($name)
{
$class = substr($this->generateClassName($name), strlen(static::CLASS_PREFIX));
return str_replace(
'/',
DIRECTORY_SEPARATOR,
sprintf(
'%s/%s/%s/%s.php',
$this->getCacheDir(),
... | php | protected function getCacheFilename($name)
{
$class = substr($this->generateClassName($name), strlen(static::CLASS_PREFIX));
return str_replace(
'/',
DIRECTORY_SEPARATOR,
sprintf(
'%s/%s/%s/%s.php',
$this->getCacheDir(),
... | [
"protected",
"function",
"getCacheFilename",
"(",
"$",
"name",
")",
"{",
"$",
"class",
"=",
"substr",
"(",
"$",
"this",
"->",
"generateClassName",
"(",
"$",
"name",
")",
",",
"strlen",
"(",
"static",
"::",
"CLASS_PREFIX",
")",
")",
";",
"return",
"str_re... | Generates PHP filename based on given resource name
@param string $name Resource filename
@return bool|string Returns FALSE if cache dir isn't configured or generated PHP absolute filename otherwise | [
"Generates",
"PHP",
"filename",
"based",
"on",
"given",
"resource",
"name"
] | 682a96672393d81c63728e47c4a4c3618c515be0 | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/Loader/Driver/AbstractDriver.php#L174-L189 |
21,387 | GrupaZero/api | src/Gzero/Api/Controller/Admin/UserController.php | UserController.index | public function index()
{
$this->authorize('readList', User::class);
$input = $this->validator->validate('list');
$params = $this->processor->process($input)->getProcessedFields();
$results = $this->userRepo->getUsers(
$params['filter'],
$params['orderBy'],... | php | public function index()
{
$this->authorize('readList', User::class);
$input = $this->validator->validate('list');
$params = $this->processor->process($input)->getProcessedFields();
$results = $this->userRepo->getUsers(
$params['filter'],
$params['orderBy'],... | [
"public",
"function",
"index",
"(",
")",
"{",
"$",
"this",
"->",
"authorize",
"(",
"'readList'",
",",
"User",
"::",
"class",
")",
";",
"$",
"input",
"=",
"$",
"this",
"->",
"validator",
"->",
"validate",
"(",
"'list'",
")",
";",
"$",
"params",
"=",
... | Display list of users
@return \Illuminate\Http\JsonResponse | [
"Display",
"list",
"of",
"users"
] | fc544bb6057274e9d5e7b617346c3f854ea5effd | https://github.com/GrupaZero/api/blob/fc544bb6057274e9d5e7b617346c3f854ea5effd/src/Gzero/Api/Controller/Admin/UserController.php#L54-L66 |
21,388 | Baachi/CouchDB | src/CouchDB/Database.php | Database.find | public function find($id)
{
$response = $this->client->request('GET', sprintf('/%s/%s', $this->name, $id));
$json = (string) $response->getBody();
if (404 === $response->getStatusCode()) {
throw new Exception('Document does not exist');
}
return JSONEncoder::dec... | php | public function find($id)
{
$response = $this->client->request('GET', sprintf('/%s/%s', $this->name, $id));
$json = (string) $response->getBody();
if (404 === $response->getStatusCode()) {
throw new Exception('Document does not exist');
}
return JSONEncoder::dec... | [
"public",
"function",
"find",
"(",
"$",
"id",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"client",
"->",
"request",
"(",
"'GET'",
",",
"sprintf",
"(",
"'/%s/%s'",
",",
"$",
"this",
"->",
"name",
",",
"$",
"id",
")",
")",
";",
"$",
"json",... | Find a document by a id.
@param string $id
@throws Exception If the document doesn't exists.
@return mixed | [
"Find",
"a",
"document",
"by",
"a",
"id",
"."
] | 6be364c2f3d9c7b1288b1c11115469c91819ff5c | https://github.com/Baachi/CouchDB/blob/6be364c2f3d9c7b1288b1c11115469c91819ff5c/src/CouchDB/Database.php#L60-L70 |
21,389 | Baachi/CouchDB | src/CouchDB/Database.php | Database.findAll | public function findAll($limit = null, $startKey = null)
{
$path = "/{$this->name}/_all_docs?include_docs=true";
if (null !== $limit) {
$path .= '&limit='.(integer) $limit;
}
if (null !== $startKey) {
$path .= '&startkey='.(string) $startKey;
}
... | php | public function findAll($limit = null, $startKey = null)
{
$path = "/{$this->name}/_all_docs?include_docs=true";
if (null !== $limit) {
$path .= '&limit='.(integer) $limit;
}
if (null !== $startKey) {
$path .= '&startkey='.(string) $startKey;
}
... | [
"public",
"function",
"findAll",
"(",
"$",
"limit",
"=",
"null",
",",
"$",
"startKey",
"=",
"null",
")",
"{",
"$",
"path",
"=",
"\"/{$this->name}/_all_docs?include_docs=true\"",
";",
"if",
"(",
"null",
"!==",
"$",
"limit",
")",
"{",
"$",
"path",
".=",
"'... | Find all documents from the database.
@param int|null $limit
@param string|null $startKey
@return mixed | [
"Find",
"all",
"documents",
"from",
"the",
"database",
"."
] | 6be364c2f3d9c7b1288b1c11115469c91819ff5c | https://github.com/Baachi/CouchDB/blob/6be364c2f3d9c7b1288b1c11115469c91819ff5c/src/CouchDB/Database.php#L80-L95 |
21,390 | Baachi/CouchDB | src/CouchDB/Database.php | Database.findDocuments | public function findDocuments(array $ids, $limit = null, $offset = null)
{
$path = "/{$this->name}/_all_docs?include_docs=true";
if (null !== $limit) {
$path .= '&limit='.(integer) $limit;
}
if (null !== $offset) {
$path .= '&skip='.(integer) $offset;
... | php | public function findDocuments(array $ids, $limit = null, $offset = null)
{
$path = "/{$this->name}/_all_docs?include_docs=true";
if (null !== $limit) {
$path .= '&limit='.(integer) $limit;
}
if (null !== $offset) {
$path .= '&skip='.(integer) $offset;
... | [
"public",
"function",
"findDocuments",
"(",
"array",
"$",
"ids",
",",
"$",
"limit",
"=",
"null",
",",
"$",
"offset",
"=",
"null",
")",
"{",
"$",
"path",
"=",
"\"/{$this->name}/_all_docs?include_docs=true\"",
";",
"if",
"(",
"null",
"!==",
"$",
"limit",
")"... | Find a documents by a id.
@param array $ids
@param null|int $limit
@param null|int $offset
@return array|null | [
"Find",
"a",
"documents",
"by",
"a",
"id",
"."
] | 6be364c2f3d9c7b1288b1c11115469c91819ff5c | https://github.com/Baachi/CouchDB/blob/6be364c2f3d9c7b1288b1c11115469c91819ff5c/src/CouchDB/Database.php#L106-L123 |
21,391 | Baachi/CouchDB | src/CouchDB/Database.php | Database.insert | public function insert(array &$doc)
{
if (isset($doc['_id'])) {
$clone = $doc;
unset($clone['_id']);
$response = $this->client->request('PUT', "/{$this->name}/{$doc['_id']}", [
'body' => JSONEncoder::encode($clone),
'headers' => ['Conte... | php | public function insert(array &$doc)
{
if (isset($doc['_id'])) {
$clone = $doc;
unset($clone['_id']);
$response = $this->client->request('PUT', "/{$this->name}/{$doc['_id']}", [
'body' => JSONEncoder::encode($clone),
'headers' => ['Conte... | [
"public",
"function",
"insert",
"(",
"array",
"&",
"$",
"doc",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"doc",
"[",
"'_id'",
"]",
")",
")",
"{",
"$",
"clone",
"=",
"$",
"doc",
";",
"unset",
"(",
"$",
"clone",
"[",
"'_id'",
"]",
")",
";",
"$",
... | Insert a new document.
@param array $doc
@deprecated To update a document use Database::update, it will be removed in version 2
@throws Exception | [
"Insert",
"a",
"new",
"document",
"."
] | 6be364c2f3d9c7b1288b1c11115469c91819ff5c | https://github.com/Baachi/CouchDB/blob/6be364c2f3d9c7b1288b1c11115469c91819ff5c/src/CouchDB/Database.php#L134-L159 |
21,392 | Baachi/CouchDB | src/CouchDB/Database.php | Database.update | public function update($id, array &$doc)
{
$json = JSONEncoder::encode($doc);
$response = $this->client->request('PUT', "/{$this->name}/{$id}", [
'body' => $json,
'headers' => ['Content-Type' => 'application/json'],
]);
if (201 !== $response->getStatusCod... | php | public function update($id, array &$doc)
{
$json = JSONEncoder::encode($doc);
$response = $this->client->request('PUT', "/{$this->name}/{$id}", [
'body' => $json,
'headers' => ['Content-Type' => 'application/json'],
]);
if (201 !== $response->getStatusCod... | [
"public",
"function",
"update",
"(",
"$",
"id",
",",
"array",
"&",
"$",
"doc",
")",
"{",
"$",
"json",
"=",
"JSONEncoder",
"::",
"encode",
"(",
"$",
"doc",
")",
";",
"$",
"response",
"=",
"$",
"this",
"->",
"client",
"->",
"request",
"(",
"'PUT'",
... | Updates a document.
@param string $id The id from the document
@param array $doc A reference from the document
@throws Exception | [
"Updates",
"a",
"document",
"."
] | 6be364c2f3d9c7b1288b1c11115469c91819ff5c | https://github.com/Baachi/CouchDB/blob/6be364c2f3d9c7b1288b1c11115469c91819ff5c/src/CouchDB/Database.php#L169-L186 |
21,393 | Baachi/CouchDB | src/CouchDB/Database.php | Database.getInfo | public function getInfo()
{
$json = (string) $this->client->request('GET', "/{$this->name}/")->getBody();
return JSONEncoder::decode($json);
} | php | public function getInfo()
{
$json = (string) $this->client->request('GET', "/{$this->name}/")->getBody();
return JSONEncoder::decode($json);
} | [
"public",
"function",
"getInfo",
"(",
")",
"{",
"$",
"json",
"=",
"(",
"string",
")",
"$",
"this",
"->",
"client",
"->",
"request",
"(",
"'GET'",
",",
"\"/{$this->name}/\"",
")",
"->",
"getBody",
"(",
")",
";",
"return",
"JSONEncoder",
"::",
"decode",
... | Return the database informations.
@return array | [
"Return",
"the",
"database",
"informations",
"."
] | 6be364c2f3d9c7b1288b1c11115469c91819ff5c | https://github.com/Baachi/CouchDB/blob/6be364c2f3d9c7b1288b1c11115469c91819ff5c/src/CouchDB/Database.php#L224-L229 |
21,394 | Baachi/CouchDB | src/CouchDB/Database.php | Database.getChanges | public function getChanges()
{
$response = $this->client->request('GET', "/{$this->name}/_changes");
if (200 !== $response->getStatusCode()) {
throw new Exception('Request wasn\'t successfull');
}
return JSONEncoder::decode((string) $response->getBody());
} | php | public function getChanges()
{
$response = $this->client->request('GET', "/{$this->name}/_changes");
if (200 !== $response->getStatusCode()) {
throw new Exception('Request wasn\'t successfull');
}
return JSONEncoder::decode((string) $response->getBody());
} | [
"public",
"function",
"getChanges",
"(",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"client",
"->",
"request",
"(",
"'GET'",
",",
"\"/{$this->name}/_changes\"",
")",
";",
"if",
"(",
"200",
"!==",
"$",
"response",
"->",
"getStatusCode",
"(",
")",
... | Return informations about the last changes from the database.
@throws \RuntimeException If the request was not successfull
@return array | [
"Return",
"informations",
"about",
"the",
"last",
"changes",
"from",
"the",
"database",
"."
] | 6be364c2f3d9c7b1288b1c11115469c91819ff5c | https://github.com/Baachi/CouchDB/blob/6be364c2f3d9c7b1288b1c11115469c91819ff5c/src/CouchDB/Database.php#L238-L247 |
21,395 | canax/database-query-builder | src/DatabaseQueryBuilder/DatabaseQueryBuilder.php | DatabaseQueryBuilder.setDefaultsFromConfiguration | public function setDefaultsFromConfiguration()
{
if ($this->options['dsn']) {
$dsn = explode(':', $this->options['dsn']);
$this->setSQLDialect($dsn[0]);
}
$this->setTablePrefix($this->options['table_prefix']);
} | php | public function setDefaultsFromConfiguration()
{
if ($this->options['dsn']) {
$dsn = explode(':', $this->options['dsn']);
$this->setSQLDialect($dsn[0]);
}
$this->setTablePrefix($this->options['table_prefix']);
} | [
"public",
"function",
"setDefaultsFromConfiguration",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"options",
"[",
"'dsn'",
"]",
")",
"{",
"$",
"dsn",
"=",
"explode",
"(",
"':'",
",",
"$",
"this",
"->",
"options",
"[",
"'dsn'",
"]",
")",
";",
"$",
... | Update builder settings from active configuration.
@return void | [
"Update",
"builder",
"settings",
"from",
"active",
"configuration",
"."
] | c26a8a1537a8d8c2dcee305167980a57384b4e77 | https://github.com/canax/database-query-builder/blob/c26a8a1537a8d8c2dcee305167980a57384b4e77/src/DatabaseQueryBuilder/DatabaseQueryBuilder.php#L22-L30 |
21,396 | canax/database-query-builder | src/DatabaseQueryBuilder/DatabaseQueryBuilder.php | DatabaseQueryBuilder.execute | public function execute($query = null, array $params = []) : object
{
// When using one argument and its array, assume its $params
if (is_array($query)) {
$params = $query;
$query = null;
}
if (!$query) {
$query = $this->getSQL();
}
... | php | public function execute($query = null, array $params = []) : object
{
// When using one argument and its array, assume its $params
if (is_array($query)) {
$params = $query;
$query = null;
}
if (!$query) {
$query = $this->getSQL();
}
... | [
"public",
"function",
"execute",
"(",
"$",
"query",
"=",
"null",
",",
"array",
"$",
"params",
"=",
"[",
"]",
")",
":",
"object",
"{",
"// When using one argument and its array, assume its $params",
"if",
"(",
"is_array",
"(",
"$",
"query",
")",
")",
"{",
"$"... | Execute a SQL-query.
@param string|null|array $query the SQL statement (or $params)
@param array $params the params array
@return self | [
"Execute",
"a",
"SQL",
"-",
"query",
"."
] | c26a8a1537a8d8c2dcee305167980a57384b4e77 | https://github.com/canax/database-query-builder/blob/c26a8a1537a8d8c2dcee305167980a57384b4e77/src/DatabaseQueryBuilder/DatabaseQueryBuilder.php#L42-L55 |
21,397 | tigron/skeleton-file | migration/20160503_215547_restruct_datastore.php | Migration_20160503_215547_Restruct_datastore.get_old_path | private function get_old_path(File $file) {
if (Config::$store_dir === null AND Config::$file_dir === null) {
throw new \Exception('Set a path first in "Config::$file_dir"');
}
$subpath = substr(base_convert($file->md5sum, 16, 10), 0, 3);
$subpath = implode('/', str_split($subpath)) . '/';
if (\Skeleton\F... | php | private function get_old_path(File $file) {
if (Config::$store_dir === null AND Config::$file_dir === null) {
throw new \Exception('Set a path first in "Config::$file_dir"');
}
$subpath = substr(base_convert($file->md5sum, 16, 10), 0, 3);
$subpath = implode('/', str_split($subpath)) . '/';
if (\Skeleton\F... | [
"private",
"function",
"get_old_path",
"(",
"File",
"$",
"file",
")",
"{",
"if",
"(",
"Config",
"::",
"$",
"store_dir",
"===",
"null",
"AND",
"Config",
"::",
"$",
"file_dir",
"===",
"null",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"'Set a path f... | Get the old path
@access private
@param string $md5sum
@return string $path | [
"Get",
"the",
"old",
"path"
] | 97978d49f179f07c76380ddc8919b8a7d56dee61 | https://github.com/tigron/skeleton-file/blob/97978d49f179f07c76380ddc8919b8a7d56dee61/migration/20160503_215547_restruct_datastore.php#L55-L69 |
21,398 | surebert/surebert-framework | src/sb/Password/Random.php | Random.generate | protected function generate()
{
$this->password = '';
$chars = range('a', 'z');
$symbols = Array('*', '&', '^', '%', '$', '#', '@', '!');
$chars = array_merge($chars, $symbols);
//get rid of l and o as they can be confused with 1 and 0
unset($chars[11]);
... | php | protected function generate()
{
$this->password = '';
$chars = range('a', 'z');
$symbols = Array('*', '&', '^', '%', '$', '#', '@', '!');
$chars = array_merge($chars, $symbols);
//get rid of l and o as they can be confused with 1 and 0
unset($chars[11]);
... | [
"protected",
"function",
"generate",
"(",
")",
"{",
"$",
"this",
"->",
"password",
"=",
"''",
";",
"$",
"chars",
"=",
"range",
"(",
"'a'",
",",
"'z'",
")",
";",
"$",
"symbols",
"=",
"Array",
"(",
"'*'",
",",
"'&'",
",",
"'^'",
",",
"'%'",
",",
... | Generates the password randomly | [
"Generates",
"the",
"password",
"randomly"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Password/Random.php#L58-L95 |
21,399 | surebert/surebert-framework | src/sb/Password/Random.php | Random.randomlyCapitalize | protected function randomlyCapitalize()
{
$chars = str_split($this->password);
$letter_positions = Array();
foreach ($chars as $key => $char) {
if (!is_numeric($char)) {
$letter_positions[] = $key;
}
}
$random_letter = $letter_positio... | php | protected function randomlyCapitalize()
{
$chars = str_split($this->password);
$letter_positions = Array();
foreach ($chars as $key => $char) {
if (!is_numeric($char)) {
$letter_positions[] = $key;
}
}
$random_letter = $letter_positio... | [
"protected",
"function",
"randomlyCapitalize",
"(",
")",
"{",
"$",
"chars",
"=",
"str_split",
"(",
"$",
"this",
"->",
"password",
")",
";",
"$",
"letter_positions",
"=",
"Array",
"(",
")",
";",
"foreach",
"(",
"$",
"chars",
"as",
"$",
"key",
"=>",
"$",... | Randomly capitalize one of the letters in the password | [
"Randomly",
"capitalize",
"one",
"of",
"the",
"letters",
"in",
"the",
"password"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Password/Random.php#L100-L116 |
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.