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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
16,200 | Graphiques-Digitale/silverstripe-seo-metadata | code/SEO_Metadata_SiteTree_DataExtension.php | SEO_Metadata_SiteTree_DataExtension.MarkupMeta | public function MarkupMeta($name, $content, $encode = null)
{
if ($encode !== null) {
return '<meta name="' . $name . '" content="' . $this->encodeContent($content, $encode) . '" />' . PHP_EOL;
} else {
return '<meta name="' . $name . '" content="' . $content . '" />' . PHP_E... | php | public function MarkupMeta($name, $content, $encode = null)
{
if ($encode !== null) {
return '<meta name="' . $name . '" content="' . $this->encodeContent($content, $encode) . '" />' . PHP_EOL;
} else {
return '<meta name="' . $name . '" content="' . $content . '" />' . PHP_E... | [
"public",
"function",
"MarkupMeta",
"(",
"$",
"name",
",",
"$",
"content",
",",
"$",
"encode",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"encode",
"!==",
"null",
")",
"{",
"return",
"'<meta name=\"'",
".",
"$",
"name",
".",
"'\" content=\"'",
".",
"$",
... | Returns markup for a HTML meta element. Can be flagged for encoding.
@param string $name
@param string $content
@param string|null $encode
@return string | [
"Returns",
"markup",
"for",
"a",
"HTML",
"meta",
"element",
".",
"Can",
"be",
"flagged",
"for",
"encoding",
"."
] | f92128688a60b6c6b514b6efb1486ac60f4a8e03 | https://github.com/Graphiques-Digitale/silverstripe-seo-metadata/blob/f92128688a60b6c6b514b6efb1486ac60f4a8e03/code/SEO_Metadata_SiteTree_DataExtension.php#L174-L181 |
16,201 | Graphiques-Digitale/silverstripe-seo-metadata | code/SEO_Metadata_SiteTree_DataExtension.php | SEO_Metadata_SiteTree_DataExtension.MarkupLink | public function MarkupLink($rel, $href, $type = null, $sizes = null)
{
// start fragment
$return = '<link rel="' . $rel . '" href="' . $href . '"';
// if type
if ($type !== null) {
$return .= ' type="' . $type . '"';
}
// if sizes
if ($sizes !== nu... | php | public function MarkupLink($rel, $href, $type = null, $sizes = null)
{
// start fragment
$return = '<link rel="' . $rel . '" href="' . $href . '"';
// if type
if ($type !== null) {
$return .= ' type="' . $type . '"';
}
// if sizes
if ($sizes !== nu... | [
"public",
"function",
"MarkupLink",
"(",
"$",
"rel",
",",
"$",
"href",
",",
"$",
"type",
"=",
"null",
",",
"$",
"sizes",
"=",
"null",
")",
"{",
"// start fragment",
"$",
"return",
"=",
"'<link rel=\"'",
".",
"$",
"rel",
".",
"'\" href=\"'",
".",
"$",
... | Returns markup for a HTML link element.
@param string $rel
@param string $href
@param string|null $type
@param string|null $sizes
@return string | [
"Returns",
"markup",
"for",
"a",
"HTML",
"link",
"element",
"."
] | f92128688a60b6c6b514b6efb1486ac60f4a8e03 | https://github.com/Graphiques-Digitale/silverstripe-seo-metadata/blob/f92128688a60b6c6b514b6efb1486ac60f4a8e03/code/SEO_Metadata_SiteTree_DataExtension.php#L193-L209 |
16,202 | Graphiques-Digitale/silverstripe-seo-metadata | code/SEO_Metadata_SiteTree_DataExtension.php | SEO_Metadata_SiteTree_DataExtension.GenerateDescription | public function GenerateDescription()
{
if ($this->owner->MetaDescription) {
return $this->owner->MetaDescription;
} else {
return $this->owner->GenerateDescriptionFromContent();
}
} | php | public function GenerateDescription()
{
if ($this->owner->MetaDescription) {
return $this->owner->MetaDescription;
} else {
return $this->owner->GenerateDescriptionFromContent();
}
} | [
"public",
"function",
"GenerateDescription",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"owner",
"->",
"MetaDescription",
")",
"{",
"return",
"$",
"this",
"->",
"owner",
"->",
"MetaDescription",
";",
"}",
"else",
"{",
"return",
"$",
"this",
"->",
"owne... | Generates description from the page `MetaDescription`, or the first paragraph of the `Content` attribute.
@return string|null | [
"Generates",
"description",
"from",
"the",
"page",
"MetaDescription",
"or",
"the",
"first",
"paragraph",
"of",
"the",
"Content",
"attribute",
"."
] | f92128688a60b6c6b514b6efb1486ac60f4a8e03 | https://github.com/Graphiques-Digitale/silverstripe-seo-metadata/blob/f92128688a60b6c6b514b6efb1486ac60f4a8e03/code/SEO_Metadata_SiteTree_DataExtension.php#L234-L241 |
16,203 | Graphiques-Digitale/silverstripe-seo-metadata | code/SEO_Metadata_SiteTree_DataExtension.php | SEO_Metadata_SiteTree_DataExtension.GenerateDescriptionFromContent | public function GenerateDescriptionFromContent()
{
// check for content
if ($content = trim($this->owner->Content)) {
// pillage first paragraph from page content
if (preg_match('/<p>(.*?)<\/p>/i', $content, $match)) {
// is HTML
$content = $ma... | php | public function GenerateDescriptionFromContent()
{
// check for content
if ($content = trim($this->owner->Content)) {
// pillage first paragraph from page content
if (preg_match('/<p>(.*?)<\/p>/i', $content, $match)) {
// is HTML
$content = $ma... | [
"public",
"function",
"GenerateDescriptionFromContent",
"(",
")",
"{",
"// check for content",
"if",
"(",
"$",
"content",
"=",
"trim",
"(",
"$",
"this",
"->",
"owner",
"->",
"Content",
")",
")",
"{",
"// pillage first paragraph from page content",
"if",
"(",
"preg... | Generates description from the first paragraph of the `Content` attribute.
@return string|null | [
"Generates",
"description",
"from",
"the",
"first",
"paragraph",
"of",
"the",
"Content",
"attribute",
"."
] | f92128688a60b6c6b514b6efb1486ac60f4a8e03 | https://github.com/Graphiques-Digitale/silverstripe-seo-metadata/blob/f92128688a60b6c6b514b6efb1486ac60f4a8e03/code/SEO_Metadata_SiteTree_DataExtension.php#L248-L266 |
16,204 | Graphiques-Digitale/silverstripe-seo-metadata | code/SEO_Metadata_SiteTree_DataExtension.php | SEO_Metadata_SiteTree_DataExtension.GenerateExtraMeta | public function GenerateExtraMeta()
{
if ($this->owner->ExtraMeta) {
return $this->owner->ExtraMeta . PHP_EOL;
} else {
return $this->owner->MarkupComment('none');
}
} | php | public function GenerateExtraMeta()
{
if ($this->owner->ExtraMeta) {
return $this->owner->ExtraMeta . PHP_EOL;
} else {
return $this->owner->MarkupComment('none');
}
} | [
"public",
"function",
"GenerateExtraMeta",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"owner",
"->",
"ExtraMeta",
")",
"{",
"return",
"$",
"this",
"->",
"owner",
"->",
"ExtraMeta",
".",
"PHP_EOL",
";",
"}",
"else",
"{",
"return",
"$",
"this",
"->",
... | Generates extra metadata.
@return string | [
"Generates",
"extra",
"metadata",
"."
] | f92128688a60b6c6b514b6efb1486ac60f4a8e03 | https://github.com/Graphiques-Digitale/silverstripe-seo-metadata/blob/f92128688a60b6c6b514b6efb1486ac60f4a8e03/code/SEO_Metadata_SiteTree_DataExtension.php#L273-L280 |
16,205 | FrenchFrogs/framework | src/Ruler/Page/Page.php | Page.isCurrent | public function isCurrent()
{
$link = $this->getLink();
if ($link{0} == '/') {
$link = substr($link, 1);
}
return request()->is($link);
} | php | public function isCurrent()
{
$link = $this->getLink();
if ($link{0} == '/') {
$link = substr($link, 1);
}
return request()->is($link);
} | [
"public",
"function",
"isCurrent",
"(",
")",
"{",
"$",
"link",
"=",
"$",
"this",
"->",
"getLink",
"(",
")",
";",
"if",
"(",
"$",
"link",
"{",
"0",
"}",
"==",
"'/'",
")",
"{",
"$",
"link",
"=",
"substr",
"(",
"$",
"link",
",",
"1",
")",
";",
... | Return TRUE if the current page is this page
@return bool | [
"Return",
"TRUE",
"if",
"the",
"current",
"page",
"is",
"this",
"page"
] | a4838c698a5600437e87dac6d35ba8ebe32c4395 | https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Ruler/Page/Page.php#L338-L346 |
16,206 | readdle/fqdb | src/Readdle/Database/FQDBQueryAPI.php | FQDBQueryAPI.queryArray | private function queryArray($query, $options, $fetcher)
{
$statement = $this->_runQuery($query, $options);
$result = call_user_func($fetcher, $statement);
return is_array($result) ? $result : [];
} | php | private function queryArray($query, $options, $fetcher)
{
$statement = $this->_runQuery($query, $options);
$result = call_user_func($fetcher, $statement);
return is_array($result) ? $result : [];
} | [
"private",
"function",
"queryArray",
"(",
"$",
"query",
",",
"$",
"options",
",",
"$",
"fetcher",
")",
"{",
"$",
"statement",
"=",
"$",
"this",
"->",
"_runQuery",
"(",
"$",
"query",
",",
"$",
"options",
")",
";",
"$",
"result",
"=",
"call_user_func",
... | executes SELECT or SHOW query and returns result array
@param string $query
@param array $options
@param callable $fetcher
@return array | [
"executes",
"SELECT",
"or",
"SHOW",
"query",
"and",
"returns",
"result",
"array"
] | 4ef2e8f3343a7c8fbb309c243be502a160c42083 | https://github.com/readdle/fqdb/blob/4ef2e8f3343a7c8fbb309c243be502a160c42083/src/Readdle/Database/FQDBQueryAPI.php#L34-L39 |
16,207 | readdle/fqdb | src/Readdle/Database/FQDBQueryAPI.php | FQDBQueryAPI.queryValue | public function queryValue($query, $options = array())
{
$statement = $this->_runQuery($query, $options);
return $statement->fetch(\PDO::FETCH_COLUMN);
} | php | public function queryValue($query, $options = array())
{
$statement = $this->_runQuery($query, $options);
return $statement->fetch(\PDO::FETCH_COLUMN);
} | [
"public",
"function",
"queryValue",
"(",
"$",
"query",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"statement",
"=",
"$",
"this",
"->",
"_runQuery",
"(",
"$",
"query",
",",
"$",
"options",
")",
";",
"return",
"$",
"statement",
"->",
... | executes SELECT or SHOW query and returns 1st returned element
@param string $query
@param array $options
@return string|false | [
"executes",
"SELECT",
"or",
"SHOW",
"query",
"and",
"returns",
"1st",
"returned",
"element"
] | 4ef2e8f3343a7c8fbb309c243be502a160c42083 | https://github.com/readdle/fqdb/blob/4ef2e8f3343a7c8fbb309c243be502a160c42083/src/Readdle/Database/FQDBQueryAPI.php#L47-L51 |
16,208 | readdle/fqdb | src/Readdle/Database/FQDBQueryAPI.php | FQDBQueryAPI.queryAssoc | public function queryAssoc($query, $options = array())
{
$statement = $this->_runQuery($query, $options);
return $statement->fetch(\PDO::FETCH_ASSOC);
} | php | public function queryAssoc($query, $options = array())
{
$statement = $this->_runQuery($query, $options);
return $statement->fetch(\PDO::FETCH_ASSOC);
} | [
"public",
"function",
"queryAssoc",
"(",
"$",
"query",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"statement",
"=",
"$",
"this",
"->",
"_runQuery",
"(",
"$",
"query",
",",
"$",
"options",
")",
";",
"return",
"$",
"statement",
"->",
... | executes SELECT or SHOW query and returns 1st row as assoc array
@param string $query
@param array $options
@return array|false | [
"executes",
"SELECT",
"or",
"SHOW",
"query",
"and",
"returns",
"1st",
"row",
"as",
"assoc",
"array"
] | 4ef2e8f3343a7c8fbb309c243be502a160c42083 | https://github.com/readdle/fqdb/blob/4ef2e8f3343a7c8fbb309c243be502a160c42083/src/Readdle/Database/FQDBQueryAPI.php#L59-L63 |
16,209 | readdle/fqdb | src/Readdle/Database/FQDBQueryAPI.php | FQDBQueryAPI.queryList | public function queryList($query, $options = array())
{
$statement = $this->_runQuery($query, $options);
return $statement->fetch(\PDO::FETCH_NUM);
} | php | public function queryList($query, $options = array())
{
$statement = $this->_runQuery($query, $options);
return $statement->fetch(\PDO::FETCH_NUM);
} | [
"public",
"function",
"queryList",
"(",
"$",
"query",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"statement",
"=",
"$",
"this",
"->",
"_runQuery",
"(",
"$",
"query",
",",
"$",
"options",
")",
";",
"return",
"$",
"statement",
"->",
... | executes SELECT or SHOW query and returns as array
@param string $query
@param array $options
@return array|false | [
"executes",
"SELECT",
"or",
"SHOW",
"query",
"and",
"returns",
"as",
"array"
] | 4ef2e8f3343a7c8fbb309c243be502a160c42083 | https://github.com/readdle/fqdb/blob/4ef2e8f3343a7c8fbb309c243be502a160c42083/src/Readdle/Database/FQDBQueryAPI.php#L71-L75 |
16,210 | readdle/fqdb | src/Readdle/Database/FQDBQueryAPI.php | FQDBQueryAPI.queryVector | public function queryVector($query, $options = array())
{
return $this->queryArray($query, $options,
function(\PDOStatement $statement) { return $statement->fetchAll(\PDO::FETCH_COLUMN, 0); });
} | php | public function queryVector($query, $options = array())
{
return $this->queryArray($query, $options,
function(\PDOStatement $statement) { return $statement->fetchAll(\PDO::FETCH_COLUMN, 0); });
} | [
"public",
"function",
"queryVector",
"(",
"$",
"query",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"queryArray",
"(",
"$",
"query",
",",
"$",
"options",
",",
"function",
"(",
"\\",
"PDOStatement",
"$",
"statemen... | executes SELECT or SHOW query and returns result as array
@param string $query
@param array $options
@return array | [
"executes",
"SELECT",
"or",
"SHOW",
"query",
"and",
"returns",
"result",
"as",
"array"
] | 4ef2e8f3343a7c8fbb309c243be502a160c42083 | https://github.com/readdle/fqdb/blob/4ef2e8f3343a7c8fbb309c243be502a160c42083/src/Readdle/Database/FQDBQueryAPI.php#L85-L90 |
16,211 | readdle/fqdb | src/Readdle/Database/FQDBQueryAPI.php | FQDBQueryAPI.queryTable | public function queryTable($query, $options = array())
{
return $this->queryArray($query, $options,
function(\PDOStatement $statement) { return $statement->fetchAll(\PDO::FETCH_ASSOC); }
);
} | php | public function queryTable($query, $options = array())
{
return $this->queryArray($query, $options,
function(\PDOStatement $statement) { return $statement->fetchAll(\PDO::FETCH_ASSOC); }
);
} | [
"public",
"function",
"queryTable",
"(",
"$",
"query",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"queryArray",
"(",
"$",
"query",
",",
"$",
"options",
",",
"function",
"(",
"\\",
"PDOStatement",
"$",
"statement... | executes SELECT or SHOW query and returns result as assoc array
@param string $query
@param array $options
@return array | [
"executes",
"SELECT",
"or",
"SHOW",
"query",
"and",
"returns",
"result",
"as",
"assoc",
"array"
] | 4ef2e8f3343a7c8fbb309c243be502a160c42083 | https://github.com/readdle/fqdb/blob/4ef2e8f3343a7c8fbb309c243be502a160c42083/src/Readdle/Database/FQDBQueryAPI.php#L98-L103 |
16,212 | readdle/fqdb | src/Readdle/Database/FQDBQueryAPI.php | FQDBQueryAPI.queryObjArray | public function queryObjArray($query, $className, $options = array(), $classConstructorArguments = NULL)
{
if (!class_exists($className)) {
$this->_error(FQDBException::CLASS_NOT_EXIST, FQDBException::FQDB_CODE);
}
return $this->queryArray($query, $options,
function(... | php | public function queryObjArray($query, $className, $options = array(), $classConstructorArguments = NULL)
{
if (!class_exists($className)) {
$this->_error(FQDBException::CLASS_NOT_EXIST, FQDBException::FQDB_CODE);
}
return $this->queryArray($query, $options,
function(... | [
"public",
"function",
"queryObjArray",
"(",
"$",
"query",
",",
"$",
"className",
",",
"$",
"options",
"=",
"array",
"(",
")",
",",
"$",
"classConstructorArguments",
"=",
"NULL",
")",
"{",
"if",
"(",
"!",
"class_exists",
"(",
"$",
"className",
")",
")",
... | executes SELECT or SHOW query and returns result as array of objects of given class
@param string $query
@param string $className
@param array $options
@param array $classConstructorArguments
@return array | [
"executes",
"SELECT",
"or",
"SHOW",
"query",
"and",
"returns",
"result",
"as",
"array",
"of",
"objects",
"of",
"given",
"class"
] | 4ef2e8f3343a7c8fbb309c243be502a160c42083 | https://github.com/readdle/fqdb/blob/4ef2e8f3343a7c8fbb309c243be502a160c42083/src/Readdle/Database/FQDBQueryAPI.php#L113-L125 |
16,213 | readdle/fqdb | src/Readdle/Database/FQDBQueryAPI.php | FQDBQueryAPI.queryObj | public function queryObj($query, $className, $options = array(), $classConstructorArguments = NULL)
{
if (!class_exists($className)) {
$this->_error(FQDBException::CLASS_NOT_EXIST, FQDBException::FQDB_CODE);
}
$statement = $this->_runQuery($query, $options);
$statement->... | php | public function queryObj($query, $className, $options = array(), $classConstructorArguments = NULL)
{
if (!class_exists($className)) {
$this->_error(FQDBException::CLASS_NOT_EXIST, FQDBException::FQDB_CODE);
}
$statement = $this->_runQuery($query, $options);
$statement->... | [
"public",
"function",
"queryObj",
"(",
"$",
"query",
",",
"$",
"className",
",",
"$",
"options",
"=",
"array",
"(",
")",
",",
"$",
"classConstructorArguments",
"=",
"NULL",
")",
"{",
"if",
"(",
"!",
"class_exists",
"(",
"$",
"className",
")",
")",
"{",... | executes SELECT or SHOW query and returns object of given class
@param string $query
@param string $className
@param array $options
@param array $classConstructorArguments
@return object|false | [
"executes",
"SELECT",
"or",
"SHOW",
"query",
"and",
"returns",
"object",
"of",
"given",
"class"
] | 4ef2e8f3343a7c8fbb309c243be502a160c42083 | https://github.com/readdle/fqdb/blob/4ef2e8f3343a7c8fbb309c243be502a160c42083/src/Readdle/Database/FQDBQueryAPI.php#L136-L146 |
16,214 | readdle/fqdb | src/Readdle/Database/FQDBQueryAPI.php | FQDBQueryAPI.queryTableCallback | public function queryTableCallback($query, $options = [], $callback)
{
if(!is_callable($callback)) {
$this->_error(FQDBException::NOT_CALLABLE_ERROR, FQDBException::FQDB_CODE);
}
$statement = $this->_runQuery($query, $options);
while ($row = $statement->fetch(\PDO::FETCH_... | php | public function queryTableCallback($query, $options = [], $callback)
{
if(!is_callable($callback)) {
$this->_error(FQDBException::NOT_CALLABLE_ERROR, FQDBException::FQDB_CODE);
}
$statement = $this->_runQuery($query, $options);
while ($row = $statement->fetch(\PDO::FETCH_... | [
"public",
"function",
"queryTableCallback",
"(",
"$",
"query",
",",
"$",
"options",
"=",
"[",
"]",
",",
"$",
"callback",
")",
"{",
"if",
"(",
"!",
"is_callable",
"(",
"$",
"callback",
")",
")",
"{",
"$",
"this",
"->",
"_error",
"(",
"FQDBException",
... | Execute query and apply a callback function to each row
@param string $query
@param array $options
@param callable $callback
@return boolean | [
"Execute",
"query",
"and",
"apply",
"a",
"callback",
"function",
"to",
"each",
"row"
] | 4ef2e8f3343a7c8fbb309c243be502a160c42083 | https://github.com/readdle/fqdb/blob/4ef2e8f3343a7c8fbb309c243be502a160c42083/src/Readdle/Database/FQDBQueryAPI.php#L156-L166 |
16,215 | readdle/fqdb | src/Readdle/Database/FQDBQueryAPI.php | FQDBQueryAPI.queryTableGenerator | public function queryTableGenerator($query, $options = [])
{
$statement = $this->_runQuery($query, $options);
while ($row = $statement->fetch(\PDO::FETCH_ASSOC)) {
yield $row;
}
} | php | public function queryTableGenerator($query, $options = [])
{
$statement = $this->_runQuery($query, $options);
while ($row = $statement->fetch(\PDO::FETCH_ASSOC)) {
yield $row;
}
} | [
"public",
"function",
"queryTableGenerator",
"(",
"$",
"query",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"statement",
"=",
"$",
"this",
"->",
"_runQuery",
"(",
"$",
"query",
",",
"$",
"options",
")",
";",
"while",
"(",
"$",
"row",
"=",
"$... | Execute a query and makes generator from the result
@param $query
@param array $options
@return \Generator | [
"Execute",
"a",
"query",
"and",
"makes",
"generator",
"from",
"the",
"result"
] | 4ef2e8f3343a7c8fbb309c243be502a160c42083 | https://github.com/readdle/fqdb/blob/4ef2e8f3343a7c8fbb309c243be502a160c42083/src/Readdle/Database/FQDBQueryAPI.php#L175-L181 |
16,216 | readdle/fqdb | src/Readdle/Database/FQDBQueryAPI.php | FQDBQueryAPI.queryHash | public function queryHash($query, $options = array())
{
return $this->queryArray(
$query,
$options,
function(\PDOStatement $statement) {
return $statement->fetchAll(\PDO::FETCH_KEY_PAIR);
}
);
} | php | public function queryHash($query, $options = array())
{
return $this->queryArray(
$query,
$options,
function(\PDOStatement $statement) {
return $statement->fetchAll(\PDO::FETCH_KEY_PAIR);
}
);
} | [
"public",
"function",
"queryHash",
"(",
"$",
"query",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"queryArray",
"(",
"$",
"query",
",",
"$",
"options",
",",
"function",
"(",
"\\",
"PDOStatement",
"$",
"statement"... | executes SELECT or SHOW query and returns an assoc array made of two-columns
where the first column is a key and the second column is the value
@param $query
@param array $options
@return array | [
"executes",
"SELECT",
"or",
"SHOW",
"query",
"and",
"returns",
"an",
"assoc",
"array",
"made",
"of",
"two",
"-",
"columns",
"where",
"the",
"first",
"column",
"is",
"a",
"key",
"and",
"the",
"second",
"column",
"is",
"the",
"value"
] | 4ef2e8f3343a7c8fbb309c243be502a160c42083 | https://github.com/readdle/fqdb/blob/4ef2e8f3343a7c8fbb309c243be502a160c42083/src/Readdle/Database/FQDBQueryAPI.php#L190-L199 |
16,217 | comodojo/dispatcher.framework | src/Comodojo/Dispatcher/Router/Parser.php | Parser.read | public function read($folders = array(), Route $value = null, $regex = '') {
if (is_null($value)) {
$value = new Route();
}
// if the first 'folder' is empty is removed
while (!empty($folders) && empty($folders[0])) {
array_shift($folders);
}
... | php | public function read($folders = array(), Route $value = null, $regex = '') {
if (is_null($value)) {
$value = new Route();
}
// if the first 'folder' is empty is removed
while (!empty($folders) && empty($folders[0])) {
array_shift($folders);
}
... | [
"public",
"function",
"read",
"(",
"$",
"folders",
"=",
"array",
"(",
")",
",",
"Route",
"$",
"value",
"=",
"null",
",",
"$",
"regex",
"=",
"''",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"value",
")",
")",
"{",
"$",
"value",
"=",
"new",
"Route... | the global regular expression against which all the request URI will be compared | [
"the",
"global",
"regular",
"expression",
"against",
"which",
"all",
"the",
"request",
"URI",
"will",
"be",
"compared"
] | 5093297dcb7441a8d8f79cbb2429c93232e16d1c | https://github.com/comodojo/dispatcher.framework/blob/5093297dcb7441a8d8f79cbb2429c93232e16d1c/src/Comodojo/Dispatcher/Router/Parser.php#L37-L122 |
16,218 | comodojo/dispatcher.framework | src/Comodojo/Dispatcher/Router/Parser.php | Parser.param | private function param($key, $string, $value) {
$field_required = false;
// If the field name ends with a '*', the parameter is considered as required
if (preg_match('/^(.+)\*$/', $key, $bits)) {
$key = $bits[1];
$field_required = true;
}
// The $valu... | php | private function param($key, $string, $value) {
$field_required = false;
// If the field name ends with a '*', the parameter is considered as required
if (preg_match('/^(.+)\*$/', $key, $bits)) {
$key = $bits[1];
$field_required = true;
}
// The $valu... | [
"private",
"function",
"param",
"(",
"$",
"key",
",",
"$",
"string",
",",
"$",
"value",
")",
"{",
"$",
"field_required",
"=",
"false",
";",
"// If the field name ends with a '*', the parameter is considered as required",
"if",
"(",
"preg_match",
"(",
"'/^(.+)\\*$/'",
... | This method read a single parameter and build the regular expression | [
"This",
"method",
"read",
"a",
"single",
"parameter",
"and",
"build",
"the",
"regular",
"expression"
] | 5093297dcb7441a8d8f79cbb2429c93232e16d1c | https://github.com/comodojo/dispatcher.framework/blob/5093297dcb7441a8d8f79cbb2429c93232e16d1c/src/Comodojo/Dispatcher/Router/Parser.php#L125-L163 |
16,219 | bfitech/zapcore | dev/RouterDev.php | RouterDev.reset | public static function reset() {
$_SERVER['REQUEST_URI'] = '/';
$_SERVER['REQUEST_METHOD'] = 'GET';
$_GET = $_POST = $_FILES = $_REQUEST = [];
self::$code = 200;
self::$head = [];
self::$body_raw = null;
self::$body = null;
self::$errno = 0;
self::$data = [];
} | php | public static function reset() {
$_SERVER['REQUEST_URI'] = '/';
$_SERVER['REQUEST_METHOD'] = 'GET';
$_GET = $_POST = $_FILES = $_REQUEST = [];
self::$code = 200;
self::$head = [];
self::$body_raw = null;
self::$body = null;
self::$errno = 0;
self::$data = [];
} | [
"public",
"static",
"function",
"reset",
"(",
")",
"{",
"$",
"_SERVER",
"[",
"'REQUEST_URI'",
"]",
"=",
"'/'",
";",
"$",
"_SERVER",
"[",
"'REQUEST_METHOD'",
"]",
"=",
"'GET'",
";",
"$",
"_GET",
"=",
"$",
"_POST",
"=",
"$",
"_FILES",
"=",
"$",
"_REQUE... | Reset fake HTTP variables and properties. | [
"Reset",
"fake",
"HTTP",
"variables",
"and",
"properties",
"."
] | 0ae4cb9370876ab3583556bf272063685ec57948 | https://github.com/bfitech/zapcore/blob/0ae4cb9370876ab3583556bf272063685ec57948/dev/RouterDev.php#L35-L45 |
16,220 | bfitech/zapcore | dev/RouterDev.php | RouterDev.override_callback_args | public function override_callback_args(array $args=[]) {
foreach ($args as $key => $val) {
if (!in_array($key, [
'get', 'post', 'files', 'put', 'patch', 'delete',
]))
continue;
self::$override_args[$key] = $val;
}
} | php | public function override_callback_args(array $args=[]) {
foreach ($args as $key => $val) {
if (!in_array($key, [
'get', 'post', 'files', 'put', 'patch', 'delete',
]))
continue;
self::$override_args[$key] = $val;
}
} | [
"public",
"function",
"override_callback_args",
"(",
"array",
"$",
"args",
"=",
"[",
"]",
")",
"{",
"foreach",
"(",
"$",
"args",
"as",
"$",
"key",
"=>",
"$",
"val",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"key",
",",
"[",
"'get'",
",",
"'... | Overrides callback args.
Use this in case you want to manipulate collected HTTP
variables without actually changing the entire route.
@param array $args Dict of HTTP variables for overriding
existing args. Key must be one or more of: 'get',
'post', 'files', 'put', 'patch', 'delete'. Invalid
keys are ignored. | [
"Overrides",
"callback",
"args",
"."
] | 0ae4cb9370876ab3583556bf272063685ec57948 | https://github.com/bfitech/zapcore/blob/0ae4cb9370876ab3583556bf272063685ec57948/dev/RouterDev.php#L133-L141 |
16,221 | bfitech/zapcore | dev/RouterDev.php | RouterDev.abort_custom | public function abort_custom(int $code) {
self::$code = $code;
static::$body_raw = "ERROR: $code";
self::$body = "ERROR: $code";
self::$errno = $code;
self::$data = [];
} | php | public function abort_custom(int $code) {
self::$code = $code;
static::$body_raw = "ERROR: $code";
self::$body = "ERROR: $code";
self::$errno = $code;
self::$data = [];
} | [
"public",
"function",
"abort_custom",
"(",
"int",
"$",
"code",
")",
"{",
"self",
"::",
"$",
"code",
"=",
"$",
"code",
";",
"static",
"::",
"$",
"body_raw",
"=",
"\"ERROR: $code\"",
";",
"self",
"::",
"$",
"body",
"=",
"\"ERROR: $code\"",
";",
"self",
"... | Custom abort for testing.
@param int $code HTTP error code. | [
"Custom",
"abort",
"for",
"testing",
"."
] | 0ae4cb9370876ab3583556bf272063685ec57948 | https://github.com/bfitech/zapcore/blob/0ae4cb9370876ab3583556bf272063685ec57948/dev/RouterDev.php#L148-L154 |
16,222 | bfitech/zapcore | dev/RouterDev.php | RouterDev.redirect_custom | public function redirect_custom(string $url) {
self::$code = 301;
self::$head = ["Location: $url"];
self::$body_raw = self::$body = "Location: $url";
self::$errno = 0;
self::$data = [$url];
} | php | public function redirect_custom(string $url) {
self::$code = 301;
self::$head = ["Location: $url"];
self::$body_raw = self::$body = "Location: $url";
self::$errno = 0;
self::$data = [$url];
} | [
"public",
"function",
"redirect_custom",
"(",
"string",
"$",
"url",
")",
"{",
"self",
"::",
"$",
"code",
"=",
"301",
";",
"self",
"::",
"$",
"head",
"=",
"[",
"\"Location: $url\"",
"]",
";",
"self",
"::",
"$",
"body_raw",
"=",
"self",
"::",
"$",
"bod... | Custom redirect for testing.
@param string $url Destination URL. | [
"Custom",
"redirect",
"for",
"testing",
"."
] | 0ae4cb9370876ab3583556bf272063685ec57948 | https://github.com/bfitech/zapcore/blob/0ae4cb9370876ab3583556bf272063685ec57948/dev/RouterDev.php#L161-L167 |
16,223 | bfitech/zapcore | dev/RouterDev.php | RouterDev.static_file_custom | public function static_file_custom(
string $path, int $cache=0, $disposition=null
) {
self::reset();
if (file_exists($path)) {
self::$code = 200;
self::$body_raw = file_get_contents($path);
self::$body = "Path: $path";
self::$errno = 0;
self::$data = [$path];
} else {
self::$code = 404;
}
... | php | public function static_file_custom(
string $path, int $cache=0, $disposition=null
) {
self::reset();
if (file_exists($path)) {
self::$code = 200;
self::$body_raw = file_get_contents($path);
self::$body = "Path: $path";
self::$errno = 0;
self::$data = [$path];
} else {
self::$code = 404;
}
... | [
"public",
"function",
"static_file_custom",
"(",
"string",
"$",
"path",
",",
"int",
"$",
"cache",
"=",
"0",
",",
"$",
"disposition",
"=",
"null",
")",
"{",
"self",
"::",
"reset",
"(",
")",
";",
"if",
"(",
"file_exists",
"(",
"$",
"path",
")",
")",
... | Custom static file serving for testing.
@param string $path Absolute path to file.
@param int $cache Cache age in seconds.
@param mixed $disposition If string, use it as
content-disposition in header. If true, infer from basename.
If null, no content-disposition header is sent.
@cond
@SuppressWarnings(PHPMD.UnusedFor... | [
"Custom",
"static",
"file",
"serving",
"for",
"testing",
"."
] | 0ae4cb9370876ab3583556bf272063685ec57948 | https://github.com/bfitech/zapcore/blob/0ae4cb9370876ab3583556bf272063685ec57948/dev/RouterDev.php#L182-L195 |
16,224 | comodojo/dispatcher.framework | src/Comodojo/Dispatcher/Router/Table.php | Table.registerRoute | private function registerRoute($folders, $type, $class = null, array $parameters = []) {
// The values associated with a route are as follows:
// $route = new Route($this->router);
$route = new Route();
$this->updateRoute($route, $type, $class, $parameters);
// $route->setType... | php | private function registerRoute($folders, $type, $class = null, array $parameters = []) {
// The values associated with a route are as follows:
// $route = new Route($this->router);
$route = new Route();
$this->updateRoute($route, $type, $class, $parameters);
// $route->setType... | [
"private",
"function",
"registerRoute",
"(",
"$",
"folders",
",",
"$",
"type",
",",
"$",
"class",
"=",
"null",
",",
"array",
"$",
"parameters",
"=",
"[",
"]",
")",
"{",
"// The values associated with a route are as follows:",
"// $route = new Route($this->router);",
... | This method add a route to the supported list | [
"This",
"method",
"add",
"a",
"route",
"to",
"the",
"supported",
"list"
] | 5093297dcb7441a8d8f79cbb2429c93232e16d1c | https://github.com/comodojo/dispatcher.framework/blob/5093297dcb7441a8d8f79cbb2429c93232e16d1c/src/Comodojo/Dispatcher/Router/Table.php#L206-L227 |
16,225 | bolt/configuration-notices | src/EventListener/ConfigurationNoticesListener.php | ConfigurationNoticesListener.mailConfigCheck | protected function mailConfigCheck()
{
if (!$this->app['config']->get('general/mailoptions') && $this->app['users']->getCurrentuser() && $this->app['users']->isAllowed('files:config')) {
$notice = json_encode([
'severity' => 1,
'notice' => 'The <strong>mail conf... | php | protected function mailConfigCheck()
{
if (!$this->app['config']->get('general/mailoptions') && $this->app['users']->getCurrentuser() && $this->app['users']->isAllowed('files:config')) {
$notice = json_encode([
'severity' => 1,
'notice' => 'The <strong>mail conf... | [
"protected",
"function",
"mailConfigCheck",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"app",
"[",
"'config'",
"]",
"->",
"get",
"(",
"'general/mailoptions'",
")",
"&&",
"$",
"this",
"->",
"app",
"[",
"'users'",
"]",
"->",
"getCurrentuser",
"(",
... | No mail transport has been set. We should gently nudge the user to set
the mail configuration.
@see https://github.com/bolt/bolt/issues/2908 | [
"No",
"mail",
"transport",
"has",
"been",
"set",
".",
"We",
"should",
"gently",
"nudge",
"the",
"user",
"to",
"set",
"the",
"mail",
"configuration",
"."
] | 0e6439f69bf3099bd6ea30288207a3fd2351e404 | https://github.com/bolt/configuration-notices/blob/0e6439f69bf3099bd6ea30288207a3fd2351e404/src/EventListener/ConfigurationNoticesListener.php#L93-L102 |
16,226 | bolt/configuration-notices | src/EventListener/ConfigurationNoticesListener.php | ConfigurationNoticesListener.liveCheck | protected function liveCheck(Request $request)
{
if (!$this->app['debug']) {
return;
}
$host = parse_url($request->getSchemeAndHttpHost());
// If we have an IP-address, we assume it's "dev"
if (filter_var($host['host'], FILTER_VALIDATE_IP) !== false) {
... | php | protected function liveCheck(Request $request)
{
if (!$this->app['debug']) {
return;
}
$host = parse_url($request->getSchemeAndHttpHost());
// If we have an IP-address, we assume it's "dev"
if (filter_var($host['host'], FILTER_VALIDATE_IP) !== false) {
... | [
"protected",
"function",
"liveCheck",
"(",
"Request",
"$",
"request",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"app",
"[",
"'debug'",
"]",
")",
"{",
"return",
";",
"}",
"$",
"host",
"=",
"parse_url",
"(",
"$",
"request",
"->",
"getSchemeAndHttpHost... | Check whether the site is live or not. | [
"Check",
"whether",
"the",
"site",
"is",
"live",
"or",
"not",
"."
] | 0e6439f69bf3099bd6ea30288207a3fd2351e404 | https://github.com/bolt/configuration-notices/blob/0e6439f69bf3099bd6ea30288207a3fd2351e404/src/EventListener/ConfigurationNoticesListener.php#L121-L154 |
16,227 | bolt/configuration-notices | src/EventListener/ConfigurationNoticesListener.php | ConfigurationNoticesListener.writableFolderCheck | protected function writableFolderCheck()
{
$fileName = '/configtester_' . date('Y-m-d-h-i-s') . '.txt';
$fileSystems = [
['name' => 'files', 'folder' => '', 'label' => '<code>files/</code> in the webroot'],
['name' => 'extensions', 'folder' => '', 'label' => '<code>extension... | php | protected function writableFolderCheck()
{
$fileName = '/configtester_' . date('Y-m-d-h-i-s') . '.txt';
$fileSystems = [
['name' => 'files', 'folder' => '', 'label' => '<code>files/</code> in the webroot'],
['name' => 'extensions', 'folder' => '', 'label' => '<code>extension... | [
"protected",
"function",
"writableFolderCheck",
"(",
")",
"{",
"$",
"fileName",
"=",
"'/configtester_'",
".",
"date",
"(",
"'Y-m-d-h-i-s'",
")",
".",
"'.txt'",
";",
"$",
"fileSystems",
"=",
"[",
"[",
"'name'",
"=>",
"'files'",
",",
"'folder'",
"=>",
"''",
... | Check if some common file locations are writable. | [
"Check",
"if",
"some",
"common",
"file",
"locations",
"are",
"writable",
"."
] | 0e6439f69bf3099bd6ea30288207a3fd2351e404 | https://github.com/bolt/configuration-notices/blob/0e6439f69bf3099bd6ea30288207a3fd2351e404/src/EventListener/ConfigurationNoticesListener.php#L242-L269 |
16,228 | bolt/configuration-notices | src/EventListener/ConfigurationNoticesListener.php | ConfigurationNoticesListener.canonicalCheck | protected function canonicalCheck(Request $request)
{
$hostname = strtok($request->getUri(), '?');
$canonical = strtok($this->app['canonical']->getUrl());
if (!empty($canonical) && ($hostname != $canonical)) {
$notice = json_encode([
'severity' => 1,
... | php | protected function canonicalCheck(Request $request)
{
$hostname = strtok($request->getUri(), '?');
$canonical = strtok($this->app['canonical']->getUrl());
if (!empty($canonical) && ($hostname != $canonical)) {
$notice = json_encode([
'severity' => 1,
... | [
"protected",
"function",
"canonicalCheck",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"hostname",
"=",
"strtok",
"(",
"$",
"request",
"->",
"getUri",
"(",
")",
",",
"'?'",
")",
";",
"$",
"canonical",
"=",
"strtok",
"(",
"$",
"this",
"->",
"app",
... | Check if the current url matches the canonical.
@param Request $request | [
"Check",
"if",
"the",
"current",
"url",
"matches",
"the",
"canonical",
"."
] | 0e6439f69bf3099bd6ea30288207a3fd2351e404 | https://github.com/bolt/configuration-notices/blob/0e6439f69bf3099bd6ea30288207a3fd2351e404/src/EventListener/ConfigurationNoticesListener.php#L297-L314 |
16,229 | bolt/configuration-notices | src/EventListener/ConfigurationNoticesListener.php | ConfigurationNoticesListener.maintenanceCheck | protected function maintenanceCheck()
{
if ($this->app['config']->get('general/maintenance_mode', false)) {
$notice = json_encode([
'severity' => 1,
'notice' => "Bolt's <strong>maintenance mode</strong> is enabled. This means that non-authenticated users will no... | php | protected function maintenanceCheck()
{
if ($this->app['config']->get('general/maintenance_mode', false)) {
$notice = json_encode([
'severity' => 1,
'notice' => "Bolt's <strong>maintenance mode</strong> is enabled. This means that non-authenticated users will no... | [
"protected",
"function",
"maintenanceCheck",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"app",
"[",
"'config'",
"]",
"->",
"get",
"(",
"'general/maintenance_mode'",
",",
"false",
")",
")",
"{",
"$",
"notice",
"=",
"json_encode",
"(",
"[",
"'severity'",
... | If the site is in maintenance mode, show this on the dashboard. | [
"If",
"the",
"site",
"is",
"in",
"maintenance",
"mode",
"show",
"this",
"on",
"the",
"dashboard",
"."
] | 0e6439f69bf3099bd6ea30288207a3fd2351e404 | https://github.com/bolt/configuration-notices/blob/0e6439f69bf3099bd6ea30288207a3fd2351e404/src/EventListener/ConfigurationNoticesListener.php#L352-L362 |
16,230 | bolt/configuration-notices | src/EventListener/ConfigurationNoticesListener.php | ConfigurationNoticesListener.changelogCheck | protected function changelogCheck()
{
if (!$this->app['config']->get('general/changelog/enabled', false)) {
return;
}
// Get the number of items in the changelog
$count = $this->app['storage']->getRepository(LogChange::class)->count();
if ($count > $this->logThr... | php | protected function changelogCheck()
{
if (!$this->app['config']->get('general/changelog/enabled', false)) {
return;
}
// Get the number of items in the changelog
$count = $this->app['storage']->getRepository(LogChange::class)->count();
if ($count > $this->logThr... | [
"protected",
"function",
"changelogCheck",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"app",
"[",
"'config'",
"]",
"->",
"get",
"(",
"'general/changelog/enabled'",
",",
"false",
")",
")",
"{",
"return",
";",
"}",
"// Get the number of items in the chang... | Check if Changelog is enabled, and if doesn't contain too many rows. | [
"Check",
"if",
"Changelog",
"is",
"enabled",
"and",
"if",
"doesn",
"t",
"contain",
"too",
"many",
"rows",
"."
] | 0e6439f69bf3099bd6ea30288207a3fd2351e404 | https://github.com/bolt/configuration-notices/blob/0e6439f69bf3099bd6ea30288207a3fd2351e404/src/EventListener/ConfigurationNoticesListener.php#L367-L392 |
16,231 | bolt/configuration-notices | src/EventListener/ConfigurationNoticesListener.php | ConfigurationNoticesListener.systemlogCheck | protected function systemlogCheck()
{
// Get the number of items in the changelog
$count = $this->app['storage']->getRepository(LogSystem::class)->count();
if ($count > $this->logThreshold) {
$message = sprintf(
"Bolt's <strong>systemlog</strong> is enabled, and ... | php | protected function systemlogCheck()
{
// Get the number of items in the changelog
$count = $this->app['storage']->getRepository(LogSystem::class)->count();
if ($count > $this->logThreshold) {
$message = sprintf(
"Bolt's <strong>systemlog</strong> is enabled, and ... | [
"protected",
"function",
"systemlogCheck",
"(",
")",
"{",
"// Get the number of items in the changelog",
"$",
"count",
"=",
"$",
"this",
"->",
"app",
"[",
"'storage'",
"]",
"->",
"getRepository",
"(",
"LogSystem",
"::",
"class",
")",
"->",
"count",
"(",
")",
"... | Check if systemlog doesn't contain too many rows. | [
"Check",
"if",
"systemlog",
"doesn",
"t",
"contain",
"too",
"many",
"rows",
"."
] | 0e6439f69bf3099bd6ea30288207a3fd2351e404 | https://github.com/bolt/configuration-notices/blob/0e6439f69bf3099bd6ea30288207a3fd2351e404/src/EventListener/ConfigurationNoticesListener.php#L397-L418 |
16,232 | bolt/configuration-notices | src/EventListener/ConfigurationNoticesListener.php | ConfigurationNoticesListener.thumbnailConfigCheck | protected function thumbnailConfigCheck()
{
$thumbConfig = $this->app['config']->get('general/thumbnails');
if ((strpos($thumbConfig['notfound_image'] . $thumbConfig['error_image'], '://') === false)) {
$notice = json_encode([
'severity' => 1,
'notice' ... | php | protected function thumbnailConfigCheck()
{
$thumbConfig = $this->app['config']->get('general/thumbnails');
if ((strpos($thumbConfig['notfound_image'] . $thumbConfig['error_image'], '://') === false)) {
$notice = json_encode([
'severity' => 1,
'notice' ... | [
"protected",
"function",
"thumbnailConfigCheck",
"(",
")",
"{",
"$",
"thumbConfig",
"=",
"$",
"this",
"->",
"app",
"[",
"'config'",
"]",
"->",
"get",
"(",
"'general/thumbnails'",
")",
";",
"if",
"(",
"(",
"strpos",
"(",
"$",
"thumbConfig",
"[",
"'notfound_... | Check if the thumbnail config has been updated for 3.3+ . | [
"Check",
"if",
"the",
"thumbnail",
"config",
"has",
"been",
"updated",
"for",
"3",
".",
"3",
"+",
"."
] | 0e6439f69bf3099bd6ea30288207a3fd2351e404 | https://github.com/bolt/configuration-notices/blob/0e6439f69bf3099bd6ea30288207a3fd2351e404/src/EventListener/ConfigurationNoticesListener.php#L423-L435 |
16,233 | FrenchFrogs/framework | src/Table/Column/Strainer/Strainer.php | Strainer.setValue | public function setValue($value)
{
if (isset($this->element)) {
$this->element->setValue($value);
}
return $this;
} | php | public function setValue($value)
{
if (isset($this->element)) {
$this->element->setValue($value);
}
return $this;
} | [
"public",
"function",
"setValue",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"element",
")",
")",
"{",
"$",
"this",
"->",
"element",
"->",
"setValue",
"(",
"$",
"value",
")",
";",
"}",
"return",
"$",
"this",
";",
"}"... | Set value to strainer element
@param $value
@return $this | [
"Set",
"value",
"to",
"strainer",
"element"
] | a4838c698a5600437e87dac6d35ba8ebe32c4395 | https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Table/Column/Strainer/Strainer.php#L148-L156 |
16,234 | PandawanTechnology/neo4j-data-fixtures | src/Loader.php | Loader.loadFromDirectory | public function loadFromDirectory($dir)
{
if (!is_dir($dir)) {
throw new \InvalidArgumentException(sprintf('"%s" does not exist', $dir));
}
$iterator = new \RecursiveIteratorIterator(
new \RecursiveDirectoryIterator($dir, \RecursiveDirectoryIterator::SKIP_DOTS),
... | php | public function loadFromDirectory($dir)
{
if (!is_dir($dir)) {
throw new \InvalidArgumentException(sprintf('"%s" does not exist', $dir));
}
$iterator = new \RecursiveIteratorIterator(
new \RecursiveDirectoryIterator($dir, \RecursiveDirectoryIterator::SKIP_DOTS),
... | [
"public",
"function",
"loadFromDirectory",
"(",
"$",
"dir",
")",
"{",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"dir",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'\"%s\" does not exist'",
",",
"$",
"dir",
")",
")",
"... | Find fixtures classes in a given directory and load them.
@param string $dir Directory to find fixture classes in.
@return array $fixtures Array of loaded fixture object instances. | [
"Find",
"fixtures",
"classes",
"in",
"a",
"given",
"directory",
"and",
"load",
"them",
"."
] | 58701f30f3de9c848308623c5e773aada106a2aa | https://github.com/PandawanTechnology/neo4j-data-fixtures/blob/58701f30f3de9c848308623c5e773aada106a2aa/src/Loader.php#L36-L48 |
16,235 | PandawanTechnology/neo4j-data-fixtures | src/Loader.php | Loader.isTransient | public function isTransient($className)
{
$rc = new \ReflectionClass($className);
if ($rc->isAbstract()) {
return true;
}
$interfaces = class_implements($className);
return !in_array('PandawanTechnology\Neo4jDataFixtures\Neo4jFixtureInterface', $interfaces);
... | php | public function isTransient($className)
{
$rc = new \ReflectionClass($className);
if ($rc->isAbstract()) {
return true;
}
$interfaces = class_implements($className);
return !in_array('PandawanTechnology\Neo4jDataFixtures\Neo4jFixtureInterface', $interfaces);
... | [
"public",
"function",
"isTransient",
"(",
"$",
"className",
")",
"{",
"$",
"rc",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"$",
"className",
")",
";",
"if",
"(",
"$",
"rc",
"->",
"isAbstract",
"(",
")",
")",
"{",
"return",
"true",
";",
"}",
"$",
"i... | Check if a given fixture is transient and should not be considered a data fixtures
class.
@param string $className
@return bool | [
"Check",
"if",
"a",
"given",
"fixture",
"is",
"transient",
"and",
"should",
"not",
"be",
"considered",
"a",
"data",
"fixtures",
"class",
"."
] | 58701f30f3de9c848308623c5e773aada106a2aa | https://github.com/PandawanTechnology/neo4j-data-fixtures/blob/58701f30f3de9c848308623c5e773aada106a2aa/src/Loader.php#L134-L145 |
16,236 | PandawanTechnology/neo4j-data-fixtures | src/Loader.php | Loader.loadFromIterator | private function loadFromIterator(\Iterator $iterator)
{
$includedFiles = [];
foreach ($iterator as $file) {
if (($fileName = $file->getBasename($this->fileExtension)) == $file->getBasename()) {
continue;
}
$sourceFile = realpath($file->getPathNa... | php | private function loadFromIterator(\Iterator $iterator)
{
$includedFiles = [];
foreach ($iterator as $file) {
if (($fileName = $file->getBasename($this->fileExtension)) == $file->getBasename()) {
continue;
}
$sourceFile = realpath($file->getPathNa... | [
"private",
"function",
"loadFromIterator",
"(",
"\\",
"Iterator",
"$",
"iterator",
")",
"{",
"$",
"includedFiles",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"iterator",
"as",
"$",
"file",
")",
"{",
"if",
"(",
"(",
"$",
"fileName",
"=",
"$",
"file",
"-... | Load fixtures from files contained in iterator.
@param \Iterator $iterator Iterator over files from which fixtures should be loaded.
@return Neo4jFixtureInterface[] $fixtures Array of loaded fixture object instances. | [
"Load",
"fixtures",
"from",
"files",
"contained",
"in",
"iterator",
"."
] | 58701f30f3de9c848308623c5e773aada106a2aa | https://github.com/PandawanTechnology/neo4j-data-fixtures/blob/58701f30f3de9c848308623c5e773aada106a2aa/src/Loader.php#L274-L303 |
16,237 | jkribeiro/composer-hydration | src/Composer/ComposerHydrationHandler.php | ComposerHydrationHandler.toUpperCamelCase | public function toUpperCamelCase($string)
{
$string = str_replace(array('-', '_'), ' ', $string);
$string = ucwords(strtolower($string));
$string = str_replace(' ', '', $string);
return $string;
} | php | public function toUpperCamelCase($string)
{
$string = str_replace(array('-', '_'), ' ', $string);
$string = ucwords(strtolower($string));
$string = str_replace(' ', '', $string);
return $string;
} | [
"public",
"function",
"toUpperCamelCase",
"(",
"$",
"string",
")",
"{",
"$",
"string",
"=",
"str_replace",
"(",
"array",
"(",
"'-'",
",",
"'_'",
")",
",",
"' '",
",",
"$",
"string",
")",
";",
"$",
"string",
"=",
"ucwords",
"(",
"strtolower",
"(",
"$"... | Converts a string to upper camel case.
@param string $string
The string to be converted.
@return string
An upper camel case string. | [
"Converts",
"a",
"string",
"to",
"upper",
"camel",
"case",
"."
] | b0dd7e9c4a966f664c2df08b3067c1b6f263e226 | https://github.com/jkribeiro/composer-hydration/blob/b0dd7e9c4a966f664c2df08b3067c1b6f263e226/src/Composer/ComposerHydrationHandler.php#L99-L106 |
16,238 | jkribeiro/composer-hydration | src/Composer/ComposerHydrationHandler.php | ComposerHydrationHandler.getMagicVariableValue | public function getMagicVariableValue($variable)
{
$base_path_name = basename(realpath("."));
switch ($variable) {
case self::MAGIC_VAR_BASENAME:
return $base_path_name;
break;
case self::MAGIC_VAR_UCFIRST_BASENAME:
return ucf... | php | public function getMagicVariableValue($variable)
{
$base_path_name = basename(realpath("."));
switch ($variable) {
case self::MAGIC_VAR_BASENAME:
return $base_path_name;
break;
case self::MAGIC_VAR_UCFIRST_BASENAME:
return ucf... | [
"public",
"function",
"getMagicVariableValue",
"(",
"$",
"variable",
")",
"{",
"$",
"base_path_name",
"=",
"basename",
"(",
"realpath",
"(",
"\".\"",
")",
")",
";",
"switch",
"(",
"$",
"variable",
")",
"{",
"case",
"self",
"::",
"MAGIC_VAR_BASENAME",
":",
... | Returns the magic value of a magic variable.
@return string
The magic value. | [
"Returns",
"the",
"magic",
"value",
"of",
"a",
"magic",
"variable",
"."
] | b0dd7e9c4a966f664c2df08b3067c1b6f263e226 | https://github.com/jkribeiro/composer-hydration/blob/b0dd7e9c4a966f664c2df08b3067c1b6f263e226/src/Composer/ComposerHydrationHandler.php#L130-L153 |
16,239 | jkribeiro/composer-hydration | src/Composer/ComposerHydrationHandler.php | ComposerHydrationHandler.getReplaceValuesFromArgument | public function getReplaceValuesFromArgument($argValues)
{
$replaceValues = array();
$argValues = explode(',', $argValues);
foreach ($argValues as $argValue) {
$argValue = explode(':', $argValue);
if (count($argValue) != 2) {
$msg = 'Command argument ... | php | public function getReplaceValuesFromArgument($argValues)
{
$replaceValues = array();
$argValues = explode(',', $argValues);
foreach ($argValues as $argValue) {
$argValue = explode(':', $argValue);
if (count($argValue) != 2) {
$msg = 'Command argument ... | [
"public",
"function",
"getReplaceValuesFromArgument",
"(",
"$",
"argValues",
")",
"{",
"$",
"replaceValues",
"=",
"array",
"(",
")",
";",
"$",
"argValues",
"=",
"explode",
"(",
"','",
",",
"$",
"argValues",
")",
";",
"foreach",
"(",
"$",
"argValues",
"as",... | Returns an array containing the replace values from command argument.
@param string $argValues
Command argument replace value.
@return array
An array, following the format: SEARCH => REPLACE. | [
"Returns",
"an",
"array",
"containing",
"the",
"replace",
"values",
"from",
"command",
"argument",
"."
] | b0dd7e9c4a966f664c2df08b3067c1b6f263e226 | https://github.com/jkribeiro/composer-hydration/blob/b0dd7e9c4a966f664c2df08b3067c1b6f263e226/src/Composer/ComposerHydrationHandler.php#L164-L187 |
16,240 | jkribeiro/composer-hydration | src/Composer/ComposerHydrationHandler.php | ComposerHydrationHandler.getArguments | public function getArguments()
{
// Checks if script received command arguments.
$cmdArguments = $this->event->getArguments();
if (!$cmdArguments) {
throw new \ErrorException('Hydrate command expects arguments.');
}
// Treats arguments.
$returnArguments =... | php | public function getArguments()
{
// Checks if script received command arguments.
$cmdArguments = $this->event->getArguments();
if (!$cmdArguments) {
throw new \ErrorException('Hydrate command expects arguments.');
}
// Treats arguments.
$returnArguments =... | [
"public",
"function",
"getArguments",
"(",
")",
"{",
"// Checks if script received command arguments.",
"$",
"cmdArguments",
"=",
"$",
"this",
"->",
"event",
"->",
"getArguments",
"(",
")",
";",
"if",
"(",
"!",
"$",
"cmdArguments",
")",
"{",
"throw",
"new",
"\... | Returns an array containing the command arguments values.
@return array
An array containing the script command arguments. | [
"Returns",
"an",
"array",
"containing",
"the",
"command",
"arguments",
"values",
"."
] | b0dd7e9c4a966f664c2df08b3067c1b6f263e226 | https://github.com/jkribeiro/composer-hydration/blob/b0dd7e9c4a966f664c2df08b3067c1b6f263e226/src/Composer/ComposerHydrationHandler.php#L195-L227 |
16,241 | jkribeiro/composer-hydration | src/Composer/ComposerHydrationHandler.php | ComposerHydrationHandler.hydrateFileContents | public function hydrateFileContents($replaceMap)
{
$io = $this->event->getIO();
$finder = new Finder();
$finder->in($this->basePath);
$finder->ignoreDotFiles(false);
$finder->notPath('vendor');
$finder->notName('composer.json');
// Find files.
foreac... | php | public function hydrateFileContents($replaceMap)
{
$io = $this->event->getIO();
$finder = new Finder();
$finder->in($this->basePath);
$finder->ignoreDotFiles(false);
$finder->notPath('vendor');
$finder->notName('composer.json');
// Find files.
foreac... | [
"public",
"function",
"hydrateFileContents",
"(",
"$",
"replaceMap",
")",
"{",
"$",
"io",
"=",
"$",
"this",
"->",
"event",
"->",
"getIO",
"(",
")",
";",
"$",
"finder",
"=",
"new",
"Finder",
"(",
")",
";",
"$",
"finder",
"->",
"in",
"(",
"$",
"this"... | Process hydration to File contents.
@param string $replaceMap
An array containing the replacement map following the format:
[{SEARCH} => {REPLACE},
{SEARCH} => {REPLACE},
...] | [
"Process",
"hydration",
"to",
"File",
"contents",
"."
] | b0dd7e9c4a966f664c2df08b3067c1b6f263e226 | https://github.com/jkribeiro/composer-hydration/blob/b0dd7e9c4a966f664c2df08b3067c1b6f263e226/src/Composer/ComposerHydrationHandler.php#L238-L279 |
16,242 | jkribeiro/composer-hydration | src/Composer/ComposerHydrationHandler.php | ComposerHydrationHandler.hydrateRenameFilesAndFolders | public function hydrateRenameFilesAndFolders($replaceMap)
{
$io = $this->event->getIO();
$finder = new Finder();
$finder->in($this->basePath);
$finder->ignoreDotFiles(false);
$finder->exclude('vendor');
foreach ($replaceMap as $search => $replace) {
// R... | php | public function hydrateRenameFilesAndFolders($replaceMap)
{
$io = $this->event->getIO();
$finder = new Finder();
$finder->in($this->basePath);
$finder->ignoreDotFiles(false);
$finder->exclude('vendor');
foreach ($replaceMap as $search => $replace) {
// R... | [
"public",
"function",
"hydrateRenameFilesAndFolders",
"(",
"$",
"replaceMap",
")",
"{",
"$",
"io",
"=",
"$",
"this",
"->",
"event",
"->",
"getIO",
"(",
")",
";",
"$",
"finder",
"=",
"new",
"Finder",
"(",
")",
";",
"$",
"finder",
"->",
"in",
"(",
"$",... | Process hydration renaming files and folders.
@param string $replaceMap
An array containing the replacement map following the format:
[{SEARCH} => {REPLACE},
{SEARCH} => {REPLACE},
...] | [
"Process",
"hydration",
"renaming",
"files",
"and",
"folders",
"."
] | b0dd7e9c4a966f664c2df08b3067c1b6f263e226 | https://github.com/jkribeiro/composer-hydration/blob/b0dd7e9c4a966f664c2df08b3067c1b6f263e226/src/Composer/ComposerHydrationHandler.php#L290-L328 |
16,243 | jkribeiro/composer-hydration | src/Composer/ComposerHydrationHandler.php | ComposerHydrationHandler.hydrate | public function hydrate()
{
$arguments = $this->getArguments();
$replaceMap = $arguments[self::REPLACE_ARG];
// Rename Files and Folders.
$this->hydrateRenameFilesAndFolders($replaceMap);
// Hydrate file contents.
$this->hydrateFileContents($replaceMap);
} | php | public function hydrate()
{
$arguments = $this->getArguments();
$replaceMap = $arguments[self::REPLACE_ARG];
// Rename Files and Folders.
$this->hydrateRenameFilesAndFolders($replaceMap);
// Hydrate file contents.
$this->hydrateFileContents($replaceMap);
} | [
"public",
"function",
"hydrate",
"(",
")",
"{",
"$",
"arguments",
"=",
"$",
"this",
"->",
"getArguments",
"(",
")",
";",
"$",
"replaceMap",
"=",
"$",
"arguments",
"[",
"self",
"::",
"REPLACE_ARG",
"]",
";",
"// Rename Files and Folders.",
"$",
"this",
"->"... | Performs Hydration process. | [
"Performs",
"Hydration",
"process",
"."
] | b0dd7e9c4a966f664c2df08b3067c1b6f263e226 | https://github.com/jkribeiro/composer-hydration/blob/b0dd7e9c4a966f664c2df08b3067c1b6f263e226/src/Composer/ComposerHydrationHandler.php#L333-L343 |
16,244 | acasademont/wurfl | WURFL/DeviceRepositoryBuilder.php | WURFL_DeviceRepositoryBuilder.buildRepository | private function buildRepository($wurflInfoIterator, $deviceIterator, $patchDeviceIterators = null)
{
$this->persistWurflInfo($wurflInfoIterator);
$patchingDevices = $this->toListOfPatchingDevices($patchDeviceIterators);
try {
$this->process($deviceIterator, $patchingDevices);
... | php | private function buildRepository($wurflInfoIterator, $deviceIterator, $patchDeviceIterators = null)
{
$this->persistWurflInfo($wurflInfoIterator);
$patchingDevices = $this->toListOfPatchingDevices($patchDeviceIterators);
try {
$this->process($deviceIterator, $patchingDevices);
... | [
"private",
"function",
"buildRepository",
"(",
"$",
"wurflInfoIterator",
",",
"$",
"deviceIterator",
",",
"$",
"patchDeviceIterators",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"persistWurflInfo",
"(",
"$",
"wurflInfoIterator",
")",
";",
"$",
"patchingDevices",
... | Iterates over XML files and pulls relevent data
@param WURFL_Xml_VersionIterator $wurflInfoIterator
@param WURFL_Xml_DeviceIterator $deviceIterator
@param array $patchDeviceIterators arrray of WURFL_Xml_DeviceIterator objects for patch files
@throws Exception | [
"Iterates",
"over",
"XML",
"files",
"and",
"pulls",
"relevent",
"data"
] | 0f4fb6e06b452ba95ad1d15e7d8226d0974b60c2 | https://github.com/acasademont/wurfl/blob/0f4fb6e06b452ba95ad1d15e7d8226d0974b60c2/WURFL/DeviceRepositoryBuilder.php#L185-L195 |
16,245 | marmelab/phpcr-api | src/PHPCRAPI/PHPCR/Node.php | Node.getReducedTree | public function getReducedTree()
{
$parseTree = function (Node $node, Node $target) use ( &$parseTree ) {
if (substr($target->getPath(),0, strlen($node->getPath())) != $node->getPath()) {
return array();
}
$tree = array();
foreach ($node->getN... | php | public function getReducedTree()
{
$parseTree = function (Node $node, Node $target) use ( &$parseTree ) {
if (substr($target->getPath(),0, strlen($node->getPath())) != $node->getPath()) {
return array();
}
$tree = array();
foreach ($node->getN... | [
"public",
"function",
"getReducedTree",
"(",
")",
"{",
"$",
"parseTree",
"=",
"function",
"(",
"Node",
"$",
"node",
",",
"Node",
"$",
"target",
")",
"use",
"(",
"&",
"$",
"parseTree",
")",
"{",
"if",
"(",
"substr",
"(",
"$",
"target",
"->",
"getPath"... | Return a the minimum tree to display for a node
@return array The tree
@api | [
"Return",
"a",
"the",
"minimum",
"tree",
"to",
"display",
"for",
"a",
"node"
] | 372149e27d45babe142d0546894362fce987729b | https://github.com/marmelab/phpcr-api/blob/372149e27d45babe142d0546894362fce987729b/src/PHPCRAPI/PHPCR/Node.php#L88-L127 |
16,246 | marmelab/phpcr-api | src/PHPCRAPI/PHPCR/Node.php | Node.getPropertiesAsArray | public function getPropertiesAsArray()
{
$array = array();
foreach ($this->getProperties() as $property) {
$array[$property->getName()] = [ 'value' => $property->getValue(), 'type' => $property->getType() ];
}
return $array;
} | php | public function getPropertiesAsArray()
{
$array = array();
foreach ($this->getProperties() as $property) {
$array[$property->getName()] = [ 'value' => $property->getValue(), 'type' => $property->getType() ];
}
return $array;
} | [
"public",
"function",
"getPropertiesAsArray",
"(",
")",
"{",
"$",
"array",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"getProperties",
"(",
")",
"as",
"$",
"property",
")",
"{",
"$",
"array",
"[",
"$",
"property",
"->",
"getName",
... | Convert node's properties to array
@return array Properties
@api | [
"Convert",
"node",
"s",
"properties",
"to",
"array"
] | 372149e27d45babe142d0546894362fce987729b | https://github.com/marmelab/phpcr-api/blob/372149e27d45babe142d0546894362fce987729b/src/PHPCRAPI/PHPCR/Node.php#L136-L145 |
16,247 | jan-dolata/crude-crud | src/Engine/CrudeSetupTrait/Filters.php | Filters.setFilters | public function setFilters($filters)
{
if (! is_array($filters))
$filters = [$filters];
$this->filters = array_unique(array_merge($this->filters, $filters));
return $this;
} | php | public function setFilters($filters)
{
if (! is_array($filters))
$filters = [$filters];
$this->filters = array_unique(array_merge($this->filters, $filters));
return $this;
} | [
"public",
"function",
"setFilters",
"(",
"$",
"filters",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"filters",
")",
")",
"$",
"filters",
"=",
"[",
"$",
"filters",
"]",
";",
"$",
"this",
"->",
"filters",
"=",
"array_unique",
"(",
"array_merge",
"... | Sets the Filters.
@param array|sting $filters the filters
@return self | [
"Sets",
"the",
"Filters",
"."
] | 9129ea08278835cf5cecfd46a90369226ae6bdd7 | https://github.com/jan-dolata/crude-crud/blob/9129ea08278835cf5cecfd46a90369226ae6bdd7/src/Engine/CrudeSetupTrait/Filters.php#L33-L41 |
16,248 | pipelinersales/pipeliner-php-sdk | src/PipelinerSales/ApiClient/Entity.php | Entity.setFields | public function setFields($values)
{
foreach ($values as $field => $value) {
$this->setField($field, $value);
}
} | php | public function setFields($values)
{
foreach ($values as $field => $value) {
$this->setField($field, $value);
}
} | [
"public",
"function",
"setFields",
"(",
"$",
"values",
")",
"{",
"foreach",
"(",
"$",
"values",
"as",
"$",
"field",
"=>",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"setField",
"(",
"$",
"field",
",",
"$",
"value",
")",
";",
"}",
"}"
] | Sets values of multiple fields at once. Fields not present in the array
will not be changed in any way.
@param array $values an associative array of fields to values | [
"Sets",
"values",
"of",
"multiple",
"fields",
"at",
"once",
".",
"Fields",
"not",
"present",
"in",
"the",
"array",
"will",
"not",
"be",
"changed",
"in",
"any",
"way",
"."
] | a020149ffde815be17634542010814cf854c3d5f | https://github.com/pipelinersales/pipeliner-php-sdk/blob/a020149ffde815be17634542010814cf854c3d5f/src/PipelinerSales/ApiClient/Entity.php#L92-L97 |
16,249 | WindomZ/shmcache | src/shmop.php | shmop.exists | protected function exists(int $id = 0): bool
{
return (bool)@shmop_open($id ? $id : $this->id, 'a', 0, 0);
} | php | protected function exists(int $id = 0): bool
{
return (bool)@shmop_open($id ? $id : $this->id, 'a', 0, 0);
} | [
"protected",
"function",
"exists",
"(",
"int",
"$",
"id",
"=",
"0",
")",
":",
"bool",
"{",
"return",
"(",
"bool",
")",
"@",
"shmop_open",
"(",
"$",
"id",
"?",
"$",
"id",
":",
"$",
"this",
"->",
"id",
",",
"'a'",
",",
"0",
",",
"0",
")",
";",
... | Whether there is a system's id
@param int $id [optional]
@return bool | [
"Whether",
"there",
"is",
"a",
"system",
"s",
"id"
] | dfb1660b72e6807ba9c6eb4bed70169f4d7e0a7a | https://github.com/WindomZ/shmcache/blob/dfb1660b72e6807ba9c6eb4bed70169f4d7e0a7a/src/shmop.php#L65-L68 |
16,250 | WindomZ/shmcache | src/shmop.php | shmop.pack | protected function pack($data, int $seconds = 0): string
{
return serialize(
array(
'data' => $this->toPack($data),
'timeout' => $seconds ? $this->microtime($seconds * 1000) : 0,
)
);
} | php | protected function pack($data, int $seconds = 0): string
{
return serialize(
array(
'data' => $this->toPack($data),
'timeout' => $seconds ? $this->microtime($seconds * 1000) : 0,
)
);
} | [
"protected",
"function",
"pack",
"(",
"$",
"data",
",",
"int",
"$",
"seconds",
"=",
"0",
")",
":",
"string",
"{",
"return",
"serialize",
"(",
"array",
"(",
"'data'",
"=>",
"$",
"this",
"->",
"toPack",
"(",
"$",
"data",
")",
",",
"'timeout'",
"=>",
... | Package to an array and serialize to a string
@param mixed $data
@param int $seconds [optional]
@return string | [
"Package",
"to",
"an",
"array",
"and",
"serialize",
"to",
"a",
"string"
] | dfb1660b72e6807ba9c6eb4bed70169f4d7e0a7a | https://github.com/WindomZ/shmcache/blob/dfb1660b72e6807ba9c6eb4bed70169f4d7e0a7a/src/shmop.php#L93-L101 |
16,251 | WindomZ/shmcache | src/shmop.php | shmop.unpack | protected function unpack(string $data)
{
if ($data) {
$data = unserialize($data);
if (is_array($data) && isset($data['data']) && isset($data['timeout'])) {
$timeout = intval($data['timeout']);
if (!$timeout || $timeout >= $this->microtime()) {
... | php | protected function unpack(string $data)
{
if ($data) {
$data = unserialize($data);
if (is_array($data) && isset($data['data']) && isset($data['timeout'])) {
$timeout = intval($data['timeout']);
if (!$timeout || $timeout >= $this->microtime()) {
... | [
"protected",
"function",
"unpack",
"(",
"string",
"$",
"data",
")",
"{",
"if",
"(",
"$",
"data",
")",
"{",
"$",
"data",
"=",
"unserialize",
"(",
"$",
"data",
")",
";",
"if",
"(",
"is_array",
"(",
"$",
"data",
")",
"&&",
"isset",
"(",
"$",
"data",... | Unpacking a string and parse no timeout data from array
@param string $data
@return mixed|bool | [
"Unpacking",
"a",
"string",
"and",
"parse",
"no",
"timeout",
"data",
"from",
"array"
] | dfb1660b72e6807ba9c6eb4bed70169f4d7e0a7a | https://github.com/WindomZ/shmcache/blob/dfb1660b72e6807ba9c6eb4bed70169f4d7e0a7a/src/shmop.php#L115-L128 |
16,252 | WindomZ/shmcache | src/shmop.php | shmop.write | protected function write($data, int $seconds = 0): bool
{
if (!$data) {
return false;
}
$this->clean();
$data = $this->pack($data, $seconds);
$id = shmop_open($this->id, "n", $this->mode, strlen($data));
if (!$id) {
return false;
}
... | php | protected function write($data, int $seconds = 0): bool
{
if (!$data) {
return false;
}
$this->clean();
$data = $this->pack($data, $seconds);
$id = shmop_open($this->id, "n", $this->mode, strlen($data));
if (!$id) {
return false;
}
... | [
"protected",
"function",
"write",
"(",
"$",
"data",
",",
"int",
"$",
"seconds",
"=",
"0",
")",
":",
"bool",
"{",
"if",
"(",
"!",
"$",
"data",
")",
"{",
"return",
"false",
";",
"}",
"$",
"this",
"->",
"clean",
"(",
")",
";",
"$",
"data",
"=",
... | Write data into shared memory block
@param mixed $data
@param int $seconds [optional]
@return bool | [
"Write",
"data",
"into",
"shared",
"memory",
"block"
] | dfb1660b72e6807ba9c6eb4bed70169f4d7e0a7a | https://github.com/WindomZ/shmcache/blob/dfb1660b72e6807ba9c6eb4bed70169f4d7e0a7a/src/shmop.php#L136-L154 |
16,253 | WindomZ/shmcache | src/shmop.php | shmop.read | protected function read()
{
if ($this->exists()) {
$id = shmop_open($this->id, "a", 0, 0);
if (!$id) {
return false;
}
$data = shmop_read($id, 0, shmop_size($id));
if (!$data) {
return false;
}
... | php | protected function read()
{
if ($this->exists()) {
$id = shmop_open($this->id, "a", 0, 0);
if (!$id) {
return false;
}
$data = shmop_read($id, 0, shmop_size($id));
if (!$data) {
return false;
}
... | [
"protected",
"function",
"read",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"exists",
"(",
")",
")",
"{",
"$",
"id",
"=",
"shmop_open",
"(",
"$",
"this",
"->",
"id",
",",
"\"a\"",
",",
"0",
",",
"0",
")",
";",
"if",
"(",
"!",
"$",
"id",
"... | Read data from shared memory block
@return bool|mixed | [
"Read",
"data",
"from",
"shared",
"memory",
"block"
] | dfb1660b72e6807ba9c6eb4bed70169f4d7e0a7a | https://github.com/WindomZ/shmcache/blob/dfb1660b72e6807ba9c6eb4bed70169f4d7e0a7a/src/shmop.php#L160-L180 |
16,254 | WindomZ/shmcache | src/shmop.php | shmop.clean | protected function clean()
{
if ($this->exists()) {
$id = shmop_open($this->id, "a", 0, 0);
shmop_delete($id);
shmop_close($id);
}
} | php | protected function clean()
{
if ($this->exists()) {
$id = shmop_open($this->id, "a", 0, 0);
shmop_delete($id);
shmop_close($id);
}
} | [
"protected",
"function",
"clean",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"exists",
"(",
")",
")",
"{",
"$",
"id",
"=",
"shmop_open",
"(",
"$",
"this",
"->",
"id",
",",
"\"a\"",
",",
"0",
",",
"0",
")",
";",
"shmop_delete",
"(",
"$",
"id",... | Clean data from shared memory block | [
"Clean",
"data",
"from",
"shared",
"memory",
"block"
] | dfb1660b72e6807ba9c6eb4bed70169f4d7e0a7a | https://github.com/WindomZ/shmcache/blob/dfb1660b72e6807ba9c6eb4bed70169f4d7e0a7a/src/shmop.php#L185-L192 |
16,255 | stubbles/stubbles-webapp-core | src/main/php/routing/SupportedMimeTypes.php | SupportedMimeTypes.findMatch | public function findMatch(AcceptHeader $acceptedMimeTypes)
{
if (count($this->mimeTypes) === 0) {
return 'text/html';
}
if (count($acceptedMimeTypes) === 0) {
reset($this->mimeTypes);
return current($this->mimeTypes);
}
return $acceptedMi... | php | public function findMatch(AcceptHeader $acceptedMimeTypes)
{
if (count($this->mimeTypes) === 0) {
return 'text/html';
}
if (count($acceptedMimeTypes) === 0) {
reset($this->mimeTypes);
return current($this->mimeTypes);
}
return $acceptedMi... | [
"public",
"function",
"findMatch",
"(",
"AcceptHeader",
"$",
"acceptedMimeTypes",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"mimeTypes",
")",
"===",
"0",
")",
"{",
"return",
"'text/html'",
";",
"}",
"if",
"(",
"count",
"(",
"$",
"acceptedMime... | finds best matching mime type based on accept header
@param \stubbles\peer\http\AcceptHeader $acceptedMimeTypes
@return string|null | [
"finds",
"best",
"matching",
"mime",
"type",
"based",
"on",
"accept",
"header"
] | 7705f129011a81d5cc3c76b4b150fab3dadac6a3 | https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/SupportedMimeTypes.php#L122-L134 |
16,256 | stubbles/stubbles-webapp-core | src/main/php/routing/SupportedMimeTypes.php | SupportedMimeTypes.removeDefaultMimeTypeClass | public static function removeDefaultMimeTypeClass(string $mimeType)
{
if (isset(self::$supported[$mimeType])) {
unset(self::$supported[$mimeType]);
}
} | php | public static function removeDefaultMimeTypeClass(string $mimeType)
{
if (isset(self::$supported[$mimeType])) {
unset(self::$supported[$mimeType]);
}
} | [
"public",
"static",
"function",
"removeDefaultMimeTypeClass",
"(",
"string",
"$",
"mimeType",
")",
"{",
"if",
"(",
"isset",
"(",
"self",
"::",
"$",
"supported",
"[",
"$",
"mimeType",
"]",
")",
")",
"{",
"unset",
"(",
"self",
"::",
"$",
"supported",
"[",
... | removes default mime type class for given mime type
@param string $mimeType
@since 5.1.1 | [
"removes",
"default",
"mime",
"type",
"class",
"for",
"given",
"mime",
"type"
] | 7705f129011a81d5cc3c76b4b150fab3dadac6a3 | https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/SupportedMimeTypes.php#L154-L159 |
16,257 | stubbles/stubbles-webapp-core | src/main/php/routing/SupportedMimeTypes.php | SupportedMimeTypes.provideDefaultClassFor | public static function provideDefaultClassFor(string $mimeType): bool
{
if (in_array($mimeType, array_keys(self::$supported))) {
return true;
}
if (class_exists('stubbles\xml\serializer\XmlSerializerFacade') && in_array($mimeType, array_keys(self::$xml))) {
return tr... | php | public static function provideDefaultClassFor(string $mimeType): bool
{
if (in_array($mimeType, array_keys(self::$supported))) {
return true;
}
if (class_exists('stubbles\xml\serializer\XmlSerializerFacade') && in_array($mimeType, array_keys(self::$xml))) {
return tr... | [
"public",
"static",
"function",
"provideDefaultClassFor",
"(",
"string",
"$",
"mimeType",
")",
":",
"bool",
"{",
"if",
"(",
"in_array",
"(",
"$",
"mimeType",
",",
"array_keys",
"(",
"self",
"::",
"$",
"supported",
")",
")",
")",
"{",
"return",
"true",
";... | checks if a default class is known for the given mime type
@param string $mimeType
@return bool
@since 5.0.0 | [
"checks",
"if",
"a",
"default",
"class",
"is",
"known",
"for",
"the",
"given",
"mime",
"type"
] | 7705f129011a81d5cc3c76b4b150fab3dadac6a3 | https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/SupportedMimeTypes.php#L168-L183 |
16,258 | stubbles/stubbles-webapp-core | src/main/php/routing/SupportedMimeTypes.php | SupportedMimeTypes.classFor | public function classFor(string $mimeType)
{
if ($this->provideClass($mimeType)) {
return $this->mimeTypeClasses[$mimeType];
}
return null;
} | php | public function classFor(string $mimeType)
{
if ($this->provideClass($mimeType)) {
return $this->mimeTypeClasses[$mimeType];
}
return null;
} | [
"public",
"function",
"classFor",
"(",
"string",
"$",
"mimeType",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"provideClass",
"(",
"$",
"mimeType",
")",
")",
"{",
"return",
"$",
"this",
"->",
"mimeTypeClasses",
"[",
"$",
"mimeType",
"]",
";",
"}",
"return"... | returns special class which was defined for given mime type or null if none defined
@param string $mimeType
@return string|null
@since 3.2.0 | [
"returns",
"special",
"class",
"which",
"was",
"defined",
"for",
"given",
"mime",
"type",
"or",
"null",
"if",
"none",
"defined"
] | 7705f129011a81d5cc3c76b4b150fab3dadac6a3 | https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/SupportedMimeTypes.php#L204-L211 |
16,259 | belgattitude/soluble-metadata | src/Soluble/Metadata/Reader/AbstractMetadataReader.php | AbstractMetadataReader.getColumnsMetadata | public function getColumnsMetadata(string $sql): ColumnsMetadata
{
if ($this->cache_active) {
$cache_key = md5($sql);
if (!array_key_exists($cache_key, static::$metadata_cache)) {
$md = $this->readColumnsMetadata($sql);
static::$metadata_cache[$cache_k... | php | public function getColumnsMetadata(string $sql): ColumnsMetadata
{
if ($this->cache_active) {
$cache_key = md5($sql);
if (!array_key_exists($cache_key, static::$metadata_cache)) {
$md = $this->readColumnsMetadata($sql);
static::$metadata_cache[$cache_k... | [
"public",
"function",
"getColumnsMetadata",
"(",
"string",
"$",
"sql",
")",
":",
"ColumnsMetadata",
"{",
"if",
"(",
"$",
"this",
"->",
"cache_active",
")",
"{",
"$",
"cache_key",
"=",
"md5",
"(",
"$",
"sql",
")",
";",
"if",
"(",
"!",
"array_key_exists",
... | Return columns metadata from query.
@throws Exception\UnsupportedTypeException
@throws Exception\AmbiguousColumnException
@throws Exception\InvalidQueryException | [
"Return",
"columns",
"metadata",
"from",
"query",
"."
] | 6285461c40a619070f601184d58e6c772b769d5c | https://github.com/belgattitude/soluble-metadata/blob/6285461c40a619070f601184d58e6c772b769d5c/src/Soluble/Metadata/Reader/AbstractMetadataReader.php#L48-L61 |
16,260 | belgattitude/soluble-metadata | src/Soluble/Metadata/Reader/AbstractMetadataReader.php | AbstractMetadataReader.getTableMetadata | public function getTableMetadata(string $table): ColumnsMetadata
{
try {
$metadata = $this->getColumnsMetadata(sprintf('select * from %s', $table));
} catch (Exception\InvalidQueryException $e) {
throw new Exception\TableNotFoundException(sprintf(
'Table "%s" ... | php | public function getTableMetadata(string $table): ColumnsMetadata
{
try {
$metadata = $this->getColumnsMetadata(sprintf('select * from %s', $table));
} catch (Exception\InvalidQueryException $e) {
throw new Exception\TableNotFoundException(sprintf(
'Table "%s" ... | [
"public",
"function",
"getTableMetadata",
"(",
"string",
"$",
"table",
")",
":",
"ColumnsMetadata",
"{",
"try",
"{",
"$",
"metadata",
"=",
"$",
"this",
"->",
"getColumnsMetadata",
"(",
"sprintf",
"(",
"'select * from %s'",
",",
"$",
"table",
")",
")",
";",
... | Return columns metadata from a table.
@throws Exception\UnsupportedTypeException
@throws Exception\AmbiguousColumnException
@throws Exception\TableNotFoundException | [
"Return",
"columns",
"metadata",
"from",
"a",
"table",
"."
] | 6285461c40a619070f601184d58e6c772b769d5c | https://github.com/belgattitude/soluble-metadata/blob/6285461c40a619070f601184d58e6c772b769d5c/src/Soluble/Metadata/Reader/AbstractMetadataReader.php#L70-L83 |
16,261 | belgattitude/soluble-metadata | src/Soluble/Metadata/Reader/AbstractMetadataReader.php | AbstractMetadataReader.getEmptiedQuery | protected function getEmptiedQuery(string $sql): string
{
// see the reason why in Vision_Store_Adapter_ZendDbSelect::getMetaData
//$sql = str_replace("('__innerselect'='__innerselect')", '(1=0)', $sql);
$sql = preg_replace('/(\r\n|\r|\n|\t)+/', ' ', strtolower($sql));
$sql = trim($... | php | protected function getEmptiedQuery(string $sql): string
{
// see the reason why in Vision_Store_Adapter_ZendDbSelect::getMetaData
//$sql = str_replace("('__innerselect'='__innerselect')", '(1=0)', $sql);
$sql = preg_replace('/(\r\n|\r|\n|\t)+/', ' ', strtolower($sql));
$sql = trim($... | [
"protected",
"function",
"getEmptiedQuery",
"(",
"string",
"$",
"sql",
")",
":",
"string",
"{",
"// see the reason why in Vision_Store_Adapter_ZendDbSelect::getMetaData",
"//$sql = str_replace(\"('__innerselect'='__innerselect')\", '(1=0)', $sql);",
"$",
"sql",
"=",
"preg_replace",
... | Optimization, will add false condition to the query
so the metadata loading will be faster. | [
"Optimization",
"will",
"add",
"false",
"condition",
"to",
"the",
"query",
"so",
"the",
"metadata",
"loading",
"will",
"be",
"faster",
"."
] | 6285461c40a619070f601184d58e6c772b769d5c | https://github.com/belgattitude/soluble-metadata/blob/6285461c40a619070f601184d58e6c772b769d5c/src/Soluble/Metadata/Reader/AbstractMetadataReader.php#L98-L122 |
16,262 | andyvenus/form | src/Type/CollectionType.php | CollectionType.processFieldsCollection | protected function processFieldsCollection($fieldCollection, $data, FormHandler $formHandler)
{
$fields = array();
foreach ($fieldCollection as $field) {
// Unnamed array fields
if ($field['name'] === null) {
if (!isset($i)) $i = 0;
$field['na... | php | protected function processFieldsCollection($fieldCollection, $data, FormHandler $formHandler)
{
$fields = array();
foreach ($fieldCollection as $field) {
// Unnamed array fields
if ($field['name'] === null) {
if (!isset($i)) $i = 0;
$field['na... | [
"protected",
"function",
"processFieldsCollection",
"(",
"$",
"fieldCollection",
",",
"$",
"data",
",",
"FormHandler",
"$",
"formHandler",
")",
"{",
"$",
"fields",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"fieldCollection",
"as",
"$",
"field",
")",
... | Process a collection of fields
@param $fieldCollection
@param $data
@param \AV\Form\FormHandler $formHandler
@return array | [
"Process",
"a",
"collection",
"of",
"fields"
] | fde9d7e1741a707028aec4fd55c3568802df3708 | https://github.com/andyvenus/form/blob/fde9d7e1741a707028aec4fd55c3568802df3708/src/Type/CollectionType.php#L72-L101 |
16,263 | tjbp/laravel-verify-emails | src/Auth/VerifyEmails/VerifyEmailServiceProvider.php | VerifyEmailServiceProvider.registerVerifyEmailBroker | protected function registerVerifyEmailBroker()
{
$this->app->singleton('auth.verify_emails', function ($app) {
return new VerifyEmailBrokerManager($app);
});
$this->app->bind('auth.verify_emails.broker', function ($app) {
return $app->make('auth.verify_emails')->brok... | php | protected function registerVerifyEmailBroker()
{
$this->app->singleton('auth.verify_emails', function ($app) {
return new VerifyEmailBrokerManager($app);
});
$this->app->bind('auth.verify_emails.broker', function ($app) {
return $app->make('auth.verify_emails')->brok... | [
"protected",
"function",
"registerVerifyEmailBroker",
"(",
")",
"{",
"$",
"this",
"->",
"app",
"->",
"singleton",
"(",
"'auth.verify_emails'",
",",
"function",
"(",
"$",
"app",
")",
"{",
"return",
"new",
"VerifyEmailBrokerManager",
"(",
"$",
"app",
")",
";",
... | Register the verify email broker instance.
@return void | [
"Register",
"the",
"verify",
"email",
"broker",
"instance",
"."
] | 1e2ac10a696c10f2fdf0d7de6c3388d549bc07c6 | https://github.com/tjbp/laravel-verify-emails/blob/1e2ac10a696c10f2fdf0d7de6c3388d549bc07c6/src/Auth/VerifyEmails/VerifyEmailServiceProvider.php#L34-L43 |
16,264 | FrenchFrogs/framework | src/Form/Form/Form.php | Form.render | public function render()
{
$render = '';
try {
$render = $this->getRenderer()->render('form', $this);
} catch(\Exception $e){
dd($e->getMessage());//@todo find a good way to warn the developper
}
return $render;
} | php | public function render()
{
$render = '';
try {
$render = $this->getRenderer()->render('form', $this);
} catch(\Exception $e){
dd($e->getMessage());//@todo find a good way to warn the developper
}
return $render;
} | [
"public",
"function",
"render",
"(",
")",
"{",
"$",
"render",
"=",
"''",
";",
"try",
"{",
"$",
"render",
"=",
"$",
"this",
"->",
"getRenderer",
"(",
")",
"->",
"render",
"(",
"'form'",
",",
"$",
"this",
")",
";",
"}",
"catch",
"(",
"\\",
"Excepti... | Render the polliwog
@return mixed|string | [
"Render",
"the",
"polliwog"
] | a4838c698a5600437e87dac6d35ba8ebe32c4395 | https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Form/Form/Form.php#L268-L278 |
16,265 | FrenchFrogs/framework | src/Form/Form/Form.php | Form.getValues | public function getValues()
{
$values = [];
foreach($this->getElements() as $name => $e) {
/** @var $e \FrenchFrogs\Form\Element\Element */
if ($e->isDiscreet()) {continue;}
$values[$name] = $e->getValue();
}
return $values;
} | php | public function getValues()
{
$values = [];
foreach($this->getElements() as $name => $e) {
/** @var $e \FrenchFrogs\Form\Element\Element */
if ($e->isDiscreet()) {continue;}
$values[$name] = $e->getValue();
}
return $values;
} | [
"public",
"function",
"getValues",
"(",
")",
"{",
"$",
"values",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"getElements",
"(",
")",
"as",
"$",
"name",
"=>",
"$",
"e",
")",
"{",
"/** @var $e \\FrenchFrogs\\Form\\Element\\Element */",
"if",
"(",... | Return all values from all elements
@return array | [
"Return",
"all",
"values",
"from",
"all",
"elements"
] | a4838c698a5600437e87dac6d35ba8ebe32c4395 | https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Form/Form/Form.php#L333-L344 |
16,266 | FrenchFrogs/framework | src/Form/Form/Form.php | Form.getFilteredValues | public function getFilteredValues()
{
$values = [];
foreach($this->getElements() as $name => $e){
/** @var \FrenchFrogs\Form\Element\Element $e */
if ($e->isDiscreet()) {continue;}
$values[$name] = $e->getFilteredValue();
}
return $values;
} | php | public function getFilteredValues()
{
$values = [];
foreach($this->getElements() as $name => $e){
/** @var \FrenchFrogs\Form\Element\Element $e */
if ($e->isDiscreet()) {continue;}
$values[$name] = $e->getFilteredValue();
}
return $values;
} | [
"public",
"function",
"getFilteredValues",
"(",
")",
"{",
"$",
"values",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"getElements",
"(",
")",
"as",
"$",
"name",
"=>",
"$",
"e",
")",
"{",
"/** @var \\FrenchFrogs\\Form\\Element\\Element $e */",
"if"... | Return all filtered values from all elements
@return array | [
"Return",
"all",
"filtered",
"values",
"from",
"all",
"elements"
] | a4838c698a5600437e87dac6d35ba8ebe32c4395 | https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Form/Form/Form.php#L364-L374 |
16,267 | FrenchFrogs/framework | src/Form/Form/Form.php | Form.valid | public function valid(array $values, $populate = true)
{
foreach($this->getElements() as $index => &$element) {
if(!array_key_exists($index, $values)) {
if(is_a($element, 'FrenchFrogs\Form\Element\Boolean')){
$values[$index] = 0;
} else {
... | php | public function valid(array $values, $populate = true)
{
foreach($this->getElements() as $index => &$element) {
if(!array_key_exists($index, $values)) {
if(is_a($element, 'FrenchFrogs\Form\Element\Boolean')){
$values[$index] = 0;
} else {
... | [
"public",
"function",
"valid",
"(",
"array",
"$",
"values",
",",
"$",
"populate",
"=",
"true",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getElements",
"(",
")",
"as",
"$",
"index",
"=>",
"&",
"$",
"element",
")",
"{",
"if",
"(",
"!",
"array_key... | Valid all the form elements
@param array $values
@param bool|true $populate
@return $this | [
"Valid",
"all",
"the",
"form",
"elements"
] | a4838c698a5600437e87dac6d35ba8ebe32c4395 | https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Form/Form/Form.php#L416-L436 |
16,268 | FrenchFrogs/framework | src/Form/Form/Form.php | Form.getErrorAsString | public function getErrorAsString()
{
$errors = [];
foreach($this->getValidator()->getErrors() as $index => $message){
$errors[] = sprintf('%s:%s %s', $index, PHP_EOL, $message);
}
return implode(PHP_EOL, $errors);
} | php | public function getErrorAsString()
{
$errors = [];
foreach($this->getValidator()->getErrors() as $index => $message){
$errors[] = sprintf('%s:%s %s', $index, PHP_EOL, $message);
}
return implode(PHP_EOL, $errors);
} | [
"public",
"function",
"getErrorAsString",
"(",
")",
"{",
"$",
"errors",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"getValidator",
"(",
")",
"->",
"getErrors",
"(",
")",
"as",
"$",
"index",
"=>",
"$",
"message",
")",
"{",
"$",
"errors",
... | Return string formated error from the form validation
@return string | [
"Return",
"string",
"formated",
"error",
"from",
"the",
"form",
"validation"
] | a4838c698a5600437e87dac6d35ba8ebe32c4395 | https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Form/Form/Form.php#L445-L452 |
16,269 | okvpn/fixture-bundle | src/Fixture/AbstractEntityReferenceFixture.php | AbstractEntityReferenceFixture.getObjectReferences | protected function getObjectReferences(ObjectManager $objectManager, $className)
{
$identifier = $objectManager->getClassMetadata($className)->getIdentifier();
$idField = reset($identifier);
/** @var EntityRepository $objectRepository */
$objectRepository = $objectManager->getRep... | php | protected function getObjectReferences(ObjectManager $objectManager, $className)
{
$identifier = $objectManager->getClassMetadata($className)->getIdentifier();
$idField = reset($identifier);
/** @var EntityRepository $objectRepository */
$objectRepository = $objectManager->getRep... | [
"protected",
"function",
"getObjectReferences",
"(",
"ObjectManager",
"$",
"objectManager",
",",
"$",
"className",
")",
"{",
"$",
"identifier",
"=",
"$",
"objectManager",
"->",
"getClassMetadata",
"(",
"$",
"className",
")",
"->",
"getIdentifier",
"(",
")",
";",... | Returns array of object references.
@param ObjectManager $objectManager
@param string $className
@return array
@see getObjectReferencesByIds | [
"Returns",
"array",
"of",
"object",
"references",
"."
] | 243b5e4dff9773e97fa447280e929c936a5d66ae | https://github.com/okvpn/fixture-bundle/blob/243b5e4dff9773e97fa447280e929c936a5d66ae/src/Fixture/AbstractEntityReferenceFixture.php#L21-L41 |
16,270 | okvpn/fixture-bundle | src/Fixture/AbstractEntityReferenceFixture.php | AbstractEntityReferenceFixture.getObjectReferencesByIds | protected function getObjectReferencesByIds(ObjectManager $objectManager, $className, array $ids)
{
$entities = [];
foreach ($ids as $id) {
/** @var EntityManager $objectManager */
$entities[] = $objectManager->getReference($className, $id);
}
return $entiti... | php | protected function getObjectReferencesByIds(ObjectManager $objectManager, $className, array $ids)
{
$entities = [];
foreach ($ids as $id) {
/** @var EntityManager $objectManager */
$entities[] = $objectManager->getReference($className, $id);
}
return $entiti... | [
"protected",
"function",
"getObjectReferencesByIds",
"(",
"ObjectManager",
"$",
"objectManager",
",",
"$",
"className",
",",
"array",
"$",
"ids",
")",
"{",
"$",
"entities",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"ids",
"as",
"$",
"id",
")",
"{",
"/** @... | Returns array of object references by their ids. It's useful when ids are known and objects are used as
other entities' relation.
@param ObjectManager $objectManager
@param string $className
@param array $ids
@return array | [
"Returns",
"array",
"of",
"object",
"references",
"by",
"their",
"ids",
".",
"It",
"s",
"useful",
"when",
"ids",
"are",
"known",
"and",
"objects",
"are",
"used",
"as",
"other",
"entities",
"relation",
"."
] | 243b5e4dff9773e97fa447280e929c936a5d66ae | https://github.com/okvpn/fixture-bundle/blob/243b5e4dff9773e97fa447280e929c936a5d66ae/src/Fixture/AbstractEntityReferenceFixture.php#L52-L62 |
16,271 | matthenning/eloquent-api-filter | src/Matthenning/EloquentApiFilter/EloquentApiFilter.php | EloquentApiFilter.applyFilter | private function applyFilter(Builder $query, $field, $filter, $or = false)
{
$filter = explode(':', $filter);
if (count($filter) > 1) {
$operator = $this->getFilterOperator($filter[0]);
$value = $this->replaceWildcards($filter[1]);
}
else {
$operat... | php | private function applyFilter(Builder $query, $field, $filter, $or = false)
{
$filter = explode(':', $filter);
if (count($filter) > 1) {
$operator = $this->getFilterOperator($filter[0]);
$value = $this->replaceWildcards($filter[1]);
}
else {
$operat... | [
"private",
"function",
"applyFilter",
"(",
"Builder",
"$",
"query",
",",
"$",
"field",
",",
"$",
"filter",
",",
"$",
"or",
"=",
"false",
")",
"{",
"$",
"filter",
"=",
"explode",
"(",
"':'",
",",
"$",
"filter",
")",
";",
"if",
"(",
"count",
"(",
"... | Applies a single filter to the query
@param Builder $query
@param $field
@param $filter
@param $or = false
@return Builder | [
"Applies",
"a",
"single",
"filter",
"to",
"the",
"query"
] | 3533155f894fbc0e6566b9d69baefda557031506 | https://github.com/matthenning/eloquent-api-filter/blob/3533155f894fbc0e6566b9d69baefda557031506/src/Matthenning/EloquentApiFilter/EloquentApiFilter.php#L152-L171 |
16,272 | matthenning/eloquent-api-filter | src/Matthenning/EloquentApiFilter/EloquentApiFilter.php | EloquentApiFilter.applyNestedFilter | private function applyNestedFilter(Builder $query, array $fields, $operator, $value, $or = false)
{
$relation_name = implode('.', array_slice($fields, 0, count($fields) - 1));
$relation_field = end($fields);
if ($relation_name[0] == '!') {
$relation_name = substr($relation_name, ... | php | private function applyNestedFilter(Builder $query, array $fields, $operator, $value, $or = false)
{
$relation_name = implode('.', array_slice($fields, 0, count($fields) - 1));
$relation_field = end($fields);
if ($relation_name[0] == '!') {
$relation_name = substr($relation_name, ... | [
"private",
"function",
"applyNestedFilter",
"(",
"Builder",
"$",
"query",
",",
"array",
"$",
"fields",
",",
"$",
"operator",
",",
"$",
"value",
",",
"$",
"or",
"=",
"false",
")",
"{",
"$",
"relation_name",
"=",
"implode",
"(",
"'.'",
",",
"array_slice",
... | Applies a nested filter.
Nested filters are filters on field on related models.
@param Builder $query
@param array $fields
@param $operator
@param $value
@param $or = false
@return Builder | [
"Applies",
"a",
"nested",
"filter",
".",
"Nested",
"filters",
"are",
"filters",
"on",
"field",
"on",
"related",
"models",
"."
] | 3533155f894fbc0e6566b9d69baefda557031506 | https://github.com/matthenning/eloquent-api-filter/blob/3533155f894fbc0e6566b9d69baefda557031506/src/Matthenning/EloquentApiFilter/EloquentApiFilter.php#L184-L203 |
16,273 | matthenning/eloquent-api-filter | src/Matthenning/EloquentApiFilter/EloquentApiFilter.php | EloquentApiFilter.applyWhereClause | private function applyWhereClause(Builder $query, $field, $operator, $value, $or = false) {
$verb = $or ? 'orWhere' : 'where';
$null_verb = $or ? 'orWhereNull' : 'whereNull';
$not_null_verb = $or ? 'orWhereNotNull' : 'whereNotNull';
$value = $this->base64decodeIfNecessary($value);
... | php | private function applyWhereClause(Builder $query, $field, $operator, $value, $or = false) {
$verb = $or ? 'orWhere' : 'where';
$null_verb = $or ? 'orWhereNull' : 'whereNull';
$not_null_verb = $or ? 'orWhereNotNull' : 'whereNotNull';
$value = $this->base64decodeIfNecessary($value);
... | [
"private",
"function",
"applyWhereClause",
"(",
"Builder",
"$",
"query",
",",
"$",
"field",
",",
"$",
"operator",
",",
"$",
"value",
",",
"$",
"or",
"=",
"false",
")",
"{",
"$",
"verb",
"=",
"$",
"or",
"?",
"'orWhere'",
":",
"'where'",
";",
"$",
"n... | Applies a where clause.
Is used by applyFilter and applyNestedFilter to apply the clause to the query.
@param Builder $query
@param $field
@param $operator
@param $value
@param $or = false
@return Builder | [
"Applies",
"a",
"where",
"clause",
".",
"Is",
"used",
"by",
"applyFilter",
"and",
"applyNestedFilter",
"to",
"apply",
"the",
"clause",
"to",
"the",
"query",
"."
] | 3533155f894fbc0e6566b9d69baefda557031506 | https://github.com/matthenning/eloquent-api-filter/blob/3533155f894fbc0e6566b9d69baefda557031506/src/Matthenning/EloquentApiFilter/EloquentApiFilter.php#L216-L238 |
16,274 | matthenning/eloquent-api-filter | src/Matthenning/EloquentApiFilter/EloquentApiFilter.php | EloquentApiFilter.getFilterOperator | private function getFilterOperator($filter)
{
$operator = str_replace('notlike', 'not like', $filter);
$operator = str_replace('gt', '>', $operator);
$operator = str_replace('ge', '>=', $operator);
$operator = str_replace('lt', '<', $operator);
$operator = str_replace('le', '... | php | private function getFilterOperator($filter)
{
$operator = str_replace('notlike', 'not like', $filter);
$operator = str_replace('gt', '>', $operator);
$operator = str_replace('ge', '>=', $operator);
$operator = str_replace('lt', '<', $operator);
$operator = str_replace('le', '... | [
"private",
"function",
"getFilterOperator",
"(",
"$",
"filter",
")",
"{",
"$",
"operator",
"=",
"str_replace",
"(",
"'notlike'",
",",
"'not like'",
",",
"$",
"filter",
")",
";",
"$",
"operator",
"=",
"str_replace",
"(",
"'gt'",
",",
"'>'",
",",
"$",
"ope... | Translates operators to SQL
@param $filter
@return mixed | [
"Translates",
"operators",
"to",
"SQL"
] | 3533155f894fbc0e6566b9d69baefda557031506 | https://github.com/matthenning/eloquent-api-filter/blob/3533155f894fbc0e6566b9d69baefda557031506/src/Matthenning/EloquentApiFilter/EloquentApiFilter.php#L304-L315 |
16,275 | codeburnerframework/router | src/Collectors/ResourceCollectorTrait.php | ResourceCollectorTrait.resource | public function resource($controller, array $options = array())
{
$name = isset($options["prefix"]) ? $options["prefix"] : "";
$name .= $this->getResourceName($controller, $options);
$actions = $this->getResourceActions($options);
$resource = new RouteResource;
... | php | public function resource($controller, array $options = array())
{
$name = isset($options["prefix"]) ? $options["prefix"] : "";
$name .= $this->getResourceName($controller, $options);
$actions = $this->getResourceActions($options);
$resource = new RouteResource;
... | [
"public",
"function",
"resource",
"(",
"$",
"controller",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"name",
"=",
"isset",
"(",
"$",
"options",
"[",
"\"prefix\"",
"]",
")",
"?",
"$",
"options",
"[",
"\"prefix\"",
"]",
":",
... | Resource routing allows you to quickly declare all of the common routes for a given resourceful controller.
Instead of declaring separate routes for your index, show, new, edit, create, update and destroy actions,
a resourceful route declares them in a single line of code.
@param string $controller The controller name... | [
"Resource",
"routing",
"allows",
"you",
"to",
"quickly",
"declare",
"all",
"of",
"the",
"common",
"routes",
"for",
"a",
"given",
"resourceful",
"controller",
".",
"Instead",
"of",
"declaring",
"separate",
"routes",
"for",
"your",
"index",
"show",
"new",
"edit"... | 2b0e8030303dd08d3fadfc4c57aa37b184a408cd | https://github.com/codeburnerframework/router/blob/2b0e8030303dd08d3fadfc4c57aa37b184a408cd/src/Collectors/ResourceCollectorTrait.php#L68-L87 |
16,276 | codeburnerframework/router | src/Collectors/ResourceCollectorTrait.php | ResourceCollectorTrait.resources | public function resources(array $controllers)
{
$resource = new RouteResource;
foreach ($controllers as $controller)
$resource->set($this->resource($controller));
return $resource;
} | php | public function resources(array $controllers)
{
$resource = new RouteResource;
foreach ($controllers as $controller)
$resource->set($this->resource($controller));
return $resource;
} | [
"public",
"function",
"resources",
"(",
"array",
"$",
"controllers",
")",
"{",
"$",
"resource",
"=",
"new",
"RouteResource",
";",
"foreach",
"(",
"$",
"controllers",
"as",
"$",
"controller",
")",
"$",
"resource",
"->",
"set",
"(",
"$",
"this",
"->",
"res... | Collect several resources at same time.
@param array $controllers Several controller names as parameters or an array with all controller names.
@return RouteResource | [
"Collect",
"several",
"resources",
"at",
"same",
"time",
"."
] | 2b0e8030303dd08d3fadfc4c57aa37b184a408cd | https://github.com/codeburnerframework/router/blob/2b0e8030303dd08d3fadfc4c57aa37b184a408cd/src/Collectors/ResourceCollectorTrait.php#L96-L102 |
16,277 | phossa2/middleware | src/Middleware/Utility.php | Utility.setCookie | public static function setCookie(
ResponseInterface $response,
/*# string */ $name,
/*# string */ $value = null,
/*# int */ $ttl = null,
/*# string */ $path = null,
/*# string */ $domain = null,
/*# bool */ $secure = false,
/*# bool */ $httponly = true
... | php | public static function setCookie(
ResponseInterface $response,
/*# string */ $name,
/*# string */ $value = null,
/*# int */ $ttl = null,
/*# string */ $path = null,
/*# string */ $domain = null,
/*# bool */ $secure = false,
/*# bool */ $httponly = true
... | [
"public",
"static",
"function",
"setCookie",
"(",
"ResponseInterface",
"$",
"response",
",",
"/*# string */",
"$",
"name",
",",
"/*# string */",
"$",
"value",
"=",
"null",
",",
"/*# int */",
"$",
"ttl",
"=",
"null",
",",
"/*# string */",
"$",
"path",
"=",
"n... | Set a cookie in the response
@param ResponseInterface $response
@param string $name
@param string $value
@param int $ttl
@param string $path
@param string $domain
@param bool $secure
@param bool $httponly
@return ResponseInterface
@access public | [
"Set",
"a",
"cookie",
"in",
"the",
"response"
] | 518e97ae48077f2c11adcd3c2393830ed7ab7ce7 | https://github.com/phossa2/middleware/blob/518e97ae48077f2c11adcd3c2393830ed7ab7ce7/src/Middleware/Utility.php#L47-L70 |
16,278 | phossa2/middleware | src/Middleware/Utility.php | Utility.unsetCookie | public static function unsetCookie(
ResponseInterface $response,
/*# string */ $name,
/*# string */ $path = null
)/*# : ResponseInterface */ {
return self::setCookie($response, $name, '', time() - 86400, $path);
} | php | public static function unsetCookie(
ResponseInterface $response,
/*# string */ $name,
/*# string */ $path = null
)/*# : ResponseInterface */ {
return self::setCookie($response, $name, '', time() - 86400, $path);
} | [
"public",
"static",
"function",
"unsetCookie",
"(",
"ResponseInterface",
"$",
"response",
",",
"/*# string */",
"$",
"name",
",",
"/*# string */",
"$",
"path",
"=",
"null",
")",
"/*# : ResponseInterface */",
"{",
"return",
"self",
"::",
"setCookie",
"(",
"$",
"r... | Unset a cookie
@param ResponseInterface $response
@param string $name
@param string $path
@return ResponseInterface
@access public | [
"Unset",
"a",
"cookie"
] | 518e97ae48077f2c11adcd3c2393830ed7ab7ce7 | https://github.com/phossa2/middleware/blob/518e97ae48077f2c11adcd3c2393830ed7ab7ce7/src/Middleware/Utility.php#L81-L87 |
16,279 | phossa2/middleware | src/Middleware/Utility.php | Utility.publicCache | public static function publicCache(
ResponseInterface $response,
/*# int */ $cacheTime = 120
)/*# : ResponseInterface */ {
$maxAge = $cacheTime * 60;
return $response
->withAddedHeader('Expires', self::timeStamp($maxAge))
->withAddedHeader('Cache-Control', "pu... | php | public static function publicCache(
ResponseInterface $response,
/*# int */ $cacheTime = 120
)/*# : ResponseInterface */ {
$maxAge = $cacheTime * 60;
return $response
->withAddedHeader('Expires', self::timeStamp($maxAge))
->withAddedHeader('Cache-Control', "pu... | [
"public",
"static",
"function",
"publicCache",
"(",
"ResponseInterface",
"$",
"response",
",",
"/*# int */",
"$",
"cacheTime",
"=",
"120",
")",
"/*# : ResponseInterface */",
"{",
"$",
"maxAge",
"=",
"$",
"cacheTime",
"*",
"60",
";",
"return",
"$",
"response",
... | Set public cache header
@param ResponseInterface $response
@param int $cacheTime cache time in minutes
@return ResponseInterface
@access public | [
"Set",
"public",
"cache",
"header"
] | 518e97ae48077f2c11adcd3c2393830ed7ab7ce7 | https://github.com/phossa2/middleware/blob/518e97ae48077f2c11adcd3c2393830ed7ab7ce7/src/Middleware/Utility.php#L97-L106 |
16,280 | phossa2/middleware | src/Middleware/Utility.php | Utility.privateNoExpireCache | public static function privateNoExpireCache(
ResponseInterface $response,
/*# int */ $cacheTime = 120
)/*# : ResponseInterface */ {
$maxAge = $cacheTime * 60;
return $response
->withAddedHeader('Cache-Control', "private, max-age={$maxAge}, pre-check={$maxAge}")
... | php | public static function privateNoExpireCache(
ResponseInterface $response,
/*# int */ $cacheTime = 120
)/*# : ResponseInterface */ {
$maxAge = $cacheTime * 60;
return $response
->withAddedHeader('Cache-Control', "private, max-age={$maxAge}, pre-check={$maxAge}")
... | [
"public",
"static",
"function",
"privateNoExpireCache",
"(",
"ResponseInterface",
"$",
"response",
",",
"/*# int */",
"$",
"cacheTime",
"=",
"120",
")",
"/*# : ResponseInterface */",
"{",
"$",
"maxAge",
"=",
"$",
"cacheTime",
"*",
"60",
";",
"return",
"$",
"resp... | Set private_no_expire cache header
@param ResponseInterface $response
@param int $cacheTime cache time in minutes
@return ResponseInterface
@access public | [
"Set",
"private_no_expire",
"cache",
"header"
] | 518e97ae48077f2c11adcd3c2393830ed7ab7ce7 | https://github.com/phossa2/middleware/blob/518e97ae48077f2c11adcd3c2393830ed7ab7ce7/src/Middleware/Utility.php#L116-L124 |
16,281 | pipelinersales/pipeliner-php-sdk | src/PipelinerSales/ApiClient/Http/PipelinerHttpException.php | PipelinerHttpException.getErrorMessage | public function getErrorMessage()
{
if (is_string($this->jsonError)) {
return $this->jsonError;
} elseif (isset($this->jsonError['message'])) {
return $this->jsonError['message'];
}
return '';
} | php | public function getErrorMessage()
{
if (is_string($this->jsonError)) {
return $this->jsonError;
} elseif (isset($this->jsonError['message'])) {
return $this->jsonError['message'];
}
return '';
} | [
"public",
"function",
"getErrorMessage",
"(",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"this",
"->",
"jsonError",
")",
")",
"{",
"return",
"$",
"this",
"->",
"jsonError",
";",
"}",
"elseif",
"(",
"isset",
"(",
"$",
"this",
"->",
"jsonError",
"[",
... | The error message specified in the API, or an empty string if not available.
@return string | [
"The",
"error",
"message",
"specified",
"in",
"the",
"API",
"or",
"an",
"empty",
"string",
"if",
"not",
"available",
"."
] | a020149ffde815be17634542010814cf854c3d5f | https://github.com/pipelinersales/pipeliner-php-sdk/blob/a020149ffde815be17634542010814cf854c3d5f/src/PipelinerSales/ApiClient/Http/PipelinerHttpException.php#L67-L75 |
16,282 | codeburnerframework/router | src/Route.php | Route.reset | public function reset()
{
return $this->collector->set($this->method, $this->pattern, $this->action)->nth(0)
->setStrategy($this->strategy)->setParams($this->params)
->setDefaults($this->defaults)->setMetadataArray($this->metadata);
} | php | public function reset()
{
return $this->collector->set($this->method, $this->pattern, $this->action)->nth(0)
->setStrategy($this->strategy)->setParams($this->params)
->setDefaults($this->defaults)->setMetadataArray($this->metadata);
} | [
"public",
"function",
"reset",
"(",
")",
"{",
"return",
"$",
"this",
"->",
"collector",
"->",
"set",
"(",
"$",
"this",
"->",
"method",
",",
"$",
"this",
"->",
"pattern",
",",
"$",
"this",
"->",
"action",
")",
"->",
"nth",
"(",
"0",
")",
"->",
"se... | Clone this route and set it into the collector.
@return Route | [
"Clone",
"this",
"route",
"and",
"set",
"it",
"into",
"the",
"collector",
"."
] | 2b0e8030303dd08d3fadfc4c57aa37b184a408cd | https://github.com/codeburnerframework/router/blob/2b0e8030303dd08d3fadfc4c57aa37b184a408cd/src/Route.php#L139-L144 |
16,283 | codeburnerframework/router | src/Route.php | Route.call | public function call(callable $container = null)
{
$this->action = $this->buildCallable($this->action, $container);
if ($this->strategy === null) {
return call_user_func_array($this->action, array_merge($this->defaults, $this->params));
}
if (!is_object($this->strategy)... | php | public function call(callable $container = null)
{
$this->action = $this->buildCallable($this->action, $container);
if ($this->strategy === null) {
return call_user_func_array($this->action, array_merge($this->defaults, $this->params));
}
if (!is_object($this->strategy)... | [
"public",
"function",
"call",
"(",
"callable",
"$",
"container",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"action",
"=",
"$",
"this",
"->",
"buildCallable",
"(",
"$",
"this",
"->",
"action",
",",
"$",
"container",
")",
";",
"if",
"(",
"$",
"this",
... | Execute the route action, if no strategy was provided the action
will be executed by the call_user_func PHP function.
@param callable $container
@throws BadRouteException
@return mixed | [
"Execute",
"the",
"route",
"action",
"if",
"no",
"strategy",
"was",
"provided",
"the",
"action",
"will",
"be",
"executed",
"by",
"the",
"call_user_func",
"PHP",
"function",
"."
] | 2b0e8030303dd08d3fadfc4c57aa37b184a408cd | https://github.com/codeburnerframework/router/blob/2b0e8030303dd08d3fadfc4c57aa37b184a408cd/src/Route.php#L167-L182 |
16,284 | codeburnerframework/router | src/Route.php | Route.parseCallableController | private function parseCallableController($controller, $container)
{
$controller = rtrim($this->namespace, "\\") . "\\" . $this->parseCallablePlaceholders($controller);
if ($container === null) {
return new $controller;
} else return $container($controller);
} | php | private function parseCallableController($controller, $container)
{
$controller = rtrim($this->namespace, "\\") . "\\" . $this->parseCallablePlaceholders($controller);
if ($container === null) {
return new $controller;
} else return $container($controller);
} | [
"private",
"function",
"parseCallableController",
"(",
"$",
"controller",
",",
"$",
"container",
")",
"{",
"$",
"controller",
"=",
"rtrim",
"(",
"$",
"this",
"->",
"namespace",
",",
"\"\\\\\"",
")",
".",
"\"\\\\\"",
".",
"$",
"this",
"->",
"parseCallablePlac... | Get the controller object.
@param string $controller
@param callable $container
@return Object | [
"Get",
"the",
"controller",
"object",
"."
] | 2b0e8030303dd08d3fadfc4c57aa37b184a408cd | https://github.com/codeburnerframework/router/blob/2b0e8030303dd08d3fadfc4c57aa37b184a408cd/src/Route.php#L224-L231 |
16,285 | codeburnerframework/router | src/Route.php | Route.parseCallablePlaceholders | private function parseCallablePlaceholders($fragment)
{
if (strpos($fragment, "{") !== false) {
foreach ($this->params as $placeholder => $value) {
if (strpos($fragment, "{" . $placeholder . "}") !== false) {
$fragment = str_replace("{" . $placeholder . "}", u... | php | private function parseCallablePlaceholders($fragment)
{
if (strpos($fragment, "{") !== false) {
foreach ($this->params as $placeholder => $value) {
if (strpos($fragment, "{" . $placeholder . "}") !== false) {
$fragment = str_replace("{" . $placeholder . "}", u... | [
"private",
"function",
"parseCallablePlaceholders",
"(",
"$",
"fragment",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"fragment",
",",
"\"{\"",
")",
"!==",
"false",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"params",
"as",
"$",
"placeholder",
"=>",
"$",
... | Parse and replace dynamic content on route action.
@param string $fragment Part of callable
@return string | [
"Parse",
"and",
"replace",
"dynamic",
"content",
"on",
"route",
"action",
"."
] | 2b0e8030303dd08d3fadfc4c57aa37b184a408cd | https://github.com/codeburnerframework/router/blob/2b0e8030303dd08d3fadfc4c57aa37b184a408cd/src/Route.php#L240-L251 |
16,286 | codeburnerframework/router | src/Route.php | Route.callWithStrategy | private function callWithStrategy()
{
if ($this->strategy instanceof StrategyInterface) {
if ($this->strategy instanceof MatcherAwareInterface) {
$this->strategy->setMatcher($this->matcher);
}
return $this->strategy->call($this);
}
throw ... | php | private function callWithStrategy()
{
if ($this->strategy instanceof StrategyInterface) {
if ($this->strategy instanceof MatcherAwareInterface) {
$this->strategy->setMatcher($this->matcher);
}
return $this->strategy->call($this);
}
throw ... | [
"private",
"function",
"callWithStrategy",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"strategy",
"instanceof",
"StrategyInterface",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"strategy",
"instanceof",
"MatcherAwareInterface",
")",
"{",
"$",
"this",
"->",
"st... | Execute the route action with the given strategy.
@throws BadRouteException
@return mixed | [
"Execute",
"the",
"route",
"action",
"with",
"the",
"given",
"strategy",
"."
] | 2b0e8030303dd08d3fadfc4c57aa37b184a408cd | https://github.com/codeburnerframework/router/blob/2b0e8030303dd08d3fadfc4c57aa37b184a408cd/src/Route.php#L260-L271 |
16,287 | codeburnerframework/router | src/Route.php | Route.setConstraint | public function setConstraint($token, $regex)
{
$initPos = strpos($this->pattern, "{" . $token);
if ($initPos !== false) {
$endPos = strpos($this->pattern, "}", $initPos);
$newPattern = substr_replace($this->pattern, "{" . "$token:$regex" . "}", $initPos, $endPos - $initPos ... | php | public function setConstraint($token, $regex)
{
$initPos = strpos($this->pattern, "{" . $token);
if ($initPos !== false) {
$endPos = strpos($this->pattern, "}", $initPos);
$newPattern = substr_replace($this->pattern, "{" . "$token:$regex" . "}", $initPos, $endPos - $initPos ... | [
"public",
"function",
"setConstraint",
"(",
"$",
"token",
",",
"$",
"regex",
")",
"{",
"$",
"initPos",
"=",
"strpos",
"(",
"$",
"this",
"->",
"pattern",
",",
"\"{\"",
".",
"$",
"token",
")",
";",
"if",
"(",
"$",
"initPos",
"!==",
"false",
")",
"{",... | Set a constraint to a token in the route pattern.
@param string $token
@param string $regex
@return self | [
"Set",
"a",
"constraint",
"to",
"a",
"token",
"in",
"the",
"route",
"pattern",
"."
] | 2b0e8030303dd08d3fadfc4c57aa37b184a408cd | https://github.com/codeburnerframework/router/blob/2b0e8030303dd08d3fadfc4c57aa37b184a408cd/src/Route.php#L627-L640 |
16,288 | prooph/link-app-core | src/SharedKernel/ApplicationDataTypeLocation.php | ApplicationDataTypeLocation.addDataTypeClass | public function addDataTypeClass($dataTypeFQCN, $classContent, $replace = false)
{
if (strpos($dataTypeFQCN, "Prooph\\Link\\Application\\DataType\\") !== 0) {
throw new \InvalidArgumentException("Namespace of data type should start with Prooph\\Link\\Application\\DataType\\. Got " . $dataTypeFQC... | php | public function addDataTypeClass($dataTypeFQCN, $classContent, $replace = false)
{
if (strpos($dataTypeFQCN, "Prooph\\Link\\Application\\DataType\\") !== 0) {
throw new \InvalidArgumentException("Namespace of data type should start with Prooph\\Link\\Application\\DataType\\. Got " . $dataTypeFQC... | [
"public",
"function",
"addDataTypeClass",
"(",
"$",
"dataTypeFQCN",
",",
"$",
"classContent",
",",
"$",
"replace",
"=",
"false",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"dataTypeFQCN",
",",
"\"Prooph\\\\Link\\\\Application\\\\DataType\\\\\"",
")",
"!==",
"0",
"... | Writes the given class content to a class file named after the class.
The root directory is defined by the path of ApplicationDataTypeLocation.
The namespace of the class should start with Application\DataType\
If more sub namespaces are defined, the method creates a directory for each
namespace part if not already exi... | [
"Writes",
"the",
"given",
"class",
"content",
"to",
"a",
"class",
"file",
"named",
"after",
"the",
"class",
".",
"The",
"root",
"directory",
"is",
"defined",
"by",
"the",
"path",
"of",
"ApplicationDataTypeLocation",
".",
"The",
"namespace",
"of",
"the",
"cla... | 835a5945dfa7be7b2cebfa6e84e757ecfd783357 | https://github.com/prooph/link-app-core/blob/835a5945dfa7be7b2cebfa6e84e757ecfd783357/src/SharedKernel/ApplicationDataTypeLocation.php#L43-L70 |
16,289 | czim/laravel-pxlcms | src/Generator/Analyzer/Steps/ResolveModuleNames.php | ResolveModuleNames.checkForDuplicateNames | protected function checkForDuplicateNames()
{
$normalized = [];
foreach ($this->data->rawData['modules'] as $moduleId => $module) {
$normalized[ $moduleId ] = $this->normalizeName(
array_get($module, 'prefixed_name') ?: $module['name']
);
}
r... | php | protected function checkForDuplicateNames()
{
$normalized = [];
foreach ($this->data->rawData['modules'] as $moduleId => $module) {
$normalized[ $moduleId ] = $this->normalizeName(
array_get($module, 'prefixed_name') ?: $module['name']
);
}
r... | [
"protected",
"function",
"checkForDuplicateNames",
"(",
")",
"{",
"$",
"normalized",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"data",
"->",
"rawData",
"[",
"'modules'",
"]",
"as",
"$",
"moduleId",
"=>",
"$",
"module",
")",
"{",
"$",
"norm... | Checks all modules for conflicting module names, and returns modules per
duplicate set.
@return array | [
"Checks",
"all",
"modules",
"for",
"conflicting",
"module",
"names",
"and",
"returns",
"modules",
"per",
"duplicate",
"set",
"."
] | 910297d2a3f2db86dde51b0e10fe5aad45f1aa1a | https://github.com/czim/laravel-pxlcms/blob/910297d2a3f2db86dde51b0e10fe5aad45f1aa1a/src/Generator/Analyzer/Steps/ResolveModuleNames.php#L102-L113 |
16,290 | czim/laravel-pxlcms | src/Generator/Analyzer/Steps/ResolveModuleNames.php | ResolveModuleNames.addOrInjectSectionNamePrefix | protected function addOrInjectSectionNamePrefix($moduleId)
{
$module = $this->data->rawData['modules'][ $moduleId ];
$prefix = $module['parent_names']['section'];
// mark so we don't prefix it twice
$this->modulePrefixedSection[$moduleId] = true;
// simple prefix if nothing... | php | protected function addOrInjectSectionNamePrefix($moduleId)
{
$module = $this->data->rawData['modules'][ $moduleId ];
$prefix = $module['parent_names']['section'];
// mark so we don't prefix it twice
$this->modulePrefixedSection[$moduleId] = true;
// simple prefix if nothing... | [
"protected",
"function",
"addOrInjectSectionNamePrefix",
"(",
"$",
"moduleId",
")",
"{",
"$",
"module",
"=",
"$",
"this",
"->",
"data",
"->",
"rawData",
"[",
"'modules'",
"]",
"[",
"$",
"moduleId",
"]",
";",
"$",
"prefix",
"=",
"$",
"module",
"[",
"'pare... | Prefixes module name with section name, keeping into account whether
other, higher-level prefixes have been applied
@param int $moduleId | [
"Prefixes",
"module",
"name",
"with",
"section",
"name",
"keeping",
"into",
"account",
"whether",
"other",
"higher",
"-",
"level",
"prefixes",
"have",
"been",
"applied"
] | 910297d2a3f2db86dde51b0e10fe5aad45f1aa1a | https://github.com/czim/laravel-pxlcms/blob/910297d2a3f2db86dde51b0e10fe5aad45f1aa1a/src/Generator/Analyzer/Steps/ResolveModuleNames.php#L161-L200 |
16,291 | czim/laravel-pxlcms | src/Generator/Analyzer/Steps/ResolveModuleNames.php | ResolveModuleNames.addOrInjectGroupNamePrefix | protected function addOrInjectGroupNamePrefix($moduleId)
{
$module = $this->data->rawData['modules'][ $moduleId ];
$prefix = $module['parent_names']['group'];
// mark so we don't prefix it twice
$this->modulePrefixedGroup[$moduleId] = true;
// simple prefix if nothing else ... | php | protected function addOrInjectGroupNamePrefix($moduleId)
{
$module = $this->data->rawData['modules'][ $moduleId ];
$prefix = $module['parent_names']['group'];
// mark so we don't prefix it twice
$this->modulePrefixedGroup[$moduleId] = true;
// simple prefix if nothing else ... | [
"protected",
"function",
"addOrInjectGroupNamePrefix",
"(",
"$",
"moduleId",
")",
"{",
"$",
"module",
"=",
"$",
"this",
"->",
"data",
"->",
"rawData",
"[",
"'modules'",
"]",
"[",
"$",
"moduleId",
"]",
";",
"$",
"prefix",
"=",
"$",
"module",
"[",
"'parent... | Prefixes module name with group name, keeping into account whether
other, higher-level prefixes have been applied
@param int $moduleId | [
"Prefixes",
"module",
"name",
"with",
"group",
"name",
"keeping",
"into",
"account",
"whether",
"other",
"higher",
"-",
"level",
"prefixes",
"have",
"been",
"applied"
] | 910297d2a3f2db86dde51b0e10fe5aad45f1aa1a | https://github.com/czim/laravel-pxlcms/blob/910297d2a3f2db86dde51b0e10fe5aad45f1aa1a/src/Generator/Analyzer/Steps/ResolveModuleNames.php#L208-L246 |
16,292 | czim/laravel-pxlcms | src/Generator/Analyzer/Steps/ResolveModuleNames.php | ResolveModuleNames.addOrInjectMenuNamePrefix | protected function addOrInjectMenuNamePrefix($moduleId)
{
$module = $this->data->rawData['modules'][ $moduleId ];
$prefix = $module['parent_names']['menu'];
// mark so we don't prefix it twice
$this->modulePrefixedMenu[$moduleId] = true;
// this is always a simple prefix
... | php | protected function addOrInjectMenuNamePrefix($moduleId)
{
$module = $this->data->rawData['modules'][ $moduleId ];
$prefix = $module['parent_names']['menu'];
// mark so we don't prefix it twice
$this->modulePrefixedMenu[$moduleId] = true;
// this is always a simple prefix
... | [
"protected",
"function",
"addOrInjectMenuNamePrefix",
"(",
"$",
"moduleId",
")",
"{",
"$",
"module",
"=",
"$",
"this",
"->",
"data",
"->",
"rawData",
"[",
"'modules'",
"]",
"[",
"$",
"moduleId",
"]",
";",
"$",
"prefix",
"=",
"$",
"module",
"[",
"'parent_... | Prefixes module name with menu name, keeping into account whether
other, higher-level prefixes have been applied
@param int $moduleId | [
"Prefixes",
"module",
"name",
"with",
"menu",
"name",
"keeping",
"into",
"account",
"whether",
"other",
"higher",
"-",
"level",
"prefixes",
"have",
"been",
"applied"
] | 910297d2a3f2db86dde51b0e10fe5aad45f1aa1a | https://github.com/czim/laravel-pxlcms/blob/910297d2a3f2db86dde51b0e10fe5aad45f1aa1a/src/Generator/Analyzer/Steps/ResolveModuleNames.php#L254-L268 |
16,293 | czim/laravel-pxlcms | src/Generator/Analyzer/Steps/ResolveModuleNames.php | ResolveModuleNames.addModuleIdPostFix | protected function addModuleIdPostFix($moduleId)
{
// undo previously applied prefixes (if any)
$this->data->rawData['modules'][ $moduleId ]['prefixed_name'] = null;
$this->prefixModuleName($moduleId);
// postfix the module ID
$module = $this->data->rawData['modules'][ $modu... | php | protected function addModuleIdPostFix($moduleId)
{
// undo previously applied prefixes (if any)
$this->data->rawData['modules'][ $moduleId ]['prefixed_name'] = null;
$this->prefixModuleName($moduleId);
// postfix the module ID
$module = $this->data->rawData['modules'][ $modu... | [
"protected",
"function",
"addModuleIdPostFix",
"(",
"$",
"moduleId",
")",
"{",
"// undo previously applied prefixes (if any)",
"$",
"this",
"->",
"data",
"->",
"rawData",
"[",
"'modules'",
"]",
"[",
"$",
"moduleId",
"]",
"[",
"'prefixed_name'",
"]",
"=",
"null",
... | Postfixes the module name with the module ID, as a last resort to
making a unique module name.
Ideally this should undo any other attempts by prefixes, since
they are useless anyway.. but this might be tricky in edge cases.
You'd have to recheck for duplicates or trust the module IDs.
We'll do the latter for now.
@pa... | [
"Postfixes",
"the",
"module",
"name",
"with",
"the",
"module",
"ID",
"as",
"a",
"last",
"resort",
"to",
"making",
"a",
"unique",
"module",
"name",
"."
] | 910297d2a3f2db86dde51b0e10fe5aad45f1aa1a | https://github.com/czim/laravel-pxlcms/blob/910297d2a3f2db86dde51b0e10fe5aad45f1aa1a/src/Generator/Analyzer/Steps/ResolveModuleNames.php#L281-L292 |
16,294 | czim/laravel-pxlcms | src/Generator/Analyzer/Steps/ResolveModuleNames.php | ResolveModuleNames.getKeysForDuplicates | function getKeysForDuplicates(array $array)
{
$duplicates = $newArray = [];
foreach ($array as $key => $value) {
if ( ! isset($newArray[ $value ])) {
$newArray[ $value ] = $key;
continue;
}
if (isset($duplicates[ $value ])) {
... | php | function getKeysForDuplicates(array $array)
{
$duplicates = $newArray = [];
foreach ($array as $key => $value) {
if ( ! isset($newArray[ $value ])) {
$newArray[ $value ] = $key;
continue;
}
if (isset($duplicates[ $value ])) {
... | [
"function",
"getKeysForDuplicates",
"(",
"array",
"$",
"array",
")",
"{",
"$",
"duplicates",
"=",
"$",
"newArray",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"array",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
... | Returns the keys for values that occur more than once in an array
@param array $array
@return array | [
"Returns",
"the",
"keys",
"for",
"values",
"that",
"occur",
"more",
"than",
"once",
"in",
"an",
"array"
] | 910297d2a3f2db86dde51b0e10fe5aad45f1aa1a | https://github.com/czim/laravel-pxlcms/blob/910297d2a3f2db86dde51b0e10fe5aad45f1aa1a/src/Generator/Analyzer/Steps/ResolveModuleNames.php#L314-L336 |
16,295 | discophp/framework | core/classes/Paginate.class.php | Paginate.getPageUrl | public function getPageUrl($page){
$qs = '';
if($_SERVER['QUERY_STRING']){
$qs = '?' . $_SERVER['QUERY_STRING'];
}//if
return str_replace($this->fromFormat($this->currentPage),$this->fromFormat($page),$this->uri) . $qs;
} | php | public function getPageUrl($page){
$qs = '';
if($_SERVER['QUERY_STRING']){
$qs = '?' . $_SERVER['QUERY_STRING'];
}//if
return str_replace($this->fromFormat($this->currentPage),$this->fromFormat($page),$this->uri) . $qs;
} | [
"public",
"function",
"getPageUrl",
"(",
"$",
"page",
")",
"{",
"$",
"qs",
"=",
"''",
";",
"if",
"(",
"$",
"_SERVER",
"[",
"'QUERY_STRING'",
"]",
")",
"{",
"$",
"qs",
"=",
"'?'",
".",
"$",
"_SERVER",
"[",
"'QUERY_STRING'",
"]",
";",
"}",
"//if",
... | Get the url for a specified page number.
@param int $page The page number to build a link to.
@return string | [
"Get",
"the",
"url",
"for",
"a",
"specified",
"page",
"number",
"."
] | 40ff3ea5225810534195494dc6c21083da4d1356 | https://github.com/discophp/framework/blob/40ff3ea5225810534195494dc6c21083da4d1356/core/classes/Paginate.class.php#L240-L246 |
16,296 | discophp/framework | core/classes/Paginate.class.php | Paginate.getPrevUrls | public function getPrevUrls($floor = null){
if($floor){
$floor = $this->currentPage - $floor;
} else {
$floor = 1;
}//el
return $this->getRangeUrls($floor,$this->currentPage - 1);
} | php | public function getPrevUrls($floor = null){
if($floor){
$floor = $this->currentPage - $floor;
} else {
$floor = 1;
}//el
return $this->getRangeUrls($floor,$this->currentPage - 1);
} | [
"public",
"function",
"getPrevUrls",
"(",
"$",
"floor",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"floor",
")",
"{",
"$",
"floor",
"=",
"$",
"this",
"->",
"currentPage",
"-",
"$",
"floor",
";",
"}",
"else",
"{",
"$",
"floor",
"=",
"1",
";",
"}",
"... | Get paginated urls that come before the current page.
@param null|int $floor The max number of links to generate.
@return string[] | [
"Get",
"paginated",
"urls",
"that",
"come",
"before",
"the",
"current",
"page",
"."
] | 40ff3ea5225810534195494dc6c21083da4d1356 | https://github.com/discophp/framework/blob/40ff3ea5225810534195494dc6c21083da4d1356/core/classes/Paginate.class.php#L258-L268 |
16,297 | discophp/framework | core/classes/Paginate.class.php | Paginate.getNextUrls | public function getNextUrls($max = null){
if($max){
$max = $this->currentPage + $max;
} else {
$max = $this->totalPages;
}//el
return $this->getRangeUrls($this->currentPage + 1,$max);
} | php | public function getNextUrls($max = null){
if($max){
$max = $this->currentPage + $max;
} else {
$max = $this->totalPages;
}//el
return $this->getRangeUrls($this->currentPage + 1,$max);
} | [
"public",
"function",
"getNextUrls",
"(",
"$",
"max",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"max",
")",
"{",
"$",
"max",
"=",
"$",
"this",
"->",
"currentPage",
"+",
"$",
"max",
";",
"}",
"else",
"{",
"$",
"max",
"=",
"$",
"this",
"->",
"totalP... | Get paginated urls that come after the current page.
@param null|int $max The max number of links to generate.
@return string[] | [
"Get",
"paginated",
"urls",
"that",
"come",
"after",
"the",
"current",
"page",
"."
] | 40ff3ea5225810534195494dc6c21083da4d1356 | https://github.com/discophp/framework/blob/40ff3ea5225810534195494dc6c21083da4d1356/core/classes/Paginate.class.php#L280-L290 |
16,298 | discophp/framework | core/classes/Paginate.class.php | Paginate.getEasyMarkup | public function getEasyMarkup(){
$markup = '';
if($this->prevUrl){
$markup .= "<li class='pagination-previous' title='View previous page'><a href='{$this->prevUrl}'>prev</a></li>";
}//if
$pages = $this->getPrevUrls(5);
foreach($pages as $i => $page){
$... | php | public function getEasyMarkup(){
$markup = '';
if($this->prevUrl){
$markup .= "<li class='pagination-previous' title='View previous page'><a href='{$this->prevUrl}'>prev</a></li>";
}//if
$pages = $this->getPrevUrls(5);
foreach($pages as $i => $page){
$... | [
"public",
"function",
"getEasyMarkup",
"(",
")",
"{",
"$",
"markup",
"=",
"''",
";",
"if",
"(",
"$",
"this",
"->",
"prevUrl",
")",
"{",
"$",
"markup",
".=",
"\"<li class='pagination-previous' title='View previous page'><a href='{$this->prevUrl}'>prev</a></li>\"",
";",
... | Get a simple markup for a pagination feed.
@return string The pagination markup. | [
"Get",
"a",
"simple",
"markup",
"for",
"a",
"pagination",
"feed",
"."
] | 40ff3ea5225810534195494dc6c21083da4d1356 | https://github.com/discophp/framework/blob/40ff3ea5225810534195494dc6c21083da4d1356/core/classes/Paginate.class.php#L344-L374 |
16,299 | heyday/heystack | src/Output/Handler.php | Handler.process | public function process($identifier, \Controller $controller, $result = null)
{
if ($this->hasProcessor($identifier)) {
return $this->processors[$identifier]->process($controller, $result);
} else {
return false;
}
} | php | public function process($identifier, \Controller $controller, $result = null)
{
if ($this->hasProcessor($identifier)) {
return $this->processors[$identifier]->process($controller, $result);
} else {
return false;
}
} | [
"public",
"function",
"process",
"(",
"$",
"identifier",
",",
"\\",
"Controller",
"$",
"controller",
",",
"$",
"result",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasProcessor",
"(",
"$",
"identifier",
")",
")",
"{",
"return",
"$",
"this",
... | Process an output processor by identifier if it exists
@param string $identifier The identifier of the processor to run
@param \Controller $controller The controller that handled the request
@param mixed $result The result from the run input processor
@return mixed|null | [
"Process",
"an",
"output",
"processor",
"by",
"identifier",
"if",
"it",
"exists"
] | 2c051933f8c532d0a9a23be6ee1ff5c619e47dfe | https://github.com/heyday/heystack/blob/2c051933f8c532d0a9a23be6ee1ff5c619e47dfe/src/Output/Handler.php#L42-L49 |
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.