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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
195,000 | ScaraMVC/Framework | src/Scara/Http/Controller.php | Controller.redirectWith | public function redirectWith($url, $data)
{
$this->_session->flash('redirect_data', $data);
$this->redirect($url);
} | php | public function redirectWith($url, $data)
{
$this->_session->flash('redirect_data', $data);
$this->redirect($url);
} | [
"public",
"function",
"redirectWith",
"(",
"$",
"url",
",",
"$",
"data",
")",
"{",
"$",
"this",
"->",
"_session",
"->",
"flash",
"(",
"'redirect_data'",
",",
"$",
"data",
")",
";",
"$",
"this",
"->",
"redirect",
"(",
"$",
"url",
")",
";",
"}"
] | Redirects to a URL with data passed in as a temp flash session.
@param string $url - Redirection's URL
@param mixed $data - Data to redirect with
@return void | [
"Redirects",
"to",
"a",
"URL",
"with",
"data",
"passed",
"in",
"as",
"a",
"temp",
"flash",
"session",
"."
] | 199b08b45fadf5dae14ac4732af03b36e15bbef2 | https://github.com/ScaraMVC/Framework/blob/199b08b45fadf5dae14ac4732af03b36e15bbef2/src/Scara/Http/Controller.php#L208-L212 |
195,001 | ScaraMVC/Framework | src/Scara/Http/Controller.php | Controller.group | public function group($name, $data = [])
{
$app = 'App\Groups\\'.ucwords($name);
$core = 'Scara\Http\Groups\\'.ucwords($name);
if (class_exists($app)) {
$class = new $app();
} else {
if (class_exists($core)) {
$class = new $core();
... | php | public function group($name, $data = [])
{
$app = 'App\Groups\\'.ucwords($name);
$core = 'Scara\Http\Groups\\'.ucwords($name);
if (class_exists($app)) {
$class = new $app();
} else {
if (class_exists($core)) {
$class = new $core();
... | [
"public",
"function",
"group",
"(",
"$",
"name",
",",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"$",
"app",
"=",
"'App\\Groups\\\\'",
".",
"ucwords",
"(",
"$",
"name",
")",
";",
"$",
"core",
"=",
"'Scara\\Http\\Groups\\\\'",
".",
"ucwords",
"(",
"$",
"na... | Loads in a group for given controller method.
@param string $name - The group name
@param array $data - Data to pass to group
@throws \Exception
@return \Scara\Http\Controller | [
"Loads",
"in",
"a",
"group",
"for",
"given",
"controller",
"method",
"."
] | 199b08b45fadf5dae14ac4732af03b36e15bbef2 | https://github.com/ScaraMVC/Framework/blob/199b08b45fadf5dae14ac4732af03b36e15bbef2/src/Scara/Http/Controller.php#L236-L269 |
195,002 | ScaraMVC/Framework | src/Scara/Http/Controller.php | Controller.load | public function load(Router $router, $basepath)
{
$loader = new RouteLoader();
$loader->registerRouter($router);
$this->_route = $loader->getRequestedRoute($basepath);
if (isset($this->_route['method']) && $this->_route['method'] == $_SERVER['REQUEST_METHOD']) {
$control... | php | public function load(Router $router, $basepath)
{
$loader = new RouteLoader();
$loader->registerRouter($router);
$this->_route = $loader->getRequestedRoute($basepath);
if (isset($this->_route['method']) && $this->_route['method'] == $_SERVER['REQUEST_METHOD']) {
$control... | [
"public",
"function",
"load",
"(",
"Router",
"$",
"router",
",",
"$",
"basepath",
")",
"{",
"$",
"loader",
"=",
"new",
"RouteLoader",
"(",
")",
";",
"$",
"loader",
"->",
"registerRouter",
"(",
"$",
"router",
")",
";",
"$",
"this",
"->",
"_route",
"="... | Loads the controller with the requested route.
@param \Scara\Routing\Router $router - The router
@param string $basepath - Application's base path
@return void | [
"Loads",
"the",
"controller",
"with",
"the",
"requested",
"route",
"."
] | 199b08b45fadf5dae14ac4732af03b36e15bbef2 | https://github.com/ScaraMVC/Framework/blob/199b08b45fadf5dae14ac4732af03b36e15bbef2/src/Scara/Http/Controller.php#L279-L313 |
195,003 | ScaraMVC/Framework | src/Scara/Http/Controller.php | Controller.loadErrorPage | public function loadErrorPage($errorType)
{
switch ($errorType) {
case 'notfound':
$code = '404';
break;
case 'badrequest':
$code = '400';
break;
default:
$code = $errorType;
break;
}
... | php | public function loadErrorPage($errorType)
{
switch ($errorType) {
case 'notfound':
$code = '404';
break;
case 'badrequest':
$code = '400';
break;
default:
$code = $errorType;
break;
}
... | [
"public",
"function",
"loadErrorPage",
"(",
"$",
"errorType",
")",
"{",
"switch",
"(",
"$",
"errorType",
")",
"{",
"case",
"'notfound'",
":",
"$",
"code",
"=",
"'404'",
";",
"break",
";",
"case",
"'badrequest'",
":",
"$",
"code",
"=",
"'400'",
";",
"br... | Loads a requested error page.
@param string $errorType - Error type to render for
@return void | [
"Loads",
"a",
"requested",
"error",
"page",
"."
] | 199b08b45fadf5dae14ac4732af03b36e15bbef2 | https://github.com/ScaraMVC/Framework/blob/199b08b45fadf5dae14ac4732af03b36e15bbef2/src/Scara/Http/Controller.php#L322-L364 |
195,004 | Ang3/PhpunitBundle | src/Traits/ClassUtilsTrait.php | ClassUtilsTrait.getReflectionMethod | protected function getReflectionMethod($class, $name)
{
// Réflection de la classe
$reflectionClass = new ReflectionClass($class);
// Récupération de la réflection de la méthode
$method = $reflectionClass->getMethod($name);
// Ouverture des accès aux appels
$method-... | php | protected function getReflectionMethod($class, $name)
{
// Réflection de la classe
$reflectionClass = new ReflectionClass($class);
// Récupération de la réflection de la méthode
$method = $reflectionClass->getMethod($name);
// Ouverture des accès aux appels
$method-... | [
"protected",
"function",
"getReflectionMethod",
"(",
"$",
"class",
",",
"$",
"name",
")",
"{",
"// Réflection de la classe",
"$",
"reflectionClass",
"=",
"new",
"ReflectionClass",
"(",
"$",
"class",
")",
";",
"// Récupération de la réflection de la méthode",
"$",
"met... | Gets a reflection method object.
@param string $class
@param string $name
@return \ReflectionMethod | [
"Gets",
"a",
"reflection",
"method",
"object",
"."
] | b76fff16cd8b8a95d71f75a2f5b738716d8b6f36 | https://github.com/Ang3/PhpunitBundle/blob/b76fff16cd8b8a95d71f75a2f5b738716d8b6f36/src/Traits/ClassUtilsTrait.php#L36-L49 |
195,005 | Ang3/PhpunitBundle | src/Traits/ClassUtilsTrait.php | ClassUtilsTrait.getReflectionProperty | protected function getReflectionProperty($objectOrClass, $name)
{
// Réflection de la classe
$reflectionClass = new ReflectionClass($objectOrClass);
// Récupération de la réflection de la propriété
$property = $reflectionClass->getProperty((string) $name);
// Ouverture des ... | php | protected function getReflectionProperty($objectOrClass, $name)
{
// Réflection de la classe
$reflectionClass = new ReflectionClass($objectOrClass);
// Récupération de la réflection de la propriété
$property = $reflectionClass->getProperty((string) $name);
// Ouverture des ... | [
"protected",
"function",
"getReflectionProperty",
"(",
"$",
"objectOrClass",
",",
"$",
"name",
")",
"{",
"// Réflection de la classe",
"$",
"reflectionClass",
"=",
"new",
"ReflectionClass",
"(",
"$",
"objectOrClass",
")",
";",
"// Récupération de la réflection de la propr... | Gets a reflection property object.
@param object|string $objectOrClass
@param string $name
@return \ReflectionProperty | [
"Gets",
"a",
"reflection",
"property",
"object",
"."
] | b76fff16cd8b8a95d71f75a2f5b738716d8b6f36 | https://github.com/Ang3/PhpunitBundle/blob/b76fff16cd8b8a95d71f75a2f5b738716d8b6f36/src/Traits/ClassUtilsTrait.php#L59-L72 |
195,006 | Ang3/PhpunitBundle | src/Traits/ClassUtilsTrait.php | ClassUtilsTrait.setPropertyValue | protected function setPropertyValue($object, $propertyName, $value)
{
// Mise-à-jour de la valeur de la propriété
$this->getReflectionProperty($object, $propertyName)->setValue($object, $value);
// Retour du test
return $this;
} | php | protected function setPropertyValue($object, $propertyName, $value)
{
// Mise-à-jour de la valeur de la propriété
$this->getReflectionProperty($object, $propertyName)->setValue($object, $value);
// Retour du test
return $this;
} | [
"protected",
"function",
"setPropertyValue",
"(",
"$",
"object",
",",
"$",
"propertyName",
",",
"$",
"value",
")",
"{",
"// Mise-à-jour de la valeur de la propriété",
"$",
"this",
"->",
"getReflectionProperty",
"(",
"$",
"object",
",",
"$",
"propertyName",
")",
"-... | Sets value in object property.
@param object $object
@param string $propertyName
@param mixed $value
@return mixed | [
"Sets",
"value",
"in",
"object",
"property",
"."
] | b76fff16cd8b8a95d71f75a2f5b738716d8b6f36 | https://github.com/Ang3/PhpunitBundle/blob/b76fff16cd8b8a95d71f75a2f5b738716d8b6f36/src/Traits/ClassUtilsTrait.php#L83-L90 |
195,007 | Nekland/BaseApi | lib/Nekland/BaseApi/Http/AbstractHttpClient.php | AbstractHttpClient.getPath | protected function getPath($path)
{
$hasHttp = strpos($path, 'http');
if (false === $hasHttp || $hasHttp !== 0) {
return $this->options['base_url'] . $path;
}
return $path;
} | php | protected function getPath($path)
{
$hasHttp = strpos($path, 'http');
if (false === $hasHttp || $hasHttp !== 0) {
return $this->options['base_url'] . $path;
}
return $path;
} | [
"protected",
"function",
"getPath",
"(",
"$",
"path",
")",
"{",
"$",
"hasHttp",
"=",
"strpos",
"(",
"$",
"path",
",",
"'http'",
")",
";",
"if",
"(",
"false",
"===",
"$",
"hasHttp",
"||",
"$",
"hasHttp",
"!==",
"0",
")",
"{",
"return",
"$",
"this",
... | Generate a complete URL using the option "base_url"
@param string $path The api uri
@return string | [
"Generate",
"a",
"complete",
"URL",
"using",
"the",
"option",
"base_url"
] | c96051b36d6982abf2a8b1f1ec16351bcae2455e | https://github.com/Nekland/BaseApi/blob/c96051b36d6982abf2a8b1f1ec16351bcae2455e/lib/Nekland/BaseApi/Http/AbstractHttpClient.php#L110-L118 |
195,008 | Nekland/BaseApi | lib/Nekland/BaseApi/Http/AbstractHttpClient.php | AbstractHttpClient.createRequest | public static function createRequest($method, $path, $body = [], array $headers = [])
{
return new Request($method, $path, $body, $headers);
} | php | public static function createRequest($method, $path, $body = [], array $headers = [])
{
return new Request($method, $path, $body, $headers);
} | [
"public",
"static",
"function",
"createRequest",
"(",
"$",
"method",
",",
"$",
"path",
",",
"$",
"body",
"=",
"[",
"]",
",",
"array",
"$",
"headers",
"=",
"[",
"]",
")",
"{",
"return",
"new",
"Request",
"(",
"$",
"method",
",",
"$",
"path",
",",
... | Generate a request object
@param string $method
@param string $path
@param array|string $body
@param array $headers
@return Request | [
"Generate",
"a",
"request",
"object"
] | c96051b36d6982abf2a8b1f1ec16351bcae2455e | https://github.com/Nekland/BaseApi/blob/c96051b36d6982abf2a8b1f1ec16351bcae2455e/lib/Nekland/BaseApi/Http/AbstractHttpClient.php#L129-L132 |
195,009 | mylxsw/FocusPHP | src/Request/HttpRequest.php | HttpRequest._escape | private function _escape($value, $htmlEntities = false)
{
if (get_magic_quotes_gpc()) {
if ($htmlEntities) {
return htmlspecialchars($value);
}
return $value;
}
if (is_array($value)) {
return array_map(function ($n) use ($html... | php | private function _escape($value, $htmlEntities = false)
{
if (get_magic_quotes_gpc()) {
if ($htmlEntities) {
return htmlspecialchars($value);
}
return $value;
}
if (is_array($value)) {
return array_map(function ($n) use ($html... | [
"private",
"function",
"_escape",
"(",
"$",
"value",
",",
"$",
"htmlEntities",
"=",
"false",
")",
"{",
"if",
"(",
"get_magic_quotes_gpc",
"(",
")",
")",
"{",
"if",
"(",
"$",
"htmlEntities",
")",
"{",
"return",
"htmlspecialchars",
"(",
"$",
"value",
")",
... | escape string value.
@param $value
@param $htmlEntities
@return string | [
"escape",
"string",
"value",
"."
] | 33922bacbea66f11f874d991d7308a36cdf5831a | https://github.com/mylxsw/FocusPHP/blob/33922bacbea66f11f874d991d7308a36cdf5831a/src/Request/HttpRequest.php#L128-L156 |
195,010 | apioo/psx-record | src/Mapper.php | Mapper.map | public static function map(RecordInterface $source, $destination, array $rules)
{
if (!is_object($destination)) {
throw new InvalidArgumentException('Destination must be an object');
}
$data = $source->getProperties();
foreach ($data as $key => $value) {
// ... | php | public static function map(RecordInterface $source, $destination, array $rules)
{
if (!is_object($destination)) {
throw new InvalidArgumentException('Destination must be an object');
}
$data = $source->getProperties();
foreach ($data as $key => $value) {
// ... | [
"public",
"static",
"function",
"map",
"(",
"RecordInterface",
"$",
"source",
",",
"$",
"destination",
",",
"array",
"$",
"rules",
")",
"{",
"if",
"(",
"!",
"is_object",
"(",
"$",
"destination",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(... | Method which can map all fields of a record to an arbitrary class by
calling the fitting setter methods if available
@param \PSX\Record\RecordInterface $source
@param object $destination
@param array $rules | [
"Method",
"which",
"can",
"map",
"all",
"fields",
"of",
"a",
"record",
"to",
"an",
"arbitrary",
"class",
"by",
"calling",
"the",
"fitting",
"setter",
"methods",
"if",
"available"
] | 045d1ec323635187467569f7d12973c8718a7871 | https://github.com/apioo/psx-record/blob/045d1ec323635187467569f7d12973c8718a7871/src/Mapper.php#L43-L73 |
195,011 | Hnto/nuki | src/Handlers/Security/Hasher.php | Hasher.hash | public function hash(string $data, $file = false) {
if ($file === false) {
return $this->hashContent($data);
}
return $this->hashFile($file);
} | php | public function hash(string $data, $file = false) {
if ($file === false) {
return $this->hashContent($data);
}
return $this->hashFile($file);
} | [
"public",
"function",
"hash",
"(",
"string",
"$",
"data",
",",
"$",
"file",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"file",
"===",
"false",
")",
"{",
"return",
"$",
"this",
"->",
"hashContent",
"(",
"$",
"data",
")",
";",
"}",
"return",
"$",
"thi... | Hash by message
@param string $data
@return bool|string | [
"Hash",
"by",
"message"
] | c3fb16244e8d611c335a88e3b9c9ee7d81fafc0c | https://github.com/Hnto/nuki/blob/c3fb16244e8d611c335a88e3b9c9ee7d81fafc0c/src/Handlers/Security/Hasher.php#L43-L49 |
195,012 | Hnto/nuki | src/Handlers/Security/Hasher.php | Hasher.hashFile | private function hashFile(string $filename) {
$hash = hash_hmac_file(
$this->algorithm,
$filename,
$this->key
);
return $this->validate($hash);
} | php | private function hashFile(string $filename) {
$hash = hash_hmac_file(
$this->algorithm,
$filename,
$this->key
);
return $this->validate($hash);
} | [
"private",
"function",
"hashFile",
"(",
"string",
"$",
"filename",
")",
"{",
"$",
"hash",
"=",
"hash_hmac_file",
"(",
"$",
"this",
"->",
"algorithm",
",",
"$",
"filename",
",",
"$",
"this",
"->",
"key",
")",
";",
"return",
"$",
"this",
"->",
"validate"... | Hash by filename
@param string $filename
@return bool|string | [
"Hash",
"by",
"filename"
] | c3fb16244e8d611c335a88e3b9c9ee7d81fafc0c | https://github.com/Hnto/nuki/blob/c3fb16244e8d611c335a88e3b9c9ee7d81fafc0c/src/Handlers/Security/Hasher.php#L79-L87 |
195,013 | Hnto/nuki | src/Handlers/Security/Hasher.php | Hasher.hashContent | private function hashContent(string $data) {
$hash = hash_hmac(
$this->algorithm,
$data,
$this->key
);
return $this->validate($hash);
} | php | private function hashContent(string $data) {
$hash = hash_hmac(
$this->algorithm,
$data,
$this->key
);
return $this->validate($hash);
} | [
"private",
"function",
"hashContent",
"(",
"string",
"$",
"data",
")",
"{",
"$",
"hash",
"=",
"hash_hmac",
"(",
"$",
"this",
"->",
"algorithm",
",",
"$",
"data",
",",
"$",
"this",
"->",
"key",
")",
";",
"return",
"$",
"this",
"->",
"validate",
"(",
... | Hash by content
@param string $data
@return boolean | [
"Hash",
"by",
"content"
] | c3fb16244e8d611c335a88e3b9c9ee7d81fafc0c | https://github.com/Hnto/nuki/blob/c3fb16244e8d611c335a88e3b9c9ee7d81fafc0c/src/Handlers/Security/Hasher.php#L95-L103 |
195,014 | modulusphp/http | Rest.php | Rest.json | public function json(array $array = [], int $code = null)
{
$this->data = $array;
if ($code != null) {
$this->code = $code;
header('HTTP/1.1 '.$this->code);
return $this->send();
}
return $this;
} | php | public function json(array $array = [], int $code = null)
{
$this->data = $array;
if ($code != null) {
$this->code = $code;
header('HTTP/1.1 '.$this->code);
return $this->send();
}
return $this;
} | [
"public",
"function",
"json",
"(",
"array",
"$",
"array",
"=",
"[",
"]",
",",
"int",
"$",
"code",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"data",
"=",
"$",
"array",
";",
"if",
"(",
"$",
"code",
"!=",
"null",
")",
"{",
"$",
"this",
"->",
"co... | Attach json data
@param array $array
@param integer $code
@return Rest | [
"Attach",
"json",
"data"
] | fc5c0f2b582a04de1685578d3fb790686a0a240c | https://github.com/modulusphp/http/blob/fc5c0f2b582a04de1685578d3fb790686a0a240c/Rest.php#L87-L98 |
195,015 | modulusphp/http | Rest.php | Rest.withHeaders | public function withHeaders(array $array, int $code = null)
{
foreach($array as $field => $i) {
array_push($this->headers, $field .': '. $i);
}
if ($code != null) {
$this->code = $code;
header('HTTP/1.1 '.$this->code);
return $this->send();
}
return $this;
} | php | public function withHeaders(array $array, int $code = null)
{
foreach($array as $field => $i) {
array_push($this->headers, $field .': '. $i);
}
if ($code != null) {
$this->code = $code;
header('HTTP/1.1 '.$this->code);
return $this->send();
}
return $this;
} | [
"public",
"function",
"withHeaders",
"(",
"array",
"$",
"array",
",",
"int",
"$",
"code",
"=",
"null",
")",
"{",
"foreach",
"(",
"$",
"array",
"as",
"$",
"field",
"=>",
"$",
"i",
")",
"{",
"array_push",
"(",
"$",
"this",
"->",
"headers",
",",
"$",
... | Set response header's
@param array $array
@return Rest | [
"Set",
"response",
"header",
"s"
] | fc5c0f2b582a04de1685578d3fb790686a0a240c | https://github.com/modulusphp/http/blob/fc5c0f2b582a04de1685578d3fb790686a0a240c/Rest.php#L119-L132 |
195,016 | modulusphp/http | Rest.php | Rest.view | public function view(string $path, array $data = [], bool $return = false)
{
if ($this->headers !== ['Content-Type: application/json']) {
foreach($this->headers as $header) {
header($header);
}
}
return View::make($path, $data, $return);
} | php | public function view(string $path, array $data = [], bool $return = false)
{
if ($this->headers !== ['Content-Type: application/json']) {
foreach($this->headers as $header) {
header($header);
}
}
return View::make($path, $data, $return);
} | [
"public",
"function",
"view",
"(",
"string",
"$",
"path",
",",
"array",
"$",
"data",
"=",
"[",
"]",
",",
"bool",
"$",
"return",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"headers",
"!==",
"[",
"'Content-Type: application/json'",
"]",
")",
... | Return a view response
@param string $path
@param array $data
@param bool $return
@return mixed | [
"Return",
"a",
"view",
"response"
] | fc5c0f2b582a04de1685578d3fb790686a0a240c | https://github.com/modulusphp/http/blob/fc5c0f2b582a04de1685578d3fb790686a0a240c/Rest.php#L142-L151 |
195,017 | modulusphp/http | Rest.php | Rest.download | public function download(string $location, ?string $filename = null, ?array $headers = [])
{
if (!file_exists($location)) {
header("HTTP/1.1 404 Not Found");
return;
}
$size = filesize($location);
$time = date('r', filemtime($location));
$fm = @fopen($location, 'rb');
if (!$fm) ... | php | public function download(string $location, ?string $filename = null, ?array $headers = [])
{
if (!file_exists($location)) {
header("HTTP/1.1 404 Not Found");
return;
}
$size = filesize($location);
$time = date('r', filemtime($location));
$fm = @fopen($location, 'rb');
if (!$fm) ... | [
"public",
"function",
"download",
"(",
"string",
"$",
"location",
",",
"?",
"string",
"$",
"filename",
"=",
"null",
",",
"?",
"array",
"$",
"headers",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"location",
")",
")",
"{",
"hea... | Reads the requested portion of a file and sends its contents to the client with the appropriate headers.
This HTTP_RANGE compatible read file function is necessary for allowing streaming media to be skipped around in.
@param string $location
@param string $filename
@param string $mimeType
@return
@link https://gist.g... | [
"Reads",
"the",
"requested",
"portion",
"of",
"a",
"file",
"and",
"sends",
"its",
"contents",
"to",
"the",
"client",
"with",
"the",
"appropriate",
"headers",
".",
"This",
"HTTP_RANGE",
"compatible",
"read",
"file",
"function",
"is",
"necessary",
"for",
"allowi... | fc5c0f2b582a04de1685578d3fb790686a0a240c | https://github.com/modulusphp/http/blob/fc5c0f2b582a04de1685578d3fb790686a0a240c/Rest.php#L164-L229 |
195,018 | zhaoxianfang/tools | src/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php | ParameterBag.resolveString | public function resolveString($value, array $resolving = array())
{
// we do this to deal with non string values (Boolean, integer, ...)
// as the preg_replace_callback throw an exception when trying
// a non-string in a parameter value
if (preg_match('/^%([^%\s]+)%$/', $value, $matc... | php | public function resolveString($value, array $resolving = array())
{
// we do this to deal with non string values (Boolean, integer, ...)
// as the preg_replace_callback throw an exception when trying
// a non-string in a parameter value
if (preg_match('/^%([^%\s]+)%$/', $value, $matc... | [
"public",
"function",
"resolveString",
"(",
"$",
"value",
",",
"array",
"$",
"resolving",
"=",
"array",
"(",
")",
")",
"{",
"// we do this to deal with non string values (Boolean, integer, ...)",
"// as the preg_replace_callback throw an exception when trying",
"// a non-string i... | Resolves parameters inside a string.
@param string $value The string to resolve
@param array $resolving An array of keys that are being resolved (used internally to detect circular references)
@return string The resolved string
@throws ParameterNotFoundException if a placeholder references a parameter ... | [
"Resolves",
"parameters",
"inside",
"a",
"string",
"."
] | d8fc8a9ecd75b5ce4236f0a2e9fdc055108573e7 | https://github.com/zhaoxianfang/tools/blob/d8fc8a9ecd75b5ce4236f0a2e9fdc055108573e7/src/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php#L205-L246 |
195,019 | jabernardo/lollipop-php | Library/System/Directory.php | Directory.contents | static function contents($directory) {
if (!self::exists($directory)) return null;
$dircontents = [];
$contents = scandir($directory);
foreach ($contents as $content) {
if ($content != '.' && $content != '..') {
array_push($dircontents, $content);
... | php | static function contents($directory) {
if (!self::exists($directory)) return null;
$dircontents = [];
$contents = scandir($directory);
foreach ($contents as $content) {
if ($content != '.' && $content != '..') {
array_push($dircontents, $content);
... | [
"static",
"function",
"contents",
"(",
"$",
"directory",
")",
"{",
"if",
"(",
"!",
"self",
"::",
"exists",
"(",
"$",
"directory",
")",
")",
"return",
"null",
";",
"$",
"dircontents",
"=",
"[",
"]",
";",
"$",
"contents",
"=",
"scandir",
"(",
"$",
"d... | Returns the contents of directory
@param string $directory Path to directory
@return array | [
"Returns",
"the",
"contents",
"of",
"directory"
] | 004d80b21f7246bb3e08c7b9f74a165b0d3ca0f5 | https://github.com/jabernardo/lollipop-php/blob/004d80b21f7246bb3e08c7b9f74a165b0d3ca0f5/Library/System/Directory.php#L38-L52 |
195,020 | FuzeWorks/Core | src/FuzeWorks/Factory.php | Factory.getInstance | public static function getInstance($cloneInstance = false): Factory
{
if ($cloneInstance === true || self::$cloneInstances === true)
{
return clone self::$sharedFactoryInstance;
}
return self::$sharedFactoryInstance;
} | php | public static function getInstance($cloneInstance = false): Factory
{
if ($cloneInstance === true || self::$cloneInstances === true)
{
return clone self::$sharedFactoryInstance;
}
return self::$sharedFactoryInstance;
} | [
"public",
"static",
"function",
"getInstance",
"(",
"$",
"cloneInstance",
"=",
"false",
")",
":",
"Factory",
"{",
"if",
"(",
"$",
"cloneInstance",
"===",
"true",
"||",
"self",
"::",
"$",
"cloneInstances",
"===",
"true",
")",
"{",
"return",
"clone",
"self",... | Get a new instance of the Factory class.
@param bool $cloneInstance Whether to get a cloned instance (true) or exactly the same instance (false)
@return Factory Instance | [
"Get",
"a",
"new",
"instance",
"of",
"the",
"Factory",
"class",
"."
] | 051c64fdaa3a648174cbd54557d05ad553dd826b | https://github.com/FuzeWorks/Core/blob/051c64fdaa3a648174cbd54557d05ad553dd826b/src/FuzeWorks/Factory.php#L218-L226 |
195,021 | FuzeWorks/Core | src/FuzeWorks/Factory.php | Factory.newInstance | public function newInstance($className, $namespace = 'FuzeWorks\\'): self
{
// Determine the class to load
$instanceName = strtolower($className);
$className = $namespace.ucfirst($className);
if (!isset($this->{$instanceName}))
{
throw new FactoryException("Could not load new instance of '".$instanceName... | php | public function newInstance($className, $namespace = 'FuzeWorks\\'): self
{
// Determine the class to load
$instanceName = strtolower($className);
$className = $namespace.ucfirst($className);
if (!isset($this->{$instanceName}))
{
throw new FactoryException("Could not load new instance of '".$instanceName... | [
"public",
"function",
"newInstance",
"(",
"$",
"className",
",",
"$",
"namespace",
"=",
"'FuzeWorks\\\\'",
")",
":",
"self",
"{",
"// Determine the class to load",
"$",
"instanceName",
"=",
"strtolower",
"(",
"$",
"className",
")",
";",
"$",
"className",
"=",
... | Create a new instance of one of the loaded classes.
It reloads the class. It does NOT clone it.
@param string $className The name of the loaded class, WITHOUT the namespace
@param string $namespace Optional namespace. Defaults to 'FuzeWorks\'
@return Factory Instance | [
"Create",
"a",
"new",
"instance",
"of",
"one",
"of",
"the",
"loaded",
"classes",
".",
"It",
"reloads",
"the",
"class",
".",
"It",
"does",
"NOT",
"clone",
"it",
"."
] | 051c64fdaa3a648174cbd54557d05ad553dd826b | https://github.com/FuzeWorks/Core/blob/051c64fdaa3a648174cbd54557d05ad553dd826b/src/FuzeWorks/Factory.php#L256-L279 |
195,022 | FuzeWorks/Core | src/FuzeWorks/Factory.php | Factory.cloneInstance | public function cloneInstance($className): self
{
// Determine the class to load
$instanceName = strtolower($className);
if (!isset($this->{$instanceName}))
{
throw new FactoryException("Could not clone instance of '".$instanceName."'. Instance was not found.", 1);
}
// Clone the instance
$this->{$i... | php | public function cloneInstance($className): self
{
// Determine the class to load
$instanceName = strtolower($className);
if (!isset($this->{$instanceName}))
{
throw new FactoryException("Could not clone instance of '".$instanceName."'. Instance was not found.", 1);
}
// Clone the instance
$this->{$i... | [
"public",
"function",
"cloneInstance",
"(",
"$",
"className",
")",
":",
"self",
"{",
"// Determine the class to load",
"$",
"instanceName",
"=",
"strtolower",
"(",
"$",
"className",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"{",
"$",
"inst... | Clone an instance of one of the loaded classes.
It clones the class. It does NOT re-create it.
@param string $className The name of the loaded class, WITHOUT the namespace
@return Factory Instance | [
"Clone",
"an",
"instance",
"of",
"one",
"of",
"the",
"loaded",
"classes",
".",
"It",
"clones",
"the",
"class",
".",
"It",
"does",
"NOT",
"re",
"-",
"create",
"it",
"."
] | 051c64fdaa3a648174cbd54557d05ad553dd826b | https://github.com/FuzeWorks/Core/blob/051c64fdaa3a648174cbd54557d05ad553dd826b/src/FuzeWorks/Factory.php#L288-L303 |
195,023 | FuzeWorks/Core | src/FuzeWorks/Factory.php | Factory.removeInstance | public function removeInstance($className): self
{
// Determine the instance name
$instanceName = strtolower($className);
if (!isset($this->{$instanceName}))
{
throw new FactoryException("Could not remove instance of '".$instanceName."'. Instance was not found.", 1);
}
// Unset
unset($this->{$instan... | php | public function removeInstance($className): self
{
// Determine the instance name
$instanceName = strtolower($className);
if (!isset($this->{$instanceName}))
{
throw new FactoryException("Could not remove instance of '".$instanceName."'. Instance was not found.", 1);
}
// Unset
unset($this->{$instan... | [
"public",
"function",
"removeInstance",
"(",
"$",
"className",
")",
":",
"self",
"{",
"// Determine the instance name",
"$",
"instanceName",
"=",
"strtolower",
"(",
"$",
"className",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"{",
"$",
"ins... | Remove an instance of one of the loaded classes.
@param string $className The name of the loaded class, WITHOUT the namespace
@return Factory Factory Instance | [
"Remove",
"an",
"instance",
"of",
"one",
"of",
"the",
"loaded",
"classes",
"."
] | 051c64fdaa3a648174cbd54557d05ad553dd826b | https://github.com/FuzeWorks/Core/blob/051c64fdaa3a648174cbd54557d05ad553dd826b/src/FuzeWorks/Factory.php#L332-L347 |
195,024 | raframework/rapkg | src/Rapkg/Validation/Validator.php | Validator.mergeMessages | protected function mergeMessages(array $customMessages = [], array $attributes = [])
{
$globalMessages = [];
if (self::$globalMessageInstance instanceof MessageInterface) {
$globalMessages = self::$globalMessageInstance->getMessages();
}
// Merge rule messages
$r... | php | protected function mergeMessages(array $customMessages = [], array $attributes = [])
{
$globalMessages = [];
if (self::$globalMessageInstance instanceof MessageInterface) {
$globalMessages = self::$globalMessageInstance->getMessages();
}
// Merge rule messages
$r... | [
"protected",
"function",
"mergeMessages",
"(",
"array",
"$",
"customMessages",
"=",
"[",
"]",
",",
"array",
"$",
"attributes",
"=",
"[",
"]",
")",
"{",
"$",
"globalMessages",
"=",
"[",
"]",
";",
"if",
"(",
"self",
"::",
"$",
"globalMessageInstance",
"ins... | Merge rule messages & custom messages & attributes
@param array $customMessages
@param array $attributes | [
"Merge",
"rule",
"messages",
"&",
"custom",
"messages",
"&",
"attributes"
] | 7c4371911369d7c9d4463127bcd285144d7347ee | https://github.com/raframework/rapkg/blob/7c4371911369d7c9d4463127bcd285144d7347ee/src/Rapkg/Validation/Validator.php#L84-L113 |
195,025 | mtils/cmsable | src/Cmsable/Http/CmsRequestConverter.php | CmsRequestConverter.toCmsRequest | public function toCmsRequest(Request $request)
{
$cmsRequest = (new CmsRequest)->duplicate(
$request->query->all(), $request->request->all(), $request->attributes->all(),
$request->cookies->all(), $request->files->all(), $request->server->all()
);
$cmsRequest->hea... | php | public function toCmsRequest(Request $request)
{
$cmsRequest = (new CmsRequest)->duplicate(
$request->query->all(), $request->request->all(), $request->attributes->all(),
$request->cookies->all(), $request->files->all(), $request->server->all()
);
$cmsRequest->hea... | [
"public",
"function",
"toCmsRequest",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"cmsRequest",
"=",
"(",
"new",
"CmsRequest",
")",
"->",
"duplicate",
"(",
"$",
"request",
"->",
"query",
"->",
"all",
"(",
")",
",",
"$",
"request",
"->",
"request",
"... | Creates a CmsRequest out of an Illuminate Request
@param \Illuminate\Http\Request $request
@return \Cmsable\Http\CmsRequest | [
"Creates",
"a",
"CmsRequest",
"out",
"of",
"an",
"Illuminate",
"Request"
] | 03ae84ee3c7d46146f2a1cf687e5c29d6de4286d | https://github.com/mtils/cmsable/blob/03ae84ee3c7d46146f2a1cf687e5c29d6de4286d/src/Cmsable/Http/CmsRequestConverter.php#L17-L31 |
195,026 | Linkvalue-Interne/MobileNotif | src/Model/ApnsMessage.php | ApnsMessage.addAction | public function addAction(array $action)
{
$actions = $this->getAction();
$actions[] = $action;
return $this->setAction($actions);
} | php | public function addAction(array $action)
{
$actions = $this->getAction();
$actions[] = $action;
return $this->setAction($actions);
} | [
"public",
"function",
"addAction",
"(",
"array",
"$",
"action",
")",
"{",
"$",
"actions",
"=",
"$",
"this",
"->",
"getAction",
"(",
")",
";",
"$",
"actions",
"[",
"]",
"=",
"$",
"action",
";",
"return",
"$",
"this",
"->",
"setAction",
"(",
"$",
"ac... | Set an array in the action array.
@param array $action
@return self | [
"Set",
"an",
"array",
"in",
"the",
"action",
"array",
"."
] | e6e4c4219f3bbb0aee32e90e5fdfc8c6a7ed53f6 | https://github.com/Linkvalue-Interne/MobileNotif/blob/e6e4c4219f3bbb0aee32e90e5fdfc8c6a7ed53f6/src/Model/ApnsMessage.php#L545-L552 |
195,027 | Linkvalue-Interne/MobileNotif | src/Model/ApnsMessage.php | ApnsMessage.getPayloadAlertKeyValue | private function getPayloadAlertKeyValue()
{
// Alert "string" (simple alert)
if ($this->getSimpleAlert()) {
return $this->getSimpleAlert();
}
// Alert "array" (complex alert)
$payloadAlert = array();
if ($this->getAlertTitle()) {
$payloadAle... | php | private function getPayloadAlertKeyValue()
{
// Alert "string" (simple alert)
if ($this->getSimpleAlert()) {
return $this->getSimpleAlert();
}
// Alert "array" (complex alert)
$payloadAlert = array();
if ($this->getAlertTitle()) {
$payloadAle... | [
"private",
"function",
"getPayloadAlertKeyValue",
"(",
")",
"{",
"// Alert \"string\" (simple alert)",
"if",
"(",
"$",
"this",
"->",
"getSimpleAlert",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"getSimpleAlert",
"(",
")",
";",
"}",
"// Alert \"array\" (compl... | Get the value of the payload "alert" key.
@return string|array | [
"Get",
"the",
"value",
"of",
"the",
"payload",
"alert",
"key",
"."
] | e6e4c4219f3bbb0aee32e90e5fdfc8c6a7ed53f6 | https://github.com/Linkvalue-Interne/MobileNotif/blob/e6e4c4219f3bbb0aee32e90e5fdfc8c6a7ed53f6/src/Model/ApnsMessage.php#L559-L598 |
195,028 | libreworks/caridea-validate | src/Rule/Nested.php | Nested.finish | public function finish(\Caridea\Validate\Registry $registry): \Caridea\Validate\Rule
{
if ($this->validator instanceof \Caridea\Validate\Validator) {
return $this;
} else {
$rule = clone $this;
$builder = $registry->builder();
switch ($this->operator) ... | php | public function finish(\Caridea\Validate\Registry $registry): \Caridea\Validate\Rule
{
if ($this->validator instanceof \Caridea\Validate\Validator) {
return $this;
} else {
$rule = clone $this;
$builder = $registry->builder();
switch ($this->operator) ... | [
"public",
"function",
"finish",
"(",
"\\",
"Caridea",
"\\",
"Validate",
"\\",
"Registry",
"$",
"registry",
")",
":",
"\\",
"Caridea",
"\\",
"Validate",
"\\",
"Rule",
"{",
"if",
"(",
"$",
"this",
"->",
"validator",
"instanceof",
"\\",
"Caridea",
"\\",
"Va... | Finishes creating a rule using the parent builder.
@param \Caridea\Validate\Registry $registry
@return \Caridea\Validate\Rule The fully created rule | [
"Finishes",
"creating",
"a",
"rule",
"using",
"the",
"parent",
"builder",
"."
] | 625835694d34591bfb1e3b2ce60c2cc28a28d006 | https://github.com/libreworks/caridea-validate/blob/625835694d34591bfb1e3b2ce60c2cc28a28d006/src/Rule/Nested.php#L64-L89 |
195,029 | PenoaksDev/Milky-Framework | src/Milky/Database/Schema/Grammars/MySqlGrammar.php | MySqlGrammar.compileKey | protected function compileKey( Blueprint $blueprint, Fluent $command, $type )
{
$columns = $this->columnize( $command->columns );
$table = $this->wrapTable( $blueprint );
$index = $this->wrap( $command->index );
return "alter table {$table} add {$type} {$index}($columns)";
} | php | protected function compileKey( Blueprint $blueprint, Fluent $command, $type )
{
$columns = $this->columnize( $command->columns );
$table = $this->wrapTable( $blueprint );
$index = $this->wrap( $command->index );
return "alter table {$table} add {$type} {$index}($columns)";
} | [
"protected",
"function",
"compileKey",
"(",
"Blueprint",
"$",
"blueprint",
",",
"Fluent",
"$",
"command",
",",
"$",
"type",
")",
"{",
"$",
"columns",
"=",
"$",
"this",
"->",
"columnize",
"(",
"$",
"command",
"->",
"columns",
")",
";",
"$",
"table",
"="... | Compile an index creation command.
@param Blueprint $blueprint
@param Fluent $command
@param string $type
@return string | [
"Compile",
"an",
"index",
"creation",
"command",
"."
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Database/Schema/Grammars/MySqlGrammar.php#L181-L190 |
195,030 | shrink0r/monatic | src/Many.php | Many.flatMap | protected function flatMap(array $flattened, MonadInterface $result)
{
$value = $result->get();
if (!is_array($value)) {
$value = [ $value ];
}
return array_merge($flattened, $value);
} | php | protected function flatMap(array $flattened, MonadInterface $result)
{
$value = $result->get();
if (!is_array($value)) {
$value = [ $value ];
}
return array_merge($flattened, $value);
} | [
"protected",
"function",
"flatMap",
"(",
"array",
"$",
"flattened",
",",
"MonadInterface",
"$",
"result",
")",
"{",
"$",
"value",
"=",
"$",
"result",
"->",
"get",
"(",
")",
";",
"if",
"(",
"!",
"is_array",
"(",
"$",
"value",
")",
")",
"{",
"$",
"va... | Internal callback that is used in conjunction with php's array_reduce to flatten recursive chain results.
@param array $flattened The current flat array.
@param MonadInterface $result The result to be reduced into the flat array.
@return array A new flat array created from merging in the flattened result. | [
"Internal",
"callback",
"that",
"is",
"used",
"in",
"conjunction",
"with",
"php",
"s",
"array_reduce",
"to",
"flatten",
"recursive",
"chain",
"results",
"."
] | f39b8b2ef68a397d31d844341487412b335fd107 | https://github.com/shrink0r/monatic/blob/f39b8b2ef68a397d31d844341487412b335fd107/src/Many.php#L141-L150 |
195,031 | kaiohken1982/NeobazaarDocumentModule | src/Document/Paginator/ClassifiedFull.php | ClassifiedFull.build | public function build(array $params = null)
{
if(null !== $params) {
$this->setParams($params);
}
$this->adapter = $this->getDoctrinePaginatorAdapter();
$this->setCurrentPageNumber($this->getParam('page', 1));
$this->setDefaultItemCountPerPage($this->getParam('limit... | php | public function build(array $params = null)
{
if(null !== $params) {
$this->setParams($params);
}
$this->adapter = $this->getDoctrinePaginatorAdapter();
$this->setCurrentPageNumber($this->getParam('page', 1));
$this->setDefaultItemCountPerPage($this->getParam('limit... | [
"public",
"function",
"build",
"(",
"array",
"$",
"params",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"params",
")",
"{",
"$",
"this",
"->",
"setParams",
"(",
"$",
"params",
")",
";",
"}",
"$",
"this",
"->",
"adapter",
"=",
"$",
"this... | Build the instance
@param array $params | [
"Build",
"the",
"instance"
] | edb0223878fe02e791d2a0266c5a7c0f2029e3fe | https://github.com/kaiohken1982/NeobazaarDocumentModule/blob/edb0223878fe02e791d2a0266c5a7c0f2029e3fe/src/Document/Paginator/ClassifiedFull.php#L61-L70 |
195,032 | kaiohken1982/NeobazaarDocumentModule | src/Document/Paginator/ClassifiedFull.php | ClassifiedFull.getParam | public function getParam($param, $default = null)
{
if(array_key_exists($param, $this->params)) {
return $this->params[$param];
}
return $default;
} | php | public function getParam($param, $default = null)
{
if(array_key_exists($param, $this->params)) {
return $this->params[$param];
}
return $default;
} | [
"public",
"function",
"getParam",
"(",
"$",
"param",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"param",
",",
"$",
"this",
"->",
"params",
")",
")",
"{",
"return",
"$",
"this",
"->",
"params",
"[",
"$",
"pa... | Get a specified param
@param string $param
@return mixed | [
"Get",
"a",
"specified",
"param"
] | edb0223878fe02e791d2a0266c5a7c0f2029e3fe | https://github.com/kaiohken1982/NeobazaarDocumentModule/blob/edb0223878fe02e791d2a0266c5a7c0f2029e3fe/src/Document/Paginator/ClassifiedFull.php#L101-L108 |
195,033 | Linkvalue-Interne/MajoraFrameworkExtraBundle | src/Majora/Framework/Loader/Bridge/Doctrine/DoctrineLoaderTrait.php | DoctrineLoaderTrait.toEntityCollection | protected function toEntityCollection($result)
{
switch (true) {
// already a collection ?
case is_object($result) && is_subclass_of($result, $this->collectionClass) :
$collection = $result;
break;
// already a collection ?
ca... | php | protected function toEntityCollection($result)
{
switch (true) {
// already a collection ?
case is_object($result) && is_subclass_of($result, $this->collectionClass) :
$collection = $result;
break;
// already a collection ?
ca... | [
"protected",
"function",
"toEntityCollection",
"(",
"$",
"result",
")",
"{",
"switch",
"(",
"true",
")",
"{",
"// already a collection ?",
"case",
"is_object",
"(",
"$",
"result",
")",
"&&",
"is_subclass_of",
"(",
"$",
"result",
",",
"$",
"this",
"->",
"coll... | Convert given array or Collection result set to managed entity collection class.
@param array|Collection $result
@return EntityCollection | [
"Convert",
"given",
"array",
"or",
"Collection",
"result",
"set",
"to",
"managed",
"entity",
"collection",
"class",
"."
] | 6f368380cfc39d27fafb0844e9a53b4d86d7c034 | https://github.com/Linkvalue-Interne/MajoraFrameworkExtraBundle/blob/6f368380cfc39d27fafb0844e9a53b4d86d7c034/src/Majora/Framework/Loader/Bridge/Doctrine/DoctrineLoaderTrait.php#L59-L102 |
195,034 | Linkvalue-Interne/MajoraFrameworkExtraBundle | src/Majora/Framework/Loader/Bridge/Doctrine/DoctrineLoaderTrait.php | DoctrineLoaderTrait.createFilteredQuery | private function createFilteredQuery(array $filters)
{
$qb = $this->createQuery('entity');
foreach ($filters as $field => $filter) {
$qb->andWhere(is_array($filter)
? sprintf('entity.%s in (:%s)', $field, $field)
: sprintf('entity.%s = :%s', $fiel... | php | private function createFilteredQuery(array $filters)
{
$qb = $this->createQuery('entity');
foreach ($filters as $field => $filter) {
$qb->andWhere(is_array($filter)
? sprintf('entity.%s in (:%s)', $field, $field)
: sprintf('entity.%s = :%s', $fiel... | [
"private",
"function",
"createFilteredQuery",
"(",
"array",
"$",
"filters",
")",
"{",
"$",
"qb",
"=",
"$",
"this",
"->",
"createQuery",
"(",
"'entity'",
")",
";",
"foreach",
"(",
"$",
"filters",
"as",
"$",
"field",
"=>",
"$",
"filter",
")",
"{",
"$",
... | create query an filter it with given data.
@param array $filters
@return Query | [
"create",
"query",
"an",
"filter",
"it",
"with",
"given",
"data",
"."
] | 6f368380cfc39d27fafb0844e9a53b4d86d7c034 | https://github.com/Linkvalue-Interne/MajoraFrameworkExtraBundle/blob/6f368380cfc39d27fafb0844e9a53b4d86d7c034/src/Majora/Framework/Loader/Bridge/Doctrine/DoctrineLoaderTrait.php#L126-L140 |
195,035 | codemojo-dr/startkit-php-sdk | src/CodeMojo/OAuth2/GrantType/Password.php | Password.validateParameters | public function validateParameters(&$parameters)
{
if (!isset($parameters['username']))
{
throw new InvalidArgumentException(
'The \'username\' parameter must be defined for the Password grant type',
InvalidArgumentException::MISSING_PARAMETER
... | php | public function validateParameters(&$parameters)
{
if (!isset($parameters['username']))
{
throw new InvalidArgumentException(
'The \'username\' parameter must be defined for the Password grant type',
InvalidArgumentException::MISSING_PARAMETER
... | [
"public",
"function",
"validateParameters",
"(",
"&",
"$",
"parameters",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"parameters",
"[",
"'username'",
"]",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"'The \\'username\\' parameter must be defin... | Adds a specific Handling of the parameters
@return array of Specific parameters to be sent.
@param mixed $parameters the parameters array (passed by reference) | [
"Adds",
"a",
"specific",
"Handling",
"of",
"the",
"parameters"
] | cd2227e1a221be2cd75dc96d1c9e0acfda936fb3 | https://github.com/codemojo-dr/startkit-php-sdk/blob/cd2227e1a221be2cd75dc96d1c9e0acfda936fb3/src/CodeMojo/OAuth2/GrantType/Password.php#L24-L40 |
195,036 | dmt-software/auth-middleware | src/Authorization/BasicAuthorization.php | BasicAuthorization.handle | public function handle(RequestInterface $request): RequestInterface
{
return
$request->withHeader(
'Authorization',
sprintf('Basic %s', base64_encode(sprintf('%s:%s', $this->user, $this->password)))
);
} | php | public function handle(RequestInterface $request): RequestInterface
{
return
$request->withHeader(
'Authorization',
sprintf('Basic %s', base64_encode(sprintf('%s:%s', $this->user, $this->password)))
);
} | [
"public",
"function",
"handle",
"(",
"RequestInterface",
"$",
"request",
")",
":",
"RequestInterface",
"{",
"return",
"$",
"request",
"->",
"withHeader",
"(",
"'Authorization'",
",",
"sprintf",
"(",
"'Basic %s'",
",",
"base64_encode",
"(",
"sprintf",
"(",
"'%s:%... | Get the http headers associated with the authorization.
@param RequestInterface $request
@return RequestInterface | [
"Get",
"the",
"http",
"headers",
"associated",
"with",
"the",
"authorization",
"."
] | 7a4633224944567c1e2ce63189f40a69acf221a6 | https://github.com/dmt-software/auth-middleware/blob/7a4633224944567c1e2ce63189f40a69acf221a6/src/Authorization/BasicAuthorization.php#L43-L50 |
195,037 | DanweDE/php-bitcoin-address | src/Address.php | Address.equals | function equals( $other ) {
if( ! ( $other instanceof Address ) ) {
return false;
}
return $this === $other
|| $this->asString() === $other->asString();
} | php | function equals( $other ) {
if( ! ( $other instanceof Address ) ) {
return false;
}
return $this === $other
|| $this->asString() === $other->asString();
} | [
"function",
"equals",
"(",
"$",
"other",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"other",
"instanceof",
"Address",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"$",
"this",
"===",
"$",
"other",
"||",
"$",
"this",
"->",
"asString",
"(",
")",
... | Returns whether the address is equal to another given address.
@return bool | [
"Returns",
"whether",
"the",
"address",
"is",
"equal",
"to",
"another",
"given",
"address",
"."
] | 89d717e572086e1cb80e2c4021ef1ec407044a5c | https://github.com/DanweDE/php-bitcoin-address/blob/89d717e572086e1cb80e2c4021ef1ec407044a5c/src/Address.php#L46-L52 |
195,038 | SchulIT/common-bundle | Helper/DateHelper.php | DateHelper.getStartDate | public function getStartDate() {
$now = $this->getNow();
$endOfDay = $this->getToday()->modify('+18 hours');
$currentDay = $this->getToday();
if($now > $endOfDay) {
$currentDay->modify('+1 day');
}
return $currentDay;
} | php | public function getStartDate() {
$now = $this->getNow();
$endOfDay = $this->getToday()->modify('+18 hours');
$currentDay = $this->getToday();
if($now > $endOfDay) {
$currentDay->modify('+1 day');
}
return $currentDay;
} | [
"public",
"function",
"getStartDate",
"(",
")",
"{",
"$",
"now",
"=",
"$",
"this",
"->",
"getNow",
"(",
")",
";",
"$",
"endOfDay",
"=",
"$",
"this",
"->",
"getToday",
"(",
")",
"->",
"modify",
"(",
"'+18 hours'",
")",
";",
"$",
"currentDay",
"=",
"... | Gets the start date for the timeline
@return \DateTime | [
"Gets",
"the",
"start",
"date",
"for",
"the",
"timeline"
] | ebd4007bce43796be4c8566467f41963262eabfe | https://github.com/SchulIT/common-bundle/blob/ebd4007bce43796be4c8566467f41963262eabfe/Helper/DateHelper.php#L55-L66 |
195,039 | SchulIT/common-bundle | Helper/DateHelper.php | DateHelper.isBetween | public function isBetween(\DateTime $dateTime, \DateTime $start, \DateTime $end) {
return $dateTime >= $start && $dateTime <= $end;
} | php | public function isBetween(\DateTime $dateTime, \DateTime $start, \DateTime $end) {
return $dateTime >= $start && $dateTime <= $end;
} | [
"public",
"function",
"isBetween",
"(",
"\\",
"DateTime",
"$",
"dateTime",
",",
"\\",
"DateTime",
"$",
"start",
",",
"\\",
"DateTime",
"$",
"end",
")",
"{",
"return",
"$",
"dateTime",
">=",
"$",
"start",
"&&",
"$",
"dateTime",
"<=",
"$",
"end",
";",
... | Checks if a given date is beween a given start and end date
@param \DateTime $dateTime
@param \DateTime $start
@param \DateTime $end
@return bool | [
"Checks",
"if",
"a",
"given",
"date",
"is",
"beween",
"a",
"given",
"start",
"and",
"end",
"date"
] | ebd4007bce43796be4c8566467f41963262eabfe | https://github.com/SchulIT/common-bundle/blob/ebd4007bce43796be4c8566467f41963262eabfe/Helper/DateHelper.php#L104-L106 |
195,040 | mmethner/engine | src/Base/Controller/Controller.php | Controller.http404Action | public function http404Action(): void
{
$header = Http::status(404);
$this->view->header($header);
$this->view->snippet('Base::error/http-404.phtml');
$this->view->assign('message', $header);
} | php | public function http404Action(): void
{
$header = Http::status(404);
$this->view->header($header);
$this->view->snippet('Base::error/http-404.phtml');
$this->view->assign('message', $header);
} | [
"public",
"function",
"http404Action",
"(",
")",
":",
"void",
"{",
"$",
"header",
"=",
"Http",
"::",
"status",
"(",
"404",
")",
";",
"$",
"this",
"->",
"view",
"->",
"header",
"(",
"$",
"header",
")",
";",
"$",
"this",
"->",
"view",
"->",
"snippet"... | default action for unknown pages
@return void | [
"default",
"action",
"for",
"unknown",
"pages"
] | 89e1bcc644cf8cc3712a67ef1697da2ca4008f74 | https://github.com/mmethner/engine/blob/89e1bcc644cf8cc3712a67ef1697da2ca4008f74/src/Base/Controller/Controller.php#L37-L43 |
195,041 | rawphp/RawDateTime | src/RawPHP/RawDateTime/DateTime.php | DateTime.getUtcDateTime | public static function getUtcDateTime( BaseDateTime $date )
{
$newDate = new BaseDateTime( );
$newDate->setTimestamp( $date->getTimestamp() );
$newDate->setTimezone( new DateTimeZone( 'UTC' ) );
return $newDate;
} | php | public static function getUtcDateTime( BaseDateTime $date )
{
$newDate = new BaseDateTime( );
$newDate->setTimestamp( $date->getTimestamp() );
$newDate->setTimezone( new DateTimeZone( 'UTC' ) );
return $newDate;
} | [
"public",
"static",
"function",
"getUtcDateTime",
"(",
"BaseDateTime",
"$",
"date",
")",
"{",
"$",
"newDate",
"=",
"new",
"BaseDateTime",
"(",
")",
";",
"$",
"newDate",
"->",
"setTimestamp",
"(",
"$",
"date",
"->",
"getTimestamp",
"(",
")",
")",
";",
"$"... | Converts the current date time object to UTC time.
@param BaseDateTime $date the date time object to convert
@return BaseDateTime the UTC date time object | [
"Converts",
"the",
"current",
"date",
"time",
"object",
"to",
"UTC",
"time",
"."
] | 0ea19738c859a211369a663bb7bd3daab7af4a48 | https://github.com/rawphp/RawDateTime/blob/0ea19738c859a211369a663bb7bd3daab7af4a48/src/RawPHP/RawDateTime/DateTime.php#L61-L68 |
195,042 | rawphp/RawDateTime | src/RawPHP/RawDateTime/DateTime.php | DateTime.getUserDateTime | public static function getUserDateTime( BaseDateTime $date, $timezone = '' )
{
$newDate = new BaseDateTime( );
$newDate->setTimestamp( $date->getTimestamp() );
if ( is_string( $timezone ) && !empty( $timezone ) )
{
$timezone = new DateTimeZone( $timezone );
... | php | public static function getUserDateTime( BaseDateTime $date, $timezone = '' )
{
$newDate = new BaseDateTime( );
$newDate->setTimestamp( $date->getTimestamp() );
if ( is_string( $timezone ) && !empty( $timezone ) )
{
$timezone = new DateTimeZone( $timezone );
... | [
"public",
"static",
"function",
"getUserDateTime",
"(",
"BaseDateTime",
"$",
"date",
",",
"$",
"timezone",
"=",
"''",
")",
"{",
"$",
"newDate",
"=",
"new",
"BaseDateTime",
"(",
")",
";",
"$",
"newDate",
"->",
"setTimestamp",
"(",
"$",
"date",
"->",
"getT... | Converts the UTC date time object to user time.
@param BaseDateTime $date the date time to convert
@param string $timezone the time zone
@return BaseDateTime the user timezone date time object | [
"Converts",
"the",
"UTC",
"date",
"time",
"object",
"to",
"user",
"time",
"."
] | 0ea19738c859a211369a663bb7bd3daab7af4a48 | https://github.com/rawphp/RawDateTime/blob/0ea19738c859a211369a663bb7bd3daab7af4a48/src/RawPHP/RawDateTime/DateTime.php#L78-L95 |
195,043 | rawphp/RawDateTime | src/RawPHP/RawDateTime/DateTime.php | DateTime.getSpan | public static function getSpan( BaseDateTime $date1, BaseDateTime $date2,
$type = self::SPAN_HOURS, $absolute = TRUE
)
{
$diff = $date1->diff( $date2, $absolute );
$span = 0;
switch( $type )
{
case self::SPAN_YEARS:
$span = ( int )$di... | php | public static function getSpan( BaseDateTime $date1, BaseDateTime $date2,
$type = self::SPAN_HOURS, $absolute = TRUE
)
{
$diff = $date1->diff( $date2, $absolute );
$span = 0;
switch( $type )
{
case self::SPAN_YEARS:
$span = ( int )$di... | [
"public",
"static",
"function",
"getSpan",
"(",
"BaseDateTime",
"$",
"date1",
",",
"BaseDateTime",
"$",
"date2",
",",
"$",
"type",
"=",
"self",
"::",
"SPAN_HOURS",
",",
"$",
"absolute",
"=",
"TRUE",
")",
"{",
"$",
"diff",
"=",
"$",
"date1",
"->",
"diff... | Returns the span between the two dates.
@param BaseDateTime $date1 first date
@param BaseDateTime $date2 second date
@param string $type the scale of span output
[ years, months, days, hours, minutes, seconds ]
@param bool $absolute should the output be forced to be positive
@return mixed the span b... | [
"Returns",
"the",
"span",
"between",
"the",
"two",
"dates",
"."
] | 0ea19738c859a211369a663bb7bd3daab7af4a48 | https://github.com/rawphp/RawDateTime/blob/0ea19738c859a211369a663bb7bd3daab7af4a48/src/RawPHP/RawDateTime/DateTime.php#L108-L176 |
195,044 | Kris-Kuiper/sFire-Framework | src/Permissions/Resources.php | Resources.setResources | public function setResources($resources) {
if(false === is_array($resources)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type array, "%s" given', __METHOD__, gettype($resources)), E_USER_ERROR);
}
$this -> resources = $resources;
} | php | public function setResources($resources) {
if(false === is_array($resources)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type array, "%s" given', __METHOD__, gettype($resources)), E_USER_ERROR);
}
$this -> resources = $resources;
} | [
"public",
"function",
"setResources",
"(",
"$",
"resources",
")",
"{",
"if",
"(",
"false",
"===",
"is_array",
"(",
"$",
"resources",
")",
")",
"{",
"return",
"trigger_error",
"(",
"sprintf",
"(",
"'Argument 1 passed to %s() must be of the type array, \"%s\" given'",
... | Sets the resources
@param array $resources | [
"Sets",
"the",
"resources"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Permissions/Resources.php#L25-L32 |
195,045 | Kris-Kuiper/sFire-Framework | src/Permissions/Resources.php | Resources.hasResource | public function hasResource($resource) {
if(null !== $resource && false === is_string($resource)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($resource)), E_USER_ERROR);
}
return true === array_key_exists($resource, $this -> res... | php | public function hasResource($resource) {
if(null !== $resource && false === is_string($resource)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($resource)), E_USER_ERROR);
}
return true === array_key_exists($resource, $this -> res... | [
"public",
"function",
"hasResource",
"(",
"$",
"resource",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"resource",
"&&",
"false",
"===",
"is_string",
"(",
"$",
"resource",
")",
")",
"{",
"return",
"trigger_error",
"(",
"sprintf",
"(",
"'Argument 1 passed to %s(... | Check if a resource exists
@param string $resource
@return boolean | [
"Check",
"if",
"a",
"resource",
"exists"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Permissions/Resources.php#L65-L72 |
195,046 | native5/native5-sdk-client-php | src/Native5/Route/RoutingEngine.php | RoutingEngine.route | public function route()
{
global $logger;
try {
// TODO : Refactor Code :
// $url = URLParser::parse();
// $route = RouteMapper::getRoute($url['route']);
// $router = new Router();
// $router->route($route);
$urlInterpreter ... | php | public function route()
{
global $logger;
try {
// TODO : Refactor Code :
// $url = URLParser::parse();
// $route = RouteMapper::getRoute($url['route']);
// $router = new Router();
// $router->route($route);
$urlInterpreter ... | [
"public",
"function",
"route",
"(",
")",
"{",
"global",
"$",
"logger",
";",
"try",
"{",
"// TODO : Refactor Code :",
"// $url = URLParser::parse();",
"// $route = RouteMapper::getRoute($url['route']);",
"// $router = new Router();",
"// $router->route($route);",
"$",
"urlInte... | route Handles incoming requests.
@access public
@return void | [
"route",
"Handles",
"incoming",
"requests",
"."
] | e1f598cf27654d81bb5facace1990b737242a2f9 | https://github.com/native5/native5-sdk-client-php/blob/e1f598cf27654d81bb5facace1990b737242a2f9/src/Native5/Route/RoutingEngine.php#L49-L66 |
195,047 | codeinchq/media-types | src/MediaTypes.php | MediaTypes.getExtensionMediaType | public static function getExtensionMediaType(string $extension, ?string $defaultMediaType = null):?string
{
return self::getMediaTypes()[strtolower($extension)] ?? $defaultMediaType;
} | php | public static function getExtensionMediaType(string $extension, ?string $defaultMediaType = null):?string
{
return self::getMediaTypes()[strtolower($extension)] ?? $defaultMediaType;
} | [
"public",
"static",
"function",
"getExtensionMediaType",
"(",
"string",
"$",
"extension",
",",
"?",
"string",
"$",
"defaultMediaType",
"=",
"null",
")",
":",
"?",
"string",
"{",
"return",
"self",
"::",
"getMediaTypes",
"(",
")",
"[",
"strtolower",
"(",
"$",
... | Returns the media type for a given extension.
@param string $extension File type
@param null|string $defaultMediaType Media type returned if the file's media type can not determined
@return null|string
@throws MediaTypesException | [
"Returns",
"the",
"media",
"type",
"for",
"a",
"given",
"extension",
"."
] | 923b4491f3a626ebb01217fae3b0e8bf77ce4b3f | https://github.com/codeinchq/media-types/blob/923b4491f3a626ebb01217fae3b0e8bf77ce4b3f/src/MediaTypes.php#L74-L77 |
195,048 | codeinchq/media-types | src/MediaTypes.php | MediaTypes.getFilenameMediaType | public static function getFilenameMediaType(string $filename, ?string $defaultMediaType = null):?string
{
if (preg_match('|\\.([^.]+)$|u', $filename, $matches)) {
return self::getExtensionMediaType($matches[1]);
}
return $defaultMediaType;
} | php | public static function getFilenameMediaType(string $filename, ?string $defaultMediaType = null):?string
{
if (preg_match('|\\.([^.]+)$|u', $filename, $matches)) {
return self::getExtensionMediaType($matches[1]);
}
return $defaultMediaType;
} | [
"public",
"static",
"function",
"getFilenameMediaType",
"(",
"string",
"$",
"filename",
",",
"?",
"string",
"$",
"defaultMediaType",
"=",
"null",
")",
":",
"?",
"string",
"{",
"if",
"(",
"preg_match",
"(",
"'|\\\\.([^.]+)$|u'",
",",
"$",
"filename",
",",
"$"... | Returns the media type for a given file name.
@param string $filename File name or path (must include an extension)
@param null|string $defaultMediaType Media type returned if the file's media type can not determined
@return null|string
@throws MediaTypesException | [
"Returns",
"the",
"media",
"type",
"for",
"a",
"given",
"file",
"name",
"."
] | 923b4491f3a626ebb01217fae3b0e8bf77ce4b3f | https://github.com/codeinchq/media-types/blob/923b4491f3a626ebb01217fae3b0e8bf77ce4b3f/src/MediaTypes.php#L87-L93 |
195,049 | codeinchq/media-types | src/MediaTypes.php | MediaTypes.getMediaTypeExtensions | public static function getMediaTypeExtensions(string $mediaType):array
{
$mediaType = strtolower($mediaType);
$extensions = [];
foreach (self::getMediaTypes() as $extension => $listMediaType) {
if ($listMediaType == $mediaType) {
$extensions[] = $extension;
... | php | public static function getMediaTypeExtensions(string $mediaType):array
{
$mediaType = strtolower($mediaType);
$extensions = [];
foreach (self::getMediaTypes() as $extension => $listMediaType) {
if ($listMediaType == $mediaType) {
$extensions[] = $extension;
... | [
"public",
"static",
"function",
"getMediaTypeExtensions",
"(",
"string",
"$",
"mediaType",
")",
":",
"array",
"{",
"$",
"mediaType",
"=",
"strtolower",
"(",
"$",
"mediaType",
")",
";",
"$",
"extensions",
"=",
"[",
"]",
";",
"foreach",
"(",
"self",
"::",
... | Returnes all the known extensions for a given media type.
@param string $mediaType
@return array
@throws MediaTypesException | [
"Returnes",
"all",
"the",
"known",
"extensions",
"for",
"a",
"given",
"media",
"type",
"."
] | 923b4491f3a626ebb01217fae3b0e8bf77ce4b3f | https://github.com/codeinchq/media-types/blob/923b4491f3a626ebb01217fae3b0e8bf77ce4b3f/src/MediaTypes.php#L102-L112 |
195,050 | squareproton/Bond | src/Bond/Entity/Uid.php | Uid.count | public function count()
{
return ( self::$assigned[$this->type] - self::START_AT + self::INCREMENT ) / self::INCREMENT;
} | php | public function count()
{
return ( self::$assigned[$this->type] - self::START_AT + self::INCREMENT ) / self::INCREMENT;
} | [
"public",
"function",
"count",
"(",
")",
"{",
"return",
"(",
"self",
"::",
"$",
"assigned",
"[",
"$",
"this",
"->",
"type",
"]",
"-",
"self",
"::",
"START_AT",
"+",
"self",
"::",
"INCREMENT",
")",
"/",
"self",
"::",
"INCREMENT",
";",
"}"
] | How many keys have been instantiated so far
@return int | [
"How",
"many",
"keys",
"have",
"been",
"instantiated",
"so",
"far"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Entity/Uid.php#L95-L98 |
195,051 | koolkode/meta | src/Source/SourceStream.php | SourceStream.next | public function next(SourceBuffer $generator)
{
while(isset($this->tokens[$this->index]))
{
$tok = $this->tokens[$this->index++];
if(is_array($tok))
{
switch($tok[0])
{
case T_COMMENT:
$generator->append($tok);
$this->comment = '';
continue 2;
case T_WHI... | php | public function next(SourceBuffer $generator)
{
while(isset($this->tokens[$this->index]))
{
$tok = $this->tokens[$this->index++];
if(is_array($tok))
{
switch($tok[0])
{
case T_COMMENT:
$generator->append($tok);
$this->comment = '';
continue 2;
case T_WHI... | [
"public",
"function",
"next",
"(",
"SourceBuffer",
"$",
"generator",
")",
"{",
"while",
"(",
"isset",
"(",
"$",
"this",
"->",
"tokens",
"[",
"$",
"this",
"->",
"index",
"]",
")",
")",
"{",
"$",
"tok",
"=",
"$",
"this",
"->",
"tokens",
"[",
"$",
"... | Read the next token from the stream, comments and whitespace will be ignored.
@param SourceBuffer $generator
@return mixed A token as array or string or false on EOF. | [
"Read",
"the",
"next",
"token",
"from",
"the",
"stream",
"comments",
"and",
"whitespace",
"will",
"be",
"ignored",
"."
] | 339db24d3ce461190f552c96e243bca21010f360 | https://github.com/koolkode/meta/blob/339db24d3ce461190f552c96e243bca21010f360/src/Source/SourceStream.php#L154-L209 |
195,052 | koolkode/meta | src/Source/SourceStream.php | SourceStream.peek | public function peek($distance = 1)
{
if($distance < 0)
{
throw new \InvalidArgumentException('Peek must be a lookahead => distance must be greater than or equal to 0');
}
$idx = $this->index + $distance - 1;
while(isset($this->tokens[$idx]))
{
$tok = $this->tokens[$idx++];
if(is_arr... | php | public function peek($distance = 1)
{
if($distance < 0)
{
throw new \InvalidArgumentException('Peek must be a lookahead => distance must be greater than or equal to 0');
}
$idx = $this->index + $distance - 1;
while(isset($this->tokens[$idx]))
{
$tok = $this->tokens[$idx++];
if(is_arr... | [
"public",
"function",
"peek",
"(",
"$",
"distance",
"=",
"1",
")",
"{",
"if",
"(",
"$",
"distance",
"<",
"0",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'Peek must be a lookahead => distance must be greater than or equal to 0'",
")",
";",
"}... | Lookahead at a token relative to the current position.
@param integer $distance
@return mixed Token as array / string or false on EOF.
@throws \InvalidArgumentException When the given distance is less than 0. | [
"Lookahead",
"at",
"a",
"token",
"relative",
"to",
"the",
"current",
"position",
"."
] | 339db24d3ce461190f552c96e243bca21010f360 | https://github.com/koolkode/meta/blob/339db24d3ce461190f552c96e243bca21010f360/src/Source/SourceStream.php#L219-L247 |
195,053 | koolkode/meta | src/Source/SourceStream.php | SourceStream.preceededBy | public function preceededBy($token)
{
if(is_integer($token))
{
$tok = $this->tokens[$this->index - 1];
if(is_array($tok) && $tok[0] == $token)
{
return true;
}
}
else
{
return $token == $this->tokens[$this->index - 1];
}
} | php | public function preceededBy($token)
{
if(is_integer($token))
{
$tok = $this->tokens[$this->index - 1];
if(is_array($tok) && $tok[0] == $token)
{
return true;
}
}
else
{
return $token == $this->tokens[$this->index - 1];
}
} | [
"public",
"function",
"preceededBy",
"(",
"$",
"token",
")",
"{",
"if",
"(",
"is_integer",
"(",
"$",
"token",
")",
")",
"{",
"$",
"tok",
"=",
"$",
"this",
"->",
"tokens",
"[",
"$",
"this",
"->",
"index",
"-",
"1",
"]",
";",
"if",
"(",
"is_array",... | Check if the token at the current position is preceeded by the given token.
@param mixed $token
@return boolean | [
"Check",
"if",
"the",
"token",
"at",
"the",
"current",
"position",
"is",
"preceeded",
"by",
"the",
"given",
"token",
"."
] | 339db24d3ce461190f552c96e243bca21010f360 | https://github.com/koolkode/meta/blob/339db24d3ce461190f552c96e243bca21010f360/src/Source/SourceStream.php#L255-L270 |
195,054 | koolkode/meta | src/Source/SourceStream.php | SourceStream.previous | public function previous()
{
if(isset($this->tokens[$this->index - 2]))
{
return $this->tokens[$this->index - 2];
}
return false;
} | php | public function previous()
{
if(isset($this->tokens[$this->index - 2]))
{
return $this->tokens[$this->index - 2];
}
return false;
} | [
"public",
"function",
"previous",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"tokens",
"[",
"$",
"this",
"->",
"index",
"-",
"2",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"tokens",
"[",
"$",
"this",
"->",
"index",
"-",
"... | Get the previous token, returns false when there is no such token.
@return mixed | [
"Get",
"the",
"previous",
"token",
"returns",
"false",
"when",
"there",
"is",
"no",
"such",
"token",
"."
] | 339db24d3ce461190f552c96e243bca21010f360 | https://github.com/koolkode/meta/blob/339db24d3ce461190f552c96e243bca21010f360/src/Source/SourceStream.php#L277-L285 |
195,055 | koolkode/meta | src/Source/SourceStream.php | SourceStream.preceedingTokens | public function preceedingTokens(array $types)
{
$result = [];
for($x = $this->index - 2; $x >= 0; $x--)
{
$tok = $this->tokens[$x];
if(is_array($tok))
{
switch($tok[0])
{
case T_COMMENT:
case T_WHITESPACE:
continue 2;
}
if(!in_array($tok[0], $types, true))
... | php | public function preceedingTokens(array $types)
{
$result = [];
for($x = $this->index - 2; $x >= 0; $x--)
{
$tok = $this->tokens[$x];
if(is_array($tok))
{
switch($tok[0])
{
case T_COMMENT:
case T_WHITESPACE:
continue 2;
}
if(!in_array($tok[0], $types, true))
... | [
"public",
"function",
"preceedingTokens",
"(",
"array",
"$",
"types",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"for",
"(",
"$",
"x",
"=",
"$",
"this",
"->",
"index",
"-",
"2",
";",
"$",
"x",
">=",
"0",
";",
"$",
"x",
"--",
")",
"{",
"$",
... | Get all preceeding tokens matching the given token types, will stop when a token is encountered
that does not match the given filter.
@param array $types Valid token types (all other tokens cause halt).
@return array All the tokens that matched the filter. | [
"Get",
"all",
"preceeding",
"tokens",
"matching",
"the",
"given",
"token",
"types",
"will",
"stop",
"when",
"a",
"token",
"is",
"encountered",
"that",
"does",
"not",
"match",
"the",
"given",
"filter",
"."
] | 339db24d3ce461190f552c96e243bca21010f360 | https://github.com/koolkode/meta/blob/339db24d3ce461190f552c96e243bca21010f360/src/Source/SourceStream.php#L294-L328 |
195,056 | jenskooij/cloudcontrol | src/components/CachableBaseComponent.php | CachableBaseComponent.createCache | private function createCache($renderedContent)
{
if (!CmsComponent::isCmsLoggedIn()) {
Cache::getInstance()->setCacheForPath(Request::$requestUri, $renderedContent, json_encode(ResponseHeaders::getHeaders()));
}
} | php | private function createCache($renderedContent)
{
if (!CmsComponent::isCmsLoggedIn()) {
Cache::getInstance()->setCacheForPath(Request::$requestUri, $renderedContent, json_encode(ResponseHeaders::getHeaders()));
}
} | [
"private",
"function",
"createCache",
"(",
"$",
"renderedContent",
")",
"{",
"if",
"(",
"!",
"CmsComponent",
"::",
"isCmsLoggedIn",
"(",
")",
")",
"{",
"Cache",
"::",
"getInstance",
"(",
")",
"->",
"setCacheForPath",
"(",
"Request",
"::",
"$",
"requestUri",
... | Sets the new cache, unless a cms user is logged in
@param $renderedContent
@throws \RuntimeException | [
"Sets",
"the",
"new",
"cache",
"unless",
"a",
"cms",
"user",
"is",
"logged",
"in"
] | 76e5d9ac8f9c50d06d39a995d13cc03742536548 | https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/components/CachableBaseComponent.php#L121-L126 |
195,057 | WellCommerce/DistributionBundle | Locator/BundleLocator.php | BundleLocator.getBundleClass | private function getBundleClass(SplFileInfo $fileInfo)
{
$reflection = new ReflectionFile($fileInfo->getRealPath());
$baseName = $fileInfo->getBasename('.php');
foreach ($reflection->getNamespaces() as $namespace) {
return $namespace . '\\' . $baseName;
}
... | php | private function getBundleClass(SplFileInfo $fileInfo)
{
$reflection = new ReflectionFile($fileInfo->getRealPath());
$baseName = $fileInfo->getBasename('.php');
foreach ($reflection->getNamespaces() as $namespace) {
return $namespace . '\\' . $baseName;
}
... | [
"private",
"function",
"getBundleClass",
"(",
"SplFileInfo",
"$",
"fileInfo",
")",
"{",
"$",
"reflection",
"=",
"new",
"ReflectionFile",
"(",
"$",
"fileInfo",
"->",
"getRealPath",
"(",
")",
")",
";",
"$",
"baseName",
"=",
"$",
"fileInfo",
"->",
"getBasename"... | Returns FQCN for file
@param SplFileInfo $fileInfo
@return string|null | [
"Returns",
"FQCN",
"for",
"file"
] | 82b1b4c2c5a59536aaae22506b23ccd5d141cbb0 | https://github.com/WellCommerce/DistributionBundle/blob/82b1b4c2c5a59536aaae22506b23ccd5d141cbb0/Locator/BundleLocator.php#L82-L92 |
195,058 | vpg/titon.utility | src/Titon/Utility/Path.php | Path.alias | public static function alias($file, array $paths = array()) {
if (empty($file)) {
return '[internal]';
}
$file = static::ds($file);
// Inherit titon constants
foreach (array('vendor', 'app', 'modules', 'resources', 'temp', 'views', 'web') as $type) {
$co... | php | public static function alias($file, array $paths = array()) {
if (empty($file)) {
return '[internal]';
}
$file = static::ds($file);
// Inherit titon constants
foreach (array('vendor', 'app', 'modules', 'resources', 'temp', 'views', 'web') as $type) {
$co... | [
"public",
"static",
"function",
"alias",
"(",
"$",
"file",
",",
"array",
"$",
"paths",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"file",
")",
")",
"{",
"return",
"'[internal]'",
";",
"}",
"$",
"file",
"=",
"static",
"::",
"d... | Parse the file path to remove absolute paths and replace with a constant name.
@param string $file
@param array $paths
@return string | [
"Parse",
"the",
"file",
"path",
"to",
"remove",
"absolute",
"paths",
"and",
"replace",
"with",
"a",
"constant",
"name",
"."
] | 8a77eb9e7b8baacf41cc25487289779d8319cd3a | https://github.com/vpg/titon.utility/blob/8a77eb9e7b8baacf41cc25487289779d8319cd3a/src/Titon/Utility/Path.php#L42-L76 |
195,059 | vpg/titon.utility | src/Titon/Utility/Path.php | Path.ds | public static function ds($path, $endSlash = false) {
$path = str_replace(array('\\', '/'), static::SEPARATOR, $path);
if ($endSlash && substr($path, -1) !== static::SEPARATOR) {
$path .= static::SEPARATOR;
}
return $path;
} | php | public static function ds($path, $endSlash = false) {
$path = str_replace(array('\\', '/'), static::SEPARATOR, $path);
if ($endSlash && substr($path, -1) !== static::SEPARATOR) {
$path .= static::SEPARATOR;
}
return $path;
} | [
"public",
"static",
"function",
"ds",
"(",
"$",
"path",
",",
"$",
"endSlash",
"=",
"false",
")",
"{",
"$",
"path",
"=",
"str_replace",
"(",
"array",
"(",
"'\\\\'",
",",
"'/'",
")",
",",
"static",
"::",
"SEPARATOR",
",",
"$",
"path",
")",
";",
"if",... | Converts OS directory separators to the standard forward slash.
@param string $path
@param bool $endSlash
@return string | [
"Converts",
"OS",
"directory",
"separators",
"to",
"the",
"standard",
"forward",
"slash",
"."
] | 8a77eb9e7b8baacf41cc25487289779d8319cd3a | https://github.com/vpg/titon.utility/blob/8a77eb9e7b8baacf41cc25487289779d8319cd3a/src/Titon/Utility/Path.php#L96-L104 |
195,060 | vpg/titon.utility | src/Titon/Utility/Path.php | Path.includePath | public static function includePath($paths) {
$current = array(get_include_path());
if (is_array($paths)) {
$current = array_merge($current, $paths);
} else {
$current[] = $paths;
}
$path = implode(static::DELIMITER, $current);
set_include_path($... | php | public static function includePath($paths) {
$current = array(get_include_path());
if (is_array($paths)) {
$current = array_merge($current, $paths);
} else {
$current[] = $paths;
}
$path = implode(static::DELIMITER, $current);
set_include_path($... | [
"public",
"static",
"function",
"includePath",
"(",
"$",
"paths",
")",
"{",
"$",
"current",
"=",
"array",
"(",
"get_include_path",
"(",
")",
")",
";",
"if",
"(",
"is_array",
"(",
"$",
"paths",
")",
")",
"{",
"$",
"current",
"=",
"array_merge",
"(",
"... | Define additional include paths for PHP to detect within.
@param string|array $paths
@return array | [
"Define",
"additional",
"include",
"paths",
"for",
"PHP",
"to",
"detect",
"within",
"."
] | 8a77eb9e7b8baacf41cc25487289779d8319cd3a | https://github.com/vpg/titon.utility/blob/8a77eb9e7b8baacf41cc25487289779d8319cd3a/src/Titon/Utility/Path.php#L122-L136 |
195,061 | vpg/titon.utility | src/Titon/Utility/Path.php | Path.join | public static function join(array $paths, $above = true, $join = true) {
$clean = array();
$parts = array();
$ds = static::SEPARATOR;
$up = 0;
// First pass expands sub-paths
foreach ($paths as $path) {
if (!is_string($path)) {
throw new Inval... | php | public static function join(array $paths, $above = true, $join = true) {
$clean = array();
$parts = array();
$ds = static::SEPARATOR;
$up = 0;
// First pass expands sub-paths
foreach ($paths as $path) {
if (!is_string($path)) {
throw new Inval... | [
"public",
"static",
"function",
"join",
"(",
"array",
"$",
"paths",
",",
"$",
"above",
"=",
"true",
",",
"$",
"join",
"=",
"true",
")",
"{",
"$",
"clean",
"=",
"array",
"(",
")",
";",
"$",
"parts",
"=",
"array",
"(",
")",
";",
"$",
"ds",
"=",
... | Join all path parts and return a normalized path.
@param array $paths
@param bool $above - Go above the root path if .. is used
@param bool $join - Join all the path parts into a string
@return string
@throws \Titon\Utility\Exception\InvalidTypeException | [
"Join",
"all",
"path",
"parts",
"and",
"return",
"a",
"normalized",
"path",
"."
] | 8a77eb9e7b8baacf41cc25487289779d8319cd3a | https://github.com/vpg/titon.utility/blob/8a77eb9e7b8baacf41cc25487289779d8319cd3a/src/Titon/Utility/Path.php#L167-L219 |
195,062 | vpg/titon.utility | src/Titon/Utility/Path.php | Path.relativeTo | public static function relativeTo($from, $to) {
if (static::isRelative($from) || static::isRelative($to)) {
throw new InvalidArgumentException('Cannot determine relative path without two absolute paths');
}
$ds = static::SEPARATOR;
$from = explode($ds, static::ds($from, true... | php | public static function relativeTo($from, $to) {
if (static::isRelative($from) || static::isRelative($to)) {
throw new InvalidArgumentException('Cannot determine relative path without two absolute paths');
}
$ds = static::SEPARATOR;
$from = explode($ds, static::ds($from, true... | [
"public",
"static",
"function",
"relativeTo",
"(",
"$",
"from",
",",
"$",
"to",
")",
"{",
"if",
"(",
"static",
"::",
"isRelative",
"(",
"$",
"from",
")",
"||",
"static",
"::",
"isRelative",
"(",
"$",
"to",
")",
")",
"{",
"throw",
"new",
"InvalidArgum... | Determine the relative path between two absolute paths.
@param string $from
@param string $to
@return string
@throws \Titon\Utility\Exception\InvalidArgumentException | [
"Determine",
"the",
"relative",
"path",
"between",
"two",
"absolute",
"paths",
"."
] | 8a77eb9e7b8baacf41cc25487289779d8319cd3a | https://github.com/vpg/titon.utility/blob/8a77eb9e7b8baacf41cc25487289779d8319cd3a/src/Titon/Utility/Path.php#L251-L286 |
195,063 | vpg/titon.utility | src/Titon/Utility/Path.php | Path.toNamespace | public static function toNamespace($path) {
$path = static::ds(static::stripExt($path));
// Attempt to split path at source folder
foreach (array('lib', 'src') as $folder) {
if (mb_strpos($path, $folder . static::SEPARATOR) !== false) {
$paths = explode($folder . sta... | php | public static function toNamespace($path) {
$path = static::ds(static::stripExt($path));
// Attempt to split path at source folder
foreach (array('lib', 'src') as $folder) {
if (mb_strpos($path, $folder . static::SEPARATOR) !== false) {
$paths = explode($folder . sta... | [
"public",
"static",
"function",
"toNamespace",
"(",
"$",
"path",
")",
"{",
"$",
"path",
"=",
"static",
"::",
"ds",
"(",
"static",
"::",
"stripExt",
"(",
"$",
"path",
")",
")",
";",
"// Attempt to split path at source folder",
"foreach",
"(",
"array",
"(",
... | Converts a path to a namespace package.
@param string $path
@return string | [
"Converts",
"a",
"path",
"to",
"a",
"namespace",
"package",
"."
] | 8a77eb9e7b8baacf41cc25487289779d8319cd3a | https://github.com/vpg/titon.utility/blob/8a77eb9e7b8baacf41cc25487289779d8319cd3a/src/Titon/Utility/Path.php#L308-L320 |
195,064 | vpg/titon.utility | src/Titon/Utility/Path.php | Path.toPath | public static function toPath($path, $ext = 'php', $root = '') {
$ds = static::SEPARATOR;
$path = static::ds($path);
$dirs = explode($ds, $path);
$file = array_pop($dirs);
$path = implode($ds, $dirs) . $ds . str_replace('_', $ds, $file);
if ($ext && mb_substr($path, -mb_... | php | public static function toPath($path, $ext = 'php', $root = '') {
$ds = static::SEPARATOR;
$path = static::ds($path);
$dirs = explode($ds, $path);
$file = array_pop($dirs);
$path = implode($ds, $dirs) . $ds . str_replace('_', $ds, $file);
if ($ext && mb_substr($path, -mb_... | [
"public",
"static",
"function",
"toPath",
"(",
"$",
"path",
",",
"$",
"ext",
"=",
"'php'",
",",
"$",
"root",
"=",
"''",
")",
"{",
"$",
"ds",
"=",
"static",
"::",
"SEPARATOR",
";",
"$",
"path",
"=",
"static",
"::",
"ds",
"(",
"$",
"path",
")",
"... | Converts a namespace to a relative or absolute file system path.
@param string $path
@param string $ext
@param string $root
@return string | [
"Converts",
"a",
"namespace",
"to",
"a",
"relative",
"or",
"absolute",
"file",
"system",
"path",
"."
] | 8a77eb9e7b8baacf41cc25487289779d8319cd3a | https://github.com/vpg/titon.utility/blob/8a77eb9e7b8baacf41cc25487289779d8319cd3a/src/Titon/Utility/Path.php#L330-L346 |
195,065 | linguisticteam/xml-sitemap | src/sitemap_iterator.php | SiteMapUrlSet.addImage | public function addImage( $key, $location, $caption = '', $geolocation = '', $title = '', $license = '' )
{
/**
* @var \Lti\Sitemap\SitemapUrl $node
*/
$node = $this->get( $key );
if ( ! is_null( $node )) {
$node->addImage( new SitemapImage( $location, $caption,... | php | public function addImage( $key, $location, $caption = '', $geolocation = '', $title = '', $license = '' )
{
/**
* @var \Lti\Sitemap\SitemapUrl $node
*/
$node = $this->get( $key );
if ( ! is_null( $node )) {
$node->addImage( new SitemapImage( $location, $caption,... | [
"public",
"function",
"addImage",
"(",
"$",
"key",
",",
"$",
"location",
",",
"$",
"caption",
"=",
"''",
",",
"$",
"geolocation",
"=",
"''",
",",
"$",
"title",
"=",
"''",
",",
"$",
"license",
"=",
"''",
")",
"{",
"/**\n * @var \\Lti\\Sitemap\\Sit... | Adding an image at a specific index in our array of SitemapUrls
@param int $key
@param $location
@param string $caption
@param string $geolocation
@param string $title
@param string $license | [
"Adding",
"an",
"image",
"at",
"a",
"specific",
"index",
"in",
"our",
"array",
"of",
"SitemapUrls"
] | b600a31ad9c1c136fa6f3d3b6a394002121d42f0 | https://github.com/linguisticteam/xml-sitemap/blob/b600a31ad9c1c136fa6f3d3b6a394002121d42f0/src/sitemap_iterator.php#L128-L138 |
195,066 | libreworks/caridea-acl | src/Service.php | Service.assert | public function assert(array $subjects, string $verb, Target $target): void
{
try {
if ($this->get($target, $subjects)->can($subjects, $verb)) {
return;
}
} catch (\Exception $ex) {
throw new Exception\Forbidden("Access denied to $verb the target",... | php | public function assert(array $subjects, string $verb, Target $target): void
{
try {
if ($this->get($target, $subjects)->can($subjects, $verb)) {
return;
}
} catch (\Exception $ex) {
throw new Exception\Forbidden("Access denied to $verb the target",... | [
"public",
"function",
"assert",
"(",
"array",
"$",
"subjects",
",",
"string",
"$",
"verb",
",",
"Target",
"$",
"target",
")",
":",
"void",
"{",
"try",
"{",
"if",
"(",
"$",
"this",
"->",
"get",
"(",
"$",
"target",
",",
"$",
"subjects",
")",
"->",
... | Asserts that one of the provided subjects can verb the Target.
@param Subject[] $subjects An array of `Subject`s
@param string $verb The verb (e.g. `read`, `create`, `delete`)
@param \Caridea\Acl\Target $target The target
@throws Exception\Forbidden if the subject cannot *verb* the Target | [
"Asserts",
"that",
"one",
"of",
"the",
"provided",
"subjects",
"can",
"verb",
"the",
"Target",
"."
] | 64ff8f2e29926acc67b9fc4a8a9ea7bcc50e4916 | https://github.com/libreworks/caridea-acl/blob/64ff8f2e29926acc67b9fc4a8a9ea7bcc50e4916/src/Service.php#L54-L64 |
195,067 | libreworks/caridea-acl | src/Service.php | Service.can | public function can(array $subjects, string $verb, Target $target): bool
{
try {
return $this->get($target, $subjects)->can($subjects, $verb);
} catch (\Exception $ex) {
// just return false below
}
return false;
} | php | public function can(array $subjects, string $verb, Target $target): bool
{
try {
return $this->get($target, $subjects)->can($subjects, $verb);
} catch (\Exception $ex) {
// just return false below
}
return false;
} | [
"public",
"function",
"can",
"(",
"array",
"$",
"subjects",
",",
"string",
"$",
"verb",
",",
"Target",
"$",
"target",
")",
":",
"bool",
"{",
"try",
"{",
"return",
"$",
"this",
"->",
"get",
"(",
"$",
"target",
",",
"$",
"subjects",
")",
"->",
"can",... | Whether any of the provided subjects has permission to verb the Target.
@param Subject[] $subjects An array of `Subject`s
@param string $verb The verb (e.g. `read`, `create`, `delete`)
@param \Caridea\Acl\Target $target The target
@return bool Whether one of the subjects can *verb* the provided Target | [
"Whether",
"any",
"of",
"the",
"provided",
"subjects",
"has",
"permission",
"to",
"verb",
"the",
"Target",
"."
] | 64ff8f2e29926acc67b9fc4a8a9ea7bcc50e4916 | https://github.com/libreworks/caridea-acl/blob/64ff8f2e29926acc67b9fc4a8a9ea7bcc50e4916/src/Service.php#L74-L82 |
195,068 | libreworks/caridea-acl | src/Service.php | Service.get | public function get(Target $target, array $subjects): Acl
{
return $this->strategy->load($target, $subjects, $this);
} | php | public function get(Target $target, array $subjects): Acl
{
return $this->strategy->load($target, $subjects, $this);
} | [
"public",
"function",
"get",
"(",
"Target",
"$",
"target",
",",
"array",
"$",
"subjects",
")",
":",
"Acl",
"{",
"return",
"$",
"this",
"->",
"strategy",
"->",
"load",
"(",
"$",
"target",
",",
"$",
"subjects",
",",
"$",
"this",
")",
";",
"}"
] | Gets an access control list for a Target.
@param Target $target The Target whose ACL will be loaded
@param Subject[] $subjects An array of `Subject`s
@return Acl The Acl found
@throws Exception\Unloadable If the target provided is invalid
@throws \InvalidArgumentException If the `subjects` argument contains invalid va... | [
"Gets",
"an",
"access",
"control",
"list",
"for",
"a",
"Target",
"."
] | 64ff8f2e29926acc67b9fc4a8a9ea7bcc50e4916 | https://github.com/libreworks/caridea-acl/blob/64ff8f2e29926acc67b9fc4a8a9ea7bcc50e4916/src/Service.php#L93-L96 |
195,069 | libreworks/caridea-acl | src/Service.php | Service.getAll | public function getAll(array $targets, array $subjects): array
{
$acls = [];
if ($this->strategy instanceof MultiStrategy) {
$acls = $this->strategy->loadAll($targets, $subjects, $this);
} else {
foreach ($targets as $target) {
$acls[(string)$target] =... | php | public function getAll(array $targets, array $subjects): array
{
$acls = [];
if ($this->strategy instanceof MultiStrategy) {
$acls = $this->strategy->loadAll($targets, $subjects, $this);
} else {
foreach ($targets as $target) {
$acls[(string)$target] =... | [
"public",
"function",
"getAll",
"(",
"array",
"$",
"targets",
",",
"array",
"$",
"subjects",
")",
":",
"array",
"{",
"$",
"acls",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"this",
"->",
"strategy",
"instanceof",
"MultiStrategy",
")",
"{",
"$",
"acls",
"=",... | Gets access control lists for several Targets.
@since 2.1.0
@param \Caridea\Acl\Target[] $targets The `Target` whose ACL will be loaded
@param \Caridea\Acl\Subject[] $subjects An array of `Subject`s
@return array<string,\Caridea\Acl\Acl> The loaded ACLs
@throws \Caridea\Acl\Exception\Unloadable If the target provided ... | [
"Gets",
"access",
"control",
"lists",
"for",
"several",
"Targets",
"."
] | 64ff8f2e29926acc67b9fc4a8a9ea7bcc50e4916 | https://github.com/libreworks/caridea-acl/blob/64ff8f2e29926acc67b9fc4a8a9ea7bcc50e4916/src/Service.php#L108-L126 |
195,070 | AnonymPHP/Anonym-Database | Pagination/Paginator.php | Paginator.render | public function render()
{
$render = new Render($this);
if ($this->getMode() === static::MODE_SIMPLE) {
return $render->simpleRende();
}else{
return $render->standartRende();
}
} | php | public function render()
{
$render = new Render($this);
if ($this->getMode() === static::MODE_SIMPLE) {
return $render->simpleRende();
}else{
return $render->standartRende();
}
} | [
"public",
"function",
"render",
"(",
")",
"{",
"$",
"render",
"=",
"new",
"Render",
"(",
"$",
"this",
")",
";",
"if",
"(",
"$",
"this",
"->",
"getMode",
"(",
")",
"===",
"static",
"::",
"MODE_SIMPLE",
")",
"{",
"return",
"$",
"render",
"->",
"simpl... | rende the pagination to string
@return string | [
"rende",
"the",
"pagination",
"to",
"string"
] | 4d034219e0e3eb2833fa53204e9f52a74a9a7e4b | https://github.com/AnonymPHP/Anonym-Database/blob/4d034219e0e3eb2833fa53204e9f52a74a9a7e4b/Pagination/Paginator.php#L148-L158 |
195,071 | AnonymPHP/Anonym-Database | Pagination/Paginator.php | Paginator.rendeToArray | public function rendeToArray(){
$render = new Render($this);
if ($this->getMode() === static::MODE_SIMPLE) {
return $render->simpleRendeArray();
}else{
return $render->standartRendeArray();
}
} | php | public function rendeToArray(){
$render = new Render($this);
if ($this->getMode() === static::MODE_SIMPLE) {
return $render->simpleRendeArray();
}else{
return $render->standartRendeArray();
}
} | [
"public",
"function",
"rendeToArray",
"(",
")",
"{",
"$",
"render",
"=",
"new",
"Render",
"(",
"$",
"this",
")",
";",
"if",
"(",
"$",
"this",
"->",
"getMode",
"(",
")",
"===",
"static",
"::",
"MODE_SIMPLE",
")",
"{",
"return",
"$",
"render",
"->",
... | rende the pagination to an array
@return array | [
"rende",
"the",
"pagination",
"to",
"an",
"array"
] | 4d034219e0e3eb2833fa53204e9f52a74a9a7e4b | https://github.com/AnonymPHP/Anonym-Database/blob/4d034219e0e3eb2833fa53204e9f52a74a9a7e4b/Pagination/Paginator.php#L165-L172 |
195,072 | phossa/phossa-di | src/Phossa/Di/Extension/Provider/ProviderExtension.php | ProviderExtension.addProvider | public function addProvider($providerOrClass)
{
// get the provider object
$prov = $this->getProviderInstance($providerOrClass);
// check added or not
$class = get_class($prov);
if (isset($this->providers[$class])) {
throw new LogicException(
Mes... | php | public function addProvider($providerOrClass)
{
// get the provider object
$prov = $this->getProviderInstance($providerOrClass);
// check added or not
$class = get_class($prov);
if (isset($this->providers[$class])) {
throw new LogicException(
Mes... | [
"public",
"function",
"addProvider",
"(",
"$",
"providerOrClass",
")",
"{",
"// get the provider object",
"$",
"prov",
"=",
"$",
"this",
"->",
"getProviderInstance",
"(",
"$",
"providerOrClass",
")",
";",
"// check added or not",
"$",
"class",
"=",
"get_class",
"(... | Add provider to the registry
@param ProviderAbstract|string $providerOrClass provider or classname
@return void
@access public
@internal | [
"Add",
"provider",
"to",
"the",
"registry"
] | bbe1e95b081068e2bc49c6cd465f38aab0374be5 | https://github.com/phossa/phossa-di/blob/bbe1e95b081068e2bc49c6cd465f38aab0374be5/src/Phossa/Di/Extension/Provider/ProviderExtension.php#L57-L77 |
195,073 | phossa/phossa-di | src/Phossa/Di/Extension/Provider/ProviderExtension.php | ProviderExtension.getProviderInstance | public function getProviderInstance($providerOrClass)
{
if (is_a($providerOrClass, ProviderAbstract::PROVIDER_CLASS, true)) {
if (!is_object($providerOrClass)) {
$providerOrClass = new $providerOrClass;
}
return $providerOrClass;
} else {
... | php | public function getProviderInstance($providerOrClass)
{
if (is_a($providerOrClass, ProviderAbstract::PROVIDER_CLASS, true)) {
if (!is_object($providerOrClass)) {
$providerOrClass = new $providerOrClass;
}
return $providerOrClass;
} else {
... | [
"public",
"function",
"getProviderInstance",
"(",
"$",
"providerOrClass",
")",
"{",
"if",
"(",
"is_a",
"(",
"$",
"providerOrClass",
",",
"ProviderAbstract",
"::",
"PROVIDER_CLASS",
",",
"true",
")",
")",
"{",
"if",
"(",
"!",
"is_object",
"(",
"$",
"providerO... | Get the provider object
@param string|ProviderAbstract $providerOrClass class or object
@return ProviderAbstract
@throws LogicException
@access protected | [
"Get",
"the",
"provider",
"object"
] | bbe1e95b081068e2bc49c6cd465f38aab0374be5 | https://github.com/phossa/phossa-di/blob/bbe1e95b081068e2bc49c6cd465f38aab0374be5/src/Phossa/Di/Extension/Provider/ProviderExtension.php#L105-L118 |
195,074 | attogram/shared-media-orm | src/Attogram/SharedMedia/Orm/Base/PageQuery.php | PageQuery.filterBySourceId | public function filterBySourceId($sourceId = null, $comparison = null)
{
if (is_array($sourceId)) {
$useMinMax = false;
if (isset($sourceId['min'])) {
$this->addUsingAlias(PageTableMap::COL_SOURCE_ID, $sourceId['min'], Criteria::GREATER_EQUAL);
$useMin... | php | public function filterBySourceId($sourceId = null, $comparison = null)
{
if (is_array($sourceId)) {
$useMinMax = false;
if (isset($sourceId['min'])) {
$this->addUsingAlias(PageTableMap::COL_SOURCE_ID, $sourceId['min'], Criteria::GREATER_EQUAL);
$useMin... | [
"public",
"function",
"filterBySourceId",
"(",
"$",
"sourceId",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"sourceId",
")",
")",
"{",
"$",
"useMinMax",
"=",
"false",
";",
"if",
"(",
"isset",
"(",
"$",... | Filter the query on the source_id column
Example usage:
<code>
$query->filterBySourceId(1234); // WHERE source_id = 1234
$query->filterBySourceId(array(12, 34)); // WHERE source_id IN (12, 34)
$query->filterBySourceId(array('min' => 12)); // WHERE source_id > 12
</code>
@see filterBySource()
@param mixed $... | [
"Filter",
"the",
"query",
"on",
"the",
"source_id",
"column"
] | 81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8 | https://github.com/attogram/shared-media-orm/blob/81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8/src/Attogram/SharedMedia/Orm/Base/PageQuery.php#L378-L399 |
195,075 | attogram/shared-media-orm | src/Attogram/SharedMedia/Orm/Base/PageQuery.php | PageQuery.filterByPageid | public function filterByPageid($pageid = null, $comparison = null)
{
if (is_array($pageid)) {
$useMinMax = false;
if (isset($pageid['min'])) {
$this->addUsingAlias(PageTableMap::COL_PAGEID, $pageid['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
... | php | public function filterByPageid($pageid = null, $comparison = null)
{
if (is_array($pageid)) {
$useMinMax = false;
if (isset($pageid['min'])) {
$this->addUsingAlias(PageTableMap::COL_PAGEID, $pageid['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
... | [
"public",
"function",
"filterByPageid",
"(",
"$",
"pageid",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"pageid",
")",
")",
"{",
"$",
"useMinMax",
"=",
"false",
";",
"if",
"(",
"isset",
"(",
"$",
"pa... | Filter the query on the pageid column
Example usage:
<code>
$query->filterByPageid(1234); // WHERE pageid = 1234
$query->filterByPageid(array(12, 34)); // WHERE pageid IN (12, 34)
$query->filterByPageid(array('min' => 12)); // WHERE pageid > 12
</code>
@param mixed $pageid The value to use as filter.
Use scalar v... | [
"Filter",
"the",
"query",
"on",
"the",
"pageid",
"column"
] | 81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8 | https://github.com/attogram/shared-media-orm/blob/81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8/src/Attogram/SharedMedia/Orm/Base/PageQuery.php#L419-L440 |
195,076 | attogram/shared-media-orm | src/Attogram/SharedMedia/Orm/Base/PageQuery.php | PageQuery.filterByDisplaytitle | public function filterByDisplaytitle($displaytitle = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($displaytitle)) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(PageTableMap::COL_DISPLAYTITLE, $displaytitle, $com... | php | public function filterByDisplaytitle($displaytitle = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($displaytitle)) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(PageTableMap::COL_DISPLAYTITLE, $displaytitle, $com... | [
"public",
"function",
"filterByDisplaytitle",
"(",
"$",
"displaytitle",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"displaytitle",
")",
")",
"{",
"... | Filter the query on the displaytitle column
Example usage:
<code>
$query->filterByDisplaytitle('fooValue'); // WHERE displaytitle = 'fooValue'
$query->filterByDisplaytitle('%fooValue%', Criteria::LIKE); // WHERE displaytitle LIKE '%fooValue%'
</code>
@param string $displaytitle The value to use as filter.
@para... | [
"Filter",
"the",
"query",
"on",
"the",
"displaytitle",
"column"
] | 81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8 | https://github.com/attogram/shared-media-orm/blob/81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8/src/Attogram/SharedMedia/Orm/Base/PageQuery.php#L481-L490 |
195,077 | attogram/shared-media-orm | src/Attogram/SharedMedia/Orm/Base/PageQuery.php | PageQuery.filterByPageImageFree | public function filterByPageImageFree($pageImageFree = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($pageImageFree)) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(PageTableMap::COL_PAGE_IMAGE_FREE, $pageImageFre... | php | public function filterByPageImageFree($pageImageFree = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($pageImageFree)) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(PageTableMap::COL_PAGE_IMAGE_FREE, $pageImageFre... | [
"public",
"function",
"filterByPageImageFree",
"(",
"$",
"pageImageFree",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"pageImageFree",
")",
")",
"{",
... | Filter the query on the page_image_free column
Example usage:
<code>
$query->filterByPageImageFree('fooValue'); // WHERE page_image_free = 'fooValue'
$query->filterByPageImageFree('%fooValue%', Criteria::LIKE); // WHERE page_image_free LIKE '%fooValue%'
</code>
@param string $pageImageFree The value to use as f... | [
"Filter",
"the",
"query",
"on",
"the",
"page_image_free",
"column"
] | 81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8 | https://github.com/attogram/shared-media-orm/blob/81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8/src/Attogram/SharedMedia/Orm/Base/PageQuery.php#L506-L515 |
195,078 | attogram/shared-media-orm | src/Attogram/SharedMedia/Orm/Base/PageQuery.php | PageQuery.filterByWikibaseItem | public function filterByWikibaseItem($wikibaseItem = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($wikibaseItem)) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(PageTableMap::COL_WIKIBASE_ITEM, $wikibaseItem, $co... | php | public function filterByWikibaseItem($wikibaseItem = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($wikibaseItem)) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(PageTableMap::COL_WIKIBASE_ITEM, $wikibaseItem, $co... | [
"public",
"function",
"filterByWikibaseItem",
"(",
"$",
"wikibaseItem",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"wikibaseItem",
")",
")",
"{",
"... | Filter the query on the wikibase_item column
Example usage:
<code>
$query->filterByWikibaseItem('fooValue'); // WHERE wikibase_item = 'fooValue'
$query->filterByWikibaseItem('%fooValue%', Criteria::LIKE); // WHERE wikibase_item LIKE '%fooValue%'
</code>
@param string $wikibaseItem The value to use as filter.
@p... | [
"Filter",
"the",
"query",
"on",
"the",
"wikibase_item",
"column"
] | 81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8 | https://github.com/attogram/shared-media-orm/blob/81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8/src/Attogram/SharedMedia/Orm/Base/PageQuery.php#L531-L540 |
195,079 | attogram/shared-media-orm | src/Attogram/SharedMedia/Orm/Base/PageQuery.php | PageQuery.filterByDisambiguation | public function filterByDisambiguation($disambiguation = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($disambiguation)) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(PageTableMap::COL_DISAMBIGUATION, $disambigua... | php | public function filterByDisambiguation($disambiguation = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($disambiguation)) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(PageTableMap::COL_DISAMBIGUATION, $disambigua... | [
"public",
"function",
"filterByDisambiguation",
"(",
"$",
"disambiguation",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"disambiguation",
")",
")",
"{... | Filter the query on the disambiguation column
Example usage:
<code>
$query->filterByDisambiguation('fooValue'); // WHERE disambiguation = 'fooValue'
$query->filterByDisambiguation('%fooValue%', Criteria::LIKE); // WHERE disambiguation LIKE '%fooValue%'
</code>
@param string $disambiguation The value to use as f... | [
"Filter",
"the",
"query",
"on",
"the",
"disambiguation",
"column"
] | 81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8 | https://github.com/attogram/shared-media-orm/blob/81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8/src/Attogram/SharedMedia/Orm/Base/PageQuery.php#L556-L565 |
195,080 | attogram/shared-media-orm | src/Attogram/SharedMedia/Orm/Base/PageQuery.php | PageQuery.filterByDefaultsort | public function filterByDefaultsort($defaultsort = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($defaultsort)) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(PageTableMap::COL_DEFAULTSORT, $defaultsort, $comparis... | php | public function filterByDefaultsort($defaultsort = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($defaultsort)) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(PageTableMap::COL_DEFAULTSORT, $defaultsort, $comparis... | [
"public",
"function",
"filterByDefaultsort",
"(",
"$",
"defaultsort",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"defaultsort",
")",
")",
"{",
"$",... | Filter the query on the defaultsort column
Example usage:
<code>
$query->filterByDefaultsort('fooValue'); // WHERE defaultsort = 'fooValue'
$query->filterByDefaultsort('%fooValue%', Criteria::LIKE); // WHERE defaultsort LIKE '%fooValue%'
</code>
@param string $defaultsort The value to use as filter.
@param ... | [
"Filter",
"the",
"query",
"on",
"the",
"defaultsort",
"column"
] | 81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8 | https://github.com/attogram/shared-media-orm/blob/81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8/src/Attogram/SharedMedia/Orm/Base/PageQuery.php#L581-L590 |
195,081 | attogram/shared-media-orm | src/Attogram/SharedMedia/Orm/Base/PageQuery.php | PageQuery.useSourceQuery | public function useSourceQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
return $this
->joinSource($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Source', '\Attogram\SharedMedia\Orm\SourceQuery');
} | php | public function useSourceQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
return $this
->joinSource($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Source', '\Attogram\SharedMedia\Orm\SourceQuery');
} | [
"public",
"function",
"useSourceQuery",
"(",
"$",
"relationAlias",
"=",
"null",
",",
"$",
"joinType",
"=",
"Criteria",
"::",
"LEFT_JOIN",
")",
"{",
"return",
"$",
"this",
"->",
"joinSource",
"(",
"$",
"relationAlias",
",",
"$",
"joinType",
")",
"->",
"useQ... | Use the Source relation Source object
@see useQuery()
@param string $relationAlias optional alias for the relation,
to be used as main alias in the secondary query
@param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
@return \Attogram\SharedMedia\Orm\SourceQuery A seconda... | [
"Use",
"the",
"Source",
"relation",
"Source",
"object"
] | 81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8 | https://github.com/attogram/shared-media-orm/blob/81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8/src/Attogram/SharedMedia/Orm/Base/PageQuery.php#L748-L753 |
195,082 | attogram/shared-media-orm | src/Attogram/SharedMedia/Orm/Base/PageQuery.php | PageQuery.filterByC2P | public function filterByC2P($c2P, $comparison = null)
{
if ($c2P instanceof \Attogram\SharedMedia\Orm\C2P) {
return $this
->addUsingAlias(PageTableMap::COL_ID, $c2P->getPageId(), $comparison);
} elseif ($c2P instanceof ObjectCollection) {
return $this
... | php | public function filterByC2P($c2P, $comparison = null)
{
if ($c2P instanceof \Attogram\SharedMedia\Orm\C2P) {
return $this
->addUsingAlias(PageTableMap::COL_ID, $c2P->getPageId(), $comparison);
} elseif ($c2P instanceof ObjectCollection) {
return $this
... | [
"public",
"function",
"filterByC2P",
"(",
"$",
"c2P",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"c2P",
"instanceof",
"\\",
"Attogram",
"\\",
"SharedMedia",
"\\",
"Orm",
"\\",
"C2P",
")",
"{",
"return",
"$",
"this",
"->",
"addUsingA... | Filter the query by a related \Attogram\SharedMedia\Orm\C2P object
@param \Attogram\SharedMedia\Orm\C2P|ObjectCollection $c2P the related object to use as filter
@param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
@return ChildPageQuery The current query, for fluid interfa... | [
"Filter",
"the",
"query",
"by",
"a",
"related",
"\\",
"Attogram",
"\\",
"SharedMedia",
"\\",
"Orm",
"\\",
"C2P",
"object"
] | 81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8 | https://github.com/attogram/shared-media-orm/blob/81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8/src/Attogram/SharedMedia/Orm/Base/PageQuery.php#L763-L776 |
195,083 | attogram/shared-media-orm | src/Attogram/SharedMedia/Orm/Base/PageQuery.php | PageQuery.useC2PQuery | public function useC2PQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinC2P($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'C2P', '\Attogram\SharedMedia\Orm\C2PQuery');
} | php | public function useC2PQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinC2P($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'C2P', '\Attogram\SharedMedia\Orm\C2PQuery');
} | [
"public",
"function",
"useC2PQuery",
"(",
"$",
"relationAlias",
"=",
"null",
",",
"$",
"joinType",
"=",
"Criteria",
"::",
"INNER_JOIN",
")",
"{",
"return",
"$",
"this",
"->",
"joinC2P",
"(",
"$",
"relationAlias",
",",
"$",
"joinType",
")",
"->",
"useQuery"... | Use the C2P relation C2P object
@see useQuery()
@param string $relationAlias optional alias for the relation,
to be used as main alias in the secondary query
@param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
@return \Attogram\SharedMedia\Orm\C2PQuery A secondary query ... | [
"Use",
"the",
"C2P",
"relation",
"C2P",
"object"
] | 81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8 | https://github.com/attogram/shared-media-orm/blob/81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8/src/Attogram/SharedMedia/Orm/Base/PageQuery.php#L821-L826 |
195,084 | attogram/shared-media-orm | src/Attogram/SharedMedia/Orm/Base/PageQuery.php | PageQuery.useM2PQuery | public function useM2PQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinM2P($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'M2P', '\Attogram\SharedMedia\Orm\M2PQuery');
} | php | public function useM2PQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinM2P($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'M2P', '\Attogram\SharedMedia\Orm\M2PQuery');
} | [
"public",
"function",
"useM2PQuery",
"(",
"$",
"relationAlias",
"=",
"null",
",",
"$",
"joinType",
"=",
"Criteria",
"::",
"INNER_JOIN",
")",
"{",
"return",
"$",
"this",
"->",
"joinM2P",
"(",
"$",
"relationAlias",
",",
"$",
"joinType",
")",
"->",
"useQuery"... | Use the M2P relation M2P object
@see useQuery()
@param string $relationAlias optional alias for the relation,
to be used as main alias in the secondary query
@param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
@return \Attogram\SharedMedia\Orm\M2PQuery A secondary query ... | [
"Use",
"the",
"M2P",
"relation",
"M2P",
"object"
] | 81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8 | https://github.com/attogram/shared-media-orm/blob/81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8/src/Attogram/SharedMedia/Orm/Base/PageQuery.php#L894-L899 |
195,085 | Kris-Kuiper/sFire-Framework | src/Cache/Driver/Filesystem.php | Filesystem.clear | public function clear() {
$files = glob(Path :: get('cache-shared') . '*');
if(true === is_array($files)) {
foreach($files as $file) {
$file = new File($file);
$file -> delete();
}
}
return $this;
} | php | public function clear() {
$files = glob(Path :: get('cache-shared') . '*');
if(true === is_array($files)) {
foreach($files as $file) {
$file = new File($file);
$file -> delete();
}
}
return $this;
} | [
"public",
"function",
"clear",
"(",
")",
"{",
"$",
"files",
"=",
"glob",
"(",
"Path",
"::",
"get",
"(",
"'cache-shared'",
")",
".",
"'*'",
")",
";",
"if",
"(",
"true",
"===",
"is_array",
"(",
"$",
"files",
")",
")",
"{",
"foreach",
"(",
"$",
"fil... | Clear all cache files
@return sFire\Cache\Filesystem | [
"Clear",
"all",
"cache",
"files"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Cache/Driver/Filesystem.php#L122-L136 |
195,086 | Kris-Kuiper/sFire-Framework | src/Cache/Driver/Filesystem.php | Filesystem.clearExpired | public function clearExpired() {
$files = glob(Path :: get('cache-shared') . '*');
if(true === is_array($files) && count($files) > 0) {
foreach($files as $file) {
$file = new File($file);
$expiration = $this -> extractExpiration($file);
if($expiration -> time <= time()) {
... | php | public function clearExpired() {
$files = glob(Path :: get('cache-shared') . '*');
if(true === is_array($files) && count($files) > 0) {
foreach($files as $file) {
$file = new File($file);
$expiration = $this -> extractExpiration($file);
if($expiration -> time <= time()) {
... | [
"public",
"function",
"clearExpired",
"(",
")",
"{",
"$",
"files",
"=",
"glob",
"(",
"Path",
"::",
"get",
"(",
"'cache-shared'",
")",
".",
"'*'",
")",
";",
"if",
"(",
"true",
"===",
"is_array",
"(",
"$",
"files",
")",
"&&",
"count",
"(",
"$",
"file... | Clear all expired cache
@return sFire\Cache\Filesystem | [
"Clear",
"all",
"expired",
"cache"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Cache/Driver/Filesystem.php#L143-L161 |
195,087 | Kris-Kuiper/sFire-Framework | src/Cache/Driver/Filesystem.php | Filesystem.generateName | private function generateName($key, $expiration = null) {
if(null !== $expiration && false === ('-' . intval($expiration) == '-' . $expiration)) {
return trigger_error(sprintf('Argument 2 passed to %s() must be of the type integer, "%s" given', __METHOD__, gettype($expiration)), E_USER_ERROR);
}
retu... | php | private function generateName($key, $expiration = null) {
if(null !== $expiration && false === ('-' . intval($expiration) == '-' . $expiration)) {
return trigger_error(sprintf('Argument 2 passed to %s() must be of the type integer, "%s" given', __METHOD__, gettype($expiration)), E_USER_ERROR);
}
retu... | [
"private",
"function",
"generateName",
"(",
"$",
"key",
",",
"$",
"expiration",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"expiration",
"&&",
"false",
"===",
"(",
"'-'",
".",
"intval",
"(",
"$",
"expiration",
")",
"==",
"'-'",
".",
"$",
... | Generates the cache file name
@param mixed $key
@param int $expiration
@return string | [
"Generates",
"the",
"cache",
"file",
"name"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Cache/Driver/Filesystem.php#L222-L229 |
195,088 | Kris-Kuiper/sFire-Framework | src/Cache/Driver/Filesystem.php | Filesystem.extractExpiration | private function extractExpiration(File $file) {
$expiration = explode('-', $file -> entity() -> getName());
if(count($expiration) > 2) {
return (object) ['time' => $expiration[2], 'expiration' => $expiration[1]];
}
return (object) ['time' => 0, 'expiration' => 0];
} | php | private function extractExpiration(File $file) {
$expiration = explode('-', $file -> entity() -> getName());
if(count($expiration) > 2) {
return (object) ['time' => $expiration[2], 'expiration' => $expiration[1]];
}
return (object) ['time' => 0, 'expiration' => 0];
} | [
"private",
"function",
"extractExpiration",
"(",
"File",
"$",
"file",
")",
"{",
"$",
"expiration",
"=",
"explode",
"(",
"'-'",
",",
"$",
"file",
"->",
"entity",
"(",
")",
"->",
"getName",
"(",
")",
")",
";",
"if",
"(",
"count",
"(",
"$",
"expiration"... | Returns the expiration time of cache file
@param sFire\System\File $file
@return object | [
"Returns",
"the",
"expiration",
"time",
"of",
"cache",
"file"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Cache/Driver/Filesystem.php#L237-L246 |
195,089 | eureka-framework/component-orm | src/Orm/Type/Factory.php | Factory.create | public static function create($sqlType)
{
$matches = array();
if (!(bool) preg_match('`([a-z]+)\(?([0-9]*)\)? ?(.*)`', $sqlType, $matches)) {
throw new \Exception();
}
$type = (string) $matches[1];
$display = (int) $matches[2];
$other = (string) $ma... | php | public static function create($sqlType)
{
$matches = array();
if (!(bool) preg_match('`([a-z]+)\(?([0-9]*)\)? ?(.*)`', $sqlType, $matches)) {
throw new \Exception();
}
$type = (string) $matches[1];
$display = (int) $matches[2];
$other = (string) $ma... | [
"public",
"static",
"function",
"create",
"(",
"$",
"sqlType",
")",
"{",
"$",
"matches",
"=",
"array",
"(",
")",
";",
"if",
"(",
"!",
"(",
"bool",
")",
"preg_match",
"(",
"'`([a-z]+)\\(?([0-9]*)\\)? ?(.*)`'",
",",
"$",
"sqlType",
",",
"$",
"matches",
")"... | Instantiate new type.
@param string $sqlType
@return TypeInterface
@throws \RangeException
@throws \Exception | [
"Instantiate",
"new",
"type",
"."
] | bce48121d26c4e923534f9dc70da597634184316 | https://github.com/eureka-framework/component-orm/blob/bce48121d26c4e923534f9dc70da597634184316/src/Orm/Type/Factory.php#L27-L67 |
195,090 | mattferris/configuration | src/Configuration.php | Configuration.& | protected function &resolveKey($key)
{
// check if the key is a compound key
if (strpos($key, '.') !== false) {
// key is compound, so split it into parts
$parts = explode('.', $key);
$config = &$this->config;
// recurse into the config array using t... | php | protected function &resolveKey($key)
{
// check if the key is a compound key
if (strpos($key, '.') !== false) {
// key is compound, so split it into parts
$parts = explode('.', $key);
$config = &$this->config;
// recurse into the config array using t... | [
"protected",
"function",
"&",
"resolveKey",
"(",
"$",
"key",
")",
"{",
"// check if the key is a compound key",
"if",
"(",
"strpos",
"(",
"$",
"key",
",",
"'.'",
")",
"!==",
"false",
")",
"{",
"// key is compound, so split it into parts",
"$",
"parts",
"=",
"exp... | Resolve a key to it's value.
@param string $key The key to resolve
@return A reference to the key's value
@throws KeyDoesNotExistException If the key doesn't exist | [
"Resolve",
"a",
"key",
"to",
"it",
"s",
"value",
"."
] | 28985400060959744922a0657ffb2e1751d7f6bb | https://github.com/mattferris/configuration/blob/28985400060959744922a0657ffb2e1751d7f6bb/src/Configuration.php#L162-L195 |
195,091 | mattferris/configuration | src/Configuration.php | Configuration.getParentChildKeys | protected function getParentChildKeys($key)
{
$parts = explode('.', $key);
$child = array_pop($parts);
return [implode('.', $parts), $child];
} | php | protected function getParentChildKeys($key)
{
$parts = explode('.', $key);
$child = array_pop($parts);
return [implode('.', $parts), $child];
} | [
"protected",
"function",
"getParentChildKeys",
"(",
"$",
"key",
")",
"{",
"$",
"parts",
"=",
"explode",
"(",
"'.'",
",",
"$",
"key",
")",
";",
"$",
"child",
"=",
"array_pop",
"(",
"$",
"parts",
")",
";",
"return",
"[",
"implode",
"(",
"'.'",
",",
"... | Get the parent key, and the child part of the key.
@param string $key The key to get the parent and child part from
@return array The parent and child part | [
"Get",
"the",
"parent",
"key",
"and",
"the",
"child",
"part",
"of",
"the",
"key",
"."
] | 28985400060959744922a0657ffb2e1751d7f6bb | https://github.com/mattferris/configuration/blob/28985400060959744922a0657ffb2e1751d7f6bb/src/Configuration.php#L203-L208 |
195,092 | mattferris/configuration | src/Configuration.php | Configuration.merge | protected function merge($key, $result)
{
if (is_null($key)) {
// key is null, so just merge with root
$this->config = array_merge($this->config, $result);
} elseif (strpos($key, '.') === false) {
// non-compound key, just merge key with incoming data
... | php | protected function merge($key, $result)
{
if (is_null($key)) {
// key is null, so just merge with root
$this->config = array_merge($this->config, $result);
} elseif (strpos($key, '.') === false) {
// non-compound key, just merge key with incoming data
... | [
"protected",
"function",
"merge",
"(",
"$",
"key",
",",
"$",
"result",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"key",
")",
")",
"{",
"// key is null, so just merge with root",
"$",
"this",
"->",
"config",
"=",
"array_merge",
"(",
"$",
"this",
"->",
"co... | Merge values into a key.
@param string $key The key to merge into
@param mixed $result The data to merge
@throws KeyDoesNotExistException If the key doesn't exist | [
"Merge",
"values",
"into",
"a",
"key",
"."
] | 28985400060959744922a0657ffb2e1751d7f6bb | https://github.com/mattferris/configuration/blob/28985400060959744922a0657ffb2e1751d7f6bb/src/Configuration.php#L217-L246 |
195,093 | Kris-Kuiper/sFire-Framework | src/DB/Driver/MySQLi/Entity.php | Entity.setTable | public function setTable($table) {
if(false === is_string($table)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($table)), E_USER_ERROR);
}
$this -> table = $table;
return $this;
} | php | public function setTable($table) {
if(false === is_string($table)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($table)), E_USER_ERROR);
}
$this -> table = $table;
return $this;
} | [
"public",
"function",
"setTable",
"(",
"$",
"table",
")",
"{",
"if",
"(",
"false",
"===",
"is_string",
"(",
"$",
"table",
")",
")",
"{",
"return",
"trigger_error",
"(",
"sprintf",
"(",
"'Argument 1 passed to %s() must be of the type string, \"%s\" given'",
",",
"_... | Set the current table
@param string $table
@return $this | [
"Set",
"the",
"current",
"table"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/DB/Driver/MySQLi/Entity.php#L117-L126 |
195,094 | Kris-Kuiper/sFire-Framework | src/DB/Driver/MySQLi/Entity.php | Entity.getTable | public function getTable() {
if(null === $this -> table) {
$path = $this -> getNamespace($this, ['directory', 'entity'], ['directory', 'entity']) . Application :: get(['prefix', 'entity']);
$path = str_replace(DIRECTORY_SEPARATOR, '\\', $path);
$class = new \ReflectionClass(get_class($this));
... | php | public function getTable() {
if(null === $this -> table) {
$path = $this -> getNamespace($this, ['directory', 'entity'], ['directory', 'entity']) . Application :: get(['prefix', 'entity']);
$path = str_replace(DIRECTORY_SEPARATOR, '\\', $path);
$class = new \ReflectionClass(get_class($this));
... | [
"public",
"function",
"getTable",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"table",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"getNamespace",
"(",
"$",
"this",
",",
"[",
"'directory'",
",",
"'entity'",
"]",
",",
"[",
"'direc... | Returns the table from current namespace or from table variable if set
@return string | [
"Returns",
"the",
"table",
"from",
"current",
"namespace",
"or",
"from",
"table",
"variable",
"if",
"set"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/DB/Driver/MySQLi/Entity.php#L133-L145 |
195,095 | Kris-Kuiper/sFire-Framework | src/DB/Driver/MySQLi/Entity.php | Entity.setDateFormat | public function setDateFormat($formats) {
if(false === is_array($formats)) {
$formats = [$formats];
}
$this -> date_formats = $formats;
return $this;
} | php | public function setDateFormat($formats) {
if(false === is_array($formats)) {
$formats = [$formats];
}
$this -> date_formats = $formats;
return $this;
} | [
"public",
"function",
"setDateFormat",
"(",
"$",
"formats",
")",
"{",
"if",
"(",
"false",
"===",
"is_array",
"(",
"$",
"formats",
")",
")",
"{",
"$",
"formats",
"=",
"[",
"$",
"formats",
"]",
";",
"}",
"$",
"this",
"->",
"date_formats",
"=",
"$",
"... | Adds a string or array of date formats so selected dates which matches the formats will be converted automatically to Date Objects
@param array|string $formats
@return $this | [
"Adds",
"a",
"string",
"or",
"array",
"of",
"date",
"formats",
"so",
"selected",
"dates",
"which",
"matches",
"the",
"formats",
"will",
"be",
"converted",
"automatically",
"to",
"Date",
"Objects"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/DB/Driver/MySQLi/Entity.php#L153-L162 |
195,096 | Kris-Kuiper/sFire-Framework | src/DB/Driver/MySQLi/Entity.php | Entity.convertToJson | public function convertToJson($convert = true) {
if(false === is_bool($convert)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type Boolean, "%s" given', __METHOD__, gettype($convert)), E_USER_ERROR);
}
$this -> convert_json = $convert;
return $this;
} | php | public function convertToJson($convert = true) {
if(false === is_bool($convert)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type Boolean, "%s" given', __METHOD__, gettype($convert)), E_USER_ERROR);
}
$this -> convert_json = $convert;
return $this;
} | [
"public",
"function",
"convertToJson",
"(",
"$",
"convert",
"=",
"true",
")",
"{",
"if",
"(",
"false",
"===",
"is_bool",
"(",
"$",
"convert",
")",
")",
"{",
"return",
"trigger_error",
"(",
"sprintf",
"(",
"'Argument 1 passed to %s() must be of the type Boolean, \"... | Columns containing valid JSON will be converted to Array's automatically
@param boolean $convert
@return $this | [
"Columns",
"containing",
"valid",
"JSON",
"will",
"be",
"converted",
"to",
"Array",
"s",
"automatically"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/DB/Driver/MySQLi/Entity.php#L170-L179 |
195,097 | Kris-Kuiper/sFire-Framework | src/DB/Driver/MySQLi/Entity.php | Entity.fromArray | public function fromArray($data) {
if(false === is_array($data)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type Array, "%s" given', __METHOD__, gettype($data)), E_USER_ERROR);
}
$this -> beforeLoad();
foreach($data as $column => $value) {
$value = $this -> ... | php | public function fromArray($data) {
if(false === is_array($data)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type Array, "%s" given', __METHOD__, gettype($data)), E_USER_ERROR);
}
$this -> beforeLoad();
foreach($data as $column => $value) {
$value = $this -> ... | [
"public",
"function",
"fromArray",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"false",
"===",
"is_array",
"(",
"$",
"data",
")",
")",
"{",
"return",
"trigger_error",
"(",
"sprintf",
"(",
"'Argument 1 passed to %s() must be of the type Array, \"%s\" given'",
",",
"__ME... | Converts given array to entity data
@param array $data
@return $this | [
"Converts",
"given",
"array",
"to",
"entity",
"data"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/DB/Driver/MySQLi/Entity.php#L187-L213 |
195,098 | Kris-Kuiper/sFire-Framework | src/DB/Driver/MySQLi/Entity.php | Entity.toArray | public function toArray() {
$class = new \ReflectionClass($this);
$props = $class -> getProperties();
$data = [];
foreach($props as $prop) {
if($class -> name === $prop -> class) {
if(true === isset($this -> {$prop -> name})) {
$data[$prop -> name] = $this -> {$prop -> name};
}
... | php | public function toArray() {
$class = new \ReflectionClass($this);
$props = $class -> getProperties();
$data = [];
foreach($props as $prop) {
if($class -> name === $prop -> class) {
if(true === isset($this -> {$prop -> name})) {
$data[$prop -> name] = $this -> {$prop -> name};
}
... | [
"public",
"function",
"toArray",
"(",
")",
"{",
"$",
"class",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"$",
"this",
")",
";",
"$",
"props",
"=",
"$",
"class",
"->",
"getProperties",
"(",
")",
";",
"$",
"data",
"=",
"[",
"]",
";",
"foreach",
"(",
... | Returns all variables to a single Array
@return array | [
"Returns",
"all",
"variables",
"to",
"a",
"single",
"Array"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/DB/Driver/MySQLi/Entity.php#L220-L241 |
195,099 | Kris-Kuiper/sFire-Framework | src/DB/Driver/MySQLi/Entity.php | Entity.setIdentifier | public function setIdentifier($identifier) {
if(false === is_array($identifier)) {
$identifier = [$identifier];
}
$this -> identifier = $identifier;
} | php | public function setIdentifier($identifier) {
if(false === is_array($identifier)) {
$identifier = [$identifier];
}
$this -> identifier = $identifier;
} | [
"public",
"function",
"setIdentifier",
"(",
"$",
"identifier",
")",
"{",
"if",
"(",
"false",
"===",
"is_array",
"(",
"$",
"identifier",
")",
")",
"{",
"$",
"identifier",
"=",
"[",
"$",
"identifier",
"]",
";",
"}",
"$",
"this",
"->",
"identifier",
"=",
... | Sets the identifier
@param string|array $identifier | [
"Sets",
"the",
"identifier"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/DB/Driver/MySQLi/Entity.php#L275-L282 |
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.