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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
205,200 | PhoxPHP/Glider | src/Query/Parameters.php | Parameters.getType | public function getType($parameter='')
{
$parameterType = null;
switch (gettype($parameter)) {
case 'string':
$parameterType = 's';
break;
case 'numeric':
case 'integer':
$parameterType = 'i';
break;
case 'double':
$parameterType = 'd';
break;
default:
$parameterType = nu... | php | public function getType($parameter='')
{
$parameterType = null;
switch (gettype($parameter)) {
case 'string':
$parameterType = 's';
break;
case 'numeric':
case 'integer':
$parameterType = 'i';
break;
case 'double':
$parameterType = 'd';
break;
default:
$parameterType = nu... | [
"public",
"function",
"getType",
"(",
"$",
"parameter",
"=",
"''",
")",
"{",
"$",
"parameterType",
"=",
"null",
";",
"switch",
"(",
"gettype",
"(",
"$",
"parameter",
")",
")",
"{",
"case",
"'string'",
":",
"$",
"parameterType",
"=",
"'s'",
";",
"break"... | Return a parameter type.
@param $paramter <Mixed>
@access public
@return <Mixed> | [
"Return",
"a",
"parameter",
"type",
"."
] | 17aaf3b7bb6e70ea3ae1f04e30a7690e884bf042 | https://github.com/PhoxPHP/Glider/blob/17aaf3b7bb6e70ea3ae1f04e30a7690e884bf042/src/Query/Parameters.php#L97-L117 |
205,201 | stratedge/wye | src/Wye.php | Wye.makeBinding | public static function makeBinding(
$parameter,
$value,
$data_type = PDO::PARAM_STR
) {
$binding = new Binding(new static, $parameter, $value, $data_type);
return $binding;
} | php | public static function makeBinding(
$parameter,
$value,
$data_type = PDO::PARAM_STR
) {
$binding = new Binding(new static, $parameter, $value, $data_type);
return $binding;
} | [
"public",
"static",
"function",
"makeBinding",
"(",
"$",
"parameter",
",",
"$",
"value",
",",
"$",
"data_type",
"=",
"PDO",
"::",
"PARAM_STR",
")",
"{",
"$",
"binding",
"=",
"new",
"Binding",
"(",
"new",
"static",
",",
"$",
"parameter",
",",
"$",
"valu... | Creates a new instance of Stratedge\Wye\Binding.
@param int|string $parameter
@param mixed $value
@param int $data_type
@return BindingInterface | [
"Creates",
"a",
"new",
"instance",
"of",
"Stratedge",
"\\",
"Wye",
"\\",
"Binding",
"."
] | 9d3d32b4ea56c711d67b8498ab1a05d0aded40ea | https://github.com/stratedge/wye/blob/9d3d32b4ea56c711d67b8498ab1a05d0aded40ea/src/Wye.php#L154-L161 |
205,202 | stratedge/wye | src/Wye.php | Wye.executeStatement | public static function executeStatement(
PDOStatement $statement,
array $params = null
) {
//Add the statement to the list of those run
static::addStatement($statement);
//Add bindings to the statement
if (is_array($params)) {
$statement->getBindings()
... | php | public static function executeStatement(
PDOStatement $statement,
array $params = null
) {
//Add the statement to the list of those run
static::addStatement($statement);
//Add bindings to the statement
if (is_array($params)) {
$statement->getBindings()
... | [
"public",
"static",
"function",
"executeStatement",
"(",
"PDOStatement",
"$",
"statement",
",",
"array",
"$",
"params",
"=",
"null",
")",
"{",
"//Add the statement to the list of those run",
"static",
"::",
"addStatement",
"(",
"$",
"statement",
")",
";",
"//Add bin... | Records a simulation of a query execution.
@todo Raise an error if there are parameters already bound and params are
provided.
@param PDOStatement $statement
@param array $params
@return void | [
"Records",
"a",
"simulation",
"of",
"a",
"query",
"execution",
"."
] | 9d3d32b4ea56c711d67b8498ab1a05d0aded40ea | https://github.com/stratedge/wye/blob/9d3d32b4ea56c711d67b8498ab1a05d0aded40ea/src/Wye.php#L219-L255 |
205,203 | stratedge/wye | src/Wye.php | Wye.beginTransaction | public static function beginTransaction()
{
if (static::inTransaction()) {
throw new PDOException();
}
static::inTransaction(true);
$transaction = static::makeTransaction(static::countTransactions());
static::addTransaction($transaction);
} | php | public static function beginTransaction()
{
if (static::inTransaction()) {
throw new PDOException();
}
static::inTransaction(true);
$transaction = static::makeTransaction(static::countTransactions());
static::addTransaction($transaction);
} | [
"public",
"static",
"function",
"beginTransaction",
"(",
")",
"{",
"if",
"(",
"static",
"::",
"inTransaction",
"(",
")",
")",
"{",
"throw",
"new",
"PDOException",
"(",
")",
";",
"}",
"static",
"::",
"inTransaction",
"(",
"true",
")",
";",
"$",
"transacti... | Places Wye into transaction mode and increments number of transactions.
If a transaction is already open, throws a PDOException
@todo Flesh out the details for the PDOException properly
@throws PDOException
@return void | [
"Places",
"Wye",
"into",
"transaction",
"mode",
"and",
"increments",
"number",
"of",
"transactions",
".",
"If",
"a",
"transaction",
"is",
"already",
"open",
"throws",
"a",
"PDOException"
] | 9d3d32b4ea56c711d67b8498ab1a05d0aded40ea | https://github.com/stratedge/wye/blob/9d3d32b4ea56c711d67b8498ab1a05d0aded40ea/src/Wye.php#L288-L299 |
205,204 | stratedge/wye | src/Wye.php | Wye.getOrCreateResultAt | public static function getOrCreateResultAt($index = 0)
{
$results = static::getResultAt($index);
if (is_null($results)) {
$results = static::makeResult()->attachAtIndex($index);
}
return $results;
} | php | public static function getOrCreateResultAt($index = 0)
{
$results = static::getResultAt($index);
if (is_null($results)) {
$results = static::makeResult()->attachAtIndex($index);
}
return $results;
} | [
"public",
"static",
"function",
"getOrCreateResultAt",
"(",
"$",
"index",
"=",
"0",
")",
"{",
"$",
"results",
"=",
"static",
"::",
"getResultAt",
"(",
"$",
"index",
")",
";",
"if",
"(",
"is_null",
"(",
"$",
"results",
")",
")",
"{",
"$",
"results",
"... | Retrieve a result at a specific index. If no result is found, a new,
blank result will be generated, stored at the index, and returned.
@param integer $index
@return Result | [
"Retrieve",
"a",
"result",
"at",
"a",
"specific",
"index",
".",
"If",
"no",
"result",
"is",
"found",
"a",
"new",
"blank",
"result",
"will",
"be",
"generated",
"stored",
"at",
"the",
"index",
"and",
"returned",
"."
] | 9d3d32b4ea56c711d67b8498ab1a05d0aded40ea | https://github.com/stratedge/wye/blob/9d3d32b4ea56c711d67b8498ab1a05d0aded40ea/src/Wye.php#L604-L613 |
205,205 | stratedge/wye | src/Wye.php | Wye.addResultAtIndex | public static function addResultAtIndex(Result $result, $index)
{
// Add result
$results = static::getResults();
$results[$index] = $result;
// Store results
static::setResults($results);
} | php | public static function addResultAtIndex(Result $result, $index)
{
// Add result
$results = static::getResults();
$results[$index] = $result;
// Store results
static::setResults($results);
} | [
"public",
"static",
"function",
"addResultAtIndex",
"(",
"Result",
"$",
"result",
",",
"$",
"index",
")",
"{",
"// Add result",
"$",
"results",
"=",
"static",
"::",
"getResults",
"(",
")",
";",
"$",
"results",
"[",
"$",
"index",
"]",
"=",
"$",
"result",
... | Attach a result at a specific index. If a result already exists the
current one will be replaced with the new one.
@param Result $result
@param integer $index | [
"Attach",
"a",
"result",
"at",
"a",
"specific",
"index",
".",
"If",
"a",
"result",
"already",
"exists",
"the",
"current",
"one",
"will",
"be",
"replaced",
"with",
"the",
"new",
"one",
"."
] | 9d3d32b4ea56c711d67b8498ab1a05d0aded40ea | https://github.com/stratedge/wye/blob/9d3d32b4ea56c711d67b8498ab1a05d0aded40ea/src/Wye.php#L642-L650 |
205,206 | phavour/phavour | Phavour/Helper/FileSystem/Directory.php | Directory.createPath | public function createPath($base, $path)
{
if (!is_dir($base) || !is_writable($base)) {
return false;
}
if (empty($path)) {
return false;
}
$pieces = explode(self::DS, $path);
$dir = $base;
foreach ($pieces as $directory) {
... | php | public function createPath($base, $path)
{
if (!is_dir($base) || !is_writable($base)) {
return false;
}
if (empty($path)) {
return false;
}
$pieces = explode(self::DS, $path);
$dir = $base;
foreach ($pieces as $directory) {
... | [
"public",
"function",
"createPath",
"(",
"$",
"base",
",",
"$",
"path",
")",
"{",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"base",
")",
"||",
"!",
"is_writable",
"(",
"$",
"base",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"empty",
"(",
... | Create a new path on top of a base directory
@param string $base
@param string $path
@return boolean | [
"Create",
"a",
"new",
"path",
"on",
"top",
"of",
"a",
"base",
"directory"
] | 2246f78203312eb2e23fdb0f776f790e81b4d20f | https://github.com/phavour/phavour/blob/2246f78203312eb2e23fdb0f776f790e81b4d20f/Phavour/Helper/FileSystem/Directory.php#L51-L83 |
205,207 | phavour/phavour | Phavour/Helper/FileSystem/Directory.php | Directory.recursivelyDeleteFromDirectory | public function recursivelyDeleteFromDirectory($baseDirectory)
{
if (!is_dir($baseDirectory)) {
return;
}
$iterator = new \RecursiveDirectoryIterator($baseDirectory);
$files = new \RecursiveIteratorIterator(
$iterator,
\RecursiveIteratorIterator::... | php | public function recursivelyDeleteFromDirectory($baseDirectory)
{
if (!is_dir($baseDirectory)) {
return;
}
$iterator = new \RecursiveDirectoryIterator($baseDirectory);
$files = new \RecursiveIteratorIterator(
$iterator,
\RecursiveIteratorIterator::... | [
"public",
"function",
"recursivelyDeleteFromDirectory",
"(",
"$",
"baseDirectory",
")",
"{",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"baseDirectory",
")",
")",
"{",
"return",
";",
"}",
"$",
"iterator",
"=",
"new",
"\\",
"RecursiveDirectoryIterator",
"(",
"$",
"b... | Recursively delete files and folders, when given a base path
@param string $baseDirectory
@return void | [
"Recursively",
"delete",
"files",
"and",
"folders",
"when",
"given",
"a",
"base",
"path"
] | 2246f78203312eb2e23fdb0f776f790e81b4d20f | https://github.com/phavour/phavour/blob/2246f78203312eb2e23fdb0f776f790e81b4d20f/Phavour/Helper/FileSystem/Directory.php#L90-L118 |
205,208 | villermen/runescape-lookup-commons | src/ActivityFeed/ActivityFeedItem.php | ActivityFeedItem.equals | public function equals(ActivityFeedItem $otherItem): bool
{
return $this->getTime()->format("Ymd") == $otherItem->getTime()->format("Ymd") &&
$this->getTitle() == $otherItem->getTitle() &&
$this->getDescription() == $otherItem->getDescription();
} | php | public function equals(ActivityFeedItem $otherItem): bool
{
return $this->getTime()->format("Ymd") == $otherItem->getTime()->format("Ymd") &&
$this->getTitle() == $otherItem->getTitle() &&
$this->getDescription() == $otherItem->getDescription();
} | [
"public",
"function",
"equals",
"(",
"ActivityFeedItem",
"$",
"otherItem",
")",
":",
"bool",
"{",
"return",
"$",
"this",
"->",
"getTime",
"(",
")",
"->",
"format",
"(",
"\"Ymd\"",
")",
"==",
"$",
"otherItem",
"->",
"getTime",
"(",
")",
"->",
"format",
... | Compares this feed item to another.
Only the date part of the time is compared, because adventurer's log feeds only contain accurate date parts.
@param ActivityFeedItem $otherItem
@return bool | [
"Compares",
"this",
"feed",
"item",
"to",
"another",
".",
"Only",
"the",
"date",
"part",
"of",
"the",
"time",
"is",
"compared",
"because",
"adventurer",
"s",
"log",
"feeds",
"only",
"contain",
"accurate",
"date",
"parts",
"."
] | 3e24dadbdc5e20b755280e5110f4ca0a1758b04c | https://github.com/villermen/runescape-lookup-commons/blob/3e24dadbdc5e20b755280e5110f4ca0a1758b04c/src/ActivityFeed/ActivityFeedItem.php#L61-L66 |
205,209 | valu-digital/valuso | src/ValuSo/Feature/IdentityTrait.php | IdentityTrait.getIdentity | public function getIdentity($spec = null, $default = null)
{
if ($spec !== null) {
return isset($this->identity[$spec]) ? $this->identity[$spec] : $default;
} else {
return $this->identity;
}
} | php | public function getIdentity($spec = null, $default = null)
{
if ($spec !== null) {
return isset($this->identity[$spec]) ? $this->identity[$spec] : $default;
} else {
return $this->identity;
}
} | [
"public",
"function",
"getIdentity",
"(",
"$",
"spec",
"=",
"null",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"spec",
"!==",
"null",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"identity",
"[",
"$",
"spec",
"]",
")",
"?... | Retrieve identity or identity spec
@param string|null $spec
@param mixed $default
@return \ArrayAccess|null | [
"Retrieve",
"identity",
"or",
"identity",
"spec"
] | c96bed0f6bd21551822334fe6cfe913a7436dd17 | https://github.com/valu-digital/valuso/blob/c96bed0f6bd21551822334fe6cfe913a7436dd17/src/ValuSo/Feature/IdentityTrait.php#L22-L29 |
205,210 | headzoo/web-tools | src/Headzoo/Web/Tools/Utils.php | Utils.normalizeHeaderName | public static function normalizeHeaderName($headerName, $stripX = false)
{
if (is_array($headerName)) {
array_walk($headerName, function(&$name) use($stripX) {
$name = self::normalizeHeaderName($name, $stripX);
});
} else {
$headerName = tr... | php | public static function normalizeHeaderName($headerName, $stripX = false)
{
if (is_array($headerName)) {
array_walk($headerName, function(&$name) use($stripX) {
$name = self::normalizeHeaderName($name, $stripX);
});
} else {
$headerName = tr... | [
"public",
"static",
"function",
"normalizeHeaderName",
"(",
"$",
"headerName",
",",
"$",
"stripX",
"=",
"false",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"headerName",
")",
")",
"{",
"array_walk",
"(",
"$",
"headerName",
",",
"function",
"(",
"&",
"$",... | Normalizes a header name
Changes the value of $headerName to the format "Camel-Case-String" from any other format. For example the
string "CONTENT_TYPE" becomes "Content-Type". Special cases are handled for header fields which typically
use non-standard formatting. For example the headers "XSS-Protection" and "ETag". ... | [
"Normalizes",
"a",
"header",
"name"
] | 305ce78029b86fa1fadaf8341d8fc737c84eab87 | https://github.com/headzoo/web-tools/blob/305ce78029b86fa1fadaf8341d8fc737c84eab87/src/Headzoo/Web/Tools/Utils.php#L76-L104 |
205,211 | headzoo/web-tools | src/Headzoo/Web/Tools/Utils.php | Utils.appendUrlQuery | public static function appendUrlQuery($url, $query)
{
if (is_array($query)) {
$query = http_build_query($query);
}
$query = ltrim($query, "?&");
$joiner = strpos($url, "?") === false ? "?" : "&";
return "{$url}{$joiner}{$query}";
} | php | public static function appendUrlQuery($url, $query)
{
if (is_array($query)) {
$query = http_build_query($query);
}
$query = ltrim($query, "?&");
$joiner = strpos($url, "?") === false ? "?" : "&";
return "{$url}{$joiner}{$query}";
} | [
"public",
"static",
"function",
"appendUrlQuery",
"(",
"$",
"url",
",",
"$",
"query",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"query",
")",
")",
"{",
"$",
"query",
"=",
"http_build_query",
"(",
"$",
"query",
")",
";",
"}",
"$",
"query",
"=",
"lt... | Appends the query string to the url
Used when you need to append a query string to a url which may already have
a query string. The $query argument be either a string, or an array.
Note: This method does not merge values from the query string which are already
in the url.
@param string $url The base rul
@pa... | [
"Appends",
"the",
"query",
"string",
"to",
"the",
"url"
] | 305ce78029b86fa1fadaf8341d8fc737c84eab87 | https://github.com/headzoo/web-tools/blob/305ce78029b86fa1fadaf8341d8fc737c84eab87/src/Headzoo/Web/Tools/Utils.php#L119-L128 |
205,212 | diasbruno/stc | lib/stc/MarkdownRender.php | MarkdownRender.render | public function render($template, $options = array())
{
$pre_render = view($template, $options);
$md = new \Parsedown();
return $md->text($pre_render);
} | php | public function render($template, $options = array())
{
$pre_render = view($template, $options);
$md = new \Parsedown();
return $md->text($pre_render);
} | [
"public",
"function",
"render",
"(",
"$",
"template",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"pre_render",
"=",
"view",
"(",
"$",
"template",
",",
"$",
"options",
")",
";",
"$",
"md",
"=",
"new",
"\\",
"Parsedown",
"(",
")",
... | Render the template with options.
@param $template string | The template name.
@param $options array | A hash with options to render.
@return string | [
"Render",
"the",
"template",
"with",
"options",
"."
] | 43f62c3b28167bff76274f954e235413a9e9c707 | https://github.com/diasbruno/stc/blob/43f62c3b28167bff76274f954e235413a9e9c707/lib/stc/MarkdownRender.php#L25-L31 |
205,213 | CandleLight-Project/Framework | src/Migration.php | Migration.execUp | public function execUp(string $name): void{
DB::connection('default')->table('migrations')->insert(['name' => $name]);
$this->up();
} | php | public function execUp(string $name): void{
DB::connection('default')->table('migrations')->insert(['name' => $name]);
$this->up();
} | [
"public",
"function",
"execUp",
"(",
"string",
"$",
"name",
")",
":",
"void",
"{",
"DB",
"::",
"connection",
"(",
"'default'",
")",
"->",
"table",
"(",
"'migrations'",
")",
"->",
"insert",
"(",
"[",
"'name'",
"=>",
"$",
"name",
"]",
")",
";",
"$",
... | Kicks of the Migration-Up Process | [
"Kicks",
"of",
"the",
"Migration",
"-",
"Up",
"Process"
] | 13c5cc34bd1118601406b0129f7b61c7b78d08f4 | https://github.com/CandleLight-Project/Framework/blob/13c5cc34bd1118601406b0129f7b61c7b78d08f4/src/Migration.php#L54-L57 |
205,214 | CandleLight-Project/Framework | src/Migration.php | Migration.execDown | public function execDown(string $name): void{
$this->down();
DB::connection('default')->table('migrations')->where('name', $name)->delete();
} | php | public function execDown(string $name): void{
$this->down();
DB::connection('default')->table('migrations')->where('name', $name)->delete();
} | [
"public",
"function",
"execDown",
"(",
"string",
"$",
"name",
")",
":",
"void",
"{",
"$",
"this",
"->",
"down",
"(",
")",
";",
"DB",
"::",
"connection",
"(",
"'default'",
")",
"->",
"table",
"(",
"'migrations'",
")",
"->",
"where",
"(",
"'name'",
","... | Kicks of the Migration-Down Process | [
"Kicks",
"of",
"the",
"Migration",
"-",
"Down",
"Process"
] | 13c5cc34bd1118601406b0129f7b61c7b78d08f4 | https://github.com/CandleLight-Project/Framework/blob/13c5cc34bd1118601406b0129f7b61c7b78d08f4/src/Migration.php#L62-L65 |
205,215 | CandleLight-Project/Framework | src/Migration.php | Migration.hasMigrated | public static function hasMigrated(string $name){
$res = DB::connection('default')->table('migrations')->where('name', $name)->first();
return !is_null($res);
} | php | public static function hasMigrated(string $name){
$res = DB::connection('default')->table('migrations')->where('name', $name)->first();
return !is_null($res);
} | [
"public",
"static",
"function",
"hasMigrated",
"(",
"string",
"$",
"name",
")",
"{",
"$",
"res",
"=",
"DB",
"::",
"connection",
"(",
"'default'",
")",
"->",
"table",
"(",
"'migrations'",
")",
"->",
"where",
"(",
"'name'",
",",
"$",
"name",
")",
"->",
... | Checks if the given migration has been done already
@param string $name
@return bool | [
"Checks",
"if",
"the",
"given",
"migration",
"has",
"been",
"done",
"already"
] | 13c5cc34bd1118601406b0129f7b61c7b78d08f4 | https://github.com/CandleLight-Project/Framework/blob/13c5cc34bd1118601406b0129f7b61c7b78d08f4/src/Migration.php#L82-L85 |
205,216 | CandleLight-Project/Framework | src/Migration.php | Migration.getLastMigration | public static function getLastMigration(App $app){
$res = DB::connection('default')->table('migrations')->orderBy('id', 'desc')->first();
if (is_null($res) || !$app->hasMigration($res->name)){
return false;
}
return $res->name;
} | php | public static function getLastMigration(App $app){
$res = DB::connection('default')->table('migrations')->orderBy('id', 'desc')->first();
if (is_null($res) || !$app->hasMigration($res->name)){
return false;
}
return $res->name;
} | [
"public",
"static",
"function",
"getLastMigration",
"(",
"App",
"$",
"app",
")",
"{",
"$",
"res",
"=",
"DB",
"::",
"connection",
"(",
"'default'",
")",
"->",
"table",
"(",
"'migrations'",
")",
"->",
"orderBy",
"(",
"'id'",
",",
"'desc'",
")",
"->",
"fi... | Returns the last migration-name, which has been done
@param App $app CDL Application instance
@return string|bool migration name or false if no migrations have been found | [
"Returns",
"the",
"last",
"migration",
"-",
"name",
"which",
"has",
"been",
"done"
] | 13c5cc34bd1118601406b0129f7b61c7b78d08f4 | https://github.com/CandleLight-Project/Framework/blob/13c5cc34bd1118601406b0129f7b61c7b78d08f4/src/Migration.php#L92-L98 |
205,217 | CandleLight-Project/Framework | src/Migration.php | Migration.prepareMigrationTable | public static function prepareMigrationTable(App $app): void{
$migration = new class($app) extends Migration{
/**
* Create the migration table if it does not exist yet
*/
public function up(): void{
$schema = $this->getSchema('default');
... | php | public static function prepareMigrationTable(App $app): void{
$migration = new class($app) extends Migration{
/**
* Create the migration table if it does not exist yet
*/
public function up(): void{
$schema = $this->getSchema('default');
... | [
"public",
"static",
"function",
"prepareMigrationTable",
"(",
"App",
"$",
"app",
")",
":",
"void",
"{",
"$",
"migration",
"=",
"new",
"class",
"(",
"$",
"app",
")",
"extends",
"Migration",
"{",
"/**\n * Create the migration table if it does not exist yet\n... | Prepares the migration table
@param App $app | [
"Prepares",
"the",
"migration",
"table"
] | 13c5cc34bd1118601406b0129f7b61c7b78d08f4 | https://github.com/CandleLight-Project/Framework/blob/13c5cc34bd1118601406b0129f7b61c7b78d08f4/src/Migration.php#L104-L128 |
205,218 | UnionOfRAD/li3_quality | qa/rules/syntax/HasExplicitPropertyAndMethodVisibility.php | HasExplicitPropertyAndMethodVisibility.apply | public function apply($testable, array $config = array()) {
$message = '{:name} has no declared visibility.';
$tokens = $testable->tokens();
$classes = $testable->findAll(array(T_CLASS));
$filtered = $testable->findAll($this->inspectableTokens);
foreach ($classes as $classId) {
$children = $tokens[$classI... | php | public function apply($testable, array $config = array()) {
$message = '{:name} has no declared visibility.';
$tokens = $testable->tokens();
$classes = $testable->findAll(array(T_CLASS));
$filtered = $testable->findAll($this->inspectableTokens);
foreach ($classes as $classId) {
$children = $tokens[$classI... | [
"public",
"function",
"apply",
"(",
"$",
"testable",
",",
"array",
"$",
"config",
"=",
"array",
"(",
")",
")",
"{",
"$",
"message",
"=",
"'{:name} has no declared visibility.'",
";",
"$",
"tokens",
"=",
"$",
"testable",
"->",
"tokens",
"(",
")",
";",
"$"... | Will iterate all the tokens looking for tokens in inspectableTokens
The token needs an access modifier if it is a T_FUNCTION or T_VARIABLE
and is in the first level of T_CLASS. This prevents functions and variables
inside methods and outside classes to register violations.
@param Testable $testable The testable objec... | [
"Will",
"iterate",
"all",
"the",
"tokens",
"looking",
"for",
"tokens",
"in",
"inspectableTokens",
"The",
"token",
"needs",
"an",
"access",
"modifier",
"if",
"it",
"is",
"a",
"T_FUNCTION",
"or",
"T_VARIABLE",
"and",
"is",
"in",
"the",
"first",
"level",
"of",
... | acb72a43ae835e6d200bc0eba1a61aee610e36bf | https://github.com/UnionOfRAD/li3_quality/blob/acb72a43ae835e6d200bc0eba1a61aee610e36bf/qa/rules/syntax/HasExplicitPropertyAndMethodVisibility.php#L46-L70 |
205,219 | Etenil/assegai | src/assegai/modules/validator/Validator.php | Validator.email | public function email($message = null)
{
$this->setRule(__FUNCTION__, function($email)
{
if (strlen($email) == 0) return true;
$isValid = true;
$atIndex = strrpos($email, '@');
... | php | public function email($message = null)
{
$this->setRule(__FUNCTION__, function($email)
{
if (strlen($email) == 0) return true;
$isValid = true;
$atIndex = strrpos($email, '@');
... | [
"public",
"function",
"email",
"(",
"$",
"message",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"setRule",
"(",
"__FUNCTION__",
",",
"function",
"(",
"$",
"email",
")",
"{",
"if",
"(",
"strlen",
"(",
"$",
"email",
")",
"==",
"0",
")",
"return",
"true... | Field, if completed, has to be a valid email address.
@param string $message
@return FormValidator | [
"Field",
"if",
"completed",
"has",
"to",
"be",
"a",
"valid",
"email",
"address",
"."
] | d43cce1a88f1c332f60dd0a4374b17764852af9e | https://github.com/Etenil/assegai/blob/d43cce1a88f1c332f60dd0a4374b17764852af9e/src/assegai/modules/validator/Validator.php#L65-L122 |
205,220 | Etenil/assegai | src/assegai/modules/validator/Validator.php | Validator.required | public function required($message = null)
{
$this->setRule(__FUNCTION__, function($val)
{
if (is_scalar($val)) {
$val = trim($val);
}
return !empty($val);
... | php | public function required($message = null)
{
$this->setRule(__FUNCTION__, function($val)
{
if (is_scalar($val)) {
$val = trim($val);
}
return !empty($val);
... | [
"public",
"function",
"required",
"(",
"$",
"message",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"setRule",
"(",
"__FUNCTION__",
",",
"function",
"(",
"$",
"val",
")",
"{",
"if",
"(",
"is_scalar",
"(",
"$",
"val",
")",
")",
"{",
"$",
"val",
"=",
... | Field must be filled in.
@param string $message
@return FormValidator | [
"Field",
"must",
"be",
"filled",
"in",
"."
] | d43cce1a88f1c332f60dd0a4374b17764852af9e | https://github.com/Etenil/assegai/blob/d43cce1a88f1c332f60dd0a4374b17764852af9e/src/assegai/modules/validator/Validator.php#L130-L140 |
205,221 | Etenil/assegai | src/assegai/modules/validator/Validator.php | Validator.exists | public function exists( $message = null)
{
$this->setRule(__FUNCTION__, function ($val) {
return null !== $val;
}, $message);
return $this;
} | php | public function exists( $message = null)
{
$this->setRule(__FUNCTION__, function ($val) {
return null !== $val;
}, $message);
return $this;
} | [
"public",
"function",
"exists",
"(",
"$",
"message",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"setRule",
"(",
"__FUNCTION__",
",",
"function",
"(",
"$",
"val",
")",
"{",
"return",
"null",
"!==",
"$",
"val",
";",
"}",
",",
"$",
"message",
")",
";",... | Field must exist, even if empty
@param null $message
@return $this | [
"Field",
"must",
"exist",
"even",
"if",
"empty"
] | d43cce1a88f1c332f60dd0a4374b17764852af9e | https://github.com/Etenil/assegai/blob/d43cce1a88f1c332f60dd0a4374b17764852af9e/src/assegai/modules/validator/Validator.php#L148-L154 |
205,222 | Etenil/assegai | src/assegai/modules/validator/Validator.php | Validator.float | public function float($message = null)
{
$this->setRule(__FUNCTION__, function($val)
{
return !(filter_var($val, FILTER_VALIDATE_FLOAT) === FALSE);
}, $message);
return $this;
} | php | public function float($message = null)
{
$this->setRule(__FUNCTION__, function($val)
{
return !(filter_var($val, FILTER_VALIDATE_FLOAT) === FALSE);
}, $message);
return $this;
} | [
"public",
"function",
"float",
"(",
"$",
"message",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"setRule",
"(",
"__FUNCTION__",
",",
"function",
"(",
"$",
"val",
")",
"{",
"return",
"!",
"(",
"filter_var",
"(",
"$",
"val",
",",
"FILTER_VALIDATE_FLOAT",
"... | Field must contain a valid float value.
@param string $message
@return FormValidator | [
"Field",
"must",
"contain",
"a",
"valid",
"float",
"value",
"."
] | d43cce1a88f1c332f60dd0a4374b17764852af9e | https://github.com/Etenil/assegai/blob/d43cce1a88f1c332f60dd0a4374b17764852af9e/src/assegai/modules/validator/Validator.php#L162-L169 |
205,223 | Etenil/assegai | src/assegai/modules/validator/Validator.php | Validator.integer | public function integer($message = null)
{
$this->setRule(__FUNCTION__, function($val)
{
return !(filter_var($val, FILTER_VALIDATE_INT) === FALSE);
}, $message);
return $this;
} | php | public function integer($message = null)
{
$this->setRule(__FUNCTION__, function($val)
{
return !(filter_var($val, FILTER_VALIDATE_INT) === FALSE);
}, $message);
return $this;
} | [
"public",
"function",
"integer",
"(",
"$",
"message",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"setRule",
"(",
"__FUNCTION__",
",",
"function",
"(",
"$",
"val",
")",
"{",
"return",
"!",
"(",
"filter_var",
"(",
"$",
"val",
",",
"FILTER_VALIDATE_INT",
"... | Field must contain a valid integer value.
@param string $message
@return FormValidator | [
"Field",
"must",
"contain",
"a",
"valid",
"integer",
"value",
"."
] | d43cce1a88f1c332f60dd0a4374b17764852af9e | https://github.com/Etenil/assegai/blob/d43cce1a88f1c332f60dd0a4374b17764852af9e/src/assegai/modules/validator/Validator.php#L177-L184 |
205,224 | Etenil/assegai | src/assegai/modules/validator/Validator.php | Validator.between | public function between($min, $max, $include = TRUE, $message = null)
{
$message = $this->_getDefaultMessage(__FUNCTION__, array($min, $max, $include));
$this->min($min, $include, $message)->max($max, $include, $message);
return $this;
} | php | public function between($min, $max, $include = TRUE, $message = null)
{
$message = $this->_getDefaultMessage(__FUNCTION__, array($min, $max, $include));
$this->min($min, $include, $message)->max($max, $include, $message);
return $this;
} | [
"public",
"function",
"between",
"(",
"$",
"min",
",",
"$",
"max",
",",
"$",
"include",
"=",
"TRUE",
",",
"$",
"message",
"=",
"null",
")",
"{",
"$",
"message",
"=",
"$",
"this",
"->",
"_getDefaultMessage",
"(",
"__FUNCTION__",
",",
"array",
"(",
"$"... | Field must be a number between X and Y.
@param numeric $min
@param numeric $max
@param bool $include Whether to include limit value.
@param string $message
@return FormValidator | [
"Field",
"must",
"be",
"a",
"number",
"between",
"X",
"and",
"Y",
"."
] | d43cce1a88f1c332f60dd0a4374b17764852af9e | https://github.com/Etenil/assegai/blob/d43cce1a88f1c332f60dd0a4374b17764852af9e/src/assegai/modules/validator/Validator.php#L261-L267 |
205,225 | Etenil/assegai | src/assegai/modules/validator/Validator.php | Validator.minlength | public function minlength($len, $message = null)
{
$this->setRule(__FUNCTION__, function($val, $args)
{
return !(strlen(trim($val)) < $args[0]);
}, $message, array($len));
return $this;
} | php | public function minlength($len, $message = null)
{
$this->setRule(__FUNCTION__, function($val, $args)
{
return !(strlen(trim($val)) < $args[0]);
}, $message, array($len));
return $this;
} | [
"public",
"function",
"minlength",
"(",
"$",
"len",
",",
"$",
"message",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"setRule",
"(",
"__FUNCTION__",
",",
"function",
"(",
"$",
"val",
",",
"$",
"args",
")",
"{",
"return",
"!",
"(",
"strlen",
"(",
"tri... | Field has to be greater than or equal to X characters long.
@param int $len
@param string $message
@return FormValidator | [
"Field",
"has",
"to",
"be",
"greater",
"than",
"or",
"equal",
"to",
"X",
"characters",
"long",
"."
] | d43cce1a88f1c332f60dd0a4374b17764852af9e | https://github.com/Etenil/assegai/blob/d43cce1a88f1c332f60dd0a4374b17764852af9e/src/assegai/modules/validator/Validator.php#L276-L283 |
205,226 | Etenil/assegai | src/assegai/modules/validator/Validator.php | Validator.betweenlength | public function betweenlength($minlength, $maxlength, $message = null)
{
$message = empty($message) ? self::getDefaultMessage(__FUNCTION__, array($minlength, $maxlength)) : NULL;
$this->minlength($minlength, $message)->max($maxlength, $message);
return $this;
} | php | public function betweenlength($minlength, $maxlength, $message = null)
{
$message = empty($message) ? self::getDefaultMessage(__FUNCTION__, array($minlength, $maxlength)) : NULL;
$this->minlength($minlength, $message)->max($maxlength, $message);
return $this;
} | [
"public",
"function",
"betweenlength",
"(",
"$",
"minlength",
",",
"$",
"maxlength",
",",
"$",
"message",
"=",
"null",
")",
"{",
"$",
"message",
"=",
"empty",
"(",
"$",
"message",
")",
"?",
"self",
"::",
"getDefaultMessage",
"(",
"__FUNCTION__",
",",
"ar... | Field has to be between minlength and maxlength characters long.
@param int $minlength
@param int $maxlength
@ | [
"Field",
"has",
"to",
"be",
"between",
"minlength",
"and",
"maxlength",
"characters",
"long",
"."
] | d43cce1a88f1c332f60dd0a4374b17764852af9e | https://github.com/Etenil/assegai/blob/d43cce1a88f1c332f60dd0a4374b17764852af9e/src/assegai/modules/validator/Validator.php#L308-L314 |
205,227 | Etenil/assegai | src/assegai/modules/validator/Validator.php | Validator.endsWith | public function endsWith($sub, $message = null)
{
$this->setRule(__FUNCTION__, function($val, $args)
{
$sub = $args[0];
return (strlen($val) === 0 || substr($val, -strlen($sub)) === $sub);
}, $message, array(... | php | public function endsWith($sub, $message = null)
{
$this->setRule(__FUNCTION__, function($val, $args)
{
$sub = $args[0];
return (strlen($val) === 0 || substr($val, -strlen($sub)) === $sub);
}, $message, array(... | [
"public",
"function",
"endsWith",
"(",
"$",
"sub",
",",
"$",
"message",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"setRule",
"(",
"__FUNCTION__",
",",
"function",
"(",
"$",
"val",
",",
"$",
"args",
")",
"{",
"$",
"sub",
"=",
"$",
"args",
"[",
"0"... | Field must end with a specific substring.
@param string $sub
@param string $message
@return FormValidator | [
"Field",
"must",
"end",
"with",
"a",
"specific",
"substring",
"."
] | d43cce1a88f1c332f60dd0a4374b17764852af9e | https://github.com/Etenil/assegai/blob/d43cce1a88f1c332f60dd0a4374b17764852af9e/src/assegai/modules/validator/Validator.php#L407-L415 |
205,228 | Etenil/assegai | src/assegai/modules/validator/Validator.php | Validator.ip | public function ip($message = null)
{
$this->setRule(__FUNCTION__, function($val)
{
return (strlen(trim($val)) === 0 || filter_var($val, FILTER_VALIDATE_IP) !== FALSE);
}, $message);
return $this;
} | php | public function ip($message = null)
{
$this->setRule(__FUNCTION__, function($val)
{
return (strlen(trim($val)) === 0 || filter_var($val, FILTER_VALIDATE_IP) !== FALSE);
}, $message);
return $this;
} | [
"public",
"function",
"ip",
"(",
"$",
"message",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"setRule",
"(",
"__FUNCTION__",
",",
"function",
"(",
"$",
"val",
")",
"{",
"return",
"(",
"strlen",
"(",
"trim",
"(",
"$",
"val",
")",
")",
"===",
"0",
"|... | Field has to be valid IP address.
@param string $message
@return FormValidator | [
"Field",
"has",
"to",
"be",
"valid",
"IP",
"address",
"."
] | d43cce1a88f1c332f60dd0a4374b17764852af9e | https://github.com/Etenil/assegai/blob/d43cce1a88f1c332f60dd0a4374b17764852af9e/src/assegai/modules/validator/Validator.php#L440-L447 |
205,229 | Etenil/assegai | src/assegai/modules/validator/Validator.php | Validator.url | public function url($message = null)
{
$this->setRule(__FUNCTION__, function($val)
{
return (strlen(trim($val)) === 0 || filter_var($val, FILTER_VALIDATE_URL) !== FALSE);
}, $message);
return $this;
} | php | public function url($message = null)
{
$this->setRule(__FUNCTION__, function($val)
{
return (strlen(trim($val)) === 0 || filter_var($val, FILTER_VALIDATE_URL) !== FALSE);
}, $message);
return $this;
} | [
"public",
"function",
"url",
"(",
"$",
"message",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"setRule",
"(",
"__FUNCTION__",
",",
"function",
"(",
"$",
"val",
")",
"{",
"return",
"(",
"strlen",
"(",
"trim",
"(",
"$",
"val",
")",
")",
"===",
"0",
"... | Field has to be valid internet address.
@param string $message
@return FormValidator | [
"Field",
"has",
"to",
"be",
"valid",
"internet",
"address",
"."
] | d43cce1a88f1c332f60dd0a4374b17764852af9e | https://github.com/Etenil/assegai/blob/d43cce1a88f1c332f60dd0a4374b17764852af9e/src/assegai/modules/validator/Validator.php#L455-L462 |
205,230 | Etenil/assegai | src/assegai/modules/validator/Validator.php | Validator.date | public function date($message = null, $format = null, $separator = '')
{
$this->setRule(__FUNCTION__, function($val, $args)
{
if (strlen(trim($val)) === 0) {
return TRUE;
}
... | php | public function date($message = null, $format = null, $separator = '')
{
$this->setRule(__FUNCTION__, function($val, $args)
{
if (strlen(trim($val)) === 0) {
return TRUE;
}
... | [
"public",
"function",
"date",
"(",
"$",
"message",
"=",
"null",
",",
"$",
"format",
"=",
"null",
",",
"$",
"separator",
"=",
"''",
")",
"{",
"$",
"this",
"->",
"setRule",
"(",
"__FUNCTION__",
",",
"function",
"(",
"$",
"val",
",",
"$",
"args",
")",... | Field has to be a valid date.
@param string $message
@return FormValidator | [
"Field",
"has",
"to",
"be",
"a",
"valid",
"date",
"."
] | d43cce1a88f1c332f60dd0a4374b17764852af9e | https://github.com/Etenil/assegai/blob/d43cce1a88f1c332f60dd0a4374b17764852af9e/src/assegai/modules/validator/Validator.php#L479-L497 |
205,231 | Etenil/assegai | src/assegai/modules/validator/Validator.php | Validator.minDate | public function minDate($date = 0, $format = null, $message = null)
{
if (empty($format)) {
$format = $this->_getDefaultDateFormat();
}
if (is_numeric($date)) {
$date = new \DateTime($date . ' days'); // Days difference from today
} else {
$fieldVa... | php | public function minDate($date = 0, $format = null, $message = null)
{
if (empty($format)) {
$format = $this->_getDefaultDateFormat();
}
if (is_numeric($date)) {
$date = new \DateTime($date . ' days'); // Days difference from today
} else {
$fieldVa... | [
"public",
"function",
"minDate",
"(",
"$",
"date",
"=",
"0",
",",
"$",
"format",
"=",
"null",
",",
"$",
"message",
"=",
"null",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"format",
")",
")",
"{",
"$",
"format",
"=",
"$",
"this",
"->",
"_getDefaultDa... | Field has to be a date later than or equal to X.
@param string|int $date Limit date
@param string $format Date format
@param string $message
@return FormValidator | [
"Field",
"has",
"to",
"be",
"a",
"date",
"later",
"than",
"or",
"equal",
"to",
"X",
"."
] | d43cce1a88f1c332f60dd0a4374b17764852af9e | https://github.com/Etenil/assegai/blob/d43cce1a88f1c332f60dd0a4374b17764852af9e/src/assegai/modules/validator/Validator.php#L507-L529 |
205,232 | Etenil/assegai | src/assegai/modules/validator/Validator.php | Validator.ccnum | public function ccnum($message = null)
{
$this->setRule(__FUNCTION__, function($value)
{
$value = str_replace(' ', '', $value);
$length = strlen($value);
if ($length < 13 || $length > 19) {
... | php | public function ccnum($message = null)
{
$this->setRule(__FUNCTION__, function($value)
{
$value = str_replace(' ', '', $value);
$length = strlen($value);
if ($length < 13 || $length > 19) {
... | [
"public",
"function",
"ccnum",
"(",
"$",
"message",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"setRule",
"(",
"__FUNCTION__",
",",
"function",
"(",
"$",
"value",
")",
"{",
"$",
"value",
"=",
"str_replace",
"(",
"' '",
",",
"''",
",",
"$",
"value",
... | Field has to be a valid credit card number format.
@see https://github.com/funkatron/inspekt/blob/master/Inspekt.php
@param string $message
@return FormValidator | [
"Field",
"has",
"to",
"be",
"a",
"valid",
"credit",
"card",
"number",
"format",
"."
] | d43cce1a88f1c332f60dd0a4374b17764852af9e | https://github.com/Etenil/assegai/blob/d43cce1a88f1c332f60dd0a4374b17764852af9e/src/assegai/modules/validator/Validator.php#L570-L595 |
205,233 | Etenil/assegai | src/assegai/modules/validator/Validator.php | Validator.oneOf | public function oneOf($allowed, $message = null)
{
if (is_string($allowed)) {
$allowed = explode(',', $allowed);
}
$this->setRule(__FUNCTION__, function($val, $args)
{
return in_array($val, $args[0]);
}, $m... | php | public function oneOf($allowed, $message = null)
{
if (is_string($allowed)) {
$allowed = explode(',', $allowed);
}
$this->setRule(__FUNCTION__, function($val, $args)
{
return in_array($val, $args[0]);
}, $m... | [
"public",
"function",
"oneOf",
"(",
"$",
"allowed",
",",
"$",
"message",
"=",
"null",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"allowed",
")",
")",
"{",
"$",
"allowed",
"=",
"explode",
"(",
"','",
",",
"$",
"allowed",
")",
";",
"}",
"$",
"this... | Field has to be one of the allowed ones.
@param string|array $allowed Allowed values.
@param string $message
@return FormValidator | [
"Field",
"has",
"to",
"be",
"one",
"of",
"the",
"allowed",
"ones",
"."
] | d43cce1a88f1c332f60dd0a4374b17764852af9e | https://github.com/Etenil/assegai/blob/d43cce1a88f1c332f60dd0a4374b17764852af9e/src/assegai/modules/validator/Validator.php#L604-L615 |
205,234 | Etenil/assegai | src/assegai/modules/validator/Validator.php | Validator._applyFilter | protected function _applyFilter(&$val)
{
if (is_array($val)) {
foreach($val as $key => &$item) {
$this->_applyFilter($item);
}
} else {
foreach($this->filters as $filter) {
$val = $filter($val);
}
}
} | php | protected function _applyFilter(&$val)
{
if (is_array($val)) {
foreach($val as $key => &$item) {
$this->_applyFilter($item);
}
} else {
foreach($this->filters as $filter) {
$val = $filter($val);
}
}
} | [
"protected",
"function",
"_applyFilter",
"(",
"&",
"$",
"val",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"val",
")",
")",
"{",
"foreach",
"(",
"$",
"val",
"as",
"$",
"key",
"=>",
"&",
"$",
"item",
")",
"{",
"$",
"this",
"->",
"_applyFilter",
"("... | recursively apply filters to a value
@access protected
@param mixed $val reference
@return void | [
"recursively",
"apply",
"filters",
"to",
"a",
"value"
] | d43cce1a88f1c332f60dd0a4374b17764852af9e | https://github.com/Etenil/assegai/blob/d43cce1a88f1c332f60dd0a4374b17764852af9e/src/assegai/modules/validator/Validator.php#L686-L697 |
205,235 | Etenil/assegai | src/assegai/modules/validator/Validator.php | Validator._validate | protected function _validate($key, $val)
{
// try each rule function
foreach ($this->rules as $rule => $is_true) {
if ($is_true) {
$function = $this->functions[$rule];
$args = $this->arguments[$rule]; // Arguments of rule
$valid = true;
... | php | protected function _validate($key, $val)
{
// try each rule function
foreach ($this->rules as $rule => $is_true) {
if ($is_true) {
$function = $this->functions[$rule];
$args = $this->arguments[$rule]; // Arguments of rule
$valid = true;
... | [
"protected",
"function",
"_validate",
"(",
"$",
"key",
",",
"$",
"val",
")",
"{",
"// try each rule function",
"foreach",
"(",
"$",
"this",
"->",
"rules",
"as",
"$",
"rule",
"=>",
"$",
"is_true",
")",
"{",
"if",
"(",
"$",
"is_true",
")",
"{",
"$",
"f... | recursively validates a value
@access protected
@param string $key
@param mixed $val
@return bool | [
"recursively",
"validates",
"a",
"value"
] | d43cce1a88f1c332f60dd0a4374b17764852af9e | https://github.com/Etenil/assegai/blob/d43cce1a88f1c332f60dd0a4374b17764852af9e/src/assegai/modules/validator/Validator.php#L732-L761 |
205,236 | Etenil/assegai | src/assegai/modules/validator/Validator.php | Validator.getAllErrors | public function getAllErrors($keys = true)
{
return ($keys == true) ? $this->errors : array_values($this->errors);
} | php | public function getAllErrors($keys = true)
{
return ($keys == true) ? $this->errors : array_values($this->errors);
} | [
"public",
"function",
"getAllErrors",
"(",
"$",
"keys",
"=",
"true",
")",
"{",
"return",
"(",
"$",
"keys",
"==",
"true",
")",
"?",
"$",
"this",
"->",
"errors",
":",
"array_values",
"(",
"$",
"this",
"->",
"errors",
")",
";",
"}"
] | Get all errors.
@return array | [
"Get",
"all",
"errors",
"."
] | d43cce1a88f1c332f60dd0a4374b17764852af9e | https://github.com/Etenil/assegai/blob/d43cce1a88f1c332f60dd0a4374b17764852af9e/src/assegai/modules/validator/Validator.php#L788-L791 |
205,237 | Etenil/assegai | src/assegai/modules/validator/Validator.php | Validator.registerError | protected function registerError($rule, $key, $message = null)
{
if (empty($message)) {
$message = $this->messages[$rule];
}
$this->errors[$key] = sprintf($message, $this->fields[$key]);
} | php | protected function registerError($rule, $key, $message = null)
{
if (empty($message)) {
$message = $this->messages[$rule];
}
$this->errors[$key] = sprintf($message, $this->fields[$key]);
} | [
"protected",
"function",
"registerError",
"(",
"$",
"rule",
",",
"$",
"key",
",",
"$",
"message",
"=",
"null",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"message",
")",
")",
"{",
"$",
"message",
"=",
"$",
"this",
"->",
"messages",
"[",
"$",
"rule",
... | Register error.
@param string $rule
@param string $key
@param string $message | [
"Register",
"error",
"."
] | d43cce1a88f1c332f60dd0a4374b17764852af9e | https://github.com/Etenil/assegai/blob/d43cce1a88f1c332f60dd0a4374b17764852af9e/src/assegai/modules/validator/Validator.php#L853-L860 |
205,238 | Etenil/assegai | src/assegai/modules/validator/Validator.php | Validator.setRule | public function setRule($rule, $function, $message = '', $args = array())
{
if (!array_key_exists($rule, $this->rules)) {
$this->rules[$rule] = TRUE;
if (!array_key_exists($rule, $this->functions)) {
if (!is_callable($function)) {
die('Invalid func... | php | public function setRule($rule, $function, $message = '', $args = array())
{
if (!array_key_exists($rule, $this->rules)) {
$this->rules[$rule] = TRUE;
if (!array_key_exists($rule, $this->functions)) {
if (!is_callable($function)) {
die('Invalid func... | [
"public",
"function",
"setRule",
"(",
"$",
"rule",
",",
"$",
"function",
",",
"$",
"message",
"=",
"''",
",",
"$",
"args",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"rule",
",",
"$",
"this",
"->",
"rules",
")... | Set rule.
@param string $rule
@param closure $function
@param string $message
@param array $args | [
"Set",
"rule",
"."
] | d43cce1a88f1c332f60dd0a4374b17764852af9e | https://github.com/Etenil/assegai/blob/d43cce1a88f1c332f60dd0a4374b17764852af9e/src/assegai/modules/validator/Validator.php#L870-L884 |
205,239 | datto/core-enumerator | src/Core/Enumerator.php | Enumerator.getClasses | public static function getClasses($namespace, $conditions = [])
{
self::_setupRoot();
$namespace = explode('\\', trim($namespace, '\\'));
$composerNamespaces = self::getComposerNamespaces();
$searchPaths = [];
// for each Composer namespace, assess whether it may contain the namespace $namespace.
fo... | php | public static function getClasses($namespace, $conditions = [])
{
self::_setupRoot();
$namespace = explode('\\', trim($namespace, '\\'));
$composerNamespaces = self::getComposerNamespaces();
$searchPaths = [];
// for each Composer namespace, assess whether it may contain the namespace $namespace.
fo... | [
"public",
"static",
"function",
"getClasses",
"(",
"$",
"namespace",
",",
"$",
"conditions",
"=",
"[",
"]",
")",
"{",
"self",
"::",
"_setupRoot",
"(",
")",
";",
"$",
"namespace",
"=",
"explode",
"(",
"'\\\\'",
",",
"trim",
"(",
"$",
"namespace",
",",
... | Return a list of classes under a given namespace. It is an error to enumerate the root namespace.
@param string Namespace name. Trailing backslash may be omitted.
@param Limiting rules. An array of constraints on the returned results. Currently
the only supported constraints are "implements" (string - class name) and "... | [
"Return",
"a",
"list",
"of",
"classes",
"under",
"a",
"given",
"namespace",
".",
"It",
"is",
"an",
"error",
"to",
"enumerate",
"the",
"root",
"namespace",
"."
] | 90cdcc90cc0453c35e7b2d2e941d23abd6e9cf39 | https://github.com/datto/core-enumerator/blob/90cdcc90cc0453c35e7b2d2e941d23abd6e9cf39/src/Core/Enumerator.php#L53-L102 |
205,240 | datto/core-enumerator | src/Core/Enumerator.php | Enumerator.getComposerModule | public static function getComposerModule($className)
{
global $Composer;
if ( $result = $Composer->findFile($className) ) {
$result = substr($result, strlen(self::$root));
if ( preg_match('#^vendor/([a-z0-9_-]+/[a-z0-9_-]+)/#', $result, $match) ) {
return $match[1];
}
}
return null;
} | php | public static function getComposerModule($className)
{
global $Composer;
if ( $result = $Composer->findFile($className) ) {
$result = substr($result, strlen(self::$root));
if ( preg_match('#^vendor/([a-z0-9_-]+/[a-z0-9_-]+)/#', $result, $match) ) {
return $match[1];
}
}
return null;
} | [
"public",
"static",
"function",
"getComposerModule",
"(",
"$",
"className",
")",
"{",
"global",
"$",
"Composer",
";",
"if",
"(",
"$",
"result",
"=",
"$",
"Composer",
"->",
"findFile",
"(",
"$",
"className",
")",
")",
"{",
"$",
"result",
"=",
"substr",
... | Return the name of the composer module where a given class lives.
@param string Class name
@return mixed String if it lives in a module, or null if the root | [
"Return",
"the",
"name",
"of",
"the",
"composer",
"module",
"where",
"a",
"given",
"class",
"lives",
"."
] | 90cdcc90cc0453c35e7b2d2e941d23abd6e9cf39 | https://github.com/datto/core-enumerator/blob/90cdcc90cc0453c35e7b2d2e941d23abd6e9cf39/src/Core/Enumerator.php#L110-L123 |
205,241 | datto/core-enumerator | src/Core/Enumerator.php | Enumerator.getComposerNamespaces | private static function getComposerNamespaces()
{
static $result = null;
if ( !is_array($result) ) {
$result = require self::$root . 'vendor/composer/autoload_namespaces.php';
foreach ( $result as $ns => &$paths ) {
$subpath = trim(str_replace('\\', DIRECTORY_SEPARATOR, $ns), DIRECTORY_SEPARATOR);... | php | private static function getComposerNamespaces()
{
static $result = null;
if ( !is_array($result) ) {
$result = require self::$root . 'vendor/composer/autoload_namespaces.php';
foreach ( $result as $ns => &$paths ) {
$subpath = trim(str_replace('\\', DIRECTORY_SEPARATOR, $ns), DIRECTORY_SEPARATOR);... | [
"private",
"static",
"function",
"getComposerNamespaces",
"(",
")",
"{",
"static",
"$",
"result",
"=",
"null",
";",
"if",
"(",
"!",
"is_array",
"(",
"$",
"result",
")",
")",
"{",
"$",
"result",
"=",
"require",
"self",
"::",
"$",
"root",
".",
"'vendor/c... | Get Composer's namespace list.
@return array
@access private
@static | [
"Get",
"Composer",
"s",
"namespace",
"list",
"."
] | 90cdcc90cc0453c35e7b2d2e941d23abd6e9cf39 | https://github.com/datto/core-enumerator/blob/90cdcc90cc0453c35e7b2d2e941d23abd6e9cf39/src/Core/Enumerator.php#L132-L165 |
205,242 | datto/core-enumerator | src/Core/Enumerator.php | Enumerator.searchPath | private static function searchPath($prefix, $path, $conditions)
{
$result = [];
$dir = new DirectoryIterator($path);
foreach ( $dir as $entry ) {
if ( $entry->isDot() ) {
continue;
}
$de = $entry->getFilename();
if ( $entry->isDir() && preg_match('/^[A-Za-z_]+$/', $de) ) {
// it's ... | php | private static function searchPath($prefix, $path, $conditions)
{
$result = [];
$dir = new DirectoryIterator($path);
foreach ( $dir as $entry ) {
if ( $entry->isDot() ) {
continue;
}
$de = $entry->getFilename();
if ( $entry->isDir() && preg_match('/^[A-Za-z_]+$/', $de) ) {
// it's ... | [
"private",
"static",
"function",
"searchPath",
"(",
"$",
"prefix",
",",
"$",
"path",
",",
"$",
"conditions",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"$",
"dir",
"=",
"new",
"DirectoryIterator",
"(",
"$",
"path",
")",
";",
"foreach",
"(",
"$",
... | Search one directory recursively for classes belonging to a given namespace.
@param string Namespace to search for
@param string Directory to search
@param array Search conditions
@return array
@access private
@static | [
"Search",
"one",
"directory",
"recursively",
"for",
"classes",
"belonging",
"to",
"a",
"given",
"namespace",
"."
] | 90cdcc90cc0453c35e7b2d2e941d23abd6e9cf39 | https://github.com/datto/core-enumerator/blob/90cdcc90cc0453c35e7b2d2e941d23abd6e9cf39/src/Core/Enumerator.php#L177-L287 |
205,243 | datto/core-enumerator | src/Core/Enumerator.php | Enumerator._setupRoot | private static function _setupRoot()
{
if ( !empty(self::$root) ) {
// avoid duplicating efforts... only set root if it's not already set
return;
}
if ( defined('ROOT') ) {
self::$root = rtrim(ROOT, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
}
else if ( !empty($GLOBALS['baseDir']) ) {
self::... | php | private static function _setupRoot()
{
if ( !empty(self::$root) ) {
// avoid duplicating efforts... only set root if it's not already set
return;
}
if ( defined('ROOT') ) {
self::$root = rtrim(ROOT, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
}
else if ( !empty($GLOBALS['baseDir']) ) {
self::... | [
"private",
"static",
"function",
"_setupRoot",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"self",
"::",
"$",
"root",
")",
")",
"{",
"// avoid duplicating efforts... only set root if it's not already set ",
"return",
";",
"}",
"if",
"(",
"defined",
"(",
"'ROOT'... | Determine the project root directory. | [
"Determine",
"the",
"project",
"root",
"directory",
"."
] | 90cdcc90cc0453c35e7b2d2e941d23abd6e9cf39 | https://github.com/datto/core-enumerator/blob/90cdcc90cc0453c35e7b2d2e941d23abd6e9cf39/src/Core/Enumerator.php#L292-L335 |
205,244 | phramework/phramework | src/URIStrategy/URITemplate.php | URITemplate.URI | public static function URI()
{
$REDIRECT_QUERY_STRING =
isset($_SERVER['QUERY_STRING'])
? $_SERVER['QUERY_STRING']
: '';
$REDIRECT_URL = '';
if (isset($_SERVER['REQUEST_URI'])) {
$url_parts = parse_url($_SERVER['REQUEST_URI']);
$R... | php | public static function URI()
{
$REDIRECT_QUERY_STRING =
isset($_SERVER['QUERY_STRING'])
? $_SERVER['QUERY_STRING']
: '';
$REDIRECT_URL = '';
if (isset($_SERVER['REQUEST_URI'])) {
$url_parts = parse_url($_SERVER['REQUEST_URI']);
$R... | [
"public",
"static",
"function",
"URI",
"(",
")",
"{",
"$",
"REDIRECT_QUERY_STRING",
"=",
"isset",
"(",
"$",
"_SERVER",
"[",
"'QUERY_STRING'",
"]",
")",
"?",
"$",
"_SERVER",
"[",
"'QUERY_STRING'",
"]",
":",
"''",
";",
"$",
"REDIRECT_URL",
"=",
"''",
";",
... | Get current URI and GET parameters from the requested URI
@return string[2] Returns an array with current URI and GET parameters | [
"Get",
"current",
"URI",
"and",
"GET",
"parameters",
"from",
"the",
"requested",
"URI"
] | 40041d1ef23b1f8cdbd26fb112448d6a3dbef012 | https://github.com/phramework/phramework/blob/40041d1ef23b1f8cdbd26fb112448d6a3dbef012/src/URIStrategy/URITemplate.php#L120-L150 |
205,245 | ThomasMarinissen/FileDownloader | src/FileDownloader/Exceptions/DownloadException.php | DownloadException.codeToMessage | private function codeToMessage($code) {
// get the error message belong to the given code
switch ($code) {
case \Th\FileDownloader::FILE_WRONG_MIME:
$message = "File is of the wrong MIME type";
break;
case \Th\FileDownloader::FILE_WRONG_EXTENSION:
... | php | private function codeToMessage($code) {
// get the error message belong to the given code
switch ($code) {
case \Th\FileDownloader::FILE_WRONG_MIME:
$message = "File is of the wrong MIME type";
break;
case \Th\FileDownloader::FILE_WRONG_EXTENSION:
... | [
"private",
"function",
"codeToMessage",
"(",
"$",
"code",
")",
"{",
"// get the error message belong to the given code",
"switch",
"(",
"$",
"code",
")",
"{",
"case",
"\\",
"Th",
"\\",
"FileDownloader",
"::",
"FILE_WRONG_MIME",
":",
"$",
"message",
"=",
"\"File is... | Method that switches the error code constants till it finds the messages
that belongs to the error code and then returns the message.
@param int The error code
@return string The error message | [
"Method",
"that",
"switches",
"the",
"error",
"code",
"constants",
"till",
"it",
"finds",
"the",
"messages",
"that",
"belongs",
"to",
"the",
"error",
"code",
"and",
"then",
"returns",
"the",
"message",
"."
] | a69a1c88674038597bcd2e8f0777abf39f58c215 | https://github.com/ThomasMarinissen/FileDownloader/blob/a69a1c88674038597bcd2e8f0777abf39f58c215/src/FileDownloader/Exceptions/DownloadException.php#L33-L52 |
205,246 | hal-platform/hal-core | src/Entity/Target.php | Target.isAWS | public function isAWS()
{
return in_array($this->type(), [TargetEnum::TYPE_CD, TargetEnum::TYPE_EB, TargetEnum::TYPE_S3]);
} | php | public function isAWS()
{
return in_array($this->type(), [TargetEnum::TYPE_CD, TargetEnum::TYPE_EB, TargetEnum::TYPE_S3]);
} | [
"public",
"function",
"isAWS",
"(",
")",
"{",
"return",
"in_array",
"(",
"$",
"this",
"->",
"type",
"(",
")",
",",
"[",
"TargetEnum",
"::",
"TYPE_CD",
",",
"TargetEnum",
"::",
"TYPE_EB",
",",
"TargetEnum",
"::",
"TYPE_S3",
"]",
")",
";",
"}"
] | Is this group for AWS?
@return bool | [
"Is",
"this",
"group",
"for",
"AWS?"
] | 30d456f8392fc873301ad4217d2ae90436c67090 | https://github.com/hal-platform/hal-core/blob/30d456f8392fc873301ad4217d2ae90436c67090/src/Entity/Target.php#L253-L256 |
205,247 | hal-platform/hal-core | src/Entity/Target.php | Target.formatParameters | public function formatParameters()
{
switch ($this->type()) {
case TargetEnum::TYPE_CD:
return $this->parameter('group') ?: '???';
case TargetEnum::TYPE_EB:
return $this->parameter('environment') ?: '???';
case TargetEnum::TYPE_S3:
... | php | public function formatParameters()
{
switch ($this->type()) {
case TargetEnum::TYPE_CD:
return $this->parameter('group') ?: '???';
case TargetEnum::TYPE_EB:
return $this->parameter('environment') ?: '???';
case TargetEnum::TYPE_S3:
... | [
"public",
"function",
"formatParameters",
"(",
")",
"{",
"switch",
"(",
"$",
"this",
"->",
"type",
"(",
")",
")",
"{",
"case",
"TargetEnum",
"::",
"TYPE_CD",
":",
"return",
"$",
"this",
"->",
"parameter",
"(",
"'group'",
")",
"?",
":",
"'???'",
";",
... | Format parameters into something readable.
@return string | [
"Format",
"parameters",
"into",
"something",
"readable",
"."
] | 30d456f8392fc873301ad4217d2ae90436c67090 | https://github.com/hal-platform/hal-core/blob/30d456f8392fc873301ad4217d2ae90436c67090/src/Entity/Target.php#L263-L293 |
205,248 | ncou/Chiron-Pipeline | src/Pipeline.php | Pipeline.handle | public function handle(ServerRequestInterface $request): ResponseInterface
{
if ($this->index >= count($this->middlewares)) {
throw new OutOfBoundsException('Reached end of middleware stack. Does your controller return a response ?');
}
$middleware = $this->middlewares[$this->in... | php | public function handle(ServerRequestInterface $request): ResponseInterface
{
if ($this->index >= count($this->middlewares)) {
throw new OutOfBoundsException('Reached end of middleware stack. Does your controller return a response ?');
}
$middleware = $this->middlewares[$this->in... | [
"public",
"function",
"handle",
"(",
"ServerRequestInterface",
"$",
"request",
")",
":",
"ResponseInterface",
"{",
"if",
"(",
"$",
"this",
"->",
"index",
">=",
"count",
"(",
"$",
"this",
"->",
"middlewares",
")",
")",
"{",
"throw",
"new",
"OutOfBoundsExcepti... | Execute the middleware stack.
@param ServerRequestInterface $request
@return ResponseInterface | [
"Execute",
"the",
"middleware",
"stack",
"."
] | dda743d797bc85c24a947dc332f3cfb41f6bf05a | https://github.com/ncou/Chiron-Pipeline/blob/dda743d797bc85c24a947dc332f3cfb41f6bf05a/src/Pipeline.php#L149-L158 |
205,249 | mlocati/concrete5-translation-library | src/Parser/Cif.php | Cif.parseXml | private static function parseXml(\Gettext\Translations $translations, $realPath, $shownPath)
{
if (@filesize($realPath) !== 0) {
$xml = new \DOMDocument();
if ($xml->load($realPath) === false) {
global $php_errormsg;
if (isset($php_errormsg) && $php_er... | php | private static function parseXml(\Gettext\Translations $translations, $realPath, $shownPath)
{
if (@filesize($realPath) !== 0) {
$xml = new \DOMDocument();
if ($xml->load($realPath) === false) {
global $php_errormsg;
if (isset($php_errormsg) && $php_er... | [
"private",
"static",
"function",
"parseXml",
"(",
"\\",
"Gettext",
"\\",
"Translations",
"$",
"translations",
",",
"$",
"realPath",
",",
"$",
"shownPath",
")",
"{",
"if",
"(",
"@",
"filesize",
"(",
"$",
"realPath",
")",
"!==",
"0",
")",
"{",
"$",
"xml"... | Parses an XML CIF file and extracts translatable strings.
@param \Gettext\Translations $translations
@param string $realPath
@param string $shownPath
@throws \Exception | [
"Parses",
"an",
"XML",
"CIF",
"file",
"and",
"extracts",
"translatable",
"strings",
"."
] | 26f806c8c1ecb6ce63115a4058ab396303622e00 | https://github.com/mlocati/concrete5-translation-library/blob/26f806c8c1ecb6ce63115a4058ab396303622e00/src/Parser/Cif.php#L65-L84 |
205,250 | mlocati/concrete5-translation-library | src/Parser/Cif.php | Cif.readXmlNodeAttribute | private static function readXmlNodeAttribute(\Gettext\Translations $translations, $filenameRel, \DOMNode $node, $attributeName, $context = '')
{
$value = (string) $node->getAttribute($attributeName);
if ($value !== '') {
$translation = $translations->insert($context, $value);
... | php | private static function readXmlNodeAttribute(\Gettext\Translations $translations, $filenameRel, \DOMNode $node, $attributeName, $context = '')
{
$value = (string) $node->getAttribute($attributeName);
if ($value !== '') {
$translation = $translations->insert($context, $value);
... | [
"private",
"static",
"function",
"readXmlNodeAttribute",
"(",
"\\",
"Gettext",
"\\",
"Translations",
"$",
"translations",
",",
"$",
"filenameRel",
",",
"\\",
"DOMNode",
"$",
"node",
",",
"$",
"attributeName",
",",
"$",
"context",
"=",
"''",
")",
"{",
"$",
... | Parse a node attribute and create a POEntry item if it has a value.
@param \Gettext\Translations $translations Will be populated with found entries
@param string $filenameRel The relative file name of the xml file being read
@param \DOMNode $node The current node
@param string ... | [
"Parse",
"a",
"node",
"attribute",
"and",
"create",
"a",
"POEntry",
"item",
"if",
"it",
"has",
"a",
"value",
"."
] | 26f806c8c1ecb6ce63115a4058ab396303622e00 | https://github.com/mlocati/concrete5-translation-library/blob/26f806c8c1ecb6ce63115a4058ab396303622e00/src/Parser/Cif.php#L409-L416 |
205,251 | mlocati/concrete5-translation-library | src/Parser/Cif.php | Cif.readXmlPageKeywords | private static function readXmlPageKeywords(\Gettext\Translations $translations, $filenameRel, \DOMNode $node, $pageUrl)
{
$keywords = (string) $node->nodeValue;
if ($keywords !== '') {
$translation = $translations->insert('', $keywords);
$translation->addReference($filenameR... | php | private static function readXmlPageKeywords(\Gettext\Translations $translations, $filenameRel, \DOMNode $node, $pageUrl)
{
$keywords = (string) $node->nodeValue;
if ($keywords !== '') {
$translation = $translations->insert('', $keywords);
$translation->addReference($filenameR... | [
"private",
"static",
"function",
"readXmlPageKeywords",
"(",
"\\",
"Gettext",
"\\",
"Translations",
"$",
"translations",
",",
"$",
"filenameRel",
",",
"\\",
"DOMNode",
"$",
"node",
",",
"$",
"pageUrl",
")",
"{",
"$",
"keywords",
"=",
"(",
"string",
")",
"$... | Parse a node attribute which contains the keywords for a page.
@param \Gettext\Translations $translations Will be populated with found entries
@param string $filenameRel The relative file name of the xml file being read
@param \DOMNode $node The current node
@param string ... | [
"Parse",
"a",
"node",
"attribute",
"which",
"contains",
"the",
"keywords",
"for",
"a",
"page",
"."
] | 26f806c8c1ecb6ce63115a4058ab396303622e00 | https://github.com/mlocati/concrete5-translation-library/blob/26f806c8c1ecb6ce63115a4058ab396303622e00/src/Parser/Cif.php#L424-L435 |
205,252 | mlocati/concrete5-translation-library | src/Parser/Cif.php | Cif.parseXmlNodeValue | private static function parseXmlNodeValue(\Gettext\Translations $translations, $filenameRel, \DOMNode $node, $context = '')
{
$value = (string) $node->nodeValue;
if ($value !== '') {
$translation = $translations->insert($context, $value);
$translation->addReference($filenameR... | php | private static function parseXmlNodeValue(\Gettext\Translations $translations, $filenameRel, \DOMNode $node, $context = '')
{
$value = (string) $node->nodeValue;
if ($value !== '') {
$translation = $translations->insert($context, $value);
$translation->addReference($filenameR... | [
"private",
"static",
"function",
"parseXmlNodeValue",
"(",
"\\",
"Gettext",
"\\",
"Translations",
"$",
"translations",
",",
"$",
"filenameRel",
",",
"\\",
"DOMNode",
"$",
"node",
",",
"$",
"context",
"=",
"''",
")",
"{",
"$",
"value",
"=",
"(",
"string",
... | Parse a node value and create a POEntry item if it has a value.
@param \Gettext\Translations $translations Will be populated with found entries
@param string $filenameRel The relative file name of the xml file being read
@param \DOMNode $node The current node
@param string ... | [
"Parse",
"a",
"node",
"value",
"and",
"create",
"a",
"POEntry",
"item",
"if",
"it",
"has",
"a",
"value",
"."
] | 26f806c8c1ecb6ce63115a4058ab396303622e00 | https://github.com/mlocati/concrete5-translation-library/blob/26f806c8c1ecb6ce63115a4058ab396303622e00/src/Parser/Cif.php#L445-L452 |
205,253 | digipolisgent/robo-digipolis-deploy | src/PartialCleanDirs.php | PartialCleanDirs.dirs | public function dirs(array $dirs)
{
foreach ($dirs as $k => $v) {
if (is_numeric($v)) {
$this->dir($k, $v);
continue;
}
$this->dir($v);
}
return $this;
} | php | public function dirs(array $dirs)
{
foreach ($dirs as $k => $v) {
if (is_numeric($v)) {
$this->dir($k, $v);
continue;
}
$this->dir($v);
}
return $this;
} | [
"public",
"function",
"dirs",
"(",
"array",
"$",
"dirs",
")",
"{",
"foreach",
"(",
"$",
"dirs",
"as",
"$",
"k",
"=>",
"$",
"v",
")",
"{",
"if",
"(",
"is_numeric",
"(",
"$",
"v",
")",
")",
"{",
"$",
"this",
"->",
"dir",
"(",
"$",
"k",
",",
"... | Add directories to clean.
@param array $dirs
Either an array of directories or an array keyed by directory with the
number of items to keep within this directory as value.
@return $this | [
"Add",
"directories",
"to",
"clean",
"."
] | fafa8967d98ed4d3f2265b17f4b1abe53bf0b5ab | https://github.com/digipolisgent/robo-digipolis-deploy/blob/fafa8967d98ed4d3f2265b17f4b1abe53bf0b5ab/src/PartialCleanDirs.php#L138-L149 |
205,254 | digipolisgent/robo-digipolis-deploy | src/PartialCleanDirs.php | PartialCleanDirs.cleanDir | protected function cleanDir($dir, $keep)
{
$finder = clone $this->finder;
$finder->in($dir);
$finder->depth(0);
$this->doSort($finder);
$items = iterator_to_array($finder->getIterator());
if ($keep) {
array_splice($items, -$keep);
}
while (... | php | protected function cleanDir($dir, $keep)
{
$finder = clone $this->finder;
$finder->in($dir);
$finder->depth(0);
$this->doSort($finder);
$items = iterator_to_array($finder->getIterator());
if ($keep) {
array_splice($items, -$keep);
}
while (... | [
"protected",
"function",
"cleanDir",
"(",
"$",
"dir",
",",
"$",
"keep",
")",
"{",
"$",
"finder",
"=",
"clone",
"$",
"this",
"->",
"finder",
";",
"$",
"finder",
"->",
"in",
"(",
"$",
"dir",
")",
";",
"$",
"finder",
"->",
"depth",
"(",
"0",
")",
... | Clean a directory.
@param string $dir
The directory to clean.
@param int $keep
The number of items to keep. | [
"Clean",
"a",
"directory",
"."
] | fafa8967d98ed4d3f2265b17f4b1abe53bf0b5ab | https://github.com/digipolisgent/robo-digipolis-deploy/blob/fafa8967d98ed4d3f2265b17f4b1abe53bf0b5ab/src/PartialCleanDirs.php#L221-L247 |
205,255 | digipolisgent/robo-digipolis-deploy | src/PartialCleanDirs.php | PartialCleanDirs.doSort | protected function doSort(Finder $finder)
{
switch ($this->sort) {
case static::SORT_NAME:
$finder->sortByName();
break;
case static::SORT_TYPE:
$finder->sortByType();
break;
case static::SORT_ACCESS_TIME:
... | php | protected function doSort(Finder $finder)
{
switch ($this->sort) {
case static::SORT_NAME:
$finder->sortByName();
break;
case static::SORT_TYPE:
$finder->sortByType();
break;
case static::SORT_ACCESS_TIME:
... | [
"protected",
"function",
"doSort",
"(",
"Finder",
"$",
"finder",
")",
"{",
"switch",
"(",
"$",
"this",
"->",
"sort",
")",
"{",
"case",
"static",
"::",
"SORT_NAME",
":",
"$",
"finder",
"->",
"sortByName",
"(",
")",
";",
"break",
";",
"case",
"static",
... | Sort the finder.
@param Finder $finder
The finder to sort. | [
"Sort",
"the",
"finder",
"."
] | fafa8967d98ed4d3f2265b17f4b1abe53bf0b5ab | https://github.com/digipolisgent/robo-digipolis-deploy/blob/fafa8967d98ed4d3f2265b17f4b1abe53bf0b5ab/src/PartialCleanDirs.php#L255-L282 |
205,256 | bennybi/yii2-cza-base | behaviors/CmsMediaBehavior.php | CmsMediaBehavior.setup | protected function setup() {
if (!$this->_isSetup) {
$defaultConfig = array(
'srcBasePath' => Yii::getAlias('@webroot'),
'dstBasePath' => Yii::$app->czaHelper->folderOrganizer->getEntityUploadPath(true),
'dstUrlBase' => Yii::$app->czaHelper->folderOrga... | php | protected function setup() {
if (!$this->_isSetup) {
$defaultConfig = array(
'srcBasePath' => Yii::getAlias('@webroot'),
'dstBasePath' => Yii::$app->czaHelper->folderOrganizer->getEntityUploadPath(true),
'dstUrlBase' => Yii::$app->czaHelper->folderOrga... | [
"protected",
"function",
"setup",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_isSetup",
")",
"{",
"$",
"defaultConfig",
"=",
"array",
"(",
"'srcBasePath'",
"=>",
"Yii",
"::",
"getAlias",
"(",
"'@webroot'",
")",
",",
"'dstBasePath'",
"=>",
"Yii",
... | setup config on flying | [
"setup",
"config",
"on",
"flying"
] | 8257db8034bd948712fa469062921f210f0ba8da | https://github.com/bennybi/yii2-cza-base/blob/8257db8034bd948712fa469062921f210f0ba8da/behaviors/CmsMediaBehavior.php#L82-L103 |
205,257 | phPoirot/AuthSystem | Authenticate/Identifier/aIdentifier.php | aIdentifier.giveIdentity | function giveIdentity(iIdentity $identity)
{
if ($this->identity)
throw new \Exception('Identity is immutable.');
$defIdentity = $this->_newDefaultIdentity();
$defIdentity->import($identity);
if (!$defIdentity->isFulfilled())
throw new \InvalidArgumen... | php | function giveIdentity(iIdentity $identity)
{
if ($this->identity)
throw new \Exception('Identity is immutable.');
$defIdentity = $this->_newDefaultIdentity();
$defIdentity->import($identity);
if (!$defIdentity->isFulfilled())
throw new \InvalidArgumen... | [
"function",
"giveIdentity",
"(",
"iIdentity",
"$",
"identity",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"identity",
")",
"throw",
"new",
"\\",
"Exception",
"(",
"'Identity is immutable.'",
")",
";",
"$",
"defIdentity",
"=",
"$",
"this",
"->",
"_newDefaultIden... | Set Immutable Identity
@param iIdentity $identity
@return $this
@throws \Exception immutable error; identity not met requirement | [
"Set",
"Immutable",
"Identity"
] | bb8d02f72a7c2686d7d453021143361fa704a5a6 | https://github.com/phPoirot/AuthSystem/blob/bb8d02f72a7c2686d7d453021143361fa704a5a6/Authenticate/Identifier/aIdentifier.php#L95-L111 |
205,258 | phPoirot/AuthSystem | Authenticate/Identifier/aIdentifier.php | aIdentifier.issueException | final function issueException(exAuthentication $exception = null)
{
$callable = ($this->issuer_exception)
? $this->issuer_exception
: $this->doIssueExceptionDefault();
return call_user_func($callable, $exception);
} | php | final function issueException(exAuthentication $exception = null)
{
$callable = ($this->issuer_exception)
? $this->issuer_exception
: $this->doIssueExceptionDefault();
return call_user_func($callable, $exception);
} | [
"final",
"function",
"issueException",
"(",
"exAuthentication",
"$",
"exception",
"=",
"null",
")",
"{",
"$",
"callable",
"=",
"(",
"$",
"this",
"->",
"issuer_exception",
")",
"?",
"$",
"this",
"->",
"issuer_exception",
":",
"$",
"this",
"->",
"doIssueExcept... | Issue To Handle Authentication Exception
usually called when authentication exception rise
to challenge client to login form or something.
@param exAuthentication $exception Maybe support for specific error
@return mixed Result Handle in Dispatch Listener Events | [
"Issue",
"To",
"Handle",
"Authentication",
"Exception"
] | bb8d02f72a7c2686d7d453021143361fa704a5a6 | https://github.com/phPoirot/AuthSystem/blob/bb8d02f72a7c2686d7d453021143361fa704a5a6/Authenticate/Identifier/aIdentifier.php#L150-L157 |
205,259 | phPoirot/AuthSystem | Authenticate/Identifier/aIdentifier.php | aIdentifier.setIssuerException | function setIssuerException(/*callable*/ $callable)
{
if (!is_callable($callable))
throw new \InvalidArgumentException(sprintf(
'Issuer must be callable; given: (%s).'
, \Poirot\Std\flatten($callable)
));
$this->issuer_exception = $cal... | php | function setIssuerException(/*callable*/ $callable)
{
if (!is_callable($callable))
throw new \InvalidArgumentException(sprintf(
'Issuer must be callable; given: (%s).'
, \Poirot\Std\flatten($callable)
));
$this->issuer_exception = $cal... | [
"function",
"setIssuerException",
"(",
"/*callable*/",
"$",
"callable",
")",
"{",
"if",
"(",
"!",
"is_callable",
"(",
"$",
"callable",
")",
")",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'Issuer must be callable; given: (%s).'",
",",
... | Set Exception Issuer
callable:
function(exAuthentication $e)
@param callable $callable
@return $this | [
"Set",
"Exception",
"Issuer"
] | bb8d02f72a7c2686d7d453021143361fa704a5a6 | https://github.com/phPoirot/AuthSystem/blob/bb8d02f72a7c2686d7d453021143361fa704a5a6/Authenticate/Identifier/aIdentifier.php#L213-L223 |
205,260 | jlaso/slim-routing-manager | JLaso/SlimRoutingManager/RoutingCacheManager.php | RoutingCacheManager.writeCache | protected function writeCache($class, $content)
{
$date = date("Y-m-d h:i:s");
$content = <<<EOD
<?php
/**
* Generated with RoutingCacheManager
*
* on {$date}
*/
\$app = Slim\Slim::getInstance();
{$content}
EOD;
$fileName = $this->cacheFile($class);
file_put_contents($fileNa... | php | protected function writeCache($class, $content)
{
$date = date("Y-m-d h:i:s");
$content = <<<EOD
<?php
/**
* Generated with RoutingCacheManager
*
* on {$date}
*/
\$app = Slim\Slim::getInstance();
{$content}
EOD;
$fileName = $this->cacheFile($class);
file_put_contents($fileNa... | [
"protected",
"function",
"writeCache",
"(",
"$",
"class",
",",
"$",
"content",
")",
"{",
"$",
"date",
"=",
"date",
"(",
"\"Y-m-d h:i:s\"",
")",
";",
"$",
"content",
"=",
" <<<EOD\n<?php\n\n\n/**\n * Generated with RoutingCacheManager\n *\n * on {$date}\n */\n\n\\$app = Sl... | This method writes the cache content into cache file
@param $class
@param $content
@return string | [
"This",
"method",
"writes",
"the",
"cache",
"content",
"into",
"cache",
"file"
] | a9fb697e03377b1694add048418a484ef62eae08 | https://github.com/jlaso/slim-routing-manager/blob/a9fb697e03377b1694add048418a484ef62eae08/JLaso/SlimRoutingManager/RoutingCacheManager.php#L68-L90 |
205,261 | php-kit/power-primitives | src/PowerString.php | PowerString.indexOfPattern | function indexOfPattern ($pattern)
{
self::toUnicodeRegex ($pattern);
if (!preg_match ($pattern, $this->S, $m, PREG_OFFSET_CAPTURE)) return false;
return $m[0][1];
} | php | function indexOfPattern ($pattern)
{
self::toUnicodeRegex ($pattern);
if (!preg_match ($pattern, $this->S, $m, PREG_OFFSET_CAPTURE)) return false;
return $m[0][1];
} | [
"function",
"indexOfPattern",
"(",
"$",
"pattern",
")",
"{",
"self",
"::",
"toUnicodeRegex",
"(",
"$",
"pattern",
")",
";",
"if",
"(",
"!",
"preg_match",
"(",
"$",
"pattern",
",",
"$",
"this",
"->",
"S",
",",
"$",
"m",
",",
"PREG_OFFSET_CAPTURE",
")",
... | Searches for a pattern on a string and returns the index of the matched substring.
><p>This is a simpler version of {@see search}.
@param string $pattern A regular expression pattern.
@return int The index of the matched substring. | [
"Searches",
"for",
"a",
"pattern",
"on",
"a",
"string",
"and",
"returns",
"the",
"index",
"of",
"the",
"matched",
"substring",
"."
] | 98450f8c1c34abe86ef293a4764c62c51852632b | https://github.com/php-kit/power-primitives/blob/98450f8c1c34abe86ef293a4764c62c51852632b/src/PowerString.php#L195-L200 |
205,262 | php-kit/power-primitives | src/PowerString.php | PowerString.search | function search ($pattern, $from = 0, &$match = null)
{
self::toUnicodeRegex ($pattern);
if (preg_match ($pattern, $this->S, $m, PREG_OFFSET_CAPTURE)) {
list ($match, $ofs) = $m[0];
return $ofs;
}
return false;
} | php | function search ($pattern, $from = 0, &$match = null)
{
self::toUnicodeRegex ($pattern);
if (preg_match ($pattern, $this->S, $m, PREG_OFFSET_CAPTURE)) {
list ($match, $ofs) = $m[0];
return $ofs;
}
return false;
} | [
"function",
"search",
"(",
"$",
"pattern",
",",
"$",
"from",
"=",
"0",
",",
"&",
"$",
"match",
"=",
"null",
")",
"{",
"self",
"::",
"toUnicodeRegex",
"(",
"$",
"pattern",
")",
";",
"if",
"(",
"preg_match",
"(",
"$",
"pattern",
",",
"$",
"this",
"... | Finds the position of the first occurrence of a pattern in the current string.
><p>This is an extended version of {@see indexOfPattern}.
@param string $pattern A regular expression.
@param int $from The position where the search begins, counted from the beginning of the current string.
@param string $match [o... | [
"Finds",
"the",
"position",
"of",
"the",
"first",
"occurrence",
"of",
"a",
"pattern",
"in",
"the",
"current",
"string",
"."
] | 98450f8c1c34abe86ef293a4764c62c51852632b | https://github.com/php-kit/power-primitives/blob/98450f8c1c34abe86ef293a4764c62c51852632b/src/PowerString.php#L289-L297 |
205,263 | nasumilu/geometry | src/Operation/AbstractOpEvent.php | AbstractOpEvent.addError | public function addError(OperationError $ex, bool $stopPropagation = false) {
$this->lastError = $ex;
if ($stopPropagation) {
$this->stopPropagation();
}
} | php | public function addError(OperationError $ex, bool $stopPropagation = false) {
$this->lastError = $ex;
if ($stopPropagation) {
$this->stopPropagation();
}
} | [
"public",
"function",
"addError",
"(",
"OperationError",
"$",
"ex",
",",
"bool",
"$",
"stopPropagation",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"lastError",
"=",
"$",
"ex",
";",
"if",
"(",
"$",
"stopPropagation",
")",
"{",
"$",
"this",
"->",
"stopP... | Adds an OperationError to the operation events error list.
If the argument <code>$stopPropagation</code> is true than this operation
will stop propagating once complete.
@param \Nasumilu\Geometry\Operation\OperationError $ex
@param bool $stopPropagation | [
"Adds",
"an",
"OperationError",
"to",
"the",
"operation",
"events",
"error",
"list",
"."
] | 000fafe3e61f1d0682952ad236b7486dded65eae | https://github.com/nasumilu/geometry/blob/000fafe3e61f1d0682952ad236b7486dded65eae/src/Operation/AbstractOpEvent.php#L111-L116 |
205,264 | nasumilu/geometry | src/Operation/AbstractOpEvent.php | AbstractOpEvent.setResults | public function setResults($results = null, bool $stopPropagation = false) {
$this->result = $results;
if ($stopPropagation) {
$this->stopPropagation();
}
} | php | public function setResults($results = null, bool $stopPropagation = false) {
$this->result = $results;
if ($stopPropagation) {
$this->stopPropagation();
}
} | [
"public",
"function",
"setResults",
"(",
"$",
"results",
"=",
"null",
",",
"bool",
"$",
"stopPropagation",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"result",
"=",
"$",
"results",
";",
"if",
"(",
"$",
"stopPropagation",
")",
"{",
"$",
"this",
"->",
... | Sets the operations result.
To stop the operations propagation set <code>$stopPropagation</code> to
true.
@param mixed $results
@param bool $stopPropagation | [
"Sets",
"the",
"operations",
"result",
"."
] | 000fafe3e61f1d0682952ad236b7486dded65eae | https://github.com/nasumilu/geometry/blob/000fafe3e61f1d0682952ad236b7486dded65eae/src/Operation/AbstractOpEvent.php#L232-L237 |
205,265 | schpill/thin | src/Vertica.php | Vertica.query | public function query($query, $params = null, $fetchResult = false)
{
$this->checkConnection(true);
$this->log('Query: ' . $query);
if(!empty($params)) {
$this->log('Params: ' . print_r($params, true));
}
$start = microtime(true);
... | php | public function query($query, $params = null, $fetchResult = false)
{
$this->checkConnection(true);
$this->log('Query: ' . $query);
if(!empty($params)) {
$this->log('Params: ' . print_r($params, true));
}
$start = microtime(true);
... | [
"public",
"function",
"query",
"(",
"$",
"query",
",",
"$",
"params",
"=",
"null",
",",
"$",
"fetchResult",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"checkConnection",
"(",
"true",
")",
";",
"$",
"this",
"->",
"log",
"(",
"'Query: '",
".",
"$",
"... | Execute a query and return the results
@param string $query
@param array $params
@param bool $fetchResult Return a ressource or a an array
@return resource|array
@throws Exception | [
"Execute",
"a",
"query",
"and",
"return",
"the",
"results"
] | a9102d9d6f70e8b0f6be93153f70849f46489ee1 | https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Vertica.php#L36-L66 |
205,266 | schpill/thin | src/Vertica.php | Vertica.executeQuery | protected function executeQuery($query)
{
$res = @odbc_exec($this->_lnk, $query);
if(!$res) {
$error = odbc_errormsg($this->_lnk);
$this->log('Query failed: '.$error);
throw new Exception('Executing query failed ' . $error, self::QUERY_FAIL... | php | protected function executeQuery($query)
{
$res = @odbc_exec($this->_lnk, $query);
if(!$res) {
$error = odbc_errormsg($this->_lnk);
$this->log('Query failed: '.$error);
throw new Exception('Executing query failed ' . $error, self::QUERY_FAIL... | [
"protected",
"function",
"executeQuery",
"(",
"$",
"query",
")",
"{",
"$",
"res",
"=",
"@",
"odbc_exec",
"(",
"$",
"this",
"->",
"_lnk",
",",
"$",
"query",
")",
";",
"if",
"(",
"!",
"$",
"res",
")",
"{",
"$",
"error",
"=",
"odbc_errormsg",
"(",
"... | Execute a query and returns an ODBC result identifier
@param string $query
@return resource
@throws Exception | [
"Execute",
"a",
"query",
"and",
"returns",
"an",
"ODBC",
"result",
"identifier"
] | a9102d9d6f70e8b0f6be93153f70849f46489ee1 | https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Vertica.php#L74-L83 |
205,267 | schpill/thin | src/Vertica.php | Vertica.executePreparedStatement | protected function executePreparedStatement($query, $params)
{
$res = odbc_prepare($this->_lnk, $query);
if(!$res) {
$error = odbc_errormsg($this->_lnk);
$this->log('Prepare failed: ' . $error);
throw new Exception('Preparing query failed '... | php | protected function executePreparedStatement($query, $params)
{
$res = odbc_prepare($this->_lnk, $query);
if(!$res) {
$error = odbc_errormsg($this->_lnk);
$this->log('Prepare failed: ' . $error);
throw new Exception('Preparing query failed '... | [
"protected",
"function",
"executePreparedStatement",
"(",
"$",
"query",
",",
"$",
"params",
")",
"{",
"$",
"res",
"=",
"odbc_prepare",
"(",
"$",
"this",
"->",
"_lnk",
",",
"$",
"query",
")",
";",
"if",
"(",
"!",
"$",
"res",
")",
"{",
"$",
"error",
... | Prepare a query, execute it and return an ODBC result identifier
@param string $query
@param array $params
@return bool|resource
@throws Exception | [
"Prepare",
"a",
"query",
"execute",
"it",
"and",
"return",
"an",
"ODBC",
"result",
"identifier"
] | a9102d9d6f70e8b0f6be93153f70849f46489ee1 | https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Vertica.php#L92-L107 |
205,268 | schpill/thin | src/Vertica.php | Vertica.checkConnection | protected function checkConnection($reconnect = false)
{
if(empty($this->_lnk)) {
$this->log('CheckConnection: link is not valid');
if($reconnect) {
$this->log('CheckConnection: try to reconnect');
$this->_lnk = @odbc_connect('D... | php | protected function checkConnection($reconnect = false)
{
if(empty($this->_lnk)) {
$this->log('CheckConnection: link is not valid');
if($reconnect) {
$this->log('CheckConnection: try to reconnect');
$this->_lnk = @odbc_connect('D... | [
"protected",
"function",
"checkConnection",
"(",
"$",
"reconnect",
"=",
"false",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"_lnk",
")",
")",
"{",
"$",
"this",
"->",
"log",
"(",
"'CheckConnection: link is not valid'",
")",
";",
"if",
"(",
"$",... | Check if the connection failed and try to reconnect if asked
@param bool $reconnect
@throws Exception | [
"Check",
"if",
"the",
"connection",
"failed",
"and",
"try",
"to",
"reconnect",
"if",
"asked"
] | a9102d9d6f70e8b0f6be93153f70849f46489ee1 | https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Vertica.php#L128-L144 |
205,269 | infusephp/auth | src/Libs/RememberMeCookie.php | RememberMeCookie.decode | public static function decode($cookie)
{
$params = (array) json_decode(base64_decode($cookie), true);
return new self((string) array_value($params, 'user_email'),
(string) array_value($params, 'agent'),
(string) array_value($params, 'series'),
... | php | public static function decode($cookie)
{
$params = (array) json_decode(base64_decode($cookie), true);
return new self((string) array_value($params, 'user_email'),
(string) array_value($params, 'agent'),
(string) array_value($params, 'series'),
... | [
"public",
"static",
"function",
"decode",
"(",
"$",
"cookie",
")",
"{",
"$",
"params",
"=",
"(",
"array",
")",
"json_decode",
"(",
"base64_decode",
"(",
"$",
"cookie",
")",
",",
"true",
")",
";",
"return",
"new",
"self",
"(",
"(",
"string",
")",
"arr... | Decodes an encoded remember me cookie string.
@param string $cookie
@return self | [
"Decodes",
"an",
"encoded",
"remember",
"me",
"cookie",
"string",
"."
] | 720280b4b2635572f331afe8d082e3e88cf54eb7 | https://github.com/infusephp/auth/blob/720280b4b2635572f331afe8d082e3e88cf54eb7/src/Libs/RememberMeCookie.php#L130-L138 |
205,270 | infusephp/auth | src/Libs/RememberMeCookie.php | RememberMeCookie.encode | public function encode()
{
$json = json_encode([
'user_email' => $this->email,
'agent' => $this->userAgent,
'series' => $this->series,
'token' => $this->token,
]);
return base64_encode($json);
} | php | public function encode()
{
$json = json_encode([
'user_email' => $this->email,
'agent' => $this->userAgent,
'series' => $this->series,
'token' => $this->token,
]);
return base64_encode($json);
} | [
"public",
"function",
"encode",
"(",
")",
"{",
"$",
"json",
"=",
"json_encode",
"(",
"[",
"'user_email'",
"=>",
"$",
"this",
"->",
"email",
",",
"'agent'",
"=>",
"$",
"this",
"->",
"userAgent",
",",
"'series'",
"=>",
"$",
"this",
"->",
"series",
",",
... | Encodes a remember me cookie.
@return string | [
"Encodes",
"a",
"remember",
"me",
"cookie",
"."
] | 720280b4b2635572f331afe8d082e3e88cf54eb7 | https://github.com/infusephp/auth/blob/720280b4b2635572f331afe8d082e3e88cf54eb7/src/Libs/RememberMeCookie.php#L145-L155 |
205,271 | infusephp/auth | src/Libs/RememberMeCookie.php | RememberMeCookie.isValid | public function isValid()
{
if (!filter_var($this->email, FILTER_VALIDATE_EMAIL)) {
return false;
}
if (empty($this->userAgent)) {
return false;
}
if (empty($this->series)) {
return false;
}
if (empty($this->token)) {
... | php | public function isValid()
{
if (!filter_var($this->email, FILTER_VALIDATE_EMAIL)) {
return false;
}
if (empty($this->userAgent)) {
return false;
}
if (empty($this->series)) {
return false;
}
if (empty($this->token)) {
... | [
"public",
"function",
"isValid",
"(",
")",
"{",
"if",
"(",
"!",
"filter_var",
"(",
"$",
"this",
"->",
"email",
",",
"FILTER_VALIDATE_EMAIL",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"userAgent",
")",
")"... | Checks if the cookie contains valid values.
@return bool | [
"Checks",
"if",
"the",
"cookie",
"contains",
"valid",
"values",
"."
] | 720280b4b2635572f331afe8d082e3e88cf54eb7 | https://github.com/infusephp/auth/blob/720280b4b2635572f331afe8d082e3e88cf54eb7/src/Libs/RememberMeCookie.php#L162-L181 |
205,272 | infusephp/auth | src/Libs/RememberMeCookie.php | RememberMeCookie.verify | public function verify(Request $req, AuthManager $auth)
{
if (!$this->isValid()) {
return false;
}
// verify the user agent matches the one in the request
if ($this->userAgent != $req->agent()) {
return false;
}
// look up the user with a mat... | php | public function verify(Request $req, AuthManager $auth)
{
if (!$this->isValid()) {
return false;
}
// verify the user agent matches the one in the request
if ($this->userAgent != $req->agent()) {
return false;
}
// look up the user with a mat... | [
"public",
"function",
"verify",
"(",
"Request",
"$",
"req",
",",
"AuthManager",
"$",
"auth",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isValid",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"// verify the user agent matches the one in the request",
"... | Looks for a remembered user using this cookie
from an incoming request.
@param Request $req
@param AuthManager $auth
@return UserInterface|false remembered user | [
"Looks",
"for",
"a",
"remembered",
"user",
"using",
"this",
"cookie",
"from",
"an",
"incoming",
"request",
"."
] | 720280b4b2635572f331afe8d082e3e88cf54eb7 | https://github.com/infusephp/auth/blob/720280b4b2635572f331afe8d082e3e88cf54eb7/src/Libs/RememberMeCookie.php#L192-L264 |
205,273 | infusephp/auth | src/Libs/RememberMeCookie.php | RememberMeCookie.persist | public function persist(UserInterface $user)
{
$session = new PersistentSession();
$session->email = $this->email;
$session->series = $this->hash($this->series);
$session->token = $this->hash($this->token);
$session->user_id = $user->id();
$session->two_factor_verifie... | php | public function persist(UserInterface $user)
{
$session = new PersistentSession();
$session->email = $this->email;
$session->series = $this->hash($this->series);
$session->token = $this->hash($this->token);
$session->user_id = $user->id();
$session->two_factor_verifie... | [
"public",
"function",
"persist",
"(",
"UserInterface",
"$",
"user",
")",
"{",
"$",
"session",
"=",
"new",
"PersistentSession",
"(",
")",
";",
"$",
"session",
"->",
"email",
"=",
"$",
"this",
"->",
"email",
";",
"$",
"session",
"->",
"series",
"=",
"$",... | Persists this cookie to the database.
@param UserInterface $user
@throws \Exception when the model cannot be saved.
@return PersistentSession | [
"Persists",
"this",
"cookie",
"to",
"the",
"database",
"."
] | 720280b4b2635572f331afe8d082e3e88cf54eb7 | https://github.com/infusephp/auth/blob/720280b4b2635572f331afe8d082e3e88cf54eb7/src/Libs/RememberMeCookie.php#L275-L291 |
205,274 | infusephp/auth | src/Libs/RememberMeCookie.php | RememberMeCookie.destroy | function destroy()
{
$seriesHash = $this->hash($this->series);
PersistentSession::where('email', $this->email)
->where('series', $seriesHash)
->delete();
} | php | function destroy()
{
$seriesHash = $this->hash($this->series);
PersistentSession::where('email', $this->email)
->where('series', $seriesHash)
->delete();
} | [
"function",
"destroy",
"(",
")",
"{",
"$",
"seriesHash",
"=",
"$",
"this",
"->",
"hash",
"(",
"$",
"this",
"->",
"series",
")",
";",
"PersistentSession",
"::",
"where",
"(",
"'email'",
",",
"$",
"this",
"->",
"email",
")",
"->",
"where",
"(",
"'serie... | Destroys the persisted cookie in the data store. | [
"Destroys",
"the",
"persisted",
"cookie",
"in",
"the",
"data",
"store",
"."
] | 720280b4b2635572f331afe8d082e3e88cf54eb7 | https://github.com/infusephp/auth/blob/720280b4b2635572f331afe8d082e3e88cf54eb7/src/Libs/RememberMeCookie.php#L296-L302 |
205,275 | infusephp/auth | src/Libs/RememberMeCookie.php | RememberMeCookie.hash | private function hash($token)
{
$app = Application::getDefault();
$salt = $app['config']->get('app.salt');
return hash_hmac('sha512', $token, $salt);
} | php | private function hash($token)
{
$app = Application::getDefault();
$salt = $app['config']->get('app.salt');
return hash_hmac('sha512', $token, $salt);
} | [
"private",
"function",
"hash",
"(",
"$",
"token",
")",
"{",
"$",
"app",
"=",
"Application",
"::",
"getDefault",
"(",
")",
";",
"$",
"salt",
"=",
"$",
"app",
"[",
"'config'",
"]",
"->",
"get",
"(",
"'app.salt'",
")",
";",
"return",
"hash_hmac",
"(",
... | Hashes a token.
@param string $token
@return string hashed token | [
"Hashes",
"a",
"token",
"."
] | 720280b4b2635572f331afe8d082e3e88cf54eb7 | https://github.com/infusephp/auth/blob/720280b4b2635572f331afe8d082e3e88cf54eb7/src/Libs/RememberMeCookie.php#L323-L329 |
205,276 | gplcart/file_manager | handlers/commands/Listing.php | Listing.getFilesListing | protected function getFilesListing($path, array $params)
{
$files = $this->getFiles($path, $params);
return $this->prepareFiles($files);
} | php | protected function getFilesListing($path, array $params)
{
$files = $this->getFiles($path, $params);
return $this->prepareFiles($files);
} | [
"protected",
"function",
"getFilesListing",
"(",
"$",
"path",
",",
"array",
"$",
"params",
")",
"{",
"$",
"files",
"=",
"$",
"this",
"->",
"getFiles",
"(",
"$",
"path",
",",
"$",
"params",
")",
";",
"return",
"$",
"this",
"->",
"prepareFiles",
"(",
"... | Returns an array of scanned and prepared files
@param string $path
@param array $params
@return array | [
"Returns",
"an",
"array",
"of",
"scanned",
"and",
"prepared",
"files"
] | 45424e93eafea75d31af6410ac9cf110f08e500a | https://github.com/gplcart/file_manager/blob/45424e93eafea75d31af6410ac9cf110f08e500a/handlers/commands/Listing.php#L91-L95 |
205,277 | gplcart/file_manager | handlers/commands/Listing.php | Listing.prepareFiles | protected function prepareFiles(array $files)
{
$prepared = array();
foreach ($files as $file) {
$type = $file->getType();
$path = $file->getRealPath();
$relative_path = gplcart_file_relative($path);
$item = array(
'info' => $file,
... | php | protected function prepareFiles(array $files)
{
$prepared = array();
foreach ($files as $file) {
$type = $file->getType();
$path = $file->getRealPath();
$relative_path = gplcart_file_relative($path);
$item = array(
'info' => $file,
... | [
"protected",
"function",
"prepareFiles",
"(",
"array",
"$",
"files",
")",
"{",
"$",
"prepared",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"files",
"as",
"$",
"file",
")",
"{",
"$",
"type",
"=",
"$",
"file",
"->",
"getType",
"(",
")",
";",
... | Prepares an array of scanned files
@param array $files
@return array | [
"Prepares",
"an",
"array",
"of",
"scanned",
"files"
] | 45424e93eafea75d31af6410ac9cf110f08e500a | https://github.com/gplcart/file_manager/blob/45424e93eafea75d31af6410ac9cf110f08e500a/handlers/commands/Listing.php#L102-L128 |
205,278 | gplcart/file_manager | handlers/commands/Listing.php | Listing.renderIcon | protected function renderIcon(array $item)
{
static $rendered = array();
if (isset($rendered[$item['extension']])) {
return $rendered[$item['extension']];
}
$template = "file_manager|icons/ext/{$item['extension']}";
if ($item['type'] === 'dir') {
$t... | php | protected function renderIcon(array $item)
{
static $rendered = array();
if (isset($rendered[$item['extension']])) {
return $rendered[$item['extension']];
}
$template = "file_manager|icons/ext/{$item['extension']}";
if ($item['type'] === 'dir') {
$t... | [
"protected",
"function",
"renderIcon",
"(",
"array",
"$",
"item",
")",
"{",
"static",
"$",
"rendered",
"=",
"array",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"rendered",
"[",
"$",
"item",
"[",
"'extension'",
"]",
"]",
")",
")",
"{",
"return",
"... | Returns a rendered icon for the given file extension and type
@param array $item
@return string | [
"Returns",
"a",
"rendered",
"icon",
"for",
"the",
"given",
"file",
"extension",
"and",
"type"
] | 45424e93eafea75d31af6410ac9cf110f08e500a | https://github.com/gplcart/file_manager/blob/45424e93eafea75d31af6410ac9cf110f08e500a/handlers/commands/Listing.php#L135-L154 |
205,279 | AbuseIO/collector-common | src/Collector.php | Collector.isKnownFeed | protected function isKnownFeed()
{
if (empty(config("{$this->configBase}.feeds.{$this->feedName}"))) {
$this->warningCount++;
Log::warning(
"The feed referred as '{$this->feedName}' is not configured in the collector " .
config("{$this->configBase}.col... | php | protected function isKnownFeed()
{
if (empty(config("{$this->configBase}.feeds.{$this->feedName}"))) {
$this->warningCount++;
Log::warning(
"The feed referred as '{$this->feedName}' is not configured in the collector " .
config("{$this->configBase}.col... | [
"protected",
"function",
"isKnownFeed",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"config",
"(",
"\"{$this->configBase}.feeds.{$this->feedName}\"",
")",
")",
")",
"{",
"$",
"this",
"->",
"warningCount",
"++",
";",
"Log",
"::",
"warning",
"(",
"\"The feed referred ... | Check if the feed specified is known in the collector config.
@return Boolean Returns true or false | [
"Check",
"if",
"the",
"feed",
"specified",
"is",
"known",
"in",
"the",
"collector",
"config",
"."
] | fe887083371ac50c9112f313b2441b9852dfd263 | https://github.com/AbuseIO/collector-common/blob/fe887083371ac50c9112f313b2441b9852dfd263/src/Collector.php#L170-L183 |
205,280 | temp/media-converter | src/Transmuter.php | Transmuter.transmute | public function transmute($inFilename, Specification $targetFormat, $outFilename)
{
$extractedFile = $this->extractor->extract($inFilename, $targetFormat);
if (!$extractedFile) {
return null;
}
$this->converter->convert($extractedFile, $targetFormat, $outFilename);
... | php | public function transmute($inFilename, Specification $targetFormat, $outFilename)
{
$extractedFile = $this->extractor->extract($inFilename, $targetFormat);
if (!$extractedFile) {
return null;
}
$this->converter->convert($extractedFile, $targetFormat, $outFilename);
... | [
"public",
"function",
"transmute",
"(",
"$",
"inFilename",
",",
"Specification",
"$",
"targetFormat",
",",
"$",
"outFilename",
")",
"{",
"$",
"extractedFile",
"=",
"$",
"this",
"->",
"extractor",
"->",
"extract",
"(",
"$",
"inFilename",
",",
"$",
"targetForm... | Transmute file to target format
@param string $inFilename
@param Specification $targetFormat
@param string $outFilename
@return string|null | [
"Transmute",
"file",
"to",
"target",
"format"
] | a6e8768c583aa461be568f13e592ae49294e5e33 | https://github.com/temp/media-converter/blob/a6e8768c583aa461be568f13e592ae49294e5e33/src/Transmuter.php#L54-L65 |
205,281 | schpill/thin | src/Html/Attributes.php | Attributes.add | public function add($attribute, $value = array())
{
if(is_array($attribute)) {
foreach($attribute as $k => $v) {
$this->add($k, $v);
}
} else {
if($attribute instanceof \Thin\Html\Attributes) {
$this-... | php | public function add($attribute, $value = array())
{
if(is_array($attribute)) {
foreach($attribute as $k => $v) {
$this->add($k, $v);
}
} else {
if($attribute instanceof \Thin\Html\Attributes) {
$this-... | [
"public",
"function",
"add",
"(",
"$",
"attribute",
",",
"$",
"value",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"attribute",
")",
")",
"{",
"foreach",
"(",
"$",
"attribute",
"as",
"$",
"k",
"=>",
"$",
"v",
")",
"{",
"$... | Add an attribute or an array thereof. If the attribute already exists, the specified values will be added to it, without overwriting the previous ones. Duplicate values are removed.
@param string|array|\Thin\Html\Attributes $attribute The name of the attribute to add, a name-value array of attributes or an attributes ... | [
"Add",
"an",
"attribute",
"or",
"an",
"array",
"thereof",
".",
"If",
"the",
"attribute",
"already",
"exists",
"the",
"specified",
"values",
"will",
"be",
"added",
"to",
"it",
"without",
"overwriting",
"the",
"previous",
"ones",
".",
"Duplicate",
"values",
"a... | a9102d9d6f70e8b0f6be93153f70849f46489ee1 | https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Html/Attributes.php#L19-L54 |
205,282 | schpill/thin | src/Html/Attributes.php | Attributes.set | public function set($attribute, $value = array())
{
if(is_array($attribute)) {
$this->attributes = array();
foreach($attribute as $k => $v) {
$this->set($k, $v);
}
} else {
if($attribute instanceof \Thin\... | php | public function set($attribute, $value = array())
{
if(is_array($attribute)) {
$this->attributes = array();
foreach($attribute as $k => $v) {
$this->set($k, $v);
}
} else {
if($attribute instanceof \Thin\... | [
"public",
"function",
"set",
"(",
"$",
"attribute",
",",
"$",
"value",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"attribute",
")",
")",
"{",
"$",
"this",
"->",
"attributes",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$... | Set the value or values of an attribute or an array thereof. Already existent attributes are overwritten.
@param string|array|\Thin\Html\Attributes $attribute The name of the attribute to set, a name-value array of attributes or an attributes object
@param string|array $value In case the first parametre is a string, v... | [
"Set",
"the",
"value",
"or",
"values",
"of",
"an",
"attribute",
"or",
"an",
"array",
"thereof",
".",
"Already",
"existent",
"attributes",
"are",
"overwritten",
"."
] | a9102d9d6f70e8b0f6be93153f70849f46489ee1 | https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Html/Attributes.php#L64-L93 |
205,283 | schpill/thin | src/Html/Attributes.php | Attributes.remove | public function remove($attribute, $value = null)
{
$attribute = strval($attribute);
if(\Thin\Arrays::exists($attribute, $this->attributes)) {
if(null === $value) {
unset($this->attributes[$attribute]);
} else {
$va... | php | public function remove($attribute, $value = null)
{
$attribute = strval($attribute);
if(\Thin\Arrays::exists($attribute, $this->attributes)) {
if(null === $value) {
unset($this->attributes[$attribute]);
} else {
$va... | [
"public",
"function",
"remove",
"(",
"$",
"attribute",
",",
"$",
"value",
"=",
"null",
")",
"{",
"$",
"attribute",
"=",
"strval",
"(",
"$",
"attribute",
")",
";",
"if",
"(",
"\\",
"Thin",
"\\",
"Arrays",
"::",
"exists",
"(",
"$",
"attribute",
",",
... | Remove an attribute or a value
@param string $attribute The attribute name to remove(or to remove a value from)
@param string $value The value to remove from the attribute. Omit the parametre to remove the entire attribute.
@return \Thin\Html\Attributes Provides a fluent interface | [
"Remove",
"an",
"attribute",
"or",
"a",
"value"
] | a9102d9d6f70e8b0f6be93153f70849f46489ee1 | https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Html/Attributes.php#L103-L121 |
205,284 | schpill/thin | src/Html/Attributes.php | Attributes.getArray | public function getArray($attribute = null)
{
if(null === $attribute) {
return $this->attributes;
} else {
$attribute = strval($attribute);
if(ake($attribute, $this->attributes)) {
return $this->attributes[$attribute];
... | php | public function getArray($attribute = null)
{
if(null === $attribute) {
return $this->attributes;
} else {
$attribute = strval($attribute);
if(ake($attribute, $this->attributes)) {
return $this->attributes[$attribute];
... | [
"public",
"function",
"getArray",
"(",
"$",
"attribute",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"attribute",
")",
"{",
"return",
"$",
"this",
"->",
"attributes",
";",
"}",
"else",
"{",
"$",
"attribute",
"=",
"strval",
"(",
"$",
"attrib... | Get the entire attributes array or the array of values for a single attribute.
@param string $attribute The attribute whose values are to be retrieved. Omit the parametre to fetch the entire array of attributes.
@return array|null The attribute or attributes or null in case a nonexistent attribute is requested | [
"Get",
"the",
"entire",
"attributes",
"array",
"or",
"the",
"array",
"of",
"values",
"for",
"a",
"single",
"attribute",
"."
] | a9102d9d6f70e8b0f6be93153f70849f46489ee1 | https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Html/Attributes.php#L130-L142 |
205,285 | schpill/thin | src/Html/Attributes.php | Attributes.getHtml | public function getHtml($attribute = null)
{
if(null !== $attribute) {
$attribute = strval($attribute);
if(\Thin\Arrays::exists($attribute, $this->attributes)) {
return $attribute . '="' . implode(' ', $this->attributes[$attribute]) . '"';
... | php | public function getHtml($attribute = null)
{
if(null !== $attribute) {
$attribute = strval($attribute);
if(\Thin\Arrays::exists($attribute, $this->attributes)) {
return $attribute . '="' . implode(' ', $this->attributes[$attribute]) . '"';
... | [
"public",
"function",
"getHtml",
"(",
"$",
"attribute",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"attribute",
")",
"{",
"$",
"attribute",
"=",
"strval",
"(",
"$",
"attribute",
")",
";",
"if",
"(",
"\\",
"Thin",
"\\",
"Arrays",
"::",
"e... | Generate the HTML code for the attributes
@param string $attribute The attribute for which HTML code is to be generated. Omit the parametre to generate HTML code for all attributes.
@return string HTML code | [
"Generate",
"the",
"HTML",
"code",
"for",
"the",
"attributes"
] | a9102d9d6f70e8b0f6be93153f70849f46489ee1 | https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Html/Attributes.php#L151-L167 |
205,286 | schpill/thin | src/Html/Attributes.php | Attributes.exists | public function exists($attribute, $value = null)
{
$attribute = strval($attribute);
if(\Thin\Arrays::exists($attribute, $this->attributes)) {
if(null === $value || in_array(strval($value), $this->attributes[$attribute])) {
return true;
... | php | public function exists($attribute, $value = null)
{
$attribute = strval($attribute);
if(\Thin\Arrays::exists($attribute, $this->attributes)) {
if(null === $value || in_array(strval($value), $this->attributes[$attribute])) {
return true;
... | [
"public",
"function",
"exists",
"(",
"$",
"attribute",
",",
"$",
"value",
"=",
"null",
")",
"{",
"$",
"attribute",
"=",
"strval",
"(",
"$",
"attribute",
")",
";",
"if",
"(",
"\\",
"Thin",
"\\",
"Arrays",
"::",
"exists",
"(",
"$",
"attribute",
",",
... | Check whether a given attribute or attribute value exists
@param string $attribute Attribute name whose existence is to be checked
@param string $value The attribute's value to be checked. Omit the parametre to check the existence of the attribute.
@return boolean | [
"Check",
"whether",
"a",
"given",
"attribute",
"or",
"attribute",
"value",
"exists"
] | a9102d9d6f70e8b0f6be93153f70849f46489ee1 | https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Html/Attributes.php#L187-L198 |
205,287 | PhoxPHP/Glider | src/Query/Builder/Type.php | Type.getStatementType | public static function getStatementType(String $query) : Int
{
$type = 0;
if (preg_match("/^SELECT|select|Select([^ ]+)/", $query)) {
$type = 1;
}
if (preg_match("/^INSERT([^ ]+)/", $query)) {
$type = 2;
}
if (preg_match("/^UPDATE([^ ]+)/", $query)) {
$type = 3;
}
if (preg_match("/^DELETE([... | php | public static function getStatementType(String $query) : Int
{
$type = 0;
if (preg_match("/^SELECT|select|Select([^ ]+)/", $query)) {
$type = 1;
}
if (preg_match("/^INSERT([^ ]+)/", $query)) {
$type = 2;
}
if (preg_match("/^UPDATE([^ ]+)/", $query)) {
$type = 3;
}
if (preg_match("/^DELETE([... | [
"public",
"static",
"function",
"getStatementType",
"(",
"String",
"$",
"query",
")",
":",
"Int",
"{",
"$",
"type",
"=",
"0",
";",
"if",
"(",
"preg_match",
"(",
"\"/^SELECT|select|Select([^ ]+)/\"",
",",
"$",
"query",
")",
")",
"{",
"$",
"type",
"=",
"1"... | This method gets and returns the statement type.
@param $query <String>
@access public
@return <Integer> | [
"This",
"method",
"gets",
"and",
"returns",
"the",
"statement",
"type",
"."
] | 17aaf3b7bb6e70ea3ae1f04e30a7690e884bf042 | https://github.com/PhoxPHP/Glider/blob/17aaf3b7bb6e70ea3ae1f04e30a7690e884bf042/src/Query/Builder/Type.php#L35-L55 |
205,288 | skeeks-cms/cms-search | src/console/controllers/ClearController.php | ClearController.actionPhrase | public function actionPhrase()
{
$this->stdout('phraseLiveTime: ' . \Yii::$app->cmsSearch->phraseLiveTime . "\n");
if (\Yii::$app->cmsSearch->phraseLiveTime) {
$deleted = CmsSearchPhrase::deleteAll([
'<=',
'created_at',
\Yii::$app->formatt... | php | public function actionPhrase()
{
$this->stdout('phraseLiveTime: ' . \Yii::$app->cmsSearch->phraseLiveTime . "\n");
if (\Yii::$app->cmsSearch->phraseLiveTime) {
$deleted = CmsSearchPhrase::deleteAll([
'<=',
'created_at',
\Yii::$app->formatt... | [
"public",
"function",
"actionPhrase",
"(",
")",
"{",
"$",
"this",
"->",
"stdout",
"(",
"'phraseLiveTime: '",
".",
"\\",
"Yii",
"::",
"$",
"app",
"->",
"cmsSearch",
"->",
"phraseLiveTime",
".",
"\"\\n\"",
")",
";",
"if",
"(",
"\\",
"Yii",
"::",
"$",
"ap... | Remove old searches | [
"Remove",
"old",
"searches"
] | 2fcd8c6343f46938c5cc5829bbb4c9a83593092d | https://github.com/skeeks-cms/cms-search/blob/2fcd8c6343f46938c5cc5829bbb4c9a83593092d/src/console/controllers/ClearController.php#L26-L41 |
205,289 | diasbruno/stc | lib/stc/DataWriter.php | DataWriter.write_to | private function write_to($file, $data)
{
$handler = fopen($file, "w");
fwrite($handler, $data);
fclose($handler);
} | php | private function write_to($file, $data)
{
$handler = fopen($file, "w");
fwrite($handler, $data);
fclose($handler);
} | [
"private",
"function",
"write_to",
"(",
"$",
"file",
",",
"$",
"data",
")",
"{",
"$",
"handler",
"=",
"fopen",
"(",
"$",
"file",
",",
"\"w\"",
")",
";",
"fwrite",
"(",
"$",
"handler",
",",
"$",
"data",
")",
";",
"fclose",
"(",
"$",
"handler",
")"... | Creates the handler and writes the files.
@param $file string | The filename.
@return string | [
"Creates",
"the",
"handler",
"and",
"writes",
"the",
"files",
"."
] | 43f62c3b28167bff76274f954e235413a9e9c707 | https://github.com/diasbruno/stc/blob/43f62c3b28167bff76274f954e235413a9e9c707/lib/stc/DataWriter.php#L21-L26 |
205,290 | diasbruno/stc | lib/stc/DataWriter.php | DataWriter.write | public function write($path = '', $file = '', $content = '')
{
$the_path = Application::config()->public_folder() . '/' . $path;
@mkdir($the_path, 0755, true);
$this->write_to($the_path . '/'. $file, $content);
} | php | public function write($path = '', $file = '', $content = '')
{
$the_path = Application::config()->public_folder() . '/' . $path;
@mkdir($the_path, 0755, true);
$this->write_to($the_path . '/'. $file, $content);
} | [
"public",
"function",
"write",
"(",
"$",
"path",
"=",
"''",
",",
"$",
"file",
"=",
"''",
",",
"$",
"content",
"=",
"''",
")",
"{",
"$",
"the_path",
"=",
"Application",
"::",
"config",
"(",
")",
"->",
"public_folder",
"(",
")",
".",
"'/'",
".",
"$... | Write the file.
@param $path string | The path where the file is located.
@param $file string | The filename.
@param $content string | The file content.
@return string | [
"Write",
"the",
"file",
"."
] | 43f62c3b28167bff76274f954e235413a9e9c707 | https://github.com/diasbruno/stc/blob/43f62c3b28167bff76274f954e235413a9e9c707/lib/stc/DataWriter.php#L35-L41 |
205,291 | RadialCorp/magento-core | src/lib/Radial/RiskService/Sdk/Api.php | Radial_RiskService_Sdk_Api._deserializeResponse | protected function _deserializeResponse($responseData)
{
try {
$this->getResponseBody()->deserialize($responseData);
} catch (Radial_RiskService_Sdk_Exception_Invalid_Payload_Exception $e) {
$logMessage = sprintf('[%s] Error Payload Response Body: %s', __CLASS__, $this->cleanAuthXml($responseData));
... | php | protected function _deserializeResponse($responseData)
{
try {
$this->getResponseBody()->deserialize($responseData);
} catch (Radial_RiskService_Sdk_Exception_Invalid_Payload_Exception $e) {
$logMessage = sprintf('[%s] Error Payload Response Body: %s', __CLASS__, $this->cleanAuthXml($responseData));
... | [
"protected",
"function",
"_deserializeResponse",
"(",
"$",
"responseData",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"getResponseBody",
"(",
")",
"->",
"deserialize",
"(",
"$",
"responseData",
")",
";",
"}",
"catch",
"(",
"Radial_RiskService_Sdk_Exception_Invalid_P... | Deserialized the response xml into response payload if an exception is thrown catch it
and set the error payload and deserialized the response xml into it.
@param string
@return self | [
"Deserialized",
"the",
"response",
"xml",
"into",
"response",
"payload",
"if",
"an",
"exception",
"is",
"thrown",
"catch",
"it",
"and",
"set",
"the",
"error",
"payload",
"and",
"deserialized",
"the",
"response",
"xml",
"into",
"it",
"."
] | 9bb5f218d9caf79eab8598f4f8447037a0cc6355 | https://github.com/RadialCorp/magento-core/blob/9bb5f218d9caf79eab8598f4f8447037a0cc6355/src/lib/Radial/RiskService/Sdk/Api.php#L94-L107 |
205,292 | RadialCorp/magento-core | src/lib/Radial/RiskService/Sdk/Api.php | Radial_RiskService_Sdk_Api._sendRequest | protected function _sendRequest()
{
// clear the old response
$this->_lastRequestsResponse = null;
$httpMethod = strtolower($this->_config->getHttpMethod());
if (!method_exists($this, $httpMethod)) {
throw Mage::exception(
'Radial_RiskService_Sdk_Exception_Unsupported_Http_Action',
sprintf('HTTP act... | php | protected function _sendRequest()
{
// clear the old response
$this->_lastRequestsResponse = null;
$httpMethod = strtolower($this->_config->getHttpMethod());
if (!method_exists($this, $httpMethod)) {
throw Mage::exception(
'Radial_RiskService_Sdk_Exception_Unsupported_Http_Action',
sprintf('HTTP act... | [
"protected",
"function",
"_sendRequest",
"(",
")",
"{",
"// clear the old response",
"$",
"this",
"->",
"_lastRequestsResponse",
"=",
"null",
";",
"$",
"httpMethod",
"=",
"strtolower",
"(",
"$",
"this",
"->",
"_config",
"->",
"getHttpMethod",
"(",
")",
")",
";... | Send get or post CURL request to the API URI.
@return boolean
@throws Radial_RiskService_Sdk_Exception_Unsupported_Http_Action_Exception | [
"Send",
"get",
"or",
"post",
"CURL",
"request",
"to",
"the",
"API",
"URI",
"."
] | 9bb5f218d9caf79eab8598f4f8447037a0cc6355 | https://github.com/RadialCorp/magento-core/blob/9bb5f218d9caf79eab8598f4f8447037a0cc6355/src/lib/Radial/RiskService/Sdk/Api.php#L175-L188 |
205,293 | RadialCorp/magento-core | src/lib/Radial/RiskService/Sdk/Api.php | Radial_RiskService_Sdk_Api._post | protected function _post()
{
$requestXml = $this->getRequestBody()->serialize();
if ($this->_helperConfig->isDebugMode()) {
$logMessage = sprintf('[%s] Request Body: %s', __CLASS__, $this->cleanAuthXml($requestXml));
Mage::log($logMessage, Zend_Log::DEBUG);
}
$xml = simplexml_load_string($requestXml);
... | php | protected function _post()
{
$requestXml = $this->getRequestBody()->serialize();
if ($this->_helperConfig->isDebugMode()) {
$logMessage = sprintf('[%s] Request Body: %s', __CLASS__, $this->cleanAuthXml($requestXml));
Mage::log($logMessage, Zend_Log::DEBUG);
}
$xml = simplexml_load_string($requestXml);
... | [
"protected",
"function",
"_post",
"(",
")",
"{",
"$",
"requestXml",
"=",
"$",
"this",
"->",
"getRequestBody",
"(",
")",
"->",
"serialize",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"_helperConfig",
"->",
"isDebugMode",
"(",
")",
")",
"{",
"$",
"lo... | Send post CURL request.
@return Requests_Response
@throws Requests_Exception | [
"Send",
"post",
"CURL",
"request",
"."
] | 9bb5f218d9caf79eab8598f4f8447037a0cc6355 | https://github.com/RadialCorp/magento-core/blob/9bb5f218d9caf79eab8598f4f8447037a0cc6355/src/lib/Radial/RiskService/Sdk/Api.php#L196-L231 |
205,294 | RadialCorp/magento-core | src/lib/Radial/RiskService/Sdk/Api.php | Radial_RiskService_Sdk_Api._get | protected function _get()
{
$this->_lastRequestsResponse = Requests::post(
$this->_config->getEndpoint(),
$this->_buildHeader()
);
return $this->_lastRequestsResponse->success;
} | php | protected function _get()
{
$this->_lastRequestsResponse = Requests::post(
$this->_config->getEndpoint(),
$this->_buildHeader()
);
return $this->_lastRequestsResponse->success;
} | [
"protected",
"function",
"_get",
"(",
")",
"{",
"$",
"this",
"->",
"_lastRequestsResponse",
"=",
"Requests",
"::",
"post",
"(",
"$",
"this",
"->",
"_config",
"->",
"getEndpoint",
"(",
")",
",",
"$",
"this",
"->",
"_buildHeader",
"(",
")",
")",
";",
"re... | Send get CURL request.
@return Requests_Response
@throws Requests_Exception | [
"Send",
"get",
"CURL",
"request",
"."
] | 9bb5f218d9caf79eab8598f4f8447037a0cc6355 | https://github.com/RadialCorp/magento-core/blob/9bb5f218d9caf79eab8598f4f8447037a0cc6355/src/lib/Radial/RiskService/Sdk/Api.php#L252-L259 |
205,295 | RadialCorp/magento-core | src/lib/Radial/RiskService/Sdk/Api.php | Radial_RiskService_Sdk_Api.cleanAuthXml | public function cleanAuthXml($xml)
{
$xml = preg_replace('#(\<(?:Encrypted)?CardSecurityCode\>).*(\</(?:Encrypted)?CardSecurityCode\>)#', '$1***$2', $xml);
$xml = preg_replace('#(\<(?:Encrypted)?PaymentAccountUniqueId.*?\>).*(\</(?:Encrypted)?PaymentAccountUniqueId\>)#', '$1***$2', $xm... | php | public function cleanAuthXml($xml)
{
$xml = preg_replace('#(\<(?:Encrypted)?CardSecurityCode\>).*(\</(?:Encrypted)?CardSecurityCode\>)#', '$1***$2', $xml);
$xml = preg_replace('#(\<(?:Encrypted)?PaymentAccountUniqueId.*?\>).*(\</(?:Encrypted)?PaymentAccountUniqueId\>)#', '$1***$2', $xm... | [
"public",
"function",
"cleanAuthXml",
"(",
"$",
"xml",
")",
"{",
"$",
"xml",
"=",
"preg_replace",
"(",
"'#(\\<(?:Encrypted)?CardSecurityCode\\>).*(\\</(?:Encrypted)?CardSecurityCode\\>)#'",
",",
"'$1***$2'",
",",
"$",
"xml",
")",
";",
"$",
"xml",
"=",
"preg_replace",
... | Scrub the auth request XML message of any sensitive data - CVV, CC number.
@param string $xml
@return string | [
"Scrub",
"the",
"auth",
"request",
"XML",
"message",
"of",
"any",
"sensitive",
"data",
"-",
"CVV",
"CC",
"number",
"."
] | 9bb5f218d9caf79eab8598f4f8447037a0cc6355 | https://github.com/RadialCorp/magento-core/blob/9bb5f218d9caf79eab8598f4f8447037a0cc6355/src/lib/Radial/RiskService/Sdk/Api.php#L266-L272 |
205,296 | drmvc/router | src/Router/Router.php | Router.set | public function set(array $methods, array $args): RouterInterface
{
list($pattern, $callable) = $args;
$route = new Route($methods, $pattern, $callable);
$this->setRoute($route);
return $this;
} | php | public function set(array $methods, array $args): RouterInterface
{
list($pattern, $callable) = $args;
$route = new Route($methods, $pattern, $callable);
$this->setRoute($route);
return $this;
} | [
"public",
"function",
"set",
"(",
"array",
"$",
"methods",
",",
"array",
"$",
"args",
")",
":",
"RouterInterface",
"{",
"list",
"(",
"$",
"pattern",
",",
"$",
"callable",
")",
"=",
"$",
"args",
";",
"$",
"route",
"=",
"new",
"Route",
"(",
"$",
"met... | Abstraction of setter
@param array $methods
@param array $args
@return RouterInterface | [
"Abstraction",
"of",
"setter"
] | ecbf5f4380a060af83af23334b9f81054bc6c64c | https://github.com/drmvc/router/blob/ecbf5f4380a060af83af23334b9f81054bc6c64c/src/Router/Router.php#L80-L86 |
205,297 | drmvc/router | src/Router/Router.php | Router.checkMethods | public function checkMethods(array $methods): array
{
return array_map(
function($method) {
$method = strtolower($method);
if (!\in_array($method, self::METHODS, false)) {
throw new Exception("Method \"$method\" is not in allowed list [" . impl... | php | public function checkMethods(array $methods): array
{
return array_map(
function($method) {
$method = strtolower($method);
if (!\in_array($method, self::METHODS, false)) {
throw new Exception("Method \"$method\" is not in allowed list [" . impl... | [
"public",
"function",
"checkMethods",
"(",
"array",
"$",
"methods",
")",
":",
"array",
"{",
"return",
"array_map",
"(",
"function",
"(",
"$",
"method",
")",
"{",
"$",
"method",
"=",
"strtolower",
"(",
"$",
"method",
")",
";",
"if",
"(",
"!",
"\\",
"i... | Check if passed methods in allowed list
@param array $methods list of methods for check
@throws Exception
@return array | [
"Check",
"if",
"passed",
"methods",
"in",
"allowed",
"list"
] | ecbf5f4380a060af83af23334b9f81054bc6c64c | https://github.com/drmvc/router/blob/ecbf5f4380a060af83af23334b9f81054bc6c64c/src/Router/Router.php#L95-L108 |
205,298 | drmvc/router | src/Router/Router.php | Router.map | public function map(array $methods, string $pattern, $callable): MethodsInterface
{
// Check if method in allowed list
$methods = $this->checkMethods($methods);
// Set new route with parameters
$this->set($methods, [$pattern, $callable]);
return $this;
} | php | public function map(array $methods, string $pattern, $callable): MethodsInterface
{
// Check if method in allowed list
$methods = $this->checkMethods($methods);
// Set new route with parameters
$this->set($methods, [$pattern, $callable]);
return $this;
} | [
"public",
"function",
"map",
"(",
"array",
"$",
"methods",
",",
"string",
"$",
"pattern",
",",
"$",
"callable",
")",
":",
"MethodsInterface",
"{",
"// Check if method in allowed list",
"$",
"methods",
"=",
"$",
"this",
"->",
"checkMethods",
"(",
"$",
"methods"... | Callable must be only selected methods
@param array $methods
@param string $pattern
@param callable|string $callable
@throws Exception
@return MethodsInterface | [
"Callable",
"must",
"be",
"only",
"selected",
"methods"
] | ecbf5f4380a060af83af23334b9f81054bc6c64c | https://github.com/drmvc/router/blob/ecbf5f4380a060af83af23334b9f81054bc6c64c/src/Router/Router.php#L119-L128 |
205,299 | drmvc/router | src/Router/Router.php | Router.any | public function any(string $pattern, $callable): MethodsInterface
{
// Set new route with all methods
$this->set(self::METHODS, [$pattern, $callable]);
return $this;
} | php | public function any(string $pattern, $callable): MethodsInterface
{
// Set new route with all methods
$this->set(self::METHODS, [$pattern, $callable]);
return $this;
} | [
"public",
"function",
"any",
"(",
"string",
"$",
"pattern",
",",
"$",
"callable",
")",
":",
"MethodsInterface",
"{",
"// Set new route with all methods",
"$",
"this",
"->",
"set",
"(",
"self",
"::",
"METHODS",
",",
"[",
"$",
"pattern",
",",
"$",
"callable",
... | Any method should be callable
@param string $pattern
@param callable|string $callable
@return MethodsInterface | [
"Any",
"method",
"should",
"be",
"callable"
] | ecbf5f4380a060af83af23334b9f81054bc6c64c | https://github.com/drmvc/router/blob/ecbf5f4380a060af83af23334b9f81054bc6c64c/src/Router/Router.php#L137-L143 |
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.